:root {
  --navy-950: #071f25;
  --navy-900: #0a2c33;
  --navy-800: #123c43;
  --green-700: #00684f;
  --green-600: #087f61;
  --green-100: #dff1ea;
  --lime-500: #b5d334;
  --lime-100: #f2f7d8;
  --amber-700: #a46100;
  --amber-100: #fff1cf;
  --red-700: #a43a37;
  --red-100: #f9e4e2;
  --blue-700: #25658a;
  --blue-100: #e4f1f8;
  --ink-900: #17251f;
  --ink-700: #40564c;
  --ink-500: #6c7d75;
  --line: #d8e2dd;
  --line-strong: #bdcec6;
  --surface: #ffffff;
  --surface-soft: #f4f7f5;
  --surface-muted: #e9efec;
  --canvas: #edf2ef;
  --shadow-1: 0 1px 2px rgba(7, 31, 37, .06), 0 8px 24px rgba(7, 31, 37, .04);
  --radius-sm: .375rem;
  --radius-md: .625rem;
  --radius-lg: .875rem;
  --sidebar: 17.5rem;
  --topbar: 4.25rem;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { background: var(--canvas); scroll-behavior: smooth; }
body { margin: 0; min-width: 0; color: var(--ink-900); background: var(--canvas); font-size: .9375rem; line-height: 1.5; }
button, input, select, textarea { font: inherit; }
button, select { cursor: pointer; }
a { color: inherit; }
svg { display: block; }
.visually-hidden { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0 0 0 0) !important; white-space: nowrap !important; border: 0 !important; }

:focus-visible { outline: .1875rem solid var(--lime-500); outline-offset: .1875rem; }
.skip-link { position: fixed; top: .5rem; left: .5rem; z-index: 100; transform: translateY(-160%); padding: .625rem .875rem; border-radius: var(--radius-sm); color: white; background: var(--navy-950); font-weight: 750; }
.skip-link:focus { transform: translateY(0); }

