/* Kargo Hiring — "harbour at dawn".
   Warm paper, deep ink, sea-teal accent; emerald / amber / terracotta for
   High / Medium / Low. Dark mode is "night port". */

:root {
  --bg: #f4f1ea;
  --bg-2: #ebe6db;
  --panel: #fffdf8;
  --panel-2: #f8f5ee;
  --ink: #15181d;
  --ink-2: #3a3f47;
  --muted: #7b7f86;
  --line: #e4ded1;
  --line-2: #d8d1c2;

  --accent: #0f6b69;
  --accent-2: #13857f;
  --accent-soft: #dcefec;
  --accent-ink: #ffffff;

  --high: #1d7f55;
  --high-soft: #e1f1e8;
  --med: #b3741c;
  --med-soft: #f8ecd6;
  --low: #b24f39;
  --low-soft: #f6e3dc;

  --btn: #15181d;
  --btn-ink: #f7f4ec;

  --shadow-sm: 0 1px 2px rgba(35, 28, 14, .06), 0 1px 1px rgba(35, 28, 14, .04);
  --shadow: 0 1px 2px rgba(35, 28, 14, .05), 0 8px 24px -12px rgba(35, 28, 14, .18);
  --shadow-lg: 0 2px 6px rgba(35, 28, 14, .06), 0 24px 60px -20px rgba(35, 28, 14, .30);

  --glow-a: rgba(19, 133, 127, .16);
  --glow-b: rgba(224, 164, 88, .18);

  --radius: 18px;
  --radius-sm: 12px;
  --serif: "Instrument Serif", "Iowan Old Style", Georgia, serif;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0d0f12;
    --bg-2: #13161a;
    --panel: #15181d;
    --panel-2: #1a1e24;
    --ink: #eceae4;
    --ink-2: #c7c5bf;
    --muted: #8a8f97;
    --line: #242830;
    --line-2: #2f343d;
    --accent: #5cc2bc;
    --accent-2: #7ad3cd;
    --accent-soft: #15302f;
    --accent-ink: #0d1413;
    --high: #52c28c;
    --high-soft: #15291f;
    --med: #e2b25e;
    --med-soft: #2c2415;
    --low: #e6896f;
    --low-soft: #2e1a15;
    --btn: #eceae4;
    --btn-ink: #121418;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, .5), 0 30px 70px -24px rgba(0, 0, 0, .8);
    --glow-a: rgba(92, 194, 188, .10);
    --glow-b: rgba(226, 178, 94, .07);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0d0f12; --bg-2: #13161a; --panel: #15181d; --panel-2: #1a1e24;
  --ink: #eceae4; --ink-2: #c7c5bf; --muted: #8a8f97; --line: #242830; --line-2: #2f343d;
  --accent: #5cc2bc; --accent-2: #7ad3cd; --accent-soft: #15302f; --accent-ink: #0d1413;
  --high: #52c28c; --high-soft: #15291f; --med: #e2b25e; --med-soft: #2c2415; --low: #e6896f; --low-soft: #2e1a15;
  --btn: #eceae4; --btn-ink: #121418;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
  --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 10px 30px -14px rgba(0, 0, 0, .7);
  --shadow-lg: 0 2px 6px rgba(0, 0, 0, .5), 0 30px 70px -24px rgba(0, 0, 0, .8);
  --glow-a: rgba(92, 194, 188, .10); --glow-b: rgba(226, 178, 94, .07);
  color-scheme: dark;
}

/* ---------- Base ---------- */
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 400 14.5px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  min-height: 100vh;
}
h1, h2, h3, h4, h5 { margin: 0; line-height: 1.2; font-weight: 600; }
h2 { font-size: 17px; letter-spacing: -.01em; }
h4 {
  font: 600 11px/1 var(--sans); letter-spacing: .12em; text-transform: uppercase;
  color: var(--muted); margin: 22px 0 12px;
}
h5 { font-size: 13px; font-weight: 600; margin: 16px 0 6px; color: var(--ink-2); }
p { margin: 0; }
a { color: inherit; text-decoration: none; }
.muted { color: var(--muted); }
::selection { background: var(--accent-soft); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }

