/* Black Lungs analysis site — soft neutrals derived from the Cabot 2026 logo (warm grays) */

:root {
  /* Logo-adjacent base (cloud / paper ring tones, slightly warmed) */
  --logo-paper: #f1f0ed;
  --logo-mist: #e6e4e0;

  --bg: var(--logo-paper);
  --surface: #fdfcfa;
  --ink: #2e3136;
  --muted: #636770;
  --faint: #8c9097;
  /* Quiet blue-gray so links read as links without competing with the mark */
  --accent: #5e6670;
  --accent-hover: #4d545e;
  --accent-soft: rgba(94, 102, 112, 0.09);
  --accent-soft-border: rgba(94, 102, 112, 0.2);

  --border: #e3e2de;
  --border-strong: #d5d4cf;
  --table-head: #ebe9e5;
  --table-zebra: #f8f7f4;
  --table-hover: #f5f4f0;

  --map-canvas: var(--logo-mist);

  --radius: 8px;
  --radius-sm: 4px;
  --shadow-sm: 0 1px 3px rgba(46, 49, 54, 0.055);
  /* Modern serif: ui-serif first where supported; strong fallbacks across macOS / Windows / Linux */
  --font: ui-serif, "Charter", "Iowan Old Style", "Palatino Linotype", "Book Antiqua", Palatino,
    "Noto Serif", "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Monaco, "Cascadia Code", monospace;
  --page-pad-x: clamp(0.75rem, 4vw, 1.25rem);
  --page-pad-y: clamp(1rem, 3vw, 1.5rem);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  font-size: 15px;
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  font-family: var(--font);
  font-weight: 400;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.58;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  color: var(--accent-hover);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0.65rem;
  z-index: 10000;
  padding: 0.5rem 0.85rem;
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  border-radius: var(--radius-sm);
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

.skip-link:focus,
.skip-link:focus-visible {
  left: max(var(--page-pad-x), env(safe-area-inset-left, 0px));
  outline: 2px solid #fff;
  outline-offset: 2px;
  color: #fff;
  text-decoration: none;
}

/* —— Header —— */
.site-header {
  position: relative;
  z-index: 300;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding-top: max(0.75rem, env(safe-area-inset-top, 0px));
  padding-right: max(var(--page-pad-x), env(safe-area-inset-right, 0px));
  padding-bottom: 0.75rem;
  padding-left: max(var(--page-pad-x), env(safe-area-inset-left, 0px));
}

.site-header__inner {
  max-width: 1080px;
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.25rem;
}

.site-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.site-logo-link {
  display: block;
  flex-shrink: 0;
  line-height: 0;
  border-radius: 50%;
  transition: opacity 0.15s ease;
}

.site-logo-link:hover {
  opacity: 0.88;
}

.site-logo {
  display: block;
  width: 48px;
  height: 48px;
  object-fit: contain;
  padding: 2px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
}

.site-brand__text {
  min-width: 0;
}

.site-title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--ink);
}

.site-title a {
  color: inherit;
  text-decoration: none;
}

.site-title a:hover {
  color: var(--accent);
}

.site-tagline {
  margin: 0.15rem 0 0;
  font-size: clamp(0.6rem, 1.8vw, 0.65rem);
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--faint);
}

.site-nav-scroll {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  justify-content: flex-end;
  position: relative;
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.15rem 0.35rem;
  font-size: 0.8125rem;
  font-weight: 450;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.4rem 0.55rem;
  min-height: 2.4rem;
  display: inline-flex;
  align-items: center;
  border-radius: var(--radius-sm);
  transition: background 0.12s ease, color 0.12s ease;
  flex-shrink: 0;
}

.site-nav a:hover {
  color: var(--ink);
  background: var(--table-hover);
  text-decoration: none;
}

.site-nav a.is-active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
  text-decoration: none;
}

.site-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.site-nav.site-nav--grouped {
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem 0.55rem;
}

.site-nav--grouped .site-nav__group {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding: 0.1rem 0.65rem 0.1rem 0;
  border-right: 1px solid var(--border);
}

.site-nav--grouped .site-nav__group:last-child {
  border-right: none;
  padding-right: 0;
}

.site-nav__group--home {
  padding-left: 0;
}

.site-nav__dropdown {
  margin: 0;
}

.site-nav__summary {
  list-style: none;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
  padding: 0.5rem 0.6rem;
  min-height: 2.4rem;
  border-radius: var(--radius-sm);
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--muted);
  transition: background 0.12s ease, color 0.12s ease;
  user-select: none;
}

.site-nav__summary::-webkit-details-marker {
  display: none;
}

.site-nav__summary::marker {
  content: "";
}

.site-nav__summary span {
  pointer-events: none;
}

/* Chevron */
.site-nav__summary::after {
  content: "";
  display: inline-block;
  width: 0.35em;
  height: 0.35em;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
  margin-top: -0.15em;
  opacity: 0.55;
  transition: transform 0.15s ease, opacity 0.15s ease;
}

.site-nav__dropdown[open] .site-nav__summary::after {
  transform: rotate(225deg);
  margin-top: 0.12em;
  opacity: 0.75;
}

