/* RDBK.app — shared design system (every page uses it).
   Dark rally/desert theme. Mobile-first. */
:root {
    --bg: #0e1116;
    --bg-soft: #151a22;
    --card: #1a212c;
    --card-2: #212a37;
    --line: rgba(255, 255, 255, .08);
    --text: #eef2f7;
    --muted: #93a0b4;
    --sand: #e8b059;      /* primary accent (sand/dune) */
    --sand-2: #f2c879;
    --on-sand: #14100a;   /* ink/text that sits on a sand fill */
    --track: #ff5a45;     /* track red */
    --ok: #3ad29f;
    --info: #5aa9ff;
    --radius: 16px;
    --shadow: 0 10px 40px rgba(0, 0, 0, .45);
    --maxw: 1080px;
    --tabbar-h: 3.75rem;  /* app-like bottom tab bar height (mobile web · PWA · native) */
    color-scheme: dark;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* The `hidden` attribute must ALWAYS beat classes that set display (.center-screen,
   .modal…). Without this, screens/modals would not hide. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
html, body { margin: 0; padding: 0; }
body {
    background:
        radial-gradient(1200px 600px at 85% -8%, rgba(232, 176, 89, .14), transparent 60%),
        radial-gradient(900px 500px at -10% 5%, rgba(217, 102, 59, .10), transparent 55%),
        var(--bg);
    color: var(--text);
    font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    line-height: 1.55;
}
a { color: var(--sand-2); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }
.muted { color: var(--muted); }
.small { font-size: .85rem; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 1.1rem; }
/* native app recommendation banner — shown in browser, hidden in native apps */
.native-hint { background: var(--card-2); border: 1px solid var(--line); border-radius: 10px; padding: .7rem .9rem; margin: .8rem 0; font-size: .85rem; color: var(--text); display: flex; align-items: flex-start; gap: .5rem; }
.native-hint i { color: var(--sand); flex-shrink: 0; margin-top: .1rem; font-size: 1.1rem; }
.native .native-hint { display: none; }
/* keyboard accessibility: a clear ring on focus-visible only (no mouse-click rings) */
:focus-visible { outline: 2px solid var(--sand); outline-offset: 2px; }
:focus:not(:focus-visible) { outline: none; }
/* vestibular accessibility: stand still when the user asks for reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* ---------- topbar ---------- */
.topbar {
    position: sticky; top: 0; z-index: 40;
    background: rgba(14, 17, 22, .8); backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
}
.topbar .wrap { display: flex; align-items: center; justify-content: space-between; gap: 1rem; height: 56px; }
.brand { display: inline-flex; align-items: center; gap: .55rem; font-weight: 800; color: var(--text); letter-spacing: -.01em; }
.brand:hover { text-decoration: none; }
.brand-wrap { display: inline-flex; align-items: center; gap: .55rem; }
/* "How it works" link to a tool's /features page — labelled, shown right after the active tool's nav link */
.tool-help { display: inline-flex; align-items: center; gap: .35rem; color: var(--muted); font-size: .92rem; font-weight: 600; line-height: 1; text-decoration: none; transition: color .15s; }
.tool-help:hover { color: var(--sand); text-decoration: none; }
/* minimal desktop nav: clean single-word text links with an animated active/hover underline */
.topnav { display: flex; align-items: center; gap: 1.45rem; }
.nav-link { position: relative; background: none; border: 0; padding: .3rem 0; color: var(--muted); font: inherit; font-weight: 600; font-size: .95rem; letter-spacing: -.01em; white-space: nowrap; cursor: pointer; text-decoration: none; transition: color .15s ease; }
.nav-link:hover { color: var(--text); text-decoration: none; }
.nav-link.active { color: var(--sand); }
/* the tool icon rides in the markup but only surfaces in the mobile full-screen menu */
.nav-ico { display: none; }
/* animated underline indicator under the tool links (grows on hover, pinned when active) */
.nav-tool::after { content: ''; position: absolute; left: 0; right: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--sand); transform: scaleX(0); transform-origin: center; transition: transform .18s ease; }
.nav-tool:hover::after, .nav-tool.active::after { transform: scaleX(1); }
/* Desktop shows the nav links inline in the top bar. On every mobile-width view — web, installed
   PWA and the native app — the top bar is hidden and the fixed icon-only bottom tab bar takes over
   (no hamburger, no full-screen menu). */
.native .topbar { display: none; }
@media (max-width: 1024px) { .topbar { display: none; } }

/* ---------- app-like bottom tab bar (Instagram-style, icon-only). One definition shown wherever
   the top bar is hidden: the native app AND any mobile-width web/PWA view; hidden on desktop. ---------- */
