/* One item, one century: styles for time-cargo.html and time-cargo-ro.html.
   Semantic tokens only; the terrain ramp is read from --t0..--t4 by the canvas. */

:root {
    color-scheme: dark;
    --bg: #0b1220;
    --raise: #121c30;
    --raise-2: #19253d;
    --ink: #f1f4f9;
    --ink-2: #c9d3e2;
    --ink-3: #a3b3ca;
    --line: #2b3b57;
    --accent: #f0c35a;
    --accent-ink: #1b1405;
    --ice: #86d6e3;
    --warn: #ff9f7a;
    --good: #8fe0b0;
    --t0: #16233f;
    --t1: #1d5f7c;
    --t2: #3ba9a2;
    --t3: #dcc25a;
    --t4: #fff3c4;
    --unseen: rgba(163, 179, 202, 0.18);
    --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    --serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
    --sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --topbar: 3.25rem;
}

:root[data-theme="light"] {
    color-scheme: light;
    --bg: #f7f2e8;
    --raise: #fffdf8;
    --raise-2: #f0e9d9;
    --ink: #17202f;
    --ink-2: #364256;
    --ink-3: #3f4a5d;
    --line: #d6cdb9;
    --accent: #664000;
    --accent-ink: #fffaf0;
    --ice: #074d5c;
    --warn: #8a2d0b;
    --good: #0c552e;
    --t0: #efe6d2;
    --t1: #c9cfa9;
    --t2: #78b0a2;
    --t3: #2c7886;
    --t4: #0d3b55;
    --unseen: rgba(79, 92, 113, 0.16);
    --shadow: 0 10px 40px rgba(60, 44, 10, 0.16);
}

@media (prefers-color-scheme: light) {
    :root:not([data-theme="dark"]) {
        color-scheme: light;
        --bg: #f7f2e8;
        --raise: #fffdf8;
        --raise-2: #f0e9d9;
        --ink: #17202f;
        --ink-2: #364256;
        --ink-3: #3f4a5d;
        --line: #d6cdb9;
        --accent: #664000;
        --accent-ink: #fffaf0;
        --ice: #074d5c;
        --warn: #8a2d0b;
        --good: #0c552e;
        --t0: #efe6d2;
        --t1: #c9cfa9;
        --t2: #78b0a2;
        --t3: #2c7886;
        --t4: #0d3b55;
        --unseen: rgba(79, 92, 113, 0.16);
        --shadow: 0 10px 40px rgba(60, 44, 10, 0.16);
    }
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }
svg[hidden] { display: none !important; }

