/* AppliedIn — a calm console for a one-person job-application pipeline.
   Understated, product-grade: Inter everywhere, JetBrains Mono only for the
   log stream and data fragments. Color carries meaning, not decoration:
   green = discovery/success, amber = needs attention, red = failure.
   The two-step flow (Discover → Process) is the visual spine; everything
   else recedes until it matters. */

:root {
  --bg: #101312;
  --panel: #151917;
  --panel-solid: #151917;
  --card: #1a1f1c;
  --card-2: #202622;
  --border: #262d28;
  --border-2: #343d37;
  --fg: #e8ede9;
  --muted: #9fada3;
  --faint: #66716a;

  --scan: #3fd68f;      /* discovery / good */
  --scan-deep: #24b476;
  --scan-ink: #08130d;  /* text on a green button */
  --run: #f2b13e;       /* process / attention */
  --run-deep: #d99a25;
  --ink-on-run: #221703;
  --bad: #f07b71;
  --info: #6cc4d8;

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.25);
  --shadow-2: 0 10px 34px -12px rgba(0, 0, 0, 0.5);
  --r-sm: 6px;
  --r-md: 9px;
  --r-lg: 12px;

  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

:root[data-theme="light"] {
  --bg: #f6f7f6;
  --panel: #ffffff;
  --panel-solid: #ffffff;
  --card: #ffffff;
  --card-2: #f1f4f1;
  --border: #e1e6e1;
  --border-2: #c9d2c9;
  --fg: #171d19;
  --muted: #5a675e;
  --faint: #8b968e;

  --scan: #0e9c62;
  --scan-deep: #0b7f50;
  --scan-ink: #ffffff;
  --run: #e29c17;
  --run-deep: #c4860e;
  --ink-on-run: #241804;
  --bad: #d64a3e;
  --info: #14829e;

  --shadow-1: 0 1px 2px rgba(20, 30, 24, 0.07);
  --shadow-2: 0 12px 36px -14px rgba(20, 30, 24, 0.22);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html, body { margin: 0; min-height: 100%; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--sans);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--scan); color: var(--scan-ink); }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; color: inherit; }
button:disabled { cursor: default; }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
:focus-visible { outline: 2px solid var(--scan); outline-offset: 2px; border-radius: 4px; }

.shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ─── Control deck ───────────────────────────────────────────────────────── */
.deck {
  position: sticky;
  top: 0;
  z-index: 30;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 12px clamp(16px, 3vw, 32px) 0;
}
.deck-row {
  display: flex;
  align-items: center;
  gap: clamp(16px, 3vw, 40px);
  flex-wrap: wrap;
}
.deck-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
}
.brand-logo .lg-badge {
  fill: color-mix(in srgb, var(--scan) 9%, var(--card));
  stroke: var(--border-2);
  stroke-width: 1;
}
.brand-logo .lg-mark {
  fill: none;
  stroke: var(--scan);
  stroke-width: 4.2;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 15px; letter-spacing: -0.01em; }
.brand-sub {
  font-size: 9.5px;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--faint);
}
.paused-pill {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--run);
  border: 1px solid color-mix(in srgb, var(--run) 40%, transparent);
  background: color-mix(in srgb, var(--run) 10%, transparent);
  border-radius: 999px;
  padding: 2px 10px;
  animation: pausepulse 2s ease-in-out infinite;
}
@keyframes pausepulse { 50% { opacity: 0.55; } }

/* The two-step flow: Discover → Process. Normal-sized, tasteful buttons. */
.deck-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  justify-content: center;
  flex-wrap: wrap;
}
.act {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 14px;
  border-radius: var(--r-md);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.005em;
  white-space: nowrap;
  box-shadow: var(--shadow-1);
  transition: background 0.14s ease, filter 0.14s ease, opacity 0.14s ease;
}
.act-ico { width: 15px; height: 15px; flex-shrink: 0; }
.act-discover {
  background: var(--scan);
  border-color: color-mix(in srgb, var(--scan-ink) 12%, var(--scan));
  color: var(--scan-ink);
  border-radius: var(--r-md) 0 0 var(--r-md);
}
.act-discover:not(:disabled):hover { filter: brightness(1.05); }
.act-caret {
  width: 28px;
  height: 34px;
  padding: 0;
  justify-content: center;
  background: var(--scan);
  border-color: color-mix(in srgb, var(--scan-ink) 12%, var(--scan));
  border-left: 1px solid color-mix(in srgb, var(--scan-ink) 25%, var(--scan));
  color: var(--scan-ink);
  border-radius: 0 var(--r-md) var(--r-md) 0;
}
.act-caret:hover, .act-caret.open { filter: brightness(1.07); }
.act-caret svg { transition: transform 0.15s ease; }
.act-caret.open svg { transform: rotate(180deg); }
.disco { position: relative; display: inline-flex; }
.act-arrow {
  display: inline-flex;
  color: var(--faint);
}
.act-process {
  background: var(--run);
  border-color: color-mix(in srgb, var(--ink-on-run) 12%, var(--run));
  color: var(--ink-on-run);
}
.act-process:not(:disabled):hover { filter: brightness(1.04); }
.act-badge {
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: color-mix(in srgb, var(--ink-on-run) 82%, transparent);
  color: var(--run);
  font-size: 11.5px;
  font-weight: 600;
  margin-left: 2px;
}
.act-badge.zero { opacity: 0.55; }
.act:disabled { opacity: 0.75; }
.act.running { pointer-events: none; }
.act-spin {
  display: none;
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 2px solid color-mix(in srgb, currentColor 25%, transparent);
  border-top-color: currentColor;
  animation: spin 0.8s linear infinite;
}
.act.running .act-spin { display: inline-block; }
.act.running .act-ico { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* company picker (scopes the next discovery run) */
/* A popover is anchored under its button, so a tall one runs off the bottom of
   the window and its footer — where the save button lives — becomes
   unreachable: scrolling over the popover scrolls its inner list instead of the
   page. --pop-max is set from app.js on open to the space actually below the
   button, and the column layout lets the scrollable middle shrink so the footer
   is always in view. */
.copicker {
  position: absolute;
  left: 0;
  top: calc(100% + 8px);
  width: min(272px, calc(100vw - 32px));
  max-height: var(--pop-max, none);
  display: flex;
  flex-direction: column;
  background: var(--panel-solid);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  z-index: 60;
  overflow: hidden;
}
/* Footers and headers hold their size; only the scrollable middle gives way. */
.copicker > .cp-head,
.copicker > .cp-tools,
.copicker > .cp-role-h,
.copicker > .cp-foot,
.copicker > .cp-add,
.copicker > .cp-role-foot { flex: none; }
.cp-head { padding: 10px 10px 0; }
.cp-search {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 7px 11px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--card-2);
  color: var(--fg);
  outline: none;
}
.cp-search:focus { border-color: var(--scan); }
.cp-search::placeholder { color: var(--faint); }
.cp-tools {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 12px 6px;
}
.cp-lk {
  border: none;
  background: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: var(--scan);
}
.cp-lk:hover { text-decoration: underline; }
.cp-state { margin-left: auto; font-size: 10.5px; color: var(--faint); }
.cp-list {
  max-height: 224px;
  overflow-y: auto;
  padding: 2px 6px 6px;
  scrollbar-width: thin;
}
.cp-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 6px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  cursor: pointer;
  user-select: none;
}
.cp-item:hover { background: var(--card-2); }
.cp-item input[type="checkbox"] {
  accent-color: var(--scan);
  width: 14px;
  height: 14px;
  margin: 0;
  cursor: pointer;
  flex: none;
}
.cp-name {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  cursor: pointer;
}
.cp-name span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-skip {
  flex: none;
  border: 0;
  background: none;
  color: var(--faint);
  font-size: 13px;
  line-height: 1;
  padding: 2px 4px;
  border-radius: var(--r-sm);
  cursor: pointer;
  opacity: 0.4;
}
.cp-item:hover .cp-skip, .cp-item.skipped .cp-skip { opacity: 1; }
.cp-skip:hover { color: var(--fg); background: var(--card); }
.cp-item.skipped .cp-name span { text-decoration: line-through; color: var(--faint); }
.cp-skipnote { color: var(--faint); }