.app-tabbar { display: none; position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    justify-content: space-around; align-items: stretch;
    background: rgba(14, 17, 22, .96); backdrop-filter: blur(14px);
    border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
.app-tabbar .tabbar-link { flex: 1; display: flex; align-items: center; justify-content: center;
    padding: .85rem 0; color: var(--muted); font-size: 1.6rem; text-decoration: none;
    transition: color .12s ease, transform .08s ease; }
.app-tabbar .tabbar-link.active { color: var(--sand); }
.app-tabbar .tabbar-link:active { transform: scale(.88); }
/* show the bar + leave room so content and any fixed bottom controls clear it. With no top bar,
   the top padding is the notch / status-bar inset (viewport-fit=cover), so content never sits
   under the clock. The sticky tool bars pin to the same inset, so they line up with no gap. */
.native .app-tabbar { display: flex; }
.native body { padding-top: env(safe-area-inset-top); padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
.native .fabrow { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
@media (max-width: 1024px) {
    .app-tabbar { display: flex; }
    body { padding-top: env(safe-area-inset-top); padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
    .fabrow { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); }
}
/* fullscreen field mode (active recording / navigation) reclaims the whole screen — bar hidden.
   `body.rb-fs`/`body.rb-immersive` outweigh the plain-`body` padding rules above on specificity,
   so no !important is needed. */
body.rb-fs .app-tabbar, body.rb-immersive .app-tabbar { display: none; }
body.rb-fs, body.rb-immersive { padding-bottom: 0; }
/* immersive mode (Reader navigating): the tool has its OWN bottom action row (with an exit
   button), so it returns to the screen edge — no tab bar underneath to clear. */
body.rb-immersive .fabrow { bottom: 0; }

/* language switcher — collapsed flag-only trigger that opens a flag + name list */
.lang { position: relative; display: inline-flex; }
.lang-trigger { display: inline-flex; align-items: center; gap: .35rem; background: var(--card-2); border: 1px solid var(--line); border-radius: 9px; padding: .3rem .45rem; color: var(--text); cursor: pointer; }
.lang-trigger .lang-chev { color: var(--muted); font-size: .6rem; }
.lang-flag { display: inline-flex; }
.lang-flag svg { width: 20px; height: 14px; border-radius: 2px; display: block; box-shadow: 0 0 0 1px rgba(255, 255, 255, .14); }
.lang-menu { position: absolute; top: calc(100% + 6px); right: 0; z-index: 70; min-width: 152px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: .3rem; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: .1rem; }
.lang-opt { display: flex; align-items: center; gap: .55rem; background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; font-size: .85rem; text-align: left; padding: .4rem .5rem; border-radius: 7px; cursor: pointer; }
.lang-opt:hover { background: var(--card-2); }
.lang-opt.active { color: var(--sand); }
/* Fixed floating lang for mobile: appears above the tab bar when the footer is hidden.
   The dropdown opens upward so it fits below the top of the screen. */
.lang-mobile { display: none; position: fixed; right: .6rem; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + .6rem); z-index: 55; }
.lang-mobile .lang-menu { bottom: calc(100% + 6px); top: auto; right: 0; }
@media (max-width: 1024px) { .lang-mobile { display: inline-flex; } }
.native .lang-mobile { display: inline-flex; }

/* ---------- buttons ---------- */
.btn {
    display: inline-flex; align-items: center; gap: .5rem; cursor: pointer;
    font: inherit; font-weight: 700; border-radius: 12px; padding: .7rem 1.15rem; border: 1px solid transparent;
    transition: transform .08s ease, filter .15s ease, background .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: linear-gradient(180deg, var(--sand-2), var(--sand)); color: var(--on-sand); font-weight: 800; text-shadow: 0 1px 0 rgba(255, 255, 255, .25); }
.btn-primary:hover { filter: brightness(.9); transform: translateY(-1px); box-shadow: 0 3px 10px rgba(0, 0, 0, .4); text-decoration: none; }
.btn-ghost { background: rgba(255, 255, 255, .06); color: var(--text); border-color: var(--line); }
.btn-ghost:hover { background: rgba(255, 255, 255, .18); border-color: var(--sand); text-decoration: none; }

/* ---------- hero ---------- */
.hero { padding: 3.6rem 0 2.4rem; }
.hero h1 { font-size: clamp(2rem, 6vw, 3.4rem); line-height: 1.05; letter-spacing: -.02em; margin: .6rem 0 .8rem; }
.hero h1 .accent { color: var(--sand); }
.hero p.lead { font-size: clamp(1rem, 2.4vw, 1.2rem); color: var(--muted); max-width: 56ch; }

/* ---------- sections ---------- */
section.block { padding: 2.4rem 0; }
.section-head { margin-bottom: 1.4rem; }
.section-head h2 { font-size: clamp(1.4rem, 4vw, 2rem); letter-spacing: -.01em; margin: .2rem 0; }
.section-head .kicker { color: var(--sand); font-weight: 800; text-transform: uppercase; letter-spacing: .12em; font-size: .74rem; }
/* install / cross-platform band */
#install .section-head { text-align: center; }
#install .install-lead { max-width: 70ch; margin: .6rem auto 0; }
#install .install-grid { display: grid; gap: 1.5rem; align-items: center; }
@media (min-width: 1025px) { #install .install-grid { grid-template-columns: 1fr 2fr; } }
.wiki-cta a { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .3rem; background: linear-gradient(135deg, rgba(232,176,89,.12), rgba(232,176,89,.06)); border: 1px solid rgba(232,176,89,.3); border-radius: 16px; padding: 1.6rem 1.2rem; text-decoration: none; transition: border-color .15s ease, transform .12s ease; }
.wiki-cta a:hover { border-color: var(--sand); transform: translateY(-2px); }
.wiki-cta a i { font-size: 1.8rem; color: var(--sand); }
.wiki-cta a h3 { margin: .4rem 0 0; font-size: 1.1rem; font-weight: 800; color: var(--sand-2); }
.wiki-cta a p { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.5; max-width: 26ch; }
.wiki-cta .cta-link { font-weight: 700; font-size: .9rem; color: var(--sand); margin-top: .3rem; }
@media (max-width: 1024px) { .wiki-cta a { flex-direction: row; text-align: left; padding: 1rem 1.2rem; } .wiki-cta a p { max-width: none; } .wiki-cta a i { flex-shrink: 0; } }
/* cross-platform band: each platform sits in a soft pill */
.platforms { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; margin-top: 1.4rem; color: var(--text); font-weight: 700; }
.platforms span { display: inline-flex; align-items: center; gap: .5rem; background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .5rem 1rem; font-size: .92rem; }
.platforms i { color: var(--sand); }

/* features grid (home): 6 cards → 3 balanced columns (2 rows on desktop) */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.flow .step { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 1.5rem 1.3rem; text-align: center; position: relative; transition: border-color .15s ease, transform .12s ease; }
.flow .step:hover { border-color: rgba(232, 176, 89, .5); transform: translateY(-3px); }
.flow .step i, .workflow .wf-step i { color: var(--sand); font-size: 1.5rem; display: inline-flex; align-items: center; justify-content: center; width: 3.4rem; height: 3.4rem; border-radius: 16px; background: rgba(232, 176, 89, .12); border: 1px solid rgba(232, 176, 89, .22); }
.flow .step h4 { margin: .7rem 0 .3rem; font-size: 1.02rem; }
.flow .step p { margin: 0; font-size: .86rem; color: var(--muted); line-height: 1.5; }

/* header controls — Install is a pill CTA that reads apart from the plain tool links */
.install-btn { display: inline-flex; align-items: center; gap: .4rem; white-space: nowrap; cursor: pointer; font: inherit; background: rgba(232, 176, 89, .14); border: 1px solid rgba(232, 176, 89, .40); color: var(--sand-2); border-radius: 999px; padding: .42rem 1rem; font-weight: 700; box-shadow: var(--shadow); }
.install-btn:hover { background: rgba(232, 176, 89, .26); border-color: var(--sand); color: var(--sand-2); }

/* floating contextual chips (Install prompt · unsaved-work alert): fixed above the bottom tab bar
   on mobile, bottom-right on desktop — independent of the top bar, so they show on every layout */
.app-chip-stack { position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom)); z-index: 55; display: flex; flex-direction: column; align-items: flex-end; gap: .5rem; }
.app-chip-stack:empty { display: none; }
/* no floating chips during focused field use (Reader navigating / fullscreen) */
body.rb-immersive .app-chip-stack, body.rb-fs .app-chip-stack { display: none; }
.native .app-chip-stack { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + .7rem); }
@media (max-width: 1024px) { .app-chip-stack { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + .7rem); } }
.account-control { position: relative; order: 99; display: flex; }
.account-button span { max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.account-menu { position: absolute; top: calc(100% + 6px); right: 0; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .4rem; box-shadow: var(--shadow); min-width: 175px; z-index: 60; display: flex; flex-direction: column; gap: .15rem; }
.account-menu a, .account-menu button { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border-radius: 8px; background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: left; white-space: nowrap; /* the dropdown widens to its longest label — no two-line entries (#243) */ }
.account-menu a:hover, .account-menu button:hover { background: var(--card-2); text-decoration: none; }
.account-menu .menu-sep { border: 0; border-top: 1px solid var(--line); margin: .3rem .35rem; width: auto; }
/* Tab-bar profile dropup (mobile, #303 → #310): positioned above the fixed bottom tab bar. */
.tabbar-dropup { position: fixed; bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + 6px); right: max(.5rem, env(safe-area-inset-right)); background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .4rem; box-shadow: 0 -4px 20px rgba(0,0,0,.18); min-width: 185px; z-index: 61; display: flex; flex-direction: column; gap: .15rem; }
.tabbar-dropup a, .tabbar-dropup button { display: flex; align-items: center; gap: .55rem; padding: .55rem .7rem; border-radius: 8px; background: none; border: 0; color: var(--text); font: inherit; font-weight: 600; cursor: pointer; text-decoration: none; text-align: left; white-space: nowrap; }
.tabbar-dropup a:hover, .tabbar-dropup button:hover { background: var(--card-2); text-decoration: none; }
.tabbar-dropup .menu-sep { border: 0; border-top: 1px solid var(--line); margin: .3rem .35rem; width: auto; }
@media (min-width: 1025px) { .tabbar-dropup { display: none; } }
/* admin user-picker list (reassign a roadbook / restore-to-user from the trash) */
.mv-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: .25rem; margin: .5rem 0; }
.mv-opt { text-align: left; background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: .4rem .6rem; color: var(--text); font: inherit; cursor: pointer; }
.mv-opt:hover { border-color: var(--sand); }
/* "unsaved work" pill: sits in the bar (always visible, not behind the mobile menu) and only
   appears when another tool has in-progress work to resume or discard */
