/* Job Pipeline — Q design language: warm paper, navy sidebar, executive restraint.
   Tokens from the Helios-in-Q handoff. No native controls. Light theme by design. */
:root {
  --paper: #FBFAF8;
  --panel: #ffffff;
  --fill: #F2F0EA;
  --fill-2: #f1efe9;
  --fill-3: #f7f5f1;
  --ink: #121923;
  --ink-2: #192432;
  --body: #2a313d;
  --secondary: #41495a;
  --muted: #5b6472;
  --faint: #8a8f97;
  --hair: #e6e2d9;
  --hair-2: #ece8df;
  --accent: #2B5C87;
  --accent-fill: #eef3f8;
  --warn: #B4552D;
  --warn-fill: #F7E4DA;
  --good: #1F7A5C;
  --good-fill: #E2F0E9;
  --bad: #A8352B;
  --bad-fill: #F7E0DD;
  --nav: #192432;
  --nav-deep: #121923;
  --shadow: 0 1px 2px rgba(25,36,50,.04), 0 4px 14px rgba(25,36,50,.05);
  --green: #1F7A5C; --red: #A8352B; /* aliases used by inline styles */
  --font: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-brand: "Space Grotesk", var(--font);
  font-size: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--paper); color: var(--body);
  font-family: var(--font); font-weight: 400;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
