:root {
  color-scheme: light;
  --ink: #23201d;
  --ink-soft: #5f5953;
  --paper: #f7f6f3;
  --surface: #ffffff;
  --surface-soft: #efede8;
  --line: #d8d3cc;
  --accent: #c34f20;
  --accent-dark: #923511;
  --accent-soft: #f8e4d9;
  --danger: #a82e2e;
  --success: #356648;
  --radius: 12px;
  --shadow: 0 18px 46px rgba(72, 57, 43, .11);
  --header-height: 72px;
  font-family: "Segoe UI Variable", "Aptos", "Segoe UI", system-ui, sans-serif;
}
* { box-sizing: border-box; }
html { background: var(--paper); scroll-padding-top: calc(var(--header-height) + 16px); }
body { margin: 0; min-width: 320px; background: var(--paper); color: var(--ink); font-size: 16px; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
a { color: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.skip-link { position: fixed; left: 16px; top: -80px; z-index: 100; background: var(--ink); color: white; padding: 12px 16px; border-radius: 8px; }
.skip-link:focus { top: 16px; }
.eyebrow { margin: 0 0 8px; color: var(--accent-dark); font-size: .76rem; font-weight: 750; letter-spacing: .09em; text-transform: uppercase; }
.muted, .fine-print { color: var(--ink-soft); }
.fine-print { font-size: .78rem; }
.brand-mark { width: 58px; height: 58px; display: grid; place-items: center; border: 2px solid currentColor; border-radius: 10px; font-weight: 800; letter-spacing: -.04em; }
label { display: grid; gap: 7px; color: var(--ink-soft); font-size: .86rem; font-weight: 700; }
input, select, textarea { width: 100%; min-height: 44px; border: 1px solid #aaa39b; border-radius: 8px; background: white; color: var(--ink); padding: 10px 12px; }
textarea { resize: vertical; }
.form-error { min-height: 24px; margin: 6px 0; color: var(--danger); font-size: .86rem; }
.button { min-height: 44px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid transparent; border-radius: 8px; padding: 10px 16px; font-weight: 750; line-height: 1.2; transition: transform 160ms ease, background 160ms ease, border-color 160ms ease; }
.button:active, .text-button:active, .primary-nav button:active { transform: translateY(1px); }
.button-primary { background: var(--accent); color: white; }
.button-primary:hover { background: var(--accent-dark); }
.button-secondary { background: transparent; color: var(--ink); border-color: #918981; }
.button-secondary:hover { background: var(--surface-soft); }
.button-danger { background: var(--danger); color: white; }
.button-block { width: 100%; }
.button-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.text-button { min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); padding: 8px 10px; font-size: .86rem; font-weight: 700; }
.text-button:hover { background: var(--surface-soft); color: var(--ink); }
.app-shell { min-height: 100dvh; padding-bottom: 58px; }
.topbar { min-height: var(--header-height); position: sticky; top: 0; z-index: 20; display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 22px; padding: 10px clamp(18px, 3vw, 44px); border-bottom: 1px solid var(--line); background: rgba(247, 246, 243, .97); }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.brand span:last-child { display: grid; line-height: 1.15; }
.brand small { color: var(--ink-soft); font-size: .7rem; }
.brand-mark-small { width: 40px; height: 40px; border-width: 1px; border-color: var(--accent); color: var(--accent-dark); font-size: .84rem; }
.primary-nav { display: flex; align-items: center; gap: 2px; }
.primary-nav button { min-height: 44px; border: 0; border-radius: 8px; background: transparent; color: var(--ink-soft); padding: 8px 13px; font-weight: 700; }
.primary-nav button:hover, .primary-nav button[aria-current="page"] { background: var(--surface-soft); color: var(--ink); }
.primary-nav button[aria-current="page"] { box-shadow: inset 0 -2px var(--accent); }
.top-actions { display: flex; gap: 2px; }
.mobile-nav-toggle { display: none; }
main { width: min(1440px, 100%); margin: 0 auto; padding: clamp(26px, 4vw, 54px) clamp(18px, 4vw, 56px) 80px; }
.view { animation: view-in 220ms ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(7px); } to { opacity: 1; transform: none; } }
.page-heading { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 460px); align-items: end; gap: 36px; margin-bottom: 30px; }
.page-heading h1 { margin: 0; font-size: clamp(2.5rem, 5vw, 5rem); line-height: .98; letter-spacing: -.055em; }
.page-heading > p { margin: 0 0 6px; color: var(--ink-soft); max-width: 52ch; }
.section-heading, .panel-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.section-heading h2 { margin: 0; font-size: 1.15rem; }
.section-heading span { color: var(--ink-soft); font-size: .85rem; }
.welcome-view { min-height: calc(100dvh - 210px); display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(330px, .65fr); align-items: center; gap: clamp(44px, 9vw, 130px); }
.welcome-copy h1 { max-width: 820px; margin: 0; font-size: clamp(3rem, 7vw, 7.3rem); line-height: .92; letter-spacing: -.065em; }
.welcome-lede { max-width: 62ch; color: var(--ink-soft); font-size: 1.12rem; }
.welcome-brief { border-left: 3px solid var(--accent); padding-left: 28px; }
.welcome-brief h2 { margin-top: 0; }
.welcome-brief dl { margin: 0; }
.welcome-brief dl div { padding: 14px 0; border-bottom: 1px solid var(--line); }
.welcome-brief dt { font-weight: 800; }
.welcome-brief dd { margin: 2px 0 0; color: var(--ink-soft); }
.status-panel { min-height: 62px; display: flex; align-items: center; justify-content: center; border: 1px dashed #aaa39b; border-radius: var(--radius); color: var(--ink-soft); padding: 18px; }
.status-panel.is-error { color: var(--danger); border-color: var(--danger); }
.metrics-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 22px 0 34px; }
.operator-context { display: flex; align-items: flex-start; gap: 14px; padding: 16px 18px; margin-bottom: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.operator-context div { display: grid; gap: 4px; }
.operator-context strong { font-size: 1rem; }
.operator-context p { margin: 0; color: var(--ink-soft); max-width: 78ch; }
.metric { min-height: 136px; padding: 24px; border-right: 1px solid var(--line); }
.metric:last-child { border-right: 0; }
.metric strong { display: block; font-size: clamp(2rem, 4vw, 3.6rem); line-height: 1; letter-spacing: -.055em; font-variant-numeric: tabular-nums; }
.metric span { display: block; margin-top: 10px; color: var(--ink-soft); }
.today-layout { display: grid; grid-template-columns: minmax(360px, .8fr) minmax(0, 1.2fr); gap: 28px; align-items: start; }
.today-layout.is-guided-focus { grid-template-columns: minmax(0, 900px); justify-content: center; }
.split-workspace.is-guided-focus { grid-template-columns: minmax(0, 980px); justify-content: center; }
.split-workspace.is-guided-focus > .list-panel { display: none; }
.spotlight-panel { min-height: 360px; padding: clamp(24px, 4vw, 46px); border-radius: var(--radius); background: #2b2824; color: #f8f5ef; box-shadow: var(--shadow); }
.spotlight-panel .eyebrow { color: #f2aa82; }
.spotlight-panel h2 { margin: 0; font-size: clamp(2rem, 4vw, 3.7rem); line-height: 1.02; letter-spacing: -.045em; }
.spotlight-panel p { color: #d8d1c9; }
.spotlight-panel .reason-row { color: #f8f5ef; }
.spotlight-facts { display: grid; gap: 10px; margin: 24px 0; }
.spotlight-facts div { padding-top: 10px; border-top: 1px solid #554f48; }
.spotlight-facts dt { color: #bdb5ab; font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.spotlight-facts dd { margin: 4px 0 0; }
.work-list { padding: 8px 0; }
.priority-item { width: 100%; display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: start; gap: 16px; padding: 18px 8px; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; color: inherit; }
.priority-item:hover { background: rgba(255,255,255,.65); }
.priority-score { font-weight: 850; font-size: 1.35rem; color: var(--accent-dark); font-variant-numeric: tabular-nums; }
.priority-copy strong { display: block; }
.priority-copy span { color: var(--ink-soft); font-size: .87rem; }
.priority-copy small { display: block; margin-top: 5px; color: var(--ink-soft); }
.value { white-space: nowrap; font-weight: 750; }
.reason-row { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 15px; }
.reason { display: inline-flex; align-items: center; min-height: 28px; border: 1px solid currentColor; border-radius: 999px; padding: 3px 9px; font-size: .74rem; font-weight: 700; }
.split-workspace { display: grid; grid-template-columns: minmax(300px, 390px) minmax(0, 1fr); gap: 22px; align-items: start; }
.list-panel, .detail-panel { min-height: 580px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }
.panel-toolbar { min-height: 68px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.thread-list, .prospect-list { max-height: calc(100dvh - 250px); overflow: auto; }
.thread-item, .prospect-item { width: 100%; display: grid; gap: 5px; border: 0; border-bottom: 1px solid #e8e4df; background: transparent; color: inherit; padding: 16px; text-align: left; }
.thread-item:hover, .prospect-item:hover, .thread-item.is-active, .prospect-item.is-active { background: var(--accent-soft); }
.thread-meta, .prospect-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; color: var(--ink-soft); font-size: .78rem; }
.unread-label { color: var(--accent-dark); font-weight: 850; }
.thread-item strong, .prospect-item strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread-item p { margin: 0; color: var(--ink-soft); font-size: .85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-panel { padding: clamp(20px, 3vw, 38px); }
.empty-state { display: grid; place-content: center; text-align: center; color: var(--ink-soft); }
.empty-state h2 { margin-bottom: 4px; color: var(--ink); }
.reader-heading { padding-bottom: 20px; border-bottom: 1px solid var(--line); }
.reader-heading h2 { margin: 6px 0; font-size: clamp(1.6rem, 3vw, 2.5rem); line-height: 1.1; letter-spacing: -.035em; }
.linked-company { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px; margin: 20px 0; padding: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.linked-company-copy { display: grid; gap: 4px; }
.linked-company-copy strong { font-size: 1.05rem; }
.linked-company-copy > span:not(.record-source), .linked-company-copy small { color: var(--ink-soft); }
.record-source { color: var(--accent-dark); font-size: .72rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.conversation-brief { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 20px 0 26px; }
.brief-card { padding: 16px; border-top: 3px solid var(--line); background: var(--surface-soft); }
.brief-card:last-child { border-top-color: var(--accent); }
.brief-card > span { color: var(--ink-soft); font-size: .74rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.brief-card p { margin: 7px 0 0; }
.message-history > h3 { margin: 0 0 12px; font-size: 1rem; }
.mail-message { margin: 18px 0; padding-left: 18px; border-left: 3px solid var(--line); }
.mail-message.is-inbound { border-left-color: var(--accent); }
.mail-message header { display: flex; justify-content: space-between; gap: 16px; font-size: .83rem; color: var(--ink-soft); }
.mail-message header > span:first-child { display: grid; gap: 2px; }
.message-direction { color: var(--accent-dark); font-size: .69rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }
.mail-message p { white-space: pre-wrap; }
.reply-form { display: grid; gap: 10px; margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line); }
.guided-draft { margin-top: 26px; padding: 20px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-soft); }
.guided-draft pre { margin: 12px 0; white-space: pre-wrap; overflow-wrap: anywhere; font: inherit; line-height: 1.6; }
.guided-draft small, .guided-control-note { color: var(--ink-soft); }
.simulation-note { color: var(--accent-dark); font-size: .78rem; font-weight: 700; }
.stage-overview { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1px; margin-bottom: 22px; overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--line); }
.stage-cell { min-height: 86px; background: var(--surface); padding: 15px; }
.stage-cell strong { display: block; font-size: 1.45rem; }
.stage-cell span { color: var(--ink-soft); font-size: .78rem; }
.pipeline-workspace .list-panel { min-height: 650px; }
.search-label { width: 100%; font-size: .75rem; }
.search-label input { min-height: 40px; }
.status-tag { width: fit-content; border-radius: 999px; background: var(--surface-soft); padding: 3px 9px; font-size: .72rem; font-weight: 750; }
.prospect-header { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.prospect-header-actions { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.prospect-header h2 { margin: 5px 0; font-size: clamp(1.8rem, 3vw, 3rem); line-height: 1; letter-spacing: -.045em; }
.prospect-header .value { font-size: 1.35rem; color: var(--accent-dark); }
.record-explainer { max-width: 68ch; color: var(--ink-soft); }
.result-summary { margin: 24px 0; padding: 22px; border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: var(--radius); background: var(--surface-soft); }
.result-grid { display: grid; grid-template-columns: .65fr 1.25fr 1fr; gap: 22px; }
.result-grid > div { display: grid; align-content: start; gap: 5px; }
.result-grid span { color: var(--ink-soft); font-size: .72rem; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; }
.result-grid small { color: var(--ink-soft); line-height: 1.45; }
.record-edit-disclosure { margin-top: 24px; border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 20px; }
.record-edit-disclosure summary { cursor: pointer; font-weight: 800; }
.detail-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.detail-grid div { padding: 12px 0; border-bottom: 1px solid var(--line); }
.detail-grid dt { color: var(--ink-soft); font-size: .76rem; font-weight: 700; }
.detail-grid dd { margin: 4px 0 0; }
.edit-section { margin-top: 24px; padding: 20px; border-radius: var(--radius); background: var(--surface-soft); }
.edit-section h3 { margin-top: 0; }
.edit-grid { display: grid; grid-template-columns: 1fr 130px; gap: 12px; }
.timeline { margin-top: 26px; }
.timeline-item { padding: 13px 0; border-bottom: 1px solid var(--line); }
.timeline-item p { margin: 3px 0; }
.timeline-item small { color: var(--ink-soft); }
.scenario-chooser { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 28px 0; }
.scenario-button { min-height: 96px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); color: var(--ink); padding: 18px; text-align: left; font-weight: 800; }
.scenario-button:hover, .scenario-button.is-active { border-color: var(--accent); background: var(--accent-soft); }
.scenario-stage { min-height: 300px; padding: clamp(24px, 4vw, 48px); border-radius: var(--radius); background: #2b2824; color: #f8f5ef; }
.scenario-stage > p { color: #d8d1c9; }
.action-sequence { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin-top: 30px; }
.action-step { opacity: .38; transform: translateY(8px); padding: 16px 0; border-top: 3px solid #746d64; transition: opacity 240ms ease, transform 240ms ease, border-color 240ms ease; }
.action-step.is-active { opacity: 1; transform: none; border-color: #e17743; }
.action-step strong, .action-step span { display: block; }
.action-step span { color: #d8d1c9; font-size: .82rem; margin-top: 5px; }
.technical-disclosure { margin-top: 18px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 16px 20px; }
.technical-disclosure summary { cursor: pointer; font-weight: 800; }
.tool-inventory { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 12px; }
.tool-inventory code { border: 1px solid var(--line); border-radius: 6px; padding: 4px 7px; background: var(--surface-soft); font-size: .73rem; }
.completion-view { min-height: calc(100dvh - 220px); display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr); align-items: center; gap: 70px; }
.completion-copy h1 { max-width: 760px; margin: 0; font-size: clamp(3rem, 7vw, 7rem); line-height: .92; letter-spacing: -.065em; }
.completion-copy > p:not(.eyebrow) { max-width: 60ch; color: var(--ink-soft); font-size: 1.08rem; }
.completion-metrics { border-left: 3px solid var(--accent); padding-left: 28px; }
.completion-metric { padding: 17px 0; border-bottom: 1px solid var(--line); }
.completion-metric strong { display: block; font-size: 2.2rem; }
.tour-guide { position: sticky; z-index: 18; top: calc(var(--header-height) + 10px); width: 100%; margin: 0 0 28px; border: 1px solid #6d655c; border-radius: var(--radius); background: #2b2824; color: #f8f5ef; padding: 16px 20px; box-shadow: 0 12px 35px rgba(29, 24, 19, .16); }
.tour-content { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 24px; margin-top: 10px; }
.tour-guide h2 { margin: 0 0 4px; font-size: 1.15rem; }
.tour-guide p { max-width: 82ch; margin: 0; color: #d8d1c9; }
.tour-topline { display: flex; align-items: center; justify-content: space-between; color: #d8d1c9; font-size: .78rem; }
.tour-topline button { min-height: 38px; border: 0; background: transparent; color: #f8f5ef; }
.tour-guide progress { width: 100%; height: 4px; accent-color: #e17743; }
.tour-guide .button { min-width: 240px; }
.tour-anchor-active { outline: 4px solid rgba(195, 79, 32, .45); outline-offset: 5px; }
.disclosure-bar { min-height: 48px; position: fixed; z-index: 19; inset: auto 0 0; display: flex; justify-content: center; align-items: center; gap: 24px; border-top: 1px solid var(--line); background: rgba(247, 246, 243, .98); color: var(--ink-soft); padding: 8px 20px; font-size: .72rem; }
.disclosure-bar strong { color: var(--ink); }
.confirm-dialog { width: min(470px, calc(100% - 28px)); border: 0; border-radius: var(--radius); padding: 0; box-shadow: var(--shadow); }
.confirm-dialog::backdrop { background: rgba(35, 32, 29, .58); }
.confirm-dialog form { padding: 28px; }
.confirm-dialog h2 { margin: 0; }
.toast-region { position: fixed; z-index: 60; right: 18px; top: 88px; display: grid; gap: 8px; }
.toast { max-width: 380px; border: 1px solid var(--line); border-left: 4px solid var(--ink); border-radius: 8px; background: white; padding: 12px 16px; box-shadow: var(--shadow); }
.toast-success { border-left-color: var(--success); }
.toast-error { border-left-color: var(--danger); }
@media (max-width: 1100px) {
  .topbar { grid-template-columns: auto auto; }
  .primary-nav { grid-column: 1 / -1; grid-row: 2; }
  .top-actions { justify-self: end; }
  :root { --header-height: 126px; }
  .metrics-grid { grid-template-columns: repeat(3, 1fr); }
  .today-layout { grid-template-columns: 1fr; }
  .stage-overview { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
}
@media (max-width: 760px) {
  .topbar { grid-template-columns: 1fr auto; gap: 8px; padding: 10px 14px; }
  .mobile-nav-toggle { min-height: 44px; display: block; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); padding: 8px 12px; }
  .primary-nav { display: none; grid-column: 1 / -1; flex-wrap: wrap; }
  .primary-nav.is-open { display: flex; }
  .primary-nav button { flex: 1 0 44%; }
  .top-actions { grid-column: 1 / -1; flex-wrap: wrap; justify-content: center; justify-self: stretch; }
  .top-actions .text-button { flex: 0 0 auto; min-height: 40px; }
  :root { --header-height: 166px; }
  main { padding: 26px 16px 120px; }
  .page-heading, .welcome-view, .completion-view { grid-template-columns: 1fr; gap: 30px; }
  .page-heading { align-items: start; }
  .welcome-view { min-height: auto; }
  .welcome-copy h1, .completion-copy h1 { font-size: clamp(3rem, 15vw, 5.5rem); }
  .metrics-grid { grid-template-columns: 1fr; }
  .metric { min-height: 120px; padding: 18px 14px; }
  .split-workspace { grid-template-columns: 1fr; }
  .list-panel, .detail-panel { min-height: auto; }
  .thread-list, .prospect-list { max-height: 440px; }
  .detail-panel { padding: 20px 16px; }
  .stage-overview { grid-template-columns: 1fr; }
  .detail-grid, .edit-grid, .scenario-chooser, .action-sequence, .conversation-brief, .result-grid, .tour-content { grid-template-columns: 1fr; }
  .linked-company { align-items: stretch; }
  .linked-company .button { width: 100%; }
  .prospect-header-actions { align-items: flex-start; flex-direction: column-reverse; }
  .action-step { min-height: 70px; }
  .disclosure-bar { position: static; flex-direction: column; align-items: flex-start; gap: 3px; }
  .app-shell { padding-bottom: 0; }
  .tour-guide { position: relative; top: auto; margin-bottom: 20px; }
  .tour-guide .button { width: 100%; min-width: 0; }
  .priority-item { grid-template-columns: 44px minmax(0, 1fr); }
  .priority-item .value { grid-column: 2; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; }
}
