/* bins — minimal mobile-first stylesheet */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --font-display: "Black Ops One", system-ui;
  --bg: #f8f7f4;
  --surface: #fff;
  --border: #e2e0db;
  --text: #1a1917;
  --muted: #7a786f;
  --accent: #2a6ef5;
  --accent-hover: #1d5cde;
  --danger: #d9362b;
  --radius: 8px;
  --shadow: 0 1px 3px rgba(0,0,0,.08);
  --header-h: 56px;
}

html { font-size: 16px; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  min-height: 100dvh;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 100;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 12px;
  padding: 0 16px;
}
.logo { font-family: var(--font-display); font-weight: 400; font-size: 1.4rem; text-decoration: none; color: var(--text); letter-spacing: .03em; }
.search-bar { flex: 1; position: relative; }
.search-bar input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  background: var(--bg);
  outline: none;
}
.search-bar input:focus { border-color: var(--accent); }
#search-suggest {
  position: absolute; top: calc(100% + 4px); left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  z-index: 200;
}
.search-suggest-list { list-style: none; }
.search-suggest-list a {
  display: block; padding: 10px 14px;
  text-decoration: none; color: var(--text);
  border-bottom: 1px solid var(--border);
}
.search-suggest-list a:hover { background: var(--bg); }
.site-nav { display: flex; gap: 4px; }
.site-nav a {
  padding: 6px 10px;
  text-decoration: none;
  color: var(--muted);
  border-radius: var(--radius);
  font-size: 0.9rem;
  white-space: nowrap;
}
.site-nav a:hover { color: var(--text); background: var(--bg); }
.nav-icon { font-size: 1.1rem; padding: 6px 8px; }

/* Display font — page titles, bin names, section display headers */
#main-content h1,
.page-title,
.bin-name-display,
.item-title-display {
  font-family: var(--font-display);
  font-weight: 400; /* Black Ops One has only weight 400 */
  letter-spacing: .02em;
}

/* Connect / QR page */
.connect-page { max-width: 700px; margin: 0 auto; }
.connect-header { margin-bottom: 28px; }
.connect-header h1 { font-size: 1.5rem; margin-bottom: 6px; }
.connect-header p { color: var(--muted); }
.qr-grid { display: flex; flex-wrap: wrap; gap: 24px; }
.qr-card {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 24px;
  box-shadow: var(--shadow);
}
.qr-code canvas, .qr-code img { display: block; border-radius: 4px; }
.qr-url {
  font-family: monospace; font-size: 0.95rem;
  color: var(--accent); word-break: break-all; text-align: center;
}
.qr-hint { color: var(--muted); font-size: 0.8rem; text-align: center; }
.connect-notice {
  margin-top: 28px; padding: 14px 18px;
  background: #fff8e1; border: 1px solid #ffe082;
  border-radius: var(--radius); font-size: 0.9rem;
}
.connect-notice code {
  background: rgba(0,0,0,.06); padding: 1px 5px; border-radius: 3px; font-size: 0.85rem;
}

/* Main content */
#main-content { max-width: 960px; margin: 0 auto; padding: 20px 16px 80px; }

/* FAB */
.fab {
  position: fixed; bottom: 24px; right: 20px; z-index: 50;
  width: 56px; height: 56px;
  background: var(--accent); color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.8rem; line-height: 1;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(42,110,245,.35);
}
.fab:hover { background: var(--accent-hover); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  font-size: 0.95rem;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}
.btn:hover { background: var(--bg); }
.btn-primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.btn-large { padding: 14px 24px; font-size: 1.05rem; }

