/* ============================================================
   StationTag — App Styles
   Mobile-first, theme-switchable, no framework
   ============================================================ */

/* ── Reset ─────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; height: 100%; }
body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    min-height: 100%;
    min-height: 100dvh;
    overscroll-behavior: none;
}
button { font: inherit; cursor: pointer; border: none; background: none; }
input, textarea { font: inherit; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
ul, ol { list-style: none; }

/* ── Themes ─────────────────────────────────────────────────── */
:root {
    --radius: 12px;
    --radius-sm: 8px;
    --gap: 16px;
    --header-h: 56px;
    --transition: 0.2s ease;
}

[data-theme="dark"] {
    --bg:         #1a1a2e;
    --surface:    #16213e;
    --surface2:   #0f3460;
    --border:     rgba(255,255,255,0.08);
    --text:       #e0e0e0;
    --text-muted: #8888aa;
    --text-inv:   #1a1a2e;
    --shadow:     0 4px 20px rgba(0,0,0,0.4);
    --overlay:    rgba(0,0,0,0.6);
    --theme-icon: '☀️';
}
[data-theme="light"] {
    --bg:         #f0f2f5;
    --surface:    #ffffff;
    --surface2:   #e8eaf0;
    --border:     rgba(0,0,0,0.08);
    --text:       #1a1a2e;
    --text-muted: #666680;
    --text-inv:   #ffffff;
    --shadow:     0 4px 20px rgba(0,0,0,0.1);
    --overlay:    rgba(0,0,0,0.4);
    --theme-icon: '🌙';
}

body {
    background: var(--bg);
    color: var(--text);
    transition: background var(--transition), color var(--transition);
}

/* ── TfL Line Colours ───────────────────────────────────────── */
:root {
    --c-bakerloo:         #B26300;
    --c-central:          #DC241F;
    --c-circle:           #FFC80A;
    --c-district:         #00643C;
    --c-hammersmith-city: #F4A9BE;
    --c-jubilee:          #868F96;
    --c-metropolitan:     #751056;
    --c-northern:         #000000;
    --c-piccadilly:       #0019A8;
    --c-victoria:         #0099CC;
    --c-waterloo-city:    #00B0E7;
    --c-elizabeth:        #603A9E;
    --c-dlr:              #00AFAD;
    --c-lioness:          #FAB900;
    --c-mildmay:          #0090D0;
    --c-windrush:         #E5272D;
    --c-weaver:           #9B0056;
    --c-suffragette:      #007D32;
    --c-liberty:          #6B6B6B;
    --c-thameslink:       #F05B72;

    --t-bakerloo:         #ffffff;
    --t-central:          #ffffff;
    --t-circle:           #000000;
    --t-district:         #ffffff;
    --t-hammersmith-city: #000000;
    --t-jubilee:          #ffffff;
    --t-metropolitan:     #ffffff;
    --t-northern:         #ffffff;
    --t-piccadilly:       #ffffff;
    --t-victoria:         #ffffff;
    --t-waterloo-city:    #ffffff;
    --t-elizabeth:        #ffffff;
    --t-dlr:              #ffffff;
    --t-lioness:          #000000;
    --t-mildmay:          #ffffff;
    --t-windrush:         #ffffff;
    --t-weaver:           #ffffff;
    --t-suffragette:      #ffffff;
    --t-liberty:          #ffffff;
    --t-thameslink:       #ffffff;
}

/* ── Layout ─────────────────────────────────────────────────── */
#app {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-height: 100dvh;
}

.screen {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* ── Header ─────────────────────────────────────────────────── */
.header {
    display: flex;
    align-items: center;
    gap: 8px;
    /* Grow header to cover iOS status bar */
    height: calc(var(--header-h) + env(safe-area-inset-top));
    padding: env(safe-area-inset-top) var(--gap) 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow);
}
.header__back {
    width: 36px; height: 36px;
    display: flex; align-items: center; justify-content: center;
    border-radius: 50%;
    color: var(--text-muted);
    font-size: 2.25rem;
    transition: background var(--transition);
}
.header__back:active { background: var(--surface2); }
.header__title {
    flex: 1;
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--text);
}
.header__actions { display: flex; gap: 4px; }
.header__btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.1rem;
    color: var(--text-muted);
    transition: background var(--transition);
}
.header__btn:active         { background: var(--surface2); }
.header__btn--active        { background: var(--surface2); color: var(--text); }
/* Hamburger menu button — larger and full-contrast so it's easy to spot */
#menu-btn {
    font-size: 1.5rem;
    color: var(--text);
}

/* ── Scrollable content area ────────────────────────────────── */
.content {
    flex: 1;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: var(--gap);
}
.content--nogap { padding: 0; }

/* ── Splash ─────────────────────────────────────────────────── */
.splash {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg);
    z-index: 9999;
}

/* Arch-shaped tunnel surround — matches the train's silhouette */
.splash__tunnel-surround {
    position: absolute;
    width: 216px;
    height: 236px;
    border-radius: 108px 108px 22px 22px;
    background: #0b0c18;
}
.splash__tunnel-surround::before {
    content: '';
    position: absolute;
    inset: 8px;
    border-radius: 100px 100px 16px 16px;
    background: #07080f;
}

/* Clips the train image to the same arch shape */
.splash__arch-clip {
    position: absolute;
    width: 188px;
    height: 206px;
    border-radius: 94px 94px 18px 18px;
    overflow: hidden;
    background: #1a1a2e;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Train rushes toward the user */
.splash__train {
    width: 188px;
    height: 188px;
    object-fit: cover;
    flex-shrink: 0;
    animation: splashTrainRush 0.75s cubic-bezier(0.55, 0.0, 0.85, 0.6) forwards;
}

/* Fades to the app background in the last ~35% of the animation */
.splash__fade {
    position: absolute;
    inset: 0;
    background: var(--bg);
    opacity: 0;
    pointer-events: none;
    animation: splashFadeIn 0.75s ease-in forwards;
}

@keyframes splashTrainRush {
    0%   { transform: scale(0.03); opacity: 0; }
    12%  { opacity: 1; }
    100% { transform: scale(1);    opacity: 1; }
}

@keyframes splashFadeIn {
    0%,  65% { opacity: 0; }
    100%     { opacity: 1; }
}

/* ── Cards ──────────────────────────────────────────────────── */
.card {
    background: var(--surface);
    border-radius: var(--radius);
    padding: var(--gap);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
}
.card + .card { margin-top: var(--gap); }

/* ── Buttons ────────────────────────────────────────────────── */
.btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-size: 1rem;
    font-weight: 600;
    transition: opacity var(--transition), transform var(--transition);
    width: 100%;
}
.btn:active { opacity: 0.8; transform: scale(0.98); }
.btn--primary {
    background: var(--c-victoria);
    color: #fff;
}
.btn--secondary {
    background: var(--surface2);
    color: var(--text);
    border: 1px solid var(--border);
}
.btn--danger {
    background: var(--c-windrush);
    color: #fff;
}
.btn--sm {
    padding: 10px 16px;
    font-size: 0.9rem;
}
.btn:disabled { opacity: 0.45; pointer-events: none; }

/* ── Forms ──────────────────────────────────────────────────── */
.form-group { margin-bottom: 16px; }
.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.form-control {
    display: block;
    width: 100%;
    padding: 12px 14px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-size: 1rem;
    transition: border-color var(--transition);
    -webkit-appearance: none;
}
.form-control:focus {
    outline: none;
    border-color: var(--c-victoria);
}
textarea.form-control { resize: vertical; min-height: 80px; }

/* Password field with show/hide toggle */
.input-with-toggle { position: relative; }
.input-with-toggle .form-control { padding-right: 46px; }
.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    border-radius: var(--radius-sm);
    transition: color var(--transition);
}
.password-toggle:hover { color: var(--text); }
.password-toggle:focus-visible {
    outline: 2px solid var(--c-victoria);
    outline-offset: -2px;
}
.password-toggle__eye-off { display: none; }
.password-toggle.is-revealed .password-toggle__eye { display: none; }
.password-toggle.is-revealed .password-toggle__eye-off { display: block; }

.form-error {
    color: var(--c-windrush);
    font-size: 0.85rem;
    margin-top: 8px;
    min-height: 20px;
}

/* ── Auth screens ───────────────────────────────────────────── */
.auth-screen {
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 100vh;
    padding: 32px var(--gap);
}

/* Login screen — full-viewport video background */
.auth-screen--video {
    position: relative;
    overflow: hidden;
    padding: 0;
    align-items: center;
    justify-content: center;
    /* Fallback colour while video loads */
    background: #0d1020;
}
.auth-bg-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    pointer-events: none;
}
.auth-bg-overlay {
    position: absolute;
    inset: 0;
    /* Heavier at top/bottom so the card text is always readable */
    background: linear-gradient(
        180deg,
        rgba(0,0,0,0.70) 0%,
        rgba(0,0,0,0.45) 35%,
        rgba(0,0,0,0.45) 65%,
        rgba(0,0,0,0.72) 100%
    );
    z-index: 1;
}
/* Glass-morphism form card */
.auth-screen__card {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    padding: 36px 28px;
    margin: 24px var(--gap);
    background: rgba(10, 14, 42, 0.341);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255,255,255,0.10);
    border-radius: var(--radius);
}
/* Text always white on the dark card */
.auth-screen--video .auth-screen__logo    { color: #fff; }
.auth-screen--video .auth-screen__title   { color: #fff; }
.auth-screen--video .auth-screen__sub     { color: rgba(255,255,255,0.60); }
.auth-screen--video .auth-screen__switch  { color: rgba(255,255,255,0.55); }
.auth-screen--video .auth-screen__switch button { color: var(--c-victoria); }
.auth-screen--video label                 { color: rgba(255,255,255,0.80); }
.auth-screen__logo {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 8px;
}
.auth-screen__branding {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 12px;
}
.auth-screen__branding .auth-screen__title {
    margin-bottom: 0;
}
.auth-screen__title {
    text-align: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 4px;
}
.auth-screen__sub {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 32px;
}
.auth-screen__switch {
    text-align: center;
    margin-top: 20px;
    font-size: 0.9rem;
    color: var(--text-muted);
}
.auth-screen__switch button {
    color: var(--c-victoria);
    font-weight: 600;
    text-decoration: underline;
}

/* OAuth (Sign in with Google) block under the auth form */
.auth-oauth { margin-top: 20px; }
.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 4px 0 16px;
    color: var(--text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.auth-divider::before,
.auth-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}
.auth-oauth__btn {
    display: flex;
    justify-content: center;
    min-height: 40px;   /* reserve space so layout doesn't jump when GIS renders */
}
/* On the video login card, tint the divider for the dark glass background */
.auth-screen--video .auth-divider { color: rgba(255,255,255,0.55); }
.auth-screen--video .auth-divider::before,
.auth-screen--video .auth-divider::after { background: rgba(255,255,255,0.20); }

/* ── Home screen ────────────────────────────────────────────── */
.stats-card {
    text-align: center;
    padding: 24px var(--gap);
}
.stats-card__fraction {
    font-size: 2.8rem;
    font-weight: 800;
    line-height: 1;
    white-space: nowrap;   /* keep visited / total on one line */
}
/* Gradient applied only to the visited number */
.stats-card__visited {
    background: linear-gradient(135deg, var(--c-victoria), var(--c-elizabeth));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    display: inline-block;
    transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.stats-card__visited--pop {
    transform: scale(1.35);
}
/* Total (/ 419) — explicit colour so iOS Safari renders it */
.stats-card__total {
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-muted);
    -webkit-text-fill-color: var(--text-muted); /* override inherited transparent */
    opacity: 0.55;
}
.stats-card__label {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 4px;
}
.stats-card__bar {
    height: 8px;
    background: var(--surface2);
    border-radius: 4px;
    margin-top: 16px;
    overflow: hidden;
}
.stats-card__bar-fill {
    height: 100%;
    border-radius: 4px;
    background: linear-gradient(90deg, var(--c-victoria), var(--c-elizabeth));
    transition: width 0.6s ease;
}
.stats-card__pct {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 8px;
}
.stats-card__rank {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 10px;
}
.stats-card__rank-label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}
.stats-card__rank-name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}
.rank-info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    font-size: 1rem;
    line-height: 1;
    color: var(--text-muted);
    opacity: 0.75;
    transition: opacity var(--transition), color var(--transition);
    padding: 0;
    flex-shrink: 0;
}
.rank-info-btn:hover,
.rank-info-btn:focus { opacity: 1; color: var(--c-victoria); outline: none; }