html {
    font-size: 17px;
    scroll-behavior: smooth;
    scroll-padding-top: calc(var(--topbar) + var(--sticky-h, 0px) + 0.75rem);
    -webkit-text-size-adjust: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: var(--sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

a { color: var(--accent); text-underline-offset: 0.18em; }
a:hover { text-decoration-thickness: 2px; }

:focus-visible {
    outline: 3px solid var(--ice);
    outline-offset: 2px;
    border-radius: 4px;
}

.skip {
    position: absolute; left: -999px; top: 0; z-index: 100;
    background: var(--accent); color: var(--accent-ink); padding: 0.6rem 1rem;
}
.skip:focus { left: 0.5rem; top: 0.5rem; }

/* ---- Topbar ---- */
.topbar {
    position: sticky; top: 0; z-index: 50;
    height: var(--topbar);
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0 max(1rem, env(safe-area-inset-left));
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}
.topbar .brand {
    font-family: var(--serif); font-weight: 700; font-size: 1.02rem;
    color: var(--ink); text-decoration: none; white-space: nowrap;
}
.topbar nav { display: flex; gap: 0.15rem; margin-left: auto; overflow-x: auto; scrollbar-width: none; }
.topbar nav::-webkit-scrollbar { display: none; }
.topbar nav a, .tb-btn {
    font-size: 0.82rem; font-weight: 600; color: var(--ink-2);
    text-decoration: none; padding: 0.55rem 0.7rem; border-radius: 8px;
    min-height: 44px; min-width: 44px; justify-content: center; display: inline-flex; align-items: center; white-space: nowrap;
    background: none; border: 0; cursor: pointer; font-family: inherit;
}
.topbar nav a:hover, .tb-btn:hover { background: var(--raise-2); color: var(--ink); }
.topbar nav a[aria-current="true"] { color: var(--accent); }
.tb-btn svg { width: 1.15rem; height: 1.15rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.lang-switch { display: inline-flex; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.lang-switch a { min-height: 44px; min-width: 44px; justify-content: center; padding: 0 0.7rem; display: inline-flex; align-items: center; font-size: 0.78rem; font-weight: 700; color: var(--ink-2); text-decoration: none; }
.lang-switch a[aria-current="true"] { background: var(--accent); color: var(--accent-ink); }

/* ---- Language suggestion (never a redirect) ---- */
.suggest { display: flex; flex-wrap: wrap; gap: 0.5rem 0.8rem; align-items: center; justify-content: center; padding: 0.5rem 1rem; background: var(--raise-2); border-bottom: 1px solid var(--line); font-size: 0.88rem; color: var(--ink); }

/* ---- Hero ---- */
.hero { padding: 1.4rem 0 2.2rem; }
.kicker { font-size: 0.84rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ice); margin-bottom: 0.9rem; }
.hero h1 {
    font-family: var(--serif); font-weight: 700; line-height: 1.12;
    font-size: clamp(1.75rem, 3.6vw, 2.9rem); color: var(--ink);
    text-wrap: balance;
}
.deck { margin-top: 1.1rem; max-width: 60ch; font-size: 1.08rem; color: var(--ink-2); }
.hero-actions { margin-top: 1.5rem; display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; }

.btn {
    font: inherit; font-size: 0.92rem; font-weight: 700;
    min-height: 44px; padding: 0.55rem 1.15rem; border-radius: 10px; cursor: pointer;
    border: 1px solid var(--line); background: var(--raise); color: var(--ink);
    display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none;
    transition: transform 0.15s, border-color 0.15s, background 0.15s;
}
.btn:hover { border-color: var(--accent); transform: translateY(-1px); }
.btn.primary { background: var(--accent); color: var(--accent-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.06); }
.btn.quiet { background: transparent; }
.btn.small { min-height: 44px; padding: 0.4rem 0.85rem; font-size: 0.84rem; }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; transform: none; }

/* ---- Workbench: sticky terrain + content ---- */
.workbench {
    max-width: 1220px; margin: 0 auto; padding: 1.2rem 1.25rem 4rem;
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(360px, 470px); gap: 2.6rem; align-items: start;
}

.terrain-col { position: sticky; top: calc(var(--topbar) + 0.75rem); z-index: 5; grid-column: 2; grid-row: 1; }
.content-col { grid-column: 1; grid-row: 1; }
.terrain-card {
    background: var(--raise); border: 1px solid var(--line); border-radius: 14px;
    padding: 0.9rem 0.9rem 0.7rem; box-shadow: var(--shadow);
}
.terrain-title { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.5rem; }
.terrain-stage { position: relative; }
#terrain { display: block; width: 100%; height: min(540px, calc(100svh - 14rem)); touch-action: manipulation; cursor: default; }
.terrain-tip {
    position: absolute; pointer-events: none; z-index: 3; max-width: 17rem;
    background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 8px;
    padding: 0.4rem 0.6rem; font-size: 0.78rem; line-height: 1.35; box-shadow: var(--shadow);
}
.terrain-legend { display: flex; align-items: center; gap: 0.6rem; margin-top: 0.55rem; font-size: 0.74rem; color: var(--ink-3); }
.ramp { flex: 1; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--t0), var(--t1), var(--t2), var(--t3), var(--t4)); border: 1px solid var(--line); }
.terrain-foot { display: flex; gap: 0.6rem; align-items: center; justify-content: space-between; margin-top: 0.4rem; }
.terrain-status { flex: 1; font-size: 0.8rem; color: var(--ink-2); min-height: 1.3em; }
.terrain-foot .btn { flex: none; }

.content-col { min-width: 0; }
.step { padding-top: 0.2rem; }
.step > h2, .section-h {
    font-family: var(--serif); font-size: clamp(1.45rem, 2.6vw, 1.95rem); line-height: 1.2; margin-bottom: 0.55rem;
}
.lede { color: var(--ink-2); max-width: 62ch; margin-bottom: 1.1rem; }

