/* Content pages (programme, equipment, shuttle, guide): the link hub's navy and cream on a readable paper field. */

.page {
  --page-bg: #f6f0e6;
  --surface: #fffdf8;
  --surface-2: #efe5d6;
  --ink: var(--navy);
  --ink-2: #3a3860;
  --muted: #625e72;
  --line: #e2d6c4;
  /* Small text and filled buttons on paper: 5.8:1 (the lighter #0b86c2 was 4.0:1). */
  --accent: #086a9c;
  --amber-ink: #9a4b0b;
  --amber-soft: #fbe9d6;
  --ok: #19744a;
  --ok-soft: #e0f1e7;
  --no: #a23a2c;
  --no-soft: #f7e2de;
  --page-width: 760px;
  background: var(--page-bg);
  color: var(--ink);
}

.page::before {
  content: none;
}

html:has(body.page) {
  background: #f6f0e6;
}

/* Component display rules must never override the hidden attribute the scripts toggle. */
.page [hidden] {
  display: none !important;
}

/* The link hub frames <main> as a phone-width navy card; content pages use the full reading column. */
body.page {
  padding: 0;
}

.page main.page-main {
  overflow: visible;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.page a {
  color: inherit;
}

/* Barlow has no Arabic script: keep Arabic and Persian headings upright instead of a synthetic oblique. */
:is(:lang(ar), :lang(fa)) :is(.page-head h1, .day-title, .gear-name, .notice-title, .line-head h3, .guide-section h2, .guide-docs h2, .page-back, .race-all-mark, .rich h3) {
  font-style: normal;
  letter-spacing: 0;
}

/* ---------- Top bar ---------- */

.page-bar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 6px max(12px, env(safe-area-inset-right)) 6px max(12px, env(safe-area-inset-left));
  background: var(--navy);
  color: var(--paper);
  box-shadow: 0 6px 18px -12px rgba(8, 6, 50, .6);
}

.page-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  justify-self: start;
  min-height: 44px;
  padding-inline-end: 8px;
  font-family: var(--display);
  font-size: .92rem;
  font-style: italic;
  font-weight: 800;
  letter-spacing: .02em;
  text-decoration: none;
  text-transform: uppercase;
}

.page-back .icon {
  width: 20px;
  height: 20px;
  stroke-width: 2.6;
}

[dir="rtl"] .page-back .icon {
  transform: scaleX(-1);
}

.page-logo img {
  width: 40px;
  height: auto;
  filter: invert(1) grayscale(1) brightness(4);
}

.page-bar .language-switcher {
  position: static;
  justify-self: end;
}

.page-bar .language-menu {
  right: 0;
}

/* ---------- Page head ---------- */

.page-main {
  width: min(100%, var(--page-width));
  margin-inline: auto;
  padding: 28px 16px 48px;
}

.page-shuttle {
  --page-width: 1040px;
}

.page-head {
  container-type: inline-size;
  display: grid;
  gap: 10px;
  margin-bottom: 22px;
}

.page-head h1 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.1rem, 8vw, 3.1rem);
  font-style: italic;
  font-weight: 800;
  line-height: .95;
  letter-spacing: -.01em;
  text-transform: uppercase;
  text-wrap: balance;
}

/* Long words shrink to fit the column instead of breaking (see .fit-N in site.css). */
.page-head h1[class*="fit-"] {
  font-size: max(1.5rem, min(clamp(2.1rem, 8vw, 3.1rem), calc(100cqi / var(--fit))));
  hyphens: auto;
}

.page-intro {
  max-width: 62ch;
  margin: 0;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.55;
}

.tool-button {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 700 .9rem/1 var(--display);
  letter-spacing: .02em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 160ms ease, border-color 160ms ease;
}

.tool-button .icon {
  width: 18px;
  height: 18px;
}

.tool-button.is-primary {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--paper);
}

.link-button {
  min-height: 36px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 .9rem/1 inherit;
  text-decoration: underline;
  text-underline-offset: .2em;
  cursor: pointer;
}

@media (hover: hover) and (pointer: fine) {
  .tool-button:hover {
    border-color: var(--navy);
  }
}

:where(.page button, .page a, .page select, .page input, .page summary):focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

/* ---------- Notices ---------- */

