/* Customer tracking page: "Your car's crossing" (design/redesign-brief.md §12). Covers /t/{token} (Tracking.razor,
   TrackingRoute.razor, TrackingSky.razor), its 404 (TrackingNotFound.razor) and the /track lookup (Track.razor).
   Loaded after public.css on every public page; every rule is scoped under .tk* (or the kept JS hooks: .photo,
   .lightbox, .lb-*, .push-*), so the landing, nav, footer, login and forms are untouched.
   Every value comes from tokens.css; logical properties only (physical values appear only inside [dir="rtl"]
   overrides for transforms). Contrast pairs are listed in the brief §12.3 and re-checked where colours differ. */

/* Scene colours: "dawn" in the light theme, "night" in dark (the theme toggle changes the time of day). */
:root {
  --tk-sky-1: #0A2833;
  --tk-sky-2: #184651;
  --tk-sky-3: #2A585D;
  --tk-ridge: #0F3A41;
  --tk-sea-1: #0E3A3F;
  --tk-sea-2: #031112;
  --tk-sand-1: #3A3628;
  --tk-sand-2: #14120C;
  --tk-stars: 0.45;
  --tk-glow: 1;
  --tk-rail: var(--au-petrol-600);
  --tk-pad: var(--au-5);
  --tk-top-h: calc(var(--au-tap) + 2 * var(--au-4)); /* the TrackingLayout bar: 44px tools + 16px padding each side */
  --tk-dock-space: calc(110px + env(safe-area-inset-bottom));
}
:root[data-theme="dark"] {
  --tk-sky-1: #041516;
  --tk-sky-2: #0B3132;
  --tk-sky-3: #14504F;
  --tk-ridge: #0A2C2D;
  --tk-sea-1: #0A3233;
  --tk-sea-2: #031112;
  --tk-sand-1: #2B2A22;
  --tk-sand-2: #0E0D09;
  --tk-stars: 1;
  --tk-glow: 0.85;
  --tk-rail: var(--au-petrol-200);
}
/* Cancelled: a desaturated slate sky, no glow, no stars (night-ink-2 on #2E3D3E ~6.7:1). */
.tk.state-cancelled {
  --tk-sky-1: #1A2526;
  --tk-sky-2: #243233;
  --tk-sky-3: #2E3D3E;
  --tk-ridge: #222E2F;
  --tk-sea-1: #1E2A2B;
  --tk-sea-2: #0B1112;
  --tk-sand-1: #262724;
  --tk-sand-2: #0D0E0D;
  --tk-stars: 0;
  --tk-glow: 0;
}
/* Dawn (the car is a day away, or delivered): the low sky warms and the stars fade (night-ink-2 on --tk-sky-3:
   4.75:1 light, 5.3:1 dark). */
.tk.sky-dawn { --tk-sky-3: #3A5650; --tk-stars: 0.22; }
:root[data-theme="dark"] .tk.sky-dawn { --tk-sky-3: #2F4F4C; --tk-stars: 0.4; }
@media (max-width: 399.98px) { :root { --tk-pad: var(--au-4); } }

/* ---------- Layout ---------- */
@media (min-width: 1100px) { .container.narrow.tk-shell { max-width: var(--au-container); } }

.tk { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--au-4); padding-block-end: var(--tk-dock-space); }
/* Keyboard focus never lands under the fixed dock (WCAG 2.4.11); no sticky bar on top here. */
html:has(.tk-dock) { scroll-padding-block-end: calc(96px + env(safe-area-inset-bottom)); }
html:has(.tk-top) { scroll-padding-block-start: var(--au-4); }
.tk-body { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--au-4); }
.tk-main { display: grid; gap: var(--au-4); min-inline-size: 0; }
.tk-side { min-inline-size: 0; display: grid; gap: var(--au-4); align-content: start; }
@media (min-width: 1100px) {
  .tk, .tk-body, .tk-main { gap: var(--au-5); }
  .tk-body { grid-template-columns: minmax(0, 1fr) 360px; align-items: start; }
  .tk-side { gap: var(--au-5); }
}

/* Paper cards below the hero */
.tk-card {
  background: var(--au-surface); border: 1px solid var(--au-line); border-radius: var(--au-radius-lg);
  padding: var(--tk-pad); box-shadow: var(--au-shadow-sm); min-inline-size: 0;
}
.tk-h2 {
  display: flex; align-items: center; gap: var(--au-3); margin-block-end: var(--au-4);
  font-family: var(--au-font-display); font-weight: 700; font-size: var(--au-text-xl); line-height: var(--au-leading-tight); color: var(--au-ink);
}
.tk-h2-ic {
  inline-size: 40px; block-size: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
  background: var(--au-brand-tint); color: var(--au-brand); font-size: 20px;
}
.tk-badge {
  margin-inline-start: auto; display: inline-grid; place-items: center; min-inline-size: 32px; block-size: 28px; padding-inline: 10px;
  border-radius: var(--au-radius-pill); background: var(--au-surface-2); color: var(--au-ink-2);
  font-family: var(--au-font-mono); font-weight: 600; font-size: var(--au-text-sm); font-variant-numeric: tabular-nums;
}

/* ---------- The hero: a night postcard in both themes ---------- */
.tk-hero {
  position: relative; isolation: isolate; overflow: clip;
  display: grid; grid-template-columns: minmax(0, 1fr);
  margin-inline: calc(-1 * var(--au-4));
  padding: var(--au-5) var(--au-4) var(--au-4);
  border-end-start-radius: var(--au-radius-xl); border-end-end-radius: var(--au-radius-xl);
  color: var(--au-night-ink);
  background: linear-gradient(to bottom, var(--tk-sky-1) 0%, var(--tk-sky-2) 34%, var(--tk-sky-3) 64%, var(--tk-sea-1) 100%);
}
/* Text above the scene: the route's ridge, sea and horizon run under it, never over it. */
.tk-hello-row, .tk-banner, .tk-kicker, .tk-status, .tk-where, .tk-ports, .tk-arrival { position: relative; z-index: 1; }

/* Phones: the night reaches the top of the screen. The top bar sits inside the postcard, so the status bar
   (theme-color = --tk-sky-1), the bar and the hero read as one picture. */
