/* Self-hosted variable font (Apache-2.0/OFL) — no CDN, cache-busted via ?v=. */
@font-face { font-family: 'Roboto'; font-style: normal; font-weight: 100 900;
  font-display: swap; src: url('fonts/Roboto-var.woff2') format('woff2'); }

/* Watch Watcher — dependency-free interface system */
:root {
  color-scheme: light;
  --bg: #f4f2ec;
  --bg-deep: #ebe7dd;
  --surface: #fffefa;
  --surface-raised: #ffffff;
  --surface-soft: #f0eee7;
  --surface-tint: #e9f0ec;
  --border: #dedbd1;
  --border-strong: #c9c5ba;
  --text: #17201c;
  --text-soft: #39443f;
  --muted: #5f6864;
  --faint: #66706b;
  --accent: #185944;
  --accent-hover: #104936;
  --accent-soft: #e3eee9;
  --accent-ink: #0c3d2d;
  --metal: #7d5b24;
  --metal-soft: #f4ead5;
  --pos: #16724c;
  --pos-bg: #e3f1e9;
  --warn: #9a641b;
  --warn-bg: #f8ecd7;
  --neg: #ae3d3d;
  --neg-bg: #f7e5e3;
  --info: #3d6590;
  --info-bg: #e7edf5;
  --shadow-xs: 0 1px 2px rgba(25, 31, 28, .04);
  --shadow-sm: 0 7px 22px rgba(35, 39, 32, .06), 0 1px 3px rgba(35, 39, 32, .05);
  --shadow-md: 0 18px 42px rgba(35, 39, 32, .10), 0 2px 7px rgba(35, 39, 32, .06);
  --ring: rgba(24, 89, 68, .22);
  --radius-sm: 8px;
  --radius: 13px;
  --radius-lg: 20px;
  --sans: 'Roboto', "Segoe UI", -apple-system, BlinkMacSystemFont, Helvetica, Arial, sans-serif;
  --display: 'Roboto', "Segoe UI", sans-serif;
  --mono: "Cascadia Code", "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0d1210;
    --bg-deep: #090d0b;
    --surface: #151b18;
    --surface-raised: #19211d;
    --surface-soft: #1d2521;
    --surface-tint: #172720;
    --border: #2a342f;
    --border-strong: #3b4741;
    --text: #edf0ed;
    --text-soft: #c2cac6;
    --muted: #929d97;
    --faint: #6f7a74;
    --accent: #7fc5a5;
    --accent-hover: #9bd4b9;
    --accent-soft: #1b3429;
    --accent-ink: #c0e8d4;
    --metal: #d1ad67;
    --metal-soft: #332b1c;
    --pos: #69c394;
    --pos-bg: #173225;
    --warn: #e2b66d;
    --warn-bg: #362b1a;
    --neg: #ee8585;
    --neg-bg: #392020;
    --info: #8eb6df;
    --info-bg: #1d2c3b;
    --shadow-xs: 0 1px 2px rgba(0, 0, 0, .22);
    --shadow-sm: 0 8px 24px rgba(0, 0, 0, .20), 0 1px 3px rgba(0, 0, 0, .28);
    --shadow-md: 0 20px 48px rgba(0, 0, 0, .34), 0 2px 8px rgba(0, 0, 0, .24);
    --ring: rgba(127, 197, 165, .24);
  }
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0d1210;
  --bg-deep: #090d0b;
  --surface: #151b18;
  --surface-raised: #19211d;
  --surface-soft: #1d2521;
  --surface-tint: #172720;
  --border: #2a342f;
  --border-strong: #3b4741;
  --text: #edf0ed;
  --text-soft: #c2cac6;
  --muted: #929d97;
  --faint: #6f7a74;
  --accent: #7fc5a5;
  --accent-hover: #9bd4b9;
  --accent-soft: #1b3429;
  --accent-ink: #c0e8d4;
  --metal: #d1ad67;
  --metal-soft: #332b1c;
  --pos: #69c394;
  --pos-bg: #173225;
  --warn: #e2b66d;
  --warn-bg: #362b1a;
  --neg: #ee8585;
  --neg-bg: #392020;
  --info: #8eb6df;
  --info-bg: #1d2c3b;
  --shadow-xs: 0 1px 2px rgba(0, 0, 0, .22);
  --shadow-sm: 0 8px 24px rgba(0, 0, 0, .20), 0 1px 3px rgba(0, 0, 0, .28);
  --shadow-md: 0 20px 48px rgba(0, 0, 0, .34), 0 2px 8px rgba(0, 0, 0, .24);
  --ring: rgba(127, 197, 165, .24);
}