/* Dedicated toolbar control: the first-class "Skip companies" manager. */
.skipmgr { position: relative; display: inline-flex; }
.skipbtn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  white-space: nowrap;
}
.skipbtn:hover { border-color: var(--border-2); color: var(--fg); }
.skipbtn.on {
  color: var(--run);
  border-color: color-mix(in srgb, var(--run) 45%, transparent);
  background: color-mix(in srgb, var(--run) 8%, var(--card));
}
.skip-count {
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  font-size: 11px;
  background: color-mix(in srgb, var(--run) 18%, transparent);
  color: var(--run);
}
.skippicker { left: 0; right: auto; }
.sp-item input { accent-color: var(--run); }
.sp-item.skipped span { text-decoration: line-through; color: var(--faint); }
.cp-none { padding: 16px 12px; font-size: 12.5px; color: var(--faint); text-align: center; }
.cp-foot {
  border-top: 1px solid var(--border);
  padding: 8px 12px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--card);
}
.cp-foot b { color: var(--fg); font-weight: 600; }
/* Adding a company was four controls crammed into one row, with nothing saying
   what the URL was for or how the two buttons differed. Stacked and labelled:
   the panel says what it does, the hint says when the optional field matters. */
.cp-add {
  display: flex;
  flex-direction: column;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding: 10px 12px 12px;
  background: var(--card);
}
.cp-add-hd {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 1px;
}
.cp-add .cp-search { width: 100%; min-width: 0; }
.cp-add-hint {
  margin: 1px 0 3px;
  font-size: 11px;
  line-height: 1.45;
  color: var(--faint);
}
.cp-add-row { display: flex; gap: 6px; }
.cp-add-btn {
  flex: none;
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 5px 10px;
}
.cp-add-row .cp-add-btn { flex: 1; text-align: center; }
.cp-add-btn:hover { text-decoration: none; border-color: var(--scan); }
/* The scanning button is the one people mean; the plain add is the quieter path. */
.cp-add-go {
  border-color: color-mix(in srgb, var(--scan) 45%, transparent);
  background: color-mix(in srgb, var(--scan) 12%, transparent);
  color: var(--scan);
}
.cp-add-go:hover { background: color-mix(in srgb, var(--scan) 22%, transparent); }

/* vitals cluster */
.deck-right { display: flex; align-items: center; gap: 16px; }
.deck-vitals {
  display: flex;
  gap: clamp(12px, 1.6vw, 22px);
  align-items: stretch;
}
.vital {
  display: flex;
  flex-direction: column;
  gap: 0;
  min-width: 60px;
  padding: 2px 0 2px 12px;
  border-left: 1px solid var(--border);
}
.vital-n { font-size: 17px; font-weight: 600; line-height: 1.3; }
.vital-l {
  font-size: 10.5px;
  font-weight: 500;
  letter-spacing: 0.02em;
  color: var(--faint);
  white-space: nowrap;
}
.vital.hot .vital-n { color: var(--run); }
.vital.hot .vital-l { color: color-mix(in srgb, var(--run) 70%, var(--faint)); }
.segmeter { display: flex; gap: 3px; margin-top: 4px; }
.segmeter i {
  width: 11px;
  height: 4px;
  border-radius: 2px;
  background: var(--card-2);
  border: 1px solid var(--border-2);
}
.segmeter i.on { background: var(--scan); border-color: var(--scan); }

.iconbtn {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: transparent;
  color: var(--muted);
  transition: border-color 0.14s, color 0.14s, background 0.14s;
}
.iconbtn:hover { border-color: var(--border-2); color: var(--fg); background: var(--card); }

/* settings menu */
.menu-wrap { position: relative; }
.menu {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: 250px;
  background: var(--panel-solid);
  border: 1px solid var(--border-2);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-2);
  padding: 8px;
  z-index: 60;
}
.menu-t {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--faint);
  padding: 6px 10px 8px;
}
.menu-item {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 10px;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  font: inherit;
  font-size: 13.5px;
  color: var(--fg);
  transition: background 0.12s;
}
.menu-item:hover { background: var(--card-2); }
.menu-state {
  font-size: 11px;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 9px;
}
.menu-state.on { color: var(--scan); border-color: color-mix(in srgb, var(--scan) 45%, transparent); }
.menu-state.warn { color: var(--run); border-color: color-mix(in srgb, var(--run) 45%, transparent); }
.menu-div { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-item.danger { color: var(--bad); }
.menu-item.danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); }

/* one-line explanation of the two-step flow */
.deck-help {
  margin: 8px 0 0;
  font-size: 12.5px;
  color: var(--muted);
}
.deck-help b { color: var(--fg); font-weight: 600; }

/* status breakdown strip */
.deck-breakdown {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  padding: 6px 0 10px;
  font-size: 11px;
  color: var(--muted);
}
.bd { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.bd i {
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--faint);
  display: inline-block;
}
.bd.s-ok i { background: var(--scan); }
.bd.s-warn i, .bd.s-live i { background: var(--run); }
.bd.s-bad i { background: var(--bad); }
.bd.s-found i { background: var(--info); }
.bd.s-work i { background: color-mix(in srgb, var(--scan) 55%, var(--faint)); }
.bd.dim { color: var(--faint); }

/* slim indeterminate bar while a run is active */
.runbar { height: 2px; margin: 0 calc(-1 * clamp(16px, 3vw, 32px)); overflow: hidden; }
.runbar[data-active="true"] {
  background-image: linear-gradient(90deg, transparent, var(--scan), transparent);
  background-size: 40% 100%;
  background-repeat: no-repeat;
  animation: sweep 1.4s ease-in-out infinite;
}
@keyframes sweep {
  from { background-position: -60% 0; }
  to { background-position: 160% 0; }
}

