/* ============================================================
   ALMANAC — Recruiting OS
   Calm, warm-neutral design system
   ============================================================ */

:root {
  /* Surfaces — cool studio ivory (cooler & flatter than the previous warm cream) */
  --bg: #ECEEE9;
  --bg-sub: #E2E5DE;
  --paper: #FFFFFF;
  --paper-2: #F6F7F3;
  --paper-3: #ECEEE7;
  --panel: #F2F4EE;

  /* Ink — cool charcoal, slate-leaning */
  --ink: #14181C;
  --ink-2: #2D333B;
  --ink-3: #5E6670;
  --ink-4: #8C939B;
  --ink-5: #B6BBC1;

  /* Borders — neutral cool */
  --line: #DDE0DA;
  --line-2: #C7CBC2;
  --line-strong: #9DA39A;
  --line-dotted: #B8BDB3;

  /* Primary accent — deep forest teal (replaces warm sage) */
  --sage: #1F4D45;
  --sage-2: #143430;
  --sage-soft: #C9D9D4;
  --sage-tint: #E1EBE7;

  /* AI accent — warm marigold (replaces dusty violet) */
  --ai: #B8761E;
  --ai-2: #84520F;
  --ai-soft: #EFDDB6;
  --ai-tint: #F7ECCF;

  /* Status */
  --warn: #B8843C;
  --warn-soft: #F2E3CB;
  --danger: #9C3E3A;
  --danger-soft: #ECD0CC;
  --info: #2F5E80;
  --info-soft: #D4E0EA;

  /* Stage colors (for pipeline + workflow nodes) */
  --stage-applied: #5E6F84;
  --stage-screen:  #B8843C;
  --stage-inter:   #1F4D45;
  --stage-offer:   #B8761E;
  --stage-hired:   #143430;
  --stage-rej:     #9C3E3A;

  /* Type — sharper editorial serif + cleaner mono */
  --font-sans: "Geist", ui-sans-serif, system-ui, sans-serif;
  --font-serif: "Instrument Serif", ui-serif, Georgia, serif;
  --font-mono: "JetBrains Mono", ui-monospace, "Geist Mono", monospace;

  /* Radius */
  --r-xs: 4px;
  --r-sm: 6px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 20px;

  /* Spacing scale */
  --s-1: 4px;
  --s-2: 8px;
  --s-3: 12px;
  --s-4: 16px;
  --s-5: 20px;
  --s-6: 24px;
  --s-7: 32px;
  --s-8: 40px;
  --s-9: 56px;

  /* Density */
  --density: 1;

  /* Sidebar / panels */
  --sidebar-w: 232px;
  --rail-w: 320px;
  --rail-collapsed-w: 56px;
  --topbar-h: 60px;
}

/* Dark / theme variants kept via [data-theme] on html */
html[data-theme="cool"] {
  --bg: #F2F3F5;
  --bg-sub: #E9EBEF;
  --paper: #FFFFFF;
  --paper-2: #F7F8FA;
  --paper-3: #EEF0F4;
  --panel: #FAFBFC;
  --line: #E2E5EB;
  --line-2: #CDD2DA;
  --line-dotted: #BBC2CC;
  --ink: #16181D;
  --ink-2: #2F333B;
  --ink-3: #5C6470;
  --ink-4: #8A92A0;
  --sage: #4A6F8C;
  --sage-2: #2E4F66;
  --sage-soft: #D7E1EB;
  --sage-tint: #E8EEF4;
}

html[data-theme="sage"] {
  --bg: #ECEEE7;
  --bg-sub: #E2E5DB;
  --paper: #F7F8F2;
  --paper-2: #F0F2EA;
  --paper-3: #E6E9DD;
  --panel: #F4F6EE;
  --line: #D8DCCC;
  --line-2: #C3C8B3;
  --ink: #1B1F17;
  --ink-2: #353B2D;
  --ink-3: #5F6555;
}

/* ============================================================
   Reset
   ============================================================ */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; height: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow: hidden;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; padding: 0; }
input, textarea, select { font-family: inherit; color: inherit; }
a { color: inherit; }
::selection { background: var(--sage-soft); color: var(--ink); }

/* ============================================================
   Typography utilities
   ============================================================ */
