/* ==========================================================================
   Thiruvanchoor Radhakrishnan - portfolio stylesheet

   Layer 1  :root design tokens. The only place raw hex and px values appear.
   Layer 2  tr-<block>__<element>--<modifier> component classes.

   Bootstrap 5 supplies the grid, utilities and the navbar collapse behaviour.
   This file contains zero @media queries by design: responsive behaviour comes
   from Bootstrap's grid classes and from clamp() on anything that scales.
   ========================================================================== */

/* Self-hosted Playfair Display (SIL OFL 1.1, static/fonts/playfair-display-OFL.txt).
   --tr-font-display names it first, but nothing loaded it, so every heading
   silently fell back to Georgia / Times New Roman on machines without the
   font installed. Latin subset only; the weights and styles the stylesheet
   actually uses. */
@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/playfair-display-latin-400-normal.8a53e5ecdbff.woff2") format("woff2");
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("../fonts/playfair-display-latin-500-normal.c9fd9226ff27.woff2") format("woff2");
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/playfair-display-latin-600-normal.53169c2447b2.woff2") format("woff2");
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/playfair-display-latin-700-normal.9401d0214a93.woff2") format("woff2");
}

@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/playfair-display-latin-400-italic.4450ccfb7533.woff2") format("woff2");
}

:root {
  /* Indian National Congress palette: saffron, white, Indian green and the deep
     navy of the Ashoka Chakra. Every value below is a token swap only - no rule
     in the component layer changed, so layout and spacing are untouched.

     Saffron carries almost no contrast against white (about 2:1), so it is used
     as a *fill* with navy text on top, or as text on the navy surfaces. Saffron
     as text on a light surface uses --tr-saffron-ink instead. */

  /* Deep navy (Ashoka Chakra) - header, hero and footer surfaces, primary text */
  --tr-navy-900: #0a1f44;
  --tr-navy-800: #122c58;
  --tr-navy-700: #1b3a6e;
  /* The hero gradient's midpoint and its green end, from the supplied theme. */
  --tr-navy-mid: #142f57;
  --tr-green-deep: #0b5e2e;

  /* Indian green - section surfaces, secondary buttons, icon tiles */
  --tr-green-900: #08331a;
  /* Deep forest green for timeline nodes and section buttons: the reference tone
     without leaving the tricolor family. */
  --tr-green-800: #0d3d20;
  --tr-green-700: #0e6606;
  --tr-green-500: #138808;

  /* Saffron - primary calls to action, active navigation, key accents */
  --tr-saffron-500: #ff9933;
  --tr-saffron-400: #ffb266;
  --tr-saffron-200: #ffe0bf;
  --tr-saffron-ink: #9a4f06; /* saffron dark enough to pass AA on white */

  /* Neutrals - white is the primary page background */
  --tr-page: #ffffff;
  --tr-surface: #ffffff;
  --tr-surface-sunken: #f2f7f3;
  /* Warm card surface and its amber accent, sampled from the statistics row in
     designs/home.png so the cards read as cards against a white page. */
  --tr-surface-warm: #f8f1eb;
  --tr-line-warm: #ece0d4;
  --tr-amber-ink: #965f1c;
  --tr-line: #dfe4ec;
  --tr-line-invert: rgb(255 255 255 / 16%);

  /* Validation. The ink is a deep red rather than a pure one so it clears 4.5:1
     on both the white page and its own tinted surface - a form error nobody can
     read is not an error message. */
  --tr-error-ink: #a4161a;
  --tr-error-surface: #fdf0f0;

  /* Citizen login page (designs/login-mockup.png), sampled from the mockup.
     The green and ink are a shade off the site's own --tr-green-deep and
     --tr-navy, so they get their own names; .tr-login re-exposes them under
     the short names the brief uses without touching the site-wide tokens. */
  --tr-login-cream: #fbf6ee;
  --tr-login-green: #14632d;
  --tr-login-ink: #14213d;
  --tr-login-text: #4f5b52;
  --tr-login-line: #e6dccf;
  --tr-login-field-line: #d9d2c8;
  --tr-login-amber: #ffb15c;
  --tr-login-mint: #e3f0e4;
  --tr-login-mint-dim: #bfdcc3;
  --tr-login-ring: #cfe8d0;
  --tr-login-error: #b42318;
  --tr-signup-connector: #5e9a6e;
  --tr-signup-muted: #6b7a6e;
  --tr-signup-star: #c2410c;
  --tr-signup-dash: #bfb6a8;
  --tr-signup-selected: #eaf4ea;
  --tr-kailm-bg: #f5eee2;
  --tr-kailm-text: #3b4a40;

  /* Text */
  --tr-text: #0a1f44;
  --tr-text-muted: #4a5875;
  --tr-text-invert: #f7f9fc;
  --tr-text-invert-muted: #c3cee2;

  /* Idea-card ribbons and sector/status tags only - a small categorical set
     distinct from the disciplined saffron/green/navy brand palette used for
     buttons, navigation and every other interactive element. Sampled from
     designs/new's Explore Ideas mockup, which is the one place this site
     shows more than three colours at once. */
  --tr-ribbon-trending: var(--tr-green-700);
  --tr-ribbon-top-rated: #5b3aa0;
  --tr-ribbon-popular: #0f7a72;
  --tr-ribbon-new: var(--tr-saffron-ink);
  /* Home's Innovation Dashboard strip (six-figure stat row, Active
     Participants) is the one other place this site needs a colour outside
     that same disciplined three - sampled by pixel from the office's own
     mockup screenshot the same way the four ribbons above were, not
     picked by eye; clears 4.5:1 on white already at the sampled value. */
  --tr-magenta-ink: #b71a6f;

  /* Type */
  --tr-font-display:
    "Playfair Display", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --tr-font-body:
    "Inter", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue",
    Arial, sans-serif;
  --tr-fs-hero: clamp(2.25rem, 1.2rem + 4.4vw, 4.5rem);
  --tr-fs-h1: clamp(1.9rem, 1.2rem + 2.6vw, 3rem);
  --tr-fs-h2: clamp(1.5rem, 1.1rem + 1.6vw, 2.25rem);
  --tr-fs-h3: clamp(1.15rem, 1rem + 0.6vw, 1.4rem);
  --tr-fs-body: 1rem;
  --tr-fs-sm: 0.875rem;
  --tr-fs-xs: 0.78rem;
  --tr-lh-tight: 1.15;
  --tr-lh-body: 1.65;
  --tr-tracking-caps: 0.12em;

  /* Space */
  --tr-space-1: 0.25rem;
  --tr-space-2: 0.5rem;
  --tr-space-3: 0.75rem;
  --tr-space-4: 1rem;
  --tr-space-5: 1.5rem;
  --tr-space-6: 2rem;
  --tr-space-7: 1rem;
  --tr-space-8: 4rem;

  /* Shape */
  --tr-radius-sm: 4px;
  --tr-radius: 8px;
  --tr-radius-md: 10px;
  --tr-radius-lg: 14px;
  --tr-shadow-card: 0 2px 10px rgb(10 31 68 / 8%);
  --tr-shadow-raised: 0 10px 30px rgb(10 31 68 / 14%);
  --tr-shadow-header: 0 6px 20px rgb(10 31 68 / 24%);
  --tr-focus: 0 0 0 3px var(--tr-saffron-400);

  /* Layering: the header sits above page content but below the skip link, which
     has to stay reachable over everything. */
  --tr-z-header: 1030;
  --tr-z-skip-link: 1080;
  --tr-z-toast: 1090;

  /* Roughly the sticky header's height. Used to keep anchor targets from landing
     underneath it. */
  --tr-header-offset: 5rem;

  /* Home's "Our Proud Sponsors" tiles: one fixed height for every logo box
     (about 72px on a phone up to 100px on a wide screen), so a square
     crest and a wide wordmark occupy exactly the same tile. */
  --tr-sponsor-logo-height: clamp(4.5rem, 3.75rem + 2vw, 6.25rem);
}

/* --------------------------------------------------------------------------
   Base
   -------------------------------------------------------------------------- */

.tr-body {
  margin: 0;
  background-color: var(--tr-page);
  color: var(--tr-text);
  font-family: var(--tr-font-body);
  font-size: var(--tr-fs-body);
  line-height: var(--tr-lh-body);
}

.tr-body h1,
.tr-body h2,
.tr-body h3 {
  font-family: var(--tr-font-display);
  line-height: var(--tr-lh-tight);
}

/* `:where()` contributes no specificity, so this is a true default: any component
   class overrides it. Written as `.tr-body a` it would be (0,1,1) and would beat
   every single-class rule below, painting links on the dark chrome in the dark
   saffron reserved for light surfaces - which fails contrast. */
:where(.tr-body) a {
  color: var(--tr-saffron-ink);
  text-underline-offset: 0.18em;
}

:where(.tr-body) a:hover {
  color: var(--tr-green-700);
}

.tr-body :focus-visible {
  outline: none;
  box-shadow: var(--tr-focus);
  border-radius: var(--tr-radius-sm);
}

.tr-main {
  display: block;
  min-height: 40vh;
}

.tr-main:focus {
  outline: none;
}

html {
  scroll-behavior: smooth;
  /* The header is sticky, so an anchor jump would otherwise land the target
     underneath it - including the skip link's own destination. */
  scroll-padding-top: var(--tr-header-offset);
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .tr-idea,
  .tr-innovator,
  .tr-kailm-tile,
  .tr-program {
    transition: none;
  }

  .tr-idea:hover,
  .tr-innovator:hover,
  .tr-kailm-tile--link:hover,
  .tr-program:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Skip link
   -------------------------------------------------------------------------- */

.tr-skip-link {
  position: fixed;
  left: var(--tr-space-4);
  top: calc(-1 * var(--tr-space-8));
  z-index: var(--tr-z-skip-link);
  padding: var(--tr-space-2) var(--tr-space-4);
  background-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
  font-weight: 600;
  text-decoration: none;
  border-radius: 0 0 var(--tr-radius) var(--tr-radius);
  transition: top 0.15s ease-in-out;
}

.tr-skip-link:focus {
  top: 0;
  color: var(--tr-navy-900);
}

/* --------------------------------------------------------------------------
   Header and primary navigation
   -------------------------------------------------------------------------- */

.tr-header {
  /* Stays with the reader through the page. Sticky rather than fixed so it keeps
     its place in the flow - the header's height changes when the brand wraps, and
     fixed positioning would need that height compensated for on <body>. */
  position: sticky;
  top: 0;
  z-index: var(--tr-z-header);
  /* Light chrome (designs/new): the masthead, breadcrumb strip, hero, rail and
     footer all moved off solid navy onto the page's own white/near-white
     surfaces, with navy demoted to a text colour throughout. Every rule below
     that used to read `--tr-text-invert*`/`--tr-line-invert` (built for white
     text on navy) now reads the ordinary `--tr-text*`/`--tr-line` pair
     instead - there is no page left in this chrome path still dark enough to
     need the invert tokens. */
  background-color: var(--tr-page);
  color: var(--tr-text);
  border-bottom: 1px solid var(--tr-line);
  box-shadow: var(--tr-shadow-header);
}

/* designs/new's actual "TR" artwork (static/img/tr-logo.svg), not the
   bordered-box-of-text this replaced - the image is its own two-tone shape,
   so nothing here draws a border or a background for it any more. */
.tr-brand__monogram {
  display: inline-block;
  width: 2.75rem;
  height: 2.75rem;
}

.tr-brand__text {
  display: flex;
  flex-direction: column;
  min-width: 0;
  border-left: 1px solid var(--tr-line);
  padding-left: var(--tr-space-3);
}

/* First/last name always on their own line (designs/new) - a flex column
   of two spans, not one string left to wrap wherever the column happens to
   be narrow enough to break it. */
.tr-brand__name {
  display: flex;
  flex-direction: column;
  color: var(--tr-text);
  font-family: var(--tr-font-display);
  font-size: clamp(0.9rem, 0.78rem + 0.5vw, 1.05rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.tr-brand__role {
  /* `-ink`, not `-500`: on the header's own white now, not navy, this text
     needs the AA-safe saffron rather than the light tint that only ever
     worked on a dark surface. */
  color: var(--tr-saffron-ink);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
}

.tr-navbar {
  padding-block: var(--tr-space-2);
}

.tr-navbar .navbar-brand {
  /* Bootstrap sets `white-space: nowrap` on the brand, which pushes the full name
     off-screen on a 360px viewport. Shrinking rather than growing keeps the toggler
     on the same row, so the sticky header stays short on small screens. */
  flex: 0 1 auto;
  /* Capped so the brand is forced to wrap its own text rather than pushing the
     toggler onto a second row: in a wrapping flex row the browser wraps before it
     shrinks, so the cap is what keeps the sticky header to one row on mobile. */
  max-width: 70%;
  min-width: 0;
  margin-right: var(--tr-space-4);
  padding-block: 0;
  white-space: normal;
}

.tr-navbar .navbar-collapse {
  /* An expanded mobile menu taller than the viewport would be unreachable inside a
     sticky header. Scoped below `lg` with Bootstrap's own breakpoint value (not a
     hand-rolled one) - above it the navbar is a single row and the "About" dropdown
     needs to float freely above the page, not get clipped by this same scroll box. */
  max-height: calc(100vh - var(--tr-header-offset));
  overflow-y: auto;
}

@media (min-width: 992px) {
  .tr-navbar .navbar-collapse {
    max-height: none;
    overflow: visible;
  }
}

.tr-nav__login {
  align-self: flex-start;
  margin-block: var(--tr-space-3);
}

.tr-nav__toggler {
  border-color: var(--tr-line);
}

/* .navbar-toggler-icon needs no colour rule of its own any more: Bootstrap's
   own toggler-icon SVG is already a dark mark, right for a light header -
   the invert()/grayscale()/brightness() filter stack that used to flip it
   white for the navy header would make it vanish here, so it's removed
   rather than left empty. */

.tr-nav__list {
  gap: var(--tr-space-1);
}

.tr-nav__link {
  display: inline-block;
  padding: var(--tr-space-2) var(--tr-space-3);
  color: var(--tr-text);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.tr-nav__link:hover {
  color: var(--tr-saffron-ink);
}

.tr-nav__link--active {
  /* Text stays navy (designs/new: the active item reads the same as its
     neighbours) - only the underline carries the active state, in the
     vivid saffron-500 a 2px border doesn't need AA text contrast for. */
  color: var(--tr-text);
  border-bottom-color: var(--tr-saffron-500);
}

/* The "About" dropdown - Bootstrap's own dropdown-menu/dropdown-item, just
   restyled onto the dark navbar surface instead of its default white one.
   The caret needs no colour rule of its own: Bootstrap draws it with
   `currentColor`, so it already tracks .tr-nav__link's colour and hover
   state. */
.tr-nav__dropdown {
  padding: var(--tr-space-2);
  margin-top: var(--tr-space-2);
  background-color: var(--tr-page);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-raised);
}

.tr-nav__dropdown-link {
  padding: var(--tr-space-2) var(--tr-space-3);
  color: var(--tr-text);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  border-radius: var(--tr-radius-sm);
}

a.tr-nav__dropdown-link:hover,
a.tr-nav__dropdown-link:focus {
  background-color: var(--tr-surface-sunken);
  color: var(--tr-saffron-ink);
}

.tr-nav__dropdown-link--active {
  color: var(--tr-saffron-ink);
  background-color: var(--tr-surface-sunken);
}

/* EN / ML switcher, sitting on the same light navbar surface as .tr-nav__link -
   same muted/saffron colour pair, just smaller and undecorated since it is a
   toggle, not a nav destination. */
.tr-lang-switch {
  display: flex;
  align-items: center;
  margin-block: var(--tr-space-3);
  padding: 0;
  list-style: none;
}

.tr-lang-switch__item + .tr-lang-switch__item {
  border-left: 1px solid var(--tr-line);
}

.tr-lang-switch__link {
  display: inline-block;
  padding: var(--tr-space-1) var(--tr-space-2);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
  text-decoration: none;
  border-radius: var(--tr-radius-sm);
}

a.tr-lang-switch__link:hover,
a.tr-lang-switch__link:focus {
  color: var(--tr-saffron-ink);
}

.tr-lang-switch__link--active {
  color: var(--tr-saffron-ink);
  font-weight: 600;
}

/* A destination that has not been built yet: shown, but never a link to a 404. */
.tr-nav__link--pending,
.tr-footer__link--pending,
.tr-legal__link--pending,
.tr-rail__link--pending {
  /* 0.7 rather than a heavier dim: navy text on the light chrome starts from
     a contrast ratio well past AA, so even dimmed to 70% it stays legible -
     unlike the old white-on-navy chrome, where 0.55 would have dropped
     below the 4.5:1 floor for text still meant to be read. */
  opacity: 0.7;
  cursor: default;
}

/* --------------------------------------------------------------------------
   Breadcrumbs
   -------------------------------------------------------------------------- */

.tr-breadcrumbs,
.tr-topbar {
  background-color: var(--tr-surface-sunken);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* Deliberately matches `.tr-breadcrumbs__list` padding exactly: the two bars
   occupy the same slot on different pages and must be the same height. */
.tr-topbar__text {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2);
  align-items: center;
  margin: 0;
  padding: var(--tr-space-3) 0;
}

.tr-breadcrumbs__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2);
  align-items: center;
  margin: 0;
  padding: var(--tr-space-3) 0;
  list-style: none;
}

.tr-breadcrumbs__item + .tr-breadcrumbs__item::before {
  content: "\203A";
  margin-right: var(--tr-space-2);
  color: var(--tr-saffron-ink);
}

.tr-breadcrumbs__list a {
  color: var(--tr-text-muted);
  text-decoration: none;
}

.tr-breadcrumbs__list a:hover {
  color: var(--tr-saffron-ink);
  text-decoration: underline;
}

.tr-breadcrumbs__item [aria-current="page"] {
  color: var(--tr-text);
}

/* --------------------------------------------------------------------------
   Buttons
   -------------------------------------------------------------------------- */

.tr-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-2);
  padding: var(--tr-space-3) var(--tr-space-5);
  border: 1px solid transparent;
  border-radius: var(--tr-radius-sm);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
}

.tr-btn--sm {
  padding: var(--tr-space-2) var(--tr-space-4);
  font-size: var(--tr-fs-xs);
}

.tr-btn--gold {
  background-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

.tr-btn--gold:hover {
  background-color: var(--tr-saffron-400);
  color: var(--tr-navy-900);
}

.tr-btn--ghost {
  border-color: var(--tr-line-invert);
  color: var(--tr-text-invert);
}

.tr-btn--ghost:hover {
  border-color: var(--tr-saffron-500);
  color: var(--tr-saffron-400);
}

.tr-btn--dark {
  background-color: var(--tr-navy-800);
  color: var(--tr-text-invert);
}

.tr-btn--green {
  background-color: var(--tr-green-800);
  color: var(--tr-text-invert);
}

/* Hero secondary: a translucent green plate with a green edge. Text was
   white (--tr-text-invert) for the hero's old dark background - promoted
   to green-700 now that the hero (designs/new) is light, the same as
   every other invert-token leftover this reskin has fixed. */
.tr-btn--ghost-green {
  background-color: rgb(15 122 61 / 25%);
  border-color: var(--tr-green-500);
  color: var(--tr-green-700);
}

.tr-btn--ghost-green:hover {
  background-color: rgb(15 122 61 / 45%);
  color: var(--tr-green-700);
}

/* Hero tertiary: outline only. Same fix as above - a white border/text pair
   only ever read on the hero's old dark background. */
.tr-btn--outline {
  border-color: var(--tr-text);
  color: var(--tr-text);
}

.tr-btn--outline:hover {
  background-color: var(--tr-surface-sunken);
  color: var(--tr-text);
}

.tr-btn--green:hover {
  background-color: var(--tr-green-900);
  color: var(--tr-saffron-400);
}

.tr-btn:disabled,
.tr-btn--pending {
  opacity: 0.5;
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   Section scaffolding
   -------------------------------------------------------------------------- */

.tr-section {
  padding-block: var(--tr-space-7);
}

.tr-section--sunken {
  background-color: var(--tr-surface-sunken);
}

/* Home's Quick Actions strip only - the warm card tone already used
   elsewhere (--tr-surface-warm), not a repurposing of --sunken. */
.tr-section--warm {
  background-color: var(--tr-surface-warm);
}

.tr-section--ink {
  background-color: var(--tr-navy-900);
  color: var(--tr-text-invert);
}

.tr-section__eyebrow {
  margin-bottom: var(--tr-space-2);
  color: var(--tr-saffron-ink);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-tracking-caps);
  text-transform: uppercase;
}

.tr-section--ink .tr-section__eyebrow {
  color: var(--tr-saffron-400);
}

.tr-section__title {
  margin-bottom: var(--tr-space-3);
  font-size: var(--tr-fs-h2);
}

.tr-section__lead {
  max-width: 60ch;
  margin-top: var(--tr-space-4);
  color: var(--tr-text-muted);
}

.tr-section--ink .tr-section__lead {
  color: var(--tr-text-invert-muted);
}

.tr-rule {
  display: block;
  width: 3.5rem;
  height: 3px;
  background-color: var(--tr-saffron-500);
  border-radius: var(--tr-radius-sm);
}

/* Only present when `action_label` is passed - every other section_heading
   call site (31 of them) keeps the plain single-column layout untouched.
   nowrap + min-width: 0 on the title side is what keeps title and action on
   one line - without min-width: 0 a flex item won't shrink past its text's
   natural width, so the title would push the action onto its own wrapped
   line below instead of eliding. */
.tr-section__heading--split {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--tr-space-3);
}

.tr-section__heading-body {
  min-width: 0;
}

.tr-section__heading--split .tr-section__title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tr-section__action {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: var(--tr-space-2);
  color: var(--tr-saffron-500);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

a.tr-section__action:hover {
  color: var(--tr-saffron-400);
}

.tr-section--ink .tr-section__action {
  color: var(--tr-text-invert);
}

/* No destination exists yet - same "inert, not a link to nowhere"
   convention .tr-btn--pending already uses. */
.tr-section__action--pending {
  opacity: 0.5;
  pointer-events: none;
}

/* Centred title with a hairline running out to both edges, as the reference's
   "A Journey Through Time" heading does. */
.tr-heading-rule {
  display: flex;
  align-items: center;
  gap: var(--tr-space-4);
}

/* Green and heavier (designs/new), not the neutral hairline this replaced. */
.tr-heading-rule::before,
.tr-heading-rule::after {
  content: "";
  flex: 1 1 auto;
  height: 2px;
  background-color: var(--tr-green-500);
}

.tr-heading-rule .tr-section__title {
  margin: 0;
  flex: 0 1 auto;
}

/* --------------------------------------------------------------------------
   Video card
   -------------------------------------------------------------------------- */

.tr-video {
  position: relative;
  display: block;
}

.tr-video__play {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.tr-video__play span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  background-color: rgb(10 31 68 / 72%);
  border: 2px solid var(--tr-text-invert);
  border-radius: 50%;
  color: var(--tr-text-invert);
  font-size: 1.35rem;
}

/* --------------------------------------------------------------------------
   Image placeholders - see CONTENT-GAPS.md
   -------------------------------------------------------------------------- */

.tr-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  background-color: var(--tr-surface-sunken);
  border: 1px dashed var(--tr-line);
  border-radius: var(--tr-radius);
  aspect-ratio: var(--tr-ratio, 16 / 9);
}

.tr-placeholder--16x9 {
  --tr-ratio: 16 / 9;
}

.tr-placeholder--4x3 {
  --tr-ratio: 4 / 3;
}

.tr-placeholder--1x1 {
  --tr-ratio: 1 / 1;
}

.tr-placeholder--3x4 {
  --tr-ratio: 3 / 4;
}

.tr-placeholder__mark {
  width: 2rem;
  height: 2rem;
  border: 2px solid var(--tr-line);
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   Supplied images
   -------------------------------------------------------------------------- */

.tr-image {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--tr-radius);
  object-fit: cover;
}

/* Ratios mirror the placeholder slots exactly, so swapping a real image in for a
   placeholder cannot shift the layout. */
.tr-image--16x9 {
  aspect-ratio: 16 / 9;
}

.tr-image--4x3 {
  aspect-ratio: 4 / 3;
}

.tr-image--1x1 {
  aspect-ratio: 1 / 1;
}

.tr-image--3x4 {
  aspect-ratio: 3 / 4;
}

/* For cut-outs with transparency, which must not be cropped to a box. */
.tr-image--natural {
  aspect-ratio: auto;
  border-radius: 0;
  object-fit: contain;
}

/* --------------------------------------------------------------------------
   Icons
   -------------------------------------------------------------------------- */

.tr-icon {
  width: 1em;
  height: 1em;
  fill: currentcolor;
  vertical-align: -0.125em;
  flex-shrink: 0;
}

/* --------------------------------------------------------------------------
   Hero
   -------------------------------------------------------------------------- */

.tr-hero {
  position: relative;
  overflow: hidden;
  /* Above the tallest hero's natural content (529px on the pages that carry a
     statistics panel), so every page is pinned to this floor rather than some
     sitting on it and others being pushed past it. */
  min-height: 34rem;
  /* The media slot's height, declared once for both the portrait and the
     reserved placeholder so the two can never drift apart. The ceiling stands
     clear of the 34rem floor once the top padding is taken off. */
  --tr-hero-media-h: clamp(16rem, 56vw, 30.5rem);

  padding-block: var(--tr-space-6) 0;
  background-color: var(--tr-page);
  /* Light chrome (designs/new): the same Assembly-at-night photo stays -
     no new asset was supplied, and this one is still the only photo of the
     building on file. The wash is the tricolor formula promoted here from
     .tr-hero--ideas (main.css/git history), where it was built and
     live-measured for contrast first - three soft bands (saffron, then
     white, then green) blending into each other over a wide span rather
     than a hard edge, not literal stripes (see the wave-divider comment
     below for why). Promoted to every hero once every page with one
     wanted the same tricolor identity, not just the Ideas section -
     .tr-hero--ideas/--kailm below now only restate this same formula over
     their own photo, since a photo swap is a whole background-image
     property, not something CSS can layer independently of the gradient
     sitting on top of it. The last stop stays lighter for the same reason
     as the old warm-white wash did: this is the one hero (Home) where a
     portrait sits in that zone, and needs to read clearly against it. */
  background-image:
    linear-gradient(
      100deg,
      rgb(255 199 145 / 90%) 0%,
      rgb(255 224 179 / 86%) 30%,
      rgb(255 255 255 / 92%) 50%,
      rgb(220 243 222 / 84%) 72%,
      rgb(186 227 190 / 78%) 100%
    ),
    url("../img/hero-assembly-night.449949c15c23.webp");
  background-position:
    center,
    right center;
  background-repeat: no-repeat, no-repeat;
  background-size: cover, cover;
  color: var(--tr-text);
}

/* Home only: the supplied sunlit Assembly photograph in place of the tricolour
   wash over the night photo, as in the reference design. A warm ivory fade on
   the left keeps the dark type readable; the right is left to the photograph.
   No orange/green gradient. */
.tr-hero--home {
  background-color: var(--tr-surface-warm);
  /* Layer 1 only exists below lg (width-sign trick, as elsewhere in this file):
     stacked, the copy runs the full width over the photograph, so it gets an
     ivory wash from the top instead of the left. */
  background-image:
    linear-gradient(
      180deg,
      rgb(251 248 241 / 94%) 0%,
      rgb(251 248 241 / 84%) 62%,
      rgb(251 248 241 / 0%) 100%
    ),
    linear-gradient(
      90deg,
      rgb(251 248 241 / 92%) 0%,
      rgb(251 248 241 / 72%) 28%,
      rgb(251 248 241 / 24%) 52%,
      rgb(251 248 241 / 0%) 72%
    ),
    url("../img/hero-bg.eb2905736420.webp");
  background-position:
    center top,
    center,
    right bottom;
  background-repeat: no-repeat;
  background-size:
    clamp(0px, calc((992px - 100vw) * 100), 100%) 80%,
    cover,
    cover;
}