/* ---- Object cards ---- */
.cargo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 0.75rem; }
.cargo {
    text-align: left; font: inherit; color: inherit; cursor: pointer; position: relative;
    background: var(--raise); border: 1px solid var(--line); border-radius: 12px;
    padding: 0.85rem 0.9rem 0.9rem; min-height: 8.6rem; display: flex; flex-direction: column; gap: 0.2rem;
    transition: transform 0.15s, border-color 0.15s;
}
.cargo:hover { transform: translateY(-2px); border-color: var(--accent); }
.cargo .emoji { font-size: 1.7rem; line-height: 1; }
.cargo .nm { font-family: var(--serif); font-weight: 700; font-size: 1rem; line-height: 1.2; margin-top: 0.25rem; }
.cargo .sb { font-size: 0.76rem; color: var(--ink-3); }
.cargo .tg { font-size: 0.82rem; color: var(--ink-2); margin-top: auto; padding-top: 0.35rem; }
.cargo .done {
    position: absolute; top: 0.55rem; right: 0.6rem; font-size: 0.7rem; font-weight: 700;
    padding: 0.1rem 0.45rem; border-radius: 99px; background: var(--raise-2); color: var(--ink); border: 1px solid var(--line);
}

/* ---- Briefing + eras ---- */
.brief-head { display: flex; gap: 1rem; align-items: flex-start; margin-bottom: 0.9rem; }
.brief-head .emoji { font-size: 2.6rem; line-height: 1; }
.brief-head h2 { margin-bottom: 0.1rem; }
.brief-head .sb { color: var(--ink-3); font-size: 0.85rem; }
.briefing { max-width: 62ch; color: var(--ink-2); margin-bottom: 0.9rem; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1rem; }
.tag { font-size: 0.72rem; font-weight: 700; padding: 0.15rem 0.55rem; border-radius: 99px; border: 1px solid var(--line); color: var(--ink-2); }
.hint { margin: 0.2rem 0 1.1rem; }
.hint-text { margin-top: 0.5rem; color: var(--ice); font-size: 0.92rem; }
.era-list { display: grid; gap: 0.6rem; list-style: none; }
.era {
    width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer;
    background: var(--raise); border: 1px solid var(--line); border-radius: 12px; padding: 0.8rem 1rem;
    display: grid; grid-template-columns: 5.6rem minmax(0, 1fr) auto; gap: 0.2rem 1rem; align-items: center;
    transition: border-color 0.15s, transform 0.15s;
}
.era:hover { border-color: var(--accent); transform: translateX(2px); }
.era .yrs { grid-row: span 2; font-family: var(--serif); font-weight: 700; font-size: 0.98rem; color: var(--accent); line-height: 1.2; }
.era .en { font-weight: 700; }
.era .pl { font-size: 0.78rem; color: var(--ink-3); }
.era .cr { grid-column: 2 / 4; font-size: 0.86rem; color: var(--ink-2); }
.era .go { grid-row: 1; grid-column: 3; font-size: 0.8rem; font-weight: 700; color: var(--accent); }
.era[data-visited="true"] { border-style: dashed; }