.site-nav__summary:hover {
  color: var(--ink);
  background: var(--table-hover);
}

.site-nav__dropdown--active .site-nav__summary {
  color: var(--accent);
  background: var(--accent-soft);
}

.site-nav__dropdown--active .site-nav__summary:hover {
  color: var(--accent-hover);
}

.site-nav__summary:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.site-nav__menu {
  display: flex;
  flex-direction: column;
  gap: 0.08rem;
  margin-top: 0.2rem;
  padding: 0.35rem;
  min-width: 11.5rem;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(46, 49, 54, 0.08);
}

.site-nav__menu a {
  display: block;
  width: 100%;
  text-align: left;
}

.site-landing .page-intro h1 {
  margin-top: 0;
}

/* —— Main —— */
main {
  max-width: 1080px;
  margin: 0 auto;
  padding: var(--page-pad-y) var(--page-pad-x) max(clamp(2rem, 6vw, 3rem), env(safe-area-inset-bottom, 0px));
  overflow-wrap: anywhere;
}

.lede {
  max-width: 40rem;
  margin: 0 0 1rem;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* —— Map (non-landing) —— */
.map-frame-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.map-frame-wrap iframe {
  display: block;
  width: 100%;
  height: clamp(320px, 70dvh, 720px);
  min-height: max(240px, 40vh);
  border: 0;
}

/* Landing: full-viewport map */
body.map-landing {
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

body.map-landing .site-header {
  flex-shrink: 0;
  padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
  padding-right: max(var(--page-pad-x), env(safe-area-inset-right, 0px));
  padding-left: max(var(--page-pad-x), env(safe-area-inset-left, 0px));
}

body.map-landing main.map-landing__main {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  margin: 0;
  max-width: none;
}

body.map-landing main.map-landing__main .page-intro--map-landing-top {
  flex-shrink: 0;
  align-self: center;
  width: 100%;
  max-width: 52rem;
  margin: 0;
  padding: 0.65rem var(--page-pad-x) 0.35rem;
}

.page-intro--compact .lede {
  margin-bottom: 0.35rem;
}

body.map-landing .map-frame-wrap--landing {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border: none;
  border-radius: 0;
  box-shadow: none;
  background: var(--map-canvas);
}

body.map-landing .map-frame-wrap--landing iframe {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  height: 100%;
  border: 0;
}

/* Runner Progress Estimator (support tool, maps/) */
body.rpe-page main {
  max-width: 56rem;
  margin: 0 auto;
  padding: 0 var(--page-pad-x) 1.75rem;
}

.rpe-map-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  height: clamp(300px, 52svh, 520px);
  height: clamp(300px, 52dvh, 520px);
  margin: 0.75rem 0 1rem;
  background: var(--map-canvas);
}

#rpe-map {
  width: 100%;
  height: 100%;
}

.rpe-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  margin: 0.5rem 0 0.75rem;
}

.rpe-controls label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink);
}

.rpe-controls input[type="datetime-local"] {
  font: inherit;
  padding: 0.35rem 0.45rem;
  border: 1px solid var(--border);
  border-radius: 6px;
  min-width: 12.5rem;
}

@media (max-width: 375px) {
  .rpe-controls input[type="datetime-local"] {
    min-width: 100%;
  }
}

.rpe-controls button {
  font: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.9rem;
  min-height: 2.5rem;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}