/* Home hero typography and actions, matched to the reference design: lighter
   serif weights and softer greys for the supporting lines, one bold navy
   surname, a solid orange primary action, a hairline-outline secondary and a
   quiet underlined text link for the third. Layout is untouched. */
.tr-hero--home .tr-hero__name-lead {
  color: #4a4f5c;
  font-family: var(--tr-font-display);
  font-size: clamp(1.25rem, 1rem + 1vw, 1.875rem);
  font-weight: 400;
  letter-spacing: 0.05em;
}

.tr-hero--home .tr-hero__name-main {
  color: var(--tr-navy-900);
  font-weight: 700;
  letter-spacing: 0;
}

.tr-hero--home .tr-hero__role {
  color: #4a4f5c;
  font-family: var(--tr-font-display);
  font-size: clamp(1.1rem, 1rem + 0.5vw, 1.4rem);
  font-weight: 400;
}

.tr-hero--home .tr-hero__tagline {
  color: var(--tr-navy-900);
  font-size: var(--tr-fs-sm);
  font-weight: 400;
  letter-spacing: 0.01em;
  text-transform: none;
}

.tr-hero--home .tr-btn {
  padding: 0.7rem 1.4rem;
  border-radius: 4px;
  font-family: var(--tr-font-display);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.01em;
}

.tr-hero--home .tr-btn--gold {
  background-color: #bd5009;
  border-color: #bd5009;
  color: #fff;
}

.tr-hero--home .tr-btn--gold:hover {
  background-color: var(--tr-saffron-ink);
  border-color: var(--tr-saffron-ink);
  color: #fff;
}

.tr-hero--home .tr-btn--ghost-green {
  background-color: rgb(255 255 255 / 55%);
  border-color: rgb(10 31 68 / 45%);
  color: var(--tr-navy-900);
}

.tr-hero--home .tr-btn--ghost-green:hover {
  background-color: #fff;
  border-color: var(--tr-navy-900);
  color: var(--tr-navy-900);
}

/* Third action: a text link, play icon leading. */
.tr-hero--home .tr-btn--outline {
  padding-inline: 0.25rem;
  border-color: transparent;
  background: none;
  color: var(--tr-navy-900);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.3em;
}

.tr-hero--home .tr-btn--outline:hover {
  background: none;
  color: var(--tr-green-700);
}

.tr-hero--home .tr-btn--outline .tr-icon {
  order: -1;
  color: var(--tr-green-700);
}

/* designs/new's animated wave divider, at the seam where the hero meets the
   page below - a self-contained SVG (its own <style>/@keyframes and its
   own prefers-reduced-motion guard live inside the file, so nothing here
   has to drive the animation or repeat that media query). White, like the
   brief asks, so it reads as the page's own white content turf rising into
   the hero - the soft drop-shadow baked into the SVG is what keeps its
   crest visible even where the hero's own wash is already close to white,
   rather than the shape vanishing into a same-colour background.

   Used to share the hero's box with a second pseudo-element, ::before,
   carrying a soft saffron/green radial glow layered on top of the wash
   (git history) - redundant now that the wash itself (background-image
   above) carries saffron and green directly, so ::before was deleted
   rather than kept as dead weight under every hero. */
.tr-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background-image: url("../img/wave-divider.db3317d8827a.svg");
  background-position: bottom center;
  background-repeat: no-repeat;
  background-size: 100% 25%;
  pointer-events: none;
}

.tr-hero > * {
  position: relative;

}

.tr-hero__text {
  /* Wide enough to hold all three calls to action on one row, as the design
     does - at 35rem the third wrapped onto a second line. */
  max-width: 38rem;
  padding-block: var(--tr-space-5) var(--tr-space-6);
}

/* Reserves the exact width the overlaid sidebar itself uses
   (--tr-railaside-w, .tr-body--railshell above) plus a little breathing
   room, not a Bootstrap grid fraction - offset-lg-3 (25% of the row) was
   the first attempt at approximating that width, and drifted far enough
   from the sidebar's own clamp()-based value at some widths in the
   lg-to-xl range to visibly overlap it, confirmed live. d-none
   d-lg-block, the same Bootstrap utility the sidebar itself is
   hidden/shown with, so this spacer and the sidebar always agree on
   when they exist at all. */
.tr-hero__sidebar-spacer {
  flex: 0 0 calc(var(--tr-railaside-w) + var(--tr-space-5));
}

.tr-hero__text-col {
  flex: 1 1 auto;
  min-width: 0;
}

/* The hero's secondary column - a portrait (peterboy/templates/partials/
   rail_hero.html, most pages) or the KAILM hero's own stats card
   (app_kailm/templates/app_kailm/overview.html) - a fixed-ish upper
   bound approximating the old partials/hero.html shape's col-lg-4 share
   (roughly a third of the row), not an exact fraction: both a portrait
   (height: var(--tr-hero-media-h) plus its own aspect ratio) and the
   stats card (width: fit-content, main.css .tr-kailm-hero__stats)
   already self-limit their own rendered width, so this column only
   needs to be wide enough that its own basis is never what's actually
   binding. flex-shrink: 1 (not 0) so it still gives ground to the text
   column at the narrow end of the `lg`+ range instead of forcing an
   overflow. */
.tr-hero__media-col {
  flex: 0 1 clamp(14rem, 27vw, 22rem);
}

/* Home splits the title into two spans; the interior pages use it as a plain
   heading, so it needs a size of its own as well as the flow rules. */
.tr-hero__title {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-1);
  margin-bottom: var(--tr-space-3);
  font-size: var(--tr-fs-h1);
}

/* Measured live (canvas-reconstructed composite of the promoted tricolor
   wash + hero-assembly-night.jpg, worst-case sampled at 2% steps across
   this element's full rendered width, on Home - the one page these three
   classes are used on): --tr-saffron-ink drops to 3.50:1 against this
   photo's own patches under the tricolor wash, under the 4.5:1 normal
   text needs. #5c2e03 (darker than the #7a3d04 used on the Ideas/KAILM/
   other-hero-eyebrows, needed here for extra margin against this
   specific photo's own worst patches - independently measured, not
   assumed to transfer) clears it to 6.61:1. */
.tr-hero__name-lead {
  color: #5c2e03;
  font-family: var(--tr-font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tr-hero__name-main {
  /* Tops out at the reference's 44px but still scales down rather than
     overflowing a phone - a fixed px size would need a breakpoint (C-02). */
  font-size: clamp(2rem, 1.4rem + 2.4vw, 2.75rem);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}

/* Same measurement, same reason: --tr-text-muted dropped to 4.15-4.18:1
   against this photo's own patches, just under 4.5:1. #2a3c5b (the same
   darkening already used and independently re-verified for the same
   reason on every other converted hero) clears both to 6.4-6.5:1. */
.tr-hero__role {
  margin-bottom: var(--tr-space-1);
  color: #2a3c5b;
  font-family: var(--tr-font-body);
  font-size: 1.0625rem;
}

.tr-hero__tagline {
  margin-bottom: var(--tr-space-5);
  color: #2a3c5b;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tr-hero__ctas {
  margin-top: var(--tr-space-5);
}

/* The portrait stands on a plate rounded at the top only, so it reads as rising
   out of the hero rather than floating in it. */
.tr-hero__figure {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: 100%;
  margin-inline: auto;
}

/* The portrait is sized to fit the hero rather than to dictate it - that is what
   keeps every hero on the site the same height. An explicit clamp rather than
   `height: 100%`, because a percentage needs a definite height on the column and
   a stretched flex item does not reliably give one. The ceiling (27.5rem) sits
   inside the 32.5rem hero once its top padding is taken off. */
.tr-hero__portrait {
  align-self: flex-end;
  width: auto;
  max-width: 100%;
  height: var(--tr-hero-media-h);
  object-fit: contain;
  object-position: bottom center;
}

/* The figure stands on the hero's floor, as the design does - the row's bottom
   gutter would otherwise leave it floating clear of it. */
.tr-hero .row {
  --bs-gutter-y: 0;
}

/* Social rail, pinned to the right edge of the hero. */
.tr-hero__social {
  position: absolute;
  right: var(--tr-space-5);
  top: var(--tr-space-7);
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-hero__social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.125rem;
  height: 2.125rem;
  background-color: var(--tr-page);
  border: 1px solid var(--tr-line);
  border-radius: 50%;
  color: var(--tr-text);
}

.tr-hero__social-link:hover {
  background-color: var(--tr-saffron-500);
  border-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

/* A reserved slot takes the exact height of a filled one, so a page waiting on
   its photograph has the same hero as a page that has one. */
.tr-hero .tr-placeholder {
  height: var(--tr-hero-media-h);
  aspect-ratio: auto;
  background-color: var(--tr-surface-sunken);
  border-color: var(--tr-line);
}

/* The other direction of the rule above: once a real photo fills this same
   slot (e.g. an idea's uploaded banner_image), it takes the exact box the
   placeholder reserved, rather than whatever aspect ratio the uploaded file
   itself happens to be. */
.tr-hero .tr-image {
  height: var(--tr-hero-media-h);
  aspect-ratio: auto;
}

.tr-hero .tr-placeholder__mark {
  border-color: var(--tr-line);
}

/* --------------------------------------------------------------------------
   Statistics
   -------------------------------------------------------------------------- */

.tr-statbar {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-5);
}

.tr-stat {
  /* Source order is dt then dd, as the spec requires; the column is reversed so the
     figure still reads above its label. */
  display: flex;
  flex-direction: column-reverse;
  align-items: flex-start;
  gap: var(--tr-space-1);
  min-width: 7rem;
}

.tr-stat__value {
  display: flex;
  flex-direction: column;
  align-items: inherit;
  gap: var(--tr-space-2);
  margin: 0;
}

.tr-stat__number {
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h2);
  line-height: 1.1;
}

.tr-stat__label {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tr-stat__icon {
  color: var(--tr-saffron-500);
  font-size: 1.5rem;
  line-height: 1;
}

.tr-statbar--inline {
  gap: var(--tr-space-6);
  padding-block: var(--tr-space-4);
  border-block: 1px solid var(--tr-line-invert);
}

/* Hero variant: figure beside its label on one line, no rules, no icons - the
   reference reads as a sentence of numbers rather than a panel of cards. */
.tr-statbar--hero {
  gap: var(--tr-space-6);
  margin-bottom: var(--tr-space-5);
}

.tr-statbar--hero .tr-stat {
  flex-direction: row-reverse;
  align-items: center;
  gap: var(--tr-space-2);
  min-width: 0;
}

.tr-statbar--hero .tr-stat__value {
  flex-direction: row;
  align-items: center;
  gap: var(--tr-space-2);
}

/* The design keeps its icons in the hero row, sitting just before the figure.
   `-ink`, not `-500`: this hero is light now (designs/new), not navy, so the
   icon needs the AA-safe saffron rather than the tint that only ever worked
   on a dark surface. */
.tr-statbar--hero .tr-stat__icon {
  color: var(--tr-saffron-ink);
  font-size: 1.1rem;
  line-height: 1;
}

/* A hairline between each pair, as the design has. */
.tr-statbar--hero .tr-stat + .tr-stat {
  padding-left: var(--tr-space-5);
  border-left: 1px solid var(--tr-line);
}

.tr-statbar--hero .tr-stat__number {
  color: var(--tr-saffron-ink);
  font-size: 1.375rem;
  font-weight: 700;
}

.tr-statbar--hero .tr-stat__label {
  max-width: 6rem;
  color: var(--tr-text-muted);
  font-size: 0.6875rem;
  letter-spacing: 0;
  text-transform: none;
}

.tr-statbar--inline .tr-stat__label {
  color: var(--tr-text-invert-muted);
}

.tr-statbar--card {
  display: grid;
  gap: var(--tr-space-4);
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
}

/* White card on a white page (designs/new's own "Legacy of Service" row) -
   the box-shadow plus hairline border are what separate it from the page,
   not a warm tint; the amber card treatment was an earlier, since-corrected
   reading of the reference. */
.tr-statbar--card .tr-stat {
  align-items: center;
  padding: var(--tr-space-5) var(--tr-space-3);
  background-color: var(--tr-page);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
  text-align: center;
}

/* Bigger, not heavier: these are solid-fill Bootstrap Icons glyphs (see
   icons.svg's own comment on not hand-tracing path data), so there is no
   stroke-width to thicken and no bundled bold/outline variant to swap to -
   size is the one honest lever for more visual weight here. */
.tr-statbar--card .tr-stat__icon {
  color: var(--tr-saffron-500);
  font-size: 1.75rem;
}

.tr-statbar--card .tr-stat__number {
  font-weight: 700;
}

.tr-statbar--card .tr-stat__label {
  font-weight: 700;
}

.tr-statbar--card .tr-stat__label {
  color: var(--tr-green-700);
}

/* --------------------------------------------------------------------------
   Home: "A Legacy of Service & Trust" figures (stat_list variant="legacy").
   Five white cards: a soft round icon, the figure, the label, a short accent
   rule, and a tinted sweep in the bottom-right corner. Accents alternate
   saffron / green. Its own variant so Hall of Fame's "card" variant is left alone.
   -------------------------------------------------------------------------- */

.tr-statbar--legacy {
  display: grid;
  gap: clamp(0.75rem, 1.4vw, 1.25rem);
  grid-template-columns: repeat(auto-fit, minmax(9.5rem, 1fr));
}

.tr-statbar--legacy .tr-stat {
  --tl-accent: var(--tr-saffron-500);
  --tl-ink: var(--tr-saffron-ink);

  position: relative;
  overflow: hidden;
  min-width: 0;
  padding: clamp(0.875rem, 1.3vw, 1.25rem);
  background-color: var(--tr-page);
  background-image: radial-gradient(
    ellipse 70% 55% at 100% 100%,
    color-mix(in srgb, var(--tl-accent) 26%, var(--tr-page)) 0%,
    color-mix(in srgb, var(--tl-accent) 8%, var(--tr-page)) 55%,
    transparent 56%
  );
  border: 1px solid color-mix(in srgb, var(--tr-line) 55%, var(--tr-page));
  border-radius: 1.125rem;
  box-shadow: var(--tr-shadow-card);
  gap: 0.25rem;

  /* The column is reversed, so flex-end packs the content to the card's top. */
  justify-content: flex-end;
}

.tr-statbar--legacy .tr-stat:nth-child(even) {
  --tl-accent: var(--tr-green-500);
  --tl-ink: var(--tr-green-700);
}

/* Source order is label then value and the column is reversed, so this first
   child sits at the bottom of the card: the accent rule under the label. */
.tr-statbar--legacy .tr-stat::before {
  width: 1.75rem;
  height: 0.1875rem;
  margin-top: 0.5rem;
  background-color: var(--tl-accent);
  border-radius: 999px;
  content: "";
}

.tr-statbar--legacy .tr-stat__value {
  gap: 0.625rem;
}

.tr-statbar--legacy .tr-stat__icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  place-items: center;
  background-color: color-mix(in srgb, var(--tl-accent) 16%, var(--tr-page));
  border-radius: 50%;
  color: var(--tl-ink);
  font-size: 1.25rem;
}

.tr-statbar--legacy .tr-stat__number {
  color: var(--tr-navy-900);
  font-size: clamp(1.75rem, 1.3rem + 1vw, 2.375rem);
  font-weight: 700;
}

.tr-statbar--legacy .tr-stat__label {
  color: var(--tr-navy-800);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  line-height: 1.35;
}

/* --------------------------------------------------------------------------
   Pull quote
   -------------------------------------------------------------------------- */

.tr-quote {
  margin: 0;
  font-family: var(--tr-font-display);
  font-style: italic;
}

.tr-quote--band {
  margin-top: var(--tr-space-6);
  padding-top: var(--tr-space-5);
  border-top: 1px solid var(--tr-line-invert);
  font-size: var(--tr-fs-h3);
}

.tr-quote--band p {
  margin-bottom: var(--tr-space-2);
}

.tr-quote cite {
  color: var(--tr-saffron-400);
  font-size: var(--tr-fs-sm);
  font-style: normal;
}

/* Hero quote: a saffron rule down the left, as the reference. The pale
   cream text colour only ever worked on the old dark hero (designs/new's
   is light) - promoted straight to the ordinary text token rather than
   carrying a second near-white literal forward. Placed after the generic
   .tr-quote/.tr-quote cite rules above (same specificity either way, so
   source order decides) - .tr-quote--hero cite needs to win over .tr-quote
   cite's saffron-400, which is only legible on the still-dark surfaces
   .tr-quote--band is reserved for. */
.tr-quote--hero {
  margin-top: var(--tr-space-6);
  padding-left: var(--tr-space-4);
  border-left: 3px solid var(--tr-saffron-500);
  color: var(--tr-text);
  font-size: 0.9375rem;
}

.tr-quote--hero p {
  margin-bottom: var(--tr-space-2);
}

.tr-quote--hero cite {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* --------------------------------------------------------------------------
   Quick Search - Home only. One field, not the three separate category
   inputs the mockup showed (designs/new) - a citizen looking for a page
   has no reason to know in advance which bucket it would have lived in.
   Straddles the hero's own bottom edge the way a stats panel elsewhere
   uses tr-hero__stats--seam to do the same thing - simpler here because
   this bar is a *sibling* of .tr-hero in the markup (home.html), not a
   descendant of it, so it needs no overflow: visible escape hatch to
   spill past that edge; a negative top margin on a following sibling
   already renders above the box before it, at any hero height.
   -------------------------------------------------------------------------- */

.tr-quicksearch {
  position: relative;
  z-index: 3;
  display: flex;
  /* Never wraps onto a second line, even at phone widths - the badge
     goes icon-only below sm (home.html) instead, specifically so this
     never happens: a wrapped badge alone on its own row would leave its
     own border-right divider dangling under nothing. */
  flex-wrap: nowrap;
  align-items: center;
  gap: var(--tr-space-3);
  /* Roughly half the bar's own height (padding + input row), so it reads
     as straddling the seam rather than sitting fully on one side of it -
     measured live against the hero's own 2rem (--tr-space-6) bottom
     padding on .tr-hero__text, which is what keeps this from overlapping
     the pull-quote above it. */
  margin-top: -2.25rem;
  padding: var(--tr-space-3) var(--tr-space-4);
  background-color: var(--tr-surface);
  border-radius: var(--tr-radius-lg);
  box-shadow: var(--tr-shadow-raised);
}

.tr-quicksearch__badge {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--tr-space-2);
  padding-inline-end: var(--tr-space-4);
  border-right: 1px solid var(--tr-line);
  color: var(--tr-text);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  white-space: nowrap;
}

.tr-quicksearch__badge .tr-icon {
  color: var(--tr-saffron-500);
}

.tr-quicksearch__field {
  position: relative;
  display: flex;
  flex: 1 1 8rem;
  min-width: 0;
  align-items: center;
}

.tr-quicksearch__input {
  width: 100%;
  padding: var(--tr-space-2) var(--tr-space-6) var(--tr-space-2) var(--tr-space-3);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text);
  font-size: var(--tr-fs-sm);
}

.tr-quicksearch__submit {
  position: absolute;
  inset-inline-end: var(--tr-space-2);
  display: flex;
  padding: var(--tr-space-1);
  color: var(--tr-text-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.tr-quicksearch__submit:hover {
  color: var(--tr-green-700);
}

/* Suggestions drop onto the lede section below, not back over the hero -
   the field sits at the very bottom of the bar, so there is nowhere
   upward left to open into anyway. */
.tr-quicksearch__results {
  position: absolute;
  inset-inline: 0;
  top: calc(100% + var(--tr-space-2));
  z-index: 4;
  margin: 0;
  padding: var(--tr-space-2) 0;
  list-style: none;
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-raised);
}

.tr-quicksearch__result {
  display: block;
  padding: var(--tr-space-2) var(--tr-space-4);
  color: var(--tr-text);
  font-size: var(--tr-fs-sm);
  text-decoration: none;
}

.tr-quicksearch__result:hover,
.tr-quicksearch__result:focus-visible,
.tr-quicksearch__result--active {
  color: var(--tr-green-700);
  background-color: var(--tr-surface-sunken);
}

.tr-quicksearch__empty {
  padding: var(--tr-space-2) var(--tr-space-4);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* --------------------------------------------------------------------------
   Lede - the plain-language summary near the top of every page
   -------------------------------------------------------------------------- */

.tr-section--lede {
  padding-block: var(--tr-space-6);
}

.tr-lede {
  max-width: 72ch;
  margin: 0;
  font-size: 1.075rem;
  color: var(--tr-text-muted);
}

/* --------------------------------------------------------------------------
   Timeline
   -------------------------------------------------------------------------- */

.tr-timeline {
  /* One unbroken row, as the reference shows, so the connectors between nodes are
     always correct. Below `lg` the row scrolls inside its own container rather
     than wrapping - wrapping would leave connector lines dangling mid-air, and
     detecting the wrap would need a custom breakpoint (C-02). */
  display: flex;
  gap: var(--tr-space-5);
  margin: var(--tr-space-6) 0 0;
  /* The inline padding is what the end dots sit in - they hang half a gap beyond
     the first and last item and would otherwise be clipped by the scroll box. */
  padding: 0 var(--tr-space-4) var(--tr-space-3);
  list-style: none;
  overflow-x: auto;

  /* Node geometry, shared by the nodes and by the connector maths below. */
  --tr-node-size: 2.5rem;
  --tr-node-centre: calc(var(--tr-node-size) / 2);
  --tr-dot-size: 0.5rem;
}

.tr-timeline__item {
  position: relative;
  display: flex;
  /* Allowed to shrink so all six fit the column without scrolling on desktop, as
     the reference shows; the min-width is what forces the scroll on narrow
     screens instead of squashing the labels. */
  flex: 1 1 7rem;
  min-width: 6.5rem;
  flex-direction: column;
  align-items: center;
  gap: var(--tr-space-2);
  text-align: center;

  /* The connector is painted as a background on every item, spanning its own
     width plus half a gap on each side. The union across items is one unbroken
     line that also extends past the first and last node, as the reference does -
     and it scrolls with the row rather than being clipped by it. */
  background-image: linear-gradient(
    var(--tr-saffron-200),
    var(--tr-saffron-200)
  );
  background-repeat: no-repeat;
  background-size: calc(100% + var(--tr-space-5)) 2px;
  background-position: calc(-0.5 * var(--tr-space-5))
    calc(var(--tr-node-centre) - 1px);
}

/* A dot at every gap midpoint. Sitting on each item's left edge minus half a gap
   puts one between each pair of nodes and one before the first. */
.tr-timeline__item::before,
.tr-timeline__item:last-child::after {
  content: "";
  position: absolute;
  top: calc(var(--tr-node-centre) - var(--tr-dot-size) / 2);
  width: var(--tr-dot-size);
  height: var(--tr-dot-size);
  border-radius: 50%;
  background-color: var(--tr-amber-ink);
}

.tr-timeline__item::before {
  left: calc(-0.5 * var(--tr-space-5) - var(--tr-dot-size) / 2);
}

/* ...and one closing the line after the last node. */
.tr-timeline__item:last-child::after {
  right: calc(-0.5 * var(--tr-space-5) - var(--tr-dot-size) / 2);
}

.tr-timeline__node {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--tr-node-size);
  height: var(--tr-node-size);
  /* Every node is the same deep green - the reference does not alternate. */
  background-color: var(--tr-green-800);
  border-radius: 50%;
  color: var(--tr-text-invert);
  font-size: 1.1rem;
}

.tr-timeline__year {
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h3);
  font-weight: 700;
}

.tr-timeline__label {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* --------------------------------------------------------------------------
   Promotional bands
   -------------------------------------------------------------------------- */

/* `container-xxl` only caps at 1320px once the viewport itself crosses
   1400px - below that it is already fluid. This override raises that cap
   so the band keeps growing on wide monitors instead of going flat at
   1320px; `clamp()` with a 0 floor (not `min()`) to stay inside the
   project's "anything that scales uses clamp()" convention (C-02) while
   never exceeding the viewport on narrow screens. */
.tr-band {
  max-width: clamp(0px, 96vw, 1600px);
  color: var(--tr-text-invert);
}

/* The artwork's own bulb+table illustration lives in its left third; the
   rest is already a near-flat navy fade (sampled: the rightmost pixels are
   #000b28, which is what --tr-band-ideas-edge below matches, so the
   background-color underneath needs no gradient of its own to blend in).
   `auto 100%` - not `cover` - so the image is scaled to the band's own
   height with its aspect ratio intact and no vertical cropping; at that
   height it is narrower than the band, so it sits flush left and the flat
   background-color carries the rest, exactly the composition the reference
   shows. The gradient layer is what makes the copy readable over the
   brightest part of the bulb - main.css's other art-behind-copy band
   (.tr-band--kailm) only needs a light 20-35% wash because its own busy
   area sits clear of the text; this artwork's glow sits directly behind
   the heading, so the wash has to be strong there and can taper off before
   it reaches the flat navy on the right, where there is nothing left to
   dim. */
.tr-band--ideas {
  --tr-band-ideas-edge: #000b28;

  padding-block: 5em;
  background-color: var(--tr-band-ideas-edge);
  background-image:
    linear-gradient(
      90deg,
      rgb(2 8 24 / 88%) 0%,
      rgb(2 8 24 / 80%) 30%,
      rgb(2 8 24 / 45%) 55%,
      rgb(2 8 24 / 0%) 75%
    ),
    url("../img/ideas.497a072ac6d7.webp");
  background-position: left center, left center;
  background-repeat: no-repeat, no-repeat;
  background-size: 100% 100%, auto 100%;
}

.tr-band__title {
  margin-bottom: var(--tr-space-2);
  color: var(--tr-saffron-500);
  font-size: var(--tr-fs-h2);
  text-transform: uppercase;
}

.tr-band__tagline {
  margin-bottom: var(--tr-space-3);
  color: var(--tr-saffron-200);
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h3);
}

.tr-band__text {
  max-width: 60ch;
  color: var(--tr-text-invert-muted);
}

/* --------------------------------------------------------------------------
   Home: Kerala AI Literacy Mission (docs/kailm.png)
   Everything is scoped under .tr-kailm-home. Panel breakpoints use the
   width-sign trick (a huge positive value wraps/switches, a negative one clamps
   away) rather than @media, per the project's rule.
   -------------------------------------------------------------------------- */

/* Same outer box as the "Public Opinions & Innovative Ideas" band below it
   (.tr-band: 96vw, capped at 1600px), so the two line up edge to edge. */
.tr-kailm-home {
  max-width: clamp(0px, 96vw, 1600px);
  padding: 0;
  overflow: hidden;
  background-color: var(--tr-page);
  border-radius: var(--tr-radius-lg);
  box-shadow: var(--tr-shadow-card);
}

/* Hero band: pale wash from the page colour into a cool tint of the navy. */
.tr-kailm-home__hero {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  background-image: linear-gradient(
    100deg,
    var(--tr-page) 0%,
    color-mix(in srgb, var(--tr-navy-700) 7%, var(--tr-page)) 55%,
    color-mix(in srgb, var(--tr-navy-700) 14%, var(--tr-page)) 100%
  );
}

/* 0.9 : 1.1 from 48rem up; stacked (copy, then the photo) below it. */
.tr-kailm-home__copy,
.tr-kailm-home__visual {
  min-width: 0;
  flex-basis: calc((48rem - 100vw) * 999);
}

.tr-kailm-home__copy {
  display: flex;
  flex-direction: column;
  flex-grow: 0.9;
  align-items: flex-start;
  padding: clamp(1.25rem, 0.5rem + 2.4vw, 2.5rem) clamp(1.25rem, 0.5rem + 3vw, 3.5rem);
}

.tr-kailm-home__eyebrow {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  margin: 0;
  padding: 0.375rem 1rem 0.375rem 0.75rem;
  background-color: var(--tr-signup-selected);
  border-radius: 999px;
  color: var(--tr-login-ink);
  font-size: 0.8125rem;
  font-weight: 600;
}