/* ─── Board layout ───────────────────────────────────────────────────────── */
.board {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(300px, 27vw, 380px);
  gap: 16px;
  align-items: start;
  padding: 16px clamp(16px, 3vw, 32px);
}
.board.logs-open { grid-template-columns: minmax(0, 1fr); }
.board.logs-open .feedpanel { display: none; }
.work, .feedpanel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

/* workbar: tabs + company filter + search */
.workbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
.tabs { display: flex; gap: 2px; max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.tab {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  flex-shrink: 0;
  white-space: nowrap;
  padding: 7px 12px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--r-md);
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
  transition: color 0.13s, background 0.13s, border-color 0.13s;
}
.tab:hover { color: var(--fg); }
.tab.active {
  color: var(--fg);
  font-weight: 600;
  background: var(--card-2);
  border-color: var(--border);
}
.tab-n {
  font-size: 11px;
  min-width: 20px;
  text-align: center;
  border-radius: 999px;
  padding: 0 6px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--muted);
}
.tab-n.amber {
  background: color-mix(in srgb, var(--run) 16%, transparent);
  border-color: color-mix(in srgb, var(--run) 45%, transparent);
  color: var(--run);
}
.tab-n.red {
  background: color-mix(in srgb, var(--bad) 14%, transparent);
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
  color: var(--bad);
}
.tab-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--faint);
  opacity: 0.5;
}
.tab-dot[data-state="live"] { background: var(--scan); opacity: 1; }
.tab-dot[data-state="demo"] { background: var(--info); opacity: 0.9; }
.tab-dot[data-state="connecting"] { background: var(--run); opacity: 0.9; }
.workbar-right { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.cofilter {
  font: inherit;
  font-size: 12.5px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--muted);
  padding: 7px 10px;
  max-width: 170px;
  outline: none;
  transition: border-color 0.14s, color 0.14s;
}
.cofilter:hover { border-color: var(--border-2); }
.cofilter:focus { border-color: var(--scan); }
.cofilter.on {
  color: var(--fg);
  border-color: color-mix(in srgb, var(--scan) 55%, var(--border-2));
}
.search {
  font: inherit;
  font-size: 12.5px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  color: var(--fg);
  padding: 7px 12px;
  width: min(210px, 36vw);
  outline: none;
  transition: border-color 0.14s;
}
.search:focus { border-color: var(--scan); }
.search::placeholder { color: var(--faint); }

.pane { padding: 14px 16px 18px; min-height: 320px; }

/* filter chips */
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.chip {
  font-size: 12px;
  font-weight: 500;
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  transition: color 0.13s ease, border-color 0.13s ease, background 0.13s ease;
}
.chip:hover { color: var(--fg); border-color: var(--border-2); }
.chip[aria-selected="true"] {
  background: var(--fg);
  color: var(--bg);
  border-color: var(--fg);
  font-weight: 600;
}
.chip .n { opacity: 0.65; margin-left: 5px; font-variant-numeric: tabular-nums; }

/* ─── Pipeline board (kanban lanes) ──────────────────────────────────────── */
.kboard {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(164px, 1fr);
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 6px;
  scrollbar-width: thin;
  align-items: start;
}
.klane {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  min-height: 140px;
  display: flex;
  flex-direction: column;
}
.kl-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 11px;
  border-bottom: 1px solid var(--border);
  cursor: default;
}
.kl-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex-shrink: 0; }
.klane.ln-found .kl-dot { background: var(--info); }
.klane.ln-ready .kl-dot { background: color-mix(in srgb, var(--scan) 60%, var(--faint)); }
.klane.ln-live .kl-dot { background: var(--run); animation: wippulse 1.4s ease-in-out infinite; }
.klane.ln-ok .kl-dot { background: var(--scan); }
.klane.ln-warn .kl-dot { background: var(--run); }
.klane.ln-flag .kl-dot { background: var(--info); }
.klane.ln-bad .kl-dot { background: var(--bad); }
.kl-name { font-size: 12.5px; font-weight: 600; }
.kl-n {
  margin-left: auto;
  font-size: 11px;
  color: var(--muted);
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: 999px;
  min-width: 20px;
  padding: 0 6px;
  text-align: center;
}
.kl-cards {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 9px;
  /* A lane with 100+ cards must scroll ITSELF — never stretch the page. */
  max-height: min(62vh, 640px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
.kl-empty { color: var(--faint); text-align: center; font-size: 12px; padding: 12px 0 8px; }
.kcard {
  background: var(--card-2);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 9px 11px;
  cursor: pointer;
  transition: border-color 0.13s, transform 0.13s, box-shadow 0.13s;
}
.kcard:hover {
  border-color: var(--border-2);
  transform: translateY(-1px);
  box-shadow: var(--shadow-1);
}
.kc-co { font-size: 13px; font-weight: 600; }
.kc-role {
  font-size: 12px;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 1px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.kc-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  margin-top: 9px;
  flex-wrap: wrap;
}
.knote { margin-top: 10px; font-size: 11.5px; color: var(--faint); }

/* ─── Applications table ─────────────────────────────────────────────────── */
.tablewrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
}
table.data { width: 100%; border-collapse: collapse; font-size: 13.5px; min-width: 680px; }
table.data th {
  text-align: left;
  font-weight: 600;
  font-size: 10.5px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}
table.data td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
table.data tbody tr:last-child td { border-bottom: none; }
table.data tbody tr { cursor: pointer; transition: background 0.12s; }
table.data tbody tr:hover { background: var(--card-2); }
.t-co { font-weight: 600; white-space: nowrap; }
.t-role {
  color: var(--muted);
  max-width: 300px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.t-when {
  color: var(--faint);
  font-family: var(--mono);
  font-size: 11.5px;
  white-space: nowrap;
}
.t-links { display: flex; gap: 5px; align-items: center; }
.rowlk {
  font-family: var(--mono);
  font-size: 10.5px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  border: 1px solid var(--border);
  background: transparent;
  border-radius: var(--r-sm);
  padding: 2px 8px;
  transition: color 0.13s ease, border-color 0.13s ease, background 0.13s ease;
}
a.rowlk, button.rowlk { display: inline-block; }
.rowlk:hover { color: var(--fg); border-color: var(--border-2); }
.rowlk.off { opacity: 0.28; pointer-events: none; }

/* status pill */
.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.01em;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
  border: 1px solid var(--border);
  color: var(--muted);
  background: transparent;
}
.pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  flex-shrink: 0;
}
.pill.s-ok {
  color: var(--scan);
  border-color: color-mix(in srgb, var(--scan) 40%, transparent);
  background: color-mix(in srgb, var(--scan) 9%, transparent);
}
.pill.s-warn {
  color: var(--run);
  border-color: color-mix(in srgb, var(--run) 45%, transparent);
  background: color-mix(in srgb, var(--run) 10%, transparent);
}
.pill.s-live {
  color: var(--run);
  border-color: color-mix(in srgb, var(--run) 45%, transparent);
  background: color-mix(in srgb, var(--run) 10%, transparent);
}
.pill.s-live::before { animation: wippulse 1.1s ease-in-out infinite; }
@keyframes wippulse { 50% { opacity: 0.25; transform: scale(0.6); } }
.pill.s-bad {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 42%, transparent);
  background: color-mix(in srgb, var(--bad) 9%, transparent);
}
.pill.s-found {
  color: var(--info);
  border-color: color-mix(in srgb, var(--info) 40%, transparent);
}
.pill.s-found::before { background: transparent; border: 1px dashed currentColor; }
.pill.s-tailoring {
  color: var(--run);
  border-color: color-mix(in srgb, var(--run) 45%, transparent);
  background: color-mix(in srgb, var(--run) 12%, transparent);
}
.pill.s-tailoring::before {
  background: var(--run);
  animation: wippulse 1.1s ease-in-out infinite;
}
.pill.s-work { color: color-mix(in srgb, var(--scan) 70%, var(--muted)); }
.pill.s-dim { color: var(--faint); }
.pill.s-dim::before { background: var(--faint); }

