/* ===========================================================================
   Applicant Tracker — KLN internal tool
   Grey is the workhorse (text, structure, borders); orange is the accent only.
   No external fonts, no external images, no network requests of any kind.
   =========================================================================== */

/* ── tokens ─────────────────────────────────────────────────────────────── */
:root {
  /* brand */
  --orange: #ED6D00;
  --orange-light: #FCBE85;
  --grey-dark: #54565B;
  --grey-mid: #76777B;

  /* derived accent (light) */
  --accent: #ED6D00;
  --accent-hover: #d36100;
  --accent-ink: #ffffff;
  --accent-soft: rgba(237, 109, 0, 0.10);
  --accent-soft-2: rgba(237, 109, 0, 0.18);
  --accent-border: rgba(237, 109, 0, 0.42);

  /* surfaces */
  --bg: #f1f1f3;
  --surface: #ffffff;
  --surface-2: #f8f8f9;
  --surface-3: #ecedef;
  --border: #dedee2;
  --border-strong: #c6c7cc;

  /* text */
  --text: #25262a;
  --text-2: #54565B;
  --text-3: #76777B;

  /* status */
  --ok: #1b7a49;
  --warn: #9a5c08;
  --danger: #b0261e;
  --danger-soft: rgba(176, 38, 30, 0.09);

  --tone: var(--grey-mid);

  --shadow-1: 0 1px 2px rgba(20, 20, 26, .07);
  --shadow-2: 0 1px 3px rgba(20, 20, 26, .08), 0 8px 24px rgba(20, 20, 26, .09);
  --shadow-3: 0 2px 6px rgba(20, 20, 26, .12), 0 18px 48px rgba(20, 20, 26, .18);

  --r: 8px;
  --r-sm: 6px;
  --r-lg: 12px;

  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --font: system-ui, -apple-system, 'Segoe UI', Calibri, sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --accent: #F5822B;
    --accent-hover: #ff9542;
    --accent-ink: #1c1204;
    --accent-soft: rgba(245, 130, 43, 0.13);
    --accent-soft-2: rgba(245, 130, 43, 0.22);
    --accent-border: rgba(245, 130, 43, 0.45);

    --bg: #141517;
    --surface: #1d1f22;
    --surface-2: #232528;
    --surface-3: #2b2e32;
    --border: #32353a;
    --border-strong: #464a51;

    --text: #e9eaec;
    --text-2: #babcc0;
    --text-3: #8e9197;

    --ok: #4fbe83;
    --warn: #dfa54e;
    --danger: #f0817a;
    --danger-soft: rgba(240, 129, 122, 0.12);

    --shadow-1: 0 1px 2px rgba(0, 0, 0, .45);
    --shadow-2: 0 1px 3px rgba(0, 0, 0, .5), 0 8px 24px rgba(0, 0, 0, .4);
    --shadow-3: 0 2px 8px rgba(0, 0, 0, .55), 0 20px 52px rgba(0, 0, 0, .5);
  }
}

/* ── reset ──────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-text-size-adjust: 100%;
  overflow-x: hidden;
}
h1, h2, h3, h4, p, figure { margin: 0; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}
.hidden { display: none !important; }
.muted { color: var(--text-3); }
.spacer { flex: 1 1 auto; }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ── icons ──────────────────────────────────────────────────────────────── */
.icon {
  width: 1em; height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: -0.14em;
}
.icon-fill { fill: currentColor; stroke: currentColor; stroke-width: 1; }