.tr-kailm-home__spark {
  width: 1rem;
  height: 1rem;
  fill: var(--tr-green-500);
}

.tr-kailm-home__title {
  margin: clamp(0.75rem, 1.2vw, 1.25rem) 0 0;
  color: var(--tr-login-ink);
  font-family: var(--tr-font-display);
  font-size: clamp(2rem, 1.3rem + 1.9vw, 3.5rem);
  font-weight: 700;
  line-height: 1.1;
}

.tr-kailm-home__accent {
  display: block;
  color: var(--tr-login-green);
}

.tr-kailm-home__rule {
  display: block;
  width: clamp(3rem, 5vw, 4.75rem);
  height: 0.3rem;
  margin: 0.75rem 0 1rem;
  background-image: linear-gradient(90deg, var(--tr-green-500), var(--tr-navy-700));
  border-radius: 999px;
}

.tr-kailm-home__text {
  max-width: 34ch;
  margin: 0 0 clamp(1rem, 1.6vw, 1.75rem);
  color: var(--tr-text-muted);
  font-size: clamp(1rem, 0.9rem + 0.35vw, 1.25rem);
  line-height: 1.45;
}

.tr-kailm-home__cta {
  display: inline-flex;
  gap: 0.625rem;
  align-items: center;
  padding: 0.8rem 1.75rem;
  background-color: var(--tr-login-green);
  border-radius: 999px;
  box-shadow: 0 6px 16px color-mix(in srgb, var(--tr-login-green) 35%, transparent);
  color: var(--tr-text-invert);
  font-size: 1.0625rem;
  font-weight: 500;
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.tr-kailm-home__cta:hover {
  color: var(--tr-text-invert);
  box-shadow: 0 10px 22px color-mix(in srgb, var(--tr-login-green) 45%, transparent);
  transform: translateY(-2px);
}

.tr-kailm-home__cta:focus-visible {
  outline: 3px solid var(--tr-saffron-400);
  outline-offset: 3px;
}

.tr-kailm-home__cta--pending {
  opacity: 0.7;
}

/* Photo: bleeds off the right and bottom edges; a pale green blob peeks out
   from behind its big convex left edge. */
.tr-kailm-home__visual {
  position: relative;
  display: flex;
  flex-grow: 1.1;
  overflow: hidden;
  /* 12rem stacked, 17rem from 48rem up. */
  min-height: clamp(12rem, 12rem + (100vw - 48rem) * 999, 17rem);
}

.tr-kailm-home__visual::before {
  position: absolute;
  top: 32%;
  bottom: -25%;
  left: 0;
  width: 30%;
  background-color: color-mix(in srgb, var(--tr-green-500) 22%, var(--tr-page));
  border-radius: 60% 40% 70% 30% / 50% 60% 40% 50%;
  content: "";
}

.tr-kailm-home__photo {
  position: relative;
  display: grid;
  flex: 1;
  place-items: center;
  overflow: hidden;
  background-color: var(--tr-login-green);
  /* Stacked: soft 1.5rem corners; from 48rem up the left edge becomes the big curve. */
  border-radius: clamp(1.5rem, 1.5rem + (100vw - 48rem) * 999, 14rem) 0 0
    clamp(1.5rem, 1.5rem + (100vw - 48rem) * 999, 14rem);
}

.tr-kailm-home__photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: right center;
}

.tr-kailm-home__sparkles {
  width: 3rem;
  height: 3rem;
  fill: none;
  stroke: var(--tr-login-amber);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.75;
}

/* Cards: five across from 64rem, three from 48rem, two (the fifth full width)
   below: max() of the three widths, each of the lower two only "live" in its
   range. */
.tr-kailm-home__cards {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(0.75rem, 1.6vw, 1.375rem);
  margin: 0;
  padding: clamp(1rem, 2.4vw, 2rem) clamp(1rem, 2.4vw, 2rem) clamp(1.25rem, 2.8vw, 2.25rem);
  list-style: none;
}

.tr-kailm-home__item {
  display: flex;
  flex: 1 1
    max(
      calc(20% - 1.1rem),
      min(calc(33.333% - 0.9rem), calc((64rem - 100vw) * 999)),
      min(calc(50% - 0.7rem), calc((48rem - 100vw) * 999))
    );
  min-width: 0;

  /* Accent per card, drawn from the theme palette: --kh-accent for fills and
     borders, --kh-ink for text that must clear 4.5:1 on the tint. */
  --kh-accent: var(--tr-green-700);
  --kh-ink: var(--tr-green-700);
}

.tr-kailm-home__item:nth-child(5n + 2) {
  --kh-accent: var(--tr-navy-700);
  --kh-ink: var(--tr-navy-700);
}

.tr-kailm-home__item:nth-child(5n + 3) {
  --kh-accent: var(--tr-signup-star);
  --kh-ink: var(--tr-signup-star);
}

.tr-kailm-home__item:nth-child(5n + 4) {
  --kh-accent: var(--tr-saffron-500);
  --kh-ink: var(--tr-saffron-ink);
}

.tr-kailm-home__item:nth-child(5n) {
  --kh-accent: var(--tr-signup-connector);
  --kh-ink: var(--tr-green-deep);
}

.tr-kailm-home__card {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  overflow: hidden;
  padding: clamp(1rem, 1.4vw, 1.5rem);
  background-image: linear-gradient(
    150deg,
    color-mix(in srgb, var(--kh-accent) 11%, var(--tr-page)) 0%,
    var(--tr-page) 100%
  );
  border: 1px solid color-mix(in srgb, var(--kh-accent) 16%, var(--tr-page));
  border-top: 4px solid var(--kh-accent);
  border-radius: 1.25rem;
  box-shadow: var(--tr-shadow-card);
  color: var(--tr-login-ink);
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

/* Faint corner blob, bottom-left. */
.tr-kailm-home__card::after {
  position: absolute;
  bottom: -2.25rem;
  left: -1.75rem;
  width: 5.5rem;
  height: 5.5rem;
  background-color: color-mix(in srgb, var(--kh-accent) 12%, transparent);
  border-radius: 50%;
  content: "";
  pointer-events: none;
}

.tr-kailm-home__card:hover {
  box-shadow: var(--tr-shadow-raised);
  color: var(--tr-login-ink);
  transform: translateY(-3px);
}

.tr-kailm-home__card:focus-visible {
  outline: 3px solid var(--tr-saffron-400);
  outline-offset: 3px;
}

.tr-kailm-home__icon {
  display: grid;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: clamp(0.5rem, 1vw, 0.875rem);
  place-items: center;
  background-color: var(--kh-accent);
  border-radius: 50%;
  color: var(--tr-page);
  font-size: 1.375rem;
}

.tr-kailm-home__cardtitle {
  color: var(--kh-ink);
  font-size: clamp(1rem, 0.85rem + 0.4vw, 1.25rem);
  font-weight: 600;
  line-height: 1.25;
}

.tr-kailm-home__cardtext {
  margin-top: 0.25rem;
  color: var(--tr-text-muted);
  font-size: 0.9375rem;
  line-height: 1.4;
}

/* Pinned to the bottom so the links line up even when a title wraps. */
.tr-kailm-home__foot {
  position: relative;
  z-index: 1;
  display: flex;
  gap: 0.5rem;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 1rem;
}

.tr-kailm-home__more {
  padding-left: clamp(0.25rem, 2.6vw, 2.75rem);
  color: var(--kh-ink);
  font-size: 0.9375rem;
  white-space: nowrap;
  font-weight: 600;
}

.tr-kailm-home__go {
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  flex: none;
  place-items: center;
  background-color: color-mix(in srgb, var(--kh-accent) 16%, var(--tr-page));
  border-radius: 50%;
  color: var(--kh-ink);
}

@media (prefers-reduced-motion: reduce) {
  .tr-kailm-home__cta,
  .tr-kailm-home__card {
    transition: none;
  }

  .tr-kailm-home__cta:hover,
  .tr-kailm-home__card:hover {
    transform: none;
  }
}

/* --------------------------------------------------------------------------
   Process steps
   -------------------------------------------------------------------------- */

.tr-steps {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.tr-steps__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--tr-space-2);
  text-align: center;
}

/* A defined badge, not the near-invisible tint this had before - green for
   the circle itself (a supporting accent, not the headline), saffron kept
   for the glyph so the actionable step still reads as the highlight. */
.tr-steps__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background-color: rgb(19 136 8 / 18%);
  border: 1px solid rgb(19 136 8 / 45%);
  border-radius: 50%;
  color: var(--tr-saffron-400);
  font-size: 1.1rem;
}

.tr-steps__title {
  margin: 0;
  font-family: var(--tr-font-body);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
}

.tr-steps__text {
  margin: 0;
  color: var(--tr-text-invert-muted);
  font-size: var(--tr-fs-xs);
}

/* The Innovation Dashboard card: a sibling of .tr-band--ideas (home.html),
   not nested inside it, pulled up to straddle that band's own bottom edge
   the same way Home's Quick Search bar straddles the hero above it (see
   that comment, main.css - same "negative margin on a following sibling
   needs no overflow: visible escape hatch" reasoning). -3.5rem clears
   .tr-section's own 1rem bottom padding plus about 2.5rem into
   .tr-band--ideas's own 5em padding-block, which is empty space there
   regardless of how tall the band's own content row is - padding sits
   outside that row, not overlapping it - so this never reaches the row's
   actual text content at any height. */
.tr-dashboard {
  position: relative;
  margin-top: -3.5rem;
  padding: var(--tr-space-5);
  background-color: var(--tr-surface);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-raised);
}

/* --------------------------------------------------------------------------
   Feature tiles and quick actions
   -------------------------------------------------------------------------- */

.tr-tiles,
.tr-actions {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-tile {
  height: 100%;
  padding: var(--tr-space-5);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
}

.tr-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--tr-space-3);
  background-color: var(--tr-green-700);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-saffron-400);
}

.tr-tile__title {
  margin-bottom: var(--tr-space-2);
  font-size: var(--tr-fs-h3);
}

.tr-tile__title a {
  color: inherit;
  text-decoration: none;
}

.tr-tile__title a:hover {
  color: var(--tr-saffron-ink);
  text-decoration: underline;
}

.tr-tile__text {
  margin: 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* Media tile: artwork behind the label, as the reference shows. The scrim is what
   makes the text legible over whatever the photograph happens to be doing - it is
   not decoration, so it is not optional. */
.tr-tile--media {
  position: relative;
  isolation: isolate;
  min-height: 12rem;
  background-color: var(--tr-navy-900);
  border-color: var(--tr-navy-900);
  color: var(--tr-text-invert);
  overflow: hidden;
}

.tr-tile__media {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  border-radius: 0;
  object-fit: cover;
}

.tr-tile--media::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background-image: linear-gradient(
    to top,
    rgb(10 31 68 / 92%) 30%,
    rgb(10 31 68 / 55%) 70%,
    rgb(10 31 68 / 25%) 100%
  );
}

/* Same scrim, different colour, so the four feature tiles (Hall of Fame /
   Success Stories / Youth Innovation Hub / Idea Map of Kerala) read as
   distinct without losing their photographs. RGB values are the existing
   --tr-saffron-ink / --tr-green-deep / --tr-navy-mid tokens' own hex,
   written out because gradient stops need a per-stop alpha (matching how
   the default navy scrim above is already written). Idea Map keeps the
   default navy scrim - no tint class needed for it. */
.tr-tile--tint-gold::after {
  background-image: linear-gradient(
    to top,
    rgb(154 79 6 / 92%) 30%,
    rgb(154 79 6 / 55%) 70%,
    rgb(154 79 6 / 25%) 100%
  );
}

.tr-tile--tint-green::after {
  background-image: linear-gradient(
    to top,
    rgb(11 94 46 / 92%) 30%,
    rgb(11 94 46 / 55%) 70%,
    rgb(11 94 46 / 25%) 100%
  );
}

.tr-tile--tint-navy-mid::after {
  background-image: linear-gradient(
    to top,
    rgb(20 47 87 / 92%) 30%,
    rgb(20 47 87 / 55%) 70%,
    rgb(20 47 87 / 25%) 100%
  );
}

.tr-tile--media .tr-tile__icon {
  background-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

.tr-tile--media .tr-tile__title a {
  color: var(--tr-saffron-400);
}

.tr-tile--media .tr-tile__title a:hover {
  color: var(--tr-saffron-500);
}

.tr-tile--media .tr-tile__text {
  color: var(--tr-text-invert-muted);
}

.tr-tile--pending,
.tr-action--pending {
  opacity: 0.6;
}

/* Best Innovative Idea Awards card (Home, "From the Ideas Platform" row) -
   the office's own trophy photo on top, a dark content panel below, rather
   than .tr-tile's plain padded box. Border/radius/shadow match .tr-tile so
   the card still sits flush with its row-mates; the dark panel reuses the
   same green-900 the old flat-colour .tr-tile--banner (now retired, no
   template references it any more) used. */
.tr-award-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
}

.tr-award-card__media img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.tr-award-card__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: flex-start;
  padding: var(--tr-space-4);
  background-color: var(--tr-green-900);
  color: var(--tr-text-invert);
}

.tr-award-card__heading {
  margin-bottom: var(--tr-space-2);
  font-size: var(--tr-fs-body);
  font-weight: 700;
}

.tr-award-card__text {
  margin-bottom: var(--tr-space-3);
  color: var(--tr-text-invert-muted);
  font-size: var(--tr-fs-sm);
}

/* The small "<title> ... View All" row shared by every card in the "From the
   Ideas Platform" row (Idea Spotlight, Top Sectors, Best Innovative Idea
   Awards, Our Proud Sponsors) - keeps their card tops aligned even though
   the cards themselves differ (photo card / list / colour banner). */
.tr-panel-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--tr-space-2);
  margin-bottom: var(--tr-space-3);
}

.tr-panel-head__title {
  display: flex;
  align-items: center;
  gap: var(--tr-space-2);
  margin: 0;
  font-size: var(--tr-fs-h3);
}

.tr-panel-head__viewall {
  flex-shrink: 0;
  color: var(--tr-green-700);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.tr-panel-head__viewall:hover {
  color: var(--tr-saffron-ink);
}

/* Top Sectors list, inside a plain .tr-tile surface. */
.tr-sector-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-sector-list__item {
  display: flex;
  align-items: center;
  gap: var(--tr-space-2);
  padding: var(--tr-space-2) 0;
  border-bottom: 1px solid var(--tr-line);
  font-size: var(--tr-fs-sm);
}

.tr-sector-list__item:last-child {
  border-bottom: 0;
}

.tr-sector-list__icon {
  display: inline-flex;
  flex-shrink: 0;
  color: var(--tr-green-700);
}

.tr-sector-list__name {
  flex: 1 1 auto;
  color: var(--tr-text);
}

.tr-sector-list__count {
  flex-shrink: 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

/* Real, admin-managed sponsor logos (CONTENT-GAPS G-55, resolved) - a
   clean 2-column grid of equally-sized, bordered logo cells. */
/* Every tile is the same box whatever the logo's own size or aspect ratio:
   the columns are minmax(0, 1fr) rather than plain 1fr, so a large logo's
   intrinsic width can never widen its own column, and the height is the
   fixed --tr-sponsor-logo-height token. The logo then fills the box with
   object-fit: contain - scaled down or up to fit, never stretched or
   cropped, centred on both axes. */
.tr-sponsor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--tr-space-3);
  margin: 0 0 var(--tr-space-4);
  padding: 0;
  list-style: none;
}

.tr-sponsor-grid__item {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  height: var(--tr-sponsor-logo-height);
  padding: var(--tr-space-2);
  overflow: hidden;
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius-sm);
}

.tr-sponsor-grid__link {
  display: block;
  width: 100%;
  height: 100%;
}

.tr-sponsor-grid__logo {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  object-position: center;
}

.tr-action {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--tr-space-2);
  height: 100%;
  padding: var(--tr-space-4) var(--tr-space-2);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  color: var(--tr-text);
  text-align: center;
  text-decoration: none;
}

a.tr-action:hover {
  border-color: var(--tr-saffron-500);
  color: var(--tr-saffron-ink);
}

.tr-action__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: 50%;
  color: var(--tr-green-700);
  font-size: 1.2rem;
}

a.tr-action:hover .tr-action__icon {
  border-color: var(--tr-saffron-500);
}

.tr-action__label {
  font-size: var(--tr-fs-xs);
  font-weight: 500;
}

/* --------------------------------------------------------------------------
   Interior page hero
   -------------------------------------------------------------------------- */

/* Interior-page hero elements. There is one hero component across the whole
   site - the section geometry lives with `.tr-hero` above, so every page gets
   the same height and the same background treatment. */

/* Measured live (canvas-reconstructed composite of the promoted tricolor
   wash + hero-assembly-night.jpg, worst-case sampled across the
   eyebrow's full rendered width, on Development Works - the first page
   converted onto this hero shape after the wash was promoted): the base
   --tr-saffron-ink, "dark enough to pass AA on white" by its own token
   comment, drops to 3.64:1 against this photo's own warmer patches under
   the tricolor wash - well under the 4.5:1 normal text needs. #7a3d04
   (already measured and used for the exact same reason on the Ideas and
   KAILM heroes, and independently re-verified against this photo too,
   not assumed to transfer) clears it to 5.09:1. Every page on the base
   .tr-hero (no --ideas/--kailm variant) that uses this eyebrow/lead pair
   shares this one photo (Biography, Electoral Journey, Ministerial
   Roles, Development Works, Media Gallery), so fixing it here once
   covers all of them instead of repeating the same override on each -
   Home uses the base .tr-hero too, but its own name-lead/role/tagline
   are different elements with their own colours, measured separately. */
.tr-hero__eyebrow {
  margin-bottom: var(--tr-space-2);
  color: #7a3d04;
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-tracking-caps);
  text-transform: uppercase;
}

/* Same measurement, same reason: --tr-text-muted dropped to 4.48:1
   against this photo's own patches, just under 4.5:1. #2a3c5b (the same
   darkening already used and re-verified for the same reason on the
   Ideas and KAILM heroes) clears it to 6.96:1. */
.tr-hero__lead {
  max-width: 52ch;
  margin-top: var(--tr-space-4);
  color: #2a3c5b;
}

.tr-hero__stats {
  margin-top: var(--tr-space-6);
}

/* Starts clear of the section rail rather than centred, as the design has
   it. flex: 1 1 auto (not a percentage width): inside .tr-hero__stats--
   seam's own flex row, this is the second child after
   tr-hero__stats-spacer - filling whatever's left after that fixed-width
   spacer, the same "remaining space after a fixed sidebar column" shape
   .tr-railshell__main already uses. */
.tr-hero__stats--offset {
  flex: 1 1 auto;
  min-width: 0;
}

/* The panel straddles the hero/content boundary rather than sitting
   entirely inside it. .tr-hero is already at its own min-height floor
   regardless of this panel's own height, so a negative margin (which
   only reduces how much of the panel's height *counts* toward its flow
   parent) never actually reaches the hero's real bottom edge - there is
   slack between the panel's natural position and that edge either way.
   Anchoring to the edge directly with position: absolute sidesteps that
   entirely: bottom: -2rem places this panel's own bottom exactly 2rem
   past the hero's bottom border, a fixed value rather than a vw formula
   (this session's own analysis of tr-layout__rail's vw-based lift found
   it drifting and eventually overlapping content at certain widths - the
   class of bug a fixed value can't have). Taken out of flow entirely, so
   it contributes nothing to the hero's own rendered height - nothing
   else moves either way. z-index above both the hero's own background
   and tr-railshell__sidebar's own overlay (z-index: 3) so the spilled
   portion paints over both instead of being covered by whatever the DOM
   puts after the hero.

   left/right (not right + a percentage width): this bar and the hero's
   own title both used to clear the sidebar with a Bootstrap grid
   fraction (offset-lg-3, 25% of the row) - a rough approximation of
   --tr-railaside-w's real, clamp()-based width that drifts far enough
   apart at some widths in the lg-to-xl range to visibly overlap the
   sidebar, confirmed live. display: flex + tr-hero__stats-spacer
   reserves the exact same width instead, toggled by the same d-none
   d-lg-block Bootstrap already uses for the sidebar itself - so the two
   can never disagree about how much space the sidebar actually needs. */
.tr-hero__stats--seam {
  position: absolute;
  left: 5rem;
  right: 5rem;
  bottom: -2rem;
  z-index: 4;
  display: flex;
  align-items: flex-end;
}

.tr-hero__stats-spacer {
  flex: 0 0 var(--tr-railaside-w);
}

.tr-statbar--panel {
  display: grid;
  gap: var(--tr-space-4);
  grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
  padding: var(--tr-space-4) var(--tr-space-5);
  background-color: var(--tr-surface);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-raised);
  /* The panel sits on the inverted hero but is itself a light surface, so it has
     to reset the inherited text colour or the figures render white on white. */
  color: var(--tr-text);
}

/* Icon on the left, the figure over its label on the right, rather than
   the icon/number/label stacked in one tall column - shorter and narrower,
   so more of them fit across the same width. `display: contents` unwraps
   .tr-stat__value so the icon and the number both become direct items of
   this grid, alongside the label, without a second copy of
   stat_list.html's shared markup. */
.tr-statbar--panel .tr-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon number"
    "icon label";
  column-gap: var(--tr-space-3);
  min-width: 0;
  text-align: left;
}

.tr-statbar--panel .tr-stat__value {
  display: contents;
}

.tr-statbar--panel .tr-stat__icon {
  grid-area: icon;
  align-self: center;
  color: var(--tr-amber-ink);
  font-size: 1.35rem;
}

.tr-statbar--panel .tr-stat__number {
  grid-area: number;
  align-self: end;
  font-size: var(--tr-fs-h3);
}

.tr-statbar--panel .tr-stat__label {
  grid-area: label;
  align-self: start;
}

/* Home's Innovation Dashboard card (.tr-dashboard/.tr-dashboard__row,
   home.html): "Innovation Dashboard" itself and each of the six figures
   are columns of one single row, confirmed against the office's own
   mockup screenshot pixel by pixel - not a heading sitting above a
   separate stat grid (tr-panel-head's own shape, kept as-is for Idea
   Spotlight/Top Sectors, which this is not). display: contents unwraps
   stat_list's own <dl> so its .tr-stat children become direct flex
   siblings of .tr-dashboard__label below, the same technique
   .tr-stat__value already uses one level down to unwrap the icon/number
   pairing into its own grid. */
.tr-dashboard__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
}

/* Bold, the same size as each figure's own number - confirmed against
   the mockup, this reads as a peer column, not a smaller caption. */
.tr-dashboard__label {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: var(--tr-space-2);
  margin: 0;
  padding-right: var(--tr-space-4);
  border-right: 1px solid var(--tr-line);
  color: var(--tr-text);
  font-size: var(--tr-fs-h3);
  font-weight: 700;
  white-space: nowrap;
}

.tr-dashboard__label .tr-icon {
  color: var(--tr-ribbon-popular);
  font-size: 1.6rem;
}

.tr-statbar--dashboard-light {
  display: contents;
}

.tr-statbar--dashboard-light .tr-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon number"
    "icon label";
  column-gap: var(--tr-space-3);
  flex: 1 1 9rem;
  min-width: 0;
  padding-inline: var(--tr-space-4);
  border-right: 1px solid var(--tr-line);
  text-align: left;
}

.tr-statbar--dashboard-light .tr-stat:last-child {
  border-right: none;
}

.tr-statbar--dashboard-light .tr-stat__value {
  display: contents;
}

.tr-statbar--dashboard-light .tr-stat__icon {
  grid-area: icon;
  align-self: center;
  font-size: 1.6rem;
}

.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 1) .tr-stat__icon,
.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 1) .tr-stat__number {
  color: var(--tr-navy-700);
}

.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 2) .tr-stat__icon,
.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 2) .tr-stat__number {
  color: var(--tr-amber-ink);
}

.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 3) .tr-stat__icon,
.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 3) .tr-stat__number {
  color: var(--tr-ribbon-top-rated);
}

.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 4) .tr-stat__icon,
.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 4) .tr-stat__number {
  color: var(--tr-green-800);
}

.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 5) .tr-stat__icon,
.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 5) .tr-stat__number {
  color: var(--tr-ribbon-popular);
}

.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 6) .tr-stat__icon,
.tr-statbar--dashboard-light .tr-stat:nth-child(6n + 6) .tr-stat__number {
  color: var(--tr-magenta-ink);
}

.tr-statbar--dashboard-light .tr-stat__number {
  grid-area: number;
  align-self: end;
  font-size: var(--tr-fs-h3);
  font-weight: 700;
}

