/* ===================================================================
   BG Advantage — Proof of Concept
   Styled to the production BG Advantage design language (DESIGN.md):
   navy intelligence dashboard, left sidebar shell, mono numerics,
   colored stat-card accents. Kept scoped to the demo's three screens.
   =================================================================== */

:root {
  --bg:        #0B1120;   /* bg-deepest */
  --bg-grad:   radial-gradient(1200px 640px at 80% -14%, #102544 0%, #0B1120 58%);
  --bg-deep:   #0F1729;   /* sidebar / wells */
  --panel:     #151E31;   /* bg-card */
  --panel-2:   #1A2540;   /* bg-card-hover */
  --panel-3:   #1F2D47;   /* bg-elevated */
  --input:     #111827;   /* bg-input */
  --border:    #1E293B;   /* border-subtle */
  --border-2:  #334155;   /* border-medium */
  --text:      #E2E8F0;   /* text-primary */
  --text-2:    #94A3B8;   /* text-secondary */
  --muted:     #64748B;   /* text-muted */
  --navy:      #1E3A5F;   /* blue-800 */
  --navy-2:    #0C2340;   /* blue-900 */
  --brand-600: #2E6BB0;   /* interactive */
  --accent:    #4A90D9;   /* blue-500 primary action / focus */
  --accent-2:  #6AADEC;   /* blue-400 */
  --good:      #34D399;   /* approved */
  --good-bg:   rgba(52,211,153,.10);
  --warn:      #FBBF24;   /* flagged */
  --warn-bg:   rgba(251,191,36,.10);
  --bad:       #EF4444;   /* rejected */
  --violet:    #A78BFA;   /* moved */
  --cyan:      #38BDF8;   /* new */
  --red-dot:   #E84545;   /* signature rising red dot */
  --gold:      #E7C873;   /* law-school prestige tier */
  --radius:    12px;
  --radius-lg: 10px;
  --shadow:    0 4px 16px rgba(0,0,0,.5);
  --shadow-glow: 0 0 20px rgba(74,144,217,.15);
  --font:      "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  /* JetBrains Mono → graceful fall back to the platform mono. Numbers, scores
     and codes use this for the "data terminal" feel of the production app. */
  --font-mono: "JetBrains Mono", ui-monospace, "SF Mono", "Cascadia Code", Menlo, Consolas, monospace;
  --sidebar-w: 232px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }

/* mono numerics — the single biggest tell of the production design language */
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; letter-spacing: -.2px; }

/* ---------------- Inline icons (Lucide-style, offline-safe) ---------------- */
.ico {
  width: 18px; height: 18px; flex: none;
  stroke: currentColor; fill: none; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
  vertical-align: middle;
}
.ico-sm { width: 15px; height: 15px; }
.ico-lg { width: 22px; height: 22px; }
.ico-xl { width: 46px; height: 46px; stroke-width: 1.25; }
@keyframes spin { to { transform: rotate(360deg); } }
.ico-spin { animation: spin .9s linear infinite; }

/* =================================================================== */
/* App shell                                                            */
/* =================================================================== */
.app { display: grid; grid-template-columns: var(--sidebar-w) 1fr; min-height: 100vh; }

/* ---------------- Sidebar ---------------- */
.sidebar {
  background: var(--bg-deep);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  position: sticky; top: 0; height: 100vh;
}
.logo { display: flex; align-items: center; gap: 11px; padding: 20px 18px; }
.logo-mark { width: 34px; height: 34px; flex: none; filter: drop-shadow(0 2px 6px rgba(74,144,217,.35)); }
.logo-title { font-weight: 700; font-size: 15px; letter-spacing: -.2px; line-height: 1.1; }
.logo-sub { font-size: 9.5px; font-weight: 600; letter-spacing: 2.5px; color: var(--muted); margin-top: 2px; }

