/* CEI Bid Monitor design system: "Interstate".
   One typeface (Overpass, a descendant of the US highway sign alphabet) with tabular figures.
   Color follows the road-sign code, so a glance reads like a highway:
     red    = stop: HOT, overdue, destructive
     yellow = warning: WARM, due soon, things to check
     green  = guide: SDVOSB, go, won, done
     blue   = services: pipeline, new, information
   Tier and set-aside "plates" keep the same colors in light and dark, like reflective signs.
   Every color is a token; light-dark(light value, dark value). The page picks the scheme:
   data-theme="auto" follows the device, "light" or "dark" locks it.
   Page-specific components live in app-pages.css. */

/* Overpass marks U+00B7 (middle dot) as a combining mark, so it renders with zero width.
   Route only that character to a system face; everything else stays Overpass. */
@font-face {
  font-family: "UI Dot";
  src: local("Helvetica Neue"), local("Arial"), local("Segoe UI"), local("Roboto"), local("DejaVu Sans");
  unicode-range: U+00B7;
}
@font-face {
  font-family: "Overpass";
  src: url("fonts/overpass-latin-wght-normal.woff2") format("woff2");
  font-weight: 100 900; font-style: normal; font-display: swap;
}

:root {
  color-scheme: light dark;

  /* neutrals */
  --canvas: light-dark(#eceef1, #0c0f13);
  --surface: light-dark(#ffffff, #14181e);
  --surface-2: light-dark(#f5f6f8, #1a1f26);
  --surface-3: light-dark(#e8ebef, #232932);
  --ink: light-dark(#0f141a, #eef1f5);
  --ink-2: light-dark(#3b4450, #b9c1cc);
  --ink-3: light-dark(#5d6876, #8d97a5);
  --line: light-dark(#dde1e6, #242b34);
  --line-2: light-dark(#c5ccd4, #343d48);

  /* the rail (left navigation) is asphalt in both themes */
  --rail: light-dark(#12161c, #080a0d);
  --rail-ink: #aab4c0;
  --rail-ink-strong: #ffffff;
  --rail-line: rgba(255, 255, 255, 0.08);
  --rail-hover: rgba(255, 255, 255, 0.06);
  --rail-active: rgba(255, 255, 255, 0.11);
  --rail-focus: #86adff;

  /* actions: navy in light, reflective white in dark. Red is never a button color. */
  --primary: light-dark(#0e2c52, #e8edf3);
  --primary-hover: light-dark(#0a213e, #ffffff);
  --primary-ink: light-dark(#ffffff, #0c0f13);

  /* sign plates: identical in both themes */
  --sign-red: #b5122b;
  --sign-red-ink: #ffffff;
  --sign-yellow: #f4b400;
  --sign-yellow-ink: #15120a;
  --sign-green: #0d6b4a;
  --sign-green-ink: #ffffff;
  --sign-blue: #1d4f9c;
  --sign-blue-ink: #ffffff;
  --sign-gray: light-dark(#e3e7ec, #2a313a);
  --sign-gray-ink: light-dark(#2f3843, #c9d0d9);

  /* semantic text and tints */
  --hot: light-dark(#b5122b, #ff6b7c);
  --hot-bg: light-dark(#fcebee, #34141a);
  --warm: light-dark(#8a5700, #f3c14b);
  --warm-bg: light-dark(#fdf4d9, #2d2510);
  --warm-line: light-dark(#ecd28f, #5a4718);
  --ok: light-dark(#0d6b4a, #55c893);
  --ok-bg: light-dark(#e3f2eb, #10291f);
  --info: light-dark(#1d4f9c, #86adff);
  --info-bg: light-dark(#e7eefa, #152238);
  --low: light-dark(#4a5562, #b3bcc8);
  --low-bg: light-dark(#eef0f3, #1e242c);
  --focus: light-dark(#1d4f9c, #86adff);
  --focus-ring: light-dark(rgba(29, 79, 156, 0.28), rgba(134, 173, 255, 0.32));

  --shadow-pop: 0 1px 2px light-dark(rgba(15, 20, 26, 0.06), rgba(0, 0, 0, 0.4)),
                0 16px 40px -18px light-dark(rgba(15, 20, 26, 0.35), rgba(0, 0, 0, 0.85));

  /* type: one family; figures are tabular wherever numbers line up */
  --font-ui: "UI Dot", "Overpass", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --font-display: var(--font-ui);
  --font-code: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --text-xs: 0.75rem;
  --text-sm: 0.8125rem;
  --text-base: 0.9375rem;
  --text-md: 1.0625rem;
  --text-lg: 1.25rem;
  --text-xl: 1.625rem;
  --text-2xl: clamp(1.75rem, 1.45rem + 0.9vw, 2.25rem);
  --weight-strong: 680;
  --weight-heavy: 780;
  --display-tracking: -0.028em;
  --text-pad-top: 0.12em; /* Overpass sits high in its line box; nudge single-line controls */

  /* shape: radius steps with hierarchy (panel > control > plate) */
  --r-plate: 5px;
  --r-control: 8px;
  --r-panel: 12px;
  --r-pill: 999px;

  --s-1: 0.25rem;
  --s-2: 0.5rem;
  --s-3: 0.75rem;
  --s-4: 1rem;
  --s-5: 1.5rem;
  --s-6: 2rem;
  --s-7: 3rem;

  --control-h: 2.5rem;
  --control-h-sm: 2rem;
  --cell-y: 0.95rem;
  --rail-w: 15.5rem;
  --rail-w-compact: 4.5rem;
  --page-max: 82rem;
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
  --fast: 120ms;
}
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

/* ---- base ------------------------------------------------------------- */

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--canvas); color: var(--ink);
  font: 400 var(--text-base)/1.5 var(--font-ui); font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; }
h1, h2, h3 { line-height: 1.2; text-wrap: balance; }
p { text-wrap: pretty; }
code { font-family: var(--font-code); font-size: 0.86em; background: var(--low-bg); padding: 1px 5px; border-radius: 4px; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.mono { font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }
.muted { color: var(--ink-3); }
.small { font-size: var(--text-sm); }
.strong { font-weight: var(--weight-strong); }
.ok-text { color: var(--ok); font-weight: 650; }
.error-text { color: var(--hot); }
.inline { display: inline; margin: 0; }
.sr-only, .visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.link-quiet { color: var(--ink-3); font-size: var(--text-sm); }
.link-quiet:hover { color: var(--ink); }

.skip-link {
  position: absolute; left: var(--s-4); top: -3rem; z-index: 20; padding: var(--s-2) var(--s-3);
  background: var(--surface); color: var(--ink); border-radius: var(--r-control); box-shadow: var(--shadow-pop);
}
.skip-link:focus { top: var(--s-2); }

/* ---- shell: rail + canvas ------------------------------------------------ */

.has-shell .shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); min-height: 100vh; }
.appbar {
  position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: var(--s-5);
  padding: var(--s-4) var(--s-3); background: var(--rail); color: var(--rail-ink);
  border-right: 1px solid var(--rail-line);
}
.brand { display: inline-flex; align-items: center; gap: 0.6rem; padding: var(--s-1) var(--s-2); text-decoration: none; color: var(--rail-ink-strong); }
.brand-mark {
  display: inline-grid; place-items: center; height: 1.75rem; padding: var(--text-pad-top) 0.55rem 0;
  font-size: 0.8125rem; font-weight: 850; letter-spacing: 0.08em;
  background: var(--sign-red); color: #ffffff; border-radius: var(--r-plate);
  outline: 1.5px solid rgba(255, 255, 255, 0.92); outline-offset: -3.5px;
}
.brand-name { font-family: var(--font-display); font-size: 1.0625rem; font-weight: var(--weight-heavy); letter-spacing: -0.015em; }
.appbar-panel { display: flex; flex: 1 1 auto; flex-direction: column; gap: var(--s-5); }
.nav { display: grid; gap: var(--s-3); }
.nav-group { list-style: none; margin: 0; padding: 0 0 var(--s-3); display: grid; gap: 2px; border-bottom: 1px solid var(--rail-line); }
.nav-group:last-child { padding-bottom: 0; border-bottom: 0; }
.nav-link {
  position: relative; display: flex; align-items: center; gap: 0.7rem; width: 100%; min-height: 2.25rem; padding: var(--text-pad-top) 0.65rem 0;
  border: 0; border-radius: var(--r-control); background: none; color: var(--rail-ink);
  font: inherit; font-size: 0.875rem; font-weight: 520; text-align: left; text-decoration: none; cursor: pointer;
  transition: background var(--fast) var(--ease), color var(--fast) var(--ease);
}
.nav-link .icon { flex: none; margin-top: calc(-1 * var(--text-pad-top)); opacity: 0.8; }
.nav-link:hover { background: var(--rail-hover); color: var(--rail-ink-strong); }
.nav-link[aria-current="page"] { background: var(--rail-active); color: var(--rail-ink-strong); font-weight: 680; }
.nav-link[aria-current="page"] .icon, .nav-link:hover .icon { opacity: 1; }
.nav-link:focus-visible { outline-color: var(--rail-focus); outline-offset: -2px; }
.nav-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  display: inline-grid; place-items: center; min-width: 1.25rem; height: 1.25rem; margin-left: auto; padding: 0.1rem 0.35rem 0;
  border-radius: var(--r-pill); background: var(--sign-red); color: #ffffff; font-size: var(--text-xs); font-weight: 800;
}
.appbar-foot { display: grid; gap: 2px; margin-top: auto; padding-top: var(--s-3); border-top: 1px solid var(--rail-line); }
.avatar {
  flex: none; display: inline-grid; place-items: center; width: 1.375rem; height: 1.375rem; margin-top: calc(-1 * var(--text-pad-top));
  padding-top: var(--text-pad-top); border-radius: 50%; background: var(--sign-blue); color: #ffffff; font-size: 0.75rem; font-weight: 800;
}
.nav-user .nav-text { color: var(--rail-ink-strong); font-weight: 650; }

.theme-switch { margin: var(--s-2) 0 0; }
.theme-options { display: flex; gap: 2px; padding: 3px; border-radius: var(--r-control); background: rgba(255, 255, 255, 0.05); }
.theme-options button {
  flex: 1 1 0; display: inline-grid; place-items: center; height: 1.875rem; padding: 0; border: 0;
  border-radius: 6px; background: transparent; color: var(--rail-ink); cursor: pointer;
  transition: color var(--fast) var(--ease), background var(--fast) var(--ease);
}
.theme-options button:hover { color: var(--rail-ink-strong); }
.theme-options button[aria-pressed="true"] { background: rgba(255, 255, 255, 0.14); color: #ffffff; }
.theme-options button:focus-visible { outline: 2px solid var(--rail-focus); outline-offset: -2px; }

/* CSS-only toggles: hidden (and out of the tab order) until the layout that uses them. */
.menu-toggle, .toggle-input { display: none; position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.menu-button { display: none; }

.publicbar {
  display: flex; align-items: center; justify-content: space-between; gap: var(--s-4);
  max-width: var(--page-max); margin: 0 auto; padding: var(--s-4) clamp(1rem, 3vw, 2.5rem);
}
.publicbar .brand { color: var(--ink); padding-left: 0; }
.publicbar .theme-switch { margin: 0; }
.publicbar .theme-options { background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }
.publicbar .theme-options button { width: 2.25rem; color: var(--ink-3); }
.publicbar .theme-options button:hover { color: var(--ink); }
.publicbar .theme-options button[aria-pressed="true"] { background: var(--surface-3); color: var(--ink); }
.publicbar .theme-options button:focus-visible { outline-color: var(--focus); }

.wrap { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: var(--s-6) clamp(1rem, 3vw, 2.5rem) var(--s-7); }

/* ---- page heads --------------------------------------------------------- */

.page-head { margin-bottom: var(--s-5); }
.page-head h1, .detail-head h1 {
  margin: 0 0 var(--s-2); font-family: var(--font-display); font-size: var(--text-2xl); font-weight: var(--weight-heavy);
  letter-spacing: var(--display-tracking); line-height: 1.08;
}
.page-head h1.is-caps, .detail-head h1.is-caps { font-size: clamp(1.4rem, 1.2rem + 0.75vw, 1.875rem); letter-spacing: -0.005em; line-height: 1.15; max-width: 40ch; }
.page-head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: var(--s-3) var(--s-5); flex-wrap: wrap; }
.page-title { min-width: 0; }
.lede { margin: 0; max-width: 68ch; color: var(--ink-2); line-height: 1.55; }
.last-run { margin: 0; color: var(--ink-3); font-size: var(--text-sm); }
.last-run .mono { color: var(--ink-2); }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--s-2) var(--s-4); flex-wrap: wrap; margin-bottom: var(--s-4); }
.toolbar-actions { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.back {
  display: inline-flex; align-items: center; gap: 0.35rem; margin-bottom: var(--s-4);
  color: var(--ink-3); font-size: var(--text-sm); font-weight: 600; text-decoration: none;
}
.back:hover { color: var(--ink); }

/* ---- buttons -------------------------------------------------------------- */

.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem;
  min-height: 2.25rem; padding: var(--text-pad-top) var(--s-4) 0; border: 1px solid transparent; border-radius: var(--r-control);
  background: var(--primary); color: var(--primary-ink);
  font: inherit; font-size: 0.875rem; font-weight: 680; line-height: 1; letter-spacing: 0.005em;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background var(--fast) var(--ease), border-color var(--fast) var(--ease), color var(--fast) var(--ease);
}
.button:hover { background: var(--primary-hover); }
.button:active { transform: translateY(1px); }
.button-ghost { background: var(--surface); color: var(--ink); border-color: var(--line-2); }
.button-ghost:hover { background: var(--surface-2); border-color: var(--ink-3); }
.button-small { min-height: var(--control-h-sm); padding-inline: var(--s-3); font-size: var(--text-sm); }
.button-block { width: 100%; }

/* ---- flashes and empty states -------------------------------------------- */

.flash {
  margin-bottom: var(--s-4); padding: 0.7rem var(--s-4) 0.6rem; border: 1px solid var(--line); border-radius: var(--r-control);
  background: var(--surface); font-size: var(--text-sm); font-weight: 560;
}
.flash-ok { background: var(--ok-bg); color: var(--ok); border-color: transparent; }
.flash-error { background: var(--hot-bg); color: var(--hot); border-color: transparent; }

.empty {
  display: grid; justify-items: center; gap: var(--s-3); padding: var(--s-7) var(--s-5); text-align: center;
  color: var(--ink-2); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel);
}
.empty p { margin: 0; max-width: 52ch; }

/* ---- form controls ------------------------------------------------------- */

input, select, textarea {
  width: 100%; min-height: var(--control-h); padding: calc(0.5rem + var(--text-pad-top)) 0.75rem 0.45rem; font: inherit; font-size: 0.9375rem; color: var(--ink);
  background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--r-control);
  transition: border-color var(--fast) var(--ease), box-shadow var(--fast) var(--ease);
}
input::placeholder, textarea::placeholder { color: var(--ink-3); opacity: 0.85; }
input:hover, select:hover, textarea:hover { border-color: var(--ink-3); }
input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: none; border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-ring);
}
select {
  appearance: none; padding-right: 2rem; cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' fill='none' stroke='%238d97a5' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 0.8rem center;
}
input[type="checkbox"] {
  width: 1.05rem; min-height: 0; height: 1.05rem; padding: 0; margin: 0; flex: none;
  accent-color: var(--sign-blue); cursor: pointer;
}
input[type="file"] { padding: 0.4rem; font-size: var(--text-sm); }
textarea { resize: vertical; min-height: 6rem; line-height: 1.5; }
.field { display: flex; flex-direction: column; gap: 0.35rem; min-width: 0; }
.field-label { font-size: var(--text-sm); font-weight: 650; color: var(--ink-2); line-height: 1.3; }
.field-label .muted { font-weight: 450; }
.check { display: inline-flex; align-items: center; gap: 0.5rem; font-size: var(--text-sm); color: var(--ink-2); cursor: pointer; }
.check:hover { color: var(--ink); }

/* ---- panels ----------------------------------------------------------------- */

.panel { padding: var(--s-5); background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); }
.panel h2 { margin: 0 0 var(--s-3); font-family: var(--font-display); font-size: var(--text-md); font-weight: var(--weight-heavy); letter-spacing: -0.012em; }
.panel h2 + .muted.small { margin-top: calc(-1 * var(--s-2)); }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); margin-bottom: var(--s-3); }
.panel-head h2 { margin: 0; }
.subhead { margin: var(--s-5) 0 var(--s-2); font-size: var(--text-sm); font-weight: var(--weight-heavy); color: var(--ink); }
.subhead-plain { margin: var(--s-4) 0 var(--s-2); font-size: var(--text-sm); font-weight: var(--weight-heavy); }
details > summary { cursor: pointer; }
details > summary::marker { color: var(--ink-3); }

/* ---- stat board ---------------------------------------------------------- */

.board {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); margin-bottom: var(--s-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden;
}
.stat {
  display: flex; flex-direction: column; gap: 0.15rem; padding: var(--s-4) var(--s-5) 0.9rem;
  border-left: 1px solid var(--line); text-decoration: none; transition: background var(--fast) var(--ease);
}
.stat:first-child { border-left: 0; }
a.stat:hover { background: var(--surface-2); }
.stat-num { font-family: var(--font-display); font-size: 1.875rem; font-weight: var(--weight-heavy); line-height: 1.1; letter-spacing: -0.03em; }
.stat-label { font-size: var(--text-sm); color: var(--ink-2); }
.stat-hot .stat-num, .stat-alert .stat-num { color: var(--hot); }
.stat-warm .stat-num { color: var(--warm); }
.stat-info .stat-num { color: var(--info); }

/* ---- plates, pills, chips -------------------------------------------------- */

.tier {
  display: inline-flex; align-items: center; height: 1.4rem; padding: var(--text-pad-top) 0.55rem 0; white-space: nowrap;
  border-radius: var(--r-plate); outline: 1.5px solid currentColor; outline-offset: -3.5px;
  font-size: 0.71875rem; font-weight: 820; letter-spacing: 0.05em; line-height: 1;
}
.tier-hot { background: var(--sign-red); color: var(--sign-red-ink); }
.tier-warm { background: var(--sign-yellow); color: var(--sign-yellow-ink); }
.tier-low { background: var(--sign-gray); color: var(--sign-gray-ink); outline-color: transparent; }
.tier-skip { background: transparent; color: var(--ink-3); outline: 1px dashed var(--line-2); outline-offset: -1px; }

.sa {
  display: inline-flex; align-items: center; height: 1.35rem; padding: var(--text-pad-top) 0.45rem 0; white-space: nowrap;
  border-radius: var(--r-plate); background: var(--sign-gray); color: var(--sign-gray-ink);
  font-size: var(--text-xs); font-weight: 700; letter-spacing: 0.03em; line-height: 1;
}
.sa-vet { background: var(--sign-green); color: var(--sign-green-ink); outline: 1.5px solid rgba(255, 255, 255, 0.9); outline-offset: -3.5px; padding-inline: 0.55rem; }

.jev {
  display: inline-flex; align-items: center; gap: 0.35rem; margin-top: 0.45rem;
  font-size: var(--text-xs); font-weight: 650; color: var(--ink-2); white-space: nowrap;
}
.jev::before { content: ""; width: 0.5rem; height: 0.5rem; margin-top: -0.12em; border-radius: 50%; background: var(--ink-3); }
.jev.jev-high::before { background: var(--ok); }
.jev.jev-mid::before { background: var(--sign-yellow); }

.status {
  display: inline-flex; align-items: center; gap: 0.4rem; height: 1.5rem; padding: var(--text-pad-top) 0.6rem 0; white-space: nowrap;
  border-radius: var(--r-pill); background: var(--low-bg); color: var(--ink-2);
  font-size: var(--text-xs); font-weight: 680; line-height: 1;
}
.status::before { content: ""; width: 0.4rem; height: 0.4rem; margin-top: calc(-1 * var(--text-pad-top)); border-radius: 50%; background: currentColor; opacity: 0.7; }
.status-reviewing { background: var(--warm-bg); color: var(--warm); }
.status-bidding, .status-submitted { background: var(--info-bg); color: var(--info); }
.status-won { background: var(--ok-bg); color: var(--ok); }
.status-no_bid, .status-lost { background: transparent; color: var(--ink-3); box-shadow: inset 0 0 0 1px var(--line-2); }

.badge-new, .legend-new, .tag-new {
  display: inline-flex; align-items: center; height: 1.15rem; margin-right: 0.45rem; padding: var(--text-pad-top) 0.4rem 0; vertical-align: 0.12em;
  border-radius: 4px; background: var(--sign-blue); color: var(--sign-blue-ink);
  font-size: 0.6875rem; font-weight: 800; letter-spacing: 0.03em; line-height: 1;
}
.badge-ended, .badge-ok, .badge-maybe {
  display: inline-flex; align-items: center; height: 1.35rem; padding: var(--text-pad-top) 0.55rem 0;
  border-radius: var(--r-pill); font-size: var(--text-xs); font-weight: 680; line-height: 1;
}
.badge-ended { background: var(--low-bg); color: var(--ink-2); }
.badge-ok { background: var(--ok-bg); color: var(--ok); }
.badge-maybe { background: var(--warm-bg); color: var(--warm); }
.count-pill {
  display: inline-flex; align-items: center; height: 1.3rem; padding: var(--text-pad-top) 0.5rem 0;
  border-radius: var(--r-pill); background: var(--info-bg); color: var(--info); font-size: var(--text-xs); font-weight: 700; line-height: 1;
}
.tag-ok { font-size: var(--text-xs); font-weight: 700; color: var(--ok); white-space: nowrap; }

/* advisory flags read as small warning signs, not pills */
.flags { display: flex; flex-wrap: wrap; align-items: center; gap: 0.3rem var(--s-3); margin-top: 0.45rem; }
.flag { position: relative; display: inline-block; padding-left: 1rem; font-size: var(--text-sm); line-height: 1.4; color: var(--warm); }
.flag::before {
  content: ""; position: absolute; left: 0.1rem; top: 0.36em; width: 0.5rem; height: 0.5rem;
  background: var(--sign-yellow); transform: rotate(45deg); border-radius: 1px;
  box-shadow: 0 0 0 1px light-dark(rgba(21, 18, 10, 0.55), transparent);
}
.flag-region { color: var(--info); }
.flag-region::before { background: var(--sign-blue); transform: none; border-radius: 2px; box-shadow: none; }
.related-count {
  display: inline-flex; align-items: center; height: 1.35rem; padding: var(--text-pad-top) 0.5rem 0; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); color: var(--ink-2); font-size: var(--text-xs); font-weight: 650; text-decoration: none; line-height: 1;
}
.related-count:hover { border-color: var(--ink-3); color: var(--ink); }

/* ---- data tables ------------------------------------------------------------ */

.opps {
  position: relative; width: 100%; border-collapse: separate; border-spacing: 0; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden;
}
.opps th {
  padding: 0.75rem var(--s-4) 0.6rem; text-align: left; white-space: nowrap; vertical-align: bottom;
  background: var(--surface-2); border-bottom: 1px solid var(--line);
  font-size: var(--text-sm); font-weight: 650; color: var(--ink-3);
}
.opps td { padding: var(--cell-y) var(--s-4) calc(var(--cell-y) - 0.1rem); border-bottom: 1px solid var(--line); vertical-align: top; }
.opps tbody tr { transition: background var(--fast) var(--ease); }
.opps tbody tr:hover { background: var(--surface-2); }
.opps tbody tr:last-child td { border-bottom: 0; }
.opps .num, .num { text-align: right; }
.th-sort { display: inline-flex; align-items: center; gap: 0.3rem; color: inherit; text-decoration: none; }
.th-sort:hover, .th-sort.is-current { color: var(--ink); }
.sort-arrow { color: var(--info); }

.opps td a:not([class]) { font-weight: 600; color: var(--ink); text-decoration: none; }
.opps td a:not([class]):hover { color: var(--info); text-decoration: underline; }
.col-nowrap { white-space: nowrap; }
.opp-title { font-weight: var(--weight-strong); color: var(--ink); text-decoration: none; line-height: 1.35; letter-spacing: -0.005em; }
.opp-title:hover { color: var(--info); text-decoration: underline; }
.opp-meta { margin-top: 0.2rem; font-size: var(--text-sm); color: var(--ink-3); line-height: 1.45; }

.due-label { display: block; font-size: var(--text-sm); font-weight: var(--weight-strong); }
.due-date { display: block; margin-top: 0.1rem; font-size: var(--text-xs); color: var(--ink-3); }
.due-urgent .due-label, .due-urgent .keyfact-main { color: var(--hot); }
.due-soon .due-label, .due-soon .keyfact-main { color: var(--warm); }
.due-closed .due-label, .due-closed .keyfact-main { color: var(--ink-3); text-decoration: line-through; }
.overdue { color: var(--hot); font-weight: 700; }

.pager { display: flex; align-items: center; justify-content: center; gap: var(--s-4); margin-top: var(--s-5); }
.pager-link {
  display: inline-flex; align-items: center; min-height: var(--control-h-sm); padding: var(--text-pad-top) var(--s-3) 0;
  border: 1px solid var(--line-2); border-radius: var(--r-control); background: var(--surface);
  font-size: var(--text-sm); font-weight: 650; text-decoration: none;
}
.pager-link:hover { border-color: var(--ink-3); }
.pager-link.is-off { color: var(--ink-3); background: transparent; border-style: dashed; }
.pager-pos { font-size: var(--text-sm); color: var(--ink-2); }

/* ---- key facts strip -------------------------------------------------------- */

.keyfacts {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 0 0 var(--s-5);
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-panel); overflow: hidden;
}
.keyfact { margin: 0; padding: var(--s-4) var(--s-5); border-left: 1px solid var(--line); }
.keyfact:first-child { border-left: 0; }
.keyfact dt { font-size: var(--text-sm); font-weight: 600; color: var(--ink-3); }
.keyfact dd { margin: 0.3rem 0 0; font-weight: 650; overflow-wrap: anywhere; }
.keyfact-main { display: block; font-family: var(--font-display); font-size: var(--text-lg); font-weight: var(--weight-heavy); letter-spacing: -0.015em; line-height: 1.2; }
.keyfact .small { display: block; margin-top: 0.15rem; font-weight: 450; color: var(--ink-3); }

/* ---- meters ------------------------------------------------------------------ */

.meter { display: block; flex: 1 1 auto; max-width: 220px; height: 6px; background: var(--low-bg); border-radius: var(--r-pill); overflow: hidden; }
.meter-fill { display: block; height: 100%; border-radius: inherit; background: var(--ink-3); }
.meter-fill.jev-high { background: var(--ok); }
.meter-fill.jev-mid { background: var(--sign-yellow); }
.meter-wide { max-width: 160px; margin-top: 0.5rem; }
.meter-row { display: flex; align-items: center; gap: var(--s-3); }
.m0 { width: 0; } .m1 { width: 10%; } .m2 { width: 20%; } .m3 { width: 30%; } .m4 { width: 40%; } .m5 { width: 50%; }
.m6 { width: 60%; } .m7 { width: 70%; } .m8 { width: 80%; } .m9 { width: 90%; } .m10 { width: 100%; }

/* ---- responsive shell -------------------------------------------------------- */

@media (max-width: 1279px) and (min-width: 1024px) {
  .has-shell .shell { grid-template-columns: var(--rail-w-compact) minmax(0, 1fr); }
  .appbar { padding-inline: var(--s-2); align-items: center; }
  .brand { padding: var(--s-1) 0; }
  .brand-name, .nav-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .appbar-panel, .nav, .nav-group, .appbar-foot { width: 100%; }
  .nav-link { justify-content: center; padding: 0; min-height: 2.5rem; }
  .nav-link .icon { margin-top: 0; }
  .nav-badge { position: absolute; top: 0.15rem; right: 0.35rem; min-width: 1rem; height: 1rem; font-size: 0.625rem; }
  .theme-options { flex-direction: column; }
}

@media (max-width: 1023px) {
  .has-shell .shell { display: block; }
  .appbar {
    position: sticky; z-index: 10; height: auto; overflow: visible; flex-flow: row wrap; align-items: center; justify-content: space-between;
    gap: 0; padding: 0.6rem clamp(1rem, 3vw, 2.5rem); border-right: 0; border-bottom: 1px solid var(--rail-line);
  }
  .menu-button {
    display: inline-flex; align-items: center; gap: 0.55rem; min-height: 2.25rem; padding: var(--text-pad-top) 0.8rem 0;
    border-radius: var(--r-control); color: var(--rail-ink-strong); font-size: 0.875rem; font-weight: 650; cursor: pointer;
    background: rgba(255, 255, 255, 0.07);
  }
  .menu-button:hover { background: rgba(255, 255, 255, 0.12); }
  .menu-bars, .menu-bars::before, .menu-bars::after { display: block; width: 0.95rem; height: 2px; border-radius: 2px; background: currentColor; }
  .menu-bars { position: relative; margin-top: calc(-1 * var(--text-pad-top)); }
  .menu-bars::before, .menu-bars::after { content: ""; position: absolute; left: 0; }
  .menu-bars::before { top: -5px; }
  .menu-bars::after { top: 5px; }
  .menu-toggle { display: block; }
  .menu-toggle:focus-visible + .menu-button { outline: 2px solid var(--rail-focus); outline-offset: 2px; }
  .menu-toggle:checked + .menu-button { background: rgba(255, 255, 255, 0.16); }
  .appbar-panel { display: none; flex-basis: 100%; gap: var(--s-4); padding: var(--s-4) 0 var(--s-2); }
  .menu-toggle:checked ~ .appbar-panel { display: flex; }
  .nav { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-4); }
  .nav-group { padding-bottom: 0; border-bottom: 0; }
  .appbar-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: center; gap: 2px var(--s-4); }
  .theme-switch { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