.tr-statbar--dashboard-light .tr-stat__label {
  grid-area: label;
  align-self: start;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

/* --------------------------------------------------------------------------
   Two-column page layout with a section rail
   -------------------------------------------------------------------------- */

.tr-layout {
  padding-block: var(--tr-space-7);
}

/* --------------------------------------------------------------------------
   Section rail shell (peterboy/templates/partials/rail_section.html) - a
   full-bleed sidebar + content row, not boxed inside container-xxl. A
   centred, capped-width container would leave equal dead margin either
   side of the whole row on anything wider than that cap - fine for a page
   of prose, wrong for a full-height panel that reads as chrome, not
   content, the same reasoning partials/hero.html's own full-bleed section
   already follows. Genuinely full width, not literally edge to edge
   though: tr-railwrap gives it (and {% block hero %}'s own wrap above it)
   a fixed 40px gutter instead, so nothing touches the browser edge, and
   the two line up with each other down the page.

   Originally built for, and named after, the Ideas section alone
   (tr-ideasshell/tr-ideasaside/tr-ideaswrap, git history) - promoted to
   this page-agnostic name once every page with a section rail (Biography,
   Electoral Journey, Ministerial Roles, Development Works, Media Gallery,
   KAILM, and every Ideas-section page) moved onto the same shell, so
   there is exactly one implementation rather than the old shape
   duplicated under a second name. The nav *content* inside the sidebar
   (headings, links, the signed-in user card) stays under its own
   tr-ideasaside__* classes below, unrenamed - that part is still
   genuinely Ideas-specific, the only sidebar with an account card. -
   -------------------------------------------------------------------- */

/* 80px gutter at `lg`+ (992px, the sidebar's own breakpoint) and above,
   reused by {% block hero %}'s own wrap above this shell so both align -
   not container-xxl's own responsive breakpoints, which would recreate
   exactly the dead-margin problem the shell's own full-bleed row exists
   to avoid. clamp() rather than a flat 5rem below that width: a fixed
   80px gutter on a true mobile viewport left too little room for KAILM's
   own hero CTA row (its second button alone needs ~239px - white-space:
   nowrap is a deliberate, sitewide .tr-btn rule, not something to
   override for one page - and 80px of gutter either side of a 375px
   viewport leaves only 215px), overflowing the page horizontally,
   confirmed live. 10vw reaches the 80px cap at exactly 992px, so every
   width this shell's sidebar math was already verified at (992-1440px)
   computes to precisely the same 80px as before - only narrower,
   true-mobile widths actually shrink. */
.tr-railwrap {
  padding-inline: clamp(1.25rem, 10vw, 5rem);
}

/* Site-wide: the header's brand, the breadcrumb trail and Home's own
   topbar (the same slot a breadcrumb occupies on every interior page)
   all used to sit in their own container-xxl, which centres and caps at
   1320px past 1400px viewport width - a different, growing inset than
   tr-railwrap's own gutter. That drifted out of alignment on anything
   wider than that breakpoint on the (formerly few, now nearly every)
   pages using the rail shell, and left Home's own navbar sitting at a
   visibly different width than every other page's once the rest of the
   site moved onto the shell's own gutter - confirmed live, the one
   genuinely site-wide chrome element that still disagreed with itself
   page to page. Unscoped from the rail shell's own body class for that
   reason: this is no longer "the shell's own exception," it is what the
   whole site's header chrome should look like everywhere, rail or no
   rail. Same clamp() as .tr-railwrap (main.css), and for the same reason
   - so the header/topbar/breadcrumb gutter keeps matching the content
   below it (where there is a rail shell) at every width, not just the
   992px+ range all three were originally fixed at 80px for. */
.tr-header .container-xxl,
.tr-breadcrumbs .container-xxl,
.tr-topbar .container-xxl {
  max-width: none;
  padding-inline: clamp(1.25rem, 10vw, 5rem);
}

/* The sidebar's own width, shared with two other places that have to
   clear the exact same space (the hero's own tr-hero__sidebar-spacer,
   and the stats panel's tr-hero__stats-spacer, both below) rather than
   approximating it with a Bootstrap grid fraction. col-lg-9/offset-lg-3
   (25% of the row) was the first attempt at that approximation - it
   drifts far enough from this clamp()'s own real width at some widths
   in the lg-to-xl range to visibly overlap the sidebar, confirmed live.
   One custom property instead, read by all three, so they can never
   drift apart from each other. */
.tr-body--railshell {
  --tr-railaside-w: clamp(16rem, 12rem + 8vw, 20rem);
}

/* Lifted up into {% block hero %} above it - a fixed value, not a vw
   formula (tr-layout__rail's own history is exactly the bug that
   approach caused: drifting further from correct the narrower the
   screen got, eventually overlapping the hero at some widths and not
   others). -34rem matches .tr-hero's own min-height exactly, so the top
   of this column can never land above the hero's own top edge - a hero
   can never render shorter than its min-height floor, only taller.
   z-index over the hero's own stacking context so the sidebar paints on
   top of it, not behind it. No sticky here - see .tr-railaside below
   for why the lift and the stick live on two different elements. */
.tr-railshell__sidebar {
  position: relative;
  z-index: 3;
  flex: 0 0 var(--tr-railaside-w);
  margin-top: -34rem;
}

.tr-railshell__main {
  flex: 1 1 auto;
  min-width: 0;
  padding-block: var(--tr-space-6);
}

/* The same 80px rhythm tr-railwrap gives the shell's own left/right
   edges, repeated here as the gap between the sidebar and the main
   column's own content - not container-xxl, for the same "genuinely
   full width" reason as above. */
.tr-railshell__main-inner {
  padding-left: 5rem;
}

/* --------------------------------------------------------------------------
   Ideas section sidebar (app_ideas/partials/section_sidebar.html) - a real
   layout column that also lifts into the hero above it (tr-railshell__
   sidebar's own negative margin, above). Same white/green/saffron
   treatment as the shared tr-rail/tr-usercard/tr-dashnav/tr-helpcard
   components (still used by pages on partials/rail.html's own,
   non-account-card rail) - but its own tr-ideasaside* classes, not those
   shared ones directly, since this sidebar carries a signed-in citizen's
   own account nav and user card, which no tr-rail page needs. -
   -------------------------------------------------------------------- */

/* The lift (negative margin, tr-railshell__sidebar above) and the stick
   (position: sticky, here) are deliberately on two different elements -
   this session's own sticky+negative-margin bug fix found that combining
   both on one box renders it `top`'s own value lower than intended, and
   the fix was exactly this split, parent carries the margin, child
   carries the sticky. max-height + overflow-y so a sidebar taller than
   the viewport (a long citizen_nav with every count badge showing)
   scrolls on its own rather than pushing past the footer.

   border-bottom + box-shadow: both the sidebar and the main column
   beside it are white (.tr-page), so a right border alone reads as a
   thin line rather than a genuinely separate panel - a directional
   shadow (to the right, where the content sits, not the omnidirectional
   --tr-shadow-card every ordinary card uses) gives the white-on-white
   sidebar actual depth instead. */
.tr-railaside {
  display: flex;
  flex-direction: column;
  position: sticky;
  top: calc(var(--tr-header-offset) + var(--tr-space-4));
  max-height: calc(100vh - var(--tr-header-offset) - var(--tr-space-4) * 2);
  overflow-y: auto;
  background-color: var(--tr-page);
  border-right: 1px solid var(--tr-line);
  border-bottom: 1px solid var(--tr-line);
  box-shadow: 4px 0 16px rgb(10 31 68 / 10%);
}

/* Green header block - the same fill .tr-rail__heading uses for its own
   section-rail heading elsewhere, not a new colour rule of its own. */
.tr-ideasaside__heading {
  display: flex;
  align-items: center;
  gap: var(--tr-space-2);
  margin: 0;
  padding: var(--tr-space-4);
  background-color: var(--tr-green-700);
  color: var(--tr-text-invert);
  font-size: var(--tr-fs-xs);
  font-weight: 700;
  letter-spacing: var(--tr-tracking-caps);
  text-transform: uppercase;
}

.tr-ideasaside__list {
  margin: 0;
  padding: var(--tr-space-3) var(--tr-space-2);
  list-style: none;
}

/* Saffron-fill/navy-text active pill, muted-navy default text - the same
   pairing .tr-rail__link/.tr-dashnav__link already use, not a new colour
   rule of its own. */
.tr-ideasaside__link {
  display: flex;
  align-items: center;
  gap: var(--tr-space-3);
  padding: var(--tr-space-3);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  text-decoration: none;
}

a.tr-ideasaside__link:hover {
  background-color: var(--tr-surface-sunken);
  color: var(--tr-saffron-ink);
}

.tr-ideasaside__link--active {
  background-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

a.tr-ideasaside__link--active:hover {
  background-color: var(--tr-saffron-400);
  color: var(--tr-navy-900);
}

.tr-ideasaside__link--pending {
  color: var(--tr-text-muted);
  opacity: 0.7;
}

.tr-ideasaside__divider {
  height: 1px;
  margin-inline: var(--tr-space-4);
  background-color: var(--tr-line);
}

/* Sunken fill - the same background/radius .tr-usercard (dashboard_sidebar.html,
   used by every tr-layout__rail page: wizard, My Dashboard, My Ideas,
   Profile Settings) gives its own user card, so this reads as the same
   component even though it lives in its own tr-ideasaside__* namespace.
   No margin-top of its own, unlike .tr-usercard's - the divider directly
   above this in the markup (section_sidebar.html) already provides that
   gap, and adding both would double it. */
.tr-ideasaside__user {
  display: flex;
  align-items: center;
  gap: var(--tr-space-3);
  padding: var(--tr-space-4);
  margin: var(--tr-space-2);
  background-color: var(--tr-surface-sunken);
  border-radius: var(--tr-radius);
}

/* Saffron initials circle, navy text - the same pairing .tr-usercard__
   avatar already uses. */
.tr-ideasaside__avatar {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  overflow: hidden;
  background-color: var(--tr-saffron-500);
  border-radius: 50%;
  color: var(--tr-navy-900);
  font-weight: 700;
}

.tr-ideasaside__avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.tr-ideasaside__user-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.tr-ideasaside__user-name {
  overflow: hidden;
  color: var(--tr-text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tr-ideasaside__user-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tr-space-2);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

.tr-ideasaside__verified {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--tr-green-500);
  font-weight: 600;
}

.tr-ideasaside__account {
  margin-top: var(--tr-space-2);
  background-color: var(--tr-surface-sunken);
  border-radius: var(--tr-radius);
}

.tr-ideasaside__count {
  margin-left: auto;
  padding: 0.05rem var(--tr-space-2);
  background-color: rgb(10 31 68 / 10%);
  border-radius: 999px;
  font-size: var(--tr-fs-xs);
  font-weight: 700;
}

.tr-ideasaside__link--active .tr-ideasaside__count {
  background-color: rgb(10 31 68 / 18%);
}

.tr-ideasaside__help {
  margin: var(--tr-space-3) var(--tr-space-4) var(--tr-space-4);
  padding: var(--tr-space-4);
  background-color: var(--tr-surface-warm);
  border: 1px solid var(--tr-line-warm);
  border-radius: var(--tr-radius);
}

.tr-ideasaside__help-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  margin-bottom: var(--tr-space-2);
  background-color: var(--tr-page);
  border-radius: 50%;
  color: var(--tr-navy-800);
}

.tr-ideasaside__help-title {
  margin: 0 0 var(--tr-space-1);
  color: var(--tr-text);
  font-weight: 700;
}

.tr-ideasaside__help-text {
  margin: 0 0 var(--tr-space-3);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-ideasaside__help-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-2);
  padding: var(--tr-space-2) var(--tr-space-3);
  border: 1px solid var(--tr-line);
  border-radius: 999px;
  color: var(--tr-text);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  text-decoration: none;
}

.tr-ideasaside__help-btn:hover {
  border-color: var(--tr-saffron-500);
  color: var(--tr-saffron-ink);
}

/* Sits above {% block hero %} now (rail_section.html), directly under
   the breadcrumb - padding-block rather than tr-railaside__mobile-
   trigger's own margin-bottom alone, so there is breathing room above
   the button too, not just below it. */
.tr-railaside__mobile-bar {
  padding-block: var(--tr-space-4) 0;
}

/* Icon-only now (rail_section.html) - square padding instead of .tr-btn's
   own text-button proportions, which read as an odd wide slab with
   nothing but an icon adrift in the middle of it. */
.tr-railaside__mobile-trigger {
  padding: var(--tr-space-3);
  margin-bottom: var(--tr-space-4);
}

.tr-railaside__offcanvas {
  background-color: var(--tr-page);
  color: var(--tr-text);
}

.tr-railaside__offcanvas .offcanvas-header {
  border-bottom: 1px solid var(--tr-line);
}

.tr-railaside__offcanvas .offcanvas-title {
  color: var(--tr-text);
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h3);
}

.tr-rail {
  background-color: var(--tr-page);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  overflow: hidden;
}

/* Green header block (designs/new), not a caption on the navy body the rest
   of the rail used to share - the heading now carries its own solid fill,
   the one piece of the rail that stays a genuinely dark surface, so it
   keeps the invert text tokens rather than switching to the light-chrome
   pair every other rule below it moves to. */
.tr-rail__heading {
  margin: 0;
  padding: var(--tr-space-4);
  background-color: var(--tr-green-700);
  color: var(--tr-text-invert);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-tracking-caps);
  text-transform: uppercase;
}

.tr-rail__list {
  margin: 0;
  padding: var(--tr-space-3) var(--tr-space-2);
  list-style: none;
}

.tr-rail__link {
  display: flex;
  align-items: center;
  gap: var(--tr-space-3);
  padding: var(--tr-space-3);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
  text-decoration: none;
}

a.tr-rail__link:hover {
  background-color: var(--tr-surface-sunken);
  color: var(--tr-saffron-ink);
}

.tr-rail__link--active {
  background-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

a.tr-rail__link--active:hover {
  background-color: var(--tr-saffron-400);
  color: var(--tr-navy-900);
}

.tr-quote--panel {
  margin-top: var(--tr-space-4);
  padding: var(--tr-space-5);
  background-color: var(--tr-navy-800);
  border-radius: var(--tr-radius);
  color: var(--tr-text-invert);
  font-size: var(--tr-fs-h3);
}

.tr-quote--panel p {
  margin-bottom: var(--tr-space-3);
}

/* --------------------------------------------------------------------------
   Values, snapshot, message, banner
   -------------------------------------------------------------------------- */

.tr-highlights {
  display: grid;
  gap: var(--tr-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-highlight {
  display: flex;
  align-items: flex-start;
  gap: var(--tr-space-4);
  padding: var(--tr-space-4);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
}

.tr-highlight__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--tr-green-700);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-saffron-400);
}

.tr-highlight__title {
  margin-bottom: var(--tr-space-1);
  font-family: var(--tr-font-body);
  font-size: 1rem;
  font-weight: 600;
}

.tr-highlight__text {
  margin: 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-snapshot {
  margin: 0;
  padding: var(--tr-space-5);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
}

.tr-snapshot__row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2) var(--tr-space-4);
  padding-block: var(--tr-space-3);
  border-bottom: 1px solid var(--tr-line);
}

.tr-snapshot__row:last-child {
  border-bottom: 0;
}

.tr-snapshot__term {
  flex: 1 1 12rem;
  font-weight: 600;
}

.tr-snapshot__value {
  flex: 2 1 14rem;
  margin: 0;
  color: var(--tr-text-muted);
}

.tr-message {
  padding: var(--tr-space-5);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-saffron-200);
  border-radius: var(--tr-radius-lg);
}

.tr-message__title {
  margin-bottom: var(--tr-space-4);
  font-size: var(--tr-fs-h3);
}

.tr-quote--message {
  font-size: 1.05rem;
}

.tr-quote--message p {
  margin-bottom: var(--tr-space-3);
  color: var(--tr-text-muted);
}

.tr-quote--message cite {
  display: block;
  color: var(--tr-text);
  font-weight: 600;
}

.tr-message__role {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-banner {
  margin-top: var(--tr-space-6);
  padding: var(--tr-space-5);
  background-image: linear-gradient(
    100deg,
    var(--tr-green-900),
    var(--tr-green-700)
  );
  border-radius: var(--tr-radius-lg);
  color: var(--tr-text-invert);
}

.tr-banner__title {
  margin-bottom: var(--tr-space-1);
  font-size: var(--tr-fs-h3);
}

.tr-banner__text {
  max-width: 60ch;
  margin: 0;
  color: var(--tr-text-invert-muted);
  font-size: var(--tr-fs-sm);
}

/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

.tr-table {
  width: 100%;
  border-collapse: collapse;
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
}

.tr-table__caption {
  /* Bootstrap's Reboot puts captions below the table; the section heading above it
     already introduces the data, so this reads as a source note. */
  padding-top: var(--tr-space-3);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
  text-align: left;
}

.tr-table thead th {
  padding: var(--tr-space-3) var(--tr-space-4);
  background-color: var(--tr-navy-900);
  color: var(--tr-text-invert);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-tracking-caps);
  text-align: left;
  text-transform: uppercase;
  white-space: nowrap;
}

.tr-table tbody th,
.tr-table tbody td {
  padding: var(--tr-space-3) var(--tr-space-4);
  border-top: 1px solid var(--tr-line);
  text-align: left;
  vertical-align: middle;
}

.tr-table tbody th {
  font-family: var(--tr-font-display);
  font-size: 1.05rem;
  font-weight: 600;
  white-space: nowrap;
}

.tr-table tbody tr:nth-child(even) {
  background-color: var(--tr-page);
}

/* Home's own preview (results_table.html's `compact=True` branch): a
   plain, dense table with no filled header bar - matching the reference
   mockup's own leaner treatment. Modifier class, so the full Electoral
   Journey table (and any other .tr-table on the site) keeps its navy
   header exactly as before; nothing here touches the base rule. */
.tr-table--compact {
  border: none;
}

.tr-table--compact thead th {
  padding: var(--tr-space-2) var(--tr-space-3);
  background-color: transparent;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

.tr-table--compact tbody th,
.tr-table--compact tbody td {
  padding: var(--tr-space-2) var(--tr-space-3);
  font-size: var(--tr-fs-sm);
}

.tr-table--compact tbody th {
  font-size: var(--tr-fs-sm);
}

/* A sortable `<th>` link (data_table.html + sort_query tag) - same white
   heading text as a plain `<th>`, an underline only on hover/focus so a
   non-sortable column right next to it does not look like the odd one out. */
.tr-table__sort {
  color: inherit;
  text-decoration: none;
}

.tr-table__sort:hover,
.tr-table__sort:focus-visible {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   Chips
   -------------------------------------------------------------------------- */

.tr-chip {
  display: inline-block;
  padding: var(--tr-space-1) var(--tr-space-3);
  border-radius: 999px;
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.tr-chip--subject {
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-2);
  background-color: var(--tr-surface-sunken);
  border: 1px solid var(--tr-line);
  color: var(--tr-text);
}

.tr-chip--status {
  background-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

.tr-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2);
  margin: 0;
  padding: 0;
  list-style: none;
}

/* --------------------------------------------------------------------------
   Portfolio label and footnotes
   -------------------------------------------------------------------------- */

.tr-portfolio {
  display: flex;
  align-items: center;
  gap: var(--tr-space-3);
  /* Row headers are `nowrap` so dates stay on one line; the longest portfolio name
     is five subjects long and has to be allowed to wrap. */
  min-width: 14rem;
  white-space: normal;
}

.tr-portfolio__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2rem;
  height: 2rem;
  background-color: var(--tr-green-700);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-saffron-400);
  font-size: 0.9rem;
}

/* --------------------------------------------------------------------------
   Project cards (Development Works, Home's Transforming Kottayam)
   -------------------------------------------------------------------------- */

.tr-project-card {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
  overflow: hidden;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.tr-project-card:hover {
  box-shadow: var(--tr-shadow-raised);
  transform: translateY(-2px);
}

/* Before and after, side by side rather than a slider - no slider/carousel
   pattern exists anywhere in this codebase to build one on (the same call
   made for Hall of Fame's Spotlight). */
.tr-project-card__media {
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.tr-project-card__shot {
  position: relative;
}

.tr-project-card__shot img,
.tr-project-card__shot .tr-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

/* Top, at the outer corner of each half (Before flush left, After flush
   right) - matching the reference mockup's own placement, confirmed
   against it directly rather than left as the previous bottom-left/
   bottom-left pairing both shots inherited from sharing one class. */
.tr-project-card__tag {
  position: absolute;
  top: var(--tr-space-2);
  left: var(--tr-space-2);
  padding: 0.1rem var(--tr-space-2);
  background-color: rgb(10 31 68 / 72%);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text-invert);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tr-project-card__shot:last-child .tr-project-card__tag {
  left: auto;
  right: var(--tr-space-2);
}

.tr-project-card__body {
  flex: 1 1 auto;
  padding: var(--tr-space-4);
}

.tr-project-card__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--tr-space-2);
  margin-bottom: var(--tr-space-2);
}

.tr-project-card__cost {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
}

.tr-project-card__title {
  margin-bottom: var(--tr-space-2);
  font-size: var(--tr-fs-h3);
}

.tr-project-card__summary {
  margin-bottom: var(--tr-space-3);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-project-card__location,
.tr-project-card__date {
  display: flex;
  align-items: center;
  gap: var(--tr-space-2);
  margin: 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-project-card__location + .tr-project-card__date {
  margin-top: var(--tr-space-1);
}

.tr-project-card__actions {
  margin-top: var(--tr-space-3);
}

/* Home's compact card (project_card.html's `compact=True` branch): one
   line standing in for the status chip + cost + location + date + "View
   Details" button the full card uses, matching the reference's own
   leaner meta row - the whole line is the modal trigger, not just a
   chevron at the end of it, so the larger tap target still opens the
   same detail modal the full card's own button does. */
.tr-project-card__metaline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--tr-space-2);
  width: 100%;
  margin-top: var(--tr-space-3);
  padding: 0;
  background: none;
  border: none;
  border-top: 1px solid var(--tr-line);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
  cursor: pointer;
}

.tr-project-card__metaline span {
  display: flex;
  align-items: center;
  gap: var(--tr-space-2);
  padding-top: var(--tr-space-3);
}

.tr-project-card__metaline .tr-icon {
  flex-shrink: 0;
  color: var(--tr-text-muted);
  transition: transform 150ms ease;
}

.tr-project-card:hover .tr-project-card__metaline .tr-icon {
  transform: translateX(0.2rem);
}

/* A small ribbon on the card's own photo, not just inside the detail modal -
   `is_featured` already exists to drive the Home page's picks; showing it
   here too costs nothing extra and answers "why this one" for a visitor
   browsing the grid. */
.tr-project-card__featured {
  position: absolute;
  top: var(--tr-space-2);
  right: var(--tr-space-2);
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-1);
  padding: 0.1rem var(--tr-space-2);
  background-color: var(--tr-saffron-500);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-navy-900);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* FR-P-23's own class name for a finished project - the same green as
   .tr-chip--won (awards), both meaning "done". */
.tr-chip--completed,
.tr-chip--won {
  background-color: var(--tr-green-700);
  color: var(--tr-text-invert);
}

.tr-chip--ongoing {
  background-color: var(--tr-saffron-200);
  border: 1px solid var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

/* Hasn't started yet - a quieter, neutral outline rather than either of the
   warm/done colours above, so it reads as "not yet" at a glance. */
.tr-chip--upcoming {
  background-color: var(--tr-surface-sunken);
  border: 1px solid var(--tr-navy-700);
  color: var(--tr-navy-800);
}

/* "Featured" is not a project status - the same saffron the card's own
   corner ribbon uses (.tr-project-card__featured), kept as one look rather
   than picking a second colour for the identical meaning in the modal. */
.tr-chip--featured {
  background-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

.tr-source {
  margin-top: var(--tr-space-4);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

/* A figure or field the office has not supplied - never dressed up as content. */
.tr-note {
  color: var(--tr-text-muted);
  font-family: var(--tr-font-body);
  font-size: var(--tr-fs-xs);
  font-style: italic;
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Ideas: hero value props
   -------------------------------------------------------------------------- */

.tr-valueprops {
  margin: var(--tr-space-5) 0 0;
  padding: 0;
  list-style: none;
}

/* --tr-text-invert-muted (a pale blue-grey) and --tr-saffron-400 (a light
   orange) were both tuned for the hero's old dark background, from before
   every hero (Home included) moved to the light wash it uses now - left
   behind by that reskin, so this text and its "Share"/"Collaborate"/
   "Inspire" labels rendered at ~1:1 contrast against the current light
   hero, effectively invisible. --tr-text-muted matches the ordinary
   reading-text colour every other hero paragraph on a light surface uses
   (.tr-hero__lead, for one); --tr-saffron-ink is the token's own
   documented purpose - "saffron dark enough to pass AA on white". */
.tr-valueprop {
  display: flex;
  align-items: flex-start;
  gap: var(--tr-space-3);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-valueprop strong {
  display: block;
  color: var(--tr-saffron-ink);
  font-family: var(--tr-font-display);
  font-size: 1.05rem;
}

/* User feedback: filled solid rather than an outline (saffron first, then
   green) - the icon's own colour flips to white (--tr-text-invert) since
   it now sits on a solid fill instead of the hero's own background; the
   border is dropped as redundant once the fill is the same colour it
   used to outline. */
.tr-valueprop__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  background-color: var(--tr-green-500);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text-invert);
}

/* --------------------------------------------------------------------------
   Ideas: filters and sector tabs
   -------------------------------------------------------------------------- */

.tr-filters {
  padding: var(--tr-space-4);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
}

.tr-filters__label {
  display: block;
  margin-bottom: var(--tr-space-1);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.tr-btn--ghost-dark {
  border-color: var(--tr-line);
  color: var(--tr-text);
}

.tr-btn--ghost-dark:hover {
  border-color: var(--tr-saffron-500);
  color: var(--tr-saffron-ink);
}

.tr-sectortabs {
  display: flex;
  flex-wrap: nowrap;
  gap: var(--tr-space-2);
  margin: var(--tr-space-4) 0;
  padding-bottom: var(--tr-space-2);
  list-style: none;
  overflow-x: auto;
}

.tr-sectortab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--tr-space-2);
  min-width: 6.5rem;
  padding: var(--tr-space-3);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
  text-align: center;
  text-decoration: none;
}

.tr-sectortab:hover {
  border-color: var(--tr-saffron-500);
  color: var(--tr-saffron-ink);
}

/* Green, not navy (designs/new): the active state moves off the site's own
   text/chrome colour so it doesn't read as identical to a heading, and
   green is otherwise unused among the sector icons this pill sits beside. */
.tr-sectortab--active {
  background-color: var(--tr-green-700);
  border-color: var(--tr-green-700);
  color: var(--tr-text-invert);
}

.tr-sectortab--active:hover {
  color: var(--tr-text-invert);
}

/* Hall of Fame's tab row has no icon, only a label, and eight labels are too
   many for the sectortab's fixed min-width grid - a plain wrapping pill row
   instead of a horizontal-scroll rail. Its own green (not the sectortab's
   navy/saffron) so the two read as distinct controls. */
.tr-hoftabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2);
  margin: 0 0 var(--tr-space-4);
  padding: 0;
  list-style: none;
}

.tr-hoftab {
  display: inline-flex;
  align-items: center;
  padding: var(--tr-space-2) var(--tr-space-4);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: 999px;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    border-color 150ms ease;
}

.tr-hoftab:hover {
  border-color: var(--tr-green-700);
  color: var(--tr-green-700);
}

.tr-hoftab--active,
.tr-hoftab--active:hover {
  background-color: var(--tr-green-700);
  border-color: var(--tr-green-700);
  color: var(--tr-text-invert);
  box-shadow: var(--tr-shadow-card);
}

/* Media Gallery's category filter row - same wrapping-pill shape as
   .tr-hoftabs (label only, no icon: MediaCategory carries no icon field the
   way Sector does), its own component name rather than reusing "hoftab"
   for an unrelated page, matching how .tr-sectortabs/.tr-hoftabs already
   coexist as separately-named, identically-shaped tab components. */
.tr-mediatabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2);
  margin: 0 0 var(--tr-space-4);
  padding: 0;
  list-style: none;
}

.tr-mediatab {
  display: inline-flex;
  align-items: center;
  padding: var(--tr-space-2) var(--tr-space-4);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: 999px;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  text-decoration: none;
  transition:
    background-color 150ms ease,
    color 150ms ease,
    border-color 150ms ease;
}

.tr-mediatab:hover {
  border-color: var(--tr-green-700);
  color: var(--tr-green-700);
}

.tr-mediatab--active,
.tr-mediatab--active:hover {
  background-color: var(--tr-green-700);
  border-color: var(--tr-green-700);
  color: var(--tr-text-invert);
  box-shadow: var(--tr-shadow-card);
}

/* Media Gallery / Home preview card - image or click-to-play video. */
.tr-media-card {
  height: 100%;
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  overflow: hidden;
  box-shadow: var(--tr-shadow-card);
}

.tr-media-card__media {
  position: relative;
}

.tr-media-card__media .tr-placeholder {
  border: 0;
  border-radius: 0;
}

.tr-media-card__playtrigger {
  display: block;
  position: relative;
  width: 100%;
  padding: 0;
  background: none;
  border: 0;
  cursor: pointer;
}

.tr-media-card__play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: absolute;
  inset: 0;
  width: 3.5rem;
  height: 3.5rem;
  margin: auto;
  background-color: rgb(10 31 68 / 78%);
  border-radius: 50%;
  color: var(--tr-text-invert);
  font-size: 2rem;
  transition: background-color 150ms ease;
}