.pending-pill { display: inline-flex; align-items: center; gap: .4rem; background: var(--sand); color: var(--on-sand); border: 0; border-radius: 999px; padding: .42rem .85rem; font: inherit; font-weight: 800; font-size: .82rem; cursor: pointer; white-space: nowrap; box-shadow: var(--shadow); }
.pending-pill:hover { filter: brightness(.93); }
.pending-pill .pending-count { display: inline-flex; align-items: center; justify-content: center; min-width: 1.25em; height: 1.25em; padding: 0 .25em; border-radius: 999px; background: var(--on-sand); color: var(--sand); font-size: .82em; }
.pending-list { display: flex; flex-direction: column; gap: .5rem; }
.pending-list .roadbook-row > i { color: var(--sand); flex-shrink: 0; }
/* footer */
.foot { border-top: 1px solid var(--line); margin-top: 2rem; padding: 2rem 0; color: var(--muted); font-size: .9rem; }
.foot .wrap { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; }
.foot a { color: var(--sand-2); }
/* shared fullscreen mode (Tripmaster, Reader): hide the site chrome for a distraction-free view */
body.rb-fs header.topbar, body.rb-fs footer.foot { display: none; }
/* GPS tool pages (Reader · Recorder · Tripmaster): short landscape gives the dashboard the whole screen */
@media (orientation: landscape) and (max-height: 540px) { body.gps-tool header.topbar { display: none; } }

/* ---------- centred single-card screen (Reader load screen) ---------- */
.center-screen { min-height: 70vh; display: grid; place-items: center; text-align: center; padding: 2rem 1rem; }
.center-card { max-width: 480px; }
.center-card .big { font-size: 3rem; color: var(--sand); }
.center-card h1 { margin: .6rem 0 .3rem; }
/* tool-page title + its "How it works" link, side by side (centred in the idle card, left-aligned on the editor landing) */
/* One page-header pattern for every section: the title on the left, the "Info" link at the
   top-right of the same row. No big decorative icon, no centring — identical across sections. */
.tool-titlebar { display: flex; align-items: baseline; justify-content: space-between; gap: .6rem 1rem; margin: .4rem 0 .8rem; }
.tool-titlebar h1 { margin: 0; min-width: 0; }  /* let a long title wrap on its own line instead of pushing "Info" below it */
.tool-titlebar .tool-help { flex-shrink: 0; }   /* "Info" stays pinned at the top-right */

/* ---------- tool pages ---------- */
.tool-page { padding: 1.2rem 1.1rem 3rem; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; }
.panel h2 { margin: 0 0 .8rem; font-size: 1.05rem; }
.action-row { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: 1rem; }
/* small accent section heading (Editor panels, challenge page) */
.icon-category { color: var(--sand); font-weight: 800; font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; margin: .8rem 0 .3rem; }

/* ---------- dashboard readouts (Tripmaster / Reader) ---------- */
.dash { display: grid; gap: .8rem; padding-top: 1rem; }
.readout { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.1rem 1.2rem; text-align: center; }
.readout .field-label { color: var(--muted); font-size: .76rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 700; }
.readout .num { font-size: clamp(2.6rem, 13vw, 4.2rem); font-weight: 800; color: var(--sand); font-variant-numeric: tabular-nums; line-height: 1.02; }
.readout .unit { color: var(--muted); font-weight: 700; font-size: 1rem; }
.readout.primary .num { color: #fff; }
.row3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: .7rem; }
.mini { background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: .8rem .5rem; text-align: center; }
.mini .value { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; color: var(--text); }
.mini .key { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; margin-top: .2rem; }
.btnrow { display: flex; gap: .6rem; flex-wrap: wrap; justify-content: center; margin-top: .4rem; }
.gps-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; background: var(--muted); vertical-align: middle; }
.gps-dot.ok { background: var(--ok); } .gps-dot.bad { background: var(--track); }
/* live-position chevron on a heading-up map: a triangle pointing along the course */
.rb-pos-arrow { width: 0; height: 0; border-left: 9px solid transparent; border-right: 9px solid transparent; border-bottom: 18px solid var(--info); filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .6)); }
/* map control buttons carry FontAwesome glyphs, which would otherwise inherit the page's light
   text colour and vanish on MapLibre's white button face — pin them dark; active state below wins */
