:root {
    --cyber-black: #000000;
    --cyber-dark: #0a0a0a;
    --cyber-green: #00ff41;
    --cyber-cyan: #00e5ff;
    --cyber-magenta: #ff00ff;
    --cyber-yellow: #ffd700;
    --cyber-orange: #ff6600;
    --cyber-red: #ff0040;
    --cyber-blue: #4169e1;
    --cyber-purple: #9945ff;
    --cyber-pink: #ff69b4;
    --cyber-dim: #1a1a1a;
    --cyber-muted: #333333;
    --cyber-text: #e0e0e0;
    /* sticky thead / general chrome — remeasured every page */
    --chrome-h: 112px;
    /* map top ONLY. Updated only while .map-pane is mounted (listing
       chrome with pills). Never inherits short state/token chrome —
       that was the "map falls from the top" after /state or /token. */
    --map-chrome-h: 112px;
}

/* SEO breadcrumbs (prerender / noscript surface) */
.crumbs {
    font-size: 12px;
    color: #666;
    margin: 0 0 12px;
    letter-spacing: 0.02em;
}
.crumbs a {
    color: var(--cyber-cyan);
    text-decoration: none;
}
.crumbs a:hover {
    text-decoration: underline;
}
.crumbs .sep {
    opacity: 0.4;
    margin: 0 4px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* scrollbar track always present — filtering to a short list must not
       widen the viewport and shift the layout */
    overflow-y: scroll;
    scrollbar-gutter: stable;
}

body {
    overflow-x: clip; /* clip, not hidden: hidden creates a scrollport and kills sticky */
    font-family: "Play", sans-serif;
    background: var(--cyber-black);
    color: var(--cyber-text);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

/* Scrollbar */
::-webkit-scrollbar {
    width: 6px;
}
::-webkit-scrollbar-track {
    background: var(--cyber-black);
}
::-webkit-scrollbar-thumb {
    background: var(--cyber-muted);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--cyber-green);
}

/* Header */
.header-row1 {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 6px;
}

.logo-zone {
    flex: 1 1 0;
    min-width: 0;
}

.logo {
    font-size: clamp(24px, 4vw, 42px);
    font-weight: 700;
    margin: 0;
    line-height: 1.1;
    white-space: nowrap;
}

.by-label {
    align-self: center;
    font-size: 11px;
    letter-spacing: 2px;
    color: #555;
    margin-right: 8px;
}