.nav { padding: 6px 0; flex: 1; }
.nav-group { margin-bottom: 14px; }
.nav-label {
  font-size: 10.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px;
  color: var(--muted); padding: 8px 20px 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 11px; width: calc(100% - 16px);
  margin: 2px 8px; padding: 9px 12px; border-radius: 8px;
  background: none; border: none; cursor: pointer; text-align: left;
  color: var(--text-2); font-family: var(--font); font-size: 13.5px; font-weight: 500;
  transition: background .15s ease, color .15s ease;
}
.nav-item .ico { color: var(--text-2); transition: color .15s ease; }
.nav-item:hover { background: var(--panel); color: var(--text); }
.nav-item:hover .ico { color: var(--text); }
.nav-item.is-active {
  background: linear-gradient(90deg, rgba(74,144,217,.16), rgba(74,144,217,.05));
  color: var(--accent-2); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.nav-item.is-active .ico { color: var(--accent-2); }

.sidebar-foot { padding: 16px 18px; border-top: 1px solid var(--border); }
.badge {
  display: inline-block;
  font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px;
  padding: 4px 10px; border-radius: 999px;
}
.badge-poc { background: rgba(167,139,250,.16); color: var(--violet); border: 1px solid rgba(167,139,250,.3); }
.data-note { font-size: 11.5px; color: var(--text-2); display: flex; align-items: center; gap: 7px; margin-top: 10px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 8px var(--good); flex: none; }

/* ---------------- Main column ---------------- */
.main { min-width: 0; display: flex; flex-direction: column; background: var(--bg); }
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 28px; height: 60px; flex: none;
  border-bottom: 1px solid var(--border);
  background: rgba(15,23,41,.7); backdrop-filter: blur(8px);
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 17px; font-weight: 700; letter-spacing: -.2px; }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.icon-btn {
  width: 34px; height: 34px; display: grid; place-items: center;
  background: none; border: 1px solid transparent; border-radius: 8px; cursor: default;
  color: var(--text-2);
}
.icon-btn:hover { background: var(--panel); color: var(--text); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%;
  display: grid; place-items: center; font-size: 11px; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--navy), var(--accent));
  box-shadow: 0 2px 8px rgba(74,144,217,.35);
}

.content { padding: 28px; max-width: 1280px; width: 100%; margin: 0 auto; flex: 1; }
.view { display: none; animation: fade .25s ease; }
.view.is-active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.view-head h1 { font-size: 23px; font-weight: 700; margin: 0 0 7px; letter-spacing: -.4px; }
.view-head p { margin: 0 0 22px; color: var(--text-2); max-width: 780px; font-size: 13.5px; }

/* ---------------- Pipeline strip (inside Enrichment view) ---------------- */
.pipeline {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 16px; margin-bottom: 20px;
  border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel);
}
.pipe-step {
  display: flex; align-items: center; gap: 11px;
  padding: 9px 14px; border: 1px solid var(--border); border-radius: 10px; background: var(--bg-deep);
}
.pipe-step.is-engine { border-color: rgba(74,144,217,.5); background: linear-gradient(180deg, rgba(74,144,217,.12), var(--bg-deep)); }
.pipe-step.is-engine .pipe-ico { color: var(--accent-2); }
.pipe-ico { color: var(--text-2); }
.pipe-label b { display: block; font-size: 13px; }
.pipe-label span { font-size: 11px; color: var(--muted); }
.pipe-arrow { color: var(--border-2); margin: 0 2px; }