/* match score */
.score {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
}
.score-bar {
  width: 44px;
  height: 4px;
  border-radius: 2px;
  border: 1px solid var(--border-2);
  overflow: hidden;
  background: var(--bg);
}
.score-bar > span { display: block; height: 100%; }

/* ─── Needs-you cards ────────────────────────────────────────────────────── */
.pane-note {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 13px;
}
.gatecard {
  border: 1px solid color-mix(in srgb, var(--run) 28%, var(--border));
  border-left: 3px solid var(--run);
  border-radius: var(--r-md);
  background: var(--card);
  padding: 14px 16px;
  margin-bottom: 12px;
}
.gatecard header,
.stuckcard header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}
.gc-co { font-weight: 600; font-size: 14.5px; }
.gc-role { color: var(--muted); font-size: 13px; margin-left: 8px; }
.gc-side { display: flex; align-items: center; gap: 8px; }
.gatepill {
  font-size: 11px;
  font-weight: 500;
  color: var(--run);
  border: 1px solid color-mix(in srgb, var(--run) 40%, transparent);
  background: color-mix(in srgb, var(--run) 9%, transparent);
  border-radius: 999px;
  padding: 2px 10px;
  white-space: nowrap;
}
.gc-q {
  margin: 10px 0 12px;
  font-size: 13.5px;
  color: var(--fg);
  line-height: 1.55;
}
.gc-answer { display: flex; flex-direction: column; gap: 10px; }
.gate-input {
  width: 100%;
  font: inherit;
  font-size: 13px;
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  background: var(--bg);
  color: var(--fg);
  resize: vertical;
}
.gate-input:focus { outline: none; border-color: var(--run); }
.gc-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.gc-jd { font-size: 12px; color: var(--faint); margin-left: auto; }
.gc-jd:hover { color: var(--fg); }

/* ─── Unable-to-do-it cards — full failure visibility ────────────────────── */
.stuckcard {
  display: flex;
  border: 1px solid color-mix(in srgb, var(--bad) 24%, var(--border));
  border-left: 3px solid var(--bad);
  border-radius: var(--r-md);
  background: var(--card);
  margin-bottom: 12px;
  overflow: hidden;
}
.stuck-main {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.stuck-reason { font-size: 13.5px; line-height: 1.5; color: var(--fg); }
.mini-timeline {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 2px solid var(--border-2);
  padding-left: 10px;
  margin: 2px 0;
}
.mini-tl {
  display: flex;
  align-items: baseline;
  gap: 7px;
  font-size: 12px;
  color: var(--muted);
}
.mini-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
  position: relative;
  top: -2px;
}
.mini-tl:last-child .mini-lbl { color: var(--fg); }
.mini-tl:last-child .mini-dot { background: var(--bad); }
.mini-when { margin-left: auto; font-size: 10.5px; color: var(--faint); white-space: nowrap; }
.stuck-meta { font-size: 10.5px; color: var(--faint); }
.stuck-meta a { color: var(--muted); text-decoration: underline; }
.stuck-meta a:hover { color: var(--fg); }
.stuck-shot { flex: 0 0 220px; border-left: 1px solid var(--border); display: block; }
.stuck-shot img {
  width: 100%;
  height: 100%;
  max-height: 210px;
  object-fit: cover;
  object-position: top;
  display: block;
}
.stuck-shot.none {
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--faint);
  font-size: 11.5px;
}
@media (max-width: 700px) {
  .stuckcard { flex-direction: column; }
  .stuck-shot { flex-basis: auto; border-left: none; border-top: 1px solid var(--border); }
}

/* ─── Buttons ────────────────────────────────────────────────────────────── */
.btn {
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--border-2);
  background: transparent;
  color: var(--fg);
  transition: color 0.13s ease, border-color 0.13s ease, background 0.13s ease;
  white-space: nowrap;
}
.btn:hover { border-color: var(--fg); }
.btn-primary {
  background: var(--scan);
  color: var(--scan-ink);
  border-color: color-mix(in srgb, var(--scan-ink) 12%, var(--scan));
}
.btn-primary:hover { filter: brightness(1.06); }
.btn-amber {
  background: color-mix(in srgb, var(--run) 12%, transparent);
  color: var(--run);
  border-color: color-mix(in srgb, var(--run) 50%, transparent);
  font-weight: 600;
}
.btn-amber:hover { background: color-mix(in srgb, var(--run) 22%, transparent); }
.btn-ghost { border-color: var(--border); color: var(--muted); }
.btn-ghost:hover { color: var(--fg); border-color: var(--border-2); }
.btn-danger {
  color: var(--bad);
  border-color: color-mix(in srgb, var(--bad) 45%, transparent);
}
.btn-danger:hover { background: color-mix(in srgb, var(--bad) 12%, transparent); border-color: var(--bad); }

/* ─── Live activity: shared row rendering (side rail + Logs tab) ─────────── */
.feedpanel {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 128px;
  max-height: calc(100vh - 162px);
}
.feed-head {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.feed-title { font-size: 12.5px; font-weight: 600; }
.feed-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--faint);
  flex-shrink: 0;
}
.feed-dot[data-state="live"] {
  background: var(--scan);
  box-shadow: 0 0 8px color-mix(in srgb, var(--scan) 70%, transparent);
  animation: livepulse 1.8s ease-in-out infinite;
}
.feed-dot[data-state="demo"] { background: var(--info); }
.feed-dot[data-state="connecting"] { background: var(--run); animation: pausepulse 1s infinite; }
@keyframes livepulse { 50% { box-shadow: 0 0 2px transparent; } }
.feed-hint { margin-left: auto; font-size: 10.5px; color: var(--faint); letter-spacing: 0.06em; }
.feed { overflow-y: auto; padding: 6px 0 14px; scrollbar-width: thin; }
.feed-empty { padding: 40px 20px; text-align: center; color: var(--faint); font-size: 11.5px; line-height: 1.7; }