/* Ambient background: two soft glows + film grain */
.backdrop { position: fixed; inset: 0; z-index: -1; overflow: hidden; pointer-events: none; }
.glow { position: absolute; border-radius: 50%; filter: blur(80px); }
.glow-a { width: 620px; height: 620px; left: -180px; top: -260px; background: var(--glow-a); }
.glow-b { width: 560px; height: 560px; right: -200px; top: 120px; background: var(--glow-b); }
.grain {
  position: absolute; inset: 0; opacity: .35; mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .05 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .grain { mix-blend-mode: screen; opacity: .25; } }

/* ---------- Header ---------- */
.top {
  position: sticky; top: 0; z-index: 20;
  background: color-mix(in oklab, var(--bg) 78%, transparent);
  backdrop-filter: saturate(1.4) blur(14px);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid color-mix(in oklab, var(--line) 70%, transparent);
}
.top-inner {
  max-width: 1160px; margin: 0 auto; padding: 12px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: 12px; }
.mark { width: 34px; height: 34px; flex: none; }
.mark-bg { fill: var(--ink); }
.mark-a { fill: #66c3bd; }
.mark-b { fill: var(--bg); }
.mark-c { fill: #e0a458; }
.mark-d { fill: var(--bg); opacity: .5; }
.wordmark { display: flex; flex-direction: column; line-height: 1; }
.wm-serif { font: 400 24px/1 var(--serif); letter-spacing: -.01em; }
.wm-sans { font: 500 10.5px/1 var(--sans); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); margin-top: 4px; }

.tabs {
  position: relative; display: flex; gap: 2px; padding: 4px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, .04);
}
.tab-indicator {
  position: absolute; top: 4px; left: 4px; height: calc(100% - 8px); width: 0;
  background: var(--panel); border-radius: 999px; box-shadow: var(--shadow-sm);
  border: 1px solid var(--line);
}
.tab {
  position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 6px;
  font: 500 13.5px/1 var(--sans); color: var(--muted);
  background: none; border: 0; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  transition: color .2s;
}
.tab:hover { color: var(--ink-2); }
.tab.active { color: var(--ink); }
.badge {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: 999px; background: var(--low); color: #fff; font: 600 11px/1 var(--mono);
}

.warn {
  max-width: 1160px; margin: 14px auto 0; padding: 10px 16px; border-radius: 12px;
  background: var(--med-soft); color: var(--med); font-size: 13px;
  border: 1px solid color-mix(in oklab, var(--med) 25%, transparent);
  width: calc(100% - 48px);
}

main { max-width: 1160px; margin: 0 auto; padding: 8px 24px 64px; }

/* ---------- Hero ---------- */
.hero { padding: 40px 0 28px; }
.eyebrow { font: 500 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--accent); }
.hero-title {
  font: 400 clamp(38px, 6vw, 64px)/1.02 var(--serif); letter-spacing: -.02em;
  margin: 14px 0 12px; max-width: 16ch;
}
.hero-title em { font-style: italic; color: var(--accent); }
.hero-sub { font-size: 17px; color: var(--ink-2); max-width: 60ch; }
.hero-sub b { font-weight: 600; color: var(--ink); }
.hero-principle { margin-top: 14px; font-size: 13px; color: var(--muted); }
.hero-principle em { font-family: var(--serif); font-size: 15px; color: var(--ink-2); }

/* ---------- Pipeline + stats ---------- */
.pipeline {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 18px; margin-bottom: 20px;
}
.pipeline-bar {
  display: flex; height: 10px; border-radius: 999px; overflow: hidden; gap: 3px;
  background: var(--bg-2); margin-bottom: 16px;
}
.pipeline-bar .seg-fill { height: 100%; border-radius: 999px; min-width: 0; }
.seg-fill.high { background: var(--high); }
.seg-fill.med { background: var(--med); }
.seg-fill.low { background: color-mix(in oklab, var(--low) 42%, var(--bg-2)); }
.stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; }
.stat { padding: 6px 12px; border-left: 1px solid var(--line); }
.stat:first-child { border-left: 0; }
.stat .k { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); }
.stat .k i { width: 7px; height: 7px; border-radius: 50%; background: var(--line-2); flex: none; }
.stat.high .k i { background: var(--high); }
.stat.med .k i { background: var(--med); }
.stat.low .k i { background: var(--low); }
.stat.sent .k i { background: var(--accent); }
.stat b { display: block; margin-top: 6px; font: 400 36px/1 var(--serif); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 760px) {
  .stats { grid-template-columns: repeat(3, 1fr); row-gap: 14px; }
  .stat:nth-child(4) { border-left: 0; }
}