/* current landing: "in europe · by freedom" */
.logo-suffix {
    min-height: 14px;
    line-height: 14px;
    font-size: 11px;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: rgba(0, 255, 65, 0.55);
    margin-top: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.search-input {
    flex: 0 1 370px;
    min-width: 180px;
    padding: 10px 16px;
    background: #050505;
    border: 1px solid #222;
    border-radius: 2px;
    color: var(--cyber-green);
    font-family: "Play", sans-serif;
    font-size: 13px;
    outline: none;
}

.map-zone {
    flex: 1 1 0;
    min-width: 0;
    display: flex;
    justify-content: flex-end;
}

.map-zone {
    gap: 8px;
}

/* Site nav — four constant buttons, current page renders as outline */
.nav-btn {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #000;
    text-decoration: none;
    background: var(--btn-c);
    border: 1px solid var(--btn-c);
    padding: 8px 14px;
    border-radius: 2px;
    box-shadow: 0 0 14px color-mix(in srgb, var(--btn-c) 35%, transparent);
    transition: all 0.15s;
    white-space: nowrap;
}

.nav-states {
    --btn-c: var(--cyber-green);
}
.nav-tokens {
    --btn-c: var(--cyber-yellow);
}
.nav-totals {
    --btn-c: var(--cyber-orange);
}
.nav-method {
    --btn-c: var(--cyber-cyan);
}

.nav-btn.nav-here {
    background: transparent;
    color: var(--btn-c);
    box-shadow: none;
}

.header-row2 {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.region-pills {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    align-items: center;
}

.state-count {
    color: #444;
    font-size: 13px;
    margin: 0;
    white-space: nowrap;
}

/* Mobile: compact chrome — it serves the table, not itself.
   Control box metrics live in the LATE @media block at the end of this
   file so they win over base .nav-btn / .region-pill / .num-btn rules. */
@media (max-width: 640px) {
    /* the table earns edge-to-edge; the header earns its margins */
    .header-row1,
    .header-row2 {
        padding-left: 10px;
        padding-right: 10px;
    }
    /* [brand | by + rank centered | doctrine/num] */
    .header-row1 {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
        align-items: center;
        gap: 8px;
        margin-bottom: 10px;
        flex-wrap: nowrap;
    }
    .logo-zone {
        flex: none;
        justify-self: start;
        min-width: 0;
        grid-column: 1;
        display: flex;
        align-items: center;
    }
    /* brand: flex row so the big flag doesn't drop the wordmark below the bar */
    .logo,
    .brand-chooser .logo {
        display: inline-flex;
        align-items: center;
        gap: 0;
        font-size: 18px;
        letter-spacing: normal;
        line-height: 1;
        white-space: nowrap;
        margin: 0;
    }
    /* juicy flag only on phone — desktop stays modest */
    .brand-chooser .brand-flag {
        width: 1.78em;
        height: 1.78em;
        margin-right: 0.22em;
        vertical-align: unset; /* flex parent owns alignment */
        flex-shrink: 0;
    }
    /* the suffix duplicates the highlighted rating pill; the active nav
       button duplicates the page itself — neither earns its pixels here */
    .logo-suffix {
        display: none;
    }
    .map-zone .nav-here {
        display: none;
    }
    .map-zone {
        flex: none;
        flex-wrap: nowrap;
        gap: 6px;
        justify-self: end;
        justify-content: flex-end;
        align-items: center;
        grid-column: 3;
        min-width: 0;
    }

    .search-input {
        padding: 8px 12px;
        font-size: 12px;
    }

    .region-pills {
        display: none;
    }

    /* pills and count share one line */
    .header-row2 {
        flex-direction: row;
        align-items: center;
        gap: 8px;
        margin-bottom: 8px;
    }
    .region-pills {
        flex: 1 1 auto;
        min-width: 0;
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none; /* the pills row scrolls, no track needed */
        -webkit-overflow-scrolling: touch;
        padding-bottom: 2px;
    }
    .region-pills::-webkit-scrollbar {
        display: none;
    }
    .dock-credit {
        display: none;
    }
    .region-pills .region-pill {
        flex: 0 0 auto;
    }
    .state-count {
        font-size: 11px;
        white-space: nowrap;
    }
}

.count-zone {
    display: flex;
    align-items: center;
    gap: 14px;
}

.price-tail,
.price-frac {
    font-size: 0.78em;
    opacity: 0.45;
}

.price-unit {
    font-size: 0.78em;
    opacity: 0.6;
}

.num-chooser {
    position: relative;
}

/* parity with .nav-btn: same box, same type — a control in the same family */
.region-pill.num-btn {
    padding: 8px 14px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 2px;
    white-space: nowrap;
}

.num-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    z-index: 70;
    flex-direction: column;
    gap: 4px;
    background: #070a08;
    border: 1px solid #1c2a1e;
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

.num-menu .region-pill {
    text-align: left;
    white-space: nowrap;
}

/* Search dock — fixed command bar at the bottom of every page */
/* brand chooser: the logo opens the view menu */
.brand-chooser {
    position: relative;
    flex: 0 0 auto; /* the logo never shrinks — overflow must be seen, not hidden */
}

/* desktop: modest flag (mobile bumps size below) */
.brand-flag {
    display: inline-block;
    width: 0.9em;
    height: 0.9em;
    margin-right: 0.18em;
    vertical-align: -0.1em;
}

.brand-flag svg {
    display: block;
    width: 100%;
    height: 100%;
    shape-rendering: geometricPrecision;
}

/* ONE CSS chevron only (no ::after — that doubled the triangle). */
.brand-caret,
.rating-caret {
    display: none;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 0;
    height: 0;
    margin-left: 6px;
    padding: 0;
    border-style: solid;
    border-width: 5px 4px 0 4px;
    border-color: var(--cyber-green) transparent transparent transparent;
    opacity: 0.9;
    /* optical center next to caps text */
    transform: translateY(1px);
}

/* active rank pill is green fill — green caret would be invisible */
.region-pill.active .rating-caret,
.rating-btn.active .rating-caret,
.rating-btn.region-pill.active .rating-caret {
    border-top-color: #000;
}

.brand-menu {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 75;
    flex-direction: column;
    gap: 4px;
    min-width: 160px;
    background: #070a08;
    border: 1px solid #1c2a1e;
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

.brand-menu .region-pill {
    display: block;
    text-align: left;
}

/* mobile rating dropdown — desktop keeps the pills */
.rating-chooser {
    position: relative;
    display: none;
}

.rating-btn {
    font-weight: 700;
    letter-spacing: 1px;
}

.rating-menu {
    /* closed by default — never flash the full list on mount/nav */
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 70;
    flex-direction: column;
    gap: 4px;
    min-width: 220px;
    background: #070a08;
    border: 1px solid #1c2a1e;
    border-radius: 4px;
    padding: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.7);
}

.rating-menu .region-pill {
    display: block;
    text-align: left;
}

@media (max-width: 640px) {
    .rating-chooser {
        display: flex;
        align-items: center;
        gap: 0;
        justify-self: center;
        grid-column: 2;
        height: 100%;
    }
    /* no room for "by" on the phone strip — rank short is enough */
    .rating-chooser .by-label {
        display: none;
    }
    .brand-caret,
    .rating-caret {
        display: inline-block !important;
        align-self: center;
        width: 0;
        height: 0;
        margin-left: 6px;
        border-style: solid !important;
        border-width: 5px 4px 0 4px !important;
        opacity: 0.9;
        transform: translateY(1px);
    }
    .brand-caret {
        border-color: var(--cyber-green) transparent transparent transparent !important;
    }
    .rating-btn .rating-caret {
        border-color: #000 transparent transparent transparent !important;
    }
    .num-btn .rating-caret {
        border-color: var(--cyber-green) transparent transparent transparent !important;
    }
    /* list views live in the brand menu; only doctrine keeps a button */
    .map-zone .nav-states,
    .map-zone .nav-tokens {
        display: none;
    }
    .map-zone {
        margin-left: 0;
    }
    .header-row2 {
        display: none;
    }
}

.dock-count {
    align-self: center;
    font-size: 11px;
    letter-spacing: 1px;
    color: #555;
    white-space: nowrap;
    margin-right: 12px;
}

.search-dock {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 80;
    display: flex;
    justify-content: center;
    padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(5, 6, 8, 0.92);
    backdrop-filter: blur(8px);
    border-top: 1px solid #111;
}

/* the maker's mark lives in the dock, starboard of the search */
.dock-credit {
    align-self: center;
    margin-left: 14px;
    color: #555;
    font-size: 11px;
    letter-spacing: 1px;
    text-decoration: none;
    white-space: nowrap;
    transition: color 0.15s;
}

.dock-credit:hover {
    color: #999;
}

.search-dock .search-wrap,
.search-dock .search-input {
    flex: 1 1 640px;
    max-width: 640px;
}

.search-dock .search-wrap .search-input {
    max-width: none;
}

/* the filter panel opens upward from the dock */
.search-dock .search-panel {
    top: auto;
    bottom: calc(100% + 8px);
    box-shadow:
        0 -8px 32px rgba(0, 0, 0, 0.7),
        0 0 20px rgba(0, 255, 65, 0.06);
}

/* content must never hide behind the dock */
body {
    padding-bottom: 76px;
}

/* Search command panel */
.search-wrap {
    flex: 0 1 370px;
    min-width: 180px;
    position: relative;
}

.search-wrap .search-input {
    width: 100%;
    flex: none;
}

.search-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    width: max(100%, 560px);
    max-width: 90vw;
    z-index: 60;
    background: #070a08;
    border: 1px solid #1c2a1e;
    border-radius: 4px;
    padding: 14px;
    box-shadow:
        0 8px 32px rgba(0, 0, 0, 0.7),
        0 0 20px rgba(0, 255, 65, 0.06);
}

.panel-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.panel-label {
    flex: 0 0 52px;
    font-size: 10px;
    letter-spacing: 2px;
    color: #555;
    padding-top: 7px;
}

.panel-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.filter-chip {
    color: var(--cyber-yellow);
    border-color: #3a3212;
}

.panel-hint {
    font-size: 10px;
    color: #444;
    letter-spacing: 1px;
    margin-top: 4px;
}

@media (max-width: 640px) {
    .search-wrap {
        order: 3;
        flex: 1 1 100%;
    }
    .search-panel {
        width: 100%;
    }
    .panel-row {
        flex-direction: column;
        gap: 4px;
    }
    .panel-label {
        padding-top: 0;
    }
}

.page-shell {
    --pad-t: 20px;
    --pad-x: 20px;
    padding: var(--pad-t) var(--pad-x) 20px;
}

.page-frame {
    --pad-t: 20px;
    --pad-x: 20px;
    max-width: 1440px;
    margin: 0 auto;
    padding: var(--pad-t) var(--pad-x) 20px;
}

/* The site chrome sticks; everything sails under it. Full-bleed via the
   shell's own padding vars; flow-root so child margins paint background. */
.site-chrome {
    position: sticky;
    top: 0;
    z-index: 60;
    display: flow-root;
    background: var(--cyber-black);
    margin: calc(-1 * var(--pad-t)) calc(-1 * var(--pad-x)) 0;
    padding: var(--pad-t) var(--pad-x) 0;
}

/* header + rating pills + filters: same horizontal stage as home-split
   (table 540 + gap + map to the right edge) — never a narrower 1400 box */
.chrome-inner {
    width: 100%;
    max-width: none;
    margin: 0;
}

.table-shell {
    overflow-x: clip;
    border: 1px solid #111;
    border-radius: 4px;
}

/* Home split: slim table + desktop map */
.home-split {
    display: flex;
    gap: 16px;
    align-items: flex-start;
    margin-right: -20px; /* bleed the map to the physical screen edge */
}

.table-pane {
    /* was 500px — +40 to give the 24H column room without starving any
       of the other columns, which were already at their exact content
       width (zero slack) before that column existed */
    flex: 0 0 540px;
    min-width: 0;
    /* the grown map sweeps beneath — the table stays on top */
    position: relative;
    z-index: 7;
    background: var(--cyber-black);
}

.map-pane {
    /* fixed, not sticky: the map is an instrument panel, it never scrolls.
       left = shell pad 20 + table pane 540 + gap 16.
       top uses --map-chrome-h (listing-only), NOT --chrome-h: leaving a
       state/token page leaves a short --chrome-h and the map would mount
       too high, then drop when listing chrome is measured. */
    position: fixed;
    top: calc(var(--map-chrome-h, 112px) + 8px);
    left: 576px;
    right: 0;
    z-index: 5;
    /* never interpolate top — variable updates must snap, not slide */
    transition: none !important;
}

/* the map is the hero: as large as viewport height and pane width allow,
   box aspect = viewBox aspect (no internal letterbox), hugging the right */
.map-pane .world-map-container svg {
    display: block;
    margin-left: auto;
    aspect-ratio: 880 / 550;
    /* grow from the LEFT edge (at the table): continents get big, the
       empty gap + Antarctica sweep toward the right edge and disk bay */
    width: calc(100vw - 582px);
    height: auto;
    max-width: none;
    margin-top: -18px;
    transform: translateX(0vw) translateY(5vh) scale(1.0815);
}

.cyber-table.slim {
    min-width: 460px;
}

.cyber-table.slim th,
.cyber-table.slim td {
    padding-left: 10px;
    padding-right: 10px;
}

/* one fixed row height on every listing — the box owns the height, the
   content centers inside it, switching states/tokens never jumps */
.cyber-table.slim tbody td {
    height: 45px;
    padding-top: 0;
    padding-bottom: 0;
    vertical-align: middle;
}

.cyber-table th.metric-th {
    white-space: nowrap; /* one-word headers — never two lines */
    letter-spacing: 1px;
}

/* constant header height: every label occupies the same slim box, so
   switching ratings never shifts the table — and the stuck header reads
   as a rail, not a slab */
.cyber-table.slim thead th {
    height: 40px;
    vertical-align: middle;
    box-sizing: border-box;
    font-size: 10px;
    letter-spacing: 1.5px;
}

@media (max-width: 1100px) {
    .map-pane {
        display: none;
    }
    .solar-panel {
        display: none;
    }
    .table-pane {
        flex: 1 1 auto;
    }
    .home-split {
        margin-right: 0;
    } /* no map, no bleed — symmetric margins */
}

/* slim table columns, desktop — px, not %: rank/state/token/price/metric
   are each already sized to their exact content (measured live, zero
   slack), so 24H must not steal a % share from them — it gets the
   table-pane's spare 40px outright. Sum must equal .table-pane's 540px. */
.cyber-table.slim col.c-rank {
    width: 40px;
}
.cyber-table.slim col.c-state {
    width: 150px;
}
.cyber-table.slim col.c-token {
    width: 60px;
}
.cyber-table.slim col.c-price {
    width: 90px;
}
.cyber-table.slim col.c-delta {
    width: 90px;
}
.cyber-table.slim col.c-metric {
    width: 110px;
}

/* the 24h badge rides small, like the price's fraction — narrower than a
   full metric cell, so it never needs the column's full share of width */
.cyber-table.slim td.delta-cell {
    font-size: 0.82em;
    letter-spacing: -0.2px;
}

@media (max-width: 640px) {
    /* pixels are the budget: hairline gutters, no box around the table */
    .page-shell {
        --pad-t: 16px;
        --pad-x: 2px;
        padding: 16px 2px 20px;
    }
    .page-frame {
        --pad-t: 16px;
        --pad-x: 2px;
        padding: 16px 2px 20px;
    }
    .table-shell {
        border: none;
        border-radius: 0;
    }

    .cyber-table.slim {
        min-width: 0;
    }
    .cyber-table.slim th,
    .cyber-table.slim td {
        padding-left: 6px;
        padding-right: 6px;
    }
    /* every column in %, none in px: on a table-layout:fixed table at
       width:100%, percentage columns can never sum past the container —
       mixing in a fixed px column risks the table growing wider than the
       viewport (real horizontal scroll) the moment paddings get tight, so
       this budget is deliberately all-% even though 6 columns is a squeeze */
    .cyber-table.slim col.c-rank {
        width: 8%;
    }
    .cyber-table.slim col.c-state {
        width: 26%;
    }
    .cyber-table.slim col.c-token {
        width: 11%;
    }
    .cyber-table.slim col.c-price {
        width: 18%;
    }
    .cyber-table.slim col.c-delta {
        width: 15%;
    }
    .cyber-table.slim col.c-metric {
        width: 22%;
    }
    .cyber-table.slim td.delta-cell {
        font-size: 10px;
        letter-spacing: -0.3px;
    }
    .cyber-table.slim td:nth-child(2) span:first-child {
        margin-right: 6px !important;
    }
    .cyber-table.slim th:first-child,
    .cyber-table.slim td:first-child {
        padding-left: 2px;
        padding-right: 4px;
    }
    .cyber-table.slim th {
        letter-spacing: 1px;
    } /* TOKEN must not clip to TOKE */
    /* fractions stay — dim and small, same beauty as desktop */
}

/* State page */
.section-label {
    font-size: 11px;
    letter-spacing: 3px;
    color: #555;
    margin-bottom: 10px;
}

.score-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 12px;
}