*, *::before, *::after { box-sizing: border-box; }
.sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; overflow: hidden !important; clip: rect(0, 0, 0, 0) !important; white-space: nowrap !important; border: 0 !important; }
html { min-width: 320px; scroll-behavior: smooth; }
body {
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(circle at 13% -10%, color-mix(in srgb, var(--metal) 8%, transparent) 0, transparent 29rem),
    linear-gradient(180deg, var(--bg) 0, color-mix(in srgb, var(--bg) 92%, var(--bg-deep)) 100%);
  color: var(--text);
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; }
a { color: var(--accent); text-decoration: none; text-underline-offset: 3px; }
a:hover { text-decoration: underline; }
svg { display: block; }
h1, h2, h3, p { margin-top: 0; }
h1, h2 {
  color: var(--text);
  font-family: var(--display);
  font-weight: 600;
  letter-spacing: -.025em;
  line-height: 1.08;
}
h1 { margin-bottom: 8px; font-size: clamp(2rem, 3vw, 2.75rem); }
h2 { font-size: 1.65rem; }
h3 { color: var(--text); font-size: 1rem; line-height: 1.3; }
strong { font-weight: 680; }
::selection { background: var(--accent); color: var(--surface); }
:focus-visible { outline: 3px solid var(--ring); outline-offset: 2px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.small { font-size: .79rem; }
.pos { color: var(--pos); }
.warn { color: var(--warn); }
.neg { color: var(--neg); }
.eyebrow {
  margin: 0 0 9px;
  color: var(--metal);
  font-size: .69rem;
  font-weight: 750;
  letter-spacing: .13em;
  line-height: 1.2;
  text-transform: uppercase;
}
.eyebrow.light { color: #d8bd85; }

.skip-link {
  position: fixed;
  top: 10px;
  left: 10px;
  z-index: 100;
  padding: 9px 13px;
  transform: translateY(-150%);
  border-radius: var(--radius-sm);
  background: var(--text);
  color: var(--surface);
  font-weight: 650;
}
.skip-link:focus { transform: translateY(0); }

/* Shared shell */
.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid color-mix(in srgb, var(--border) 84%, transparent);
  background: color-mix(in srgb, var(--surface) 88%, transparent);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .03);
  -webkit-backdrop-filter: blur(18px) saturate(1.25);
  backdrop-filter: blur(18px) saturate(1.25);
}
.topbar-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 28px;
  width: min(100% - 40px, 1320px);
  min-height: 70px;
  margin: 0 auto;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--text);
  white-space: nowrap;
}
.brand:hover { text-decoration: none; }
.brand-mark {
  position: relative;
  display: inline-grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border: 1px solid var(--metal);
  border-radius: 50%;
  color: var(--metal);
}
.brand-mark::before,
.brand-mark::after {
  position: absolute;
  left: 50%;
  width: 8px;
  height: 5px;
  transform: translateX(-50%);
  border-right: 1px solid currentColor;
  border-left: 1px solid currentColor;
  content: "";
}
.brand-mark::before { top: -5px; border-top: 1px solid currentColor; border-radius: 2px 2px 0 0; }
.brand-mark::after { bottom: -5px; border-bottom: 1px solid currentColor; border-radius: 0 0 2px 2px; }
.brand-mark > span {
  width: 2px;
  height: 8px;
  transform: translateY(-2px) rotate(32deg);
  transform-origin: bottom center;
  border-radius: 2px;
  background: currentColor;
}
.brand-mark > span::after {
  position: absolute;
  bottom: -2px;
  left: -1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}
.brand-name {
  font-size: .82rem;
  font-weight: 780;
  letter-spacing: .13em;
  text-transform: uppercase;
}
.brand-name em { color: var(--metal); font-style: normal; font-weight: 570; }
.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 11px;
  border-radius: 9px;
  color: var(--muted);
  font-size: .84rem;
  font-weight: 620;
  transition: color .16s ease, background .16s ease;
}
.nav a svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}
.nav a:first-child svg { fill: currentColor; stroke: none; }
.nav a:hover { background: var(--surface-soft); color: var(--text); text-decoration: none; }
.nav a.active { background: var(--accent-soft); color: var(--accent-ink); }
.topbar-actions { display: flex; align-items: center; gap: 10px; }
.live-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 32px;
  padding: 6px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  background: color-mix(in srgb, var(--surface-raised) 70%, transparent);
  font-size: .68rem;
  font-weight: 720;
  letter-spacing: .07em;
  text-transform: uppercase;
}
.live-dot {
  position: relative;
  width: 7px;
  height: 7px;
  flex: 0 0 auto;
  border-radius: 50%;
  background: var(--pos);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--pos) 13%, transparent);
}
.live-dot::after {
  position: absolute;
  inset: -4px;
  border: 1px solid var(--pos);
  border-radius: inherit;
  content: "";
  opacity: 0;
  animation: signal 2.6s ease-out infinite;
}
.live-pill[data-freshness="aging"] .live-dot { background: var(--warn); box-shadow: 0 0 0 4px color-mix(in srgb, var(--warn) 13%, transparent); }
.live-pill[data-freshness="stale"] .live-dot,
.live-pill[data-freshness="empty"] .live-dot { background: var(--muted); box-shadow: 0 0 0 4px color-mix(in srgb, var(--muted) 13%, transparent); }
.live-pill[data-freshness="aging"] .live-dot::after,
.live-pill[data-freshness="stale"] .live-dot::after,
.live-pill[data-freshness="empty"] .live-dot::after { display: none; }
@keyframes signal { 25% { opacity: .42; } 80%, 100% { opacity: 0; transform: scale(1.8); } }
.theme-toggle {
  display: inline-grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface-raised);
  color: var(--text-soft);
  cursor: pointer;
  transition: border-color .16s ease, transform .16s ease, background .16s ease;
}
.theme-toggle:hover { transform: rotate(8deg); border-color: var(--border-strong); background: var(--surface-soft); }
.theme-toggle svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}
.theme-toggle .sun-icon { display: none; }
.theme-toggle[data-active-theme="dark"] .moon-icon { display: none; }
.theme-toggle[data-active-theme="dark"] .sun-icon { display: block; }
.container { width: min(100% - 40px, 1240px); min-height: calc(100vh - 150px); margin: 0 auto; padding: 44px 0 80px; }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: min(100% - 40px, 1240px);
  margin: 0 auto;
  padding: 22px 0 28px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .73rem;
}
.site-footer > div:first-child { color: var(--text-soft); font-weight: 650; }
.footer-mark { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border: 1px solid var(--metal); border-radius: 50%; }
.page-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 28px;
}
.page-head > div:first-child { max-width: 780px; }
.page-head p:not(.eyebrow) { max-width: 760px; margin: 0; color: var(--muted); font-size: .91rem; line-height: 1.65; }
.page-head-compact { margin-bottom: 22px; }

