* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* ══════════════════════════════════════════════════════════════
     Behr 2026 Color Trends — source-of-truth hex values
     All hardcoded colors in app.js / index.html reference these.
     NEVER hardcode a hex value outside this block.
     ══════════════════════════════════════════════════════════════ */

  /* ── Behr named swatches ── */
  --behr-hidden-gem:    #4E7A74;   /* smoky jade teal — primary brand */
  --behr-dragonfly:     #72908D;   /* muted blue-green — secondary */
  --behr-nocturne:      #1A2B3C;   /* deep navy — structural/nav */
  --behr-nocturne-mid:  #25486A;   /* mid nocturne — gradient stop */
  --behr-watery:        #AFC9CE;   /* soft sky blue — info */
  --behr-copper:        #BC7A58;   /* warm copper — finalized/premium */
  --behr-terracotta:    #B85640;   /* earthy red — danger/problem */
  --behr-beehive:       #D0A050;   /* sunny gold — attention */
  --behr-wheat:         #C4A278;   /* warm tan — provenance/earthy */
  --behr-pepper:        #4A4340;   /* warm charcoal — body emphasis */
  --behr-canvas:        #F5EFE4;   /* warm cream — card backgrounds */

  /* ── Primary (teal) scale ── */
  --primary:            #4E7A74;
  --primary-hover:      #3A615B;
  --primary-dark:       #2D5A56;
  --primary-bg-light:   #E0F0EE;
  --primary-tint-90:    rgba(78,122,116,0.90);
  --primary-tint-85:    rgba(78,122,116,0.85);
  --primary-tint-30:    rgba(78,122,116,0.30);
  --primary-tint-25:    rgba(78,122,116,0.25);
  --primary-tint-15:    rgba(78,122,116,0.15);
  --primary-tint-10:    rgba(78,122,116,0.10);
  --primary-tint-8:     rgba(78,122,116,0.08);
  --primary-tint-5:     rgba(78,122,116,0.05);

  /* ── Danger (terracotta) scale ── */
  --danger:             #B85640;
  --danger-dark:        #8A3E2C;
  --danger-deep:        #7f1d1d;
  --danger-bg:          #fef2f2;
  --danger-bg-soft:     #fee2e2;
  --danger-bg-faint:    #fff5f5;
  --danger-border:      #fecaca;
  --danger-border-mid:  #fca5a5;
  --danger-bright:      #dc2626;   /* explicit error red — alert indicators */
  --danger-bright-dark: #b91c1c;   /* darker error red — hover states */

  /* ── Warning / attention (amber → Beehive family) ── */
  --warn:               #d97706;
  --warn-mid:           #9A6820;
  --warn-dark:          #92400e;
  --warn-bg:            #FDF0D5;
  --warn-bg-light:      #FDF8EE;
  --warn-bg-pale:       #fff7ed;
  --warn-border:        #fde68a;
  --warn-border-mid:    #fcd34d;
  --attention:          #f59e0b;
  --attention-tint-15:  rgba(245,158,11,0.15);
  --attention-tint-10:  rgba(245,158,11,0.10);
  --attention-tint-8:   rgba(245,158,11,0.08);

  /* ── Success ── */
  --success:            #4E7A74;   /* on-palette: use primary teal */
  --success-bright:     #22c55e;   /* kept for explicit green signals */
  --success-bg:         #dcfce7;
  --success-border:     #bbf7d0;

  /* ── Info / watery ── */
  --info-bg:            #F0F5F5;
  --info-border:        #bae6fd;
  --watery-tint:        rgba(175,201,206,0.20);
  --watery-tint-8:      rgba(175,201,206,0.08);
  --watery-border:      #B2D4D8;

  /* ── Page / card / surface ── */
  --bg:                 #F7F3EE;
  --card:               #ffffff;
  --card-bg:            #ffffff;   /* alias of --card — used for modal inner panels */
  --surface-1:          #f8fafc;
  --surface-2:          #f1f5f9;
  --surface-3:          #fafafa;

  /* ── Border scale ── */
  --border:             #e2e8f0;
  --border-strong:      #e5e7eb;
  --border-mid:         #d1d5db;
  --border-light:       #cbd5e1;

  /* ── Text scale ── */
  --ink:                #0f172a;   /* deepest — modal headings */
  --text:               #1e293b;   /* body copy */
  --text-dim:           #334155;   /* between body and secondary */
  --text-medium:        #374151;   /* mid-weight labels */
  --text-secondary:     #475569;   /* secondary labels */
  --text-light:         #64748b;   /* hints / meta */
  --text-muted:         #94a3b8;   /* placeholder / disabled */
  --slate-heavy:        #1f2937;   /* heavy slate */

  /* ── Overlay / scrim ── */
  --scrim-darkest:      rgba(15,23,42,0.85);
  --scrim-darker:       rgba(15,23,42,0.65);
  --scrim-dark:         rgba(15,23,42,0.50);

  /* ── Legacy tier badges (kept for backward compat) ── */
  --tier1: var(--danger);
  --tier2: var(--warn);
  --tier3: var(--success-bright);
  --tier4: var(--behr-dragonfly);

  /* ── Z-index scale ── */
  --z-base: 100;
  --z-dropdown: 200;
  --z-sticky: 300;
  --z-sticky-over: 310;
  --z-fab: 400;
  --z-toast: 1000;
  --z-modal: 9000;
  --z-modal-over: 9999;
  --z-search: 10000;
  --z-system: 99999;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

.header {
  background: linear-gradient(135deg, var(--behr-nocturne), var(--behr-nocturne-mid));
  color: white;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: var(--z-base);
  box-shadow: 0 2px 8px var(--primary-tint-15);
}

.header h1 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.5px;
}

.header h1 span { color: var(--behr-dragonfly); }

.nav-tabs {
  display: flex;
  gap: 4px;
}

.nav-tab {
  padding: 6px 12px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.7);
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s;
}

.nav-tab:hover { background: rgba(255,255,255,0.2); color: white; }
.nav-tab.active { background: rgba(255,255,255,0.25); color: white; }

.stats-bar {
  display: flex;
  gap: 6px;
  padding: 4px 12px;
  background: white;
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  align-items: center;
}

.stat-card {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 3px;
  min-width: auto;
  white-space: nowrap;
}
.stat-clickable {
  cursor: pointer;
  border-radius: 6px;
  padding: 2px 6px;
  transition: background 0.2s;
}
.stat-clickable:hover {
  background: rgba(78, 122, 116, 0.15);
}
.stat-clickable:active {
  background: rgba(78, 122, 116, 0.25);
}

.stat-value { font-size: 15px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 10px; color: var(--text-light); text-transform: uppercase; letter-spacing: 0.3px; }

.container { max-width: 1400px; margin: 0 auto; padding: 8px 12px; }

.screen { display: none; }
.screen.active { display: block; }

/* Upload Zone */
.upload-zone {
  border: 2px solid transparent;
  border-radius: 10px;
  transition: all 0.3s;
  margin-bottom: 6px;
}
.upload-zone.dragover {
  border-color: var(--primary);
  background: rgba(78, 122, 116, 0.04);
}

/* Compact upload bar: mode toggle + upload buttons in one row */
.upload-compact-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 6px;
  background: var(--surface-1);
  border: 1px solid var(--border);
  border-radius: 10px;
  flex-wrap: wrap;
}
.upload-compact-bar .upload-mode-toggle {
  margin: 0;
  flex: 1;
  min-width: 150px;
}
.upload-icon-row {
  display: flex;
  gap: 4px;
  align-items: center;
  flex-shrink: 0;
}
.upload-icon-btn {
  background: var(--border);
  border: none;
  border-radius: 8px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text);
  white-space: nowrap;
  transition: filter 0.15s, box-shadow 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.upload-icon-btn:hover { filter: brightness(0.90); }
.upload-icon-btn:focus-visible { box-shadow: 0 0 0 3px rgba(78,122,116,0.4); outline: none; }
.upload-btn-primary { background: var(--primary); color: var(--card); }
.upload-btn-dark { background: var(--text); color: var(--card); }
.upload-btn-teal { background: var(--primary-dark); color: var(--card); }

.paste-zone {
  min-height: 44px;
  border: 2px dashed var(--text-muted);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 13px;
  color: var(--text-light);
  background: var(--surface-1);
  cursor: text;
  transition: border-color 0.2s, background 0.2s;
  outline: none;
  width: 100%;
  margin-top: 6px;
}
.paste-zone:empty::before {
  content: attr(data-placeholder);
  color: var(--text-muted);
  pointer-events: none;
}
.paste-zone:focus {
  border-color: var(--primary);
  background: var(--primary-bg-light);
  box-shadow: 0 0 0 3px var(--primary-tint-15);
}
.paste-zone-compact {
  min-height: 44px;
  padding: 8px 12px;
  font-size: 12px;
  margin-top: 0;
  min-width: 140px;
  max-width: 200px;
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.15);
  color: var(--card);
}
.paste-zone-compact:empty::before { color: rgba(255,255,255,0.7); }
.paste-zone-compact:focus { border-color: var(--card); background: rgba(255,255,255,0.25); box-shadow: 0 0 0 3px rgba(255,255,255,0.2); }

.receipts-btn-pill {
  background: var(--card) !important;
  color: var(--primary-dark) !important;
  border: 2px solid var(--primary-dark) !important;
  border-radius: 8px;
  font-size: 13px !important;
  font-weight: 700;
  padding: 8px 14px !important;
  min-height: 44px;
}
.receipts-btn-pill:hover { background: var(--success-bg) !important; }
.receipts-btn-dark { background: var(--primary-dark) !important; color: var(--card) !important; }
.receipts-btn-dark:hover { background: var(--primary-dark) !important; }
.receipts-btn-util {
  background: rgba(255,255,255,0.25) !important;
  color: var(--card) !important;
  border: 1px solid rgba(255,255,255,0.5) !important;
  min-height: 44px;
  font-size: 13px !important;
  padding: 8px 12px !important;
}

.upload-drop-message {
  text-align: center;
  padding: 8px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}
.upload-zone.dragover .upload-drop-message { color: var(--primary); font-weight: 600; }

/* Claim Hub Styles */
.claim-hub-tabs {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding: 4px 0;
  border-bottom: 2px solid var(--border);
  margin-bottom: 12px;
  -webkit-overflow-scrolling: touch;
}
.claim-hub-tab {
  padding: 8px 14px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 3px solid transparent;
  transition: all 0.15s;
  min-height: 44px;
  position: relative;
}
.claim-hub-tab:hover { color: var(--text); background: var(--surface-2); }
.claim-hub-tab.active { color: var(--primary); border-bottom-color: var(--primary); }
.claim-hub-tab.comms-tab { color: var(--behr-nocturne); }
.claim-hub-tab.comms-tab.active { color: var(--behr-nocturne); border-bottom-color: var(--behr-nocturne); }
.claim-hub-tab .tab-badge {
  display: inline-block;
  background: var(--danger);
  color: var(--card);
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  margin-left: 4px;
  min-width: 18px;
  text-align: center;
}