.serif { font-family: var(--font-serif); font-weight: 400; letter-spacing: -0.005em; font-style: normal; }
.serif-i { font-family: var(--font-serif); font-style: italic; font-weight: 400; }
.mono { font-family: var(--font-mono); font-feature-settings: "tnum" 1; }
.t-eyebrow {
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-3);
}
.t-display {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 40px;
  line-height: 1.0;
  letter-spacing: -0.015em;
  color: var(--ink);
}
.t-h1 { font-size: 22px; font-weight: 500; letter-spacing: -0.01em; color: var(--ink); }
.t-h2 { font-size: 17px; font-weight: 500; color: var(--ink); }
.t-body { font-size: 13.5px; color: var(--ink-2); }
.t-meta { font-size: 12px; color: var(--ink-3); }
.t-tiny { font-size: 11px; color: var(--ink-3); }

/* ============================================================
   App shell
   ============================================================ */
.app {
  display: grid;
  grid-template-columns: var(--sidebar-w) 1fr auto;
  grid-template-rows: var(--topbar-h) 1fr;
  height: 100vh;
  width: 100vw;
  background: var(--bg);
}
.sidebar { grid-row: 1 / 3; grid-column: 1; border-right: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; }
.topbar { grid-row: 1; grid-column: 2 / 4; border-bottom: 1px solid var(--line); background: var(--bg); display: flex; align-items: center; padding: 0 var(--s-6); gap: var(--s-4); }
.main { grid-row: 2; grid-column: 2; overflow: hidden; display: flex; flex-direction: column; min-width: 0; }
.rail { grid-row: 2; grid-column: 3; border-left: 1px solid var(--line); background: var(--panel); display: flex; flex-direction: column; transition: width 200ms ease; }

/* ============================================================
   Sidebar
   ============================================================ */
.brand { padding: var(--s-5) var(--s-5) var(--s-4); display: flex; align-items: center; gap: 10px; }
/* Stacked-bar glyph: three lines of decreasing length on an ink chip */
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 4px;
  background: var(--ink);
  position: relative;
  display: grid; place-items: center;
  color: var(--bg);
  overflow: hidden;
}
.brand-mark::before {
  content: "";
  width: 14px; height: 2px;
  background: var(--bg);
  box-shadow:
    0 5px 0 0 var(--bg),
    -3px 10px 0 0 var(--bg);
  border-radius: 1px;
}
.brand-mark::after {
  content: "";
  position: absolute;
  right: 4px; top: 4px;
  width: 4px; height: 4px;
  background: var(--ai);
  border-radius: 50%;
}
.brand-name { font-family: var(--font-serif); font-size: 22px; letter-spacing: -0.005em; color: var(--ink); line-height: 1; }
.brand-tag { font-family: var(--font-mono); font-size: 9px; color: var(--ink-3); letter-spacing: 0.12em; text-transform: uppercase; margin-top: 1px; white-space: nowrap; }

.org-switch {
  margin: 0 var(--s-3) var(--s-4);
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  background: var(--paper);
  display: flex; align-items: center; gap: 10px;
  cursor: pointer;
}
.org-switch:hover { background: var(--paper-2); }
.org-avatar {
  width: 24px; height: 24px;
  border-radius: 6px;
  background: var(--ink);
  color: var(--bg);
  display: grid; place-items: center;
  font-family: var(--font-mono);
  font-size: 10.5px; font-weight: 500;
  letter-spacing: 0.02em;
}
.org-name { font-size: 13px; font-weight: 500; flex: 1; }
.org-caret { color: var(--ink-4); }

.nav-section { padding: 0 var(--s-3); margin-bottom: var(--s-5); }
.nav-label {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-4);
  padding: 0 12px;
  margin-bottom: 6px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
  user-select: none;
}
.nav-item:hover { background: var(--paper-3); color: var(--ink); }
.nav-item.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--line);
}
.nav-item.active::before {
  content: ""; position: absolute; left: -3px; top: 50%; transform: translateY(-50%);
  width: 3px; height: 14px; background: var(--sage); border-radius: 2px;
}
.nav-item .nav-count { margin-left: auto; font-family: var(--font-mono); font-size: 10.5px; color: var(--ink-4); }
.nav-item.active .nav-count { color: var(--ink-3); }
.nav-item svg { flex-shrink: 0; }