.tr-media-card__playtrigger:hover .tr-media-card__play {
  background-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

.tr-media-card__media iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

.tr-media-card__body {
  padding: var(--tr-space-4);
}

.tr-media-card__title {
  margin: var(--tr-space-2) 0;
  font-size: var(--tr-fs-h3);
}

.tr-media-card__caption {
  margin-bottom: var(--tr-space-2);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-media-card__meta {
  margin: 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

/* Home's compact media tile (media_card.html's `compact=True` branch):
   image fills the whole card, title overlaid on a dark scrim instead of
   the full gallery's separate white body - matching the reference
   mockup's own denser 2x2 grid. Same scrim colour
   .tr-project-card__tag already uses, this time as a bottom-anchored
   gradient rather than a small pill, so it reads at any title length
   without a hard-edged band. */
.tr-media-card--compact .tr-media-card__body {
  display: none;
}

/* Constituencies Represented (Home only): the office's own supplied map
   graphic (static/img/kerala-constituencies-map.png), used exactly as
   given - markers, connector lines and callout cards are already baked
   into the asset, nothing rendered on top of it. Bounded to the column's
   own height rather than stretched to its width, so the map's tall
   portrait aspect ratio (1160x1355) never balloons the column past its
   siblings' own height at this breakpoint. */
.tr-constituency-map {
  display: block;
  width: 100%;
  max-height: 26rem;
  margin-inline: auto;
  object-fit: contain;
}

.tr-media-card__overlay {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  padding: var(--tr-space-4) var(--tr-space-3) var(--tr-space-2);
  background-image: linear-gradient(
    to top,
    rgb(10 31 68 / 85%) 0%,
    rgb(10 31 68 / 0%) 100%
  );
  color: var(--tr-text-invert);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  text-align: left;
}

/* --------------------------------------------------------------------------
   Home: Transforming Kottayam
   Scoped under .tr-kottayam; the shared .tr-project-card rules used on the
   Development Works page are left untouched.
   -------------------------------------------------------------------------- */

.tr-kottayam {
  --tr-kottayam-card: 14.375rem;
  --tr-kottayam-gap: 1.25rem;
}

/* Intro and cards side by side, top-aligned. The intro's basis is ~200px
   from Bootstrap's lg breakpoint up and 100% below it (the (62rem - 100vw)
   term flips sign at 992px), so the cards wrap underneath it on tablet
   and mobile without an @media query. */
.tr-kottayam__layout {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: var(--tr-kottayam-gap);
}

.tr-kottayam__intro {
  flex: 0 0 max(12.5rem, min(100%, (62rem - 100vw) * 999));
  min-width: 0;
}

.tr-kottayam__main {
  flex: 1 1 0;
  min-width: min(100%, 14.375rem);
}

.tr-kottayam__title {
  margin: 0 0 var(--tr-space-2);
  font-size: 1.4rem;
  font-weight: 500;
  line-height: 1.25;
}

.tr-kottayam .tr-rule {
  width: 1.75rem;
  height: 2px;
}

.tr-kottayam__lead {
  margin: var(--tr-space-3) 0 var(--tr-space-5);
  color: var(--tr-text-muted);
  font-size: 0.75rem;
  line-height: 1.6;
}

.tr-kottayam__btn {
  min-width: 10rem;
  height: 2.25rem;
  padding: 0 var(--tr-space-4);
  border-radius: var(--tr-radius-sm);
  font-size: 0.8125rem;
  font-weight: 600;
}

/* Card grid. Each track is exactly one card wide (~230px) on desktop and
   the grid is left-aligned, so 1-4 projects keep the same card size. The
   two sign-flipping terms switch it to 2 equal columns once the grid is
   narrower than four cards (tablet), and to 1 full-width column below
   30rem (phones), without an @media query. */
.tr-kottayam__cards {
  display: grid;
  grid-template-columns: repeat(
    auto-fill,
    min(
      100%,
      max(
        clamp(
          var(--tr-kottayam-card),
          (61.25rem - 100%) * 999,
          (100% - var(--tr-kottayam-gap)) / 2
        ),
        (30rem - 100%) * 999
      )
    )
  );
  justify-content: start;
  gap: var(--tr-kottayam-gap);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-kottayam .tr-project-card {
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius-md);
  box-shadow: 0 1px 6px color-mix(in srgb, var(--tr-navy-900) 6%, transparent);
}

.tr-kottayam .tr-project-card__media {
  gap: 0.125rem;
  height: 7.1875rem;
  background-color: var(--tr-surface);
}

.tr-kottayam .tr-project-card__shot img,
.tr-kottayam .tr-project-card__shot .tr-placeholder {
  aspect-ratio: auto;
}

.tr-kottayam .tr-project-card__tag {
  top: var(--tr-space-2);
  padding: 0.1rem 0.4rem;
  background-color: color-mix(in srgb, var(--tr-navy-900) 85%, transparent);
  font-size: 0.625rem;
  letter-spacing: 0.02em;
}

.tr-kottayam .tr-project-card__body {
  display: flex;
  flex-direction: column;
  padding: 0.875rem;
}

.tr-kottayam .tr-project-card__title {
  margin: 0 0 0.125rem;
  overflow: hidden;
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow-wrap: normal;
  word-break: normal;
}

.tr-kottayam .tr-project-card__summary {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  min-height: calc(2 * 1.4em);
  margin: 0 0 0.375rem;
  overflow: hidden;
  font-size: 0.75rem;
  line-height: 1.4;
}

.tr-kottayam .tr-project-card__metaline {
  margin-top: auto;
  padding-top: 0.3rem;
  font-size: 0.72rem;
  line-height: 1.3;
}

.tr-kottayam .tr-project-card__metaline span {
  display: inline;
  padding: 0;
}

.tr-kottayam .tr-project-card__metatext {
  display: flex;
  align-items: center;
  gap: var(--tr-space-1);
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
}

.tr-kottayam .tr-project-card__costvalue {
  color: var(--tr-text);
  font-weight: 700;
}

.tr-kottayam .tr-project-card__sep {
  margin-inline: var(--tr-space-1);
  color: var(--tr-line);
}

.tr-kottayam .tr-project-card__status {
  overflow: hidden;
  text-overflow: ellipsis;
}

/* --------------------------------------------------------------------------
   Home: Electoral Journey / Constituencies Represented / Media Gallery row
   Everything is scoped under .tr-homecard, so the shared .tr-table,
   .tr-media-card and .tr-mediatab rules used on the Electoral Journey and
   Media Gallery pages are left untouched.
   -------------------------------------------------------------------------- */

.tr-homecard {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: color-mix(in srgb, var(--tr-surface-warm) 45%, var(--tr-surface));
  border: 1px solid var(--tr-line-warm);
  border-radius: var(--tr-radius-md);
  box-shadow: var(--tr-shadow-card);
  overflow: hidden;
}

.tr-homecard__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--tr-space-3);
  padding: var(--tr-space-4) var(--tr-space-4) var(--tr-space-3);
}

.tr-homecard__head--center {
  justify-content: center;
  text-align: center;
}

.tr-homecard__title {
  margin: 0;
  font-family: var(--tr-font-display);
  /* 22.4px on desktop; eases down just enough that "Constituencies
     Represented" stays on one line in a 3-column row at 992px and on
     the narrowest phones. */
  font-size: clamp(1.15rem, 0.55rem + 1.25vw, 1.4rem);
  font-weight: 500;
  line-height: var(--tr-lh-tight);
  white-space: nowrap;
}

.tr-homecard__action {
  flex-shrink: 0;
  color: var(--tr-green-700);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.tr-homecard__action:hover {
  text-decoration: underline;
}

.tr-homecard__action--pending,
.tr-homecard__footlink--pending {
  opacity: 0.5;
  pointer-events: none;
}

.tr-homecard__body {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0 var(--tr-space-3) var(--tr-space-3);
}

.tr-homecard__body--table {
  padding-inline: var(--tr-space-4);
}

.tr-homecard__body--map {
  display: flex;
  align-items: center;
  justify-content: center;
}

.tr-homecard__foot {
  padding: var(--tr-space-3) var(--tr-space-4);
  border-top: 1px solid var(--tr-line-warm);
}

.tr-homecard__footlink {
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-2);
  color: var(--tr-green-700);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  text-decoration: none;
}

.tr-homecard__footlink:hover {
  text-decoration: underline;
}

/* Electoral Journey table: sentence-case 11-12px headers, 12px body, ~28px
   rows with hairline dividers; only the latest (first) year is bold. */
.tr-homecard .tr-table--compact {
  background-color: transparent;
}

.tr-homecard .tr-table--compact thead th {
  padding: var(--tr-space-1) var(--tr-space-2);
  color: var(--tr-text);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: normal;
  text-transform: none;
  border-bottom: 1px solid var(--tr-line-warm);
}

.tr-homecard .tr-table--compact tbody th,
.tr-homecard .tr-table--compact tbody td {
  height: 1.75rem;
  padding: 0 var(--tr-space-2);
  border-top: 0;
  border-bottom: 1px solid var(--tr-line-warm);
  font-size: 0.75rem;
  line-height: 1.2;
}

.tr-homecard .tr-table--compact tbody th {
  font-family: var(--tr-font-body);
  font-weight: 400;
}

.tr-homecard .tr-table--compact tbody tr:first-child th {
  font-weight: 700;
}

.tr-homecard .tr-table--compact tbody tr:nth-child(even) {
  background-color: transparent;
}

.tr-homecard .tr-table--compact tbody tr:last-child th,
.tr-homecard .tr-table--compact tbody tr:last-child td {
  border-bottom: 0;
}

/* Constituencies: the supplied map (callouts baked in) centred in the card. */
.tr-homecard .tr-constituency-map {
  width: auto;
  max-width: 100%;
  max-height: 19rem;
}

/* Media Gallery filter pills: one row, compact; the active pill is filled. */
.tr-homecard__pills {
  /* The pills size themselves against this row's own width (cqi units), so
     all five stay on one row whether the card is ~290px (3 columns at
     992px) or ~420px (3 columns at 1366px, or stacked on a phone). */
  container-type: inline-size;
  display: flex;
  flex-wrap: nowrap;
  gap: calc(var(--tr-space-1) * 1.5);
  margin: 0 0 var(--tr-space-3);
  padding: 0;
  overflow-x: auto;
  list-style: none;
  scrollbar-width: none;
}

.tr-homecard__pill {
  display: inline-flex;
  align-items: center;
  padding: var(--tr-space-1) clamp(0.3rem, 5.6cqi - 0.71rem, 0.75rem);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line-warm);
  border-radius: 999px;
  color: var(--tr-text-muted);
  font-size: clamp(0.6rem, 1.54cqi + 0.32rem, 0.72rem);
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
  white-space: nowrap;
}

.tr-homecard__pill:hover {
  border-color: var(--tr-saffron-500);
  color: var(--tr-text);
}

.tr-homecard__pill--active,
.tr-homecard__pill--active:hover {
  background-color: var(--tr-saffron-500);
  border-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

/* Video grid: always two equal columns with ~6px gaps, so 1, 2 or 3 videos
   keep exactly the tile size of the 4-video 2x2 layout. */
.tr-homecard__videos {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: calc(var(--tr-space-1) * 1.5);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-homecard__videos .tr-media-card {
  border: 0;
  border-radius: var(--tr-radius);
  box-shadow: none;
}

.tr-homecard__videos .tr-media-card__media img,
.tr-homecard__videos .tr-media-card__media .tr-placeholder {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.tr-homecard__videos .tr-media-card__play {
  width: 2.25rem;
  height: 2.25rem;
  margin: auto;
  inset: 0 0 1.5rem;
  background-color: color-mix(in srgb, var(--tr-navy-900) 55%, transparent);
  border: 2px solid var(--tr-text-invert);
  font-size: 1.1rem;
}

.tr-homecard__videos .tr-media-card__overlay {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  min-height: calc(2 * 1.3em + 2 * var(--tr-space-2));
  padding: var(--tr-space-2);
  overflow: hidden;
  background-color: color-mix(in srgb, var(--tr-navy-900) 88%, transparent);
  background-image: none;
  font-size: 0.7rem;
  font-weight: 500;
  line-height: 1.3;
}

/* --------------------------------------------------------------------------
   Ideas: card grid
   -------------------------------------------------------------------------- */

.tr-ideas {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-idea {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
  overflow: hidden;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.tr-idea:hover {
  box-shadow: var(--tr-shadow-raised);
  transform: translateY(-2px);
}

.tr-idea__media {
  position: relative;
}

.tr-idea__media img,
.tr-idea__media .tr-placeholder {
  display: block;
  width: 100%;
  /* `height: auto` is load-bearing, not decorative - an `<img>` (unlike the
     placeholder `<div>`) carries real `width`/`height` HTML attributes
     (its actual pixel dimensions, for CLS), which the UA stylesheet maps
     straight onto the `height` CSS property. Without overriding that back
     to `auto`, the box already has two definite dimensions before
     `aspect-ratio` is ever considered, so the ratio below is silently
     ignored and the image renders at its literal uploaded height instead
     of the card's 16:9 slot. */
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border: 0;
  border-radius: 0;
}

.tr-ribbon {
  position: absolute;
  top: var(--tr-space-3);
  left: var(--tr-space-3);
  z-index: 1;
  padding: var(--tr-space-1) var(--tr-space-3);
  background-color: var(--tr-ribbon-trending);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text-invert);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
}

/* idea_card.html's four categorical variants (--trending/--top-rated/
   --popular/--new), keyed to idea.badge.slug. Not yet reachable: no
   badge-computation logic exists on Idea, so idea.badge is always falsy
   today and no ribbon renders on the Explore grid - these are the ready
   styles for whenever that real classification (which idea counts as
   "trending" vs "popular" etc, a product decision, not a colour one) gets
   built, not a currently-visible change. */
.tr-ribbon--top-rated {
  background-color: var(--tr-ribbon-top-rated);
}

.tr-ribbon--popular {
  background-color: var(--tr-ribbon-popular);
}

.tr-ribbon--new {
  background-color: var(--tr-ribbon-new);
}

/* Idea Spotlight's sector badge (Home) - opposite corner from the default
   .tr-ribbon so a trending/etc. badge, once that classification exists,
   can never collide with it. Same navy scrim colour as
   .tr-project-card__tag's own over-image tag, not a new one. */
.tr-ribbon--category {
  top: var(--tr-space-3);
  right: var(--tr-space-3);
  left: auto;
  background-color: rgb(10 31 68 / 72%);
  font-weight: 500;
}

.tr-idea__body {
  flex: 1 1 auto;
  padding: var(--tr-space-4);
}

.tr-idea__title {
  margin-bottom: var(--tr-space-2);
  font-size: var(--tr-fs-h3);
}

.tr-idea__title a {
  color: inherit;
  text-decoration: none;
}

.tr-idea__title a:hover {
  color: var(--tr-saffron-ink);
  text-decoration: underline;
}

.tr-idea__summary {
  margin-bottom: var(--tr-space-3);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-idea__district,
.tr-idea__author {
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-2);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-idea__chips {
  margin-top: var(--tr-space-3);
}

.tr-idea__footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--tr-space-2);
  padding: var(--tr-space-3) var(--tr-space-4);
  border-top: 1px solid var(--tr-line);
}

.tr-idea__metric {
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-2);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* Shown only to the idea's own author, only while it is still a draft or
   needs-info - a plain footer link, not a second card action competing with
   the title link above it. */
.tr-idea__edit {
  justify-content: center;
  margin: 0 var(--tr-space-4) var(--tr-space-4);
}

.tr-idea__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tr-space-3);
  margin-top: var(--tr-space-4);
}

/* Home's Idea Spotlight, sliding through several .tr-idea cards instead of
   showing a single top pick. Bootstrap's own indicator dots default to
   `position: absolute; bottom: 0`, floating over whatever the last slide's
   own footer renders - moved into normal flow below the card instead, so
   they never sit on top of the vote/comment/status row, and restyled from
   Bootstrap's white 30x3px bars to small round dots (reference design:
   the active slide is a solid dark dot, the rest are hollow outlines, not
   two shades of the same fill). */
.tr-spotlight-carousel .carousel-indicators {
  position: static;
  margin: var(--tr-space-3) 0 0;
}

.tr-spotlight-carousel .carousel-indicators button {
  width: 0.5rem;
  height: 0.5rem;
  margin: 0 var(--tr-space-1);
  background-color: transparent;
  background-clip: padding-box;
  border: 1px solid var(--tr-line);
  border-radius: 50%;
  opacity: 1;
}

.tr-spotlight-carousel .carousel-indicators button.active {
  background-color: var(--tr-text);
  border-color: var(--tr-text);
}

.tr-pagehero .tr-idea__district,
.tr-pagehero .tr-idea__author {
  color: var(--tr-text-invert-muted);
}

/* Status chips share a shape; a few carry meaning through colour as well. */
[class*="tr-chip--status-"] {
  background-color: var(--tr-surface-sunken);
  border: 1px solid var(--tr-line);
  color: var(--tr-text-muted);
}

.tr-chip--status-shortlisted,
.tr-chip--status-final_review {
  background-color: var(--tr-saffron-200);
  border-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

.tr-chip--status-implemented {
  background-color: var(--tr-green-700);
  border-color: var(--tr-green-700);
  color: var(--tr-text-invert);
}

/* --------------------------------------------------------------------------
   Ideas: results, pagination, detail
   -------------------------------------------------------------------------- */

.tr-resultcount {
  margin-bottom: var(--tr-space-3);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-empty {
  padding: var(--tr-space-6);
  background-color: var(--tr-surface);
  border: 1px dashed var(--tr-line);
  border-radius: var(--tr-radius);
  color: var(--tr-text-muted);
  text-align: center;
}

.tr-pagination {
  margin-top: var(--tr-space-5);
}

.tr-pagination__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2);
  justify-content: center;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-pagination__link {
  display: inline-block;
  min-width: 2.5rem;
  padding: var(--tr-space-2) var(--tr-space-3);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text);
  font-size: var(--tr-fs-sm);
  text-align: center;
  text-decoration: none;
}

a.tr-pagination__link:hover {
  border-color: var(--tr-saffron-500);
  color: var(--tr-saffron-ink);
}

/* Green, matching .tr-sectortab--active's own active-state colour - the two
   "which one is currently selected" controls read as one convention. */
.tr-pagination__link--current {
  background-color: var(--tr-green-700);
  border-color: var(--tr-green-700);
  color: var(--tr-text-invert);
}

.tr-detail {
  margin: 0;
}

.tr-detail__term {
  margin-top: var(--tr-space-4);
  color: var(--tr-saffron-ink);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-tracking-caps);
  text-transform: uppercase;
}

.tr-detail__value {
  margin: 0;
}

.tr-vote {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--tr-space-4);
  padding: var(--tr-space-5);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
}

.tr-vote__count {
  margin: 0;
  color: var(--tr-text-muted);
}

.tr-vote__count strong {
  color: var(--tr-text);
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h3);
}

.tr-comments {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-comment {
  padding: var(--tr-space-4) 0;
  border-bottom: 1px solid var(--tr-line);
}

.tr-comment__meta {
  margin-bottom: var(--tr-space-1);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

.tr-comment__text {
  margin: 0;
}

/* --------------------------------------------------------------------------
   Ideas: the submission wizard and the citizen dashboard shell
   -------------------------------------------------------------------------- */

/* The hero carries its own strapline between the title and the lead - unlike
   the portrait heroes, it has no eyebrow above the title. */
.tr-hero--submit {
  padding-bottom: var(--tr-space-6);
}

.tr-hero__strap {
  margin-bottom: var(--tr-space-3);
  color: var(--tr-saffron-ink);
  font-family: var(--tr-font-body);
  font-size: var(--tr-fs-h3);
  font-weight: 700;
}

/* Stepper
   -------------------------------------------------------------------------- */

/* Wizard step page only: .tr-railshell__main's own padding-block (main.css)
   gives every other rail page its normal gap under the hero - a real
   barrier to margin collapse, not just visual space, so .tr-stepper-wrap's
   own negative top margin below can't reach past it to the hero the way
   it used to when it sat bare in container-xxl (no padding-top there at
   all, git history). Zeroed here, scoped to this one page's own body
   class, rather than on .tr-railshell__main itself, which every other
   rail page still needs its ordinary padding on. */
.tr-body--wizard-step .tr-railshell__main {
  padding-top: 0;
}

/* Rides over the join between the hero and the page the same way the
   portrait heroes' statistics panel does - lifted clear of the dark band by
   its own negative margin, so it reads as one card sitting across both. */
.tr-stepper-wrap {
  position: relative;
  z-index: 2;
  margin-top: calc(-1 * var(--tr-space-8));
  margin-bottom: var(--tr-space-6);
}

.tr-stepper {
  padding: var(--tr-space-5) var(--tr-space-6);
  background-color: var(--tr-page);
  border-radius: var(--tr-radius-lg);
  box-shadow: 0 1.25rem 2.5rem rgb(10 31 68 / 12%);
}

.tr-stepper__list {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--tr-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-stepper__item {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: var(--tr-space-2);
  min-width: 6rem;
  text-align: center;
}

.tr-stepper__node {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background-color: var(--tr-surface-warm);
  border: 2px solid var(--tr-line-warm);
  border-radius: 50%;
  color: var(--tr-text-muted);
  font-weight: 700;
  text-decoration: none;
}

a.tr-stepper__node:hover {
  border-color: var(--tr-saffron-500);
  color: var(--tr-saffron-ink);
}

.tr-stepper__item--current .tr-stepper__node {
  background-color: var(--tr-green-700);
  border-color: var(--tr-green-700);
  color: var(--tr-text-invert);
}

.tr-stepper__item--done .tr-stepper__node {
  background-color: var(--tr-page);
  border-color: var(--tr-green-700);
  color: var(--tr-green-700);
}

.tr-stepper__label {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
}

.tr-stepper__item--current .tr-stepper__label {
  color: var(--tr-navy-900);
}

/* Dashboard sidebar: user card, personal nav, help card
   -------------------------------------------------------------------------- */

.tr-usercard {
  display: flex;
  gap: var(--tr-space-3);
  align-items: center;
  padding: var(--tr-space-4);
  margin-top: var(--tr-space-4);
  background-color: var(--tr-surface-sunken);
  border-radius: var(--tr-radius);
}

.tr-usercard__avatar {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background-color: var(--tr-saffron-500);
  border-radius: 50%;
  color: var(--tr-navy-900);
  font-weight: 700;
}

/* The citizen's own upload (Profile Settings), never a substitute for one
   (D-13) - covers the saffron initials circle completely, so there is no
   fallback bleed at the edges. */
.tr-usercard__avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

/* The larger standalone version on Profile Settings itself, above the
   read-only field list - same "own upload or initials" rule as the usercard,
   just bigger since it is not sharing a row with a name/meta column. */
.tr-profile-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 5rem;
  height: 5rem;
  margin-bottom: var(--tr-space-4);
  background-color: var(--tr-saffron-500);
  border-radius: 50%;
  color: var(--tr-navy-900);
  font-size: var(--tr-fs-h3);
  font-weight: 700;
}

.tr-profile-avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.tr-usercard__info {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-1);
  min-width: 0;
}

.tr-usercard__name {
  overflow: hidden;
  color: var(--tr-text);
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tr-usercard__meta {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2);
  align-items: center;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

.tr-badge--verified {
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-1);
  color: var(--tr-green-500);
  font-weight: 600;
}

.tr-dashnav {
  margin-top: var(--tr-space-3);
  background-color: var(--tr-surface-sunken);
  border-radius: var(--tr-radius);
}

.tr-dashnav__list {
  margin: 0;
  padding: var(--tr-space-2);
  list-style: none;
}

.tr-dashnav__link {
  display: flex;
  gap: var(--tr-space-3);
  align-items: center;
  padding: var(--tr-space-3);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
  text-decoration: none;
}

a.tr-dashnav__link:hover {
  background-color: var(--tr-page);
  color: var(--tr-text);
}

.tr-dashnav__link--active {
  background-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

/* Rendered as text rather than a link (CONTENT-GAPS G-45) - dimmed the same
   way a pending section-rail entry is, so the two read as one convention.
   Light chrome now: navy text on this surface starts from a contrast ratio
   well past AA, so 0.7 stays legible - unlike the old navy-800 surface,
   where 0.55 measured 3.7:1 and failed AA, which is why 0.7 was chosen
   there in the first place. */
.tr-dashnav__link--pending {
  opacity: 0.7;
}

.tr-dashnav__count {
  margin-left: auto;
  padding: 0.05rem var(--tr-space-2);
  background-color: rgb(10 31 68 / 10%);
  border-radius: 999px;
  font-size: var(--tr-fs-xs);
  font-weight: 700;
}

.tr-dashnav__link--active .tr-dashnav__count {
  background-color: rgb(10 31 68 / 18%);
}

.tr-helpcard {
  padding: var(--tr-space-4);
  margin-top: var(--tr-space-4);
  background-color: var(--tr-surface-warm);
  border: 1px solid var(--tr-line-warm);
  border-radius: var(--tr-radius);
  text-align: center;
}

.tr-helpcard__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  margin-bottom: var(--tr-space-2);
  background-color: var(--tr-page);
  border-radius: 50%;
  color: var(--tr-navy-800);
}

.tr-helpcard__title {
  margin-bottom: var(--tr-space-1);
  font-weight: 700;
}

.tr-helpcard__text {
  margin-bottom: var(--tr-space-3);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* Form panel
   -------------------------------------------------------------------------- */

.tr-panel {
  padding: clamp(var(--tr-space-5), 4vw, var(--tr-space-6));
  margin-bottom: var(--tr-space-6);
  background-color: var(--tr-page);
  border: 1px solid var(--tr-line-warm);
  border-radius: var(--tr-radius-lg);
}

.tr-panel__title {
  margin-bottom: var(--tr-space-2);
  font-size: var(--tr-fs-h3);
}

.tr-panel__lead {
  margin-bottom: var(--tr-space-5);
  padding-bottom: var(--tr-space-5);
  border-bottom: 1px solid var(--tr-line-warm);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* A live character count, inserted after the field it belongs to - see
   static/js/wizard.js. Positioned to echo the design without the field
   needing to know its counter exists. */
.tr-charcount {
  display: block;
  margin-top: calc(-1 * var(--tr-space-2));
  margin-bottom: var(--tr-space-3);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
  text-align: right;
}

/* Upload tiles
   -------------------------------------------------------------------------- */

.tr-upload {
  margin-bottom: var(--tr-space-4);
}

.tr-upload__control {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--tr-space-1);
  padding: var(--tr-space-5);
  background-color: var(--tr-surface-warm);
  border: 1px dashed var(--tr-line-warm);
  border-radius: var(--tr-radius);
  color: var(--tr-navy-800);
  cursor: pointer;
  text-align: center;
}

.tr-upload__control:hover {
  border-color: var(--tr-saffron-500);
}

.tr-upload__label {
  font-weight: 600;
}

.tr-upload__hint {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

.tr-upload__files {
  color: var(--tr-green-700);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
}

/* A short note under a field, distinct from `.tr-upload__hint` (which lives
   inside the drop tile's own label) - this one sits below the whole field,
   for a tip that needs a real link in it rather than plain help text. */
.tr-field__hint {
  margin-top: calc(-1 * var(--tr-space-2));
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

/* The input stays in the accessibility tree and keeps native keyboard and
   file-picker behaviour - clicking the label above opens it without any
   script, exactly as clicking a <label for> always has. */
.tr-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

/* Review recap (step 5)
   -------------------------------------------------------------------------- */

.tr-review {
  padding: var(--tr-space-5);
  margin-bottom: var(--tr-space-5);
  background-color: var(--tr-surface-warm);
  border-radius: var(--tr-radius);
}

.tr-review__title {
  margin-bottom: var(--tr-space-2);
  font-size: var(--tr-fs-h3);
}

.tr-review__summary {
  color: var(--tr-text-muted);
}

.tr-review__section {
  padding-top: var(--tr-space-4);
  margin-top: var(--tr-space-4);
  border-top: 1px solid var(--tr-line-warm);
}

.tr-review__section h4 {
  margin-bottom: var(--tr-space-2);
  font-size: var(--tr-fs-sm);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tr-review__incomplete {
  margin-top: var(--tr-space-4);
  color: var(--tr-amber-ink);
  font-size: var(--tr-fs-sm);
}

.tr-facts {
  display: grid;
  gap: var(--tr-space-2) var(--tr-space-5);
  margin: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 16rem), 1fr));
}

.tr-facts__row {
  display: flex;
  gap: var(--tr-space-2);
  font-size: var(--tr-fs-sm);
}

.tr-facts__row dt {
  color: var(--tr-text-muted);
}

.tr-facts__row dd {
  margin: 0;
  font-weight: 600;
}

/* FAQ accordion
   -------------------------------------------------------------------------- */

.tr-faq__item {
  padding: var(--tr-space-4) 0;
  border-bottom: 1px solid var(--tr-line-warm);
}

.tr-faq__item summary {
  font-weight: 600;
  cursor: pointer;
  list-style: none;
}

.tr-faq__item summary::-webkit-details-marker {
  display: none;
}

/* A plus/minus mark drawn as a pseudo-element rather than an icon, so opening
   and closing needs no script beyond what <details> already provides. */
.tr-faq__item summary::before {
  display: inline-block;
  margin-right: var(--tr-space-3);
  color: var(--tr-saffron-ink);
  content: "+";
}

.tr-faq__item[open] summary::before {
  content: "−";
}

.tr-faq__item p {
  margin: var(--tr-space-3) 0 0;
  color: var(--tr-text-muted);
}

/* Info rail: tips, process steps, inspiration
   -------------------------------------------------------------------------- */

.tr-infocard {
  padding: var(--tr-space-5);
  margin-bottom: var(--tr-space-5);
  background-color: var(--tr-page);
  border: 1px solid var(--tr-line-warm);
  border-radius: var(--tr-radius-lg);
}

.tr-infocard--accent {
  background-color: var(--tr-surface-warm);
}

.tr-infocard__title {
  display: flex;
  gap: var(--tr-space-2);
  align-items: center;
  margin-bottom: var(--tr-space-4);
  font-size: var(--tr-fs-h3);
}

.tr-checklist {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-checklist li {
  display: flex;
  gap: var(--tr-space-2);
  align-items: center;
  color: var(--tr-text);
  font-size: var(--tr-fs-sm);
}

.tr-checklist .tr-icon {
  flex-shrink: 0;
  color: var(--tr-green-700);
}

.tr-processlist {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: none;
}

.tr-processlist li {
  display: flex;
  gap: var(--tr-space-3);
}

.tr-processlist__icon {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background-color: var(--tr-surface-warm);
  border-radius: 50%;
  color: var(--tr-green-700);
}

.tr-processlist__text {
  display: block;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* My Dashboard stats
   -------------------------------------------------------------------------- */

.tr-dashstats {
  margin-bottom: var(--tr-space-6);
}

.tr-dashstat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--tr-space-2);
  padding: var(--tr-space-5);
  background-color: var(--tr-surface-warm);
  border-radius: var(--tr-radius);
  text-align: center;
}

.tr-dashstat .tr-icon {
  color: var(--tr-saffron-ink);
}

.tr-dashstat__value {
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h2);
}

.tr-dashstat__label {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.tr-dashboard__more {
  margin-bottom: var(--tr-space-6);
}

/* Ideas: the signed-out gate at /ideas/submit/
   -------------------------------------------------------------------------- */

/* The platform-stats card reuses the stepper's floating position and shell,
   but never its stepper-specific children - the two never render together
   (one is signed out, one is not), so sharing the wrapper costs nothing. */
.tr-stepper--stats {
  padding: var(--tr-space-5) var(--tr-space-6);
}

.tr-benefits {
  margin-bottom: var(--tr-space-6);
}

.tr-benefit {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-2);
  padding: var(--tr-space-5);
  background-color: var(--tr-page);
  border: 1px solid var(--tr-line-warm);
  border-radius: var(--tr-radius);
}

.tr-benefit .tr-icon {
  color: var(--tr-green-700);
}

.tr-benefit span {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-gate {
  margin-bottom: var(--tr-space-5);
}

.tr-gate__head {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-3);
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--tr-space-4);
}