.rpe-controls button:hover {
  background: var(--surface-2, #f4f4f2);
}

.rpe-status {
  font-size: 0.85rem;
  margin: 0.35rem 0 0.75rem;
  color: var(--muted);
}

.rpe-status--warn {
  color: #7a4a08;
}

.rpe-status--error {
  color: #8b2e2e;
}

.rpe-status--info {
  color: var(--muted);
}

.rpe-map-focus {
  margin: 0 0 0.5rem;
  padding: 0.5rem 0.65rem;
  font-size: 0.88rem;
  line-height: 1.45;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.rpe-map-focus--active {
  color: var(--ink);
  background: rgba(107, 155, 130, 0.12);
  border-color: rgba(107, 155, 130, 0.45);
  font-weight: 600;
}

.rpe-map-focus--warn {
  background: rgba(139, 46, 46, 0.06);
  border-color: rgba(139, 46, 46, 0.25);
  color: #5c2a2a;
}

.rpe-legend {
  font-size: 0.8rem;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.rpe-summary {
  margin-top: 0.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.rpe-summary table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
  line-height: 1.4;
}

.rpe-summary th,
.rpe-summary td {
  padding: 0.45rem 0.65rem;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

.rpe-summary thead th {
  background: var(--surface-2, #efefec);
  font-weight: 650;
}

.rpe-summary tbody th {
  width: 42%;
  max-width: 14rem;
  font-weight: 600;
  color: var(--ink-muted, #444);
  background: var(--surface);
}

@media (max-width: 36rem) {
  .rpe-summary tbody th {
    width: 46%;
  }
}

/* Race hub — first-time runner orientation */
.race-hub-orient {
  margin: 1rem 0 1.25rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.race-hub-orient__title {
  margin: 0 0 0.5rem;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink);
}

.race-hub-orient__steps {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.45;
  color: var(--ink);
}

.race-hub-orient__steps li {
  margin: 0.4rem 0;
}

/* Analytics — shared runner framing */
.analytics-framing {
  margin: 0 0 0.85rem;
  padding: 0.65rem 0.75rem;
  border-left: 3px solid var(--accent);
  background: var(--table-hover);
  font-size: 0.92rem;
  line-height: 1.5;
  color: var(--muted);
}

.analytics-framing a {
  font-weight: 600;
}

/* —— Table pages —— */
.page-intro {
  margin-bottom: 1.25rem;
}

.page-intro__eyebrow {
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--faint);
}

.page-intro h1 {
  margin: 0 0 0.5rem;
  font-size: clamp(1.05rem, 2.8vw, 1.25rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.3;
}

.page-intro p {
  margin: 0 0 0.65rem;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.55;
  max-width: 42rem;
}

.page-intro small {
  font-size: 0.75rem;
  color: var(--faint);
}

.page-intro code {
  font-family: var(--font-mono);
  font-size: 0.8em;
  padding: 0.1em 0.35em;
  border-radius: 3px;
  background: var(--table-head);
  border: 1px solid var(--border);
  color: var(--muted);
}

/* Roster deep-links from historical / field tables */
.table-runner-link {
  font-weight: 600;
  text-decoration: none;
}

.table-runner-link:hover {
  text-decoration: underline;
}

.page-subheading {
  margin: 1.25rem 0 0.4rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
  line-height: 1.3;
}

.page-subheading:first-of-type {
  margin-top: 0.75rem;
}

.table-panel {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow-sm);
}

.table-panel__scroll {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
  scrollbar-gutter: stable both-edges;
}

.table-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 0.65rem 1rem;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

@media (max-width: 640px) {
  .table-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 0.55rem;
  }

  .table-toolbar__btn {
    align-self: flex-start;
    min-height: 2.5rem;
  }
}

.table-toolbar__search {
  flex: 1 1 12rem;
  min-width: 0;
}

.table-toolbar__label {
  display: block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.table-filter-input {
  width: 100%;
  max-width: min(28rem, 100%);
  min-height: 2.5rem;
  padding: 0.45rem 0.55rem;
  font: inherit;
  font-size: 0.8125rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

.table-filter-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.table-toolbar__btn {
  flex: 0 0 auto;
  padding: 0.45rem 0.65rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
  background: var(--table-head);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.table-toolbar__btn:hover {
  color: var(--ink);
  border-color: var(--faint);
}

.table-toolbar__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.table-toolbar__btn--export {
  color: var(--ink);
  border-color: var(--accent-soft-border);
  background: var(--accent-soft);
}

.table-toolbar__btn--export:hover {
  border-color: var(--accent);
  color: var(--accent-hover);
}

.table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border);
  background: var(--table-head);
  font-size: 0.8rem;
  color: var(--muted);
}

.table-pagination__summary {
  margin: 0;
  flex: 1 1 12rem;
  min-width: 0;
  line-height: 1.4;
}

.table-pagination__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem 0.5rem;
}

.table-pagination__status {
  font-weight: 600;
  color: var(--ink);
  padding: 0 0.25rem;
  min-width: 5.5rem;
  text-align: center;
}

.table-pagination__btn {
  padding: 0.35rem 0.65rem;
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

.table-pagination__btn:hover:not(:disabled) {
  border-color: var(--accent);
  color: var(--accent);
}

.table-pagination__btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.table-pagination__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.analytics-panel {
  margin-top: 1rem;
  border: 1px solid var(--border);
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0.95rem;
}

.analytics-panel__header h2 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.35;
}

.analytics-panel__subtitle {
  margin: 0.35rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
  line-height: 1.45;
}

.analytics-panel__helper {
  margin: 0.7rem 0 0.9rem;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.5;
}

.analytics-panel__commentary {
  margin: -0.2rem 0 0.9rem;
  padding: 0.55rem 0.65rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--table-hover);
  color: var(--ink);
  font-size: 0.83rem;
  line-height: 1.45;
}

.analytics-controls {
  display: grid;
  gap: 0.65rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-bottom: 0.85rem;
}

.analytics-controls__field {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
}

.analytics-controls__label {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.analytics-controls select {
  min-height: 2.5rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.45rem;
  font: inherit;
  font-size: 0.84rem;
  color: var(--ink);
  background: #fff;
}

.analytics-controls select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.analytics-canvas-wrap {
  position: relative;
  min-height: clamp(260px, 44vw, 420px);
  margin-bottom: 0.35rem;
}

.analytics-canvas {
  width: 100%;
  height: 100%;
  display: block;
}

.analytics-state {
  margin: 0.75rem 0 0;
  font-size: 0.84rem;
}

.analytics-state--empty {
  color: var(--muted);
}

.analytics-state--error {
  color: #8b2942;
  font-weight: 600;
}

.results-leg-nav,
.results-year-nav {
  flex: 1 1 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.2rem 0.35rem;
  font-size: 0.75rem;
  font-weight: 500;
  max-width: 100%;
}

.results-leg-nav a,
.results-year-nav a {
  color: var(--muted);
  text-decoration: none;
  padding: 0.28rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: background 0.12s ease, color 0.12s ease, border-color 0.12s ease;
}

.results-leg-nav a:hover,
.results-year-nav a:hover {
  color: var(--ink);
  background: var(--table-hover);
  text-decoration: none;
  border-color: var(--border);
}

.results-leg-nav a.is-active,
.results-year-nav a.is-active {
  color: var(--accent);
  font-weight: 600;
  background: var(--accent-soft);
  border-color: var(--accent-soft-border);
  text-decoration: none;
}

.results-leg-nav a:focus-visible,
.results-year-nav a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.results-year-wrap {
  flex: 0 0 auto;
  min-width: 6.5rem;
}

.results-year-select {
  width: 100%;
  max-width: min(9rem, 100%);
  min-height: 2.5rem;
  padding: 0.4rem 0.45rem;
  font: inherit;
  font-size: 0.8125rem;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  background: var(--surface);
  color: var(--ink);
}

.results-year-select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

.table-panel .data-table {
  margin: 0;
}

table.data-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font);
  font-size: 0.8125rem;
  font-variant-numeric: tabular-nums;
}

table.data-table th,
table.data-table td {
  padding: 0.5rem 0.75rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  white-space: nowrap;
}

@media (max-width: 480px) {
  table.data-table th,
  table.data-table td {
    padding: 0.4rem 0.5rem;
    font-size: 0.8rem;
  }

  table.data-table th {
    font-size: 0.68rem;
  }
}

table.data-table th {
  position: sticky;
  top: 0;
  background: var(--table-head);
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  z-index: 1;
  border-bottom: 1px solid var(--border-strong);
}

table.data-table th.data-table__th--sortable {
  cursor: pointer;
  user-select: none;
}

table.data-table th.data-table__th--sortable:hover {
  color: var(--ink);
  background: var(--table-hover);
}

table.data-table th.data-table__th--sortable:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
  z-index: 2;
}

.data-table__th-inner {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 100%;
}

.data-table__sort-ind {
  font-size: 0.65rem;
  color: var(--accent);
  font-weight: 700;
  line-height: 1;
  min-width: 0.6rem;
}

table.data-table th.is-sorted-asc,
table.data-table th.is-sorted-desc {
  color: var(--ink);
}

table.data-table tbody tr:last-child td {
  border-bottom: none;
}

table.data-table tbody tr:nth-child(even) td {
  background: var(--table-zebra);
}

table.data-table tbody tr:hover td {
  background: var(--table-hover);
}

/* —— Footer —— */
.site-preview-notice {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0.55rem var(--page-pad-x);
  display: flex;
  gap: 0.75rem;
  align-items: center;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--ink);
  background: var(--accent-soft);
  border-bottom: 1px solid var(--accent-soft-border);
}