.claim-hub-subtabs {
  display: flex;
  gap: 4px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.claim-hub-subtab {
  padding: 6px 14px;
  border: 1px solid var(--border);
  background: var(--surface-1);
  color: var(--text-secondary);
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-height: 36px;
}
.claim-hub-subtab:hover { background: var(--surface-2); border-color: var(--border-light); }
.claim-hub-subtab.active { background: var(--primary); color: var(--card); border-color: var(--primary); }

.claim-hub-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border: none;
  background: none;
  color: var(--text-light);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}
.claim-hub-back:hover { color: var(--text); }

.claim-card-clean {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: box-shadow 0.15s, border-color 0.15s;
}
.claim-card-clean:hover { box-shadow: 0 2px 8px rgba(0,0,0,0.08); border-color: var(--border-light); }

.submission-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.submission-badge.documented { background: var(--warn-bg-light); color: var(--warn-dark); }
.submission-badge.submitted { background: var(--info-border); color: var(--behr-nocturne); }
.submission-badge.acknowledged { background: var(--warn-bg); color: var(--danger-dark); }
.submission-badge.resolved_paid { background: var(--success-bg); color: var(--primary-dark); }
.submission-badge.resolved_denied { background: var(--danger-bg-soft); color: var(--danger-deep); }
.submission-badge.unresolved { background: var(--danger-border); color: var(--danger-deep); border: 1px solid var(--danger-border-mid); }
.submission-badge.never_submitted { background: var(--surface-2); color: var(--text-light); }

.upload-btn {
  background: var(--primary);
  color: white;
  border: none;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  max-height: 32px;
}

.upload-btn:hover { background: var(--primary-hover); }

.upload-preview {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 6px;
  margin-top: 6px;
  align-items: flex-start;
}
@media (max-width: 600px) {
  .upload-preview {
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
  }
}
.staging-grid-spacer {
  aspect-ratio: 1;
  border-radius: 8px;
  background: repeating-linear-gradient(
    -45deg,
    transparent,
    transparent 6px,
    rgba(78, 122, 116, 0.04) 6px,
    rgba(78, 122, 116, 0.04) 12px
  );
  border: 2px dashed rgba(78, 122, 116, 0.12);
  display: none;
}
@media (max-width: 600px) {
  .staging-grid-spacer { display: block; }
}

.staging-toolbar {
  width: 100%;
  margin-bottom: 6px;
}
.staging-toolbar-bar {
  background: linear-gradient(135deg, var(--behr-nocturne), var(--behr-nocturne-mid));
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 6px;
  border-radius: 8px 8px 0 0;
}
.staging-toolbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}
.staging-photo-count {
  color: var(--behr-dragonfly);
  font-size: 14px;
  font-weight: 600;
}
.staging-show-select {
  display: flex;
  align-items: center;
  gap: 4px;
}
.staging-show-select label {
  color: rgba(255,255,255,0.4);
  font-size: 11px;
}
.staging-show-select select {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 11px;
  font-family: inherit;
}
.staging-toolbar-center {
  display: flex;
  align-items: center;
  gap: 4px;
}
.staging-toolbar-right {
  display: flex;
  align-items: center;
  gap: 4px;
}
.stb-btn {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.75);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.15s;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.stb-btn:hover {
  background: rgba(255,255,255,0.15);
  color: white;
}
.stb-btn.stb-primary {
  background: rgba(78, 122, 116, 0.35);
  color: var(--behr-dragonfly);
  border-color: rgba(78, 122, 116, 0.5);
}
.stb-btn.stb-primary:hover {
  background: rgba(78, 122, 116, 0.5);
  color: white;
}
.stb-btn.stb-muted {
  color: rgba(255,255,255,0.4);
  border-color: rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.03);
}
.stb-sep {
  width: 1px;
  height: 16px;
  background: rgba(255,255,255,0.15);
  flex-shrink: 0;
}
.stb-page-select {
  background: rgba(255,255,255,0.1);
  color: white;
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 5px;
  padding: 3px 6px;
  font-size: 11px;
  font-family: inherit;
  min-height: 44px;
}
.staging-tag-progress {
  font-size: 12px;
  color: var(--behr-dragonfly);
  font-weight: 600;
  padding: 4px 12px;
  background: rgba(30, 27, 75, 0.4);
}
.staging-search-row {
  padding: 4px 12px 6px;
  background: rgba(30, 27, 75, 0.3);
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}
.staging-search-row input {
  flex: 1;
  padding: 7px 12px;
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  background: white;
  border: 1px solid var(--border);
}
.staging-search-row input::placeholder {
  color: var(--text-muted);
}
.staging-search-clear {
  position: absolute;
  right: 20px;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
}
.staging-search-count {
  font-size: 11px;
  color: var(--primary);
  font-weight: 600;
  white-space: nowrap;
}
/* Filter bar — replaces old single search row */
.staging-filter-bar {
  padding: 4px 12px 6px;
  background: rgba(30, 27, 75, 0.18);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.staging-filter-inputs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.staging-search-wrap {
  flex: 1;
  min-width: 120px;
  position: relative;
  display: flex;
  align-items: center;
}
.staging-filter-text {
  flex: 1;
  padding: 7px 28px 7px 10px;
  background: white;
  border: 1px solid var(--border);
  border-radius: 7px;
  color: var(--text);
  font-size: 12px;
  font-family: inherit;
  min-width: 0;
}
.staging-filter-text::placeholder { color: var(--text-muted); }
.staging-search-clear {
  position: absolute;
  right: 6px;
  background: none;
  border: none;
  font-size: 16px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.stg-folder-select {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: white;
  color: var(--text-dim);
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  max-width: 160px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.stg-clear-btn {
  padding: 6px 10px;
  border: 1px solid var(--danger-border-mid);
  border-radius: 7px;
  background: var(--danger-bg-faint);
  color: var(--danger);
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  min-height: 32px;
}
.stg-clear-btn:hover { background: var(--danger-bg-soft); }
/* Result count badge in toolbar when filtering */
.stg-filter-count {
  display: inline-flex;
  align-items: center;
  padding: 2px 9px;
  border-radius: 12px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
  min-width: 44px;
  justify-content: center;
}
.stg-filter-count-zero { background: var(--danger); }
/* Keyword chips */
.stg-kw-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.stg-kw-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 9px;
  border-radius: 999px;
  border: 1px solid var(--border-light);
  background: white;
  color: var(--text-secondary);
  font-size: 11px;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.12s, color 0.12s, border-color 0.12s;
  min-height: 26px;
}
.stg-kw-chip:hover { background: var(--surface-2); border-color: var(--text-muted); }
.stg-kw-chip.stg-kw-active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}
.stg-kw-count {
  font-size: 10px;
  opacity: 0.65;
  background: rgba(0,0,0,0.12);
  border-radius: 999px;
  padding: 0 4px;
  line-height: 1.4;
}
.stg-kw-chip.stg-kw-active .stg-kw-count { opacity: 0.75; background: rgba(255,255,255,0.2); }
.staging-selection-strip {
  padding: 7px 12px;
  background: var(--primary-bg-light);
  border: 1px solid rgba(78, 122, 116, 0.2);
  border-radius: 0 0 8px 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: wrap;
}
.staging-sel-count {
  color: var(--primary-dark);
  font-size: 12px;
  font-weight: 600;
}
.staging-sel-detail {
  color: var(--behr-dragonfly);
  font-size: 11px;
  font-weight: 400;
}
.staging-sel-actions {
  display: flex;
  align-items: center;
  gap: 5px;
}
.staging-sel-actions select {
  background: white;
  color: var(--text);
  border: 1px solid var(--behr-dragonfly);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 11px;
  font-family: inherit;
}
.staging-sel-go {
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 5px;
  padding: 5px 12px;
  font-size: 11px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}
.staging-sel-clear {
  background: transparent;
  color: var(--text-muted);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 4px 8px;
  font-size: 10px;
  cursor: pointer;
  font-family: inherit;
}

.upload-thumb {
  position: relative;
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  overflow: hidden;
  border: 3px solid var(--border);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.upload-thumb:active {
  transform: scale(0.95);
}

.upload-thumb.selected-photo {
  border-color: var(--primary);
  border-width: 4px;
  box-shadow: 0 0 0 5px rgba(78, 122, 116, 0.28);
}

.upload-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.group-card {
  touch-action: pan-y;
}

.upload-thumb .status-badge {
  position: absolute;
  bottom: 4px;
  left: 4px;
  right: 4px;
  font-size: 10px;
  text-align: center;
  padding: 2px 6px;
  border-radius: 4px;
  background: rgba(0,0,0,0.7);
  color: white;
}

.parent-context-badge {
  position: absolute;
  top: 3px;
  left: 3px;
  background: rgba(8, 145, 178, 0.92);
  color: white;
  font-size: 9px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  cursor: pointer;
  letter-spacing: 0.2px;
  z-index: 1;
  line-height: 1.4;
}
.parent-context-badge:hover {
  background: rgba(8, 145, 178, 1);
}

/* Progress Bar */
.progress-container {
  display: none;
  margin: 20px 0;
  background: white;
  border-radius: 12px;
  padding: 20px;
  border: 1px solid var(--border);
}

.progress-container.active { display: block; }

.progress-bar-track {
  height: 8px;
  background: var(--border);
  border-radius: 4px;
  overflow: hidden;
  margin: 8px 0;
}

.progress-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--behr-dragonfly));
  border-radius: 4px;
  transition: width 0.3s;
  width: 0%;
}

.progress-text { font-size: 14px; color: var(--text-light); }

/* Action Bar */
.action-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 8px;
  flex-wrap: wrap;
}

.action-bar .analyze-all-btn {
  background: var(--success);
  color: white;
  border: none;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.action-bar .analyze-all-btn:hover { filter: brightness(1.1); }
.action-bar .analyze-all-btn:disabled { opacity: 0.5; cursor: not-allowed; }

.staging-action-dock {
  display: none;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  position: sticky;
  bottom: 62px;
  z-index: 50;
  margin: 0 -16px;
  padding: 10px 16px;
  background: linear-gradient(to top, var(--card) 80%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(0,0,0,0.06);
}
.staging-dock-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  flex-wrap: wrap;
}
.dock-btn {
  flex: 1 1 auto;
  min-width: 100px;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  letter-spacing: -0.01em;
  max-height: 38px;
}
.dock-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.dock-btn-primary {
  background: var(--primary);
  color: white;
}
.dock-btn-primary:hover:not(:disabled) { background: var(--primary-hover); }
.dock-btn-teal {
  background: var(--primary-dark);
  color: white;
}
.dock-btn-teal:hover { background: var(--primary-dark); }
.dock-btn-done {
  background: var(--success);
  color: white;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  max-height: 40px;
}
.dock-btn-done:hover { filter: brightness(1.1); }
.dock-btn-done:disabled { opacity: 0.5; cursor: not-allowed; }

/* Filters */
.filters {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
  align-items: center;
}

.filter-select, .search-input {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 12px;
  background: white;
  color: var(--text);
}

.search-input { min-width: 140px; }

/* Item Cards */
.items-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
}

