/* RFP Review System — Theme 3, Graphite & Petrol (from docs/ui-samples/theme-3-graphite-petrol.html). */
:root {
  color-scheme: light;
  --bg: #F3F3F3;
  --surface: #FFFFFF;
  --surface-2: #F7F7F7;
  --border: #E0E0E0;
  --border-strong: #C6C6C6;
  --fg: #161616;
  --fg-2: #4B4B4B;
  --fg-3: #7A7A7A;
  --primary: #0E6E74;
  --primary-hover: #0A575C;
  --primary-fg: #FFFFFF;
  --primary-soft: #E5F1F2;
  --primary-text: #0B5F64;
  --hl: #0B5F64;
  --hdr-bg: #1F2326;
  --hdr-fg: #F4F4F4;
  --hdr-muted: #A6ABB0;
  --hdr-active: #5DBBC0;
  --hdr-border: #1F2326;
  --hdr-rule: #1F2326;
  --hdr-input: #2B3034;
  --hdr-input-border: #3A4045;
  --logo-bg: #5DBBC0;
  --logo-fg: #1F2326;
  --avatar-bg: #3A4045;
  --avatar-fg: #FFFFFF;
  --ok: #1E7443;       --ok-soft: #E7F3EB;
  --warn: #8F5B00;     --warn-soft: #FBF1DC;
  --bad: #B42318;      --bad-soft: #FBEAE8;
  --track: #E4E4E4;
  --radius-sm: 3px;
  --radius: 5px;
  --radius-lg: 8px;
  --font-head: 'Noto Sans', 'Segoe UI', Arial, sans-serif;
  --font-body: 'Noto Sans', 'Segoe UI', Arial, sans-serif;
  --head-weight: 700;
  --h1-size: 24.2px;
  --h1-track: 0;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 15.4px/1.5 var(--font-body); -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4 { margin: 0; font-family: var(--font-head); text-wrap: balance; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.num { font-variant-numeric: tabular-nums; }
.wrap { margin: 0 auto; padding-inline: clamp(16px, 1.5vw, 28px); }
.link { color: var(--primary-text); font-weight: 500; }
.link:hover { text-decoration: underline; }
.muted { color: var(--fg-3); }

/* App header: logo, search, settings, user */
.app-header { flex: none; background: var(--hdr-bg); color: var(--hdr-fg); border-top: 3px solid var(--hdr-rule); position: sticky; top: 0; z-index: 40; }
.hdr-inner { display: flex; align-items: center; gap: 20px; height: 68px; padding-inline: clamp(16px, 1.5vw, 28px); }
.brand { display: flex; align-items: center; gap: 10px; font-family: var(--font-head); font-weight: var(--head-weight); font-size: 18.7px; white-space: nowrap; }
.brand-names { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; gap: 1px; }
.brand-ar { font-family: 'Noto Sans Arabic', 'Segoe UI', Tahoma, sans-serif; font-size: 19.8px; font-weight: 600; line-height: 1.3; color: var(--hdr-fg); }
.mark { width: 34px; height: 34px; border-radius: var(--radius-sm); background: var(--logo-bg); color: var(--logo-fg); display: grid; place-items: center; flex: none; }
.hdr-actions { margin-left: auto; display: flex; align-items: center; gap: 12px; flex: none; }
.user { display: flex; align-items: center; gap: 10px; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--avatar-bg); color: var(--avatar-fg); display: grid; place-items: center; font-size: 13.2px; font-weight: 600; }
.user-meta { display: flex; flex-direction: column; line-height: 1.25; }
.user-meta b { font-size: 14.3px; font-weight: 600; }
.user-meta small { font-size: 12.1px; color: var(--hdr-muted); }

.search {
  display: flex; align-items: center; gap: 10px;
  flex: 1 1 360px;
  max-width: 480px;
  min-width: 160px;
  height: 38px;
  padding: 0 12px 0 14px;
  background: var(--hdr-input);
  border: 1px solid var(--hdr-input-border);
  color: var(--hdr-muted);
}
.search:focus-within { border-color: var(--hdr-active); color: var(--hdr-fg); }
.search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--hdr-fg); font: inherit; font-size: 15.4px; }
.search input::placeholder { color: var(--hdr-muted); }
kbd { font: 500 12.1px/1 var(--font-body); padding: 3px 6px; border: 1px solid var(--hdr-input-border); background: transparent; color: var(--hdr-muted); }

.icon-btn {
  width: 36px; height: 36px; display: grid; place-items: center;
  border: 1px solid var(--hdr-input-border); background: var(--hdr-input); color: var(--hdr-muted); cursor: pointer;
}
.icon-btn:hover, .icon-btn[aria-expanded="true"] { color: var(--hdr-fg); border-color: var(--hdr-active); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.settings-menu { position: relative; }
.settings-panel {
  position: absolute; top: calc(100% + 6px); right: 0; z-index: 50;
  min-width: 200px; padding: 6px 0;
  background: var(--surface); border: 1px solid var(--border-strong);
  box-shadow: 0 8px 24px rgba(16, 24, 40, .16); color: var(--fg);
}
.settings-panel a, .settings-panel button {
  display: block; width: 100%; padding: 10px 16px; border: 0; background: none; text-align: left; font: inherit; font-size: 14.3px; font-weight: 500; color: var(--fg-2); cursor: pointer;
}
.settings-panel a:hover, .settings-panel a.active, .settings-panel button:hover { background: var(--primary-soft); color: var(--primary-text); }
.settings-panel button { border-top: 1px solid var(--border); }

/* Sign-in screen: shown instead of the app until signed in */
.login { display: none; }
body.signed-out > .app-header, body.signed-out > .app-body { display: none; }
body.signed-out > .login { display: grid; place-items: center; min-height: 100dvh; padding: 24px 16px; background: var(--surface-2); }
.login-card { display: grid; gap: 18px; width: 100%; max-width: 400px; padding: 32px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); }
.login-brand { display: flex; align-items: center; gap: 12px; padding-bottom: 20px; border-bottom: 1px solid var(--border); }
.login-brand .brand-ar { font-size: 19.8px; font-weight: 600; color: var(--fg); }
.login-card h1 { margin: 0; font-size: 22px; }
.login-card .btn { justify-content: center; height: 40px; margin-top: 4px; }
.login-err { margin: 0; padding: 10px 12px; border-radius: var(--radius); background: var(--bad-soft); color: var(--bad); font-size: 13.2px; font-weight: 500; }

/* Body: sidebar + content */
.app-body { display: flex; align-items: stretch; min-height: 0; flex: 1 1 auto; }
.sidebar {
  flex: none; width: 240px;
  display: flex; flex-direction: column;
  background: var(--surface); border-right: 1px solid var(--border);
  transition: width .18s ease;
}
.sidebar.collapsed { width: 64px; }
.side-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px 10px; flex: 1 1 auto; overflow: auto; }
.side-nav a {
  display: flex; align-items: center; gap: 12px;
  min-height: 42px; padding: 0 12px;
  color: var(--fg-2); font-weight: 600; font-size: 15.4px; white-space: nowrap;
  border-left: 3px solid transparent;
}
.side-nav a svg { flex: none; }
.side-nav a:hover { background: var(--surface-2); color: var(--fg); }
.side-nav a.active { background: var(--primary-soft); color: var(--primary-text); border-left-color: var(--primary); }
.sidebar.collapsed .side-nav a { justify-content: center; padding: 0; gap: 0; }
.sidebar.collapsed .side-nav a span { display: none; }