/* ---------- Panels ---------- */
.panel {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 22px; margin-bottom: 20px;
}
.panel-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin-bottom: 16px; }
.kicker { font: 500 11px/1 var(--mono); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 8px; }
.kicker-med { color: var(--med); }
.kicker-low { color: var(--low); }
.panel h2, .section-title { font: 400 28px/1.1 var(--serif); letter-spacing: -.01em; }
.section-note { margin-top: 6px; font-size: 13px; }
.count { font: 500 13px/1 var(--mono); color: var(--muted); vertical-align: middle; margin-left: 4px; }

.row { display: flex; gap: 12px; flex-wrap: wrap; align-items: flex-end; margin-top: 12px; }
.row.end { justify-content: flex-end; align-items: center; }
.grow { flex: 1 1 240px; }
label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--muted); font-weight: 500; }
input, select, textarea {
  font: inherit; font-size: 14px; color: var(--ink);
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px;
  padding: 10px 12px; width: 100%; transition: border-color .15s, box-shadow .15s, background .15s;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--accent); background: var(--panel);
  box-shadow: 0 0 0 4px color-mix(in oklab, var(--accent) 16%, transparent);
}
textarea { resize: vertical; line-height: 1.6; }
input:disabled, textarea:disabled { opacity: .65; }

/* Buttons */
button {
  font: 500 13.5px/1 var(--sans); cursor: pointer; border-radius: 999px;
  padding: 11px 18px; border: 1px solid var(--line-2); background: var(--panel); color: var(--ink);
  display: inline-flex; align-items: center; gap: 8px;
  transition: transform .15s ease, background .15s, border-color .15s, box-shadow .15s, color .15s;
}
button:hover:not(:disabled) { border-color: var(--ink-2); }
button:active:not(:disabled) { transform: translateY(1px) scale(.99); }
button:disabled { opacity: .45; cursor: default; }
button svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
button.primary { background: var(--btn); color: var(--btn-ink); border-color: var(--btn); box-shadow: 0 6px 16px -8px rgba(21, 24, 29, .55); }
button.primary:hover:not(:disabled) { background: color-mix(in oklab, var(--btn) 88%, var(--accent)); border-color: transparent; box-shadow: 0 10px 22px -10px rgba(21, 24, 29, .6); }
button.primary:hover:not(:disabled) svg { transform: translateX(2px); }
button.primary svg { transition: transform .2s; }
button.secondary { background: var(--panel); border-color: var(--ink); }
button.ghost { background: transparent; }
button.ghost:hover:not(:disabled) { background: var(--panel-2); }
button.small { padding: 8px 14px; font-size: 12.5px; }
.icon-btn { width: 38px; height: 38px; padding: 0; justify-content: center; border-radius: 50%; }

/* Role segmented control */
.seg { display: inline-flex; padding: 4px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 999px; }
.seg-opt { flex-direction: row; cursor: pointer; }
.seg-opt input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.seg-opt span { padding: 8px 16px; border-radius: 999px; font: 500 13px/1 var(--sans); color: var(--muted); transition: all .2s; }
.seg-opt input:checked + span { background: var(--ink); color: var(--bg); box-shadow: var(--shadow-sm); }
.seg-opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Dropzone */
.dropzone {
  position: relative; display: grid; justify-items: center; gap: 6px; text-align: center;
  padding: 30px 20px; border-radius: var(--radius-sm); cursor: pointer;
  border: 1.5px dashed var(--line-2);
  background: repeating-linear-gradient(135deg, transparent 0 10px, color-mix(in oklab, var(--bg-2) 45%, transparent) 10px 20px);
  transition: border-color .2s, background-color .2s;
}
.dropzone:hover, .dropzone.drag { border-color: var(--accent); background-color: var(--accent-soft); }
.dropzone input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.dz-icon {
  width: 44px; height: 44px; display: grid; place-items: center; border-radius: 12px;
  background: var(--panel); border: 1px solid var(--line); box-shadow: var(--shadow-sm); color: var(--accent);
}
.dz-icon svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dz-title { font-size: 15px; color: var(--ink); font-weight: 500; }
.dz-title u { text-decoration-color: var(--accent); text-underline-offset: 3px; }
.dz-sub { font-size: 12.5px; color: var(--muted); }
.overrides summary { cursor: pointer; color: var(--muted); font-size: 13px; margin-top: 14px; width: max-content; }
.overrides summary:hover { color: var(--ink-2); }