/* Summary strip */
.tiles,
.guard {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  overflow: hidden;
  margin-bottom: 26px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.tile { position: relative; min-width: 0; padding: 20px 21px; }
.tile + .tile::before {
  position: absolute;
  top: 18px;
  bottom: 18px;
  left: 0;
  width: 1px;
  background: var(--border);
  content: "";
}
.tile .label {
  overflow: hidden;
  color: var(--muted);
  font-size: .68rem;
  font-weight: 720;
  letter-spacing: .09em;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}
.tile .value {
  margin-top: 7px;
  font-family: var(--display);
  font-size: 1.75rem;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  letter-spacing: -.03em;
  line-height: 1;
}
.tile .tile-detail { margin-top: 6px; color: var(--faint); font-size: .72rem; }

/* Filters and inputs */
.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 20px;
  padding: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: color-mix(in srgb, var(--surface) 80%, transparent);
  box-shadow: var(--shadow-xs);
}
.filter-group { display: grid; gap: 5px; min-width: 142px; }
.search-filter { min-width: 250px; flex: 1 1 300px; }
.budget-filter { min-width: 220px; }
.range-control { display: grid; grid-template-columns: minmax(82px, 1fr) auto minmax(82px, 1fr); align-items: center; gap: 7px; }
.range-control span { color: var(--faint); font-size: .8rem; }
.range-control input { min-width: 0; width: 100%; }
.search-control { position: relative; }
.search-control svg { position: absolute; top: 50%; left: 11px; width: 16px; height: 16px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 1.7; pointer-events: none; }
.search-control input { width: 100%; padding-right: 38px !important; padding-left: 36px !important; }
.search-control kbd { position: absolute; top: 50%; right: 9px; min-width: 21px; padding: 2px 6px; transform: translateY(-50%); border: 1px solid var(--border); border-radius: 5px; background: var(--surface-soft); color: var(--muted); font: 600 .67rem/1.25 var(--sans); text-align: center; pointer-events: none; }
.filter-actions { display: flex; gap: 7px; margin-left: auto; }
.filters label,
.field-label,
.login-form label {
  color: var(--muted);
  font-size: .67rem;
  font-weight: 730;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.checkbox-filter {
  display: grid;
  grid-template-columns: 18px auto;
  align-items: center;
  gap: 0 9px;
  min-height: 40px;
  padding: 5px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  cursor: pointer;
  text-transform: none !important;
}
.checkbox-filter input { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }
.checkbox-mark {
  display: grid;
  grid-row: 1 / span 2;
  width: 18px;
  height: 18px;
  place-items: center;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface);
  color: #fff;
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.checkbox-mark svg { width: 11px; height: 11px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2; opacity: 0; }
.checkbox-filter input:checked + .checkbox-mark { border-color: var(--accent); background: var(--accent); }
.checkbox-filter input:checked + .checkbox-mark svg { opacity: 1; }
.checkbox-filter input:focus-visible + .checkbox-mark { outline: 3px solid var(--ring); outline-offset: 2px; }
.checkbox-filter strong { display: block; color: var(--text-soft); font-size: .73rem; font-weight: 690; letter-spacing: 0; line-height: 1.15; }
.checkbox-filter small { display: block; margin-top: 2px; color: var(--faint); font-size: .64rem; font-weight: 500; letter-spacing: 0; line-height: 1.1; }
select,
input[type="number"],
input[type="text"],
input[type="password"],
input[type="search"] {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  color: var(--text);
  font-size: .87rem;
  transition: border-color .16s ease, box-shadow .16s ease, background .16s ease;
}
select { min-width: 142px; padding: 7px 34px 7px 11px; cursor: pointer; }
input[type="number"], input[type="text"], input[type="password"], input[type="search"] { padding: 8px 11px; }
select:hover, input:hover { border-color: var(--border-strong); }
select:focus, input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--ring); }

