/* The Public Ledger — editorial data system.
   Newsreader (display serif) + Public Sans (UI/data), self-hosted.
   Type carries hierarchy; hairlines and whitespace over fills and boxes. */

@font-face{font-family:"Public Sans";src:url(fonts/public-sans-latin.woff2) format("woff2");font-weight:100 900;font-style:normal;font-display:swap}
@font-face{font-family:"Public Sans";src:url(fonts/public-sans-italic-latin.woff2) format("woff2");font-weight:100 900;font-style:italic;font-display:swap}
@font-face{font-family:"Newsreader";src:url(fonts/newsreader-latin.woff2) format("woff2");font-weight:200 800;font-style:normal;font-display:swap}
@font-face{font-family:"Newsreader";src:url(fonts/newsreader-italic-latin.woff2) format("woff2");font-weight:200 800;font-style:italic;font-display:swap}

:root{
  color-scheme: light;
  /* paper + ink */
  --page:#faf9f6; --surface:#ffffff;
  --ink:#16150f; --ink-2:#4a473f; --muted:#8b8578;
  /* two-tier rules (old names kept as aliases so every rule resolves) */
  --hair:rgba(22,21,15,.10); --rule:rgba(22,21,15,.20);
  --grid:var(--hair); --border:var(--hair); --baseline:var(--rule);
  /* accent + data */
  --accent:#2b5fb3; --accent-soft:#a9c2e8;
  --series-1:#2b5fb3; --series-1-soft:#a9c2e8; --series-2:#1f8a5b;
  --pos:#2b5fb3; --neg:#c0392f; --up:#1f8a5b;
  --link:#2b5fb3;
  /* type */
  --sans:"Public Sans",system-ui,-apple-system,"Segoe UI",sans-serif;
  --serif:"Newsreader",Georgia,"Times New Roman",serif;
  /* space scale (4px) + radius */
  --sp1:4px;--sp2:8px;--sp3:12px;--sp4:16px;--sp5:24px;--sp6:32px;--sp7:48px;--sp8:64px;
  --radius:6px;
}
:root[data-theme="dark"]{
  color-scheme: dark;
  --page:#131210; --surface:#1c1a17;
  --ink:#f3f1ea; --ink-2:#c2bdb0; --muted:#8b8578;
  --hair:rgba(243,241,234,.11); --rule:rgba(243,241,234,.22);
  --grid:var(--hair); --border:var(--hair); --baseline:var(--rule);
  --accent:#6ea3ee; --accent-soft:#294c7d;
  --series-1:#6ea3ee; --series-1-soft:#294c7d; --series-2:#4fb387;
  --pos:#6ea3ee; --neg:#e2776c; --up:#4fb387;
  --link:#8fb6f0;
}
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]){
    color-scheme: dark;
    --page:#131210; --surface:#1c1a17;
    --ink:#f3f1ea; --ink-2:#c2bdb0; --muted:#8b8578;
    --hair:rgba(243,241,234,.11); --rule:rgba(243,241,234,.22);
    --grid:var(--hair); --border:var(--hair); --baseline:var(--rule);
    --accent:#6ea3ee; --accent-soft:#294c7d;
    --series-1:#6ea3ee; --series-1-soft:#294c7d; --series-2:#4fb387;
    --pos:#6ea3ee; --neg:#e2776c; --up:#4fb387;
    --link:#8fb6f0;
  }
}

*{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0; background:var(--page); color:var(--ink);
  font-family:var(--sans); font-size:16px; line-height:1.6;
  font-optical-sizing:auto; -webkit-font-smoothing:antialiased;
  font-variant-numeric:tabular-nums;
}
.wrap{margin:0 auto; padding:0 var(--sp5)}
a{color:var(--link); text-decoration:none}
a:hover{text-decoration:underline}

/* ---------- App shell: sidebar + content ---------- */
:root{ --sidebar-w:264px; --sidebar-rail:60px; --topbar-h:54px; }

.shell{ display:flex; min-height:100vh; align-items:flex-start; }

.sidebar{
  width:var(--sidebar-w); flex:0 0 var(--sidebar-w);
  background:var(--page); border-right:1px solid var(--hair);
  display:flex; flex-direction:column;
  position:sticky; top:0; height:100vh; overflow:hidden auto;
  transition:width .2s ease, flex-basis .2s ease;
}