::selection { background: #D3E2F0; }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea {
  font: inherit; color: var(--ink-2); background: var(--panel);
  border: 1px solid var(--hair); border-radius: 7px; padding: 7px 10px; outline: none;
  transition: border-color .12s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:hover, textarea:hover { border-color: #d5d0c4; }
input:focus, textarea:focus { border-color: var(--accent); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid #9db9d0; outline-offset: 1px; }

* { scrollbar-width: thin; scrollbar-color: #d5d0c4 transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: #d5d0c4; border-radius: 8px; border: 3px solid var(--paper); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- shell: fixed dark sidebar + flowing content ---------- */
#app { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px; flex: none; position: sticky; top: 0; height: 100vh;
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-deep) 100%);
  color: #E7EAEE; display: flex; flex-direction: column; padding: 18px 14px 16px;
}
.brand-row { display: flex; align-items: center; gap: 10px; padding: 2px 8px 18px; }
.brand-mark {
  font-family: var(--font-brand); font-weight: 500; font-size: 15px; letter-spacing: .02em;
  background: #fff; color: var(--nav-deep); width: 30px; height: 30px; border-radius: 7px;
  display: flex; align-items: center; justify-content: center; flex: none;
}
.brand-text { font-weight: 600; font-size: 13.5px; letter-spacing: .01em; line-height: 1.25; display: flex; flex-direction: column; }
.brand-sub { font-weight: 400; font-size: 11px; color: #97A0AC; }
.nav { flex: 1; display: flex; flex-direction: column; gap: 18px; overflow-y: auto; }
.nav-group { display: flex; flex-direction: column; gap: 1px; }
.nav-label {
  font-size: 10px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
  color: #6f7987; padding: 0 10px 6px;
}
.tab {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  text-align: left; color: #B9C0C9; font-size: 13.5px; font-weight: 500;
  padding: 7px 10px; border-radius: 7px; transition: background .12s ease, color .12s ease;
}
.tab:hover { color: #fff; background: rgba(255,255,255,.06); }
.tab.active { color: #fff; background: rgba(255,255,255,.10); }
.nav-count {
  font-size: 11px; font-weight: 600; color: #97A0AC; background: rgba(255,255,255,.08);
  border-radius: 100px; padding: 1px 8px; font-variant-numeric: tabular-nums;
}
.nav-count.accent { background: #2B5C87; color: #fff; }
.nav-count.warn { background: #B4552D; color: #fff; }
.sidebar-foot { padding-top: 14px; border-top: 1px solid rgba(255,255,255,.08); display: flex; flex-direction: column; gap: 8px; }
.btn-find {
  background: #fff; color: var(--nav-deep); font-weight: 600; font-size: 13px;
  border-radius: 7px; padding: 9px 12px; text-align: center; transition: background .12s ease;
}
.btn-find:hover { background: #e9edf2; }
.btn-find[disabled] { opacity: .6; cursor: default; }
.foot-note { font-size: 11px; color: #6f7987; text-align: center; }

main { flex: 1; min-width: 0; padding: 40px 48px 80px; max-width: 1280px; }

/* ---------- screen headers ---------- */
.eyebrow {
  font-size: 11px; font-weight: 600; letter-spacing: .16em; text-transform: uppercase;
  color: var(--faint); margin: 0 0 10px;
}
.screen-title {
  font-size: 33px; font-weight: 300; letter-spacing: -.025em; color: var(--ink);
  margin: 0 0 10px; line-height: 1.15; text-wrap: balance;
}
.screen-sub { font-size: 14px; color: var(--muted); margin: 0 0 28px; max-width: 620px; line-height: 1.55; }
.screen-sub b, .screen-sub strong { color: var(--ink-2); font-weight: 600; }

/* ---------- buttons ---------- */
.btn {
  font-size: 13px; font-weight: 500; color: var(--body);
  border: 1px solid var(--hair); background: var(--panel); border-radius: 7px;
  padding: 7px 14px; transition: background .12s ease, border-color .12s ease; white-space: nowrap;
}
.btn:hover { background: var(--fill-3); border-color: #d5d0c4; }
.btn-primary { background: var(--nav); border-color: var(--nav); color: #fff; font-weight: 600; }
.btn-primary:hover { background: var(--accent); border-color: var(--accent); }
.btn-accent { background: var(--nav); border-color: var(--nav); color: #fff; font-weight: 600; }
.btn-accent:hover { background: var(--accent); border-color: var(--accent); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { color: var(--ink-2); background: var(--fill); border-color: transparent; }
.btn-danger { color: var(--bad); }
.btn-danger:hover { border-color: #e0b7b2; background: var(--bad-fill); }
.btn-block { width: 100%; }
.btn-sm { padding: 4px 11px; font-size: 12px; border-radius: 6px; }
.btn[disabled] { opacity: .5; cursor: default; }

/* ---------- board ---------- */
.addbar { display: flex; gap: 8px; margin-bottom: 14px; }
.addbar input { flex: 1; }
.board-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.board-toolbar .spacer { flex: 1; }
.board-stats { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.board {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 14px; align-items: flex-start;
}
.board > .col { flex: 1 1 180px; min-width: 180px; }
.board > .col.folded {
  flex: 0 0 40px; min-width: 40px; min-height: 220px;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 12px 0; cursor: pointer; background: var(--fill);
  border: 1px solid var(--hair-2); border-radius: 10px;
  transition: background .12s ease, border-color .12s ease;
}
.board > .col.folded:hover { background: var(--fill-2); border-color: #d5d0c4; }
.fold-label {
  writing-mode: vertical-rl; font-size: 10px; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em; color: var(--muted);
}
.col-head-btn { width: 100%; cursor: pointer; text-align: left; }
.col.folded .col-count { margin-left: 0; }
.btn-delete { background: #fff; border-color: var(--hair); color: var(--nav); font-weight: 600; }
.btn-delete:hover { background: var(--fill-3); border-color: #d5d0c4; }
.col-head-btn:hover { color: var(--ink-2); }
.col {
  background: var(--fill); border: 1px solid var(--hair-2); border-radius: 10px;
  display: flex; flex-direction: column; max-height: calc(100vh - 320px);
  transition: border-color .12s ease, background .12s ease;
}
.col-head {
  display: flex; align-items: center; gap: 7px; padding: 10px 12px;
  font-weight: 600; font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--secondary);
}
.col-head::before {
  content: ""; width: 7px; height: 7px; border-radius: 50%;
  background: var(--stage, var(--faint)); flex: none;
}
/* stage progression: grey → deepening accent blue, green at offer */
.col[data-stage="shortlist"] { --stage: #9aa1ab; }
.col[data-stage="applied"]   { --stage: #7d9cba; }
.col[data-stage="screening"] { --stage: #4f7ca6; }
.col[data-stage="interview"] { --stage: #2B5C87; }
.col[data-stage="final"]     { --stage: #1E466B; }
.col[data-stage="offer"]     { --stage: #1F7A5C; }
.col[data-stage="__closed"]  { --stage: #b3b7bd; }
.col-count {
  margin-left: auto; background: #fff; border: 1px solid var(--hair-2); border-radius: 100px;
  padding: 0 7px; font-size: 10.5px; font-variant-numeric: tabular-nums; color: var(--muted); font-weight: 600;
}
.col-cards { padding: 8px; display: flex; flex-direction: column; gap: 7px; overflow-y: auto; min-height: 56px; flex: 1; }
.col.dragover { border-color: var(--accent); background: var(--accent-fill); }
.col-more { text-align: center; color: var(--faint); font-size: 11.5px; padding: 7px 0 4px; }
.card {
  background: var(--panel); border: 1px solid var(--hair); border-radius: 8px;
  padding: 10px 12px; cursor: grab; position: relative;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.card:hover { border-color: #cfd7de; box-shadow: var(--shadow); }
.card.dragging { opacity: .45; box-shadow: none; }
.card-title { font-weight: 600; font-size: 13px; color: var(--ink); margin-bottom: 1px; padding-right: 30px; line-height: 1.35; overflow-wrap: anywhere; }
.card-co { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.card-meta { display: flex; gap: 5px; margin-top: 8px; flex-wrap: wrap; align-items: center; }
.card-meta:empty { margin-top: 0; }
.card-age {
  position: absolute; top: 10px; right: 11px; font-size: 10.5px;
  color: #b3b7bd; font-variant-numeric: tabular-nums;
}
.chip {
  font-size: 10px; font-weight: 600; letter-spacing: .02em; padding: 2px 8px;
  border-radius: 100px; background: #ebedef; color: var(--muted); white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.chip.due { color: var(--warn); background: var(--warn-fill); }
.chip.overdue { color: #fff; background: var(--warn); }
.chip.won { color: var(--good); background: var(--good-fill); }
.chip.lost { color: var(--secondary); background: #ebedef; }

/* ---------- track tags ---------- */
.ttag {
  font-size: 10px; font-weight: 600; letter-spacing: .02em; padding: 2px 8px; border-radius: 100px;
  color: var(--tc); background: color-mix(in srgb, var(--tc) 10%, #fff); white-space: nowrap;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.ttag-sm { font-size: 9.5px; padding: 1px 7px; }
.track-chips { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; }
.tchip {
  --tc: var(--secondary);
  padding: 4px 12px; border-radius: 100px; border: 1px solid var(--hair);
  color: var(--muted); font-size: 12px; font-weight: 500; background: var(--panel);
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.tchip:hover { color: var(--tc); border-color: color-mix(in srgb, var(--tc) 40%, #fff); }
.tchip.active {
  color: var(--tc); font-weight: 600;
  border-color: color-mix(in srgb, var(--tc) 45%, #fff);
  background: color-mix(in srgb, var(--tc) 8%, #fff);
}
.tchip.active[data-tf=""] { --tc: var(--ink-2); }

/* ---------- network ---------- */
.wdot {
  display: inline-block; width: 7px; height: 7px; border-radius: 50%;
  background: var(--w, var(--faint)); margin-right: 7px; vertical-align: 1px; flex: none;
}
.col[data-status="identify"]        { --stage: #9aa1ab; }
.col[data-status="reach_out"]       { --stage: #7d9cba; }
.col[data-status="in_conversation"] { --stage: #2B5C87; }
.col[data-status="follow_up"]       { --stage: #1E466B; }
.col[data-status="dormant"]         { --stage: #b3b7bd; }
.net-match { cursor: pointer; }
.net-match:hover { border-color: var(--accent); }
.person-row { display: flex; align-items: center; gap: 6px; }
.person-row b { flex: none; }
.person-row .btn-x { margin-left: auto; }
.person-links { display: inline-flex; gap: 6px; margin-left: 4px; }
.person-links a {
  display: inline-flex; align-items: center; justify-content: center;
  width: 18px; height: 18px; border-radius: 5px; font-size: 10px; font-weight: 700;
  background: var(--accent-fill); color: var(--accent); text-decoration: none;
}
.person-links a:hover { background: #D3E2F0; text-decoration: none; }

/* ---------- jobs feed ---------- */
.jobs-head { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; }
.jobs-filters { display: flex; gap: 5px; }
.pill {
  padding: 4px 13px; border-radius: 100px; border: 1px solid var(--hair);
  color: var(--muted); font-size: 12px; font-weight: 500; background: var(--panel);
  transition: border-color .12s ease, color .12s ease, background .12s ease;
}
.pill:hover { color: var(--ink-2); border-color: #d5d0c4; }
.pill.active { background: var(--nav); border-color: var(--nav); color: #fff; font-weight: 600; }
.job-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.job-card {
  background: var(--panel); border: 1px solid var(--hair); border-radius: 10px;
  padding: 14px 16px; display: flex; flex-direction: column; gap: 5px;
  transition: border-color .12s ease, box-shadow .12s ease;
}
.job-card:hover { border-color: #cfd7de; box-shadow: var(--shadow); }
.job-top { display: flex; align-items: flex-start; gap: 8px; }
.job-age { flex: none; font-size: 10.5px; color: #b3b7bd; font-variant-numeric: tabular-nums; margin-top: 2px; }
.btn-x {
  flex: none; width: 20px; height: 20px; border-radius: 5px; color: var(--faint);
  display: inline-flex; align-items: center; justify-content: center; font-size: 12px;
  transition: color .12s ease, background .12s ease; margin: -2px -4px 0 -2px;
}
.btn-x:hover { color: var(--bad); background: var(--bad-fill); }
.job-title { font-weight: 600; font-size: 14px; color: var(--ink); flex: 1; line-height: 1.35; }
.fit {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 100px;
  background: #ebedef; color: var(--muted); font-variant-numeric: tabular-nums;
}
.fit.hi { color: var(--good); background: var(--good-fill); }
.fit.mid { color: var(--warn); background: var(--warn-fill); }
.fit.lo { color: var(--muted); }
.job-co { color: var(--muted); font-size: 12.5px; }
.job-co-name { font-weight: 600; font-size: 13px; color: var(--ink-2); }
.job-snippet { font-size: 12.5px; color: var(--secondary); line-height: 1.55; max-height: 60px; overflow: hidden; }
.job-actions { display: flex; gap: 7px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; align-items: center; }
.sec-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.sec-head .btn { flex: none; margin-top: 18px; }
.job-dq {
  font-size: 12px; color: var(--warn); background: var(--warn-fill);
  border-radius: 7px; padding: 6px 10px; line-height: 1.5;
}
.empty { text-align: center; color: var(--muted); padding: 70px 20px; line-height: 1.7; font-size: 13.5px; }
.empty .big { font-size: 36px; margin-bottom: 12px; filter: grayscale(.2); }
.empty b { color: var(--ink-2); }

/* ---------- documents ---------- */
.docs-head { display: flex; align-items: center; gap: 12px; margin-bottom: 18px; }
.doc-table { width: 100%; border-collapse: separate; border-spacing: 0; background: var(--panel); border: 1px solid var(--hair); border-radius: 10px; }
.doc-table th {
  text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: .07em;
  color: var(--muted); font-weight: 600; padding: 10px 12px; border-bottom: 1px solid var(--hair-2);
  background: var(--fill-3);
}
.doc-table th:first-child { border-top-left-radius: 10px; }
.doc-table th:last-child { border-top-right-radius: 10px; }
.doc-app-cell { min-width: 220px; }
.doc-app .sel-btn { border-color: transparent; background: transparent; padding: 4px 6px; }
.doc-app .sel-btn:hover { border-color: var(--hair); background: var(--panel); }
.doc-table td { padding: 11px 12px; border-bottom: 1px solid var(--hair-2); font-size: 13px; }
.doc-table tbody tr:last-child td { border-bottom: none; }
.doc-table td:nth-child(4), .doc-table td:nth-child(5) { font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }
.doc-table tbody tr:hover td { background: var(--fill-3); }
.doc-name { font-weight: 600; color: var(--ink); }
.kind-tag {
  font-size: 9.5px; padding: 2px 8px; border-radius: 100px; background: #ebedef;
  color: var(--muted); text-transform: uppercase; letter-spacing: .06em; font-weight: 600;
  max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- profile ---------- */
.profile-wrap { display: flex; flex-direction: column; gap: 44px; }
.sec-title {
  font-size: 15px; font-weight: 600; color: var(--ink); margin: 0 0 4px;
  padding-top: 18px; border-top: 1px solid var(--hair);
}
.profile-sec:first-child .sec-title { border-top: none; padding-top: 0; }
.sec-sub { color: var(--muted); font-size: 13px; margin: 0 0 16px; max-width: 620px; }
.profile-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; max-width: 860px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field.full { grid-column: 1 / -1; }
.field label {
  font-size: 10px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--muted); font-weight: 600;
}
.field .hint { font-size: 12px; color: var(--faint); }
.field textarea { min-height: 92px; resize: vertical; line-height: 1.55; }
.field .btn { align-self: flex-start; }
.track-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 12px; }
.track-card {
  background: var(--panel); border: 1px solid var(--hair); border-radius: 10px;
  border-top: 2px solid var(--tc);
  padding: 16px; display: flex; flex-direction: column; gap: 12px;
  transition: opacity .15s ease;
}
.track-card.off { opacity: .55; }
.track-card.off:hover { opacity: .8; }
.track-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.track-name { font-weight: 600; font-size: 14px; color: var(--tc); }
.track-card .btn { align-self: flex-start; }
.switch {
  width: 36px; height: 20px; border-radius: 100px; background: #e3e0d8;
  border: 1px solid var(--hair); position: relative; padding: 0; flex: none;
  transition: background .15s ease, border-color .15s ease;
}
.switch .knob {
  position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(25,36,50,.2);
  transition: transform .15s ease;
}
.switch.on { background: var(--tc, var(--accent)); border-color: var(--tc, var(--accent)); }
.switch.on .knob { transform: translateX(16px); }
.source-list { display: flex; flex-direction: column; max-width: 840px; background: var(--panel); border: 1px solid var(--hair); border-radius: 10px; padding: 4px 16px; }
.source-row {
  display: grid; grid-template-columns: 1fr auto; grid-template-areas: "main del" "notes del";
  gap: 2px 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--hair-2);
}
.source-row:last-child { border-bottom: none; }
.source-main { grid-area: main; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.source-name { font-weight: 600; color: var(--ink); font-size: 13.5px; }
a.source-name { color: var(--ink); } a.source-name:hover { color: var(--accent); }
.source-notes { grid-area: notes; color: var(--muted); font-size: 12.5px; }
.source-del { grid-area: del; opacity: 0; transition: opacity .12s ease; }
.source-row:hover .source-del { opacity: 1; }

/* ---------- drawer ---------- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(18,25,35,.28); z-index: 60; }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(540px, 94vw);
  background: var(--paper); border-left: 1px solid var(--hair); z-index: 61;
  display: flex; flex-direction: column; box-shadow: -8px 0 32px rgba(25,36,50,.10);
  animation: slideIn .18s cubic-bezier(.2, .8, .3, 1);
}
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }
.drawer-head {
  display: flex; align-items: flex-start; gap: 10px; padding: 24px 26px 18px;
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-deep) 100%);
}
.drawer-head h2 { margin: 0; font-size: 21px; font-weight: 300; letter-spacing: -.015em; color: #fff; flex: 1; line-height: 1.3; }
.drawer-sub { color: #97A0AC; font-weight: 300; }
.drawer-head .wdot { vertical-align: 2px; }
.drawer-head .btn-ghost { color: #97A0AC; }
.drawer-head .btn-ghost:hover { color: #fff; background: rgba(255,255,255,.08); }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px 26px 36px; display: flex; flex-direction: column; gap: 24px; }
.drawer-sec h3 {
  margin: 0 0 10px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--faint); font-weight: 700;
}
.kv { display: grid; grid-template-columns: 100px 1fr; gap: 8px 12px; align-items: center; font-size: 13px; }
.kv .k { color: var(--muted); font-size: 12px; }
.note {
  background: var(--panel); border: 1px solid var(--hair); border-radius: 8px;
  padding: 9px 13px; margin-bottom: 7px; font-size: 13px; line-height: 1.55; color: var(--body);
}
.note .when { color: var(--faint); font-size: 11px; margin-top: 4px; font-variant-numeric: tabular-nums; }
.timeline { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 6px; font-variant-numeric: tabular-nums; }
.tl-stage { color: var(--accent); font-weight: 600; }
.note-add { display: flex; gap: 7px; }
.note-add input { flex: 1; }
.drawer-actions { display: flex; gap: 7px; flex-wrap: wrap; align-items: stretch; }
.drawer-actions .btn { display: inline-flex; align-items: center; }

/* ---------- custom select (brand popouts, never native) ---------- */
.sel { position: relative; }
.sel-btn {
  display: flex; align-items: center; gap: 8px; width: 100%; justify-content: space-between;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 7px;
  padding: 7px 10px; font-size: 13px; color: var(--ink-2);
  transition: border-color .12s ease;
}
.sel-btn:hover { border-color: var(--accent); }
.sel-btn > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.sel-btn .arrow { color: var(--faint); display: inline-flex; align-items: center; }
.sel-btn.placeholder > span:first-child { color: var(--faint); }

/* ---------- custom calendar (never native) ---------- */
.cal {
  position: absolute; top: calc(100% + 4px); left: 0; z-index: 80;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 10px;
  padding: 12px; width: 252px; box-shadow: 0 6px 24px rgba(25,36,50,.12);
  animation: menuIn .1s ease;
}
.cal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; padding: 0 2px; }
.cal-title { font-size: 13px; font-weight: 600; color: var(--ink); }
.cal-nav { display: flex; gap: 4px; }
.cal-btn {
  width: 24px; height: 24px; border: 1px solid var(--hair); background: var(--panel);
  border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
  color: var(--muted); transition: border-color .12s ease, color .12s ease;
}
.cal-btn:hover { border-color: var(--accent); color: var(--accent); }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; }
.cal-dow { font-size: 9px; font-weight: 700; letter-spacing: .08em; color: var(--faint); text-align: center; padding: 4px 0 6px; }
.cal-day {
  height: 30px; border-radius: 6px; font-size: 12px; color: var(--body);
  font-variant-numeric: tabular-nums; transition: background .1s ease;
}
.cal-day:hover { background: var(--accent-fill); }
.cal-day.out { color: #c6c3ba; }
.cal-day.today { box-shadow: inset 0 0 0 1px var(--hair); font-weight: 600; }
.cal-day.sel { background: var(--nav); color: #fff; font-weight: 600; }
.cal-day.sel:hover { background: var(--accent); }
.cal-foot { display: flex; justify-content: space-between; margin-top: 8px; padding: 8px 2px 0; border-top: 1px solid var(--hair-2); }
.cal-link { font-size: 12px; font-weight: 500; color: var(--accent); padding: 2px 4px; border-radius: 5px; }
.cal-link:hover { background: var(--accent-fill); }

.kv-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 12px; font-size: 13px; }
.sel-menu {
  position: absolute; top: calc(100% + 4px); left: 0; min-width: 100%;
  background: var(--panel); border: 1px solid var(--hair); border-radius: 9px;
  padding: 4px; z-index: 80; box-shadow: 0 6px 24px rgba(25,36,50,.12); max-height: 260px; overflow-y: auto;
  animation: menuIn .1s ease;
}
@keyframes menuIn { from { transform: translateY(-3px); opacity: 0; } }
.sel-opt { display: block; width: 100%; text-align: left; padding: 6px 11px; border-radius: 6px; font-size: 13px; white-space: nowrap; color: var(--body); }
.sel-opt:hover { background: var(--accent-fill); }
.sel-opt.on { color: var(--accent); font-weight: 600; }
.sel-opt:disabled { opacity: .45; cursor: default; }
.sel-opt:disabled:hover { background: none; }
.find-menu { z-index: 90; }
.find-menu-foot {
  font-size: 11px; color: var(--muted); padding: 8px 11px 5px; margin-top: 4px;
  border-top: 1px solid var(--hair-2); font-variant-numeric: tabular-nums;
}

/* ---------- source suggestions ---------- */
.sug-head {
  margin: 0 0 4px; font-size: 10px; text-transform: uppercase;
  letter-spacing: .12em; color: var(--faint); font-weight: 700;
}
.sug-sub { margin: 0 0 12px; font-size: 13px; color: var(--secondary); }
.suggestion-row { background: var(--fill-3); }

/* ---------- login gate ---------- */
.gate {
  position: fixed; inset: 0; z-index: 100; display: flex; align-items: center;
  justify-content: center; padding: 24px;
  background: linear-gradient(180deg, var(--nav) 0%, var(--nav-deep) 100%);
}
.gate-card {
  background: var(--panel); border: 1px solid var(--hair); border-radius: 12px;
  padding: 36px 34px 30px; width: min(380px, 100%); display: flex;
  flex-direction: column; gap: 12px; text-align: center;
  box-shadow: 0 8px 40px rgba(0,0,0,.25);
}
.gate-card .brand-mark { margin: 0 auto 2px; }
.gate-card h1 { margin: 0; font-size: 27px; font-weight: 300; letter-spacing: -.02em; color: var(--ink); }
.gate-card p { margin: 0 0 10px; font-size: 13.5px; color: var(--secondary); }
.gate-card input { text-align: left; }
.gate-card .btn-primary { margin-top: 4px; padding: 10px; }
.gate-err { min-height: 18px; font-size: 12.5px; color: var(--warn); }

/* ---------- modal / toast ---------- */
.modal-scrim {
  position: fixed; inset: 0; background: rgba(18,25,35,.32);
  z-index: 90; display: flex; align-items: center; justify-content: center;
}
.modal {
  width: min(430px, 92vw); background: var(--paper); border: 1px solid var(--hair);
  border-radius: 12px; padding: 24px; box-shadow: 0 12px 44px rgba(25,36,50,.16);
  animation: modalIn .15s cubic-bezier(.2, .8, .3, 1);
}
@keyframes modalIn { from { transform: translateY(8px) scale(.99); opacity: 0; } }
.modal h3 { margin: 0 0 8px; font-size: 19px; font-weight: 300; letter-spacing: -.015em; color: var(--ink); }
.modal p { color: var(--muted); margin: 0 0 18px; font-size: 13.5px; line-height: 1.55; }
.modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
.toast-host {
  position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%);
  z-index: 100; display: flex; flex-direction: column; gap: 8px; align-items: center;
}
.toast {
  background: var(--nav); color: #fff; border-radius: 8px;
  padding: 10px 18px; font-size: 13px; box-shadow: 0 6px 24px rgba(25,36,50,.25);
  animation: toastIn .18s cubic-bezier(.2, .8, .3, 1);
}
.toast.ok { background: var(--good); }
.toast.err { background: var(--bad); }
@keyframes toastIn { from { transform: translateY(10px); opacity: 0; } }

.spin {
  display: inline-block; width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff;
  border-radius: 50%; animation: rot .7s linear infinite; vertical-align: -2px;
}
.btn:not(.btn-primary):not(.btn-accent) .spin { border-color: rgba(25,36,50,.2); border-top-color: var(--ink-2); }
@keyframes rot { to { transform: rotate(360deg); } }

.lbl-s { display: none; }

/* ---------- mobile ---------- */
@media (max-width: 860px) {
  body { overflow-x: clip; }
  #app { flex-direction: column; }
  /* iOS Safari auto-zooms (and stays zoomed) on focusing inputs under 16px */
  input, textarea { font-size: 16px; }
  /* touch targets ≥ 40px (DESIGN.md "Interaction") */
  .sel-btn { padding: 12px; }
  .sel-opt { padding: 12px; }
  .cal { width: min(320px, calc(100vw - 36px)); left: auto; right: 0; }
  .cal-day { min-height: 40px; }

  /* sidebar → slim top header; nav → fixed bottom tab bar */
  .sidebar {
    width: 100%; height: auto; position: sticky; top: 0; z-index: 50;
    flex-direction: row; align-items: center; justify-content: space-between;
    padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top));
  }
  .brand-row { padding: 0; }
  .brand-sub { display: none; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 55;
    flex-direction: row; gap: 0; overflow: visible;
    background: var(--nav-deep); border-top: 1px solid rgba(255,255,255,.09);
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
  }
  .nav-group { display: contents; }
  .nav-label { display: none; }
  .lbl-l { display: none; }
  .lbl-s { display: inline; }
  .tab {
    flex: 1 1 0; min-width: 0; flex-direction: column; gap: 2px;
    justify-content: center; align-items: center; text-align: center;
    font-size: 11px; font-weight: 500; padding: 7px 2px; border-radius: 8px;
    position: relative;
  }
  .tab > span:first-child { overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
  .nav-count {
    position: absolute; top: 0; right: 4px;
    font-size: 9px; padding: 0 5px; line-height: 14px;
  }
  .sidebar-foot { padding: 0; border: none; flex-direction: row; align-items: center; }
  .btn-find { padding: 7px 12px; font-size: 12.5px; }
  .foot-note { display: none; }

  main {
    padding: 22px 16px calc(84px + env(safe-area-inset-bottom));
    max-width: 100%;
  }
  .screen-title { font-size: 26px; }
  .screen-sub { font-size: 13px; margin-bottom: 20px; }

  /* board: swipeable near-full-width columns, inner scroll only */
  .board {
    scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch;
    margin: 0 -16px; padding: 0 16px 12px; gap: 10px;
  }
  .board > .col { flex: 0 0 min(82vw, 340px); min-width: 0; }
  .board > .col.folded { flex: 0 0 44px; min-width: 44px; }
  .col { scroll-snap-align: start; max-height: calc(100dvh - 300px); min-height: 180px; }
  .addbar { flex-wrap: wrap; }
  .addbar input { flex: 1 1 100%; }
  .addbar .sel { flex: 1 1 auto; }
  .board-toolbar { gap: 8px; }
  .board-stats { flex-basis: 100%; order: 9; }

  /* jobs feed: single column */
  .job-list { grid-template-columns: 1fr; }
  .jobs-head input, #netSearch { width: 100% !important; flex: 1 1 100%; }

  /* documents table scrolls inside itself */
  .doc-table { display: block; overflow-x: auto; white-space: nowrap; }

  /* profile */
  .profile-grid { grid-template-columns: 1fr; }
  .track-cards { grid-template-columns: 1fr; }
  .source-row { grid-template-columns: 1fr auto; }
  .source-del { opacity: 1; }

  /* drawer: full screen sheet */
  .drawer { width: 100vw; border-left: none; }
  .drawer-head { padding: 18px 18px 12px; padding-top: calc(18px + env(safe-area-inset-top)); }
  .drawer-body { padding: 16px 18px calc(30px + env(safe-area-inset-bottom)); }
  .kv { grid-template-columns: 86px 1fr; }
  .modal { padding: 20px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