/* Opportunity cards */
.cards { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.opp {
  position: relative;
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 15px;
  overflow: hidden;
  padding: 20px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  color: inherit;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.opp::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--border-strong);
  content: "";
}
.opp.v-strong::before { background: var(--pos); }
.opp.v-thin::before { background: var(--warn); }
.opp.v-negative::before { background: var(--neg); }
.opp.v-insufficient::before { background: var(--muted); }
.opp.v-stale::before { background: var(--warn); }
.opp.v-unconfirmed::before { background: var(--warn); }
.opp.v-ended::before { background: var(--border-strong); }
.opp.is-ended { background: color-mix(in srgb, var(--surface) 72%, var(--surface-soft)); }
.opp.is-ended .bid-ceiling { box-shadow: none; }
.opp.is-stale { border-style: dashed; }
a.opp:hover { transform: translateY(-3px); border-color: var(--border-strong); box-shadow: var(--shadow-md); text-decoration: none; }
a.opp:focus-visible { outline: none; box-shadow: inset 0 0 0 3px var(--ring), var(--shadow-md); }
.opp-top { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.opp-identity { min-width: 0; }
.opp .title {
  overflow: hidden;
  font-family: var(--display);
  font-size: 1.24rem;
  font-weight: 600;
  letter-spacing: -.02em;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.opp .sub { margin-top: 4px; color: var(--muted); font-size: .72rem; letter-spacing: .02em; }
.margin { flex: 0 0 auto; text-align: right; white-space: nowrap; }
.margin .pct { font-family: var(--display); font-size: 1.85rem; font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.04em; line-height: 1; }
.margin .eur { margin-top: 4px; color: var(--muted); font-size: .72rem; font-variant-numeric: tabular-nums; }
.margin .historical { color: var(--text-soft); }
.secondary-estimate { color: var(--text); font-family: var(--display); font-size: 1.55rem; font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.035em; line-height: 1; }
.bid-ceiling {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  min-height: 78px;
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--border));
  border-radius: 12px;
  background: linear-gradient(125deg, var(--accent-soft), color-mix(in srgb, var(--surface) 76%, var(--accent-soft)));
}
.bid-ceiling.unavailable { border-color: var(--border); background: var(--surface-soft); }
.bid-ceiling-label {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  color: var(--accent-ink);
  font-size: .7rem;
  font-weight: 780;
  letter-spacing: .085em;
  text-transform: uppercase;
}
.bid-ceiling.unavailable .bid-ceiling-label { color: var(--muted); }
.bid-ceiling-label svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.bid-ceiling-note { color: var(--muted); font-size: .73rem; }
.bid-ceiling-value { flex: 0 0 auto; color: var(--accent-ink); font-family: var(--display); font-size: 1.7rem; font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -.035em; white-space: nowrap; }
.bid-ceiling-value.too-high { max-width: 185px; color: var(--neg); font-family: var(--sans); font-size: .9rem; font-weight: 700; letter-spacing: 0; text-align: right; white-space: normal; }
.bid-ceiling.unavailable .bid-ceiling-value { color: var(--muted); font-family: var(--sans); font-size: .91rem; font-weight: 650; letter-spacing: 0; }
.headroom { display: block; margin-top: 3px; color: var(--pos); font-family: var(--sans); font-size: .69rem; font-weight: 650; letter-spacing: 0; text-align: right; }
.opp-grid { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 7px 16px; font-size: .81rem; }
.opp-grid .k { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.opp-grid .val { color: var(--text-soft); font-variant-numeric: tabular-nums; text-align: right; white-space: nowrap; }
.opp-grid .val strong { color: var(--text); }
.secondary-signals {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: .72rem;
  font-variant-numeric: tabular-nums;
}
.secondary-signals span::before { color: var(--accent); content: "•"; margin-right: 6px; }
.opp-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 29px;
  padding-top: 14px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: .73rem;
}
.opp-foot .when { margin-left: auto; }
.src { color: var(--muted); text-transform: capitalize; }
.when { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.when.urgent { color: var(--neg); font-weight: 700; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 23px;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: .64rem;
  font-weight: 780;
  letter-spacing: .065em;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}
.badge::before { width: 5px; height: 5px; border-radius: 50%; background: currentColor; content: ""; }
.v-strong { color: var(--pos); background: var(--pos-bg); }
.v-thin { color: var(--warn); background: var(--warn-bg); }
.v-negative { color: var(--neg); background: var(--neg-bg); }
.v-insufficient { color: var(--muted); background: var(--surface-soft); }
.v-stale { color: var(--warn); background: var(--warn-bg); }
.v-unconfirmed { color: var(--warn); background: var(--warn-bg); }
.v-ended { color: var(--text-soft); background: var(--surface-soft); }
.badge.urgent { color: var(--neg); background: var(--neg-bg); }
.comp-method-label {
  display: inline-flex;
  width: fit-content;
  margin-top: 5px;
  padding: 3px 7px;
  border: 1px solid color-mix(in srgb, var(--warn) 38%, var(--border));
  border-radius: 999px;
  background: var(--warn-bg);
  color: var(--warn);
  font-size: .62rem;
  font-weight: 760;
  letter-spacing: .035em;
  line-height: 1.25;
  text-transform: uppercase;
}
.comp-method-label.verified {
  border-color: color-mix(in srgb, var(--pos) 32%, var(--border));
  background: var(--pos-bg);
  color: var(--pos);
}

.result-summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: -4px 2px 14px; color: var(--muted); font-size: .78rem; }
.result-summary strong { color: var(--text-soft); font-variant-numeric: tabular-nums; }
.result-summary a { font-weight: 650; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 14px; margin-top: 25px; }
.page-numbers { display: flex; gap: 6px; }
.page-link { display: inline-grid; min-width: 38px; min-height: 38px; padding: 7px 10px; place-items: center; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--surface); color: var(--text-soft); font-size: .79rem; font-weight: 650; }
a.page-link:hover { border-color: var(--border-strong); background: var(--surface-soft); text-decoration: none; }
.page-link.active { border-color: var(--accent); background: var(--accent); color: #fff; }
.page-link.disabled { color: var(--faint); cursor: not-allowed; }
.page-direction { min-width: 92px; }

/* Buttons */
.btn {
  display: inline-flex;
  min-height: 40px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 14px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface-raised);
  box-shadow: var(--shadow-xs);
  color: var(--text-soft);
  cursor: pointer;
  font-size: .83rem;
  font-weight: 690;
  transition: background .16s ease, border-color .16s ease, color .16s ease, transform .16s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--text-soft); background: var(--surface-soft); color: var(--text); text-decoration: none; }