@media (max-width: 639.98px) {
  .tk-shell:has(.tk-hero) .tk-top { position: relative; z-index: 2; }
  .tk-shell:has(.tk-hero) .tk-top .brand { color: var(--au-night-ink); }
  .tk-shell:has(.tk-hero) .tk-top .brand small { color: var(--au-night-ink-2); }
  .tk-shell:has(.tk-hero) .tk-top .tool { background: rgba(255, 255, 255, 0.06); color: var(--au-night-ink); border-color: var(--au-night-line-strong); }
  .tk-shell:has(.tk-hero) .tk-top .tool:hover { background: rgba(255, 255, 255, 0.12); border-color: rgba(255, 255, 255, 0.55); }
  .tk-shell:has(.tk-hero) .tk-top :focus-visible { outline-color: var(--au-night-focus); }
  .tk-hero { margin-block-start: calc(-1 * var(--tk-top-h)); padding-block-start: calc(var(--tk-top-h) + var(--au-2)); }
}
.tk-hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image: var(--pub-grain); opacity: 0.06;
}
@media (min-width: 640px) {
  .tk-hero { margin-inline: 0; border-radius: var(--au-radius-xl); box-shadow: var(--au-shadow-lg); }
}
@media (min-width: 768px) { .tk-hero { padding: var(--au-6); } }
.tk-hero :focus-visible, .tk-lost :focus-visible, .tk-pass :focus-visible, .lightbox :focus-visible { outline-color: var(--au-night-focus); }

/* Sky (TrackingSky.razor) */
.tk-sky { position: absolute; inset: 0; z-index: -1; pointer-events: none; overflow: clip; }
[dir="rtl"] .tk-sky { transform: scaleX(-1); }
.tk-sky svg { position: absolute; inset-inline: 0; inline-size: 100%; max-inline-size: none; display: block; }
.tks-stars { inset-block-start: 0; block-size: min(100%, 520px); opacity: var(--tk-stars); transition: opacity 900ms var(--au-ease); }
.tks-stars circle { fill: var(--au-night-ink); }
.tks-land { inset-block-end: 0; block-size: 42%; }
.tks-sea-1 { stop-color: var(--tk-sea-1); }
.tks-sea-2 { stop-color: var(--tk-sea-2); }
.tks-ridge { fill: var(--tk-ridge); stroke: rgba(255, 255, 255, 0.06); stroke-width: 1; }
.tks-glow { opacity: var(--tk-glow); }
.tk-sky stop, .tks-ridge { transition: stop-color 900ms var(--au-ease), fill 900ms var(--au-ease); }

/* Greeting + plate */
.tk-hello-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--au-2) var(--au-3); }
.tk-hello { flex: 1 1 14rem; min-inline-size: 0; color: var(--au-night-ink-2); font-size: var(--au-text-sm); }
.tk-plate-row { display: inline-flex; align-items: center; gap: var(--au-2); flex: none; }
.tk-plate {
  position: relative; overflow: hidden; display: inline-flex; align-items: center;
  block-size: 36px; padding-inline: 20px 12px; white-space: nowrap;
  background: var(--au-plate-bg); color: var(--au-plate-ink);
  border: 2px solid var(--au-plate-ink); border-radius: 8px;
  box-shadow: inset 0 0 0 2px var(--au-plate-bg), 0 8px 18px -10px rgba(0, 0, 0, 0.7);
  font-family: var(--au-font-mono); font-weight: 600; font-size: 1.0625rem; letter-spacing: 0.04em;
}
.tk-plate::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 10px; background: var(--au-plate-band); }
.tk-copy {
  inline-size: var(--au-tap); block-size: var(--au-tap); flex: none; border-radius: 50%;
  display: grid; place-items: center; font-size: 18px;
  border: 1px solid var(--au-night-line-strong); background: transparent; color: var(--au-night-ink);
  transition: background-color var(--au-dur-fast) var(--au-ease), border-color var(--au-dur-fast) var(--au-ease), transform var(--au-dur-fast) var(--au-ease), color var(--au-dur-fast) var(--au-ease);
}
.tk-copy:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.55); }
.tk-copy:active { transform: scale(0.94); }
.tk-copy.is-done { color: var(--au-petrol-200); border-color: var(--au-petrol-200); }