/* ---------------- Buttons ---------------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font); font-weight: 600; font-size: 13px;
  border-radius: 8px; border: 1px solid var(--border-2); cursor: pointer;
  padding: 9px 16px; background: var(--panel-2); color: var(--text);
  transition: background .15s ease, border-color .15s ease, box-shadow .15s ease;
}
.btn:hover { border-color: var(--accent); }
.btn-primary { background: linear-gradient(135deg, var(--accent), var(--brand-600)); border: none; color: #fff; box-shadow: 0 6px 18px rgba(46,107,176,.35); }
.btn-primary:hover { box-shadow: 0 6px 22px rgba(46,107,176,.5), var(--shadow-glow); }
.btn-primary:disabled { opacity: .85; cursor: default; }
.btn-lg { padding: 13px 24px; font-size: 14.5px; }

/* ---------------- Run zone ---------------- */
.run-zone { text-align: center; padding: 32px 24px 28px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.run-zone .btn-lg { display: inline-flex; }
.run-hint { margin-top: 14px; color: var(--muted); font-size: 12.5px; }

.csv-drop {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  max-width: 560px; margin: 0 auto; padding: 30px 24px;
  border: 1.5px dashed var(--border-2); border-radius: var(--radius); background: var(--bg-deep);
  transition: border-color .15s, background .15s;
}
.csv-drop.drag { border-color: var(--accent); background: rgba(74,144,217,.08); }
.csv-drop-ico { color: var(--accent-2); }
.csv-drop-main { font-size: 15px; font-weight: 700; color: var(--text); margin-top: 2px; }
.csv-drop-sub { font-size: 12.5px; color: var(--text-2); max-width: 420px; }
.csv-drop .btn { margin-top: 10px; }
.run-or { display: flex; align-items: center; gap: 12px; max-width: 560px; margin: 16px auto; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: 1px; }
.run-or::before, .run-or::after { content: ""; flex: 1; height: 1px; background: var(--border); }

.source-banner {
  display: flex; align-items: center; gap: 9px; margin-bottom: 16px;
  padding: 10px 14px; border-radius: 10px; font-size: 13px; color: var(--text);
  background: var(--good-bg); border: 1px solid rgba(52,211,153,.3);
}
.source-banner .ico { color: var(--good); }
.source-banner b { font-weight: 700; }

/* ---------------- Stat cards (colored top accents, mono numbers) ---------------- */
.stat-cards { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 18px; }
.stat-card {
  position: relative; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px 18px 16px; overflow: hidden;
}
.stat-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 2px; background: var(--accent); }
.stat-card.good::before   { background: var(--good); }
.stat-card.warn::before   { background: var(--warn); }
.stat-card.violet::before { background: var(--violet); }
.stat-card.cyan::before   { background: var(--cyan); }
.stat-label { font-size: 10.5px; color: var(--text-2); text-transform: uppercase; letter-spacing: .8px; font-weight: 600; }
.stat-num { font-family: var(--font-mono); font-size: 34px; font-weight: 700; letter-spacing: -1px; margin-top: 8px; line-height: 1; }
@media (max-width: 1040px) { .stat-cards { grid-template-columns: repeat(2,1fr); } }

/* ---------------- Callout ---------------- */
.callout {
  background: linear-gradient(180deg, rgba(251,191,36,.08), var(--panel));
  border: 1px solid rgba(251,191,36,.28); border-left: 3px solid var(--warn); border-radius: var(--radius);
  padding: 14px 18px; margin-bottom: 20px; font-size: 13.5px; color: var(--text);
}
.callout b { color: var(--warn); }

/* ---------------- Table controls ---------------- */
.table-controls { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 12px; flex-wrap: wrap; }
.filters { display: flex; gap: 6px; flex-wrap: wrap; }
.filter-pill {
  font-size: 12px; font-weight: 600; padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--panel); color: var(--text-2); cursor: pointer;
  transition: background .12s, border-color .12s, color .12s;
}
.filter-pill:hover { border-color: var(--border-2); color: var(--text); }
.filter-pill.is-active { background: rgba(74,144,217,.16); border-color: var(--accent); color: var(--accent-2); }
.filter-pill .cnt { opacity: .7; margin-left: 5px; font-family: var(--font-mono); }
.search-wrap { position: relative; display: flex; align-items: center; }
.search-ico { position: absolute; left: 11px; color: var(--muted); pointer-events: none; }
.search {
  background: var(--input); border: 1px solid var(--border); border-radius: 8px;
  padding: 9px 13px 9px 32px; color: var(--text); font-family: var(--font); font-size: 13px; min-width: 240px;
}
.search:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(74,144,217,.25); }