.app-shell { min-height: 100vh; }
.sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: var(--sidebar); display: flex; flex-direction: column; color: white; background: var(--navy-950); border-right: 1px solid rgba(255,255,255,.08); }
.brand { display: flex; align-items: center; gap: .75rem; min-height: var(--topbar); padding: .875rem 1rem; border-bottom: 1px solid rgba(255,255,255,.10); }
.brand-mark { width: 2.25rem; height: 2.25rem; display: grid; place-items: center; border-radius: var(--radius-sm); color: var(--navy-950); background: var(--lime-500); font-size: .75rem; font-weight: 900; letter-spacing: -.03em; }
.brand-copy strong, .brand-copy span { display: block; }
.brand-copy strong { font-size: .875rem; letter-spacing: .01em; }
.brand-copy span { margin-top: .125rem; color: #aac0b7; font-size: .6875rem; }
.sidebar-nav { flex: 1; overflow-y: auto; padding: .75rem; }
.nav-group + .nav-group { margin-top: 1rem; }
.nav-label { margin: 0 0 .375rem; padding: 0 .625rem; color: #7f9b90; font-size: .625rem; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
.nav-link { display: flex; align-items: center; gap: .625rem; min-height: 2.5rem; padding: .5rem .625rem; border-radius: var(--radius-sm); color: #d7e3de; text-decoration: none; font-size: .8125rem; font-weight: 620; }
.nav-link:hover { background: rgba(255,255,255,.07); color: white; }
.nav-link.active { color: white; background: var(--green-700); box-shadow: inset .1875rem 0 0 var(--lime-500); }
.nav-icon { width: 1.25rem; height: 1.25rem; display: grid; place-items: center; color: #91aba1; font-size: .625rem; font-weight: 850; }
.nav-link.active .nav-icon { color: var(--lime-500); }
.sidebar-footer { padding: 1rem; color: #829f94; border-top: 1px solid rgba(255,255,255,.10); font-size: .6875rem; }
.sidebar-footer strong { color: #c8d8d2; }

.app-frame { min-height: 100vh; margin-left: var(--sidebar); }
.topbar { position: sticky; top: 0; z-index: 20; min-height: var(--topbar); display: grid; grid-template-columns: minmax(15rem, 1fr) minmax(14rem, 28rem) auto; align-items: center; gap: 1rem; padding: .625rem 1.5rem; background: rgba(255,255,255,.96); border-bottom: 1px solid var(--line); backdrop-filter: blur(.75rem); }
.program-label span, .program-label strong { display: block; }
.program-label span { color: var(--ink-500); font-size: .625rem; font-weight: 750; letter-spacing: .1em; text-transform: uppercase; }
.program-label strong { margin-top: .125rem; font-size: .8125rem; }
.search-wrap { position: relative; }
.global-search { width: 100%; height: 2.5rem; padding: 0 .875rem 0 2.25rem; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-900); background: var(--surface-soft); }
.global-search:focus { background: white; border-color: var(--green-600); outline: .1875rem solid rgba(181,211,52,.35); }
.search-glyph { position: absolute; left: .75rem; top: .75rem; color: var(--ink-500); pointer-events: none; }
.search-results { position: absolute; top: calc(100% + .375rem); left: 0; right: 0; z-index: 40; max-height: 22rem; overflow-y: auto; padding: .375rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; box-shadow: 0 .75rem 2rem rgba(7,31,37,.16); }
.search-results:empty, .search-results[hidden] { display: none; }
.search-result { display: block; padding: .625rem .75rem; border-radius: var(--radius-sm); text-decoration: none; }
.search-result:hover { background: var(--surface-soft); }
.search-result strong, .search-result small { display: block; }
.search-result small { color: var(--ink-500); }
.top-actions { display: flex; align-items: center; justify-content: flex-end; gap: .5rem; }
.role-select { height: 2.5rem; max-width: 12rem; padding: 0 2rem 0 .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; color: var(--ink-900); font-size: .75rem; font-weight: 700; }
.icon-button { width: 2.5rem; height: 2.5rem; display: inline-grid; place-items: center; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-700); background: white; }
.icon-button:hover { color: var(--green-700); border-color: var(--line-strong); }
.mobile-menu { display: none; }

.page { width: min(100%, 96rem); margin: 0 auto; padding: 1.5rem; }
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; }
.page-kicker { margin: 0 0 .25rem; color: var(--green-700); font-size: .6875rem; font-weight: 850; letter-spacing: .1em; text-transform: uppercase; }
h1, h2, h3, h4, p { margin-top: 0; }
h1 { margin-bottom: .375rem; color: var(--navy-950); font-size: clamp(1.75rem, 3vw, 2.5rem); line-height: 1.08; letter-spacing: -.035em; }
h2 { margin-bottom: .75rem; color: var(--navy-950); font-size: 1.125rem; line-height: 1.25; }
h3 { margin-bottom: .375rem; color: var(--navy-950); font-size: .9375rem; line-height: 1.3; }
.page-description { max-width: 48rem; margin-bottom: 0; color: var(--ink-500); }
.page-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .5rem; }
.button { min-height: 2.5rem; display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .5rem .875rem; border: 1px solid transparent; border-radius: var(--radius-sm); text-decoration: none; font-size: .8125rem; font-weight: 750; }
.button-primary { color: white; background: var(--green-700); }
.button-primary:hover { background: #00553f; }
.button-secondary { color: var(--ink-900); background: white; border-color: var(--line); }
.button-secondary:hover { border-color: var(--green-600); color: var(--green-700); }
.button-quiet { min-height: 2rem; padding: .25rem .5rem; color: var(--green-700); background: transparent; }
.button[disabled] { opacity: .55; cursor: not-allowed; }

.metric-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .75rem; margin-bottom: 1rem; }
.metric { min-height: 7rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; box-shadow: var(--shadow-1); }
.metric-label { color: var(--ink-500); font-size: .625rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.metric-value { display: block; margin: .5rem 0 .125rem; color: var(--navy-950); font-size: 1.625rem; font-weight: 850; letter-spacing: -.04em; }
.metric-detail { color: var(--ink-500); font-size: .6875rem; }
.negative { color: var(--red-700); }
.positive { color: var(--green-700); }

.dashboard-grid { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(19rem, .7fr); gap: 1rem; align-items: start; }
.content-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 1rem; }
.span-12 { grid-column: span 12; }
.span-8 { grid-column: span 8; }
.span-7 { grid-column: span 7; }
.span-6 { grid-column: span 6; }
.span-5 { grid-column: span 5; }
.span-4 { grid-column: span 4; }
.panel { min-width: 0; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; box-shadow: var(--shadow-1); }
.panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; margin-bottom: .875rem; }
.panel-header p { margin: .25rem 0 0; color: var(--ink-500); font-size: .75rem; }
.panel-meta { color: var(--ink-500); font-size: .6875rem; white-space: nowrap; }

.program-map-card { margin-bottom: 1rem; padding: 0; overflow: hidden; }
.map-panel-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; padding: 1rem 1.25rem; border-bottom: 1px solid var(--line); }
.map-panel-header h2 { margin-bottom: .25rem; }
.map-panel-header p { margin: 0; color: var(--ink-500); font-size: .75rem; }
.program-map-frame { height: clamp(24rem, 40vw, 32rem); background: #e3e8e7; }
.program-map { width: 100%; height: 100%; background: #e3e8e7; }
.program-map .leaflet-control-zoom a { color: var(--navy-950); font-family: inherit; font-weight: 800; }
.program-map .leaflet-control-zoom a:focus-visible { outline: .1875rem solid var(--lime-500); outline-offset: -.1875rem; }
.program-map .leaflet-control-attribution { color: var(--ink-500); font-size: .5625rem; }
.program-map .leaflet-control-attribution a { color: var(--green-700); }
.program-site-icon { background: transparent; border: 0; }
.program-site-dot { position: absolute; left: 0; top: 0; width: 1.125rem; height: 1.125rem; border: .1875rem solid white; border-radius: 50%; background: var(--green-600); box-shadow: 0 .125rem .375rem rgba(7,31,37,.35); }
.program-site-dot.at-risk { background: #d38a13; }
.program-site-dot.late { background: var(--red-700); }
.program-site-label { position: absolute; left: 1.35rem; top: -.1rem; width: max-content; max-width: 9.5rem; padding: .1875rem .375rem; border: 1px solid var(--line); border-radius: .25rem; color: var(--navy-950); background: rgba(255,255,255,.96); box-shadow: 0 .0625rem .2rem rgba(7,31,37,.15); font: 750 .6875rem/1.2 Inter, ui-sans-serif, system-ui, sans-serif; white-space: nowrap; }
.program-map .leaflet-marker-icon:focus { outline: none; }
.program-map .leaflet-marker-icon:focus .program-site-dot { outline: .1875rem solid var(--lime-500); outline-offset: .125rem; }
.leaflet-program-legend { display: flex; gap: .625rem; padding: .45rem .625rem; border: 1px solid rgba(255,255,255,.85); border-radius: var(--radius-sm); color: var(--ink-700); background: rgba(255,255,255,.94); box-shadow: var(--shadow-1); font-size: .6875rem; }
.leaflet-program-legend span { display: inline-flex; align-items: center; gap: .3rem; }
.map-fallback { display: grid; min-height: 100%; place-items: center; margin: 0; padding: 2rem; color: var(--ink-500); text-align: center; }
.legend-item { display: inline-flex; align-items: center; gap: .375rem; }
.legend-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--green-600); }
.legend-dot.risk { background: #d38a13; }
.legend-dot.late { background: var(--red-700); }

.quick-links { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-bottom: 1rem; }
.quick-link { min-height: 4.5rem; display: flex; flex-direction: column; justify-content: space-between; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-900); background: white; text-decoration: none; }
.quick-link:hover { border-color: var(--green-600); background: var(--surface-soft); }
.quick-link span { color: var(--green-700); font-size: .625rem; font-weight: 850; letter-spacing: .08em; text-transform: uppercase; }
.quick-link strong { font-size: .8125rem; }

.risk-list, .activity-list, .plain-list { margin: 0; padding: 0; list-style: none; }
.risk-item { padding: .875rem 0; border-top: 1px solid var(--line); }
.risk-item:first-child { padding-top: 0; border-top: 0; }
.risk-item p { margin: .25rem 0 0; color: var(--ink-500); font-size: .75rem; }
.activity-item { display: grid; grid-template-columns: 5.75rem 1fr; gap: .75rem; padding: .75rem 0; border-top: 1px solid var(--line); }
.activity-item:first-child { border-top: 0; }
.activity-item time { color: var(--ink-500); font-size: .6875rem; }
.activity-item p { margin: 0; font-size: .75rem; }

.filter-bar { display: flex; flex-wrap: wrap; align-items: end; gap: .75rem; margin-bottom: 1rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.field { min-width: 10rem; display: grid; gap: .25rem; }
.field.grow { flex: 1; min-width: 14rem; }
.field label { color: var(--ink-500); font-size: .625rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; }
.input, .select { width: 100%; height: 2.5rem; padding: 0 .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); color: var(--ink-900); background: white; }
.input:focus, .select:focus { border-color: var(--green-600); outline: .1875rem solid rgba(181,211,52,.3); }
.result-count { margin-left: auto; padding: .625rem .25rem; color: var(--ink-500); font-size: .75rem; font-weight: 700; }

.site-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.site-card { display: flex; flex-direction: column; min-height: 16rem; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; box-shadow: var(--shadow-1); text-decoration: none; }
.site-card:hover { border-color: var(--green-600); transform: translateY(-1px); }
.card-top { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.site-card h2 { margin: 0; font-size: 1rem; }
.eyebrow { margin: 0 0 .25rem; color: var(--ink-500); font-size: .625rem; font-weight: 750; letter-spacing: .06em; text-transform: uppercase; }
.progress-labels { display: flex; justify-content: space-between; margin: 1rem 0 .375rem; font-size: .6875rem; }
.progress-track { height: .5rem; overflow: hidden; border-radius: 999px; background: var(--surface-muted); }
.progress-fill { height: 100%; border-radius: inherit; background: var(--green-600); }
.site-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin-top: 1rem; padding-top: .875rem; border-top: 1px solid var(--line); }
.site-stat span, .site-stat strong { display: block; }
.site-stat span { color: var(--ink-500); font-size: .625rem; }
.site-stat strong { margin-top: .125rem; font-size: .75rem; }
.site-card .open-label { margin-top: auto; padding-top: .875rem; color: var(--green-700); font-size: .75rem; font-weight: 800; }

.status-pill { display: inline-flex; align-items: center; gap: .375rem; width: fit-content; padding: .25rem .5rem; border-radius: 999px; color: var(--green-700); background: var(--green-100); font-size: .625rem; font-weight: 800; white-space: nowrap; }
.status-pill::before { content: ""; width: .375rem; height: .375rem; border-radius: 50%; background: currentColor; }
.status-pill.at-risk, .status-pill.raised, .status-pill.under-review, .status-pill.review, .status-pill.requested { color: var(--amber-700); background: var(--amber-100); }
.status-pill.late, .status-pill.rejected, .status-pill.high { color: var(--red-700); background: var(--red-100); }
.status-pill.pending, .status-pill.new, .status-pill.submitted { color: var(--blue-700); background: var(--blue-100); }

.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.data-table { width: 100%; border-collapse: collapse; font-size: .75rem; }
.data-table caption { padding: .75rem 1rem; color: var(--ink-700); background: var(--surface-soft); border-bottom: 1px solid var(--line); text-align: left; font-weight: 800; }
.data-table th { padding: .625rem .75rem; color: #dce8e3; background: var(--navy-900); text-align: left; font-size: .625rem; letter-spacing: .06em; text-transform: uppercase; white-space: nowrap; }
.data-table td { padding: .75rem; border-top: 1px solid var(--line); vertical-align: top; }
.data-table tbody tr:first-child td { border-top: 0; }
.data-table tbody tr:hover { background: var(--surface-soft); }
.number { text-align: right !important; white-space: nowrap; }
.muted { color: var(--ink-500); }
.nowrap { white-space: nowrap; }
.row-link { color: var(--green-700); font-weight: 750; text-decoration: none; }
.row-link:hover { text-decoration: underline; }

.split-view { display: grid; grid-template-columns: minmax(18rem, .7fr) minmax(0, 1.3fr); gap: 1rem; align-items: start; }
.record-list { padding: .375rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.record-button { width: 100%; display: grid; grid-template-columns: 1fr auto; gap: .5rem; padding: .75rem; border: 0; border-radius: var(--radius-sm); color: var(--ink-900); background: transparent; text-align: left; }
.record-button { text-decoration: none; }
.record-button + .record-button { margin-top: .125rem; }
.record-button:hover { background: var(--surface-soft); }
.record-button.selected { background: var(--green-100); box-shadow: inset .1875rem 0 0 var(--green-700); }
.record-button strong, .record-button small { display: block; }
.record-button small { margin-top: .125rem; color: var(--ink-500); }
.detail-stack { display: grid; gap: 1rem; }
.detail-hero { padding: 1.25rem; color: white; background: var(--navy-900); border-radius: var(--radius-md); }
.detail-hero .eyebrow { color: #9bb7ac; }
.detail-hero h2 { color: white; font-size: 1.375rem; }
.detail-hero p { margin-bottom: 0; color: #c7d8d1; }
.detail-metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: .5rem; margin-top: 1rem; }
.detail-metric { padding: .625rem; border-radius: var(--radius-sm); background: rgba(255,255,255,.08); }
.detail-metric span, .detail-metric strong { display: block; }
.detail-metric span { color: #9fbbb0; font-size: .625rem; text-transform: uppercase; }
.detail-metric strong { margin-top: .25rem; font-size: .8125rem; }
.obligation { padding: .875rem 0; border-top: 1px solid var(--line); }
.obligation:first-child { border-top: 0; }
.obligation-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; margin-bottom: .375rem; }
.clause { color: var(--green-700); font-weight: 850; }
.confidence { padding: .1875rem .375rem; border-radius: var(--radius-sm); color: var(--blue-700); background: var(--blue-100); font-size: .625rem; font-weight: 800; }
.reviewed { color: var(--green-700); font-size: .625rem; font-weight: 800; }
.obligation p { margin: 0; font-size: .8125rem; }

.tabs { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: 1rem; }
.tab { min-height: 2.25rem; padding: .375rem .75rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-700); background: white; font-size: .75rem; font-weight: 750; }
.tab:hover { border-color: var(--green-600); }
.tab.active { color: white; background: var(--green-700); border-color: var(--green-700); }

.kanban { display: grid; grid-template-columns: repeat(4, minmax(14rem, 1fr)); gap: .75rem; overflow-x: auto; padding-bottom: .5rem; }
.kanban-column { min-width: 14rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.kanban-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: .75rem; }
.kanban-heading h2 { margin: 0; font-size: .8125rem; }
.count-badge { min-width: 1.5rem; height: 1.5rem; display: grid; place-items: center; border-radius: 999px; color: var(--ink-700); background: white; border: 1px solid var(--line); font-size: .6875rem; font-weight: 800; }
.kanban-card { padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; box-shadow: var(--shadow-1); }
.kanban-card + .kanban-card { margin-top: .5rem; }
.kanban-card h3 { margin: .375rem 0; font-size: .8125rem; }
.kanban-card p { margin: 0; color: var(--ink-500); font-size: .6875rem; }

.insight-card { padding: 1rem; border-left: .25rem solid var(--green-600); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: white; box-shadow: var(--shadow-1); }
.insight-card + .insight-card { margin-top: .75rem; }
.insight-card p { color: var(--ink-700); }
.evidence-list { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .75rem; }
.evidence-chip { padding: .25rem .5rem; border-radius: 999px; color: var(--blue-700); background: var(--blue-100); font-size: .625rem; font-weight: 750; }
.chat-shell { display: flex; flex-direction: column; min-height: 31rem; }
.chat-messages { flex: 1; max-height: 28rem; overflow-y: auto; padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.chat-message { max-width: 90%; margin-bottom: .5rem; padding: .75rem; border-radius: var(--radius-md); background: white; font-size: .8125rem; }
.chat-message.user { margin-left: auto; color: white; background: var(--green-700); }
.chat-message p:last-child { margin-bottom: 0; }
.chat-form { display: grid; grid-template-columns: 1fr auto; gap: .5rem; margin-top: .75rem; }
.suggestions { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: .75rem; }
.suggestion { padding: .375rem .625rem; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-700); background: white; font-size: .6875rem; }
.suggestion:hover { border-color: var(--green-600); color: var(--green-700); }

.agent-flow { display: grid; grid-template-columns: repeat(6, 1fr); gap: .5rem; margin-bottom: 1rem; }
.agent-step { position: relative; min-height: 9rem; padding: .75rem; border-radius: var(--radius-md); color: white; background: var(--navy-900); }
.agent-step:not(:last-child)::after { content: "›"; position: absolute; right: -.6rem; top: 50%; z-index: 2; width: 1.25rem; height: 1.25rem; display: grid; place-items: center; transform: translateY(-50%); border-radius: 50%; color: var(--navy-950); background: var(--lime-500); font-weight: 900; }
.agent-step span { color: var(--lime-500); font-size: .625rem; font-weight: 850; }
.agent-step strong { display: block; margin: .75rem 0 .375rem; font-size: .75rem; }
.agent-step p { margin: 0; color: #b9cdc5; font-size: .625rem; }

.option-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: .75rem; }
.option-card { position: relative; padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.option-card.recommended { border: .125rem solid var(--green-600); }
.recommendation-label { position: absolute; top: -.625rem; right: .75rem; padding: .25rem .5rem; border-radius: 999px; color: white; background: var(--green-700); font-size: .625rem; font-weight: 800; }
.option-stats { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin: 1rem 0; }
.option-stat { padding: .625rem; border-radius: var(--radius-sm); background: var(--surface-soft); }
.option-stat span, .option-stat strong { display: block; }
.option-stat span { color: var(--ink-500); font-size: .625rem; }
.option-stat strong { margin-top: .125rem; font-size: .75rem; }

.sync-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: .75rem; }
.sync-card { padding: 1rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.sync-card span, .sync-card strong, .sync-card small { display: block; }
.sync-card span { color: var(--ink-500); font-size: .625rem; font-weight: 800; text-transform: uppercase; }
.sync-card strong { margin: .375rem 0; font-size: 1.5rem; }
.sync-card small { color: var(--green-700); }
.sync-progress { margin-top: 1rem; }
.sync-progress[hidden] { display: none; }
.sync-progress-bar { height: .5rem; overflow: hidden; border-radius: 999px; background: var(--surface-muted); }
.sync-progress-bar span { display: block; width: 0; height: 100%; background: var(--green-600); transition: width .5s ease; }

.empty-state { padding: 3rem 1rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); color: var(--ink-500); background: var(--surface-soft); text-align: center; }
.empty-state strong { display: block; margin-bottom: .375rem; color: var(--ink-900); }
.toast { position: fixed; right: 1rem; bottom: 1rem; z-index: 70; max-width: 22rem; padding: .75rem 1rem; border-radius: var(--radius-md); color: white; background: var(--navy-950); box-shadow: 0 .75rem 2rem rgba(7,31,37,.24); }
.toast[hidden] { display: none; }
.disclosure { padding: .75rem 1rem; border-left: .25rem solid var(--amber-700); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: #604716; background: var(--amber-100); font-size: .75rem; }

@media (max-width: 78rem) {
  .metric-grid { grid-template-columns: repeat(3, 1fr); }
  .site-grid { grid-template-columns: repeat(2, 1fr); }
  .agent-flow { grid-template-columns: repeat(3, 1fr); }
  .agent-step:nth-child(3)::after { display: none; }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 64rem) {
  :root { --sidebar: 15rem; }
  .topbar { grid-template-columns: 1fr minmax(12rem, 20rem) auto; padding-inline: 1rem; }
  .dashboard-grid, .split-view { grid-template-columns: 1fr; }
  .span-8, .span-7, .span-6, .span-5, .span-4 { grid-column: span 12; }
  .option-grid { grid-template-columns: 1fr; }
  .sync-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 48rem) {
  .sidebar { transform: translateX(-100%); transition: transform .2s ease; }
  body.nav-open .sidebar { transform: translateX(0); box-shadow: .75rem 0 2rem rgba(7,31,37,.24); }
  .app-frame { margin-left: 0; }
  .topbar { grid-template-columns: 2.5rem minmax(0, 1fr) 2.5rem; }
  .mobile-menu { display: inline-grid; }
  .program-label { display: none; }
  .top-actions .role-select { display: none; }
  .page { padding: 1rem; }
  .page-header { flex-direction: column; }
  .map-panel-header { align-items: stretch; flex-direction: column; }
  .map-panel-header .button { align-self: flex-start; }
  .program-map-frame { height: 24rem; }
  .page-actions { justify-content: flex-start; }
  .metric-grid { grid-template-columns: repeat(2, 1fr); }
  .site-grid { grid-template-columns: 1fr; }
  .detail-metrics { grid-template-columns: repeat(2, 1fr); }
  .agent-flow { grid-template-columns: 1fr 1fr; }
  .agent-step:nth-child(2n)::after { display: none; }
  .result-count { width: 100%; margin-left: 0; }
}

@media (max-width: 26rem) {
  .topbar { padding-inline: .625rem; gap: .5rem; }
  .metric-grid, .sync-grid, .agent-flow { grid-template-columns: 1fr; }
  .agent-step::after { display: none !important; }
  .quick-links { grid-template-columns: 1fr; }
  .site-stats { grid-template-columns: 1fr 1fr; }
  .program-map-frame { height: 20rem; }
  .map-attribution { display: none; }
  .program-site-label { display: none; }
  .program-site-dot { width: 1.25rem; height: 1.25rem; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: .01ms !important; animation-duration: .01ms !important; }
}

@media print {
  .sidebar, .topbar, .page-actions, .filter-bar, .tabs, .chat-form, .suggestions { display: none !important; }
  .app-frame { margin: 0; }
  .page { width: 100%; padding: 0; }
  .panel, .metric, .site-card, .option-card { break-inside: avoid; box-shadow: none; }
}

/* ---------- parity build: shared utilities ---------- */
.tag { display: inline-block; padding: .1875rem .4375rem; border-radius: 999px; background: var(--green-100); color: var(--green-700); font-size: .625rem; font-weight: 800; letter-spacing: .02em; text-transform: capitalize; }
.tag.amber { background: var(--amber-100); color: var(--amber-700); }
.tag.red { background: var(--red-100); color: var(--red-700); }
.confidence-chip { display: inline-block; padding: .1875rem .4375rem; border-radius: var(--radius-sm); color: var(--blue-700); background: var(--blue-100); font-size: .625rem; font-weight: 800; }
.confidence-chip.low { color: var(--amber-700); background: var(--amber-100); }
.confidence-chip.muted { color: var(--ink-500); background: var(--surface-muted); }
.delta { color: var(--red-700); font-size: .75rem; font-weight: 800; }
.metric-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.metric-grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.card { padding: .875rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.card h3 { margin: 0 0 .375rem; font-size: .875rem; }
.card p { margin: 0; color: var(--ink-700); font-size: .8125rem; }
ul.clean, ol.clean { margin: .5rem 0 0; padding-left: 1.125rem; }
ul.clean li, ol.clean li { margin: .25rem 0; font-size: .8125rem; }
.panel-note { margin: .625rem 0 0; color: var(--ink-500); font-size: .75rem; }
.fine-print { margin: 1rem 0 0; color: var(--ink-500); font-size: .6875rem; }
.panel + .panel, .panel + .kanban, .filter-bar + .panel { margin-top: .875rem; }
.definition-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; margin: .875rem 0 0; }
.definition-row.compact { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .5rem; }
.definition-row div { min-width: 0; padding: .5rem .625rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.definition-row dt { color: var(--ink-500); font-size: .625rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.definition-row dd { margin: .1875rem 0 0; font-size: .8125rem; overflow-wrap: anywhere; }
.check-list { margin: .625rem 0 0; padding: 0; list-style: none; }
.check-list li { position: relative; margin: .3125rem 0; padding-left: 1.25rem; font-size: .8125rem; }
.check-list li::before { position: absolute; left: 0; font-weight: 900; }
.check-list li.yes::before { content: "✓"; color: var(--green-600); }
.check-list li.no::before { content: "×"; color: var(--red-700); }
.callout { margin: .875rem 0 0; padding: .75rem .875rem; border-left: 4px solid var(--lime-500); border-radius: 0 var(--radius-md) var(--radius-md) 0; background: var(--lime-100); font-size: .8125rem; }
.callout.warn { border-left-color: var(--amber-700); background: var(--amber-100); }
.summary-row { display: flex; flex-wrap: wrap; gap: .75rem; margin-bottom: .875rem; }
.summary-figure { padding: .625rem .875rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: white; }
.summary-figure span { display: block; color: var(--ink-500); font-size: .625rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.summary-figure strong { font-size: 1.125rem; }
.field.checkbox { display: flex; flex-direction: row; align-items: center; gap: .5rem; min-width: 12rem; }
.field.checkbox span { color: var(--ink-700); font-size: .8125rem; }
.field.checkbox input { width: 1rem; height: 1rem; }
.app-footer { padding: .875rem 1.5rem; border-top: 1px solid var(--line); color: var(--ink-500); font-size: .6875rem; }
.alert-badge { position: absolute; top: -.25rem; right: -.25rem; min-width: 1rem; padding: 0 .25rem; border-radius: 999px; background: var(--red-700); color: white; font-size: .5625rem; font-weight: 800; line-height: 1rem; }
.top-actions .icon-button { position: relative; }

/* ---------- tabs and chips ---------- */
.tab-row { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: .875rem; }
.tab-count { display: inline-block; margin-left: .25rem; padding: 0 .3125rem; border-radius: 999px; background: var(--surface-muted); color: var(--ink-700); font-size: .625rem; font-weight: 800; }
.tab.active .tab-count { background: rgba(255,255,255,.24); color: white; }
.chip-row { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: .625rem; }
.chip { padding: .3125rem .625rem; border: 1px solid var(--line); border-radius: 999px; background: white; color: var(--ink-700); font-size: .6875rem; font-weight: 700; text-align: left; }
.chip:hover { border-color: var(--green-600); color: var(--green-700); }
.chip.active { background: var(--navy-900); border-color: var(--navy-900); color: white; }

/* ---------- charts ---------- */
.cash-chart { width: 100%; height: 19rem; }
.s-curve { width: 100%; height: 13rem; }
.grid-line { stroke: var(--line); stroke-width: 1; }
.axis-label { fill: var(--ink-500); font-size: 10px; }
.cash-band { fill: rgba(8, 127, 97, .12); }
.cash-contracted { fill: none; stroke: var(--ink-500); stroke-width: 2; stroke-dasharray: 5 3; }
.cash-projected { fill: none; stroke: var(--green-600); stroke-width: 2.5; }
.cash-actual { fill: none; stroke: var(--lime-500); stroke-width: 3.5; }
.cash-dot { fill: var(--green-600); }
.cash-point.selected .cash-dot { fill: var(--navy-900); }
.cash-hit { fill: transparent; cursor: pointer; }
.cash-hit:hover { fill: rgba(7, 31, 37, .05); }
.cash-hit:focus-visible { fill: rgba(8, 127, 97, .14); outline: 2px solid var(--green-600); }
.today-line { stroke: var(--navy-900); stroke-width: 1; stroke-dasharray: 3 3; }
.chart-legend { display: flex; flex-wrap: wrap; gap: .875rem; margin-top: .5rem; color: var(--ink-500); font-size: .6875rem; }
.swatch { display: inline-block; width: .875rem; height: .25rem; margin-right: .375rem; border-radius: 999px; background: var(--green-600); vertical-align: middle; }
.swatch.band { height: .625rem; background: rgba(8, 127, 97, .2); }
.swatch.contracted { background: var(--ink-500); }
.swatch.actual { background: var(--lime-500); }
.swatch.projected { background: var(--green-600); }
.swatch.baseline { background: var(--navy-900); }
.swatch.forecast { background: var(--green-600); }
.swatch.late { background: var(--red-700); }
.swatch.approval { background: var(--amber-700); }
.swatch.build { background: var(--green-600); }
.swatch.golive { background: var(--navy-900); }

/* ---------- working-capital drivers ---------- */
.driver-panel { margin-top: .875rem; padding: .75rem .875rem; border: 1px solid var(--line-strong); border-radius: var(--radius-md); background: var(--surface-soft); }
.driver-head { display: flex; justify-content: space-between; gap: .75rem; font-size: .8125rem; }
.driver-head span { color: var(--ink-500); }
.driver-list { margin: .625rem 0 0; padding: 0; list-style: none; }
.driver-list li { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: .625rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.driver-list small { display: block; color: var(--ink-500); font-size: .6875rem; }
.driver-value { font-size: .8125rem; font-weight: 800; white-space: nowrap; }
.driver-foot { margin: .625rem 0 0; color: var(--ink-500); font-size: .6875rem; }

/* ---------- lists ---------- */
.health-list, .contract-list, .deviation-detail-list, .pattern-list, .flow-list, .plan-milestones, .next-steps { margin: 0; padding: 0; list-style: none; }
.health-list li { display: grid; grid-template-columns: minmax(0, 1.4fr) auto auto auto; align-items: center; gap: .625rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.health-list li:first-child { border-top: 0; }
.health-list small { display: block; color: var(--ink-500); font-size: .6875rem; }
.health-progress { font-size: .8125rem; font-weight: 800; white-space: nowrap; }
.health-cod { color: var(--ink-500); font-size: .6875rem; white-space: nowrap; }
.contract-list li { display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto; align-items: center; gap: .625rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.contract-list li:first-child { border-top: 0; }
.contract-list small { display: block; color: var(--ink-500); font-size: .6875rem; }
.deviation-detail-list li { padding: .75rem 0; border-top: 1px solid var(--line); }
.deviation-detail-list li:first-child { border-top: 0; }
.deviation-detail-head { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-bottom: .375rem; }
.deviation-detail-list p { margin: .25rem 0; font-size: .8125rem; }
.deviation-tags { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .5rem; }
.recommendation { color: var(--green-700); font-size: .8125rem; }
.finding p { margin: .5rem 0 0; font-size: .8125rem; }

/* ---------- sites ---------- */
.site-card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; }
.site-card-head h3 { margin: 0; font-size: 1rem; }
.site-card-pills { display: flex; flex-wrap: wrap; gap: .25rem; justify-content: flex-end; }
.site-meta { margin: .1875rem 0 0; color: var(--ink-500); font-size: .75rem; }
.site-summary { margin: .625rem 0; color: var(--ink-700); font-size: .8125rem; }
.progress-plan { position: absolute; top: -.125rem; width: 2px; height: calc(100% + .25rem); background: var(--navy-900); }
.progress-track { position: relative; }
.detail-head { display: flex; flex-wrap: wrap; gap: .375rem; margin-bottom: .875rem; }
.site-map { height: 16rem; }
.timeline-quarter { margin-top: .875rem; }
.timeline-quarter-head { display: flex; justify-content: space-between; padding: .375rem .625rem; border-radius: var(--radius-sm); background: var(--surface-muted); font-size: .75rem; }
.timeline-list { margin: 0; padding: 0; list-style: none; }
.timeline-list li { display: flex; align-items: flex-start; justify-content: space-between; gap: .75rem; padding: .625rem .625rem; border-bottom: 1px solid var(--line); }
.timeline-main { min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; }
.timeline-main strong { font-size: .875rem; }
.timeline-main small { flex-basis: 100%; color: var(--ink-500); font-size: .6875rem; }
.timeline-side { display: flex; align-items: center; gap: .5rem; white-space: nowrap; }

/* ---------- milestone gantt ---------- */
.gantt-list { margin: 0; padding: 0; list-style: none; }
.gantt-list li { display: grid; grid-template-columns: minmax(9rem, 16rem) minmax(0, 1fr) auto; align-items: center; gap: .75rem; padding: .375rem 0; border-top: 1px solid var(--line); }
.gantt-label strong { display: block; font-size: .8125rem; }
.gantt-label small { color: var(--ink-500); font-size: .6875rem; }
.gantt-track { position: relative; height: 1.25rem; border-radius: var(--radius-sm); background: var(--surface-soft); }
.gantt-baseline { position: absolute; top: .1875rem; width: 3px; height: .875rem; background: var(--navy-900); }
.gantt-slip { position: absolute; top: .5rem; height: .25rem; background: var(--amber-700); opacity: .55; }
.gantt-slip.late { background: var(--red-700); }
.gantt-forecast { position: absolute; top: .3125rem; width: .625rem; height: .625rem; border-radius: 50%; background: var(--green-600); }
.gantt-forecast.at-risk { background: var(--amber-700); }
.gantt-forecast.late { background: var(--red-700); }
.gantt-forecast.done { background: var(--ink-500); }
.gantt-status { display: flex; align-items: center; gap: .375rem; white-space: nowrap; }

/* ---------- contracts ---------- */
.contracts-layout { display: grid; grid-template-columns: minmax(0, 20rem) minmax(0, 1fr); gap: .875rem; align-items: start; }
.contracts-register, .split-list { display: flex; flex-direction: column; gap: .375rem; }
.register-group { margin-bottom: .5rem; }
.register-label { margin: .5rem 0 .25rem; color: var(--ink-500); font-size: .625rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.register-row, .list-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; width: 100%; padding: .5rem .625rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; color: inherit; text-align: left; text-decoration: none; }
.register-row:hover, .list-row:hover { border-color: var(--green-600); }
.register-row.active, .list-row.active { border-color: var(--navy-900); box-shadow: inset 3px 0 0 var(--lime-500); }
.register-row small, .list-row small { display: block; color: var(--ink-500); font-size: .6875rem; }
.register-value { font-size: .75rem; font-weight: 800; white-space: nowrap; }
.list-row-side { text-align: right; white-space: nowrap; }
.upload-card { padding: .75rem; border: 1px dashed var(--line-strong); border-radius: var(--radius-md); background: var(--surface-soft); }
.upload-card p { margin: .25rem 0 .5rem; color: var(--ink-500); font-size: .75rem; }
.obligation-list { margin: 0; padding: 0; list-style: none; }
.obligation-list li { padding: .625rem 0; border-top: 1px solid var(--line); }
.obligation-list li:first-child { border-top: 0; }
.obligation-list p { margin: .375rem 0 0; font-size: .8125rem; }
.obligation-head { display: flex; flex-wrap: wrap; align-items: center; gap: .375rem; }
.obligation-kind { color: var(--ink-500); font-size: .625rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.document-card { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; padding: .75rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.document-card small { display: block; color: var(--ink-500); font-size: .6875rem; }
.document-icon { padding: .375rem .5rem; border-radius: var(--radius-sm); background: var(--navy-900); color: white; font-size: .625rem; font-weight: 800; }
.document-actions { display: flex; gap: .375rem; margin-left: auto; }
.change-cell strong { display: block; font-size: .8125rem; }
.change-cell small { color: var(--ink-500); font-size: .6875rem; }

/* ---------- split layout ---------- */
.split-layout { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: .875rem; align-items: start; }

/* ---------- deviation kanban ---------- */
.kanban { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: .625rem; align-items: start; }
.kanban-column { min-width: 0; padding: .625rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.kanban-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .5rem; }
.kanban-head h2 { margin: 0; font-size: .8125rem; }
.kanban-card { padding: .625rem; margin-bottom: .5rem; border: 1px solid var(--line); border-left: 3px solid var(--green-600); border-radius: var(--radius-sm); background: white; }
.kanban-card.medium { border-left-color: var(--amber-700); }
.kanban-card.high { border-left-color: var(--red-700); }
.kanban-card.expanded { box-shadow: var(--shadow-1); }
.kanban-card h3 { margin: .25rem 0; font-size: .8125rem; }
.kanban-card-head { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 0; border: 0; background: none; }
.kanban-id { font-family: ui-monospace, SFMono-Regular, monospace; font-size: .6875rem; font-weight: 800; }
.kanban-meta { margin: 0; color: var(--ink-500); font-size: .6875rem; }
.kanban-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .375rem; }
.kanban-body { margin-top: .5rem; padding-top: .5rem; border-top: 1px solid var(--line); }
.kanban-body p { margin: 0 0 .375rem; font-size: .75rem; }
.kanban-actions { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .5rem; }
.kanban-empty { margin: 0; color: var(--ink-500); font-size: .75rem; }

/* ---------- reports ---------- */
.report-kpi-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; margin-bottom: .625rem; }
.blocker-block { margin-top: .75rem; padding: .625rem .75rem; border-left: 3px solid var(--amber-700); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; background: var(--amber-100); font-size: .8125rem; }
.report-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; margin-top: .875rem; }
.report-excerpt { margin: 0; padding: .875rem; overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); font-family: ui-monospace, SFMono-Regular, monospace; font-size: .75rem; line-height: 1.55; white-space: pre-wrap; }

/* ---------- insights ---------- */
.pattern-list li { padding: .75rem 0; border-top: 1px solid var(--line); }
.pattern-list li:first-child { border-top: 0; }
.pattern-head { display: flex; align-items: baseline; justify-content: space-between; gap: .625rem; }
.pattern-head h3 { margin: 0; font-size: .9375rem; }
.pattern-list p { margin: .375rem 0; font-size: .8125rem; }
.pattern-tags { display: flex; flex-wrap: wrap; gap: .25rem; margin: .375rem 0; }
.evidence { margin-top: .5rem; padding: .5rem .625rem; border-radius: var(--radius-sm); background: var(--surface-soft); }
.evidence strong { font-size: .6875rem; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-500); }
.chat { max-height: 24rem; overflow-y: auto; padding: .625rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.chat-message { margin-bottom: .625rem; padding: .625rem .75rem; border-radius: var(--radius-md); background: white; font-size: .8125rem; }
.chat-message.user { background: var(--navy-900); color: white; }
.chat-message.user .chat-role { color: var(--lime-500); }
.chat-role { display: block; margin-bottom: .25rem; color: var(--ink-500); font-size: .625rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.chat-message code { padding: 0 .25rem; border-radius: var(--radius-sm); background: var(--surface-muted); color: var(--green-700); font-size: .75rem; }
.chat-message.user code { background: rgba(255,255,255,.16); color: var(--lime-500); }
.suggestion-row { display: flex; flex-wrap: wrap; gap: .375rem; margin: .625rem 0; }
.chat-form { display: flex; gap: .5rem; }
.chat-form input { flex: 1; min-width: 0; padding: .5rem .625rem; border: 1px solid var(--line); border-radius: var(--radius-sm); }

/* ---------- pipeline / aconex ---------- */
.pipeline { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: .375rem; margin-top: .875rem; }
.pipeline-step { padding: .625rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; }
.pipeline-step strong { display: block; font-size: .75rem; }
.pipeline-step small { display: block; margin-top: .25rem; color: var(--ink-500); font-size: .625rem; }
.pipeline-step.done { border-color: var(--green-600); background: var(--green-100); }
.pipeline-step.active { border-color: var(--navy-900); background: var(--navy-900); color: white; }
.pipeline-step.active small { color: rgba(255,255,255,.72); }
.pipeline-index { color: var(--ink-500); font-size: .625rem; font-weight: 800; }
.pipeline-step.active .pipeline-index { color: var(--lime-500); }

/* ---------- project plan ---------- */
.phase-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; }
.phase-card { padding: .875rem; border: 1px solid var(--line); border-top: 3px solid var(--green-600); border-radius: var(--radius-md); background: white; }
.phase-head { display: flex; align-items: baseline; justify-content: space-between; gap: .5rem; }
.phase-head h3 { margin: 0; font-size: .9375rem; }
.phase-pt { color: var(--green-700); font-size: .8125rem; font-weight: 800; }
.phase-card p { font-size: .8125rem; }
.option-head { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.option-index { color: var(--ink-500); font-size: .625rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.option-card.recommended { border-top: 3px solid var(--lime-500); }
.feasibility { margin-top: .875rem; }
.feasibility-head, .feasibility-row { display: grid; grid-template-columns: minmax(0, 18rem) minmax(0, 1fr); gap: .625rem; align-items: center; }
.feasibility-head { padding-bottom: .375rem; border-bottom: 1px solid var(--line); color: var(--ink-500); font-size: .625rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; }
.feasibility-head span:not(:first-child) { display: none; }
.feasibility-row { padding: .375rem 0; border-bottom: 1px solid var(--line); }
.feasibility-label strong { display: block; font-size: .8125rem; }
.feasibility-label small { color: var(--ink-500); font-size: .6875rem; }
.feasibility-lane { position: relative; height: 1.125rem; border-radius: var(--radius-sm); background: var(--surface-soft); }
.feasibility-bar { position: absolute; top: .1875rem; height: .75rem; border-radius: 999px; background: var(--green-600); }
.feasibility-bar.approval { background: var(--amber-700); }
.feasibility-bar.decision { background: var(--navy-800); }
.feasibility-bar.golive { background: var(--navy-900); }
.plan-milestones li, .flow-list li { display: grid; grid-template-columns: 2.75rem minmax(0, 1fr); gap: .625rem; padding: .5rem 0; border-top: 1px solid var(--line); }
.plan-milestones li:first-child, .flow-list li:first-child { border-top: 0; }
.plan-id { display: grid; place-items: center; height: 1.75rem; border-radius: var(--radius-sm); background: var(--navy-900); color: white; font-size: .6875rem; font-weight: 800; }
.plan-milestones small { display: block; color: var(--green-700); font-size: .6875rem; font-weight: 800; }
.plan-milestones p { margin: .25rem 0 0; font-size: .8125rem; }
.next-steps li { display: grid; grid-template-columns: 9rem minmax(0, 1fr); gap: .625rem; padding: .5rem 0; border-top: 1px solid var(--line); font-size: .8125rem; }
.next-steps li:first-child { border-top: 0; }
.next-when { color: var(--green-700); font-size: .6875rem; font-weight: 800; letter-spacing: .04em; text-transform: uppercase; }

/* ---------- how it works ---------- */
.stepper { display: flex; flex-wrap: wrap; gap: .375rem; margin: 0 0 .875rem; padding: 0; list-style: none; }
.step-chip { display: flex; align-items: center; gap: .375rem; padding: .375rem .625rem; border: 1px solid var(--line); border-radius: 999px; background: white; font-size: .75rem; font-weight: 700; }
.step-chip span { display: grid; place-items: center; width: 1.125rem; height: 1.125rem; border-radius: 50%; background: var(--surface-muted); font-size: .625rem; font-weight: 800; }
.step-chip.active { background: var(--navy-900); border-color: var(--navy-900); color: white; }
.step-chip.active span { background: var(--lime-500); color: var(--navy-950); }
.step-chip.done { border-color: var(--green-600); color: var(--green-700); }
.step-body { padding: .875rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.step-body h3 { margin: 0 0 .375rem; font-size: 1rem; }
.step-body p { margin: 0 0 .5rem; font-size: .8125rem; }
.step-actions { display: flex; flex-wrap: wrap; gap: .375rem; margin-top: .625rem; }
.hub { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 14rem); gap: .75rem; }
.hub-agents { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .375rem; }
.hub-agent { padding: .5rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: white; text-align: left; }
.hub-agent strong { display: block; font-size: .8125rem; }
.hub-agent small { display: block; color: var(--ink-500); font-size: .625rem; }
.hub-agent.active { border-color: var(--navy-900); box-shadow: inset 0 0 0 1px var(--navy-900); }
.hub-state { display: block; margin-top: .25rem; color: var(--green-700); font-size: .625rem; font-weight: 800; }
.hub-core { display: grid; align-content: center; padding: .875rem; border-radius: var(--radius-md); background: var(--navy-900); color: white; }
.hub-core small { color: rgba(255,255,255,.72); font-size: .6875rem; }
.hub-core .panel-note { color: rgba(255,255,255,.6); }
.agent-detail { margin-top: .875rem; padding: .875rem; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--surface-soft); }
.agent-detail h3 { margin: 0 0 .375rem; font-size: .9375rem; }
.agent-detail p { margin: 0; font-size: .8125rem; }

/* ---------- gate ---------- */
.gate { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); min-height: 100vh; }
.gate-brand { display: flex; flex-direction: column; justify-content: center; gap: .875rem; padding: 3rem; background: var(--navy-900); color: white; }
.gate-logo { margin: 0; font-size: 1.5rem; font-weight: 900; letter-spacing: .06em; }
.gate-eyebrow { margin: 0; color: var(--lime-500); font-size: .6875rem; font-weight: 800; letter-spacing: .16em; text-transform: uppercase; }
.gate-brand h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.25rem); line-height: 1.04; letter-spacing: -.03em; }
.gate-brand p { max-width: 32rem; color: rgba(255,255,255,.8); font-size: .9375rem; }
.gate-foot { margin-top: auto; color: rgba(255,255,255,.55); font-size: .75rem; }
.gate-form-wrap { display: grid; place-items: center; padding: 2rem; background: var(--surface-soft); }
.gate-card { width: min(26rem, 100%); padding: 1.5rem; border: 1px solid var(--line); border-radius: var(--radius-lg); background: white; box-shadow: var(--shadow-1); }
.gate-card-head { display: flex; align-items: center; gap: .75rem; margin-bottom: 1.25rem; }
.gate-card-head h2 { margin: 0; font-size: 1.125rem; }
.gate-card-head p { margin: .125rem 0 0; color: var(--ink-500); font-size: .8125rem; }
.gate-lock { display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: var(--radius-md); background: var(--surface-muted); }
.gate-card label { display: block; margin-bottom: .375rem; color: var(--ink-500); font-size: .625rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.gate-card input { width: 100%; padding: .625rem .75rem; border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface-soft); }
.gate-submit { width: 100%; margin-top: 1rem; justify-content: center; }
.gate-error { margin: .5rem 0 0; color: var(--red-700); font-size: .75rem; font-weight: 700; }
.gate-note { margin: 1rem 0 0; color: var(--ink-500); font-size: .6875rem; text-align: center; }

/* ---------- guided tour ---------- */
.tour { position: fixed; top: 1rem; left: 1rem; z-index: 40; width: min(24rem, calc(100vw - 2rem)); padding: 1rem; border-radius: var(--radius-lg); background: white; box-shadow: 0 18px 50px rgba(7, 31, 37, .22); }
.tour-step { margin: 0 0 .25rem; color: var(--green-700); font-size: .625rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; }
.tour h2 { margin: 0 0 .375rem; font-size: 1rem; }
.tour p { margin: 0; color: var(--ink-700); font-size: .8125rem; }
.tour-dots { display: flex; gap: .25rem; margin: .75rem 0; }
.tour-dots span { width: .375rem; height: .375rem; border-radius: 999px; background: var(--line-strong); }
.tour-dots span.active { width: 1.25rem; background: var(--navy-900); }
.tour-actions { display: flex; align-items: center; gap: .375rem; }
.tour-spacer { flex: 1; }
.tour-launch { position: fixed; right: 1rem; bottom: 1rem; z-index: 30; padding: .5rem .875rem; border: 1px solid var(--line); border-radius: 999px; background: white; box-shadow: var(--shadow-1); font-size: .75rem; font-weight: 700; }

@media (max-width: 1200px) {
  .kanban { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hub-agents { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pipeline { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 1000px) {
  .contracts-layout, .split-layout, .hub, .phase-grid, .grid-2, .grid-3, .definition-row, .metric-grid.four, .metric-grid.three { grid-template-columns: 1fr; }
  .gate { grid-template-columns: 1fr; }
  .gate-brand { padding: 2rem 1.5rem; }
}

@media (max-width: 760px) {
  .kanban, .pipeline, .hub-agents { grid-template-columns: 1fr; }
  .gantt-list li, .health-list li, .contract-list li, .driver-list li, .next-steps li, .feasibility-head, .feasibility-row { grid-template-columns: 1fr; }
  .tour { top: auto; bottom: 1rem; left: 1rem; }
  .tour-launch { display: none; }
}

/* dark-surface headings must not inherit the navy ink colour */
.gate-brand h1, .gate-brand h2, .hub-core strong, .chat-message.user strong { color: inherit; }
.metric-grid.four .metric-value, .metric-grid.three .metric-value { font-size: 1.375rem; line-height: 1.15; }
