:root {
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #192f43;
  background: #f1f5f9;
  line-height: 1.55;
  font-synthesis: none;
  --navy: #132333;
  --ink: #192f43;
  --muted: #536879;
  --line: #d6e0e9;
  --blue: #315de9;
  --teal: #137b73;
}
* { box-sizing: border-box; }
body { margin: 0; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
button { cursor: pointer; }
button:disabled { cursor: default; opacity: .6; }
a { color: #2855cc; text-underline-offset: 4px; }
button, a, input, select, textarea, summary { outline-offset: 4px; }
:focus-visible { outline: 3px solid #0d827b; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.8rem, 2.7vw, 2.5rem); line-height: 1.15; letter-spacing: -.055em; font-weight: 650; overflow-wrap: anywhere; }
h2 { font-size: 1.08rem; line-height: 1.35; letter-spacing: -.02em; }
h3 { font-size: .95rem; line-height: 1.4; }
button, input, select, textarea, a { max-width: 100%; }
button, a, p, h2, h3, dd, small, strong { overflow-wrap: anywhere; }
[hidden] { display: none !important; }
.skip { position: fixed; top: 8px; left: 8px; z-index: 40; padding: 14px; background: white; transform: translateY(-180%); border-radius: 8px; }
.skip:focus { transform: none; }
.shell { display: grid; grid-template-columns: 224px minmax(0, 1fr); min-height: 100dvh; }
.sidebar { position: sticky; top: 0; height: 100dvh; overflow: auto; background: var(--navy); color: #edf4fa; padding: 27px 18px 20px; display: flex; flex-direction: column; }
.brand { min-height: 44px; display: flex; align-items: center; gap: 12px; padding: 0 12px; font-size: 2.1rem; color: white; text-decoration: none; letter-spacing: -.065em; font-weight: 650; }
.brand-mark { display: flex; align-items: center; gap: 4px; height: 28px; transform: skewY(-15deg); }
.brand-mark i { display: block; width: 6px; height: 18px; background: #c3edb0; border-radius: 2px; }
.brand-mark i:nth-child(2) { height: 27px; }
.brand-mark i:nth-child(3) { height: 22px; }
.workspace-label { display: flex; align-items: flex-start; gap: 10px; padding: 0 8px; margin: 28px 0 25px; font-size: .78rem; }
.workspace-label strong { font-size: .8rem; font-weight: 550; display: block; }
.workspace-label small { display: block; color: #a9bdce; font-size: .73rem; margin-top: 4px; }
.workspace-monogram { border: 1px solid #6b8295; flex-shrink: 0; border-radius: 8px; height: 33px; width: 33px; display: grid; place-items: center; font-size: .75rem; }
.sidebar nav { display: grid; gap: 3px; }
.sidebar nav a { min-height: 44px; padding: 11px 13px; color: #c4d3e1; font-size: .8rem; text-decoration: none; border-radius: 7px; display: flex; align-items: center; }
.sidebar nav a:hover { background: #243c50; color: #fff; }
.sidebar nav a[aria-current=page] { background: #2b4358; color: #fff; box-shadow: inset 3px 0 #c3edb0; }
.sidebar-boundary { margin-top: auto; padding: 33px 8px 0; font-size: .73rem; }
.sidebar-boundary strong { color: #e0eaf3; font-weight: 550; }
.sidebar-boundary p { color: #adbfce; font-size: .73rem; margin-top: 8px; line-height: 1.7; }
.sidebar-button { margin-top: 14px; min-height: 44px; border: 1px solid #6a8192; color: #eaf1f7; background: transparent; border-radius: 7px; padding: 10px; font-size: .73rem; width: 100%; }
.sidebar-button:hover { background: #2b4358; }
.workspace { min-width: 0; }
.topbar { min-height: 64px; display: flex; justify-content: space-between; align-items: center; gap: 20px; background: white; border-bottom: 1px solid var(--line); padding: 16px 34px; }
.topbar span { font-size: .7rem; font-weight: 650; letter-spacing: .12em; color: var(--muted); }
.topbar strong { font-size: .71rem; color: #265d55; background: #e9f5f0; border: 1px solid #c6e3d9; border-radius: 5px; padding: 6px 9px; font-weight: 500; }
.storage-banner { font-size: .75rem; line-height: 1.6; padding: 12px 34px; color: #305647; background: #edf7f0; border-bottom: 1px solid #cee4d5; }
.storage-banner.storage-warning { background: #e8f2fa; color: #264b67; border-color: #b6d0e3; }
main { max-width: 1530px; margin: auto; padding: 32px 34px 20px; min-width: 0; outline: none; }
#screen { display: grid; gap: 22px; min-width: 0; }
.page-heading { display: flex; gap: 22px; justify-content: space-between; align-items: flex-start; margin-bottom: 3px; }
.page-heading > div:first-child { max-width: 740px; min-width: 0; }
.eyebrow { font-size: .69rem; color: var(--muted); letter-spacing: .1em; font-weight: 650; margin-bottom: 10px; }
.muted { color: var(--muted); font-size: .8rem; line-height: 1.75; }
.page-heading .muted { margin-top: 12px; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.page-heading > .actions { justify-content: flex-end; padding-top: 21px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; border-radius: 7px; padding: 11px 15px; line-height: 1.4; font-size: .78rem; font-weight: 600; text-decoration: none; border: 1px solid transparent; text-align: center; }
.primary { color: #fff; background: var(--blue); border-color: #244bd1; }
.primary:hover { background: #244dce; }
.secondary { background: white; color: #29435c; border-color: #b9c9d7; }
.secondary:hover { background: #e9f0f7; }
.text-link, .back-link { display: inline-flex; align-items: center; min-height: 44px; font-size: .78rem; font-weight: 550; }
.back-link { justify-self: start; }
.panel { background: white; border: 1px solid var(--line); border-radius: 13px; padding: 23px; min-width: 0; }
.panel > h2 { margin-bottom: 9px; }
.panel > .muted { margin-bottom: 15px; }
.panel > .actions { margin: 16px 0; }
.metrics { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 13px; }
.metric { background: white; border: 1px solid var(--line); padding: 20px; border-radius: 13px; min-width: 0; }
.metric h2 { font-size: .76rem; color: var(--muted); font-weight: 550; }
.metric strong { display: block; font-size: clamp(1.4rem, 2vw, 2rem); font-weight: 600; font-variant-numeric: tabular-nums; letter-spacing: -.04em; margin: 15px 0 6px; line-height: 1.2; }
.metric .muted { font-size: .73rem; }
.two-columns { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.empty-state { background: #fff; border: 1px dashed #bdcedf; border-radius: 12px; padding: 32px 26px; min-width: 0; }
.empty-state h2 { font-size: 1.25rem; margin-bottom: 10px; }
.empty-state .muted { max-width: 650px; }
.empty-state .actions { margin-top: 20px; }
.empty-mark { display: grid; place-items: center; color: #4a73cc; background: #edf2ff; width: 40px; height: 40px; border: 1px solid #c6d5f1; border-radius: 10px; font-size: 1.4rem; margin-bottom: 18px; }
.due-row { display: grid; grid-template-columns: minmax(100px, .7fr) minmax(0, 1.4fr); gap: 8px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid #e3eaf1; font-size: .8rem; }
.due-row a { min-height: 44px; align-content: center; font-weight: 550; }
.due-row small { grid-column: 2; color: var(--muted); font-size: .73rem; }
.date-chip { font-variant-numeric: tabular-nums; font-size: .75rem; color: #4d6378; }
.stage-chart { display: grid; gap: 18px; padding: 18px 0; }
.stage-row { display: grid; grid-template-columns: minmax(75px, .65fr) minmax(0, 1.5fr) 25px; align-items: center; gap: 13px; font-size: .76rem; }
.stage-row strong { text-align: right; font-variant-numeric: tabular-nums; }
.stage-track { background: #eef2f8; height: 10px; border-radius: 3px; overflow: hidden; }
.stage-fill { display: block; min-height: 10px; background: #5879df; border-radius: 3px; }
.stage-fill.won { background: #2d978a; }
.stage-fill.lost { background: #8693a4; }
.stage-fill.proposal { background: #7896b5; }
.record-list { display: grid; gap: 12px; margin-top: 17px; }
.record-card { border: 1px solid #dae3ed; border-radius: 9px; padding: 15px 17px; background: #fff; min-width: 0; }
.record-card .muted { font-size: .75rem; margin-top: 5px; }
.record-top { display: flex; justify-content: space-between; align-items: start; gap: 12px; flex-wrap: wrap; }
.record-title { min-height: 44px; display: inline-flex; align-items: center; color: #1e3a55; font-weight: 600; font-size: .85rem; text-decoration-color: #b6c5d7; }
.record-title:hover { color: #2855cc; }
.badge { display: inline-flex; align-items: center; gap: 6px; border: 1px solid #d3deea; border-radius: 4px; font-size: .7rem; padding: 4px 7px; color: #445f7c; background: #edf2f8; line-height: 1.5; }
.badge.won, .badge.done, .badge.complete { color: #1a6c5b; border-color: #c2e1d3; background: #e8f5ed; }
.badge.active, .badge.doing, .badge.qualified { color: #315bc5; border-color: #d4dfff; background: #edf2ff; }
.badge.proposal, .badge.high { color: #285e70; background: #eaf4f7; border-color: #c5dde5; }
.badge.lost, .badge.archived { color: #536271; background: #edf0f3; }
.record-card > .badge { margin-top: 10px; }
.filters { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); align-items: end; gap: 15px; }
.field { display: grid; gap: 7px; min-width: 0; align-content: start; }
.field label { font-size: .78rem; font-weight: 550; color: #263f55; }
.field input, .field select, .field textarea { width: 100%; min-width: 0; min-height: 44px; padding: 11px 12px; border: 1px solid #adbfce; border-radius: 6px; background: white; color: #1d3449; font-size: .85rem; line-height: 1.5; }
.field input[type=file] { font-size: .75rem; padding: 8px; }
.field input[type=file]::file-selector-button { border: 1px solid #adbfce; background: #eef2f7; color: var(--ink); border-radius: 4px; padding: 8px; min-height: 44px; margin-right: 10px; font: inherit; }
.field input:disabled, .field select:disabled { color: #4d6073; background: #edf2f6; opacity: 1; }
.field textarea { resize: vertical; min-height: 130px; }
.field > small { color: var(--muted); font-size: .73rem; line-height: 1.65; }
.field > small:empty { display: none; }
.field [aria-invalid=true] { border: 2px solid #a33129; }
.field-error, .form-error { color: #a33129; font-size: .8rem; line-height: 1.7; }
.field-error:empty, .form-error:empty { display: none; }
.form-error { padding: 12px; background: #fff1ed; border-radius: 6px; }
.result-count { font-size: .75rem; color: var(--muted); margin-top: 16px; }
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.pipeline-board { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.board-column { background: #e7edf4; padding: 13px; border: 1px solid #d4deea; border-radius: 10px; min-width: 0; }
.board-column > h2 { font-size: .8rem; letter-spacing: .01em; padding: 3px 3px 0; }
.board-column .record-card { padding: 10px 12px; }
.board-column .record-title { font-size: .78rem; }
.board-column .record-top { display: block; }
.board-column .badge { margin-top: 7px; }
.board-column .record-list { margin-top: 13px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0; border: 1px solid var(--line); border-radius: 11px; background: white; min-width: 0; }
.fact { padding: 18px; border-right: 1px solid var(--line); min-width: 0; }
.fact:last-child { border-right: 0; }
.fact dt { font-size: .73rem; color: var(--muted); }
.fact dd { margin: 7px 0 0; font-size: .85rem; font-weight: 550; }
.prose { white-space: pre-wrap; overflow-wrap: anywhere; color: #405b73; font-size: .85rem; line-height: 1.9; }
.panel > .prose { margin-top: 13px; }
.subnav { display: flex; flex-wrap: wrap; gap: 8px; padding: 8px; background: #e4ebf3; border-radius: 8px; }
.subnav a { min-height: 44px; padding: 10px 14px; border-radius: 6px; font-size: .78rem; text-decoration: none; color: #405b73; align-content: center; }
.subnav a[aria-current=page] { background: #fff; color: #244db8; box-shadow: 0 1px 4px #19364d13; font-weight: 600; }
.editor-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 21px; max-width: 940px; }
.editor-form > .field:has(textarea), .editor-form > .actions, .editor-form > .muted, .editor-form > .form-error, .editor-form > h2, .editor-form > .button { grid-column: 1 / -1; }
.editor-form > .button { justify-self: start; }
.activity-list { list-style: none; margin: 15px 0 0; padding: 0; }
.activity-list li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 20px; padding: 16px 0; border-bottom: 1px solid #e2eaf2; font-size: .8rem; }
.activity-list li:last-child { border: 0; }
.activity-list time { color: var(--muted); font-size: .73rem; }
.activity-list .text-link { font-size: .73rem; }
.calendar-date { margin: 25px 0 7px; padding-bottom: 8px; border-bottom: 1px solid var(--line); color: #405b73; }
.report-title { margin: 20px 0 15px; font-size: 1.5rem; }
.print-sheet > .facts { margin: 20px 0; }
.print-sheet > h3 { margin-top: 25px; }
.report-record { padding: 17px 0; border-bottom: 1px solid var(--line); font-size: .85rem; }
.report-record .muted { margin: 5px 0; }
.panel > .field { margin-top: 23px; max-width: 750px; }
.storage-good { color: #19694f; font-size: .8rem; }
.app-footer { font-size: .73rem; line-height: 1.8; color: var(--muted); padding: 15px 34px 28px; max-width: 1530px; margin: auto; }
.notice { margin-bottom: 18px; padding: 14px 19px; border: 1px solid #bcd8d9; border-radius: 8px; color: #214e54; background: #e8f5f4; font-size: .8rem; line-height: 1.7; }
.notice:empty { display: none; }
.no-script { padding: 25px; background: white; border: 1px solid #bdd0e5; border-radius: 10px; }
.no-script p { margin-top: 15px; font-size: .9rem; line-height: 1.8; color: var(--muted); }
dialog { border: 1px solid var(--line); border-radius: 14px; padding: 26px; width: min(560px, calc(100% - 28px)); background: white; color: var(--ink); }
dialog::backdrop { background: #122d47aa; }
dialog p { margin: 14px 0 24px; font-size: .85rem; color: var(--muted); }
body[data-density=compact] .record-card { padding-block: 9px; }
body[data-density=compact] .panel { padding: 18px; }
body[data-density=compact] .record-list { gap: 8px; }
#navigation-toggle { display: none; }
@media (max-width: 1250px) {
  .pipeline-board { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .page-heading { flex-wrap: wrap; }
  .page-heading > .actions { justify-content: flex-start; padding-top: 0; }
}
@media (max-width: 950px) {
  .shell { grid-template-columns: 190px minmax(0, 1fr); }
  .sidebar { padding-inline: 13px; }
  main { padding: 28px 24px 20px; }
  .topbar, .storage-banner { padding-inline: 24px; }
  .topbar { flex-wrap: wrap; gap: 10px; }
  .two-columns { grid-template-columns: 1fr; }
  .filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline-board, .board { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact { border-bottom: 1px solid var(--line); }
  .fact:nth-child(even) { border-right: 0; }
}
@media (max-width: 750px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; padding: 13px 20px; display: grid; grid-template-columns: 1fr auto; gap: 12px; align-items: center; overflow: visible; }
  .brand { font-size: 1.9rem; padding: 0; }
  .workspace-label, .sidebar-boundary { display: none; }
  .sidebar nav { grid-column: 1 / -1; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sidebar nav a { font-size: .8rem; }
  body.app-ready #navigation-toggle { display: block; min-height: 44px; min-width: 64px; border: 1px solid #6f8293; color: white; background: #274054; border-radius: 7px; padding: 10px 13px; font-size: .8rem; }
  body.app-ready .sidebar nav { display: none; }
  body.app-ready.menu-open .sidebar nav { display: grid; }
  .topbar { min-height: auto; padding: 15px 20px; }
  .topbar span, .topbar strong { font-size: .69rem; }
  .storage-banner { padding: 12px 20px; font-size: .73rem; }
  main { padding: 26px 20px 18px; }
  #screen { gap: 18px; }
  .page-heading { display: block; }
  .page-heading > .actions { margin-top: 21px; }
  .page-heading .muted { font-size: .8rem; }
  .panel { padding: 19px; }
  .metrics { gap: 10px; }
  .metric { padding: 16px; }
  .metric strong { font-size: 1.55rem; }
  .metric .muted { font-size: .73rem; }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .fact { padding: 14px; }
  .fact dd { font-size: .8rem; }
  .editor-form { grid-template-columns: 1fr; gap: 19px; }
  .editor-form > * { grid-column: 1 / -1; }
  .board, .pipeline-board { grid-template-columns: 1fr; }
  .activity-list li { grid-template-columns: 1fr; gap: 8px; }
  .app-footer { padding: 15px 20px 27px; }
  .empty-state { padding: 25px 20px; }
}
@media (max-width: 420px) {
  .filters { grid-template-columns: 1fr; }
  .actions > .button { flex: 1 1 auto; }
  .due-row { grid-template-columns: 1fr; gap: 3px; }
  .due-row small { grid-column: 1; }
  .stage-row { grid-template-columns: 75px minmax(0, 1fr) 20px; gap: 9px; }
  .metrics { grid-template-columns: 1fr; }
  .metric strong { font-size: 1.7rem; }
  .facts { grid-template-columns: 1fr; }
  .fact { border-right: 0; }
  .fact:last-child { border-bottom: 0; }
  .panel { padding: 17px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}
@media print {
  @page { margin: 16mm; }
  .sidebar, .topbar, .storage-banner, .app-footer, .notice, .skip, .page-heading, .back-link, .subnav, .actions, #screen > :not(.print-sheet):not(.report-output), .print-sheet .button { display: none !important; }
  .shell { display: block; }
  main { padding: 0; max-width: none; }
  body { color: #000; background: #fff; }
  #screen { display: block; }
  .print-sheet { display: block !important; border: 0; padding: 0; }
  .print-sheet p, .print-sheet dd, .print-sheet dt, .print-sheet .muted { color: #000; }
  .report-record, .facts { break-inside: avoid; }
}

@media print { .report-output { display: block !important; } }

.pager { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }

/* The delivery desk keeps relationship context beside the actual handoff plan. */
.delivery-desk { display:grid; grid-template-columns:minmax(220px,.7fr) minmax(0,2fr); gap:22px; align-items:start; }
.delivery-rail { position:sticky; top:20px; background:linear-gradient(145deg,#e3edf5ee,#f7fafdee); border-color:#b8cbdc; box-shadow:0 12px 35px #19354e0a; }
.delivery-rail .field { margin-bottom:26px; }
.delivery-rail hr { border:0; border-top:1px solid #b8cbdc; margin:22px 0; }
.delivery-client { display:block; font-size:1.3rem; line-height:1.4; font-weight:600; min-height:44px; color:#193b59; }
.delivery-work { display:grid; gap:22px; min-width:0; }
.delivery-brief { border-top:4px solid #557d9a; background:linear-gradient(125deg,#fff,#edf4f9); }
.delivery-brief h2 { font-size:1.6rem; }
.delivery-brief > .badge { margin:4px 0 12px; }
.delivery-scope { white-space:pre-wrap; margin:20px 0; font-size:1rem; max-width:65ch; }
.delivery-checkpoint { border-top:1px solid var(--line); padding:24px 0 8px 20px; position:relative; }
.delivery-checkpoint::before { content:''; position:absolute; left:0; top:30px; height:8px; width:8px; border:2px solid #527994; border-radius:50%; }
.checkpoint-heading { display:flex; justify-content:space-between; gap:18px; flex-wrap:wrap; margin-bottom:12px; }
.checkpoint-heading .eyebrow { margin-bottom:5px; }
.checkpoint-heading h3 { font-size:1.1rem; }
.delivery-tasks { list-style:none; padding:0; margin:12px 0; }
.delivery-task { display:flex; justify-content:space-between; gap:14px; align-items:center; border-bottom:1px solid #e0e7ee; padding:12px 0; }
.delivery-task > div:first-child { min-width:0; flex:1; }
.delivery-task .record-title { font-size:.95rem; }
.delivery-task .actions { flex-shrink:0; }
@media(max-width:1100px) { .delivery-desk { grid-template-columns:1fr; } .delivery-rail { position:static; } }
@media(max-width:600px) { .delivery-task { display:block; } .delivery-task .actions { margin-top:12px; } .delivery-checkpoint { padding-left:16px; } .delivery-brief h2 {font-size:1.35rem;} }