.results { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 6px; font-size: 13px; }
.results li { padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line); }
.results .ok { color: var(--high); background: var(--high-soft); border-color: transparent; }
.results .err { color: var(--low); background: var(--low-soft); border-color: transparent; }

/* ---------- Section head + filters ---------- */
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 36px 0 16px; }
.section-title { font-size: 34px; }
.filter-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; font-size: 13px; }
.panel .filter-bar { margin: 4px 0 12px; }
.filter-bar label {
  flex-direction: row; align-items: center; gap: 10px; font-size: 12.5px; color: var(--ink-2);
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; padding: 7px 14px;
}
.filter-bar input[type=range] {
  -webkit-appearance: none; appearance: none; width: 150px; height: 4px; padding: 0; border: 0;
  border-radius: 999px; background: linear-gradient(90deg, var(--accent) var(--fill, 0%), var(--line-2) var(--fill, 0%));
}
.filter-bar input[type=range]:focus { box-shadow: none; }
.filter-bar input[type=range]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--panel); border: 2px solid var(--accent); box-shadow: var(--shadow-sm); cursor: grab;
}
.filter-bar input[type=range]::-moz-range-thumb {
  width: 14px; height: 14px; border-radius: 50%; background: var(--panel); border: 2px solid var(--accent); cursor: grab;
}
.filter-bar output { min-width: 3.2em; font: 600 12.5px/1 var(--mono); color: var(--ink); text-align: right; }
.filter-showing { font: 500 12px/1 var(--mono); }

/* ---------- Chips ---------- */
.chip {
  display: inline-flex; align-items: center; gap: 6px; font: 600 11.5px/1 var(--sans);
  padding: 6px 10px; border-radius: 999px; background: var(--med-soft); color: var(--med); white-space: nowrap;
}
.chip::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; opacity: .85; }
.card.high .chip.cat { background: var(--high-soft); color: var(--high); }
.chip.ok { background: var(--high-soft); color: var(--high); }
.chip.draft { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.chip.low { background: var(--low-soft); color: var(--low); }
.chip.med { background: var(--med-soft); color: var(--med); }
.flag {
  font: 500 11px/1 var(--sans); padding: 5px 9px; border-radius: 999px;
  color: var(--low); background: var(--low-soft);
}

/* ---------- Candidate cards ---------- */
.cards { display: grid; gap: 18px; }
.empty {
  padding: 40px 20px; text-align: center; border: 1.5px dashed var(--line-2); border-radius: var(--radius);
  font-size: 14px;
}
.card {
  position: relative; background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius);
  box-shadow: var(--shadow); padding: 26px; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--med), color-mix(in oklab, var(--med) 20%, transparent));
}
.card.high::before { background: linear-gradient(180deg, var(--high), color-mix(in oklab, var(--high) 15%, transparent)); }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap; }
.who { display: flex; align-items: center; gap: 14px; min-width: 0; }
.avatar {
  width: 48px; height: 48px; border-radius: 14px; flex: none; display: grid; place-items: center;
  font: 400 22px/1 var(--serif); color: var(--ink);
  background: linear-gradient(135deg, var(--accent-soft), var(--med-soft));
  border: 1px solid var(--line);
}
.card-head h3 { font: 400 30px/1.05 var(--serif); letter-spacing: -.01em; }
.meta { margin-top: 5px; font-size: 13px; }
.scores { display: flex; align-items: center; gap: 16px; }
.ring { position: relative; width: 76px; height: 76px; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring-track { fill: none; stroke: var(--bg-2); stroke-width: 5; }
.ring-fg { fill: none; stroke: var(--accent); stroke-width: 5; stroke-linecap: round; }
.card.high .ring-fg { stroke: var(--high); }
.card.medium .ring-fg { stroke: var(--med); }
.ring-label { position: absolute; inset: 0; display: grid; place-content: center; text-align: center; }
.ring-label b { font: 600 17px/1 var(--mono); letter-spacing: -.02em; }
.ring-label small { font-size: 10px; color: var(--muted); letter-spacing: .08em; text-transform: uppercase; margin-top: 3px; }
.score-side { display: grid; gap: 8px; justify-items: start; }
.risk-pill { font: 500 12px/1 var(--sans); color: var(--muted); padding: 6px 10px; border: 1px solid var(--line); border-radius: 999px; }
.risk-pill b { font-family: var(--mono); color: var(--ink); margin-left: 2px; }

.reason {
  margin: 20px 0 0; padding: 14px 18px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line);
  font: 400 19px/1.45 var(--serif); color: var(--ink-2);
}
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 32px; }
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; gap: 0; } }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 520px) { .two { grid-template-columns: 1fr; } }
.sr { background: var(--high-soft); border-radius: 12px; padding: 4px 14px 12px; }
.sr h5 { color: var(--high); }
.sr-risk { background: var(--low-soft); }
.sr-risk h5 { color: var(--low); }
ul, ol { margin: 0; padding-left: 18px; }
.sr ul { font-size: 13px; color: var(--ink-2); display: grid; gap: 4px; }

