/* data.railsnaps.com: shared look. Tokens and components lifted from the "Open data" page of the
   Rail Snaps UI kit canvas, which this file now replaces as the reference (crates/opendata/README.md
   "Look"). Page-only rules go in css/pages/<page>.css, not here. */

@font-face { font-family: 'Big Shoulders Display'; font-weight: 900; font-display: swap; src: url(/assets/fonts/BigShouldersDisplay_900Black.ttf) format('truetype'); }
@font-face { font-family: 'Nunito'; font-weight: 700; font-display: swap; src: url(/assets/fonts/Nunito_700Bold.ttf) format('truetype'); }
@font-face { font-family: 'Nunito'; font-weight: 800; font-display: swap; src: url(/assets/fonts/Nunito_800ExtraBold.ttf) format('truetype'); }
@font-face { font-family: 'Nunito'; font-weight: 900; font-display: swap; src: url(/assets/fonts/Nunito_900Black.ttf) format('truetype'); }
@font-face { font-family: 'DotGothic16'; font-weight: 400; font-display: swap; src: url(/assets/fonts/DotGothic16_400Regular.ttf) format('truetype'); }

:root {
  --ink: #1A2436;         /* text, rims, dark panels */
  --ink-deep: #0A111D;    /* lips under dark things, header rule */
  --navy: #0E1726;        /* page heroes */
  --navy-2: #16233A;      /* control strips on navy */
  --navy-3: #1E2F4D;      /* secondary buttons on navy */
  --rim: #2A3D5E;         /* rims on navy, BEING CHECKED */
  --rim-2: #4A5E80;       /* softer rims on navy */
  --paper: #F3EAD7;       /* page */
  --panel: #FFFBF2;       /* raised panels on paper */
  --band: #E4D9C2;        /* bands (corrections), row rules, PLANNED */
  --line: #D8CCB2;        /* section rules */
  --stone: #B9AC92;       /* USUALLY rims, quiet rims */
  --muted: #5C5242;       /* labels on paper */
  --body-2: #3D4555;      /* secondary text on paper */
  --muted-ink: #A9B6C8;   /* labels on ink */
  --lede: #C9D3E0;        /* hero text on navy */
  --orange: #FF6B3D;      /* one main action per page, nothing else */
  --orange-lip: #A33A17;  /* its lip; RETRACTED */
  --gilt: #E2B04C;        /* current nav item */
  --amber: #FFB23D;       /* headcodes on navy */
  --teal: #3FC1C9;
  --link-hover: #C2471F;
  --display: 'Big Shoulders Display', Impact, sans-serif;
  --dots: 'DotGothic16', ui-monospace, monospace;
  --sans: Nunito, system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-weight: 700; }
a { color: var(--ink); }
a:hover { color: var(--link-hover); }
button, input, select, textarea { font-family: inherit; }
img, svg { max-width: 100%; }
.art { display: block; width: 100%; height: auto; }   /* a train drawing (the drawing macro) */
svg.art--none { max-width: 420px; }   /* the outline standing in for a missing drawing stays modest */

/* Type */
.d { font-family: var(--display); font-weight: 900; }
.b { font-family: var(--dots); font-weight: 400; }   /* headcodes, numbers on boards */
.title { margin: 0; font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: 0.95; font-size: clamp(44px, 6vw, 68px); }  /* list pages */
.title--record { font-size: clamp(52px, 7vw, 80px); line-height: 0.9; }    /* class, station, operator */
.title--number { font-size: clamp(56px, 8vw, 96px); line-height: 0.88; text-transform: none; }  /* loco, unit */
.lede { margin: 0; font-size: 18px; font-weight: 700; line-height: 1.45; color: var(--lede); max-width: 680px; }
.sh { margin: 0; font-family: var(--display); font-weight: 900; text-transform: uppercase; line-height: 1; }  /* section heading */
.sh--xl { font-size: 36px; } .sh--l { font-size: 32px; } .sh--m { font-size: 28px; } .sh--s { font-size: 26px; }
.label { font-size: 13px; font-weight: 900; color: var(--muted); }
.muted { color: var(--muted); } .body-2 { color: var(--body-2); }
.small { font-size: 13px; font-weight: 700; } .strong { font-weight: 900; }