/* ---- Journey ---- */
.landing-head {
    border-left: 4px solid var(--accent); padding: 0.2rem 0 0.2rem 1rem; margin-bottom: 1.1rem;
}
.landing-head .when { font-family: var(--serif); font-size: clamp(2rem, 6vw, 3.2rem); font-weight: 700; line-height: 1; color: var(--accent); }
.landing-head .where { color: var(--ink-2); margin-top: 0.25rem; }
.beats { display: grid; gap: 1rem; }
.beat { animation: rise 0.5s ease both; }
.beat h3 { font-size: 0.74rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ice); margin-bottom: 0.25rem; }
.beat p { max-width: 64ch; font-size: 1.02rem; }
.outcome-lead { font-family: var(--serif); font-size: 1.25rem; font-weight: 700; margin-bottom: 0.4rem; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.next-row { margin-top: 1.1rem; display: flex; gap: 0.6rem; flex-wrap: wrap; }

/* ---- Result ---- */
.result { margin-top: 1.6rem; padding-top: 1.4rem; border-top: 1px solid var(--line); }
.meter-row { display: grid; grid-template-columns: minmax(0, 1fr); gap: 0.3rem 1.2rem; margin-bottom: 0.8rem; }
.big-num { font-family: var(--serif); font-size: clamp(3rem, 10vw, 5rem); font-weight: 700; line-height: 0.9; color: var(--accent); }
.big-num small { font-size: 0.35em; color: var(--ink-3); font-weight: 400; margin-left: 0.2em; }
.verdict-line { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
/* the verdict as a stamp on the pass */
.verdict-line > span { display: inline-block; border: 2px solid currentColor; border-radius: 8px; padding: 0.15rem 0.7rem; transform: rotate(-2deg); letter-spacing: 0.03em; }
.verdict-line[data-vc="best"] { color: var(--good); }
.verdict-line[data-vc="near"] { color: var(--accent); }
.verdict-line[data-vc="off"], .verdict-line[data-vc="lost"] { color: var(--warn); }
.cargo[data-best="true"] { border-color: var(--accent); }
.cargo[data-best="true"]::after { content: "★"; position: absolute; top: 0.5rem; right: 0.6rem; color: var(--accent); font-size: 0.9rem; }
/* each era washes the arrival header in its own colour; text stays on the page tokens */
#step-journey { --era-c: var(--accent); }
#step-journey[data-era="w1"] { --era-c: #b98a4e; }
#step-journey[data-era="w2"] { --era-c: #c4673f; }
#step-journey[data-era="w3"] { --era-c: #3f9c8f; }
#step-journey[data-era="w4"] { --era-c: #7a8f4a; }
#step-journey[data-era="w5"] { --era-c: #9a4a64; }
#step-journey[data-era="w6"] { --era-c: #4a6fb0; }
#step-journey[data-era="w7"] { --era-c: #8b6bb5; }
#step-journey[data-era="w8"] { --era-c: #b5533f; }
#step-journey[data-era="w9"] { --era-c: #6d7d86; }
.landing-head { border-left-color: var(--era-c, var(--accent)); background: linear-gradient(90deg, color-mix(in srgb, var(--era-c, var(--accent)) 16%, transparent), transparent 70%); padding-top: 0.5rem; padding-bottom: 0.5rem; }
.meter { grid-column: 1 / -1; position: relative; height: 14px; border-radius: 7px; background: var(--raise-2); border: 1px solid var(--line); overflow: hidden; }
.meter i { position: absolute; left: 0; top: 0; bottom: 0; background: linear-gradient(90deg, var(--t1), var(--t2), var(--t3)); width: 0; transition: width 1s cubic-bezier(.2,.7,.2,1); }
.meter b { position: absolute; top: -2px; bottom: -2px; width: 3px; background: var(--ink); }
.meter-key { font-size: 0.78rem; color: var(--ink-3); grid-column: 1 / -1; }
.era-bars { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; align-items: end; height: 92px; margin: 1rem 0 0.2rem; }
.era-bars div { position: relative; background: var(--raise-2); border-radius: 4px 4px 0 0; min-height: 4px; }
.era-bars div[data-you="true"] { outline: 2px solid var(--accent); outline-offset: 1px; }
.era-bars-lab { display: grid; grid-template-columns: repeat(9, 1fr); gap: 4px; font-size: 0.66rem; color: var(--ink-3); text-align: center; }
.era-bars-lab span { writing-mode: vertical-rl; transform: rotate(180deg); height: 3.6rem; justify-self: center; white-space: nowrap; }
.pass-wrap { margin-top: 1.4rem; }
.pass-wrap canvas { width: 100%; max-width: 600px; height: auto; aspect-ratio: 1200 / 630; border-radius: 12px; border: 1px solid var(--line); display: block; }
.share-row { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.8rem; }
.share-label { font-size: 0.8rem; color: var(--ink-3); margin-right: 0.3rem; }
.icon-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--ink);
    display: inline-flex; align-items: center; justify-content: center; cursor: pointer; text-decoration: none;
}
.icon-btn:hover { border-color: var(--accent); color: var(--accent); }
.icon-btn svg { width: 1.2rem; height: 1.2rem; }
.status { font-size: 0.82rem; color: var(--good); min-height: 1.3em; width: 100%; }
.after-actions { margin-top: 1.2rem; display: flex; flex-wrap: wrap; gap: 0.6rem; }