/* ── Rank modal ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: var(--overlay);
    z-index: 1000;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    animation: fade-in 0.18s ease;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

.modal {
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    width: 100%;
    max-width: 520px;
    max-height: 80dvh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slide-up-modal 0.22s ease;
    padding-bottom: env(safe-area-inset-bottom);
}
@keyframes slide-up-modal {
    from { transform: translateY(40px); opacity: 0; }
    to   { transform: translateY(0);    opacity: 1; }
}

.modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px 14px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.modal__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
}
.modal__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 1rem;
    color: var(--text-muted);
    background: var(--surface2);
    transition: background var(--transition), color var(--transition);
}
.modal__close:hover { background: var(--border); color: var(--text); }

.modal__body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 8px 0 8px;
}

.rank-row {
    display: flex;
    align-items: center;
    padding: 11px 20px;
    gap: 12px;
    transition: background var(--transition);
}
.rank-row + .rank-row { border-top: 1px solid var(--border); }
.rank-row--current {
    background: rgba(0, 153, 204, 0.10);  /* Victoria blue tint */
}
[data-theme="light"] .rank-row--current { background: rgba(0, 153, 204, 0.08); }

.rank-row__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.rank-row__name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
}
.rank-row--current .rank-row__name { color: var(--c-victoria); }

.rank-row__range {
    font-size: 0.78rem;
    color: var(--text-muted);
}
.rank-row__you {
    font-size: 0.65rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    background: var(--c-victoria);
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    flex-shrink: 0;
}

.home-actions {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: var(--gap);
    margin-bottom: var(--gap);
}

.recent-list { margin-top: var(--gap); }
.recent-list__title {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin-bottom: 10px;
}
.recent-item {
    display: flex;
    flex-direction: column;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.recent-item:last-child { border-bottom: none; }
.recent-item:active { opacity: 0.7; }

/* Top row: dot · name · date · chevron */
.recent-item__top {
    display: flex;
    align-items: center;
    gap: 12px;
}
.recent-item__dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.recent-item__name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}
.recent-item__date {
    font-size: 0.8rem;
    color: var(--text-muted);
    flex-shrink: 0;
}
.recent-item__photo {
    flex-shrink: 0;
    font-size: 0.85rem;
    line-height: 1;
    margin-left: -4px;
}
.recent-item__chevron {
    color: var(--text-muted);
    font-size: 1rem;
    line-height: 1;
    flex-shrink: 0;
    transition: transform var(--transition);
    margin-left: 2px;
}
.recent-item.expanded .recent-item__chevron {
    transform: rotate(90deg);
}

/* Notes area — hidden until expanded */
.recent-item__notes {
    display: none;
    padding: 8px 0 2px 22px;   /* indent aligns with the station name */
    font-size: 0.84rem;
    color: var(--text-muted);
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.recent-item.expanded .recent-item__notes { display: block; }
.recent-item__photos {
    display: none;
    padding: 0 0 4px 22px;   /* align with the station name */
}
.recent-item.expanded .recent-item__photos { display: block; }
.recent-item__photos .photo-strip--mini { margin-top: 4px; }

.recent-item__share-btn {
    display: none;
    margin: 4px 0 2px 22px;   /* align with the station name */
    padding: 6px 12px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    transition: background var(--transition);
}
.recent-item.expanded .recent-item__share-btn { display: inline-block; }
.recent-item__share-btn:active { background: var(--surface); }

/* ── Line selector grid ─────────────────────────────────────── */
.line-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.line-btn {
    padding: 14px 10px;
    border-radius: var(--radius-sm);
    font-size: 0.85rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.3;
    transition: transform var(--transition), opacity var(--transition);
    border: none;
    width: 100%;
}
.line-btn:active { transform: scale(0.96); opacity: 0.85; }

/* ── Station timeline ───────────────────────────────────────── */
.search-bar {
    position: relative;   /* sits in flex flow above the scrollable content */
    flex-shrink: 0;
    background: var(--bg);
    padding: 10px var(--gap);
    border-bottom: 1px solid var(--border);
    z-index: 10;          /* low z-index — content scrolls below, not under */
}
.search-bar input {
    width: 100%;
    padding: 10px 14px 10px 38px;
    border-radius: 20px;
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.95rem;
    -webkit-appearance: none;
}
.search-bar input:focus { outline: none; border-color: var(--line-colour, var(--c-victoria)); }
.search-bar__icon {
    position: absolute;
    left: calc(var(--gap) + 12px);
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1rem;
    pointer-events: none;
}

.timeline {
    padding: var(--gap);
    padding-left: calc(var(--gap) + 32px);
    --line-colour: var(--c-victoria);
    --line-text:   #ffffff;
    position: relative;
}

/* Line spine */
.timeline::before {
    content: '';
    position: absolute;
    left: calc(var(--gap) + 12px);
    top: 20px;
    bottom: 20px;
    width: 4px;
    background: var(--line-colour);
    border-radius: 2px;
}

.timeline-item {
    position: relative;
    padding: 4px 0 4px 20px;
    margin-bottom: 2px;
}

/* Circle marker — real element so it can receive tap/click events */
.timeline-item__dot {
    position: absolute;
    left: -28px;
    /* Fixed offset keeps the dot aligned with the row even when the
       expand-form makes .timeline-item taller (top:50% would drift) */
    top: 26px;
    transform: translateY(-50%);
    width: 20px; height: 20px;
    border-radius: 50%;
    border: 3px solid var(--line-colour);
    background: var(--bg);
    transition: background var(--transition);
    z-index: 1;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}
.timeline-item.visited .timeline-item__dot {
    background: var(--line-colour);
}
.timeline-item.hidden { display: none; }

.timeline-item__row {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 8px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.timeline-item__row:active { background: var(--surface); }
.timeline-item.expanded .timeline-item__row { background: var(--surface); }

.timeline-item__name {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 500;
}
.timeline-item.visited .timeline-item__name { font-weight: 600; }

.visit-bubble {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px; height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--line-colour);
    color: var(--line-text);
    font-size: 0.72rem;
    font-weight: 700;
    flex-shrink: 0;
}
.visit-bubble[data-count="0"] { opacity: 0; }

/* Interchange line indicators */
.interchange {
    display: inline-flex;
    align-items: center;
    gap: 3px;
    flex-shrink: 0;
    margin-right: 4px;
}
.interchange__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
    /* Subtle border so dark circles (e.g. Northern) are visible on dark theme
       and pale circles (e.g. Circle yellow) are visible on light theme */
    border: 1.5px solid rgba(128, 128, 128, 0.30);
}

/* Expanded form */
.timeline-item__form {
    display: none;
    padding: 12px;
    background: var(--surface);
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    margin-top: -8px;
}
.timeline-item.expanded .timeline-item__form { display: block; }

.timeline-item__form .form-group { margin-bottom: 12px; }
.timeline-item__form .btn { margin-top: 4px; }

/* Nearest station toast */
.geo-toast {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom) + 16px);
    left: var(--gap);
    right: var(--gap);
    background: var(--surface2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 12px 10px 14px;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow);
    z-index: 200;
    animation: slide-up 0.3s ease;
}
/* Tappable region — everything except the close button */
.geo-toast__body {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    min-width: 0;
    padding: 4px;
    margin: -4px;
    border-radius: var(--radius-sm);
    -webkit-tap-highlight-color: transparent;
    transition: opacity var(--transition);
}
.geo-toast__body:active { opacity: 0.55; }
.geo-toast__pin { font-size: 1.1rem; flex-shrink: 0; }
.geo-toast__text {
    flex: 1;
    font-size: 0.9rem;
    min-width: 0;
    line-height: 1.3;
}
.geo-toast__dist {
    display: block;
    font-size: 0.75rem;
    opacity: 0.6;
    margin-top: 1px;
}
.geo-toast__arrow {
    color: var(--c-victoria);
    font-size: 1.05rem;
    font-weight: 700;
    flex-shrink: 0;
}
.geo-toast__close {
    color: var(--text-muted);
    font-size: 1.2rem;
    line-height: 1;
    padding: 4px;
    flex-shrink: 0;
}

/* ── History screen ─────────────────────────────────────────── */
.sort-bar {
    display: flex;
    gap: 8px;
    padding: var(--gap);
    padding-bottom: 0;
}
.sort-btn {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    background: var(--surface2);
    color: var(--text-muted);
    border: 1px solid var(--border);
    transition: all var(--transition);
}
.sort-btn.active {
    background: var(--c-victoria);
    color: #fff;
    border-color: transparent;
}

.journey-group { margin: var(--gap) var(--gap) 0; }
.journey-group__date {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    padding: 8px 0 6px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 6px;
}
.journey-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.journey-item:last-child { border-bottom: none; }
.journey-item__dot {
    width: 10px; height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}