.tr-gate__head h3 {
  margin: 0;
  font-size: var(--tr-fs-h3);
}

.tr-gate__lead {
  margin-bottom: var(--tr-space-4);
  color: var(--tr-text-muted);
}

.tr-gate__cta {
  width: 100%;
  justify-content: center;
  margin-bottom: var(--tr-space-4);
}

.tr-gate__or {
  margin-bottom: var(--tr-space-3);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
  text-align: center;
}

.tr-gate__terms,
.tr-gate__aside {
  margin: var(--tr-space-4) 0 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
  text-align: center;
}

/* Smaller, plain-link tiles - this row only ever routes to registration, it
   is not itself a persona choice the way the signup page's tiles are. */
.tr-persona--compact {
  display: grid;
  gap: var(--tr-space-2);
  margin: 0 0 var(--tr-space-2);
  padding: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
  list-style: none;
}

.tr-persona--compact .tr-persona__tile {
  min-height: 2.75rem;
  padding: var(--tr-space-2);
  font-size: var(--tr-fs-xs);
}

.tr-evallist {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: eval;
}

.tr-evallist > li {
  display: flex;
  gap: var(--tr-space-3);
}

.tr-evallist .tr-icon {
  flex-shrink: 0;
  color: var(--tr-saffron-ink);
}

.tr-evallist__text {
  display: block;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* A horizontal, non-interactive restatement of the wizard's own stepper -
   informational only, so it never borrows .tr-stepper's clickable states. */
.tr-processrow {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: var(--tr-space-3);
  margin: 0 0 var(--tr-space-5);
  padding: 0;
  list-style: none;
}

.tr-processrow > li {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  gap: var(--tr-space-2);
  min-width: 4.5rem;
  text-align: center;
  font-size: var(--tr-fs-xs);
  font-weight: 600;
}

.tr-processrow__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background-color: var(--tr-surface-warm);
  border-radius: 50%;
  color: var(--tr-green-700);
}

.tr-banner--compact {
  margin-top: 0;
  padding: var(--tr-space-4);
}

.tr-banner--compact .tr-banner__title {
  margin-bottom: var(--tr-space-3);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
}

/* A help card laid out as icon-beside-text rather than the stacked,
   centred one in the dashboard sidebar - this one sits two to a row. */
.tr-helpcard--row {
  display: flex;
  gap: var(--tr-space-4);
  align-items: flex-start;
  height: 100%;
  text-align: left;
}

.tr-helpcard--row .tr-helpcard__icon {
  flex-shrink: 0;
  margin-bottom: 0;
}

/* --------------------------------------------------------------------------
   Accounts: the signed-out shell, forms and persona tiles
   -------------------------------------------------------------------------- */

.tr-auth {
  padding-block: var(--tr-space-6);
  background-color: var(--tr-surface-warm);
}

.tr-auth__panel {
  margin-inline: auto;
  padding: clamp(var(--tr-space-5), 4vw, var(--tr-space-6));
  background-color: var(--tr-page);
  border: 1px solid var(--tr-line-warm);
  border-radius: var(--tr-radius);
}

/* Signing in asks for two things; registering asks for eight and lays six
   personas out beside each other. One shell, two widths. */
.tr-auth__panel--narrow {
  max-width: 27rem;
}

.tr-auth__panel--wide {
  max-width: 52rem;
}

.tr-auth__head {
  margin-bottom: var(--tr-space-5);
}

.tr-auth__eyebrow {
  margin-bottom: var(--tr-space-1);
  color: var(--tr-saffron-ink);
  font-family: var(--tr-font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.tr-auth__title {
  margin-bottom: var(--tr-space-3);
  font-size: var(--tr-fs-h2);
}

.tr-auth__lead {
  margin-bottom: 0;
  color: var(--tr-text-muted);
}

/* Forms
   -------------------------------------------------------------------------- */

.tr-form__group {
  margin: 0 0 var(--tr-space-5);
  padding: 0;
  border: 0;
}

.tr-form__legend {
  width: 100%;
  margin-bottom: var(--tr-space-3);
  padding-bottom: var(--tr-space-2);
  border-bottom: 1px solid var(--tr-line-warm);
  color: var(--tr-navy-800);
  font-family: var(--tr-font-body);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Two controls side by side where there is room, stacked where there is not,
   without a breakpoint deciding which (C-02). */
.tr-form__row {
  display: grid;
  gap: var(--tr-space-4);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr));
}

.tr-field {
  margin-bottom: var(--tr-space-4);
}

.tr-field__label {
  display: block;
  margin-bottom: var(--tr-space-2);
  font-family: var(--tr-font-body);
  font-size: 0.875rem;
  font-weight: 600;
}

.tr-field__required {
  color: var(--tr-saffron-ink);
}

/* A checkbox and its label sit on one line, and the label stops being a block.
   Wraps rather than a strict single row, so an error list dropped in beside
   them (see checkbox_field.html) lands on a line of its own instead of
   squeezing in next to the label. */
.tr-field--inline {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2);
  align-items: center;
}

.tr-field--inline .tr-field__label {
  margin-bottom: 0;
}

.tr-field--inline .tr-field__errors {
  flex-basis: 100%;
}

.tr-field__help {
  margin: var(--tr-space-2) 0 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* Django's password validators hand their help text over as a list. */
.tr-field__help ul {
  margin: 0;
  padding-left: var(--tr-space-4);
}

.tr-field__errors {
  margin: var(--tr-space-2) 0 0;
  padding-left: var(--tr-space-4);
  color: var(--tr-error-ink);
  font-size: var(--tr-fs-sm);
}

/* <fieldset>/<legend> reset to the same look as .tr-field's own <label> -
   a group of checkboxes sharing one field (partials/checkbox_group_field.html)
   is still just one .tr-field visually. */
.tr-field--group {
  padding: 0;
  border: 0;
}

.tr-field--group > .tr-field__label {
  padding: 0;
}

.tr-field__options {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2) var(--tr-space-5);
}

/* Hidden until "willing to contribute" is checked (project.js). */
.tr-field__conditional[hidden] {
  display: none;
}

.tr-form__errors {
  margin-bottom: var(--tr-space-4);
  padding: var(--tr-space-3) var(--tr-space-4);
  background-color: var(--tr-error-surface);
  border-left: 3px solid var(--tr-error-ink);
  color: var(--tr-error-ink);
}

.tr-form__errors p:last-child {
  margin-bottom: 0;
}

.tr-input,
.tr-select {
  display: block;
  width: 100%;
  padding: var(--tr-space-3);
  background-color: var(--tr-page);
  border: 1px solid var(--tr-line-warm);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text);
  font-family: var(--tr-font-body);
  font-size: 1rem;
}

.tr-input:focus-visible,
.tr-select:focus-visible {
  border-color: var(--tr-saffron-500);
  outline: 2px solid var(--tr-saffron-500);
  outline-offset: 1px;
}

.tr-form__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-4);
  align-items: center;
  margin-bottom: var(--tr-space-4);
}

.tr-form__aside,
.tr-form__note {
  margin: 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* Social sign-in
   -------------------------------------------------------------------------- */

.tr-social {
  margin-top: var(--tr-space-5);
}

/* A rule with the label sitting in a gap in it, drawn with a flex row rather
   than a pseudo-element so the line length follows the text. */
.tr-social__divider {
  display: flex;
  gap: var(--tr-space-3);
  align-items: center;
  margin-bottom: var(--tr-space-4);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-social__divider::before,
.tr-social__divider::after {
  flex: 1;
  height: 1px;
  background-color: var(--tr-line-warm);
  content: "";
}

.tr-social__list {
  display: grid;
  gap: var(--tr-space-3);
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 13rem), 1fr));
  list-style: none;
}

.tr-social__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: var(--tr-space-3);
  background-color: var(--tr-page);
  border: 1px solid var(--tr-line-warm);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-navy-800);
  font-family: var(--tr-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  text-decoration: none;
}

.tr-social__btn:hover {
  background-color: var(--tr-surface-warm);
  border-color: var(--tr-navy-800);
  color: var(--tr-navy-900);
}

/* --------------------------------------------------------------------------
   Citizen login (templates/account/login.html). Everything is under .tr-login;
   the one rule outside it hides the header's own login button on this page.
   Stacking below 48rem uses the same width-sign trick as the Home rows
   (a huge flex-basis wraps the panels) since custom @media queries are banned.
   -------------------------------------------------------------------------- */

.tr-body--login {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.tr-body--login .tr-main {
  display: flex;
  flex: 1 0 auto;
  flex-direction: column;
}

.tr-body--login .tr-nav__login {
  display: none;
}

.tr-login {
  --tr-saffron: var(--tr-saffron-500);
  --tr-green: var(--tr-green-500);
  --tr-green-deep: var(--tr-login-green);
  --tr-ink: var(--tr-login-ink);

  display: flex;
  flex: 1 0 auto;
  align-items: center;
  justify-content: center;
  padding: clamp(var(--tr-space-4), 4vw, var(--tr-space-8)) clamp(var(--tr-space-4), 4vw, var(--tr-space-6));
  background-color: var(--tr-login-cream);
}

.tr-login__card {
  display: flex;
  flex-wrap: wrap;
  width: 100%;
  max-width: 55rem;
  overflow: hidden;
  background-color: var(--tr-page);
  border: 1px solid var(--tr-login-line);
  border-radius: 0.75rem;
}

.tr-login__aside,
.tr-login__main {
  min-width: 0;
  /* Negative from 48rem up (basis 0, the 5:7 grow ratio decides the split);
     enormous below it, so each panel takes a full row. */
  flex-basis: calc((48rem - 100vw) * 999);
}

.tr-login__aside {
  position: relative;
  flex-grow: 5;
  background-color: var(--tr-green-deep);
  color: var(--tr-page);
}

.tr-login__main {
  flex-grow: 7;
  padding: clamp(1.25rem, 5vw, 2.25rem);
  background-color: var(--tr-page);
}

.tr-login__flag {
  position: absolute;
  inset: 0 0 auto;
  height: 0.25rem;
  background: linear-gradient(
    to right,
    var(--tr-saffron) 33.33%,
    var(--tr-page) 33.33% 66.66%,
    var(--tr-green) 66.66%
  );
}

.tr-login__asideinner {
  display: flex;
  flex-direction: column;
  height: 100%;
  padding: 2rem;
}

.tr-login__kicker {
  margin: var(--tr-space-3) 0 var(--tr-space-3);
  color: var(--tr-login-amber);
  font-size: 0.75rem;
  letter-spacing: 0.0625rem;
}

.tr-login__pitch {
  margin: 0;
  font-family: var(--tr-font-display);
  font-size: 1.75rem;
  line-height: 1.25;
}

/* Below 48rem the panel is a short banner: the list and the reassurance line
   collapse to nothing (max-height clamps to 0 there, and to 40rem above). */
.tr-login__extras {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: space-between;
  max-height: clamp(0rem, (100vw - 48rem) * 999, 40rem);
  overflow: hidden;
}

.tr-login__points {
  display: grid;
  gap: var(--tr-space-4);
  margin: var(--tr-space-5) 0 var(--tr-space-6);
  padding: 0;
  color: var(--tr-login-mint);
  font-size: 0.875rem;
  line-height: 1.4;
  list-style: none;
}

.tr-login__points li {
  display: flex;
  gap: var(--tr-space-3);
  align-items: flex-start;
}

.tr-login__secure {
  display: flex;
  gap: var(--tr-space-2);
  align-items: center;
  margin: 0;
  color: var(--tr-login-mint-dim);
  font-size: 0.75rem;
}

.tr-login__icon,
.tr-login__lead-icon,
.tr-login__eye svg,
.tr-login__submit svg {
  fill: none;
  stroke: currentcolor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tr-login__icon {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  margin-top: 0.0625rem;
  color: var(--tr-login-amber);
}

.tr-login__icon--sm {
  width: 0.875rem;
  height: 0.875rem;
  margin-top: 0;
  color: inherit;
}

.tr-login__eyebrow {
  margin: 0 0 var(--tr-space-1);
  color: var(--tr-green-deep);
  font-size: 0.75rem;
  letter-spacing: 0.0625rem;
}

.tr-login__title {
  margin: 0 0 var(--tr-space-3);
  color: var(--tr-ink);
  font-family: var(--tr-font-display);
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.125rem);
  font-weight: 400;
  line-height: 1.15;
}

.tr-login__rule {
  display: block;
  width: 2.25rem;
  height: 0.1875rem;
  margin-bottom: var(--tr-space-3);
  background: linear-gradient(
    to right,
    var(--tr-saffron) 33.33%,
    var(--tr-login-line) 33.33% 66.66%,
    var(--tr-green) 66.66%
  );
}

.tr-login__lead {
  margin: 0 0 var(--tr-space-4);
  color: var(--tr-login-text);
  font-size: 0.875rem;
}

.tr-login__field {
  margin-bottom: var(--tr-space-4);
}

.tr-login__labelrow {
  display: flex;
  gap: var(--tr-space-3);
  align-items: baseline;
  justify-content: space-between;
}

.tr-login__label {
  display: block;
  margin-bottom: var(--tr-space-2);
  color: var(--tr-ink);
  font-size: 0.875rem;
  font-weight: 500;
}

.tr-login__link,
.tr-login__signup a {
  color: var(--tr-green-deep);
  font-size: 0.875rem;
  text-decoration: none;
}

.tr-login__signup a {
  font-weight: 500;
}

.tr-login__link:hover,
.tr-login__signup a:hover {
  text-decoration: underline;
}

.tr-login__control {
  position: relative;
}

.tr-login__lead-icon {
  position: absolute;
  top: 50%;
  left: 0.875rem;
  width: 1rem;
  height: 1rem;
  color: var(--tr-login-text);
  pointer-events: none;
  transform: translateY(-50%);
}

.tr-login .tr-input {
  height: 2.875rem;
  padding: 0 0.875rem;
  background-color: var(--tr-page);
  border: 1px solid var(--tr-login-field-line);
  border-radius: 0.375rem;
  color: var(--tr-ink);
  font-size: 1rem;
}

.tr-login__control .tr-input {
  padding-inline: 2.75rem;
}

.tr-login .tr-input::placeholder {
  color: var(--tr-login-text);
  opacity: 0.7;
}

.tr-login .tr-input:focus,
.tr-login .tr-input:focus-visible,
.tr-login .tr-select:focus,
.tr-login .tr-select:focus-visible {
  border-color: var(--tr-green);
  box-shadow: 0 0 0 3px var(--tr-login-ring);
  outline: none;
}

/* Keep autofilled fields white instead of the browser's yellow/blue. */
.tr-login .tr-input:-webkit-autofill,
.tr-login .tr-input:-webkit-autofill:hover,
.tr-login .tr-input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--tr-ink);
  box-shadow: 0 0 0 100vmax var(--tr-page) inset;
  caret-color: var(--tr-ink);
}

.tr-login .tr-input:-webkit-autofill:focus {
  box-shadow:
    0 0 0 100vmax var(--tr-page) inset,
    0 0 0 3px var(--tr-login-ring);
}

.tr-login__eye {
  position: absolute;
  top: 50%;
  right: 0.25rem;
  display: grid;
  width: 2.25rem;
  height: 2.25rem;
  place-items: center;
  padding: 0;
  background: none;
  border: 0;
  border-radius: 0.375rem;
  color: var(--tr-login-text);
  cursor: pointer;
  transform: translateY(-50%);
}

.tr-login__eye svg {
  width: 1.125rem;
  height: 1.125rem;
}

.tr-login__eye:hover {
  color: var(--tr-ink);
}

.tr-login__eye:focus-visible {
  box-shadow: 0 0 0 3px var(--tr-login-ring);
  outline: none;
}

.tr-login__eye [hidden] {
  display: none;
}

.tr-login__field--invalid .tr-input {
  border-color: var(--tr-login-error);
}

.tr-login__field--invalid .tr-input:focus {
  box-shadow: 0 0 0 3px var(--tr-login-ring);
}

.tr-login__errors,
.tr-login__alert {
  color: var(--tr-login-error);
  font-size: 0.875rem;
}

.tr-login__errors {
  margin: var(--tr-space-2) 0 0;
  padding: 0;
  list-style: none;
}

.tr-login__alert {
  margin-bottom: var(--tr-space-4);
  padding: var(--tr-space-3) var(--tr-space-4);
  background-color: var(--tr-error-surface);
  border: 1px solid var(--tr-login-error);
  border-radius: 0.375rem;
}

.tr-login__alert p {
  margin: 0;
}

.tr-login__remember {
  display: flex;
  gap: var(--tr-space-3);
  align-items: center;
  margin-bottom: var(--tr-space-4);
  color: var(--tr-ink);
  font-size: 0.875rem;
}

.tr-login__remember input {
  width: 1.125rem;
  height: 1.125rem;
  margin: 0;
  accent-color: var(--tr-green);
}

.tr-login__remember input:focus-visible {
  outline: 2px solid var(--tr-green);
  outline-offset: 2px;
}

.tr-login__submit,
.tr-login__social {
  display: flex;
  gap: var(--tr-space-2);
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 3rem;
  border-radius: 0.375rem;
  font-family: var(--tr-font-body);
  text-decoration: none;
}

.tr-login__submit {
  background-color: var(--tr-saffron);
  border: 1px solid var(--tr-saffron);
  color: var(--tr-ink);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 500;
}

.tr-login__submit svg {
  width: 1rem;
  height: 1rem;
}

.tr-login__submit:hover {
  filter: brightness(0.95);
}

.tr-login__submit:focus-visible,
.tr-login__social:focus-visible {
  box-shadow: 0 0 0 3px var(--tr-login-ring);
  outline: 2px solid var(--tr-green);
  outline-offset: 2px;
}

.tr-login__or {
  display: flex;
  gap: var(--tr-space-3);
  align-items: center;
  margin: var(--tr-space-4) 0;
  color: var(--tr-login-text);
  font-size: 0.75rem;
}

.tr-login__or::before,
.tr-login__or::after {
  flex: 1;
  height: 1px;
  background-color: var(--tr-login-line);
  content: "";
}

.tr-login__social {
  background-color: var(--tr-page);
  border: 1px solid var(--tr-green);
  color: var(--tr-green-deep);
  font-size: 0.9375rem;
  font-weight: 500;
}

.tr-login__social:hover {
  background-color: var(--tr-login-mint);
}

/* The Google mark is drawn as a single-colour outline, as in the mockup. */
.tr-login__social svg {
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentcolor;
  stroke-width: 2;
}

.tr-login__signup {
  margin: var(--tr-space-4) 0 0;
  color: var(--tr-login-text);
  font-size: 0.875rem;
  text-align: center;
}

/* --------------------------------------------------------------------------
   Citizen registration (templates/account/signup.html, designs/
   registration-mockup.png). Shares the .tr-login card shell; everything that
   is specific to this page lives under .tr-signup.
   -------------------------------------------------------------------------- */

.tr-signup .tr-login__card {
  max-width: 60rem;
}

.tr-signup .tr-login__aside {
  flex-grow: 4.2;
}

.tr-signup .tr-login__main {
  flex-grow: 7.8;
  padding: clamp(1.25rem, 5vw, 2.25rem);
}

.tr-signup .tr-login__pitch {
  font-size: clamp(1.5rem, 1.2rem + 1vw, 1.875rem);
}

/* Steps, joined by a 1px line running from circle to circle. */
.tr-signup__steps {
  margin: var(--tr-space-6) 0 0;
  padding: 0;
  list-style: none;
}

.tr-signup__step {
  position: relative;
  display: flex;
  gap: var(--tr-space-3);
  align-items: flex-start;
  padding-bottom: var(--tr-space-5);
  color: var(--tr-login-mint);
}

.tr-signup__step:not(:last-child)::after {
  position: absolute;
  top: 2rem;
  bottom: 0.25rem;
  left: 0.9375rem;
  width: 1px;
  background-color: var(--tr-signup-connector);
  content: "";
}

.tr-signup__num {
  display: grid;
  flex: none;
  width: 1.875rem;
  height: 1.875rem;
  place-items: center;
  border: 1px solid var(--tr-login-mint-dim);
  border-radius: 50%;
  color: var(--tr-login-mint);
  font-size: 0.8125rem;
}

.tr-signup__step--current {
  color: var(--tr-page);
}

.tr-signup__step--current .tr-signup__num {
  background-color: var(--tr-saffron);
  border-color: var(--tr-saffron);
  color: var(--tr-ink);
  font-weight: 500;
}

.tr-signup__steptext {
  display: flex;
  flex-direction: column;
  padding-top: 0.125rem;
}

.tr-signup__steptext strong {
  font-size: 0.9375rem;
  font-weight: 500;
  line-height: 1.3;
}

.tr-signup__steptext small {
  color: var(--tr-login-mint-dim);
  font-size: 0.75rem;
  line-height: 1.4;
}

.tr-signup .tr-login__secure {
  margin-top: auto;
}

.tr-signup .tr-login__extras {
  justify-content: flex-start;
}

.tr-signup__top {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-1) var(--tr-space-4);
  align-items: baseline;
  justify-content: space-between;
}

.tr-signup__top .tr-login__eyebrow {
  margin: 0;
}

.tr-signup__already {
  margin: 0;
  color: var(--tr-login-text);
  font-size: 0.8125rem;
}

.tr-signup__already a {
  color: var(--tr-green-deep);
  font-weight: 500;
  text-decoration: none;
}

.tr-signup .tr-login__title {
  margin-top: var(--tr-space-1);
  font-size: clamp(1.75rem, 1.4rem + 1vw, 2rem);
}

.tr-signup .tr-login__rule {
  margin-bottom: var(--tr-space-4);
}

.tr-signup .tr-login__social {
  min-height: 2.875rem;
}

.tr-signup .tr-login__or {
  margin: var(--tr-space-3) 0 var(--tr-space-4);
  color: var(--tr-signup-muted);
}

.tr-signup .tr-login__field {
  margin-bottom: var(--tr-space-3);
}

.tr-signup__req {
  margin-left: 0.125rem;
  color: var(--tr-signup-star);
}

.tr-signup__choose {
  color: var(--tr-signup-muted);
  font-weight: 400;
}

.tr-signup .tr-login__label {
  margin-bottom: var(--tr-space-1);
  padding: 0;
}

/* Inputs outside an icon wrapper (optional details) get plain padding; the
   ones inside .tr-login__control keep the icon gutter. */
.tr-signup .tr-select {
  display: block;
  width: 100%;
  height: 2.875rem;
  padding: 0 0.875rem;
  background-color: var(--tr-page);
  border: 1px solid var(--tr-login-field-line);
  border-radius: 0.375rem;
  color: var(--tr-ink);
  font-size: 1rem;
}

.tr-signup .tr-select:focus,
.tr-signup .tr-select:focus-visible {
  border-color: var(--tr-green);
  box-shadow: 0 0 0 3px var(--tr-login-ring);
  outline: none;
}

.tr-signup .tr-login__field--invalid .tr-select {
  border-color: var(--tr-login-error);
}

/* "I am a": native radios visually hidden, labels drawn as cards. */
.tr-signup__persona {
  min-width: 0;
  container-type: inline-size;
  margin: 0 0 var(--tr-space-3);
  padding: 0;
  border: 0;
}

.tr-signup__persona legend {
  float: none;
  width: auto;
  font-size: 0.875rem;
}

.tr-signup__grid {
  display: grid;
  gap: var(--tr-space-2);
  /* Three across; two once the panels stack (below 48rem). The column floor is
     a third of the fieldset, or - only when stacked, where the huge
     width-sign term wins the min() - half of it. No @media. */
  grid-template-columns:
    repeat(
      auto-fit,
      minmax(
        min(
          100%,
          max(
            calc(33.333cqi - 0.34rem),
            min(calc((48rem - 100vw) * 999), calc(50cqi - 0.25rem))
          )
        ),
        1fr
      )
    );
}

.tr-signup__opt {
  position: relative;
  display: flex;
  gap: var(--tr-space-2);
  align-items: center;
  height: 2.75rem;
  padding: 0 var(--tr-space-3);
  background-color: var(--tr-page);
  border: 1px solid var(--tr-login-field-line);
  border-radius: 0.375rem;
  color: var(--tr-ink);
  cursor: pointer;
  font-size: 0.8125rem;
  line-height: 1.15;
}