.notice {
  display: grid;
  gap: 6px;
  margin: 0 0 16px;
  padding: 14px 16px;
  border-radius: 12px;
  background: #e4f1f8;
  color: var(--ink);
}

.notice-warning {
  background: var(--amber-soft);
}

.notice-title {
  font-family: var(--display);
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
}

.notice-phone {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--navy);
  color: var(--paper) !important;
  font: 800 1.05rem/1 var(--display);
  letter-spacing: .03em;
  text-decoration: none;
}

.notice-phone .icon {
  width: 18px;
  height: 18px;
}

.rich p,
.rich ul {
  margin: 0 0 .7em;
}

.rich > :last-child {
  margin-bottom: 0;
}

.rich ul {
  padding-inline-start: 1.2em;
}

.rich h3 {
  margin: 1em 0 .4em;
  font-family: var(--display);
  font-size: 1.1rem;
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
}

.rich a {
  color: var(--accent);
  font-weight: 600;
}

.rich-table {
  overflow-x: auto;
  margin: 0 0 .8em;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.rich-table table,
.board-table,
.lines-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
}

.rich-table th,
.rich-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

.rich-table th {
  background: var(--surface-2);
  font: 700 .8rem/1.2 var(--display);
  letter-spacing: .05em;
  text-transform: uppercase;
}

/* ---------- Course colours ---------- */

.course-chip,
.course-code {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 7px;
  border-radius: 6px;
  background: var(--course, var(--navy));
  color: var(--course-ink, #fff);
  font: 800 .72rem/1 var(--display);
  letter-spacing: .04em;
}

.course-emblem {
  width: 36px;
  height: 36px;
  object-fit: contain;
}

/* ---------- Programme ---------- */

.day-tabs::-webkit-scrollbar,
.picker-options::-webkit-scrollbar,
.shuttle-tabs::-webkit-scrollbar {
  display: none;
}

.day-tabs {
  position: sticky;
  top: 56px;
  z-index: 10;
  display: flex;
  gap: 6px;
  margin: 6px -16px 10px;
  padding: 10px 16px;
  overflow-x: auto;
  background: var(--page-bg);
  scrollbar-width: none;
}

.day-tab {
  flex: 1 0 auto;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  font: 800 .95rem/1 var(--display);
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
}

.day-tab {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 2px;
  min-height: 54px;
}

.tab-dow {
  font-size: .72rem;
  letter-spacing: .08em;
  opacity: .75;
}

.tab-date {
  font-size: 1.35rem;
  line-height: 1;
}

.day-tab[aria-pressed="true"] {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--paper);
}

.program-day + .program-day {
  margin-top: 26px;
}

.day-title {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
}