.item-card {
  background: white;
  border-radius: 12px;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow 0.2s;
}
.item-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.item-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.item-card-header:active { background: rgba(0,0,0,0.03); }

.item-card-thumb {
  width: 60px;
  height: 60px;
  min-width: 60px;
  border-radius: 8px;
  overflow: hidden;
  background: var(--surface-2);
}
.item-card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-card-summary {
  flex: 1;
  min-width: 0;
}
.item-card-summary .item-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.item-card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  align-items: center;
}
.item-number-inline {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-light);
  background: var(--surface-2);
  padding: 1px 6px;
  border-radius: 4px;
}
.item-value-inline {
  font-size: 13px;
  font-weight: 700;
  color: var(--success);
}

.item-card-chevron {
  font-size: 12px;
  color: var(--text-light);
  transition: transform 0.2s;
  min-width: 16px;
  text-align: center;
}
.item-card-chevron.open { transform: rotate(180deg); }

.item-card-body {
  border-top: 1px solid var(--border);
}

.item-card-layout {
  display: flex;
  gap: 0;
}

.item-photo-section {
  width: 280px;
  min-width: 280px;
  background: var(--surface-2);
  display: flex;
  flex-direction: column;
}

.item-primary-photo {
  width: 100%;
  height: 280px;
  overflow: hidden;
  cursor: pointer;
}
.item-primary-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-photo-strip {
  display: flex;
  gap: 4px;
  padding: 4px;
  overflow-x: auto;
}
.item-photo-strip img {
  width: 48px;
  height: 48px;
  border-radius: 4px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
}
.item-photo-strip img:hover { border-color: var(--primary); }

.photo-strip-thumb.primary-photo {
  border: 2px solid var(--primary);
  border-radius: 6px;
}
.photo-strip-thumb.primary-photo img {
  border-color: var(--primary);
}
.primary-star {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--primary);
  color: white;
  font-size: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.set-primary-btn {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: rgba(0,0,0,0.6);
  color: var(--text-muted);
  font-size: 12px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}
.set-primary-btn:hover, .set-primary-btn:active {
  background: var(--primary);
  color: white;
  transform: scale(1.15);
}

.item-number-badge {
  text-align: center;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-light);
  background: rgba(255,255,255,0.8);
}

.item-quick-actions {
  display: flex;
  gap: 4px;
  padding: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.item-details-section {
  flex: 1;
  min-width: 0;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.item-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
}
.rename-btn {
  background: none;
  border: 1px solid var(--behr-watery);
  border-radius: 4px;
  color: var(--behr-dragonfly);
  font-size: 14px;
  padding: 2px 6px;
  cursor: pointer;
  flex-shrink: 0;
  line-height: 1;
}
.rename-btn:active {
  background: var(--primary);
  color: white;
}
.item-title.editing {
  border: 2px solid var(--primary);
  border-radius: 6px;
  padding: 2px 6px;
  outline: none;
  background: var(--behr-nocturne);
  cursor: text;
}
.item-title-row h3 {
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  margin: 0;
  color: var(--text);
}
.item-identification {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.4;
  margin-top: -4px;
}

.item-badges-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  align-items: center;
}

.tier-badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: white;
}
.tier-TIER1_AUCTION { background: var(--tier1); }
.tier-TIER2_HIGH { background: var(--tier2); }
.tier-TIER3_MID { background: var(--tier3); }
.tier-TIER4_VOLUME { background: var(--tier4); }

.rarity-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
}
.rarity-Common { background: var(--border); color: var(--text-light); }
.rarity-Uncommon { background: var(--info-border); color: var(--behr-nocturne); }
.rarity-Rare { background: var(--success-bg); color: var(--primary); }
.rarity-Very_Rare { background: var(--warn-bg-light); color: var(--warn); }
.rarity-Exceptional { background: var(--danger-bg); color: var(--danger); }

.condition-badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 4px;
  font-weight: 600;
  background: var(--surface-2);
  color: var(--text-secondary);
}
.condition-mint { background: var(--success-bg); color: var(--primary-dark); }
.condition-excellent { background: var(--info-border); color: var(--behr-nocturne); }
.condition-very-good { background: var(--info-border); color: var(--behr-nocturne); }
.condition-good { background: var(--warn-bg-light); color: var(--warn-dark); }
.condition-fair { background: var(--warn-bg); color: var(--danger-dark); }
.condition-poor { background: var(--danger-border); color: var(--danger-deep); }
.condition-as-is-parts { background: var(--primary-tint-5); color: var(--behr-nocturne); }

.info-tip {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--border);
  color: var(--text-light);
  font-size: 10px;
  font-weight: 700;
  cursor: pointer;
  vertical-align: middle;
  margin-left: 2px;
  flex-shrink: 0;
  line-height: 1;
  user-select: none;
}
.info-tip:hover, .info-tip.active {
  background: var(--primary);
  color: white;
}
.info-tip .info-bubble {
  display: none;
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--surface-2);
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 400;
  line-height: 1.5;
  white-space: normal;
  width: max-content;
  max-width: 280px;
  z-index: var(--z-toast);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
  text-transform: none;
  letter-spacing: normal;
}
.info-tip .info-bubble::after {
  content: '';
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  border: 6px solid transparent;
  border-top-color: var(--text);
}
.info-tip:hover .info-bubble, .info-tip.active .info-bubble {
  display: block;
}
@media (max-width: 768px) {
  .info-tip .info-bubble {
    position: fixed;
    bottom: auto;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 85vw;
    width: auto;
  }
  .info-tip .info-bubble::after { display: none; }
}

.value-block {
  background: var(--surface-1);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid var(--border);
}
.value-primary {
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
  margin-bottom: 8px;
}
.value-breakdown {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.vb-chip {
  flex: 1;
  min-width: 70px;
  padding: 6px 8px;
  border-radius: 8px;
  text-align: center;
}
.vb-chip span { display: block; font-size: 11px; color: var(--text-light); }
.vb-chip strong { display: block; font-size: 15px; }
.vb-new { background: var(--success-bg); }
.vb-new strong { color: var(--primary); }
.vb-used { background: var(--warn-bg-pale); }
.vb-used strong { color: var(--warn); }
.vb-collectible { background: var(--primary-bg-light); }
.vb-collectible strong { color: var(--primary); }

.item-detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.detail-field {
  background: var(--surface-1);
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--surface-2);
}
.detail-field label {
  display: block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.detail-field span {
  font-size: 13px;
  color: var(--text);
  line-height: 1.3;
}
.detail-full { grid-column: 1 / -1; }

.confidence-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}
.confidence-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}
.confidence-fill {
  height: 100%;
  background: var(--primary);
  border-radius: 2px;
}
.confidence-text { font-size: 12px; color: var(--text-light); white-space: nowrap; }

.item-actions-bar {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: 4px;
}

.detail-section {
  border-top: 1px solid var(--border);
  padding-top: 8px;
}
.detail-section h4 {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  margin: 0;
  user-select: none;
}
.detail-section h4:hover { color: var(--primary); }
.toggle-icon {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
  transition: transform 0.2s;
}

.rec-platforms {
  background: var(--primary-tint-5);
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 13px;
  color: var(--behr-nocturne);
  margin-bottom: 10px;
  line-height: 1.4;
}

.market-cards {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.market-card {
  background: var(--surface-1);
  border-radius: 8px;
  padding: 10px;
  border: 1px solid var(--border);
}
.mc-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 4px;
}
.mc-header strong { font-size: 14px; }
.mc-price { font-weight: 700; color: var(--primary); font-size: 15px; }
.mc-range { font-size: 12px; color: var(--text-light); }
.mc-notes { font-size: 12px; color: var(--text-light); margin-top: 2px; }
.mc-search { font-size: 11px; color: var(--text-muted); margin-top: 4px; font-style: italic; }

.description-text, .history-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text);
  white-space: pre-wrap;
}

.expandable-section {
  display: none;
  padding: 8px 0;
}
.expandable-section.open { display: block; }
.expandable-section p {
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-secondary);
  margin: 0;
}

.open-section > h4 {
  border-left: 3px solid var(--primary);
  padding-left: 8px;
}

.folder-assign-block {
  background: var(--success-bg);
  border: 1px solid var(--success-border);
  border-radius: 8px;
  padding: 10px 12px;
  margin: 8px 0 12px;
}
.folder-assign-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.folder-icon {
  font-size: 18px;
  flex-shrink: 0;
}
.folder-select {
  flex: 1;
  padding: 8px 10px;
  border: 1px solid var(--success-border);
  border-radius: 6px;
  background: white;
  font-size: 14px;
  color: var(--primary-dark);
  cursor: pointer;
  min-width: 0;
}
.folder-create-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--success-border);
  border-radius: 6px;
  background: var(--primary-dark);
  color: white;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.folder-create-btn:active {
  background: var(--primary);
}
.folder-current-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--primary-dark);
  margin-top: 6px;
  font-weight: 600;
}

.hands-warning-alert {
  background: linear-gradient(135deg, var(--warn-bg-pale), var(--warn-bg-light));
  border: 2px solid var(--attention);
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
}
.hands-warning-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
  color: var(--warn-dark);
  font-size: 15px;
}

.duplicate-alert {
  background: linear-gradient(135deg, var(--danger-bg), var(--danger-border));
  border: 2px solid var(--danger);
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
}
.duplicate-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--danger-deep);
  font-size: 15px;
}
.duplicate-list {
  margin-bottom: 10px;
}
.duplicate-entry {
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
  padding: 8px 12px;
  margin-bottom: 4px;
  border: 1px solid var(--danger-border-mid);
  font-size: 13px;
  color: var(--danger-deep);
  cursor: pointer;
}
.duplicate-entry:active {
  background: rgba(255,255,255,0.9);
}
.duplicate-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.multi-item-alert {
  background: linear-gradient(135deg, var(--warn-bg-light), var(--warn-border));
  border: 2px solid var(--attention);
  border-radius: 10px;
  padding: 14px;
  margin: 12px 0;
}
.multi-item-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  color: var(--warn-dark);
  font-size: 15px;
}
.multi-item-icon { font-size: 20px; }
.multi-item-reason {
  font-size: 13px;
  color: var(--warn-dark);
  margin: 0 0 10px;
  font-style: italic;
}
.multi-item-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
}
.multi-item-entry {
  background: rgba(255,255,255,0.7);
  border-radius: 8px;
  padding: 10px 12px;
  border: 1px solid var(--warn-border-mid);
}
.multi-item-name {
  font-weight: 600;
  color: var(--warn-dark);
  font-size: 14px;
  margin-bottom: 2px;
}
.multi-item-desc {
  font-size: 12px;
  color: var(--warn-dark);
  line-height: 1.4;
}
.multi-item-meta {
  display: flex;
  gap: 12px;
  margin-top: 4px;
  font-size: 12px;
}
.multi-item-pos {
  color: var(--warn-mid);
  font-style: italic;
}
.multi-item-val {
  font-weight: 700;
  color: var(--primary-dark);
}
.multi-item-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.btn-sm {
  padding: 4px 8px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}