.tr-signup__opt input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tr-signup__opt svg {
  flex: none;
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: var(--tr-signup-muted);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tr-signup__opt:hover {
  border-color: var(--tr-green);
}

.tr-signup__opt:has(input:checked) {
  background-color: var(--tr-signup-selected);
  /* 1.5px border drawn as 1px border + 0.5px inset so the box does not move */
  border-color: var(--tr-green);
  box-shadow: inset 0 0 0 0.5px var(--tr-green);
  color: var(--tr-green-deep);
  font-weight: 500;
}

.tr-signup__opt:has(input:checked) svg {
  stroke: var(--tr-green);
}

.tr-signup__opt:has(input:focus-visible) {
  box-shadow: 0 0 0 3px var(--tr-login-ring);
}

.tr-signup__persona.tr-login__field--invalid .tr-signup__opt {
  border-color: var(--tr-login-error);
}

.tr-signup__ok {
  position: absolute;
  top: 50%;
  right: 0.875rem;
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: var(--tr-green);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  transform: translateY(-50%);
}

.tr-signup__ok[hidden] {
  display: none;
}

/* Strength meter */
.tr-signup__bars {
  display: flex;
  gap: 0.25rem;
  margin-top: var(--tr-space-2);
}

.tr-signup__bars i {
  flex: 1;
  height: 0.25rem;
  background-color: var(--tr-login-line);
  border-radius: 0.125rem;
}

.tr-signup__bars i[data-level="1"] {
  background-color: var(--tr-login-error);
}

.tr-signup__bars i[data-level="2"] {
  background-color: var(--tr-saffron);
}

.tr-signup__bars i[data-level="3"],
.tr-signup__bars i[data-level="4"] {
  background-color: var(--tr-green);
}

.tr-signup__hints {
  display: flex;
  flex-wrap: wrap;
  gap: 0 var(--tr-space-3);
  margin: var(--tr-space-2) 0 0;
  color: var(--tr-green-deep);
  font-size: 0.75rem;
}

.tr-signup__hints [data-tr-tick] {
  color: var(--tr-signup-muted);
}

.tr-signup__hints [data-done="true"] {
  color: var(--tr-green-deep);
}

/* Optional details */
.tr-signup__more {
  margin-bottom: var(--tr-space-4);
  background-color: var(--tr-login-cream);
  border: 1px dashed var(--tr-signup-dash);
  border-radius: 0.375rem;
}

.tr-signup__more summary {
  display: flex;
  gap: var(--tr-space-3);
  align-items: center;
  padding: 0.75rem 0.875rem;
  cursor: pointer;
  list-style: none;
}

.tr-signup__more summary::-webkit-details-marker {
  display: none;
}

.tr-signup__more summary:focus-visible {
  border-radius: 0.375rem;
  box-shadow: 0 0 0 3px var(--tr-login-ring);
  outline: none;
}

.tr-signup__plus,
.tr-signup__chev {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: var(--tr-green-deep);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tr-signup__chev {
  margin-left: auto;
  stroke: var(--tr-signup-muted);
  transition: transform 0.15s ease;
}

.tr-signup__more[open] .tr-signup__chev {
  transform: rotate(180deg);
}

.tr-signup__moretext {
  display: flex;
  flex-direction: column;
}

.tr-signup__moretext strong {
  color: var(--tr-ink);
  font-size: 0.8125rem;
  font-weight: 500;
}

.tr-signup__moretext small {
  color: var(--tr-login-text);
  font-size: 0.75rem;
}

.tr-signup__morebody {
  padding: 0 0.875rem 0.25rem;
}

.tr-signup__note {
  margin: var(--tr-space-1) 0 0;
  color: var(--tr-login-text);
  font-size: 0.75rem;
}

.tr-signup__submit {
  min-height: 3.125rem;
}

.tr-signup__fine {
  display: flex;
  flex-wrap: wrap;
  gap: 0 0.25rem;
  align-items: center;
  margin: var(--tr-space-3) 0 0;
  color: var(--tr-login-text);
  font-size: 0.75rem;
}

.tr-signup__fine svg {
  flex: none;
  width: 0.875rem;
  height: 0.875rem;
  margin-right: 0.25rem;
  fill: none;
  stroke: var(--tr-green-deep);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.tr-signup__fine--mail {
  flex-wrap: nowrap;
  align-items: flex-start;
}

.tr-signup__fine--mail svg {
  margin-top: 0.125rem;
}

.tr-signup__fine--terms {
  margin-top: var(--tr-space-1);
}

.tr-signup__fine a {
  color: var(--tr-green-deep);
  text-decoration: underline;
}

/* Persona tiles
   -------------------------------------------------------------------------- */

.tr-persona {
  margin-bottom: var(--tr-space-4);
}

.tr-persona__list {
  display: grid;
  gap: var(--tr-space-3);
  margin: 0;
  padding: 0;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10.5rem), 1fr));
  list-style: none;
}

.tr-persona__item {
  position: relative;
}

/* The radio itself is the control - it stays in the accessibility tree and keeps
   its keyboard behaviour, it is just not what you see. Clipped rather than
   `display: none`, which would take it out of the tab order entirely. */
.tr-persona__item input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.tr-persona__tile {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 3.5rem;
  padding: var(--tr-space-3);
  background-color: var(--tr-surface-warm);
  border: 1px solid var(--tr-line-warm);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-navy-800);
  font-family: var(--tr-font-body);
  font-size: 0.875rem;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
}

.tr-persona__tile:hover {
  border-color: var(--tr-saffron-500);
}

.tr-persona__item input:checked + .tr-persona__tile {
  background-color: var(--tr-saffron-500);
  border-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

/* Focus has to be drawn on the tile, because the input it belongs to is
   visually clipped - without this, keyboard users lose the cursor entirely. */
.tr-persona__item input:focus-visible + .tr-persona__tile {
  outline: 2px solid var(--tr-navy-800);
  outline-offset: 2px;
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.tr-footer {
  position: relative;
  background-color: var(--tr-page);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* The thin saffron-to-green rule designs/new repeats at hero-bottom and
   footer-top: a straight gradient bar rather than the mockup's literal wave
   art, which would need hand-drawn SVG path data this codebase avoids. Same
   spirit (a tricolor seam, not a stripe of either colour alone), far less
   to maintain. */
.tr-footer::before {
  content: "";
  display: block;
  height: 4px;
  background-image: linear-gradient(
    90deg,
    var(--tr-saffron-500),
    var(--tr-green-500)
  );
}

.tr-footer__top {
  padding-block: var(--tr-space-7);
}

.tr-footer__heading {
  margin-bottom: var(--tr-space-4);
  color: var(--tr-text);
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h3);
}

.tr-footer__text {
  max-width: 34ch;
}

.tr-footer__signature {
  margin-top: var(--tr-space-4);
  color: var(--tr-saffron-ink);
  font-family: var(--tr-font-display);
  font-size: 1.05rem;
  font-style: italic;
}

.tr-footer__list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-footer__list > li + li {
  margin-top: var(--tr-space-2);
}

.tr-footer__link {
  color: var(--tr-text-muted);
  text-decoration: none;
}

.tr-footer__link:hover {
  color: var(--tr-saffron-ink);
  text-decoration: underline;
}

.tr-footer__address {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-1);
  margin: 0;
  font-style: normal;
}

.tr-footer__office {
  color: var(--tr-text);
}

.tr-social {
  display: flex;
  gap: var(--tr-space-3);
  margin: var(--tr-space-4) 0 0;
  padding: 0;
  list-style: none;
}

.tr-social__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2rem;
  height: 2rem;
  border: 1px solid var(--tr-line);
  border-radius: 50%;
  color: var(--tr-text-muted);
}

.tr-social__link:hover {
  border-color: var(--tr-saffron-500);
  color: var(--tr-saffron-ink);
}

.tr-footer__bottom {
  padding-block: var(--tr-space-4);
  border-top: 1px solid var(--tr-line);
  font-size: var(--tr-fs-xs);
}

.tr-footer__copyright {
  margin: 0;
}

.tr-legal__list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2) var(--tr-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-legal__link {
  color: var(--tr-text-muted);
  text-decoration: none;
}

.tr-legal__link:hover {
  color: var(--tr-saffron-ink);
  text-decoration: underline;
}

.tr-backtotop {
  color: var(--tr-saffron-ink);
  text-decoration: none;
}

.tr-backtotop:hover {
  color: var(--tr-saffron-500);
  text-decoration: underline;
}

/* ==========================================================================
   Staff admin panel

   Its own shell - `base_staff.html` does not extend the public `base.html`
   (that hardcodes header.html/footer.html), so nothing above this point is
   assumed. Every colour below is one of the existing :root tokens; no new
   hex value is introduced for this section.
   ========================================================================== */

.tr-staffshell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--tr-surface-sunken);
  font-family: var(--tr-font-body);
}

.tr-staffshell__topbar {
  position: sticky;
  top: 0;
  z-index: var(--tr-z-header);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--tr-space-4);
  padding: var(--tr-space-3) var(--tr-space-5);
  background-color: var(--tr-navy-900);
  box-shadow: var(--tr-shadow-header);
}

.tr-staffbrand {
  display: flex;
  align-items: center;
  gap: var(--tr-space-3);
  color: inherit;
  text-decoration: none;
}

.tr-staffbrand__mark {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background-color: var(--tr-saffron-500);
  border-radius: 50%;
  color: var(--tr-navy-900);
  font-family: var(--tr-font-display);
  font-size: 1.1rem;
  font-weight: 700;
}

.tr-staffbrand__name {
  margin: 0;
  color: var(--tr-saffron-400);
  font-size: var(--tr-fs-sm);
  font-weight: 700;
  letter-spacing: var(--tr-tracking-caps);
  text-transform: uppercase;
}

.tr-staffbrand__subtitle {
  margin: 0;
  color: var(--tr-text-invert-muted);
  font-size: var(--tr-fs-xs);
}

.tr-staffshell__topbar-actions {
  display: flex;
  align-items: center;
  gap: var(--tr-space-4);
}

.tr-staffshell__icon-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background: none;
  border: none;
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text-invert-muted);
}

.tr-staffshell__icon-btn:hover {
  background-color: rgb(255 255 255 / 8%);
  color: var(--tr-text-invert);
}

.tr-staffshell__icon-badge {
  position: absolute;
  top: 0.25rem;
  right: 0.25rem;
  width: 0.5rem;
  height: 0.5rem;
  background-color: var(--tr-error-ink);
  border: 1.5px solid var(--tr-navy-900);
  border-radius: 50%;
}

.tr-staffuser {
  display: flex;
  align-items: center;
  gap: var(--tr-space-2);
  color: var(--tr-text-invert);
}

.tr-staffuser__avatar {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  background-color: var(--tr-navy-700);
  border-radius: 50%;
  color: var(--tr-text-invert);
}

.tr-staffuser__email {
  margin: 0;
  font-size: var(--tr-fs-sm);
  font-weight: 600;
}

.tr-staffuser__role {
  margin: 0;
  color: var(--tr-text-invert-muted);
  font-size: var(--tr-fs-xs);
}

/* The identity block doubles as the Sign Out dropdown's own toggle button -
   reset to look exactly like the plain version it replaces. */
.tr-staffuser--toggle {
  background: none;
  border: none;
  cursor: pointer;
}

.tr-staffuser__chevron {
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  color: var(--tr-text-invert-muted);
  transform: rotate(90deg);
}

.tr-staffshell__body {
  display: flex;
  flex: 1;
  min-height: 0;
}

.tr-staffshell__sidebar {
  flex: 0 0 clamp(15rem, 12rem + 4vw, 16.5rem);
  background-color: var(--tr-navy-900);
}

.tr-staffnav {
  margin: 0;
  padding: var(--tr-space-4) var(--tr-space-3);
  list-style: none;
}

.tr-staffnav__link {
  display: flex;
  align-items: center;
  gap: var(--tr-space-3);
  padding: var(--tr-space-3);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text-invert-muted);
  font-size: var(--tr-fs-sm);
  text-decoration: none;
}

a.tr-staffnav__link:hover {
  background-color: rgb(255 255 255 / 8%);
  color: var(--tr-text-invert);
}

.tr-staffnav__link--active {
  background-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
  font-weight: 600;
}

.tr-staffnav__link--disabled {
  opacity: 0.45;
  pointer-events: none;
}

.tr-staffshell__main {
  flex: 1;
  min-width: 0;
  padding: var(--tr-space-6);
}

.tr-staffhead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--tr-space-3);
  margin-bottom: var(--tr-space-5);
}

/* The Ideas pipeline's stage tabs (pipeline_stage.html) - plain `.tr-btn`
   links, so no new visual language, just a row to hold them. */
.tr-pipeline-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-2);
  margin-bottom: var(--tr-space-5);
}

/* The read-only status-history list (_status_history_fragment.html). */
.tr-statushistory {
  margin: 0 0 var(--tr-space-4);
  padding: 0;
  list-style: none;
}

.tr-statushistory__item {
  padding: var(--tr-space-3) 0;
  border-top: 1px solid var(--tr-line);
}

.tr-statushistory__item:first-child {
  border-top: none;
}

.tr-staffhead__title {
  margin: 0;
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h2);
}

.tr-staffcard {
  padding: var(--tr-space-5);
  background-color: var(--tr-surface);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
}

.tr-staffcard + .tr-staffcard {
  margin-top: var(--tr-space-5);
}

.tr-staffcard__title {
  margin: 0 0 var(--tr-space-4);
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h3);
}

.tr-staffstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--tr-space-4);
  margin-bottom: var(--tr-space-5);
}

.tr-staffstat {
  display: flex;
  align-items: center;
  gap: var(--tr-space-3);
  padding: var(--tr-space-4);
  background-color: var(--tr-surface);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
}

.tr-staffstat__icon {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  background-color: var(--tr-surface-sunken);
  border-radius: 50%;
  color: var(--tr-navy-800);
}

.tr-staffstat__value {
  margin: 0;
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h3);
  font-weight: 700;
}

.tr-staffstat__label {
  margin: 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

.tr-stafffilters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: var(--tr-space-3);
  margin-bottom: var(--tr-space-5);
}

.tr-stafffilters__field {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-1);
}

.tr-stafffilters__label {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

.tr-staffform {
  display: grid;
  gap: var(--tr-space-3);
  max-width: 32rem;
}

.tr-staffform__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-3);
}

.tr-staffactivity {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-staffactivity__item {
  padding: var(--tr-space-3) 0;
  border-top: 1px solid var(--tr-line);
  font-size: var(--tr-fs-sm);
}

.tr-staffactivity__item:first-child {
  border-top: none;
}

.tr-staffactivity__meta {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

.tr-btn--danger {
  background-color: var(--tr-error-surface);
  color: var(--tr-error-ink);
}

.tr-btn--danger:hover {
  background-color: var(--tr-error-ink);
  color: var(--tr-text-invert);
}

/* A couple more status colours beyond what the public idea card already
   defines (shortlisted/final_review/implemented) - the staff table shows
   every status, including the two that reads as a setback rather than
   progress. */
.tr-chip--status-rejected {
  background-color: var(--tr-error-surface);
  border-color: var(--tr-error-ink);
  color: var(--tr-error-ink);
}

.tr-chip--status-needs_info {
  background-color: var(--tr-surface-warm);
  border-color: var(--tr-amber-ink);
  color: var(--tr-amber-ink);
}

/* Toast feedback (partials/toasts.html) - the staff panel's one
   success/error/warning surface (SRS admin panel redesign), replacing
   partials/messages.html's inline banner there only; the public site keeps
   the banner. Bootstrap's own `.toast`/`text-bg-*` utilities do the visual
   work; this just fixes the stack in the corner and initialises/auto-hides
   each one from project.js. */
.tr-toast-container {
  position: fixed;
  top: var(--tr-space-5);
  right: var(--tr-space-5);
  z-index: var(--tr-z-toast);
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-2);
  width: min(22rem, calc(100vw - var(--tr-space-5) * 2));
}

.tr-toast {
  box-shadow: var(--tr-shadow-card);
}

/* ==========================================================================
   Award shortlist

   Every colour is an existing token; the recommendation bar reuses the same
   three-way semantic split (green/amber/red) the rest of the site already
   applies to advance/hold/reject-shaped states.
   ========================================================================== */

.tr-staffcard__hint {
  margin: 0.2rem 0 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* Sponsors admin: a small logo thumbnail in the DataTable row, and a live
   preview tile next to the upload field in the Add/Edit modal
   (`data-image-preview`, static/js/project.js's `initImagePreview()`). */
.tr-sponsor-thumb {
  width: 2.5rem;
  height: 2.5rem;
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius-sm);
  object-fit: contain;
  background-color: var(--tr-surface);
}

.tr-sponsor-logo-preview {
  display: block;
  width: 100%;
  height: 4.5rem;
  margin-top: 0.35rem;
  padding: var(--tr-space-2);
  border: 1px dashed var(--tr-line);
  border-radius: var(--tr-radius-sm);
  object-fit: contain;
  background-color: var(--tr-surface);
}

.tr-sponsor-logo-preview[hidden] {
  display: none;
}

.tr-staffcell--wrap {
  max-width: 20rem;
}

.tr-shortlist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: var(--tr-space-4);
}

.tr-shortlistcard {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-3);
}

.tr-shortlistcard__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--tr-space-3);
}

.tr-shortlistcard__metrics {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--tr-space-3);
  padding: var(--tr-space-3) 0;
  border-top: 1px solid var(--tr-line);
  border-bottom: 1px solid var(--tr-line);
}

.tr-shortlistmetric {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-1);
}

.tr-shortlistmetric__value {
  font-family: var(--tr-font-display);
  font-size: 1.3rem;
  font-weight: 700;
}

.tr-shortlistmetric__value small {
  color: var(--tr-text-muted);
  font-size: 0.65em;
  font-weight: 500;
}

.tr-shortlistmetric__label {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

/* Sits under the sparkline - what the line is doing needs a number next to
   it, or a flat line at zero votes reads as a rendering bug rather than as
   "nothing happened recently". */
.tr-shortlistmetric__caption {
  display: block;
  margin-top: var(--tr-space-1);
  color: var(--tr-text-muted);
  font-size: 0.7rem;
}

.tr-spark {
  width: 100%;
  height: 2rem;
  margin-top: var(--tr-space-1);
}

.tr-spark polyline {
  stroke: var(--tr-green-700);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tr-spark__end {
  fill: var(--tr-green-700);
}

.tr-popbar {
  width: 100%;
  height: 0.4rem;
  background-color: var(--tr-surface-sunken);
  border-radius: 999px;
  overflow: hidden;
}

.tr-popbar__fill {
  height: 100%;
  background-color: var(--tr-saffron-500);
  border-radius: 999px;
}

.tr-recbar {
  display: flex;
  height: 0.5rem;
  background-color: var(--tr-surface-sunken);
  border-radius: 999px;
  overflow: hidden;
}

.tr-recbar__segment {
  min-width: 0;
}

.tr-recbar__segment--advance {
  background-color: var(--tr-green-700);
}

.tr-recbar__segment--hold {
  background-color: var(--tr-amber-ink);
}

.tr-recbar__segment--reject {
  background-color: var(--tr-error-ink);
}

.tr-shortlistcard__nominate summary {
  color: var(--tr-navy-800);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  cursor: pointer;
}

.tr-shortlistcard__nominate .tr-staffform {
  margin-top: var(--tr-space-3);
}

/* ==========================================================================
   Dashboard breakdowns

   The status/sector bars and the wider submission sparkline reuse the same
   tokens as the shortlist's own charts - one visual language for "here is a
   real number, compared to another real number" across the whole panel.
   ========================================================================== */

.tr-staffgrid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: var(--tr-space-4);
  margin-bottom: var(--tr-space-5);
}

.tr-staffgrid .tr-staffcard {
  margin-top: 0;
}

.tr-spark--wide {
  height: 4rem;
}

.tr-breakdown {
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-breakdown__row {
  display: grid;
  grid-template-columns: 9rem 1fr 2.5rem;
  align-items: center;
  gap: var(--tr-space-3);
  padding: var(--tr-space-2) 0;
}

.tr-breakdown__label {
  overflow: hidden;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tr-breakdown__bar {
  display: block;
  height: 0.5rem;
  background-color: var(--tr-surface-sunken);
  border-radius: 999px;
  overflow: hidden;
}

.tr-breakdown__fill {
  display: block;
  height: 100%;
  background-color: var(--tr-navy-700);
  border-radius: 999px;
}

.tr-breakdown__count {
  color: var(--tr-text);
  font-family: var(--tr-font-display);
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* ==========================================================================
   Idea screening
   ========================================================================== */

.tr-screening__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-3);
  margin-top: var(--tr-space-3);
}

.tr-screening__nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--tr-space-4);
  margin-bottom: var(--tr-space-5);
}

/* ==========================================================================
   Hall of Fame
   ========================================================================== */

.tr-medal {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  background-color: var(--tr-surface-sunken);
  border: 2px solid var(--tr-surface);
  border-radius: 50%;
  color: var(--tr-text-muted);
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-xs);
  font-weight: 700;
  box-shadow: var(--tr-shadow-card);
}

/* Gold, silver, bronze - built from tokens already in the palette rather
   than three new hex values. */
.tr-medal--1 {
  background-color: var(--tr-saffron-500);
  border-color: var(--tr-surface);
  color: var(--tr-navy-900);
}

.tr-medal--2 {
  background-color: var(--tr-line);
  border-color: var(--tr-surface);
  color: var(--tr-navy-900);
}

.tr-medal--3 {
  background-color: var(--tr-amber-ink);
  border-color: var(--tr-surface);
  color: var(--tr-text-invert);
}

/* A vertical tile - avatar, name, district, chip, then a two-up stats
   footer - not the wide horizontal row a narrower grid column has no room
   for. */
.tr-innovator {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: var(--tr-space-4);
  text-align: center;
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.tr-innovator:hover {
  box-shadow: var(--tr-shadow-raised);
  transform: translateY(-2px);
}

.tr-innovator__avatar {
  position: relative;
  width: 4rem;
  margin-bottom: var(--tr-space-3);
}

.tr-innovator__avatar .tr-placeholder {
  border-radius: 50%;
}

/* Only ever this citizen's own upload (see innovator_card.html's own
   comment) - same circular treatment as the placeholder it replaces, so
   ranking up from one to the other never shifts the card's layout. */
.tr-innovator__avatar img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
}

/* Rides the avatar's top-left corner, the way a rank badge sits on a photo
   in the reference design. */
.tr-innovator__avatar .tr-medal {
  position: absolute;
  top: -0.35rem;
  left: -0.35rem;
}

.tr-innovator__name {
  margin-bottom: var(--tr-space-1);
  overflow: hidden;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tr-innovator__district {
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-2);
  margin-bottom: var(--tr-space-2);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-innovator__stats {
  display: flex;
  gap: var(--tr-space-4);
  width: 100%;
  margin: var(--tr-space-3) 0 0;
  padding-top: var(--tr-space-3);
  border-top: 1px solid var(--tr-line);
}

.tr-innovator__stats > div {
  flex: 1 1 0;
}

.tr-innovator__stats dt {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
  text-transform: uppercase;
}

.tr-innovator__stats dd {
  margin: 0;
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h3);
  font-variant-numeric: tabular-nums;
}

.tr-hof-panel {
  padding: var(--tr-space-4);
  margin-bottom: var(--tr-space-4);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
}

.tr-hof-panel__title {
  margin-bottom: var(--tr-space-3);
  font-size: var(--tr-fs-h3);
}

.tr-hof-panel__empty {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-hof-panel .tr-idea {
  box-shadow: none;
}

.tr-hof-panel .tr-idea:hover {
  box-shadow: var(--tr-shadow-card);
}

/* The "Impact Created by Citizens" band - a panel inside the page's own
   margins, not a full-bleed section. Sunken rather than the warm card
   surface, so the `variant="card"` stats (themselves warm cards) still
   show up against it instead of blending in. */
.tr-hof-impact {
  padding: var(--tr-space-6) var(--tr-space-5);
  margin-block: var(--tr-space-6);
  background-color: var(--tr-surface-sunken);
  border-radius: var(--tr-radius-lg);
}

.tr-hof-impact .tr-note {
  margin-top: var(--tr-space-4);
}

.tr-breakdown__label {
  display: flex;
  align-items: center;
  gap: var(--tr-space-2);
  overflow: hidden;
}

.tr-breakdown__text {
  overflow: hidden;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.tr-breakdown__icon {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  width: 1.5rem;
  height: 1.5rem;
  border-radius: 50%;
  color: var(--tr-text-invert);
  font-size: 0.8rem;
}

/* A five-colour rotation built from tokens already in the palette, so each
   row's icon chip reads as distinct without a single new hex value. */
.tr-breakdown__row:nth-child(5n + 1) .tr-breakdown__icon {
  background-color: var(--tr-green-700);
}

.tr-breakdown__row:nth-child(5n + 2) .tr-breakdown__icon {
  background-color: var(--tr-saffron-500);
  color: var(--tr-navy-900);
}

.tr-breakdown__row:nth-child(5n + 3) .tr-breakdown__icon {
  background-color: var(--tr-navy-700);
}

.tr-breakdown__row:nth-child(5n + 4) .tr-breakdown__icon {
  background-color: var(--tr-amber-ink);
}

.tr-breakdown__row:nth-child(5n + 5) .tr-breakdown__icon {
  background-color: var(--tr-error-ink);
}

/* The "How It Works" strip beside the closing CTA - a light card so it
   reads as a companion to the dark banner, not a continuation of it. */
.tr-hofsteps {
  padding: var(--tr-space-5);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius-lg);
}

.tr-hofsteps__title {
  margin-bottom: var(--tr-space-4);
  font-size: var(--tr-fs-h3);
}

.tr-hofsteps__row {
  display: flex;
  align-items: flex-start;
  gap: var(--tr-space-2);
}

.tr-hofsteps__step {
  flex: 1 1 0;
  min-width: 0;
  text-align: center;
}

.tr-hofsteps__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-bottom: var(--tr-space-2);
  background-color: var(--tr-surface-sunken);
  border-radius: 50%;
  color: var(--tr-green-700);
}

.tr-hofsteps__label {
  margin-bottom: var(--tr-space-1);
  font-size: var(--tr-fs-sm);
  font-weight: 700;
}