/* ---------------- Data table ---------------- */
.table-wrap { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.data-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.data-table thead th {
  text-align: left; padding: 11px 14px; font-size: 11px; text-transform: uppercase; letter-spacing: .5px;
  color: var(--muted); background: var(--bg-deep); border-bottom: 1px solid var(--border-2); font-weight: 700;
}
.th-unit { font-family: var(--font-mono); text-transform: none; letter-spacing: 0; opacity: .7; }
.col-score { width: 156px; }
.data-table tbody td { padding: 11px 14px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data-table tbody tr { cursor: pointer; transition: background .12s ease; }
.data-table tbody tr:hover { background: var(--panel-2); }
.data-table tbody tr:last-child td { border-bottom: none; }
.cand-name { font-weight: 600; }
.cand-sub { font-size: 11.5px; color: var(--muted); }
.title-cell { color: var(--text-2); max-width: 220px; }
.title-strike { color: var(--muted); }
.table-empty { padding: 40px; text-align: center; color: var(--muted); }

/* ---------------- Chips ---------------- */
.chip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 600; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--panel-3); white-space: nowrap;
}
.chip-good { background: var(--good-bg); border-color: rgba(52,211,153,.4); color: var(--good); }
.chip-warn { background: var(--warn-bg); border-color: rgba(251,191,36,.4); color: var(--warn); }
.chip-accent { background: rgba(74,144,217,.14); border-color: rgba(74,144,217,.4); color: var(--accent-2); }
.chip-violet { background: rgba(167,139,250,.14); border-color: rgba(167,139,250,.4); color: var(--violet); }
.chip-cyan { background: rgba(56,189,248,.14); border-color: rgba(56,189,248,.4); color: var(--cyan); }
.chip-muted { background: var(--panel-3); border-color: var(--border); color: var(--muted); }
.conf-dot { width: 6px; height: 6px; border-radius: 50%; display: inline-block; }
.conf-high { background: var(--good); }
.conf-low { background: var(--warn); }

/* ---------------- Score cell (flex row, no wrap) ---------------- */
/* The score is PARTIAL during enrichment: law-school + firm pedigree (≈half the
   points) are zero until a resume is attached. The hatched segment shows that
   resume-completable headroom, and the "partial" tag makes it explicit. */
.score-cell { display: flex; align-items: center; gap: 8px; }
.score-bar { position: relative; width: 64px; height: 6px; border-radius: 999px; background: var(--panel-3); overflow: hidden; flex: none; }
.score-fill { position: absolute; left: 0; top: 0; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--accent), var(--cyan)); }
.score-pending { position: absolute; top: 0; height: 100%; background: repeating-linear-gradient(45deg, var(--border-2) 0, var(--border-2) 3px, transparent 3px, transparent 6px); }
.score-val { font-family: var(--font-mono); font-size: 13px; font-weight: 700; white-space: nowrap; }
.score-partial { font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; color: var(--muted); border: 1px solid var(--border); border-radius: 4px; padding: 1px 5px; white-space: nowrap; }
.moved-tag { font-size: 10px; font-weight: 700; color: var(--warn); margin-left: 6px; white-space: nowrap; }