.sidebar-foot {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding: var(--s-3);
}
.user-chip {
  display: flex; align-items: center; gap: 10px;
  padding: 8px;
  border-radius: var(--r-sm);
}
.user-chip:hover { background: var(--paper-3); }
.user-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--sage);
  color: white;
  display: grid; place-items: center;
  font-size: 11px; font-weight: 500;
}
.user-name { font-size: 12.5px; font-weight: 500; }
.user-role { font-size: 10.5px; color: var(--ink-3); }

/* ============================================================
   Topbar
   ============================================================ */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-3); white-space: nowrap; }
.crumbs .here { color: var(--ink); font-weight: 500; }
.crumbs .sep { color: var(--ink-5); }

.search {
  margin-left: auto;
  flex: 0 1 380px;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 12px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.search:focus-within { border-color: var(--line-strong); background: var(--paper); }
.search input { border: none; outline: none; background: transparent; flex: 1; font-size: 13px; }
.search input::placeholder { color: var(--ink-4); }
.search .kbd { font-family: var(--font-mono); font-size: 10px; color: var(--ink-4); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; }

.icon-btn {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: var(--r-sm);
  color: var(--ink-2);
  position: relative;
}
.icon-btn:hover { background: var(--paper-2); color: var(--ink); }
.icon-btn .dot {
  position: absolute; top: 8px; right: 8px;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--warn);
  border: 2px solid var(--bg);
  box-sizing: content-box;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  transition: background 120ms, border-color 120ms;
  white-space: nowrap;
}
.btn-primary { background: var(--ink); color: var(--bg); }
.btn-primary:hover { background: var(--ink-2); }
.btn-secondary { background: var(--paper); border-color: var(--line); color: var(--ink); }
.btn-secondary:hover { background: var(--paper-2); border-color: var(--line-2); }
.btn-ghost { color: var(--ink-2); }
.btn-ghost:hover { background: var(--paper-2); color: var(--ink); }
.btn-ai { background: var(--ai-tint); color: var(--ai-2); border-color: var(--ai-soft); }
.btn-ai:hover { background: var(--ai-soft); }
.btn-sm { padding: 5px 9px; font-size: 12px; }
.btn-icon { padding: 6px; }

