/* ============================================================
   OptiCount PHP Edition — shared styles (flat-file stack)
   Design language: shadcn/ui "new york" (v2 look) — zinc palette,
   white surfaces, dark primary buttons, inline SVG icons only.
   ============================================================ */

:root {
  --bg: #fafafa;
  --surface: #ffffff;
  --border: #e4e4e7;
  --border-strong: #d4d4d8;
  --text: #09090b;
  --muted: #71717a;
  --faint: #a1a1aa;
  --primary: #18181b;
  --primary-hover: #2f2f37;
  --accent: #16a34a;            /* semantic success */
  --accent-soft: #f0fdf4;
  --accent-border: #bbf7d0;
  --amber: #b45309;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;
  --red: #dc2626;
  --red-soft: #fef2f2;
  --red-border: #fecaca;
  --ring: rgba(24, 24, 27, .14);
  --radius: 10px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, .1), 0 4px 6px -4px rgba(0, 0, 0, .06);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
body.oc-page { min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; width: 100%; }
footer.app-footer {
  flex-shrink: 0;
  margin-top: auto;
  padding: 13px 16px calc(13px + env(safe-area-inset-bottom, 0));
  text-align: center;
  color: var(--faint);
  font-size: 12px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
h1, h2, h3 { margin: 0; font-weight: 600; letter-spacing: -.015em; }
a { color: inherit; text-decoration: none; }
a:hover { text-decoration: none; }
::selection { background: #e4e4e7; }

/* ---------- inline SVG icons ---------- */
.ic { display: inline-flex; flex: none; align-items: center; justify-content: center; vertical-align: middle; line-height: 0; }
.ic svg { display: block; }
.btn .ic svg { flex: none; }

/* ---------- layout ---------- */
.container { max-width: 1100px; margin: 0 auto; padding: 0 16px; width: 100%; }
.narrow { max-width: 520px; }
.row { display: flex; align-items: center; gap: 10px; }
.row-wrap { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spread { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.grid { display: grid; gap: 14px; }
.grid > * { min-width: 0; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
@media (max-width: 720px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 480px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
.mt-1 { margin-top: 4px; } .mt-2 { margin-top: 8px; } .mt-3 { margin-top: 14px; } .mt-4 { margin-top: 22px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 14px; }
.right { text-align: right; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.small { font-size: 12.5px; }
.tiny { font-size: 11.5px; }
.mono { font-family: var(--mono); font-size: 12.5px; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hidden { display: none !important; }

/* ---------- header ---------- */
.app-header {
  background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  color: var(--text);
  flex-shrink: 0;
  position: sticky; top: 0; z-index: 50;
}
.app-header .inner {
  display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap;
  min-height: 54px; padding: 8px 16px; max-width: 1100px; margin: 0 auto; width: 100%;
}
.wordmark { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 16px; letter-spacing: -.02em; text-decoration: none; }
.wordmark:hover { text-decoration: none; }
.wordmark .logo {
  width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 800;
  box-shadow: var(--shadow);
}
.wordmark .logo .ic svg { width: 17px; height: 17px; }
.header-user { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--muted); min-width: 0; flex-wrap: wrap; }
.header-user b { color: var(--text); font-weight: 600; }
.header-user a { color: var(--muted); font-size: 12.5px; white-space: nowrap; }
.header-user a:hover { color: var(--text); }

/* ---------- tabs ---------- */
.tabs {
  display: flex; gap: 2px; overflow-x: auto; background: rgba(255, 255, 255, .94);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border); padding: 0 8px; position: sticky; top: 55px; z-index: 40;
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tabs button {
  appearance: none; border: 0; background: none; padding: 11px 13px; font-size: 13.5px; font-weight: 500;
  color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap;
  font-family: var(--font); min-height: 44px; display: inline-flex; align-items: center; gap: 7px;
}
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--text); font-weight: 600; border-bottom-color: var(--primary); }
.tabs button .ic svg { width: 15px; height: 15px; }

/* ---------- cards ---------- */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px;
}
.card-title { font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title .ic svg { width: 16px; height: 16px; color: var(--muted); }
.card-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; font-weight: 400; }
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; margin-bottom: 12px; flex-wrap: wrap; }

/* ---------- stats ---------- */
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; box-shadow: var(--shadow); }
.stat .k { font-size: 25px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.stat .l { font-size: 11.5px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 3px; font-weight: 500; }

/* ---------- buttons ---------- */
.btn {
  appearance: none; display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  border-radius: 8px; border: 1px solid transparent; cursor: pointer; font-family: var(--font);
  font-size: 13.5px; font-weight: 500; padding: 0 15px; min-height: 40px; text-decoration: none;
  transition: background .12s, border-color .12s, color .12s, box-shadow .12s; user-select: none; white-space: nowrap;
}
.btn:hover { text-decoration: none; }
.btn:focus-visible, .input:focus-visible, .select:focus-visible, textarea.input:focus-visible { outline: none; box-shadow: 0 0 0 3px var(--ring); }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-primary, .btn-accent { background: var(--primary); color: #fafafa; box-shadow: var(--shadow); }
.btn-primary:hover:not(:disabled), .btn-accent:hover:not(:disabled) { background: var(--primary-hover); }
.btn-outline { background: var(--surface); color: var(--text); border-color: var(--border-strong); box-shadow: var(--shadow); }
.btn-outline:hover:not(:disabled) { background: #f4f4f5; }
.btn-ghost { background: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { background: #f4f4f5; color: var(--text); }
.btn-danger { background: var(--red); color: #fff; box-shadow: var(--shadow); }
.btn-danger:hover:not(:disabled) { background: #b91c1c; }
.btn-danger-outline { background: var(--surface); color: var(--red); border-color: var(--red-border); }
.btn-danger-outline:hover:not(:disabled) { background: var(--red-soft); }
.btn-sm { min-height: 32px; padding: 0 11px; font-size: 12.5px; border-radius: 7px; }
.btn-lg { min-height: 46px; font-size: 14.5px; padding: 0 20px; border-radius: 9px; }
.btn-block { width: 100%; }
.btn-icon { min-width: 40px; padding: 0; }

/* ---------- forms ---------- */
.input, .select, textarea.input {
  width: 100%; border: 1px solid var(--border-strong); border-radius: 8px; background: var(--surface);
  font-size: 14px; font-family: var(--font); color: var(--text); padding: 9px 12px; min-height: 40px;
  outline: none; transition: border-color .12s, box-shadow .12s;
}
.input:focus, .select:focus, textarea.input:focus { border-color: var(--faint); box-shadow: 0 0 0 3px var(--ring); }
.input::placeholder, textarea.input::placeholder { color: var(--faint); }
textarea.input { resize: vertical; min-height: 66px; line-height: 1.45; }
.field { margin-bottom: 13px; }
.field > label { display: block; font-size: 13px; font-weight: 500; color: var(--text); margin-bottom: 6px; }
.form-error { color: var(--red); font-size: 12.5px; margin-top: 5px; }
.check-row { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: 13.5px; min-height: 40px; }
.check-row input[type="checkbox"], .check-row input[type="radio"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* toggle switch */
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
  position: absolute; inset: 0; border-radius: 999px; background: #d4d4d8; transition: background .15s; cursor: pointer;
}
.switch .track::before {
  content: ""; position: absolute; width: 18px; height: 18px; border-radius: 50%; background: #fff;
  top: 2px; left: 2px; transition: transform .15s; box-shadow: 0 1px 2px rgba(0,0,0,.2);
}
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::before { transform: translateX(18px); }
.switch input:disabled + .track { opacity: .5; cursor: not-allowed; }

/* ---------- badges & chips ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px; border-radius: 999px; font-size: 11px;
  font-weight: 600; padding: 2.5px 9px; border: 1px solid transparent; white-space: nowrap;
}
.badge .ic svg { width: 11px; height: 11px; }
.badge-gray { background: #f4f4f5; color: #52525b; border-color: #e4e4e7; }
.badge-green { background: var(--accent-soft); color: #15803d; border-color: var(--accent-border); }
.badge-amber { background: var(--amber-soft); color: var(--amber); border-color: var(--amber-border); }
.badge-red { background: var(--red-soft); color: #b91c1c; border-color: var(--red-border); }
.badge-dark { background: var(--primary); color: #fafafa; }

/* ---------- tables ---------- */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow: auto; max-height: 65vh; box-shadow: var(--shadow); }
table.oc { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.oc th {
  text-align: left; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted);
  background: #fafafa; padding: 10px 12px; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 2;
  font-weight: 600;
}
table.oc td { padding: 10px 12px; border-bottom: 1px solid #f0f0f1; vertical-align: middle; }
table.oc tr:last-child td { border-bottom: 0; }
table.oc tbody tr:hover { background: #fafafa; }
table.oc tr.clickable { cursor: pointer; }

/* ---------- lists ---------- */
.divided { list-style: none; margin: 0; padding: 0; }
.divided li { padding: 10px 2px; border-bottom: 1px solid #f0f0f1; min-width: 0; overflow-wrap: anywhere; }
.divided li:last-child { border-bottom: 0; }

/* scrollbars */
.oc-scroll::-webkit-scrollbar { width: 8px; height: 8px; }
.oc-scroll::-webkit-scrollbar-thumb { background: #d4d4d8; border-radius: 8px; }
.oc-scroll::-webkit-scrollbar-track { background: transparent; }

/* ---------- toasts ---------- */
#oc-toasts { position: fixed; right: 14px; bottom: calc(14px + env(safe-area-inset-bottom, 0)); z-index: 1000; display: flex; flex-direction: column-reverse; gap: 8px; max-width: min(92vw, 380px); }
.toast {
  background: var(--surface); color: var(--text); border: 1px solid var(--border); border-radius: 10px;
  padding: 11px 14px 11px 12px; font-size: 13px; box-shadow: var(--shadow-lg);
  animation: toast-in .18s ease-out; display: flex; gap: 9px; align-items: flex-start; line-height: 1.4;
}
.toast::before { content: ""; flex: none; width: 7px; align-self: stretch; min-height: 14px; border-radius: 4px; background: var(--muted); }
.toast.ok::before { background: var(--accent); }
.toast.err::before { background: var(--red); }
.toast.warn::before { background: #d97706; }
@keyframes toast-in { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- modal ---------- */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(9, 9, 11, .55); z-index: 900;
  display: flex; align-items: flex-end; justify-content: center; padding: 0;
}
@media (min-width: 640px) { .modal-overlay { align-items: center; padding: 20px; } }
.modal {
  background: var(--surface); border-radius: 16px 16px 0 0; width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow-lg); padding: 20px;
  animation: sheet-up .18s ease-out;
}
@media (min-width: 640px) { .modal { border-radius: 12px; } }
@keyframes sheet-up { from { transform: translateY(24px); opacity: .6; } to { transform: none; opacity: 1; } }
.modal h3 { font-size: 16px; margin-bottom: 4px; }
.modal .modal-sub { color: var(--muted); font-size: 13px; margin: 0 0 14px; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px; flex-wrap: wrap; }

/* ---------- misc ---------- */
.empty { text-align: center; color: var(--muted); padding: 28px 12px; font-size: 13.5px; }
.empty .big { color: #c9c9cf; margin-bottom: 8px; line-height: 0; }
.empty .big svg { width: 30px; height: 30px; }
.spinner {
  width: 17px; height: 17px; border: 2px solid var(--border-strong); border-top-color: var(--primary);
  border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: -4px;
}
@keyframes spin { to { transform: rotate(360deg); } }
.alert { border-radius: 9px; padding: 11px 13px; font-size: 13.5px; border: 1px solid; display: flex; gap: 9px; align-items: flex-start; }
.alert .ic { margin-top: 1px; }
.alert-amber { background: var(--amber-soft); border-color: var(--amber-border); color: var(--amber); }
.alert-red { background: var(--red-soft); border-color: var(--red-border); color: #991b1b; }
.alert-green { background: var(--accent-soft); border-color: var(--accent-border); color: #166534; }
.alert .ic svg { width: 16px; height: 16px; }
kbd { background: #f4f4f5; border: 1px solid var(--border); border-bottom-width: 2px; border-radius: 5px; padding: 1px 6px; font-size: 11px; font-family: var(--mono); }
.section-label { font-size: 11px; text-transform: uppercase; letter-spacing: .07em; color: var(--faint); font-weight: 600; margin: 16px 0 8px; }
.hr { border: 0; border-top: 1px solid var(--border); margin: 14px 0; }
.photo-thumb { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; display: block; background: #f4f4f5; }
.shake { animation: shake .3s; }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-5px); } 75% { transform: translateX(5px); } }
.flash-green { animation: flashg .6s; }
@keyframes flashg { 0% { background: #dcfce7; } 100% { background: transparent; } }

/* ---------- login page ---------- */
.login-hero { text-align: center; padding: 44px 0 10px; }
.login-hero .logo-big {
  width: 56px; height: 56px; border-radius: 14px; background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg); margin-bottom: 14px;
}
.login-hero .logo-big svg { width: 30px; height: 30px; }
.login-hero h1 { font-size: 23px; }
.login-hero p { color: var(--muted); margin: 6px 0 0; font-size: 14px; }
.seg { display: flex; background: #f4f4f5; border-radius: 9px; padding: 4px; gap: 4px; margin-bottom: 16px; }
.seg button {
  flex: 1; border: 0; background: transparent; border-radius: 7px; padding: 8px 6px; min-height: 40px;
  font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; font-family: var(--font);
}
.seg button.active { background: var(--surface); color: var(--text); box-shadow: var(--shadow); font-weight: 600; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin-top: 26px; }
.feature { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; box-shadow: var(--shadow); font-size: 12.5px; color: var(--muted); display: flex; gap: 10px; align-items: flex-start; }
.feature b { display: block; color: var(--text); font-size: 13px; margin-bottom: 2px; }
.feature .ic { margin-top: 1px; color: var(--muted); }
.feature .ic svg { width: 16px; height: 16px; }

/* ---------- count page ---------- */
.search-wrap { position: relative; min-width: 0; }
.search-wrap .input { min-height: 50px; font-size: 16px; padding-left: 14px; padding-right: 96px; font-weight: 500; }
.search-clear {
  position: absolute; right: 52px; top: 50%; transform: translateY(-50%); border: 0; background: none;
  color: var(--faint); cursor: pointer; width: 40px; height: 40px; border-radius: 8px;
  display: inline-flex; align-items: center; justify-content: center;
}
.search-clear:hover { color: var(--text); background: #f4f4f5; }
.search-clear svg { width: 16px; height: 16px; }
.mic-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%); width: 40px; height: 40px;
  border-radius: 8px; border: 0; background: #f4f4f5; color: var(--muted); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.mic-btn svg { width: 17px; height: 17px; }
.mic-btn:hover { background: #e4e4e7; color: var(--text); }
.mic-btn.rec { background: var(--red); color: #fff; animation: pulse 1.2s infinite; }
.mic-btn.off { opacity: .4; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(220,38,38,.35); } 50% { box-shadow: 0 0 0 7px rgba(220,38,38,0); } }
.results { border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); overflow-y: auto; box-shadow: var(--shadow-lg); }
.result-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-bottom: 1px solid #f0f0f1; cursor: pointer;
}
.result-row:last-child { border-bottom: 0; }
.result-row:hover, .result-row.hl { background: #fafafa; }
.result-row .code { font-family: var(--mono); font-size: 13px; font-weight: 600; min-width: 110px; }
.result-row .desc { flex: 1; font-size: 13px; color: var(--muted); min-width: 0; }
.add-btn {
  width: 38px; height: 38px; border-radius: 8px; border: 0; background: var(--primary); color: #fafafa;
  cursor: pointer; flex-shrink: 0; line-height: 0; display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s, transform .08s;
}
.add-btn svg { width: 17px; height: 17px; }
.add-btn:hover { background: var(--primary-hover); }
.add-btn:active { transform: scale(.94); }
.count-chip {
  flex: none; display: inline-flex; align-items: center; justify-content: center; min-width: 30px; height: 24px;
  padding: 0 8px; border-radius: 999px; background: var(--accent-soft); border: 1px solid var(--accent-border);
  color: #15803d; font-size: 11.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.qty-stepper { display: inline-flex; align-items: center; gap: 2px; }
.qty-stepper button {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--border-strong); background: var(--surface);
  cursor: pointer; color: var(--text); line-height: 0; display: inline-flex; align-items: center; justify-content: center;
}
.qty-stepper button svg { width: 14px; height: 14px; }
.qty-stepper button:hover { background: #f4f4f5; }
.qty-stepper .qty { min-width: 34px; text-align: center; font-weight: 600; font-size: 14.5px; font-variant-numeric: tabular-nums; }
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.cat-tabs button {
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--muted); border-radius: 999px;
  padding: 6px 14px; font-size: 13px; font-weight: 500; cursor: pointer; font-family: var(--font); min-height: 36px;
  display: inline-flex; align-items: center; gap: 7px;
}
.cat-tabs button:hover { color: var(--text); }
.cat-tabs button.active { background: var(--primary); border-color: var(--primary); color: #fafafa; }
.cat-tabs button .badge { font-weight: 600; }
.sticky-bar {
  position: sticky; bottom: 0; z-index: 30; background: rgba(255, 255, 255, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--border);
  padding: 10px 16px calc(10px + env(safe-area-inset-bottom, 0)); box-shadow: 0 -4px 16px rgba(0,0,0,.06);
}
.gps-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; border-radius: 999px; padding: 4px 11px; }
.gps-chip .ic svg { width: 12.5px; height: 12.5px; }
.gps-ok { background: var(--accent-soft); color: #15803d; border: 1px solid var(--accent-border); }
.gps-weak { background: var(--amber-soft); color: var(--amber); border: 1px solid var(--amber-border); }
.gps-off { background: #f4f4f5; color: var(--muted); border: 1px solid var(--border); }
.gps-err { background: var(--red-soft); color: #b91c1c; border: 1px solid var(--red-border); }
.birthday-banner {
  background: var(--amber-soft); border: 1px solid var(--amber-border); color: var(--amber);
  border-radius: 9px; padding: 8px 12px; font-size: 13px; margin-bottom: 10px;
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
}
.birthday-banner .ic svg { width: 15px; height: 15px; }

/* camera dialog */
.camera-stage { background: #09090b; border-radius: 10px; overflow: hidden; position: relative; aspect-ratio: 4 / 3; }
.camera-stage video, .camera-stage img.preview { width: 100%; height: 100%; object-fit: cover; display: block; }
.camera-stage .camera-off {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  color: #a1a1aa; gap: 10px; font-size: 13px; text-align: center; padding: 18px;
}
.camera-stage .camera-off svg { width: 26px; height: 26px; }
.camera-actions { display: flex; align-items: center; justify-content: center; gap: 9px; margin-top: 12px; flex-wrap: wrap; }

/* detail media */
.lightbox-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.78); z-index: 950; display: flex; align-items: center; justify-content: center; padding: 20px; cursor: zoom-out; }
.lightbox-overlay img { max-width: 100%; max-height: 92vh; border-radius: 10px; }

/* map link chip */
.map-link { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; font-weight: 500; color: var(--text); }
.map-link .ic svg { width: 13px; height: 13px; color: var(--muted); }
.map-link:hover .ic svg { color: var(--text); }

/* ---------- user guide ---------- */
.guide-toc { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.guide-toc a {
  display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 500; color: var(--muted);
  border: 1px solid var(--border); background: var(--surface); padding: 6px 12px; border-radius: 999px; box-shadow: var(--shadow);
}
.guide-toc a:hover { color: var(--text); background: #f4f4f5; }
.guide-toc a .ic svg { width: 13px; height: 13px; }
.guide-section { scroll-margin-top: 120px; }
.guide-step { display: flex; gap: 13px; padding: 12px 0; border-bottom: 1px solid #f0f0f1; }
.guide-step:last-child { border-bottom: none; }
.guide-step .step-num {
  flex: none; width: 26px; height: 26px; border-radius: 50%; background: var(--primary); color: #fafafa;
  display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 600; margin-top: 1px;
}
.guide-step .step-body { flex: 1; min-width: 0; }
.guide-step .step-title { font-weight: 600; font-size: 13.5px; margin-bottom: 2px; }
.guide-step .step-text { color: var(--muted); font-size: 13px; }
.guide-step .step-text b { color: var(--text); font-weight: 600; }

@media print { .app-header, .tabs, footer.app-footer, .btn, .sticky-bar { display: none !important; } body { background: #fff; } .card { box-shadow: none; } }