/* Collapsed = icon rail. The brand row has no icon (text-only wordmark), so
   with the text hidden there'd be nothing left to show — hide the row
   entirely rather than leave an empty gap; the topbar toggle still expands it. */
body.sidebar-collapsed .sidebar{ width:var(--sidebar-rail); flex-basis:var(--sidebar-rail); }
body.sidebar-collapsed .brand,
body.sidebar-collapsed .sb-text,
body.sidebar-collapsed .sb-chevron,
body.sidebar-collapsed .sb-sub{ display:none; }
body.sidebar-collapsed .sb-item{ justify-content:center; padding:0; gap:0; }
body.sidebar-collapsed .sb-icon{ opacity:.9; }

:root{ --sb-hover:color-mix(in srgb, var(--ink) 6%, transparent);
       --sb-active:color-mix(in srgb, var(--ink) 9%, transparent); }

.sidebar .brand{
  display:flex; align-items:center; gap:var(--sp2); flex-shrink:0;
  margin:var(--sp3) var(--sp2) var(--sp1); padding:var(--sp2); border-radius:var(--radius); color:inherit;
}
.sidebar .brand:hover{ text-decoration:none; background:var(--sb-hover); }
.brand-name{ font-family:var(--serif); font-weight:560; font-size:1rem; letter-spacing:-.01em; line-height:1.2; }

/* Mirror of the brand in the topbar — only shown on mobile (sidebar off-canvas). */
.topbar-brand{
  display:none; align-items:center; gap:var(--sp2); margin-left:var(--sp3);
  color:inherit; font-weight:600; font-size:.95rem; letter-spacing:-.01em;
}
.topbar-brand:hover{ text-decoration:none; color:inherit; }

.sidebar-nav{
  flex:1; padding:var(--sp2); overflow-y:auto;
  display:flex; flex-direction:column; gap:1px;
}
.sb-section{ display:flex; flex-direction:column; }