.journey-item__info { flex: 1; min-width: 0; }
.journey-item__name {
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.journey-item__notes {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.journey-item__share-btn {
    color: var(--text-muted);
    font-size: 1rem;
    padding: 6px;
    border-radius: 50%;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}
.journey-item__share-btn:active { background: var(--surface2); }
.journey-item__edit-btn {
    color: var(--text-muted);
    font-size: 1rem;
    padding: 6px;
    border-radius: 50%;
    transition: background var(--transition), color var(--transition);
    flex-shrink: 0;
}
.journey-item__edit-btn:active  { background: var(--surface2); }
.journey-item__edit-btn--active { color: var(--text); }
.journey-item__del {
    color: var(--text-muted);
    font-size: 1.1rem;
    padding: 6px;
    border-radius: 50%;
    transition: background var(--transition);
    flex-shrink: 0;
}
.journey-item__del:active { background: var(--surface2); color: var(--c-windrush); }

/* Edit form that expands below the item row */
.journey-item--editing {
    flex-wrap: wrap;
    align-items: flex-start;
    background: var(--surface);
    border-radius: var(--radius);
    padding: 10px 10px 0;
    margin-bottom: 4px;
    border: 1px solid var(--border);
}
.journey-item__form {
    flex: 0 0 100%;
    padding: 10px 0 4px;
}
.journey-item__form .form-group { margin-bottom: 10px; }
.journey-item__form-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding-bottom: 6px;
}

/* Brief highlight on a row just after its edit is saved */
.journey-item--saved {
    animation: journey-item-saved 0.9s ease;
}
@keyframes journey-item-saved {
    0%   { background: rgba(0, 153, 204, 0.18); }
    100% { background: transparent; }
}

/* ── Empty state ────────────────────────────────────────────── */
.empty {
    text-align: center;
    padding: 48px var(--gap);
    color: var(--text-muted);
}
.empty__icon { font-size: 2.5rem; margin-bottom: 12px; }
.empty__text { font-size: 0.95rem; }

/* ── Loading spinner ────────────────────────────────────────── */
.spinner {
    display: flex;
    justify-content: center;
    padding: 32px;
}
.spinner::after {
    content: '';
    width: 32px; height: 32px;
    border: 3px solid var(--border);
    border-top-color: var(--c-victoria);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Pull-to-refresh indicator ──────────────────────────────── */
.ptr-indicator {
    position: fixed;
    /* Sit just below the header (accounts for iOS status-bar safe area) */
    top: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    left: 50%;
    /* Start hidden: 60px above its resting position */
    transform: translateX(-50%) translateY(-60px);
    opacity: 0;
    z-index: 500;
    pointer-events: none;   /* never intercept taps */

    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--surface);
    border: 1px solid var(--border);
    box-shadow: 0 2px 12px rgba(0,0,0,0.25);
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Down-arrow shown while pulling */
.ptr-arrow {
    font-size: 1.05rem;
    line-height: 1;
    color: var(--text-muted);
    display: block;
    transition: transform 0.2s ease, color 0.2s ease;
}
/* Arrow flips upward when threshold is reached */
.ptr-indicator--ready .ptr-arrow {
    transform: rotate(180deg);
    color: var(--c-victoria);
}

/* Spinner shown once released past threshold */
.ptr-indicator--loading .ptr-arrow { display: none; }
.ptr-indicator--loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2.5px solid var(--border);
    border-top-color: var(--c-victoria);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Animations ─────────────────────────────────────────────── */
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes slide-up { from { transform: translateY(20px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade-in  { from { opacity: 0; } to { opacity: 1; } }

.screen { animation: fade-in 0.15s ease; }

/* ── Safe area padding ──────────────────────────────────────── */
.content {
    padding-bottom: calc(var(--gap) + env(safe-area-inset-bottom));
}

/* ── Map screen ─────────────────────────────────────────────── */
/* The map wrapper fills all remaining height inside the flex-column .screen */
.map-wrapper {
    flex: 1;
    position: relative;
    overflow: hidden;
    min-height: 0;         /* required in a flex column so it can shrink */
    background: var(--surface2);
}
/* Leaflet injects its map div — stretch it to fill the wrapper */
#leaflet-map {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
}
.map-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

/* ── Map floating toggle controls ───────────────────────────────── */
.map-controls {
    position: absolute;
    bottom: 36px;     /* clear Leaflet attribution bar */
    left: 12px;
    right: 12px;      /* allow wrapping without overflow on narrow screens */
    z-index: 1000;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    pointer-events: all;
}
.map-toggle {
    padding: 7px 13px;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 700;
    background: var(--surface);
    color: var(--text-muted);
    border: 1.5px solid var(--border);
    box-shadow: 0 2px 10px rgba(0,0,0,0.22);
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
    white-space: nowrap;
    line-height: 1.3;
}
.map-toggle--active {
    background: var(--text);
    color: var(--bg);
    border-color: transparent;
}
.map-toggle:active { opacity: 0.85; }

/* Locate button — square pill, no text, slightly wider tap target */
.map-toggle--icon { padding: 7px 10px; }   /* icon-only buttons — no text label */

/* ── Layers dropdown panel ───────────────────────────────────── */
.map-layers-menu {
    position: fixed;
    z-index: 1100;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 6px 24px rgba(0,0,0,0.22);
    padding: 8px 0;
    min-width: 220px;
    max-width: 260px;
}
.map-layer-row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text);
    padding: 7px 14px;
    cursor: pointer;
}
.map-layer-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    accent-color: var(--c-victoria);
}
.map-layer-row__badge {
    margin-left: auto;
    font-size: 0.62rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 2px 7px;
    white-space: nowrap;
}

/* ── Map legend panel ────────────────────────────────────────── */
.map-legend {
    position: fixed;
    z-index: 1100;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: 0 6px 24px rgba(0,0,0,0.22);
    padding: 4px 0 8px;
    min-width: 210px;
    max-width: 260px;
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.map-legend__section {
    padding: 8px 14px 4px;
    border-bottom: 1px solid var(--border);
}
.map-legend__section:last-child { border-bottom: none; }
.map-legend__heading {
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.map-legend__row {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: var(--text);
    padding: 3px 0;
}
.map-legend__icon {
    font-size: 1rem;
    width: 20px;
    text-align: center;
    flex-shrink: 0;
}
.map-legend__dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    flex-shrink: 0;
    border: 1.5px solid rgba(0,0,0,0.25);
}
.map-legend__dot--visited {
    background: #0099CC;   /* representative Victoria line blue */
    border-color: rgba(0,0,0,0.35);
}
.map-legend__dot--unvisited {
    background: transparent;
    border-color: #888;
    border-width: 1.5px;
}

/* ── GPS location marker ─────────────────────────────────────────
   The marker is a zero-size Leaflet divIcon anchored at [0,0].
   All children use position:absolute and are centred on that point.
   ─────────────────────────────────────────────────────────────── */

/* Strip Leaflet's default white box from divIcon */
.loc-icon.leaflet-div-icon {
    background: none !important;
    border:     none !important;
}

/* Zero-size wrapper — everything hangs off this single point */
.loc-wrapper {
    position: relative;
    width:  0;
    height: 0;
}

/* Rotating container for the heading beam.
   transform-origin: 0 0 pins the pivot at the dot centre.
   JS writes:  el.style.transform = 'rotate(Ndeg)'
   Starts hidden; revealed when first heading arrives.           */
.loc-heading {
    position:         absolute;
    top:  0; left: 0;
    width:  0; height: 0;
    transform-origin: 0 0;
    transform:        rotate(0deg);
    opacity:          0;
    transition:       opacity 0.4s ease;
    pointer-events:   none;
}

/* Heading cone — triangle pointing upward (north).
   clip-path triangle: tip at top-center, base at bottom.
   translate(-50%, -100%) puts the base at the origin (dot centre),
   so the cone extends toward the heading direction when rotated.  */
.loc-heading::before {
    content:  '';
    position: absolute;
    top: 0; left: 0;
    width:  22px;
    height: 38px;
    background: linear-gradient(
        to top,
        rgba(41, 121, 255, 0.55),
        rgba(41, 121, 255, 0.0)
    );
    clip-path:  polygon(50% 0%, 0% 100%, 100% 100%);
    transform:  translate(-50%, -100%);
}

/* The blue location dot */
.loc-dot {
    position:      absolute;
    top:  0; left: 0;
    width:  16px;
    height: 16px;
    background:    #2979FF;
    border:        2.5px solid #fff;
    border-radius: 50%;
    transform:     translate(-50%, -50%);
    box-shadow:    0 1px 5px rgba(0,0,0,0.4);
    z-index:       3;
}

/* Pulse ring — emitted on first fix, removed after 2 s */
@keyframes locPulse {
    0%   { transform: translate(-50%, -50%) scale(1);   opacity: 0.7; }
    100% { transform: translate(-50%, -50%) scale(3.5); opacity: 0; }
}
.loc-dot--pulse::after {
    content:       '';
    position:      absolute;
    inset:         0;
    border-radius: 50%;
    background:    rgba(41, 121, 255, 0.45);
    animation:     locPulse 1.8s ease-out 2;
}

/* Hint toast — appears when no stations are visited yet */
/* Time-lapse scrub bar */
.tl-bar {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    display: flex;
    align-items: center;
    gap: 10px;
    width: calc(100% - 28px);
    max-width: 460px;
    padding: 8px 12px;
    border-radius: 26px;
    background: rgba(0,0,0,0.78);
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}
.tl-btn {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.85rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.tl-bar input[type=range] {
    flex: 1;
    accent-color: var(--c-victoria);
}
.tl-date {
    flex-shrink: 0;
    min-width: 84px;
    text-align: right;
    color: #fff;
    font-size: 0.76rem;
    font-weight: 600;
    font-variant-numeric: tabular-nums;
}

.map-hint {
    position: absolute;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 1001;
    background: rgba(0,0,0,0.75);
    color: #fff;
    font-size: 0.8rem;
    font-weight: 600;
    padding: 9px 16px;
    border-radius: 20px;
    white-space: nowrap;
    max-width: calc(100vw - 32px);
    text-align: center;
    pointer-events: none;
    animation: fadeOut 5s forwards;
}
@keyframes fadeOut {
    0%   { opacity: 1; }
    70%  { opacity: 1; }
    100% { opacity: 0; }
}
/* Zoom-in-to-load hint for Blue Plaques — stays until the user zooms in,
   unlike .map-hint's own toast which fades after 5s */
.map-hint--persist { animation: none; }

/* ── Blue Plaques markers (Open Plaques) ─────────────────────────
   className:'plaque-icon' replaces divIcon's default 'leaflet-div-icon'
   class, but strip any background/border defensively all the same. */
.plaque-icon { background: none !important; border: none !important; }
.plaque-dot {
    display: block;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    border: 1.5px solid #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.4);
}

/* ── Network Status screen ───────────────────────────────────── */

/* Summary banner — full-width card at top of content area */
.netstatus-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 12px 16px;
    padding: 14px 16px;
    border-radius: var(--radius);
    font-size: 0.9rem;
}
.netstatus-banner--good {
    background: rgba(46, 125, 50, 0.14);
    color: #2E7D32;
}
.netstatus-banner--disrupted {
    background: rgba(198, 40, 40, 0.12);
    color: #C62828;
}
[data-theme="dark"] .netstatus-banner--good {
    background: rgba(129, 199, 132, 0.15);
    color: #81C784;
}
[data-theme="dark"] .netstatus-banner--disrupted {
    background: rgba(239, 154, 154, 0.12);
    color: #EF9A9A;
}
.netstatus-banner__icon  { font-size: 1.4rem; flex-shrink: 0; line-height: 1; }
.netstatus-banner__title { font-weight: 700; line-height: 1.3; }
.netstatus-banner__time  { font-size: 0.74rem; opacity: 0.72; margin-top: 3px; }

/* Line status cards */
.netstatus-card {
    display: flex;
    align-items: stretch;
    margin: 0 16px 10px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

/* Coloured left stripe — matches the line's TfL colour */
.netstatus-card__stripe {
    width: 5px;
    flex-shrink: 0;
}

.netstatus-card__body {
    flex: 1;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.netstatus-card__name {
    font-size: 0.92rem;
    font-weight: 700;
    color: var(--text);
    line-height: 1.2;
}
.netstatus-card__reason {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.45;
}

/* Status badge pills — severity-coded colours */
.netstatus-badge {
    display: inline-block;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 2px 10px;
    border-radius: 10px;
    align-self: flex-start;
    letter-spacing: 0.01em;
}
.netstatus-badge--good {
    background: rgba(46, 125, 50, 0.14);
    color: #2E7D32;
}
.netstatus-badge--minor {
    background: rgba(230, 81, 0, 0.14);
    color: #E65100;
}
.netstatus-badge--delays {
    background: rgba(198, 40, 40, 0.14);
    color: #C62828;
}
.netstatus-badge--suspended {
    background: rgba(106, 27, 154, 0.14);
    color: #6A1B9A;
}
.netstatus-badge--severe {
    background: rgba(183, 28, 28, 0.18);
    color: #B71C1C;
}
[data-theme="dark"] .netstatus-badge--good      { background: rgba(129,199,132,0.2);  color: #81C784; }
[data-theme="dark"] .netstatus-badge--minor     { background: rgba(255,183,77,0.2);   color: #FFB74D; }
[data-theme="dark"] .netstatus-badge--delays    { background: rgba(239,154,154,0.2);  color: #EF9A9A; }
[data-theme="dark"] .netstatus-badge--suspended { background: rgba(206,147,216,0.2);  color: #CE93D8; }
[data-theme="dark"] .netstatus-badge--severe    { background: rgba(239,154,154,0.25); color: #EF9A9A; }

.netstatus-divider {
    margin: 6px 16px 2px;
    padding-top: 10px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    border-top: 1px solid var(--border);
    opacity: 0.65;
}

/* ── Arrivals / Crowding modal ───────────────────────────────── */
.arrivals-body {
    padding: 0 4px 8px;
    max-height: 70vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.arr-section {
    padding: 12px 0 8px;
    border-bottom: 1px solid var(--border);
}
.arr-section:last-child { border-bottom: none; }
.arr-section__title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 8px;
}

/* Crowding live indicator */
.crowd-live {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.crowd-live__label {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.crowd-live__pct {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-left: auto;
}
.crowd-na {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-style: italic;
    margin: 4px 0 8px;
}

/* Crowding bar chart */
.crowd-chart {
    display: flex;
    align-items: flex-end;
    gap: 2px;
    height: 48px;
    margin-bottom: 4px;
}
.crowd-bar {
    flex: 1;
    border-radius: 2px 2px 0 0;
    min-height: 2px;
    transition: height 0.3s ease;
}
.crowd-bar--good  { background: #2E7D32; }
.crowd-bar--minor { background: #F57C00; }
.crowd-bar--busy  { background: #C62828; }
[data-theme="dark"] .crowd-bar--good  { background: #81C784; }
[data-theme="dark"] .crowd-bar--minor { background: #FFB74D; }
[data-theme="dark"] .crowd-bar--busy  { background: #EF9A9A; }
.crowd-chart-label {
    font-size: 0.7rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 4px;
}

/* Arrivals board rows */
.arrival-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    border-bottom: 1px solid var(--border);
}
.arrival-row:last-child { border-bottom: none; }
.arrival-line {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 10px;
    white-space: nowrap;
    flex-shrink: 0;
}
.arrival-dest {
    font-size: 0.85rem;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--text);
}
.arrival-mins {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--text-muted);
    white-space: nowrap;
    flex-shrink: 0;
}
.arrival-mins--due {
    color: #2E7D32;
}
[data-theme="dark"] .arrival-mins--due { color: #81C784; }

/* ── Tube Map screen ─────────────────────────────────────────── */
/* Wrapper fills remaining height, same pattern as .map-wrapper */
.tubemap-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    background: var(--bg);
}

/* Control strip: zoom buttons + external link */
.tubemap-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    background: var(--surface);
    flex-shrink: 0;
}
.tubemap-zoom-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: var(--bg);
    color: var(--text);
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.15s;
}
.tubemap-zoom-btn:active  { background: var(--border); }
.tubemap-zoom-btn:disabled { opacity: 0.4; cursor: default; }
.tubemap-zoom-label {
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--text-muted);
    min-width: 42px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}
.tubemap-bar__spacer { flex: 1; }
.tubemap-ext-link {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    padding: 6px 10px;
    border: 1px solid var(--border);
    border-radius: 14px;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
}
.tubemap-ext-link:active { opacity: 0.7; }

/* Scrollable canvas area — fills remaining height, scrolls in both axes */
.tubemap-canvas-wrap {
    flex: 1;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    background: #e8e8e8; /* neutral background behind the white PDF */
    display: flex;
    align-items: flex-start;
    justify-content: flex-start;
}
.tubemap-canvas-wrap canvas {
    display: block;
    /* Allow native pinch-zoom within the scroll container on supporting browsers */
    touch-action: pan-x pan-y pinch-zoom;
}

/* Fallback state — shown if CORS blocks in-app loading */
.tubemap-fallback {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 24px;
    text-align: center;
}
.tubemap-fallback__icon {
    font-size: 3rem;
    line-height: 1;
    margin-bottom: 4px;
}
.tubemap-fallback__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.tubemap-fallback__msg {
    font-size: 0.88rem;
    color: var(--text-muted);
    margin: 0;
    max-width: 300px;
    line-height: 1.5;
}
.tubemap-fallback__hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin: 4px 0 0;
}

/* ── Hamburger dropdown menu ─────────────────────────────────── */
.hamburger-menu {
    display: none;         /* toggled to flex by .hamburger-menu--open */
    flex-direction: column;
    position: fixed;
    top: calc(var(--header-h) + env(safe-area-inset-top) + 6px);
    right: var(--gap);
    min-width: 220px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    z-index: 300;
    overflow: hidden;
    animation: fade-in 0.15s ease;
}
.hamburger-menu--open { display: flex; }
.hamburger-menu__header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    pointer-events: none;   /* label row is not interactive */
}
.hamburger-menu__item {
    display: flex;
    align-items: center;
    gap: 12px;
    width: 100%;
    padding: 14px 16px;
    font-size: 0.95rem;
    color: var(--text);
    text-align: left;
    transition: background var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.hamburger-menu__item:active { background: var(--surface2); }
/* Icon sizing for emoji/text icons — intentionally excludes .user-avatar */
.hamburger-menu__item span:first-child:not(.user-avatar) {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
}
.hamburger-menu__divider { height: 1px; background: var(--border); }
.hamburger-menu__item--danger { color: #e05252; }
/* Transparent full-screen overlay — sits behind the open menu so any tap
   outside the menu panel closes it. More reliable than a document listener. */
.menu-overlay {
    position: fixed;
    inset: 0;
    z-index: 299;          /* just below menu's 300 */
    background: transparent;
}
.hamburger-menu__item--profile { font-weight: 600; }

/* User initial avatar (shown in hamburger menu and profile header) */
.user-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--c-victoria), var(--c-elizabeth));
    /* iOS Safari ignores `color` on spans inside <button> — use both */
    color: #fff;
    -webkit-text-fill-color: #fff;
    font-size: 0.8rem;
    font-weight: 700;
    /* flex (not inline-flex) is more reliable inside a parent flex container */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;          /* belt-and-braces fallback */
    flex-shrink: 0;
    line-height: 1;
    -webkit-user-select: none;
    user-select: none;
}

/* ── Profile screen ──────────────────────────────────────────── */
/* ── Profile summary card ───────────────────────────────────────── */
.profile-summary {
    margin-bottom: var(--gap);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}
.profile-summary__top {
    display: flex;
    align-items: center;
    gap: 16px;
}
.profile-summary__avatar {
    width: 56px;
    height: 56px;
    font-size: 1.4rem;
    flex-shrink: 0;
}
.profile-summary__identity {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}
.profile-summary__name {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.profile-summary__rank {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
}
.profile-summary__rank-icon { font-size: 0.95rem; }

/* Three-stat row */
.profile-summary__stats {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 14px 0 2px;
    border-top: 1px solid var(--border);
}
.profile-summary__stat {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}
.profile-summary__stat-value {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1;
}
.profile-summary__stat-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
}
.profile-summary__divider {
    width: 1px;
    height: 32px;
    background: var(--border);
}

/* Progress bar */
.profile-summary__bar-wrap {
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
}
.profile-summary__bar {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #4a9eff, #a855f7);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 3px;
}

.profile-card { margin-bottom: var(--gap); }
.profile-section__label {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin-bottom: 12px;
}
.form-feedback {
    font-size: 0.85rem;
    min-height: 18px;
    margin-bottom: 10px;
}
.form-feedback--error { color: #e05252; }
.form-feedback--ok    { color: #4caf82; }

/* ── Offline / error banner ─────────────────────────────────── */
.offline-banner {
    position: fixed;
    top: var(--header-h);
    left: 0; right: 0;
    background: var(--c-windrush);
    color: #fff;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 8px var(--gap);
    z-index: 150;
    animation: slide-up 0.3s ease;
}

/* ── Utility ────────────────────────────────────────────────── */
.text-muted    { color: var(--text-muted); }
.text-center   { text-align: center; }
.mt-gap        { margin-top: var(--gap); }
.mb-gap        { margin-bottom: var(--gap); }
.fw-bold       { font-weight: 700; }

/* Checkbox style for remember me */
.check-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}
.check-row input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--c-victoria); }
.check-row label { font-size: 0.9rem; color: var(--text-muted); margin: 0; text-transform: none; letter-spacing: 0; font-weight: 400; }

/* ── Auth screen separator ──────────────────────────────────── */
.auth-screen__switch-sep {
    margin: 0 6px;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ── FAQ screen ─────────────────────────────────────────────── */
.faq__intro {
    text-align: center;
    padding: 8px 0 20px;
}
.faq__logo { font-size: 2.4rem; margin-bottom: 6px; }
.faq__tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.faq__list {
    padding: 0;
    overflow: hidden;
}

.faq__item {
    border-bottom: 1px solid var(--border);
}
.faq__item:last-child { border-bottom: none; }

/* Remove the native browser triangle */
.faq__item > summary { list-style: none; }
.faq__item > summary::-webkit-details-marker { display: none; }

.faq__question {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px var(--gap);
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    transition: background var(--transition);
}
.faq__question:active { background: var(--surface2); }

.faq__q-text {
    flex: 1;
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text);
    line-height: 1.35;
}

.faq__chevron {
    font-size: 1.3rem;
    color: var(--text-muted);
    line-height: 1;
    transition: transform 0.2s ease;
    flex-shrink: 0;
}
.faq__item[open] .faq__chevron {
    transform: rotate(90deg);
}

.faq__answer {
    padding: 0 var(--gap) 16px calc(var(--gap));
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--text-muted);
}

.faq__link {
    color: var(--c-victoria);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.faq__link:hover { opacity: 0.8; }

.faq__footer {
    margin-top: 24px;
    text-align: center;
    padding: 0 4px;
}
.faq__footer-text {
    font-size: 0.9rem;
    color: var(--text-muted);
}
.faq__stationtag {
    text-align: center;
    margin-top: 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ── Changelog screen ───────────────────────────────────────── */
.changelog__intro {
    text-align: center;
    padding: 8px 0 16px;
}
.changelog__logo { font-size: 2.4rem; margin-bottom: 6px; }
.changelog__tagline {
    font-size: 0.9rem;
    color: var(--text-muted);
}

.changelog__release {
    margin-bottom: 14px;
    padding: 16px var(--gap);
}
.changelog__head {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 4px;
}
.changelog__version {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--c-victoria);
    background: var(--surface2);
    padding: 2px 8px;
    border-radius: 999px;
}
.changelog__date {
    font-size: 0.8rem;
    color: var(--text-muted);
}
.changelog__title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 8px;
    line-height: 1.35;
}
.changelog__list {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}
.changelog__list li {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.changelog__list li:last-child { margin-bottom: 0; }

.changelog__stationtag {
    text-align: center;
    margin-top: 20px;
    font-size: 0.82rem;
    color: var(--text-muted);
    opacity: 0.7;
}

/* ── Auth screen stationtag.co.uk link ──────────────────────── */
.auth-screen__stationtag {
    text-align: center;
    margin-top: 16px;
    font-size: 0.8rem;
    color: rgba(255,255,255,0.35);
}
.auth-screen__stationtag a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ── Home screen: 2×2 action grid ──────────────────────────── */
.home-actions__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

/* ── Stats card share button ─────────────────────────────────── */
.stats-card__share {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text-muted);
    background: var(--surface2);
    border: 1px solid var(--border);
    transition: background var(--transition), color var(--transition);
}
.stats-card__share:active { background: var(--border); }

/* ── Share modal ─────────────────────────────────────────────── */
.share-modal__body { padding: 16px 20px 24px; }
.share-modal__hint {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 20px;
}
.share-modal__ios-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    text-align: center;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    margin: -12px 0 20px;
    line-height: 1.4;
}
.share-options {
    display: flex;
    gap: 16px;
    justify-content: center;
    align-items: flex-start;
}
.share-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    flex: 1;
    max-width: 180px;
}
.share-preview {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #1a1a2e;
    display: block;
    width: 100%;
    height: auto;
}
.share-preview--portrait {
    width: auto;
    height: 160px;
}
.share-option__label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
}
.share-option__btn { width: 100%; }
.share-option__photo-only {
    font-size: 0.72rem;
    color: var(--text-muted);
    text-decoration: underline;
    text-underline-offset: 2px;
    background: none;
    border: none;
    padding: 0;
}

.share-modal__photos-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text);
    margin: -8px 0 20px;
    cursor: pointer;
}
.share-modal__photos-toggle input { width: 16px; height: 16px; }

/* ── Per-line progress screen ────────────────────────────────── */
.lines-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: var(--gap);
}
.lines-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.line-card {
    background: var(--surface);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    cursor: pointer;
    transition: opacity var(--transition);
}
.line-card:active { opacity: 0.8; }
.line-card--complete { border-color: rgba(76,175,130,0.35); }