.site-preview-notice a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.site-footer {
  max-width: 1080px;
  margin: 0 auto;
  padding: 1.5rem var(--page-pad-x) max(2rem, env(safe-area-inset-bottom, 0px));
  font-size: 0.75rem;
  line-height: 1.55;
  color: var(--faint);
  border-top: 1px solid var(--border);
  overflow-wrap: anywhere;
}

@media (max-width: 560px) {
  .site-preview-notice {
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.35rem 0.7rem;
  }
}

.site-footer code {
  font-family: var(--font-mono);
  font-size: 0.85em;
  padding: 0.08em 0.3em;
  border-radius: 3px;
  background: var(--table-head);
  border: 1px solid var(--border);
  color: var(--muted);
}

@media (max-width: 900px) {
  .site-title {
    font-size: clamp(0.95rem, 3.2vw, 1.05rem);
  }

  .site-logo {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 720px) {
  .site-header__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .site-nav-scroll {
    justify-content: stretch;
    margin-inline: calc(-1 * var(--page-pad-x));
    padding-inline: var(--page-pad-x);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }

  .site-nav-scroll::after {
    content: "";
    position: sticky;
    right: 0;
    width: 1.6rem;
    flex: 0 0 1.6rem;
    margin-left: -1.6rem;
    background: linear-gradient(90deg, rgba(253, 252, 250, 0), rgba(253, 252, 250, 0.95));
    pointer-events: none;
    z-index: 2;
  }

  .site-nav {
    flex-wrap: nowrap;
    justify-content: flex-start;
    width: max-content;
    max-width: none;
    min-width: 100%;
    padding-top: 0.65rem;
    margin-top: 0.35rem;
    border-top: 1px solid var(--border);
  }

  .site-nav.site-nav--grouped {
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 0;
    column-gap: 0;
  }

  .site-nav--grouped .site-nav__group {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: nowrap;
    gap: 0.15rem;
    padding: 0 0.85rem 0 0;
    margin: 0;
    border-right: 1px solid var(--border);
  }

  .site-nav--grouped .site-nav__group:last-child {
    border-right: none;
    padding-right: 0;
  }

  .site-nav__group--home {
    flex-direction: row;
    align-items: center;
  }

  .site-nav__menu {
    min-width: min(100%, 12rem);
    margin-top: 0.15rem;
  }

  .site-nav a {
    padding: 0.55rem 0.65rem;
    min-height: 2.9rem;
  }

  .site-nav__summary {
    min-height: 2.9rem;
    padding: 0.6rem 0.75rem;
  }

  .results-leg-nav,
  .results-year-nav {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-x: contain;
    padding-bottom: 0.15rem;
    scrollbar-width: thin;
  }

  .results-leg-nav a,
  .results-year-nav a {
    flex-shrink: 0;
  }

  .analytics-controls {
    grid-template-columns: 1fr;
  }

  .analytics-canvas-wrap {
    min-height: 280px;
  }
}

@media (min-width: 721px) {
  .site-nav-scroll {
    overflow: visible;
  }

  .site-nav__menu {
    position: absolute;
    top: calc(100% + 0.12rem);
    right: 0;
    left: auto;
    margin-top: 0;
    z-index: 200;
  }
}

/* --- 2026 race hub + live snapshot --- */
.race2026-overview-countdown {
  margin: 1.5rem 0 1.75rem;
  padding: 1rem 0 0;
  border-top: 1px solid var(--border);
}

.race2026-overview-countdown h2.race2026-section-title {
  margin: 0 0 0.35rem;
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  color: var(--ink);
}

.race2026-overview-countdown__note {
  margin: 0 0 0.35rem;
  line-height: 1.45;
  font-size: 0.95rem;
}

.race2026-overview-countdown .race2026-legs {
  margin: 1rem 0 0;
  padding: 0;
}

.race2026-hub-links {
  margin: 1rem 0 0;
  padding-left: 1.25rem;
  line-height: 1.5;
}

.race2026-runner-list {
  margin: 0.5rem 0 1.25rem;
  padding-left: 1.25rem;
  column-width: 14rem;
  column-gap: 2rem;
}

.race2026-runner-list .race2026-roster-jumplink {
  font-weight: 600;
}

.race2026-profiles {
  max-width: 42rem;
  margin: 2rem auto 0;
  padding: 0 1rem 2rem;
}

.race2026-profiles__title {
  font-size: 1.35rem;
  margin: 0 0 0.35rem;
}

.race2026-profiles__note {
  margin: 0 0 1.5rem;
  font-size: 0.9rem;
  color: var(--muted);
  line-height: 1.45;
}

.race2026-profile {
  margin-bottom: 1.75rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
}

.race2026-profile:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.race2026-profile__row {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
}

.race2026-profile__avatar {
  flex: 0 0 5.5rem;
  width: 5.5rem;
  height: 5.5rem;
  line-height: 0;
}

.race2026-profile__avatar .race2026-avatar__svg {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 0.65rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

.race2026-profile__avatar--photo .race2026-avatar__img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  border-radius: 0.65rem;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
}

.race2026-profile__body {
  flex: 1;
  min-width: 0;
}

.race2026-profile__name {
  margin: 0 0 0.4rem;
  font-size: 1.1rem;
}

.race2026-profile__bio {
  margin: 0;
  line-height: 1.55;
  font-size: 0.95rem;
}

.race2026-profile__map {
  margin: 0.65rem 0 0;
  font-size: 0.9rem;
}

.race2026-profile__top {
  margin: 0.35rem 0 0;
  font-size: 0.82rem;
}

.race2026-profile__toplink {
  color: var(--muted);
  text-decoration: none;
}

.race2026-profile__toplink:hover {
  color: var(--accent);
  text-decoration: underline;
}

.team-ref-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(16.5rem, 1fr));
  gap: 0.85rem;
  margin: 0 auto 1rem;
  max-width: 1080px;
  padding: 0 var(--page-pad-x);
}