/* ============================================================
   Pills / badges
   ============================================================ */
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 8px;
  font-size: 11px;
  border-radius: 999px;
  background: var(--paper-3);
  color: var(--ink-2);
  border: 1px solid var(--line);
  white-space: nowrap;
}
.pill .pill-dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.pill.sage { background: var(--sage-tint); color: var(--sage-2); border-color: var(--sage-soft); }
.pill.ai { background: var(--ai-tint); color: var(--ai-2); border-color: var(--ai-soft); }
.pill.warn { background: var(--warn-soft); color: #6F4F1F; border-color: #E5CFA9; }
.pill.danger { background: var(--danger-soft); color: #6F2D26; border-color: #DDB4AC; }
.pill.info { background: var(--info-soft); color: #2A4658; border-color: #B7C7D2; }

/* ============================================================
   AI annotation frame
   ============================================================ */
.ai-frame {
  border: 1px dashed var(--ai-soft);
  background: linear-gradient(180deg, var(--ai-tint), var(--paper));
  border-radius: var(--r-md);
}
.ai-label {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ai-2);
}
.ai-dot {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ai);
  box-shadow: 0 0 0 3px var(--ai-tint);
  position: relative;
}
.ai-dot.pulse::after {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%; border: 1px solid var(--ai);
  animation: ai-pulse 2s ease-out infinite;
}
@keyframes ai-pulse {
  0% { transform: scale(0.6); opacity: 0.9; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* ============================================================
   Cards / panels
   ============================================================ */
.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
}
.card-pad { padding: var(--s-5); }

/* ============================================================
   View frame
   ============================================================ */
.view-header {
  padding: var(--s-6) var(--s-7) var(--s-4);
  display: flex; align-items: flex-end; gap: var(--s-5);
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}
.view-header .lead { flex: 1; min-width: 0; }
.view-header .lead .flex { flex-wrap: wrap; row-gap: 6px; }
.view-header .lead .eyebrow { margin-bottom: 6px; }
.view-header .lead h1 { margin: 0; }
.view-actions { display: flex; align-items: center; gap: 8px; }
.view-body { flex: 1; overflow: auto; padding: var(--s-6) var(--s-7); }
.view-body.no-pad { padding: 0; }

/* ============================================================
   KANBAN
   ============================================================ */
.board { display: flex; gap: var(--s-4); padding: var(--s-5) var(--s-7); height: 100%; overflow: auto; }
.column {
  flex: 0 0 264px;
  display: flex; flex-direction: column;
  background: var(--paper-3);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  max-height: 100%;
}
.column.drag-target { background: var(--sage-tint); border-color: var(--sage-soft); border-style: dashed; }
.column-head {
  padding: 12px 14px 10px;
  display: flex; align-items: center; gap: 8px;
  border-bottom: 1px solid var(--line);
}
.column-stripe {
  width: 8px; height: 8px; border-radius: 2px;
  background: var(--stage-applied);
}
.column-title { font-size: 12.5px; font-weight: 500; color: var(--ink); }
.column-count { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); margin-left: 4px; }
.column-add { margin-left: auto; color: var(--ink-3); }
.column-body { padding: 10px; display: flex; flex-direction: column; gap: 8px; overflow: auto; flex: 1; }

.cand-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 11px 12px;
  cursor: grab;
  user-select: none;
  transition: transform 100ms, box-shadow 100ms, border-color 100ms;
  display: flex; flex-direction: column; gap: 8px;
}
.cand-card:hover { border-color: var(--line-2); }
.cand-card:active { cursor: grabbing; }
.cand-card.dragging { opacity: 0.4; transform: scale(0.98); }
.cand-card .top { display: flex; align-items: center; gap: 8px; }
.cand-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--paper-3);
  display: grid; place-items: center;
  font-size: 10px; font-weight: 500;
  color: var(--ink-2);
  flex-shrink: 0;
}
.cand-name { font-size: 12.5px; font-weight: 500; line-height: 1.2; }
.cand-role { font-size: 11px; color: var(--ink-3); margin-top: 1px; }
.cand-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.match-score {
  display: inline-flex; align-items: center; gap: 4px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--ai-2);
  background: var(--ai-tint);
  border: 1px solid var(--ai-soft);
  border-radius: 4px;
  padding: 1px 5px;
}
.match-bar {
  height: 3px;
  background: var(--paper-3);
  border-radius: 2px;
  overflow: hidden;
}
.match-bar .fill { height: 100%; background: var(--sage); }
.match-bar .fill.warn { background: var(--warn); }
.match-bar .fill.danger { background: var(--danger); }

/* ============================================================
   Drag ghost
   ============================================================ */
.drag-ghost {
  position: fixed; pointer-events: none;
  z-index: 9999;
  background: var(--paper);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  box-shadow: 0 12px 32px rgba(28, 26, 22, 0.18), 0 2px 6px rgba(28, 26, 22, 0.08);
  transform: rotate(-2deg);
  padding: 10px 12px;
  width: 240px;
  font-size: 12.5px;
}

/* ============================================================
   Workflow canvas
   ============================================================ */
.canvas-wrap {
  position: relative; height: 100%; overflow: hidden;
  background: var(--paper-2);
  background-image:
    radial-gradient(circle, var(--line) 1px, transparent 1px);
  background-size: 24px 24px;
  background-position: 0 0;
}
.canvas-inner {
  position: absolute; top: 0; left: 0;
  width: 3000px; height: 2000px;
  transform-origin: 0 0;
}
.canvas-svg { position: absolute; inset: 0; pointer-events: none; }