/* ── buttons ────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 6px 11px;
  min-height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  transition: background-color .1s, border-color .1s, color .1s;
}
.btn:hover { background: var(--surface-3); color: var(--text); }
.btn:active { transform: translateY(0.5px); }
.btn[disabled] { opacity: .55; cursor: default; pointer-events: none; }
.btn .btn-ico { display: inline-flex; font-size: 15px; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-ink); }

.btn-ghost { background: transparent; border-color: transparent; color: var(--text-3); }
.btn-ghost:hover { background: var(--surface-3); color: var(--text); }

.btn-icon { padding: 6px; width: 32px; }
.btn-icon .btn-ico { font-size: 16px; }

.btn-sm { min-height: 28px; padding: 3px 8px; font-size: 12.5px; }
.btn-block { width: 100%; }

.btn-danger { color: var(--danger); border-color: var(--border-strong); }
.btn-danger:hover { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }

.btn-toggle[aria-pressed="true"] {
  background: var(--accent-soft);
  border-color: var(--accent-border);
  color: var(--accent);
}

.segmented { display: inline-flex; border: 1px solid var(--border-strong); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.seg {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 11px; min-height: 32px;
  border: 0; background: transparent; color: var(--text-3);
  font-size: 13px; font-weight: 500;
}
.seg + .seg { border-left: 1px solid var(--border); }
.seg:hover { background: var(--surface-3); color: var(--text); }
.seg[aria-pressed="true"] { background: var(--accent-soft); color: var(--accent); font-weight: 600; }

/* ── form controls ──────────────────────────────────────────────────────── */
.inp, .sel, textarea.inp {
  width: 100%;
  padding: 6px 9px;
  min-height: 32px;
  border: 1px solid var(--border-strong);
  border-radius: var(--r-sm);
  background: var(--surface);
  color: var(--text);
  font-size: 13.5px;
}
.inp::placeholder { color: var(--text-3); }
.inp:hover, .sel:hover { border-color: var(--grey-mid); }
.inp:focus, .sel:focus, textarea.inp:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea.inp { min-height: 64px; resize: vertical; line-height: 1.5; }
.sel { appearance: none; -webkit-appearance: none; padding-right: 26px;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 14px) 51%, calc(100% - 9px) 51%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}
.field { display: flex; flex-direction: column; gap: 4px; }
.lbl { font-size: 11.5px; font-weight: 600; letter-spacing: .03em; text-transform: uppercase; color: var(--text-3); }

/* ── cards / alerts ─────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  box-shadow: var(--shadow-1);
}
.alert {
  padding: 8px 11px;
  border-radius: var(--r-sm);
  font-size: 13px;
  border: 1px solid transparent;
  line-height: 1.4;
}
.alert-error { background: var(--danger-soft); border-color: var(--danger); color: var(--danger); }
.alert-warn { background: var(--accent-soft); border-color: var(--accent-border); color: var(--warn); }
.alert-info { background: var(--surface-2); border-color: var(--border); color: var(--text-2); }

/* ── centered screens ───────────────────────────────────────────────────── */
.screen-center {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px;
}
.boot-card { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.boot-text { color: var(--text-3); font-size: 13.5px; }
.boot-dot {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2.5px solid var(--border-strong);
  border-top-color: var(--accent);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .boot-dot { animation-duration: 2s; } }

.fatal-card { max-width: 420px; padding: 22px; text-align: center; display: grid; gap: 12px; justify-items: center; }
.fatal-title { font-size: 17px; font-weight: 650; }
.fatal-msg { font-size: 13.5px; }

/* ── login ──────────────────────────────────────────────────────────────── */
.login-card {
  width: 100%; max-width: 360px;
  padding: 26px 24px 22px;
  display: grid; gap: 14px;
  box-shadow: var(--shadow-2);
  position: relative; overflow: hidden;
}
.login-rule { position: absolute; inset: 0 0 auto 0; height: 3px; background: var(--accent); }
.login-title { font-size: 19px; font-weight: 650; letter-spacing: -.01em; }
.login-sub { font-size: 13px; margin-top: -8px; }
.login-card .btn-primary { min-height: 40px; }

/* ── app shell ──────────────────────────────────────────────────────────── */
/* Two layout modes. Wide screens get a fixed app shell whose board/table
   scrolls internally; narrow screens let the whole page scroll, which is what
   a thumb expects and keeps the small viewport free of stacked sticky bars. */
.app { display: flex; flex-direction: column; min-height: 100dvh; }

@media (min-width: 901px) {
  .app { height: 100dvh; min-height: 0; overflow: hidden; }
}

.topbar {
  background: var(--surface);
  border-top: 2px solid var(--accent);
  border-bottom: 1px solid var(--border);
  padding: 10px 14px 0;
  display: grid; gap: 8px;
  flex: 0 0 auto;
}
.topbar-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

.position {
  display: flex; flex-direction: column; align-items: flex-start; gap: 1px;
  border: 1px solid transparent; border-radius: var(--r-sm);
  background: transparent; padding: 3px 7px; margin-left: -7px;
  text-align: left; min-width: 0; flex: 1 1 auto;
}
.position:hover { background: var(--surface-3); border-color: var(--border); }
.position-title {
  font-size: 17px; font-weight: 650; letter-spacing: -.015em; color: var(--text);
  max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.position-meta { font-size: 12px; color: var(--text-3); max-width: 46vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.topbar-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

.stats-row { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12px; color: var(--text-3); }
.stat { display: inline-flex; align-items: baseline; gap: 4px; }
.stat b { color: var(--text-2); font-weight: 650; font-variant-numeric: tabular-nums; }

.chips {
  display: flex; gap: 6px; overflow-x: auto; padding-bottom: 9px;
  scrollbar-width: thin; -webkit-overflow-scrolling: touch;
}
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; min-height: 28px;
  border: 1px solid var(--border); border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
  font-size: 12.5px; white-space: nowrap;
}
.chip:hover { border-color: var(--border-strong); background: var(--surface-3); }
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); flex: 0 0 auto; }
.chip .n { font-variant-numeric: tabular-nums; font-weight: 650; color: var(--text-3); }
.chip[aria-pressed="true"] {
  background: var(--accent-soft); border-color: var(--accent-border); color: var(--accent); font-weight: 600;
}
.chip[aria-pressed="true"] .n { color: var(--accent); }
.chip.is-empty { opacity: .5; }