.team-ref-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 0.8rem 0.9rem;
}

.team-ref-card h2 {
  margin: 0 0 0.5rem;
  font-size: 0.96rem;
}

.team-ref-card ul {
  margin: 0;
  padding-left: 1rem;
}

.team-ref-card li + li {
  margin-top: 0.42rem;
}

.team-ref-downloads {
  max-width: 1080px;
  margin-left: auto;
  margin-right: auto;
}

.team-ref-downloads__table td:nth-child(1) {
  width: 5rem;
}

.team-ref-downloads__table td:nth-child(3) small {
  display: block;
  margin-top: 0.2rem;
  color: var(--faint);
}

.team-ref-downloads__missing {
  color: var(--faint);
}

@media (max-width: 520px) {
  .race2026-profile__row {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .race2026-profile__avatar {
    flex-basis: 6rem;
    width: 6rem;
    height: 6rem;
  }
}

@media (max-width: 375px) {
  .race2026-profile__avatar {
    flex-basis: 5rem;
    width: 5rem;
    height: 5rem;
  }

  .race2026-legs__sep {
    font-size: 1.2rem;
    margin: 0 0.15rem;
  }
}

/* --- 2026 leg assignments countdown --- */
.race2026-legs {
  max-width: 36rem;
  margin: 0 auto 2.5rem;
  padding: 0 1rem;
  text-align: center;
}

.race2026-legs__label {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.race2026-legs--live .race2026-legs__label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  flex-wrap: wrap;
}

.race2026-legs--live .race2026-legs__label::before {
  content: "";
  width: 0.45rem;
  height: 0.45rem;
  border-radius: 50%;
  background: #2a9d5c;
  box-shadow: 0 0 0 0 rgba(42, 157, 92, 0.45);
  animation: race2026-live-pulse 1.6s ease-out infinite;
}

@keyframes race2026-live-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(42, 157, 92, 0.5);
  }
  70% {
    box-shadow: 0 0 0 0.55rem rgba(42, 157, 92, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(42, 157, 92, 0);
  }
}