.btn-sm:hover { background: var(--surface-2); }
.btn-sm.btn-primary { background: var(--primary-dark); color: white; border-color: var(--primary-dark); }
.btn-sm.btn-primary:hover { background: var(--primary-dark); }
.btn-sm.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-sm.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-sm.btn-insurance { background: var(--behr-dragonfly); color: white; border-color: var(--behr-dragonfly); }
.btn-sm.btn-insurance:hover { background: var(--behr-dragonfly); }
.btn-sm.btn-needs-info { background: var(--attention); color: var(--warn-dark); border-color: var(--attention); font-weight: 600; }
.btn-sm.btn-needs-info:active { background: var(--warn); }
.btn-download-icon { display: inline-flex; align-items: center; justify-content: center; background: var(--text); color: var(--text-muted); border: 1px solid var(--text-dim); font-size: 14px; padding: 4px 8px; min-width: 28px; text-decoration: none; border-radius: 6px; cursor: pointer; }
.btn-download-icon:hover { background: var(--text-dim); color: var(--border); }
.btn-needs-answers { background: var(--behr-nocturne); color: var(--attention); border: 2px solid var(--attention); font-weight: 600; }
.btn-needs-answers:active, .btn-needs-answers.active { background: var(--attention); color: var(--warn-dark); }
.combine-undo-toast { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-width: 280px; }
.combine-undo-toast span { flex: 1; }
.btn-undo { background: white; color: var(--primary); border: 2px solid white; border-radius: 6px; padding: 6px 16px; font-weight: 700; font-size: 14px; cursor: pointer; white-space: nowrap; }
.btn-undo:hover { background: var(--success-bg); }
.btn-undo:disabled { opacity: 0.6; cursor: not-allowed; }
.btn-sm.btn-investigate { background: var(--behr-dragonfly); color: white; border-color: var(--behr-dragonfly); font-weight: 600; }
.btn-sm.btn-investigate:active { background: var(--behr-nocturne); }
.investigate-badge { font-size: 11px; color: var(--behr-dragonfly); background: var(--primary-tint-5); padding: 1px 6px; border-radius: 4px; font-weight: 600; }
.investigate-alert { background: var(--primary-tint-5); border: 2px solid var(--behr-dragonfly); border-radius: 10px; padding: 12px; margin-bottom: 12px; }
.investigate-header { display: flex; align-items: center; gap: 8px; color: var(--behr-nocturne); font-size: 14px; }
.investigate-note-input { width: 100%; margin-top: 8px; padding: 8px; border: 1px solid var(--behr-watery); border-radius: 6px; background: var(--primary-bg-light); color: var(--behr-nocturne-mid); font-size: 13px; resize: vertical; min-height: 50px; font-family: inherit; }
.investigate-note-input:focus { outline: 2px solid var(--behr-dragonfly); border-color: transparent; }

.insurance-section h4 {
  color: var(--behr-dragonfly);
}
.insurance-section .expandable-section {
  padding: 12px;
  background: var(--success-bg);
  border-radius: 8px;
  border: 1px solid var(--success-border);
}
.insurance-range {
  font-size: 15px;
  margin-bottom: 10px;
  color: var(--primary-dark);
}
.insurance-desc {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.insurance-sources {
  margin-bottom: 12px;
}
.insurance-sources > strong {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
}
.insurance-source-item {
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  margin-bottom: 6px;
  font-size: 13px;
}
.insurance-source-name {
  font-weight: 600;
  color: var(--text-dim);
  margin-right: 8px;
}
.insurance-source-cost {
  color: var(--primary-dark);
  font-weight: 600;
  margin-right: 8px;
}
.insurance-source-avail {
  color: var(--text-light);
  font-style: italic;
}
.insurance-source-notes {
  font-size: 12px;
  color: var(--text-light);
  margin-top: 4px;
}
.insurance-coverage, .insurance-docs, .insurance-depreciation, .insurance-comparable {
  font-size: 13px;
  color: var(--text-secondary);
  margin-top: 8px;
  padding: 8px;
  background: white;
  border-radius: 6px;
  border: 1px solid var(--border);
}
.insurance-type-label {
  font-size: 13px;
  color: var(--primary-dark);
  margin-bottom: 8px;
  padding: 6px 10px;
  background: var(--success-border);
  border-radius: 6px;
  display: inline-block;
}
.insurance-justification {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-dim);
  margin-bottom: 12px;
  padding: 10px;
  background: white;
  border-radius: 6px;
  border-left: 3px solid var(--behr-dragonfly);
}
.insurance-type-btn {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px;
  border: 2px solid var(--border);
  border-radius: 10px;
  background: white;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}
.insurance-type-btn:hover {
  border-color: var(--behr-dragonfly);
  background: var(--success-bg);
}
.insurance-type-btn strong {
  font-size: 15px;
  color: var(--ink);
}
.insurance-type-btn span {
  font-size: 13px;
  color: var(--text-light);
  line-height: 1.5;
}

.reanalyze-section {
  background: var(--primary-bg-light);
  border: 2px dashed var(--behr-dragonfly);
  border-radius: 10px;
  padding: 12px;
  margin-top: 8px;
}
.reanalyze-section h4 { color: var(--primary); }

.followup-flagged {
  border-left: 4px solid var(--attention) !important;
  background: linear-gradient(135deg, var(--attention-tint-8), transparent) !important;
}
.followup-flagged h4 {
  color: var(--warn) !important;
}
.followup-complete h4 {
  color: var(--success-bright) !important;
}
.followup-flag {
  color: var(--attention);
  font-size: 16px;
}
.followup-badge {
  background: var(--attention);
  color: var(--warn-dark);
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 10px;
  margin-left: 6px;
}
.followup-hint {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 12px;
  font-style: italic;
}
.followup-question {
  margin-bottom: 12px;
  padding: 10px;
  border-radius: 8px;
  transition: background 0.2s;
}
.fq-unanswered {
  background: var(--attention-tint-10);
  border-left: 3px solid var(--attention);
}
.fq-answered {
  background: rgba(34,197,94,0.06);
  border-left: 3px solid var(--success-bright);
}
.fq-flag {
  color: var(--attention);
  margin-right: 4px;
}
.fq-check {
  color: var(--success-bright);
  margin-right: 4px;
}

.followup-question label {
  display: block;
  font-size: 13px;
  color: var(--text);
  margin-bottom: 4px;
  font-weight: 500;
}

.followup-question input, .followup-question textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  font-family: inherit;
}

.description-preview {
  font-size: 13px;
  color: var(--text);
  line-height: 1.6;
  max-height: 200px;
  overflow-y: auto;
  white-space: pre-wrap;
}

/* Platform Buttons */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 8px;
  margin-top: 8px;
}

.platform-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: white;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  transition: all 0.2s;
}

.platform-btn:hover { background: var(--surface-2); border-color: var(--primary); }
.platform-btn.copied { background: var(--success-bg); border-color: var(--success); color: var(--success); }

/* Fee Table */
.fee-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
  margin-top: 8px;
}

.fee-table th, .fee-table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--border); }
.fee-table th { font-weight: 600; font-size: 11px; text-transform: uppercase; color: var(--text-light); }
.fee-table .recommended { background: var(--success-bg); }

