:root {
  --ink: #202124;
  --muted: #687078;
  --line: #d9dde1;
  --soft: #f6f7f8;
  --paper: #fff;
  --canvas: #eef1f3;
  --blue: #315f9d;
  --blue-soft: #e8f0fa;
  --teal: #17735a;
  --teal-soft: #e3f4ed;
  --amber: #8a5c00;
  --amber-soft: #fff4d7;
  --red: #9c3838;
  --red-soft: #fcecec;
  --purple: #6352a4;
  --purple-soft: #f0ecff;
  --gray-soft: #eef0f2;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--canvas); color: var(--ink); font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.4; }
a { color: inherit; text-decoration: none; }

.app { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.sidebar { padding: 14px 12px; background: #1e2936; color: #edf3f8; }
.brand { padding: 7px 10px 12px; border-bottom: 1px solid rgba(255,255,255,.16); }
.brand strong { display: block; font-size: 1rem; letter-spacing: -.01em; }
.brand span { display: none; }
.nav-title { margin: 14px 10px 5px; color: #aebcc7; font-size: .67rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.nav-divider { height: 0; margin: 10px 10px; border: 0; border-top: 1px solid rgba(255,255,255,.16); }
.nav-link { display: block; margin: 1px 0; padding: 6px 10px; border-radius: 7px; color: #dce6ed; font-size: .83rem; }
.nav-link:hover, .nav-link.active { background: #344559; color: #fff; }
.nav-link.active { box-shadow: inset 3px 0 0 #8ec2ff; }
.sidebar-note { display: none; }

.content { min-width: 0; padding: 22px; }
.view-bar { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.eyebrow { margin: 0 0 5px; color: var(--muted); font-size: .71rem; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(1.55rem, 3vw, 2.2rem); line-height: 1.08; letter-spacing: -.03em; }
.subtitle { max-width: 760px; margin: 8px 0 0; color: var(--muted); font-size: .92rem; }
.view-definition { max-width: 860px; margin: 0 0 12px; color: #4e5962; font-size: .9rem; }
.view-state { display: none; }
.global-provenance { padding: 5px 22px; background: var(--blue); color: #fff; font-size: .72rem; font-weight: 700; letter-spacing: .02em; }
.case-study-return { padding: 7px 22px; border-bottom: 1px solid var(--line); background: var(--paper); color: #52606d; font-size: .76rem; font-weight: 750; }
.case-study-return a { display: inline-flex; align-items: center; gap: 5px; text-decoration: none; }
.case-study-return a:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 2px; }
.view-bar .eyebrow, .view-bar .subtitle { display: none; }
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 12px; padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.control { padding: 6px 9px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #4e5962; font-size: .78rem; }
.control.search { display: none; }
.control.active { border-color: #9ebee6; background: var(--blue-soft); color: #244e83; }
.toolbar-note { margin-left: auto; color: var(--muted); font-size: .76rem; }
.surface { border: 1px solid var(--line); border-radius: 9px; background: var(--paper); overflow: hidden; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .8rem; }
th, td { padding: 10px 9px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
th.row-index, td.row-index { width: 42px; min-width: 42px; padding-right: 5px; padding-left: 8px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }
.touchpoint-inventory th.row-index, .touchpoint-inventory td.row-index { width: 64px; min-width: 64px; text-align: left; }
.touchpoint-id-table th.row-index, .touchpoint-id-table td.row-index { width: 64px; min-width: 64px; text-align: left; }
.touchpoint-inventory th:nth-child(8), .touchpoint-inventory td:nth-child(8) { display: none; }
.field-glossary-view table { table-layout: fixed; }
.field-glossary-view th.row-index, .field-glossary-view td.row-index { width: 4%; min-width: 0; max-width: none; padding-right: 5px; padding-left: 5px; white-space: nowrap; }
.field-glossary-view th:nth-child(2) { width: 16%; }
.field-glossary-view th:nth-child(3) { width: 24%; }
.field-glossary-view th:nth-child(4) { width: 10%; }
.field-glossary-view th:nth-child(5), .field-glossary-view th:nth-child(6) { width: 23%; }
.field-glossary-view .pill { margin: 2px 4px 2px 0; }
th { position: sticky; top: 0; z-index: 1; background: #f7f8f9; color: #5d6871; font-size: .67rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
td { color: #525c65; }
td strong { color: var(--ink); font-weight: 680; }
tr:last-child td { border-bottom: 0; }
.subline { display: block; margin-top: 2px; color: var(--muted); font-size: .72rem; }
.pill { display: inline-block; padding: 3px 7px; border-radius: 999px; font-size: .68rem; font-weight: 780; letter-spacing: .035em; text-transform: uppercase; white-space: nowrap; }
.tag { background: var(--gray-soft); color: #5c6670; }
.funded { background: var(--teal-soft); color: var(--teal); }
.baseline { background: var(--blue-soft); color: #214f87; }
.essential { background: var(--amber-soft); color: var(--amber); }
.risk { background: var(--red-soft); color: var(--red); }
.ready { background: var(--teal-soft); color: var(--teal); }
.draft { background: #f0ecff; color: #5d4aa1; }
.dot, .dot.on { display: none; }
.signal-line { display: block; margin: 2px 0; white-space: nowrap; }
.ai-icon { display: inline-grid; place-items: center; width: 15px; height: 15px; margin-left: 3px; border-radius: 50%; background: var(--purple-soft); color: var(--purple); font-size: .68rem; font-weight: 800; line-height: 1; vertical-align: -1px; }
.ai-inline { color: var(--purple); font-weight: inherit; }
.historical-view .ai-inline { color: inherit; }
.touchpoint-inventory td:nth-child(6) .ai-inline { font-weight: 720; }
.info { margin-top: 12px; padding: 11px 13px; border-left: 3px solid var(--blue); background: var(--blue-soft); color: #3a4c60; font-size: .81rem; }
.info strong { color: #244e83; }

.board { display: grid; grid-template-columns: repeat(4, minmax(230px, 1fr)); gap: 12px; overflow-x: auto; }
.board-col { min-width: 230px; padding: 11px; border: 1px solid var(--line); border-radius: 8px; background: #f7f8f9; }
.board-head { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 10px; color: #42505b; font-size: .79rem; font-weight: 760; }
.count { padding: 1px 7px; border-radius: 999px; background: #e2e6e9; color: #5d6871; font-size: .68rem; }
.work-card { margin-top: 9px; padding: 11px; border: 1px solid var(--line); border-radius: 7px; background: var(--paper); }
.work-card h3 { margin: 0 0 5px; font-size: .86rem; line-height: 1.25; }
.row-number { display: inline-block; min-width: 48px; margin-right: 5px; color: var(--muted); font-size: .68rem; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: .04em; }
.work-card p { margin: 0; color: var(--muted); font-size: .75rem; }
.work-card .pill { margin-top: 9px; }

.timeline { display: grid; grid-template-columns: 220px repeat(5, minmax(128px, 1fr)); min-width: 980px; }
.roadmap-table { margin-top: 14px; }
.roadmap-table-title { padding: 14px 16px 4px; }
.roadmap-table-title h2 { margin: 0; font-size: .98rem; }
.roadmap-table-title p { margin: 3px 0 0; color: var(--muted); font-size: .78rem; }
.timeline > div { min-height: 48px; padding: 9px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .76rem; }
.timeline .head { background: #f7f8f9; color: #5d6871; font-size: .67rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.timeline .label { color: var(--ink); font-weight: 680; }
.timeline .lane-heading { grid-column: 1 / -1; min-height: 0; padding: 8px 10px; background: var(--soft); color: var(--ink); font-size: .75rem; }
.timeline .lane-heading span { margin-left: 8px; color: var(--muted); font-weight: 500; }
.timeline .cluster-heading { grid-column: 1 / -1; min-height: 0; padding: 6px 10px; background: #fafbfc; color: var(--muted); font-size: .68rem; font-weight: 780; letter-spacing: .045em; text-transform: uppercase; }
.bar { display: block; min-height: 22px; margin: 3px 0; border-radius: 4px; background: var(--blue-soft); color: #244e83; font-size: .68rem; line-height: 1.25; padding: 4px 6px; white-space: normal; overflow-wrap: anywhere; }
.bar.baseline-bar { background: var(--gray-soft); color: #59636c; }
.bar.critical { background: var(--red-soft); color: var(--red); }
.bar.training { background: var(--teal-soft); color: var(--teal); }
.bar.funded-bar { background: var(--teal-soft); color: var(--teal); }
.bar.assessment-bar { background: var(--blue-soft); color: #244e83; }
.bar.recurring-bar { background: var(--gray-soft); color: #59636c; }
.bar.planning-bar { border: 1px dashed #89939d; background: #fff; color: #59636c; }

.service-blueprint { display: grid; grid-template-columns: 190px repeat(5, minmax(150px, 1fr)); min-width: 980px; }
.service-blueprint-surface { margin-top: 14px; }
.service-blueprint > div { min-height: 72px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); font-size: .76rem; }
.service-blueprint .bp-head { min-height: 48px; background: #f7f8f9; color: #5d6871; font-size: .67rem; font-weight: 800; letter-spacing: .055em; text-transform: uppercase; }
.service-blueprint .bp-layer { background: #fafbfc; color: var(--ink); font-weight: 720; }
.service-blueprint .bp-cell { color: var(--muted); }
.service-blueprint .bp-divider { grid-column: 1 / -1; min-height: 0; padding: 6px 10px; background: var(--blue-soft); border-right: 0; color: #244e83; font-size: .68rem; font-weight: 800; letter-spacing: .045em; text-transform: uppercase; }

.cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; }
.metric { padding: 15px; border: 1px solid var(--line); border-radius: 8px; background: var(--paper); }
.metric strong { display: block; margin: 3px 0 6px; color: var(--ink); font-size: 1.65rem; letter-spacing: -.04em; line-height: 1; }
.metric span { color: var(--muted); font-size: .76rem; }
.split { display: grid; grid-template-columns: 1.2fr .8fr; gap: 14px; }
.mini-list { margin: 0; padding: 0; list-style: none; }
.mini-list li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); color: #4d5962; font-size: .8rem; }
.mini-list li:last-child { border-bottom: 0; }
.mini-list strong { color: var(--ink); }
.mini-list .pill { flex: 0 0 auto; align-self: center; }

.glossary-table td:first-child { min-width: 185px; color: var(--ink); font-weight: 650; }
.glossary-table td:nth-child(2) { min-width: 135px; }
.glossary-table td:nth-child(3) { min-width: 180px; }
.field-kind { color: var(--muted); font-size: .72rem; }

.record-layout { max-width: 1080px; }
.record-hero { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; margin-bottom: 14px; padding: 18px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.record-hero h2 { margin: 0; color: var(--ink); font-size: 1.25rem; letter-spacing: -.02em; }
.record-hero p { margin: 4px 0 0; color: var(--muted); font-size: .8rem; }
.record-meta { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; }
.record-sections { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.record-section { padding: 16px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); }
.record-section.wide { grid-column: 1 / -1; }
.record-section h2 { margin: 0 0 11px; color: var(--ink); font-size: .94rem; }
.field-row { display: grid; grid-template-columns: minmax(125px, .8fr) minmax(0, 1.5fr); gap: 12px; padding: 9px 0; border-top: 1px solid var(--line); }
.field-row:first-of-type { padding-top: 0; border-top: 0; }
.field-label { color: var(--muted); font-size: .74rem; }
.field-value { color: #43505a; font-size: .82rem; }
.field-value .pill { margin: 0 4px 4px 0; }
.comment { padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fff; }
.comment-meta { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .74rem; }
.comment-meta strong { color: var(--ink); }
.comment p { margin: 7px 0 0; color: #43505a; font-size: .82rem; line-height: 1.45; }
.empty { color: var(--muted); font-style: italic; }
.check { color: var(--teal); font-weight: 700; }
.input-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.input-field { display: grid; gap: 5px; }
.intake-name-field { margin-top: 8px; }
.input-field.full { grid-column: 1 / -1; }
.input-field label { color: #4e5962; font-size: .78rem; font-weight: 700; }
.required { color: var(--red); }
.input-field input, .input-field select, .input-field textarea { width: 100%; padding: 9px 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #4e5962; font: inherit; font-size: .82rem; }
.input-field select[multiple] { min-height: 92px; }
.input-field textarea { min-height: 88px; resize: vertical; }
.check-list { display: flex; flex-wrap: wrap; gap: 8px 12px; padding: 9px 10px; border: 1px solid var(--line); border-radius: 5px; background: #fff; color: #4e5962; font-size: .82rem; }
.check-list label { display: inline-flex; align-items: center; gap: 5px; color: inherit; font-size: inherit; font-weight: 400; }
.check-list input { width: auto; margin: 0; }
.intake-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; padding-top: 14px; border-top: 1px solid var(--line); }
.button { display: inline-block; padding: 8px 12px; border: 0; border-radius: 5px; background: var(--blue); color: #fff; font-size: .8rem; font-weight: 700; }
.record-link { color: var(--blue); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.record-link:hover { color: #214f87; }
.record-modal { width: min(980px, calc(100% - 32px)); max-height: calc(100vh - 32px); padding: 0; overflow: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); color: var(--ink); box-shadow: 0 18px 60px rgba(23, 34, 44, .24); }
.record-modal::backdrop { background: rgba(20, 32, 44, .48); }
.modal-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 16px 18px; border-bottom: 1px solid var(--line); background: var(--paper); }
.modal-head h2 { margin: 0; font-size: 1.08rem; }
.modal-head p { margin: 4px 0 0; color: var(--muted); font-size: .78rem; }
.modal-close { padding: 5px 9px; border: 1px solid var(--line); border-radius: 5px; background: var(--paper); color: #4e5962; font: inherit; font-size: .76rem; }
.modal-body { padding: 16px; }
.modal-body .record-sections { grid-template-columns: repeat(2, minmax(0, 1fr)); }

@media (max-width: 700px) { .record-hero { display: block; } .record-meta { justify-content: flex-start; margin-top: 12px; } .record-sections, .modal-body .record-sections, .input-grid { grid-template-columns: 1fr; } .field-row { grid-template-columns: 1fr; gap: 3px; } }

@media (max-width: 900px) { .app { grid-template-columns: 1fr; } .sidebar { padding: 12px; } .sidebar nav { display: flex; gap: 5px; overflow-x: auto; } .nav-title, .nav-divider, .brand span, .sidebar-note { display: none; } .brand { padding: 0 0 9px; } .nav-link { white-space: nowrap; } .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); } .split { grid-template-columns: 1fr; } }
@media (max-width: 560px) { .content { padding: 14px; } .view-bar { align-items: flex-start; flex-direction: column; } .toolbar-note { margin-left: 0; } .cards { grid-template-columns: 1fr; } }