.stat-label .rank-badge {
    float: right;
    color: var(--cyber-green);
    opacity: 0.75;
    letter-spacing: 1px;
}

.state-hero {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 32px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.state-scores {
    flex: 0 1 460px;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stat-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 12px;
}

.visa-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* half-width visa tables: natural layout, never force the page wide */
.visa-grid .cyber-table {
    min-width: 0;
    table-layout: auto;
}

@media (max-width: 900px) {
    .visa-grid {
        grid-template-columns: 1fr;
    }
    .state-hero {
        align-items: stretch;
    }
    .state-scores {
        flex: 1 1 100%;
    }
}

@media (max-width: 640px) {
    .stat-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
    .stat-card {
        min-width: 0;
    }
    .stat-value {
        font-size: 18px;
    }
}

/* Rendered markdown — methodology and future prose pages */
.prose-cyber {
    margin-top: 8px;
    font-size: 14px;
    line-height: 1.7;
    color: #b8c2cc;
}

.prose-cyber h1 {
    font-size: 26px;
    color: var(--cyber-green);
    letter-spacing: 1px;
    margin: 28px 0 12px;
}

.prose-cyber h2 {
    font-size: 17px;
    color: var(--cyber-cyan);
    letter-spacing: 2px;
    text-transform: uppercase;
    margin: 32px 0 10px;
}

.prose-cyber p {
    margin: 10px 0;
}

.prose-cyber a {
    color: var(--cyber-cyan);
    text-decoration: none;
}
.prose-cyber a:hover {
    color: var(--cyber-green);
}

.prose-cyber strong {
    color: #e8eef4;
}
.prose-cyber em {
    color: #d0d8e0;
}

.prose-cyber code {
    font-family: "Play", monospace;
    background: #0a0f0a;
    border: 1px solid #1a241a;
    border-radius: 2px;
    padding: 1px 5px;
    color: var(--cyber-yellow);
    font-size: 13px;
}

.prose-cyber pre {
    background: #050505;
    border: 1px solid #111;
    border-radius: 4px;
    padding: 14px 16px;
    overflow-x: auto;
    margin: 14px 0;
}

.prose-cyber pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--cyber-green);
}

.prose-cyber table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 13px;
}

.prose-cyber th {
    text-align: left;
    color: var(--cyber-green);
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    border-bottom: 1px solid var(--cyber-muted);
    padding: 8px 12px;
}

.prose-cyber td {
    border-bottom: 1px solid #111;
    padding: 8px 12px;
}

.prose-cyber ul,
.prose-cyber ol {
    margin: 10px 0 10px 24px;
}
.prose-cyber li {
    margin: 6px 0;
}

/* Cyber table */
.cyber-table {
    width: 100%;
    min-width: 1000px;
    table-layout: fixed; /* widths come from colgroup — filtering must not reflow them */
    border-collapse: separate;
    border-spacing: 0;
}

.cyber-table th {
    position: sticky;
    /* -1px: offsetHeight rounds down, the overlap seals the seam */
    top: calc(var(--chrome-h, 112px) - 1px);
    z-index: 10;
    background: #050505;
    border-bottom: 1px solid var(--cyber-muted);
    padding: 12px 16px;
    text-align: left;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--cyber-green);
    cursor: pointer;
    user-select: none;
    transition: color 0.15s;
    white-space: nowrap;
}

.cyber-table th:hover {
    color: var(--cyber-cyan);
}

/* informational columns — not sortable, no affordance */
.cyber-table th.th-static {
    cursor: default;
}

.cyber-table th.th-static:hover {
    color: var(--cyber-green);
}

.cyber-table th.sorted {
    color: var(--cyber-cyan);
    border-bottom-color: var(--cyber-cyan);
}

.cyber-table td {
    padding: 10px 16px;
    border-bottom: 1px solid #111;
    font-size: 13px;
    transition: background 0.1s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis; /* fixed layout: long names truncate instead of pushing the column */
}

/* rank column is narrow — slim padding so 3-digit ranks fit */
.cyber-table td:first-child,
.cyber-table th:first-child {
    padding-left: 8px;
    padding-right: 8px;
}

.cyber-table tr {
    cursor: pointer;
    transition: background 0.1s;
}

.cyber-table tr:hover {
    background: #0d0d0d;
}

.cyber-table tr:hover td {
    border-bottom-color: var(--cyber-green);
}

/* Sort indicators */
.sort-asc::after {
    content: " ▲";
    font-size: 9px;
}
.sort-desc::after {
    content: " ▼";
    font-size: 9px;
}

/* Region filter pills */
/* the kernel ratings end here; the derived freedom scores follow the dot */
.pill-dot {
    color: #444;
    font-size: 16px;
    align-self: center;
    margin: 0 2px;
    user-select: none;
}

.menu-divider {
    height: 1px;
    background: #1c2a1e;
    margin: 4px 2px;
}

.region-pill {
    display: inline-block;
    text-decoration: none;
    padding: 6px 14px;
    border: 1px solid var(--cyber-muted);
    border-radius: 2px;
    font-size: 12px;
    font-family: "Play", sans-serif;
    cursor: pointer;
    transition: all 0.15s;
    background: transparent;
    color: #666;
    letter-spacing: 1px;
}

.region-pill:hover {
    border-color: var(--cyber-green);
    color: var(--cyber-green);
}

.region-pill.active {
    background: var(--cyber-green);
    color: var(--cyber-black);
    border-color: var(--cyber-green);
}

/* Country card / landing page */
.country-hero {
    position: relative;
    padding: 60px 20px;
    border-bottom: 1px solid #111;
    overflow: hidden;
}

.country-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
        ellipse at 50% 0%,
        rgba(0, 255, 65, 0.05) 0%,
        transparent 70%
    );
    pointer-events: none;
}

.stat-card {
    background: #050505;
    border: 1px solid #1a1a1a;
    border-radius: 4px;
    padding: 20px;
    transition: border-color 0.2s;
}

.stat-card:hover {
    border-color: var(--cyber-green);
}

.stat-label {
    font-size: 10px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 8px;
}

.stat-value {
    font-size: 24px;
    font-weight: 700;
    color: var(--cyber-green);
}

/* Color utilities for the full palette */
.text-cyber-green {
    color: var(--cyber-green);
}
.text-cyber-cyan {
    color: var(--cyber-cyan);
}
.text-cyber-magenta {
    color: var(--cyber-magenta);
}
.text-cyber-yellow {
    color: var(--cyber-yellow);
}
.text-cyber-orange {
    color: var(--cyber-orange);
}
.text-cyber-red {
    color: var(--cyber-red);
}
.text-cyber-blue {
    color: var(--cyber-blue);
}
.text-cyber-purple {
    color: var(--cyber-purple);
}
.text-cyber-pink {
    color: var(--cyber-pink);
}

.bg-cyber-black {
    background: var(--cyber-black);
}
.bg-cyber-dark {
    background: var(--cyber-dark);
}
.bg-cyber-dim {
    background: var(--cyber-dim);
}

.border-cyber-green {
    border-color: var(--cyber-green);
}
.border-cyber-cyan {
    border-color: var(--cyber-cyan);
}
.border-cyber-muted {
    border-color: var(--cyber-muted);
}

/* Bar visualization */
.openness-bar {
    height: 4px;
    border-radius: 2px;
    transition: width 0.3s ease;
}

/* Glow effects */
.glow-green {
    text-shadow: 0 0 10px rgba(0, 255, 65, 0.5);
}
.glow-cyan {
    text-shadow: 0 0 10px rgba(0, 229, 255, 0.5);
}

/* Back link */
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #555;
    font-size: 12px;
    letter-spacing: 1px;
    text-decoration: none;
    transition: color 0.15s;
}

.back-link:hover {
    color: var(--cyber-green);
}

/* Number formatting */
.tabular-nums {
    font-variant-numeric: tabular-nums;
}

/* World map */
.world-map-container svg {
    width: 100%;
    height: auto;
    max-height: 70vh;
}

.world-map-container path {
    stroke: #111;
    stroke-width: 0.3;
    cursor: pointer;
    transition:
        opacity 0.15s,
        stroke 0.15s;
}

.world-map-container path:hover {
    opacity: 0.85;
    stroke: var(--cyber-green);
    stroke-width: 1;
}

/* ---- motion: pure cross-fade, frozen chrome -------------------------------
   Previous iterations used blur + translateY + named map/pills layers.
   Blur is GPU-heavy on large WASM snapshots (stutter), Y-motion fights the
   sticky header, and map/pills only exist on some routes so they entered/exited
   as separate layers on top of root — double-dissolve, not smooth.
   This pass: single opacity cross-fade on root only; chrome + dock stay put. */

/* Fallback when View Transitions API is missing */
@keyframes page-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* Kill UA size/position morph on every named group — geometry morph is
   what made the header twitch between pages of different chrome height. */
::view-transition-group(*) {
    animation: none;
}

/* Soft simultaneous cross-fade. No blur, no translate — just opacity.
   Equal duration so old and new trade places without a hollow gap. */
@keyframes vt-cross-out {
    from {
        opacity: 1;
    }
    to {
        opacity: 0;
    }
}
@keyframes vt-cross-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