.upload-mode-toggle {
  display: flex;
  background: var(--border);
  border-radius: 10px;
  padding: 3px;
  margin-bottom: 8px;
  gap: 2px;
}
.mode-btn {
  flex: 1;
  padding: 5px 10px;
  border: none;
  border-radius: 8px;
  background: transparent;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
  max-height: 40px;
}
.mode-btn.active {
  background: white;
  color: var(--text);
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.mode-btn[data-mode="auction"].active {
  background: var(--warn-bg-light);
  color: var(--warn-dark);
}
.auction-price-bar {
  background: var(--warn-bg-pale);
  border: 1px solid var(--warn-border);
  border-radius: 12px;
  padding: 14px 16px;
  margin-bottom: 12px;
}
.auction-badge {
  display: inline-block;
  background: var(--warn-bg-light);
  color: var(--warn-dark);
  font-size: 10px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.verdict-badge {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.verdict-buy { background: var(--success-bg); color: var(--primary-dark); }
.verdict-consider { background: var(--warn-bg-light); color: var(--warn-dark); }
.verdict-pass { background: var(--danger-bg-soft); color: var(--danger-deep); }
.verdict-unknown { background: var(--border); color: var(--text-secondary); }
.price-comparison {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: var(--surface-1);
  border-radius: 8px;
  margin-top: 8px;
}
.price-comparison .price-label { font-size: 12px; color: var(--text-light); }
.price-comparison .price-val { font-size: 18px; font-weight: 700; }
.price-comparison .price-vs { font-size: 14px; color: var(--text-light); font-weight: 600; }
.auction-section-header {
  padding: 12px 16px;
  margin: 16px 0 8px;
  font-size: 14px;
  font-weight: 600;
  color: var(--warn-dark);
  border-top: 2px solid var(--warn-border);
}
.auction-card { border-left: 3px solid var(--attention); }
.auction-reasoning {
  background: var(--warn-bg-pale);
  border: 1px solid var(--warn-border);
  border-radius: 8px;
  padding: 10px 14px;
  margin: 8px 0;
  font-size: 14px;
  line-height: 1.5;
}

.inv-mobile-list { display: block; }

@media (min-width: 768px) {
  .inv-mobile-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
  .inv-card { margin-bottom: 0; }
}

@media (min-width: 1200px) {
  .inv-mobile-list {
    grid-template-columns: repeat(3, 1fr);
  }
}

.inv-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-bottom: 10px;
  overflow: hidden;
  transition: box-shadow 0.2s, transform 0.1s;
}
.inv-card:hover {
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}
.inv-card:active {
  transform: scale(0.99);
}
.inv-card-top {
  display: flex;
  gap: 12px;
  padding: 12px;
}
.inv-card-photo {
  width: 64px;
  height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
  cursor: pointer;
}
.inv-card-info { flex: 1; min-width: 0; }
.inv-card-chevron {
  flex-shrink: 0;
  font-size: 18px;
  color: var(--text-light);
  align-self: center;
  margin-left: 4px;
  transition: transform 0.2s ease;
}
.inv-status-pill {
  display: inline-block;
  font-size: 10px;
  font-weight: 600;
  padding: 1px 6px;
  border-radius: 8px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  background: var(--border-strong);
  color: var(--text-light);
  vertical-align: middle;
  margin-left: 4px;
}
.inv-status-pill.status-reviewed { background: var(--info-border); color: var(--behr-nocturne); }
.inv-status-pill.status-listed { background: var(--success-bg); color: var(--primary-dark); }
.inv-status-pill.status-sold { background: var(--warn-bg-light); color: var(--warn-mid); }
.inv-status-pill.status-analyzing { background: var(--primary-bg-light); color: var(--primary); }
.inv-status-pill.status-needs_info { background: var(--warn-bg-light); color: var(--warn-mid); border: 1px solid var(--warn-border-mid); }
.inv-status-pill.status-error { background: var(--danger-bg-soft); color: var(--danger-dark); border: 1px solid var(--danger); }
.inv-card-id { font-size: 12px; font-weight: 700; color: var(--text-light); }
.inv-card-title {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  margin: 2px 0 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.inv-card-meta { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.inv-card-value { font-size: 16px; font-weight: 700; margin-top: 4px; }
.inv-card-actions {
  display: flex;
  gap: 8px;
  padding: 8px 12px 10px;
  flex-wrap: wrap;
  border-top: 1px solid var(--border);
}

/* Drag and Drop */
.drag-over {
  outline: 3px dashed var(--primary) !important;
  outline-offset: -3px;
  background: rgba(78, 122, 116, 0.08) !important;
}
.combine-source {
  outline: 3px solid var(--primary) !important;
  outline-offset: -3px;
  box-shadow: 0 0 12px rgba(78, 122, 116, 0.4) !important;
}
.combine-target {
  outline: 2px dashed var(--primary) !important;
  outline-offset: -2px;
  cursor: crosshair !important;
}
.combine-target:active {
  background: rgba(78, 122, 116, 0.15) !important;
}
[draggable="true"] {
  cursor: grab;
}
[draggable="true"]:active {
  cursor: grabbing;
}

/* Inventory Table */
.inventory-table-wrap {
  display: none;
}

.inventory-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

.inventory-table th {
  padding: 12px 14px;
  text-align: left;
  font-size: 11px;
  text-transform: uppercase;
  color: var(--text-light);
  font-weight: 600;
  border-bottom: 2px solid var(--border);
  cursor: pointer;
  white-space: nowrap;
  user-select: none;
}

.inventory-table th:hover { color: var(--text); }

.inventory-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.inventory-table tr:hover { background: var(--surface-1); }

.table-photo {
  width: 50px;
  height: 50px;
  border-radius: 6px;
  object-fit: cover;
}

.status-pill {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 600;
}

.status-uploaded { background: var(--border); color: var(--text-light); }
.status-analyzing { background: var(--warn-bg-light); color: var(--warn); }
.status-needs_info { background: var(--warn-bg-light); color: var(--warn-mid); border: 1px solid var(--warn-border-mid); }
.status-identified { background: var(--info-border); color: var(--behr-nocturne); }

/* B004: reconciliation stats table (replaces stat boxes) */
.stats-recon { width: 100%; }
.recon-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; color: var(--ink); padding: 2px 0; }
.recon-chip { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 6px 10px; cursor: pointer; font-size: 13px; color: var(--ink); min-height: 32px; }
.inv-lens-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 10px; }
.inv-lens-label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-light); }
.inv-lens-pill { background: var(--card); border: 1px solid var(--border); border-radius: 20px; padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--ink); min-height: 44px; }
.inv-lens-pill.active { background: var(--primary); border-color: var(--primary); color: var(--card); }
.inv-lens-count { display: inline-block; margin-left: 3px; font-size: 12px; font-weight: 700; opacity: 0.7; }
.inv-lens-reset { margin-left: auto; border-style: dashed; color: var(--text-light); font-weight: 500; }
@media (max-width: 600px) {
  .inv-lens-bar { gap: 6px; }
  .inv-lens-pill { flex: 1 1 auto; text-align: center; }
  .inv-lens-reset { margin-left: 0; flex-basis: 100%; }
}
.recon-chip strong { font-variant-numeric: tabular-nums; }
.recon-chip-alert { background: var(--danger-bg-soft); border-color: var(--danger); color: var(--danger-dark); font-weight: 600; }
.recon-secs { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; margin-top: 8px; }
.recon-sec { background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; flex: 1 1 200px; min-width: 190px; max-width: 300px; }
.recon-sec-title { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.4px; color: var(--text-light); margin-bottom: 4px; }
.recon-tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.recon-tbl td { padding: 4px; border-bottom: 1px solid var(--border); color: var(--ink); }
.recon-tbl tr:last-child td { border-bottom: none; }
.recon-num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; white-space: nowrap; }
.recon-total td { font-weight: 700; border-top: 2px solid var(--border); }
.recon-alert td { color: var(--danger-dark); font-weight: 600; }
.recon-warn td { color: var(--danger-dark); background: var(--danger-bg-soft); font-weight: 600; }
.recon-note { font-size: 11px; color: var(--text-muted); margin-top: 4px; }
@media (max-width: 600px) {
  .recon-sec { max-width: none; flex: 1 1 100%; }
}
.status-reviewed { background: var(--primary-tint-10); color: var(--behr-nocturne); }
.status-listed { background: var(--success-bg); color: var(--primary); }
.status-sold { background: var(--danger-bg); color: var(--danger); }
.status-error { background: var(--danger-bg-soft); color: var(--danger); }

.posting-tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 600;
  margin: 1px;
}
.posting-not { background: var(--warn-bg-light); color: var(--warn-dark); }
.posting-posted { background: var(--success-bg); color: var(--primary-dark); }
.posting-sold { background: var(--danger-bg); color: var(--danger); }

.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  background: white;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 4px 12px var(--primary-tint-15);
  z-index: var(--z-base);
  min-width: 200px;
  overflow: hidden;
}
.dropdown-menu.open { display: block; }
.dropdown-menu a {
  display: block;
  padding: 10px 16px;
  color: var(--text);
  text-decoration: none;
  font-size: 13px;
  border-bottom: 1px solid var(--surface-2);
}
.dropdown-menu a:last-child { border-bottom: none; }
.dropdown-menu a:hover { background: var(--surface-2); }

/* Modal */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: var(--z-dropdown);
  justify-content: center;
  align-items: flex-start;
  padding: 40px 20px;
  overflow-y: auto;
}

.modal-overlay.open { display: flex; }

.modal {
  background: white;
  border-radius: 12px;
  max-width: 700px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: white;
  z-index: 1;
}

.modal-header h3 { font-size: 16px; }

.modal-close {
  width: 32px; height: 32px;
  border: none; background: var(--surface-2);
  border-radius: 6px; cursor: pointer;
  font-size: 18px; display: flex;
  align-items: center; justify-content: center;
}

.modal-body { padding: 20px; }

.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 4px; }
.form-group input, .form-group select, .form-group textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  font-family: inherit;
}

.form-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 20px;
}

/* Pagination */
.pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
}

.pagination button {
  padding: 8px 16px;
  border: 1px solid var(--border);
  background: white;
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  min-height: 44px;
}

.pagination button:hover { background: var(--surface-2); }
.pagination button:disabled { opacity: 0.4; cursor: not-allowed; }
.pagination .page-info { font-size: 13px; color: var(--text-light); flex-basis: 100%; text-align: center; }
.pagination .page-num { min-width: 44px; padding: 8px 10px; font-weight: 600; }
.pagination .page-num.page-current { background: var(--primary); border-color: var(--primary); color: var(--card); opacity: 1; }
.pagination .page-ellipsis { color: var(--text-light); padding: 0 2px; }
@media (max-width: 600px) {
  .pagination { gap: 6px; }
  .pagination button { padding: 8px 10px; }
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light);
}

.empty-state h3 { font-size: 18px; margin-bottom: 8px; color: var(--text); }

/* Photo Modal */
.photo-modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.9);
  z-index: var(--z-sticky);
  justify-content: center;
  align-items: center;
  cursor: pointer;
  overflow: hidden;
}

.photo-modal.open { display: flex; }
.photo-modal img {
  max-width: 90%; max-height: 90%; object-fit: contain;
  transition: transform 0.15s ease;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}
.photo-modal img.dragging { cursor: grabbing; transition: none; }
.photo-modal-controls {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  gap: 8px;
  z-index: var(--z-sticky-over);
}
.photo-modal-controls button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.15);
  color: var(--card);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  transition: background 0.2s;
}
.photo-modal-controls button:hover { background: rgba(255,255,255,0.3); }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: var(--z-fab);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: 8px;
  color: white;
  font-size: 14px;
  font-weight: 500;
  box-shadow: 0 4px 12px var(--primary-tint-15);
  animation: slideIn 0.3s ease;
}

.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
.toast.info { background: var(--primary); }

@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

@media (max-width: 768px) {
  .items-grid { grid-template-columns: 1fr; }
  .item-card-layout { flex-direction: column; }
  .item-photo-section { width: 100%; min-width: 100%; }
  .item-primary-photo { height: 240px; }
  .item-detail-grid { grid-template-columns: 1fr; }
  .stats-bar { gap: 12px; }
  .header { flex-direction: column; gap: 6px; }
  .header-right { width: 100%; flex-direction: column; gap: 4px; }
  .nav-tabs { width: 100%; justify-content: center; }
  .user-menu { justify-content: center; }
  .action-bar { flex-direction: column; }
  .filters { width: 100%; }
  .inventory-table-wrap { display: none; }
}

.auth-container {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--behr-nocturne) 0%, var(--behr-nocturne-mid) 50%, var(--primary-dark) 100%);
  padding: 20px;
}

.auth-card {
  background: white;
  border-radius: 16px;
  padding: 40px;
  max-width: 420px;
  width: 100%;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo h1 {
  font-size: 28px;
  color: var(--text);
  letter-spacing: -0.5px;
}

.auth-logo h1 span {
  color: var(--primary);
}

.auth-logo p {
  color: var(--text-light);
  margin-top: 4px;
  font-size: 14px;
}

.auth-card .form-group {
  margin-bottom: 16px;
}

.auth-card .form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 14px;
  color: var(--text);
}

.auth-card .form-group input {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-size: 16px;
  transition: border-color 0.2s;
}

.auth-card .form-group input:focus {
  outline: none;
  border-color: var(--primary);
}

.auth-btn {
  width: 100%;
  padding: 14px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
  margin-top: 8px;
}

.auth-btn:hover {
  background: var(--primary-hover);
}

.auth-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.auth-error {
  color: var(--danger);
  font-size: 14px;
  min-height: 20px;
  text-align: center;
}

.auth-switch {
  text-align: center;
  margin-top: 20px;
  font-size: 14px;
  color: var(--text-light);
}

.auth-switch a {
  color: var(--primary);
  text-decoration: none;
  font-weight: 600;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-menu {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-name {
  font-size: 13px;
  opacity: 0.8;
  white-space: nowrap;
}

.undo-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  color: rgba(255,255,255,0.5);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: default;
  white-space: nowrap;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.undo-btn:not([disabled]) {
  color: white;
  border-color: rgba(167,139,250,0.6);
  background: var(--primary-tint-25);
  cursor: pointer;
}

.undo-btn:not([disabled]):hover {
  background: rgba(78,122,116,0.45);
}

.logout-btn {
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.25);
  color: white;
  padding: 6px 14px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.logout-btn:hover {
  background: rgba(255,255,255,0.25);
}

.admin-only {
  background: rgba(234, 179, 8, 0.2) !important;
  border: 1px solid rgba(234, 179, 8, 0.4) !important;
}

.admin-only:hover {
  background: rgba(234, 179, 8, 0.3) !important;
}

.admin-dashboard {
  padding: 16px 0;
}

.admin-section-title {
  font-size: 18px;
  font-weight: 700;
  margin: 24px 0 12px 0;
  color: var(--text);
  display: flex;
  align-items: center;
}

.admin-section-title:first-child {
  margin-top: 0;
}

.admin-stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 8px;
}

.admin-stat-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  text-align: center;
}