.btn:disabled { transform: none; opacity: .58; cursor: wait; }
.btn-primary { border-color: var(--accent); background: var(--accent); color: #fff; }
.btn-primary:hover { border-color: var(--accent-hover); background: var(--accent-hover); color: #fff; }
:root[data-theme="dark"] .btn-primary { color: #0d2119; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .btn-primary { color: #0d2119; } }
.btn-sm { min-height: 34px; padding: 6px 11px; font-size: .75rem; }
.btn-large { width: 100%; min-height: 50px; padding: 11px 17px; border-radius: 10px; font-size: .9rem; }
.btn-block { width: 100%; margin-top: 18px; }
.btn.ml-auto { margin-left: auto; }

/* Opportunity detail */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: .8rem;
  font-weight: 650;
}
.back-link:hover { color: var(--accent); text-decoration: none; }
.back-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 2; }
.head-figure { flex: 0 0 auto; text-align: right; }
.head-figure .pct { font-family: var(--display); font-size: 2.6rem; font-variant-numeric: tabular-nums; font-weight: 600; letter-spacing: -.045em; line-height: 1; }
.head-figure .secondary-estimate { font-size: 2.2rem; }
.head-figure-caption { margin-top: 5px; color: var(--muted); font-size: .72rem; }
.head-meta { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 10px; color: var(--muted); font-size: .74rem; }
.decision-banner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 28px;
  margin-bottom: 18px;
  padding: 20px 22px;
  border: 1px solid color-mix(in srgb, var(--accent) 26%, var(--border));
  border-radius: var(--radius-lg);
  background:
    linear-gradient(110deg, var(--accent-soft), color-mix(in srgb, var(--surface) 88%, var(--accent-soft))),
    var(--surface);
  box-shadow: var(--shadow-sm);
}
.decision-banner.caution { border-color: color-mix(in srgb, var(--neg) 28%, var(--border)); background: linear-gradient(110deg, var(--neg-bg), var(--surface)); }
.decision-banner.unavailable { border-color: var(--border); background: var(--surface); }
.decision-kicker { margin-bottom: 4px; color: var(--accent-ink); font-size: .68rem; font-weight: 780; letter-spacing: .1em; text-transform: uppercase; }
.decision-banner.caution .decision-kicker { color: var(--neg); }
.decision-banner.unavailable .decision-kicker { color: var(--muted); }
.decision-title { font-family: var(--display); font-size: 1.3rem; font-weight: 600; letter-spacing: -.02em; }
.decision-copy { margin: 5px 0 0; color: var(--muted); font-size: .82rem; }
.decision-value { color: var(--accent-ink); font-family: var(--display); font-size: clamp(2rem, 4vw, 3rem); font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -.045em; white-space: nowrap; }
.decision-banner.caution .decision-value { color: var(--neg); font-family: var(--sans); font-size: 1rem; font-weight: 720; letter-spacing: 0; }
.decision-banner.unavailable .decision-value { color: var(--muted); font-family: var(--sans); font-size: 1rem; font-weight: 690; letter-spacing: 0; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(340px, .88fr); gap: 18px; align-items: start; }
.detail-col { display: flex; min-width: 0; flex-direction: column; gap: 18px; }
.panel {
  min-width: 0;
  padding: 22px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}