/* ---------------- Drawer ---------------- */
.drawer-overlay { position: fixed; inset: 0; background: rgba(5,7,12,.6); backdrop-filter: blur(2px); z-index: 40; animation: fade .2s ease; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100vh; width: 560px; max-width: 94vw;
  background: var(--panel); border-left: 1px solid var(--border); z-index: 50;
  box-shadow: var(--shadow); overflow-y: auto; animation: slideIn .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes slideIn { from { transform: translateX(100%); } to { transform: none; } }
.drawer-close { position: absolute; top: 16px; right: 16px; display: grid; place-items: center; background: var(--panel-2); border: 1px solid var(--border); color: var(--text-2); width: 32px; height: 32px; border-radius: 8px; cursor: pointer; }
.drawer-close:hover { color: var(--text); border-color: var(--border-2); }
.drawer-body { padding: 26px; }
.dr-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 18px; padding-right: 36px; }
.dr-head-text { min-width: 0; }
.dr-name { font-size: 20px; font-weight: 700; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dr-sub { color: var(--text-2); font-size: 13px; margin-top: 4px; }
.dr-section { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 14px 16px; margin-bottom: 14px; background: var(--bg-deep); }
.dr-section h3 { margin: 0 0 10px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.dr-section h3 .num { color: var(--text); font-size: 13px; }
.kv { display: flex; justify-content: space-between; gap: 14px; padding: 5px 0; font-size: 13px; border-bottom: 1px dashed var(--border); }
.kv:last-child { border-bottom: none; }
.kv .k { color: var(--text-2); }
.kv .v { font-weight: 600; text-align: right; }
.flow { display: flex; align-items: center; gap: 10px; font-size: 13px; flex-wrap: wrap; }
.flow .from { color: var(--muted); text-decoration: line-through; }
.flow .to { font-weight: 700; }
.flow .ar { color: var(--accent); display: inline-flex; }
.rule-box { font-family: var(--font-mono); font-size: 12px; background: var(--bg); border: 1px solid var(--border); border-radius: 8px; padding: 9px 11px; color: var(--accent-2); margin-top: 8px; word-break: break-word; }

/* radial score gauge */
.gauge { flex: none; }
.gauge-track { fill: none; stroke: var(--panel-3); }
.gauge-arc { fill: none; stroke: var(--accent); stroke-linecap: round; transition: stroke-dashoffset .6s ease; }
.gauge-num { fill: var(--text); font-family: var(--font-mono); font-size: 19px; font-weight: 700; text-anchor: middle; }
.gauge-max { fill: var(--muted); font-family: var(--font-mono); font-size: 9px; text-anchor: middle; }
.gauge-wrap { text-align: center; }
.gauge-cap { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-top: 2px; }

/* component score bars */
.comp { margin: 9px 0; }
.comp-top { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 5px; }
.comp-top .num { font-weight: 700; }
.comp-track { height: 7px; border-radius: 999px; background: var(--panel-3); overflow: hidden; }
.comp-fill { height: 100%; border-radius: 999px; }
.comp-fill.locked { background: repeating-linear-gradient(45deg, var(--border), var(--border) 5px, var(--panel-3) 5px, var(--panel-3) 10px); }
.locked-note { font-size: 11px; color: var(--muted); font-style: italic; }

.raw-toggle { cursor: pointer; color: var(--accent-2); font-size: 12.5px; font-weight: 600; user-select: none; display: inline-flex; align-items: center; gap: 6px; }
.raw-json { font-family: var(--font-mono); font-size: 11.5px; white-space: pre-wrap; word-break: break-word; color: var(--text-2); margin-top: 10px; max-height: 240px; overflow: auto; background: var(--bg); padding: 12px; border-radius: 8px; border: 1px solid var(--border); }

/* ---------------- Resume tab ---------------- */
.resume-layout { display: grid; grid-template-columns: 300px 1fr; gap: 22px; }
@media (max-width: 960px) { .resume-layout { grid-template-columns: 1fr; } }
.picker-label { font-size: 11px; text-transform: uppercase; letter-spacing: .6px; color: var(--muted); margin-bottom: 10px; font-weight: 600; }
.resume-card { border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 13px 14px; margin-bottom: 10px; cursor: pointer; background: var(--panel); transition: border-color .15s, background .15s; }
.resume-card:hover { border-color: var(--accent); }
.resume-card.is-active { border-color: var(--accent); background: linear-gradient(180deg, rgba(74,144,217,.10), var(--panel)); box-shadow: var(--shadow-glow); }
.rc-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rc-title { font-weight: 700; font-size: 13px; }
.rc-label { font-size: 11.5px; color: var(--text-2); margin-top: 3px; }
.dropzone { border: 1px dashed var(--border-2); border-radius: var(--radius-lg); padding: 18px; text-align: center; color: var(--muted); font-size: 12.5px; margin-top: 6px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.dropzone span { display: block; font-size: 11px; margin-top: 3px; opacity: .8; }
.dropzone.drag { border-color: var(--accent); color: var(--accent-2); }

.resume-stage { min-height: 440px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 22px; }
.stage-empty { height: 400px; display: grid; place-content: center; justify-items: center; text-align: center; color: var(--muted); gap: 6px; }
.stage-empty-ico { color: var(--border-2); }

.parse-steps { list-style: none; padding: 0; margin: 0 0 20px; }
.parse-steps li { display: flex; align-items: center; gap: 10px; padding: 7px 0; font-size: 13px; color: var(--muted); }
.parse-steps li .ps-ico { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--border-2); display: inline-grid; place-items: center; font-size: 11px; flex: none; }
.parse-steps li.done { color: var(--text); }
.parse-steps li.done .ps-ico { background: var(--good); border-color: var(--good); color: #04130d; }
.parse-steps li.active .ps-ico { border-color: var(--accent); animation: pulse 1s infinite; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(74,144,217,.5);} 50% { box-shadow: 0 0 0 5px rgba(74,144,217,0);} }

.tier-badge { font-family: var(--font-mono); font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 6px; background: linear-gradient(135deg, var(--gold), #c9a23f); color: #1a1407; }
.timeline { border-left: 2px solid var(--border-2); margin-left: 6px; padding-left: 16px; }
.tl-item { position: relative; padding: 6px 0 12px; }
.tl-item::before { content: ""; position: absolute; left: -22px; top: 11px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.tl-title { font-weight: 600; font-size: 13px; }
.tl-meta { font-size: 11.5px; color: var(--muted); }
.attr-tags { display: flex; flex-wrap: wrap; gap: 7px; }

.decision { border-radius: var(--radius-lg); padding: 16px; margin-top: 6px; }
.decision.match { background: linear-gradient(180deg, rgba(52,211,153,.10), var(--panel-2)); border: 1px solid rgba(52,211,153,.35); }
.decision.create { background: linear-gradient(180deg, rgba(74,144,217,.10), var(--panel-2)); border: 1px solid rgba(74,144,217,.35); }
.decision h3 { margin: 0 0 4px; font-size: 14px; display: flex; align-items: center; gap: 8px; }
.decision .dec-sub { font-size: 12.5px; color: var(--text-2); }
.score-jump { display: flex; align-items: center; gap: 10px; margin-top: 10px; font-weight: 700; }
.score-jump .old { color: var(--muted); text-decoration: line-through; font-weight: 600; font-family: var(--font-mono); }
.score-jump .new { color: var(--good); font-size: 19px; font-family: var(--font-mono); }
.score-jump .ar { color: var(--text-2); display: inline-flex; }

/* ---------------- Live classifier ---------------- */
.classify-box { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; }
.title-input { width: 100%; font-size: 18px; padding: 14px 16px; border-radius: var(--radius-lg); border: 1px solid var(--border-2); background: var(--input); color: var(--text); font-family: var(--font); }
.title-input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px rgba(74,144,217,.25); }
.classify-toggles { margin: 14px 0; }
.toggle { font-size: 13px; color: var(--text-2); display: inline-flex; align-items: center; gap: 7px; cursor: pointer; }
.preset-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.preset { font-size: 12px; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--border); background: var(--bg-deep); color: var(--text-2); cursor: pointer; transition: border-color .12s, color .12s; }
.preset:hover { border-color: var(--accent); color: var(--text); }

.classify-result { margin-top: 20px; min-height: 80px; }
.cr-card { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 22px; animation: fade .2s ease; }
.cr-code { font-size: 26px; font-weight: 800; letter-spacing: -.4px; }
.cr-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 8px; }
.cr-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 24px; margin-top: 18px; }
.cr-grid .v { font-family: var(--font-mono); }
@media (max-width: 620px){ .cr-grid { grid-template-columns: 1fr; } }

/* clean unclassified state — no raw code, no "regex" match type */
.cr-card.is-unclassified { border-color: rgba(251,191,36,.3); background: linear-gradient(180deg, rgba(251,191,36,.05), var(--panel)); }
.cr-unc-head { display: flex; align-items: center; gap: 12px; }
.cr-unc-icon { width: 42px; height: 42px; border-radius: 10px; display: grid; place-items: center; background: var(--warn-bg); color: var(--warn); border: 1px solid rgba(251,191,36,.35); flex: none; }
.cr-unc-title { font-size: 19px; font-weight: 700; }
.cr-unc-title small { display: block; font-size: 12px; font-weight: 500; color: var(--text-2); margin-top: 2px; }
.cr-note { margin-top: 16px; font-size: 13px; color: var(--text-2); background: var(--bg-deep); border: 1px solid var(--border); border-radius: 8px; padding: 12px 14px; line-height: 1.55; }
.cr-note b { color: var(--text); }

.ruleset-note { margin-top: 18px; font-size: 12.5px; color: var(--muted); background: var(--panel); border: 1px solid var(--border); border-left: 3px solid var(--violet); border-radius: 8px; padding: 12px 16px; }

/* ---------------- Footer ---------------- */
.footer { text-align: center; color: var(--muted); font-size: 11.5px; padding: 28px 20px 36px; border-top: 1px solid var(--border); margin-top: 24px; }

/* ---------------- Narrow screens ---------------- */
@media (max-width: 860px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; flex-direction: row; align-items: center; flex-wrap: wrap; }
  .nav { display: flex; flex: 1 1 100%; padding: 0 8px 8px; }
  .nav-group { margin: 0; display: flex; align-items: center; }
  .nav-label { display: none; }
  .sidebar-foot { border-top: none; }
}