.wf-node {
  position: absolute;
  width: 220px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: grab;
  user-select: none;
  transition: box-shadow 120ms, border-color 120ms;
}
.wf-node:hover { border-color: var(--line-2); box-shadow: 0 2px 6px rgba(28,26,22,0.04); }
.wf-node.selected { border-color: var(--ink); box-shadow: 0 0 0 3px var(--paper-3); }
.wf-node.dragging { opacity: 0.8; cursor: grabbing; box-shadow: 0 16px 32px rgba(28,26,22,0.12); }
.wf-node-stripe {
  height: 4px; width: 100%;
  border-radius: var(--r-md) var(--r-md) 0 0;
}
.wf-node-body { padding: 12px 14px; }
.wf-node-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.wf-node-icon {
  width: 22px; height: 22px;
  border-radius: 5px;
  background: var(--paper-3);
  display: grid; place-items: center;
  color: var(--ink-2);
}
.wf-node-title { font-size: 12.5px; font-weight: 500; flex: 1; }
.wf-node-meta { font-family: var(--font-mono); font-size: 10px; color: var(--ink-3); }
.wf-node-desc { font-size: 11.5px; color: var(--ink-3); line-height: 1.45; }
.wf-node-foot {
  border-top: 1px solid var(--line);
  margin: 10px -14px -12px;
  padding: 7px 14px;
  display: flex; align-items: center; gap: 8px;
  font-size: 11px;
  color: var(--ink-3);
  background: var(--paper-2);
  border-radius: 0 0 var(--r-md) var(--r-md);
}
.wf-node-port {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 12px; height: 12px;
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line-2);
}
.wf-node-port.left { left: -6px; }
.wf-node-port.right { right: -6px; }
.wf-node-port:hover, .wf-node:hover .wf-node-port { border-color: var(--ink); }

.wf-palette {
  position: absolute; left: 16px; top: 16px;
  width: 220px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 10px;
  z-index: 5;
  max-height: calc(100% - 32px);
  overflow: auto;
}
.wf-palette-head { padding: 4px 6px 8px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.wf-palette-group { margin-top: 10px; }
.wf-palette-group:first-of-type { margin-top: 0; }
.wf-palette-label { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink-4); padding: 0 6px 6px; }
.wf-palette-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px;
  border-radius: var(--r-xs);
  cursor: grab;
  font-size: 12px;
  color: var(--ink-2);
  border: 1px solid transparent;
  white-space: nowrap;
}
.wf-palette-item > span:not(.wf-palette-swatch):not(.ai-dot) {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.wf-palette-item:hover { background: var(--paper-2); border-color: var(--line); }
.wf-palette-item:active { cursor: grabbing; }
.wf-palette-swatch { width: 14px; height: 14px; border-radius: 3px; flex-shrink: 0; }

.wf-toolbar {
  position: absolute; top: 16px; right: 16px;
  display: flex; align-items: center; gap: 6px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 6px;
  z-index: 5;
}
.wf-zoom {
  position: absolute; bottom: 16px; left: 16px;
  display: flex; align-items: center; gap: 4px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 4px;
  z-index: 5;
}
.wf-zoom-val { font-family: var(--font-mono); font-size: 11px; color: var(--ink-3); padding: 0 8px; min-width: 44px; text-align: center; }

.wf-lane-label {
  position: absolute;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-4);
}

.wf-ai-suggest {
  position: absolute;
  background: var(--ai-tint);
  border: 1px dashed var(--ai-soft);
  border-radius: var(--r-md);
  padding: 10px 12px;
  width: 220px;
  cursor: pointer;
}
.wf-ai-suggest:hover { background: var(--ai-soft); }

/* ============================================================
   AI Copilot rail
   ============================================================ */
.rail-collapsed { width: var(--rail-collapsed-w); }
.rail-open { width: var(--rail-w); }
.rail-head {
  padding: var(--s-5) var(--s-5) var(--s-3);
  display: flex; align-items: center; gap: 10px;
  border-bottom: 1px solid var(--line);
}
.rail-head-title { font-size: 13px; font-weight: 500; }
.rail-body { flex: 1; overflow: auto; padding: var(--s-4) var(--s-5); }
.rail-collapsed .rail-body { display: none; }
.rail-collapsed .rail-head { padding: var(--s-5) 0; justify-content: center; }
.rail-collapsed .rail-head > *:not(.rail-toggle) { display: none; }

.suggestion {
  border: 1px solid var(--ai-soft);
  background: var(--paper);
  border-radius: var(--r-md);
  padding: 12px;
  margin-bottom: 10px;
  position: relative;
  overflow: hidden;
}
.suggestion::before {
  content: "";
  position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ai);
}
.suggestion .sug-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.suggestion .sug-title { font-size: 12.5px; font-weight: 500; color: var(--ink); line-height: 1.3; }
.suggestion .sug-body { font-size: 12px; color: var(--ink-3); line-height: 1.45; margin-bottom: 10px; }
.suggestion .sug-actions { display: flex; gap: 6px; }