.race2026-legs__clock {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: center;
  gap: 0.35rem 0.5rem;
  font-variant-numeric: tabular-nums;
}

.race2026-legs__block {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  min-width: 3.25rem;
}

.race2026-legs__num {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.1;
  font-feature-settings: "tnum" 1;
}

.race2026-legs__unit {
  font-size: 0.72rem;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.race2026-countdown__subsecond {
  margin: 0.65rem auto 0;
  max-width: min(18rem, 100%);
  height: 5px;
  border-radius: 3px;
  background: var(--border);
  overflow: hidden;
}

.race2026-countdown__subsecond-fill {
  height: 100%;
  width: 100%;
  transform-origin: left center;
  transform: scaleX(0);
  border-radius: 3px;
  background: linear-gradient(90deg, var(--accent-soft-border), var(--accent));
  will-change: transform;
}

.race2026-countdown--pulse {
  animation: race2026-sec-block-pulse 0.45s ease-out;
}

@keyframes race2026-sec-block-pulse {
  0% {
    transform: translateY(0.12em);
    opacity: 0.72;
  }

  100% {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .race2026-countdown--pulse {
    animation: none;
  }
}

.race2026-legs__sep {
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--muted);
  align-self: flex-start;
  margin-top: 0.35rem;
}

.race2026-legs__done {
  margin: 0;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--muted);
}

.race2026-leg-matrix {
  margin-top: 1rem;
}

.race2026-leg-matrix__note {
  margin: 0 0 0.75rem;
  color: var(--muted);
}

.race2026-leg-matrix__scroll {
  overflow-x: auto;
}

.race2026-leg-matrix__table th:first-child,
.race2026-leg-matrix__table td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: var(--table-head);
}

.race2026-leg-matrix__table tbody th {
  color: var(--ink);
  font-weight: 600;
  text-transform: none;
  letter-spacing: 0;
  font-size: 0.8rem;
}

.race2026-leg-matrix__table td {
  min-width: 4.2rem;
  white-space: normal;
  line-height: 1.35;
}

.race2026-leg-matrix__table td.race2026-leg-matrix__hit {
  background: #4b515a;
  color: #f6f7f9;
  font-weight: 600;
}

.race2026-leg-matrix__table td.race2026-leg-matrix__none {
  color: var(--faint);
  font-style: italic;
}

/* Override global table zebra/hover for this matrix only. */
table.data-table.race2026-leg-matrix__table tbody tr td {
  background: transparent;
}

table.data-table.race2026-leg-matrix__table tbody tr:hover td {
  background: transparent;
}

/* Keep filled experience cells dark/readable in all states. */
table.data-table.race2026-leg-matrix__table tbody tr td.race2026-leg-matrix__hit,
table.data-table.race2026-leg-matrix__table tbody tr:hover td.race2026-leg-matrix__hit {
  background: #4b515a;
  color: #f6f7f9;
}

.race2026-live-root {
  max-width: 56rem;
  margin: 0 auto 2rem;
  padding: 0 1rem;
}

.race2026-live__meta {
  margin-bottom: 1.25rem;
  font-size: 0.9rem;
  color: var(--muted);
}

.race2026-live__meta p {
  margin: 0.35rem 0;
}

.race2026-live__insights {
  margin: 1.25rem 0;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.race2026-live__insights h2 {
  margin: 0 0 0.5rem;
  font-size: 1rem;
}

.race2026-live__insights p {
  margin: 0.35rem 0;
  line-height: 1.45;
}

.race2026-live__status {
  margin: 1rem 0;
  color: var(--muted);
}

.race2026-live__status--error {
  color: #8b2942;
}

.race2026-live__empty pre {
  margin: 0.75rem 0;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  font-size: 0.8rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
}

table.data-table tr.race2026-live__bl-row td {
  background: rgba(139, 41, 66, 0.08);
  font-weight: 600;
}

/* —— Team photos (upload + gallery) —— */
.tp-banner {
  margin: 0.75rem 0 0;
  padding: 0.65rem 0.85rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-strong);
  font-size: 0.9rem;
}

.tp-banner--warn {
  background: #faf6ef;
  border-color: #e0d3bc;
  color: var(--ink);
}

.tp-coming-soon-wrap {
  position: relative;
}