.fe {
  padding: 7px 14px 6px;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 55%, transparent);
  animation: feedin 0.25s ease;
}
@keyframes feedin { from { opacity: 0; transform: translateY(-3px); } }
.fe:hover { background: color-mix(in srgb, var(--card) 60%, transparent); }
.fe-h {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 10.5px;
  color: var(--faint);
  flex-wrap: wrap;
}
.fe-t { font-variant-numeric: tabular-nums; }
.fe-stg { color: var(--muted); font-weight: 600; }
.fe-mark {
  text-transform: uppercase;
  letter-spacing: 0.07em;
  font-weight: 600;
}
.fe-co {
  margin-left: auto;
  color: var(--muted);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0 8px;
  font-size: 10px;
  cursor: pointer;
}
.fe-co:hover { color: var(--fg); border-color: var(--border-2); }
.fe-b {
  margin-top: 3px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  color: var(--muted);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}
.fe-b.md { white-space: normal; }
.fe-b.clipped { max-height: 6.4em; overflow: hidden; position: relative; }
.fe-b.clipped:not(.open)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0;
  height: 2em;
  background: linear-gradient(transparent, var(--panel-solid));
  pointer-events: none;
}
.fe-b.clipped.open { max-height: none; }
.fe-more {
  margin-top: 4px;
  font-size: 10px;
  color: var(--faint);
  background: none;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 1px 8px;
}
.fe-more:hover { color: var(--fg); border-color: var(--border-2); }
.fe-shot {
  display: inline-block;
  margin-top: 6px;
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  overflow: hidden;
  line-height: 0;
}
.fe-shot img { max-width: 100%; max-height: 180px; width: auto; height: auto; display: block; }

/* kind accents */
.fe.k-gate .fe-mark, .fe.k-gate .fe-b { color: var(--run); }
.fe.k-gate { border-left: 2px solid var(--run); }
.fe.k-ok .fe-mark, .fe.k-ok .fe-b { color: var(--scan); }
.fe.k-ok { border-left: 2px solid var(--scan); }
.fe.k-bad .fe-mark, .fe.k-bad .fe-b { color: var(--bad); }
.fe.k-bad { border-left: 2px solid var(--bad); }
.fe.k-found .fe-mark { color: var(--info); }
.fe.k-start .fe-mark { color: var(--scan); }
.fe.k-model .fe-b { color: var(--muted); }
.fe-step {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px 4px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--faint);
  border-bottom: none;
}
.fe-step::before { content: "▸"; color: var(--scan); }
.fe-step .fe-co { margin-left: auto; }

/* ─── Logs tab: the roomy, filterable stream ─────────────────────────────── */
.log-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.log-head .chips { margin-bottom: 0; }
.log-live {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: 11px;
  color: var(--faint);
}
.log-sep { opacity: 0.5; }
.logview {
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--card);
  overflow: hidden;
}
.logview .fe { padding: 8px 16px 7px; }
.logview .fe-h { font-size: 11px; }
.logview .fe-b { font-size: 12px; }
.logview .fe-shot img { max-height: 260px; }
.logview:empty { display: none; }

/* ─── Empty states ───────────────────────────────────────────────────────── */
.empty {
  padding: 52px 24px;
  text-align: center;
  color: var(--muted);
  font-size: 13.5px;
  line-height: 1.7;
}
.empty-big {
  font-size: 15.5px;
  font-weight: 600;
  color: var(--fg);
  margin-bottom: 6px;
}
.empty b { color: var(--fg); font-weight: 600; }
.empty-act { margin-top: 14px; }

/* ─── Footer ─────────────────────────────────────────────────────────────── */
.foot {
  padding: 12px clamp(16px, 3vw, 32px);
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--faint);
  display: flex;
  align-items: center;
  gap: 10px;
}
.foot-sep { opacity: 0.5; }
.foot-env {
  margin-left: auto;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 2px 10px;
}

/* ─── Detail drawer ──────────────────────────────────────────────────────── */
.scrim {
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 6, 0.5);
  z-index: 40;
  opacity: 0;
  transition: opacity 0.2s;
}
.scrim.show { opacity: 1; }
.drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100vh;
  width: min(560px, 94vw);
  background: var(--bg);
  border-left: 1px solid var(--border-2);
  z-index: 41;
  transform: translateX(100%);
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1);
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-2);
}
.drawer.show { transform: translateX(0); }
.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 20px 22px 16px;
  border-bottom: 1px solid var(--border);
}
.drawer-title { font-size: 17px; font-weight: 700; letter-spacing: -0.01em; }
.drawer-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.drawer-body { overflow-y: auto; padding: 20px 22px 40px; }
.drawer-close {
  border: 1px solid var(--border);
  background: transparent;
  color: var(--muted);
  width: 32px;
  height: 32px;
  border-radius: var(--r-sm);
  font-size: 15px;
  flex-shrink: 0;
}
.drawer-close:hover { color: var(--fg); border-color: var(--border-2); }

.section { margin-bottom: 24px; }
.section-t {
  font-size: 10.5px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--faint);
  margin-bottom: 11px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-t::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.meta-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 18px;
  font-size: 13.5px;
  margin: 0;
}
.meta-grid dt { color: var(--faint); font-size: 12px; }
.meta-grid dd { margin: 0; color: var(--fg); word-break: break-word; }

.drawer-shot {
  display: block;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
  line-height: 0;
  transition: border-color 0.14s;
}
.drawer-shot:hover { border-color: var(--border-2); }
.drawer-shot img { width: 100%; max-height: 300px; object-fit: cover; object-position: top; display: block; }

.fields {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  overflow: hidden;
}
.field {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 10px 13px;
  background: var(--card);
  align-items: center;
}
.field + .field { border-top: 1px solid var(--border); }
.field-q { font-size: 13px; }
.field-q .conf {
  font-size: 9.5px;
  font-weight: 500;
  margin-left: 7px;
  padding: 1px 6px;
  border-radius: 999px;
  border: 1px solid var(--border);
  color: var(--faint);
  vertical-align: middle;
}
.field-q .conf.low { border-color: color-mix(in srgb, var(--run) 45%, transparent); color: var(--run); }
.field-v {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--muted);
  text-align: right;
  max-width: 220px;
  word-break: break-word;
}
.check {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border: 1px solid var(--scan);
  color: var(--scan);
  border-radius: 4px;
  font-size: 11px;
  line-height: 1;
}
.check.off { border-color: var(--border-2); color: transparent; }

.timeline { display: flex; flex-direction: column; }
.tl {
  display: grid;
  grid-template-columns: 14px 1fr;
  gap: 12px;
  padding-bottom: 16px;
  position: relative;
}
.tl::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 14px;
  bottom: -2px;
  width: 1px;
  background: var(--border-2);
}
.tl:last-child::before { display: none; }
.tl-dot {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  border: 1px solid var(--scan);
  background: var(--bg);
  margin-top: 2px;
  z-index: 1;
}
.tl-dot.done { background: var(--scan); }
.tl-label { font-size: 13px; font-weight: 500; }
.tl-time { font-family: var(--mono); font-size: 11px; color: var(--faint); }