.maplibregl-ctrl-group button { color: #222; }
/* a map control button in its active state (e.g. heading-up engaged) */
.maplibregl-ctrl button.rb-ctrl-on { color: var(--sand); }
/* style label under the layer-toggle icon (satellite / topo / OSM) */
.rb-map-style-label { display: block; font-size: 9px; line-height: 1; margin-top: -1px; }
/* WP-type icon overlay marker (RBMap): a visual badge over a note's dot — never intercepts map interaction */
.rb-wp-badge { pointer-events: none; line-height: 0; }
/* per-tool feature pages (/features/<tool>/): hero recap + a grid of feature cards */
.feat-page { max-width: var(--maxw); margin: 0 auto; padding: 1.4rem 1.1rem 5rem; }
.feat-hero { text-align: center; padding: 1rem 0 1.4rem; }
.feat-hero .feat-ico { font-size: 2.6rem; color: var(--sand); }
.feat-hero h1 { font-size: clamp(1.8rem, 5vw, 2.6rem); margin: .5rem 0 .5rem; }
.feat-hero .lead { color: var(--muted); max-width: 60ch; margin: 0 auto 1.2rem; line-height: 1.6; }
.feat-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 1rem; margin-top: 1.2rem; }
.feat-item { display: flex; gap: .8rem; background: var(--card); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; }
.feat-item > i { color: var(--sand); font-size: 1.3rem; flex-shrink: 0; margin-top: .15rem; }
.feat-item h3 { margin: 0 0 .25rem; font-size: 1rem; }
.feat-item p { margin: 0; color: var(--muted); font-size: .9rem; line-height: 1.5; }
.feat-item b { color: var(--text); }
/* a titled sub-section on a feature page (e.g. the Editor's Tips & tricks) */
.feat-section { margin-top: 2.4rem; }
.feat-section h2 { font-size: 1.35rem; margin: 0; }
.feat-section h2 i { color: var(--sand); margin-right: .5rem; }
.feat-section .feat-list { margin-top: .9rem; }
/* prev/next nav across the tool feature pages */
/* prev/next links flank the page title at the same height (icon sits above, centred) */
.feat-titlerow { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 1rem; margin: .4rem 0 .2rem; }
.feat-titlerow h1 { margin: 0; }
.feat-titlerow .prev { justify-self: start; }
.feat-titlerow .next { justify-self: end; }
@media (max-width: 760px) {
    .feat-titlerow { grid-template-columns: 1fr; gap: .7rem; }
    .feat-titlerow h1 { order: -1; }   /* title first, then the two links below it */
    .feat-titlerow .prev, .feat-titlerow .next { justify-self: center; }
}
.feat-nav-link { display: inline-flex; align-items: center; gap: .5rem; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .55rem .9rem; color: var(--text); text-decoration: none; font-weight: 700; font-size: .9rem; transition: border-color .15s ease, transform .12s ease; }
.feat-nav-link:hover { border-color: var(--sand); transform: translateY(-1px); text-decoration: none; }
.feat-nav-link > i { color: var(--muted); }
.feat-nav-link .tool { display: inline-flex; align-items: center; gap: .4rem; }
.feat-nav-link .tool i { color: var(--sand); }
.feat-plat { text-align: center; color: var(--muted); margin-top: 1.6rem; font-size: .9rem; }
.feat-plat i { color: var(--sand); margin: 0 .15rem 0 .6rem; }
.feat-more { font-size: .82rem; font-weight: 700; margin-top: .4rem; display: inline-block; }
.feat-intro { color: var(--muted); line-height: 1.6; margin: .9rem 0 0; max-width: 70ch; }
/* format support matrix — a compact card-styled table (Editor features page) */
.feat-table-wrap { overflow-x: auto; margin-top: 1rem; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.feat-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.feat-table th, .feat-table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
.feat-table tr:last-child td { border-bottom: none; }
.feat-table th { color: var(--muted); font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; }
.feat-table th.mark, .feat-table td.mark { text-align: center; white-space: nowrap; }
.feat-table td code { color: var(--sand-2); white-space: nowrap; }
.fmt-yes { color: #2ec77a; }
.fmt-no { color: var(--muted); opacity: .5; }
/* toggle switch showing an ON/OFF state (e.g. the Reader's auto-advance control) — the
   knob position IS the state, so it never reads as "press to set to the shown value". */
.rb-switch { display: inline-flex; align-items: center; gap: .5rem; }
.rb-switch .rb-switch-track { position: relative; width: 32px; height: 18px; border-radius: 999px; background: var(--line); transition: background .15s ease; flex-shrink: 0; }
.rb-switch .rb-switch-knob { position: absolute; top: 2px; left: 2px; width: 14px; height: 14px; border-radius: 50%; background: var(--muted); transition: transform .15s ease, background .15s ease; }
.rb-switch.on .rb-switch-track { background: var(--sand); }
.rb-switch.on .rb-switch-knob { transform: translateX(14px); background: var(--on-sand); }
/* a feature card for an upcoming capability: dimmed, dashed, with a "Coming soon" pill */
.flow .step.soon { border-style: dashed; opacity: .85; }
.flow .step.soon:hover { transform: none; border-color: var(--line); }   /* not a live tool — no clickable lift */
.flow .step.soon i { color: var(--muted); background: rgba(255, 255, 255, .05); border-color: var(--line); }
.soon-badge { display: inline-block; vertical-align: middle; margin-left: .4rem; background: var(--card-2); border: 1px solid var(--line); color: var(--sand); border-radius: 999px; padding: .05rem .5rem; font-size: .62rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; }
/* one-time cookie / storage notice (#95) — honest essential-only notice, not a consent wall */
.cookie-notice { position: fixed; left: 0; right: 0; bottom: 0; z-index: 200; display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; justify-content: center; background: var(--card); border-top: 1px solid var(--line); box-shadow: 0 -6px 24px rgba(0, 0, 0, .35); padding: .8rem 1.1rem calc(.8rem + env(safe-area-inset-bottom)); }
/* on mobile it sits ABOVE the bottom tab bar (web-only banner; never covers the nav) */
@media (max-width: 1024px) { .cookie-notice { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: .8rem; } }
.cookie-notice .cookie-text { color: var(--muted); font-size: .86rem; max-width: 70ch; }
.cookie-notice .cookie-text a { color: var(--sand-2); }
.cookie-notice .cookie-ok { flex-shrink: 0; }

.fabrow { position: fixed; left: 0; right: 0; bottom: 0; z-index: 35; display: flex; gap: .6rem; padding: .7rem 1rem; padding-bottom: calc(.7rem + env(safe-area-inset-bottom)); background: rgba(14, 17, 22, .95); border-top: 1px solid var(--line); }
.fabrow .btn { flex: 1; justify-content: center; min-width: 0; white-space: nowrap; }
/* phones: the button row must never outgrow the viewport — tighter gaps, compact labels, and
   content-proportional widths so no button's content ever spills over its neighbour (#250) */
@media (max-width: 560px) {
    .fabrow { gap: .3rem; padding: .55rem .45rem calc(.55rem + env(safe-area-inset-bottom)); }
    .fabrow .btn { flex: 1 1 auto; min-width: 2.4rem; padding: .55rem .3rem; font-size: .8rem; gap: .3rem; }
}

/* ---------- gallery (home) + demo picker ---------- */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.gallery-card { position: relative; display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); color: inherit; text-decoration: none; transition: border-color .15s, transform .1s; }
.gallery-card:hover, .launch-tile:hover { border-color: var(--sand); transform: translateY(-2px); text-decoration: none; }
/* overlay button on a gallery card (copy-link + admin-force-private) */
.card-btn { position: absolute; top: .5rem; z-index: 2; width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; border: 0; border-radius: 9px; background: rgba(14, 17, 22, .7); color: #fff; font-size: .9rem; cursor: pointer; backdrop-filter: blur(4px); }
.card-copy { right: .5rem; }
.card-copy:hover { background: var(--sand); color: var(--on-sand); }
.card-unpub { left: .5rem; }
.card-unpub:hover { background: var(--track); color: #fff; }
.gallery-card .thumb { aspect-ratio: 16/10; width: 100%; object-fit: cover; background: var(--card-2); display: block; }
.gallery-card .thumb-placeholder { display: flex; align-items: center; justify-content: center; font-size: 2.6rem; color: var(--muted); }
.challenge-row-placeholder { width: 84px; height: 54px; border-radius: 8px; flex: 0 0 auto; background: var(--card); display: flex; align-items: center; justify-content: center; color: var(--muted); font-size: 1.3rem; }

/* White "paper" roadbook note row — shared by the Reader and the public challenge page
   (distance | vignette | comments | buttons). Read-only views add .readonly to drop the
   buttons column; the colour-coded state classes are set by the Reader only. */
.nrow { display: grid; grid-template-columns: 96px clamp(124px, 26vw, 178px) 1fr 56px; border-bottom: 1px solid #c9c9c9; min-height: 132px; background: #fff; color: #14110b; }
.nrow.readonly { grid-template-columns: 96px clamp(124px, 26vw, 178px) 1fr; }
.nrow > div { padding: .45rem .5rem; border-right: 1px solid #d7d7d7; min-width: 0; }
.nrow.readonly .col-text { border-right: 0; }
.nrow .col-distance { display: flex; flex-direction: column; gap: .1rem; }
.nrow .col-distance .total { font-size: 1.65rem; font-weight: 800; font-variant-numeric: tabular-nums; line-height: 1; }
.nrow .col-distance .partial { font-size: .8rem; color: #555; font-variant-numeric: tabular-nums; }
.nrow .col-distance .num { margin-top: auto; align-self: flex-start; background: #14110b; color: #fff; border-radius: 6px; padding: 0 .5rem; font-weight: 800; }
.nrow .col-distance.close { background: #bfe3ff; } /* light blue: < 50 m to the next note */
.nrow .col-vignette { display: flex; align-items: center; justify-content: center; padding: .15rem; }
.nrow .col-vignette svg { width: 100%; height: 100%; max-height: 130px; }
/* phones: give the tulip more room (it's the thing you read while driving) */
@media (max-width: 600px) {
    .nrow { grid-template-columns: 64px minmax(150px, 44vw) 1fr 44px; }
    .nrow.readonly { grid-template-columns: 64px minmax(150px, 44vw) 1fr; }
    .nrow .col-vignette svg { max-height: 170px; }
}
.nrow .col-text { display: flex; flex-direction: column; font-size: .92rem; }
.nrow .col-text .text { flex: 1; word-break: break-word; }
.nrow .col-text .note-cap { color: #c0392b; font-weight: 800; margin-top: .2rem; }
.nrow .col-text .note-speed { margin-top: .25rem; }
.nrow .col-text .note-speed .lim { display: inline-flex; align-items: center; justify-content: center; min-width: 1.9rem; height: 1.9rem; padding: 0 .25rem; border: 3px solid #c0392b; border-radius: 50%; font-weight: 800; font-size: .8rem; font-variant-numeric: tabular-nums; }
.nrow .col-text .note-speed .lim.lifted { border-color: #777; color: #777; }
.nrow .col-text .coords { color: #666; font-size: .68rem; font-variant-numeric: tabular-nums; margin-top: .2rem; }
.nrow .col-buttons { display: flex; flex-direction: column; gap: .35rem; align-items: center; justify-content: center; border-right: 0; }
.nrow .col-buttons .note-button { width: 42px; height: 42px; border-radius: 10px; border: 1px solid #bbb; background: #efefef; color: #333; cursor: pointer; font-size: 1rem; }
.nrow .col-buttons .note-button.reach { background: #2ecc71; color: #fff; border-color: #27ae60; }
.nrow.done { background: #d6f5e0; }     /* light green: reached */
.nrow.skipped { background: #ffe1ec; }  /* pink: passed over without being reached */
.nrow.active { box-shadow: inset 0 0 0 3px #ff2a2a; }            /* red border: target */
/* FIA danger marks (! !! !!!) inside any vignette render — editor canvas, Reader and challenge rows */
.vignette-danger { fill: #e01414; font: 900 38px/1 system-ui, -apple-system, sans-serif; letter-spacing: 2px; }
.gallery-card .gallery-body { padding: .9rem 1rem; }
.gallery-card h3 { margin: 0 0 .2rem; font-size: 1.05rem; }
.gallery-card .gallery-meta { color: var(--muted); font-size: .82rem; }
.gallery-empty { color: var(--muted); }
.challenge-row { display: flex; gap: .8rem; align-items: center; width: 100%; text-align: left; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: .6rem; margin-bottom: .5rem; cursor: pointer; color: var(--text); }
.challenge-row:hover { border-color: var(--sand); }
.challenge-row img { width: 84px; height: 54px; object-fit: cover; border-radius: 8px; flex: 0 0 auto; background: var(--card); }
.challenge-row span { display: flex; flex-direction: column; min-width: 0; }
.challenge-row b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.challenge-row small { color: var(--muted); }

/* ---------- modals + toast (Reader/Editor/Ranking/Challenges) ---------- */
.modal { position: fixed; inset: 0; z-index: 60; display: grid; place-items: center; padding: 1rem; background: rgba(8, 9, 14, .72); backdrop-filter: blur(5px); }
.modal-card { width: 100%; max-width: 420px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 1.3rem; box-shadow: var(--shadow); }
.modal-card h2 { margin: 0 0 .3rem; font-size: 1.15rem; }
.toast { position: fixed; left: 50%; bottom: 90px; transform: translateX(-50%); z-index: 70; background: #242a36; color: #fff; padding: .7rem 1rem; border-radius: 12px; max-width: 90%; box-shadow: var(--shadow); font-size: .9rem; text-align: center; }
.mode-grid { display: grid; gap: .7rem; margin-top: .8rem; }
.mode-btn { display: flex; flex-direction: column; gap: .15rem; align-items: flex-start; text-align: left; background: var(--card-2); border: 1px solid var(--line); border-radius: 14px; padding: 1rem 1.1rem; color: var(--text); cursor: pointer; transition: border-color .15s; }
.mode-btn:hover { border-color: var(--sand); }
.mode-btn i { color: var(--sand); font-size: 1.5rem; margin-bottom: .2rem; }
.mode-btn b { font-size: 1.05rem; }
.mode-btn small { color: var(--muted); }

/* brand + two-column hero + mockup */
.brand-logo { width: 30px; height: 30px; object-fit: contain; vertical-align: middle; }
.hero-grid { display: grid; grid-template-columns: 1.05fr .95fr; gap: 2.5rem; align-items: center; }
.hero-copy { text-align: left; }
.hero-mock { width: 100%; max-width: 276px; height: auto; border-radius: 28px; box-shadow: 0 30px 70px rgba(0, 0, 0, .55); justify-self: end; }
/* full-width "how it works" strip: one centred row of 4 icon-chip steps + arrows on
   desktop/tablet, a clean 2×2 grid on phones (arrows dropped once it wraps) */
.workflow { display: flex; flex-wrap: wrap; align-items: flex-start; justify-content: center; gap: 1rem 1.6rem; margin-top: 2.6rem; }
.workflow .wf-step { display: flex; flex-direction: column; align-items: center; gap: .55rem; text-align: center; width: 8.5rem; }
.workflow .wf-step i { transition: background .12s ease, border-color .12s ease; }
.workflow .wf-step span { font-size: .86rem; font-weight: 700; }
/* workflow steps link to their feature page — subtle lift + chip highlight on hover */
.workflow a.wf-step { color: inherit; text-decoration: none; transition: transform .12s ease; }
.workflow a.wf-step:hover { transform: translateY(-3px); }
.workflow a.wf-step:hover i { background: rgba(232, 176, 89, .22); border-color: var(--sand); }
.workflow a.wf-step:hover span { color: var(--sand); }
.workflow .wf-arrow { height: 3.4rem; display: inline-flex; align-items: center; }
.workflow .wf-arrow svg { display: block; }
@media (max-width: 860px) {
    .hero-grid { grid-template-columns: 1fr; text-align: center; }
    .hero-copy { text-align: center; }
    .hero-copy p.lead { margin-left: auto; margin-right: auto; }
    .hero-mock { max-width: 204px; margin: .4rem auto 0; justify-self: center; }
}
@media (max-width: 560px) {
    .workflow { gap: 1.8rem 2.4rem; }
    .workflow .wf-arrow { display: none; }   /* clean 2×2 icon grid on phones — no stray arrows */
}
.foot-links { display: flex; flex-wrap: wrap; gap: .4rem 1.1rem; align-items: center; }
.foot-links a { color: var(--sand-2); }
#appVersion { opacity: .6; }

/* utils */
.mt-2 { margin-top: 1.4rem; }

/* ---------- home: marketing landing on the web, launcher in the native app ---------- */
/* The same index.html serves both; the Capacitor shell adds `.native` (set before paint),
   which swaps the marketing sections for the field-tool launcher. No second page, no redirect. */
.app-only { display: none; }
.native .app-only { display: block; }
.native .web-only { display: none; }
/* the marketing footer (About / standard / privacy / social…) is web-only — hide it in the app,
   where every page is a field tool and the tall footer just overflowed the viewport (#198) */
.native .foot { display: none; }
/* mobile web/PWA is app-like: the marketing footer would be an irrelevant zone on a field tool,
   so hide it below the tab-bar breakpoint too. The About/Privacy/Terms links live on the Profile
   page there (the account page's footer links), so they stay reachable. */
@media (max-width: 1024px) { .foot { display: none; } }
/* app version readout on the home launcher (installed build + latest live), #198 */
.app-ver { text-align: center; margin: 0; font-variant-numeric: tabular-nums; }

/* App-only footer: version bar pinned to the bottom of the home screen, with safe-area spacing
   so it never sits under the iOS home indicator. Subtle top line to separate it from the gallery. */
.app-foot { margin-top: 1rem; padding: .9rem 0; border-top: 1px solid var(--line); background: var(--bg); }
.native .app-foot { padding-bottom: calc(.9rem + env(safe-area-inset-bottom)); }
/* native (viewport-fit=cover): the app has no top bar, so the sticky tool bars (Reader/Tripmaster)
   pin just below the iOS status bar / notch. */
/* the sticky tool bars (Reader odometer · Tripmaster status) pin to the top by default — correct
   wherever there is no top bar (native + every mobile-width view). Only desktop web, which keeps
   the 56px top bar, offsets them below it. */
/* only desktop web WITH the top bar showing (not fullscreen) offsets the tool bars below it */
@media (min-width: 1025px) { html:not(.native) body:not(.rb-fs) .odometer-bar, html:not(.native) body:not(.rb-fs) .status-bar { top: 56px; } }
.launcher { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: .9rem; }
.launch-tile { display: flex; flex-direction: column; align-items: center; text-align: center; gap: .25rem; padding: 1.7rem 1rem; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); transition: border-color .15s, transform .1s; }
.launch-tile i { color: var(--sand); font-size: 2rem; }
.launch-tile .launch-name { font-weight: 800; font-size: 1.12rem; margin-top: .3rem; }
.launch-tile .launch-sub { color: var(--muted); font-size: .82rem; }

/* App home header: logo + title above the launcher grid */
.app-head { display: flex; align-items: center; justify-content: center; gap: .6rem; margin-bottom: 1.4rem; }
.app-logo { width: 40px; height: 40px; }
.app-title { font-size: 1.5rem; font-weight: 900; color: var(--sand); letter-spacing: .04em; margin: 0; }
@media (max-width: 860px) {
    .flow { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
    .flow { grid-template-columns: 1fr; }
}

.btn-danger { background: rgba(255,90,69,.14); color: var(--track); border: 1px solid rgba(255,90,69,.32); }
.btn-danger:hover { background: rgba(255,90,69,.24); text-decoration: none; }
/* accent-tinted action: stands out from ghost buttons without being a full primary CTA */
.btn-accent { background: rgba(232,176,89,.16); color: var(--sand-2); border: 1px solid rgba(232,176,89,.40); }
.btn-accent:hover { background: rgba(232,176,89,.26); border-color: var(--sand); text-decoration: none; }
/* canonical text input/select (page forms: editor, account, …) */
.field { width: 100%; background: var(--card-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: .7rem .8rem; font-size: 1rem; }
/* stacked form label above a .field, and small helper text below it */
.field-label { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin: .6rem 0 .2rem; }
.hint { font-size: .82rem; color: var(--muted); margin: .3rem 0 .2rem; }
/* form fields inside modals (shared by every RBModal dialog) */
.modal-in { width: 100%; background: var(--card-2); border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: .6rem; font: inherit; margin: .3rem 0 .6rem; }
select.modal-in { width: auto; margin: 0; padding: .4rem; border-radius: 8px; }
.field:focus-visible, .modal-in:focus-visible, .rb-status:focus-visible { outline: 2px solid var(--sand); border-color: transparent; }
/* locale-aware date field (RBDateField): the localized date shows in a .field box while a
   transparent native <input type="date"> overlays it for the picker + keyboard + ISO value */
.rb-datefield { position: relative; display: block; }
.rb-date-display { margin: 0; cursor: pointer; white-space: nowrap; }
.rb-date-display.rb-date-empty { color: var(--muted); }
.rb-datefield-native { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; }
.rb-datefield:focus-within .rb-date-display { border-color: var(--sand); outline: 2px solid var(--sand); outline-offset: 1px; }
/* Record-GPX dialog: the interval field sits inline with its label and stays narrow. */
.gx-rate-row { display: flex; align-items: center; gap: .6rem; margin: .3rem 0 .6rem; }
.gx-rate-row label { margin: 0; }
.gx-rate-in { width: 5rem; margin: 0; }
/* segmented two-state toggle (Reader advancement · Editor visibility); .fill stretches to full width */
.segmented { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.segmented.fill { display: flex; }
.segment { background: var(--card-2); color: var(--muted); border: 0; padding: .55rem .8rem; font: inherit; font-weight: 600; cursor: pointer; }
.segmented.fill .segment { flex: 1; text-align: center; }
.segment.on { background: var(--sand); color: var(--on-sand); }
/* modal-card size/align modifiers (passed to RBModal) */
.modal-card.slim { max-width: 340px; }
.modal-card.narrow { max-width: 360px; }
.modal-card.wide { max-width: 520px; max-height: 80vh; overflow: auto; }
.modal-card.scroll { max-height: 85vh; overflow: auto; } /* keep a tall card within the viewport (composes with any width) */
.modal-card.center { text-align: center; }
/* top-align on phones: a dialog with an autofocused input would otherwise be centred and the
   on-screen keyboard covers it (e.g. the Record-GPX settings). align-self overrides the grid centring. */
@media (max-width: 760px) { .modal-card.top { align-self: start; } }
.modal-card h3 { margin: 0 0 .4rem; font-size: 1.05rem; }
.modal-text { margin: .2rem 0 1.1rem; font-size: 1.05rem; }
/* shared helpers */
.icon-accent { color: var(--sand); }
.icon-ok { color: var(--ok); }
.btnrow.end { justify-content: flex-end; }
.btnrow.center { justify-content: center; }
.btnrow.between { justify-content: space-between; }
.btnrow.spaced { margin-top: 1rem; }
.btnrow.wrap { flex-wrap: wrap; }
.btn-group { display: flex; gap: .5rem; }
/* stacked variant (e.g. an action list in a modal): full-width, left-aligned buttons */
.btn-group.col { flex-direction: column; align-items: stretch; }
.btn-group.col .btn { justify-content: flex-start; }
.checkbox-row { display: flex; align-items: center; gap: .5rem; font-size: .9rem; cursor: pointer; }
.checkbox-row input { width: 18px; height: 18px; accent-color: var(--sand); }
/* Social sign-in (account page): an "or" divider + the centred provider buttons — Google and Apple
   share every style, since both are OUR dark button carrying the provider's mark. */
.or-sep { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: .82rem; margin: 1.1rem 0 .9rem; }
.or-sep::before, .or-sep::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.social-signin { display: flex; flex-direction: column; align-items: center; gap: .8rem; }
.social-signin > .or-sep { align-self: stretch; }         /* full-width rule inside the centred column */
/* On the web, Google's real button is rendered invisibly ON TOP of ours (.social-overlay) so the
   click triggers the official flow without the white-box GIS look; every other button (Apple on the
   web, both in the app) is a plain button that calls the provider's flow directly. */
.social-overlay-wrap { position: relative; width: 280px; }
.social-btn { width: 280px; height: 46px; gap: .6rem; font-weight: 700; }
.social-overlay-wrap .social-btn { pointer-events: none; }  /* clicks pass through to the invisible GIS button */
.social-overlay-wrap .social-overlay { position: absolute; inset: 0; opacity: 0; }
.social-overlay-wrap .social-overlay > div, .social-overlay-wrap .social-overlay iframe { width: 100% !important; height: 100% !important; }
.social-mark { width: 18px; height: 18px; font-size: 18px; line-height: 1; flex-shrink: 0; }
.social-loading { display: inline-flex; align-items: center; justify-content: center; gap: .6rem; width: 280px; height: 46px; color: var(--muted); font-weight: 600; }
.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); border-top-color: var(--sand); animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.social-hint { max-width: 280px; text-align: center; margin: 0; }
/* the post-consent confirmation panel: detected email + (new accounts) Terms + a clear CTA */
.social-confirm { display: flex; flex-direction: column; align-items: stretch; gap: .7rem; width: 280px; }
.social-confirm-as { margin: 0; text-align: center; color: var(--muted); font-size: .92rem; }
.social-confirm-as b { color: var(--text); }
.social-confirm-terms { justify-content: center; font-size: .88rem; }
.social-confirm .btn { width: 100%; justify-content: center; margin: 0; }
.social-confirm-other { background: none; border: 0; color: var(--sand-2); font: inherit; font-size: .88rem; cursor: pointer; padding: .2rem; }
.social-confirm-other:hover { text-decoration: underline; }
.field-grid { display: grid; grid-template-columns: 1fr auto; gap: .4rem .6rem; align-items: center; margin-top: .3rem; }
/* an airy list inside a modal — install steps, consistency findings… */
.modal-list { line-height: 1.9; padding-left: 1.2rem; margin: .4rem 0; }
.grow { flex: 1; }
.clickable { cursor: pointer; }
.icon-danger { color: var(--track); }
/* Inline field help: a small ⓘ after a label; its explanation shows on hover and on tap/focus
   (touch-friendly). The bubble text lives in data-tip. Reusable on any field, anywhere. */
.help-tip { position: relative; display: inline-flex; align-items: center; justify-content: center; margin-left: .25rem; padding: 0; border: 0; background: none; color: var(--muted); cursor: help; font-size: .8rem; line-height: 1; vertical-align: middle; }
.help-tip:hover, .help-tip:focus-visible { color: var(--sand); outline: none; }
.help-tip::after { content: attr(data-tip); position: absolute; top: calc(100% + 7px); left: 50%; transform: translateX(-50%); width: max-content; max-width: 210px; white-space: normal; text-align: left; text-transform: none; letter-spacing: normal; font-weight: 500; background: #0a0d12; border: 1px solid var(--line); color: var(--text); font-size: .74rem; line-height: 1.35; padding: .4rem .55rem; border-radius: 8px; box-shadow: var(--shadow); opacity: 0; visibility: hidden; transition: opacity .12s; pointer-events: none; z-index: 40; }
.help-tip:hover::after, .help-tip:focus::after { opacity: 1; visibility: visible; }
/* saved-roadbook list (shared by My roadbooks + the Editor landing, via RBRoadbookList) */
.rb-grid { display: flex; flex-direction: column; gap: .6rem; }
.roadbook-row { display: flex; flex-wrap: wrap; align-items: center; gap: .5rem; background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; }
@media (max-width: 640px) { .roadbook-row .meta { min-width: 100%; } }
.roadbook-row .meta { flex: 1; min-width: 0; }
.roadbook-row .meta b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.roadbook-row .meta small { color: var(--muted); white-space: nowrap; }
.roadbook-row .btn { flex-shrink: 0; padding: .5rem .6rem; margin: 0; }
/* public badge — green globe; the admin moderation control in the public roadbooks list */
.rb-badge { flex-shrink: 0; display: inline-flex; align-items: center; gap: .3rem; font-size: .72rem; font-weight: 700; padding: .25rem .55rem; border-radius: 999px; border: 1px solid var(--line); }
.rb-badge.public { color: var(--ok); border-color: var(--ok); }
/* the admin badge doubles as the click-to-unpublish control */
button.rb-badge { background: none; font: inherit; cursor: pointer; transition: background .12s, color .12s; }
button.rb-badge:hover { background: var(--card); }
/* My-roadbooks publication status: a compact draft → ready → public pill-select. Colour
   tracks the state: draft muted, ready neutral, public green (matching the .rb-badge pill). */
.rb-status { flex-shrink: 0; font: inherit; font-size: .72rem; font-weight: 700; padding: .25rem 1.5rem .25rem .6rem; border-radius: 999px; border: 1px solid var(--line); background-color: var(--card-2); color: var(--muted); cursor: pointer; -webkit-appearance: none; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath fill='%2393a0b4' d='M3 4.5 6 7.5 9 4.5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right .5rem center; background-size: .7rem; }
.rb-status-ready { color: var(--text); border-color: var(--muted); }
.rb-status-public { color: var(--ok); border-color: var(--ok); }
.rb-status option { color: var(--text); background: var(--card-2); }
/* shared search / filter toolbar (card style) */
.rb-toolbar, .toolbar { display: flex; align-items: center; gap: .5rem; }
.rb-toolbar { background: var(--card-2); border: 1px solid var(--line); border-radius: 12px; padding: .35rem .8rem; margin-bottom: .6rem; color: var(--muted); }
.rb-toolbar .rb-search { flex: 1; min-width: 0; margin: 0; border: 0; background: none; padding: .35rem 0; }
.rb-usage { display: flex; align-items: center; gap: .4rem; margin-bottom: .6rem; } /* My-roadbooks storage indicator */
/* Admin activity-inspection timeline (#86) */
.act-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.act-table td { padding: .25rem .45rem; border-top: 1px solid var(--line); vertical-align: top; white-space: nowrap; }
/* Admin site-settings page (#103) + the site-wide announcement banner */
.cfg-card { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 1rem 1.2rem; margin-bottom: 1rem; }
.log-pre { max-height: 320px; overflow: auto; background: var(--card-2); border: 1px solid var(--line); border-radius: 8px; padding: .6rem; font-family: ui-monospace, monospace; font-size: .78rem; white-space: pre-wrap; }
.site-banner { display: flex; align-items: center; gap: .6rem; padding: .5rem 1rem; font-size: .9rem; }
.site-banner span { flex: 1; }
.site-banner-info { background: var(--card-2); border-bottom: 1px solid var(--line); }
.site-banner-warning { background: #4a3b12; border-bottom: 1px solid #8a6d1a; color: #ffe9a8; }
.site-banner-x { background: none; border: 0; color: inherit; cursor: pointer; opacity: .7; padding: .2rem; }
.site-banner-x:hover { opacity: 1; }
/* the one chevron pager, everywhere a list pages (public listings, admin, saved roadbooks) */
.pager { display: flex; align-items: center; justify-content: center; gap: .9rem; margin-top: .8rem; }
.pager .btn { margin: 0; width: auto; }
.link-delete { background: none; border: 0; color: var(--track); cursor: pointer; }
.map-placeholder { padding: 1rem; color: var(--muted); }
/* Admin console pages: one shared content column */
.admin-wrap { max-width: 1000px; margin: 1.2rem auto; }
/* Document pages (Terms · Privacy · the .rdbk standard, which widens it) */
.doc { max-width: 820px; margin: 0 auto; padding: 1.5rem 1.2rem 5rem; }
.doc h2 { margin: 2.2rem 0 .5rem; font-size: 1.35rem; }
.doc p, .doc li { color: #c7ccd6; line-height: 1.65; }
.doc ul { padding-left: 1.2rem; }
.doc li { margin: .3rem 0; }
.doc a { color: var(--sand-2); }
.doc .updated { color: var(--muted); font-size: .9rem; }
/* Public listing pages (Roadbooks · Events): heading + boxed search toolbar */
.rbp-head { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem; }
.rbp-head h1 { margin: 0; font-size: 1.8rem; }
/* Admin event pages: one label/value/actions line */
.ev-line { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; padding: .25rem 0; }
.ev-line .meta { flex: 1; min-width: 10rem; }
.ch-ev-bar, .odo-ev-bar { padding: .4rem .6rem; background: var(--card-2); border-radius: 8px; margin-bottom: .5rem; }
.ev-back { color: var(--sand); text-decoration: none; font-weight: 600; font-size: .92rem; display: inline-flex; align-items: center; gap: .4rem; }
.ev-back:hover { text-decoration: underline; }
.ev-back i { font-size: .8rem; }
/* wide tables scroll inside their own container, never the page */
.table-scroll { overflow-x: auto; }
/* inline status message beside a form/action */
.msg.ok { color: var(--ok); }
.msg.err { color: var(--track); }
/* full-width photo preview inside a modal (Editor · Recorder) */
.photo-preview { width: 100%; max-height: 48vh; object-fit: cover; border-radius: 12px; }
/* recording pulse (mic / capture buttons) */
@keyframes recpulse { 0%, 100% { opacity: 1; } 50% { opacity: .2; } }
/* direction arrow driven by --cap-rotation (Reader bearing/CAP · Tripmaster needle) */
.cap-arrow { transform: rotate(var(--cap-rotation, 0deg)); transition: transform .35s ease; }

/* ---------- shared GPS status bar (RBStatusBar): clock · battery · satellite/GPS ---------- */
/* shared status row (Recorder + Tripmaster): clock · battery · GPS, capped to the tools' column width */
.status-bar { position: sticky; top: env(safe-area-inset-top); z-index: 30; max-width: 560px; margin-inline: auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: var(--line); border-bottom: 1px solid var(--line); }
.status-bar .status-cell { display: flex; align-items: center; justify-content: center; gap: .3rem; min-width: 0; background: var(--bg); padding: .85rem .2rem; font-size: clamp(1.15rem, 5.5vw, 1.6rem); font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.status-bar .status-cell i { font-size: clamp(.95rem, 4vw, 1.25rem); color: var(--muted); }
.status-bar .status-cell.ok i, .status-bar .status-cell.ok span { color: var(--ok); }
.status-bar .status-cell.mid i, .status-bar .status-cell.mid span { color: #ff9f1c; }
.status-bar .status-cell.bad i, .status-bar .status-cell.bad span { color: var(--track); }

/* ---------- voice-note transcription (#133) ---------- */
/* the "➜ text" button beside a note's audio player */
.audio-totext { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex-shrink: 0; border: 1px solid var(--line); background: var(--card-2); color: var(--muted); border-radius: 8px; cursor: pointer; }
.audio-totext:hover { color: var(--sand); border-color: var(--sand); }
.audio-totext:disabled { opacity: .6; cursor: default; }
/* one-time model-download progress (also reusable elsewhere) */
.progress { height: 8px; background: var(--card-2); border: 1px solid var(--line); border-radius: 999px; overflow: hidden; margin: .5rem 0 .3rem; }
.progress-bar { height: 100%; width: var(--progress, 0%); background: var(--sand); transition: width .2s ease; }
/* ---------- in-context UI translation editor (#118, admin-only) ---------- */
.btn-sm { padding: .4rem .7rem; font-size: .85rem; border-radius: 9px; }
/* the admin toggle: a small floating chip; the edit bar appears when it's active */
.i18ne-toggle { position: fixed; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 130; width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); cursor: pointer; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
.i18ne-toggle.active { color: var(--on-sand); background: var(--sand); border-color: var(--sand); }
.i18ne-toggle.has-pending::after { content: ""; position: absolute; top: 2px; right: 2px; width: 9px; height: 9px; border-radius: 50%; background: var(--track); border: 2px solid var(--card); }
.i18ne-bar { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 130; display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; justify-content: center; max-width: calc(100vw - 24px); background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: .4rem .7rem; box-shadow: var(--shadow); }
.i18ne-badge { display: inline-flex; align-items: center; gap: .35rem; color: var(--sand); font-weight: 700; font-size: .85rem; }
.i18ne-hint { color: var(--muted); font-size: .78rem; }
/* outline every translatable label while edit mode is on, so what's editable is obvious */
.i18ne-on [data-i18n], .i18ne-on [data-i18n-html], .i18ne-on [data-i18n-ph], .i18ne-on [data-i18n-title], .i18ne-on [data-i18n-aria], .i18ne-on [data-i18n-tip] { outline: 1px dashed var(--sand-2); outline-offset: 2px; }
.i18ne-list { max-height: 60vh; overflow-y: auto; margin: .2rem 0 .8rem; }
.i18ne-key { border: 1px solid var(--line); border-radius: 10px; padding: .5rem .7rem; margin-bottom: .6rem; }
.i18ne-kname { font-family: ui-monospace, monospace; font-size: .78rem; color: var(--muted); margin-bottom: .35rem; word-break: break-all; }
.i18ne-row { display: flex; align-items: center; gap: .5rem; margin: .25rem 0; }
.i18ne-lang { width: 1.7rem; text-transform: uppercase; font-size: .72rem; color: var(--muted); flex-shrink: 0; }
.i18ne-krow { margin-top: .3rem; }
.i18ne-export { width: 100%; min-height: 220px; font-family: ui-monospace, monospace; font-size: .8rem; white-space: pre; }
/* ---------- admin roadbook trash (#187) ---------- */
.trash-rows { display: flex; flex-direction: column; gap: .6rem; margin-top: .8rem; }
.trash-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: .7rem .9rem; }
.trash-meta { min-width: 0; }
.trash-title { font-weight: 700; }
.trash-left { color: var(--sand); }