.panel-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 19px; }
.panel-head h2, .panel-head h3, .panel > h2, .panel > h3 {
  margin: 0;
  font-size: .73rem;
  font-weight: 760;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.panel-head p { margin: 5px 0 0; color: var(--muted); font-size: .78rem; }
.detail-signals { margin-top: 18px; padding: 12px 13px; font-size: .78rem; }
.secondary-note { margin: 8px 2px 0; }
.history-line { margin: 12px 2px 0; }
.history-line .mono { font-size: .68rem; }
.src-link { color: inherit; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 2px; }
.src-link:hover { color: var(--accent-ink); text-decoration-color: currentColor; }
.history-row td { padding-top: 3px; padding-bottom: 3px; border-bottom-style: dashed; }
.section-icon {
  display: grid;
  width: 31px;
  height: 31px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  background: var(--surface-soft);
  color: var(--metal);
}
.section-icon svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.note {
  margin: 16px 0;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .82rem;
}
.note:first-child { margin-top: 0; }
.note-accent { border-color: color-mix(in srgb, var(--accent) 20%, var(--border)); background: var(--accent-soft); color: var(--accent-ink); }
.note-warning { border-color: color-mix(in srgb, var(--neg) 18%, var(--border)); background: var(--neg-bg); color: var(--neg); }
.provenance-note { display: grid; gap: 7px; }
.provenance-links { display: flex; flex-wrap: wrap; gap: 8px 16px; }

/* Cost and market visuals */
.wf { display: flex; flex-direction: column; gap: 9px; }
.wf + .wf { margin-top: 22px; padding-top: 20px; border-top: 1px solid var(--border); }
.wf-label { margin-bottom: 2px; color: var(--faint); font-size: .64rem; font-weight: 740; letter-spacing: .09em; text-transform: uppercase; }
.wf-row { display: grid; grid-template-columns: 132px minmax(55px, 1fr) 86px; align-items: center; gap: 12px; font-size: .81rem; }
.wf-row .lbl { overflow: hidden; color: var(--muted); text-overflow: ellipsis; white-space: nowrap; }
.wf-row .amt { color: var(--text-soft); font-family: var(--mono); font-size: .75rem; font-variant-numeric: tabular-nums; text-align: right; }
.wf-bar { position: relative; height: 10px; overflow: hidden; border-radius: 99px; background: var(--surface-soft); }
.wf-bar > span { position: absolute; top: 0; bottom: 0; min-width: 3px; border-radius: inherit; }
.wf-bar > span.cost { background: color-mix(in srgb, var(--neg) 55%, var(--border)); }
.wf-bar > span.credit { background: color-mix(in srgb, var(--pos) 60%, var(--border)); }
.wf-total { display: flex; justify-content: space-between; margin-top: 4px; padding-top: 11px; border-top: 1px solid var(--border); color: var(--text-soft); font-size: .84rem; font-variant-numeric: tabular-nums; font-weight: 680; }
.wf-net { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; margin-top: 18px; padding: 15px 16px; border-radius: 11px; background: var(--surface-soft); }
.wf-net > span:first-child { color: var(--muted); font-size: .72rem; font-weight: 740; letter-spacing: .08em; text-transform: uppercase; }
.wf-net .big { font-family: var(--display); font-size: 1.48rem; font-variant-numeric: tabular-nums; font-weight: 650; letter-spacing: -.025em; text-align: right; }
.scale { margin: 24px 4px 10px; }
.scale-track { position: relative; height: 9px; border-radius: 99px; background: linear-gradient(90deg, var(--pos-bg), var(--surface-soft)); }
.scale-fill { position: absolute; top: 0; height: 9px; border-radius: 99px; background: color-mix(in srgb, var(--accent) 40%, var(--surface)); }
.scale-mark { position: absolute; top: -5px; width: 2px; height: 19px; border-radius: 2px; background: var(--accent); box-shadow: 0 0 0 2px var(--surface); }
.scale-mark.buy { background: var(--neg); }
.scale-mark.breakeven { background: var(--warn); }
.scale-labels { display: flex; justify-content: space-between; margin-top: 10px; color: var(--muted); font-size: .7rem; font-variant-numeric: tabular-nums; }
.legend { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin: 12px 0 0; }
.legend > span { display: inline-flex; align-items: center; }
.legend .swatch { display: inline-block; width: 7px; height: 7px; margin-right: 6px; border-radius: 2px; }
.swatch.buy { background: var(--neg); }
.swatch.breakeven { background: var(--warn); }
.swatch.median { background: var(--accent); }
.kv { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 0 16px; font-size: .84rem; }
.kv .k, .kv .v { padding: 8px 0; border-bottom: 1px solid var(--border); }
.kv .k { color: var(--muted); }
.kv .v { color: var(--text-soft); font-variant-numeric: tabular-nums; text-align: right; }
.kv > :nth-last-child(-n+2) { border-bottom: 0; }
.scenario-form { display: flex; align-items: flex-end; gap: 9px; margin-top: 16px; }
.scenario-field { display: grid; flex: 1; gap: 5px; }
.money-input { position: relative; }
.money-input span { position: absolute; top: 50%; left: 11px; transform: translateY(-50%); color: var(--muted); }
.money-input input { width: 100%; padding-left: 26px; font-variant-numeric: tabular-nums; }

/* Tables */
.table-wrap {
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
  scrollbar-color: var(--border-strong) transparent;
}
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: .82rem; }
th, td { padding: 12px 15px; border-bottom: 1px solid var(--border); text-align: left; vertical-align: middle; white-space: nowrap; }
th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: .64rem;
  font-weight: 760;
  letter-spacing: .085em;
  text-transform: uppercase;
}
th:first-child { border-top-left-radius: var(--radius-lg); }
th:last-child { border-top-right-radius: var(--radius-lg); }
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background .12s ease; }
tbody tr:hover { background: color-mix(in srgb, var(--surface-soft) 60%, transparent); }
td.num, th.num { font-variant-numeric: tabular-nums; text-align: right; }
td.wrap { min-width: 250px; white-space: normal; }
.table-primary { color: var(--text); font-weight: 650; }
.table-secondary { display: block; margin-top: 2px; color: var(--muted); font-size: .72rem; }
.status-dot { display: inline-flex; align-items: center; gap: 6px; font-size: .72rem; font-weight: 650; }
.status-dot::before { width: 6px; height: 6px; border-radius: 50%; background: currentColor; content: ""; }
.status-ok { color: var(--pos); }
.status-off { color: var(--neg); }
.table-note { margin: 11px 3px 0; color: var(--muted); font-size: .74rem; }

/* Activity and settings */
.guard { grid-template-columns: repeat(5, minmax(0, 1fr)); margin-bottom: 18px; }
.guard .tile .value { font-family: var(--sans); font-size: 1.28rem; font-weight: 710; letter-spacing: -.02em; }
.callout {
  display: flex;
  align-items: flex-start;
  gap: 11px;
  padding: 13px 15px;
  border: 1px solid color-mix(in srgb, var(--info) 22%, var(--border));
  border-radius: 11px;
  background: var(--info-bg);
  color: var(--info);
  font-size: .8rem;
}
.callout svg { width: 16px; height: 16px; flex: 0 0 auto; margin-top: 1px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.empty { padding: 64px 22px !important; color: var(--muted); text-align: center; }
.empty-state { padding: 64px 24px; border: 1px dashed var(--border-strong); border-radius: var(--radius-lg); background: color-mix(in srgb, var(--surface) 60%, transparent); text-align: center; }
.empty-state-icon { display: grid; width: 48px; height: 48px; margin: 0 auto 14px; place-items: center; border-radius: 50%; background: var(--surface-soft); color: var(--muted); }
.empty-state-icon svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.empty-state h2, .empty-state h3 { margin-bottom: 5px; font-family: var(--display); font-size: 1.2rem; }
.empty-state p { margin-bottom: 12px; color: var(--muted); font-size: .84rem; }

.update-toast {
  position: fixed;
  z-index: 30;
  right: 22px;
  bottom: 22px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 11px;
  width: min(520px, calc(100% - 28px));
  padding: 13px 13px 13px 16px;
  border: 1px solid var(--border-strong);
  border-radius: 14px;
  background: var(--surface-raised);
  box-shadow: var(--shadow-md);
}
.update-toast[hidden] { display: none; }
.update-toast-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 5px var(--ring); }
.update-toast strong, .update-toast span { display: block; }
.update-toast strong { color: var(--text); font-size: .82rem; }
.update-toast div > span { margin-top: 2px; color: var(--muted); font-size: .72rem; }
.toast-dismiss { display: inline-grid; width: 32px; height: 32px; padding: 0; place-items: center; border: 0; border-radius: 50%; background: transparent; color: var(--muted); cursor: pointer; font-size: 1.2rem; }
.toast-dismiss:hover { background: var(--surface-soft); color: var(--text); }
.settings-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.settings-group { min-width: 0; }
.settings-group h3 {
  margin: 0 0 8px 3px;
  color: var(--muted);
  font-size: .67rem;
  font-weight: 760;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.settings-group .table-wrap { border-radius: var(--radius); }
.settings-group table { table-layout: fixed; }
.settings-group td { overflow: hidden; padding: 10px 14px; text-overflow: ellipsis; }
.settings-group td:last-child { color: var(--text-soft); text-align: right; }
.settings-wide { grid-column: 1 / -1; }
.settings-note { display: flex; gap: 11px; margin: 20px 0 0; }
.settings-note svg { width: 17px; height: 17px; flex: 0 0 auto; margin-top: 1px; fill: none; stroke: var(--metal); stroke-width: 1.7; }
.notification-panel { display: flex; align-items: center; gap: 16px; }
.notification-icon { display: grid; width: 42px; height: 42px; flex: 0 0 auto; place-items: center; border-radius: 11px; background: var(--metal-soft); color: var(--metal); }
.notification-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.7; }
.notification-copy { flex: 1; color: var(--text-soft); font-size: .85rem; }