.line-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    font-size: 0.95rem;
    font-weight: 700;
}
.line-card__done {
    font-size: 0.75rem;
    font-weight: 700;
    opacity: 0.9;
    background: rgba(255,255,255,0.18);
    border-radius: 4px;
    padding: 2px 8px;
}
.line-card__body {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    padding: 10px 14px 6px;
}
.line-card__visited {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
}
.line-card__sep,
.line-card__total {
    font-size: 1rem;
    color: var(--text-muted);
}
.line-card__pct {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text-muted);
}
.line-card__track {
    height: 6px;
    background: var(--surface2);
    margin: 0 14px 14px;
    border-radius: 3px;
    overflow: hidden;
}
.line-card__fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.7s ease;
}

/* ── Achievements screen ─────────────────────────────────────── */
.ach-summary {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: var(--gap);
}
.ach-section-title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-muted);
    margin: var(--gap) 0 8px;
}
.ach-section-title--locked { opacity: 0.6; }

.ach-list {
    display: flex;
    flex-direction: column;
    padding: 0;
    overflow: hidden;
}
.ach-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px var(--gap);
}
.ach-badge + .ach-badge { border-top: 1px solid var(--border); }
.ach-badge--locked { opacity: 0.4; }

.ach-badge__icon {
    font-size: 1.6rem;
    flex-shrink: 0;
    width: 40px;
    text-align: center;
    line-height: 1;
}
.ach-badge__dot {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 800;
    color: #fff;
    margin: 0 6px;
}
.ach-badge__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex: 1;
}
.ach-badge__name {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text);
}
.ach-badge--unlocked .ach-badge__name { color: var(--text); }
.ach-badge__desc {
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.35;
}
.ach-badge__date {
    font-size: 0.75rem;
    color: var(--c-victoria);
    margin-top: 2px;
}

/* ── Achievement unlock toast ────────────────────────────────── */
.ach-toast {
    position: fixed;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 80px);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    opacity: 0;
    transition: transform 0.35s ease, opacity 0.35s ease;
    z-index: 600;
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 40px;
    padding: 10px 20px 10px 14px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.35);
    white-space: nowrap;
    pointer-events: none;
    max-width: calc(100vw - 48px);
}
.ach-toast--in {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
.ach-toast__icon {
    font-size: 1.4rem;
    line-height: 1;
    flex-shrink: 0;
}
.ach-toast__body {
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.ach-toast__label {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--c-victoria);
}
.ach-toast__name {
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

/* ── Station ⓘ info button ──────────────────────────────────────── */
.station-info-btn {
    flex-shrink: 0;
    margin-left: 4px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 700;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background var(--transition), color var(--transition),
                border-color var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.station-info-btn:active,
.station-info-btn:hover {
    background: var(--line-colour, var(--surface));
    color: var(--line-text, var(--text));
    border-color: transparent;
}

/* ── Station info panel (bottom sheet) ──────────────────────────── */
.sinfo-overlay {
    position: fixed;
    inset: 0;
    /* Must clear Leaflet's own panes/controls (up to z-index 1000-1101 —
       .leaflet-container never establishes its own stacking context, so
       those values compete directly at the document root) so this still
       shows correctly when opened from a station marker on the Map screen. */
    z-index: 1200;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: flex-end;
    opacity: 0;
    transition: opacity 0.25s ease;
}
.sinfo-overlay--in {
    opacity: 1;
}
.sinfo-overlay--in .sinfo-panel {
    transform: translateY(0);
}
.sinfo-panel {
    width: 100%;
    max-height: 85vh;
    background: var(--surface);
    border-radius: var(--radius) var(--radius) 0 0;
    transform: translateY(100%);
    transition: transform 0.28s cubic-bezier(0.32, 0.72, 0, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding-bottom: env(safe-area-inset-bottom);
}
.sinfo-panel__handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--border);
    margin: 12px auto 0;
    flex-shrink: 0;
}
.sinfo-panel__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 20px 10px;
    flex-shrink: 0;
    border-bottom: 1px solid var(--border);
}
.sinfo-panel__title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--text);
    margin: 0;
}
.sinfo-panel__close {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg);
    color: var(--text-muted);
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: background var(--transition);
}
.sinfo-panel__close:hover { background: var(--border); }
.sinfo-panel__body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 16px 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* Info rows */
.sinfo__grid {
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 20px;
}
.sinfo__row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border);
}
.sinfo__row:last-child { border-bottom: none; }
.sinfo__icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    flex-shrink: 0;
}
.sinfo__icon--zone {
    background: var(--line-colour, #555);
    color: var(--line-text, #fff);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}
.sinfo__label {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 500;
}
.sinfo__empty {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 20px;
    text-align: center;
    padding: 20px 0;
}

/* Live departures button */
.sinfo__departures {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    padding: 12px 0;
    border-top: 1px solid var(--border);
    text-align: left;
    transition: color var(--transition);
}
.sinfo__departures:active { color: var(--line-colour, var(--text)); }

/* Wikipedia link */
.sinfo__wiki {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text);
    padding: 12px 0;
    border-top: 1px solid var(--border);
    text-decoration: none;
}
.sinfo__wiki:hover { color: var(--line-colour, var(--text)); }

/* Attribution */
.sinfo__source {
    font-size: 0.72rem;
    color: var(--text-muted);
    margin-top: 10px;
    text-align: center;
    letter-spacing: 0.02em;
}

/* Footer: "Show on map" + "Explore nearby" */
.sinfo-panel__footer {
    padding: 12px 16px 0;
    border-top: 1px solid var(--border);
    margin-top: 4px;
    flex-shrink: 0;
    display: flex;
    gap: 8px;
}
.sinfo-panel__footer .btn {
    flex: 1;
    justify-content: center;
}

/* Explore Nearby section (toggled by the footer button) */
.explore {
    display: none;
    padding: 12px 20px 0;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.explore--open { display: block; }
.explore__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.explore__cat {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text);
    transition: color var(--transition);
}
.explore__cat:hover,
.explore__cat:active { color: var(--line-colour, var(--text)); }
.explore__radius {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
}
.explore__radius-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
}
.explore__chips {
    display: flex;
    gap: 6px;
}
.explore__chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--bg);
    border: 1px solid var(--border);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: background var(--transition), color var(--transition);
}
.explore__chip--on {
    background: var(--line-colour, var(--text));
    border-color: var(--line-colour, var(--text));
    color: var(--line-text, var(--surface));
}
.explore__unit {
    margin-left: auto;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-decoration: underline;
}