/* Layout */
.wrap { max-width: 1240px; margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.section { padding-top: 32px; padding-bottom: 32px; }
.section--rule { border-bottom: 2px solid var(--line); }
.stack { display: flex; flex-direction: column; gap: 14px; }
.row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.heading-row { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 16px; }
.heading-row > .sh { flex: 1 1 auto; }
.heading-row .aside { font-size: 15px; font-weight: 800; color: var(--muted); }
.split { display: flex; flex-wrap: wrap; gap: 28px; align-items: flex-start; }
.split > .main { flex: 1.6 1 520px; min-width: 0; }
.split > .side { flex: 1 1 340px; min-width: 0; display: flex; flex-direction: column; gap: 16px; }
.grid-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 16px; }

/* Header and footer */
.site-header { background: var(--ink); color: var(--paper); border-bottom: 4px solid var(--ink-deep); }
.site-header .wrap { padding-top: 14px; padding-bottom: 14px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px 28px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--paper); }
.brand:hover { color: var(--paper); }
.brand .name { font-family: var(--display); font-size: 26px; font-weight: 900; letter-spacing: 0.02em; }
.brand .plate { font-family: var(--display); font-size: 18px; font-weight: 900; background: var(--paper); color: var(--ink); border-radius: 6px; padding: 1px 8px; box-shadow: 0 3px 0 var(--ink-deep); }
.site-nav { display: flex; flex-wrap: wrap; gap: 4px 20px; flex: 1; font-size: 15px; font-weight: 800; }
.site-nav a { color: var(--paper); text-decoration: none; }
.site-nav a[aria-current="page"] { box-shadow: inset 0 -3px 0 var(--gilt); padding-bottom: 4px; }
.play { height: 40px; padding: 0 16px; border-radius: 12px; border: 2px solid var(--paper); color: var(--paper); display: inline-flex; align-items: center; font-size: 14px; font-weight: 900; text-decoration: none; }
.play:hover { color: var(--paper); background: var(--navy-3); }
.icon-btn { width: 44px; height: 44px; border-radius: 12px; border: 2px solid var(--rim); background: var(--navy-3); box-shadow: 0 3px 0 #050A12; color: var(--paper); display: flex; align-items: center; justify-content: center; cursor: pointer; list-style: none; }
.icon-btn::-webkit-details-marker { display: none; }
.icon-btn:hover { color: var(--paper); }
.phone-only { display: none; }
.menu { position: relative; }
.menu[open] > .icon-btn { box-shadow: none; transform: translateY(3px); }
.menu nav { position: absolute; right: 0; top: 54px; z-index: 10; min-width: 220px; display: flex; flex-direction: column; background: var(--ink); border: 2px solid var(--ink-deep); border-radius: 14px; box-shadow: 0 5px 0 var(--ink-deep); padding: 6px; }
.menu nav a { color: var(--paper); text-decoration: none; font-size: 16px; font-weight: 900; padding: 12px 14px; border-radius: 10px; }
.menu nav a[aria-current="page"] { box-shadow: inset 4px 0 0 var(--gilt); }
.site-footer { background: var(--ink); color: var(--lede); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 16px 40px; font-size: 14px; font-weight: 700; line-height: 1.5; }
.site-footer .credits { flex: 2 1 420px; display: flex; flex-direction: column; gap: 6px; }
.site-footer nav { flex: 1 1 200px; display: flex; flex-wrap: wrap; gap: 6px 18px; font-weight: 900; }
.site-footer a { color: var(--paper); }

/* Heroes: the navy band at the top of most pages */
.hero { background: var(--navy); color: var(--paper); }
.hero .wrap { padding-top: 36px; padding-bottom: 28px; display: flex; flex-wrap: wrap; gap: 20px 32px; align-items: flex-end; }
.hero .intro { flex: 1 1 420px; display: flex; flex-direction: column; gap: 10px; }
.hero a:not(.btn) { color: var(--paper); }
.crumbs { font-size: 14px; font-weight: 800; color: var(--muted-ink); display: flex; flex-wrap: wrap; gap: 8px; }
.crumbs a { color: var(--muted-ink); }
.hero .facts-line { margin: 0; font-size: 18px; font-weight: 800; color: var(--lede); }
.headcode { color: var(--amber); }
/* A working's or headcode's title (working.html, headcode.html): the headcode as the train shows it, then its ends */
.working-title { margin: 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 18px; }
.working-title .headcode { font-family: var(--dots); font-weight: 400; font-size: clamp(56px, 8vw, 88px); line-height: 0.95; }
.working-title .route { font-size: clamp(30px, 4vw, 44px); line-height: 1; font-weight: 900; text-transform: uppercase; }
@media (max-width: 520px) {
  .working-title { flex-direction: column; gap: 4px; }
  .working-title .headcode { font-size: 64px; }
  .working-title .route { font-size: 34px; }
}

/* Panels: raised paper, or ink on paper */
.panel { background: var(--panel); border: 2px solid var(--ink); border-radius: 18px; box-shadow: 0 5px 0 var(--ink); }
.panel--ink { background: var(--ink); color: var(--paper); border-color: var(--ink-deep); box-shadow: 0 5px 0 var(--ink-deep); }
.panel--ink a:not(.btn) { color: var(--paper); }
.panel--ink .label, .panel--ink .muted { color: var(--muted-ink); }
.panel--code { background: #070C15; color: #E4ECF7; border-color: var(--rim); box-shadow: 0 5px 0 #03060B; overflow: hidden; }
.panel--pad { padding: 18px 20px; display: flex; flex-direction: column; gap: 12px; }
.panel--scroll { overflow-x: auto; }
.card { background: var(--panel); border: 2px solid var(--ink); border-radius: 16px; box-shadow: 0 4px 0 var(--ink); padding: 14px 16px; }
a.card { display: block; text-decoration: none; }
.band { background: var(--band); }

/* Buttons. .btn--primary is the page's one orange action. */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; text-decoration: none; cursor: pointer; white-space: nowrap; }
.btn--primary { height: 52px; padding: 0 22px; border-radius: 14px; border: 2px solid var(--ink-deep); background: var(--orange); color: var(--ink); font-size: 16px; box-shadow: 0 5px 0 var(--orange-lip); }
.btn--primary:hover { color: var(--ink); }
.btn--navy { height: 52px; padding: 0 20px; border-radius: 14px; border: 2px solid var(--rim-2); background: var(--navy-3); color: var(--paper); font-size: 15px; box-shadow: 0 5px 0 #050A12; }
.btn--navy:hover { color: var(--paper); }
.btn--paper { height: 48px; padding: 0 18px; border-radius: 12px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); font-size: 15px; box-shadow: 0 4px 0 var(--ink); }
.btn--ink { height: 52px; padding: 0 24px; border-radius: 14px; border: 2px solid var(--ink-deep); background: var(--ink); color: var(--paper); font-size: 16px; box-shadow: 0 5px 0 var(--ink-deep); }
.btn--ink:hover { color: var(--paper); }
.btn--later { height: 52px; padding: 0 16px; border-radius: 14px; border: 2px dashed var(--rim-2); color: var(--muted-ink); font-size: 15px; cursor: default; }
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; }