.suggestion.accepted { background: var(--sage-tint); border-color: var(--sage-soft); }
.suggestion.accepted::before { background: var(--sage); }
.suggestion.dismissed { opacity: 0.5; }

/* ============================================================
   Detail drawer
   ============================================================ */
.drawer-backdrop {
  position: fixed; inset: 0; background: rgba(28, 26, 22, 0.25);
  z-index: 50;
  opacity: 0; pointer-events: none;
  transition: opacity 180ms;
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: 580px; max-width: 92vw;
  background: var(--bg);
  border-left: 1px solid var(--line);
  z-index: 51;
  transform: translateX(100%);
  transition: transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.drawer.open { transform: translateX(0); }
.drawer-head { padding: var(--s-5) var(--s-6); border-bottom: 1px solid var(--line); display: flex; align-items: center; gap: 12px; background: var(--paper-2); }
.drawer-body { flex: 1; overflow: auto; padding: var(--s-6); }
.drawer-foot { border-top: 1px solid var(--line); padding: var(--s-4) var(--s-6); display: flex; gap: 8px; background: var(--paper-2); }

/* ============================================================
   Tables / lists
   ============================================================ */
.tbl { width: 100%; border-collapse: collapse; font-size: 13px; }
.tbl thead th {
  text-align: left;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-4);
  font-weight: 500;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
}
.tbl tbody tr { border-bottom: 1px solid var(--line); cursor: pointer; }
.tbl tbody tr:hover { background: var(--paper-2); }
.tbl tbody td { padding: 12px; vertical-align: middle; }

/* ============================================================
   Charts
   ============================================================ */
.bar-track { height: 6px; background: var(--paper-3); border-radius: 3px; overflow: hidden; }
.bar-track .bar { height: 100%; background: var(--sage); }
.sparkbar { display: flex; align-items: flex-end; gap: 3px; height: 36px; }
.sparkbar .b { flex: 1; background: var(--paper-3); border-radius: 2px 2px 0 0; min-height: 4px; }
.sparkbar .b.lit { background: var(--sage); }
.sparkbar .b.lit-ai { background: var(--ai); }

/* ============================================================
   Onboarding checklist
   ============================================================ */
.checklist { display: flex; flex-direction: column; gap: 6px; }
.checklist-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 14px;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  background: var(--paper);
}
.checklist-item.done { background: var(--paper-2); }
.check {
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 1.5px solid var(--line-2);
  display: grid; place-items: center;
  flex-shrink: 0;
}
.check.done { background: var(--sage); border-color: var(--sage); color: white; }
.checklist-title { flex: 1; font-size: 13px; color: var(--ink); }
.checklist-item.done .checklist-title { color: var(--ink-3); text-decoration: line-through; text-decoration-color: var(--line-2); }

/* ============================================================
   Utility
   ============================================================ */
.flex { display: flex; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }
.gap-4 { gap: 16px; }
.gap-5 { gap: 20px; }
.gap-6 { gap: 24px; }
.center { display: flex; align-items: center; justify-content: center; }
.between { justify-content: space-between; }
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.mt-2 { margin-top: 8px; } .mt-3 { margin-top: 12px; } .mt-4 { margin-top: 16px; } .mt-5 { margin-top: 20px; } .mt-6 { margin-top: 24px; }
.mb-2 { margin-bottom: 8px; } .mb-3 { margin-bottom: 12px; } .mb-4 { margin-bottom: 16px; } .mb-5 { margin-bottom: 20px; } .mb-6 { margin-bottom: 24px; }
.w-full { width: 100%; }
.text-center { text-align: center; }
.hidden { display: none; }
.divider { height: 1px; background: var(--line); }

/* scrollbars */
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-track { background: transparent; }
*::-webkit-scrollbar-thumb { background: var(--line); border-radius: 6px; border: 2px solid var(--bg); }
*::-webkit-scrollbar-thumb:hover { background: var(--line-2); }
