/* =========================================================
   Design System Tokens — History Redesign
   ========================================================= */
:root {
  /* Spacing (4px base) */
  --sp-xs: 4px;
  --sp-sm: 8px;
  --sp-md: 12px;
  --sp-lg: 16px;
  --sp-xl: 24px;
  --sp-2xl: 32px;
  --sp-3xl: 48px;

  /* Typography */
  --fs-display: 28px;
  --lh-display: 36px;
  --fs-h2: 20px;
  --lh-h2: 28px;
  --fs-h3: 15px;
  --lh-h3: 22px;
  --fs-body: 14px;
  --lh-body: 20px;
  --fs-caption: 12px;
  --lh-caption: 16px;

  /* Colors — Light */
  --bg-page: #FAFAFA;
  --bg-surface: #FFFFFF;
  --bg-subtle: #F4F4F5;
  --border-default: #E4E4E7;
  --border-strong: #D4D4D8;
  --text-primary: #18181B;
  --text-secondary: #71717A;
  --text-tertiary: #A1A1AA;
  --danger: #DC2626;
  --danger-bg: #FEF2F2;
  --accent: #18181B;

  /* Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 14px;

  /* Shadows */
  --shadow-card: 0 1px 2px rgba(0,0,0,0.04), 0 1px 3px rgba(0,0,0,0.06);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.08);

  /* Danger / Accent aliases */
  --clr-danger: #DC2626;
  --clr-danger-bg: #FEF2F2;
  --clr-accent: #18181B;

  /* Category chip colors (auto-assigned by JS) */
  --chip-blue-bg: #EFF6FF;
  --chip-blue-text: #1D4ED8;
  --chip-purple-bg: #F5F3FF;
  --chip-purple-text: #6D28D9;
  --chip-green-bg: #F0FDF4;
  --chip-green-text: #15803D;
  --chip-orange-bg: #FFF7ED;
  --chip-orange-text: #C2410C;
  --chip-pink-bg: #FDF2F8;
  --chip-pink-text: #BE185D;
  --chip-teal-bg: #F0FDFA;
  --chip-teal-text: #0F766E;
  --chip-red-bg: #FEF2F2;
  --chip-red-text: #DC2626;
  --chip-yellow-bg: #FEFCE8;
  --chip-yellow-text: #A16207;
}

/* Dark mode tokens */
body.dark {
  --bg-page: #0A0A0A;
  --bg-surface: #18181B;
  --bg-subtle: #27272A;
  --border-default: #3F3F46;
  --border-strong: #52525B;
  --text-primary: #FAFAFA;
  --text-secondary: #A1A1AA;
  --text-tertiary: #71717A;
  --danger: #EF4444;
  --danger-bg: #1C1917;
  --accent: #FAFAFA;
  --clr-danger: #EF4444;
  --clr-danger-bg: #1C1917;
  --clr-accent: #FAFAFA;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.2), 0 1px 3px rgba(0,0,0,0.3);
  --shadow-hover: 0 4px 12px rgba(0,0,0,0.4);

  --chip-blue-bg: #1E3A5F;
  --chip-blue-text: #93C5FD;
  --chip-purple-bg: #2E1065;
  --chip-purple-text: #C4B5FD;
  --chip-green-bg: #14532D;
  --chip-green-text: #86EFAC;
  --chip-orange-bg: #431407;
  --chip-orange-text: #FDBA74;
  --chip-pink-bg: #500724;
  --chip-pink-text: #F9A8D4;
  --chip-teal-bg: #134E4A;
  --chip-teal-text: #5EEAD4;
  --chip-red-bg: #450A0A;
  --chip-red-text: #FCA5A5;
  --chip-yellow-bg: #422006;
  --chip-yellow-text: #FDE047;
}
/* =========================================================
   ReelMind Ã¢â¬â Notion/Linear-style minimal SaaS UI
   - Single font: Inter
   - Neutral palette, no gradients, no blur, no animations
   - Flat sections, clean borders, subtle hover only
   ========================================================= */

*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
html{font-size:14px;-webkit-text-size-adjust:100%}

:root{
  --bg:#ffffff;
  --bg-soft:#fafafa;
  --bg-hover:#f4f4f5;
  --text:#111111;
  --text-2:#374151;
  --text-mute:#6b7280;
  --text-faint:#9ca3af;
  --border:#e5e5e5;
  --border-strong:#d4d4d8;
  --accent:#111111;
  --accent-fg:#ffffff;
  --green:#16a34a;
  --green-bg:#dcfce7;
  --red:#dc2626;
  --red-bg:#fee2e2;
  --amber:#b45309;
  --amber-bg:#fef3c7;
  --blue:#1d4ed8;
  --blue-bg:#dbeafe;
  --shadow:0 1px 2px rgba(0,0,0,0.04);
  --radius:6px;
  --radius-sm:4px;
}

body{
  font-family:'Inter',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  font-size:14px;
  line-height:1.5;
  color:var(--text);
  background:var(--bg);
  -webkit-font-smoothing:antialiased;
  -moz-osx-font-smoothing:grayscale;
}

a{color:inherit;text-decoration:none}
button{font:inherit;cursor:pointer;background:none;border:0;color:inherit}
input,textarea,select{font:inherit;color:inherit}

/* ============ Layout ============ */
.app{
  display:grid;
  grid-template-columns:240px 1fr;
  min-height:100vh;
}

/* ============ Sidebar ============ */
.sidebar{
  border-right:1px solid var(--border);
  background:var(--bg-soft);
  padding:20px 14px;
  display:flex;
  flex-direction:column;
  gap:18px;
  position:sticky;
  top:0;
  height:100vh;
}
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  padding:4px 6px;
  font-weight:600;
  font-size:14px;
}
.brand-mark{
  width:22px;height:22px;border-radius:5px;
  background:var(--text);color:var(--accent-fg);
  display:flex;align-items:center;justify-content:center;
  font-weight:700;font-size:12px;
}
.nav{display:flex;flex-direction:column;gap:2px}
.nav-section{
  font-size:11px;
  text-transform:uppercase;
  letter-spacing:0.06em;
  color:var(--text-faint);
  padding:8px 6px 4px;
}
.nav-item{
  display:flex;align-items:center;gap:8px;
  padding:6px 8px;border-radius:var(--radius-sm);
  color:var(--text-2);font-size:13.5px;
  cursor:pointer;
}
.nav-item:hover{background:var(--bg-hover)}
.nav-item.active{background:var(--bg-hover);color:var(--text);font-weight:500}
.nav-item .dot{width:6px;height:6px;border-radius:50%;background:var(--text-faint)}
.nav-item.active .dot{background:var(--text)}

.sidebar-footer{
  margin-top:auto;
  border-top:1px solid var(--border);
  padding-top:12px;
  font-size:12px;color:var(--text-mute);
}
.status-row{
  display:flex;align-items:center;gap:8px;
  padding:6px 6px;border-radius:var(--radius-sm);
  cursor:pointer;
}
.status-row:hover{background:var(--bg-hover)}
.status-dot{width:8px;height:8px;border-radius:50%;background:var(--text-faint)}
.status-dot.ok{background:var(--green)}
.status-dot.warn{background:var(--amber)}
.status-dot.bad{background:var(--red)}
.status-text{font-size:12px;color:var(--text-2)}

/* ============ Main ============ */
.main{
  display:flex;flex-direction:column;
  min-width:0;
}
.topbar{
  position:sticky;top:0;z-index:5;
  background:var(--bg);
  border-bottom:1px solid var(--border);
  padding:10px 24px;
  display:flex;align-items:center;gap:12px;
}
.topbar h1{font-size:15px;font-weight:600;color:var(--text)}
.topbar .crumb{color:var(--text-mute);font-size:13px}
.topbar .spacer{flex:1}
.topbar .top-actions{display:flex;align-items:center;gap:8px}

.content{
  padding:28px 24px 60px;
  max-width:1100px;
  width:100%;
}

.view{display:none}
.view.active{display:block}

/* ============ Headings ============ */
h2.section-title{
  font-size:20px;font-weight:600;color:var(--text);
  margin-bottom:4px;
}
.section-sub{color:var(--text-mute);font-size:13px;margin-bottom:20px}

h3.block-title{
  font-size:13px;font-weight:600;color:var(--text);
  margin-bottom:10px;
  display:flex;align-items:center;gap:8px;
}
h3.block-title .count{
  font-weight:500;color:var(--text-mute);font-size:12px;
}

/* ============ Block / Section ============ */
.block{
  border:1px solid var(--border);
  border-radius:var(--radius);
  background:var(--bg);
  padding:18px;
  margin-bottom:18px;
}
.block + .block{margin-top:0}

.row{display:flex;gap:10px;align-items:center;flex-wrap:wrap}
.row.between{justify-content:space-between}

/* ============ Inputs ============ */
.label{
  font-size:12px;color:var(--text-mute);
  display:block;margin-bottom:6px;font-weight:500;
}
.input,.select,.textarea{
  width:100%;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--bg);
  color:var(--text);
  padding:8px 10px;
  font-size:13.5px;
  outline:none;
}
.input:focus,.select:focus,.textarea:focus{
  border-color:#9ca3af;
}
.textarea{
  resize:vertical;min-height:140px;
  font-family:'Inter',system-ui,sans-serif;
  line-height:1.55;
}