.tp-coming-soon {
  position: absolute;
  top: 0.35rem;
  right: 0;
  margin: 0;
  padding: 0.22rem 0.5rem;
  border-radius: 999px;
  border: 1px solid var(--accent-soft-border);
  background: rgba(94, 102, 112, 0.12);
  color: var(--ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.tp-panel {
  max-width: 720px;
  margin-top: 1.25rem;
}

.tp-subheading {
  margin: 1.25rem 0 0.5rem;
  font-size: 1.05rem;
  font-weight: 650;
}

.tp-muted {
  color: var(--muted);
  font-size: 0.9rem;
}

.tp-dropzone {
  margin-top: 0.5rem;
  padding: 1.25rem 1rem;
  border: 2px dashed var(--border-strong);
  border-radius: var(--radius);
  background: var(--surface);
  text-align: center;
}

.tp-dropzone--active {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.tp-inline-file {
  cursor: pointer;
  font-weight: 600;
}

.tp-inline-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  overflow: hidden;
}

.tp-fake-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.tp-form-grid {
  display: grid;
  gap: 0.75rem 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 640px) {
  .tp-form-grid {
    grid-template-columns: 1fr 1fr;
  }
}

.tp-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.9rem;
}

.tp-label {
  font-weight: 600;
  color: var(--muted);
}

.tp-field textarea,
.tp-field input[type="text"],
.tp-field input[type="number"],
.tp-field select {
  font: inherit;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
  color: var(--ink);
}

.tp-queue {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}

.tp-queue__item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 0.25rem 0.75rem;
  align-items: center;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.9rem;
}

.tp-queue__name {
  font-weight: 500;
  word-break: break-word;
}

.tp-queue__status {
  color: var(--muted);
  text-align: right;
  font-size: 0.85rem;
}

.tp-queue__item--ok .tp-queue__status {
  color: #2d6a4f;
}

.tp-queue__item--error .tp-queue__status {
  color: #8b2942;
}

.tp-queue__bar {
  grid-column: 1 / -1;
  height: 4px;
  background: var(--border);
  border-radius: 2px;
  overflow: hidden;
}

.tp-queue__bar-fill {
  height: 100%;
  width: 0%;
  background: var(--accent);
  transition: width 0.15s ease;
}

.tp-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1rem;
  align-items: flex-end;
}

.tp-field--inline {
  min-width: 8rem;
}

.tp-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
  gap: 0.85rem;
  margin-top: 1rem;
  max-width: 1080px;
}

.tp-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

.tp-card__btn {
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}

.tp-card__btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.tp-card__btn img {
  display: block;
  width: 100%;
  height: 152px;
  object-fit: cover;
  background: var(--logo-mist);
}

.team-photos-page .tp-card__btn,
.team-photos-page .tp-card__delete,
.team-photos-page .tp-field select,
.team-photos-page .tp-field input,
.team-photos-page .tp-field textarea {
  touch-action: manipulation;
}

.tp-card__cap {
  padding: 0.4rem 0.5rem;
  font-size: 0.78rem;
  color: var(--muted);
  line-height: 1.35;
  min-height: 2.6rem;
}

.tp-card__delete {
  position: absolute;
  top: 0.35rem;
  right: 0.35rem;
  font-size: 0.72rem;
  padding: 0.2rem 0.45rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.85);
  background: rgba(46, 49, 54, 0.72);
  color: #fff;
  cursor: pointer;
}

.tp-card__delete:hover {
  background: rgba(46, 49, 54, 0.9);
}

.tp-modal {
  position: fixed;
  inset: 0;
  z-index: 5000;
  background: rgba(46, 49, 54, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(1rem, env(safe-area-inset-top)) max(1rem, env(safe-area-inset-right)) max(1rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
}

.tp-modal[hidden] {
  display: none !important;
}

.tp-modal__inner {
  position: relative;
  max-width: min(96vw, 960px);
  max-height: 92svh;
  max-height: 92dvh;
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  padding: 0.75rem 1rem 1rem;
}

.tp-modal__inner img {
  display: block;
  max-width: 100%;
  max-height: min(70vh, 720px);
  width: auto;
  height: auto;
  margin: 0 auto;
  object-fit: contain;
}

.tp-modal__close {
  position: sticky;
  top: 0;
  float: right;
  z-index: 2;
  border: none;
  background: var(--surface);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--muted);
  padding: 0.15rem 0.45rem;
  border-radius: var(--radius-sm);
}

.tp-modal__meta {
  clear: both;
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--ink);
}

.tp-modal__meta p {
  margin: 0.35rem 0;
}

/* Run of show page */
.ros-scan-tip {
  margin: 0.35rem 0 0.55rem;
  color: var(--muted);
  max-width: 52rem;
}

.ros-jump {
  margin: 0.65rem 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 0.5rem;
  font-size: 0.84rem;
}

.ros-jump a {
  display: inline-block;
  padding: 0.3rem 0.55rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  text-decoration: none;
  font-weight: 600;
}

.ros-jump a:hover {
  color: var(--ink);
  background: var(--table-hover);
}

.ros-table-wrap {
  margin-top: 0.9rem;
  border: 1px solid #cfd5ce;
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.ros-table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  table-layout: auto;
  font-size: 0.9rem;
}

