:root {
  --app-bg:#f7f9fb; --canvas-bg:#fbfcfe; --rail-bg:#fbfcfd;
  --surface:#fff; --surface-subtle:#f3f6f7; --surface-elevated:#fff;
  --text-primary:#15212b; --text-secondary:#667085; --text-tertiary:#98a2b3;
  --border:#e5eaec; --border-strong:#d5dde0;
  --teal-700:#08645d; --teal-600:#0e746c; --teal-500:#12847a; --teal-soft:#e9f5f3;
  --agent-indigo:#665cf3; --agent-indigo-strong:#554ae3; --agent-indigo-soft:#f0efff;
  --accent:var(--teal-600); --accent-hover:var(--teal-700); --accent-soft:var(--teal-soft);
  --success:#157a55; --success-soft:#eaf7f1; --warning:#a96200; --warning-soft:#fff3df;
  --danger:#b42318; --danger-soft:#fef0ee; --radius-sm:10px; --radius-md:14px; --radius-lg:18px;
  --radius-control:10px; --radius-card:14px; --radius-panel:18px; --radius-composer:18px;
  --shadow-xs:0 1px 2px rgba(24,39,52,.04); --shadow-sm:0 8px 24px rgba(24,39,52,.07); --shadow-md:0 18px 48px rgba(24,39,52,.10);
  --shadow-panel:var(--shadow-md);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",Arial,sans-serif;
  color:var(--text-primary); background:var(--app-bg);
}
* { box-sizing:border-box; }
[hidden] { display:none !important; }
body { min-width:0; margin:0; background:var(--app-bg); }
button,input,textarea,select { font:inherit; }
button { min-height:44px; padding:10px 16px; border:1px solid var(--accent); border-radius:var(--radius-sm); color:#fff; background:var(--accent); font-weight:650; cursor:pointer; }
button:hover { border-color:var(--accent-hover); background:var(--accent-hover); }
button.secondary,.quiet-button { border-color:var(--border); color:var(--text-primary); background:var(--surface); font-weight:550; }
button.secondary:hover { border-color:var(--accent); color:var(--accent); background:var(--accent-soft); }
button.quiet-button { width:100%; border:0; background:transparent; color:var(--text-secondary); text-align:left; }
button.quiet-button:hover { color:var(--text-primary); background:var(--surface-subtle); }
button.danger { border-color:var(--danger); color:var(--danger); background:var(--surface); }
button.danger:hover { color:#fff; background:var(--danger); }
button:disabled { cursor:not-allowed; opacity:.58; }
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible { outline:3px solid #7fc9c1; outline-offset:2px; }
input,textarea,select { width:100%; min-height:44px; padding:10px 12px; border:1px solid var(--border); border-radius:var(--radius-sm); color:var(--text-primary); background:#fff; }
textarea { resize:vertical; }
label { display:block; margin:14px 0 6px; font-weight:650; }
h1,h2,h3,h4,p { margin-top:0; }
h1 { font-size:30px; line-height:1.25; } h2 { font-size:20px; } h3 { font-size:16px; }
.eyebrow { margin-bottom:8px; color:var(--accent); font-size:12px; font-weight:750; letter-spacing:.05em; }
.muted { color:var(--text-secondary); } .error { min-height:1.5em; color:var(--danger); } .status { min-height:1.5em; color:var(--text-secondary); }

/* Authentication remains a compact, product-consistent entry surface. */
body:has(#authPanel:not([hidden])) { min-height:100dvh; display:grid; grid-template-rows:minmax(0,1fr) auto; }
.auth-shell { position:relative; isolation:isolate; display:grid; width:min(1180px,calc(100% - 64px)); min-height:620px; margin:auto; grid-template-columns:minmax(0,1.05fr) minmax(400px,.75fr); align-items:center; gap:clamp(56px,8vw,112px); padding:64px 0; }
.auth-shell::before { position:absolute; z-index:-1; inset:6% 42% 8% -18%; border-radius:50%; background:radial-gradient(circle,rgba(102,92,243,.12),rgba(14,116,108,.06) 44%,transparent 72%); content:""; }
.auth-brand { max-width:620px; padding:20px; }
.auth-brand-mark { display:grid; width:48px; height:48px; margin-bottom:28px; place-items:center; border-radius:15px; color:#fff; background:linear-gradient(135deg,var(--agent-indigo),var(--teal-600)); font-weight:800; box-shadow:var(--shadow-sm); }
.auth-brand h1 { max-width:580px; margin-bottom:18px; font-size:clamp(40px,4.2vw,60px); line-height:1.08; letter-spacing:-.045em; }
.auth-brand-copy { max-width:520px; color:var(--text-secondary); font-size:17px; line-height:1.75; }
.auth-benefits { display:grid; gap:12px; margin-top:34px; }
.auth-benefit { display:grid; grid-template-columns:148px 1fr; gap:18px; margin:0; padding:13px 0; border-top:1px solid rgba(213,221,224,.8); }
.auth-benefit strong { font-size:14px; }.auth-benefit span { color:var(--text-secondary); font-size:13px; line-height:1.55; }
.auth-card { width:100%; max-width:460px; justify-self:end; padding:38px; border:1px solid rgba(213,221,224,.9); border-radius:22px; background:rgba(255,255,255,.94); box-shadow:var(--shadow-panel); backdrop-filter:blur(12px); }
.auth-card form > button { width:100%; margin-top:20px; }
@media (max-width:900px) {
  .auth-shell { width:min(460px,calc(100% - 40px)); min-height:auto; grid-template-columns:1fr; padding:40px 0; }
  .auth-brand { padding:0 8px; }.auth-brand h1 { font-size:34px; }.auth-benefits { display:none; }
  .auth-card { justify-self:stretch; }
}
.notice { display:flex; align-items:center; gap:8px; } .notice input { width:20px; min-height:20px; }

/* Desktop application shell */
.app-shell { display:grid; width:100%; min-width:0; grid-template-columns:244px minmax(0,1fr); min-height:100vh; }
.task-nav { display:flex; flex-direction:column; gap:0; padding:24px 14px; border-right:1px solid var(--border); background:var(--surface); }
.brand { padding:0 10px 22px; } .brand strong { font-size:20px; } .brand .eyebrow { margin-bottom:4px; color:var(--text-tertiary); font-size:12px; }
.new-task { width:100%; margin-bottom:18px; }
.mission-list { display:grid; flex:1 1 auto; min-height:0; align-content:start; gap:3px; overflow:auto; }
.mission-group-title { margin:12px 10px 5px; color:var(--text-tertiary); font-size:12px; font-weight:750; }
.mission-item { width:100%; min-height:44px; padding:11px 10px; border:0; border-radius:8px; color:var(--text-primary); background:transparent; font-weight:400; text-align:left; }
.mission-item:hover,.mission-item[aria-current="true"] { color:var(--text-primary); background:var(--accent-soft); }
.mission-item strong,.mission-item span { display:block; } .mission-item strong { font-size:14px; } .mission-item span { margin-top:4px; color:var(--text-secondary); font-size:12px; line-height:1.4; }
.nav-footer { display:grid; gap:4px; margin-top:auto; padding-top:18px; border-top:1px solid var(--border); }
.app-main { display:grid; grid-template-rows:72px minmax(0,1fr); min-width:0; }
.topbar { display:flex; align-items:center; justify-content:space-between; height:72px; padding:0 36px; border-bottom:1px solid var(--border); background:var(--surface); }
.topbar h1 { margin:0; font-size:17px; }
.account-entry { display:flex; align-items:center; gap:10px; min-height:44px; padding:4px 8px; border:0; color:var(--text-primary); background:transparent; font-weight:550; }
.account-entry:hover { color:var(--text-primary); background:var(--surface-subtle); }
.account-avatar { display:grid; width:34px; height:34px; place-items:center; border-radius:50%; color:var(--accent); background:var(--accent-soft); font-size:13px; font-weight:750; }

/* Home: a centered JD composer instead of a dashboard. */
.page { min-width:0; }
.home-page { width:min(920px,100%); margin:0 auto; padding:9vh 0 64px; }
.home-intro { width:min(700px,100%); margin:0 auto 32px; }
.home-intro h1 { margin-bottom:12px; font-size:32px; line-height:1.25; }
.home-intro > p:last-child { max-width:560px; margin-bottom:0; color:var(--text-secondary); font-size:15px; line-height:1.65; }
.jd-composer { width:min(760px,100%); margin:0 auto; overflow:hidden; border:1px solid var(--border); border-radius:16px; background:var(--surface); box-shadow:0 8px 22px rgba(24,39,52,.05); }
.jd-composer label,.jd-composer textarea { margin:0; border:0; border-radius:0; }
.jd-composer label { padding:18px 20px 0; }
.jd-composer textarea { min-height:188px; padding:14px 20px 18px; outline:0; font-size:15px; line-height:1.65; resize:none; }
.jd-composer > div { display:flex; align-items:center; justify-content:space-between; gap:16px; padding:14px 16px; border-top:1px solid var(--border); color:var(--text-secondary); font-size:13px; }
.home-page > .status { width:min(760px,100%); margin:10px auto 0; }
.home-current { width:min(760px,100%); margin:40px auto 0; padding-top:24px; border-top:1px solid var(--border); }
.home-current h2 { margin-bottom:12px; font-size:14px; }
.home-current-card { display:flex; align-items:center; justify-content:space-between; gap:20px; padding:16px 18px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface); }
.home-current-card strong,.home-current-card span { display:block; }
.home-current-card strong { margin-bottom:4px; font-size:15px; }
.home-current-card span { color:var(--text-secondary); font-size:13px; }
.home-current-card button { flex:0 0 auto; }

/* Task workspace: five steps, a single 820px conversation spine, sticky composer. */
.mission-workspace { display:flex; flex-direction:column; min-height:calc(100vh - 72px); padding:30px 36px 0; background:var(--surface); }
.workspace-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; width:min(960px,100%); margin:0 auto 18px; }
.workspace-header h1 { margin:4px 0 6px; font-size:24px; }
.workspace-header .muted { margin-bottom:0; font-size:14px; }
.workspace-header > div:last-child { display:flex; gap:8px; flex-shrink:0; }
.stage-progress { display:grid; grid-template-columns:repeat(5,1fr); gap:8px; width:min(960px,100%); margin:0 auto 18px; padding:0; list-style:none; }
.stage-progress li { padding-top:9px; border-top:3px solid var(--border); color:var(--text-tertiary); font-size:12px; }
.stage-progress li.complete { border-color:#8bc8b3; color:var(--success); }
.stage-progress li.current { border-color:var(--accent); color:var(--accent); font-weight:750; }
.mission-workspace > .status { width:min(820px,100%); margin:0 auto; }
.timeline { display:grid; align-content:start; gap:18px; width:min(820px,100%); margin:0 auto; padding:18px 0 132px; list-style:none; }
.timeline-item { max-width:74%; padding:0; color:var(--text-primary); background:transparent; }
.timeline-item p { margin-bottom:4px; font-size:14px; line-height:1.65; } .timeline-item time { color:var(--text-tertiary); font-size:12px; }
.timeline-user { align-self:end; margin-left:auto; padding:12px 14px; border-radius:var(--radius-md); background:var(--accent-soft); }
.timeline-agent { padding:0; }
.timeline-system { max-width:100%; color:var(--text-secondary); font-size:13px; }
.timeline-system.has-artifact { width:100%; margin:4px 0; padding:0; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.timeline-artifact { display:block; width:100%; min-height:0; padding:20px; border:0; border-radius:14px; color:inherit; background:transparent; text-align:left; }
.timeline-artifact:hover { background:var(--surface-subtle); }
.timeline-artifact p { margin:0 0 8px; color:var(--text-primary); font-size:16px; font-weight:650; }
.timeline-artifact time { display:block; margin-top:12px; }
.timeline-card { width:100%; max-width:100%; }
.timeline-progress { display:flex; align-items:center; gap:9px; max-width:100%; margin:2px 0; color:var(--text-secondary); font-size:13px; }
.timeline-progress::before { width:8px; height:8px; flex:0 0 8px; border-radius:50%; background:var(--accent); content:""; }
.timeline-progress p { margin:0; }
.timeline-action-card { margin:4px 0 10px; padding:16px; border:1px solid var(--border); border-radius:14px; background:var(--surface); }
.timeline-action-card .card-label { margin:0 0 6px; color:var(--accent); font-size:12px; font-weight:750; }
.timeline-action-card h3 { margin:0 0 8px; font-size:18px; }
.timeline-action-card > p:not(.card-label) { margin:0 0 10px; color:var(--text-secondary); font-size:14px; line-height:1.55; }
.timeline-action-card .timeline-artifact { display:inline-flex; width:auto; min-height:44px; padding:10px 16px; border:1px solid var(--accent); border-radius:var(--radius-sm); color:#fff; background:var(--accent); font-weight:650; }
.timeline-action-card .timeline-artifact:hover { border-color:var(--accent-hover); background:var(--accent-hover); }
.card-facts { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:8px; margin-bottom:10px; }
.card-facts > div { padding:8px 10px; border-radius:10px; background:var(--surface-subtle); }
.card-facts span,.card-facts strong { display:block; }
.card-facts span { color:var(--text-tertiary); font-size:11px; }
.card-facts strong { margin-top:5px; font-size:14px; }
.card-chips { display:flex; flex-wrap:wrap; gap:7px; margin-bottom:12px; }
.card-chips span { padding:5px 9px; border-radius:999px; color:var(--text-secondary); background:var(--surface-subtle); font-size:12px; }
.card-actions { display:flex; align-items:center; gap:8px; padding-top:10px; border-top:1px solid var(--border); }
.card-actions .card-link { width:auto; min-height:44px; margin-left:auto; padding:10px 8px; border:0; color:var(--accent); background:transparent; font-weight:650; }
.card-actions .card-link:hover { color:var(--accent-hover); background:var(--accent-soft); }
.strategy-previews { display:grid; gap:8px; margin-bottom:18px; }
.strategy-previews section { padding:12px; border-radius:10px; background:var(--surface-subtle); }
.strategy-previews p { margin:5px 0 0; color:var(--text-secondary); font-size:13px; line-height:1.5; }
.adjustment-summary { display:grid; gap:8px; margin-bottom:18px; }
.adjustment-summary p { display:grid; grid-template-columns:88px 1fr; gap:12px; margin:0; font-size:13px; line-height:1.55; }
.adjustment-summary strong { color:var(--text-primary); }.adjustment-summary span { color:var(--text-secondary); }
.result-counts { display:grid; grid-template-columns:repeat(4,1fr); gap:8px; margin-bottom:14px; }
.result-counts > div { padding:12px; border-radius:10px; background:var(--surface-subtle); text-align:center; }
.result-counts strong,.result-counts span { display:block; }.result-counts strong { font-size:20px; }.result-counts span { margin-top:3px; color:var(--text-secondary); font-size:11px; }
.candidate-preview { margin-bottom:18px!important; color:var(--text-secondary); font-size:13px; }
.artifact-card-candidate_pool,.artifact-card-candidate_review,.artifact-card-shortlist { border-color:#b9ddd4; background:#fbfefd; }
.timeline-new-progress { position:sticky; bottom:92px; z-index:3; display:block; width:max-content; margin:-118px auto 74px; border-color:var(--accent); box-shadow:0 4px 12px rgba(24,39,52,.12); }
.composer { position:sticky; bottom:0; z-index:2; width:min(820px,100%); margin:0 auto; padding:14px 0 22px; border-top:1px solid var(--border); background:var(--surface); }
.composer > label { display:none; }
.composer > div { display:flex; gap:8px; padding:8px; border:1px solid var(--border); border-radius:14px; background:var(--surface); box-shadow:0 8px 22px rgba(24,39,52,.06); }
.composer textarea { min-height:48px; padding:11px; border:0; outline:0; resize:none; }
.composer button { flex:0 0 64px; align-self:stretch; white-space:nowrap; }
.composer .muted { display:none; }

/* Results become a wide list/detail workbench instead of a right-side artifact. */
.results-workspace { min-height:calc(100vh - 72px); padding:28px 36px 40px; background:var(--surface); }
.results-workspace > .workspace-header { width:100%; max-width:none; margin-bottom:20px; }
.results-workspace > .workspace-header h1 { margin:3px 0 7px; }
.results-workspace > .status { width:100%; max-width:none; margin:0 auto 8px; }
#candidateResults { width:100%; max-width:none; margin:0 auto; }
.candidate-toolbar { display:flex; align-items:center; justify-content:space-between; gap:16px; margin-bottom:16px; }
.candidate-toolbar > div { display:flex; flex-wrap:wrap; gap:8px; }
.agent-recommendation-filters { align-items:center; }
.agent-recommendation-filters > span { margin-right:2px; color:var(--text-tertiary); font-size:12px; font-weight:700; }
.candidate-outcome-filter { width:auto; min-width:154px; min-height:38px; padding:7px 32px 7px 11px; color:var(--text-secondary); font-size:13px; }
.filter-button { min-height:38px; padding:7px 11px; border-color:var(--border); color:var(--text-secondary); background:#fff; font-weight:550; }
.filter-button[aria-pressed="true"] { border-color:var(--accent); color:var(--accent); background:var(--accent-soft); }
.candidate-grid { display:grid; grid-template-columns:minmax(360px,38%) minmax(0,62%); height:calc(100vh - 208px); min-height:590px; border:1px solid var(--border); border-radius:16px; overflow:hidden; }
.candidate-list { display:block; overflow:auto; border-right:1px solid var(--border); background:var(--surface-subtle); }
.candidate-row { display:block; width:100%; height:auto; min-height:0; padding:17px 18px; border:0; border-bottom:1px solid var(--border); border-radius:0; color:var(--text-primary); background:transparent; text-align:left; }
.candidate-row:hover,.candidate-row[aria-current="true"] { color:var(--text-primary); background:var(--surface); }
.candidate-row h3 { margin-bottom:6px; font-size:16px; } .candidate-row p { margin-bottom:6px; }
.candidate-row .candidate-meta,.candidate-row .candidate-summary { color:var(--text-secondary); font-size:13px; line-height:1.5; }
.candidate-row .candidate-summary { margin-bottom:10px; }
.badge { display:inline-block; padding:4px 8px; border-radius:999px; background:var(--surface-subtle); color:var(--text-secondary); font-size:11px; font-weight:700; }
.recommendation { color:var(--success); background:var(--success-soft); }
.candidate-tags { display:flex; flex-wrap:wrap; align-items:center; gap:6px; }
.candidate-strength,.candidate-risk,.candidate-user-status { display:inline-block; padding:3px 7px; border-radius:999px; color:var(--text-secondary); background:var(--surface); font-size:11px; }
.candidate-risk { color:var(--warning); background:var(--warning-soft); }
.candidate-user-status { margin-left:auto; padding-right:0; color:var(--text-tertiary); background:transparent; }
.candidate-detail { overflow:auto; padding:28px 36px; }
.candidate-detail-header { display:flex; align-items:flex-start; justify-content:space-between; gap:20px; padding-bottom:20px; border-bottom:1px solid var(--border); }
.candidate-detail-header h2 { margin-bottom:6px; font-size:24px; }
.candidate-detail-header p { margin:0; color:var(--text-secondary); font-size:14px; }
.candidate-detail-header a { flex:0 0 auto; }
.candidate-detail section { margin:0; padding:20px 0; border-bottom:1px solid var(--border); }
.candidate-detail section:first-of-type { margin-top:16px; padding:16px; border:0; border-radius:12px; background:var(--accent-soft); }
.candidate-detail section:first-of-type h3 { color:var(--accent); }
.candidate-detail h3 { margin-bottom:10px; font-size:15px; }
.candidate-detail p,.candidate-detail li,.candidate-detail dd { color:var(--text-secondary); font-size:14px; line-height:1.65; }
.candidate-detail dl { display:grid; grid-template-columns:120px 1fr; gap:8px 16px; line-height:1.6; } .candidate-detail dt { color:var(--text-secondary); } .candidate-detail dd { margin:0; white-space:pre-wrap; }
.outcome-controls { position:sticky; bottom:-28px; display:flex; flex-wrap:wrap; gap:8px; margin:0 -36px; padding:16px 36px 20px!important; border-top:1px solid var(--border)!important; border-bottom:0!important; background:var(--surface); }
.outcome-controls h3 { flex-basis:100%; margin:0 0 2px; color:var(--text-tertiary); font-size:12px; font-weight:550; }
.outcome-controls select { width:auto; min-width:174px; } .outcome-controls textarea { min-height:44px; flex:1 1 220px; }
.saved-outcome { flex-basis:100%; margin:0; color:var(--text-secondary); font-size:13px; }
.outcome-action-buttons { display:flex; flex:1 1 100%; gap:8px; }
.outcome-action-buttons button { flex:1; }
.outcome-action-buttons .selected-outcome { border-color:var(--accent); color:var(--accent); background:var(--accent-soft); }
.no-contact-reason { display:flex; flex:1 1 100%; flex-wrap:wrap; gap:8px; padding:12px; border-radius:var(--radius-sm); background:var(--danger-soft); }
.no-contact-reason select { flex:1 1 220px; min-width:0; }
.no-contact-reason button { margin-left:auto; }
.global-feedback { margin-top:20px; padding:20px; border:1px solid var(--border); border-radius:var(--radius-md); background:var(--surface-subtle); }
.global-feedback textarea { margin-bottom:10px; }
.feedback-prompts { display:flex; flex-wrap:wrap; gap:8px; margin:0 0 12px; }
.feedback-prompts button { min-height:32px; padding:5px 9px; color:var(--text-secondary); font-size:12px; }

/* Drawers stay outside the reading column and are the only elevated panels. */
.context-panel,.settings-panel { position:fixed; z-index:10; top:0; right:0; width:620px; height:100vh; padding:28px; overflow:auto; border-left:1px solid var(--border); background:var(--surface); box-shadow:var(--shadow-panel); }
.context-panel header,.settings-panel header { display:flex; justify-content:space-between; gap:16px; border-bottom:1px solid var(--border); }
.icon-button { min-width:44px; padding:0; border-color:transparent; color:var(--text-secondary); background:transparent; font-size:28px; line-height:1; }
.icon-button:hover { color:var(--text-primary); background:var(--surface-subtle); }
.artifact-detail section { margin:18px 0; padding:16px; border:1px solid var(--border); border-radius:var(--radius-md); }
.artifact-detail dl { display:grid; grid-template-columns:130px 1fr; gap:8px 14px; line-height:1.6; } .artifact-detail dt { color:var(--text-secondary); } .artifact-detail dd { margin:0; white-space:pre-wrap; }
.artifact-actions { display:flex; flex-wrap:wrap; gap:8px; }
.settings-panel > section { margin:20px 0; padding-top:20px; border-top:1px solid var(--border); } .settings-panel li { margin-bottom:8px; }
.app-footer { padding:16px max(24px,calc((100% - 1200px)/2)); border-top:1px solid var(--border); color:var(--text-secondary); background:var(--surface-subtle); font-size:12px; }
.app-footer p { margin:4px 0; }
.undo-bar { position:fixed; right:28px; bottom:28px; z-index:40; display:flex; align-items:center; gap:12px; max-width:440px; padding:12px 14px; border:1px solid #c9d7cf; border-radius:12px; background:#fff; box-shadow:0 12px 32px rgba(18,54,38,.18); }
.undo-bar[hidden] { display:none; }
.undo-bar span { flex:1; }
.undo-bar button { min-height:34px; }
@media (prefers-reduced-motion:reduce) { *,*::before,*::after { scroll-behavior:auto !important; transition:none !important; } }

/* V0.8.7.1: premium teal shell and restrained Agent identity. */
button { border-radius:var(--radius-control); transition:background-color 160ms ease, border-color 160ms ease, color 160ms ease, box-shadow 160ms ease, transform 120ms ease; }
button:not(:disabled):active { transform:translateY(1px); }
button svg { width:18px; height:18px; flex:0 0 18px; }
button.secondary { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:40px; padding:9px 12px; border-color:var(--border); box-shadow:var(--shadow-xs); }
button.secondary:hover { border-color:#a8d4ce; color:var(--teal-700); background:var(--teal-soft); }
button:focus-visible,input:focus-visible,textarea:focus-visible,select:focus-visible { outline-color:color-mix(in srgb, var(--agent-indigo) 55%, white); }

.app-shell { grid-template-columns:240px minmax(0,1fr); background:var(--canvas-bg); }
.task-nav { padding:22px 14px 16px; border-right-color:var(--border); background:var(--rail-bg); }
.brand { display:flex; align-items:center; gap:10px; padding:3px 10px 24px; }
.brand-mark { display:grid; width:34px; height:34px; flex:0 0 34px; place-items:center; border-radius:11px; color:var(--agent-indigo); background:var(--agent-indigo-soft); box-shadow:inset 0 0 0 1px rgba(102,92,243,.10); }
.brand-mark svg { width:20px; height:20px; }
.brand strong { font-size:18px; letter-spacing:-.01em; }
.brand .eyebrow { color:var(--text-tertiary); font-size:11px; font-weight:650; letter-spacing:.04em; }
.new-task { display:flex; align-items:center; justify-content:center; gap:8px; margin:0 2px 20px; min-height:46px; padding:11px 14px; border-color:var(--teal-600); background:var(--teal-600); box-shadow:0 7px 16px rgba(14,116,108,.17); }
.new-task:hover { border-color:var(--teal-700); background:var(--teal-700); box-shadow:0 9px 20px rgba(14,116,108,.20); }
.mission-tools { display:grid; gap:7px; margin:0 2px 10px; }
.mission-tools label { color:var(--text-tertiary); font-size:11px; font-weight:700; }
.mission-tools input,.mission-tools select { min-height:36px; padding:7px 9px; font-size:12px; }
.mission-tools > div { display:grid; grid-template-columns:1fr 1fr; gap:6px; }
#loadMoreMissions { min-height:34px; margin-top:6px; text-align:center; }
#missionListStatus { min-height:18px; margin:4px 6px 8px; font-size:11px; }
.mission-list { gap:4px; padding-right:2px; }
.mission-group-title { margin:16px 10px 6px; color:var(--text-tertiary); font-size:11px; font-weight:700; letter-spacing:.05em; }
.mission-history { margin:12px 2px 0; border-top:1px solid var(--border); }
.mission-history > summary { padding:12px 8px 8px; color:var(--text-secondary); cursor:pointer; font-size:12px; font-weight:700; list-style-position:inside; }
.mission-history > summary:hover { color:var(--teal-700); }
.mission-history-list { display:grid; gap:4px; }
.mission-history-list .mission-group-title { margin-top:10px; }
.mission-item { position:relative; padding:11px 12px; border-radius:10px; transition:background-color 160ms ease, color 160ms ease; }
.mission-item[aria-current="true"] { background:var(--teal-soft); font-weight:550; }
.mission-item[aria-current="true"]::before { position:absolute; top:9px; bottom:9px; left:-2px; width:3px; border-radius:999px; background:var(--teal-600); content:""; }
.mission-item:hover { background:#f1f5f5; }
.mission-item strong { overflow:hidden; display:-webkit-box; -webkit-box-orient:vertical; -webkit-line-clamp:2; overflow-wrap:anywhere; font-size:13px; font-weight:600; }
.mission-item span { color:var(--text-tertiary); }
.nav-footer { padding-top:14px; border-top-color:var(--border); }
.nav-footer .quiet-button { min-height:40px; border-radius:10px; }

.app-main { grid-template-rows:66px minmax(0,1fr); }
.topbar { height:66px; padding:0 34px; border-bottom-color:var(--border); background:rgba(255,255,255,.92); box-shadow:var(--shadow-xs); }
.topbar h1 { color:var(--text-secondary); font-size:15px; font-weight:650; }
.account-entry { gap:9px; border-radius:10px; color:var(--text-secondary); }
.account-entry:hover { color:var(--text-primary); background:var(--surface-subtle); }
.account-avatar { width:32px; height:32px; color:var(--agent-indigo); background:var(--agent-indigo-soft); }
.account-avatar svg { width:18px; height:18px; }

.home-page { position:relative; isolation:isolate; padding:clamp(58px,10vh,92px) 0 72px; }
.home-page::before { position:absolute; z-index:-1; top:20px; left:50%; width:540px; height:280px; border-radius:50%; background:radial-gradient(ellipse, rgba(102,92,243,.08), rgba(102,92,243,0) 68%); transform:translateX(-50%); content:""; pointer-events:none; }
.home-intro { margin-bottom:30px; }
.home-intro .eyebrow { color:var(--agent-indigo); }
.home-intro h1 { margin-bottom:14px; font-size:36px; letter-spacing:-.035em; }
.jd-composer { border-color:var(--border); border-radius:var(--radius-composer); box-shadow:var(--shadow-sm); }
.jd-composer:hover,.jd-composer:focus-within { border-color:#b6d8d4; box-shadow:0 10px 30px rgba(24,39,52,.09); }
.jd-composer label { padding:20px 22px 0; color:var(--text-secondary); font-size:13px; font-weight:650; }
.jd-composer textarea { min-height:194px; padding:14px 22px 20px; color:var(--text-primary); }
.jd-composer textarea::placeholder { color:var(--text-tertiary); }
.jd-composer > div { padding:14px 16px 14px 22px; border-top-color:var(--border); }
.jd-composer > div button { min-width:118px; box-shadow:0 4px 10px rgba(14,116,108,.15); }
.home-current { margin-top:42px; padding-top:0; border-top:0; }
.home-current h2 { margin:0 0 12px 2px; color:var(--text-secondary); font-size:13px; font-weight:650; }
.home-current-card { padding:17px 18px; border-color:var(--border); border-radius:var(--radius-card); background:rgba(255,255,255,.85); box-shadow:var(--shadow-xs); }
.home-current-card:hover { border-color:#cfe3e0; }
.home-current-card button { min-width:76px; }

.mission-workspace,.results-workspace { min-height:calc(100vh - 66px); background:var(--canvas-bg); }
.mission-workspace { padding-top:28px; }
.workspace-header { width:min(860px,100%); }
.workspace-header h1 { font-size:24px; letter-spacing:-.02em; }
.workspace-header > div:last-child { gap:7px; }
.stage-progress { position:relative; gap:0; width:min(860px,100%); margin-bottom:14px; overflow:hidden; }
.stage-progress li { position:relative; padding:29px 12px 0 0; border:0; color:var(--text-tertiary); font-size:12px; line-height:1.35; }
.stage-progress li::before { position:absolute; z-index:1; top:7px; left:0; width:10px; height:10px; border:2px solid var(--border-strong); border-radius:50%; background:var(--canvas-bg); box-shadow:0 0 0 3px var(--canvas-bg); content:""; }
.stage-progress li:not(:last-child)::after { position:absolute; top:12px; left:12px; width:calc(100% - 12px); height:2px; background:var(--border); content:""; }
.stage-progress li.complete { color:var(--success); }
.stage-progress li.complete::before { border-color:var(--success); background:var(--success); }
.stage-progress li.complete:not(:last-child)::after { background:#9bcebd; }
.stage-progress li.current { color:var(--agent-indigo-strong); font-weight:750; }
.stage-progress li.current::before { border-color:var(--agent-indigo); background:var(--surface); box-shadow:0 0 0 3px var(--agent-indigo-soft); }
.attention-bar { display:flex; align-items:center; justify-content:space-between; gap:16px; width:min(840px,100%); margin:0 auto 10px; padding:11px 14px; border:1px solid #b9ddd4; border-radius:var(--radius-card); background:#fbfefd; }
.attention-bar p { margin:0; color:var(--text-secondary); font-size:13px; line-height:1.55; }
.attention-bar button { flex:0 0 auto; white-space:nowrap; }
.timeline { width:min(840px,100%); gap:22px; padding-top:20px; }
.timeline-agent::before { display:none; }
.timeline-agent-identity { display:flex; align-items:center; gap:8px; margin:0 0 8px; color:var(--text-secondary); font-size:12px; font-weight:650; }
.timeline-agent-avatar { display:grid; width:30px; height:30px; place-items:center; border:1px solid rgba(102,92,243,.16); border-radius:10px; color:var(--agent-indigo-strong); background:var(--agent-indigo-soft); font-size:12px; font-weight:750; }
.timeline-user { border:1px solid #d9e9e7; border-radius:14px 14px 4px 14px; background:var(--teal-soft); box-shadow:var(--shadow-xs); }
.timeline-progress::before { background:var(--agent-indigo); }
.timeline-system.has-artifact,.timeline-action-card { border-color:var(--border); border-radius:var(--radius-card); box-shadow:var(--shadow-xs); }
.timeline-action-card .card-label { color:var(--agent-indigo); }
.timeline-action-card .timeline-artifact { border-color:var(--teal-600); background:var(--teal-600); }
.card-actions { border-top-color:var(--border); }
.card-actions .card-link { color:var(--teal-700); }
.composer { width:min(840px,100%); padding-top:12px; border-top:0; background:linear-gradient(to bottom, rgba(251,252,254,0), var(--canvas-bg) 28%); }
.composer > div { border-color:var(--border); border-radius:var(--radius-composer); box-shadow:var(--shadow-sm); }
.composer > div:focus-within { border-color:#b6d8d4; box-shadow:0 9px 25px rgba(24,39,52,.09); }
.composer button { display:inline-flex; align-items:center; justify-content:center; gap:6px; flex-basis:auto; min-width:86px; }
.composer button svg { width:17px; height:17px; }

.results-workspace { padding-top:26px; }
.results-workspace > .workspace-header { width:100%; max-width:none; }
#candidateResults { width:100%; max-width:none; }
.candidate-grid { border-color:var(--border); border-radius:var(--radius-panel); box-shadow:var(--shadow-xs); }
.candidate-list { background:#f8fafb; }
.candidate-row { min-height:142px; padding:15px 18px; border-bottom-color:var(--border); }
.candidate-row:hover { background:#fff; }
.candidate-row[aria-current="true"] { background:var(--teal-soft); box-shadow:inset 3px 0 0 var(--teal-600); }
.candidate-row h3 { font-size:15px; }
.candidate-row .candidate-summary { display:-webkit-box; overflow:hidden; margin-bottom:8px; -webkit-box-orient:vertical; -webkit-line-clamp:2; }
.recommendation { color:var(--agent-indigo-strong); background:var(--agent-indigo-soft); }
.recommendation.recommendation-priority_contact { color:var(--success); background:var(--success-soft); }
.recommendation.recommendation-hold { color:var(--agent-indigo-strong); background:var(--agent-indigo-soft); }
.recommendation.recommendation-no_contact { color:var(--danger); background:var(--danger-soft); }
.candidate-row-identity,.candidate-detail-identity { display:flex; align-items:center; gap:10px; }
.candidate-row-identity h3 { margin:0; }
.candidate-avatar { display:grid; width:30px; height:30px; flex:0 0 30px; place-items:center; border-radius:50%; color:var(--teal-700); background:#d9eeeb; font-size:12px; font-weight:750; }
.candidate-avatar-large { width:48px; height:48px; flex-basis:48px; color:var(--agent-indigo-strong); background:var(--agent-indigo-soft); font-size:17px; }
.candidate-detail-hero { align-items:flex-start; }
.candidate-detail { padding:28px 34px; background:var(--surface); }
.candidate-detail-header a { color:var(--teal-700); font-weight:650; text-decoration-color:#9bcdc7; text-underline-offset:3px; }
.candidate-detail section:first-of-type { background:var(--agent-indigo-soft); }
.candidate-detail section:first-of-type h3 { color:var(--agent-indigo-strong); }
.outcome-controls { bottom:-28px; margin:0 -34px; padding:16px 34px 20px!important; background:rgba(255,255,255,.96); }
.outcome-action-buttons .selected-outcome { border-color:var(--teal-600); color:var(--teal-700); background:var(--teal-soft); }

/* V0.8.7.2: candidate scanning and evidence-led detail are independent surfaces. */
.result-metrics { display:grid; grid-template-columns:repeat(4,minmax(0,1fr)); gap:10px; margin:0 0 16px; }
.result-metric { min-height:68px; padding:12px 14px; border:1px solid var(--border); border-radius:var(--radius-card); background:var(--surface); box-shadow:var(--shadow-xs); }
.result-metric strong,.result-metric span { display:block; }
.result-metric strong { margin-bottom:3px; color:var(--text-primary); font-size:24px; line-height:1; letter-spacing:-.03em; }
.result-metric span { color:var(--text-secondary); font-size:12px; font-weight:650; }
.result-metric-priority strong { color:var(--teal-700); }
.result-metric-hold strong { color:var(--agent-indigo-strong); }
.result-metric-no-contact strong { color:var(--danger); }
.candidate-grid { grid-template-columns:clamp(360px,32%,460px) minmax(0,1fr); gap:16px; height:calc(100vh - 294px); min-height:560px; border:0; border-radius:0; box-shadow:none; background:transparent; overflow:visible; }
.candidate-list,.candidate-detail { border:1px solid var(--border); border-radius:var(--radius-panel); box-shadow:var(--shadow-xs); }
.candidate-list { border-right:1px solid var(--border); background:var(--surface); }
.candidate-row { min-height:136px; padding:12px 14px; background:var(--surface); }
.candidate-row[aria-current="true"] { background:#f8fcfb; }
.candidate-row .candidate-meta { overflow:hidden; margin:3px 0 4px; text-overflow:ellipsis; white-space:nowrap; }
.candidate-row .recommendation { float:left; margin:0 6px 4px 0; }
.candidate-row .candidate-summary { min-height:18px; margin:0 0 4px; line-height:18px; -webkit-line-clamp:1; }
.candidate-row-footer { clear:both; display:flex; align-items:center; justify-content:space-between; gap:8px; min-height:19px; }
.candidate-row-footer .candidate-tags { flex-wrap:nowrap; overflow:hidden; }
.candidate-row-footer .candidate-strength,.candidate-row-footer .candidate-risk { overflow:hidden; max-width:108px; text-overflow:ellipsis; white-space:nowrap; }
.candidate-row-footer .candidate-user-status { flex:0 0 auto; margin-left:0; font-size:11px; }
.candidate-detail { padding:26px 30px; }
.candidate-external-link { display:inline-flex; align-items:center; gap:6px; min-height:36px; padding:7px 10px; border:1px solid var(--border); border-radius:var(--radius-control); text-decoration:none; }
.candidate-external-link svg { width:15px; height:15px; fill:none; stroke:currentColor; stroke-linecap:round; stroke-linejoin:round; stroke-width:1.8; }
.candidate-evidence-list,.candidate-risk-list { display:grid; gap:8px; margin:0; padding:0; list-style:none; }
.candidate-evidence-list li,.candidate-risk-list li { position:relative; padding-left:20px; }
.candidate-evidence-list li::before,.candidate-risk-list li::before { position:absolute; left:0; font-weight:750; content:"✓"; }
.candidate-evidence-list li::before { color:var(--teal-600); }
.candidate-risk-list li::before { color:var(--warning); content:"!"; }
.results-workspace { padding-top:18px; }
.results-workspace > .workspace-header { margin-bottom:12px; }
.result-metrics { margin-bottom:10px; }
.candidate-toolbar { margin-bottom:8px; }

/* V0.8.7.2: keep the conversation spine quiet and clearly Agent-led. */
.stage-progress { margin-bottom:18px; }
.stage-progress li { padding-top:27px; color:#98a2b3; }
.stage-progress li.complete { color:#5f897f; }
.stage-progress li.complete::before { border-color:#73aa9c; background:#73aa9c; }
.stage-progress li.complete:not(:last-child)::after { background:#c6ddd8; }
.stage-progress li.current { color:var(--agent-indigo-strong); }
.timeline-agent { max-width:760px; padding:2px 0; }
.timeline-agent-identity { margin-bottom:6px; }
.timeline-agent-avatar { width:32px; height:32px; flex:0 0 32px; border-radius:11px; }
.timeline-agent p { margin:0 0 3px; color:var(--text-primary); font-size:15px; line-height:1.7; }
.timeline-agent time { display:block; margin-top:5px; }
.timeline-command { max-width:760px; padding:10px 12px; border-left:3px solid var(--agent-indigo); border-radius:0 var(--radius-card) var(--radius-card) 0; background:var(--agent-indigo-soft); }
.timeline-command p { margin:0; color:var(--text-primary); }
.timeline-command time { display:block; margin-top:5px; color:var(--text-tertiary); font-size:12px; }
.timeline-action-card { padding:18px; }
.timeline-action-card > p:not(.card-label) { max-width:680px; }
.composer { padding-top:10px; }
.composer > div { box-shadow:0 5px 16px rgba(24,39,52,.06); }
.composer button:disabled { border-color:#d5dde0; color:#98a2b3; background:#eef2f4; box-shadow:none; }

@media (max-height:760px) {
  .app-main { grid-template-rows:56px minmax(0,1fr); }
  .topbar { height:56px; }
  .mission-workspace { height:calc(100dvh - 56px); padding-top:16px; }
  .workspace-header { margin-bottom:10px; }
  .workspace-header h1 { font-size:21px; }
  .stage-progress { margin-bottom:8px; }
  .stage-progress li { padding-top:23px; }
  #missionStageCopy { display:none; }
  .attention-bar { margin-bottom:6px; padding:8px 12px; }
  .composer { padding-top:6px; padding-bottom:10px; }
}

/* V0.8.7.2: give the JD its own calm focal field without raising task history. */
.home-page { padding:clamp(72px,12vh,108px) 0 72px; }
.home-intro { margin-bottom:34px; }
.jd-composer { box-shadow:0 10px 28px rgba(24,39,52,.07); }
.home-current { margin-top:48px; }
.home-current-card { background:rgba(255,255,255,.72); box-shadow:none; }
.home-current-card strong { font-size:14px; }

.drawer-backdrop { position:fixed; z-index:9; inset:0; visibility:hidden; opacity:0; background:rgba(21,33,43,.44); transition:opacity 180ms ease, visibility 0s linear 180ms; pointer-events:none; }
.context-panel,.settings-panel { z-index:10; width:min(620px,calc(100vw - 40px)); padding:26px 28px; border-left-color:var(--border); background:var(--surface-elevated); box-shadow:var(--shadow-md); transition:opacity 180ms ease, transform 180ms ease, visibility 0s linear; }
.context-panel[hidden],.settings-panel[hidden] { display:block !important; visibility:hidden; opacity:0; transform:translateX(24px); pointer-events:none; transition:opacity 130ms ease, transform 130ms ease, visibility 0s linear 130ms; }
.app-shell:has(.context-panel:not([hidden])) .drawer-backdrop,.app-shell:has(.settings-panel:not([hidden])) .drawer-backdrop { visibility:visible; opacity:1; transition:opacity 180ms ease; pointer-events:auto; }
.context-panel header,.settings-panel header { position:sticky; z-index:1; top:-26px; align-items:center; margin:0 -28px; padding:26px 28px 16px; border-bottom-color:var(--border); background:var(--surface-elevated); }
.context-panel header h2,.settings-panel header h2 { margin:0; font-size:20px; }
.icon-button { display:grid; width:40px; min-width:40px; height:40px; min-height:40px; place-items:center; padding:0; border-radius:10px; }
.icon-button svg { width:20px; height:20px; }
.artifact-detail section { border-color:var(--border); border-radius:var(--radius-card); }

@media (max-width:1366px) {
  .topbar { padding:0 28px; }
  .mission-workspace,.results-workspace { padding-left:28px; padding-right:28px; }
  .workspace-header,.stage-progress { width:min(840px,100%); }
}

@media (prefers-reduced-motion:reduce) {
  .drawer-backdrop,.context-panel,.settings-panel,button,.mission-item { transition:none !important; }
}

/* Freeze patch: the application shell stays fixed; each work surface owns its reading scroll. */
body:has(#app:not([hidden])) { overflow:hidden; }
body:has(#app:not([hidden])) > .app-footer { display:none; }
.app-shell { height:100dvh; min-height:0; overflow:hidden; }
.task-nav,.app-main { min-height:0; }
.app-main { height:100dvh; overflow:hidden; }
.home-page { height:calc(100dvh - 66px); overflow-y:auto; }
.mission-workspace { position:relative; height:calc(100dvh - 66px); min-height:0; padding-bottom:0; overflow:hidden; }
.mission-workspace > .workspace-header,.mission-workspace > .stage-progress,.mission-workspace > .status,.mission-workspace > .composer { flex:0 0 auto; }
.timeline { flex:1 1 auto; min-height:0; padding:18px 12px 24px 0; overflow-y:auto; overscroll-behavior:contain; scrollbar-gutter:stable; }
.composer { position:static; padding-bottom:18px; }
.timeline-new-progress { position:absolute; z-index:4; right:50%; bottom:102px; margin:0; transform:translateX(50%); }

.stage-jump { width:100%; min-height:34px; padding:0 12px 0 0; border:0; border-radius:0; color:inherit; background:transparent; font-size:inherit; font-weight:inherit; line-height:1.35; text-align:left; }
.stage-jump:hover { border-color:transparent; color:var(--agent-indigo-strong); background:transparent; }
.stage-jump:focus-visible { border-radius:6px; outline-width:2px; outline-offset:2px; }

.results-workspace { display:flex; height:calc(100dvh - 66px); min-height:0; flex-direction:column; padding-bottom:18px; overflow:hidden; }
.results-workspace > .workspace-header,.results-workspace > .status { flex:0 0 auto; }
#candidateResults { display:flex; min-height:0; flex:1 1 auto; flex-direction:column; }
.result-metrics,.candidate-toolbar { flex:0 0 auto; }
.candidate-grid { height:auto; min-height:0; flex:1 1 auto; }
.candidate-list,.candidate-detail { min-height:0; overscroll-behavior:contain; }
.outcome-controls { position:static; bottom:auto; }
.candidate-detail .global-feedback { margin:20px 0 0; }
.candidate-requirement-checks { display:grid; gap:8px; padding:0; list-style:none; }
.candidate-requirement-checks li { display:grid; gap:3px; padding:10px 12px; border-radius:8px; background:var(--surface-subtle); }
.candidate-requirement-checks span { color:var(--text-secondary); font-size:13px; }

.candidate-resume > h3 { margin-bottom:18px; }
.resume-group + .resume-group { margin-top:22px; }
.resume-group h4 { margin:0 0 10px; color:var(--text-primary); font-size:14px; }
.resume-timeline { display:grid; gap:0; margin-left:5px; border-left:2px solid #d9e9e7; }
.resume-entry { position:relative; padding:0 0 20px 20px; }
.resume-entry:last-child { padding-bottom:0; }
.resume-entry::before { position:absolute; top:5px; left:-6px; width:10px; height:10px; border:2px solid var(--surface); border-radius:50%; background:var(--teal-600); content:""; }
.resume-entry header { display:grid; grid-template-columns:minmax(104px,auto) minmax(0,1fr); gap:12px; align-items:baseline; margin-bottom:8px; }
.resume-entry time { color:var(--text-tertiary); font-size:12px; font-variant-numeric:tabular-nums; }
.resume-entry strong { color:var(--text-primary); font-size:14px; }
.resume-entry ul { display:grid; gap:5px; margin:0; padding-left:18px; }