.tr-hofsteps__text {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

.tr-hofsteps__arrow {
  flex-shrink: 0;
  margin-top: 1.1rem;
  color: var(--tr-line);
}

/* ==========================================================================
   KAILM
   ========================================================================== */

/* The reference's Impact Dashboard sits on a dark green surface, not the
   navy .tr-section--ink already gives it - .tr-section--ink has no other
   consumer (confirmed by search), so this overrides on the more specific
   .tr-kailm-impact class rather than editing the shared rule itself.
   border-radius and the tighter padding-block bring its own natural
   (unstretched) height down close to the Pathway column's, so the row's
   own equal-height stretch lands both columns at a matched, compact
   height instead of the taller one dragging the shorter one down with
   it - same technique, no change to Pathway's own markup or CSS. */
.tr-kailm-impact {
  padding-block: var(--tr-space-5);
  background-color: var(--tr-green-900);
  border-radius: var(--tr-radius-lg);
}

/* The shared .tr-section__title size (--tr-fs-h2) is too wide to sit beside
   "View Full Dashboard" on one line in this column - --tr-fs-h3 is the
   next size down the same type scale already defines, not a new value. */
.tr-kailm-impact .tr-section__title {
  font-size: var(--tr-fs-h3);
}

/* <dl> carries a browser-default block margin nothing here ever reset -
   scoped to this one component rather than the shared .tr-statbar rule,
   which other pages (hero stats, dashboards elsewhere) still rely on
   keeping exactly as it is. */
.tr-kailm-impact .tr-statbar {
  margin: 0;
}

/* Same gradient-wash-over-photo technique as the base .tr-hero rule (the
   Assembly at night), swapped for the design's own KAILM photo - the
   Kerala-outline/AI-head graphic with students at a laptop. Declaring the
   full two-layer background-image here is required, not just the url():
   .tr-hero--kailm has higher specificity than .tr-hero, so this replaces
   the base rule's background-image outright rather than layering onto it;
   background-repeat and background-color are left off and so still come
   through from .tr-hero unchanged. The gradient stops themselves are the
   same tricolor formula the base rule now carries (main.css, promoted
   from this file's own history) - CSS can't layer a shared gradient
   independently of the photo underneath it, so every hero that wants the
   same wash over its own photo has to restate the whole property, not
   just the url(). */
.tr-hero--kailm {
  background-image:
    linear-gradient(
      100deg,
      rgb(255 199 145 / 90%) 0%,
      rgb(255 224 179 / 86%) 30%,
      rgb(255 255 255 / 92%) 50%,
      rgb(220 243 222 / 84%) 72%,
      rgb(186 227 190 / 78%) 100%
    ),
    url("../img/band-kailm.a53a3cc4e6c2.jpg");
  background-position:
    center,
    center;
  background-size: cover, cover;
}

/* Same technique again for the Ideas section - every page under it (Explore,
   Idea Detail, Hall of Fame, the Submit gate, the wizard steps, and the
   signed-in dashboard pages) swaps in the lightbulb/round-table artwork
   instead of the Assembly photo the rest of the site uses. This hero is
   where the tricolor formula was originally built and live-measured (git
   history) before being promoted onto the base .tr-hero rule for every
   other hero too - three soft bands (saffron, then white, then green)
   blending into each other over a wide span rather than a hard edge, not
   literal stripes (see the wave-divider comment above for why). Stops
   start the saffron band at 0% but keep it going through 38% rather than
   fading it out early: the section rail visually overlays roughly the
   first 27-35% of this hero (varies with --tr-railaside-w across
   viewports), so ending the saffron band right at that edge would leave
   it invisible behind the rail at the narrower end of that range. */
.tr-hero--ideas {
  /* Overrides the base .tr-hero's overflow: hidden - .tr-hero__stats--seam
     (below) deliberately spills past this hero's own bottom edge, and
     hidden would clip that spill back off. Doesn't affect how the
     background paints; only content that exceeds the box. */
  overflow: visible;
  background-image:
    linear-gradient(
      100deg,
      rgb(255 199 145 / 90%) 0%,
      rgb(255 224 179 / 86%) 30%,
      rgb(255 255 255 / 92%) 50%,
      rgb(220 243 222 / 84%) 72%,
      rgb(186 227 190 / 78%) 100%
    ),
    url("../img/ideas-hero.76d4401be01c.jpg");
  background-position:
    center,
    center;
  background-size: cover, cover;
}

/* Measured live (canvas-reconstructed composite of the actual wash + this
   hero's own photo + glow, sampled across the eyebrow and each "Share" /
   "Collaborate" / "Inspire" label): the base --tr-saffron-ink, "dark
   enough to pass AA on white" by its own token comment, comes out to only
   4.18-4.30:1 against the warmer patches of this specific photo - just
   under the 4.5:1 normal text needs, though it clears comfortably on the
   paler washes the other light heroes use. Rather than darken the shared
   token (and risk overcorrecting pages that already pass), this darkens
   it further for these two spots only, on this hero only - contrast
   comes out at 5.9-6.1:1 against the same worst-sampled patches. */
.tr-hero--ideas .tr-hero__eyebrow,
.tr-hero--ideas .tr-valueprop strong {
  color: #7a3d04;
}

/* Same measurement, same reason, for the saffron band the tricolor wash
   above adds (main.css, .tr-hero--ideas) - --tr-text-muted (the base
   .tr-hero__lead/.tr-valueprop colour) dropped to 4.18-4.58:1 against
   that band's warmer patches, again just under the 4.5:1 normal text
   needs. Darkened for this hero only; comes out at 6.5:1+ against the
   same worst-sampled patches, and reads as a legible dark navy rather
   than the full-strength title colour, keeping some hierarchy between
   the two. */
.tr-hero--ideas .tr-hero__lead,
.tr-hero--ideas .tr-valueprop__text {
  color: #2a3c5b;
}

/* .tr-hero__title is normally `display: flex; flex-direction: column` for
   the home page's own two-line name split - that would force this single-
   line title and its inline "(KAILM)" highlight onto two separate rows
   instead of wrapping together as ordinary text. Reset to block, scoped to
   this hero only, so the rest of the title's rules (size, spacing) still
   apply. */
.tr-hero--kailm .tr-hero__title {
  display: block;
}

/* --tr-green-500 only, only used here (app_kailm/overview.html) - only
   used on this one hero, so no other page inherits this. */
.tr-hero__highlight {
  color: var(--tr-green-500);
}

/* PREVIEW ONLY - measured against the reference so each description wraps
   to the same 2 lines the reference shows (120-140px is the empirical
   range; 130px sits in the middle). Scoped to this hero only, so
   explore.html's own 3-column value props (a different width budget) are
   unaffected. Intentionally left un-constrained by the column's own
   width - .tr-valueprops itself now uses flex-nowrap, so the row is
   expected to run wider than its column here; needs a decision on how far
   right that's allowed to go before this is final. */
.tr-hero--kailm .tr-valueprop__text {
  display: block;
  width: 6.5rem;
}

.tr-hero--kailm .tr-valueprop {
  flex-shrink: 0;
}

/* The design's second, green-toned line under the title - distinct from
   .tr-hero__lead's own muted paragraph beneath it. */
.tr-kailm-hero__tagline {
  margin-top: calc(-1 * var(--tr-space-2));
  font-weight: 600;
}

/* Measured live (canvas-reconstructed composite of the tricolor wash +
   this hero's own band-kailm.jpg photo, worst-case sampled across each
   element's full rendered width): the promoted tricolor wash (main.css,
   base .tr-hero) pushed several of this hero's own colours below AA
   against this specific photo, none of which are the same failures or
   the same fix Explore Ideas needed against its own different photo -
   --tr-green-500 (.tr-hero__highlight, the inline "(KAILM)" in the
   title, and .tr-kailm-hero__tagline) measured 3.05-3.27:1, well under
   the 4.5:1 normal text needs; --tr-green-800 fixes both to 8.1-8.7:1.
   --tr-text-muted (.tr-hero__lead/.tr-valueprop__text) measured
   4.41-4.64:1, just under 4.5:1; the same #2a3c5b darkening Explore
   Ideas already uses (verified independently against this photo, not
   assumed to transfer) clears both to 6.8-7.2:1. --tr-saffron-ink
   (.tr-valueprop strong) measured 3.75:1; the same #7a3d04 Explore Ideas
   uses clears it to 5.25:1 here too. */
.tr-hero--kailm .tr-hero__highlight,
.tr-kailm-hero__tagline {
  color: var(--tr-green-800);
}

.tr-hero--kailm .tr-hero__lead,
.tr-hero--kailm .tr-valueprop__text {
  color: #2a3c5b;
}

.tr-hero--kailm .tr-valueprop strong {
  color: #7a3d04;
}

/* The design docks this as a narrow card in the hero's top-right corner,
   not a block stretched across the whole column - .tr-statbar--sidebar's
   own width is already shrink-to-fit (its rows size to their content), so
   this just lets the wrapper follow suit and pushes it to the column's
   right edge instead of the left. Background/radius/shadow give it the
   same "flat dark card" treatment .tr-section--ink and .tr-statbar--panel
   already use elsewhere, rather than sitting flush on the photo behind it
   as it did before. */
.tr-kailm-hero__stats {
  width: fit-content;
  margin-left: auto;
  padding: var(--tr-space-3) var(--tr-space-4);
  background-color: var(--tr-navy-900);
  border-radius: var(--tr-radius-lg);
  box-shadow: var(--tr-shadow-raised);
}

/* A narrow vertical list, not a wide grid or an inline row: icon on the
   left, the figure over its label on the right, on the hero's own dark
   surface (no separate panel background needed - it already sits on one).
   Same icon-left grid technique as .tr-statbar--panel, in dark colours. */
.tr-statbar--sidebar {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-4);
}

.tr-statbar--sidebar .tr-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon number"
    "icon label";
  column-gap: var(--tr-space-3);
  text-align: left;
}

.tr-statbar--sidebar .tr-stat__value {
  display: contents;
}

.tr-statbar--sidebar .tr-stat__icon {
  grid-area: icon;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  background-color: rgb(255 255 255 / 10%);
  border-radius: 50%;
  color: var(--tr-saffron-400);
  font-size: 1.1rem;
}

.tr-statbar--sidebar .tr-stat__number {
  grid-area: number;
  align-self: end;
  color: var(--tr-text-invert);
  font-size: var(--tr-fs-h3);
}

.tr-statbar--sidebar .tr-stat__label {
  grid-area: label;
  align-self: start;
  color: var(--tr-text-invert-muted);
  font-size: var(--tr-fs-xs);
}

/* The Impact Dashboard: same icon-left grid again, in a wrapping row
   rather than a column, on the section's own .tr-section--ink surface.
   Bordered cells rather than a gapped grid - the container's own top/left
   border plus each cell's right/bottom border together draw a complete
   hairline grid regardless of how many columns auto-fit wraps to, so this
   needs no column-count assumption (and so no media query) to stay
   correct at any width. */
.tr-statbar--dashboard {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr));
  border-top: 1px solid rgb(255 255 255 / 12%);
  border-left: 1px solid rgb(255 255 255 / 12%);
  border-radius: var(--tr-radius-sm);
}

.tr-statbar--dashboard .tr-stat {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "icon number"
    "icon label";
  column-gap: var(--tr-space-3);
  padding: var(--tr-space-3);
  border-right: 1px solid rgb(255 255 255 / 12%);
  border-bottom: 1px solid rgb(255 255 255 / 12%);
  text-align: left;
}

.tr-statbar--dashboard .tr-stat__value {
  display: contents;
}

.tr-statbar--dashboard .tr-stat__icon {
  grid-area: icon;
  align-self: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 1.5px solid currentcolor;
  border-radius: 50%;
  font-size: 1.1rem;
}

/* A six-colour rotation built from tokens already in the palette (the
   same technique .tr-breakdown__row already uses), so each counter reads
   as its own category rather than six identical saffron circles. */
.tr-statbar--dashboard .tr-stat:nth-child(6n + 1) .tr-stat__icon {
  color: var(--tr-saffron-500);
}

.tr-statbar--dashboard .tr-stat:nth-child(6n + 2) .tr-stat__icon {
  color: var(--tr-amber-ink);
}

.tr-statbar--dashboard .tr-stat:nth-child(6n + 3) .tr-stat__icon {
  color: var(--tr-navy-700);
}

.tr-statbar--dashboard .tr-stat:nth-child(6n + 4) .tr-stat__icon {
  color: var(--tr-green-700);
}

.tr-statbar--dashboard .tr-stat:nth-child(6n + 5) .tr-stat__icon {
  color: var(--tr-error-ink);
}

.tr-statbar--dashboard .tr-stat:nth-child(6n + 6) .tr-stat__icon {
  color: var(--tr-green-500);
}

.tr-statbar--dashboard .tr-stat__number {
  grid-area: number;
  align-self: end;
  color: var(--tr-text-invert);
  font-size: var(--tr-fs-h3);
}

.tr-statbar--dashboard .tr-stat__label {
  grid-area: label;
  align-self: start;
  color: var(--tr-text-invert-muted);
  font-size: var(--tr-fs-xs);
}

/* A vertical icon-top tile - the About KAILM and AI Resources sections
   share this shape in the design. */
.tr-kailm-tile {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  padding: var(--tr-space-4);
  text-align: center;
  color: inherit;
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
  text-decoration: none;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.tr-kailm-tile--link:hover {
  box-shadow: var(--tr-shadow-raised);
  transform: translateY(-2px);
}

.tr-kailm-tile--pending {
  opacity: 0.6;
}

.tr-kailm-tile__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  margin-bottom: var(--tr-space-3);
  background-color: var(--tr-green-700);
  border-radius: 50%;
  color: var(--tr-text-invert);
  font-size: 1.35rem;
}

.tr-kailm-tile__title {
  margin-bottom: var(--tr-space-1);
  font-weight: 700;
}

.tr-kailm-tile__text {
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

/* One of the five programme cards - an image with an icon badge riding its
   bottom-left corner, the way the reference design overlaps them. */
.tr-program {
  display: flex;
  flex-direction: column;
  height: 100%;
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
  overflow: hidden;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease;
}

.tr-program:hover {
  box-shadow: var(--tr-shadow-raised);
  transform: translateY(-2px);
}

.tr-program__media {
  position: relative;
}

.tr-program__media .tr-placeholder {
  border: 0;
  border-radius: 0;
}

.tr-program__icon {
  position: absolute;
  bottom: calc(-1 * var(--tr-space-4));
  left: var(--tr-space-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3rem;
  height: 3rem;
  background-color: var(--tr-saffron-500);
  border: 3px solid var(--tr-surface);
  border-radius: 50%;
  color: var(--tr-navy-900);
  font-size: 1.25rem;
}

.tr-program__body {
  flex: 1 1 auto;
  padding: var(--tr-space-5) var(--tr-space-4) var(--tr-space-4);
}

.tr-program__title {
  margin-bottom: var(--tr-space-2);
  font-size: var(--tr-fs-h3);
}

.tr-program__text {
  margin-bottom: var(--tr-space-3);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-program__link,
.tr-program__link--pending {
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-2);
  color: var(--tr-green-700);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
}

.tr-program__link--pending {
  color: var(--tr-text-muted);
  opacity: 0.7;
  pointer-events: none;
}

/* The five-stage learning pathway: numbered circles on a connecting line,
   the design's own horizontal flow. Wraps to a stacked column below the
   breakpoint where five across would crowd. */
.tr-pathway {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-pathway__stage {
  position: relative;
  flex: 1 1 9rem;
  padding: 0 var(--tr-space-3);
  text-align: center;
}

/* The connecting line, drawn behind every stage but the first. */
.tr-pathway__stage:not(:first-child)::before {
  content: "";
  position: absolute;
  top: 1.1rem;
  right: 50%;
  z-index: 0;
  width: 100%;
  height: 2px;
  background-color: var(--tr-line);
}

.tr-pathway__number {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  margin-bottom: var(--tr-space-2);
  background-color: var(--tr-green-700);
  border-radius: 50%;
  color: var(--tr-text-invert);
  font-family: var(--tr-font-display);
  font-weight: 700;
}

.tr-pathway__title {
  display: block;
  margin-bottom: var(--tr-space-1);
  font-weight: 700;
}

.tr-pathway__text {
  display: block;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
}

/* A testimonial card - the photo slot is always a placeholder (D-13). */
.tr-kailm-story {
  height: 100%;
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
  overflow: hidden;
}

.tr-kailm-story__media {
  position: relative;
}

.tr-kailm-story__media .tr-placeholder {
  border: 0;
  border-radius: 0;
}

.tr-kailm-story__chip {
  position: absolute;
  bottom: var(--tr-space-3);
  left: var(--tr-space-3);
}

.tr-kailm-story__quote {
  margin: 0;
  padding: var(--tr-space-4);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-kailm-story__quote footer {
  margin-top: var(--tr-space-2);
  color: var(--tr-text);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
}

.tr-kailm-events {
  display: flex;
  flex-direction: column;
  gap: var(--tr-space-3);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-kailm-event {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tr-space-4);
  padding: var(--tr-space-4);
  background-color: var(--tr-surface);
  border: 1px solid var(--tr-line);
  border-radius: var(--tr-radius);
  box-shadow: var(--tr-shadow-card);
}

.tr-kailm-event__date {
  display: flex;
  flex-shrink: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  background-color: var(--tr-surface-sunken);
  border-radius: var(--tr-radius-sm);
}

.tr-kailm-event__month {
  color: var(--tr-green-700);
  font-size: var(--tr-fs-xs);
  font-weight: 700;
  text-transform: uppercase;
}

.tr-kailm-event__day {
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h3);
}

.tr-kailm-event__body {
  flex: 1 1 auto;
  min-width: 12rem;
}

.tr-kailm-event__title {
  margin-bottom: var(--tr-space-1);
  font-size: var(--tr-fs-body);
}

.tr-kailm-event__location {
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-2);
  margin: 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-kailm-event__cta {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: var(--tr-space-2);
  color: var(--tr-green-700);
  font-size: var(--tr-fs-sm);
  font-weight: 600;
  text-decoration: none;
}

.tr-kailm-partners {
  display: flex;
  flex-wrap: wrap;
  gap: var(--tr-space-4);
  margin: 0;
  padding: 0;
  list-style: none;
}

.tr-kailm-partners__item {
  width: 7rem;
}

/* ==========================================================================
   Modal dialogs

   Bootstrap's own Modal component (bootstrap.bundle.min.js, already loaded
   on every page) drives open/close, the backdrop, Escape and focus - a
   native <dialog> shell was tried first and worked in every test run here,
   but not in every real browser (2026-08-12), so the whole shell moved
   onto Bootstrap's own `.modal`/`.modal-dialog`/`.modal-content` mechanics
   and its `data-bs-dismiss`/`data-bs-toggle` delegation instead of a
   hand-rolled one. `.tr-modal` only restyles `.modal-dialog`/`.modal-content`
   to match this project's tokens instead of Bootstrap's own defaults - the
   content classes below (`.tr-modal__header` etc.) are unchanged from the
   <dialog> version, since they were never about the wrapper mechanics.
   Autopen/submitting-state wiring lives in static/js/project.js; every
   converted input form (comments, profile settings, admin panel, ...)
   shares this one shell.
   ========================================================================== */

.tr-modal .modal-dialog {
  max-width: min(32rem, calc(100vw - var(--tr-space-5) * 2));
}

.tr-modal .modal-content {
  padding: 0;
  background-color: var(--tr-page);
  border: none;
  border-radius: var(--tr-radius-lg);
  box-shadow: 0 1.5rem 3rem rgb(10 31 68 / 25%);
}

.modal-backdrop.show {
  background-color: rgb(10 31 68 / 55%);
  opacity: 1;
}

.tr-modal__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--tr-space-3);
  padding: var(--tr-space-5) var(--tr-space-5) var(--tr-space-3);
  border-bottom: 1px solid var(--tr-line);
}

.tr-modal__title {
  margin: 0;
  font-family: var(--tr-font-display);
  font-size: var(--tr-fs-h3);
}

/* Optional one-line help text under the title (e.g. the Development Works
   modal) - the header's own flex layout already stacks this under
   `.tr-modal__title` for free, since both sit in the same flex item; no
   change to `.tr-modal__header` itself needed. */
.tr-modal__subtitle {
  margin: var(--tr-space-1) 0 0;
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-sm);
}

.tr-modal__close {
  flex: none;
  padding: var(--tr-space-1);
  color: var(--tr-text-muted);
  background: none;
  border: none;
  cursor: pointer;
}

.tr-modal__close:hover {
  color: var(--tr-text);
}

.tr-modal__body {
  padding: var(--tr-space-5);
}

/* The KAILM intro video sits edge-to-edge under the header, not padded like
   an ordinary form/detail body - a letterboxed video floating in whitespace
   reads as a mistake, not a design choice. */
.tr-modal__body--flush {
  padding: 0;
}

/* --------------------------------------------------------------------------
   Project detail modal

   A `.tr-modal` modifier, so it has to come after the base rule above -
   equal specificity means source order decides the tie, and a modifier
   declared earlier in the file loses its own override to the base rule
   that follows it. Wider than the default shell, since the whole point
   here is room the card never had - full-size before/after photos and
   every fact laid out, not the card's compact summary.
   -------------------------------------------------------------------------- */

.tr-modal--project .modal-dialog {
  max-width: min(48rem, calc(100vw - var(--tr-space-5) * 2));
}

/* KAILM's "Watch Introduction Video" modal - same width as the project
   detail modal above (room for a real 16:9 video, not the citizen-facing
   32rem default), plus `overflow: hidden` so the video's own square corners
   are clipped to `.modal-content`'s already-rounded ones instead of
   poking past them at the bottom edge. */
.tr-modal--video .modal-dialog {
  max-width: min(48rem, calc(100vw - var(--tr-space-5) * 2));
}

.tr-modal--video .modal-content {
  overflow: hidden;
}

.tr-modal--video video {
  display: block;
  width: 100%;
}

/* Admin form/confirm modal (base_staff.html's #admin-modal) - same reason
   as `.tr-modal--project` above, after the base rule for the same
   cascade-order reason. Wider than the citizen-facing default: a form
   like Development Works' has a dozen-plus fields, and cramming that into
   32rem (or even one column at all) read as a long document, not a form.

   `.modal-content` becomes the flex column here, capped to a share of the
   viewport height - `#admin-modal-body` (this modal's `.modal-content`,
   its only direct child) fills that and is itself a flex column of
   header / scrollarea / footer, so the header and footer stay put and
   only the middle actually scrolls. Every admin fragment template renders
   into that three-part shape (`.tr-modal__header`, `.tr-modal__scrollarea`,
   `.tr-modal__footer` - the last two usually inside a `.tr-modal__form`,
   see below) - see any `_confirm_*_fragment.html` for the shape, or
   `_form_fragment.html` for the one with real fields in it.
   -------------------------------------------------------------------------- */

.tr-modal--form .modal-dialog {
  max-width: min(48rem, calc(100vw - var(--tr-space-5) * 2));
}

/* An admin-modal fragment that needs more room than the 48rem standard
   (the tabbed Idea Review modal - project.js's own `htmx:afterSwap`
   listener toggles this on `#admin-modal` when the freshly-swapped
   fragment carries `data-modal-size="lg"`, off again for the next fragment
   that doesn't). Declared *after* `.tr-modal--form .modal-dialog`/
   `.modal-content` above on purpose: `#admin-modal` carries both classes
   at once while this is active, and with equal specificity (two classes
   each) the later rule in the cascade wins - ordinary CSS behaviour, not
   a hack, just worth calling out since it's load-bearing here.
   `.tr-modal--form`'s other rules (the header/scrollarea/footer flex
   shape) keep applying regardless - only the width and the height rule
   below are overridden. */
.tr-modal--lg .modal-dialog {
  max-width: min(60rem, calc(100vw - var(--tr-space-5) * 2));
}

/* `.tr-modal--form .modal-content` only caps height (`max-height`), so it
   shrink-wraps to content - fine for a form or a confirm dialog, but this
   fragment's content is tabbed: Bootstrap's tab-panes are `display: none`
   until `.show.active`, so `.tab-content`'s rendered height is only ever
   the *current* tab's height. With just a cap, switching from a short tab
   (Summary) to a long one (a filled narrative section) shrinks/grows the
   whole dialog and - since `#admin-modal` uses `modal-dialog-centered` -
   visibly re-centres it too, not just resizes it. A real `height` instead
   of a cap fixes the box at one size regardless of which tab is active;
   `.tr-modal__scrollarea`'s existing `flex: 1 1 auto; overflow-y: auto`
   (main.css, "Modal dialogs") then fills whatever the header/footer leave
   over and scrolls internally for a tall tab, same `min(90vh, 44rem)`
   ceiling as before so this still can't overflow the viewport. */
.tr-modal--lg .modal-content {
  height: min(90vh, 44rem);
}

.tr-modal--form .modal-content {
  max-height: min(90vh, 44rem);
  display: flex;
  flex-direction: column;
}

.tr-modal--form .tr-modal__header {
  flex: none;
}

/* `#admin-modal-body` (base_staff.html) is this modal's `.modal-content`
   itself, not a separate `.tr-modal__body` wrapper inside it - htmx swaps
   fragments straight into `.modal-content`, so `.tr-modal--form
   .modal-content` above already gives it the flex column + `padding: 0`
   that `.tr-modal__body` would otherwise supply; nothing extra needed
   here for it. */

/* A `<form>` wrapping the scrollarea+footer pair needs to do its own
   header/footer-vs-scroll split too - a flex column of its own, not
   `display: contents` (real cross-browser inconsistencies with clicks and
   form controls inside a `display: contents` ancestor - not worth the
   risk here). Same `flex`/`min-height` shape as `.modal-content` above it
   for exactly the same reason: it fills whatever space `.modal-content`
   has left after the header, and its own children
   (`.tr-modal__scrollarea`/`.tr-modal__footer`) behave identically
   whether their parent is this `<form>` or `.modal-content` directly
   (the read-only fragments - status history, permission denied - have no
   form at all, so those two sit straight under `.modal-content`).

   Deliberately no `overflow: hidden` here (or on `.tr-modal__body` above)
   - `.tr-modal__scrollarea`'s own `overflow-y: auto` already does the
   actual clipping/scrolling, so this was only ever a cosmetic
   corner-rounding safety net, never load-bearing for the scroll
   behaviour. Not worth the risk of an ancestor `overflow` value
   interfering with hit-testing on the footer buttons that sit flush
   against this box's own edge. */
.tr-modal__form {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.tr-modal__scrollarea {
  flex: 1 1 auto;
  min-height: 0;
  padding: var(--tr-space-5);
  overflow-y: auto;
}

.tr-modal__footer {
  flex: none;
  display: flex;
  justify-content: flex-end;
  gap: var(--tr-space-3);
  padding: var(--tr-space-4) var(--tr-space-5);
  border-top: 1px solid var(--tr-line);
}

/* A small label above a group of related fields (Before/After Image) -
   deliberately quieter than `.tr-staffcard__title`, which is a whole
   section's heading elsewhere in the staff panel, not a field-group tag
   inside one form. */
.tr-modal__section-heading {
  margin: var(--tr-space-2) 0 var(--tr-space-1);
  padding-top: var(--tr-space-3);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: var(--tr-tracking-caps);
  text-transform: uppercase;
  border-top: 1px solid var(--tr-line);
}

/* `auto-fit`/`minmax()`, not a hard `1fr 1fr` - a fixed two-up split gave a
   big, detailed photo only half the modal's width to render in, and on a
   narrow modal (a small phone, or the dialog's own min() clamp above) that
   shrank to a sliver too small to actually see the photo in. This keeps two
   columns wherever there is room for both to read properly and drops to one
   full-width column - each photo still full size, just stacked - the moment
   there is not, with no media query needed. */
.tr-project-detail__media {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  gap: var(--tr-space-3);
  margin-bottom: var(--tr-space-4);
}

.tr-project-detail__shot {
  position: relative;
  /* A grid item's automatic minimum width is its content's own intrinsic
     size by default - for an <img> with large `width`/`height` attributes
     (a big uploaded photo), that can be wider than the track auto-fit just
     computed, pushing the grid past the modal's own width. Zeroing it lets
     `width: 100%` on the image below actually win. */
  min-width: 0;
  /* Belt-and-suspenders alongside the fixed height below: whatever the
     image ends up computing to, this box can never show more of it than
     its own bounds, full stop. */
  overflow: hidden;
  border-radius: var(--tr-radius);
}

.tr-project-detail__shot img,
.tr-project-detail__shot .tr-placeholder {
  display: block;
  width: 100%;
  /* A fixed height, not `aspect-ratio` - a very large uploaded photo (or a
     browser that resolves `aspect-ratio` against a percentage width late,
     inside a native <dialog>'s own layout pass) could otherwise render at
     its towering natural height for a frame before the box catches up.
     `clamp()` per this file's own convention: taller on wide modals,
     never so short that `object-fit: cover` has nothing to work with. */
  height: clamp(12rem, 10rem + 10vw, 20rem);
  object-fit: cover;
}

.tr-project-detail__tag {
  position: absolute;
  bottom: var(--tr-space-2);
  left: var(--tr-space-2);
  padding: 0.1rem var(--tr-space-2);
  background-color: rgb(10 31 68 / 72%);
  border-radius: var(--tr-radius-sm);
  color: var(--tr-text-invert);
  font-size: var(--tr-fs-xs);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tr-project-detail__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--tr-space-3);
  margin-bottom: var(--tr-space-3);
}

.tr-project-detail__summary {
  margin-bottom: var(--tr-space-4);
  color: var(--tr-text);
}

.tr-project-detail__description {
  margin-bottom: var(--tr-space-4);
  color: var(--tr-text-muted);
  line-height: var(--tr-lh-body);
}

.tr-project-detail__facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr));
  gap: var(--tr-space-4);
  padding-top: var(--tr-space-4);
  border-top: 1px solid var(--tr-line);
}

.tr-project-detail__fact dt {
  margin-bottom: var(--tr-space-1);
  color: var(--tr-text-muted);
  font-size: var(--tr-fs-xs);
  letter-spacing: var(--tr-tracking-caps);
  text-transform: uppercase;
}

.tr-project-detail__fact dd {
  margin: 0;
  font-weight: 600;
}