.sb-item{
  display:flex; align-items:center; gap:9px;
  height:34px; padding:0 var(--sp2); border-radius:var(--radius);
  color:var(--ink-2); font-size:.875rem; font-weight:500;
  transition:background .12s ease, color .12s ease;
}
.sb-item:hover{ background:var(--sb-hover); color:var(--ink); text-decoration:none; }
.sb-item.active{ background:var(--sb-active); color:var(--ink); font-weight:600; }
.sb-icon{ width:16px; height:16px; flex-shrink:0; opacity:.7; }
.sb-item.active .sb-icon{ opacity:1; }
.sb-text{ flex:1; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.sb-chevron{ width:14px; height:14px; flex-shrink:0; opacity:.5;
  transition:transform .18s ease; border-radius:4px; padding:6px; margin:-6px -6px -6px 0;
  box-sizing:content-box; }
.sb-chevron:hover{ opacity:1; background:var(--sb-active); }
.sb-item.expanded .sb-chevron{ transform:rotate(90deg); }

.sb-sub{
  list-style:none; margin:1px 0 var(--sp1); padding:0 0 0 var(--sp3);
  margin-left:15px; border-left:1px solid var(--hair);
  display:flex; flex-direction:column; gap:1px;
}
.sb-subitem{
  display:block; height:30px; line-height:30px; padding:0 9px;
  border-radius:var(--radius); color:var(--muted);
  font-size:.83rem; font-weight:500;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.sb-subitem:hover{ background:var(--sb-hover); color:var(--ink); text-decoration:none; }
.sb-subitem.active{ background:var(--sb-active); color:var(--ink); font-weight:600; }

.icon-btn{
  background:none; border:1px solid var(--hair); border-radius:var(--radius);
  color:var(--ink-2); font-size:1rem; width:34px; height:34px; cursor:pointer;
  display:inline-flex; align-items:center; justify-content:center; flex-shrink:0;
}
.icon-btn:hover{ color:var(--ink); border-color:var(--rule); }

.content{ flex:1; min-width:0; display:flex; flex-direction:column; }
.content-topbar{
  position:sticky; top:0; z-index:20; height:var(--topbar-h); flex-shrink:0;
  display:flex; align-items:center; padding:0 var(--sp5);
  background:color-mix(in srgb, var(--page) 88%, transparent);
  backdrop-filter:saturate(1.4) blur(6px);
  border-bottom:1px solid var(--hair);
}
.topbar-meta{ margin-left:auto; display:flex; align-items:center; gap:var(--sp3); }
.topbar-meta .meta{ color:var(--muted); font-size:.72rem; line-height:1.35; margin:0; text-align:right; }

.shell-backdrop{ display:none; }

@media (max-width:860px){
  .sidebar{
    position:fixed; top:0; left:0; z-index:40; margin-left:0 !important;
    transform:translateX(-100%); transition:transform .2s ease;
    box-shadow:2px 0 20px rgba(0,0,0,.25);
  }
  body.sidebar-mobile-open .sidebar{ transform:translateX(0); }
  body.sidebar-mobile-open .shell-backdrop{
    display:block; position:fixed; inset:0; z-index:35;
    background:rgba(0,0,0,.5);
  }
  .topbar-meta .meta{ display:none; }
  .topbar-brand{ display:flex; }
}

/* Content column: full width, capped + centred on wide screens. */
main.wrap{ width:100%; max-width:1180px; padding:var(--sp6) var(--sp6) var(--sp8); min-height:55vh; }
@media (max-width:640px){ main.wrap{ padding:var(--sp5) var(--sp5) var(--sp7); } }

/* ---------- Page header: serif title + standfirst + rule ---------- */
main.wrap > h1{
  font-family:var(--serif); font-weight:560; font-size:2.4rem; line-height:1.1;
  letter-spacing:-.015em; margin:0 0 var(--sp3);
}
@media (max-width:640px){ main.wrap > h1{ font-size:1.9rem; } }
/* the first note after the title reads as an editorial standfirst + header rule */
main.wrap > h1 + p.aliases,
main.wrap > h1 + p.note,
main.wrap > p.aliases:first-of-type{
  font-family:var(--sans); font-size:1.02rem; line-height:1.55; color:var(--ink-2);
  max-width:64ch; margin:0; padding-bottom:var(--sp5);
  border-bottom:1px solid var(--rule);
}
main.wrap > h1 + p.aliases + *,
main.wrap > h1 + p.note + *{ margin-top:var(--sp6); }

/* ---------- Home landing ----------
   One repeating rhythm per section: tiny uppercase label + rule (tight gap
   below it), stat band, then supporting content. .home-section carries the
   only inter-section margin, so every section is spaced identically instead
   of each piece guessing its own. */
.home-hero{ margin:var(--sp1) 0 0; }
.home-hero p{
  font-family:var(--serif); font-weight:400; font-size:1.5rem; line-height:1.4;
  color:var(--ink); max-width:40ch; letter-spacing:-.005em;
}
.home-section{ margin-top:var(--sp8); }
.home-h{ font-size:.74rem; text-transform:uppercase; letter-spacing:.12em;
  color:var(--muted); font-weight:600; margin:0 0 var(--sp4);
  padding-bottom:var(--sp2); border-bottom:1px solid var(--rule); }

/* Supporting links — de-boxed to match the rest of the site (no card, no
   border): a serif title that reads as a link, plus a one-line description,
   the same treatment "Latest awards" etc. use for content headings. */
.home-links{ display:grid; grid-template-columns:1fr 1fr; gap:var(--sp3) var(--sp6); margin-top:var(--sp6); }
@media (max-width:700px){ .home-links{ grid-template-columns:1fr; } }
.home-link{ display:block; color:inherit; }
.home-link:hover{ text-decoration:none; }
.home-link h3{ margin:0 0 var(--sp1); font-family:var(--serif); font-weight:560;
  font-size:1.15rem; letter-spacing:-.005em; color:var(--ink); transition:color .12s ease; }
.home-link:hover h3{ color:var(--accent); }
.home-link p{ margin:0; font-size:.9rem; line-height:1.5; color:var(--ink-2); }
.home-link strong{ color:var(--ink); font-weight:600; }

/* ---------- Stat band (de-boxed tiles) ---------- */
.tiles{ display:grid; grid-template-columns:repeat(auto-fit,minmax(190px,1fr));
  gap:0 var(--sp5); margin:0 0 var(--sp7); }
.tile{ position:relative; padding:var(--sp3) 0 0; border-top:1.5px solid var(--rule); }
/* A section label (.home-h) or the page header's standfirst already draws
   its own rule directly above — the tiles' own top rule right after it
   would just double that line, so drop it wherever tiles follow one. This
   only holds while every tile fits in a single row; below the breakpoint
   where the grid forces one column (next rule), later tiles are stacked,
   not side by side, and need their own border back to stay separated. */
.home-h + .tiles .tile,
main.wrap > h1 + p.aliases + .tiles .tile,
main.wrap > h1 + p.note + .tiles .tile{ border-top:none; padding-top:0; }
@media (max-width:700px){
  .home-h + .tiles,
  main.wrap > h1 + p.aliases + .tiles,
  main.wrap > h1 + p.note + .tiles{ grid-template-columns:1fr; }
  .home-h + .tiles > .tile:not(:first-child),
  main.wrap > h1 + p.aliases + .tiles > .tile:not(:first-child),
  main.wrap > h1 + p.note + .tiles > .tile:not(:first-child){
    border-top:1.5px solid var(--rule); padding-top:var(--sp3);
  }
}
.tile .label{ color:var(--muted); font-size:.73rem; text-transform:uppercase;
  letter-spacing:.05em; font-weight:600; margin-bottom:var(--sp2); }
.tile .value{ font-size:1.9rem; line-height:1; font-weight:600; letter-spacing:-.02em; }
.tile .value .tunit{ font-size:.9rem; color:var(--muted); font-weight:500; letter-spacing:0; }
.tile .sub{ color:var(--muted); font-size:.78rem; margin-top:var(--sp2); }

/* Info marker + tooltip */
.tip{
  display:inline-flex; align-items:center; justify-content:center;
  width:15px; height:15px; margin-left:5px; border-radius:50%;
  border:1px solid var(--rule); color:var(--muted);
  font-size:.6rem; font-weight:700; font-style:normal; cursor:help;
  vertical-align:middle; position:relative; user-select:none;
}
.tip:hover,.tip:focus-visible{ color:var(--ink); border-color:var(--ink-2); outline:none; }
.tip::after{
  content:attr(data-tip); position:absolute; bottom:calc(100% + 9px); left:0;
  width:max-content; max-width:260px;
  background:var(--ink); color:var(--page);
  padding:9px 11px; border-radius:var(--radius);
  font-size:.76rem; font-weight:400; line-height:1.45; text-align:left;
  letter-spacing:0; box-shadow:0 6px 20px rgba(0,0,0,.22);
  opacity:0; visibility:hidden; transform:translateY(3px); transition:opacity .12s ease, transform .12s ease;
  z-index:60; pointer-events:none;
}
.tip:hover::after,.tip:focus-visible::after{ opacity:1; visibility:visible; transform:translateY(0); }

/* ---------- Sections (de-boxed panels) ---------- */
.panel{ margin-bottom:var(--sp7); }
.panel h2{ font-family:var(--serif); font-weight:560; font-size:1.4rem; letter-spacing:-.01em;
  line-height:1.2; margin:0 0 var(--sp1); }
.panel .note{ color:var(--muted); font-size:.85rem; margin:0 0 var(--sp4); max-width:66ch; line-height:1.5; }

/* Sovereign credit rating — the one thing that stays boxed: containment
   now signals "third-party, not official data". */
.rating-panel{ border:1px dashed var(--rule); border-radius:var(--radius); padding:var(--sp5); }
.rating-head{ display:flex; align-items:center; gap:var(--sp3); margin-bottom:var(--sp1); }
.tag-3p{
  font-size:.62rem; text-transform:uppercase; letter-spacing:.08em;
  color:var(--muted); border:1px solid var(--hair);
  border-radius:999px; padding:2px 8px; white-space:nowrap;
}
.rating-list{ display:flex; flex-direction:column; gap:var(--sp3); }
.rating-row{ display:flex; align-items:flex-start; gap:var(--sp4); }
.rating-badge{
  flex:none; min-width:60px; text-align:center;
  font-weight:700; font-size:1.05rem; letter-spacing:.02em;
  color:var(--ink); border:1.5px solid var(--rule);
  border-radius:var(--radius); padding:8px 10px; font-variant-numeric:tabular-nums;
}
.rating-body{ min-width:0; }
.rating-agency{ font-weight:600; font-size:.92rem; }

/* ---------- Budget explorer (collapsible tree) ---------- */
.budget-controls{ display:flex; align-items:center; gap:var(--sp4); flex-wrap:wrap; margin-bottom:var(--sp3); }
.budget-controls label{ display:flex; align-items:center; gap:6px; font-size:.8rem; color:var(--muted); }
.budget-controls select{
  padding:7px 9px; border:1px solid var(--rule); border-radius:var(--radius);
  background:var(--surface); color:var(--ink); font:inherit; font-size:.85rem;
}
.seg{ display:inline-flex; border:1px solid var(--rule); border-radius:var(--radius); overflow:hidden; }
.seg-btn{
  padding:6px 12px; background:var(--surface); color:var(--ink-2);
  border:none; cursor:pointer; font:inherit; font-size:.8rem;
}
.seg-btn + .seg-btn{ border-left:1px solid var(--rule); }
.seg-btn.active{ background:var(--ink); color:var(--page); }
.budget-total{ margin-left:auto; font-weight:600; font-variant-numeric:tabular-nums; }
.budget-search{
  width:100%; padding:8px 10px; margin-bottom:var(--sp3); border:1px solid var(--rule);
  border-radius:var(--radius); background:var(--surface); color:var(--ink); font:inherit; font-size:.85rem;
}
.btree{ border-top:1px solid var(--rule); max-height:640px; overflow-y:auto; }
.btree-row{
  display:flex; align-items:center; gap:var(--sp2); padding:5px 4px;
  border-bottom:1px solid var(--hair); font-size:.84rem;
}
.btree-row.btree-target{ background:var(--sb-active); }
.btree-toggle{
  flex:none; width:20px; height:20px; border:none; background:none; cursor:pointer;
  color:var(--muted); font-size:.7rem; display:flex; align-items:center; justify-content:center;
}
.btree-toggle-empty{ cursor:default; opacity:.35; }
.btree-name{ flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.btree-path{ color:var(--muted); font-size:.78rem; }
.btree-bar-wrap{
  flex:none; width:80px; height:6px; border-radius:1px; background:var(--hair); overflow:hidden;
}
.btree-bar{ display:block; height:100%; background:var(--accent); border-radius:1px; }
.btree-amount{ flex:none; width:110px; text-align:right; font-variant-numeric:tabular-nums; color:var(--ink-2); }
.btree-change{ flex:none; width:56px; text-align:right; font-variant-numeric:tabular-nums; font-size:.78rem; }
.btree-change-down{ color:var(--series-2); }
.btree-change-up{ color:var(--neg); }
.btree-change-flat{ color:var(--muted); }
.btree-search-row{ cursor:pointer; }
.btree-search-row:hover{ background:var(--sb-hover); }
@media (max-width:640px){
  .btree-bar-wrap{ display:none; }
  .btree-amount{ width:auto; }
  .btree-change{ width:auto; }
}

/* ---------- Two-up grid + bar lists ---------- */
.grid-2{ display:grid; grid-template-columns:minmax(0,1fr) minmax(0,1fr); gap:var(--sp6); }
@media (max-width:800px){ .grid-2{ grid-template-columns:minmax(0,1fr); } }

.barlist{ display:flex; flex-direction:column; gap:var(--sp2); }
.barrow{ display:grid; grid-template-columns:minmax(120px,34%) 1fr max-content; gap:var(--sp3); align-items:center; font-size:.86rem; }
.barrow .blabel{ color:var(--ink-2); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.barrow .btrack{ height:10px; position:relative; background:var(--hair); border-radius:1px; }
.barrow .bfill{
  position:absolute; inset:0 auto 0 0; min-width:2px;
  background:var(--accent); border-radius:1px;
}
.barrow .bval{ color:var(--ink); font-variant-numeric:tabular-nums; font-size:.82rem; }

/* Hierarchical bar list (revenue: totals with nested components) */
.barrow-total{ margin-top:var(--sp1); }
.barrow-total:first-child{ margin-top:0; }
.barrow-total .blabel{ color:var(--ink); font-weight:650; }
.barrow-child .blabel{ padding-left:16px; color:var(--muted); font-size:.8rem; }
.barrow-child .btrack{ height:8px; }
.barrow-child .bfill{ background:var(--series-1-soft); }
.barrow-child .bval{ color:var(--ink-2); }

/* Year columns */
.yearchart{ display:flex; align-items:flex-end; gap:var(--sp2); height:180px; padding-top:18px; border-bottom:1px solid var(--rule); }
.yearcol{ flex:1; display:flex; flex-direction:column; justify-content:flex-end; align-items:center; height:100%; min-width:0; }
.yearcol .cfill{ width:60%; max-width:44px; background:var(--accent); border-radius:2px 2px 0 0; min-height:2px; }
.yearcol .cval{ font-size:.7rem; color:var(--muted); margin-bottom:4px; font-variant-numeric:tabular-nums; }
.yearlabels{ display:flex; gap:var(--sp2); margin-top:6px; }
.yearlabels span{ flex:1; text-align:center; font-size:.75rem; color:var(--muted); }

/* ---------- Search + tables ---------- */
.searchbox{
  width:100%; max-width:460px; padding:10px 14px; margin:0 0 var(--sp4);
  border:1px solid var(--rule); border-radius:var(--radius);
  background:var(--surface); color:var(--ink); font:inherit; font-size:.95rem;
}
.searchbox:focus{ outline:2px solid var(--accent); outline-offset:1px; border-color:transparent; }

/* overflow-x for wide tables also makes overflow-y a scroll container, which
   is what lets the sticky header (below) pin to the top of the table as it
   scrolls internally. The cap keeps a long table from pushing the whole page
   taller than the viewport; short tables stay under the cap and don't scroll. */
.tablewrap{ overflow:auto; max-height:calc(100vh - var(--topbar-h) - var(--sp8)); }
table.data{ border-collapse:collapse; width:100%; font-size:.88rem; font-variant-numeric:tabular-nums; }
table.data th,table.data td{ padding:10px 16px 10px 0; text-align:left; }
table.data th{
  color:var(--muted); font-weight:600; font-size:.72rem; text-transform:uppercase;
  letter-spacing:.05em;
  white-space:nowrap; cursor:default;
  /* Stick to the top of the .tablewrap scroll area as its rows scroll under.
     A box-shadow draws the bottom rule so it stays put when sticky (a
     border-collapse border would detach); the opaque background hides rows. */
  position:sticky; top:0; z-index:5;
  background:var(--page); box-shadow:inset 0 -1px 0 var(--rule);
}
table.data th.sortable{ cursor:pointer; }
table.data th.sortable:hover{ color:var(--ink); }
table.data td{ border-bottom:1px solid var(--hair); vertical-align:baseline; color:var(--ink); }
table.data tr:last-child td{ border-bottom:none; }
table.data td.num,table.data th.num{ text-align:right; font-variant-numeric:tabular-nums; white-space:nowrap; padding-right:0; padding-left:var(--sp6); }
table.data th.num{ padding-right:0; }
/* Rank column (leading "#"): numeric but read as a row index, so left-align it
   flush with its header rather than right-align like the value columns. The
   right pad keeps two-digit ranks off the adjacent label. */
table.data td.num:first-child,table.data th.num:first-child{ text-align:left; padding-left:0; padding-right:var(--sp4); }
/* A text column immediately after a numeric one (e.g. Source after the
   right-aligned Awarded Amount) would sit flush against the number; give it a
   left gap. .num columns supply their own left gap, so this only fires on
   non-.num followers; the leading rank column (its own first-child rule) is
   excluded so the rank->name gap isn't doubled. */
table.data th.num:not(:first-child) + th:not(.num),
table.data td.num:not(:first-child) + td:not(.num){ padding-left:var(--sp5); }
table.data tr.rowlink{ cursor:pointer; }
table.data tr.rowlink:hover td{ background:color-mix(in srgb, var(--accent) 5%, transparent); }
.dim{ color:var(--muted); }

/* ---------- Contract record: story column + sticky reference rail ---------- */
.record{ display:grid; grid-template-columns:minmax(0,1fr) 264px; gap:var(--sp7); align-items:start; }
.record-story .panel{ margin-bottom:var(--sp5); }
.record-rail{
  position:sticky; top:calc(var(--topbar-h) + 24px);
  border-left:1px solid var(--hair); padding-left:var(--sp5);
  font-size:.85rem; line-height:1.5;
}
.rail-group{ margin-bottom:var(--sp4); }
.rail-label{
  color:var(--muted); font-size:.68rem; font-weight:650;
  text-transform:uppercase; letter-spacing:.05em; margin-bottom:2px;
}
.rail-value{ overflow-wrap:break-word; }
@media (max-width:900px){
  .record{ grid-template-columns:minmax(0,1fr); }
  .record-rail{ position:static; border-left:none; border-top:1px solid var(--hair); padding:var(--sp4) 0 0; }
}

/* headline card (award) */
.award-head{ padding:0 0 var(--sp4); border-bottom:1px solid var(--rule); }
.award-party{ font-family:var(--serif); font-size:1.7rem; font-weight:560; letter-spacing:-.01em; margin-top:2px; line-height:1.2; }
.award-amount{
  font-size:1.35rem; font-weight:650; letter-spacing:-.01em;
  font-variant-numeric:tabular-nums; margin-top:var(--sp2);
}
.award-meta{ font-size:.85rem; margin-top:var(--sp1); }
.award-flag{
  color:var(--pos); font-size:.68rem; font-weight:700;
  letter-spacing:.05em; margin-left:6px; font-style:normal;
}

/* bid contest table */
.bid-table td:first-child,.bid-table th:first-child{ width:1%; text-align:right; padding-right:6px; }
tr.awarded-bid td{ font-weight:650; background:color-mix(in srgb, var(--accent) 7%, transparent); }
tr.awarded-bid td:nth-child(2){ box-shadow:inset 3px 0 0 var(--accent); }
tr.no-bid-row td{ color:var(--muted); font-style:italic; }

/* labelled rows */
.lrows{ display:flex; flex-direction:column; }
.lrow{ display:grid; grid-template-columns:190px 1fr; gap:var(--sp4); padding:var(--sp2) 0;
  border-bottom:1px solid var(--hair); font-size:.88rem; }
.lrow:last-child{ border-bottom:none; }
.lrow-label{ color:var(--muted); }
@media (max-width:640px){ .lrow{ grid-template-columns:1fr; gap:2px; } }

/* vertical timeline */
.tl{ border-left:2px solid var(--hair); margin-left:5px; padding-left:18px;
  display:flex; flex-direction:column; gap:var(--sp4); }
.tl .ev{ position:relative; }
.tl .ev::before{
  content:""; position:absolute; left:-24.5px; top:4px;
  width:9px; height:9px; border-radius:50%;
  background:var(--page); border:2px solid var(--rule);
}
.tl .ev.major::before{ border-color:var(--accent); background:var(--accent); }
.tl .ev .when{ font-size:.74rem; color:var(--muted); font-variant-numeric:tabular-nums; }
.tl .ev .what{ font-size:.88rem; }

.pill{
  display:inline-block; padding:2px 9px; border-radius:20px;
  font-size:.72rem; font-weight:650; white-space:nowrap;
}
.pill-pass{ color:var(--series-2); background:color-mix(in srgb, var(--series-2) 15%, transparent); }
.pill-fail{ color:var(--neg); background:color-mix(in srgb, var(--neg) 13%, transparent); }
.pill-neutral{ color:var(--muted); background:color-mix(in srgb, var(--muted) 14%, transparent); }

.flagged{ color:#b97e00; }
:root[data-theme="dark"] .flagged{ color:#fab219; }
@media (prefers-color-scheme: dark){
  :root:not([data-theme="light"]) .flagged{ color:#fab219; }
}
.small{ font-size:.78rem; }
.nowrap{ white-space:nowrap; }

/* Filters row */
.filters{ display:flex; flex-wrap:wrap; gap:var(--sp3); margin:0 0 var(--sp4); align-items:center; }
/* Filter-row controls share one explicit height (border-box): an <input> and a
   <select> size differently from padding/line-height alone, so pin both. The
   standalone .searchbox elsewhere keeps its own larger size. */
.filters .searchbox{ margin:0; flex:1 1 260px; height:38px; padding:0 12px; font-size:.85rem; }
.filters select{
  height:38px; padding:0 10px; border:1px solid var(--rule); border-radius:var(--radius);
  background:var(--surface); color:var(--ink); font:inherit; font-size:.85rem;
  max-width:280px;
}

/* Detail pages */
.pagetitle{ font-family:var(--serif); font-weight:560; margin:0 0 var(--sp1); font-size:1.9rem; letter-spacing:-.01em; line-height:1.15; }
table.data.fields th[scope="row"]{
  width:200px; text-transform:none; letter-spacing:0; font-size:.85rem;
  border-bottom:1px solid var(--hair); vertical-align:top; color:var(--ink-2);
}
table.data.fields td{ font-size:.9rem; }
code{ font-size:.8rem; color:var(--ink-2); word-break:break-all; }

/* Company / detail intro */
.backlink{ display:inline-block; margin-bottom:var(--sp3); font-size:.85rem; }
.aliases{ color:var(--ink-2); font-size:.85rem; margin:var(--sp1) 0 var(--sp5); max-width:75ch; }
.aliases strong{ font-weight:600; }

/* Section divider for long, multi-topic pages */
.sec{ margin:var(--sp8) 0 var(--sp5); padding-top:0; }
.sec h3{ font-family:var(--serif); margin:0 0 var(--sp1); font-size:1.5rem; font-weight:560; letter-spacing:-.01em; }
.sec p{ margin:0; color:var(--muted); font-size:.85rem; max-width:80ch; line-height:1.5; }

.pagination{ display:flex; gap:var(--sp2); align-items:center; margin:var(--sp4) 2px; font-size:.85rem; color:var(--ink-2); }
.pagination button{
  border:1px solid var(--hair); background:var(--surface); color:var(--ink-2);
  border-radius:var(--radius); padding:4px 12px; cursor:pointer; font:inherit; font-size:.85rem;
}
.pagination button:disabled{ opacity:.4; cursor:default; }

/* ---------- Charts ---------- */
.linechart-wrap{ position:relative; }
.linechart{ width:100%; height:auto; display:block; }
.cgrid{ stroke:var(--hair); stroke-width:1; }
.cbaseline{ stroke:var(--rule); stroke-width:1; }
.clabel{ fill:var(--ink-2); font-size:10px; font-variant-numeric:tabular-nums; }
.legend{ display:flex; gap:var(--sp4); margin-top:var(--sp2); font-size:.8rem; color:var(--ink-2); flex-wrap:wrap; }
.legend-item{ display:inline-flex; align-items:center; gap:6px; }
.legend-chip{ width:10px; height:10px; border-radius:2px; display:inline-block; }
.chart-tooltip{
  position:absolute; top:8px; pointer-events:none;
  background:var(--surface); border:1px solid var(--hair); border-radius:var(--radius);
  padding:8px 10px; font-size:.75rem; color:var(--ink-2);
  box-shadow:0 2px 8px rgba(0,0,0,.12); min-width:150px;
}
.chart-tooltip strong{ color:var(--ink); }

/* ---------- Footer ----------
   No margin-top here: .content is a flex column, so this wouldn't collapse
   with main.wrap's own bottom padding — it would stack on top of it. */
.site-footer{ border-top:1px solid var(--hair); }
.site-footer .wrap{
  max-width:1180px; padding:var(--sp5) var(--sp6);
  display:flex; flex-wrap:wrap; gap:var(--sp4) var(--sp6); justify-content:space-between; align-items:baseline;
}
.foot-brand{ max-width:44ch; }
.foot-mark{ display:block; font-family:var(--serif); font-weight:560; font-size:1rem;
  letter-spacing:-.01em; color:var(--ink); margin-bottom:var(--sp1); }
.foot-meta{ max-width:32ch; }
.foot-meta a{ font-size:.85rem; font-weight:500; }
.site-footer p{ margin:var(--sp1) 0 0; color:var(--muted); font-size:.8rem; line-height:1.5; }
.site-footer .foot-credit{ flex-basis:100%; margin-top:var(--sp4); padding-top:var(--sp4);
  border-top:1px solid var(--hair); font-size:.75rem; }
@media (max-width:640px){ .site-footer .wrap{ padding:var(--sp5); gap:var(--sp4); } }