/* Tags: how sure a fact is, and what kind of change it was. Use the tag() macro. */
.tag { height: 24px; padding: 0 8px; border-radius: 7px; font-size: 11px; font-weight: 900; letter-spacing: 0.08em; display: inline-flex; align-items: center; white-space: nowrap; flex: none; border: 2px solid; }
.tag--confirmed  { background: var(--ink); color: var(--paper); border-color: var(--ink); }            /* SEEN */
.tag--deduced    { background: var(--paper); color: var(--ink); border: 2px dashed var(--ink); }       /* WORKED OUT */
.tag--usual      { background: transparent; color: var(--muted); border-color: var(--stone); }         /* USUALLY */
.tag--planned    { background: var(--band); color: var(--muted); border-color: var(--stone); }         /* PLANNED */
.tag--checking   { background: var(--rim); color: var(--paper); border-color: var(--rim); }            /* BEING CHECKED */
.tag--corrected  { background: var(--panel); color: var(--ink); border-color: var(--ink); }
.tag--retracted  { background: var(--panel); color: var(--orange-lip); border-color: var(--orange-lip); }
.tag--renumbered { background: var(--band); color: var(--ink); border-color: var(--ink); }
.tag--fleet      { background: var(--band); color: var(--muted); border-color: var(--stone); }
.tag--source     { background: transparent; color: var(--muted); border-color: var(--stone); }
.tag--later      { background: var(--rim); color: var(--paper); border-color: var(--rim); }
.tag--none       { background: transparent; color: var(--muted); border: 2px dashed var(--stone); }   /* not known, did not run */
/* On ink and navy, SEEN turns paper so it still reads as the solid one. */
.panel--ink .tag--confirmed, .hero .tag--confirmed { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.panel--ink .tag--deduced, .hero .tag--deduced { background: transparent; color: var(--paper); border-color: var(--paper); }

/* Tables inside a .panel */
.table { width: 100%; border-collapse: collapse; font-size: 15px; }
.table th { text-align: left; font-size: 13px; font-weight: 900; color: var(--muted); padding: 12px 8px; }
.table td { padding: 11px 8px; font-weight: 700; color: var(--body-2); }
.table tbody tr { border-top: 2px solid var(--band); }
.table th:first-child, .table td:first-child { padding-left: 16px; }
.table th:last-child, .table td:last-child { padding-right: 16px; }
.table .num { text-align: right; white-space: nowrap; }
.table td.strong, .table td .strong { color: var(--ink); }

/* Facts: a definition list of field, value and how we know */
.facts { margin: 0; display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; font-size: 15px; }
.facts dt { font-weight: 800; color: var(--muted); }
.facts dd { margin: 0; display: flex; flex-direction: column; }
.facts dd .v { font-weight: 900; color: var(--ink); }
.facts dd .when { font-size: 13px; font-weight: 700; color: var(--muted); }
.panel--ink .facts dt, .panel--ink .facts dd .when { color: var(--muted-ink); }
.panel--ink .facts dd .v { color: var(--paper); }

/* Change history: the change_list() macro */
.changes { margin: 0; padding: 0; list-style: none; overflow: hidden; }
.changes li { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; padding: 14px 16px; }
.changes li + li { border-top: 2px solid var(--band); }
.changes .day { font-size: 15px; font-weight: 900; width: 96px; flex: none; }
.changes .text { flex: 1 1 320px; display: flex; flex-direction: column; gap: 2px; }
.changes .what { font-size: 15px; font-weight: 900; }
.changes .why { font-size: 14px; font-weight: 700; line-height: 1.45; color: var(--body-2); }

/* Forms */
.field { display: flex; flex-direction: column; gap: 6px; flex: 1 1 180px; }
.field label, .field .label-text { font-size: 14px; font-weight: 900; }
.input { height: 48px; border-radius: 12px; border: 2px solid var(--ink); background: var(--panel); color: var(--ink); padding: 0 12px; font-size: 16px; font-weight: 800; width: 100%; }
textarea.input { height: auto; min-height: 96px; padding: 10px 12px; line-height: 1.4; }
.hero .input, .panel--ink .input { border-color: var(--rim-2); background: var(--paper); }
.form { display: flex; flex-direction: column; gap: 14px; }
.form-note { font-size: 13px; font-weight: 700; color: var(--muted); }

/* Filter chips (Classes, Locos, Class pages) */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { height: 40px; padding: 0 14px; border-radius: 12px; border: 2px solid var(--ink); background: var(--panel); color: var(--ink); font-size: 14px; font-weight: 900; display: inline-flex; align-items: center; gap: 6px; text-decoration: none; cursor: pointer; }
.chip[aria-pressed="true"], .chip[aria-current="true"] { background: var(--ink); color: var(--paper); box-shadow: 0 3px 0 var(--ink-deep); }

/* Bars in "Fleets" and "Locos this month" panels: width set inline as a percentage */
.bar { height: 16px; border-radius: 5px; background: var(--ink-deep); display: block; overflow: hidden; }
.bar > span { display: block; height: 100%; border-radius: 5px; background: var(--teal); }
.panel .bar:not(.panel--ink .bar) { background: var(--band); }

/* Livery swatch: two colours, set inline */
.swatch { width: 18px; height: 18px; border-radius: 5px; border: 2px solid var(--ink); flex: none; display: inline-block; }

/* Promoted from page CSS (several pages had their own copy) */
.nowrap { white-space: nowrap; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.body-text { margin: 0; font-size: 16px; font-weight: 700; line-height: 1.5; color: var(--body-2); }
.steps { margin: 0; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; font-size: 15px; font-weight: 700; line-height: 1.45; color: var(--lede); }
.note-band { background: var(--band); border-radius: 18px; padding: 18px 20px; display: flex; flex-direction: column; gap: 8px; }
/* Chips on navy (hero filters): off is navy, current is paper pressed in. */
.hero .chip { background: var(--navy-3); color: var(--paper); border-color: var(--rim-2); box-shadow: 0 3px 0 #050A12; }
.hero .chip:hover { color: var(--paper); }
.hero .chip[aria-current="true"], .hero .chip[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); box-shadow: none; transform: translateY(3px); }
.chip .n { min-width: 24px; height: 24px; padding: 0 6px; border-radius: 7px; background: var(--ink-deep); color: var(--paper); font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }
/* The navy filter strip under a hero title (Classes, Map) */
.filters { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 12px 18px; padding: 14px 16px; background: var(--navy-2); border: 2px solid var(--rim); border-radius: 18px; box-shadow: 0 4px 0 #050A12; }
.filters .field label, .filters .label-text { font-size: 13px; color: var(--muted-ink); }
/* A strip of days, one cell per day (loco and unit: the last 30 days) */
.days { display: grid; grid-template-columns: repeat(30, minmax(0, 1fr)); gap: 4px; }
.days > span { height: 40px; border-radius: 6px; border: 2px solid; }
.days .day--confirmed, .days .cell--confirmed { background: var(--ink); border-color: var(--ink); }
.days .day--deduced, .days .cell--deduced { background: var(--paper); border: 2px dashed var(--ink); }
.days .day--planned, .days .cell--planned { background: var(--band); border-color: var(--stone); }
.days .day--none, .days .cell--none { background: var(--band); border-color: var(--band); }
.days-ends { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; font-size: 13px; font-weight: 800; color: var(--muted); }

@media (max-width: 720px) {
  .site-header .wrap { flex-wrap: nowrap; height: 64px; padding-top: 0; padding-bottom: 0; gap: 10px; }
  .brand { flex: 1; }
  .brand .name { font-size: 24px; }
  .brand .plate { font-size: 16px; padding: 1px 7px; }
  .site-nav, .play { display: none; }
  .phone-only { display: flex; }
  .site-header .wrap { padding-left: 16px; padding-right: 16px; }
}

/* Forms are columns; a field's row basis must not become its height there. */
.form > .field { flex: none; }

@media (max-width: 520px) {
  .changes .day { width: auto; }
  .hero .wrap { padding-top: 24px; }
}