.params { list-style: none; padding: 0; display: grid; gap: 14px; }
.p-head { display: flex; justify-content: space-between; gap: 10px; font-size: 13.5px; font-weight: 500; }
.p-head b { font: 600 13px/1 var(--mono); color: var(--ink); }
.bar { position: relative; height: 6px; background: var(--bg-2); border-radius: 999px; margin-top: 7px; overflow: hidden; }
.bar i {
  position: absolute; inset: 0 auto 0 0; border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}
.params p { margin-top: 6px; font-size: 12.5px; line-height: 1.5; }
.flags { list-style: none; padding: 0; display: grid; gap: 8px; }
.flags li { font-size: 13px; padding: 10px 12px; background: var(--panel-2); border: 1px solid var(--line); border-radius: 10px; }
.flags li b { color: var(--low); font-weight: 600; margin-right: 4px; }
.summary { font-size: 14px; color: var(--ink-2); }
.why { margin-top: 10px; font-size: 13.5px; padding-left: 12px; border-left: 2px solid var(--accent); color: var(--ink-2); }
.probe-h { margin-top: 20px; }
.probes { list-style: none; padding: 0; counter-reset: probe; display: grid; gap: 8px; }
.probes li {
  counter-increment: probe; position: relative; padding: 12px 14px 12px 46px; font-size: 13.5px;
  background: var(--panel-2); border: 1px solid var(--line); border-radius: 12px;
}
.probes li::before {
  content: counter(probe, decimal-leading-zero); position: absolute; left: 14px; top: 12px;
  font: 600 12px/1.6 var(--mono); color: var(--accent);
}

.email { margin-top: 24px; padding-top: 4px; border-top: 1px solid var(--line); }
.email-head { display: flex; align-items: center; gap: 10px; }
.email-head h4 { margin: 20px 0 12px; }
.letter {
  display: grid; gap: 10px; padding: 16px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line);
}
.letter textarea { font-family: var(--sans); }
.card-status { margin-right: auto; font-size: 13px; }

.rationale-block { border-top: 1px solid var(--line); margin-top: 22px; }
.rationale-text { white-space: pre-wrap; font-size: 13.5px; color: var(--ink-2); line-height: 1.65; }
.detail-actions { border-top: 1px solid var(--line); margin-top: 22px; padding-top: 16px; }
.detail-status { margin-right: auto; font-size: 13px; }