/* ============ Buttons ============ */
.btn{
  display:inline-flex;align-items:center;gap:6px;
  padding:7px 12px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--bg);
  color:var(--text);
  font-size:13px;font-weight:500;
  cursor:pointer;
}
.btn:hover{background:var(--bg-hover)}
.btn:disabled{opacity:0.5;cursor:not-allowed}
.btn.primary{background:var(--text);color:var(--accent-fg);border-color:var(--text)}
.btn.primary:hover{background:#000}
.btn.subtle{border-color:transparent;color:var(--text-2)}
.btn.subtle:hover{background:var(--bg-hover)}
.btn.danger{color:var(--red);border-color:var(--border)}
.btn.danger:hover{background:var(--red-bg);border-color:var(--red-bg)}
.btn.sm{padding:4px 8px;font-size:12px}

/* ============ Inline file ============ */
.file-input{display:none}

/* ============ Table ============ */
.table-wrap{
  border:1px solid var(--border);
  border-radius:var(--radius);
  overflow:hidden;
}
table.data{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
table.data th,table.data td{
  text-align:left;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  vertical-align:top;
}
table.data th{
  background:var(--bg-soft);
  font-weight:500;color:var(--text-mute);
  font-size:12px;text-transform:uppercase;letter-spacing:0.04em;
}
table.data tr:last-child td{border-bottom:0}
table.data tr:hover td{background:var(--bg-soft)}
table.data td.err{color:var(--red)}
.watch-link{color:var(--blue);font-weight:500}
.watch-link:hover{text-decoration:underline}

/* ============ Badges / Pills ============ */
.badge{
  display:inline-block;
  font-size:11px;font-weight:500;
  padding:2px 7px;border-radius:999px;
  background:var(--bg-hover);color:var(--text-2);
  border:1px solid var(--border);
  white-space:nowrap;
}
.badge.ok{background:var(--green-bg);color:var(--green);border-color:transparent}
.badge.warn{background:var(--amber-bg);color:var(--amber);border-color:transparent}
.badge.err{background:var(--red-bg);color:var(--red);border-color:transparent}
.badge.info{background:var(--blue-bg);color:var(--blue);border-color:transparent}

/* ============ Loader ============ */
.loader{display:none;align-items:center;gap:8px;color:var(--text-mute);font-size:13px}
.loader.active{display:inline-flex}
.loader .spinner{
  width:12px;height:12px;border-radius:50%;
  border:2px solid var(--border-strong);
  border-top-color:var(--text);
  animation:spin 0.7s linear infinite;
}
@keyframes spin{to{transform:rotate(360deg)}}

/* ============ Key panel (modal-like, no blur) ============ */
.modal-mask{
  position:fixed;inset:0;background:rgba(0,0,0,0.25);
  display:none;align-items:flex-start;justify-content:center;
  padding-top:60px;z-index:50;
}
.modal-mask.open{display:flex}
.modal{
  width:min(640px,92vw);
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  overflow:hidden;
}
.modal-head{
  display:flex;align-items:center;gap:10px;
  padding:14px 16px;border-bottom:1px solid var(--border);
}
.modal-head h3{font-size:14px;font-weight:600}
.modal-body{padding:14px 16px;max-height:65vh;overflow:auto}
.modal-foot{padding:10px 16px;border-top:1px solid var(--border);display:flex;justify-content:flex-end;gap:8px}

.kp-block{margin-bottom:14px}
.kp-block:last-child{margin-bottom:0}
.kp-block h4{font-size:12px;color:var(--text-mute);font-weight:500;margin-bottom:6px;text-transform:uppercase;letter-spacing:0.04em}
.kp-summary{font-size:12px;color:var(--text-2);margin-bottom:6px}
.kp-list{display:flex;flex-direction:column;gap:4px}
.kp-key{
  display:flex;align-items:center;gap:8px;
  padding:6px 8px;border:1px solid var(--border);border-radius:var(--radius-sm);
  font-size:12px;
}
.kp-key-id{font-weight:500;min-width:60px}
.kp-key-status{color:var(--text-mute);text-transform:capitalize}
.kp-key.available{border-left:3px solid var(--green)}
.kp-key.busy{border-left:3px solid var(--amber)}
.kp-key.cooling,.kp-key.cooldown{border-left:3px solid var(--amber)}
.kp-key.dead,.kp-key.disabled{border-left:3px solid var(--red)}
.kp-key-err{
  margin-left:auto;color:var(--red);font-size:11px;
  max-width:240px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;
}

/* ============ History (Kanban + List) ============ */
.history-toolbar{
  display:flex;align-items:center;gap:8px;flex-wrap:wrap;
  margin-bottom:12px;
}
.cat-filter{
  display:flex;gap:4px;flex-wrap:wrap;
}
.cat-chip{
  padding:4px 10px;border:1px solid var(--border);border-radius:999px;
  font-size:12px;color:var(--text-2);cursor:pointer;background:var(--bg);
}
.cat-chip:hover{background:var(--bg-hover)}
.cat-chip.active{background:var(--text);color:var(--accent-fg);border-color:var(--text)}
.cat-chip .n{margin-left:6px;color:inherit;opacity:0.7}

.view-switch{display:inline-flex;border:1px solid var(--border);border-radius:var(--radius-sm);overflow:hidden}
.view-switch button{padding:5px 10px;font-size:12px;color:var(--text-2);background:var(--bg)}
.view-switch button.on{background:var(--bg-hover);color:var(--text);font-weight:500}

/* Kanban — DEPRECATED (overridden by .history-board) */
.kanban{
  display:none;
}
.column {
  display: flex;
  flex-direction: column;
  height: 420px;        /* Ã°Å¸âÂ¥ FIXED HEIGHT */
  min-height: 420px;
  max-height: 420px;
}
.column.drag-over{border-color:var(--text);background:var(--bg-hover)}
.column-head{
  display:flex;align-items:center;gap:6px;
  padding:10px 12px;border-bottom:1px solid var(--border);
}
.column-head .name{font-weight:600;font-size:13px;text-transform:capitalize}
.column-head .n{font-size:12px;color:var(--text-mute)}
.column-head .col-actions{margin-left:auto;display:flex;gap:2px}
.column-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;     /* Ã°Å¸âÂ¥ SCROLL ENABLED */
  flex: 1;              /* Ã°Å¸âÂ¥ TAKE REMAINING SPACE */
  padding-right: 4px;
}
.column-body::-webkit-scrollbar {
  width: 6px;
}

.column-body::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 6px;
}

.hist-item{
  border:1px solid var(--border);
  background:var(--bg);
  border-radius:var(--radius-sm);
  padding:8px 10px;
  display:flex;flex-direction:column;gap:4px;
  cursor:grab;
   flex-shrink: 0;
}
.hist-item:hover{background:var(--bg-soft)}
.hist-item.dragging{opacity:0.4}
.hist-item .ti{
  font-size:13px;
  font-weight:500;
  color:var(--text);
  line-height:1.4;

  white-space: normal;      /* allow multi-line */
  word-break: break-word;   /* break long URLs */
}
.hist-item .meta{display:flex;gap:6px;align-items:center;flex-wrap:wrap;font-size:11px;color:var(--text-mute)}
.hist-item .actions{display:flex;gap:4px;margin-top:2px}