/* ---- Warp overlay ---- */
.warp { position: fixed; inset: 0; z-index: 200; background: #04070e; color: #f1f4f9; display: grid; place-items: center; }
.warp canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.warp-year { position: relative; font-family: var(--serif); font-size: clamp(3.4rem, 14vw, 8rem); font-weight: 700; letter-spacing: 0.02em; text-shadow: 0 0 30px rgba(240, 195, 90, 0.5); }
.warp-sub { position: relative; text-align: center; color: #c9d3e2; margin-top: 0.4rem; min-height: 1.6em; }
.warp-skip { position: absolute; bottom: 1.6rem; right: 1.2rem; z-index: 2; }

/* ---- Ranking ---- */
.section-band { margin-top: 3.4rem; padding-top: 1.2rem; border-top: 1px solid var(--line); }
.lock-card { background: var(--raise); border: 1px dashed var(--line); border-radius: 12px; padding: 1.1rem 1.2rem; }
.finding { background: var(--raise); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 10px; padding: 0.9rem 1.1rem; margin: 0.9rem 0 1.2rem; max-width: 66ch; }
.finding p + p { margin-top: 0.5rem; }
.finding strong { color: var(--accent); }
.awards { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 0.6rem; margin: 1rem 0 1.4rem; }
.award { background: var(--raise); border: 1px solid var(--line); border-radius: 10px; padding: 0.65rem 0.8rem; font-size: 0.82rem; color: var(--ink-2); }
.award b { display: block; color: var(--ink); font-size: 0.86rem; }
.award .ic { font-size: 1.25rem; }
.award .aw-item { display: block; color: var(--accent); font-weight: 700; margin: 0.1rem 0 0.2rem; }
.scorer { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; margin-bottom: 0.9rem; font-size: 0.86rem; color: var(--ink-2); }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.seg button { font: inherit; font-size: 0.82rem; font-weight: 700; min-height: 44px; padding: 0 0.85rem; border: 0; background: var(--raise); color: var(--ink-2); cursor: pointer; }
.seg button + button { border-left: 1px solid var(--line); }
.seg button[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); }
.rank-list { list-style: none; display: grid; gap: 0.5rem; }
.rank-row { background: var(--raise); border: 1px solid var(--line); border-radius: 12px; scroll-margin-top: calc(var(--topbar) + 1rem); }
.rank-row[data-active="true"] { border-color: var(--accent); }
.rank-row summary {
    list-style: none; cursor: pointer; display: grid; grid-template-columns: 2.4rem 2rem minmax(0, 1fr) auto; gap: 0.6rem; align-items: center;
    padding: 0.65rem 0.9rem; min-height: 44px;
}
.rank-row summary::-webkit-details-marker { display: none; }
.rank-row .pos { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; color: var(--accent); }
.rank-row .em { font-size: 1.35rem; }
.rank-row .nm { font-weight: 700; line-height: 1.25; }
.rank-row .nm small { display: block; font-weight: 400; color: var(--ink-3); font-size: 0.78rem; }
.rank-row .dl { font-family: var(--serif); font-weight: 700; font-size: 1.15rem; text-align: right; }
.rank-row .dl small { display: block; font-family: var(--sans); font-weight: 400; font-size: 0.7rem; color: var(--ink-3); }
.rank-body { padding: 0.2rem 1rem 1rem 1rem; border-top: 1px solid var(--line); }
.rank-body p { max-width: 64ch; margin-top: 0.7rem; color: var(--ink-2); }
.rank-body h4 { margin-top: 0.9rem; font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--ice); }
.dimgrid { display: grid; gap: 0.35rem; margin-top: 0.7rem; }
.dimrow { display: grid; grid-template-columns: 4.6rem 1fr 5.4rem; gap: 0.6rem; align-items: center; font-size: 0.8rem; color: var(--ink-2); }
.dimbar { position: relative; height: 10px; background: var(--raise-2); border-radius: 5px; }
.dimbar i { position: absolute; left: 0; top: 0; bottom: 0; background: var(--t2); border-radius: 5px; }
.dimbar u { position: absolute; top: -3px; bottom: -3px; width: 3px; background: var(--ink); text-decoration: none; border-radius: 1px; }
.dimrow span:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.panelline { margin-top: 0.7rem; font-size: 0.85rem; color: var(--ink-2); }
.panelline .flag { color: var(--warn); font-weight: 700; }
.src-list { margin-top: 0.4rem; padding-left: 1.1rem; font-size: 0.84rem; }
.visit-line { margin-top: 0.6rem; font-size: 0.85rem; color: var(--good); }