/* ---------- Review rows ---------- */
.queue-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; flex-wrap: wrap; margin-bottom: 14px; }
.head-actions { display: flex; gap: 8px; align-items: center; }
.collapsible.closed .queue-head { margin-bottom: 0; }
.collapsible.closed .section-note { display: none; }
.section-toggle svg { transition: transform .25s; }

.rows { display: flex; flex-direction: column; }
.qrow {
  display: grid; grid-template-columns: auto 1fr auto; gap: 14px 18px; align-items: center;
  padding: 16px 14px; margin: 0 -14px; border-radius: 14px; border-top: 1px solid var(--line);
  transition: background .2s;
}
.qrow:first-child { border-top: 0; }
.qrow:hover { background: var(--panel-2); }
.q-ring { position: relative; width: 48px; height: 48px; }
.q-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.q-ring .ring-track { stroke-width: 4; }
.q-ring .ring-fg { stroke-width: 4; stroke: var(--med); }
.qrow.is-low .q-ring .ring-fg { stroke: var(--low); }
.q-ring-val { position: absolute; inset: 0; display: grid; place-items: center; font: 600 12px/1 var(--mono); }
.q-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.q-name { font: 400 21px/1.1 var(--serif); font-weight: 400; }
.q-meta { font: 500 11.5px/1 var(--mono); margin-top: 5px; letter-spacing: .02em; }
.q-reason {
  margin-top: 8px; font-size: 13.5px; color: var(--ink-2);
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.q-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-top: 8px; }
.q-num { font: 500 12px/1 var(--mono); color: var(--muted); }
.q-num b { color: var(--ink); font-weight: 600; }
.q-flags { display: flex; flex-wrap: wrap; gap: 5px; }
.q-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.q-status { margin-top: 8px; font-size: 12.5px; color: var(--low); }
@media (max-width: 720px) {
  .qrow { grid-template-columns: auto 1fr; }
  .q-actions { grid-column: 1 / -1; justify-content: flex-start; }
}

/* ---------- Dialog ---------- */
dialog.detail {
  width: min(980px, calc(100vw - 32px)); max-height: calc(100vh - 40px);
  padding: 0; border: 1px solid var(--line); border-radius: 22px;
  background: var(--bg); color: var(--ink); box-shadow: var(--shadow-lg); overflow: hidden auto;
}
dialog.detail::backdrop { background: rgba(14, 16, 19, .42); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.detail-head {
  position: sticky; top: 0; z-index: 2; display: flex; justify-content: space-between; align-items: center;
  gap: 12px; padding: 18px 24px; background: color-mix(in oklab, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px); border-bottom: 1px solid var(--line);
}
.detail-head h2 { font: 400 26px/1.1 var(--serif); }
.detail-head .kicker { margin-bottom: 6px; }
#detail-body { padding: 20px; }
#detail-body .card { margin: 0; box-shadow: none; }
#detail-body > .muted, #detail-body > .err { padding: 40px; text-align: center; }

/* ---------- Audit table ---------- */
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
th {
  position: sticky; top: 0; background: var(--panel-2); color: var(--muted);
  font: 600 10.5px/1 var(--sans); letter-spacing: .1em; text-transform: uppercase;
}
tbody tr:hover > td { background: color-mix(in oklab, var(--panel-2) 70%, transparent); }
td:first-child, td:nth-child(4), td:nth-child(5) { font-family: var(--mono); font-size: 12px; }
td pre {
  white-space: pre-wrap; font: 12px/1.5 var(--mono); max-height: 380px; overflow: auto;
  background: var(--panel-2); padding: 12px; border-radius: 10px; border: 1px solid var(--line);
}
td h4 { margin-top: 10px; }
.cat-HIGH_POTENTIAL { color: var(--high); font-weight: 600; }
.cat-MEDIUM_POTENTIAL { color: var(--med); font-weight: 600; }
.cat-LOW_POTENTIAL { color: var(--low); font-weight: 600; }

/* ---------- Footer ---------- */
.foot { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; margin-top: 48px; font-size: 12px; color: var(--muted); }
.foot .dot { width: 3px; height: 3px; border-radius: 50%; background: var(--line-2); }

@media (max-width: 640px) {
  .top-inner, main { padding-left: 16px; padding-right: 16px; }
  .warn { width: calc(100% - 32px); }
  .tabs { width: 100%; justify-content: space-between; }
  .tab { padding: 9px 12px; }
  .card { padding: 20px; }
  .card-head h3 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: .01ms !important; }
}