/* List view */
.hist-list{
  border:1px solid var(--border);border-radius:var(--radius);overflow:hidden;
}
.hist-list-row{
  display:grid;
  grid-template-columns:1fr 140px 90px 80px;
  gap:10px;align-items:center;
  padding:10px 12px;border-bottom:1px solid var(--border);
  font-size:13px;
}
.hist-list-row:last-child{border-bottom:0}
.hist-list-row:hover{background:var(--bg-soft)}
.hist-list-row .ti{font-weight:500;color:var(--text);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.hist-list-row .cat{font-size:12px;color:var(--text-mute)}
.hist-list-row .right{display:flex;justify-content:flex-end;gap:6px}

.empty{
  padding:32px;text-align:center;color:var(--text-mute);font-size:13px;
  border:1px dashed var(--border);border-radius:var(--radius);
}

/* ============ Result count chip ============ */
.results-head{display:flex;align-items:center;gap:10px;margin-bottom:10px}
.results-count{font-size:12px;color:var(--text-mute)}

/* =========================================================
   ============ DARK MODE THEME (additive only) ============
   Notion / Linear style minimal dark palette.
   Activated by adding `dark` class on <body>.
   No existing class is removed or restructured Ã¢â¬â we only
   override CSS variables and a few hard-coded values.
   ========================================================= */
body.dark{
  --bg:#0f1115;
  --bg-soft:#171a21;
  --bg-hover:#222631;
  --text:#e5e7eb;
  --text-2:#cbd1da;
  --text-mute:#9ca3af;
  --text-faint:#6b7280;
  --border:#2a2f3a;
  --border-strong:#3a3f4b;
  --accent:#e5e7eb;
  --accent-fg:#0f1115;
  --green:#4ade80;
  --green-bg:#14532d;
  --red:#f87171;
  --red-bg:#7f1d1d;
  --amber:#fbbf24;
  --amber-bg:#78350f;
  --blue:#60a5fa;
  --blue-bg:#1e3a8a;
  --shadow:0 1px 2px rgba(0,0,0,0.4);
}

/* Card / block surface elevated slightly above main bg */
body.dark .block,
body.dark .table-wrap,
body.dark .hist-list,
body.dark .modal,
body.dark .ap-panel,
body.dark .hist-item,
body.dark .column{
  background:#1c1f26;
}

/* Topbar uses main bg variable already, but ensure it stays solid */
body.dark .topbar{ background:var(--bg); }

/* Primary button: invert so it stays visually "primary" in dark */
body.dark .btn.primary{
  background:#e5e7eb;
  color:#0f1115;
  border-color:#e5e7eb;
}
body.dark .btn.primary:hover{ background:#ffffff; }

/* Brand mark (R square) Ã¢â¬â keep contrasted in dark */
body.dark .brand-mark{
  background:#e5e7eb;
  color:#0f1115;
}

/* Active chip (filter) Ã¢â¬â invert text */
body.dark .cat-chip.active{
  background:#e5e7eb;
  color:#0f1115;
  border-color:#e5e7eb;
}

/* Table header subtle differentiation */
body.dark table.data th{ background:#171a21; }
body.dark table.data tr:hover td{ background:#222631; }
body.dark .hist-list-row:hover{ background:#222631; }
.hist-item:hover{} /* keep selector chain stable */
body.dark .hist-item:hover{ background:#222631; }

/* Inputs in dark Ã¢â¬â readable placeholders */
body.dark .input,
body.dark .select,
body.dark .textarea{
  background:#171a21;
  color:var(--text);
  border-color:var(--border);
}
body.dark .input::placeholder,
body.dark .textarea::placeholder{
  color:#6b7280;
}
body.dark .input:focus,
body.dark .select:focus,
body.dark .textarea:focus{
  border-color:#6b7280;
}

/* Modal mask Ã¢â¬â slightly stronger in dark */
body.dark .modal-mask{ background:rgba(0,0,0,0.55); }
body.dark .ap-overlay{ background:rgba(0,0,0,0.45); }
body.dark .ap-panel{ box-shadow:-4px 0 16px rgba(0,0,0,0.5); }

/* Empty state dashed border visibility */
body.dark .empty{ border-color:var(--border-strong); }

/* Badge subtle adjust Ã¢â¬â keep colored badges readable */
body.dark .badge{
  background:#222631;
  color:var(--text-2);
  border-color:var(--border);
}
body.dark .badge.ok{ background:#14532d; color:#86efac; }
body.dark .badge.warn{ background:#78350f; color:#fcd34d; }
body.dark .badge.err{ background:#7f1d1d; color:#fca5a5; }
body.dark .badge.info{ background:#1e3a8a; color:#93c5fd; }

/* Watch link / blue accents readable on dark */
body.dark .watch-link{ color:#60a5fa; }
body.dark .ap-link{ color:#60a5fa; }

/* Loader spinner contrast */
body.dark .loader .spinner{
  border-color:#2a2f3a;
  border-top-color:#e5e7eb;
}

/* Kanban scrollbar (existing rule uses #ddd) */
body.dark .column-body::-webkit-scrollbar-thumb{ background:#3a3f4b; }

/* Global scrollbar (webkit) for dark mode */
body.dark ::-webkit-scrollbar{ width:8px; height:8px; }
body.dark ::-webkit-scrollbar-track{ background:#0f1115; }
body.dark ::-webkit-scrollbar-thumb{
  background:#3a3f4b;
  border-radius:6px;
}
body.dark ::-webkit-scrollbar-thumb:hover{ background:#4a5060; }
/* Firefox scrollbar */
body.dark{ scrollbar-color:#3a3f4b #0f1115; scrollbar-width:thin; }

/* Theme toggle button Ã¢â¬â small, minimal, lives in topbar */
.theme-toggle{
  display:inline-flex; align-items:center; justify-content:center;
  width:32px; height:32px;
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  background:var(--bg);
  color:var(--text-2);
  font-size:14px; line-height:1;
  cursor:pointer;
  user-select:none;
}
.theme-toggle:hover{ background:var(--bg-hover); color:var(--text); }
.theme-toggle .icon{ display:inline-block; }

/* ============ Responsive ============ */

/* Mobile bottom nav bar */
.mobile-nav{
  display:none;
  position:fixed; bottom:0; left:0; right:0;
  background:var(--bg);
  border-top:1px solid var(--border);
  padding:6px 0 env(safe-area-inset-bottom, 6px);
  z-index:50;
}
.mobile-nav .nav-items{
  display:flex; justify-content:space-around; align-items:center;
}
.mobile-nav .mob-nav-item{
  display:flex; flex-direction:column; align-items:center; gap:2px;
  padding:6px 12px;
  font-size:10px; color:var(--text-mute);
  cursor:pointer; border:0; background:none;
  border-radius:var(--radius-sm);
}
.mobile-nav .mob-nav-item.active{ color:var(--text); font-weight:600; }
.mobile-nav .mob-nav-item .mob-icon{ font-size:18px; }

/* PWA install banner */
.pwa-install-banner{
  display:none;
  padding:10px 16px;
  background:var(--bg-soft);
  border-bottom:1px solid var(--border);
  font-size:13px;
  align-items:center; gap:10px;
}
.pwa-install-banner.show{ display:flex; }
.pwa-install-banner .pwa-text{ flex:1; color:var(--text-2); }
.pwa-install-banner .pwa-btn{
  padding:6px 14px;
  background:var(--text); color:var(--accent-fg);
  border:0; border-radius:var(--radius-sm);
  font-size:12px; font-weight:500; cursor:pointer;
}
.pwa-install-banner .pwa-dismiss{
  padding:4px 8px; border:0; background:none;
  color:var(--text-mute); cursor:pointer; font-size:16px;
}

@media (max-width: 860px){
  .app{ grid-template-columns:1fr; }
  .sidebar{ display:none; }
  .mobile-nav{ display:block; }
  .content{ padding:16px 14px 80px; } /* extra bottom padding for nav bar */
  .topbar{ padding:10px 14px; }
  .topbar h1{ font-size:14px; }
  .topbar .crumb{ display:none; }
  .topbar .top-actions{ gap:4px; flex-wrap:wrap; }
  .topbar .top-actions .badge{ display:none; } /* hide badges on mobile */
  #adminControls{ flex-direction:column; gap:6px; width:100%; }
  #adminControls .select{ width:100% !important; }
  .kanban{ grid-template-columns:1fr; }
  .column{ height:auto; min-height:auto; max-height:none; }
  .column-body{ max-height:400px; }
  .hist-list-row{ grid-template-columns:1fr 80px; gap:6px; padding:8px 10px; }
  .hist-list-row .cat{ display:none; }
  .history-toolbar{ flex-direction:column; align-items:stretch; gap:8px; }
  .cat-filter{ overflow-x:auto; flex-wrap:nowrap; padding-bottom:4px; }
  .cat-chip{ white-space:nowrap; flex-shrink:0; }
  .textarea{ min-height:100px; }
  .row.between{ flex-direction:column; align-items:stretch; gap:8px; }
  .block{ padding:14px; }
  .section-sub{ font-size:12px; }
  h2.section-title{ font-size:18px; }
  .table-wrap{ overflow-x:auto; }
  table.data{ min-width:500px; }
  .ap-panel{ width:100%; }
  .rm-search input{ width:100px; }
}

@media (max-width: 400px){
  .topbar .top-actions{ gap:2px; }
  .btn{ padding:5px 8px; font-size:12px; }
  .btn.sm{ padding:3px 6px; font-size:11px; }
  .content{ padding:12px 10px 80px; }
}

/* ============ Utility ============ */
.hidden{display:none!important}
.muted{color:var(--text-mute)}
.mono{font-family:ui-monospace,SFMono-Regular,Menlo,monospace;font-size:12px}

/* Admin elements are ALWAYS hidden via CSS until body gets .is-admin class */
#adminControls,
#healthCheckBtn,
#claimAdminBtn,
#removeAdminBtn,
#adminMigrationBlock,
#telegramAdminBlock { display:none!important; }
body.is-admin #adminControls,
body.is-admin #healthCheckBtn,
body.is-admin #removeAdminBtn,
body.is-admin #adminMigrationBlock,
body.is-admin #telegramAdminBlock { display:flex!important; }
/* claimAdminBtn only shows when there's no admin Ã¢â¬â controlled separately */
body.show-claim-admin #claimAdminBtn { display:inline-flex!important; }

/* Sign out and email only visible when signed in */
#signOutBtn,
#userEmailDisplay { display:none!important; }
body.is-signed-in #signOutBtn,
body.is-signed-in #userEmailDisplay { display:inline-flex!important; }

/* Sign in/up buttons hidden when signed in */
body.is-signed-in #clerk-auth-actions { display:none!important; }

/* Elements that only appear when signed in (e.g. "Analyze pending queue now") */
.signed-in-only { display:none!important; }
body.is-signed-in .signed-in-only { display:inline-flex!important; }

.sp-8{height:8px}.sp-12{height:12px}.sp-16{height:16px}

/* ============ Analysis Panel (right slide-in) ============ */
.ap-overlay{
  position:fixed; inset:0;
  background:rgba(17,17,17,0.18);
  opacity:0; pointer-events:none;
  transition:opacity 0.18s ease;
  z-index:60;
}
.ap-overlay.open{ opacity:1; pointer-events:auto; }

.ap-panel{
  position:fixed; top:0; right:0; bottom:0;
  width:360px; max-width:92vw;
  background:var(--bg);
  border-left:1px solid var(--border);
  box-shadow:-4px 0 16px rgba(0,0,0,0.04);
  transform:translateX(100%);
  transition:transform 0.22s ease;
  z-index:61;
  display:flex; flex-direction:column;
}
.ap-panel.open{ transform:translateX(0); }

.ap-head{
  display:flex; align-items:center; gap:8px;
  padding:14px 16px; border-bottom:1px solid var(--border);
  flex-shrink:0;
}
.ap-head h3{
  font-size:13px; font-weight:600; color:var(--text-mute);
  text-transform:uppercase; letter-spacing:0.04em;
  margin:0;
}
.ap-close{
  margin-left:auto;
  width:28px; height:28px;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--bg); color:var(--text-2);
  display:inline-flex; align-items:center; justify-content:center;
  font-size:14px; cursor:pointer;
}
.ap-close:hover{ background:var(--bg-hover); }

.ap-body{
  flex:1; overflow-y:auto;
  padding:16px;
}
.ap-title{
  font-size:16px; font-weight:600; color:var(--text);
  line-height:1.35; margin-bottom:10px;
  word-break:break-word;
}
.ap-title a{ color:inherit; }
.ap-title a:hover{ text-decoration:underline; }

.ap-cat-row{
  display:flex; flex-wrap:wrap; gap:6px;
  margin-bottom:16px;
}

.ap-section{
  margin-bottom:18px;
}
.ap-section h4{
  font-size:11px; font-weight:600;
  color:var(--text-mute);
  text-transform:uppercase; letter-spacing:0.06em;
  margin-bottom:8px;
}
.ap-list{
  list-style:none; padding:0; margin:0;
  display:flex; flex-direction:column; gap:8px;
}
.ap-list li{
  position:relative;
  padding-left:16px;
  font-size:13px; line-height:1.55; color:var(--text-2);
}
.ap-list li::before{
  content:"";
  position:absolute; left:4px; top:9px;
  width:4px; height:4px; border-radius:50%;
  background:var(--text-mute);
}

.ap-tags{
  display:flex; flex-wrap:wrap; gap:6px;
}
.ap-tag{
  font-size:11px; padding:2px 8px;
  border:1px solid var(--border); border-radius:999px;
  color:var(--text-2); background:var(--bg-soft);
  word-break:break-all;
}

.ap-link{
  font-size:12px; color:var(--blue);
  word-break:break-all;
}
.ap-link:hover{ text-decoration:underline; }

.ap-empty{
  font-size:12px; color:var(--text-faint);
  font-style:italic;
}

.ap-foot{
  padding:10px 16px;
  border-top:1px solid var(--border);
  display:flex; gap:8px; justify-content:flex-end;
  flex-shrink:0;
}

/* clickable title styling on cards */
.hist-item .ti.ti-link{
  color:var(--text);
  text-decoration:none;
  cursor:pointer;
  display:block;
}
.hist-item .ti.ti-link:hover{
  color:var(--blue);
  text-decoration:underline;
}

/* turn the View link-styled button into a real button */
.watch-link.as-btn{
  border:0; background:none; padding:0;
  font:inherit; cursor:pointer;
}
.watch-link.as-btn:hover{ text-decoration:underline; }

@media (max-width: 600px){
  .ap-panel{ width:100%; }
}

/* ============ Enhancement Layer Styles ============ */

/* ---- Search bar in topbar ---- */
.rm-search{
  display:inline-flex; align-items:center; gap:4px;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--bg);
  padding:2px 4px 2px 8px;
  height:32px;
}
.rm-search input{
  border:0; outline:none; background:transparent;
  font-size:13px; color:var(--text);
  width:180px; padding:4px 2px;
}
.rm-search input::placeholder{ color:var(--text-faint); }
.rm-search .rm-count{
  font-size:11px; color:var(--text-mute);
  min-width:36px; text-align:center;
  padding:0 4px;
}
.rm-search .rm-nav{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px;
  border:0; border-radius:3px;
  background:transparent; color:var(--text-2);
  font-size:12px; cursor:pointer;
}
.rm-search .rm-nav:hover{ background:var(--bg-hover); }
.rm-search .rm-nav:disabled{ opacity:0.4; cursor:not-allowed; }
.rm-search .rm-clear{
  display:inline-flex; align-items:center; justify-content:center;
  width:22px; height:22px;
  border:0; border-radius:3px;
  background:transparent; color:var(--text-mute);
  font-size:13px; cursor:pointer;
}
.rm-search .rm-clear:hover{ background:var(--bg-hover); color:var(--text); }

/* Highlight markers */
mark.rm-hl{
  background:yellow;
  color:#000;
  padding:0 1px;
  border-radius:2px;
}
mark.rm-hl.active{
  background:orange;
  color:#000;
}
body.dark mark.rm-hl{ background:#facc15; color:#0f1115; }
body.dark mark.rm-hl.active{ background:#fb923c; color:#0f1115; }

/* ---- Sort dropdown in column header ---- */
.rm-sort-wrap{ position:relative; display:inline-block; }
.rm-sort-btn{
  display:inline-flex; align-items:center; gap:3px;
  padding:3px 7px;
  font-size:11px; color:var(--text-2);
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--bg);
  cursor:pointer;
}
.rm-sort-btn:hover{ background:var(--bg-hover); }
.rm-sort-btn .rm-caret{ font-size:9px; opacity:0.7; }
.rm-sort-menu{
  position:absolute; top:100%; right:0; margin-top:4px;
  min-width:130px;
  background:var(--bg);
  border:1px solid var(--border);
  border-radius:var(--radius-sm);
  box-shadow:var(--shadow);
  z-index:20;
  padding:4px;
  display:none;
}
.rm-sort-menu.open{ display:block; }
.rm-sort-opt{
  display:block; width:100%; text-align:left;
  padding:6px 8px;
  font-size:12px; color:var(--text-2);
  border:0; background:transparent; border-radius:3px;
  cursor:pointer;
}
.rm-sort-opt:hover{ background:var(--bg-hover); color:var(--text); }
.rm-sort-opt.active{ color:var(--text); font-weight:500; background:var(--bg-hover); }

/* ---- Right-side filter panel ---- */
.rm-filter-overlay{
  position:fixed; inset:0;
  background:rgba(17,17,17,0.18);
  opacity:0; pointer-events:none;
  transition:opacity 0.18s ease;
  z-index:60;
}
.rm-filter-overlay.open{ opacity:1; pointer-events:auto; }
body.dark .rm-filter-overlay{ background:rgba(0,0,0,0.45); }

.rm-filter-panel{
  position:fixed; top:0; right:0; bottom:0;
  width:320px; max-width:92vw;
  background:var(--bg);
  border-left:1px solid var(--border);
  box-shadow:-4px 0 16px rgba(0,0,0,0.04);
  transform:translateX(100%);
  transition:transform 0.22s ease;
  z-index:61;
  display:flex; flex-direction:column;
}
.rm-filter-panel.open{ transform:translateX(0); }
body.dark .rm-filter-panel{ background:#1c1f26; box-shadow:-4px 0 16px rgba(0,0,0,0.5); }

.rm-filter-head{
  display:flex; align-items:center; gap:8px;
  padding:14px 16px; border-bottom:1px solid var(--border);
  flex-shrink:0;
}
.rm-filter-head h3{
  font-size:13px; font-weight:600; color:var(--text-mute);
  text-transform:uppercase; letter-spacing:0.04em;
  margin:0;
}
.rm-filter-close{
  margin-left:auto;
  width:28px; height:28px;
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--bg); color:var(--text-2);
  display:inline-flex; align-items:center; justify-content:center;
  font-size:14px; cursor:pointer;
}
.rm-filter-close:hover{ background:var(--bg-hover); }

.rm-filter-body{
  flex:1; overflow-y:auto;
  padding:16px;
}
.rm-filter-section{ margin-bottom:18px; }
.rm-filter-section h4{
  font-size:11px; font-weight:600;
  color:var(--text-mute);
  text-transform:uppercase; letter-spacing:0.06em;
  margin-bottom:8px;
}
.rm-filter-list{ display:flex; flex-direction:column; gap:4px; }
.rm-filter-opt{
  display:flex; align-items:center; justify-content:space-between;
  padding:7px 10px;
  font-size:13px; color:var(--text-2);
  border:1px solid var(--border); border-radius:var(--radius-sm);
  background:var(--bg);
  cursor:pointer;
  text-align:left;
}
.rm-filter-opt:hover{ background:var(--bg-hover); color:var(--text); }
.rm-filter-opt.active{
  background:var(--text); color:var(--accent-fg);
  border-color:var(--text);
}
body.dark .rm-filter-opt.active{ background:#e5e7eb; color:#0f1115; border-color:#e5e7eb; }
.rm-filter-grid{
  display:grid; grid-template-columns:repeat(3,1fr); gap:6px;
}
.rm-filter-foot{
  padding:10px 16px;
  border-top:1px solid var(--border);
  display:flex; gap:8px; justify-content:space-between;
  flex-shrink:0;
}

/* Active filter indicator dot on the topbar button */
.rm-filter-trigger{ position:relative; }
.rm-filter-trigger .rm-filter-dot{
  position:absolute; top:4px; right:4px;
  width:6px; height:6px; border-radius:50%;
  background:var(--blue);
  display:none;
}
.rm-filter-trigger.has-filter .rm-filter-dot{ display:block; }

@media (max-width: 600px){
  .rm-filter-panel{ width:100%; }
  .rm-search input{ width:120px; }
}

/* ============ History Redesign - Board ============ */
.history-board {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: var(--sp-xl) var(--sp-2xl);
}

@media (max-width: 640px) {
  .history-board { grid-template-columns: 1fr; padding: var(--sp-lg); gap: var(--sp-lg); }
}

/* History card */
.hist-card {
  position: relative;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  padding: var(--sp-md) var(--sp-lg);
  cursor: pointer;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.hist-card:hover {
  border-color: var(--border-strong);
  box-shadow: var(--shadow-hover);
}

.hist-card .card-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  height: 20px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.hist-card .card-title {
  margin-top: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hist-card .card-drag {
  position: absolute;
  top: 50%;
  left: 6px;
  transform: translateY(-50%);
  width: 16px;
  height: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  opacity: 0;
  transition: opacity 0.15s;
  cursor: grab;
  color: var(--text-tertiary);
}
.hist-card:hover .card-drag { opacity: 1; }
.hist-card .card-drag::before,
.hist-card .card-drag::after {
  content: '⋮⋮';
  font-size: 10px;
  line-height: 1;
}
.hist-card .card-drag::after { display: none; }

.hist-card .card-kebab {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 24px;
  height: 24px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 1;
  transition: background 0.15s;
  color: var(--text-tertiary);
  font-size: 14px;
}
.hist-card .card-kebab:hover { background: var(--bg-subtle); color: var(--text-secondary); }

/* Kebab dropdown menu */
.kebab-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 150px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  box-shadow: 0 8px 24px rgba(0,0,0,0.12), 0 2px 8px rgba(0,0,0,0.08);
  z-index: 9999;
  padding: 4px;
  display: none;
}
.kebab-menu.open { display: block; }
.kebab-menu button {
  display: block;
  width: 100%;
  padding: 9px 14px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 13px;
  color: var(--text-primary);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.1s;
}
.kebab-menu button:hover { background: var(--bg-subtle); }
.kebab-menu button.danger { color: var(--danger); }
.kebab-menu button.danger:hover { background: var(--danger-bg); }

/* History toolbar refinement */

/* Filter chips */
#catFilter {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
#catFilter .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
#catFilter .chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
#catFilter .chip.active {
  background: var(--text-primary);
  color: var(--bg-surface);
  border-color: var(--text-primary);
}
#catFilter .chip .chip-count {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
}
.history-toolbar-v2 {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  padding: var(--sp-lg) var(--sp-2xl);
  flex-wrap: wrap;
}

.history-toolbar-v2 .seg-control {
  display: flex;
  background: var(--bg-subtle);
  padding: 4px;
  border-radius: var(--radius-sm);
}
.history-toolbar-v2 .seg-control button {
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 500;
  border: none;
  background: transparent;
  border-radius: 4px;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all 0.15s;
}
.history-toolbar-v2 .seg-control button.on {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

.history-toolbar-v2 .add-cat-btn {
  height: 36px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  background: var(--clr-accent);
  color: var(--bg-surface);
  font-size: 13px;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: opacity 0.15s;
}
.history-toolbar-v2 .add-cat-btn:hover { opacity: 0.85; }

/* Filter chips v2 */
.cat-filter-v2 {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
  flex-wrap: wrap;
  padding: 0 var(--sp-2xl) var(--sp-lg);
}
.cat-filter-v2 .chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.15s;
}
.cat-filter-v2 .chip:hover { border-color: var(--border-strong); }
.cat-filter-v2 .chip.active {
  background: var(--clr-accent);
  color: var(--bg-surface);
  border-color: var(--clr-accent);
}
.cat-filter-v2 .chip .chip-count {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
}

/* History list view v2 */
.hist-list-v2 {
  padding: var(--sp-lg) var(--sp-2xl);
}
.hist-list-v2 .list-row {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s;
}
.hist-list-v2 .list-row:hover {
  background: var(--bg-subtle);
  border-color: var(--border-default);
}
.hist-list-v2 .list-row .row-chip {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  height: 20px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  flex-shrink: 0;
}
.hist-list-v2 .list-row .row-title {
  flex: 1;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-list-v2 .list-row .row-kebab {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  opacity: 0;
  color: var(--text-tertiary);
  font-size: 16px;
  transition: opacity 0.15s, background 0.15s;
  position: relative;
}
.hist-list-v2 .list-row:hover .row-kebab { opacity: 1; }
.hist-list-v2 .list-row .row-kebab:hover { background: var(--bg-subtle); }

@media (max-width: 640px) {
  .history-toolbar-v2 { padding: var(--sp-md) var(--sp-lg); }
  .cat-filter-v2 { padding: 0 var(--sp-lg) var(--sp-md); }
  .hist-list-v2 { padding: var(--sp-md) var(--sp-lg); }
}

/* =========================================================
   History Redesign — Board, Cards, Toolbar, List
   ========================================================= */

/* --- History Toolbar --- */
.history-toolbar {
  display: flex;
  align-items: center;
  gap: var(--sp-lg);
  padding: var(--sp-lg) 0;
  flex-wrap: wrap;
}

/* --- Filter Chips --- */
.cat-chip {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-xs);
  padding: 6px 14px;
  border-radius: 20px;
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  line-height: 1;
}
.cat-chip:hover {
  border-color: var(--border-strong);
  color: var(--text-primary);
}
.cat-chip.active {
  background: var(--text-primary);
  color: var(--bg-surface);
  border-color: var(--text-primary);
}
.cat-chip .n {
  font-size: 11px;
  font-weight: 600;
  opacity: 0.7;
}

/* --- View Switch (segmented control) --- */
.view-switch {
  display: flex;
  background: var(--bg-subtle);
  padding: 3px;
  border-radius: var(--radius-sm);
  gap: 2px;
}
.view-switch button {
  padding: 6px 14px;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: var(--fs-caption);
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
}
.view-switch button.on {
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: var(--shadow-card);
}

/* --- Board Grid --- */
.history-board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: var(--sp-xl) 0;
}

/* --- Category Column --- */
.cat-column {
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-default);
  background: var(--bg-surface);
  display: flex;
  flex-direction: column;
  height: 420px;
  overflow: visible;
  position: relative;
  transition: border-color 0.15s ease;
}
.cat-column.drag-over {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(24,24,27,0.08);
}

.cat-column-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--sp-lg) var(--sp-xl);
  border-bottom: 1px solid var(--bg-subtle);
}
.cat-column-head .cat-col-title {
  display: flex;
  align-items: center;
  gap: var(--sp-sm);
}
.cat-column-head .cat-col-title h2 {
  font-size: var(--fs-h3);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0;
  line-height: var(--lh-h3);
}
.cat-column-head .cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: var(--bg-subtle);
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
}

/* Column kebab button */
.cat-kebab {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-tertiary);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.12s;
}
.cat-kebab:hover {
  background: var(--bg-subtle);
  color: var(--text-secondary);
}

/* Column body (cards stack) */
.cat-column-body {
  padding: var(--sp-sm);
  display: flex;
  flex-direction: column;
  gap: var(--sp-sm);
  flex: 1;
  overflow-y: auto;
}

/* Drop zone */
.cat-column-drop {
  min-height: 24px;
  border-radius: var(--radius-sm);
  border: 1px dashed var(--border-default);
  display: grid;
  place-items: center;
  font-size: 10px;
  color: var(--text-tertiary);
  transition: border-color 0.15s, color 0.15s;
  padding: 4px;
  margin-top: auto;
}
.cat-column.drag-over .cat-column-drop {
  border-color: var(--accent);
  color: var(--text-secondary);
}

/* --- Card (duplicate removed — using first block above) --- */

/* --- Kebab Dropdown Menu --- */
.card-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  min-width: 140px;
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-hover);
  z-index: 100;
  padding: 4px;
  display: none;
}
.card-menu.open { display: block; }
.card-menu-item {
  display: block;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: var(--fs-caption);
  color: var(--text-primary);
  border-radius: 4px;
  cursor: pointer;
  transition: background 0.1s;
}
.card-menu-item:hover { background: var(--bg-subtle); }
.card-menu-item.danger { color: var(--danger); }
.card-menu-item.danger:hover { background: var(--danger-bg); }

/* --- List View --- */
.hist-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: var(--sp-lg) 0;
}
.hist-list-v2-row {
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  align-items: center;
  gap: var(--sp-lg);
  padding: var(--sp-md) var(--sp-lg);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background 0.1s;
}
.hist-list-v2-row:hover {
  background: var(--bg-subtle);
}
.hist-list-v2-row .hist-list-v2-title {
  font-size: var(--fs-body);
  font-weight: 500;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.hist-list-v2-row .hist-list-v2-actions {
  display: flex;
  gap: var(--sp-sm);
  opacity: 0;
  transition: opacity 0.12s;
}
.hist-list-v2-row:hover .hist-list-v2-actions {
  opacity: 1;
}

/* Responsive */
@media (max-width: 640px) {
  .history-board {
    grid-template-columns: 1fr;
    gap: var(--sp-lg);
  }
}
@media (min-width: 641px) and (max-width: 1024px) {
  .history-board {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (min-width: 1025px) and (max-width: 1440px) {
  .history-board {
    grid-template-columns: repeat(3, 1fr);
  }
}
@media (min-width: 1441px) {
  .history-board {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* =========================================================
   Mobile UI Overhaul — max-width: 768px only
   ========================================================= */

/* --- Mobile Landing Page --- */
.mobile-landing {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  background: #0a0a0a;
  color: #FFFFFF;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  overflow: hidden;
}
/* Radial glow on mobile landing too */
.mobile-landing::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 40% at 50% 20%, rgba(139,92,246,0.10), transparent);
  pointer-events: none;
}
.landing-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px;
  gap: 24px;
  max-width: 320px;
}
.landing-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.landing-logo h1 {
  font-size: 34px;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  letter-spacing: -0.03em;
}
.landing-logo p {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  margin: 0;
  max-width: 280px;
  line-height: 1.5;
}
.landing-start-btn {
  display: block;
  width: 100%;
  max-width: 280px;
  padding: 16px 32px;
  border-radius: 16px;
  border: none;
  background: #FFFFFF;
  color: #000000;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(255,255,255,0.15);
  transition: transform 0.15s;
}
.landing-start-btn:active {
  transform: scale(0.98);
}
.landing-sub {
  font-size: 13px;
  color: rgba(255,255,255,0.40);
  margin: 0;
  line-height: 1.5;
  max-width: 260px;
}
.landing-actions {
  display: flex;
  align-items: center;
  gap: 20px;
}
.landing-link {
  background: none;
  border: none;
  color: rgba(255,255,255,0.80);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-color: rgba(255,255,255,0.30);
  padding: 4px;
}
.landing-link:hover {
  color: #FFFFFF;
}

/* --- Bottom Sheet --- */
.bottom-sheet-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 9998;
}
.bottom-sheet-overlay.open {
  display: block;
}
.bottom-sheet {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-surface, #FFFFFF);
  border-radius: 16px 16px 0 0;
  z-index: 9999;
  transform: translateY(100%);
  transition: transform 0.3s ease;
  padding: 12px 16px;
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
}
.bottom-sheet.open {
  transform: translateY(0);
}
.bs-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: #D4D4D8;
  margin: 0 auto 16px;
}
.bs-content {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.bs-item {
  display: block;
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: none;
  background: transparent;
  text-align: left;
  font-size: 15px;
  color: var(--text-primary, #18181B);
  border-radius: 8px;
  cursor: pointer;
  transition: background 0.1s;
}
.bs-item:hover {
  background: var(--bg-subtle, #F4F4F5);
}
.bs-danger {
  color: var(--danger, #DC2626);
}
.bs-divider {
  height: 1px;
  background: var(--border-default, #E4E4E7);
  margin: 4px 0;
}

body.dark .bottom-sheet {
  background: #1c1f26;
}
body.dark .bs-handle {
  background: #52525B;
}
body.dark .bs-item:hover {
  background: #27272A;
}

/* --- Mobile-specific styles (768px and below) --- */
@media (max-width: 768px) {

  /* Safe areas */
  body {
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
  }

  /* Full-screen sections */
  .content {
    height: calc(100vh - 56px - 64px - env(safe-area-inset-bottom));
    overflow-y: auto;
    padding: 16px 14px 16px;
  }
  .view {
    min-height: 100%;
  }

  /* Bottom Navigation Redesign */
  .mobile-nav {
    display: block;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    padding-bottom: env(safe-area-inset-bottom);
    background: rgba(255, 255, 255, 0.85);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    backdrop-filter: blur(20px) saturate(180%);
    border-top: 1px solid var(--border);
    z-index: 50;
  }
  body.dark .mobile-nav {
    background: rgba(15, 17, 21, 0.85);
  }
  .mobile-nav .nav-items {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    height: 64px;
    align-items: center;
  }
  .mobile-nav .mob-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 6px 0;
    font-size: 10px;
    font-weight: 500;
    color: var(--text-mute);
    cursor: pointer;
    border: 0;
    background: none;
    border-radius: 0;
    position: relative;
  }
  .mobile-nav .mob-nav-item .mob-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 28px;
    border-radius: 14px;
    transition: background 0.2s, color 0.2s;
  }
  .mobile-nav .mob-nav-item.active .mob-icon {
    background: var(--text);
    color: var(--accent-fg);
  }
  .mobile-nav .mob-nav-item.active .mob-icon svg {
    stroke: var(--accent-fg);
  }
  .mobile-nav .mob-nav-item .mob-label {
    font-size: 10px;
    font-weight: 500;
  }
  .mobile-nav .mob-nav-item.active {
    color: var(--text);
    font-weight: 600;
  }

  /* Search bar full-width on mobile */
  .rm-search {
    flex: 1;
    min-width: 0;
  }
  .rm-search input {
    width: 100%;
    min-width: 0;
  }
  .topbar {
    position: sticky;
    top: 0;
    z-index: 5;
    padding: 8px 14px;
  }

  /* Filter chips wrap */
  #catFilter {
    flex-wrap: wrap;
    padding: 8px 0;
  }

  /* Mobile card style */
  .hist-card {
    padding: 16px;
    border-radius: 12px;
  }
  .hist-card .card-title {
    font-size: 15px;
    line-height: 22px;
  }

  /* Hide sidebar (already done at 860px but reinforce) */
  .sidebar {
    display: none;
  }
  .app {
    grid-template-columns: 1fr;
  }
}

/* Ensure landing page never shows on desktop */
@media (min-width: 769px) {
  .mobile-landing {
    display: none !important;
  }
}

/* --- Mobile Install/Sign-in Prompt (always visible on mobile in Analyze view) --- */
.mobile-install-prompt {
  display: none;
  padding: 14px 16px;
  margin-top: 12px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-md);
  background: var(--bg-subtle);
  text-align: center;
}
.mobile-install-prompt p {
  font-size: 13px;
  color: var(--text-secondary);
  margin: 0 0 12px;
  line-height: 1.5;
}
.mobile-install-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
}
.mobile-install-actions .btn-sm {
  padding: 8px 16px;
  font-size: 13px;
}

/* Show on mobile only, hide when signed in (sign-in part becomes irrelevant) */
@media (max-width: 768px) {
  .mobile-install-prompt {
    display: block;
  }
  /* Hide sign-in button inside prompt when already signed in */
  body.is-signed-in .mobile-install-prompt .btn.primary {
    display: none;
  }
}

/* Hide on desktop */
@media (min-width: 769px) {
  .mobile-install-prompt {
    display: none !important;
  }
}

/* =========================================================
   Desktop Landing Page (scroll-above-app)
   ========================================================= */
.desktop-landing {
  display: none;
  flex-direction: column;
  grid-column: 1 / -1;
}

/* Show landing for non-signed-in desktop users */
body:not(.is-signed-in) .desktop-landing {
  display: flex;
}
/* Signed-in users can still scroll up to see it */
body.is-signed-in .desktop-landing {
  display: flex;
}

/* Hide on mobile (they have their own landing) */
@media (max-width: 768px) {
  .desktop-landing {
    display: none !important;
  }
}

/* --- Hero --- */
.dl-hero {
  min-height: 90vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  background: var(--bg-page, #FAFAFA);
}
body.dark .dl-hero {
  background: var(--bg, #0f1115);
}
.dl-hero-content {
  max-width: 680px;
  text-align: center;
}
.dl-badge {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 20px;
  background: var(--bg-subtle, #F4F4F5);
  color: var(--text-secondary, #71717A);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 24px;
}
body.dark .dl-badge {
  background: #27272A;
  color: #A1A1AA;
}
.dl-headline {
  font-size: 48px;
  font-weight: 700;
  line-height: 1.15;
  color: var(--text-primary, #18181B);
  margin: 0 0 20px;
  letter-spacing: -0.02em;
}
body.dark .dl-headline {
  color: #FAFAFA;
}
.dl-subline {
  font-size: 18px;
  line-height: 1.6;
  color: var(--text-secondary, #71717A);
  margin: 0 0 36px;
}
.dl-cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
}
.dl-cta {
  padding: 14px 32px;
  border-radius: 8px;
  border: none;
  background: #18181B;
  color: #FFFFFF;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.dl-cta:hover {
  background: #000000;
}
body.dark .dl-cta {
  background: #FAFAFA;
  color: #18181B;
}
body.dark .dl-cta:hover {
  background: #FFFFFF;
}
.dl-cta-secondary {
  padding: 14px 24px;
  border-radius: 8px;
  border: 1px solid var(--border-default, #E4E4E7);
  background: transparent;
  color: var(--text-primary, #18181B);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.dl-cta-secondary:hover {
  background: var(--bg-subtle, #F4F4F5);
}

/* --- Sections --- */
.dl-section {
  padding: 80px 40px;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}
.dl-section-alt {
  background: var(--bg-subtle, #F4F4F5);
  max-width: 100%;
  padding: 80px 40px;
}
body.dark .dl-section-alt {
  background: #1c1f26;
}
.dl-section-title {
  font-size: 32px;
  font-weight: 700;
  color: var(--text-primary, #18181B);
  text-align: center;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
body.dark .dl-section-title {
  color: #FAFAFA;
}
.dl-section-sub {
  font-size: 16px;
  color: var(--text-secondary, #71717A);
  text-align: center;
  margin: 0 0 48px;
}

/* --- Steps --- */
.dl-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 900px;
  margin: 0 auto;
}
.dl-step {
  text-align: center;
  padding: 24px;
}
.dl-step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #18181B;
  color: #FFFFFF;
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
}
body.dark .dl-step-num {
  background: #FAFAFA;
  color: #18181B;
}
.dl-step h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-primary, #18181B);
  margin: 0 0 8px;
}
body.dark .dl-step h3 {
  color: #FAFAFA;
}
.dl-step p {
  font-size: 14px;
  color: var(--text-secondary, #71717A);
  line-height: 1.5;
  margin: 0;
}

/* --- Features Grid --- */
.dl-features {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 1000px;
  margin: 0 auto;
}
.dl-feature {
  padding: 24px;
  border-radius: 12px;
  background: var(--bg-surface, #FFFFFF);
  border: 1px solid var(--border-default, #E4E4E7);
}
body.dark .dl-feature {
  background: #27272A;
  border-color: #3F3F46;
}
.dl-feature-icon {
  font-size: 24px;
  margin-bottom: 12px;
}
.dl-feature h4 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary, #18181B);
  margin: 0 0 6px;
}
body.dark .dl-feature h4 {
  color: #FAFAFA;
}
.dl-feature p {
  font-size: 13px;
  color: var(--text-secondary, #71717A);
  line-height: 1.5;
  margin: 0;
}

/* --- Final CTA --- */
.dl-final-cta {
  text-align: center;
  padding: 100px 40px;
}
.dl-final-cta .dl-cta {
  margin-top: 32px;
}
.dl-final-note {
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-tertiary, #A1A1AA);
}

/* Responsive */
@media (max-width: 900px) {
  .dl-headline { font-size: 36px; }
  .dl-steps { grid-template-columns: 1fr; gap: 24px; }
  .dl-features { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .dl-features { grid-template-columns: 1fr; }
  .dl-hero { padding: 60px 20px; min-height: 80vh; }
  .dl-section { padding: 60px 20px; }
}

/* Hide sign-in button on landing when already signed in */
body.is-signed-in .dl-signin-btn {
  display: none;
}

/* Scroll-down hint at bottom of hero */
.dl-scroll-hint {
  position: absolute;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  color: var(--text-tertiary, #A1A1AA);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.15s;
  animation: dl-bounce 2s infinite;
}
.dl-scroll-hint:hover {
  color: var(--text-primary, #18181B);
}
body.dark .dl-scroll-hint:hover {
  color: #FAFAFA;
}
.dl-hero {
  position: relative;
}
@keyframes dl-bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(6px); }
}

/* --- Landing view (inside content area, beside sidebar) --- */
#view-landing {
  padding: 0;
}
.dl-hero-inline {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 60px;
}
.dl-section-inline {
  margin-bottom: 60px;
}
.dl-section-inline .dl-features {
  max-width: 100%;
}

/* Landing view now shows on mobile too (new responsive landing page) */

/* =========================================================
   NEW LANDING PAGE STYLES (lp- prefix)
   Full-width, no sidebar, conversion-focused
   ========================================================= */

/* When landing is active and user is NOT signed in, hide app chrome */
body.show-landing .sidebar { display: none !important; }
body.show-landing .topbar { display: none !important; }
body.show-landing .app { grid-template-columns: 1fr !important; }
body.show-landing .content { max-width: 100%; padding: 0; }
body.show-landing .mobile-nav { display: none !important; }

/* Hero */
.lp-hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 32px;
  text-align: center;
}
.lp-hero-inner {
  max-width: 700px;
}
.lp-headline {
  font-size: 52px;
  font-weight: 700;
  line-height: 1.12;
  color: var(--text, #111);
  margin: 0 0 24px;
  letter-spacing: -0.03em;
}
.lp-subline {
  font-size: 18px;
  line-height: 1.7;
  color: var(--text-mute, #6b7280);
  margin: 0 0 40px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
}
.lp-cta-row {
  display: flex;
  gap: 12px;
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}
.lp-cta-primary {
  padding: 14px 32px;
  border-radius: 8px;
  border: none;
  background: var(--text, #18181B);
  color: var(--accent-fg, #fff);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}
.lp-cta-primary:hover {
  background: #000;
  transform: translateY(-1px);
}
body.dark .lp-cta-primary {
  background: #FAFAFA;
  color: #18181B;
}
body.dark .lp-cta-primary:hover {
  background: #fff;
}
.lp-cta-ghost {
  padding: 14px 24px;
  border-radius: 8px;
  border: 1px solid var(--border, #e5e5e5);
  background: transparent;
  color: var(--text, #18181B);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s;
}
.lp-cta-ghost:hover {
  background: var(--bg-hover, #f4f4f5);
}

/* Sections */
.lp-section {
  max-width: 900px;
  margin: 0 auto;
  padding: 60px 32px;
}
.lp-section-label {
  font-size: 14px;
  color: var(--text, #18181B);
  text-align: center;
  margin-bottom: 24px;
  font-weight: 500;
}
.lp-section-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--text, #18181B);
  text-align: center;
  margin: 0 0 16px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.lp-section-sub {
  font-size: 16px;
  color: var(--text-mute, #6b7280);
  text-align: center;
  margin: 0 0 32px;
}

/* Video placeholder */
.lp-video-placeholder {
  max-width: 640px;
  margin: 0 auto;
}
.lp-video-box {
  aspect-ratio: 16/9;
  background: var(--bg-soft, #fafafa);
  border: 2px dashed var(--border, #e5e5e5);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: var(--text-mute, #6b7280);
  font-size: 13px;
  text-align: center;
  padding: 20px;
}
body.dark .lp-video-box {
  background: #1c1f26;
  border-color: var(--border, #2a2f3a);
}
.lp-video-play {
  font-size: 32px;
  opacity: 0.5;
}
.lp-video-text {
  max-width: 300px;
}

/* Flow: Mobile → Arrow → Desktop */
.lp-flow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 40px;
  max-width: 900px;
  margin: 0 auto;
}

/* Device shared styles */
.lp-device {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lp-device-label {
  margin-top: 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #18181B);
}
.lp-device-video {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Phone mockup */
.lp-phone .lp-device-frame {
  width: 180px;
  height: 380px;
  border: 3px solid var(--text, #18181B);
  border-radius: 28px;
  overflow: hidden;
  position: relative;
  background: #000;
}
body.dark .lp-phone .lp-device-frame {
  border-color: #71717A;
}
.lp-device-notch {
  position: absolute;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: 50px;
  height: 5px;
  border-radius: 3px;
  background: #333;
  z-index: 2;
}
.lp-device-screen {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

/* Laptop mockup */
.lp-laptop .lp-laptop-frame {
  width: 420px;
  height: 263px;
  border: 3px solid var(--text, #18181B);
  border-radius: 10px 10px 0 0;
  overflow: hidden;
  background: #000;
}
body.dark .lp-laptop .lp-laptop-frame {
  border-color: #71717A;
}
.lp-laptop-screen {
  width: 100%;
  height: 100%;
  overflow: hidden;
}
.lp-laptop-base {
  width: 460px;
  height: 14px;
  background: var(--text, #18181B);
  border-radius: 0 0 8px 8px;
}
body.dark .lp-laptop-base {
  background: #71717A;
}

/* Arrow between devices */
.lp-flow-arrow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  color: var(--text, #18181B);
  flex-shrink: 0;
}
.lp-flow-arrow-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text, #18181B);
  white-space: nowrap;
}

/* Responsive: stack vertically on smaller screens */
@media (max-width: 768px) {
  .lp-flow {
    flex-direction: column;
    gap: 24px;
  }
  .lp-flow-arrow svg {
    transform: rotate(90deg);
  }
  .lp-phone .lp-device-frame {
    width: 150px;
    height: 320px;
  }
  .lp-laptop .lp-laptop-frame {
    width: 300px;
    height: 188px;
  }
  .lp-laptop-base {
    width: 330px;
  }
}

/* Pain points */
.lp-pains {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.lp-pain {
  text-align: center;
  padding: 32px 20px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 12px;
  background: var(--bg, #fff);
}
body.dark .lp-pain {
  background: #1c1f26;
  border-color: var(--border, #2a2f3a);
}
.lp-pain-num {
  font-size: 36px;
  font-weight: 800;
  color: var(--text, #18181B);
  margin-bottom: 12px;
  letter-spacing: -0.02em;
}
.lp-pain p {
  font-size: 14px;
  color: var(--text-mute, #6b7280);
  line-height: 1.6;
  margin: 0;
}

/* Audience */
.lp-audience {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
  max-width: 600px;
  margin: 0 auto;
}
.lp-audience-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  font-size: 14px;
  color: var(--text, #18181B);
  font-weight: 500;
}
body.dark .lp-audience-item {
  border-color: var(--border, #2a2f3a);
}
.lp-audience-icon {
  font-size: 20px;
  flex-shrink: 0;
}

/* Demo section */
.lp-demo-box {
  max-width: 600px;
  margin: 0 auto 40px;
}
.lp-demo-input-row {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}
.lp-demo-input {
  flex: 1;
  padding: 12px 16px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 8px;
  font-size: 14px;
  background: var(--bg, #fff);
  color: var(--text, #18181B);
  outline: none;
}
.lp-demo-input:focus {
  border-color: var(--text-mute, #9ca3af);
}
body.dark .lp-demo-input {
  background: #1c1f26;
  border-color: var(--border, #2a2f3a);
}
.lp-demo-result {
  min-height: 0;
  transition: min-height 0.2s;
}
.lp-demo-result.has-result {
  min-height: 120px;
  padding: 20px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  background: var(--bg-soft, #fafafa);
  font-size: 13px;
  line-height: 1.6;
}
body.dark .lp-demo-result.has-result {
  background: #1c1f26;
  border-color: var(--border, #2a2f3a);
}

/* Example cards */
.lp-examples {
  max-width: 900px;
  margin: 0 auto;
}
.lp-examples-label {
  font-size: 13px;
  color: var(--text-mute, #6b7280);
  margin-bottom: 16px;
  text-align: center;
  font-weight: 500;
}
.lp-example-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.lp-example-card {
  padding: 20px;
  border: 1px solid var(--border, #e5e5e5);
  border-radius: 10px;
  background: var(--bg, #fff);
}
body.dark .lp-example-card {
  background: #1c1f26;
  border-color: var(--border, #2a2f3a);
}
.lp-example-cat {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 4px;
  background: var(--bg-hover, #f4f4f5);
  color: var(--text-mute, #6b7280);
  margin-bottom: 10px;
}
body.dark .lp-example-cat {
  background: #27272A;
}
.lp-example-card h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #18181B);
  margin: 0 0 8px;
  line-height: 1.4;
}
.lp-example-card p {
  font-size: 12px;
  color: var(--text-mute, #6b7280);
  line-height: 1.5;
  margin: 0 0 10px;
}
.lp-example-tools {
  font-size: 11px;
  color: var(--text-faint, #9ca3af);
  font-weight: 500;
}

/* Steps */
.lp-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  max-width: 800px;
  margin: 0 auto;
}
.lp-step {
  text-align: center;
}
.lp-step-num {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--text, #18181B);
  color: var(--accent-fg, #fff);
  font-size: 16px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 14px;
}
body.dark .lp-step-num {
  background: #FAFAFA;
  color: #18181B;
}
.lp-step h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--text, #18181B);
  margin: 0 0 8px;
}
body.dark .lp-step h3 {
  color: #FAFAFA;
}
.lp-step p {
  font-size: 13px;
  color: var(--text-mute, #6b7280);
  line-height: 1.5;
  margin: 0;
}

/* Final CTA */
.lp-final {
  text-align: center;
  padding: 80px 32px;
}

/* Responsive */
@media (max-width: 900px) {
  .lp-headline { font-size: 38px; }
  .lp-pains { grid-template-columns: 1fr; gap: 16px; }
  .lp-example-cards { grid-template-columns: 1fr; }
  .lp-steps { grid-template-columns: 1fr; gap: 24px; }
  .lp-audience { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .lp-hero { padding: 60px 20px; min-height: 75vh; }
  .lp-headline { font-size: 32px; }
  .lp-section { padding: 40px 20px; }
  .lp-demo-input-row { flex-direction: column; }
}

/* Landing view now shows on mobile too (new responsive landing page) */

/* =========================================================
   Mobile: Desktop Nudge Screen (after sign-in, once only)
   ========================================================= */
.desktop-nudge {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: #18181B;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
}
.nudge-content {
  text-align: center;
  padding: 32px 24px;
  max-width: 340px;
}
.nudge-icon {
  font-size: 48px;
  margin-bottom: 20px;
}
.nudge-content h2 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 12px;
  color: #FFFFFF;
}
.nudge-content p {
  font-size: 14px;
  line-height: 1.6;
  color: #A1A1AA;
  margin: 0 0 24px;
}
.nudge-link-box {
  position: relative;
  margin-bottom: 24px;
}
.nudge-link {
  width: 100%;
  padding: 12px 14px;
  border-radius: 8px;
  border: 1px solid #3F3F46;
  background: #27272A;
  color: #FAFAFA;
  font-size: 13px;
  text-align: center;
  cursor: pointer;
}
.nudge-copied {
  position: absolute;
  top: -24px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 11px;
  color: #4ADE80;
  opacity: 0;
  transition: opacity 0.3s;
}
.nudge-copied.show {
  opacity: 1;
}
.nudge-btn {
  width: 100%;
  padding: 14px;
  border-radius: 8px;
  border: none;
  background: #FFFFFF;
  color: #18181B;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.nudge-btn:hover {
  opacity: 0.9;
}

/* Only show on mobile */
@media (min-width: 769px) {
  .desktop-nudge { display: none !important; }
}

/* =========================================================
   Desktop: Persistent Mobile Install Banner
   ========================================================= */
.desktop-mobile-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 24px;
  background: var(--bg-subtle, #F4F4F5);
  border-bottom: 1px solid var(--border-default, #E4E4E7);
  font-size: 13px;
  color: var(--text-secondary, #71717A);
}
body.dark .desktop-mobile-banner {
  background: #1c1f26;
  border-color: #3F3F46;
}
.dmb-link {
  width: 260px;
  padding: 6px 10px;
  border-radius: 6px;
  border: 1px solid var(--border-default, #E4E4E7);
  background: var(--bg-surface, #FFFFFF);
  color: var(--text-primary, #18181B);
  font-size: 12px;
  cursor: pointer;
}
body.dark .dmb-link {
  background: #27272A;
  border-color: #3F3F46;
  color: #FAFAFA;
}
.dmb-dismiss {
  margin-left: auto;
  width: 24px;
  height: 24px;
  border: none;
  background: transparent;
  color: var(--text-tertiary, #A1A1AA);
  font-size: 14px;
  cursor: pointer;
  border-radius: 4px;
}
.dmb-dismiss:hover {
  background: var(--bg-hover, #F4F4F5);
  color: var(--text-primary, #18181B);
}

/* Only show on desktop */
@media (max-width: 768px) {
  .desktop-mobile-banner { display: none !important; }
}

/* =========================================================
   PREMIUM LANDING PAGE OVERRIDES
   Linear/Raycast-inspired dark mode with depth
   ========================================================= */

/* --- Accent color system --- */
:root {
  --lp-accent: #8b5cf6;
  --lp-accent-glow: rgba(139, 92, 246, 0.20);
  --lp-surface-0: #0a0a0a;
  --lp-surface-1: #111111;
  --lp-surface-2: #1a1a1a;
  --lp-border-subtle: rgba(255,255,255,0.06);
  --lp-border-default: rgba(255,255,255,0.10);
  --lp-border-strong: rgba(255,255,255,0.15);
  --lp-text-primary: rgba(255,255,255,0.95);
  --lp-text-secondary: rgba(255,255,255,0.60);
  --lp-text-tertiary: rgba(255,255,255,0.40);
}

/* --- Hero premium overhaul --- */
#view-landing {
  background: var(--lp-surface-0);
  color: var(--lp-text-primary);
  padding: 0 !important;
}

.lp-hero {
  position: relative;
  min-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 40px;
  text-align: center;
  overflow: hidden;
  background: var(--lp-surface-0);
}
/* Radial gradient glow behind hero */
.lp-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 80% 50% at 50% -20%, rgba(139,92,246,0.12), transparent);
  pointer-events: none;
}
/* Subtle noise texture via CSS (no image needed) */
.lp-hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.03'/%3E%3C/svg%3E");
  opacity: 0.4;
  mix-blend-mode: overlay;
  pointer-events: none;
}

.lp-hero-inner {
  position: relative;
  z-index: 1;
  max-width: 680px;
}

/* Eyebrow badge */
.lp-hero-inner::before {
  content: 'Free during beta \00B7 No credit card';
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 16px;
  margin-bottom: 32px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.10);
  background: rgba(255,255,255,0.05);
  font-size: 12px;
  font-weight: 500;
  color: rgba(255,255,255,0.70);
  letter-spacing: 0.01em;
}

/* Headline — gradient text */
.lp-headline {
  font-size: 56px;
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -0.03em;
  background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,0.65));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin: 0 0 24px;
}

/* Subtitle — constrained */
.lp-subline {
  font-size: 18px;
  line-height: 1.6;
  color: var(--lp-text-secondary);
  max-width: 520px;
  margin: 0 auto 40px;
}

/* CTA buttons — premium pill style */
.lp-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
}
.lp-cta-primary {
  padding: 14px 32px;
  border-radius: 999px;
  border: none;
  background: #FFFFFF;
  color: #000000;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: -0.01em;
  box-shadow: 0 8px 30px rgba(255,255,255,0.12);
  transition: all 0.3s ease;
}
.lp-cta-primary:hover {
  box-shadow: 0 8px 40px rgba(255,255,255,0.25);
  transform: translateY(-2px);
}
.lp-cta-ghost {
  padding: 14px 24px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.15);
  background: transparent;
  color: rgba(255,255,255,0.90);
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}
.lp-cta-ghost:hover {
  background: rgba(255,255,255,0.05);
  border-color: rgba(255,255,255,0.25);
}

/* --- Section spacing --- */
.lp-section {
  padding: 128px 40px;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
}
/* Gradient divider between sections */
.lp-section::before {
  content: '';
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(to right, transparent, rgba(255,255,255,0.08), transparent);
}
.lp-section:first-of-type::before {
  display: none;
}

.lp-section-title {
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--lp-text-primary);
  text-align: center;
  margin: 0 0 16px;
}
.lp-section-sub {
  font-size: 16px;
  color: var(--lp-text-secondary);
  text-align: center;
  margin: 0 0 64px;
}

/* --- Pain points / Stats — premium grid --- */
.lp-pains {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.05);
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid var(--lp-border-default);
}
.lp-pain {
  padding: 48px 32px;
  background: var(--lp-surface-0);
  text-align: center;
}
.lp-pain-num {
  font-size: 64px;
  font-weight: 800;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,0.60));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
/* Middle "0" stat — pain color */
.lp-pain:nth-child(2) .lp-pain-num {
  background: linear-gradient(to bottom, #fb7185, #e11d48);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.lp-pain p {
  font-size: 14px;
  color: var(--lp-text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* --- How it works — connected timeline --- */
.lp-steps {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: rgba(255,255,255,0.05);
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid var(--lp-border-default);
}
.lp-step {
  padding: 40px 32px;
  background: var(--lp-surface-0);
  position: relative;
  transition: background 0.2s;
}
.lp-step:hover {
  background: var(--lp-surface-1);
}
.lp-step-num {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(139,92,246,0.15), rgba(139,92,246,0.05));
  border: 1px solid rgba(139,92,246,0.20);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  color: #c4b5fd;
  margin-bottom: 20px;
}
.lp-step h3 {
  font-size: 16px;
  font-weight: 600;
  color: var(--lp-text-primary);
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.lp-step p {
  font-size: 14px;
  color: var(--lp-text-secondary);
  line-height: 1.5;
  margin: 0;
}

/* --- Example cards — premium with depth --- */
.lp-example-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.lp-example-card {
  padding: 28px;
  border-radius: 16px;
  background: linear-gradient(to bottom, rgba(255,255,255,0.04), rgba(255,255,255,0.01));
  border: 1px solid var(--lp-border-default);
  transition: all 0.3s ease;
}
.lp-example-card:hover {
  border-color: var(--lp-border-strong);
  transform: translateY(-4px);
  box-shadow: 0 20px 60px -15px rgba(0,0,0,0.5);
}
.lp-example-cat {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  background: rgba(139,92,246,0.10);
  border: 1px solid rgba(139,92,246,0.20);
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: #c4b5fd;
  margin-bottom: 16px;
}
.lp-example-card h4 {
  font-size: 17px;
  font-weight: 600;
  color: var(--lp-text-primary);
  margin: 0 0 10px;
  letter-spacing: -0.01em;
  line-height: 1.3;
}
.lp-example-card p {
  font-size: 13.5px;
  color: var(--lp-text-secondary);
  line-height: 1.55;
  margin: 0 0 20px;
}
.lp-example-tools {
  padding-top: 16px;
  border-top: 1px solid rgba(255,255,255,0.05);
  font-size: 11px;
  color: var(--lp-text-tertiary);
}

/* --- Audience section --- */
.lp-audience {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  max-width: 700px;
  margin: 0 auto;
}
.lp-audience-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.03);
  border: 1px solid var(--lp-border-default);
  font-size: 14px;
  color: var(--lp-text-secondary);
}
.lp-audience-icon {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--lp-accent);
  flex-shrink: 0;
}

/* --- Final CTA section --- */
.lp-final {
  text-align: center;
  padding: 160px 40px;
}

/* --- Demo section --- */
.lp-demo-box {
  max-width: 600px;
  margin: 0 auto;
}
.lp-demo-input-row {
  display: flex;
  gap: 8px;
}
.lp-demo-input {
  flex: 1;
  padding: 14px 16px;
  border-radius: 12px;
  border: 1px solid var(--lp-border-default);
  background: var(--lp-surface-1);
  color: var(--lp-text-primary);
  font-size: 14px;
}
.lp-demo-input:focus {
  outline: none;
  border-color: var(--lp-accent);
  box-shadow: 0 0 0 3px var(--lp-accent-glow);
}

/* --- Responsive --- */
@media (max-width: 768px) {
  .lp-hero { min-height: 85vh; padding: 60px 20px; }
  .lp-headline { font-size: 34px; }
  .lp-subline { font-size: 15px; max-width: 300px; }
  .lp-section { padding: 72px 20px; }
  .lp-pains { grid-template-columns: 1fr; }
  .lp-pain-num { font-size: 48px; }
  .lp-steps { grid-template-columns: 1fr; }
  .lp-audience { grid-template-columns: 1fr; }
  .lp-example-cards { grid-template-columns: 1fr; }
  .lp-cta-primary {
    max-width: 280px;
    width: 100%;
    box-shadow: 0 8px 32px rgba(255,255,255,0.15);
  }
  .lp-cta-row { flex-direction: column; gap: 12px; }
  .lp-demo-input-row { flex-direction: column; }
  .lp-hero-inner::before { font-size: 11px; padding: 5px 12px; margin-bottom: 24px; }
}


/* =========================================================
   Results Card — Redesigned
   Modern glassmorphism card with proper hierarchy.
   All text visible, no overflow hidden on content.
   ========================================================= */
.result-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg, 14px);
  overflow: visible;
  margin-bottom: 16px;
  box-shadow: var(--shadow-card);
  background: var(--bg-surface, var(--bg));
  transition: box-shadow 0.2s ease;
}
.result-card:hover {
  box-shadow: var(--shadow-hover);
}

/* Card header */
.result-card__header {
  padding: 20px 24px 16px;
  background: var(--bg-subtle, var(--bg-soft));
  border-bottom: 1px solid var(--border-default, var(--border));
  border-radius: var(--radius-lg, 14px) var(--radius-lg, 14px) 0 0;
}

.result-card__badges {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}

.result-card__badge {
  display: inline-flex;
  align-items: center;
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  border: 1px solid transparent;
}
.result-card__badge--ok {
  background: var(--green-bg);
  color: var(--green);
  border-color: rgba(74, 222, 128, 0.2);
}
.result-card__badge--category {
  background: var(--bg-hover, #f4f4f5);
  color: var(--text-2, var(--text-secondary));
  border-color: var(--border);
}

.result-card__title {
  font-size: 17px;
  font-weight: 600;
  color: var(--text, var(--text-primary));
  margin: 0 0 6px;
  line-height: 1.4;
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.result-card__url {
  font-size: 12px;
  color: var(--blue);
  word-break: break-all;
  text-decoration: none;
  display: block;
}
.result-card__url:hover {
  text-decoration: underline;
}

/* Takeaways section */
.result-card__body {
  padding: 20px 24px;
}

.result-card__section-label {
  font-size: 10px;
  font-weight: 600;
  color: var(--text-mute, var(--text-tertiary));
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.result-card__takeaways {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.result-card__takeaway {
  position: relative;
  padding-left: 18px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-2, var(--text-secondary));
  word-wrap: break-word;
  overflow-wrap: break-word;
}
.result-card__takeaway::before {
  content: '';
  position: absolute;
  left: 4px;
  top: 8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--blue);
}

/* Tags section */
.result-card__tags {
  padding: 0 24px 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.result-card__tag {
  display: inline-flex;
  align-items: center;
  font-size: 12px;
  font-weight: 500;
  padding: 4px 12px;
  border-radius: 6px;
  background: var(--blue-bg);
  color: var(--blue);
  border: 1px solid rgba(96, 165, 250, 0.2);
  white-space: nowrap;
}

/* Footer (sign-up prompt for anonymous users) */
.result-card__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border-default, var(--border));
  background: var(--bg-subtle, var(--bg-soft));
  text-align: center;
  border-radius: 0 0 var(--radius-lg, 14px) var(--radius-lg, 14px);
}
.result-card__footer p {
  margin: 0 0 8px;
}
.result-card__footer-title {
  font-size: 14px;
  font-weight: 500;
  color: var(--text, var(--text-primary));
}
.result-card__footer-sub {
  font-size: 12px;
  color: var(--text-mute, var(--text-tertiary));
  margin-bottom: 12px;
}

/* Dark mode enhancements */
body.dark .result-card {
  background: #13151a;
  border-color: #2a2f3a;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}
body.dark .result-card:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}
body.dark .result-card__header {
  background: #0f1115;
  border-bottom-color: #2a2f3a;
}
body.dark .result-card__badge--ok {
  background: rgba(20, 83, 45, 0.6);
  color: #86efac;
  border-color: rgba(134, 239, 172, 0.2);
}
body.dark .result-card__badge--category {
  background: #1e2028;
  color: #a1a1aa;
  border-color: #3a3f4b;
}
body.dark .result-card__tag {
  background: rgba(30, 58, 138, 0.4);
  color: #93c5fd;
  border-color: rgba(147, 197, 253, 0.2);
}
body.dark .result-card__footer {
  background: #0f1115;
  border-top-color: #2a2f3a;
}

/* Responsive */
@media (max-width: 600px) {
  .result-card__header,
  .result-card__body,
  .result-card__tags,
  .result-card__footer {
    padding-left: 16px;
    padding-right: 16px;
  }
  .result-card__title {
    font-size: 15px;
  }
}