.program.has-tabs .day-title {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.entries {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.entry {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 1px 0 rgba(8, 6, 50, .05), 0 4px 14px -10px rgba(8, 6, 50, .35);
}

.entry-time {
  display: grid;
  gap: 2px;
  padding-top: 2px;
  font-family: var(--display);
  font-variant-numeric: tabular-nums;
}

.entry-time time {
  font-size: 1.25rem;
  font-weight: 800;
  line-height: 1;
}

.entry-end {
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.entry-end::before {
  content: "– ";
}

.entry-body {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.entry-flags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
}

.entry-flags:not(:has(.flag:not([hidden]))) {
  display: none;
}

.flag {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 6px;
  font: 800 .68rem/1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.flag-now {
  background: var(--ok);
  color: #fff;
}

.flag-next {
  background: var(--accent);
  color: #fff;
}

.flag-kind {
  background: var(--surface-2);
  color: var(--ink);
}

.entry-title {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

.entry-note {
  margin: 0;
  color: var(--muted);
  font-size: .88rem;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  margin-top: 2px;
}

.entry-emblems,
.entry-courses {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.entry-place {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 32px;
  color: var(--accent) !important;
  font-size: .88rem;
  font-weight: 600;
  text-decoration: none;
}

.entry-place .icon {
  width: 16px;
  height: 16px;
  flex: none;
}

/* Starts read as the day's anchors: race-navy card, white type, course emblems. */
.entry.hl-start {
  background: var(--navy);
  color: var(--paper);
}

.entry.hl-start .entry-end,
.entry.hl-start .entry-note {
  color: #c9c7e0 !important;
}

.entry.hl-start .entry-place {
  color: #7fd3f5 !important;
}

.entry.hl-start .flag-kind {
  background: var(--cyan);
  color: var(--navy);
}

.entry.hl-start .course-emblem {
  width: 40px;
  height: 40px;
}

.entry.hl-ceremony {
  background: #fff4e0;
}

.entry.hl-ceremony .flag-kind {
  background: #e8b04a;
  color: var(--navy);
}

.entry.hl-cutoff .flag-kind {
  background: var(--amber-soft);
  color: var(--amber-ink);
}

.entry.is-now {
  box-shadow: 0 0 0 2px var(--ok), 0 6px 18px -10px rgba(8, 6, 50, .45);
}

.entry.is-past {
  opacity: .55;
}

.entry[hidden] {
  display: none;
}

.empty-note {
  padding: 24px 0;
  color: var(--muted);
  text-align: center;
}

/* ---------- Equipment ---------- */

.race-picker {
  margin-bottom: 12px;
}

.picker-label {
  margin: 0 0 6px;
  color: var(--muted);
  font: 700 .8rem/1 var(--display);
  letter-spacing: .08em;
  text-transform: uppercase;
}

.picker-options {
  display: flex;
  gap: 6px;
  margin: 0 -16px;
  padding: 2px 16px;
  overflow-x: auto;
  scrollbar-width: none;
}

.race-option {
  display: inline-flex;
  flex: none;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 12px 0 6px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: 800 .85rem/1 var(--display);
  letter-spacing: .04em;
  cursor: pointer;
}

.race-option .course-emblem {
  width: 32px;
  height: 32px;
}

.race-option.race-all {
  padding-inline: 14px;
}

.race-option[aria-pressed="true"] {
  border-color: var(--course, var(--navy));
  background: var(--course, var(--navy));
  color: #fff;
}

.race-all-mark {
  text-transform: uppercase;
}

.checklist-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
  margin-bottom: 10px;
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--navy);
  color: var(--paper);
}

.checklist-status p {
  margin: 0;
}

.checklist-status strong {
  font: 800 1.3rem/1 var(--display);
}

.checklist-status .link-button {
  color: #7fd3f5;
}

.checklist-hint {
  flex-basis: 100%;
  color: #c9c7e0;
  font-size: .82rem;
}

.gear-list {
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}

.gear-row {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 4px 14px -10px rgba(8, 6, 50, .35);
}

/* The native box stays focusable for keyboards and screen readers; the round tick shows its state. */
.gear-row {
  position: relative;
}

.gear-check {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.gear-row:has(.gear-check:focus-visible) {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.gear-photo {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border-radius: 12px;
  background: #f1e8da;
}

.gear-photo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

.gear-photo .icon {
  width: 30px;
  height: 30px;
  color: var(--muted);
}

.gear-text {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.gear-name {
  font-family: var(--display);
  font-size: 1.05rem;
  font-style: italic;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

.gear-note {
  color: var(--muted);
  font-size: .88rem;
}

.gear-courses {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.gear-tick {
  display: none;
  place-items: center;
  width: 32px;
  height: 32px;
  border: 2px solid var(--line);
  border-radius: 50%;
  color: transparent;
}

.gear-tick .icon {
  width: 18px;
  height: 18px;
  stroke-width: 3;
}

.equipment.is-checklist .gear-row {
  cursor: pointer;
}

.equipment.is-checklist .gear-tick {
  display: grid;
}

.equipment.is-checklist .gear-courses {
  display: none;
}

.gear-check:checked ~ .gear-tick {
  border-color: var(--ok);
  background: var(--ok);
  color: #fff;
}

.gear:has(.gear-check:checked) .gear-row {
  background: var(--ok-soft);
}

.gear[hidden] {
  display: none;
}

/* ---------- Guide ---------- */

.guide-docs ul {
  display: grid;
  gap: 8px;
  margin: 0 0 22px;
  padding: 0;
  list-style: none;
}

.guide-docs h2,
.guide-section h2 {
  margin: 0 0 10px;
  font-family: var(--display);
  font-size: 1.35rem;
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
}

.doc-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  min-height: 64px;
  padding: 10px 14px;
  border-radius: 14px;
  background: var(--navy);
  color: var(--paper) !important;
  text-decoration: none;
}

.doc-card .icon {
  width: 24px;
  height: 24px;
}

.doc-text {
  display: grid;
  gap: 2px;
}

.doc-text small {
  color: #c9c7e0;
  letter-spacing: .06em;
}

.guide-h2 {
  margin: 0 0 12px;
  font-family: var(--display);
  font-size: 1.4rem;
  font-style: italic;
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

.guide-block {
  margin-top: 34px;
  scroll-margin-top: 72px;
}

.guide-lead,
.guide-hint {
  margin: -4px 0 12px;
  color: var(--muted);
  font-size: .86rem;
}

.guide-hint {
  margin: 6px 0 0;
  font-size: .78rem;
}

.page .guide-button {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 0 15px;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font-size: .88rem;
  font-weight: 700;
  text-decoration: none;
}

.page .guide-button.is-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--paper);
}

.guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.guide-page {
  flex: none;
  color: var(--accent);
  font-size: .8rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* PDF card */
.guide-pdf {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  margin-bottom: 4px;
  padding: 14px;
  border-radius: 16px;
  background: var(--navy);
  color: var(--paper);
}

.guide-cover {
  width: 96px;
  height: auto;
  border-radius: 6px;
  box-shadow: 0 6px 16px rgba(0, 0, 0, .35);
}

.guide-kicker {
  margin: 0;
  color: var(--cyan-bright);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.guide-pdf h2 {
  margin: 2px 0 4px;
  font-family: var(--display);
  font-size: 1.5rem;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
  text-transform: uppercase;
}

.guide-meta {
  margin: 0 0 4px;
  color: var(--muted-on-dark);
  font-size: .8rem;
}

.guide-pdf .guide-actions {
  margin-top: 10px;
}

.page .guide-pdf .guide-button:not(.is-primary) {
  border-color: rgba(255, 253, 248, .3);
  background: transparent;
  color: var(--paper);
}

/* Jump chips */
.guide-jumps {
  display: flex;
  gap: 6px;
  margin: 16px calc(var(--page-gutter, 16px) * -1) 0;
  padding: 0 var(--page-gutter, 16px) 4px;
  overflow-x: auto;
  scrollbar-width: none;
}

.page .guide-jumps a {
  flex: none;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: .82rem;
  font-weight: 700;
  text-decoration: none;
}

/* Course cards */
.guide-course {
  margin-bottom: 8px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  border-inline-start: 5px solid var(--course);
  border-radius: 14px;
  background: var(--surface);
}

.guide-course summary,
.guide-info summary {
  cursor: pointer;
  list-style: none;
}

.guide-course summary::-webkit-details-marker,
.guide-info summary::-webkit-details-marker {
  display: none;
}

.guide-course summary {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
}

.guide-course-name strong {
  display: block;
  font-size: .92rem;
  line-height: 1.2;
}

.guide-course-name small,
.guide-course-figs small {
  display: block;
  color: var(--muted);
  font-size: .76rem;
}

.guide-course-figs {
  text-align: end;
  font-variant-numeric: tabular-nums;
}

.guide-course-figs b {
  display: block;
  color: var(--course);
  font-family: var(--display);
  font-size: 1.3rem;
  font-style: italic;
  line-height: 1;
}

.guide-course-body {
  padding: 0 12px 14px;
}

.guide-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px;
  margin: 0 0 12px;
}

.guide-stats div {
  padding: 8px 4px;
  border-radius: 8px;
  background: var(--page-bg);
  text-align: center;
}

.guide-stats dt {
  color: var(--muted);
  font-size: .64rem;
  font-weight: 700;
  text-transform: uppercase;
}

.guide-stats dd {
  margin: 2px 0 0;
  font-size: .95rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.guide-profile {
  overflow-x: auto;
  border-radius: 8px;
  background: #fff;
  scrollbar-color: var(--line) transparent;
  scrollbar-width: thin;
}

.guide-profile img {
  display: block;
  width: 100%;
  height: auto;
}

.page .guide-row-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px dashed var(--line);
  border-radius: 14px;
  color: var(--ink);
  text-decoration: none;
}

.guide-row-link small {
  display: block;
  color: var(--muted);
  font-size: .78rem;
}

/* Race village: map, legend and card styles live in village-map.css (shared with the home page). */

/* Need-to-know accordions */
.guide-info {
  border-top: 1px solid var(--line);
  scroll-margin-top: 72px;
}

.guide-info:last-of-type {
  border-bottom: 1px solid var(--line);
}

.guide-info summary {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  font-weight: 800;
}

.guide-info summary::after {
  content: "";
  flex: none;
  width: 8px;
  height: 8px;
  margin-inline-start: 4px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}

.guide-info[open] summary::after {
  transform: translateY(2px) rotate(-135deg);
}

.guide-info summary .guide-page {
  margin-inline-start: auto;
  font-weight: 600;
}

.guide-info-body {
  padding: 0 0 18px;
  font-size: .94rem;
  line-height: 1.5;
}

.guide-info-body .rich h3 {
  margin: 1em 0 .4em;
  font-size: .95rem;
}

/* Cross links */
.guide-cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.page .guide-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 56px;
  padding: 12px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--ink);
  text-decoration: none;
}

.guide-card .icon {
  flex: none;
  width: 18px;
  height: 18px;
}

[dir="rtl"] .guide-card .icon {
  transform: scaleX(-1);
}

/* Contents */
.guide-toc {
  display: grid;
  padding: 4px 14px 10px;
  border-radius: 14px;
  background: var(--surface);
}

.guide-toc h3 {
  margin: 12px 0 2px;
  color: var(--muted);
  font-size: .7rem;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.page .guide-toc-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  font-size: .9rem;
  text-decoration: none;
}

.guide-toc-item strong {
  font-weight: 500;
}

@media (max-width: 520px) {
  /* Profiles keep a readable size on phones and scroll sideways. */
  .guide-profile img {
    width: 680px;
    max-width: none;
  }

  .guide-cards {
    grid-template-columns: 1fr;
  }
}

.guide-image {
  width: 100%;
  height: auto;
  margin-bottom: 12px;
  border-radius: 10px;
}

/* ---------- Shuttle ---------- */

.card-surface {
  padding: 16px;
  border-radius: 14px;
  background: var(--surface);
  box-shadow: 0 4px 14px -10px rgba(8, 6, 50, .35);
}

.shuttle-tabs {
  position: sticky;
  top: 56px;
  z-index: 10;
  display: flex;
  gap: 2px;
  margin: 0 -16px 16px;
  padding: 0 16px;
  overflow-x: auto;
  border-bottom: 1px solid var(--line);
  background: var(--page-bg);
  scrollbar-width: none;
}

.shuttle-tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 48px;
  padding: 4px 6px;
  line-height: 1.05;
  text-align: center;
  border: 0;
  border-bottom: 3px solid transparent;
  background: none;
  color: var(--muted);
  font: 800 .95rem var(--display);
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
}

.shuttle-tabs button[aria-selected="true"] {
  border-bottom-color: var(--cyan);
  color: var(--ink);
}

.shuttle.is-ready .shuttle-panel:not(.is-active) {
  display: none;
}

.panel-lead {
  max-width: 70ch;
  margin: 0 0 12px;
  color: var(--ink-2);
}

.plan-grid {
  display: grid;
  gap: 14px;
}

@media (min-width: 860px) {
  .plan-grid {
    grid-template-columns: 340px minmax(0, 1fr);
    align-items: start;
  }

  .plan-controls {
    position: sticky;
    top: 118px;
  }
}

.control-label {
  display: block;
  margin: 0 0 6px;
  color: var(--ink-2);
  font-size: .85rem;
  font-weight: 700;
}

.race-seg {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin-bottom: 14px;
}

.race-seg button {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: var(--page-bg);
  color: var(--ink);
  text-align: start;
  cursor: pointer;
}

.race-seg b {
  font: 800 1.3rem/1 var(--display);
}

.race-seg span {
  color: var(--muted);
  font-size: .75rem;
}

.race-seg button[aria-pressed="true"] {
  border-color: var(--course, var(--navy));
  background: #fff;
}

.duration {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.duration output {
  font: 800 2.2rem/1 var(--display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.duration output small {
  margin-inline-start: .12em;
  font-size: .5em;
  font-weight: 700;
}

.duration-pct,
.control-hint {
  color: var(--muted);
  font-size: .82rem;
}

.control-hint {
  margin: 8px 0 0;
}

input[type="range"] {
  width: 100%;
  accent-color: var(--navy);
}

.presets {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}

.presets button {
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--page-bg);
  color: var(--ink-2);
  font-size: .85rem;
  cursor: pointer;
}

.live-split {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.live-split summary {
  min-height: 32px;
  font-weight: 700;
  cursor: pointer;
}

.live-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.page select {
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-variant-numeric: tabular-nums;
}

.clock-select {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.plan-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  margin-bottom: 14px;
}

.plan-count {
  font: 800 2.8rem/1 var(--display);
}

.plan-count small {
  color: var(--muted);
  font-size: 1.3rem;
}

.plan-summary-text {
  flex: 1;
  min-width: 180px;
}

.plan-summary-text p {
  margin: 0 0 6px;
  font-weight: 700;
}

.plan-bar {
  display: flex;
  gap: 3px;
}

.plan-bar i {
  flex: 1;
  height: 10px;
  border-radius: 3px;
  background: var(--line);
}

.plan-bar i.is-yes {
  background: var(--ok);
}

.plan-timeline {
  margin: 0;
  padding: 0;
  list-style: none;
}

.plan-timeline li {
  position: relative;
  padding: 0 0 14px 36px;
}

.plan-timeline li::before {
  content: "";
  position: absolute;
  inset-block: 26px 0;
  inset-inline-start: 12px;
  width: 2px;
  background: var(--line);
}

.plan-timeline li:last-child::before {
  content: none;
}

.step-dot {
  position: absolute;
  inset-inline-start: 0;
  top: 2px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--muted);
  color: #fff;
  font: 800 .85rem/1 var(--display);
}

.step-dot.is-yes { background: var(--ok); }
.step-dot.is-no { background: var(--no); }
.step-dot.is-passed { background: var(--accent); }

.step-head {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  align-items: baseline;
  justify-content: space-between;
}

.step-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  font-weight: 800;
}

.step-eta {
  color: var(--ink-2);
  font-size: .9rem;
}

.step-eta b {
  font: 800 1.05rem var(--display);
  color: var(--ink);
}

.tag {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 700;
}

.tag.is-yes { background: var(--ok-soft); color: var(--ok); }
.tag.is-no { background: var(--no-soft); color: var(--no); }
.tag.is-warn { background: var(--amber-soft); color: var(--amber-ink); }

.ride {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 3px 10px;
  align-items: center;
  margin-top: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--page-bg);
}

.ride-text b {
  font: 800 1.05rem var(--display);
}

.ride-meta {
  grid-column: 2;
  color: var(--muted);
  font-size: .82rem;
}

.step-note {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: .85rem;
}

.veh {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 8px;
  color: var(--navy);
  font: 800 1.05rem/1 var(--display);
}

.veh-A { background: #f3c9a8; }
.veh-B { background: #c9e5b8; }
.veh-C { background: #bcd9f2; }
.veh-D { background: #f5e3a0; }
.veh-E { background: #d9cdea; }

.live-alert {
  margin-bottom: 12px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--amber-soft);
  font-size: .9rem;
}

.board-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  align-items: end;
  margin-bottom: 12px;
}

.board-tools label {
  display: grid;
  gap: 6px;
  color: var(--ink-2);
  font-size: .85rem;
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  background: var(--surface);
  box-shadow: 0 4px 14px -10px rgba(8, 6, 50, .35);
}

.board-table th,
.board-table td,
.lines-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line);
  text-align: start;
  vertical-align: top;
}

.board-table th {
  position: sticky;
  top: 0;
  background: var(--surface-2);
  color: var(--muted);
  font: 700 .78rem/1.2 var(--display);
  letter-spacing: .06em;
  text-transform: uppercase;
}

.board-table td.tm,
.lines-table td.tm {
  width: 64px;
  font: 800 1.1rem/1.2 var(--display);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.board-table tr.is-past td {
  opacity: .45;
}

.stops {
  display: flex;
  flex-wrap: wrap;
  gap: 2px 6px;
  align-items: center;
}

.stop {
  white-space: nowrap;
}

.stop b {
  font: 800 1rem var(--display);
  font-variant-numeric: tabular-nums;
}

.stop-arrow {
  color: var(--muted);
}

.row-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 6px;
}

.pill {
  display: inline-block;
  padding: 1px 7px;
  border-radius: 6px;
  background: var(--surface-2);
  color: var(--ink-2);
  font-size: .75rem;
  font-weight: 700;
}

.line-head {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 10px;
  align-items: baseline;
  justify-content: space-between;
  margin: 20px 0 8px;
}

.line-head h3 {
  margin: 0;
  font-family: var(--display);
  font-size: 1.2rem;
  font-style: italic;
  font-weight: 800;
  text-transform: uppercase;
}

.line-head span {
  color: var(--muted);
  font-size: .85rem;
}

.rule-list {
  margin: 0;
  padding: 4px 16px;
  border-radius: 14px;
  background: var(--surface);
}

.rule {
  display: grid;
  gap: 4px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.rule:last-child {
  border-bottom: 0;
}

.rule dt {
  font-weight: 800;
}

.rule dd {
  margin: 0;
  color: var(--ink-2);
}

@media (min-width: 640px) {
  .rule {
    grid-template-columns: 200px minmax(0, 1fr);
    gap: 16px;
  }
}

.shuttle-version {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: .8rem;
}

.print-only {
  display: none;
}

/* ---------- Footer ---------- */

.page-footer {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 28px 16px 36px;
  color: var(--muted);
  font-size: .82rem;
  text-align: center;
}

.page-footer img {
  width: 48px;
  height: auto;
  opacity: .8;
}

.page-footer p {
  margin: 0;
}

/* ---------- Narrow phones ---------- */

@media (max-width: 480px) {
  .page-main {
    padding-top: 20px;
  }

  .page-head {
    gap: 6px;
    margin-bottom: 14px;
  }

  .page-head h1 {
    font-size: 2rem;
  }

  .page-intro {
    font-size: .9rem;
    line-height: 1.45;
  }

  .page-equipment .page-intro {
    font-size: .82rem;
  }

  .entry {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 10px;
    padding-inline: 12px;
  }

  .entry-time time {
    font-size: 1.12rem;
  }

  .day-tab {
    flex: 1 0 auto;
    min-height: 48px;
    padding: 0 10px;
  }

  .tab-date {
    font-size: 1.15rem;
  }

  .shuttle-tabs button {
    font-size: .8rem;
  }

  .board-table th,
  .board-table td {
    padding: 8px 6px;
  }

  .board-table td.tm {
    width: 48px;
    font-size: 1rem;
  }
}

/* ---------- Print: the page becomes the poster / handout ---------- */

@media print {
  @page {
    size: A4;
    margin: 12mm;
  }

  .page {
    background: #fff;
    font-size: 10.5pt;
  }

  .page-bar,
  .day-tabs,
  .entry-flags .flag-now,
  .entry-flags .flag-next,
  .race-picker,
  .checklist-status,
  .shuttle-tabs,
  .plan-controls,
  .board-tools,
  .skip-link,
  .language-switcher {
    display: none !important;
  }

  .page-main {
    width: 100%;
    padding: 0;
  }

  .program-day,
  .program-day[hidden],
  .entry[hidden],
  .gear[hidden] {
    display: block !important;
  }

  .entry[hidden] {
    display: grid !important;
  }

  .program.has-tabs .day-title {
    position: static;
    width: auto;
    height: auto;
    clip-path: none;
  }

  .entry,
  .gear-row,
  .card-surface,
  .table-wrap,
  .rule-list,
  .guide-section {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }

  .entry {
    padding-block: 6px;
  }

  .entry.hl-start {
    background: #f1f1f6;
    color: #000;
  }

  .shuttle-panel {
    display: block !important;
  }

  .shuttle-panel[data-panel="plan"] {
    display: none !important;
  }

  .print-only {
    display: block;
  }

  .shuttle-how ol {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin: 0 0 12px;
    padding: 0;
    list-style: none;
  }

  .shuttle-how li {
    display: grid;
    gap: 2px;
    padding: 8px;
    border: 1px solid #ddd;
    border-radius: 8px;
  }

  .how-step {
    font: 800 1.2rem var(--display);
  }

  .shuttle-qr {
    display: flex;
    gap: 12px;
    align-items: center;
    margin-bottom: 12px;
  }

  .shuttle-qr svg {
    width: 26mm;
    height: 26mm;
  }

  .shuttle-qr p {
    display: grid;
    margin: 0;
  }

  .board-table th {
    position: static;
  }
}