.side-foot {
  flex: none;
  display: flex;
  justify-content: flex-end;
  padding: 12px 10px 14px;
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.side-toggle {
  display: flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; margin: 0; padding: 0;
  border: 1px solid var(--border-strong);
  background: var(--surface-2);
  color: var(--fg-2);
  cursor: pointer;
}
.side-toggle:hover {
  background: var(--primary-soft);
  border-color: var(--primary);
  color: var(--primary-text);
}
.side-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.side-toggle .ico-expand { display: none; }
.sidebar.collapsed .side-foot { padding-inline: 12px; justify-content: center; }
.sidebar.collapsed .side-toggle .ico-collapse { display: none; }
.sidebar.collapsed .side-toggle .ico-expand { display: block; }

#view { flex: 1 1 auto; min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; }
#view > .page-head,
#view > main.wrap { min-width: 0; width: 100%; }

/* Page header */
.page-head { background: var(--surface); border-bottom: 1px solid var(--border); }
.page-head.flat .title-row { padding-bottom: 24px; }
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-top: 28px; font-size: 14.3px; color: var(--fg-3); }
.crumbs a:hover { color: var(--primary-text); }
.title-row { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: space-between; gap: 16px 24px; margin-top: 8px; }
.title-block { flex: 1 1 520px; min-width: 0; }
h1 { font-size: var(--h1-size); font-weight: var(--head-weight); line-height: 1.3; letter-spacing: var(--h1-track); overflow-wrap: anywhere; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 28px; margin-top: 14px; font-size: 14.3px; color: var(--fg); }
.meta em { font-style: normal; color: var(--fg-3); margin-right: 4px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border: 1px solid var(--primary); background: var(--primary-soft); color: var(--primary-text); font-size: 13.2px; font-weight: 600; }
.status-chip i { width: 6px; height: 6px; background: currentColor; }
.status-chip.bad { border-color: #E8BCB8; background: var(--bad-soft); color: var(--bad); }
.status-chip.warn { border-color: #E8D4A8; background: var(--warn-soft); color: var(--warn); }
.status-chip.neutral { border-color: var(--border-strong); background: var(--surface-2); color: var(--fg-2); }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }
/* Detail pages: Tables | Cards switch under the action buttons */
.head-side { display: flex; flex-direction: column; align-items: flex-end; gap: 12px; margin-left: auto; }
.view-switch { display: flex; align-items: center; gap: 10px; font-size: 13.2px; font-weight: 600; color: var(--fg-3); }
.view-switch .seg a { padding: 6px 16px; background: var(--surface); color: var(--fg-2); font-size: 14.3px; font-weight: 500; text-decoration: none; }
.view-switch .seg a + a { border-left: 1px solid var(--border-strong); }
.view-switch .seg a:hover { background: var(--surface-2); color: var(--fg); }
.view-switch .seg a[aria-current="page"] { background: var(--primary); color: var(--primary-fg); font-weight: 600; }
.btn { display: inline-flex; align-items: center; gap: 8px; height: 36px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius); background: var(--surface); color: var(--fg); font-size: 14.3px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.btn:hover { background: var(--surface-2); }
.btn[aria-disabled="true"] { color: var(--fg-3); cursor: not-allowed; background: var(--surface-2); }
.btn-primary { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-sm { height: 32px; padding: 0 12px; }
.tabs { display: flex; gap: 4px; margin-top: 24px; overflow-x: auto; scrollbar-width: none; }
.tab { display: flex; align-items: center; gap: 6px; padding: 12px 14px; border: 0; border-bottom: 2px solid transparent; background: none; color: var(--fg-2); font-size: 14.3px; font-weight: 500; white-space: nowrap; cursor: pointer; }
.tab:hover { color: var(--fg); }
.tab.active { color: var(--fg); border-bottom-color: var(--primary); }
.count { padding: 0 6px; border: 1px solid var(--border); background: var(--surface-2); color: var(--fg-3); font-size: 12.1px; line-height: 17px; }

/* Layout */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 28px; align-items: start; padding-block: 28px; }
.layout.single { grid-template-columns: minmax(0, 1fr); }
.col-main, .col-side { display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.panel-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 16px; padding: 16px 24px; border-bottom: 1px solid var(--border); background: var(--surface-2); }
.panel-head-plain { background: var(--surface); }
h2 { font-size: 16.5px; font-weight: 700; }
.sub { margin: 2px 0 0; font-size: 13.2px; color: var(--fg-3); }
.pass-note { font-size: 13.2px; color: var(--fg-2); }
.pass-note b { color: var(--fg); font-weight: 600; }
.empty { padding: 28px 24px; color: var(--fg-2); font-size: 14.3px; }
.note { margin: 0; padding: 12px 24px; border-bottom: 1px solid var(--border); background: var(--warn-soft); color: var(--warn); font-size: 13.2px; font-weight: 500; }

/* Official tables */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14.3px; }
th { padding: 12px 16px; background: var(--surface); border-bottom: 2px solid var(--fg); color: var(--fg); font-size: 15.4px; font-weight: 700; text-align: left; white-space: nowrap; letter-spacing: 0; }
td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
th:first-child, td:first-child { padding-left: 24px; }
th:last-child, td:last-child { padding-right: 24px; }
th.r, td.r { text-align: right; }
@media (max-width: 1599px) { th, td { padding-inline: 11px; } th:first-child, td:first-child { padding-left: 18px; } th:last-child, td:last-child { padding-right: 18px; } }
th.c, td.c { text-align: center; }
td.top { vertical-align: top; }
tr.group td { padding: 10px 24px; background: var(--surface-2); font-size: 13.2px; font-weight: 700; color: var(--fg-2); }

.rank, .list { min-width: 760px; }
.rank tbody tr[data-href], .list tbody tr[data-href] { cursor: pointer; }
.rank tbody tr[data-href]:hover td, .list tbody tr[data-href]:hover td { background: var(--surface-2); }
.rank tbody tr.sel td { background: var(--primary-soft); }
.rank-no { width: 44px; font-weight: 700; color: var(--fg-3); }
tr.first .rank-no { color: var(--hl); }
.who b { display: block; font-weight: 600; overflow-wrap: anywhere; }
.who small { font-size: 13.2px; color: var(--fg-3); }

.score-pair { display: flex; flex-direction: column; gap: 2px; align-items: flex-end; }
.score-pair .main { font-size: 17.6px; font-weight: 700; color: var(--fg); line-height: 1.2; }
.score-pair .cap { font-size: 12.1px; color: var(--fg-3); }

/* List pages: one-row toolbar + fixed table columns */
.rfp-screen { display: flex; flex-direction: column; gap: 12px; padding-block: 20px; min-height: 0; width: 100%; }
.rfp-toolbar {
  flex: none;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-width: 0;
}
.rfp-filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
}
.rfp-filters .col-filter {
  flex: none;
  width: auto;
  min-width: 132px;
  max-width: 180px;
}
.rfp-filters .seg { flex: none; }
.rfp-toolbar-end {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex: none;
  margin-left: auto;
}
.rfp-toolbar-end .btn { flex: none; }
.toolbar-meta { font-size: 14.3px; color: var(--fg-2); font-weight: 500; white-space: nowrap; }
.rfp-search-wrap {
  display: flex; align-items: center; gap: 8px;
  flex: none;
  width: 220px;
  height: 36px; padding: 0 12px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg-3);
}
.rfp-search-wrap:focus-within { border-color: var(--primary); color: var(--fg); }
.rfp-search-wrap svg { flex: none; }
.rfp-search-input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--fg); font: inherit; font-size: 14.3px; }
.rfp-search-input::placeholder { color: var(--fg-3); }
.col-filter {
  height: 36px; padding: 0 10px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg);
  font: inherit; font-size: 14.3px; cursor: pointer; outline: 0;
}
.col-filter:focus { border-color: var(--primary); }
.rfp-panel { display: flex; flex-direction: column; min-height: 0; flex: 1 1 auto; min-width: 0; width: 100%; }
.rfp-panel > .panel-body { flex: 1 1 auto; min-height: 0; min-width: 0; overflow: auto; }
.rfp-panel > .pager { flex: none; }
.rfp-panel > .panel-body[data-fit] tbody { font-size: var(--list-font, inherit); }
.rfp-panel > .panel-body[data-fit] tbody td { height: var(--row-h, auto); }
.rfp-panel > .panel-body[data-fit] .row-actions .btn-icon {
  width: var(--icon, 30px);
  height: var(--icon, 30px);
}
.pager-end { display: flex; flex-wrap: wrap; align-items: center; gap: 16px; margin-left: auto; }
.pager-size { display: flex; align-items: center; gap: 8px; color: var(--fg-2); font-size: 13.2px; }
.pager-size input {
  width: 64px; height: 30px; padding: 0 8px;
  border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg);
  font: inherit; font-size: 14.3px;
}
.pager-size input:focus { border-color: var(--primary); outline: none; }

/* Column widths are set by justifyTables() in app.js */
.rfp-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}
/* Measurement passes: natural = one line; tight = headers wrap; min = headers and cells wrap */
table[data-measure] { table-layout: auto !important; min-width: 0 !important; }
table[data-measure="natural"] { width: max-content !important; }
table[data-measure="tight"], table[data-measure="min"] { width: min-content !important; }
table[data-measure] > colgroup > col { width: auto !important; }
table[data-measure] > tbody > tr.ent-expand-row,
table[data-measure] > tbody > tr.rfp-empty-row { display: none !important; }
table[data-measure] > * > tr > *,
table[data-measure] > * > tr > * * {
  white-space: nowrap !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: none !important;
}
table[data-measure="tight"] > thead > tr > th,
table[data-measure="tight"] > thead > tr > th *,
table[data-measure="min"] > * > tr > *,
table[data-measure="min"] > * > tr > * * { white-space: normal !important; }

/* Report column labels (replaces heavy tag boxes in list view) */
.rep-full   { font-size: 14.3px; font-weight: 600; color: var(--ok); }
.rep-scored { font-size: 14.3px; color: var(--fg-2); }
.rep-none   { color: var(--fg-3); }
.eval-table .who small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: var(--fg-3);
}

.ent-table tr.ent-row { cursor: pointer; }
.ent-table tr.ent-row.is-selected > td {
  background: var(--primary-soft);
  border-bottom-color: transparent;
}
.ent-table tr.ent-expand-row > td {
  padding: 10px 0 16px;
  background: linear-gradient(180deg, var(--primary-soft) 0 12px, transparent 12px);
  border-bottom: 1px solid var(--border);
  overflow: visible;
  white-space: normal;
  vertical-align: top;
}
.ent-expand {
  width: 75%;
  max-width: 75%;
  margin: 0 auto;
  border: 1px solid #9FCBCE;
  border-radius: 10px;
  background: var(--surface);
  box-shadow: 0 6px 18px rgba(14, 110, 116, 0.10), 0 1px 0 rgba(14, 110, 116, 0.06);
  overflow: hidden;
  position: relative;
}
.ent-expand::before {
  content: "";
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: var(--primary);
}
.ent-expand-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 14px 10px 18px;
  border-bottom: 1px solid #D5E8EA;
  font-size: 13.2px; font-weight: 600; color: var(--primary-text);
  background: #F2F8F8;
}
.ent-expand-head .btn {
  height: 28px;
  padding: 0 10px;
  border-color: #9FCBCE;
  color: var(--primary-text);
  background: var(--surface);
}
.ent-expand-head .btn:hover { background: var(--primary-soft); }
.ent-expand-body {
  max-height: 440px; /* ~10 RFP rows */
  overflow: auto;
  background: var(--surface);
}
.ent-rfp-table {
  width: 100%;
  min-width: 0 !important;
  table-layout: fixed;
}
.ent-rfp-table thead th {
  background: #F7FBFC;
  border-bottom-color: #D5E8EA;
  color: var(--primary-text);
}
.ent-rfp-table th, .ent-rfp-table td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ent-rfp-table .who b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ent-expand-body .empty { padding: 18px 14px; color: var(--fg-2); }