.admin-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary);
}

.admin-stat-label {
  font-size: 13px;
  color: var(--text-light);
  margin-top: 4px;
}

.admin-users-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--card);
}

.admin-users-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.admin-users-table th {
  background: var(--surface-2);
  padding: 10px 12px;
  text-align: left;
  font-weight: 600;
  white-space: nowrap;
}

.admin-users-table td {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
}

.admin-users-table tr:hover {
  background: var(--surface-1);
}

.admin-badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
}

.admin-badge-active {
  background: var(--success-bg);
  color: var(--primary-dark);
}

.admin-badge-inactive {
  background: var(--danger-bg-soft);
  color: var(--danger-deep);
}

.admin-badge-admin {
  background: var(--warn-bg-light);
  color: var(--warn-dark);
}

.admin-users-mobile {
  display: none;
}

.admin-user-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 16px;
  margin-bottom: 12px;
}

.admin-user-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 10px;
}

.admin-user-card-name {
  font-weight: 700;
  font-size: 16px;
}

.admin-user-card-email {
  color: var(--text-light);
  font-size: 13px;
}

.admin-user-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin: 10px 0;
  font-size: 13px;
}

.admin-user-card-stat {
  background: var(--surface-1);
  padding: 6px 10px;
  border-radius: 6px;
}

.admin-user-card-stat strong {
  display: block;
  font-size: 16px;
  color: var(--primary);
}

.admin-user-card-actions {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

@media (max-width: 768px) {
  .admin-users-table-wrap { display: none; }
  .admin-users-mobile { display: block; }
  .admin-stats-grid { grid-template-columns: repeat(2, 1fr); }
}

.profile-btn { background: none; border: none; color: white; font-size: 20px; cursor: pointer; padding: 4px 8px; opacity: 0.85; }
.profile-btn:hover { opacity: 1; }

.provenance-block { background: var(--warn-bg-light); border-left: 3px solid var(--attention); padding: 8px 12px; border-radius: 6px; margin: 8px 0; font-size: 13px; }
.provenance-label { font-weight: 600; color: var(--warn-dark); font-size: 11px; text-transform: uppercase; margin-bottom: 2px; }
.provenance-source { color: var(--warn-dark); }
.provenance-notes { color: var(--warn-dark); margin-top: 2px; }

.estates-list { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.estate-tag { display: inline-flex; align-items: center; gap: 4px; background: var(--primary-bg-light); color: var(--primary-hover); padding: 4px 10px; border-radius: 16px; font-size: 13px; }
.estate-tag button { background: none; border: none; color: var(--primary-hover); cursor: pointer; font-size: 16px; line-height: 1; padding: 0 2px; }

.btn-listing { background: var(--behr-dragonfly); color: white; }
.btn-listing:hover { background: var(--primary); }

.claude-section h4 { background: linear-gradient(135deg, var(--primary-bg-light), var(--primary-bg-light)); }
.claude-confidence { font-size: 13px; color: var(--primary-hover); margin-bottom: 6px; }
.claude-values { font-size: 15px; color: var(--primary-dark); margin-bottom: 8px; }
.claude-reasoning, .claude-factors, .claude-auth, .claude-strategy { font-size: 13px; color: var(--text-secondary); margin: 6px 0; line-height: 1.5; }

.listing-photos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.listing-photos-grid img { width: 100%; border-radius: 8px; cursor: pointer; border: 2px solid var(--border); background: white; }

.duplicate-alert { background: var(--danger-bg); border: 2px solid var(--danger-border-mid); border-radius: 10px; padding: 12px; margin: 10px 0; }
.duplicate-alert h4 { color: var(--danger); font-size: 14px; margin-bottom: 6px; }
.duplicate-alert .dup-item { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 13px; color: var(--danger-deep); }

.team-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.team-member { display: flex; align-items: center; justify-content: space-between; padding: 6px 0; border-bottom: 1px solid var(--surface-2); font-size: 14px; }
.team-member button { background: none; border: none; color: var(--danger); cursor: pointer; font-size: 14px; }

/* ===== LANDING PAGE ===== */

#landingPage {
  background: linear-gradient(180deg, var(--behr-nocturne) 0%, var(--behr-nocturne) 30%, var(--behr-nocturne-mid) 60%, var(--behr-nocturne) 100%);
  color: white;
  min-height: 100vh;
}

.landing-nav {
  position: sticky;
  top: 0;
  z-index: var(--z-base);
  background: rgba(15, 10, 46, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(78, 122, 116, 0.2);
}

.landing-nav-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 16px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.landing-logo {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 700;
}

.landing-logo span {
  color: var(--behr-dragonfly);
}

.landing-nav-links {
  display: flex;
  align-items: center;
  gap: 24px;
}

.landing-nav-links a {
  color: var(--behr-dragonfly);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.landing-nav-links a:hover {
  color: white;
}

.landing-cta-sm {
  background: var(--primary);
  color: white;
  border: none;
  padding: 8px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.landing-cta-sm:hover {
  background: var(--primary-hover);
}

.landing-hero {
  max-width: 900px;
  margin: 0 auto;
  padding: 100px 24px 80px;
  text-align: center;
}

.landing-hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: 52px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 24px;
}

.landing-hero h1 span {
  color: var(--behr-dragonfly);
}

.landing-hero-sub {
  font-size: 20px;
  color: var(--behr-dragonfly);
  max-width: 650px;
  margin: 0 auto 40px;
  line-height: 1.6;
  font-weight: 300;
}

.landing-hero-actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-bottom: 48px;
}

.landing-cta-lg {
  background: linear-gradient(135deg, var(--primary), var(--primary));
  color: white;
  border: none;
  padding: 16px 40px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
  box-shadow: 0 4px 20px rgba(78, 122, 116, 0.4);
}

.landing-cta-lg:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(78, 122, 116, 0.5);
}

.landing-cta-outline {
  background: transparent;
  color: var(--behr-dragonfly);
  border: 2px solid rgba(196, 181, 253, 0.4);
  padding: 16px 40px;
  border-radius: 12px;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
}

.landing-cta-outline:hover {
  border-color: var(--behr-dragonfly);
  color: white;
  background: rgba(78, 122, 116, 0.1);
}

.landing-trust-badges {
  display: flex;
  gap: 32px;
  justify-content: center;
  flex-wrap: wrap;
}

.trust-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  padding: 8px 18px;
  border-radius: 100px;
  font-size: 14px;
  color: var(--border);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.trust-icon {
  font-size: 16px;
}

/* Steps section */
.landing-steps {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.landing-steps h2,
.landing-features h2,
.landing-ai-section h2,
.landing-platforms h2,
.landing-about h2,
.landing-final-cta h2 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
}

.landing-section-sub {
  font-size: 17px;
  color: var(--behr-dragonfly);
  max-width: 600px;
  margin: 0 auto 48px;
  line-height: 1.6;
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

.step-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 36px 28px;
  text-align: left;
  transition: transform 0.2s, background 0.2s;
}

.step-card:hover {
  transform: translateY(-4px);
  background: rgba(255, 255, 255, 0.1);
}

.step-number {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary), var(--primary));
  color: white;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 20px;
}

.step-card h3 {
  font-size: 20px;
  margin-bottom: 12px;
  font-weight: 600;
}

.step-card p {
  color: var(--behr-dragonfly);
  font-size: 15px;
  line-height: 1.6;
}

/* Features section */
.landing-features {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.feature-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: left;
  transition: transform 0.2s, border-color 0.2s;
}

.feature-card:hover {
  transform: translateY(-3px);
  border-color: rgba(78, 122, 116, 0.4);
}

.feature-icon {
  font-size: 32px;
  margin-bottom: 16px;
}

.feature-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  font-weight: 600;
}

.feature-card p {
  color: var(--behr-dragonfly);
  font-size: 14px;
  line-height: 1.6;
}

/* AI Pipeline section */
.landing-ai-section {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.ai-pipeline {
  display: flex;
  align-items: stretch;
  gap: 16px;
  margin-top: 48px;
}

.ai-stage {
  flex: 1;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: left;
}

.ai-stage-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

.ai-stage-badge.gemini {
  background: linear-gradient(135deg, var(--behr-nocturne), var(--behr-dragonfly));
  color: white;
}

.ai-stage-badge.openai {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: white;
}

.ai-stage-badge.claude {
  background: linear-gradient(135deg, var(--warn-dark), var(--attention));
  color: white;
}

.ai-stage h3 {
  font-size: 18px;
  margin-bottom: 12px;
  font-weight: 600;
}

.ai-stage p {
  color: var(--behr-dragonfly);
  font-size: 14px;
  line-height: 1.6;
}

.ai-arrow {
  display: flex;
  align-items: center;
  font-size: 28px;
  color: var(--primary);
  padding: 0 4px;
}

/* Platforms section */
.landing-platforms {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.platform-logos {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-bottom: 24px;
}

.platform-tag {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 10px 24px;
  border-radius: 100px;
  font-size: 15px;
  font-weight: 500;
  color: var(--border);
  transition: background 0.2s;
}

.platform-tag:hover {
  background: rgba(78, 122, 116, 0.2);
}

.landing-platform-note {
  color: var(--behr-dragonfly);
  font-size: 15px;
  font-style: italic;
}

/* About section */
.landing-about {
  max-width: 800px;
  margin: 0 auto;
  padding: 80px 24px;
}

.about-content {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
}

.about-content h2 {
  margin-bottom: 24px;
}

.about-content p {
  color: var(--behr-dragonfly);
  font-size: 16px;
  line-height: 1.7;
  margin-bottom: 16px;
}

.about-compliance {
  font-size: 13px !important;
  color: var(--text-muted) !important;
  margin-top: 24px !important;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-style: italic;
}

.about-social {
  display: flex;
  gap: 24px;
  justify-content: center;
  margin-top: 24px;
}

.about-social a {
  color: var(--behr-dragonfly);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.2s;
}

.about-social a:hover {
  color: white;
}

/* Final CTA */
.landing-final-cta {
  text-align: center;
  padding: 80px 24px;
}

.landing-final-cta p {
  color: var(--behr-dragonfly);
  font-size: 18px;
  margin-bottom: 32px;
}

/* Footer */
.landing-footer {
  text-align: center;
  padding: 32px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: var(--text-light);
  font-size: 13px;
}

/* Insurance section */
.landing-insurance {
  max-width: 900px;
  margin: 0 auto;
  padding: 80px 24px;
}

.insurance-content {
  background: linear-gradient(135deg, rgba(78, 122, 116, 0.12), rgba(168, 85, 247, 0.08));
  border: 1px solid rgba(78, 122, 116, 0.25);
  border-radius: 20px;
  padding: 48px 40px;
}

.insurance-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 32px;
  font-weight: 700;
  margin-bottom: 16px;
}

.insurance-lead {
  font-size: 18px;
  color: var(--behr-dragonfly);
  line-height: 1.6;
  margin-bottom: 32px;
}

.insurance-features {
  display: grid;
  gap: 20px;
  margin-bottom: 24px;
}

.insurance-feature {
  background: rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 20px 24px;
  border-left: 3px solid var(--behr-dragonfly);
}

.insurance-feature strong {
  display: block;
  font-size: 16px;
  margin-bottom: 6px;
  color: var(--border);
}

.insurance-feature p {
  font-size: 14px;
  color: var(--behr-dragonfly);
  line-height: 1.5;
  margin: 0;
}

.insurance-note {
  font-size: 14px;
  color: var(--text-muted);
  font-style: italic;
}

/* Coming Soon section */
.landing-coming-soon {
  max-width: 1100px;
  margin: 0 auto;
  padding: 80px 24px;
  text-align: center;
}

.coming-soon-badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--attention), var(--warn));
  color: var(--behr-nocturne);
  padding: 6px 20px;
  border-radius: 100px;
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 20px;
}