/* Station Master place lists */
.explore__list {
    margin-top: 10px;
    border-top: 1px solid var(--border);
    max-height: 240px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
}
.explore__place {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-height: 40px;
    padding: 4px 2px;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    color: var(--text);
}
.explore__place:active { color: var(--line-colour, var(--text)); }
.explore__place-name {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.explore__place-dist {
    flex-shrink: 0;
    font-size: 0.75rem;
    color: var(--text-muted);
}
.explore__seeall {
    display: block;
    padding: 10px 2px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text);
}
.explore__seeall:hover { color: var(--line-colour, var(--text)); }
.explore__empty {
    padding: 12px 2px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.explore__upsell {
    width: 100%;
    margin-top: 12px;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px dashed var(--border);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
}
.explore__attribution {
    margin-top: 10px;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.02em;
}

/* Geograph station photos section (toggled by the footer button) */
.geo-section {
    display: none;
    padding: 12px 20px 0;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.geo-section--open { display: block; }
.geo-upsell {
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--bg);
    border: 1px dashed var(--border);
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-align: left;
}
.geo-strip__scroller {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
}
.geo-thumb {
    flex-shrink: 0;
    width: 96px;
    height: 96px;
    border-radius: 10px;
    object-fit: cover;
    border: 1px solid var(--border);
}
.geo-empty {
    padding: 12px 2px;
    font-size: 0.82rem;
    color: var(--text-muted);
}
.geo-attribution {
    margin-top: 8px;
    font-size: 0.68rem;
    color: var(--text-muted);
    text-align: center;
    letter-spacing: 0.02em;
}

/* Full-screen lightbox for a single Geograph photo.
   z-index must clear .sinfo-overlay (1200) — it can be opened from on top of
   the station info panel, which we close underneath it (see geograph.js). */
.geo-lightbox {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(0,0,0,0.92);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.geo-lightbox img {
    width: 100%;
    max-height: 80%;
    object-fit: contain;
    border-radius: 6px;
}
.geo-lightbox__caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin-top: 12px;
    text-align: center;
}
.geo-lightbox__title {
    color: var(--surface, #fff);
    font-size: 0.85rem;
    font-weight: 600;
}
.geo-lightbox__caption a {
    color: var(--surface, #fff);
    font-size: 0.78rem;
    text-decoration: underline;
}
.geo-lightbox__close {
    position: absolute;
    top: calc(env(safe-area-inset-top, 0px) + 26px);
    right: 16px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255,255,255,0.12);
    color: var(--surface, #fff);
    font-size: 1.3rem;
}

/* ── Journey Planner ─────────────────────────────────────────── */
.planner-form {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.planner-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.planner-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.planner-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
}
.planner-input {
    flex: 1;
}
.planner-gps-btn {
    background: none;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    padding: 8px 10px;
    font-size: 1rem;
    cursor: pointer;
    color: var(--text);
    flex-shrink: 0;
    transition: background var(--transition);
    line-height: 1;
}
.planner-gps-btn:active { background: var(--surface2); }
.planner-gps-btn:disabled { opacity: 0.5; cursor: default; }

.planner-swap-row {
    display: flex;
    justify-content: center;
    margin: -4px 0;
}
.planner-swap-btn {
    background: var(--surface);
    border: 1.5px solid var(--border);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 1.15rem;
    cursor: pointer;
    color: var(--text);
    line-height: 36px;
    text-align: center;
    flex-shrink: 0;
    transition: background var(--transition);
}
.planner-swap-btn:active { background: var(--surface2); }

.planner-suggestions {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    margin-top: 2px;
}
.planner-suggestions[hidden] { display: none; }
.planner-suggestion {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 10px 12px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    text-align: left;
    cursor: pointer;
    color: var(--text);
    font-size: 0.9rem;
    transition: background var(--transition);
    -webkit-tap-highlight-color: transparent;
}
.planner-suggestion:last-child { border-bottom: none; }
.planner-suggestion:active { background: var(--surface2); }
.planner-suggestion__dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.planner-error {
    font-size: 0.82rem;
    color: #C62828;
    min-height: 1.1em;
}
[data-theme="dark"] .planner-error { color: #EF9A9A; }

/* Results */
.planner-results-title {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 16px 4px;
}
.plan-card {
    margin: 0 16px 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}
.plan-card__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px 10px;
    border-bottom: 1px solid var(--border);
}
.plan-card__duration {
    font-size: 1rem;
    font-weight: 800;
    color: var(--text);
}
.plan-card__times {
    font-size: 0.82rem;
    color: var(--text-muted);
}
.plan-card__legs {
    padding: 10px 14px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.plan-leg {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.plan-leg__icon {
    font-size: 1rem;
    flex-shrink: 0;
    margin-top: 1px;
    width: 1.2em;
    text-align: center;
}
.plan-leg__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}
.plan-leg__summary {
    font-size: 0.83rem;
    color: var(--text);
    line-height: 1.35;
}
.plan-leg__line {
    font-size: 0.72rem;
    color: var(--text-muted);
}
.plan-leg__mins {
    font-size: 0.75rem;
    color: var(--text-muted);
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Station Master / upgrade screen ───────────────────────── */
.sm-hero {
    text-align: center;
    padding: 8px 4px 20px;
}
.sm-hero__icon {
    font-size: 2.6rem;
    margin-bottom: 8px;
}
.sm-hero__title {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.sm-hero__sub {
    font-size: 0.92rem;
    color: var(--text-muted);
    line-height: 1.45;
    max-width: 32ch;
    margin: 0 auto;
}
.sm-table {
    width: 100%;
    border-collapse: collapse;
    margin: 4px 0 18px;
    font-size: 0.86rem;
}
.sm-table th,
.sm-table td {
    padding: 9px 8px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.sm-table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted);
    font-weight: 700;
}
.sm-table th:nth-child(2), .sm-table td:nth-child(2),
.sm-table th:nth-child(3), .sm-table td:nth-child(3) {
    text-align: center;
    width: 56px;
}
/* Highlight the Station Master column */
.sm-table th:nth-child(3), .sm-table td:nth-child(3) {
    background: rgba(0, 25, 168, 0.06);   /* subtle Victoria-blue tint */
}
.sm-yes { color: var(--c-victoria); font-weight: 700; }
.sm-no  { color: var(--text-muted); opacity: 0.5; }
.sm-feature {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 10px;
}
.sm-feature__icon {
    font-size: 1.4rem;
    flex-shrink: 0;
    line-height: 1.4;
}
.sm-feature__desc {
    font-size: 0.82rem;
    color: var(--text-muted);
    margin-top: 2px;
    line-height: 1.35;
}
.sm-fineprint {
    text-align: center;
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 14px;
    opacity: 0.8;
}
.sm-comingsoon {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin: 0 0 18px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: rgba(0, 25, 168, 0.06);
}
.sm-comingsoon strong { color: var(--text); }

/* Dashboard upgrade CTA */
.home-sm-cta { margin-top: 16px; }

/* FAQ — Station Master support section */
.faq__sm {
    padding: 16px;
    margin-bottom: 16px;
    border: 1px solid var(--c-victoria);
}
.faq__sm-title {
    font-size: 1.05rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.faq__sm-text {
    font-size: 0.88rem;
    color: var(--text-muted);
    line-height: 1.5;
}
.faq__sm-thanks {
    margin-top: 12px;
    font-weight: 600;
    color: var(--c-victoria);
}

/* ── Add to Home Screen ─────────────────────────────────────── */
.install-card {
    position: fixed;
    left: 50%;
    bottom: calc(16px + env(safe-area-inset-bottom));
    transform: translateX(-50%);
    z-index: 1100;
    width: calc(100% - 24px);
    max-width: 440px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-md, 14px);
    box-shadow: 0 8px 28px rgba(0,0,0,0.28);
    padding: 14px 16px;
    animation: slideUp 0.25s ease;
}
@keyframes slideUp {
    from { opacity: 0; transform: translate(-50%, 16px); }
    to   { opacity: 1; transform: translate(-50%, 0); }
}
.install-card__body { display: flex; align-items: center; gap: 12px; }
.install-card__icon { font-size: 1.8rem; flex-shrink: 0; }
.install-card__text strong { font-size: 0.95rem; }
.install-card__text p { font-size: 0.82rem; color: var(--text-muted); margin-top: 2px; }
.install-card__actions { display: flex; gap: 10px; margin-top: 12px; }

/* iOS instructions overlay */
.ios-install {
    position: fixed;
    inset: 0;
    z-index: 1101;
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: flex-end;
    justify-content: center;
    padding: 16px;
}
.ios-install__sheet {
    width: 100%;
    max-width: 440px;
    background: var(--surface);
    border-radius: 18px;
    padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
    text-align: center;
    animation: slideUp 0.25s ease;
}
.ios-install__icon { font-size: 2.4rem; }
.ios-install__title { font-size: 1.1rem; font-weight: 700; margin: 8px 0 14px; }
.ios-install__steps {
    text-align: left;
    margin: 0 0 18px;
    padding-left: 22px;
    font-size: 0.9rem;
    line-height: 1.7;
    color: var(--text);
}
.ios-install__share {
    display: inline-block;
    color: var(--c-victoria);
    font-weight: 700;
}
.hamburger-menu__item--upgrade span:last-child {
    font-weight: 600;
    color: var(--c-victoria);
}
.hm-trial {
    padding: 0 16px 12px;
    pointer-events: none;
}
.hm-trial__label {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-bottom: 6px;
}
.hm-trial__bar-wrap {
    height: 6px;
    border-radius: 3px;
    background: var(--border);
    overflow: hidden;
}
.hm-trial__bar {
    height: 100%;
    border-radius: 3px;
    background: linear-gradient(90deg, #4a9eff, #a855f7);
    transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
    min-width: 3px;
}

/* ── Visit photos ───────────────────────────────────────────── */
.photo-strip--mini {
    display: flex;
    gap: 6px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.photo-thumb {
    width: 48px;
    height: 48px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    cursor: pointer;
    background: var(--surface2);
}
.photo-section {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
}
.photo-section__label {
    font-size: 0.82rem;
    font-weight: 600;
    margin-bottom: 8px;
}
.photo-grid {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}
.photo-tile {
    position: relative;
    width: 76px;
    height: 76px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--surface2);
}
.photo-tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}
.photo-tile__del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: #fff;
    font-size: 0.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.photo-tile--add {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 1px dashed var(--border);
    color: var(--text-muted);
    font-size: 1.4rem;
    cursor: pointer;
}
.photo-tile--add span { font-size: 0.7rem; }
.photo-locked {
    width: 100%;
    text-align: left;
    padding: 10px 12px;
    border: 1px dashed var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.85rem;
}
.photo-locked strong { color: var(--c-victoria); }

/* Editor overlay */
.photo-editor {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: #0b0b14;
    display: flex;
    flex-direction: column;
}
.photo-editor__bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    /* Pad past the iOS status bar / notch so the buttons aren't under it */
    padding: calc(14px + env(safe-area-inset-top)) 16px 14px;
    color: #fff;
    font-weight: 600;
}
.photo-editor__btn {
    color: #fff;
    font-size: 0.95rem;
    padding: 6px 10px;
}
.photo-editor__btn--go { color: var(--c-victoria); font-weight: 700; }
.photo-editor__stage {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 8px;
}
.photo-editor__stage canvas {
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
}
.photo-editor__controls {
    padding: 14px 18px calc(18px + env(safe-area-inset-bottom));
    background: #14141f;
    color: #fff;
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.photo-editor__row { display: flex; gap: 10px; }
.photo-editor__controls label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 0.8rem;
}
.photo-editor__controls input[type=range] { width: 100%; }

/* Full-screen viewer */
.photo-viewer {
    position: fixed;
    inset: 0;
    z-index: 1000;
    background: rgba(0,0,0,0.92);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}
.photo-viewer img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 6px;
}

/* ── Arcade hub ─────────────────────────────────────────────── */
.arcade-hub {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}

/* Arcade / Daily Challenges tabs */
.arcade-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 4px;
}
.arcade-tab {
    flex: 1;
    min-height: 44px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
}
.arcade-tab.is-active { background: var(--c-victoria); color: #fff; border-color: transparent; }

.arcade-panel {
    display: flex;
    flex-direction: column;
    gap: var(--gap);
}
.arcade-panel[hidden] { display: none; }

.arcade-hub__coming {
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
    padding: 4px 0 8px;
}

.arcade-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 14px;
    cursor: pointer;
    transition: background var(--transition), transform 0.1s ease;
    -webkit-tap-highlight-color: transparent;
}
.arcade-card:active {
    background: var(--surface2);
    transform: scale(0.985);
}

.arcade-card__icon  { font-size: 2.2rem; flex-shrink: 0; line-height: 1; }
.arcade-card__body  { flex: 1; min-width: 0; }
.arcade-card__title { font-size: 1.05rem; font-weight: 700; color: var(--text); margin-bottom: 3px; }
.arcade-card__desc  { font-size: 0.83rem; color: var(--text-muted); line-height: 1.4; }
.arcade-card__best  { font-size: 0.78rem; color: var(--text-muted); margin-top: 4px; }
.arcade-card__chevron { color: var(--text-muted); font-size: 1.6rem; flex-shrink: 0; }

/* ── Signal Snake layout ────────────────────────────────────── */
.signal-snake {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

.snake-scorebar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.snake-scorebar__item { text-align: center; }
.snake-scorebar__val  {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.snake-scorebar__lbl  {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.snake-arena {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: stretch;
}

.snake-arena canvas {
    display: block;
    touch-action: none;
    flex: 1;
}

/* D-pad ────────────────────────────────────────────────────── */
.snake-dpad {
    display: grid;
    grid-template-columns: repeat(3, 52px);
    grid-template-rows:    repeat(3, 52px);
    gap: 4px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    justify-content: center;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.snake-dpad__btn {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
    transition: background 0.1s ease, transform 0.08s ease;
}
.snake-dpad__btn:active {
    background: var(--text);
    color: var(--bg);
    transform: scale(0.92);
}
.snake-dpad__btn--action { font-size: 1rem; }

/* Overlay ──────────────────────────────────────────────────── */
.snake-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay);
    z-index: 10;
    padding: 20px;
}
.snake-overlay__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.snake-overlay__glyph  { font-size: 2.4rem; line-height: 1; }
.snake-overlay__title  { font-size: 1.4rem; font-weight: 800; color: var(--text); margin: 0; }
.snake-overlay__sub    { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; margin: 0; }
.snake-overlay__hint   { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.snake-overlay__score  { font-size: 2.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.snake-overlay__best   { font-size: 0.88rem; color: var(--text-muted); }
.snake-overlay__streak { font-size: 1rem; color: #f5a623; font-weight: 700; }

/* Floating labels ──────────────────────────────────────────── */
.snake-flash {
    position: absolute;
    pointer-events: none;
    font-size: 0.72rem;
    font-weight: 700;
    color: #4ade80;
    white-space: nowrap;
    transform: translateX(-50%);
    text-shadow: 0 1px 4px rgba(0,0,0,0.85);
    z-index: 20;
    animation: snakeFlash 1.4s ease-out forwards;
}
@keyframes snakeFlash {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-38px); }
}

.snake-banner {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #000;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 21;
    animation: snakeBanner 2.6s ease-out forwards;
}
@keyframes snakeBanner {
    0%   { opacity: 1; transform: translateX(-50%) translateY(0); }
    75%  { opacity: 1; transform: translateX(-50%) translateY(0); }
    100% { opacity: 0; transform: translateX(-50%) translateY(-10px); }
}

/* ── Fare Evaders ───────────────────────────────────────────────
   Mirrors the Signal Snake layout: a flex column of scorebar / canvas
   arena / control bar, with the same overlay-card and floating-label
   patterns. Scoped to .fe-* so it can't regress the other games.        */
.fare-evaders {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

.fe-scorebar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.fe-scorebar__item { text-align: center; }
.fe-scorebar__val  {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.fe-scorebar__lbl  {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.fe-arena {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: stretch;
}
.fe-arena canvas {
    display: block;
    touch-action: none;
    flex: 1;
}

/* Control bar */
.fe-controls {
    display: grid;
    grid-template-columns: 1fr 1.4fr 1fr auto;
    gap: 8px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.fe-ctrl {
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.15rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
    transition: background 0.1s ease, transform 0.08s ease;
}
.fe-ctrl:active {
    background: var(--text);
    color: var(--bg);
    transform: scale(0.94);
}
.fe-ctrl--fire { font-size: 0.95rem; background: var(--accent, #e94560); color: #fff; border-color: transparent; }
.fe-ctrl--pause { width: 52px; font-size: 1rem; }

/* Overlay (menu / pause / over) */
.fe-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay);
    z-index: 10;
    padding: 20px;
}
.fe-overlay__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.fe-overlay__glyph { font-size: 2.4rem; line-height: 1; }
.fe-overlay__title { font-size: 1.4rem; font-weight: 800; color: var(--text); margin: 0; }
.fe-overlay__sub   { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; margin: 0; }
.fe-overlay__hint  { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.fe-overlay__score { font-size: 2.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.fe-overlay__best  { font-size: 0.88rem; color: var(--text-muted); }
.fe-overlay__pb    { font-size: 1rem; color: #f5a623; font-weight: 700; }

.fe-ach-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.fe-ach {
    font-size: 0.82rem;
    color: var(--text);
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
}

/* Floating labels (mirror .snake-flash / .snake-banner) */
.fe-flash {
    position: absolute;
    pointer-events: none;
    font-size: 0.72rem;
    font-weight: 700;
    color: #4ade80;
    white-space: nowrap;
    transform: translateX(-50%);
    text-shadow: 0 1px 4px rgba(0,0,0,0.85);
    z-index: 20;
    animation: snakeFlash 1.2s ease-out forwards;
}
.fe-banner {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 21;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: snakeBanner 2.4s ease-out forwards;
}

/* ── Doors Closing ──────────────────────────────────────────────
   Same flex column as Fare Evaders / Signal Snake: scorebar / target
   strip / canvas arena / D-pad, with the shared overlay-card and
   floating-label patterns. Scoped to .dc-* so it can't regress the
   other games. New visuals: station-roundel target strip and
   Oyster-card life chips.                                             */
.doors-closing {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

.dc-scorebar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.dc-scorebar__item { text-align: center; }
.dc-scorebar__val  {
    font-size: 1.15rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.dc-scorebar__lbl  {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}
.dc-doors--urgent { color: #E32017; animation: dcUrgent 0.5s ease-in-out infinite alternate; }
@keyframes dcUrgent { from { opacity: 1; } to { opacity: 0.45; } }

/* Oyster-card life chips */
.dc-lives { display: flex; gap: 4px; justify-content: center; align-items: center; min-height: 1.15rem; }
.dc-life {
    display: inline-block;
    width: 20px;
    height: 13px;
    border-radius: 3px;
    background: linear-gradient(135deg, #0019A8 0%, #0019A8 55%, #00AEEF 55%, #00AEEF 100%);
    border: 1px solid rgba(255,255,255,0.35);
    box-shadow: 0 1px 2px rgba(0,0,0,0.35);
}
.dc-life--spent { opacity: 0.18; filter: grayscale(1); }

/* Goal-station roundel strip */
.dc-targets {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
    scrollbar-width: none;
}
.dc-targets:empty { display: none; }
.dc-targets::-webkit-scrollbar { display: none; }
.dc-target {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px 3px 5px;
    border-radius: 20px;
    background: var(--surface2);
    border: 1px solid var(--border);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    flex-shrink: 0;
}
.dc-target__roundel {
    display: inline-block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 3px solid #DC241F;
    position: relative;
    flex-shrink: 0;
}
.dc-target__roundel::after {
    content: '';
    position: absolute;
    left: -5px;
    right: -5px;
    top: 50%;
    height: 3px;
    margin-top: -1.5px;
    background: #003399;
}
.dc-target--done    { opacity: 0.9; }
.dc-target--done .dc-target__roundel { border-color: #4ade80; }
.dc-target--done .dc-target__roundel::after { background: #4ade80; }
.dc-target--current {
    border-color: #FFD300;
    box-shadow: 0 0 0 1px #FFD300;
}
.dc-target--locked  { opacity: 0.4; }

.dc-arena {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: stretch;
}
.dc-arena canvas {
    display: block;
    touch-action: none;
    flex: 1;
}

/* D-pad (mirrors .snake-dpad) */
.dc-dpad {
    display: grid;
    grid-template-columns: repeat(3, 52px);
    grid-template-rows:    repeat(3, 52px);
    gap: 4px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    justify-content: center;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.dc-dpad__btn {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
    transition: background 0.1s ease, transform 0.08s ease;
}
.dc-dpad__btn:active {
    background: var(--text);
    color: var(--bg);
    transform: scale(0.92);
}
.dc-dpad__btn--action { font-size: 1rem; }

/* Overlay (menu / pause / zone-clear / over) */
.dc-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay);
    z-index: 10;
    padding: 20px;
}
.dc-overlay__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 100%;
    overflow-y: auto;
}
.dc-overlay__glyph { font-size: 2.4rem; line-height: 1; }
.dc-overlay__title { font-size: 1.4rem; font-weight: 800; color: var(--text); margin: 0; }
.dc-overlay__sub   { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; margin: 0; }
.dc-overlay__hint  { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.dc-overlay__score { font-size: 2.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.dc-overlay__best  { font-size: 0.88rem; color: var(--text-muted); }
.dc-overlay__pb    { font-size: 1rem; color: #f5a623; font-weight: 700; }

/* Fare-zone tier selector on the menu card */
.dc-zone-select {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    margin: 4px 0;
}
.dc-zone-btn {
    padding: 8px 0;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
    -webkit-tap-highlight-color: transparent;
}
.dc-zone-btn--active {
    background: #e94560;
    color: #fff;
    border-color: transparent;
}
.dc-zone-btn--locked { opacity: 0.35; cursor: default; }

.dc-ach-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.dc-ach {
    font-size: 0.82rem;
    color: var(--text);
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
}

/* Floating labels (mirror .snake-flash / .snake-banner) */
.dc-flash {
    position: absolute;
    pointer-events: none;
    font-size: 0.72rem;
    font-weight: 700;
    color: #4ade80;
    white-space: nowrap;
    transform: translateX(-50%);
    text-shadow: 0 1px 4px rgba(0,0,0,0.85);
    z-index: 20;
    animation: snakeFlash 1.2s ease-out forwards;
}
.dc-banner {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 21;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: snakeBanner 2.4s ease-out forwards;
}

/* ── Last Train Home ────────────────────────────────────────────
   3D endless runner. Same flex column as Doors Closing: scorebar /
   arena (WebGL canvas) / D-pad, with the shared overlay-card and
   banner patterns. Scoped to .lth-* so it can't regress the other
   games. New visuals: departure-board missed-train card, station
   roundel checkpoint, character select chips, headlight flash.     */
.last-train-home {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

.lth-scorebar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.lth-scorebar__item { text-align: center; min-width: 0; }
.lth-scorebar__val  {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90px;
}
.lth-scorebar__lbl  {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

/* Missed-train chips (departure-board style lives) */
.lth-trains { display: flex; gap: 3px; justify-content: center; align-items: center; min-height: 1.05rem; }
.lth-train-chip { font-size: 0.9rem; line-height: 1; }
.lth-train-chip--gone { opacity: 0.18; filter: grayscale(1); }

.lth-arena {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: #0b0b12;
    display: flex;
    align-items: stretch;
}
.lth-arena canvas {
    display: block;
    touch-action: none;
    flex: 1;
    width: 100%;
    height: 100%;
}

/* Headlight flood when the last train catches you */
.lth-flashfx {
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: radial-gradient(ellipse at 50% 65%, rgba(255,255,230,0.95), rgba(255,255,210,0.4) 45%, transparent 75%);
    opacity: 0;
    z-index: 5;
}
.lth-flashfx--on { animation: lthFlash 1.1s ease-out forwards; }
@keyframes lthFlash {
    0%   { opacity: 0; }
    18%  { opacity: 1; }
    100% { opacity: 0; }
}

/* D-pad (mirrors .dc-dpad) */
.lth-dpad {
    display: grid;
    grid-template-columns: repeat(3, 52px);
    grid-template-rows:    repeat(3, 52px);
    gap: 4px;
    padding: 10px 10px calc(10px + env(safe-area-inset-bottom));
    justify-content: center;
    background: var(--surface);
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}
.lth-dpad__btn {
    width: 52px;
    height: 52px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    touch-action: manipulation;
    transition: background 0.1s ease, transform 0.08s ease;
}
.lth-dpad__btn:active {
    background: var(--text);
    color: var(--bg);
    transform: scale(0.92);
}
.lth-dpad__btn--action { font-size: 1rem; }

/* Overlay (menu / pause / checkpoint / missed / over) */
.lth-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay);
    z-index: 10;
    padding: 20px;
}
.lth-overlay__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 100%;
    overflow-y: auto;
}
.lth-overlay__glyph { font-size: 2.4rem; line-height: 1; }
.lth-overlay__title { font-size: 1.4rem; font-weight: 800; color: var(--text); margin: 0; }
.lth-overlay__sub   { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; margin: 0; }
.lth-overlay__hint  { font-size: 0.8rem; color: var(--text-muted); margin: 0; }
.lth-overlay__score { font-size: 2.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.lth-overlay__best  { font-size: 0.88rem; color: var(--text-muted); }
.lth-overlay__pb    { font-size: 1rem; color: #f5a623; font-weight: 700; }

/* Countdown numeral */
.lth-count {
    font-size: 5rem;
    font-weight: 800;
    color: #fff;
    text-shadow: 0 2px 16px rgba(0,0,0,0.6);
    animation: lthCount 0.55s ease-out;
}
@keyframes lthCount {
    from { transform: scale(1.6); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* Character select chips */
.lth-chars {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    margin: 4px 0;
}
.lth-char {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    padding: 10px 4px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
}
.lth-char__emoji { font-size: 1.5rem; line-height: 1; }
.lth-char__name  { font-size: 0.62rem; font-weight: 700; line-height: 1.2; }
.lth-char--active {
    border-color: #FFD300;
    box-shadow: 0 0 0 1px #FFD300;
}

/* Line picker on the menu card */
.lth-line-select {
    width: 100%;
    padding: 10px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
}

/* Checkpoint station sign: platform-style blue nameplate, full width so
   the whole station name fits where possible */
.lth-nameplate {
    width: 100%;
    background: #003399;
    border: 2px solid #fff;
    outline: 2px solid #003399;
    border-radius: 3px;
    color: #fff;
    font-size: 0.92rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    padding: 10px 8px;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Departure board on the missed-train card */
.lth-board {
    background: #101014;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 8px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.lth-board__row {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    font-family: ui-monospace, 'SF Mono', Consolas, monospace;
    font-size: 0.72rem;
    font-weight: 700;
    color: #f5a623;
    letter-spacing: 0.03em;
}
.lth-board__row span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lth-board__row--gone { color: #e32017; text-decoration: line-through; opacity: 0.75; }

/* Newly unlocked achievements on end cards (mirror .dc-ach) */
.lth-ach-list { display: flex; flex-direction: column; gap: 6px; margin: 4px 0; }
.lth-ach {
    font-size: 0.82rem;
    color: var(--text);
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 6px 10px;
}

/* Floating banner (mirror .dc-banner) */
.lth-banner {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    z-index: 21;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
    animation: snakeBanner 2.4s ease-out forwards;
}

/* ── Missing Link ───────────────────────────────────────────── */
.ml-screen { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }
.ml-loading { text-align: center; color: var(--text-muted); margin-top: 20px; }

/* Ghost button used across the Missing Link screens */
.btn--ghost {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border);
}
.btn--ghost:active { background: var(--surface2); }

/* HUD */
.ml-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 10px 14px;
    margin-bottom: 14px;
}
.ml-hud__cell {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-variant-numeric: tabular-nums;
}
.ml-hud__cell b { color: var(--text); font-size: 1rem; }

/* Meta row: difficulty + line chips */
.ml-meta {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}
.ml-badge {
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 9px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface2);
}
.ml-badge--easy   { color: #16a34a; border-color: #16a34a55; }
.ml-badge--medium { color: #d97706; border-color: #d9770655; }
.ml-badge--hard   { color: #dc2626; border-color: #dc262655; }
.ml-badge--ix     { color: var(--text); }

/* Line chip — colour PLUS the line name so it never relies on colour alone */
.ml-line-chip {
    font-size: 0.72rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 20px;
    background: var(--ml-line, var(--surface2));
    color: var(--ml-line-text, var(--text));
    border: 1px solid rgba(0,0,0,0.15);
}

.ml-banner {
    background: var(--surface2);
    color: var(--text);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.85rem;
    margin-bottom: 12px;
    text-align: center;
}

/* The route, drawn vertically as chips + connectors */
.ml-route {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    margin: 6px 0 16px;
}
.ml-route__node {
    width: 100%;
    max-width: 320px;
    text-align: center;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 0.95rem;
}
.ml-route__gap {
    background: repeating-linear-gradient(
        45deg, var(--surface2), var(--surface2) 8px,
        transparent 8px, transparent 16px);
    border-style: dashed;
    color: var(--text-muted);
    font-weight: 800;
    font-size: 1.2rem;
}
.ml-route__gap--active {
    border-color: var(--c-victoria);
    border-style: solid;
    color: var(--c-victoria);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-victoria) 30%, transparent);
}
.ml-route__arrow { color: var(--text-muted); font-size: 0.85rem; line-height: 1; }
.ml-route--review { opacity: 0.95; }

.ml-prompt {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0 0 14px;
}

.ml-hints-shown { margin-bottom: 12px; display: flex; flex-direction: column; gap: 6px; }
.ml-hint-note {
    font-size: 0.82rem;
    color: var(--text);
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 7px 11px;
}

/* Choice buttons — large touch targets */
.ml-choices {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 16px;
}
.ml-choice {
    min-height: 56px;
    padding: 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.12s ease, transform 0.08s ease;
}
.ml-choice:active { background: var(--surface2); transform: scale(0.97); }

/* Hint bar */
.ml-hintbar {
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}
.ml-hintbtn {
    flex: 1;
    min-width: 70px;
    min-height: 44px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 600;
    cursor: pointer;
}
.ml-hintbtn:disabled { opacity: 0.45; cursor: default; }
.ml-fineprint { text-align: center; color: var(--text-muted); font-size: 0.72rem; margin-top: 10px; }

/* Feedback */
.ml-feedback { text-align: center; margin: 10px 0 18px; }
.ml-feedback__icon  { font-size: 2.6rem; line-height: 1; }
.ml-feedback__title { font-size: 1.4rem; font-weight: 800; margin-top: 6px; }
.ml-feedback--ok .ml-feedback__title { color: #16a34a; }
.ml-feedback--no .ml-feedback__title { color: #dc2626; }
.ml-feedback__ans    { color: var(--text-muted); margin-top: 6px; font-size: 0.95rem; }
.ml-feedback__streak { color: #f5a623; font-weight: 700; margin-top: 4px; }

/* Game over */
.ml-over { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding-top: 12px; }
.ml-over__icon  { font-size: 3rem; line-height: 1; }
.ml-over__title { font-size: 1.5rem; font-weight: 800; margin: 0; }
.ml-over__score { font-size: 3rem; font-weight: 800; color: var(--c-victoria); line-height: 1; }
.ml-over__score span { font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.ml-over__stats { display: flex; gap: 16px; flex-wrap: wrap; justify-content: center; color: var(--text-muted); font-size: 0.85rem; }
.ml-over__stats b { color: var(--text); }
.ml-over .btn { width: 100%; max-width: 320px; }
.ml-ach-list { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 320px; }
.ml-ach {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 0.85rem;
}

/* Leaderboard */
.ml-lb { display: flex; flex-direction: column; gap: 12px; }
.ml-lb__tabs { display: flex; gap: 8px; }
.ml-lb__tab {
    flex: 1;
    min-height: 42px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    cursor: pointer;
}
.ml-lb__tab.is-active { background: var(--c-victoria); color: #fff; border-color: transparent; }
.ml-lb__title { text-align: center; font-size: 1rem; margin: 0; color: var(--text-muted); }
.ml-lb__list { display: flex; flex-direction: column; gap: 4px; }
.ml-lb__row {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
}
.ml-lb__rank  { width: 28px; font-weight: 800; color: var(--text-muted); text-align: center; }
.ml-lb__name  { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ml-lb__score { font-weight: 800; font-variant-numeric: tabular-nums; }

@media (min-width: 520px) {
    .ml-choices { grid-template-columns: 1fr 1fr; max-width: 460px; margin-inline: auto; }
}

/* ============================================================
   Word Search (arcade game 3)
   ============================================================ */
.ws-screen { padding-bottom: calc(env(safe-area-inset-bottom) + 24px); }

/* ── Setup screen ─────────────────────────────────────────── */
.ws-setup { display: flex; flex-direction: column; gap: 10px; }
.ws-setup__h {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 10px 0 2px;
}
.ws-setup__h:first-child { margin-top: 0; }

.ws-opts { display: flex; flex-direction: column; gap: 8px; }
.ws-opt {
    display: flex;
    flex-direction: column;
    gap: 3px;
    text-align: left;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}
.ws-opt.is-on {
    border-color: var(--c-victoria);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-victoria) 28%, transparent);
}
.ws-opt__title { font-weight: 700; font-size: 1rem; }
.ws-opt__desc  { font-size: 0.8rem; color: var(--text-muted); line-height: 1.35; }

.ws-modeopts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.ws-modeopt {
    display: flex;
    flex-direction: column;
    gap: 2px;
    text-align: left;
    padding: 11px 12px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
}
.ws-modeopt.is-on {
    border-color: var(--c-victoria);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-victoria) 28%, transparent);
}
.ws-modeopt__icon { font-size: 1.4rem; line-height: 1; }
.ws-modeopt__name { font-weight: 700; font-size: 0.92rem; }
.ws-modeopt__desc { font-size: 0.72rem; color: var(--text-muted); line-height: 1.3; }

.ws-toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.ws-seg {
    display: flex;
    flex-direction: column;
    gap: 2px;
    align-items: center;
    text-align: center;
    padding: 12px 10px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 700;
    font-size: 0.95rem;
}
.ws-seg span { font-weight: 400; font-size: 0.72rem; color: var(--text-muted); line-height: 1.3; }
.ws-seg.is-on {
    border-color: var(--c-victoria);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-victoria) 28%, transparent);
}
.ws-start { margin-top: 8px; }

/* ── Game HUD + meta ──────────────────────────────────────── */
.ws-game { --ws-cell: 34px; display: flex; flex-direction: column; }
.ws-hud {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 9px 12px;
    margin-bottom: 8px;
}
.ws-hud__cell { font-size: 0.8rem; color: var(--text-muted); font-variant-numeric: tabular-nums; }
.ws-hud__cell b { color: var(--text); font-size: 1rem; }
.ws-hud__cell--warn b { color: var(--c-windrush); }

.ws-progress {
    height: 7px;
    border-radius: 4px;
    background: var(--surface2);
    overflow: hidden;
    margin-bottom: 12px;
}
.ws-progress__bar {
    height: 100%;
    background: var(--c-district);
    border-radius: 4px;
    transition: width 0.3s ease;
}

.ws-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.ws-badge {
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 4px 9px;
    border-radius: 20px;
    border: 1px solid var(--border);
    color: var(--text);
    background: var(--surface2);
}
.ws-badge--small  { color: #16a34a; border-color: #16a34a55; }
.ws-badge--medium { color: #d97706; border-color: #d9770655; }
.ws-badge--large  { color: #dc2626; border-color: #dc262655; }
.ws-badge--ch     { color: var(--c-victoria); border-color: color-mix(in srgb, var(--c-victoria) 40%, transparent); }
.ws-note { font-size: 0.8rem; color: var(--text-muted); margin-bottom: 8px; }

/* ── Grid ─────────────────────────────────────────────────── */
.ws-gridwrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(var(--gap) * -1) 12px;
    padding: 4px var(--gap);
}
.ws-grid {
    display: grid;
    gap: 2px;
    width: max-content;
    margin: 0 auto;
}
.ws-cell {
    width: var(--ws-cell);
    height: var(--ws-cell);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 5px;
    color: var(--text);
    font-weight: 700;
    font-size: calc(var(--ws-cell) * 0.46);
    text-transform: uppercase;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: background 0.1s ease, transform 0.06s ease;
}
.ws-cell:active { transform: scale(0.92); }
.ws-cell--ray   { background: color-mix(in srgb, var(--c-victoria) 12%, var(--surface)); }
.ws-cell--sel {
    background: var(--c-victoria);
    color: #fff;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-victoria) 45%, transparent);
}
.ws-cell--miss {
    background: var(--c-windrush);
    color: #fff;
    animation: wsShake 0.36s ease;
}
@keyframes wsShake {
    0%,100% { transform: translateX(0); }
    25%     { transform: translateX(-3px); }
    75%     { transform: translateX(3px); }
}
/* Found cells: colour PLUS bold + inset ring so it never relies on colour alone */
.ws-cell--found {
    background: var(--ws-fc, var(--c-district));
    color: #fff;
    border-color: transparent;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35);
}
.ws-cell--bonus {
    background: #f5a623;
    color: #1a1a2e;
    box-shadow: inset 0 0 0 2px rgba(0,0,0,0.3);
}
.ws-cell--hint {
    animation: wsHintPulse 0.8s ease-in-out 3;
    background: #60a5fa;
    color: #fff;
}
.ws-cell--region {
    background: color-mix(in srgb, #60a5fa 28%, var(--surface));
    box-shadow: inset 0 0 0 1px #60a5fa;
}
@keyframes wsHintPulse {
    0%,100% { transform: scale(1); }
    50%     { transform: scale(1.12); }
}
/* High-contrast mode — stronger borders + selection */
.ws-game--hc .ws-cell { border-color: var(--text-muted); }
.ws-game--hc .ws-cell--found { box-shadow: inset 0 0 0 3px #fff; }
.ws-game--hc .ws-progress__bar { background: var(--text); }

/* ── Banner ───────────────────────────────────────────────── */
.ws-banner {
    color: #fff;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    font-size: 0.85rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 12px;
}

/* ── Word list ────────────────────────────────────────────── */
.ws-wl__h {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 4px 0 8px;
}
.ws-wl {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    margin-bottom: 14px;
}
.ws-wl__item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 11px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 600;
    font-size: 0.86rem;
    letter-spacing: 0.02em;
}
.ws-wl__tick { color: var(--text-muted); font-weight: 800; width: 1em; text-align: center; }
.ws-wl__item.is-found {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--ws-fc, currentColor);
    text-decoration-thickness: 2px;
    background: var(--surface2);
}
.ws-wl__item.is-found .ws-wl__tick { color: var(--ws-fc, var(--c-district)); }

/* ── Hint bar ─────────────────────────────────────────────── */
.ws-hintbar { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.ws-hintbtn {
    flex: 1;
    min-width: 84px;
    min-height: 44px;
    padding: 8px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 600;
}
.ws-hintbtn:disabled { opacity: 0.45; }
.ws-fineprint { text-align: center; color: var(--text-muted); font-size: 0.72rem; margin-top: 10px; }

/* ── Completion / game over ───────────────────────────────── */
.ws-over { text-align: center; display: flex; flex-direction: column; gap: 12px; align-items: center; padding-top: 12px; }
.ws-over__icon  { font-size: 3rem; line-height: 1; }
.ws-over__title { font-size: 1.5rem; font-weight: 800; margin: 0; }
.ws-over__score { font-size: 3rem; font-weight: 800; color: var(--c-victoria); line-height: 1; }
.ws-over__score span { font-size: 1rem; color: var(--text-muted); font-weight: 600; }
.ws-over__pb { color: #f5a623; font-weight: 800; }
.ws-over__stats { display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; color: var(--text-muted); font-size: 0.85rem; }
.ws-over__stats b { color: var(--text); }
.ws-over__bonus {
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 9px 12px;
    font-size: 0.85rem;
    max-width: 320px;
    width: 100%;
}
.ws-over__bonus--yes { background: color-mix(in srgb, #f5a623 22%, var(--surface)); }
.ws-over .btn { width: 100%; max-width: 320px; }
.ws-ach-list { display: flex; flex-direction: column; gap: 6px; width: 100%; max-width: 320px; }
.ws-ach { background: var(--surface2); border-radius: var(--radius-sm); padding: 9px 12px; font-size: 0.85rem; }

@media (min-width: 520px) {
    .ws-game { --ws-cell: 38px; }
    .ws-modeopts { grid-template-columns: 1fr 1fr 1fr; }
    .ws-wl { grid-template-columns: 1fr 1fr 1fr; max-width: 560px; }
}

/* ════════════════════════════════════════════════════════════════════
   Crossword (reuses .ws-* setup/HUD/badge/banner/hintbar/over classes)
   ════════════════════════════════════════════════════════════════════ */
.cr-gridwrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 0 calc(var(--gap) * -1) 12px;
    padding: 4px var(--gap);
}
.cr-grid {
    --cr-cell: 30px;
    display: grid;
    gap: 2px;
    width: max-content;
    margin: 0 auto;
}
.cr-cell {
    position: relative;
    width: var(--cr-cell);
    height: var(--cr-cell);
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 3px;
    padding: 0;
    font-weight: 700;
    font-size: calc(var(--cr-cell) * 0.5);
    text-transform: uppercase;
    color: var(--text);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    transition: background 0.1s ease, box-shadow 0.1s ease;
}
.cr-cell--block {
    background: transparent;
    border-color: transparent;
}
.cr-cell__num {
    position: absolute;
    top: 1px;
    left: 2px;
    font-size: calc(var(--cr-cell) * 0.28);
    font-weight: 600;
    line-height: 1;
    color: var(--text-muted);
    pointer-events: none;
}
.cr-cell--active { background: color-mix(in srgb, var(--c-victoria) 16%, var(--surface)); }
.cr-cell--cursor {
    background: var(--c-victoria);
    color: #fff;
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--c-victoria) 45%, transparent);
}
.cr-cell--cursor .cr-cell__num { color: rgba(255,255,255,0.85); }
.cr-cell--solved {
    background: var(--cr-fc, var(--c-district));
    color: #fff;
    border-color: transparent;
    box-shadow: inset 0 0 0 2px rgba(255,255,255,0.35);
}
.cr-cell--solved .cr-cell__num { color: rgba(255,255,255,0.9); }
.cr-cell--miss {
    background: var(--c-windrush);
    color: #fff;
    animation: wsShake 0.36s ease;
}
.ws-game--hc .cr-cell { border-color: var(--text-muted); }
.ws-game--hc .cr-cell--solved { box-shadow: inset 0 0 0 3px #fff; }

/* ── Clue bar ─────────────────────────────────────────────── */
.cr-cluebar {
    display: flex;
    align-items: center;
    gap: 8px;
    background: var(--surface2);
    border-radius: var(--radius-sm);
    padding: 8px 10px;
    margin-bottom: 10px;
    min-height: 44px;
}
.cr-cluebar__text { flex: 1; font-size: 0.9rem; line-height: 1.3; }
.cr-cluebar__nav {
    flex: 0 0 auto;
    width: 34px;
    height: 34px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text);
    font-size: 1.2rem;
    line-height: 1;
    cursor: pointer;
}

/* ── On-screen keyboard ───────────────────────────────────── */
.cr-kbd { display: flex; flex-direction: column; gap: 6px; margin-bottom: 12px; }
.cr-kbd__row { display: flex; gap: 4px; justify-content: center; }
.cr-key {
    flex: 1 1 0;
    max-width: 40px;
    min-height: 44px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text);
    font-weight: 700;
    font-size: 0.95rem;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}
.cr-key:active { transform: scale(0.94); }
.cr-key--wide { max-width: 60px; flex: 1.4 1 0; }

/* ── Clue lists ───────────────────────────────────────────── */
.cr-cluelists {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
}
.cr-cluecol__h {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    margin: 4px 0 8px;
}
.cr-clues { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 5px; }
.cr-clue {
    display: flex;
    gap: 7px;
    padding: 7px 9px;
    border-radius: var(--radius-sm);
    background: var(--surface);
    font-size: 0.82rem;
    line-height: 1.25;
    cursor: pointer;
}
.cr-clue__num { font-weight: 800; min-width: 1.4em; color: var(--text-muted); }
.cr-clue.is-active { box-shadow: inset 0 0 0 2px var(--c-victoria); background: var(--surface2); }
.cr-clue.is-solved {
    color: var(--text-muted);
    text-decoration: line-through;
    text-decoration-color: var(--cr-fc, currentColor);
    text-decoration-thickness: 2px;
    background: var(--surface2);
}
.cr-clue.is-solved .cr-clue__num { color: var(--cr-fc, var(--c-district)); }

@media (min-width: 520px) {
    .cr-grid { --cr-cell: 36px; }
    .cr-key { max-width: 48px; }
}

/* ── Solitaire ─────────────────────────────────────────────────
   Mirrors the Signal Snake layout: a flex column of scorebar / canvas
   arena / control bar, with the same overlay-card pattern. Scoped to
   .sol-* so it can't regress the other games.                          */
.solitaire {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    background: var(--bg);
}

.sol-scorebar {
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 8px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sol-scorebar__item { text-align: center; }
.sol-scorebar__val {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    font-variant-numeric: tabular-nums;
}
.sol-scorebar__lbl {
    font-size: 0.6rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-top: 2px;
}

.sol-drawtoggle {
    display: flex;
    gap: 8px;
    padding: 8px 12px;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}
.sol-drawtoggle__btn {
    flex: 1;
    min-height: 36px;
    border-radius: var(--radius-sm);
    background: var(--surface2);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
}
.sol-drawtoggle__btn.is-active { background: var(--c-victoria); color: #fff; border-color: transparent; }

.sol-arena {
    flex: 1;
    min-height: 0;
    position: relative;
    overflow: hidden;
    background: var(--bg);
    display: flex;
    align-items: stretch;
}
.sol-arena canvas {
    display: block;
    touch-action: none;
    flex: 1;
}

.sol-autofinish {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    background: #4ade80;
    color: #0d3320;
    font-weight: 800;
    font-size: 0.82rem;
    padding: 8px 16px;
    border-radius: 20px;
    box-shadow: var(--shadow);
    z-index: 15;
    -webkit-tap-highlight-color: transparent;
}

.sol-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--overlay);
    z-index: 20;
    padding: 20px;
}
.sol-overlay__card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: center;
    max-width: 320px;
    width: 100%;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.sol-overlay__glyph { font-size: 2.4rem; line-height: 1; }
.sol-overlay__title { font-size: 1.3rem; font-weight: 800; color: var(--text); margin: 0; }
.sol-overlay__sub   { font-size: 0.9rem; color: var(--text-muted); line-height: 1.5; margin: 0; }
.sol-overlay__score { font-size: 2.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.sol-overlay__best  { font-size: 0.88rem; color: var(--text-muted); }

.sol-controls {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    justify-content: center;
    flex-wrap: wrap;
    background: var(--surface);
}
.sol-controls__btn {
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: 6px;
    background: var(--surface);
    color: var(--text);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 200ms;
}
.sol-controls__btn:active {
    background: var(--text);
    color: var(--surface);
}
.sol-controls__btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.sol-hint-pulse {
    position: absolute;
    pointer-events: none;
    animation: sol-pulse 1.5s ease-in-out infinite;
}
.sol-hint-pulse--waste {
    width: 120px;
    height: 170px;
    left: 20px;
    top: 20px;
    border: 3px solid #fbbf24;
    border-radius: 12px;
}
.sol-hint-pulse--tableau {
    width: 64px;
    height: 96px;
    border: 2px solid #fbbf24;
    border-radius: 8px;
}

@keyframes sol-pulse {
    0%, 100% { box-shadow: 0 0 0 2px #fbbf24; opacity: 1; }
    50% { box-shadow: 0 0 12px 6px #fbbf24; opacity: 0.7; }
}

/* ── Admin screen ─────────────────────────────────────────── */
.admin-item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 12px var(--gap);
    border-bottom: 1px solid var(--border);
}
.admin-item:last-child { border-bottom: none; }
.admin-item__info { flex: 1; min-width: 0; }
.admin-item__name {
    font-size: 0.95rem;
    font-weight: 600;
}
.admin-item__badge {
    display: inline-block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    background: var(--c-victoria);
    color: #fff;
    border-radius: 4px;
    padding: 2px 6px;
    margin-left: 4px;
    vertical-align: middle;
}
.admin-item__email {
    font-size: 0.8rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}
.admin-item__meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 4px;
}
.admin-item__status--free  { color: var(--c-district); font-weight: 600; }
.admin-item__status--trial { color: var(--c-circle);   font-weight: 600; }
.admin-item__status--none  { color: var(--text-muted); }
.admin-item__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.admin-item__actions .btn {
    padding: 6px 10px;
}
.admin-item__action--full { grid-column: 1 / -1; }