/* ---- Method ---- */
.method p, .method li { max-width: 68ch; color: var(--ink-2); }
.method p + p, .method h3 { margin-top: 0.8rem; }
.method h3 { font-family: var(--serif); font-size: 1.15rem; color: var(--ink); }
.method ul { padding-left: 1.2rem; margin-top: 0.5rem; }
.method li + li { margin-top: 0.35rem; }
.tablewrap { overflow-x: auto; margin-top: 0.8rem; border: 1px solid var(--line); border-radius: 10px; }
table.mini { border-collapse: collapse; width: 100%; font-size: 0.82rem; min-width: 30rem; }
table.mini th, table.mini td { padding: 0.45rem 0.7rem; text-align: left; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
table.mini th { background: var(--raise-2); color: var(--ink); font-weight: 700; }
table.mini tr:last-child td { border-bottom: 0; }

footer { max-width: 1180px; margin: 0 auto; padding: 2rem 1.25rem 4rem; color: var(--ink-3); font-size: 0.82rem; border-top: 1px solid var(--line); }
footer a { color: var(--ink-2); }
.foot-row { margin-top: 0.5rem; display: flex; flex-wrap: wrap; gap: 0.4rem 1.2rem; }
/* reading rail: dots in the right gutter beside the 1180 px column; labels only on hover or focus */
.rail { display: none; }
@media (min-width: 1400px) {
    .rail { --col: 1180px; --gut: 1.25rem; display: flex; flex-direction: column; position: fixed; top: 50%; left: calc(50% + var(--col) / 2 + var(--gut)); transform: translateY(-50%); z-index: 40; padding: 0.4rem 0; }
    .rail::before { content: ""; position: absolute; left: calc(0.875rem - 0.5px); top: 1.1rem; bottom: 1.1rem; width: 1px; background: var(--line); }
    .rail-dot { position: relative; display: flex; align-items: center; justify-content: center; width: 1.75rem; height: 1.75rem; text-decoration: none; border-radius: 50%; }
    .rail-dot .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); box-shadow: 0 0 0 3px var(--bg); transition: transform 0.2s, background 0.2s, box-shadow 0.2s; flex: none; }
    .rail-dot:hover .dot, .rail-dot:focus-visible .dot { background: var(--accent); transform: scale(1.25); }
    .rail-dot[aria-current="true"] .dot { background: var(--accent); transform: scale(1.45); box-shadow: 0 0 0 3px var(--bg), 0 0 0 4.5px color-mix(in srgb, var(--accent) 38%, transparent); }
    .rail-dot:focus-visible { outline: 2px solid var(--accent); outline-offset: -1px; }
    .rail-label { position: absolute; left: calc(100% + 0.15rem); top: 50%; transform: translate(-4px, -50%); max-width: calc(50vw - var(--col) / 2 - var(--gut) - 3.25rem); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.1rem 0.2rem; color: var(--ink-3); font-size: 0.82rem; font-weight: 600; line-height: 1.3; opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; }
    .rail-dot:hover .rail-label, .rail-dot:focus-visible .rail-label { opacity: 1; transform: translate(0, -50%); color: var(--accent); }
}
@media (prefers-reduced-motion: reduce) { .rail .dot, .rail-label { transition: none; } }

/* ---- Phones: the picture keeps the top of the screen, text passes beneath ---- */
@media (max-width: 860px) {
    .workbench { grid-template-columns: minmax(0, 1fr); gap: 0.8rem; padding: 0 1rem 4rem; }
    .hero { padding: 1rem 0 1.4rem; }
    .terrain-col { grid-column: 1; grid-row: 1; top: var(--topbar); margin: 0 -1rem; padding: 0.4rem 1rem 0.3rem; background: var(--bg); }
    .content-col { grid-column: 1; grid-row: 2; }
    .terrain-card { padding: 0.5rem 0.6rem 0.4rem; box-shadow: none; border-radius: 10px; }
    .terrain-title, .terrain-legend { display: none; }
    #terrain { height: clamp(120px, 19svh, 190px); }
    .terrain-foot { margin-top: 0.2rem; }
    .terrain-status { font-size: 0.72rem; line-height: 1.35; min-height: 1.2em; }
    .content-col { position: relative; z-index: 1; }
    .era { grid-template-columns: 4.6rem minmax(0, 1fr); }
    .era .go { display: none; }
    .era .cr { grid-column: 2; }
    .rank-row summary { grid-template-columns: 1.9rem 1.7rem minmax(0, 1fr) auto; gap: 0.45rem; padding: 0.6rem 0.65rem; }
    .dimrow { grid-template-columns: 3.6rem 1fr 4.4rem; }
    .topbar .brand { font-size: 0.92rem; }
    .cargo-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
    .meter-row { grid-template-columns: minmax(0, 1fr); }
    .big-num small { display: block; margin: 0.3rem 0 0; font-size: 0.32em; line-height: 1.3; }
    .rank-row { scroll-margin-top: calc(var(--topbar) + var(--sticky-h, 0px) + 0.5rem); }
}