::view-transition-image-pair(root) {
    isolation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    mix-blend-mode: normal;
    /* height: 100% keeps the snapshot clipped to the viewport so long
       pages don't paint a full-document pseudo while fading */
    height: 100%;
    object-fit: cover;
    object-position: top center;
    /* snappy: 120ms reads as instant-with-polish, not sluggish */
    animation-duration: 120ms;
    animation-timing-function: cubic-bezier(0.2, 0, 0, 1);
    animation-fill-mode: both;
}

::view-transition-old(root) {
    animation-name: vt-cross-out;
}
::view-transition-new(root) {
    animation-name: vt-cross-in;
}

/* ---- named layers: only always-present chrome ---------------------------- */

/* logo + primary nav — bolted to the viewport; instant handoff so the
   brand never blinks or double-exposes during the body fade. */
.header-row1 {
    view-transition-name: chrome;
    position: relative;
    z-index: 5;
}

/* floating search — same freeze treatment as chrome */
.search-dock {
    view-transition-name: dock;
}

/* Map intentionally UNNAMED in view transitions: a named enter from a
   page without map still risks a group box at the wrong Y. It rides in
   root (opacity-only) at the stable --map-chrome-h position instead. */

/* while a hop is running, kill sticky transitions that reflow mid-fade */
html.vt-active {
    /* avoid scrollbar / sticky thrash during the snapshot window */
    scroll-behavior: auto !important;
}
html.vt-active .map-pane,
html.vt-active .cyber-table th,
html.vt-active .world-map-container path {
    transition: none !important;
}

.brand-word {
    display: inline-block;
}

::view-transition-group(chrome),
::view-transition-group(dock) {
    animation: none;
    z-index: 1000; /* above dissolving content */
}
::view-transition-old(chrome),
::view-transition-old(dock) {
    animation: none;
    opacity: 0;
}
::view-transition-new(chrome),
::view-transition-new(dock) {
    animation: none;
    opacity: 1;
}

@supports not (view-transition-name: root) {
    .page-shell,
    .page-frame {
        animation: page-in 120ms cubic-bezier(0.2, 0, 0, 1);
    }
}

/* the map morphs between ratings instead of snapping */
.world-map-container path {
    transition: fill 450ms ease;
}

/* dropdowns breathe in */
@keyframes menu-in {
    from {
        opacity: 0;
        transform: translateY(-4px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

/* breathe-in only when a menu is opened, never on page mount/nav.
   closed menus stay display:none; open ones set display:flex inline. */
.brand-menu[style*="flex"],
.rating-menu[style*="flex"],
.num-menu[style*="flex"],
.search-panel[style*="block"],
.search-panel[style*="flex"] {
    animation: menu-in 140ms ease-out;
}

/* class toggles: planets / continents / countries, each independent */
.class-filter {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-left: auto;
}

.class-toggle {
    /* same box height as .region-pill rating buttons in this row */
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    line-height: 1;
    padding: 6px 18px;
    min-width: 2.4em;
    box-sizing: border-box;
    background: transparent;
    border: 1px solid #222;
    border-radius: 2px;
    cursor: pointer;
    filter: grayscale(1);
    opacity: 0.35;
    transition: all 0.15s;
}

.class-toggle.on {
    filter: none;
    opacity: 1;
    border-color: #2c3a2c;
}

.class-toggle:hover {
    border-color: var(--cyber-green);
}

/* when the toggles precede the legend, only the toggles push right */
.class-filter + .legend-zone {
    margin-left: 14px;
}

@media (max-width: 1360px) {
    .class-filter {
        display: none;
    }
}

/* the legend is an instrument: the bar filters on click */
.legend-zone {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: auto;
}

.legend-end {
    font-size: 10px;
    color: #555;
    letter-spacing: 1px;
}

.legend-barwrap {
    position: relative;
    display: flex;
    align-items: center;
}

.legend-bar {
    position: relative;
    width: 220px;
    height: 10px;
    border-radius: 5px;
    background: linear-gradient(
        to right,
        #ff0040,
        #ff6600,
        #ffd700,
        #00e5ff,
        #00ff41
    );
    cursor: pointer;
    overflow: hidden;
}

/* hover preview: ghost mark in the bar, the would-be filter above it */
.legend-ghost {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: rgba(255, 255, 255, 0.55);
    pointer-events: none;
}

.legend-hint {
    position: absolute;
    bottom: calc(100% + 5px);
    transform: translateX(-50%);
    font-size: 9px;
    letter-spacing: 1px;
    color: #ddd;
    background: rgba(5, 8, 6, 0.95);
    border: 1px solid #1c2a1e;
    border-radius: 2px;
    padding: 2px 6px;
    white-space: nowrap;
    pointer-events: none;
}

.legend-dim {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    background: rgba(0, 0, 0, 0.78);
    pointer-events: none;
}

.legend-mark {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    margin-left: -1px;
    background: #fff;
    box-shadow: 0 0 6px rgba(255, 255, 255, 0.9);
    pointer-events: none;
}

.legend-name {
    font-size: 10px;
    color: #444;
    letter-spacing: 2px;
    white-space: nowrap;
}

.legend-clear {
    font-size: 10px;
    letter-spacing: 1px;
    color: var(--cyber-green);
    background: transparent;
    border: 1px solid #1c2a1e;
    border-radius: 2px;
    padding: 3px 8px;
    cursor: pointer;
    font-family: "Play", sans-serif;
    white-space: nowrap;
}

.legend-clear:hover {
    border-color: var(--cyber-green);
}

/* chrome is full-width with the table+map; pills still need to stay compact
   enough to fit with toggles + legend on one row */
@media (min-width: 0px) {
    .header-row2 {
        gap: 8px;
    }
    .region-pills {
        gap: 4px;
    }
    .region-pills .region-pill {
        padding: 6px 9px;
        letter-spacing: 0.5px;
        font-size: 11px;
    }
    .legend-bar {
        width: 150px;
    }
    .legend-zone {
        gap: 7px;
    }
    .class-filter {
        gap: 4px;
    }
    .class-toggle {
        padding: 6px 18px;
        font-size: 14px;
        min-width: 2.4em;
    }
    .class-filter + .legend-zone {
        margin-left: 8px;
    }
    .by-label {
        margin-right: 2px;
    }
}

/* below this the pills need the whole row — the bar yields */
@media (max-width: 1360px) {
    .legend-zone {
        display: none;
    }
    .class-filter {
        display: none;
    }
}

/* row highlight eases instead of flashing */
.cyber-table tbody tr {
    transition: background 120ms ease;
}

/* the pre-listing mark: a quote that is not yet — links to /listing */
.notyet {
    display: inline-block;
    font-size: 9px;
    font-weight: 400;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #6b7a6b;
    border: 1px dashed #2c3a2c;
    border-radius: 2px;
    padding: 2px 7px;
    text-decoration: none;
    white-space: nowrap;
    transition: all 0.15s;
}

.notyet:hover {
    color: var(--cyber-green);
    border-color: var(--cyber-green);
}

/* /listing: the roll of territories quoted before their token */
.pending-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 20px 0;
}

.pending-pill {
    color: #aaa;
}

/* ---- solar panel: the celestial bodies that have no map polygon ------- */
.solar-panel {
    /* the orbital catalog disk, floating in the map's lower-right —
       the same live sky as /solar, every dot a link.
       21→27.3→32.76vw (+30% then +20%); SE corner pinned */
    position: fixed;
    left: auto;
    right: 12px;
    bottom: 34px;
    width: min(32.76vw, 530px);
    aspect-ratio: 1 / 1;
    z-index: 6;
    pointer-events: none;
}

.solar-panel svg {
    display: block;
    width: 100%;
    height: 100%;
}

.solar-panel .solar-body {
    pointer-events: auto;
    cursor: pointer;
}

.solar-panel .solar-body:hover circle {
    stroke: var(--cyber-green);
    stroke-width: 1.5;
}

.solar-panel circle[data-code] {
    transition: fill 450ms ease; /* morphs with the map */
}

/* ---- /solar: the orbital map experiment ------------------------------- */
.solar-map-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 6px 0 4px;
}

.solar-map {
    display: block;
    width: min(100%, 900px);
    margin: 0 auto;
}

.solar-map-dot {
    transition: fill 450ms ease;
    cursor: pointer;
}

.solar-map .solar-map-a:hover .solar-map-dot {
    stroke: var(--cyber-green);
    stroke-width: 1.5;
}

.solar-map-label {
    fill: #555;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    pointer-events: none;
}

/* ---- /solar cockpit: table · system · world --------------------------- */
/* observatory, full bleed: the disk fills the height edge to edge and
   tucks under the neighboring panels; nothing is symbolic-small */
.solar-cockpit {
    display: grid;
    grid-template-columns: 1fr minmax(720px, 61%);
    height: calc(100vh - var(--chrome-h, 112px) - 118px);
    min-height: 520px;
    margin: 2px calc(-1 * var(--pad-x, 20px)) 0;
}

.cockpit-stage {
    position: relative;
}

/* the disk is the chooser now: moderate size, centered on the band
   right of the table, edges tucking slightly under both neighbors */
.cockpit-stage .solar-map {
    position: absolute;
    top: 50%;
    height: 88%;
    width: auto;
    aspect-ratio: 1 / 1;
    left: calc(446px + (100% - 446px) / 2);
    transform: translate(-50%, -50%);
}

.cockpit-table {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 446px;
    overflow-y: auto;
    border: 1px solid #16211a;
    border-radius: 6px;
    background: rgba(4, 7, 5, 0.72);
    backdrop-filter: blur(5px);
    scrollbar-width: thin;
}

/* the floating table is an index: it lists, the panes show */
.cockpit-table .cyber-table th,
.cockpit-table .cyber-table td {
    padding-left: 7px;
    padding-right: 7px;
    font-size: 12px;
}

.cockpit-table .cyber-table.slim tbody td {
    height: 31px;
}

.cockpit-table .cyber-table.slim thead th {
    height: 30px;
    font-size: 9px;
}

.cockpit-table .cyber-table th {
    background: rgba(5, 8, 6, 0.9);
}

.cockpit-table tbody td {
    background: transparent;
}

/* inside its own scroll container the thead sticks to ITS top,
   not below the page chrome */
.cockpit-table .cyber-table th {
    top: 0;
}

.cockpit-table .cyber-table.slim {
    min-width: 0;
}

.cockpit-row {
    cursor: pointer;
}

.cockpit-row.sel {
    background: rgba(0, 255, 65, 0.07);
    box-shadow: inset 2px 0 0 var(--cyber-green);
}

.cockpit-world {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    padding: 4px 10px 4px 16px;
    /* the disk sweeps under this pane: empty areas let clicks through
       to the dots beneath; real content re-enables itself */
    pointer-events: none;
}

.cockpit-world .planet-head,
.cockpit-world .planet-stats,
.cockpit-world .world-canvas > * {
    pointer-events: auto;
}

.world-canvas {
    position: absolute;
    inset: 0 10px 0 16px;
}

.cockpit-world .planet-head,
.cockpit-world .planet-stats {
    position: relative;
    z-index: 2;
    width: fit-content;
    padding: 3px 10px 3px 4px;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
    text-shadow:
        0 0 8px #000,
        0 1px 3px #000;
}

/* the world fills the pane's full HEIGHT, anchored right — its left
   edge sweeps over the stage band (transparent sky between continents),
   and it passes clicks through to the dots beneath */
.planet-world {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
}

.planet-world svg {
    display: block;
    height: 100%;
    width: auto;
}

.planet-portrait {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.planet-portrait svg {
    height: min(86%, 640px);
    width: auto;
}

.solar-au-label {
    fill: #333;
    font-size: 10px;
    letter-spacing: 1.5px;
}

.planet-head {
    display: flex;
    align-items: center;
    gap: 6px;
}

.planet-name {
    font-size: 20px;
    font-weight: 700;
    color: #fff;
    flex: 1 1 auto;
}

.planet-open {
    font-size: 11px;
    white-space: nowrap;
}

.planet-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    margin: 10px 0 12px;
    font-size: 10px;
    letter-spacing: 1px;
    color: #555;
}

.planet-stats b {
    color: #ccc;
    font-weight: 700;
    margin-left: 4px;
}

.planet-note {
    text-align: center;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #444;
    text-transform: uppercase;
    margin-top: 10px;
}

/* corner instruments: the voids carry function */
.stage-legend {
    position: absolute;
    left: 458px;
    bottom: 8px;
    display: flex;
    align-items: center;
    gap: 8px;
    z-index: 2;
}

.world-derived {
    position: absolute;
    right: 14px;
    bottom: 6px;
    display: flex;
    align-items: flex-end;
    gap: 30px;
    text-align: right;
    pointer-events: none;
}

.world-derived .planet-open {
    pointer-events: auto;
    align-self: center;
    color: #9ab;
    background: rgba(0, 0, 0, 0.6);
}

.world-derived label {
    display: block;
    font-size: 9px;
    letter-spacing: 2px;
    color: #555;
}

.world-derived b,
.world-derived label {
    text-shadow:
        0 0 6px #000,
        0 0 14px #000,
        0 1px 2px #000;
}

.world-derived b {
    font-size: 22px;
    font-weight: 700;
}

@media (max-width: 1250px) {
    .solar-cockpit {
        height: auto;
        min-height: 0;
    }
    .solar-cockpit .solar-map {
        position: static;
        height: 480px;
    }
    .cockpit-table {
        position: static;
        width: auto;
        max-height: 420px;
        margin-top: 12px;
    }
    .cockpit-planet {
        position: static;
        width: auto;
        margin-top: 12px;
    }
}

/* ---- mobile header controls: LAST so we beat base .nav-btn / .region-pill /
   .num-btn. Fixed height + identical type for rank / doctrine / numeraire.
   STATES + TOKENS stay in the brand menu only — never in the right strip. */
@media (max-width: 640px) {
    /* hard hide — must beat the inline-flex rule below (same or higher specificity) */
    .header-row1 .map-zone .nav-btn.nav-states,
    .header-row1 .map-zone .nav-btn.nav-tokens,
    .header-row1 .map-zone .nav-btn.nav-totals,
    .header-row1 .map-zone .nav-btn.nav-here {
        display: none !important;
    }

    /* only doctrine + rank + numeraire share the control box */
    .header-row1 .nav-btn.nav-method,
    .header-row1 .rating-btn.region-pill,
    .header-row1 .region-pill.num-btn,
    .header-row1 .num-chooser .num-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        height: 30px;
        min-height: 30px;
        max-height: 30px;
        padding: 0 10px;
        font-size: 11px;
        font-weight: 700;
        letter-spacing: 1px;
        line-height: 1;
        box-sizing: border-box;
        white-space: nowrap;
        flex-shrink: 0;
        vertical-align: middle;
    }
    /* label text only — do NOT retarget .rating-caret (zero-size triangle) */
    .header-row1 .num-chooser .num-btn > span:not(.rating-caret) {
        font-size: 11px;
        line-height: 1;
        display: inline-flex;
        align-items: center;
    }
    .header-row1 .num-chooser {
        display: inline-flex;
        align-items: center;
        height: 30px;
    }
    /* one triangle per chooser — no ::after, no second border set */
    .header-row1 .brand-caret,
    .header-row1 .rating-caret {
        display: inline-block !important;
        width: 0 !important;
        height: 0 !important;
        min-width: 0;
        min-height: 0;
        margin-left: 6px;
        border-style: solid !important;
        border-width: 5px 4px 0 4px !important;
        opacity: 0.9;
        flex-shrink: 0;
        align-self: center;
        transform: translateY(1px);
    }
    .header-row1 .brand-caret {
        border-color: var(--cyber-green) transparent transparent transparent !important;
    }
    .header-row1 .rating-btn .rating-caret {
        border-color: #000 transparent transparent transparent !important;
    }
    .header-row1 .num-btn .rating-caret {
        border-color: var(--cyber-green) transparent transparent transparent !important;
    }
    /* kill any leftover pseudo triangles */
    .header-row1 .brand-caret::after,
    .header-row1 .rating-caret::after,
    .brand-caret::before,
    .rating-caret::before,
    .brand-caret::after,
    .rating-caret::after {
        content: none !important;
        display: none !important;
        border: none !important;
    }
}