/* Dashboard */
.dashboard { display: flex; flex-direction: column; gap: 24px; }
.stats-bar {
  display: flex; gap: 20px;
  padding: 14px 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.stat { color: var(--muted); font-size: 0.9rem; }
.stat strong { color: var(--text); }
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.recent-items h2 { font-size: 1rem; color: var(--muted); margin-bottom: 12px; }
.item-strip {
  display: flex; gap: 12px; overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}
.item-card-small {
  flex: 0 0 120px;
  display: flex; flex-direction: column; gap: 6px;
  text-decoration: none; color: var(--text);
}
.item-card-small img, .item-card-small .no-photo {
  width: 120px; height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.item-name { font-size: 0.85rem; line-height: 1.3; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bin-badge {
  font-size: 0.75rem; color: var(--muted);
  background: var(--bg); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px;
  align-self: flex-start;
}

/* Stub pages */
.stub-page { padding: 40px 0; }
.stub-page h1 { margin-bottom: 8px; }
.stub-page p { color: var(--muted); margin-bottom: 20px; }

/* Empty state */
.empty-state { text-align: center; padding: 48px 0; color: var(--muted); }
.empty-state a { color: var(--accent); }

/* Capture page */
.capture-page { max-width: 480px; margin: 0 auto; }
.capture-header { display: flex; flex-direction: column; gap: 4px; margin-bottom: 20px; }
.capture-header h1 { font-size: 1.5rem; }
.back-link { color: var(--accent); text-decoration: none; font-size: 0.9rem; }

.capture-form { display: flex; flex-direction: column; gap: 20px; }

/* Photo picker */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.photo-pick-label { display: block; cursor: pointer; }
.photo-pick-area {
  height: 220px;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px;
  background: var(--surface);
  transition: border-color 0.15s;
}
.photo-pick-area:hover, .photo-pick-label:focus-within .photo-pick-area {
  border-color: var(--accent);
}
.photo-pick-icon { font-size: 2.5rem; }
.photo-pick-hint { color: var(--muted); font-size: 0.9rem; }
.photo-preview-img {
  width: 100%; max-height: 320px;
  object-fit: contain;
  border-radius: var(--radius);
  background: #000;
}
.hidden { display: none !important; }

/* Fields */
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 0.9rem; font-weight: 500; }
.field input, .field select {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
  background: var(--surface);
  width: 100%;
}
.field input:focus, .field select:focus {
  outline: none; border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(42,110,245,.12);
}
.required { color: var(--danger); }

/* Tag chips */
.tag-chips { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 4px; }
.tag-chip {
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 20px;
  background: var(--surface);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.12s;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }
.tag-chip.active {
  background: var(--accent); color: #fff; border-color: var(--accent);
}

/* Action buttons */
.capture-actions { display: flex; flex-direction: column; gap: 10px; padding-top: 4px; }
.btn-full { width: 100%; justify-content: center; }
.btn-secondary { background: var(--surface); }

/* Photo gallery (item detail) */
.gallery-scroll { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery-item {
  flex: 0 0 auto;
  border: none; background: none; padding: 0; cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden;
}
.gallery-item img {
  display: block;
  height: 200px; width: auto;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Lightbox */
.lightbox {
  border: none; background: transparent;
  padding: 0; margin: 0;
  width: 100vw; height: 100dvh;
  max-width: 100vw; max-height: 100dvh;
  overflow: hidden;
}
.lightbox::backdrop { background: rgba(0,0,0,.92); }

.lightbox-viewport {
  width: 100vw;
  height: calc(100dvh - 52px); /* leave room for toolbar */
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  cursor: default;
  user-select: none; -webkit-user-select: none;
  touch-action: none;
}
.lightbox-viewport img {
  display: block;
  max-width: 100%; max-height: 100%;
  object-fit: contain;
  transform-origin: center center;
  transition: transform 0.05s linear;
  pointer-events: none;
  border-radius: 4px;
}

/* Toolbar */
.lightbox-toolbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 52px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  background: rgba(0,0,0,.55);
  backdrop-filter: blur(6px);
  z-index: 10;
}
.lb-btn {
  width: 40px; height: 40px;
  border: none; border-radius: 8px;
  background: rgba(255,255,255,.15); color: #fff;
  font-size: 1.25rem; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.lb-btn:hover { background: rgba(255,255,255,.3); }
.lb-close { margin-left: 16px; background: rgba(220,50,50,.4); }
.lb-close:hover { background: rgba(220,50,50,.7); }

/* Webcam */
.webcam-section { display: flex; flex-direction: column; gap: 12px; }
.webcam-video { width: 100%; border-radius: var(--radius); background: #000; }
.webcam-controls { display: flex; gap: 10px; }
.webcam-shutter { flex: 1; }

/* Photo gallery item wrap (context toggles) */
.gallery-item-wrap { display: flex; flex-direction: column; gap: 4px; flex: 0 0 auto; position: relative; }
.photo-actions { display: flex; gap: 4px; justify-content: center; }
.btn-micro {
  padding: 3px 8px; font-size: 0.75rem;
  border: 1px solid var(--border); border-radius: 20px;
  background: var(--surface); cursor: pointer; white-space: nowrap;
}
.btn-micro:hover { border-color: var(--accent); }
.btn-micro.active { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn-danger-micro { color: var(--danger); border-color: var(--danger); background: none; }
.btn-danger-micro:hover { background: var(--danger); color: #fff; }

/* Photo context badge (overlaid on thumbnail) */
.photo-context-badge {
  position: absolute; top: 6px; right: 6px;
  padding: 2px 7px; border-radius: 10px;
  font-size: 0.7rem; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
  pointer-events: none;
}
.photo-context-inside  { background: #e8f4fd; color: #1565c0; }
.photo-context-outside { background: #e8f5e9; color: #2e7d32; }

/* Quantity badge */
.quantity-badge {
  font-size: 1rem; color: var(--muted); font-weight: 400; margin-left: 6px;
}
.qty-badge {
  font-size: 0.75rem; color: var(--muted); margin-left: 4px; font-weight: 400;
}

/* Edit mode photo grid */
.edit-photos { margin-bottom: 24px; }
.edit-photos h3 { font-size: 0.9rem; font-weight: 600; margin-bottom: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.edit-photo-grid { display: flex; flex-wrap: wrap; gap: 12px; }
.edit-photo-card { display: flex; flex-direction: column; gap: 4px; align-items: center; }
.edit-photo-card img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); }
.edit-photo-controls { display: flex; gap: 4px; }

/* Voice recordings */
.recordings-list { display: flex; flex-direction: column; gap: 10px; }
.recording-item { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.recording-item audio { flex: 1; min-width: 0; }
.rec-label { font-size: 0.85rem; color: var(--muted); }
.voice-controls { display: flex; align-items: center; gap: 10px; }
.record-timer { font-variant-numeric: tabular-nums; color: var(--danger); font-weight: 600; }
.playback-preview { width: 100%; margin-bottom: 8px; }
.form-row { display: flex; gap: 10px; margin-top: 8px; }
.field-input {
  padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius);
  font-size: 0.95rem; background: var(--surface); width: 100%; margin-bottom: 6px;
}

/* QR code SVG (server-generated, no JS needed) */
.qr-code svg { display: block; border-radius: 4px; }

/* Inside/outside filter */
.filter-select { min-width: 140px; }

/* Insurance button — active state (has_insurance = 1) */
.btn-insurance-active {
  background: #b8860b;
  color: #fff;
  border-color: #8a6408;
  font-weight: 700;
}
.btn-insurance-active:hover {
  background: #9a7009;
}

/* ── Location picker combobox ───────────────────────────────── */
.location-input-row { display: flex; align-items: center; gap: 6px; }
.loc-text-input     { flex: 1; }
.loc-clear-btn      { flex: none; background: none; border: 1px solid var(--border, #ccc);
                      border-radius: 4px; padding: 4px 8px; cursor: pointer;
                      color: var(--text-muted, #666); font-size: 0.85rem;
                      display: none; align-items: center; justify-content: center; }
.loc-clear-btn:hover { background: var(--danger-light, #fee); color: var(--danger, #c00); }
.location-hint      { color: var(--text-muted, #888); font-size: 0.78rem; margin: 4px 0 0; }
.location-hint kbd  { background: var(--surface, #f0f0f0); border: 1px solid var(--border, #ccc);
                      border-radius: 3px; padding: 1px 4px; font-size: 0.85em; }

/* QR context notice inside item form */
.qr-assign-notice   { display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
                      background: var(--surface, #f4f4f4); border: 1px solid var(--border, #ddd);
                      border-radius: 6px; padding: 10px 14px; margin-bottom: 16px; font-size: 0.9rem; }
.qr-number-chip     { background: var(--primary, #333); color: #fff;
                      font-weight: 700; font-size: 1rem;
                      padding: 3px 10px; border-radius: 12px; }

/* Inside/outside context buttons in edit-photo-card */
.edit-photo-context { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }
.edit-photo-context-row { display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap; }

/* Out-of-DOM forms used only for HTML5 form= attribute cross-referencing */
.hidden-form { display: none; }

/* ── Photo timeline mode (item-detail + qr/found) ───────────── */
.photo-timeline     { display: flex; flex-direction: column; gap: 8px; }

.tl-main-wrap       { position: relative; background: #000; border-radius: 8px; overflow: hidden;
                      cursor: zoom-in; }
.tl-main-img        { display: block; width: 100%; max-height: 480px;
                      object-fit: contain; border-radius: 8px; }

/* Date + counter overlay on main image */
.tl-overlay         { position: absolute; bottom: 0; left: 0; right: 0;
                      display: flex; justify-content: space-between; align-items: center;
                      padding: 6px 10px;
                      background: linear-gradient(transparent, rgba(0,0,0,0.55));
                      pointer-events: none; }
.tl-date            { color: #fff; font-size: 0.78rem; text-shadow: 0 1px 3px rgba(0,0,0,0.8); }
.tl-counter         { color: rgba(255,255,255,0.85); font-size: 0.75rem; }
.tl-expand          { pointer-events: all; background: rgba(0,0,0,0.45); border: none;
                      color: #fff; font-size: 1rem; width: 32px; height: 32px;
                      border-radius: 4px; cursor: pointer; display: flex;
                      align-items: center; justify-content: center; }
.tl-expand:hover    { background: rgba(0,0,0,0.7); }

/* ‹ › nav buttons */
.tl-nav             { display: flex; align-items: center; gap: 8px;
                      justify-content: center; margin-top: 4px; }
.tl-prev,
.tl-next            { background: var(--surface, #f0f0f0); border: 1px solid var(--border, #ddd);
                      border-radius: 6px; padding: 6px 14px; font-size: 1.2rem;
                      cursor: pointer; line-height: 1; }
.tl-prev:hover,
.tl-next:hover      { background: var(--surface-hover, #e0e0e0); }
.tl-prev:disabled,
.tl-next:disabled   { opacity: 0.35; cursor: default; }

/* Horizontal scrollable thumbnail strip */
.tl-strip           { display: flex; gap: 6px; overflow-x: auto; padding: 4px 0 6px;
                      scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; }
.tl-strip::-webkit-scrollbar { height: 4px; }
.tl-strip::-webkit-scrollbar-thumb { background: var(--border, #ccc); border-radius: 2px; }

.tl-thumb           { flex: none; display: flex; flex-direction: column; align-items: center;
                      gap: 3px; background: none; border: 2px solid transparent;
                      border-radius: 6px; padding: 2px; cursor: pointer;
                      scroll-snap-align: start; transition: border-color 0.15s; }
.tl-thumb img       { width: 64px; height: 64px; object-fit: cover;
                      border-radius: 4px; display: block; }
.tl-thumb.tl-active { border-color: var(--primary, #333); }
.tl-thumb:hover:not(.tl-active) { border-color: var(--border, #ccc); }

.tl-label           { font-size: 0.65rem; color: var(--text-muted, #888);
                      white-space: nowrap; max-width: 64px;
                      overflow: hidden; text-overflow: ellipsis; }

/* "Newest" hint shown below main image when only one photo */
.tl-hint            { font-size: 0.78rem; color: var(--text-muted, #888);
                      text-align: center; padding: 2px 0; }

/* ── QR found page — compact timeline ────────────────────────── */
.qr-tl-wrap         { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.qr-tl-main-wrap    { position: relative; background: #000; border-radius: 8px; overflow: hidden;
                      cursor: zoom-in; }
.qr-tl-main         { display: block; width: 100%; max-height: 360px;
                      object-fit: contain; border-radius: 8px; }

.qr-tl-nav          { display: flex; align-items: center; gap: 8px;
                      justify-content: center; margin-top: 4px; }
.qr-tl-btn          { background: var(--surface, #f0f0f0); border: 1px solid var(--border, #ddd);
                      border-radius: 6px; padding: 5px 12px; font-size: 1.2rem;
                      cursor: pointer; line-height: 1; }
.qr-tl-btn:hover    { background: var(--surface-hover, #e0e0e0); }
.qr-tl-counter      { font-size: 0.8rem; color: var(--text-muted, #888); min-width: 48px;
                      text-align: center; }

.qr-tl-strip        { display: flex; gap: 5px; overflow-x: auto; padding: 3px 0 5px;
                      -webkit-overflow-scrolling: touch; }
.qr-tl-strip::-webkit-scrollbar { height: 3px; }
.qr-tl-strip::-webkit-scrollbar-thumb { background: var(--border, #ccc); border-radius: 2px; }

.qr-tl-thumb        { flex: none; background: none; border: 2px solid transparent;
                      border-radius: 5px; padding: 1px; cursor: pointer;
                      transition: border-color 0.15s; }
.qr-tl-thumb img    { width: 52px; height: 52px; object-fit: cover;
                      border-radius: 3px; display: block; }
.qr-tl-thumb.qr-tl-active { border-color: var(--primary, #333); }
.qr-tl-thumb:hover:not(.qr-tl-active) { border-color: var(--border, #ccc); }

/* Photo display mode toggle (item-edit form) */
.mode-toggle-row    { display: flex; gap: 12px; flex-wrap: wrap; }
.mode-option        { display: flex; align-items: center; gap: 6px; cursor: pointer;
                      padding: 8px 12px; border: 1px solid var(--border, #ddd);
                      border-radius: 6px; transition: border-color 0.15s; }
.mode-option:has(input:checked) { border-color: var(--primary, #333);
                                   background: var(--surface, #f8f8f8); }
.mode-option input  { margin: 0; }
.mode-option-label  { display: flex; align-items: center; gap: 5px; }
.mode-icon          { font-size: 1.1rem; }
.field-hint         { display: block; font-size: 0.78rem; color: var(--text-muted, #888);
                      margin-top: 5px; line-height: 1.4; }

/* ── QR new-item creation form ───────────────────────────────── */
.qr-new-page        { max-width: 600px; margin: 0 auto; padding-bottom: 80px; }
.qr-name-row        { border: 2px solid var(--primary, #333); border-radius: 8px;
                      padding: 12px 14px; margin-bottom: 12px;
                      background: var(--surface, #fafafa); }
.qr-name-row input  { font-size: 1.1rem; font-weight: 600; }

/* Reorderable section cards — no overflow:hidden so datalist popups aren't clipped */
.qr-section         { border: 1px solid var(--border, #ddd); border-radius: 10px;
                      margin-bottom: 10px;
                      transition: box-shadow 0.15s, border-color 0.15s; }
.section-header     { display: flex; align-items: center; gap: 8px;
                      padding: 10px 14px; background: var(--surface, #f5f5f5);
                      border-bottom: 1px solid var(--border, #ddd);
                      border-radius: 10px 10px 0 0; }
.section-title      { flex: 1; font-weight: 600; font-size: 0.95rem; }
.section-body       { padding: 14px; display: flex; flex-direction: column; gap: 12px; }
.section-note       { color: var(--text-muted, #888); font-size: 0.82rem; margin: 0; }

/* Photo count badge next to section title */
.photo-count-badge  { font-weight: 400; color: var(--text-muted, #888); font-size: 0.85em; }

/* Reorder mode */
.reorder-btns       { display: none; gap: 2px; }
#qr-sections.reorder-mode .reorder-btns { display: flex; }
#qr-sections.reorder-mode .qr-section   { border-color: var(--primary, #333);
                                           border-style: dashed; }
.reorder-btn        { background: var(--surface, #eee); border: 1px solid var(--border, #ccc);
                      border-radius: 4px; width: 28px; height: 28px; font-size: 0.75rem;
                      cursor: pointer; display: flex; align-items: center; justify-content: center; }
.reorder-btn:hover  { background: var(--primary, #333); color: #fff; border-color: var(--primary, #333); }
.btn-active         { background: var(--primary, #333) !important; color: #fff !important;
                      border-color: var(--primary, #333) !important; }

/* Mic / dictation button */
.mic-btn            { background: var(--surface, #f0f0f0); border: 1px solid var(--border, #ccc);
                      border-radius: 20px; padding: 4px 10px; font-size: 1rem;
                      cursor: pointer; line-height: 1; flex: none; }
.mic-btn:hover      { background: var(--surface-hover, #e4e4e4); }
.mic-btn.listening  { background: #fee; border-color: #e00; color: #c00;
                      animation: mic-pulse 1s ease-in-out infinite; }
@keyframes mic-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200,0,0,0.3); }
  50%       { box-shadow: 0 0 0 6px rgba(200,0,0,0); }
}

/* Photo section tabs */
.psec-tabs          { display: flex; gap: 4px; flex-wrap: wrap; }
.psec-tab-btn       { background: var(--surface, #f0f0f0); border: 1px solid var(--border, #ccc);
                      border-radius: 6px; padding: 5px 12px; font-size: 0.85rem; cursor: pointer; }
.psec-tab-btn.active{ background: var(--primary, #333); color: #fff; border-color: var(--primary, #333); }
.psec-tab-pane      { display: none; }
.psec-tab-pane.active { display: block; }

/* Camera take-photo button */
.camera-take-btn    { display: block; width: 100%; padding: 14px;
                      background: var(--surface, #f0f0f0); border: 2px dashed var(--border, #ccc);
                      border-radius: 8px; font-size: 1rem; cursor: pointer; text-align: center;
                      color: var(--text, #333); }
.camera-take-btn:hover { border-color: var(--primary, #333); background: var(--surface-hover, #e8e8e8); }

/* File choose button (styled label) */
.file-choose-btn    { display: inline-block; padding: 10px 18px; cursor: pointer;
                      background: var(--surface, #f0f0f0); border: 1px solid var(--border, #ccc);
                      border-radius: 6px; font-size: 0.9rem; }
.file-choose-btn:hover { background: var(--surface-hover, #e4e4e4); }

/* Staged photo preview strip */
.staged-photos      { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.staged-photo       { position: relative; }
.staged-photo-img   { width: 80px; height: 80px; object-fit: cover;
                      border-radius: 6px; display: block;
                      border: 2px solid var(--border, #ddd); }
.staged-photo-remove{ position: absolute; top: -6px; right: -6px;
                      background: #c00; color: #fff; border: none;
                      border-radius: 50%; width: 20px; height: 20px;
                      font-size: 0.65rem; cursor: pointer; line-height: 1;
                      display: flex; align-items: center; justify-content: center; }
.staged-photo-remove:hover { background: #900; }