.landing-coming-soon h2 {
  font-family: 'Playfair Display', serif;
  font-size: 36px;
  font-weight: 700;
  margin-bottom: 16px;
}

.coming-soon-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.coming-soon-card {
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.15);
  border-radius: 16px;
  padding: 32px 24px;
  text-align: left;
  transition: transform 0.2s, border-color 0.2s;
}

.coming-soon-card:hover {
  transform: translateY(-3px);
  border-color: rgba(245, 158, 11, 0.35);
}

.coming-soon-card h3 {
  font-size: 18px;
  margin-bottom: 10px;
  font-weight: 600;
}

.coming-soon-card p {
  color: var(--behr-dragonfly);
  font-size: 14px;
  line-height: 1.6;
}

.middleverse-tag {
  background: linear-gradient(135deg, var(--attention), var(--warn)) !important;
  color: var(--behr-nocturne) !important;
  font-weight: 700;
  border-color: var(--attention) !important;
}

.platform-flow {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  max-width: 700px;
  margin: 28px auto 0;
}

.flow-direction {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 14px;
  padding: 24px 20px;
  text-align: center;
}

.flow-arrow {
  display: block;
  font-size: 28px;
  margin-bottom: 8px;
  color: var(--behr-dragonfly);
}

.flow-direction strong {
  display: block;
  font-size: 16px;
  margin-bottom: 8px;
  color: var(--border);
}

.flow-direction p {
  font-size: 13px;
  color: var(--behr-dragonfly);
  line-height: 1.5;
  margin: 0;
}

.coming-soon-note {
  margin-top: 32px;
  font-size: 15px;
  color: var(--warn);
  font-style: italic;
  font-weight: 500;
}

.middleverse-link {
  color: var(--attention);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s;
}

.middleverse-link:hover {
  color: var(--warn-border-mid);
  text-decoration: underline;
}

/* MiddleVerse perk section */
.landing-middleverse-perk {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 24px;
}

.middleverse-perk-content {
  background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(217, 119, 6, 0.05));
  border: 1px solid rgba(245, 158, 11, 0.2);
  border-radius: 20px;
  padding: 48px 40px;
  text-align: center;
}

.middleverse-perk-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: linear-gradient(135deg, var(--attention), var(--warn));
  color: var(--behr-nocturne);
  font-weight: 800;
  font-size: 20px;
  border-radius: 14px;
  margin-bottom: 20px;
}

.middleverse-perk-content h2 {
  font-family: 'Playfair Display', serif;
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 16px;
}

.middleverse-perk-content > p {
  font-size: 16px;
  color: var(--behr-dragonfly);
  line-height: 1.6;
  max-width: 700px;
  margin: 0 auto 28px;
}

.middleverse-perk-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 500px;
  margin: 0 auto;
}

.perk-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  color: var(--primary-tint-5);
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  text-align: left;
}

.perk-item::before {
  content: "\2713";
  color: var(--attention);
  font-weight: 700;
  font-size: 16px;
  flex-shrink: 0;
}

.auth-middleverse-note {
  text-align: center;
  font-size: 13px;
  color: var(--warn);
  padding: 8px 0 4px;
}

.auth-middleverse-note a {
  color: var(--attention);
  text-decoration: none;
  font-weight: 600;
}

.auth-middleverse-note a:hover {
  text-decoration: underline;
}

.landing-footer .middleverse-link {
  color: var(--attention);
}

.profile-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
}

.profile-tab {
  padding: 10px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-light);
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: color 0.2s, border-color 0.2s;
}

.profile-tab:hover {
  color: var(--text);
}

.profile-tab.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.profile-tab-content {
  animation: fadeIn 0.15s ease;
}

.form-row {
  display: flex;
  gap: 12px;
}

.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-mid);
  border-radius: 8px;
  font-size: 14px;
  background: white;
}

.profile-social-section {
  border-top: 1px solid var(--border);
  margin-top: 16px;
  padding-top: 16px;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Auth back link */
.auth-back-link {
  margin-bottom: 16px;
}

.auth-back-link a {
  color: var(--primary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
}

.auth-back-link a:hover {
  text-decoration: underline;
}

/* Mobile responsive landing */
@media (max-width: 768px) {
  .landing-hero h1 { font-size: 32px; }
  .landing-hero-sub { font-size: 16px; }
  .landing-hero { padding: 60px 20px 50px; }

  .landing-hero-actions {
    flex-direction: column;
    gap: 12px;
  }
  .landing-cta-lg, .landing-cta-outline {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
  }

  .landing-trust-badges {
    gap: 12px;
  }
  .trust-badge { font-size: 12px; padding: 6px 14px; }

  .steps-grid, .features-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .ai-pipeline {
    flex-direction: column;
  }
  .ai-arrow {
    transform: rotate(90deg);
    justify-content: center;
    padding: 4px 0;
  }

  .landing-nav-links a {
    display: none;
  }

  .landing-steps h2,
  .landing-features h2,
  .landing-ai-section h2,
  .landing-platforms h2,
  .landing-about h2,
  .landing-final-cta h2 {
    font-size: 26px;
  }

  .about-content { padding: 28px 20px; }
  .about-social { flex-wrap: wrap; row-gap: 12px; }
  .insurance-content { padding: 28px 20px; }
  .insurance-content h2 { font-size: 24px; }
  .coming-soon-grid { grid-template-columns: 1fr; }
  .landing-coming-soon h2 { font-size: 26px; }
  .middleverse-perk-content { padding: 28px 20px; }
  .middleverse-perk-content h2 { font-size: 22px; }
  .platform-flow { grid-template-columns: 1fr; }
}

.display-pref-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.display-pref-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition: background 0.15s;
}
.display-pref-item:hover { background: var(--surface-2); }
.display-pref-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
  cursor: pointer;
}
.upload-context-bar {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 12px;
}
.drive-import-panel {
  background: var(--card-bg);
  border: 1px solid var(--primary-dark);
  border-radius: 12px;
  padding: 14px;
  margin-top: 12px;
}
.mn-cb-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-dim);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background .15s;
}
.mn-cb-label:hover {
  background: var(--surface-2);
}
.mn-cb-label input[type="checkbox"] {
  accent-color: var(--primary);
  width: 16px;
  height: 16px;
}
.mn-tab {
  transition: color .2s, border-color .2s;
}
.mn-tab:hover {
  color: var(--primary) !important;
}

.claim-folder-card > div:last-child {
  gap: 6px !important;
  flex-wrap: wrap !important;
}

.claim-folder-card .btn-sm {
  padding: 4px 8px;
  font-size: 11px;
  max-height: 28px;
  white-space: nowrap;
}

.btn-sm {
  max-height: 32px;
}

.inv-card-actions .btn-sm {
  padding: 5px 10px;
  font-size: 11px;
  max-height: 28px;
}

@media (max-width: 768px) {
  .dock-btn {
    min-width: 110px;
    padding: 8px 14px;
    font-size: 13px;
  }
  .staging-action-dock {
    padding: 8px 12px;
    gap: 6px;
  }
}

@media (max-width: 480px) {
  .inv-card-actions {
    gap: 6px;
  }
  .inv-card-actions .btn-sm {
    padding: 4px 8px;
    font-size: 10px;
  }
  .item-actions-bar {
    gap: 6px;
  }
  .item-actions-bar .btn-sm {
    padding: 5px 10px;
    font-size: 11px;
  }
  .claim-folder-card > div:last-child {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    gap: 6px !important;
  }
  .dock-btn {
    min-width: 0;
    flex: 1 1 calc(50% - 4px);
    padding: 7px 10px;
    font-size: 12px;
  }
  .staging-dock-row {
    gap: 4px;
    width: 100%;
  }
  .staging-action-dock {
    padding: 8px 10px;
    gap: 4px;
  }
  .upload-btn {
    padding: 8px 14px;
    font-size: 14px;
  }
}

.sv-action-btn {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  color: white;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
}

.sv-tool-btn {
  padding: 7px 12px;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  color: white;
  background: var(--text-secondary);
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.sv-group-thumb {
  width: 48px;
  height: 48px;
  border-radius: 6px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  flex-shrink: 0;
}
.sv-group-thumb.active {
  border-color: var(--behr-dragonfly);
}
.sv-group-thumb-wrap {
  position: relative;
  display: inline-block;
  flex-shrink: 0;
}
.sv-group-thumb-wrap .sv-remove-thumb {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--danger);
  color: white;
  border: none;
  font-size: 10px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

.sv-bbox {
  position: absolute;
  border: 2px solid;
  border-radius: 4px;
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.2s;
}
.sv-bbox.accepted { border-color: var(--success-bright); background: rgba(34,197,94,0.15); }
.sv-bbox.rejected { border-color: var(--text-muted); background: rgba(148,163,184,0.05); opacity: 0.7; }
.sv-bbox-medium { border-style: dashed; }
.sv-bbox-medium.rejected { border-color: var(--warn-border-mid); background: rgba(251,191,36,0.05); }
.sv-bbox-medium.accepted { border-style: solid; }
.sv-bbox-label {
  position: absolute;
  bottom: 100%;
  left: 0;
  background: rgba(0,0,0,0.8);
  color: white;
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 3px 3px 0 0;
  white-space: nowrap;
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sv-bbox-handle {
  position: absolute;
  width: 10px;
  height: 10px;
  background: white;
  border: 2px solid;
  border-radius: 2px;
  box-sizing: border-box;
  z-index: 10;
  touch-action: none;
}
.sv-bbox-handle-nw { top: -5px; left: -5px; cursor: nw-resize; }
.sv-bbox-handle-n  { top: -5px; left: 50%; transform: translateX(-50%); cursor: n-resize; }
.sv-bbox-handle-ne { top: -5px; right: -5px; cursor: ne-resize; }
.sv-bbox-handle-e  { top: 50%; right: -5px; transform: translateY(-50%); cursor: e-resize; }
.sv-bbox-handle-se { bottom: -5px; right: -5px; cursor: se-resize; }
.sv-bbox-handle-s  { bottom: -5px; left: 50%; transform: translateX(-50%); cursor: s-resize; }
.sv-bbox-handle-sw { bottom: -5px; left: -5px; cursor: sw-resize; }
.sv-bbox-handle-w  { top: 50%; left: -5px; transform: translateY(-50%); cursor: w-resize; }

.sv-resize-hint {
  text-align: center;
  font-size: 11px;
  color: var(--text-muted);
  background: rgba(148,163,184,0.1);
  border: 1px dashed var(--text-secondary);
  border-radius: 6px;
  padding: 5px 10px;
  margin-top: 6px;
  animation: svResizeHintFadeIn 0.4s ease;
}
@keyframes svResizeHintFadeIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.sv-bbox-reset {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 20px;
  height: 20px;
  background: rgba(0,0,0,0.75);
  border: 1px solid;
  border-radius: 50%;
  font-size: 13px;
  line-height: 18px;
  text-align: center;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s;
  z-index: 15;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}
.sv-bbox:hover .sv-bbox-reset {
  opacity: 1;
}
.sv-bbox-reset-pristine {
  opacity: 0 !important;
  pointer-events: none !important;
}
.sv-bbox:hover .sv-bbox-reset-pristine {
  opacity: 0.35 !important;
  pointer-events: auto !important;
  cursor: default;
}

#svCropOverlay .crop-handle {
  position: absolute;
  width: 24px;
  height: 24px;
  background: var(--success-bright);
  border: 2px solid white;
  border-radius: 50%;
  cursor: grab;
  z-index: 10;
}

#svPickGrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  max-height: 150px;
  overflow-y: auto;
}
#svPickGrid img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
  cursor: pointer;
  border: 2px solid transparent;
}
#svPickGrid img.picked {
  border-color: var(--behr-dragonfly);
}