.sr ul li.none { list-style: none; margin-left: -18px; color: var(--muted); font-style: italic; }

/* ---------- Invite preview on cards ---------- */
.letter-preview {
  padding: 16px 18px; border-radius: var(--radius-sm);
  background: var(--panel-2); border: 1px solid var(--line);
}
.lp-row { display: flex; gap: 10px; font-size: 13px; margin-bottom: 6px; }
.lp-row span { width: 58px; flex: none; color: var(--muted); font-size: 12px; }
.lp-row b { font-weight: 500; color: var(--ink); min-width: 0; overflow-wrap: anywhere; }
.lp-body {
  margin-top: 10px; padding-top: 12px; border-top: 1px dashed var(--line-2);
  white-space: pre-wrap; font: 400 16px/1.55 var(--serif); color: var(--ink-2);
  max-height: 11.5em; overflow: hidden;
  -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
          mask-image: linear-gradient(180deg, #000 70%, transparent);
}

/* ---------- Email composer ---------- */
dialog.compose { width: min(720px, calc(100vw - 32px)); }
.compose-body { padding: 20px 24px 8px; display: grid; gap: 14px; }
.compose-from {
  display: flex; gap: 10px; align-items: center; font-size: 13px;
  padding: 10px 12px; border-radius: 10px; background: var(--panel-2); border: 1px solid var(--line);
}
.compose-from span { color: var(--muted); font-size: 12px; width: 44px; }
.compose-from b { font-weight: 500; overflow-wrap: anywhere; }
#compose-message { font: 400 17px/1.6 var(--serif); color: var(--ink); min-height: 280px; }
.compose-note { font-size: 12.5px; color: var(--muted); }
.compose-error { font-size: 13px; color: var(--low); background: var(--low-soft); padding: 10px 12px; border-radius: 10px; }
.compose-foot {
  position: sticky; bottom: 0; display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap;
  padding: 14px 24px; border-top: 1px solid var(--line);
  background: color-mix(in oklab, var(--bg) 90%, transparent); backdrop-filter: blur(10px);
}
.compose-saved { margin-right: auto; font: 500 12px/1 var(--mono); color: var(--high); }

#compose-to[readonly] { color: var(--ink-2); background: var(--bg-2); cursor: default; }

/* ---------- Sort + date controls ---------- */
.view-controls { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.seg-sm { padding: 3px; }
.seg-sm .seg-opt span { padding: 6px 12px; font-size: 12.5px; }
.date-pick {
  flex-direction: row; align-items: center; gap: 6px; padding: 0 4px 0 12px;
  background: var(--panel); border: 1px solid var(--line); border-radius: 999px; color: var(--ink-2);
}
.date-pick svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; flex: none; }
.date-pick select {
  border: 0; background: transparent; padding: 7px 26px 7px 2px; border-radius: 999px; width: auto; font-size: 12.5px; color: var(--ink);
  -webkit-appearance: none; appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 13px) 52%, calc(100% - 8px) 52%; background-size: 5px 5px; background-repeat: no-repeat;
}
.date-pick select:focus { box-shadow: none; }
.custom-range { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; }
.custom-range input { width: auto; padding: 6px 10px; font-size: 12.5px; border-radius: 999px; }
.section-head .filter-bar { justify-content: flex-end; }

/* ---------- New tag, upload result links, jump highlight ---------- */
.chip.new-tag { background: var(--accent-soft); color: var(--accent); }
.results li { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.results .view-btn { padding: 6px 12px; font-size: 12px; flex: none; }
@keyframes kargo-flash {
  0%, 100% { box-shadow: 0 0 0 0 transparent; }
  20%, 60% { box-shadow: 0 0 0 3px color-mix(in oklab, var(--accent) 55%, transparent); }
}
.flash { animation: kargo-flash 2.4s ease-out 1; border-radius: 14px; }
.qrow.flash { background: var(--accent-soft); transition: background 2s; }
