:root {
  --bg: #F3F5F9;
  --panel: #FFFFFF;
  --ink: #15202B;
  --muted: #5B6675;
  --line: #E1E5EC;
  --navy: #0F2C4C;
  --navy-2: #173F6B;
  --accent: #1F5FAD;
  --sky: #4FA3E0;
  --green: #1E8E3E;
  --amber: #E8A100;
  --red: #D93025;
  --grey: #8C96A3;
  --green-bg: #E6F4EA;
  --amber-bg: #FEF5DC;
  --red-bg: #FCE8E6;
  --blue-bg: #E8F0FB;
  --grey-bg: #EEF1F5;
  --radius: 10px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .06), 0 1px 3px rgba(16, 24, 40, .08);
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }      /* the hidden attribute wins over component display rules (.ro-badge, nav links) */
body { margin: 0; background: var(--bg); color: var(--ink); display: flex; min-height: 100vh; font-size: 14px; }
a { color: var(--accent); }
h2 { font-size: 15px; margin: 0 0 12px; color: var(--navy); }
h3 { font-size: 12px; margin: 0 0 8px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .03em; }

/* ---------- layout */
.sidebar { width: 248px; flex: 0 0 248px; background: var(--navy); color: #C9D6E8; display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand { display: flex; flex-direction: column; gap: 12px; padding: 16px 14px 14px; border-bottom: 1px solid rgba(255,255,255,.08); }
.brand-logo { display: block; width: auto; height: auto; max-width: 100%; max-height: 72px; }
.brand-logo.plate { background: #fff; padding: 6px 10px; border-radius: 8px; }   /* agency logo without a dark-background version */
.brand-app { border-left: 3px solid var(--sky); padding-left: 9px; }
.brand-app strong { color: #fff; font-size: 15.5px; display: block; }
.brand-app span { font-size: 11px; color: #8FA6C4; }
.unit-switch { margin: 12px 10px 4px; background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: 9px; padding: 9px 11px; color: #fff; display: flex; flex-direction: column; gap: 5px; }
.unit-switch label { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #8FA6C4; }
.unit-switch select { font: inherit; font-size: 13.5px; font-weight: 600; width: 100%; padding: 6px 8px; border-radius: 7px; border: 1px solid rgba(255,255,255,.2); background: var(--navy-2); color: #fff; }
.unit-switch select:disabled { opacity: 1; cursor: not-allowed; background: rgba(255,255,255,.04); }
.unit-switch .unit-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.unit-switch em { font-style: normal; font-size: 11.5px; color: #A9BCD6; }
.unit-switch a { color: #8FA6C4; text-decoration: none; font-size: 11.5px; }
.unit-switch a:hover { color: #fff; }
.sidebar nav { padding: 4px 8px; flex: 1; }
.nav-group { font-size: 10.5px; text-transform: uppercase; letter-spacing: .08em; color: #6F87A8; padding: 13px 10px 5px; }
.sidebar nav a { display: flex; justify-content: space-between; align-items: center; gap: 6px; color: #C9D6E8; text-decoration: none; padding: 8px 10px; border-radius: 7px; margin: 1px 0; font-size: 13.5px; }
.sidebar nav a:hover { background: rgba(255,255,255,.06); color: #fff; }
.sidebar nav a.active { background: var(--navy-2); color: #fff; box-shadow: inset 3px 0 0 var(--sky); }
.sidebar nav a .prod { font-size: 10px; color: #8FA6C4; font-weight: 600; }
.sidebar nav a.nav-tour { background: rgba(79,163,224,.16); color: #fff; font-weight: 600; margin: 6px 0 2px; }
.pill { background: var(--red); color: #fff; border-radius: 10px; font-size: 11px; padding: 1px 7px; font-weight: 600; }
.pill:empty { display: none; }
.sidebar-foot { font-size: 11px; color: #6F87A8; padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08); }
.sidebar-foot .logout { color: #8FA6C4; }
.ro-badge { display: inline-block; font-size: 10.5px; font-weight: 600; color: #3B2A00; background: #F3D98A; border-radius: 10px; padding: 1px 7px; margin: 3px 0 0; }
body.ro [data-w] { display: none !important; }      /* read-only profile: no write actions (the server refuses them anyway) */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding: 14px 28px; background: var(--panel); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 5; }
.topbar h1 { margin: 0; font-size: 19px; color: var(--navy); display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.topbar .sub { color: var(--muted); font-size: 12.5px; margin-top: 3px; }
.top-actions { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; flex-shrink: 0; justify-content: flex-end; }   /* the title wraps, the actions stay on one line */
.topbar > div:first-child { min-width: 0; }
.badge-synth { font-size: 11px; font-weight: 600; color: #7A5B00; background: var(--amber-bg); border: 1px solid #F3D98A; padding: 4px 9px; border-radius: 20px; white-space: nowrap; }
.view { padding: 20px 28px 40px; max-width: 1500px; width: 100%; }
.entity-strip { display: flex; flex-wrap: wrap; gap: 6px 14px; align-items: center; font-size: 12.5px; color: var(--muted); }
.entity-strip b { color: var(--ink); font-weight: 600; }

/* ---------- components */
.btn { font: inherit; font-size: 13px; border: 1px solid var(--accent); background: var(--accent); color: #fff; padding: 7px 13px; border-radius: 7px; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: #fff; color: var(--accent); }
.btn.small { padding: 4px 9px; font-size: 12px; }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn[disabled] { opacity: .5; cursor: default; }
.menu { position: relative; }
.menu-list { position: absolute; right: 0; top: calc(100% + 4px); background: #fff; border: 1px solid var(--line); border-radius: 9px; box-shadow: 0 10px 30px rgba(16,24,40,.15); min-width: 290px; padding: 6px; z-index: 30; }
.menu-list[hidden] { display: none; }
.menu-list a { display: flex; justify-content: space-between; gap: 10px; padding: 7px 9px; border-radius: 6px; color: var(--ink); text-decoration: none; font-size: 13px; }
.menu-list a:hover { background: var(--blue-bg); }
.menu-list a span { color: var(--muted); font-size: 11px; text-transform: uppercase; font-weight: 600; }
.grid { display: grid; gap: 16px; margin-bottom: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; min-width: 0; }
.card-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.card-head h2 { margin: 0; }
.src { font-size: 11px; color: var(--muted); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(165px, 1fr)); gap: 14px; margin-bottom: 16px; }
.kpi { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; box-shadow: var(--shadow); border-top: 4px solid var(--grey); }
.kpi .l { font-size: 12px; color: var(--muted); }
.kpi .v { font-size: 24px; font-weight: 700; margin: 4px 0 2px; color: var(--navy); }
.kpi .s { font-size: 11.5px; color: var(--muted); }
.kpi.st-green { border-top-color: var(--green); } .kpi.st-amber { border-top-color: var(--amber); } .kpi.st-red { border-top-color: var(--red); } .kpi.st-none { border-top-color: var(--accent); }
.chart-box { position: relative; height: 260px; }
.chart-box.tall { height: 330px; }
.chart-box.short { height: 200px; }
.callout { background: #EEF4FC; border: 1px solid #CFE0F5; border-radius: 8px; padding: 11px 15px; font-size: 13.5px; color: #24425F; margin-bottom: 16px; line-height: 1.45; }
.callout.warn { background: var(--amber-bg); border-color: #F3D98A; color: #6B5000; }

table { width: 100%; border-collapse: collapse; font-size: 13px; }
th { text-align: left; font-size: 11.5px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .02em; padding: 8px; border-bottom: 1px solid var(--line); background: #FAFBFD; position: sticky; top: 0; z-index: 1; }
td { padding: 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr.click { cursor: pointer; } tr.click:hover td { background: #F6F9FE; }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }
.table-wrap.scroll { max-height: 520px; overflow-y: auto; }
tr.detail td { background: #FAFBFD; font-size: 12.5px; }
tr.detail dl { display: grid; grid-template-columns: 120px 1fr; gap: 4px 12px; margin: 0; }
tr.detail dt { color: var(--muted); font-weight: 600; }
tr.detail dd { margin: 0; }

.status { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; font-size: 12px; padding: 2px 9px; border-radius: 20px; white-space: nowrap; }
.status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.status.green { color: var(--green); background: var(--green-bg); }
.status.amber { color: #A86F00; background: var(--amber-bg); }
.status.red { color: var(--red); background: var(--red-bg); }
.status.blue { color: var(--accent); background: var(--blue-bg); }
.status.grey { color: #5B6675; background: var(--grey-bg); }
.grade { display: inline-block; min-width: 24px; text-align: center; font-weight: 700; border-radius: 5px; color: #fff; padding: 1px 5px; }
.grade.A { background: #1E8E3E; } .grade.B { background: #6BA539; } .grade.C { background: #E8A100; } .grade.D { background: #E8743B; } .grade.F { background: #D93025; }
.grade.big { font-size: 15px; padding: 2px 8px; }
.tag { display: inline-block; font-size: 11px; padding: 1px 7px; border-radius: 4px; background: #EEF2F8; color: #3B4A5E; margin: 1px 2px 1px 0; white-space: nowrap; }
.tag.prod { background: #FFF1E6; color: #8A3E00; }
.tag.tlp-amber { background: #FFC000; color: #000; font-weight: 700; }
.tag.tlp-clear { background: #fff; color: #000; border: 1px solid #999; font-weight: 700; }
.tag.mine { background: var(--green-bg); color: var(--green); font-weight: 700; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.up { color: var(--green); } .down { color: var(--red); }
.progress { height: 8px; background: #EDF0F5; border-radius: 6px; overflow: hidden; min-width: 70px; }
.progress span { display: block; height: 100%; background: var(--accent); }
.bar-cell { display: flex; align-items: center; gap: 8px; }
.bar-cell .track { position: relative; flex: 1; height: 8px; background: #EDF0F5; border-radius: 6px; min-width: 80px; }
.bar-cell .fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 6px; background: var(--accent); }
.bar-cell .base { position: absolute; top: -3px; bottom: -3px; width: 2px; background: #8C96A3; }
.bar-cell .target { position: absolute; top: -4px; bottom: -4px; width: 3px; background: var(--navy); border-radius: 2px; }
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.toolbar input, .toolbar select, .form input, .form select { font: inherit; padding: 6px 9px; border: 1px solid #C9D1DD; border-radius: 6px; background: #fff; }
.toolbar input, .toolbar select { max-width: 100%; min-width: 0; }       /* a select sized by a long option never widens the page */
.seg { display: inline-flex; border: 1px solid #C9D1DD; border-radius: 8px; overflow: hidden; flex-wrap: wrap; }
.seg a, .seg button { font: inherit; padding: 6px 12px; font-size: 13px; color: var(--ink); text-decoration: none; border: none; border-right: 1px solid #E1E5EC; background: #fff; cursor: pointer; }
.seg a:last-child, .seg button:last-child { border-right: none; }
.seg a.on, .seg button.on { background: var(--navy-2); color: #fff; }

/* required elements chips */
.el-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 10px; }
.el { border: 1px solid var(--line); border-left: 5px solid var(--grey); border-radius: 8px; padding: 9px 11px; background: #fff; }
.el.met { border-left-color: var(--green); } .el.partial { border-left-color: var(--amber); } .el.not-met { border-left-color: var(--red); }
.el b { display: block; font-size: 12.5px; color: var(--navy); }
.el .v { font-size: 12px; color: var(--muted); margin-top: 3px; }

/* goals */
.goal { border: 1px solid var(--line); border-radius: 9px; margin-bottom: 12px; overflow: hidden; }
.goal-head { background: #F7F9FC; padding: 9px 13px; display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.goal-head b { color: var(--navy); font-size: 13px; }
.goal table td:first-child { width: 52px; font-weight: 700; color: var(--navy); }
.goal tr.act td { background: #FBFCFE; border-top: 1px solid var(--line); }
.goal tr.act td b { color: var(--navy); }

/* unit cards and agency summary tiles */
.legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--muted); margin-top: 8px; }
.legend i { display: inline-block; width: 12px; height: 12px; border-radius: 3px; vertical-align: -2px; margin-right: 5px; }
.legend b { color: var(--ink); font-weight: 600; }
.unit-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.unit-card { display: flex; flex-direction: column; gap: 6px; background: var(--panel); border: 1px solid var(--line); border-top: 4px solid var(--accent); border-radius: var(--radius); box-shadow: var(--shadow); padding: 13px 15px; color: var(--ink); text-decoration: none; }
.unit-card:hover { border-color: var(--accent); }
.unit-card.agy { border-top-color: var(--navy); background: #F7F9FC; }
.unit-card.sel { outline: 2px solid var(--navy); outline-offset: 1px; }
.unit-card .uc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.unit-card .uc-head b { font-size: 14.5px; color: var(--navy); }
.unit-card .uc-id { font-size: 11px; font-weight: 700; color: var(--muted); letter-spacing: .04em; }
.unit-card .uc-facts { font-size: 12.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.unit-card .uc-foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: auto; font-size: 12.5px; }
.ut-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; }
.ut { display: flex; flex-direction: column; gap: 2px; padding: 10px 11px; border-radius: 8px; text-decoration: none; min-height: 64px; }
.ut b { font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ut span { font-size: 11.5px; opacity: .9; }
.ut:hover { outline: 2px solid var(--navy); outline-offset: 1px; }
.ut.dim { opacity: .22; }
button.chip { font: inherit; font-size: 13px; color: var(--muted); background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 3px 10px; cursor: pointer; }
button.chip:hover, button.chip.on { border-color: var(--navy); color: var(--navy); }
button.chip.on { background: var(--blue-bg); }
table.prog tr.total td { background: #F5F7FA; border-bottom: 2px solid var(--navy); }

/* MITRE matrix */
.matrix { display: grid; grid-template-columns: repeat(12, minmax(104px, 1fr)); gap: 6px; overflow-x: auto; padding-bottom: 4px; }
.matrix .col h4 { font-size: 10.5px; margin: 0 0 5px; color: var(--navy); text-transform: uppercase; letter-spacing: .03em; min-height: 26px; }
.matrix .t { font-size: 11px; border-radius: 5px; padding: 5px 6px; margin-bottom: 4px; color: #fff; line-height: 1.25; }
.matrix .t small { display: block; opacity: .85; font-size: 10px; }
.matrix .t.prevented { background: var(--green); } .matrix .t.detected { background: var(--amber); color: #3b2a00; } .matrix .t.missed { background: var(--red); } .matrix .t.not-tested { background: #C9D1DD; color: #3B4A5E; }
.matrix .t.hp { box-shadow: inset 0 0 0 2px var(--navy); }

/* tour */
.case-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; margin-bottom: 18px; }
.case { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 12px 14px; display: flex; flex-direction: column; gap: 6px; }
.case-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.case-n { font-weight: 700; font-size: 12px; color: #fff; background: var(--navy-2); border-radius: 6px; padding: 2px 8px; white-space: nowrap; }
.case p { margin: 0; font-size: 13px; color: #33404F; flex: 1; }
.case .ev { font-size: 12px; color: var(--accent); font-weight: 600; }
.tour-h { font-size: 14px; color: var(--navy); margin: 6px 0 10px; }

/* timeline */
.gantt td.m { padding: 4px 2px; text-align: center; }
.gantt td.m span { display: block; height: 14px; border-radius: 3px; background: #EDF0F5; }
.gantt td.m span.on { background: var(--accent); }
.gantt td.m span.on.past { background: #8FB3E0; }
.gantt th.now, .gantt td.now { background: #FFF6D6; }

/* connectors */
.conn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 16px; }
.conn { border-top: 4px solid var(--accent); }
.conn.out { border-top-color: var(--sky); }
.conn .mode { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; background: #EEF2F8; color: #3B4A5E; }
.conn dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 10px; font-size: 12.5px; margin: 10px 0 0; }
.conn dt { color: var(--muted); }
.conn dd { margin: 0; }
pre.payload { background: #0E1726; color: #D6E2F5; font-size: 11.5px; padding: 10px 12px; border-radius: 7px; overflow: auto; max-height: 280px; margin: 6px 0 0; }
details summary { cursor: pointer; }

/* simulator */
.sim-controls { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 12px 16px; align-items: end; }
.sim-controls label { font-size: 12px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.sim-controls select, .sim-controls input[type=number] { font: inherit; padding: 6px 9px; border: 1px solid #C9D1DD; border-radius: 6px; background: #fff; }
.sim-controls input[type=range] { accent-color: var(--accent); }
.sim-controls b { color: var(--navy); }

/* modal and toasts */
.modal { position: fixed; inset: 0; background: rgba(11, 22, 40, .45); display: flex; align-items: flex-start; justify-content: center; padding: 34px 16px; z-index: 40; overflow-y: auto; }
.modal[hidden] { display: none; }
.modal-card { background: #fff; border-radius: 12px; width: min(1100px, 100%); padding: 22px 24px; position: relative; box-shadow: 0 20px 60px rgba(0,0,0,.25); }
.modal-x { position: absolute; top: 10px; right: 12px; border: none; background: none; font-size: 26px; cursor: pointer; color: var(--muted); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin: 12px 0; flex-wrap: wrap; }
.tabs button { font: inherit; font-size: 13px; border: none; background: none; padding: 8px 12px; cursor: pointer; color: var(--muted); border-bottom: 3px solid transparent; }
.tabs button.on { color: var(--navy); border-bottom-color: var(--accent); font-weight: 600; }
.toasts { position: fixed; right: 18px; bottom: 18px; display: flex; flex-direction: column; gap: 8px; z-index: 50; }
.toast { background: var(--navy); color: #fff; padding: 10px 14px; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.2); font-size: 13px; max-width: 380px; animation: fade .25s ease; }
.toast.red { background: var(--red); }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } }

@media (max-width: 1100px) {
  .g3, .g-2-1, .g-1-2 { grid-template-columns: minmax(0, 1fr); }
  .sim-controls { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 860px) {
  body { flex-direction: column; }
  .sidebar { position: static; width: 100%; height: auto; flex: none; }
  .brand { flex-direction: row; align-items: center; justify-content: space-between; }
  .brand-logo { max-width: 150px; max-height: 48px; }
  .sidebar nav { display: flex; flex-wrap: wrap; gap: 4px; }
  .nav-group, .sidebar-foot, .sidebar nav a .prod { display: none; }
  .g2 { grid-template-columns: minmax(0, 1fr); }
  .topbar { position: static; flex-direction: column; align-items: flex-start; padding: 12px 16px; }
  .top-actions { flex-wrap: wrap; flex-shrink: 1; justify-content: flex-start; }
  .view { padding: 16px; }
  .sim-controls { grid-template-columns: 1fr; }
  .case-grid { grid-template-columns: 1fr; }
  .toolbar .btn { white-space: normal; }
}
@media print { .sidebar, .top-actions { display: none; } }

/* language toggle */
.lang-toggle button { padding: 4px 10px; font-size: 12px; font-weight: 600; }

/* ---------- program KPIs */
tr.group td { background: var(--blue-bg); border-top: 2px solid var(--accent); padding-top: 9px; padding-bottom: 9px; }
.kv-row { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13px; color: var(--muted); margin-bottom: 10px; }
.kv-row b { color: var(--navy); }
@media (min-width: 1101px) {
  .kpis.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .kpis.cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}
.pk-groups { columns: 2 520px; column-gap: 16px; }
.pk-group { break-inside: avoid; margin-bottom: 14px; }
.pk-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; padding: 6px 2px; border-bottom: 2px solid var(--accent); margin-bottom: 2px; }
.pk-group td.num, .pk-group td:nth-child(4) { white-space: nowrap; }

.el-group + .el-group { margin-top: 12px; }
.el-head { font-size: 11.5px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .04em; margin-bottom: 6px; }
.wef-phases { display: flex; gap: 6px; flex-wrap: wrap; }
.wef-phases span { flex: 1 1 120px; text-align: center; font-size: 12px; padding: 6px 8px; border-radius: 6px; background: #EEF1F5; color: var(--muted); }
.wef-phases span.past { background: #DCE7F5; color: #24425F; }
.wef-phases span.on { background: var(--navy); color: #fff; font-weight: 600; }
.score { display: inline-block; min-width: 22px; text-align: center; border-radius: 5px; font-weight: 700; font-size: 12px; padding: 1px 5px; color: #fff; background: #8C96A3; }
.score.s1, .score.s2 { background: var(--red); } .score.s3 { background: var(--amber); } .score.s4, .score.s5 { background: var(--green); }
.stages { display: flex; gap: 2px; margin-top: 3px; }
.stages span { font-size: 10px; padding: 1px 5px; border-radius: 4px; background: #EEF1F5; color: var(--muted); }
.stages span.past { background: #DCE7F5; color: #24425F; }
.stages span.on { background: var(--navy); color: #fff; }
.spark { display: inline-block; vertical-align: middle; margin-top: 3px; }
.spark polyline { fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; stroke-linecap: round; }
.spark circle { fill: currentColor; }
.spark.c-green { color: var(--green); } .spark.c-amber { color: var(--amber); } .spark.c-red { color: var(--red); } .spark.c-grey { color: var(--muted); }
input.tgt { width: 84px; padding: 3px 6px; border: 1px solid var(--line, #CCD3DC); border-radius: 4px; font: inherit; text-align: right; }
input.tgt:invalid { border-color: var(--red); }
tr.changed td:first-child { box-shadow: inset 3px 0 0 var(--accent); }
th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable.sorted { color: var(--accent); }
table.prog tr.clickable { cursor: pointer; }
table.prog tr.clickable:hover td { background: var(--blue-bg); }
table.prog th.sortable { white-space: normal; vertical-align: bottom; }
table.prog td:first-child { min-width: 210px; }
table.prog td:nth-child(2) { white-space: nowrap; }
table.push td.num, table.push td.nw, table.push td:last-child { white-space: nowrap; }

/* ---------- agencies & access (administration) */
.callout.hist { background: #FFF6E0; border-color: #F2D48A; color: #5C4300; }
.logo-chip { display: inline-flex; align-items: center; justify-content: center; width: 132px; height: 40px; padding: 4px 8px; border-radius: 6px; vertical-align: middle; }
.logo-chip.dark { background: var(--navy); }
.logo-chip.light { background: #fff; border: 1px solid var(--line); }
.logo-chip img { max-width: 100%; max-height: 100%; }
.logo-chip img.plate { background: #fff; padding: 2px 4px; border-radius: 3px; }
.logo-chip:empty::after { content: "—"; color: var(--muted); }
.admin-logos { display: inline-flex; gap: 8px; flex-wrap: wrap; vertical-align: middle; }
.code-big { font-family: ui-monospace, Consolas, monospace; font-size: 26px; letter-spacing: .08em; background: var(--bg); border: 1px dashed #C9D1DD; border-radius: 8px; padding: 12px 16px; text-align: center; margin: 12px 0; user-select: all; }
.form { display: grid; gap: 12px 14px; }
.form.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form label { font-size: 12.5px; color: var(--muted); display: flex; flex-direction: column; gap: 5px; }
.form label.check { flex-direction: row; align-items: center; gap: 8px; }
.form.two input:not([type=checkbox]), .form.two select { width: 100%; min-width: 0; }
.form .full { grid-column: 1 / -1; }
.form-msg { color: var(--red); }
.nowrap { white-space: nowrap; }
.units-table input, .units-table select { font: inherit; width: 100%; min-width: 64px; padding: 5px 8px; border: 1px solid #C9D1DD; border-radius: 6px; background: #fff; box-sizing: border-box; }
.units-table input[type=checkbox] { width: auto; min-width: 0; }
.units-table input[readonly] { background: #F3F5F8; color: var(--muted); }
.units-table td { vertical-align: middle; }
.units-table td.c { text-align: center; }
@media (max-width: 860px) { .logo-chip { width: 104px; } .form.two { grid-template-columns: minmax(0, 1fr); } }
.unit-card .uc-foot { flex-wrap: wrap; }
.unit-card .uc-foot > span { white-space: nowrap; display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
#agency-summary td.num { white-space: nowrap; }

/* Phones: wide tables outside .table-wrap scroll inside their card instead of widening the page */
@media (max-width: 600px) {
  .view .card > table, .view .card > div:not(.table-wrap) > table { display: block; overflow-x: auto; }
}