@media (max-width: 400px) {
    .topbar { gap: 0.3rem; padding: 0 0.6rem; }
    .topbar nav a { padding: 0.55rem 0.45rem; font-size: 0.76rem; }
    .topbar .brand { display: none; }
}

@media print {
    .topbar, .rail, .terrain-col, .warp { display: none !important; }
    body { background: #fff; color: #000; }
}

/* ---- The era strip: same object, any era (hop) ---- */
.strip-wrap { margin: 1rem 0 1.2rem; }
.strip-h { font-size: 0.74rem; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink-3); margin-bottom: 0.4rem; }
.strip { list-style: none; display: flex; gap: 0; overflow-x: auto; scrollbar-width: thin; scroll-snap-type: x proximity; padding: 0.2rem 0 0.5rem; margin: 0; }
.strip li { flex: 1 1 0; min-width: 4.4rem; position: relative; scroll-snap-align: center; }
.strip li::before { content: ""; position: absolute; left: 0; right: 0; top: 1.15rem; height: 2px; background: var(--line); }
.strip li:first-child::before { left: 50%; }
.strip li:last-child::before { right: 50%; }
.stop { position: relative; display: flex; flex-direction: column; align-items: center; gap: 0.15rem; width: 100%; min-height: 44px; padding: 0.15rem 0.2rem 0.4rem; background: none; border: 0; color: var(--ink-2); cursor: pointer; font: inherit; text-align: center; border-radius: 10px; }
.stop-mark { display: grid; place-items: center; width: 2.3rem; height: 2.3rem; border-radius: 50%; background: var(--raise); border: 2px dashed var(--line); font-size: 0.82rem; font-weight: 700; color: var(--ink-3); transition: transform 0.15s, border-color 0.15s, background 0.15s; position: relative; z-index: 1; }
.stop[data-state="landed"] .stop-mark { border-style: solid; border-color: var(--accent); color: var(--accent); }
.stop[data-state="here"] .stop-mark { background: var(--accent); border: 2px solid var(--accent); color: var(--accent-ink); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 30%, transparent); transform: scale(1.08); }
.stop:hover .stop-mark, .stop:focus-visible .stop-mark { border-color: var(--accent); transform: scale(1.1); }
.stop:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.stop-yr { font-family: var(--serif); font-weight: 700; font-size: 0.8rem; color: var(--ink); line-height: 1.15; }
.stop-nm { font-size: 0.7rem; line-height: 1.2; color: var(--ink-2); }
.stop[data-state="here"] .stop-nm, .stop[data-state="here"] .stop-yr { color: var(--accent); }
@media (prefers-reduced-motion: reduce) { .stop-mark { transition: none; } }

/* ---- The score, built up ---- */
.tally-dims { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.5rem; margin: 0.6rem 0; padding: 0; }
.tally-dims li { background: var(--raise); border: 1px solid var(--line); border-radius: 12px; padding: 0.5rem 0.6rem; display: grid; gap: 0.1rem; }
.td-nm { font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; color: var(--ink-3); }
.td-v { font-family: var(--serif); font-size: 1.7rem; font-weight: 700; color: var(--accent); line-height: 1; font-variant-numeric: tabular-nums; }
.td-w { font-size: 0.72rem; color: var(--ink-2); }
.tally-line { color: var(--ink-2); font-size: 0.92rem; margin-top: 0.3rem; }
@media (max-width: 560px) { .tally-dims { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.era-bars div[data-seen="false"] { background: var(--unseen); border: 1px dashed var(--line); }
.era-bars .bar-q { position: absolute; inset: 0; display: grid; place-items: center; font-size: 0.78rem; font-weight: 700; color: var(--ink-3); }