.drawer-actions { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.lk {
  font-size: 12px;
  font-weight: 500;
  color: var(--muted);
  border: 1px solid var(--border);
  padding: 4px 10px;
  border-radius: var(--r-sm);
  transition: all 0.14s;
}
.lk:hover { color: var(--fg); border-color: var(--border-2); }
.lk.off { opacity: 0.32; pointer-events: none; }

.gate-box {
  border: 1px solid color-mix(in srgb, var(--run) 45%, transparent);
  border-left: 3px solid var(--run);
  border-radius: var(--r-md);
  padding: 14px 16px;
  background: color-mix(in srgb, var(--run) 6%, var(--card));
}
.gate-q { font-size: 13.5px; color: var(--fg); margin: 8px 0 12px; line-height: 1.55; }
.closed-box {
  border: 1px solid var(--border);
  border-left: 3px solid var(--bad);
  border-radius: var(--r-md);
  padding: 12px 15px;
  background: var(--card);
}
.closed-why { font-size: 13.5px; color: var(--fg); line-height: 1.5; }

.diff-body { display: flex; flex-direction: column; gap: 12px; }
.diff-item {
  border-left: 2px solid var(--border-2);
  padding-left: 12px;
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
}
.diff-line { overflow-wrap: anywhere; padding: 1px 6px; border-radius: 3px; }
.diff-line.del { color: var(--bad); background: color-mix(in srgb, var(--bad) 10%, transparent); }
.diff-line.add { color: var(--scan); background: color-mix(in srgb, var(--scan) 10%, transparent); }
.muted { color: var(--faint); font-size: 13px; }

/* rendered markdown (gate questions / model messages) */
.md ul, .md ol { margin: 6px 0; padding-left: 20px; }
.md li { margin: 2px 0; }
.md strong { font-weight: 700; color: var(--fg); }
.md em { font-style: italic; }
.md code {
  font-family: var(--mono);
  font-size: 0.92em;
  background: var(--card-2);
  padding: 1px 5px;
  border-radius: 3px;
}
.md a { color: var(--muted); text-decoration: underline; }
.md a:hover { color: var(--fg); }

/* ─── Résumé viewer modal ────────────────────────────────────────────────── */
.rmodal {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: rgba(4, 8, 6, 0.66);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px 16px;
  opacity: 0;
  transition: opacity 0.2s;
}
.rmodal.show { opacity: 1; }
.rmodal-bar {
  width: min(820px, 96vw);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
}
.rmodal-title { color: #fff; font-size: 12.5px; letter-spacing: 0.04em; }
.rmodal-actions { display: flex; gap: 8px; align-items: center; }
.rmodal-actions .btn { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.rmodal-actions .drawer-close { color: #fff; border-color: rgba(255, 255, 255, 0.3); }
.rmodal-body {
  width: min(820px, 96vw);
  flex: 1;
  min-height: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: #fff;
  box-shadow: var(--shadow-2);
}
.rmodal-body iframe { width: 100%; height: 100%; border: 0; display: block; }

/* demo résumé sheet (print-like, always light) */
.resume {
  height: 100%;
  overflow-y: auto;
  color: #101312;
  font-family: var(--sans);
  padding: 52px clamp(28px, 6%, 64px);
  line-height: 1.55;
}
.resume h1 { font-size: 27px; letter-spacing: -0.02em; margin: 0; font-weight: 700; }
.resume .r-contact { font-family: var(--mono); font-size: 12px; color: #68706b; margin: 6px 0 22px; }
.resume h2 {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #68706b;
  border-bottom: 1px solid #e0e5e1;
  padding-bottom: 6px;
  margin: 24px 0 12px;
  font-weight: 700;
}
.resume .r-job { display: flex; justify-content: space-between; gap: 12px; font-weight: 600; font-size: 14px; }
.resume .r-job .when { font-family: var(--mono); font-size: 12px; color: #9aa29c; font-weight: 400; white-space: nowrap; }
.resume ul { margin: 7px 0 16px; padding-left: 18px; }
.resume li { font-size: 13.5px; color: #333a36; margin-bottom: 4px; }
.resume .r-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 11px;
  color: #101312;
  border: 1px solid #d5dbd6;
  border-radius: 999px;
  padding: 2px 9px;
  margin: 0 5px 5px 0;
}
.resume .r-lead { font-size: 14px; color: #333a36; margin-bottom: 4px; }

/* ─── Toast ──────────────────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 22px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  z-index: 80;
  font-size: 12.5px;
  background: var(--panel-solid);
  border: 1px solid var(--border-2);
  color: var(--fg);
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-2);
  opacity: 0;
  transition: all 0.22s;
  max-width: min(560px, 90vw);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ─── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1080px) {
  .board { grid-template-columns: 1fr; }
  .feedpanel { position: static; max-height: 420px; }
}
@media (max-width: 860px) {
  .deck-row { gap: 10px; }
  .deck-actions { order: 3; flex-basis: 100%; justify-content: flex-start; }
  .act-discover { flex: 1; justify-content: center; }
  .act-process { flex: 1; justify-content: center; }
  .deck-right { margin-left: auto; }
  .deck-vitals .vital { min-width: 0; }
  .kboard { grid-auto-columns: minmax(190px, 220px); }
}
@media (max-width: 560px) {
  .deck-breakdown { display: none; }
  .deck-help { font-size: 12px; }
  .act-arrow { display: none; }
  .t-role { max-width: 160px; }
  .workbar-right { width: 100%; }
  .search { flex: 1; width: auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0.001ms !important; animation-duration: 0.001ms !important; }
  .runbar[data-active="true"] { animation: none; }
}

/* Flagged-lane retry: one click re-runs the application with human-style clicks. */
.kc-retry {
  margin-left: auto;
  border: 1px solid color-mix(in srgb, var(--info) 45%, transparent);
  background: color-mix(in srgb, var(--info) 10%, transparent);
  color: var(--info);
  border-radius: var(--r-sm);
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  min-height: 27px;
  display: inline-flex;
  align-items: center;
}
.kc-retry:hover { background: color-mix(in srgb, var(--info) 20%, transparent); }

/* Top-level LLM failure banner — quota/auth/outage must never be silent. */
.llm-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px clamp(16px, 3vw, 32px);
  background: color-mix(in srgb, var(--bad) 14%, var(--bg));
  border-bottom: 1px solid color-mix(in srgb, var(--bad) 45%, transparent);
  color: var(--bad);
  font-size: 13px;
  font-weight: 600;
}
.lb-ico { font-size: 15px; }
.lb-msg { flex: 1; min-width: 0; }
.lb-x {
  border: 1px solid color-mix(in srgb, var(--bad) 45%, transparent);
  background: none;
  color: var(--bad);
  border-radius: var(--r-sm);
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 10px;
}
.lb-x:hover { background: color-mix(in srgb, var(--bad) 18%, transparent); }
.kc-apply {
  border-color: color-mix(in srgb, var(--scan) 45%, transparent);
  background: color-mix(in srgb, var(--scan) 10%, transparent);
  color: var(--scan);
}
.kc-apply:hover { background: color-mix(in srgb, var(--scan) 20%, transparent); }

/* One-company end-to-end run, offered when exactly one company is picked. */
.cp-runone {
  display: inline-block;
  margin-top: 4px;
  color: var(--scan);
  border: 1px solid color-mix(in srgb, var(--scan) 40%, transparent);
  border-radius: var(--r-sm);
  padding: 3px 9px;
}
.cp-runone:hover { text-decoration: none; background: color-mix(in srgb, var(--scan) 12%, transparent); }
.klane.ln-captcha .kl-dot { background: var(--info); animation: wippulse 1.4s ease-in-out infinite; }

/* Single-role tailor panel + per-company title filter input */



/* Single-company title filter — shown in the Discover picker when exactly one
   company is picked, right above its run button. Clear label, full-width input. */
.cp-one {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cp-one-fl { display: flex; flex-direction: column; gap: 4px; }
.cp-one-fl label {
  font-size: 11px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.01em;
}
.cp-one-fl .cp-search { width: 100%; }
.cp-runone {
  width: 100%;
  border: 1px solid color-mix(in srgb, var(--scan) 45%, transparent);
  background: color-mix(in srgb, var(--scan) 12%, transparent);
  color: var(--scan);
  border-radius: var(--r-md);
  font-size: 12.5px;
  font-weight: 600;
  padding: 8px 12px;
}
.cp-runone:hover { background: color-mix(in srgb, var(--scan) 22%, transparent); }


/* Top-level "Tailor a role" toolbar control (mirrors Skip companies). */
.rolemgr { position: relative; display: inline-flex; }
.rolebtn { color: var(--scan); border-color: color-mix(in srgb, var(--scan) 35%, var(--border)); }
.rolebtn:hover { color: var(--scan); border-color: color-mix(in srgb, var(--scan) 55%, transparent);
  background: color-mix(in srgb, var(--scan) 8%, var(--card)); }
.rolepicker { left: 0; right: auto; width: min(340px, calc(100vw - 32px)); }
.cp-role-h {
  padding: 11px 12px 4px;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--fg);
}
.cp-role-foot {
  border-top: 1px solid var(--border);
  padding: 9px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11.5px;
  color: var(--muted);
  background: var(--card);
}
.cp-role-foot span { flex: 1; }
.cp-role-foot b { color: var(--fg); font-weight: 600; }
.cp-role-foot .cp-add-btn {
  flex: none;
  border: 1px solid color-mix(in srgb, var(--scan) 45%, transparent);
  background: color-mix(in srgb, var(--scan) 12%, transparent);
  color: var(--scan);
  border-radius: var(--r-sm);
  padding: 5px 11px;
}
.cp-role-foot .cp-add-btn:hover { background: color-mix(in srgb, var(--scan) 22%, transparent); }

/* Run-now (found card) + Run-all (Found lane header) */
.kc-run {
  border-color: color-mix(in srgb, var(--scan) 45%, transparent);
  background: color-mix(in srgb, var(--scan) 10%, transparent);
  color: var(--scan);
}
.kc-run:hover { background: color-mix(in srgb, var(--scan) 20%, transparent); }
/* Queue sits next to Apply as the quieter of the two: same action, in line
   rather than right now, so it must not compete with the primary button. */
.kc-queue {
  border-color: var(--border);
  background: transparent;
  color: var(--muted);
}
.kc-queue:hover { border-color: var(--scan); color: var(--fg); }
.kl-runall {
  margin-left: auto;
  flex: none;
  white-space: nowrap;
  border: 1px solid color-mix(in srgb, var(--scan) 45%, transparent);
  background: color-mix(in srgb, var(--scan) 12%, transparent);
  color: var(--scan);
  border-radius: var(--r-sm);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 9px;
}
.kl-runall:hover { background: color-mix(in srgb, var(--scan) 22%, transparent); }

/* Live "what it's doing now" line on actively-working cards. */
.kc-live {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 0 2px;
  font-size: 11px;
  color: var(--run);
  font-family: var(--mono);
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kc-live-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--run);
  animation: wippulse 1.1s ease-in-out infinite;
}

/* ─── Job preferences ──────────────────────────────────────────────────────
   What counts as a match, editable in place. Same popover language as the
   role/skip pickers — wider, because these are sentences, not checkboxes. */
.prefmgr { position: relative; }
.prefpicker { left: 0; right: auto; width: min(400px, calc(100vw - 32px)); }
.pf-body {
  padding: 6px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 11px;
  /* Shrinks when the popover is capped to the window (min-height:0 is what
     lets a flex item scroll rather than push its footer off-screen). */
  flex: 1 1 auto;
  min-height: 0;
  max-height: min(62vh, 520px);
  overflow-y: auto;
}
.pf-f { display: flex; flex-direction: column; gap: 5px; }
.pf-l {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--muted);
}
.pf-hint { font-weight: 400; font-style: normal; color: var(--faint); }
.pf-row { display: flex; gap: 10px; }
.pf-row .pf-f { flex: 1; }
.pf-narrow { flex: 0 0 88px !important; }
.pf-notes {
  font-family: var(--mono);
  font-size: 11.5px;
  line-height: 1.55;
  resize: vertical;
  min-height: 76px;
}
.pf-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--muted);
  cursor: pointer;
}
.pf-check input { accent-color: var(--scan); }
#pf-state.saved { color: var(--scan); }
#pf-state.failed { color: var(--bad); }

/* ─── Agent log (drawer) ───────────────────────────────────────────────────
   The full transcript for one job: every step, tool call and result. Mono,
   dense, scrollable — it's a log, and it should look like one. */
.agentlog {
  max-height: 320px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--bg);
  padding: 8px 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.agentlog-re { float: right; font-size: 11px; }
.al-e { border-left: 2px solid var(--border-2); padding-left: 9px; }
.al-h { display: flex; align-items: baseline; gap: 7px; font-size: 11px; }
.al-k {
  font-family: var(--mono);
  font-size: 10px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}
.al-k[data-kind="applied"], .al-k[data-kind="discovered"] { color: var(--scan); }
.al-k[data-kind="gate"], .al-k[data-kind="running"] { color: var(--run); }
.al-k[data-kind="error"], .al-k[data-kind="failed"] { color: var(--bad); }
.al-a { font-size: 10.5px; color: var(--info); }
.al-t { margin-left: auto; font-size: 10.5px; color: var(--faint); }
.al-b {
  margin: 4px 0 0;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 150px;
  overflow-y: auto;
}
.drawer-jd { color: var(--scan); text-decoration: none; }
.drawer-jd:hover { text-decoration: underline; }

/* Job location on a pipeline card. The ranking in preferences is Washington
   first, so a top-tier location is marked; everything else stays quiet. */
.kc-loc {
  margin-top: 3px;
  font-size: 11px;
  color: var(--faint);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.kc-loc.top { color: var(--scan); font-weight: 600; }
.kc-loc.remote { color: var(--info); }
.drawer-loc { color: var(--muted); }

/* ─── Tailored lane: location buckets ──────────────────────────────────────
   The location preference is a ranking (Washington, then California, then
   remote), so the lane is grouped and ordered the same way. Colour says which
   tier at a glance; the top tier opens by default and the rest fold away, since
   a lane of thirty cards is not something anyone reads. */
/* Wraps rather than scrolls: a filter the owner cannot see is not a filter, and
   a lane is too narrow to hold four tiers on one line. */
.locbar {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 8px 10px 0;
}
.lp {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 7px; flex: none; white-space: nowrap;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--card); color: var(--muted);
  font-family: var(--sans); font-size: 10.5px; line-height: 1.6;
  cursor: pointer; transition: border-color .12s, color .12s, background .12s;
}
.lp:hover { border-color: var(--border-2); color: var(--fg); }
.lp-n { font-size: 10px; color: var(--faint); }
.lp.on { background: var(--card-2); color: var(--fg); border-color: currentColor; }
.lp.on .lp-n { color: inherit; opacity: .75; }
.lp.bk-wa.on     { color: var(--scan); }
.lp.bk-ca.on     { color: var(--run); }
.lp.bk-remote.on { color: var(--info); }
.lp.bk-other.on,
.lp.lp-all.on    { color: var(--fg); border-color: var(--border-2); }

.bucket { margin-bottom: 12px; }
.bucket:last-child { margin-bottom: 0; }
.bk-head {
  width: 100%;
  display: flex; align-items: center; gap: 7px;
  padding: 4px 2px 6px; margin-bottom: 8px;
  background: none; border: 0; border-bottom: 1px solid var(--border);
  color: inherit; cursor: pointer; text-align: left;
  font-family: var(--sans); font-size: 11.5px; font-weight: 600;
  letter-spacing: 0; white-space: nowrap;
}
.bk-head:hover .bk-name { color: var(--fg); }
.bucket.shut { margin-bottom: 6px; }
.bucket.shut .bk-head { margin-bottom: 0; border-bottom-color: transparent; }
.bk-caret {
  font-size: 10px; width: 10px; flex: none; line-height: 1;
  display: inline-flex; justify-content: center;
  color: currentColor; opacity: .65; transition: opacity .12s;
}
.bk-head:hover .bk-caret { opacity: 1; }
.bk-name { color: var(--muted); transition: color .12s;
           overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bk-n {
  margin-left: auto; font-size: 10px; color: var(--faint);
  background: var(--card-2); border: 1px solid var(--border);
  border-radius: 999px; padding: 0 6px; letter-spacing: 0;
}
.bk-cards { display: flex; flex-direction: column; gap: 8px; }
.bucket.bk-wa     .bk-name,
.bucket.bk-wa     .bk-caret { color: var(--scan); }
.bucket.bk-wa     .bk-head { border-bottom-color: rgba(63, 214, 143, .35); }
.bucket.bk-ca     .bk-name,
.bucket.bk-ca     .bk-caret { color: var(--run); }
.bucket.bk-ca     .bk-head { border-bottom-color: rgba(242, 177, 62, .3); }
.bucket.bk-remote .bk-name,
.bucket.bk-remote .bk-caret { color: var(--info); }
.bucket.bk-other  .bk-name,
.bucket.bk-other  .bk-caret { color: var(--faint); }

/* ─── Profiles ─────────────────────────────────────────────────────────────
   Which identity an application goes out under. Kept beside the other
   top-level tools rather than in settings, because it is a per-run choice. */
.profmgr { position: relative; }
.profpicker { left: 0; right: auto; width: min(360px, calc(100vw - 32px)); }
.pr-list { display: flex; flex-direction: column; padding: 4px 10px 0; gap: 5px; max-height: 240px; overflow-y: auto; }
.pr-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 9px; border-radius: 8px;
  background: var(--card); border: 1px solid var(--border);
}
.pr-row.is-default { border-color: color-mix(in srgb, var(--scan) 50%, transparent); }
.pr-main { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.pr-label { font-size: 12.5px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.pr-tag { font-family: var(--mono); font-size: 9.5px; letter-spacing: .04em;
          color: var(--scan); border: 1px solid currentColor; border-radius: 4px; padding: 0 4px; }
.pr-meta { font-size: 11px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-act { background: none; border: 0; cursor: pointer; color: var(--faint); font-size: 11.5px; padding: 2px 4px; }
.pr-act:hover { color: var(--fg); }
.pr-act.del:hover { color: var(--bad); }
.pr-add { display: flex; flex-direction: column; gap: 6px; padding: 10px; }
.cp-prof { display: flex; align-items: center; gap: 8px; padding: 8px 12px 0; font-size: 11.5px; color: var(--muted); }
.cp-profsel {
  flex: 1; background: var(--card); color: var(--fg); border: 1px solid var(--border);
  border-radius: 6px; font-family: var(--sans); font-size: 11.5px; padding: 3px 5px; cursor: pointer;
}
.cp-profsel:hover { border-color: var(--scan); }
.kc-prof { font-size: 10.5px; color: var(--info); margin-top: 2px; }
.profpick { display: flex; flex-direction: column; gap: 7px; }
.profpick select {
  width: 100%; padding: 8px 10px; border-radius: var(--r-md);
  background: var(--card); color: var(--fg); border: 1px solid var(--border);
  font-family: var(--sans); font-size: 13px; cursor: pointer;
}
.profpick select:hover { border-color: var(--scan); }
.profpick-note { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.pr-act.use { color: var(--scan); border: 1px solid transparent; border-radius: 5px; }
.pr-act.use:hover { border-color: currentColor; }

/* The posting, in the drawer. Collapsed by default: it is reference material,
   not the thing the owner opened the drawer to see. */
.jd-block > summary { cursor: pointer; list-style: none; }
.jd-block > summary::-webkit-details-marker { display: none; }
.jd-block > summary::before { content: "▸ "; color: var(--faint); }
.jd-block[open] > summary::before { content: "▾ "; }
.jd-text {
  margin-top: 8px; max-height: 340px; overflow-y: auto;
  white-space: pre-wrap; font-size: 13px; line-height: 1.55;
  color: var(--ink-2, var(--ink)); padding-right: 6px;
}

/* Why a run failed, in the drawer. The owner can usually fix these (Chrome
   closed, a portal cap, a slow form) so the reason belongs in front of them. */
.drawer-fail .fail-text {
  font-size: 13px; line-height: 1.55; white-space: pre-wrap;
  color: var(--bad, #b3261e);
}