/* State banner (on hold / cancelled) */
.tk-banner {
  position: relative; overflow: hidden; display: flex; align-items: flex-start; gap: var(--au-3);
  margin-block-start: var(--au-4); padding: 14px 16px; padding-inline-start: 18px;
  border: 1px solid var(--au-night-line); border-radius: var(--au-radius-md);
  background: var(--au-glass-night); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--au-night-ink-2); font-size: var(--au-text-sm);
}
.tk-banner::before { content: ""; position: absolute; inset-block: 0; inset-inline-start: 0; inline-size: 3px; }
.tk-banner > .icon { font-size: 22px; margin-block-start: 1px; }
.tk-banner b:not(.sr-only) { display: block; color: var(--au-night-ink); font-weight: 600; font-size: var(--au-text-md); }
.tk-banner span { display: block; }
.tk-banner.is-hold { align-items: center; color: var(--au-night-ink); }
.tk-banner.is-hold { border-color: color-mix(in srgb, var(--au-amber-300) 60%, transparent); }
.tk-banner.is-hold::before { background: var(--au-amber-500); }
.tk-banner.is-hold > .icon { color: var(--au-amber-300); }
.tk-banner.is-cancel { border-color: #F08A80; }
.tk-banner.is-cancel::before { background: #F08A80; }
.tk-banner.is-cancel > .icon { color: #F08A80; } /* ~5.8:1 on --au-night-2 */
.tk-banner-link {
  display: inline-flex; align-items: center; gap: var(--au-2); min-block-size: var(--au-tap); margin-block-start: var(--au-3); padding-inline: 16px;
  border: 1px solid var(--au-night-line-strong); border-radius: var(--au-radius-pill);
  color: var(--au-night-ink); font-weight: 500;
  transition: background-color var(--au-dur-fast) var(--au-ease), border-color var(--au-dur-fast) var(--au-ease);
}
.tk-banner-link span { display: inline; }
.tk-banner-link .icon { font-size: 18px; }
.tk-banner-link:hover { background: rgba(255, 255, 255, 0.1); border-color: rgba(255, 255, 255, 0.6); }
.tk-banner-link:active { transform: scale(0.98); }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .tk-banner, .tk-arrival { background: var(--au-night-2); }
}

/* Status */
.tk-kicker {
  display: flex; align-items: center; gap: 12px; margin-block-start: var(--au-5);
  font-size: var(--au-text-kicker); font-weight: 500; color: var(--au-amber-300); /* ~10:1 on --tk-sky-1 */
}
.tk-kicker::before { content: ""; inline-size: 24px; block-size: 2px; border-radius: 2px; background: var(--au-amber-500); flex: none; }
:lang(en) .tk-kicker { letter-spacing: 0.14em; text-transform: uppercase; }
.tk-status {
  margin-block-start: 10px; font-family: var(--au-font-display); font-weight: 700;
  font-size: clamp(2.25rem, 9vw, 3.75rem); line-height: var(--au-leading-display);
  color: var(--au-night-ink); text-wrap: balance; overflow-wrap: break-word;
}
:lang(en) .tk-status { font-weight: 800; letter-spacing: -0.025em; }
:lang(ar) .tk-status { line-height: var(--au-leading-display-ar); }
.state-cancelled .tk-status { color: var(--au-night-ink-2); }
.tk-where { display: flex; align-items: flex-start; gap: var(--au-2); margin-block-start: 10px; color: var(--au-night-ink); }
.tk-where > .icon { font-size: 20px; color: var(--au-night-ink-3); margin-block-start: 0.2em; }

/* ---------- Route (TrackingRoute.razor) ---------- */
.tk-route { position: relative; margin-block-start: var(--au-5); container-type: inline-size; }
.tk-route-svg { position: relative; z-index: 0; display: block; inline-size: 100%; block-size: auto; overflow: visible; }
[dir="rtl"] .tk-route-svg { transform: scaleX(-1); }
.tks-wave { fill: none; stroke: rgba(255, 255, 255, 0.12); stroke-width: 1.2; stroke-linecap: round; }
.tks-wave-2 { opacity: 0.6; }
/* Land routes: a desert band with a road */
.tks-sand-1 { stop-color: var(--tk-sand-1); }
.tks-sand-2 { stop-color: var(--tk-sand-2); }
.tks-road { stroke: rgba(255, 255, 255, 0.18); stroke-width: 1; stroke-dasharray: 6 7; }
.tks-dune { fill: none; stroke: rgba(255, 255, 255, 0.08); stroke-width: 1.2; stroke-linecap: round; }
.tks-dune-2 { opacity: 0.6; }
/* Time of day */
.tks-moon-halo { fill: var(--au-night-ink); opacity: 0.05; }
.tks-moon-disc { fill: #F6EBCF; opacity: 0.9; }
.tks-sun { fill: #FFD58F; opacity: 0.95; }
.tks-sun-halo { opacity: 0.9; }
.tks-harbour circle { fill: var(--au-amber-300); }
.tk-marker-window { fill: var(--au-amber-300); }
.tk-route-base { fill: none; stroke: var(--au-lane-night); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 8; }
.tk-route-done, .tk-route-halo {
  fill: none; stroke: var(--au-night-accent); stroke-linecap: round;
  stroke-dasharray: var(--progress) 100; stroke-dashoffset: 0;
}
.tk-route-done { stroke-width: 4; }
.tk-route-halo { stroke-width: 12; opacity: 0.16; }
.tk-pin-origin { fill: var(--au-amber-500); stroke: var(--tk-sky-1); stroke-width: 2; }
.tk-pin-dest { fill: var(--tk-sky-3); stroke: var(--au-night-ink-2); stroke-width: 2; }
.tk-pin-dest.is-reached { fill: var(--au-amber-500); stroke: var(--au-amber-300); }
.tk-pin-halo { fill: var(--au-glow); }
.tk-marker-dot { fill: var(--au-amber-500); }
.tk-marker-glyph { fill: var(--au-amber-ink); }
.tk-pulse { fill: var(--au-amber-500); opacity: 0; transform-box: fill-box; transform-origin: center; }
.tk-hold-ring { fill: none; stroke: var(--au-amber-300); stroke-width: 1.5; stroke-dasharray: 3 4; opacity: 0.85; }
.tk-wake { fill: none; stroke: var(--au-night-ink-3); stroke-width: 1; stroke-linecap: round; opacity: 0.85; }
.tk-beam { fill: var(--au-amber-300); opacity: 0.18; }
.state-cancelled .tk-marker-dot, .state-cancelled .tk-pin-origin { fill: var(--au-night-ink-3); }
.state-cancelled .tk-marker-glyph { fill: var(--tk-sky-1); }
.state-cancelled .tk-pin-dest { fill: var(--tk-sky-3); stroke: var(--au-night-ink-3); }

/* Harbour lights (delivered): hidden unless the burst animation plays. */
.tk-burst { opacity: 0; }
.tk-burst line { stroke-width: 2; stroke-linecap: round; }
.tk-ray-a { stroke: var(--au-amber-300); }
.tk-ray-b { stroke: var(--au-petrol-200); }

/* Progress chip: HTML over the SVG, anchored to the car through --tk-x / --tk-y (set by the server). */
.tk-chip {
  position: absolute; z-index: 1; inset-inline-start: var(--tk-x); inset-block-start: var(--tk-y);
  transform: translate(-50%, calc(-100% - 20px));
  display: inline-block; block-size: 32px; line-height: 32px; padding-inline: 12px; white-space: nowrap;
  border-radius: var(--au-radius-pill); background: var(--au-amber-500); color: var(--au-amber-ink); /* ~8:1 */
  font-size: var(--au-text-sm); font-weight: 600;
  box-shadow: 0 10px 22px -10px rgba(0, 0, 0, 0.7), 0 0 0 3px color-mix(in srgb, var(--tk-sky-1) 70%, transparent), 0 0 0 7px var(--au-glow-soft);
}
.tk-chip::after {
  content: ""; position: absolute; inset-block-start: 100%;
  inset-inline-start: clamp(14px, calc(50% + var(--tk-dx, 0) * 1cqi), calc(100% - 14px)); margin-inline-start: -6px;
  border: 6px solid transparent; border-block-start-color: var(--au-amber-500); border-block-end-width: 0;
}
[dir="rtl"] .tk-chip { transform: translate(50%, calc(-100% - 20px)); }
/* The chip always floats above the car, so it never hides the dashed part still to come. Near the top of the arc
   it rises past the route box: make room for it. */
.tk-route.is-chip-high { margin-block-start: calc(var(--au-5) + 24px); }

/* Delivered: a round customs stamp landing on the postcard, in the empty sky inside the arc. */
.tk-stamp {
  position: absolute; z-index: 2; inset-inline-start: 50%; inset-block-start: 24%;
  inline-size: 92px; block-size: 92px; margin-inline-start: -46px;
  display: grid; place-content: center; justify-items: center; gap: 1px; padding: 10px; text-align: center;
  border: 3px double var(--au-petrol-200); border-radius: 50%;
  background: rgba(4, 21, 22, 0.55); color: var(--au-petrol-200); /* ~9.8:1 */
  transform: rotate(-8deg); opacity: 0.92; pointer-events: none;
}
.tk-stamp::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(127, 209, 203, 0.55); border-radius: 50%; }
.tk-stamp .icon { font-size: 14px; }
.tk-stamp b { font-family: var(--au-font-display); font-weight: 700; font-size: 0.9375rem; line-height: 1.15; }
.tk-stamp small {
  font-size: 0.625rem; line-height: 1.2; max-inline-size: 70px; overflow: hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow-wrap: anywhere;
}
@media (min-width: 768px) {
  .tk-stamp { inline-size: 112px; block-size: 112px; margin-inline-start: -56px; }
  .tk-stamp b { font-size: var(--au-text-lg); }
  .tk-stamp small { font-size: 0.6875rem; max-inline-size: 84px; }
}

/* Ports */
.tk-ports { position: relative; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--au-3); margin-block-start: 6px; }
.tk-port { min-inline-size: 0; }
.tk-port b { display: block; font-weight: 600; color: var(--au-night-ink); overflow-wrap: anywhere; line-height: 1.35; }
.tk-port span { display: block; font-size: var(--au-text-sm); color: var(--au-night-ink-2); }
.tk-port:last-child { text-align: end; }

/* Arrival block: night glass on the sea */
.tk-arrival {
  position: relative; margin-block-start: var(--au-4);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--au-3) var(--au-4);
  padding: 16px; border: 1px solid var(--au-night-line); border-radius: var(--au-radius-md);
  background: var(--au-glass-night); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.tk-when { min-inline-size: 0; }
.tk-when small, .tk-count small { display: block; color: var(--au-night-ink-2); font-size: var(--au-text-sm); }
.tk-when b { display: block; font-weight: 600; font-size: var(--au-text-lg); color: var(--au-night-ink); }
.tk-count { display: grid; justify-items: end; gap: 6px; }
.tk-board { display: flex; align-items: flex-end; gap: 8px; }
.tk-tiles { display: flex; gap: 4px; perspective: 400px; }
.tk-tile {
  position: relative; inline-size: 40px; block-size: 52px; display: grid; place-items: center;
  border: 1px solid var(--au-night-line); border-radius: 8px;
  background: linear-gradient(to bottom, #0A2425 0 50%, var(--au-night-deep) 50% 100%);
  color: var(--au-night-accent); /* ~9:1 on --au-night-deep */
  font-family: var(--au-font-mono); font-weight: 600; font-size: 2rem; line-height: 1; font-variant-numeric: tabular-nums;
  box-shadow: 0 6px 14px -8px rgba(0, 0, 0, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}
.tk-tile::after { content: ""; position: absolute; inset-inline: 0; inset-block-start: 50%; border-block-start: 1px solid rgba(0, 0, 0, 0.55); box-shadow: 0 1px 0 var(--au-night-line); }
.tk-unit { color: var(--au-night-ink); font-weight: 500; padding-block-end: 4px; }
.tk-today {
  display: inline-flex; align-items: center; min-block-size: 40px; padding-inline: 18px;
  border-radius: var(--au-radius-pill); background: var(--au-amber-500); color: var(--au-amber-ink); font-weight: 600;
}
.tk-calm { display: flex; align-items: center; gap: 10px; color: var(--au-night-ink-2); }
.tk-calm .icon { font-size: 20px; flex: none; }
/* On hold and delivered: a tighter hero, so the answer to "when" stays above the dock on a 390x780 screen. */
.state-onhold .tk-route, .state-delivered .tk-route { margin-block-start: var(--au-3); }
.state-onhold .tk-kicker, .state-delivered .tk-kicker { margin-block-start: var(--au-4); }
.state-onhold .tk-arrival, .state-delivered .tk-arrival { margin-block-start: var(--au-3); padding-block: 12px; }
.state-onhold .tk-route.is-chip-high { margin-block-start: calc(var(--au-3) + 24px); }
.state-delivered .tk-thanks { padding-block-start: var(--au-2); }
.tk-thanks { flex-basis: 100%; padding-block-start: var(--au-3); border-block-start: 1px dashed var(--au-night-line-strong); color: var(--au-night-ink); }

/* Desktop: copy beside the route, the postcard spans the whole shell. */
@media (min-width: 1100px) {
  .tk-hero {
    padding: 40px 44px;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.1fr); column-gap: 56px;
    grid-template-areas: "hello hello" "banner banner" "kicker route" "status route" "where route" "rest route" "arrival ports";
    grid-template-rows: auto auto auto auto auto minmax(var(--au-7), 1fr) auto;
  }
  .tk-hello-row { grid-area: hello; }
  .tk-banner { grid-area: banner; }
  .tk-kicker { grid-area: kicker; margin-block-start: var(--au-6); }
  .tk-status { grid-area: status; font-size: 3.5rem; }
  .tk-where { grid-area: where; align-self: start; margin-block-end: var(--au-4); }
  .tk-route, .tk-route.is-chip-high, .state-onhold .tk-route, .state-delivered .tk-route { grid-area: route; align-self: end; margin-block-start: var(--au-7); }
  .tk-ports { grid-area: ports; align-self: start; }
  .tk-arrival { grid-area: arrival; align-self: start; margin-block-start: var(--au-5); }
}

/* ---------- Voyage log ---------- */
.tk-tl { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.tk-step {
  position: relative; display: grid; grid-template-columns: 44px minmax(0, 1fr) auto; column-gap: var(--au-3); align-items: start;
  min-block-size: 56px; padding: 10px 8px; border-radius: var(--au-radius);
}
/* Rail: from this node's centre (10px + 22px) to the next one's (4px gap + 32px). */
.tk-step::before {
  content: ""; position: absolute; inset-inline-start: 29px; inset-block-start: 32px; inset-block-end: -36px;
  border-inline-start: 2px solid var(--tk-rail);
}
.tk-step:last-child::before { content: none; }
.tk-step.is-done:has(+ .is-now)::before { border-inline-start-color: var(--au-amber-500); }
.tk-step.is-now::before, .tk-step.is-next::before { border-inline-start: 2px dashed var(--au-line-strong); }
.tk-node {
  position: relative; z-index: 1; justify-self: center; display: grid; place-items: center; border-radius: 50%;
  inline-size: 36px; block-size: 36px; margin-block-start: 4px; font-size: 18px;
}
.tk-step-text { min-inline-size: 0; padding-block-start: 9px; }
.tk-name { display: block; font-weight: 500; color: var(--au-ink); line-height: 1.45; }
.tk-note { margin-block-start: 2px; max-inline-size: 60ch; color: var(--au-ink-2); font-size: var(--au-text-sm); line-height: var(--au-leading); }
.tk-when-col { padding-block-start: 9px; text-align: end; }

/* Done: a passport stamp */
.is-done .tk-node { background: var(--au-brand-fill); color: var(--au-on-brand); }
.tk-date {
  display: inline-flex; align-items: center; padding: 2px 8px; white-space: nowrap;
  border: 1.5px dashed var(--au-brand); border-radius: 6px; color: var(--au-brand);
  font-family: var(--au-font-mono); font-weight: 600; font-size: var(--au-text-xs); font-variant-numeric: tabular-nums;
}
/* IBM Plex Mono has no Arabic: Arabic month names use the text face (never a monospace fallback). */
:lang(ar) .tk-date, :lang(ar) .tk-sub-date { font-family: var(--au-font); font-weight: 600; }
/* Current: the paper's one amber */
.tk-step.is-now { background: var(--au-surface-2); box-shadow: var(--au-shadow-sm); }
.tk-step.is-now::after { content: ""; position: absolute; inset-block: 10px; inset-inline-start: 0; inline-size: 3px; border-radius: 3px; background: var(--au-amber-500); }
.is-now .tk-node { inline-size: 44px; block-size: 44px; margin-block-start: 0; font-size: 22px; background: var(--au-amber-500); color: var(--au-amber-ink); }
.is-now .tk-name { font-weight: 600; font-size: var(--au-text-lg); }
.is-now .tk-note { color: var(--au-ink-2); }
.tk-now {
  display: inline-flex; align-items: center; padding: 3px 12px; white-space: nowrap;
  border-radius: var(--au-radius-pill); background: var(--au-amber-500); color: var(--au-amber-ink); font-weight: 600; font-size: var(--au-text-sm);
}
/* Upcoming */
.is-next .tk-node { inline-size: 32px; block-size: 32px; margin-block-start: 6px; font-size: 16px; background: var(--au-surface); border: 1.5px dashed var(--au-line-strong); color: var(--au-ink-3); }
.is-next .tk-name { color: var(--au-ink-3); font-weight: 400; }
.tk-exp { color: var(--au-ink-3); font-size: var(--au-text-sm); white-space: nowrap; }
/* Delivered and cancelled endings */
.tk-step.is-arrived .tk-node { inline-size: 44px; block-size: 44px; margin-block-start: 0; font-size: 22px; background: var(--au-amber-500); color: var(--au-amber-ink); }
.tk-step.is-arrived .tk-name { font-weight: 600; }
.tk-step.is-arrived .tk-date { background: var(--au-brand-fill); border: 1.5px solid var(--au-brand-fill); color: var(--au-on-brand); }
.tk-step.is-cancel .tk-node { background: var(--au-danger-tint); color: var(--au-danger); }
.tk-step.is-cancel .tk-name { font-weight: 600; }
/* On hold: the warning tone, not the amber fill */
.state-onhold .tk-step.is-now::after { background: var(--au-warning); }
.state-onhold .is-now .tk-node { background: var(--au-warning-tint); color: var(--au-warning); }
.state-onhold .tk-now { background: transparent; border: 1.5px solid var(--au-accent-text); color: var(--au-accent-text); }
.state-onhold .tk-step.is-done:has(+ .is-now)::before { border-inline-start-color: var(--au-warning); }

/* Earlier updates of the same step, newest first */
.tk-sub {
  list-style: none; margin: var(--au-2) 0 0; padding: 0; padding-inline-start: 14px;
  border-inline-start: 1px solid var(--au-line); display: grid; gap: 6px;
  font-size: var(--au-text-sm); color: var(--au-ink-2);
}
.tk-sub li { position: relative; }
.tk-sub li::before { content: ""; position: absolute; inset-inline-start: -17.5px; inset-block-start: 0.62em; inline-size: 6px; block-size: 6px; border-radius: 50%; background: var(--au-line-strong); }
.tk-sub-date { margin-inline-end: 6px; white-space: nowrap; color: var(--au-ink-3); font-family: var(--au-font-mono); font-variant-numeric: tabular-nums; }

/* ---------- Photos: film strip on phones, grid from 640px ---------- */
.tk-strip {
  display: grid; grid-auto-flow: column; grid-auto-columns: 72%; gap: var(--au-3);
  overflow-x: auto; overscroll-behavior-inline: contain; scroll-snap-type: x mandatory;
  margin-inline: calc(-1 * var(--tk-pad)); padding-inline: var(--tk-pad); scroll-padding-inline: var(--tk-pad);
  padding-block: 4px var(--au-2); scrollbar-width: thin; /* room for the focus ring */
}
@media (min-width: 640px) {
  .tk-strip { grid-auto-flow: row; grid-template-columns: repeat(3, minmax(0, 1fr)); overflow: visible; margin-inline: 0; padding-inline: 0; padding-block-end: 0; }
  .tk-strip.is-many .photo:first-child { grid-column: span 2; grid-row: span 2; aspect-ratio: auto; }
}
.photo {
  position: relative; display: block; overflow: hidden; aspect-ratio: 4 / 3; scroll-snap-align: start;
  border-radius: var(--au-radius); background: var(--au-surface-2);
}
.photo img { display: block; inline-size: 100%; block-size: 100%; object-fit: cover; transition: transform var(--au-dur-slow) var(--au-ease); }
.photo span {
  position: absolute; inset-inline-start: 8px; inset-block-end: 8px; max-inline-size: calc(100% - 16px);
  padding: 3px 10px; border-radius: var(--au-radius-pill); background: var(--au-night-2); color: var(--au-night-ink); /* >= 12:1 */
  font-size: var(--au-text-xs); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.photo:focus-visible { outline: 2px solid var(--au-focus); outline-offset: 2px; }
@media (hover: hover) { .photo:hover img { transform: scale(1.04); } }

/* Lightbox (public.js: dialog.lightbox, .lb-btn, data-lb) */
.lightbox { padding: 0; border: 0; background: transparent; max-inline-size: 100vw; max-block-size: 100vh; inline-size: 100%; block-size: 100%; }
.lightbox::backdrop { background: color-mix(in srgb, var(--au-night-deep) 94%, transparent); }
.lightbox[open] { display: grid; place-items: center; }
.lightbox figure { margin: 0; display: grid; gap: var(--au-2); justify-items: center; padding: var(--au-7) var(--au-4); pointer-events: none; }
.lightbox img { max-inline-size: min(1600px, 100%); max-block-size: calc(100vh - 160px); border-radius: var(--au-radius-sm); pointer-events: auto; }
.lightbox figcaption { color: var(--au-night-ink); font-size: var(--au-text-sm); }
.lb-btn {
  position: fixed; inline-size: 48px; block-size: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 24px;
  border: 1px solid var(--au-night-line-strong); color: var(--au-night-ink);
  background: var(--au-glass-night); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  transition: background-color var(--au-dur-fast) var(--au-ease), transform var(--au-dur-fast) var(--au-ease);
}
.lb-btn:hover { background: rgba(255, 255, 255, 0.14); }
.lb-btn:active { transform: scale(0.94); }
.lb-close { inset-block-start: var(--au-4); inset-inline-end: var(--au-4); }
.lb-prev { inset-inline-start: var(--au-4); inset-block-start: 50%; margin-block-start: -24px; }
.lb-next { inset-inline-end: var(--au-4); inset-block-start: 50%; margin-block-start: -24px; }
[dir="rtl"] .lb-prev .icon, [dir="rtl"] .lb-next .icon { transform: scaleX(-1); }

/* ---------- Vehicle manifest ---------- */
.tk-car-head { display: flex; align-items: center; gap: var(--au-3); margin-block-end: var(--au-4); }
.tk-car-ic { inline-size: 56px; block-size: 56px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--au-brand-tint); color: var(--au-brand); font-size: 28px; }
.tk-car-head > div { min-inline-size: 0; }
.tk-car-kicker { color: var(--au-ink-3); font-size: var(--au-text-sm); }
.tk-car h2 { font-family: var(--au-font-display); font-weight: 700; font-size: var(--au-text-xl); line-height: var(--au-leading-tight); color: var(--au-ink); overflow-wrap: anywhere; }
.tk-car-line { color: var(--au-ink-2); font-size: var(--au-text-sm); margin-block-start: 2px; }
.tk-vin {
  display: grid; gap: 2px; margin-block-start: var(--au-3); padding: 10px 14px;
  background: var(--au-surface-2); border: 1px dashed var(--au-line-strong); border-radius: var(--au-radius-sm);
}
.tk-vin small { color: var(--au-ink-3); font-size: var(--au-text-xs); }
.tk-vin b { font-family: var(--au-font-mono); font-weight: 600; letter-spacing: 0.04em; overflow-wrap: anywhere; color: var(--au-ink); }
.tk-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: var(--au-3); margin: 0; }
.tk-facts > div { min-inline-size: 0; padding-block: 10px; border-block-start: 1px dashed var(--au-line); }
.tk-facts > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
.tk-facts dt { color: var(--au-ink-3); font-size: var(--au-text-xs); }
.tk-facts dd { margin: 0; font-weight: 500; color: var(--au-ink); overflow-wrap: anywhere; }
.tk-mono { font-family: var(--au-font-mono); }
.tk-facts-1 { grid-template-columns: minmax(0, 1fr); }
[dir="rtl"] .tk-facts dd.ltr { text-align: right; }
.tk-manifest {
  display: flex; align-items: center; gap: var(--au-3); margin-block-start: var(--au-3); padding: 12px 14px;
  border: 1px solid var(--au-line-strong); border-radius: var(--au-radius-sm); background: var(--au-surface-2);
  color: var(--au-ink); text-decoration: none;
  transition: border-color var(--au-dur-fast) var(--au-ease), background-color var(--au-dur-fast) var(--au-ease);
}
.tk-manifest:hover { border-color: var(--au-brand); background: var(--au-brand-tint); }
.tk-manifest:focus-visible { outline: 2px solid var(--au-brand); outline-offset: 2px; }
.tk-manifest-ic { inline-size: 40px; block-size: 40px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--au-brand-tint); color: var(--au-brand); font-size: 20px; }
.tk-manifest-text { display: grid; min-inline-size: 0; flex: 1; }
.tk-manifest-text small { color: var(--au-ink-3); font-size: var(--au-text-xs); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tk-manifest-go { flex: none; color: var(--au-brand); font-size: 20px; }

/* ---------- Notifications (push.js contract untouched; restyle only) ---------- */
.tk-push {
  display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: var(--au-3) var(--au-4); align-items: center;
  padding: var(--au-4) var(--tk-pad); border: 1px solid var(--au-line); border-radius: var(--au-radius-lg);
  background: var(--au-surface); box-shadow: var(--au-shadow-sm);
}
.tk-push .push-head { display: contents; }
.tk-push .push-ic {
  inline-size: 48px; block-size: 48px; border-radius: 50%; display: grid; place-items: center; font-size: 24px; align-self: start;
  background: var(--au-brand-tint); color: var(--au-brand);
}
.tk-push .push-ic .icon { transform-origin: 50% 10%; }
.tk-push .push-text { display: grid; gap: 2px; min-inline-size: 0; }
.tk-push .push-text h2 { font-size: var(--au-text-md); font-weight: 600; color: var(--au-ink); }
.tk-push .push-text p { color: var(--au-ink-2); font-size: var(--au-text-sm); }
.tk-push .push-ok { color: var(--au-success); vertical-align: -3px; }
.tk-push .push-error { color: var(--au-danger); font-weight: 500; }
.tk-push .push-actions { grid-column: 1 / -1; display: flex; flex-wrap: wrap; gap: var(--au-2); }
.tk-push .push-actions .btn { flex: 1 1 auto; }
.tk-push[data-state="on"] .push-ic { background: var(--au-success-tint); color: var(--au-success); }
@media (min-width: 560px) {
  .tk-push { grid-template-columns: 48px minmax(0, 1fr) auto; }
  .tk-push .push-actions { grid-column: auto; }
  .tk-push .push-actions .btn { flex: none; }
}

/* ---------- Contact dock: a floating glass pill ---------- */
.tk-dock {
  position: fixed; z-index: 20; inset-inline: var(--au-3); inset-block-end: calc(var(--au-3) + env(safe-area-inset-bottom));
  max-inline-size: 560px; margin-inline: auto; padding: 6px;
  border: 1px solid var(--au-glass-line); border-radius: var(--au-radius-pill);
  background: var(--au-glass); -webkit-backdrop-filter: blur(16px) saturate(140%); backdrop-filter: blur(16px) saturate(140%);
  box-shadow: var(--au-shadow-lg);
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) { .tk-dock { background: var(--au-surface); } }
.tk-dock > div { display: flex; align-items: center; gap: 6px; }
.tk-dock .btn { block-size: 52px; }
.tk-dock .btn-primary { flex: 1 1 auto; min-inline-size: 0; padding-inline: var(--au-4); font-weight: 600; box-shadow: 0 10px 22px -12px rgba(7, 43, 44, 0.8); }
.tk-dock .btn-primary span { overflow: hidden; text-overflow: ellipsis; }
.tk-dock .btn-primary .icon { font-size: 22px; }
.tk-dock .btn-ghost { flex: none; inline-size: 52px; padding: 0; background: var(--au-surface); border-color: var(--au-line-strong); }
.tk-dock .btn-ghost:hover { background: var(--au-brand-tint); border-color: var(--au-ink-2); }
.tk-dock .is-done { border-color: var(--au-success); color: var(--au-success); }
.tk-dock-label { display: none; }
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .tk-dock .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 14px 26px -12px rgba(7, 43, 44, 0.9); }
  .tk-dock .btn-primary:active { transform: scale(0.98); }
}
@media (min-width: 1100px) {
  .tk-dock { max-inline-size: 660px; }
  .tk-dock-label { display: block; flex: none; padding-inline: 16px 6px; color: var(--au-ink-2); font-size: var(--au-text-sm); font-weight: 500; white-space: nowrap; }
}

/* ---------- Footer ---------- */
.tk-foot { display: grid; justify-items: center; gap: var(--au-2); padding-block: var(--au-6) var(--au-2); text-align: center; color: var(--au-ink-3); font-size: var(--au-text-sm); }
.tk-foot .tk-foot-line { inline-size: 140px; opacity: 0.7; }
.tk-foot .tk-foot-line .j-base { stroke: var(--au-line-strong); }
.tk-foot .tk-foot-line .j-done { stroke: var(--au-brand); }
.tk-foot .tk-foot-line .j-origin, .tk-foot .tk-foot-line .j-dest { fill: var(--au-brand); }

/* ---------- Not found (TrackingNotFound.razor) ---------- */
.tk.tk-lost-page { padding-block: var(--au-4) var(--au-7); }
.tk-lost {
  position: relative; isolation: isolate; overflow: clip;
  inline-size: 100%; max-inline-size: 640px; margin-inline: auto;
  display: grid; justify-items: center; gap: var(--au-3); text-align: center;
  padding: var(--au-6) var(--au-5) calc(var(--au-7) + 24px);
  border-radius: var(--au-radius-xl); box-shadow: var(--au-shadow-lg);
  color: var(--au-night-ink);
  background: linear-gradient(to bottom, var(--tk-sky-1), var(--tk-sky-2) 55%, var(--tk-sky-3));
}
.tk-lost .tks-land { block-size: 96px; }
.tk-lost-art { position: relative; inline-size: min(100%, 320px); }
.tk-lost-art svg { display: block; inline-size: 100%; block-size: auto; }
[dir="rtl"] .tk-lost-art svg { transform: scaleX(-1); }
.tkl-arc { fill: none; stroke-width: 2.5; stroke-linecap: round; stroke-dasharray: 2 8; }
.tkl-arc-end { fill: none; stroke: rgba(255, 255, 255, 0.14); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 8; }
.tkl-pin { fill: var(--au-amber-500); }
.tkl-pin-end { fill: none; stroke: var(--au-night-ink-3); stroke-width: 1.5; stroke-dasharray: 2 3; }
.tk-lost-ic {
  position: absolute; inset-inline-start: 63%; inset-block-start: 41%; margin-inline-start: -32px; margin-block-start: -32px;
  inline-size: 64px; block-size: 64px; border-radius: 50%; display: grid; place-items: center; font-size: 28px;
  border: 1px solid var(--au-night-line-strong); color: var(--au-night-ink);
  background: var(--au-glass-night); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.tk-lost h1 { font-family: var(--au-font-display); font-weight: 700; font-size: clamp(1.5rem, 5vw, 2rem); line-height: var(--au-leading-tight); text-wrap: balance; margin-block-start: var(--au-2); }
:lang(ar) .tk-lost h1 { line-height: var(--au-leading-display-ar); }
.tk-lost p { max-inline-size: 46ch; color: var(--au-night-ink-2); text-wrap: pretty; }
.tk-lost-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: var(--au-2); margin-block-start: var(--au-3); }
.tk-lost-actions .btn { block-size: 52px; }
@media (max-width: 479.98px) { .tk-lost-actions { inline-size: 100%; } .tk-lost-actions .btn { flex: 1 1 100%; } }

/* ---------- /track lookup: the landing's boarding pass on the sand page ---------- */
.lookup.tk-lookup { max-inline-size: 460px; margin-block: var(--au-6) var(--au-8); margin-inline: auto; }
.ticket.tk-pass { grid-column: auto; justify-self: auto; max-inline-size: none; color: var(--au-night-ink); }
.tk-pass::before { box-shadow: var(--au-shadow-lg); }
.tk-pass .ticket-stub, .tk-pass .ticket-main { background: var(--au-night-2); -webkit-backdrop-filter: none; backdrop-filter: none; border-color: transparent; }
.tk-pass .ticket-stub { padding-block-start: 0; }
.tk-pass-sky {
  position: relative; isolation: isolate; overflow: clip; block-size: 96px; margin: 0 -24px 18px;
  border-start-start-radius: var(--au-radius-lg); border-start-end-radius: var(--au-radius-lg);
  background: linear-gradient(to bottom, var(--tk-sky-1), var(--tk-sky-2) 60%, var(--tk-sky-3));
}
.tk-pass-arc { position: absolute; inset: 0; inline-size: 100%; block-size: 100%; max-inline-size: none; overflow: visible; }
[dir="rtl"] .tk-pass-arc { transform: scaleX(-1); }
.tk-pass-lane { fill: none; stroke: var(--au-lane-night); stroke-width: 2; stroke-linecap: round; stroke-dasharray: 2 7; }
.tk-pass-sea { fill: var(--tk-sea-1); }
.tk-pass-horizon { fill: var(--au-amber-500); opacity: 0.5; }
.tk-pass-pin { fill: var(--tk-sky-3); stroke: var(--au-night-ink-2); stroke-width: 1.5; }
.tk-pass-car { fill: var(--au-amber-500); }
.tk-pass-glyph { fill: var(--au-amber-ink); }
.tk-pass-title { font-family: var(--au-font-display); font-weight: 700; font-size: var(--au-text-2xl); line-height: var(--au-leading-tight); color: var(--au-night-ink); margin-block: 2px 6px; }
:lang(ar) .tk-pass-title { line-height: var(--au-leading-display-ar); }
.tk-pass-help { color: var(--au-night-ink-2); font-size: var(--au-text-sm); margin-block-end: 18px; }
.tk-pass-alert {
  display: flex; align-items: flex-start; gap: 10px; margin-block-end: 16px; padding: 12px 14px;
  border: 1px solid #F08A80; border-radius: 12px; background: rgba(240, 138, 128, 0.08);
  color: var(--au-night-ink); font-size: var(--au-text-sm);
}
.tk-pass-alert .icon { color: #F08A80; font-size: 20px; flex: none; margin-block-start: 1px; }

/* ---------- Motion: about 3s once, then ambient loops only ---------- */
@media (prefers-reduced-motion: no-preference) {
  .tk-rise { animation: tk-rise 500ms var(--au-ease-out) both; animation-delay: calc(var(--i, 0) * 70ms); }
  .tk-route-done, .tk-route-halo { animation: tk-draw var(--au-dur-route) var(--au-ease) 400ms both; }
  .tks-glow { animation: tk-glow 2.4s var(--au-ease) 400ms both; }
  .tk-tile { animation: tk-flap 380ms var(--au-ease-out) both; animation-delay: calc(900ms + var(--i, 0) * 60ms); }
  .tk-chip { animation: tk-pop 220ms var(--pub-overshoot) 2.8s both; }
  .tk-pulse { animation: pulse 2.4s ease-out infinite; }
  .tks-harbour circle { animation: tk-flicker 3.2s steps(2, jump-none) infinite; animation-delay: var(--d, 0s); }
  .tks-sun, .tks-sun-halo { animation: tk-rise-sun 2.4s var(--au-ease-out) 300ms both; }
  .tks-twinkle { animation: tk-twinkle 5.5s ease-in-out infinite; animation-delay: var(--d, 0s); }
  .tks-wave { animation: tk-drift 14s linear infinite; }
  .tks-wave-2 { animation-duration: 20s; }
  .tk-step.is-now .tk-node { animation: tk-node 2.4s ease-out infinite; }
  .state-onhold .tk-step.is-now .tk-node { animation: none; }
  .state-onhold .tks-twinkle { animation: none; }
  .tk-burst { animation: tk-burst 1.2s var(--au-ease-out) 2.8s both; transform-origin: 0 0; }
  .tk-stamp { animation: tk-stamp 260ms cubic-bezier(0.3, 1.6, 0.5, 1) 2.9s both; }
  .state-delivered .tk-hero { animation: tk-thud 160ms ease-out 3.06s; }
  .tk-pin-halo { animation: tk-halo 600ms var(--au-ease-out) 2.8s both; }
  .tk-push:not([data-state="on"]) .push-ic .icon { animation: tk-swing 700ms ease-in-out 200ms both; }
  .tk-hero.is-offscreen *, .tk-hero.is-offscreen *::before, .tk-hero.is-offscreen *::after { animation-play-state: paused; }
}
@keyframes tk-rise { from { opacity: 0; transform: translateY(16px); } }
@keyframes tk-draw { from { stroke-dashoffset: var(--progress); } to { stroke-dashoffset: 0; } }
@keyframes tk-glow { from { opacity: calc(var(--tk-glow) * 0.45); } }
@keyframes tk-flap { from { opacity: 0; transform: rotateX(90deg); } }
@keyframes tk-pop { from { opacity: 0; scale: 0.6; } }
@keyframes tk-twinkle { 50% { opacity: 0.08; } }
@keyframes tk-flicker { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes tk-rise-sun { from { transform: translateY(10px); opacity: 0; } }
@keyframes tk-drift { to { transform: translateX(-80px); } }
@keyframes tk-node { 0% { box-shadow: 0 0 0 0 var(--au-glow); } 70%, 100% { box-shadow: 0 0 0 12px rgba(242, 163, 58, 0); } }
@keyframes tk-burst { 0% { opacity: 0; transform: scale(0.3); } 12% { opacity: 1; } 100% { opacity: 0; transform: scale(1.7); } }
@keyframes tk-stamp { from { opacity: 0; transform: rotate(-8deg) scale(1.6); } to { opacity: 0.92; transform: rotate(-8deg) scale(1); } }
@keyframes tk-thud { 50% { transform: translateY(2px); } }
@keyframes tk-halo { from { opacity: 0; } }
@keyframes tk-swing { 20% { transform: rotate(12deg); } 45% { transform: rotate(-10deg); } 70% { transform: rotate(5deg); } 100% { transform: rotate(0); } }

/* Reduced motion: every keyframe off; the static marker, the chip and the stamp in their final state, no burst. */
@media (prefers-reduced-motion: reduce) {
  .tk-rise, .tk-route-done, .tk-route-halo, .tks-glow, .tk-tile, .tk-chip, .tk-pulse, .tks-twinkle, .tks-wave, .tk-node, .tks-harbour circle, .tks-sun, .tks-sun-halo,
  .tk-burst, .tk-stamp, .tk-hero, .tk-pin-halo, .push-ic .icon, .tk-pass .ticket-stub, .tk-pass .ticket-main, .tk-pass::before { animation: none !important; }
  .tk-burst { display: none; }
  .tk-hero, .tk-sky stop, .tks-stars, .tks-ridge, .photo img { transition: none !important; }
}

/* The boarding pass on /track rises right away (the landing waits for its copy). */
@media (prefers-reduced-motion: no-preference) {
  .tk-pass .ticket-stub, .tk-pass::before { animation-delay: 80ms; }
  .tk-pass .ticket-main { animation-delay: 160ms; }
}

/* ---------- Print: dark text on white, the route in petrol ---------- */
@media print {
  .tk-dock, .tk-sky, .tk-push, .tk-burst, .tk-chip, .tk-copy, .tks-wave, .tks-sea, .tks-ridge, .tks-glow, .tks-moon, .tks-sun, .tks-sun-halo, .tks-harbour, .tks-road, .tks-dune, .tk-top .tools { display: none !important; }
  .tk { padding-block-end: 0; }
  .tk-shell .tk-top .brand { color: #12686A !important; }
  .tk-shell .tk-top .brand small { color: #4A5B59 !important; }
  .tk-hero { margin-block-start: 0 !important; padding-block-start: var(--au-5) !important; }
  .tk-hero { margin-inline: 0; background: none; color: #10201F; box-shadow: none; border: 1px solid #CDBFA5; }
  .tk-hero::after { content: none; }
  .tk-hello, .tk-kicker, .tk-where, .tk-port span, .tk-when small, .tk-count small, .tk-banner, .tk-calm { color: #4A5B59; }
  .tk-status, .tk-port b, .tk-when b, .tk-unit, .tk-banner b, .tk-thanks { color: #10201F; }
  .tk-route-done { stroke: #12686A; }
  .tk-route-halo { display: none; }
  .tk-route-base { stroke: #958A75; }
  .tk-arrival, .tk-banner { background: none; border-color: #CDBFA5; }
  .tk-tile { background: none; color: #10201F; border-color: #958A75; box-shadow: none; }
  .tk-stamp { background: none; color: #12686A; border-color: #12686A; }
  .tk-step.is-now { box-shadow: none; }
}

/* Cancelled: no amber anywhere on the page (kicker, horizon, plate band go neutral). */
.state-cancelled .tk-kicker { color: var(--au-night-ink-2); }
.state-cancelled .tk-kicker::before { background: var(--au-night-ink-3); }
.state-cancelled .tks-horizon { filter: grayscale(1); opacity: 0.35; }
.state-cancelled .tk-plate::before { background: var(--au-night-ink-3); }
/* A banner already opens the hero: tighten the gap so the arrival block stays above the fold. */
.tk-banner + .tk-kicker { margin-block-start: var(--au-4); }