/* ── Workbench mobile layout ─────────────────────────────────────────────── */
@media (max-width: 700px) {
  .wb-two-pane {
    flex-direction: column !important;
  }
  .wb-panel-pane {
    width: 100% !important;
    position: static !important;
    max-height: none !important;
    flex-shrink: unset !important;
  }
}

/* ── Receipts workbench two-pane responsive layout ─────────────────────────── */
.receipts-two-pane {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.receipts-right-pane {
  width: 300px;
  flex-shrink: 0;
  background: var(--surface-1);
  border-radius: 12px;
  border: 1px solid var(--success-bg);
  overflow: hidden;
  position: sticky;
  top: 10px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

/* Mobile-only total pill — hidden on desktop */
.receipts-mobile-total {
  display: none;
}

@media (max-width: 640px) {
  /* Stack panes vertically so cards get full width */
  .receipts-two-pane {
    flex-direction: column;
    gap: 0;
  }

  /* Left pane takes full width — no more postage-stamp sizing */
  #receiptsLeftPane {
    width: 100%;
  }

  /* Right pane: full width, hidden by default on mobile, shown below cards on expand */
  .receipts-right-pane {
    display: none;
    width: 100% !important;
    position: static !important;
    max-height: none !important;
    overflow-y: auto !important;
    border-radius: 12px;
    margin-top: 8px;
    order: 3; /* always render below the card list */
  }

  .receipts-right-pane.mobile-expanded {
    display: block;
  }

  /* Show the mobile total pill */
  .receipts-mobile-total {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-dark);
    color: var(--card);
    border-radius: 10px;
    padding: 10px 14px;
    margin-bottom: 10px;
    cursor: pointer;
    user-select: none;
    order: 1; /* sits above the card list */
  }

  /* Order the left pane between pill and right pane */
  #receiptsLeftPane {
    order: 2;
  }

  /* Keep statements and report panes full-width too */
  #receiptsStatementsPane,
  #receiptsReportPane {
    width: 100%;
    order: 2;
  }
}

/* ── Workbench Inbox responsive grid (T215-followup) ───────────────────────────
   Desktop: 2-column grid of tiles (max 220px each).
   Mobile (≤640px): single full-width column with bigger thumbnails so the
   8 universal subledger fields all fit comfortably without crowding. */
.wb-inbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 8px;
}
.wb-tile {
  width: 100%;
  transition: transform 0.17s ease, box-shadow 0.17s ease;
  will-change: transform;
}
.wb-tile:hover:not(.wb-selected) {
  transform: scale(1.04);
  box-shadow: 0 10px 28px rgba(0,0,0,0.14);
  z-index: 3;
  position: relative;
}
.wb-tile-thumb { height: 140px; }

.wb-list-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  will-change: transform;
}
.wb-list-card:hover:not(.wb-selected) {
  transform: scale(1.015) translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,0.11);
  z-index: 3;
  position: relative;
}
@media (prefers-reduced-motion: no-preference) {
  .wb-tile:active {
    transform: scale(0.97);
    transition: transform 80ms ease, box-shadow 80ms ease;
  }
  .wb-list-card:active {
    transform: scale(0.97);
    transition: transform 80ms ease, box-shadow 80ms ease;
  }
}
@media (prefers-reduced-motion: reduce) {
  .wb-tile:active,
  .wb-list-card:active {
    opacity: 0.75;
  }
}

@media (max-width: 640px) {
  .wb-inbox-grid { grid-template-columns: 1fr; gap: 10px; }
  .wb-tile { max-width: none !important; }
  .wb-tile-thumb { height: 220px; }
}
@keyframes wbPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.6); }
  50%       { box-shadow: 0 0 0 5px rgba(245, 158, 11, 0); }
}

/* ── Seller Reports ─────────────────────────────────────────────── */
.reports-header { margin-bottom: 12px; }
.reports-subtabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 14px; }
.reports-subtab {
  min-height: 44px; padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 600;
  border: 1px solid var(--border, #d8d2c6); background: var(--card, #fff); color: var(--text, #2c2a26); cursor: pointer;
}
.reports-subtab.active { background: var(--behr-nocturne, #2f3a3f); color: #fff; border-color: var(--behr-nocturne, #2f3a3f); }
.report-loading, .report-empty { padding: 28px 16px; text-align: center; color: var(--text-light, #7a756a); font-size: 14px; }
.report-empty { background: var(--card, #fff); border: 1px dashed var(--border, #d8d2c6); border-radius: 12px; }
.rpt-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.rpt-section-title { font-size: 15px; font-weight: 700; margin: 20px 0 6px; color: var(--text-dark, #2e2a24); }
.rpt-section-note { font-size: 12px; color: var(--text-muted, #8d8677); margin-bottom: 8px; }
.rpt-stale { color: #b03a2e; font-weight: 700; font-size: 11px; }
.rpt-chip-row, .rpt-pager { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.rpt-chip {
  min-height: 44px; padding: 8px 12px; border-radius: 10px; font-size: 13px; cursor: pointer;
  border: 1px solid var(--border, #d8d2c6); background: var(--card, #fff); color: var(--text, #2c2a26);
}
.rpt-chip.active { background: var(--behr-dragonfly, #3a7d6f); color: #fff; border-color: var(--behr-dragonfly, #3a7d6f); font-weight: 700; }
.rpt-chip:disabled { opacity: 0.4; cursor: default; }
.rpt-period-label { font-size: 14px; font-weight: 700; padding: 0 4px; white-space: nowrap; }
.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; margin-bottom: 14px; }
.stat-card { background: var(--card, #fff); border: 1px solid var(--border, #d8d2c6); border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 3px; }
.stat-label { font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-light, #7a756a); font-weight: 700; }
.stat-value { font-size: 24px; font-weight: 800; line-height: 1.15; }
.stat-value-sm { font-size: 16px; }
.stat-note { font-size: 11px; color: var(--text-light, #7a756a); }
.rpt-delta { font-size: 11px; font-weight: 700; }
.rpt-delta.up { color: #2e7d32; }
.rpt-delta.down { color: #c0392b; }
.report-table-wrap { background: var(--card, #fff); border: 1px solid var(--border, #d8d2c6); border-radius: 12px; overflow-x: auto; }
.report-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.report-table th { text-align: left; padding: 10px 12px; font-size: 11px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-light, #7a756a); border-bottom: 1px solid var(--border, #d8d2c6); white-space: nowrap; }
.report-table td { padding: 10px 12px; border-bottom: 1px solid var(--border, #eee7da); }
.report-table tbody tr:last-child td { border-bottom: none; }
.rpt-footnote { font-size: 12px; color: var(--text-light, #7a756a); margin: 10px 2px 0; }
.rpt-h3 { font-size: 15px; margin: 0 0 10px; }
.trend-chart { display: flex; gap: 4px; align-items: stretch; background: var(--card, #fff); border: 1px solid var(--border, #d8d2c6); border-radius: 12px; padding: 14px 10px 8px; height: 180px; }
.trend-col { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.trend-bar-wrap { flex: 1; display: flex; align-items: flex-end; justify-content: center; }
.trend-bar { width: 70%; max-width: 34px; background: var(--behr-dragonfly, #3a7d6f); border-radius: 4px 4px 0 0; min-height: 0; }
.trend-label { font-size: 9px; text-align: center; color: var(--text-light, #7a756a); margin-top: 4px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.health-list { display: flex; flex-direction: column; gap: 10px; }
.health-card { display: flex; gap: 12px; background: var(--card, #fff); border: 1px solid var(--border, #d8d2c6); border-radius: 12px; padding: 12px; }
.health-thumb img, .health-thumb-ph { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; }
.health-thumb-ph { display: flex; align-items: center; justify-content: center; background: var(--bg, #f4efe6); font-size: 24px; }
.health-body { flex: 1; min-width: 0; }
.health-title { font-size: 14px; font-weight: 700; }
.health-cat { font-size: 11px; font-weight: 600; color: var(--text-light, #7a756a); margin-left: 6px; }
.health-meta { font-size: 12px; color: var(--text-light, #7a756a); margin: 3px 0 6px; }
.health-flags { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 6px; }
.health-flag { font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.health-suggest { font-size: 12px; color: var(--text, #2c2a26); line-height: 1.5; }
.rpt-month-input { min-height: 44px; padding: 8px 10px; border-radius: 10px; border: 1px solid var(--border, #d8d2c6); font-size: 14px; background: var(--card, #fff); color: var(--text, #2c2a26); }
.rpt-dl { display: inline-flex; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 10px; font-size: 13px; font-weight: 700; text-decoration: none; border: 1px solid var(--behr-dragonfly, #3a7d6f); color: var(--behr-dragonfly, #3a7d6f); background: var(--card, #fff); }
@media (max-width: 600px) {
  .reports-subtabs { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .reports-subtab { white-space: nowrap; flex-shrink: 0; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-value { font-size: 20px; }
  .rpt-toolbar { flex-direction: column; align-items: stretch; }
  .rpt-pager { justify-content: space-between; }
  .trend-chart { height: 140px; }
  .trend-label { font-size: 8px; }
  .health-thumb img, .health-thumb-ph { width: 52px; height: 52px; }
}