/* Login */
.login-page { overflow-x: hidden; background: var(--bg); }
.login-page::before {
  position: fixed;
  right: -13rem;
  bottom: -15rem;
  width: 34rem;
  height: 34rem;
  border: 1px solid color-mix(in srgb, var(--metal) 13%, transparent);
  border-radius: 50%;
  box-shadow: 0 0 0 5rem color-mix(in srgb, var(--metal) 3%, transparent), 0 0 0 10rem color-mix(in srgb, var(--metal) 2%, transparent);
  content: "";
  pointer-events: none;
}
.login-theme { position: fixed; top: 20px; right: 22px; z-index: 5; }
.login-shell { display: grid; grid-template-columns: minmax(360px, .9fr) minmax(430px, 1.1fr); min-height: 100vh; }
.login-story {
  position: relative;
  display: flex;
  overflow: hidden;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(35px, 5vw, 70px);
  background:
    radial-gradient(circle at 15% 110%, rgba(213, 178, 106, .17), transparent 32rem),
    linear-gradient(145deg, #173d30, #0b251c);
  color: #eff6f2;
}
.login-story::before {
  position: absolute;
  top: 50%;
  right: -18rem;
  width: 37rem;
  height: 37rem;
  transform: translateY(-50%);
  border: 1px solid rgba(216, 189, 133, .18);
  border-radius: 50%;
  box-shadow: 0 0 0 5rem rgba(216, 189, 133, .035), 0 0 0 10rem rgba(216, 189, 133, .025);
  content: "";
}
.login-story::after {
  position: absolute;
  top: 50%;
  right: 10%;
  width: 2px;
  height: 8rem;
  transform: translateY(-100%) rotate(36deg);
  transform-origin: bottom;
  border-radius: 2px;
  background: rgba(216, 189, 133, .38);
  box-shadow: 0 8rem 0 rgba(216, 189, 133, .15);
  content: "";
}
.login-brand, .login-mobile-brand { position: relative; z-index: 1; display: flex; align-items: center; gap: 13px; }
.login-brand .brand-name { color: #f4f8f5; }
.brand-mark-large { width: 34px; height: 34px; }
.login-copy { position: relative; z-index: 1; max-width: 520px; margin: auto 0; padding: 70px 0; }
.login-copy h1 { margin-bottom: 22px; color: #fff; font-size: clamp(2.7rem, 5vw, 5rem); line-height: .98; }
.login-copy > p:last-child { max-width: 460px; margin: 0; color: rgba(237, 245, 240, .7); font-size: 1rem; line-height: 1.75; }
.login-signal { position: relative; z-index: 1; display: flex; align-items: center; gap: 10px; color: rgba(237, 245, 240, .6); font-size: .72rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.login-signal .live-dot { background: #8cd2af; box-shadow: 0 0 0 4px rgba(140, 210, 175, .12); }
.login-panel { position: relative; z-index: 1; display: grid; padding: 60px 30px; place-items: center; }
.login-form-wrap { width: min(100%, 390px); }
.login-mobile-brand { display: none; margin-bottom: 55px; }
.login-form-wrap h2 { margin: 0 0 9px; font-size: 2rem; }
.login-intro { margin-bottom: 27px; font-size: .9rem; }
.login-form { display: grid; gap: 8px; }
.password-field { position: relative; margin-bottom: 7px; }
.password-field svg { position: absolute; top: 50%; left: 13px; width: 17px; height: 17px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-linecap: round; stroke-linejoin: round; stroke-width: 1.6; pointer-events: none; }
.password-field input { width: 100%; min-height: 50px; padding-right: 14px; padding-left: 41px; border-radius: 10px; }
.password-field input[aria-invalid="true"] { border-color: var(--neg); box-shadow: 0 0 0 4px color-mix(in srgb, var(--neg) 12%, transparent); }
.login-err { display: flex; align-items: flex-start; gap: 8px; margin: 14px 0 0; padding: 10px 12px; border-radius: 9px; background: var(--neg-bg); color: var(--neg); font-size: .8rem; }
.login-err span { display: inline-grid; width: 17px; height: 17px; flex: 0 0 auto; place-items: center; border: 1px solid currentColor; border-radius: 50%; font-size: .68rem; font-weight: 750; }
.login-help { margin: 24px 0 0; color: var(--faint); font-size: .73rem; text-align: center; }

/* Responsive layout */
@media (max-width: 1050px) {
  .topbar-inner { gap: 18px; }
  .nav a { padding-right: 9px; padding-left: 9px; }
  .live-pill > span:last-child { display: none; }
  .live-pill { width: 32px; padding: 0; justify-content: center; }
  .tiles, .guard { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .tile:nth-child(4)::before { display: none; }
  .tile:nth-child(n+4) { border-top: 1px solid var(--border); }
  .settings-list { grid-template-columns: 1fr; }
  .settings-wide { grid-column: auto; }
}

@media (max-width: 880px) {
  .detail-grid { grid-template-columns: 1fr; }
  .cards { grid-template-columns: 1fr; }
  .login-shell { grid-template-columns: minmax(300px, .8fr) minmax(390px, 1.2fr); }
  .login-copy h1 { font-size: clamp(2.4rem, 6vw, 4rem); }
}

@media (max-width: 760px) {
  .topbar-inner {
    grid-template-columns: 1fr auto;
    gap: 7px 14px;
    width: min(100% - 28px, 1240px);
    padding: 12px 0 8px;
  }
  .brand { min-height: 33px; }
  .topbar-actions { justify-self: end; }
  .live-pill { display: none; }
  .nav {
    grid-row: 2;
    grid-column: 1 / -1;
    width: 100%;
    overflow-x: auto;
    padding: 2px 0 0;
    scrollbar-width: none;
  }
  .nav::-webkit-scrollbar { display: none; }
  .nav a { flex: 1 0 auto; justify-content: center; min-height: 36px; padding: 6px 9px; font-size: .76rem; }
  .container { width: min(100% - 28px, 1240px); padding: 32px 0 60px; }
  .site-footer { width: min(100% - 28px, 1240px); flex-direction: column; gap: 5px; }
  .page-head { align-items: flex-start; margin-bottom: 23px; }
  .tiles, .guard { grid-template-columns: repeat(2, minmax(0, 1fr)); border-radius: var(--radius); }
  .tile { padding: 17px 16px; }
  .tile:nth-child(odd)::before { display: none; }
  .tile:nth-child(even)::before { display: block; }
  .tile:nth-child(n+3) { border-top: 1px solid var(--border); }
  .tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .filters { align-items: stretch; flex-wrap: wrap; }
  .filter-group { min-width: calc(50% - 6px); flex: 1; }
  .search-filter { min-width: 100%; flex-basis: 100%; }
  .filter-group select { width: 100%; }
  .checkbox-filter { flex: 1 0 100%; }
  .filter-actions { width: 100%; margin-left: 0; }
  .filter-actions .btn { flex: 1; }
  select { width: 100%; min-width: 0; }
  .head-figure { width: 100%; padding-top: 16px; border-top: 1px solid var(--border); text-align: left; }
  .head-meta { justify-content: flex-start; }
  .decision-banner { grid-template-columns: 1fr; gap: 12px; }
  .decision-value { font-size: 2.5rem; }
  .login-shell { grid-template-columns: 1fr; }
  .login-story { display: none; }
  .login-panel { min-height: 100vh; padding: 76px 24px 45px; }
  .login-mobile-brand { display: flex; }
}

@media (max-width: 520px) {
  body { font-size: 14px; }
  h1 { font-size: 2rem; }
  .topbar-inner { width: min(100% - 22px, 1240px); }
  .brand-name { font-size: .72rem; }
  .brand-mark { width: 25px; height: 25px; }
  .nav a { gap: 5px; padding-right: 7px; padding-left: 7px; font-size: .71rem; }
  .nav a svg { width: 13px; height: 13px; }
  .container { width: min(100% - 22px, 1240px); padding-top: 27px; }
  .site-footer { width: min(100% - 22px, 1240px); }
  .opp { gap: 13px; padding: 17px; border-radius: var(--radius); }
  .opp .title { font-size: 1.12rem; }
  .margin .pct { font-size: 1.6rem; }
  .bid-ceiling { min-height: 72px; padding: 12px 13px; }
  .bid-ceiling-value { font-size: 1.45rem; }
  .bid-ceiling-value.too-high { max-width: 145px; font-size: .79rem; }
  .opp-grid { gap: 7px 9px; font-size: .76rem; }
  .opp-grid .k { white-space: normal; }
  .opp-grid .val { white-space: normal; }
  .opp-foot { flex-wrap: wrap; row-gap: 7px; }
  .opp-foot .when { width: 100%; margin-left: 0; padding-top: 7px; border-top: 1px dashed var(--border); }
  .panel { padding: 18px 16px; border-radius: var(--radius); }
  .wf-row { grid-template-columns: 105px minmax(35px, 1fr) 76px; gap: 7px; font-size: .75rem; }
  .wf-row .amt { font-size: .69rem; }
  .wf-net { align-items: flex-start; flex-direction: column; gap: 5px; }
  .wf-net .big { text-align: left; }
  .scenario-form { align-items: stretch; flex-direction: column; }
  .scenario-form .btn { width: 100%; }
  .notification-panel { align-items: flex-start; flex-wrap: wrap; }
  .notification-panel .btn { width: 100%; }
  .result-summary { align-items: flex-start; flex-direction: column; gap: 4px; }
  .pagination { justify-content: space-between; gap: 8px; }
  .page-numbers { display: none; }
  .page-direction { min-width: 0; flex: 1; }
  .update-toast { right: 11px; bottom: 11px; grid-template-columns: auto minmax(0, 1fr) auto; }
  .update-toast .btn { grid-row: 2; grid-column: 2; justify-self: start; }
  .toast-dismiss { grid-row: 1; grid-column: 3; }
  .notification-copy { flex-basis: calc(100% - 60px); }
  .login-panel { padding-right: 20px; padding-left: 20px; }
}

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

@media print {
  .topbar, .site-footer, .filters, .btn, .theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
  .container { width: 100%; padding: 20px; }
  .opp, .panel, .table-wrap, .decision-banner { break-inside: avoid; box-shadow: none; }
}