/* ── upcoming strip ─────────────────────────────────────────────────────── */
.upcoming {
  display: flex; gap: 8px; align-items: stretch;
  padding: 9px 14px; overflow-x: auto;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  scrollbar-width: thin;
  flex: 0 0 auto;
}
.up-label {
  display: flex; align-items: center; gap: 6px;
  font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase;
  color: var(--text-3); padding-right: 4px; white-space: nowrap; flex: 0 0 auto;
}
.up-card {
  flex: 0 0 auto; min-width: 172px; max-width: 250px;
  display: grid; gap: 1px; text-align: left;
  padding: 6px 10px;
  border: 1px solid var(--border); border-left: 3px solid var(--tone);
  border-radius: var(--r-sm); background: var(--surface);
}
.up-card:hover { border-color: var(--border-strong); border-left-color: var(--tone); background: var(--surface-3); }
.up-when { font-size: 12.5px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.up-who { font-size: 12.5px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.up-rel { font-size: 11.5px; color: var(--text-3); }
.up-empty { font-size: 12.5px; color: var(--text-3); align-self: center; }

/* ── toolbar ────────────────────────────────────────────────────────────── */
.toolbar {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  padding: 9px 14px;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  flex: 0 0 auto;
}
.search-wrap { position: relative; flex: 1 1 220px; min-width: 170px; max-width: 380px; display: flex; align-items: center; }
.search-ico { position: absolute; left: 9px; color: var(--text-3); font-size: 15px; display: inline-flex; pointer-events: none; }
.search-inp { padding-left: 30px; padding-right: 28px; }
.search-inp::-webkit-search-cancel-button { display: none; }
.search-clear {
  position: absolute; right: 4px; display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border: 0; border-radius: var(--r-sm); background: transparent; color: var(--text-3); font-size: 14px;
}
.search-clear:hover { background: var(--surface-3); color: var(--text); }
.toolbar .sel { width: auto; min-width: 132px; flex: 0 0 auto; }

.filter-note {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 7px 14px; font-size: 12.5px; color: var(--text-2);
  background: var(--accent-soft); border-bottom: 1px solid var(--accent-border);
  flex: 0 0 auto;
}

.viewroot { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
@media (max-width: 900px) { .viewroot { display: block; } }

/* ── stage tones ────────────────────────────────────────────────────────── */
.st-new { --tone: #7c8794; }
.st-screening { --tone: #6b8299; }
.st-phone_screen { --tone: #5686a6; }
.st-interview_scheduled { --tone: #ED6D00; }
.st-interviewed { --tone: #c07520; }
.st-reference_check { --tone: #8479ad; }
.st-offer { --tone: #ED6D00; }
.st-hired { --tone: #2f9e63; }
.st-rejected { --tone: #b3564e; }
.st-withdrawn { --tone: #8b8d92; }

.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 1px 8px 1px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11.5px; font-weight: 550; white-space: nowrap;
}
.badge::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: var(--tone); flex: 0 0 auto; }
.badge-plain::before { display: none; }
.badge-plain { padding: 1px 7px; }

/* ── stars ──────────────────────────────────────────────────────────────── */
.stars { display: inline-flex; align-items: center; gap: 1px; color: var(--text-3); }
.stars .on { color: var(--accent); }
.stars-static { font-size: 12px; }
.star-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; padding: 0;
  border: 0; background: transparent; color: var(--text-3); font-size: 16px; border-radius: var(--r-sm);
}
.star-btn.on { color: var(--accent); }
.star-btn:hover { background: var(--surface-3); }
.star-clear { font-size: 11.5px; color: var(--text-3); border: 0; background: transparent; padding: 2px 6px; border-radius: var(--r-sm); }
.star-clear:hover { background: var(--surface-3); color: var(--text-2); }

/* ── board ──────────────────────────────────────────────────────────────── */
.board {
  flex: 1 1 auto; min-height: 0;
  display: flex; gap: 10px; align-items: flex-start;
  padding: 12px 14px 24px;
  overflow-x: auto; overflow-y: auto;
  scroll-snap-type: x proximity;
  scrollbar-width: thin;
}
.col {
  flex: 0 0 268px; width: 268px;
  display: flex; flex-direction: column;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-top: 2px solid var(--tone);
  border-radius: var(--r);
  scroll-snap-align: start;
  max-height: 100%;
}
.col.drop-target { border-color: var(--accent); background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-border); }
.col-head .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--tone); flex: 0 0 auto; }
.col-head {
  display: flex; align-items: center; gap: 7px;
  padding: 8px 10px 7px;
  border-bottom: 1px solid var(--border);
  position: sticky; top: 0; background: var(--surface-2); z-index: 1;
  border-radius: var(--r) var(--r) 0 0;
}
.col-name { font-size: 12.5px; font-weight: 650; color: var(--text-2); letter-spacing: .01em; }
.col-count { margin-left: auto; font-size: 11.5px; font-weight: 650; color: var(--text-3); font-variant-numeric: tabular-nums;
  background: var(--surface-3); border-radius: 999px; padding: 1px 7px; }
.col-body { display: flex; flex-direction: column; gap: 7px; padding: 8px; overflow-y: auto; overflow-x: hidden; min-height: 56px; }
.col-empty { font-size: 12px; color: var(--text-3); text-align: center; padding: 10px 4px; border: 1px dashed var(--border); border-radius: var(--r-sm); }

.acard {
  display: grid; gap: 5px;
  /* minmax(0,1fr) + min-width:0 on the rows: without both, a long unbroken
     candidate name sizes the grid to max-content and blows out the column. */
  grid-template-columns: minmax(0, 1fr);
  padding: 8px 9px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-sm);
  box-shadow: var(--shadow-1);
  text-align: left;
  cursor: pointer;
}
.acard > * { min-width: 0; }
.acard:hover { border-color: var(--border-strong); box-shadow: var(--shadow-2); }
.acard.dragging { opacity: .4; }
.acard-top { display: flex; align-items: flex-start; gap: 6px; min-width: 0; }
.acard-name { font-size: 13.5px; font-weight: 650; color: var(--text); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1 1 auto; min-width: 0; }
.acard-star { color: var(--accent); font-size: 13px; display: inline-flex; flex: 0 0 auto; margin-top: 1px; }
.acard-sub { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acard-meta { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 11.5px; color: var(--text-3); }
.acard-meta .clip { display: inline-flex; align-items: center; gap: 3px; color: var(--text-2); }
.acard-meta .next { display: inline-flex; align-items: center; gap: 4px; color: var(--accent); font-weight: 600; }
.acard-move { display: flex; align-items: center; gap: 5px; }
.acard-move .sel { font-size: 11.5px; min-height: 28px; padding: 2px 24px 2px 7px; background-color: var(--surface-2); }
.acard-move .mv-lbl { font-size: 11px; color: var(--text-3); flex: 0 0 auto; }

mark { background: var(--accent-soft-2); color: inherit; border-radius: 2px; padding: 0 1px; }

/* ── list ───────────────────────────────────────────────────────────────── */
.list-wrap {
  flex: 1 1 auto; min-height: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
  padding: 12px 14px;
}
.tbl-scroll {
  flex: 1 1 auto; min-height: 0;
  overflow: auto;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface);
}
table.tbl { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 640px; }
.tbl thead th {
  position: sticky; top: 0; z-index: 1;
  background: var(--surface-2);
  border-bottom: 1px solid var(--border);
  text-align: left; font-size: 11.5px; font-weight: 650; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3);
  padding: 0; white-space: nowrap;
}
.th-btn {
  display: flex; align-items: center; gap: 4px; width: 100%;
  padding: 8px 10px; min-height: 34px;
  border: 0; background: transparent; color: inherit; font: inherit;
  letter-spacing: inherit; text-transform: inherit;
}
.th-btn:hover { background: var(--surface-3); color: var(--text-2); }
.th-btn .sort-ico { font-size: 12px; opacity: 0; }
.th-btn[aria-sort]:not([aria-sort="none"]) { color: var(--accent); }
.th-btn[aria-sort]:not([aria-sort="none"]) .sort-ico { opacity: 1; }
.tbl tbody tr { border-bottom: 1px solid var(--border); cursor: pointer; }
.tbl tbody tr:last-child { border-bottom: 0; }
.tbl tbody tr:hover { background: var(--surface-2); }
.tbl td { padding: 7px 10px; vertical-align: middle; }
.tbl td.c-name { font-weight: 600; color: var(--text); }
.name-cell { display: flex; align-items: center; gap: 6px; min-width: 0; }
.name-cell .n { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.name-cell .ico-star { color: var(--accent); font-size: 12px; display: inline-flex; }
.name-cell .ico-clip { color: var(--text-3); font-size: 12px; display: inline-flex; }
.sub-line { font-size: 11.5px; color: var(--text-3); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tnum { font-variant-numeric: tabular-nums; white-space: nowrap; }
.next-soon { color: var(--accent); font-weight: 600; }

.empty-state {
  display: grid; gap: 8px; justify-items: center;
  padding: 46px 20px; text-align: center; color: var(--text-3);
}
.empty-state .es-title { font-size: 14.5px; font-weight: 600; color: var(--text-2); }
.empty-state .es-sub { font-size: 13px; max-width: 380px; }
.empty-state .icon { font-size: 26px; opacity: .55; }

/* ── overlays ───────────────────────────────────────────────────────────── */
.scrim {
  position: fixed; inset: 0; z-index: 40;
  background: rgba(18, 18, 22, .42);
  backdrop-filter: blur(1.5px);
}
@media (prefers-color-scheme: dark) { .scrim { background: rgba(0, 0, 0, .58); } }

.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 50;
  width: min(520px, 100vw);
  background: var(--surface);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow-3);
  display: flex; flex-direction: column;
  overflow: hidden;
}
.dr-head {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 12px 14px 10px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}
.dr-head-main { flex: 1 1 auto; min-width: 0; display: grid; gap: 5px; }
.dr-name {
  font-size: 17px; font-weight: 650; letter-spacing: -.01em;
  border: 1px solid transparent; border-radius: var(--r-sm);
  padding: 2px 6px; margin-left: -6px; background: transparent; width: 100%;
}
.dr-name:hover { border-color: var(--border); background: var(--surface-2); }
.dr-name:focus { background: var(--surface); }
.dr-head-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.dr-body { flex: 1 1 auto; overflow-y: auto; padding: 0 14px 40px; -webkit-overflow-scrolling: touch; }

.sec { border-top: 1px solid var(--border); padding: 13px 0 4px; }
.sec:first-child { border-top: 0; }
.sec-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.sec-title { font-size: 11.5px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--text-3); }
.sec-title .cnt { color: var(--text-3); font-weight: 600; }
.sec-head .btn { margin-left: auto; }

.fgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 10px; }
.fgrid .full { grid-column: 1 / -1; }
.fstat { font-size: 11px; min-height: 13px; }
.fstat.ok { color: var(--ok); }
.fstat.err { color: var(--danger); }

.kv-links { display: flex; flex-wrap: wrap; gap: 6px 12px; font-size: 12.5px; margin-bottom: 10px; }
.kv-links a { display: inline-flex; align-items: center; gap: 4px; }

/* resume */
.dropzone {
  display: grid; gap: 6px; justify-items: center; text-align: center;
  padding: 16px 12px;
  border: 1.5px dashed var(--border-strong); border-radius: var(--r);
  background: var(--surface-2); color: var(--text-3); font-size: 12.5px;
}
.dropzone.over { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.dropzone .dz-title { font-size: 13px; font-weight: 600; color: var(--text-2); }
.dropzone.over .dz-title { color: var(--accent); }
.res-row {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  padding: 9px 11px; border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2);
}
.res-main { flex: 1 1 160px; min-width: 0; display: grid; gap: 1px; }
.res-name { font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.res-meta { font-size: 11.5px; color: var(--text-3); }
.res-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* interviews */
.iv {
  display: grid; gap: 6px;
  padding: 9px 11px; margin-bottom: 8px;
  border: 1px solid var(--border); border-left: 3px solid var(--tone);
  border-radius: var(--r); background: var(--surface-2);
}
.iv.done { --tone: var(--grey-mid); opacity: .92; }
.iv-top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.iv-when { font-size: 13px; font-weight: 650; color: var(--text); font-variant-numeric: tabular-nums; }
.iv-rel { font-size: 11.5px; color: var(--text-3); }
.iv-meta { font-size: 12px; color: var(--text-2); display: flex; gap: 4px 10px; flex-wrap: wrap; }
.iv-meta .k { color: var(--text-3); }
.iv-fb { font-size: 12.5px; color: var(--text-2); background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 6px 8px; white-space: pre-wrap; overflow-wrap: anywhere; }
.iv-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.iv-form { display: grid; gap: 9px; padding: 10px 11px; border: 1px solid var(--accent-border); border-radius: var(--r); background: var(--surface); margin-bottom: 8px; }
.iv-form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 10px; }
.iv-form .full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }

.out-badge { font-size: 11.5px; font-weight: 600; }
.out-strong_yes, .out-yes { color: var(--ok); }
.out-no, .out-strong_no { color: var(--danger); }
.out-pending { color: var(--text-3); }

/* notes */
.note {
  padding: 8px 10px; margin-bottom: 7px;
  border: 1px solid var(--border); border-radius: var(--r); background: var(--surface-2);
}
.note-body { font-size: 13px; color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; }
.note-foot { display: flex; align-items: center; gap: 8px; margin-top: 5px; font-size: 11.5px; color: var(--text-3); }
.note-foot .btn { margin-left: auto; }

/* activity */
.act { display: flex; gap: 9px; padding: 5px 0; font-size: 12.5px; }
.act-ico { color: var(--text-3); font-size: 13px; display: inline-flex; margin-top: 2px; flex: 0 0 auto; }
.act-main { min-width: 0; flex: 1 1 auto; }
.act-kind { font-weight: 600; color: var(--text-2); }
.act-detail { color: var(--text-3); overflow-wrap: anywhere; }
.act-time { font-size: 11.5px; color: var(--text-3); white-space: nowrap; flex: 0 0 auto; }

.danger-zone { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 0 4px; }

/* ── modal ──────────────────────────────────────────────────────────────── */
.modal {
  position: fixed; z-index: 50;
  left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: min(560px, calc(100vw - 24px));
  max-height: min(86dvh, 780px);
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-lg);
  box-shadow: var(--shadow-3);
  overflow: hidden;
}
.mod-head { display: flex; align-items: center; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--border); }
.mod-title { font-size: 15.5px; font-weight: 650; }
.mod-head .btn { margin-left: auto; }
.mod-body { padding: 14px 16px; overflow-y: auto; display: grid; gap: 11px; flex: 1 1 auto; min-height: 0; align-content: start; }
.mod-foot { display: flex; gap: 8px; align-items: center; padding: 12px 16px; border-top: 1px solid var(--border); background: var(--surface-2); }
.mod-foot .spacer { flex: 1 1 auto; }