.rfp-table tr.is-selected td { background: var(--primary-soft); }
.row-actions {
  white-space: nowrap;
  overflow: visible !important;
  text-overflow: clip !important;
}
.row-actions .btn {
  height: 30px;
  padding: 0 8px;
  margin-left: 4px;
  vertical-align: middle;
}
.row-actions .btn-icon {
  position: relative;
  width: 30px;
  padding: 0;
  justify-content: center;
}
.row-actions .btn-icon[data-label]:hover::after,
.row-actions .btn-icon[data-label]:focus-visible::after {
  content: attr(data-label);
  position: absolute;
  z-index: 6;
  top: calc(100% + 6px);
  right: 0;
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
  pointer-events: none;
  box-shadow: 0 4px 12px rgba(22, 22, 22, 0.12);
}
.row-actions .btn:first-child { margin-left: 0; }
.list-confirm {
  flex: none;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 16px;
  border: 1px solid #E8BCB8;
  background: var(--bad-soft);
  color: var(--fg);
  font-size: 14.3px; font-weight: 500;
}
.list-confirm .btns { display: flex; gap: 8px; }
.form-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-block: 20px;
  min-height: 0;
}
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(31, 35, 38, 0.45);
}
.modal {
  width: min(420px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 12px 40px rgba(22, 22, 22, 0.18);
}
.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
}
.modal-head h2 {
  margin: 0;
  font-size: 16.5px;
  font-weight: 700;
  color: var(--fg);
}
/* Document preview overlay */
.pv-backdrop {
  position: fixed; inset: 0; z-index: 90;
  display: flex; align-items: stretch; justify-content: center;
  padding: 24px;
  background: rgba(31, 35, 38, 0.55);
}
.pv-backdrop[hidden] { display: none; }
.pv {
  display: flex; flex-direction: column;
  width: min(1180px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  box-shadow: 0 16px 48px rgba(22, 22, 22, 0.24);
}
.pv-head {
  flex: none;
  display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px;
  padding: 12px 16px 12px 20px;
  border-bottom: 1px solid var(--border);
}
.pv-id { flex: 1 1 240px; min-width: 0; }
.pv-kicker { display: block; font-size: 13.2px; font-weight: 600; color: var(--fg-3); }
.pv-id h2 { margin: 0; font-size: 17.6px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pv-actions { display: flex; gap: 8px; }
.pv-bar {
  flex: none;
  padding: 8px 20px;
  border-bottom: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 13.2px; color: var(--fg-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.pv-body { flex: 1 1 auto; min-height: 0; background: #525659; }
.pv-body iframe { display: block; width: 100%; height: 100%; border: 0; }
.btn-preview { color: var(--primary-text); border-color: #9FCBCE; }
.btn-preview:hover { background: var(--primary-soft); }
.btn-preview:disabled { color: var(--fg-3); border-color: var(--border-strong); background: var(--surface-2); cursor: not-allowed; }
@media (max-width: 700px) { .pv-backdrop { padding: 0; } }

.modal-body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}
.ent-create .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 0;
}
.ent-create .field .lbl {
  font-size: 13.2px;
  font-weight: 600;
  color: var(--fg-2);
}
.ent-create .field .req { color: var(--bad); }
.ent-create .field input[type="text"] {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--fg);
  font: inherit;
  font-size: 14.3px;
  outline: 0;
}
.ent-create .field input[type="text"]:focus { border-color: var(--primary); }
.ent-create .field.invalid input[type="text"] { border-color: var(--bad); }
.ent-create .hint,
.ent-create .err {
  margin: 0;
  font-size: 13.2px;
}
.ent-create .hint { color: var(--fg-3); }
.ent-create .err { color: var(--bad); font-weight: 500; }
.ent-create .form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.rfp-locked {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid #9FCBCE;
  background: var(--primary-soft);
  font-size: 14.3px;
  color: var(--primary-text);
}
.rfp-locked b { font-weight: 700; color: var(--fg); }
.rfp-locked .muted { color: var(--fg-2); font-size: 13.2px; }
.prog-mini {
  display: inline-block;
  margin-left: 6px;
  font-size: 12.1px;
  font-weight: 600;
  color: var(--warn);
  vertical-align: middle;
}
.eval-progress { padding: 8px 4px 16px; max-width: 720px; }
.eval-progress-bar {
  height: 10px;
  border: 1px solid #9FCBCE;
  background: #EAF3F4;
  overflow: hidden;
}
.eval-progress-bar > i {
  display: block;
  height: 100%;
  background: var(--primary);
  transition: width 0.45s ease;
}
.eval-progress-meta {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  margin-top: 8px;
  font-size: 13.2px; font-weight: 600; color: var(--primary-text);
}
.eval-progress-meta .muted { font-weight: 500; color: var(--fg-3); }
.eval-stages {
  list-style: none; margin: 22px 0 0; padding: 0;
  display: grid; gap: 10px;
}
.eval-stages li {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  font-size: 14.3px;
  color: var(--fg-3);
}
.eval-stages li b { font-weight: 700; color: var(--fg-2); }
.eval-stages li.active {
  border-color: #9FCBCE;
  background: var(--primary-soft);
  color: var(--primary-text);
}
.eval-stages li.active b { color: var(--primary-text); }
.eval-stages li.done {
  border-color: #B7D4C2;
  background: var(--ok-soft);
  color: var(--ok);
}
.eval-stages li.done b { color: var(--ok); }
.form-panel {
  width: 720px;
  max-width: calc(100% - 32px);
  margin-inline: auto;
  flex: none;
}
.form-panel .form {
  max-width: none;
  width: 100%;
}
.file-list {
  border: 1px solid var(--border);
  background: var(--surface-2);
  padding: 12px 14px;
}
.file-list-label {
  font-size: 13.2px;
  font-weight: 700;
  color: var(--fg-2);
  margin-bottom: 8px;
}
.file-list ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}
.file-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
  padding: 8px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-size: 14.3px;
}
.file-list .file-name {
  flex: 1 1 180px;
  min-width: 0;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.file-list .file-meta { color: var(--fg-3); font-variant-numeric: tabular-nums; }
.field-check .check-line {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 14.3px;
  font-weight: 500;
  color: var(--fg-2);
  cursor: pointer;
}
.field-check .check-line input { margin-top: 3px; }
.rfp-table th {
  white-space: normal;
  vertical-align: bottom;
  line-height: 1.3;
}
.rfp-table td {
  color: var(--fg);
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rfp-table .rfp-ref { font-weight: 600; color: var(--fg-2); }
.rfp-table .rfp-entity,
.rfp-table .rfp-type,
.rfp-table .rfp-assess,
.rfp-table .rfp-date { color: var(--fg-2); }
.rfp-table .who b {
  display: block;
  color: var(--fg);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.rfp-table td.cell-wrap { white-space: normal; overflow-wrap: break-word; }
table[data-justify] th.th-wrap { white-space: normal; }
.rfp-table td.cell-wrap b {
  white-space: normal;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}
.rfp-table .rfp-empty-row td { white-space: normal; overflow: visible; }
.rfp-table .status-ico { vertical-align: middle; }

/* Dense list pages: zebra rows + sticky header */
.rfp-table > thead > tr > th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface);
  box-shadow: inset 0 -2px 0 var(--fg);
}
.rfp-table > tbody > tr:nth-child(even of :not(.ent-expand-row, .rfp-empty-row)) > td {
  background: #ECF3F3;
}
.rfp-table > tbody > tr[data-href]:hover > td {
  background: #DDEBEC;
}
.rfp-table > tbody > tr.is-selected > td,
.ent-table > tbody > tr.ent-row.is-selected > td {
  background: var(--primary-soft);
}
.ent-rfp-table > tbody > tr:nth-child(even) > td { background: #ECF3F3; }
.ent-rfp-table > tbody > tr:hover > td { background: #DDEBEC; }

@media (max-width: 1100px) {
  .rfp-toolbar { flex-wrap: wrap; }
  .rfp-filters { flex: 1 1 100%; overflow-x: auto; }
  .rfp-toolbar-end {
    flex: 1 1 auto;
    margin-left: 0;
    width: 100%;
    justify-content: flex-end;
  }
  .rfp-search-wrap { width: min(280px, 100%); flex: 1 1 200px; }
}

@media (max-width: 700px) {
  .rfp-toolbar-end { justify-content: stretch; }
  .rfp-search-wrap { width: 100%; flex: 1 1 100%; }
  .rfp-toolbar-end .btn { flex: 1 1 auto; justify-content: center; }
}

/* Status icon (icon-only cell with tooltip) */
.status-ico { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; border-radius: 50%; cursor: default; }
.status-ico-ok      { color: var(--ok);   background: var(--ok-soft); }
.status-ico-warn    { color: var(--warn); background: var(--warn-soft); }
.status-ico-bad     { color: var(--bad);  background: var(--bad-soft); }
.status-ico-neutral { color: var(--fg-2); background: var(--surface-2); }

.tag { display: inline-block; padding: 2px 8px; border: 1px solid currentColor; font-size: 13.2px; font-weight: 600; white-space: nowrap; background: transparent; }
.tag-ok { color: var(--ok); background: var(--ok-soft); border-color: #B7D4C2; }
.tag-warn { color: var(--warn); background: var(--warn-soft); border-color: #E8D4A8; }
.tag-bad { color: var(--bad); background: var(--bad-soft); border-color: #E8BCB8; }
.tag-neutral { color: var(--fg-2); background: var(--surface-2); border-color: var(--border-strong); }

.seg { display: inline-flex; flex-wrap: nowrap; border: 1px solid var(--border-strong); overflow: hidden; }
.seg button { padding: 6px 14px; border: 0; background: var(--surface); color: var(--fg-2); font-size: 14.3px; font-weight: 500; cursor: pointer; }
.seg button + button { border-left: 1px solid var(--border-strong); }
.seg button:hover { background: var(--surface-2); }
.seg button[aria-pressed="true"] { background: var(--primary); color: var(--primary-fg); font-weight: 600; }

.crit { min-width: 800px; }
.crit tr.row { cursor: pointer; }
.crit tr.row:hover td { background: var(--surface-2); }
.crit tr.row.open td { background: var(--surface-2); border-bottom-color: transparent; }
.crit-name b { display: block; font-weight: 600; }
.crit-name small { display: block; font-size: 13.2px; color: var(--fg-3); }
.clamp { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--fg-2); max-width: 70ch; }
.toggle { width: 28px; height: 28px; display: grid; place-items: center; border: 1px solid var(--border); background: var(--surface); color: var(--fg-3); cursor: pointer; }
.toggle:hover { border-color: var(--border-strong); color: var(--fg); }
.toggle svg { transition: transform .15s ease; }
tr.open .toggle svg { transform: rotate(180deg); }
tr.detail td { padding: 0 24px 24px; background: var(--surface-2); }
.detail-box { border: 1px solid var(--border); background: var(--surface); padding: 20px 22px; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.detail h4 { margin-bottom: 8px; font-size: 13.2px; font-weight: 700; color: var(--fg); border-bottom: 1px solid var(--border); padding-bottom: 6px; }
.detail p { margin: 0; max-width: 72ch; line-height: 1.6; font-size: 14.3px; }
.detail ul { margin: 0; padding-left: 18px; line-height: 1.6; font-size: 14.3px; }
.detail li + li { margin-top: 6px; }

.explain { color: var(--fg-2); line-height: 1.55; max-width: 90ch; }

/* Side rail — formal summary sheet */
.side-body { padding: 20px 22px 22px; }
.sheet-label { font-size: 12.1px; font-weight: 700; color: var(--fg-3); letter-spacing: 0.04em; text-transform: uppercase; }
.sheet-score { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-top: 8px; padding-bottom: 12px; border-bottom: 2px solid var(--fg); }
.sheet-score .val { font-size: 35.2px; font-weight: 700; line-height: 1; color: var(--hl); }
.sheet-score .of { font-size: 15.4px; font-weight: 500; color: var(--fg-3); }
.sheet-delta { margin-top: 10px; font-size: 14.3px; font-weight: 600; color: var(--fg-2); }
.sheet-table { width: 100%; margin-top: 14px; border-collapse: collapse; font-size: 13.2px; }
.sheet-table th { padding: 6px 0; border-bottom: 1px solid var(--fg); font-size: 12.1px; font-weight: 700; background: transparent; letter-spacing: 0; }
.sheet-table td { padding: 8px 0; border-bottom: 1px solid var(--border); vertical-align: top; }
.sheet-table tr:last-child td { border-bottom: 0; }
.sheet-table th:first-child, .sheet-table td:first-child { padding-left: 0; }
.sheet-table th:last-child, .sheet-table td:last-child { padding-right: 0; }
.sheet-table .n { color: var(--fg-3); width: 22px; font-weight: 600; }
.sheet-table .nm { color: var(--fg-2); padding-right: 8px; line-height: 1.35; overflow-wrap: anywhere; }
.sheet-table .sc { text-align: right; white-space: nowrap; font-weight: 600; color: var(--fg); }
.sheet-table tr.cur td { background: var(--primary-soft); }
.facts { margin: 0; padding: 6px 22px 16px; }
.facts div { display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14.3px; }
.facts div:last-child { border-bottom: 0; }
.facts dt { color: var(--fg-3); }
.facts dd { margin: 0; overflow-wrap: anywhere; }

@media (max-width: 1120px) { .layout { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .user-meta, .brand .brand-names { display: none; }
  .search { flex: 1 1 auto; max-width: none; }
  .sidebar { position: sticky; top: 56px; z-index: 20; width: 100%; height: auto; border-right: 0; border-bottom: 1px solid var(--border); }
  .sidebar.collapsed { width: 100%; }
  .app-body { flex-direction: column; }
  .side-nav { flex-direction: row; overflow-x: auto; padding: 6px 8px; gap: 2px; scrollbar-width: none; }
  .side-nav a { flex: 1; justify-content: center; min-height: 40px; padding: 0 10px; border-left: 0; border-bottom: 3px solid transparent; font-size: 14.3px; }
  .side-nav a.active { border-left-color: transparent; border-bottom-color: var(--primary); }
  .sidebar.collapsed .side-nav a span { display: inline; }
  .side-foot { display: none; }
  tr.detail .detail-box { position: sticky; left: 24px; max-width: calc(100vw - 82px); }
}
@media (max-width: 600px) { .detail-grid { grid-template-columns: minmax(0, 1fr); } .actions { width: 100%; } .facts div { grid-template-columns: minmax(0, 1fr); gap: 2px; } .search kbd { display: none; } }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ───────────────────────────────────────────────────────────────────────────
   Screen layouts: fixed-height pages on desktop (no page scroll).
   Lists page or scroll inside their panel; phones and short windows scroll normally.
   ─────────────────────────────────────────────────────────────────────────── */
.nav-sep { flex: none; width: 1px; margin: 10px 8px; background: var(--border-strong); }
.screen { display: grid; gap: 20px; padding-block: 20px; }
.split { display: grid; grid-template-columns: minmax(300px, 5fr) minmax(0, 7fr); gap: 20px; align-items: start; }
.split.narrow-list { grid-template-columns: minmax(280px, 4fr) minmax(0, 8fr); }
.split.halves { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.flash.bad { border-bottom-color: #E8BCB8; background: var(--bad-soft); color: var(--bad); }
.dash { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; align-items: start; }
.stack { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.panel-body { min-width: 0; }

/* Dashboard board layout (sketch: 3 charts top, list + side bottom) */
.dash-board {
  display: grid;
  grid-template-rows: minmax(220px, 1fr) minmax(240px, 1.15fr);
  gap: 20px;
  min-height: 0;
  height: 100%;
  padding-block: 0;
}
.dash-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.35fr);
  gap: 20px;
  min-height: 0;
  align-items: stretch;
}
.dash-bottom {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(240px, 1fr);
  gap: 20px;
  min-height: 0;
  align-items: stretch;
}
.dash-top > .panel, .dash-bottom > .panel {
  display: flex; flex-direction: column; min-height: 0; min-width: 0;
}
.dash-top > .panel > .panel-head {
  flex: none;
  height: 52px;
  min-height: 52px;
  max-height: 52px;
  flex-wrap: nowrap;
  overflow: hidden;
}
.dash-top > .panel > .chart-body {
  flex: 1 1 auto; min-height: 0; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  padding: 16px 20px 20px;
}
.dash-top > .panel > .chart-body > .chart {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
}
.dash-top > .panel > .chart-body > .chart.chart-donut-wrap,
.dash-top > .panel > .chart-body > .chart.chart-vbars-simple {
  flex-direction: column;
  align-items: stretch;
  justify-content: stretch;
  gap: 8px;
}
.dash-top > .panel > .chart-body.chart-body-fill {
  align-items: stretch;
  justify-content: stretch;
  padding: 4px 12px 8px;
}
.dash-bottom > .panel > .panel-body {
  flex: 1 1 auto; min-height: 0; overflow: auto;
}
.dash-side { display: flex; flex-direction: column; min-height: 0; }
.dash-side .panel-body { flex: 1 1 auto; min-height: 0; overflow: auto; padding: 0; }
.dash-side .pick { min-height: 0; }
.list.compact td { padding-block: 10px; }
.list.compact td.who b { line-height: 1.35; }

/* Dashboard quick links */
.quick-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.quick-card {
  display: block; padding: 20px 22px;
  border: 1px solid var(--border); background: var(--surface); color: inherit;
}
.quick-card:hover { border-color: var(--primary); background: var(--primary-soft); }
.quick-card h3 { margin: 0 0 6px; font-size: 17.6px; font-weight: 700; color: var(--primary-text); }
.quick-card p { margin: 0; font-size: 14.3px; color: var(--fg-2); line-height: 1.5; max-width: 42ch; }
.quick-card .go { display: inline-block; margin-top: 12px; font-size: 14.3px; font-weight: 600; color: var(--primary-text); }

/* Dashboard charts */
.chart-body { padding: 12px 18px 18px; }
.chart-body-grow { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
.chart { min-width: 0; }
.chart-legend {
  display: flex; flex-wrap: wrap; gap: 8px 14px;
  margin: 12px 0 0; padding: 0; list-style: none;
  font-size: 12.1px; color: var(--fg-2);
}
.chart-legend li { display: inline-flex; align-items: center; gap: 6px; max-width: 100%; }
.chart-legend i { width: 8px; height: 8px; flex: none; background: var(--fg-3); }
.chart-legend span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-legend-btn {
  display: inline-flex; align-items: center; gap: 6px;
  max-width: 100%; margin: 0; padding: 2px 4px;
  border: 0; background: transparent; color: var(--fg-2);
  font: inherit; font-size: 12.1px; text-align: left; cursor: pointer;
}
.chart-legend-btn b { font-weight: 700; color: var(--fg); }
.chart-legend-btn { transition: opacity .2s ease, background-color .2s ease, color .2s ease; }
.chart-legend-btn.is-on { background: var(--primary-soft); color: var(--primary-text); box-shadow: inset 3px 0 0 var(--primary); }
.chart-legend-btn.is-dim { opacity: 0.4; }
.chart-legend-btn:hover span { text-decoration: underline; }
.chart-legend-rows {
  flex-direction: column; flex-wrap: nowrap; gap: 0;
  width: 100%; margin: 0; min-height: 0;
}
.chart-legend-rows li { display: block; width: 100%; max-width: none; }
.chart-legend-rows .chart-legend-btn {
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  min-height: 28px;
  padding: 4px 6px;
  border-bottom: 1px solid var(--border);
  font-size: 13.2px;
}
.chart-legend-rows .chart-legend-btn i { width: 10px; height: 10px; }
.chart-legend-rows .chart-legend-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.legend-count { display: inline-flex; align-items: baseline; gap: 6px; }
.legend-note { font-size: 12.1px; font-weight: 500; color: var(--fg-3); }
.chart-hit { cursor: pointer; transition: opacity .2s ease; }
.chart-hit.is-dim { opacity: 0.35; }
[data-dash-clear] { cursor: pointer; }
.dash-filters { display: flex; flex-wrap: nowrap; align-items: center; gap: 8px; min-width: 0; }
.dash-chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px;
  border: 1px solid var(--primary); background: var(--primary-soft); color: var(--primary-text);
  font-size: 13.2px; font-weight: 600; cursor: pointer;
}
.dash-chip-clear { border-color: var(--border-strong); background: var(--surface); color: var(--fg-2); font-weight: 500; }

.chart-hbars { display: flex; flex-direction: column; gap: 8px; }
.chart-hbar { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 10px; align-items: center; }
.chart-hbar-label { font-size: 13.2px; font-weight: 500; color: var(--fg-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chart-hbar-track { height: 10px; background: var(--track, #E4E4E4); overflow: hidden; }
.chart-hbar-track i { display: block; height: 100%; min-width: 2px; }

.chart-donut-wrap {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 100%;
  height: 100%;
  min-height: 0;
}
.chart-donut,
.chart-donut:focus,
.chart-donut:focus-visible,
.chart-donut:focus-within,
.chart-donut *,
.chart-hit:focus,
.chart-hit:focus-visible {
  outline: none;
}
.chart-donut {
  width: auto;
  height: auto;
  max-width: 128px;
  max-height: 128px;
  flex: 0 1 auto;
  aspect-ratio: 1;
  display: block;
  margin-inline: auto;
}
.chart-donut-total { font-size: 17.6px; font-weight: 700; fill: var(--fg); font-family: var(--font-body); }
.chart-donut-wrap .chart-legend { margin: 0; overflow: auto; flex: 1 1 auto; min-height: 0; }
.chart-legend-rows .chart-legend-btn span { white-space: normal; line-height: 1.25; }

.chart-vbars {
  display: flex; flex-direction: column; gap: 4px;
  width: 100%; height: 100%; min-height: 0;
  justify-content: center;
}
.chart-vbars svg { width: 100%; height: 100%; max-height: none; }
.chart-vbars-simple { height: 100%; align-items: stretch; justify-content: flex-end; }
.chart-vbars-simple svg { width: 100%; flex: 1 1 auto; min-height: 0; max-height: none; }
.chart-vbars-simple .chart-legend-rows { flex: none; }
.chart-v-label { font-size: 11px; fill: var(--fg-3); font-family: var(--font-body); }
.chart-v-value { font-size: 11px; font-weight: 700; fill: var(--fg); font-family: var(--font-body); }
.chart-line { width: 100%; height: 100%; min-height: 140px; display: flex; align-items: center; }
.chart-line svg { display: block; width: 100%; height: 100%; max-height: 200px; }
.chart-axis { font-size: 9.9px; fill: var(--fg-3); font-family: var(--font-body); }
.chart-body-center { display: flex; align-items: center; justify-content: center; }
.chart-body-center .chart { width: 100%; height: 100%; }

@media (max-width: 600px) {
  .chart-donut { max-width: 160px; max-height: 160px; }
}

/* Pick list (left pane of a list–detail screen) */
/* One grid for the whole list (rows are subgrids), so the end column — tags, scores — lines up across rows */
.pick { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; column-gap: 10px; list-style: none; margin: 0; padding: 0; }
.pick > li { display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; }
.pick li + li { border-top: 1px solid var(--border); }
.pick button {
  display: grid; grid-column: 1 / -1; grid-template-columns: subgrid; align-items: start;
  width: 100%; padding: 12px 18px 12px 24px; border: 0; background: var(--surface);
  text-align: left; cursor: pointer; font-size: 14.3px;
}
.pick > li.empty { display: block; }
/* Status inside lists is quiet: coloured dot + text, no box */
.stat { display: inline-flex; align-items: center; gap: 6px; font-size: 13.2px; font-weight: 600; white-space: nowrap; }
.stat i { width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }
.stat-ok { color: var(--ok); } .stat-warn { color: var(--warn); } .stat-bad { color: var(--bad); } .stat-neutral { color: var(--fg-2); }
.pick .s .sep { margin: 0 6px; color: var(--fg-3); }
.pick .s .stat { vertical-align: -1px; }
.pick .end .tag { display: inline-flex; align-items: center; gap: 6px; padding: 0; border: 0; background: none; font-size: 13.2px; }
.pick .end .tag::before { content: ""; width: 7px; height: 7px; flex: none; border-radius: 50%; background: currentColor; }
.seg-n { margin-left: 4px; font-size: 12.1px; font-weight: 600; opacity: .7; }
.seg button[disabled] { color: var(--fg-3); background: var(--surface-2); cursor: default; opacity: .6; }
.pick li:nth-child(even) > button { background: #ECF3F3; }
.pick button:hover { background: #DDEBEC; }
.pick button[aria-current="true"] { background: var(--primary-soft); }
.pick button[aria-current="true"] .t { color: var(--primary-text); }
.pick .n { color: var(--fg-3); font-weight: 600; padding-top: 1px; }
.pick .t { font-weight: 600; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.pick .s { display: block; margin-top: 2px; font-size: 13.2px; font-weight: 400; color: var(--fg-3); overflow-wrap: anywhere; }
.pick .end { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; white-space: nowrap; }
.pick .end b { font-size: 14.3px; }
.pick .avatar { width: 28px; height: 28px; font-size: 12.1px; }
.pick.bare { grid-template-columns: minmax(0, 1fr) auto; }
.pick.bare .n { display: none; }

/* Detail pane (right side) */
.pane-body { padding: 20px 24px 24px; }
.pane-kicker { font-size: 12.1px; font-weight: 700; color: var(--fg-3); letter-spacing: 0.04em; text-transform: uppercase; }
.pane-title { margin-top: 4px; font-size: 18.7px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.pane-tags { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; margin-top: 12px; font-size: 14.3px; color: var(--fg-2); }
.pane-tags em { font-style: normal; color: var(--fg-3); margin-right: 4px; }
.pane-foot, .pager, .wizard-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 12px; padding: 10px 24px; border-top: 1px solid var(--border); background: var(--surface-2); font-size: 13.2px; color: var(--fg-2); }
.pane-foot .btns, .pager .btns, .wizard-foot .btns { display: flex; gap: 6px; }
.wizard-foot { border: 1px solid var(--border); }
.confirm { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-top: 20px; padding: 12px 14px; border: 1px solid #E8BCB8; background: var(--bad-soft); color: var(--bad); font-size: 14.3px; font-weight: 500; }
.confirm .btns { display: flex; gap: 6px; margin-left: auto; }
.flash { margin: 0; padding: 10px 24px; border-bottom: 1px solid #B7D4C2; background: var(--ok-soft); color: var(--ok); font-size: 13.2px; font-weight: 600; }
.btn-danger { color: var(--bad); border-color: #E8BCB8; }
.btn-danger:hover { background: var(--bad-soft); }
.btn-danger.solid { background: var(--bad); border-color: var(--bad); color: #fff; }
.btn[disabled] { color: var(--fg-3); background: var(--surface-2); cursor: not-allowed; }

/* Wizard steps in the page-head tab row */
.tab .node { width: 20px; height: 20px; display: grid; place-items: center; border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg-3); font-size: 12.1px; font-weight: 700; }
.tab.done .node { background: var(--primary); border-color: var(--primary); color: var(--primary-fg); }
.tab.active .node { border-color: var(--primary); color: var(--primary-text); }

/* Forms */
.form { display: grid; gap: 16px; max-width: 560px; }
.field label { display: block; margin-bottom: 6px; font-size: 13.2px; font-weight: 700; color: var(--fg); }
.field label .req { color: var(--bad); }
.field input:not([type="file"]):not([type="checkbox"]), .field select, .field textarea {
  width: 100%; padding: 0 12px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--fg); font: inherit; font-size: 14.3px;
}
.field input:not([type="file"]):not([type="checkbox"]), .field select { height: 38px; }
.field textarea { padding: 10px 12px; min-height: 78px; resize: vertical; }
.field input[type="file"] { font-size: 14.3px; }
.field input:focus, .field select:focus, .field textarea:focus { outline: 0; border-color: var(--primary); }
.field.invalid input, .field.invalid select, .field.invalid textarea { border-color: var(--bad); }
.field .hint { margin-top: 4px; font-size: 13.2px; color: var(--fg-3); }
.field .err { margin-top: 4px; font-size: 13.2px; font-weight: 500; color: var(--bad); }
.form-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.profile { display: flex; align-items: center; gap: 16px; }
.avatar-lg { width: 56px; height: 56px; flex: none; border-radius: 50%; overflow: hidden; background: var(--avatar-bg); color: var(--avatar-fg); display: grid; place-items: center; font-size: 19.8px; font-weight: 600; }
.avatar img, .avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.avatar { overflow: hidden; }

@media (max-width: 1280px) {
  .dash { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .quick-grid { grid-template-columns: minmax(0, 1fr); }
}
/* Two-row chart strip only where the page scrolls; in one-screen mode it would squash every chart. */
@media (max-width: 1120px) {
  .dash-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dash-top .panel-wide { grid-column: 1 / -1; }
}
/* Site settings */
.split.settings-split { grid-template-columns: minmax(260px, 3fr) minmax(0, 9fr); }
.settings-split .list { min-width: 0; }
.set-stack { display: flex; flex-direction: column; gap: 22px; }
.set-block { display: grid; gap: 16px; max-width: 760px; padding-top: 20px; border-top: 1px solid var(--border); }
.set-block h3 { margin: 0; font-size: 16.5px; font-weight: 700; }
.set-block p { margin: 0; color: var(--fg-2); font-size: 14.3px; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px 20px; }
.check-group { margin: 0; padding: 0; border: 0; min-width: 0; }
.check-group legend { margin-bottom: 8px; padding: 0; font-size: 13.2px; font-weight: 700; color: var(--fg); }
.check-group legend .req { color: var(--bad); }
.check-row { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.check-row label { display: inline-flex; align-items: center; gap: 8px; font-size: 14.3px; cursor: pointer; }
.check-row input { width: 16px; height: 16px; margin: 0; accent-color: var(--primary); }
.field .static { padding: 8px 0; font-size: 15.4px; font-weight: 600; }
.dt-example { margin: 0; font-size: 14.3px; color: var(--fg-2); }
.dt-example b { color: var(--fg); }
.set-reset { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 16px; border-top: 1px solid var(--border); font-size: 13.2px; color: var(--fg-3); }
tr.editing td { background: var(--primary-soft); }
@media (max-width: 700px) { .field-row { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1120px) { .split, .split.narrow-list, .split.halves { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1280px) { .split.halves { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .dash { grid-template-columns: minmax(0, 1fr); }
  .nav-sep { display: none; }
  .dash-board { grid-template-rows: auto; height: auto; }
  .dash-top, .dash-bottom { grid-template-columns: minmax(0, 1fr); }
}

/* RFP page: one scrolling page, three sections */
.page-flow { display: flex; flex-direction: column; gap: 36px; padding-block: 24px 48px; }
.rfp-sec { display: flex; flex-direction: column; gap: 14px; min-width: 0; scroll-margin-top: 16px; }
.sec-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px 20px; padding-bottom: 10px; border-bottom: 2px solid var(--fg); scroll-margin-top: 16px; }
.sec-head h2 { font-size: 19.8px; }
.sec-head h2 { display: flex; align-items: center; gap: 10px; }
.sec-head h2 .count { font-size: 13.2px; font-weight: 600; line-height: 20px; padding: 0 8px; }
.top-filter { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.topn { display: flex; align-items: center; gap: 4px; font-size: 14.3px; color: var(--fg-2); }
.topn.off input, .topn.off .btn { opacity: .5; }
.topn .btn { width: 32px; padding: 0; justify-content: center; font-size: 17.6px; line-height: 1; }
.topn input { width: 52px; height: 32px; border: 1px solid var(--border-strong); background: var(--surface); color: var(--fg); font: inherit; font-weight: 600; text-align: center; -moz-appearance: textfield; }
.topn input::-webkit-outer-spin-button, .topn input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.topn input:focus { outline: 0; border-color: var(--primary); }
.topn span { margin-left: 4px; }
/* Overview summary sheet: facts | scorecard (shared by RFP and evaluation pages) */
.t-ok { --t: var(--ok); } .t-warn { --t: var(--warn); } .t-bad { --t: var(--bad); } .t-primary { --t: var(--primary); } .t-neutral { --t: var(--fg-3); }
.rfp-sec { container-type: inline-size; }
.ov-sheet { display: grid; grid-template-columns: minmax(300px, 34%) minmax(0, 1fr); overflow: visible; }
.ovs-facts { padding: 4px 24px 12px; background: var(--surface-2); border-right: 1px solid var(--border); }
.ovs-title { padding: 14px 0 8px; border-bottom: 1px solid var(--border-strong); font-size: 12.1px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--primary-text); }
.ovs-facts dl { margin: 0; }
.ovs-facts dl > div { display: grid; grid-template-columns: minmax(110px, 42%) minmax(0, 1fr); gap: 12px; padding: 9px 0; border-bottom: 1px solid var(--border); font-size: 14.3px; }
.ovs-facts dl > div:last-child { border-bottom: 0; }
.ovs-facts dt { color: var(--fg-3); }
.ovs-facts dd { margin: 0; font-weight: 600; color: var(--fg); overflow-wrap: anywhere; }
.ovs-score { display: flex; flex-direction: column; min-width: 0; }
.ovs-metric { flex: 1 1 0; display: grid; grid-template-columns: 180px minmax(0, 1fr) minmax(190px, 27%); gap: 28px; align-items: center; padding: 18px 26px; }
.ovs-metric + .ovs-metric { border-top: 1px solid var(--border); }
.ovs-label { margin-bottom: 6px; font-size: 13.2px; font-weight: 600; color: var(--fg-3); }
.ovs-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; }
.ovs-value b { font-size: 33px; font-weight: 700; line-height: 1.05; letter-spacing: -0.01em; color: var(--fg); }
.ovs-value b.ovs-colored { color: var(--t); }
.ovs-value span { font-size: 13.2px; color: var(--fg-2); }
.ovs-visual { min-width: 0; }
.ovs-stack { display: flex; gap: 2px; height: 10px; background: var(--track); }
.ovs-stack i { display: block; min-width: 4px; background: var(--t); }
.ovs-meter { position: relative; height: 10px; background: var(--track); }
.ovs-bands { position: absolute; inset: 0; background: linear-gradient(to right, var(--bad-soft) 0 40%, var(--warn-soft) 40% 70%, var(--ok-soft) 70%); }
.ovs-meter i { position: absolute; inset: 0 auto 0 0; background: var(--t); }
.ovs-meter + .ov-ticks { margin-top: 6px; margin-inline: 0; }
.ov-scale + .ov-ticks { margin-top: 0; }
.ovs-caption { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13.2px; color: var(--fg-2); }
.ovs-caption b { font-weight: 600; color: var(--fg); }
.ovs-legend { display: flex; flex-direction: column; gap: 5px; margin: 0; padding: 0; list-style: none; }
.ovs-legend li { display: grid; grid-template-columns: 9px minmax(0, 1fr) auto; align-items: center; gap: 8px; }
.ovs-legend i { width: 9px; height: 9px; background: var(--t); }
.ovs-status { display: flex; align-items: center; gap: 8px; font-weight: 600; color: var(--fg); }
.ovs-status i { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--t); }
.ovs-empty { margin: 0; font-size: 14.3px; color: var(--fg-3); }
.ovs-pipe { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; padding: 0; list-style: none; }
.ovs-pipe li { position: relative; display: flex; flex-direction: column; gap: 8px; font-size: 13.2px; color: var(--fg-3); }
.ovs-pipe li::before { content: ""; position: absolute; top: 5px; left: 12px; right: 0; height: 2px; background: var(--border-strong); }
.ovs-pipe li:last-child::before { display: none; }
.ovs-pipe li.done::before { background: var(--primary); }
.ovs-pipe .node { position: relative; z-index: 1; width: 12px; height: 12px; border: 2px solid var(--border-strong); border-radius: 50%; background: var(--surface); }
.ovs-pipe .done .node { border-color: var(--primary); background: var(--primary); }
.ovs-pipe .current .node { border-color: var(--primary); box-shadow: inset 0 0 0 2px var(--surface); background: var(--primary); }
.ovs-pipe .fail .node { border-color: var(--bad); background: var(--bad); }
.ovs-pipe .skip .node { border-color: var(--warn); background: var(--warn); }
.ovs-pipe .done .lbl, .ovs-pipe .current .lbl { font-weight: 600; color: var(--fg); }
.ovs-pipe .fail .lbl { font-weight: 600; color: var(--bad); }
.ovs-pipe .skip .lbl { font-weight: 600; color: var(--warn); }
@container (max-width: 1080px) {
  .ov-sheet { grid-template-columns: minmax(0, 1fr); }
  .ovs-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 32px; border-right: 0; border-bottom: 1px solid var(--border); }
  .ovs-metric { grid-template-columns: 170px minmax(0, 1fr) minmax(170px, 30%); gap: 24px; }
}
@container (max-width: 680px) {
  .ovs-facts { grid-template-columns: minmax(0, 1fr); }
  .ovs-metric { grid-template-columns: minmax(0, 1fr); gap: 12px; }
}
.ov-scale { position: relative; height: 16px; margin-inline: 6px; }
.ov-track { position: absolute; left: 0; right: 0; top: 3px; height: 10px; background: linear-gradient(to right, var(--bad-soft) 0 40%, var(--warn-soft) 40% 70%, var(--ok-soft) 70%); }
.ov-dot { position: absolute; top: 1px; width: 14px; height: 14px; margin-left: -7px; border-radius: 50%; background: var(--t); box-shadow: 0 0 0 2px var(--surface); cursor: pointer; }
.ov-dot:hover, .ov-dot:focus-visible { z-index: 3; transform: scale(1.25); outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--t); }
.tip { position: absolute; bottom: calc(100% + 10px); left: 50%; transform: translateX(-50%); z-index: 5; display: none; flex-direction: column; gap: 3px; width: 240px; padding: 10px 12px; background: var(--fg); color: var(--surface); font-size: 13.2px; line-height: 1.4; text-align: left; box-shadow: 0 6px 20px rgba(0, 0, 0, .18); pointer-events: none; }
.tip::after { content: ""; position: absolute; top: 100%; left: 50%; margin-left: -5px; border: 5px solid transparent; border-top-color: var(--fg); }
.tip-end .tip { left: auto; right: -8px; transform: none; } .tip-end .tip::after { left: auto; right: 10px; }
.tip-start .tip { left: -8px; transform: none; } .tip-start .tip::after { left: 12px; }
.ov-dot:hover .tip, .ov-dot:focus-visible .tip { display: flex; }
.tip b { font-size: 14.3px; }
.tip-score { font-size: 19.8px; font-weight: 700; } .tip-score small { font-size: 13.2px; font-weight: 400; opacity: .7; }
.tip-row { overflow-wrap: anywhere; } .tip .muted { color: inherit; opacity: .72; }
.ov-ticks { position: relative; height: 14px; margin: -6px 6px 0; font-size: 12.1px; color: var(--fg-3); }
.ov-ticks span { position: absolute; transform: translateX(-50%); }
.ov-ticks span:nth-child(1) { left: 0; transform: none; } .ov-ticks span:nth-child(2) { left: 40%; } .ov-ticks span:nth-child(3) { left: 70%; } .ov-ticks span:nth-child(4) { right: 0; transform: none; }
/* Element analysis headings carry meaning by colour */
.section[data-k] h4 { display: flex; align-items: center; gap: 8px; border-bottom: 2px solid var(--k, var(--border)); }
.section[data-k] h4::before { content: ""; width: 8px; height: 8px; background: var(--k, var(--fg-3)); flex: none; }
.section[data-k="standard"] { --k: var(--fg-2); }
.section[data-k="rfp"] { --k: var(--primary); }
.section[data-k="impact"] { --k: var(--bad); }
.section[data-k="recommended"] { --k: var(--ok); }
.section[data-k="implementation"] { --k: var(--warn); }
.section[data-k="coverage"] { --k: var(--primary); }
.section[data-k="gap"] { --k: var(--bad); }
/* Score with bar */
.score-bar { display: flex; align-items: center; gap: 10px; min-width: 140px; }
.score-bar b { width: 46px; text-align: right; font-size: 16.5px; font-weight: 700; }
.sb-track { flex: 1; height: 6px; background: var(--track); }
.sb-track i { display: block; height: 100%; background: var(--t); }
.page-flow .rank { min-width: 0; }
.page-flow .rank .who small { display: block; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-flow .rank td:nth-child(6) { white-space: nowrap; }
.ov-dot.cur { width: 18px; height: 18px; margin-left: -9px; top: -1px; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--fg); z-index: 2; }
/* Assessment finding: requirement vs finding → impact → remediation */
.page-flow .split { grid-template-columns: minmax(260px, 28%) minmax(0, 1fr); }
.finding { display: flex; flex-direction: column; gap: 22px; margin-top: 18px; }
.fd-stage { display: flex; flex-direction: column; gap: 10px; }
.fd-step { display: flex; align-items: center; gap: 10px; font-size: 13.2px; font-weight: 700; color: var(--fg-2); }
.fd-step span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--fg); color: var(--surface); font-size: 12.1px; }
.fd-row { display: grid; gap: 12px; }
.fd-compare { grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: stretch; }
.fd-two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.fd-arrow { display: grid; place-items: center; color: var(--fg-3); }
.fd-card { padding: 14px 16px 16px; background: var(--surface); border: 1px solid var(--border); border-top: 3px solid var(--c, var(--fg-3)); min-width: 0; }
.fd-k { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; font-size: 12.1px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--c-text, var(--fg-2)); }
.fd-k::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--c, var(--fg-3)); flex: none; }
.fd-card p { margin: 0; font-size: 14.3px; line-height: 1.65; color: var(--fg); overflow-wrap: anywhere; }
.fd-expected { --c: #8A9096; --c-text: var(--fg-2); }
.fd-found { --c: var(--primary); --c-text: var(--primary-text); }
.fd-impact { --c: var(--bad); --c-text: var(--bad); }
.fd-improve { --c: var(--ok); --c-text: var(--ok); }
.fd-notes { --c: var(--fg-2); --c-text: var(--fg-2); }
.fd-caution { --c: var(--warn); --c-text: var(--warn); }
.fd-card ul { margin: 0; padding-left: 18px; font-size: 14.3px; line-height: 1.6; color: var(--fg); }
.fd-card li + li { margin-top: 6px; }
.fd-grid { display: grid; grid-template-columns: repeat(var(--cols, 3), minmax(0, 1fr)); gap: 12px; }
@container (max-width: 820px) { .fd-grid { grid-template-columns: minmax(0, 1fr); } }
/* Report brief: lead (summary + side readout), then coded lists */
.brief { display: flex; flex-direction: column; gap: 12px; }
.brief-lead { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 28%); gap: 28px; align-items: center; }
.brief-lead.solo { grid-template-columns: minmax(0, 1fr); }
.brief-text p, .brief-text ul { margin: 0; max-width: 95ch; font-size: 15.4px; line-height: 1.7; color: var(--fg); }
.brief-text ul { padding-left: 20px; }
.brief-text .fd-k + p, .brief-text .fd-k + ul { margin-bottom: 14px; }
.brief-text > :last-child { margin-bottom: 0; }
.brief-side { display: flex; flex-direction: column; gap: 12px; align-self: stretch; justify-content: center; padding-left: 26px; border-left: 1px solid var(--border); }
.brief-side .ovs-label { margin: 0; }
.brief-counts { display: grid; grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); gap: 8px; }
.brief-counts div { display: flex; flex-direction: column; gap: 2px; }
.brief-counts b { font-size: 28.6px; font-weight: 700; line-height: 1; color: var(--t); }
.brief-counts span { font-size: 13.2px; color: var(--fg-2); }
.fd-k .count { margin-left: 2px; letter-spacing: 0; text-transform: none; }
.brief-list { margin: 0; padding: 0; list-style: none; }
.brief-list li { display: grid; grid-template-columns: 34px minmax(0, 1fr); gap: 8px; padding: 10px 0; border-top: 1px solid var(--border); font-size: 14.3px; line-height: 1.55; color: var(--fg); }
.brief-list li:first-child { padding-top: 2px; border-top: 0; }
.brief-list li:last-child { padding-bottom: 0; }
.brief-list .code { padding-top: 1px; font-size: 12.1px; font-weight: 700; color: var(--c-text, var(--fg-2)); }
@container (max-width: 820px) {
  .brief-lead { grid-template-columns: minmax(0, 1fr); }
  .brief-side { padding: 16px 0 0; border-left: 0; border-top: 1px solid var(--border); }
}
.fd-grid .fd-card.wide p { max-width: 110ch; }
.fd-scoreline { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; margin-top: 12px; font-size: 14.3px; color: var(--fg-2); }
.fd-scoreline b { color: var(--fg); font-weight: 700; }
.fd-mini { position: relative; width: 140px; height: 8px; overflow: hidden; border-radius: 4px; background: var(--track); }
.fd-mini i { position: absolute; inset: 0 auto 0 0; background: var(--t); }
@media (max-width: 1280px) { .fd-compare, .fd-two { grid-template-columns: minmax(0, 1fr); } .fd-arrow { transform: rotate(90deg); } }
.page-flow .split { height: auto; align-items: stretch; }
/* Responsive: optional columns drop out before the table overflows */
@media (max-width: 1399px) { .page-flow .rank .opt { display: none; } }
@media (max-width: 1099px) { table[data-justify] .opt-sm { display: none; } }
@media (max-width: 1099px) { .page-flow .rank .opt2 { display: none; } th, td { padding-inline: 8px; } th:first-child, td:first-child { padding-left: 14px; } th:last-child, td:last-child { padding-right: 14px; } }
/* Filter buttons in a narrow list become a 2-column grid instead of spilling out */
.page-flow .split > .panel:first-child, .dash-side { container-type: inline-size; }
/* Short chart boxes (one-screen mode on low screens): donut beside its legend instead of above it */
.dash-top > .panel > .chart-body { container-type: size; }
@container (max-height: 280px) {
  .dash-top .chart-donut { max-width: 76px; max-height: 76px; }
  .dash-top .chart-legend-rows .chart-legend-btn { min-height: 22px; padding-block: 1px; font-size: 12.1px; }
  .dash-top .chart-legend-rows .chart-legend-btn span { white-space: nowrap; }
}
/* Low screens in one-screen mode: charts get a bigger share; the lists below scroll anyway */
@media (max-height: 800px) { :where(body.fit) .dash-board { grid-template-rows: minmax(0, 1.12fr) minmax(0, 1fr); } }
@container (max-width: 440px) {
  .panel-head .seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .panel-head .seg button { white-space: normal; border-top: 1px solid var(--border-strong); margin-top: -1px; }
  .panel-head .seg button:nth-child(odd) { border-left: 0; }
  .pick { grid-template-columns: 52px minmax(0, 1fr); }
  .pick button { row-gap: 6px; }
  .pick .end { grid-column: 2; flex-direction: row; align-items: center; justify-content: flex-start; }
  .pick.bare { grid-template-columns: minmax(0, 1fr); }
  .pick.bare .end { grid-column: 1; }
  .pick .s .sep { display: none; }
  .pick .s .stat { display: flex; width: fit-content; margin-block: 2px; }
}
/* One system: slight rounding on every boxed element (tokens: --radius-sm 3px, --radius 5px, --radius-lg 8px) */
.tag, .chip, .status-chip, .count, kbd, .dash-chip, .chart-legend-btn, .status-chip i { border-radius: var(--radius-sm); }
.search, .icon-btn, .seg, .col-filter, .rfp-search-wrap, .confirm, .list-confirm, .tip, .fd-card, .file-list,
.field input:not([type="file"]):not([type="checkbox"]), .field select, .field textarea, .topn input, [data-page-size], .side-nav a, .side-toggle { border-radius: var(--radius); }
.pv, .ov-sheet { border-radius: var(--radius-lg); }
.ovs-facts { border-radius: var(--radius-lg) 0 0 var(--radius-lg); }
.ovs-stack, .ovs-meter, .ov-track, .sb-track, .chart-hbar-track { border-radius: 3px; overflow: hidden; }
.field input[type="file"]::file-selector-button {
  height: 34px; margin-right: 12px; padding: 0 14px; border: 1px solid var(--border-strong); border-radius: var(--radius);
  background: var(--surface); color: var(--fg); font: inherit; font-weight: 500; cursor: pointer;
}
.field input[type="file"]::file-selector-button:hover { background: var(--surface-2); }
.page-head.no-crumbs .title-row { padding-top: 22px; margin-top: 0; }
@container (max-width: 1080px) { .ovs-facts { border-radius: var(--radius-lg) var(--radius-lg) 0 0; } }
.page-flow .split > .panel { display: flex; flex-direction: column; min-height: 0; max-height: clamp(420px, calc(100dvh - 150px), 860px); }
.page-flow .split > .panel > .panel-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
@media (max-width: 1120px) {
  .page-flow .split { height: auto; grid-template-columns: minmax(0, 1fr); }
  .page-flow .split > .panel > .panel-body { max-height: 520px; }
}

/* Reading pages (RFP + evaluation): room to breathe, one inner padding (24px), one type scale.
   The list and the reading pane share a top edge and height; the pane header stays pinned while you read. */
.page-flow { gap: 64px; padding-block: 32px 72px; }
.page-flow .rfp-sec { gap: 20px; }
.page-flow .sec-head { padding-bottom: 12px; }
.page-flow .pick button { padding-block: 14px; }
.page-flow .split { grid-template-columns: minmax(300px, 1fr) minmax(0, 860px); gap: 24px; align-items: stretch; }
.page-flow .split > .panel { max-height: none; scroll-margin-top: 0; }
.page-flow .split > .panel:first-child { position: sticky; top: 0; align-self: start; height: calc(100dvh - 87px); }
.page-flow .split > .panel:last-child { min-height: calc(100dvh - 87px); overflow: visible; }
.page-flow .split > .panel:last-child > .panel-body { overflow: visible; max-height: none; }
.page-flow .pane-top { position: sticky; top: 0; z-index: 4; display: flex; align-items: flex-start; justify-content: space-between; gap: 12px 24px;
  padding: 20px 24px 18px; border-bottom: 1px solid var(--border); border-radius: var(--radius-lg) var(--radius-lg) 0 0; background: var(--surface); }
.page-flow .pane-top-main { min-width: 0; }
.page-flow .pane-nav { display: flex; flex: none; align-items: center; gap: 6px; font-size: 13.2px; color: var(--fg-3); }
.page-flow .pane-nav > span { margin-right: 6px; white-space: nowrap; }
.page-flow .pane-title { margin-top: 4px; font-size: 17.6px; line-height: 1.4; }
.page-flow .pane-tags, .page-flow .fd-scoreline { margin-top: 10px; }
.page-flow .pane-body { padding: 24px 24px 32px; }
/* Cards view: list rows read as pressable items; the selected one is filled petrol and its
   analysis pane header carries the same hue, so the pair reads as "this item → this analysis". */
.pick-hint { flex: none; display: flex; align-items: center; gap: 8px; padding: 12px 24px; border-bottom: 1px solid var(--border);
  background: var(--surface-2); font-size: 13.2px; font-weight: 600; color: var(--fg-2); }
.pick-hint-arrow { display: inline-grid; color: var(--primary); }
.page-flow .split .pick { grid-template-columns: 52px minmax(0, 1fr) auto; }
.page-flow .split .pick .end { grid-column: 3; flex-direction: column; align-self: stretch; justify-content: center; }
.page-flow .split .pick .end::after { content: ""; width: 8px; height: 8px; margin-right: 4px; border-top: 2px solid var(--fg-3); border-right: 2px solid var(--fg-3); transform: rotate(45deg); }
.page-flow .split .pick button:hover .end::after { border-color: var(--primary); }
.page-flow .split .pick button:focus-visible { outline-offset: -3px; }
.page-flow .split .pick button[aria-current="true"],
.page-flow .split .pick button[aria-current="true"]:hover { background: var(--primary); color: var(--primary-fg); }
.page-flow .split .pick button[aria-current="true"] :is(.t, .n, .s, .stat, .sep) { color: var(--primary-fg); }
.page-flow .split .pick button[aria-current="true"] .n { opacity: 0.8; }
.page-flow .split .pick button[aria-current="true"] .stat i { box-shadow: 0 0 0 1.5px var(--primary-fg); }
.page-flow .split .pick button[aria-current="true"] .stat-ok i { background: var(--ok); }
.page-flow .split .pick button[aria-current="true"] .stat-warn i { background: var(--warn); }
.page-flow .split .pick button[aria-current="true"] .stat-bad i { background: var(--bad); }
.page-flow .split .pick button[aria-current="true"] .end::after { border-color: var(--primary-fg); }
.page-flow .split .pane-top { background: var(--primary-soft); border-bottom-color: #B9D8DA; }
.page-flow .split .pane-kicker { color: var(--primary-text); }
@media (max-width: 1120px) { .pick-hint-arrow { transform: rotate(90deg); } }
.page-flow .finding { gap: 32px; margin-top: 0; }
.page-flow .fd-stage { gap: 12px; }
.page-flow .fd-row { gap: 12px; }
.page-flow .fd-compare, .page-flow .fd-two { grid-template-columns: minmax(0, 1fr); }
.page-flow .fd-arrow { height: 16px; transform: rotate(90deg); }
.page-flow .fd-card { padding: 18px 24px 22px; }
.page-flow .fd-k { margin-bottom: 10px; }
.page-flow .fd-card p, .page-flow .fd-card ul, .page-flow .brief-text p, .page-flow .brief-text ul { font-size: 15.4px; line-height: 1.75; }
.page-flow .brief-text p, .page-flow .brief-text ul { max-width: 90ch; }
.page-flow .brief, .page-flow .fd-grid { gap: 20px; }
.page-flow .brief-list li { padding: 14px 0; font-size: 15.4px; line-height: 1.65; }
.page-flow .brief-list li:first-child { padding-top: 4px; }
.page-flow .ovs-metric { padding: 24px; }
.page-flow .ovs-facts dl > div { padding: 12px 0; }
@media (max-width: 1120px) {
  .page-flow .split { grid-template-columns: minmax(0, 1fr); }
  .page-flow .split > .panel:first-child { position: static; height: auto; }
  .page-flow .split > .panel:last-child { min-height: 0; }
}

/* Detail pages: original report tables in the current theme */
.classic { table-layout: fixed; min-width: 0; }
/* Heading levels on detail pages: page title 24.2 → section 21 → status group 16.5 → column headings 13.2 (grey) → body 14.3 */
.classic-flow .sec-head h2 { font-size: 21px; }
.classic th { white-space: normal; padding-block: 12px; border-bottom-width: 1px; border-bottom-color: var(--border-strong); background: var(--surface-2);
  font-size: 13.2px; font-weight: 600; letter-spacing: .02em; color: var(--fg-2); }
.classic td { vertical-align: top; font-size: 14.3px; line-height: 1.65; white-space: normal; overflow-wrap: anywhere; }
.classic td b { font-weight: 600; }
.classic td.num { white-space: nowrap; overflow-wrap: normal; }
.classic td p, .classic td ul { margin: 0; }
.classic td ul { padding-left: 18px; }
.classic td li + li { margin-top: 6px; }
.classic td .stat { margin-top: 4px; }
/* Zebra rows, same shades as the list tables */
.classic > tbody > tr:nth-child(even) > td, .page-flow .rank > tbody > tr:nth-child(even) > td { background: #ECF3F3; }
.page-flow .rank > tbody > tr[data-href]:hover > td { background: #DDEBEC; }
.classic tfoot td { padding-block: 16px; border-top: 2px solid var(--fg); background: #D5E9EB; vertical-align: middle; }
.tot-label { display: block; font-size: 15.4px; font-weight: 700; color: var(--fg); }
.tot-pct { display: block; margin-top: 2px; font-size: 13.2px; font-weight: 600; color: var(--t); }
.tot-max { font-size: 16.5px; color: var(--fg); }
.score-hl { font-size: 22px; font-weight: 700; line-height: 1.1; color: var(--t); }
.classic .row-hl > td { background: #D5E9EB; vertical-align: middle; }
.classic-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.classic-facts > div { display: flex; flex-direction: column; gap: 4px; padding: 14px 24px; border-bottom: 1px solid var(--border); border-right: 1px solid var(--border); min-width: 0; }
.classic-facts > div:nth-child(3n) { border-right: 0; }
.classic-facts > div:nth-last-child(-n+3) { border-bottom: 0; }
.classic-facts dt { font-size: 13.2px; color: var(--fg-3); }
.classic-facts dd { margin: 0; font-size: 15.4px; font-weight: 600; overflow-wrap: anywhere; }
.an-list { display: grid; gap: 12px; margin: 0; }
.an-list dt { margin-bottom: 2px; font-size: 13.2px; font-weight: 700; color: var(--fg); }
.an-list dd { margin: 0; }
.classic td p.muted { margin-top: 10px; }
.classic-sub { display: flex; align-items: center; gap: 10px; margin: 8px 0 0; font-size: 16.5px; }
.classic-sub .stat { font-size: 16.5px; }
.classic-flow .rfp-sec > .classic-sub:first-of-type { margin-top: 0; }
@media (max-width: 900px) { .classic-facts { grid-template-columns: minmax(0, 1fr); } .classic-facts > div { border-right: 0; } }

/* One-screen (fit) mode: the "fit" class on body is set by the app (see fitMode() in app.js). */
body:where(.fit) { height: 100dvh; overflow: hidden; display: flex; flex-direction: column; }
:where(body.fit) .app-header { flex: none; }
:where(body.fit) .app-body { flex: 1 1 auto; min-height: 0; overflow: hidden; }
:where(body.fit) .sidebar { height: 100%; overflow: hidden; }
:where(body.fit) #view { overflow: hidden; }
:where(body.fit) #view.page-scroll { overflow-y: auto; }
:where(body.fit) #view.page-scroll > * { flex: none; }
:where(body.fit) #view > main.wrap { width: 100%; }
:where(body.fit) .page-head { flex: none; }
:where(body.fit) .crumbs { padding-top: 14px; }
:where(body.fit) .title-row { margin-top: 2px; }
:where(body.fit) .meta { margin-top: 8px; }
:where(body.fit) .tabs { margin-top: 10px; }
:where(body.fit) .page-head.flat .title-row { padding-bottom: 14px; }
:where(body.fit) .screen { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
:where(body.fit) .screen.rfp-screen { padding-block: 20px; }
:where(body.fit) .screen.layout { padding-block: 20px; gap: 20px; align-items: stretch; display: grid; grid-template-rows: minmax(0, 1fr); }
:where(body.fit) .screen > *, :where(body.fit) .screen .col-main, :where(body.fit) .screen .col-side, :where(body.fit) .stack { min-height: 0; }
:where(body.fit) .screen .col-side { overflow: auto; }
:where(body.fit) .col-main.flow { display: flex; flex-direction: column; gap: 16px; }
:where(body.fit) .col-main.flow > .grow-area { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }
:where(body.fit) .split, :where(body.fit) .dash { height: 100%; min-height: 0; align-items: stretch; }
:where(body.fit) .dash-board { flex: 1 1 auto; height: auto; min-height: 0; }
:where(body.fit) .screen:has(.dash-board) { display: flex; flex-direction: column; }
:where(body.fit) .split > .panel, :where(body.fit) .dash .panel.grow, :where(body.fit) .panel.grow { display: flex; flex-direction: column; min-height: 0; }
:where(body.fit) .panel.grow { flex: 1 1 auto; }
:where(body.fit) .panel.grow > .panel-body, :where(body.fit) .split > .panel > .panel-body { flex: 1 1 auto; min-height: 0; overflow: auto; }
:where(body.fit) .panel.grow > .chart-body-grow { flex: 1 1 auto; min-height: 0; overflow: auto; }
:where(body.fit) .panel-body thead th { position: sticky; top: 0; z-index: 1; background: var(--surface); }
:where(body.fit) .grow-area > .split, :where(body.fit) .grow-area > .dash { flex: 1 1 auto; height: auto; }
:where(body.fit) .dash > .stack { overflow: auto; }