.ros-th,
.ros-col {
  padding: 0.68rem 0.65rem;
  vertical-align: top;
  border-bottom: 1px solid #dbe0da;
  border-right: 1px solid #dbe0da;
}

.ros-th:last-child,
.ros-col:last-child {
  border-right: 0;
}

.ros-th {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #e3e8e2;
  color: #414743;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-align: left;
}

.ros-th--time,
.ros-col--time {
  width: 18%;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.ros-th--time {
  position: sticky;
  left: 0;
  z-index: 7;
}

.ros-col--time {
  position: sticky;
  left: 0;
  z-index: 3;
  background: inherit;
  box-shadow: 1px 0 0 #dbe0da;
}

.ros-th--interval,
.ros-col--interval {
  width: 10%;
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  white-space: nowrap;
}

.ros-th--type,
.ros-col--type {
  width: 10%;
  white-space: nowrap;
}

.ros-th--activity,
.ros-col--activity {
  width: 34%;
}

.ros-th--notes,
.ros-col--notes {
  width: 22%;
}

.ros-th--link,
.ros-col--link {
  width: 6%;
  white-space: nowrap;
}

.ros-col--activity {
  font-size: 0.94rem;
  font-weight: 650;
  line-height: 1.42;
  color: #1f2923;
}

.ros-type-tag {
  display: inline-block;
  padding: 0.08rem 0.32rem;
  border-radius: 999px;
  border: 1px solid #d0d8cf;
  background: #f5f7f4;
  color: #47514a;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: 1.2;
}

.ros-type-tag--leg_start {
  border-color: #9fd5bd;
  background: #eef9f3;
  color: #1f6242;
}

.ros-type-tag--departure {
  border-color: #b8cbe0;
  background: #f1f6fc;
  color: #30567c;
}

.ros-type-tag--arrival {
  border-color: #c3cfdd;
  background: #f4f7fb;
  color: #3d5978;
}

.ros-type-tag--meal {
  border-color: #e7cfa9;
  background: #fff8ec;
  color: #7f5a23;
}

.ros-type-tag--hotel {
  border-color: #d2bde8;
  background: #f9f3ff;
  color: #694190;
}

.ros-type-tag--daylight {
  border-color: #c9c9e6;
  background: #f7f7ff;
  color: #50528b;
}

.ros-col--activity a,
.ros-col--link a {
  color: #2f587f;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.ros-col--notes {
  font-size: 0.88rem;
  color: #4b524d;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.ros-cell__time-main {
  display: inline-block;
  font-weight: 650;
  color: #2b2f2c;
}

.ros-cell__time-sub {
  display: none;
}

.ros-table tbody tr.ros-row:nth-child(even) {
  background: #f8faf8;
}

.ros-day-row th {
  padding: 0.5rem 0.65rem;
  border-top: 2px solid #c0c8bf;
  border-bottom: 1px solid #c0c8bf;
  border-right: 0;
  background: #d9ded8;
  color: #1f2923;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-align: left;
}

.ros-row {
  border-left: 3px solid transparent;
}

.ros-row--placeholder .ros-col--activity {
  color: #2a5c44;
}

.ros-row--leg_start {
  border-left-color: #2f8f64;
}

.ros-row--departure {
  border-left-color: #486f9a;
}

.ros-row--arrival {
  border-left-color: #6b7f99;
}

.ros-row--meal {
  border-left-color: #ad7b2f;
}

.ros-row--hotel {
  border-left-color: #8b5fb0;
}

.ros-row--is-current,
.ros-row--is-next {
  background: #ecf3ff !important;
}

.ros-row--is-current .ros-col--time,
.ros-row--is-next .ros-col--time {
  font-weight: 700;
  color: #224d7a;
}

.ros-back-top {
  position: fixed;
  right: max(1rem, env(safe-area-inset-right, 0px));
  bottom: max(1rem, env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: inline-block;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius-sm);
  border: 1px solid #c3cbc2;
  background: var(--surface);
  color: var(--ink);
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  box-shadow: var(--shadow-sm);
}

@media (max-width: 760px) {
  .ros-table { font-size: 0.86rem; }

  .ros-th,
  .ros-col {
    padding: 0.82rem 0.52rem;
  }

  .ros-cell__time-main {
    display: block;
  }

  .ros-cell__time-sub {
    display: block;
    margin-top: 0.18rem;
    font-size: 0.76rem;
    color: var(--muted);
    font-weight: 500;
    white-space: normal;
  }

  .ros-col--notes { font-size: 0.82rem; }

  .ros-type-tag {
    font-size: 0.62rem;
    padding: 0.08rem 0.3rem;
  }
}

@media (max-width: 560px) {
  .tp-coming-soon {
    position: static;
    display: block;
    margin: 0 0 0.65rem;
    text-align: center;
  }

  .tp-grid {
    grid-template-columns: repeat(auto-fill, minmax(132px, 1fr));
    gap: 0.7rem;
  }

  .tp-card__btn img {
    height: 136px;
  }
}