/* ── toasts ─────────────────────────────────────────────────────────────── */
.toasts {
  position: fixed; z-index: 60;
  right: 14px; bottom: 14px;
  display: flex; flex-direction: column; gap: 7px;
  max-width: min(360px, calc(100vw - 28px));
  pointer-events: none;
}
.toast {
  pointer-events: auto;
  padding: 9px 12px;
  border-radius: var(--r);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-2);
  font-size: 13px; color: var(--text-2);
  border-left: 3px solid var(--grey-mid);
  white-space: pre-wrap; overflow-wrap: anywhere;
}
.toast.t-error { border-left-color: var(--danger); color: var(--danger); }
.toast.t-ok { border-left-color: var(--ok); }
.toast.t-warn { border-left-color: var(--accent); }

/* ── responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 760px) {
  .position-title, .position-meta { max-width: calc(100vw - 190px); }
  .topbar { padding: 9px 11px 0; }
  .toolbar { padding: 8px 11px; }
  .board { padding: 10px 11px 24px; gap: 9px; }
  .list-wrap { padding: 10px 11px 24px; }
  .upcoming { padding: 8px 11px; }
  /* Let the page scroll vertically; the board still scrolls sideways. */
  .board { overflow-y: visible; max-height: none; padding-bottom: 32px; }
  .col { flex: 0 0 min(84vw, 300px); width: min(84vw, 300px); max-height: none; }
  .col-body { overflow-y: visible; }
  .list-wrap { display: block; overflow: visible; padding-bottom: 32px; }
  .tbl-scroll { overflow-x: auto; }
  .tbl thead th { position: static; }
  .btn-lbl { display: none; }
  .seg .btn-lbl { display: none; }
  .btn { padding: 6px 9px; }

  /* The actions wrap to their own row on a phone; give that row to the one
     button that matters instead of leaving a dead gutter beside it. */
  .topbar-actions { margin-left: 0; width: 100%; }
  #addBtn { flex: 1 1 auto; }
  #addBtn .btn-lbl { display: inline; }
  .fgrid { grid-template-columns: 1fr; }
  .iv-form .row { grid-template-columns: 1fr; }
  .drawer { width: 100vw; border-left: 0; }
  .toasts { left: 11px; right: 11px; bottom: 11px; max-width: none; }
  table.tbl { min-width: 0; }
  .tbl .c-source, .tbl .c-applied { display: none; }
}

@media (max-width: 480px) {
  .tbl .c-next { display: none; }
  .stats-row { font-size: 11.5px; gap: 3px 11px; }
}

/* Comfortable hit targets on touch devices. */
@media (pointer: coarse) {
  .btn, .seg, .chip, .sel, .inp, .th-btn { min-height: 44px; }
  .btn-icon { width: 44px; }
  .btn-sm { min-height: 40px; }
  .star-btn { width: 40px; height: 40px; font-size: 19px; }
  .search-clear { width: 34px; height: 34px; }
  .acard { padding: 10px; }
  .acard-move .sel { min-height: 40px; }
  .tbl td { padding: 11px 10px; }
  .note-foot .btn, .iv-actions .btn, .res-actions .btn { min-height: 40px; }
}