/* ---- totals page: world capital / pop / territory ---- */
.totals-lede {
    font-size: 13px;
    color: #555;
    letter-spacing: 0.5px;
    line-height: 1.5;
    margin: 8px 0 20px;
    max-width: 720px;
}
.totals-kpis {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 24px;
}
.totals-kpis-wide {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}
.totals-kpi-val.magenta {
    color: var(--cyber-magenta);
}
.totals-kpi-val.orange {
    color: var(--cyber-orange);
}
.totals-kpi {
    background: #050505;
    border: 1px solid #1a1a1a;
    border-radius: 2px;
    padding: 16px 18px;
}
.totals-kpi-lab {
    font-size: 10px;
    letter-spacing: 2px;
    color: #555;
    margin-bottom: 8px;
}
.totals-kpi-val {
    font-size: clamp(20px, 3.5vw, 32px);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
    line-height: 1.15;
    color: var(--cyber-green);
}
.totals-kpi-val.cyan {
    color: var(--cyber-cyan);
}
.totals-kpi-val.green {
    color: var(--cyber-green);
}
.totals-kpi-val.yellow {
    color: var(--cyber-yellow);
}
.totals-kpi-hint {
    font-size: 11px;
    color: #444;
    margin-top: 8px;
    letter-spacing: 0.5px;
}
.totals-panel {
    background: #050505;
    border: 1px solid #111;
    border-radius: 2px;
    padding: 16px 18px;
    margin-bottom: 16px;
}
.totals-panel-title {
    font-size: 11px;
    letter-spacing: 3px;
    color: #555;
    margin-bottom: 4px;
}
.totals-panel-hint {
    font-size: 11px;
    color: #333;
    margin: 0 0 14px;
    letter-spacing: 0.5px;
}
.totals-world-chart {
    display: flex;
    align-items: flex-end;
    justify-content: space-around;
    gap: 16px;
    height: 160px;
    padding: 8px 8px 0;
}
.totals-world-col {
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    height: 100%;
    min-width: 0;
}
.totals-world-bar {
    flex: 1 1 auto;
    width: 100%;
    max-width: 72px;
    border-radius: 2px 2px 0 0;
    min-height: 48px;
    opacity: 0.85;
}
.totals-world-bar.cyan {
    background: var(--cyber-cyan);
}
.totals-world-bar.green {
    background: var(--cyber-green);
}
.totals-world-bar.yellow {
    background: var(--cyber-yellow);
}
.totals-world-lab {
    margin-top: 8px;
    font-size: 10px;
    letter-spacing: 1.5px;
    color: #666;
}
.totals-world-num {
    font-size: 12px;
    font-weight: 700;
    color: #ccc;
    font-variant-numeric: tabular-nums;
    margin-top: 2px;
    text-align: center;
}
.totals-bars {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.totals-bar-row {
    display: grid;
    grid-template-columns: minmax(72px, 120px) 1fr minmax(72px, 140px);
    gap: 10px;
    align-items: center;
}
.totals-bar-lab {
    font-size: 11px;
    color: #888;
    text-align: right;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.totals-bar-track {
    height: 14px;
    background: #0a0a0a;
    border: 1px solid #151515;
    border-radius: 1px;
    overflow: hidden;
}
.totals-bar-fill {
    height: 100%;
    min-width: 0;
    opacity: 0.85;
}
.totals-bar-val {
    font-size: 11px;
    color: #aaa;
    font-variant-numeric: tabular-nums;
    text-align: right;
    white-space: nowrap;
}
.dock-link {
    font-size: 11px;
    letter-spacing: 1px;
    color: #555;
    text-decoration: none;
    margin-right: 12px;
}
.dock-link:hover {
    color: var(--cyber-green);
}
@media (max-width: 720px) {
    .totals-kpis {
        grid-template-columns: 1fr;
    }
    .totals-bar-row {
        grid-template-columns: 1fr;
        gap: 2px;
    }
    .totals-bar-lab {
        text-align: left;
    }
    .totals-bar-val {
        text-align: left;
    }
}

/* map ↔ ranking hover sync — row must scream, not whisper */
svg.world-map path.map-sync-hover {
    stroke: #ffffff !important;
    stroke-width: 1.6px;
    filter: brightness(1.4) drop-shadow(0 0 8px rgba(0, 255, 65, 0.7));
    outline: none;
}
.solar-panel circle.map-sync-hover {
    stroke: #fff;
    stroke-width: 2.5px;
    filter: brightness(1.5) drop-shadow(0 0 6px rgba(0, 255, 65, 0.8));
}
.cyber-table tbody tr.row-sync-hover td {
    background: rgba(0, 255, 65, 0.18) !important;
    color: #fff !important;
    box-shadow: inset 0 0 0 1px rgba(0, 255, 65, 0.55);
}
.cyber-table tbody tr.row-sync-hover td:first-child {
    box-shadow:
        inset 4px 0 0 0 var(--cyber-green),
        inset 0 0 0 1px rgba(0, 255, 65, 0.55);
    color: var(--cyber-green) !important;
    font-weight: 700 !important;
}
.cyber-table tbody tr.row-sync-hover {
    position: relative;
    z-index: 2;
    outline: 1px solid var(--cyber-green);
    outline-offset: -1px;
    box-shadow: 0 0 18px rgba(0, 255, 65, 0.25);
}

/* ─── cyberia: fleets & flats experimental console ─── */
/* fill the viewport; only side panels scroll, map stays locked center */
.cyberia-shell {
    height: 100vh;
    max-height: 100vh;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}
.cyberia-shell .site-chrome,
.cyberia-chrome {
    flex-shrink: 0;
}
/* single header row only — no subhead strip; stage eats the rest */
.cyberia-chrome .header-row2 {
    display: none;
}
.cyberia-chrome .chrome-inner {
    padding-bottom: 6px;
}
.cyberia-phase-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    letter-spacing: 1.2px;
    color: var(--cyber-green);
    border: 1px solid rgba(0, 255, 65, 0.35);
    padding: 4px 12px;
    border-radius: 2px;
    margin: 0 12px;
}
.cyberia-phase-pill .phase-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--cyber-green);
    box-shadow: 0 0 8px var(--cyber-green);
}
.cyberia-ctas {
    display: flex;
    gap: 8px;
    align-items: center;
}
/* primary market actions — live in the footer dock */
.cyberia-cta-bar {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    flex: 1;
    min-width: 0;
}
.cyberia-dock.dock-ctas,
.cyberia-dock .dock-ctas {
    flex: 1 1 auto;
}
.cyberia-dock {
    flex-shrink: 0;
    gap: 10px;
    align-items: center;
    padding: 8px 12px;
    min-height: 72px;
    flex-wrap: nowrap;
    z-index: 30;
    border-top: 1px solid #151515;
    background: #000;
}
@media (max-width: 1100px) {
    .cyberia-cta-bar {
        grid-template-columns: 1fr 1fr;
    }
}
@media (max-width: 560px) {
    .cyberia-cta-bar {
        grid-template-columns: 1fr;
    }
}
.cta-btn {
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.2px;
    padding: 6px 14px;
    border-radius: 2px;
    cursor: pointer;
    border: 1px solid;
}
.cta-btn.cta-lg {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 18px;
    font-size: 14px;
    letter-spacing: 1.5px;
    min-height: 56px;
    text-align: left;
}
.cta-ico {
    font-size: 22px;
    line-height: 1;
}
.cta-copy {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.cta-title {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
}
.cta-sub {
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.4px;
    opacity: 0.7;
}
.cta-buy {
    color: var(--cyber-orange);
    border-color: rgba(255, 102, 0, 0.7);
    background: rgba(255, 102, 0, 0.12);
    box-shadow: 0 0 18px rgba(255, 102, 0, 0.12);
}
.cta-buy:hover {
    background: rgba(255, 102, 0, 0.22);
    box-shadow: 0 0 24px rgba(255, 102, 0, 0.22);
}
.cta-lease {
    color: var(--cyber-green);
    border-color: rgba(0, 255, 65, 0.65);
    background: rgba(0, 255, 65, 0.1);
    box-shadow: 0 0 18px rgba(0, 255, 65, 0.1);
}
.cta-lease:hover {
    background: rgba(0, 255, 65, 0.18);
    box-shadow: 0 0 24px rgba(0, 255, 65, 0.18);
}
.cta-btn.cta-bold .cta-title {
    font-weight: 900;
    letter-spacing: 2px;
    text-transform: uppercase;
}
.cta-split {
    color: var(--cyber-cyan);
    border-color: rgba(0, 229, 255, 0.75);
    background: rgba(0, 229, 255, 0.12);
    box-shadow: 0 0 18px rgba(0, 229, 255, 0.14);
    font-weight: 800;
}
.cta-split:hover {
    background: rgba(0, 229, 255, 0.22);
    box-shadow: 0 0 28px rgba(0, 229, 255, 0.25);
}
.cta-merge {
    color: var(--cyber-magenta);
    border-color: rgba(255, 0, 255, 0.7);
    background: rgba(255, 0, 255, 0.1);
    box-shadow: 0 0 18px rgba(255, 0, 255, 0.12);
    font-weight: 800;
}
.cta-merge:hover {
    background: rgba(255, 0, 255, 0.2);
    box-shadow: 0 0 28px rgba(255, 0, 255, 0.22);
}
.intent-commit.split {
    border-color: var(--cyber-cyan);
    color: var(--cyber-cyan);
    background: rgba(0, 229, 255, 0.1);
}
.intent-commit.merge {
    border-color: var(--cyber-magenta);
    color: var(--cyber-magenta);
    background: rgba(255, 0, 255, 0.1);
}
.ii-act.split {
    color: var(--cyber-cyan);
}
.ii-act.merge {
    color: var(--cyber-magenta);
}
.fleet-card.merge-b {
    border-color: var(--cyber-magenta);
    box-shadow: inset 3px 0 0 var(--cyber-magenta);
}
.panel-cta {
    margin-left: auto;
    font-family: inherit;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    padding: 4px 10px;
    border-radius: 2px;
    cursor: pointer;
    color: var(--cyber-orange);
    border: 1px solid rgba(255, 102, 0, 0.4);
    background: transparent;
}
.panel-cta.lease {
    color: var(--cyber-green);
    border-color: rgba(0, 255, 65, 0.4);
}
.panel-cta:hover {
    background: rgba(255, 255, 255, 0.04);
}
.fleet-card.owned {
    border-style: dashed;
}
.fleet-card.catalog {
    width: 100%;
}
.ii-act.buy {
    color: var(--cyber-orange);
}
.ii-act.lease {
    color: var(--cyber-green);
}

/* buy / lease sheets */
.cyberia-sheet-backdrop {
    position: fixed;
    inset: 0;
    z-index: 80;
    background: rgba(0, 0, 0, 0.72);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}
.cyberia-sheet {
    width: min(440px, 100%);
    max-height: min(80vh, 640px);
    overflow: auto;
    background: #0a0a0a;
    border: 1px solid #222;
    border-radius: 4px;
    padding: 14px 16px 16px;
    box-shadow: 0 0 40px rgba(0, 255, 65, 0.08);
}
.sheet-h {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}
.sheet-x {
    font-family: inherit;
    background: transparent;
    border: 1px solid #333;
    color: #888;
    width: 28px;
    height: 28px;
    border-radius: 2px;
    cursor: pointer;
}
.sheet-x:hover {
    color: #fff;
    border-color: #555;
}
.sheet-note {
    font-size: 12px;
    color: #666;
    line-height: 1.45;
    margin: 0 0 12px;
}
.sheet-catalog {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 12px;
}
.sheet-wide {
    width: min(520px, 100%);
}
.sheet-catalog-compact {
    max-height: 140px;
    overflow: auto;
}
.split-pick-label {
    font-size: 10px;
    letter-spacing: 1.4px;
    color: #666;
    font-weight: 700;
    margin: 10px 0 6px;
}
.split-dir-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 4px;
}
.split-slider-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}
.split-range {
    flex: 1;
    accent-color: var(--cyber-cyan);
    height: 4px;
    cursor: pointer;
}
.split-ratio-lbl {
    font-size: 13px;
    font-weight: 700;
    color: var(--cyber-yellow);
    min-width: 40px;
    text-align: right;
    font-variant-numeric: tabular-nums;
}
.split-preview {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin: 8px 0 12px;
    align-items: stretch;
}
.split-mini {
    width: 100%;
    height: 160px;
    background: #050505;
    border: 1px solid #1a1a1a;
    border-radius: 3px;
}
.split-metrics {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 12px;
    padding: 6px 0;
}
.split-metrics.empty {
    color: #555;
    padding: 12px 0;
}
.sm-row {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    letter-spacing: 0.3px;
}
.sm-row.total {
    color: #e0e0e0;
    font-weight: 700;
    border-bottom: 1px solid #1a1a1a;
    padding-bottom: 6px;
    margin-bottom: 2px;
}
.sm-row.a {
    color: var(--cyber-cyan);
    font-weight: 700;
}
.sm-row.b {
    color: var(--cyber-magenta);
    font-weight: 700;
}
.sm-row.dim {
    color: #555;
    font-size: 11px;
}
.sm-row.warn {
    color: var(--cyber-red);
    font-size: 11px;
    margin-top: 4px;
}
@media (max-width: 520px) {
    .split-preview {
        grid-template-columns: 1fr;
    }
}
.intent-commit.lease {
    border-color: var(--cyber-green);
}
/* map is the hero: fixed side rails, flexible center */
.cyberia-stage {
    flex: 1 1 auto;
    min-height: 0;
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) 270px;
    grid-template-rows: minmax(0, 1fr);
    gap: 8px;
    padding: 8px 10px;
    overflow: hidden;
}
.cyberia-panel {
    background: #050505;
    border: 1px solid #151515;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    min-height: 0;
    max-height: 100%;
    overflow: hidden;
}
/* center map panel always largest / focused */
.cyberia-flats {
    min-width: 0;
    border-color: #1f1f1f;
    box-shadow: 0 0 0 1px rgba(0, 255, 65, 0.06);
}
.cyberia-fleets,
.cyberia-right {
    min-width: 0;
}
.cyberia-panel-h {
    display: flex;
    align-items: baseline;
    gap: 10px;
    padding: 8px 10px 6px;
    border-bottom: 1px solid #111;
    flex-shrink: 0;
}
.panel-kicker {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1.5px;
    color: var(--cyber-yellow);
}
.panel-sub {
    font-size: 11px;
    color: #555;
    letter-spacing: 0.5px;
}
/* only the fleet list scrolls — not the page, not the map */
.fleet-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a transparent;
}
.fleet-list::-webkit-scrollbar {
    width: 4px;
}
.fleet-list::-webkit-scrollbar-thumb {
    background: #2a2a2a;
    border-radius: 2px;
}
.fleet-section {
    font-size: 9px;
    letter-spacing: 1.5px;
    color: #555;
    padding: 6px 2px 2px;
    border-bottom: 1px solid #151515;
    margin-top: 2px;
    flex-shrink: 0;
    position: sticky;
    top: 0;
    background: #050505;
    z-index: 1;
}
.fleet-section:first-child {
    margin-top: 0;
    padding-top: 0;
}
.fleet-card {
    text-align: left;
    background: #0a0a0a;
    border: 1px solid #1a1a1a;
    border-radius: 3px;
    padding: 5px 8px;
    color: #ccc;
    cursor: pointer;
    font-family: inherit;
    flex-shrink: 0;
    transition:
        border-color 0.12s,
        background 0.12s;
}
.fleet-card:hover:not(:disabled) {
    border-color: #333;
    background: #0e0e0e;
}
.fleet-card.sel {
    border-color: var(--cyber-green);
    background: rgba(0, 255, 65, 0.06);
    box-shadow: inset 3px 0 0 var(--cyber-green);
}
.fleet-card.offline {
    opacity: 0.4;
    cursor: not-allowed;
}
.fleet-card.worker .fleet-name {
    color: var(--cyber-cyan);
}
.fleet-card.machine .fleet-name {
    color: var(--cyber-orange);
}
.fleet-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
}
.fleet-name {
    font-weight: 700;
    letter-spacing: 0.8px;
    font-size: 11px;
}
.fleet-status {
    font-size: 9px;
    letter-spacing: 0.8px;
}
.fleet-role {
    font-size: 10px;
    color: #666;
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.fleet-meta {
    display: none; /* denser list — kind/phase redundant next to role */
}
.cyberia-hint {
    display: none; /* keep stage clean; CTAs live in footer */
}
.flat-map-wrap {
    flex: 1 1 auto;
    min-height: 0;
    padding: 0;
    display: flex;
    position: relative;
    overflow: hidden; /* static viewport — camera never scrolls the panel */
    touch-action: none;
    cursor: grab;
    outline: none;
    background: #050505;
    user-select: none;
}
.flat-map-wrap:active,
.flat-map-wrap.game-map:active {
    cursor: grabbing;
}
.flat-map-wrap:focus-visible {
    box-shadow: inset 0 0 0 1px rgba(0, 255, 65, 0.35);
}
/* camera world — pan/zoom via transform, origin top-left */
.map-world {
    width: 100%;
    height: 100%;
    transform-origin: 0 0;
    will-change: transform;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
}
.flat-map {
    width: 100%;
    height: 100%;
    display: block;
    background: radial-gradient(
        ellipse at 50% 45%,
        #0c0c0c 0%,
        #050505 55%,
        #000 100%
    );
    border-radius: 0;
    overflow: visible;
}
/* left game zoom / pan rail */
.map-zoom-rail {
    position: absolute;
    left: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 5;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 6px 4px;
    background: rgba(0, 0, 0, 0.72);
    border: 1px solid #222;
    border-radius: 4px;
    backdrop-filter: blur(4px);
}
.map-cam-btn {
    width: 28px;
    height: 28px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    line-height: 1;
    color: #ccc;
    background: #0c0c0c;
    border: 1px solid #2a2a2a;
    border-radius: 3px;
    cursor: pointer;
    padding: 0;
}
.map-cam-btn:hover {
    color: var(--cyber-green);
    border-color: rgba(0, 255, 65, 0.45);
    background: rgba(0, 255, 65, 0.08);
}
.map-cam-sep {
    height: 1px;
    background: #222;
    margin: 2px 2px;
}
.map-zoom-readout {
    margin-left: auto;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;
    color: var(--cyber-yellow);
    font-variant-numeric: tabular-nums;
}
.map-tooltip {
    position: absolute;
    right: 12px;
    top: 12px;
    z-index: 6;
    min-width: 140px;
    padding: 10px 12px;
    background: rgba(0, 0, 0, 0.88);
    border: 1px solid rgba(0, 255, 65, 0.35);
    border-radius: 3px;
    pointer-events: none;
    box-shadow: 0 0 20px rgba(0, 255, 65, 0.12);
}
.mt-name {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: #e0e0e0;
}
.mt-area {
    margin-top: 4px;
    font-size: 12px;
    color: var(--cyber-cyan);
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}
.mt-hint {
    margin-top: 4px;
    font-size: 10px;
    letter-spacing: 0.8px;
    color: #666;
}
.map-hud-hint {
    position: absolute;
    left: 50%;
    bottom: 8px;
    transform: translateX(-50%);
    z-index: 4;
    font-size: 10px;
    letter-spacing: 0.6px;
    color: #444;
    background: rgba(0, 0, 0, 0.55);
    padding: 3px 10px;
    border-radius: 2px;
    pointer-events: none;
    white-space: nowrap;
}
.flat-path {
    cursor: pointer;
    transition:
        fill 0.1s,
        stroke 0.1s,
        filter 0.1s;
}
.flat-path.is-hov {
    filter: brightness(1.25) drop-shadow(0 0 6px rgba(255, 255, 255, 0.35));
}
.flat-path.is-sel {
    filter: brightness(1.15) drop-shadow(0 0 8px rgba(0, 255, 65, 0.45));
}
.flat-path:hover {
    filter: brightness(1.2);
}
.flat-label {
    fill: #e0e0e0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    pointer-events: none;
    font-family: "Play", sans-serif;
}
.place-label {
    fill: #555;
    font-size: 8px;
    letter-spacing: 0.5px;
    pointer-events: none;
    font-family: "Play", sans-serif;
}
.map-caption {
    fill: #333;
    font-size: 8px;
    letter-spacing: 0.3px;
    font-family: "Play", sans-serif;
}
.flat-legend {
    display: flex;
    gap: 14px;
    padding: 4px 10px 6px;
    font-size: 10px;
    letter-spacing: 1px;
    flex-shrink: 0;
}
.flat-legend .leg.sin {
    color: var(--cyber-green);
}
.flat-legend .leg.avalon {
    color: var(--cyber-orange);
}
.flat-legend .leg.bridge {
    color: var(--cyber-cyan);
}
.flat-legend .leg.core {
    color: var(--cyber-yellow);
}
.flat-legend .leg.ether {
    color: var(--cyber-purple);
}
.flat-legend .leg.dim {
    color: #444;
}
.district-label {
    fill: rgba(255, 255, 255, 0.22);
    font-size: 10px;
    letter-spacing: 1.2px;
    font-weight: 700;
    pointer-events: none;
    font-family: "Play", sans-serif;
    /* size is screen-stable via SVG inverse-scale under map zoom */
}
.flat-label {
    fill: #f0f0f0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.8px;
    pointer-events: none;
    font-family: "Play", sans-serif;
    paint-order: stroke;
    stroke: rgba(0, 0, 0, 0.85);
    stroke-width: 3px;
}
.place-dot {
    pointer-events: none;
}
.place-label {
    fill: #888;
    font-size: 9px;
    letter-spacing: 0.4px;
    pointer-events: none;
    font-family: "Play", sans-serif;
}
.map-caption {
    fill: #555;
    font-size: 9px;
    letter-spacing: 0.3px;
    font-family: "Play", sans-serif;
    pointer-events: none;
}

.cyberia-right {
    min-width: 0;
}
.render-3d {
    padding: 10px 8px;
    flex: 0 0 auto;
    min-height: 160px;
    max-height: 42%;
    display: flex;
    align-items: center;
    justify-content: center;
    border-bottom: 1px solid #111;
    overflow: hidden;
}
.render-pair {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    width: 100%;
    align-items: start;
}
.render-tag {
    font-size: 9px;
    letter-spacing: 1.5px;
    color: #555;
    font-weight: 700;
    margin-bottom: 4px;
}
.prism-scene {
    perspective: 600px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 0;
}
/* stylized unit: worker (cyan biped) / machine (orange blocky) */
.bot-scene {
    perspective: 500px;
}
.bot-figure {
    --bot-color: var(--cyber-cyan);
    position: relative;
    width: 72px;
    height: 96px;
    transform-style: preserve-3d;
    animation: bot-bob 2.8s ease-in-out infinite;
}
.bot-figure.machine {
    animation: bot-spin 10s linear infinite;
}
.bot-figure.empty {
    opacity: 0.35;
    animation: none;
}
@keyframes bot-bob {
    0%,
    100% {
        transform: translateY(0) rotateY(-12deg);
    }
    50% {
        transform: translateY(-6px) rotateY(12deg);
    }
}
@keyframes bot-spin {
    from {
        transform: rotateY(0deg) translateY(0);
    }
    to {
        transform: rotateY(360deg) translateY(0);
    }
}
.bot-head {
    position: absolute;
    left: 50%;
    top: 0;
    width: 28px;
    height: 24px;
    margin-left: -14px;
    border-radius: 4px 4px 2px 2px;
    background: color-mix(in srgb, var(--bot-color) 55%, #000);
    border: 1px solid var(--bot-color);
    box-shadow: 0 0 12px color-mix(in srgb, var(--bot-color) 40%, transparent);
}
.bot-figure.machine .bot-head {
    width: 36px;
    height: 20px;
    margin-left: -18px;
    border-radius: 2px;
}
.bot-head::after {
    content: "";
    position: absolute;
    left: 6px;
    top: 8px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--bot-color);
    box-shadow:
        12px 0 0 var(--bot-color),
        0 0 8px var(--bot-color);
}
.bot-figure.machine .bot-head::after {
    left: 8px;
    width: 8px;
    height: 4px;
    border-radius: 1px;
    box-shadow: 12px 0 0 var(--bot-color);
}
.bot-body {
    position: absolute;
    left: 50%;
    top: 28px;
    width: 40px;
    height: 36px;
    margin-left: -20px;
}
.bot-chest {
    width: 100%;
    height: 100%;
    border-radius: 3px;
    background: color-mix(in srgb, var(--bot-color) 28%, #0a0a0a);
    border: 1px solid color-mix(in srgb, var(--bot-color) 70%, #333);
    box-shadow: inset 0 0 12px
        color-mix(in srgb, var(--bot-color) 15%, transparent);
}
.bot-figure.machine .bot-chest {
    border-radius: 2px;
    height: 42px;
}
.bot-arm {
    position: absolute;
    top: 4px;
    width: 10px;
    height: 28px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--bot-color) 40%, #111);
    border: 1px solid color-mix(in srgb, var(--bot-color) 50%, #222);
}
.bot-arm-l {
    left: -12px;
    transform: rotate(12deg);
}
.bot-arm-r {
    right: -12px;
    transform: rotate(-12deg);
}
.bot-figure.machine .bot-arm {
    width: 14px;
    height: 12px;
    top: 12px;
}
.bot-legs {
    position: absolute;
    left: 50%;
    top: 66px;
    width: 36px;
    margin-left: -18px;
    display: flex;
    justify-content: space-between;
}
.bot-leg {
    width: 12px;
    height: 26px;
    border-radius: 2px;
    background: color-mix(in srgb, var(--bot-color) 35%, #000);
    border: 1px solid color-mix(in srgb, var(--bot-color) 45%, #222);
}
.bot-figure.machine .bot-leg {
    width: 16px;
    height: 14px;
    border-radius: 1px;
}
.bot-glow {
    position: absolute;
    left: 50%;
    bottom: -4px;
    width: 48px;
    height: 8px;
    margin-left: -24px;
    border-radius: 50%;
    background: radial-gradient(
        ellipse,
        color-mix(in srgb, var(--bot-color) 45%, transparent),
        transparent 70%
    );
    filter: blur(2px);
}
.prism {
    --prism-color: var(--cyber-green);
    width: 110px;
    height: 70px;
    position: relative;
    transform-style: preserve-3d;
    transform: rotateX(58deg) rotateZ(-28deg);
    animation: prism-spin 14s linear infinite;
}
@keyframes prism-spin {
    from {
        transform: rotateX(58deg) rotateZ(-28deg);
    }
    to {
        transform: rotateX(58deg) rotateZ(332deg);
    }
}
.prism-face {
    position: absolute;
    border: 1px solid color-mix(in srgb, var(--prism-color) 70%, #fff 0%);
    background: color-mix(in srgb, var(--prism-color) 18%, transparent);
}
.prism-top {
    width: 110px;
    height: 70px;
    transform: translateZ(36px);
    box-shadow: 0 0 24px color-mix(in srgb, var(--prism-color) 30%, transparent);
}
.prism-front {
    width: 110px;
    height: 36px;
    transform: rotateX(-90deg) translateY(-18px) translateZ(35px);
    transform-origin: bottom;
    background: color-mix(in srgb, var(--prism-color) 12%, #000 40%);
}
.prism-side {
    width: 70px;
    height: 36px;
    left: 110px;
    transform: rotateY(90deg) rotateX(-90deg) translateY(-18px)
        translateZ(-35px);
    transform-origin: left bottom;
    background: color-mix(in srgb, var(--prism-color) 8%, #000 50%);
}
.prism-meta {
    text-align: center;
}
.prism-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 2px;
    color: #e0e0e0;
}
.prism-sub {
    font-size: 11px;
    color: #555;
    margin-top: 2px;
    letter-spacing: 0.5px;
}
.intent-form {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    overflow-x: hidden;
    overflow-y: auto;
    flex: 1 1 auto;
    min-height: 0;
    scrollbar-width: thin;
    scrollbar-color: #2a2a2a transparent;
}
.intent-row {
    display: flex;
    justify-content: space-between;
    font-size: 12px;
}
.intent-k {
    color: #555;
    letter-spacing: 1px;
    text-transform: uppercase;
    font-size: 10px;
}
.intent-v {
    color: var(--cyber-yellow);
    font-weight: 700;
    letter-spacing: 1px;
}
.intent-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}
.act-pill {
    font-family: inherit;
    font-size: 10px;
    letter-spacing: 1px;
    padding: 5px 9px;
    border-radius: 2px;
    border: 1px solid #222;
    background: #0a0a0a;
    color: #888;
    cursor: pointer;
}
.act-pill.sel {
    border-color: var(--cyber-cyan);
    color: var(--cyber-cyan);
    background: rgba(0, 229, 255, 0.08);
}
.act-pill.locked {
    opacity: 0.35;
    cursor: not-allowed;
}
.intent-commit {
    font-family: inherit;
    font-weight: 700;
    letter-spacing: 1.5px;
    font-size: 12px;
    padding: 10px;
    border: 1px solid var(--cyber-green);
    background: rgba(0, 255, 65, 0.08);
    color: var(--cyber-green);
    border-radius: 2px;
    cursor: pointer;
}
.intent-commit:hover {
    background: rgba(0, 255, 65, 0.16);
}
.intent-queue {
    margin-top: 4px;
    border-top: 1px solid #111;
    padding-top: 8px;
}
.intent-empty {
    font-size: 11px;
    color: #444;
    letter-spacing: 0.3px;
}
.intent-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.intent-item {
    display: grid;
    grid-template-columns: 42px 1fr auto auto;
    gap: 8px;
    font-size: 11px;
    padding: 5px 6px;
    background: #0a0a0a;
    border: 1px solid #151515;
    border-radius: 2px;
}
.ii-id {
    color: #444;
}
.ii-fleet {
    color: var(--cyber-orange);
    font-weight: 700;
}
.ii-act {
    color: var(--cyber-cyan);
}
.ii-flat {
    color: var(--cyber-green);
    font-weight: 700;
}
.cyberia-dock {
    gap: 16px;
}
.cyberia-soft3-dock {
    color: #444 !important;
    font-size: 11px;
    flex: 1;
}

.nav-cyberia.nav-here,
.nav-btn.nav-cyberia.nav-here {
    color: var(--cyber-green);
}

@media (max-width: 1100px) {
    .cyberia-stage {
        /* map stays center-top hero */
        grid-template-columns: 170px minmax(0, 1fr);
        grid-template-rows: minmax(0, 1fr) 220px;
    }
    .cyberia-fleets {
        grid-column: 1;
        grid-row: 1;
    }
    .cyberia-flats {
        grid-column: 2;
        grid-row: 1;
    }
    .cyberia-right {
        grid-column: 1 / -1;
        grid-row: 2;
    }
    .cyberia-dock {
        flex-wrap: wrap;
    }
}
@media (max-width: 720px) {
    .cyberia-shell {
        height: auto;
        max-height: none;
        overflow: auto;
    }
    .cyberia-stage {
        grid-template-columns: 1fr;
        grid-template-rows: 200px minmax(280px, 50vh) 260px;
        overflow: visible;
    }
    .cyberia-fleets {
        grid-column: 1;
        grid-row: 1;
    }
    .cyberia-flats {
        grid-column: 1;
        grid-row: 2; /* still the visual center of the stack */
    }
    .cyberia-right {
        grid-column: 1;
        grid-row: 3;
    }
    .cyberia-soft3 {
        display: none;
    }
    .cyberia-phase-pill {
        display: none;
    }
}
