:root {
    --void: #05090c;
    --panel: #0a1218;
    --panel-2: #0d181f;
    --line: #233038;
    --hud: #8fb0bd;
    --hud-dim: #5b7683;
    --bone: #e6edf1;
    --signal: #e1382e;
    --f-disp: "Arial Narrow", "Helvetica Neue Condensed", "Liberation Sans Narrow", system-ui, sans-serif;
    --f-data: ui-monospace, Consolas, "SF Mono", Menlo, monospace;
    --f-ui: system-ui, -apple-system, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box
}

body {
    margin: 0;
    background: var(--void);
    color: var(--bone);
    font-family: var(--f-ui);
    font-size: 14px;
    line-height: 1.45;
    -webkit-font-smoothing: antialiased
}

.frame {
    max-width: 1680px;
    margin: 0 auto;
    padding: 14px;
    display: flex;
    flex-direction: column;
    gap: 10px
}

.topbar {
    display: flex;
    align-items: center;
    gap: 14px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #0c161d, #080f14);
    padding: 10px 14px
}

.brandmark {
    display: flex;
    gap: 8px;
    align-items: center;
    flex: none
}

.brandmark svg {
    display: block;
    border: 1px solid #2c3a43
}

.titleblock {
    flex: 1;
    min-width: 0
}

.eyebrow {
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .2em;
    color: var(--hud-dim);
    text-transform: uppercase
}

.title {
    font-family: var(--f-disp);
    font-size: clamp(19px, 2.3vw, 28px);
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
    text-wrap: balance;
    margin: 2px 0 0;
    line-height: 1.05
}

.clockblock {
    text-align: right;
    font-family: var(--f-data);
    font-size: 11px;
    letter-spacing: .12em;
    color: var(--hud);
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-variant-numeric: tabular-nums;
    flex: none
}

.clockblock .lo {
    color: var(--hud-dim);
    font-size: 10px
}

.stage {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 10px;
    align-items: start
}

.mapcase {
    position: relative;
    border: 1px solid var(--line);
    background: #060b0e;
    overflow: hidden
}

.mapcase svg.map {
    display: block;
    width: 100%;
    height: auto
}

.corner {
    position: absolute;
    font-family: var(--f-data);
    font-size: 9px;
    letter-spacing: .14em;
    color: #5a7583;
    pointer-events: none;
    white-space: pre;
    line-height: 1.6;
    text-shadow: 0 1px 3px #000
}

.corner.tl {
    top: 10px;
    left: 12px
}

.corner.tr {
    top: 10px;
    right: 12px;
    text-align: right
}

.hudbar {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 12px;
    background: linear-gradient(180deg, rgba(6, 12, 16, 0), rgba(5, 10, 13, .9));
    border-top: 1px solid rgba(143, 176, 189, .18);
    pointer-events: none
}

.hb-title {
    font-family: var(--f-disp);
    font-size: clamp(13px, 1.3vw, 19px);
    letter-spacing: .2em;
    text-transform: uppercase;
    color: #b9ccd4;
    white-space: nowrap;
    text-shadow: 0 1px 4px #000
}

.hb-title b {
    color: #fff;
    font-weight: 700
}

.hb-meter {
    display: flex;
    gap: 2px;
    align-items: flex-end
}

.hb-meter i {
    display: block;
    width: 5px;
    background: #7ea3b2;
    opacity: .5
}

.hb-alpha {
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .22em;
    text-transform: uppercase;
    color: #cfe0e6;
    border: 1px solid rgba(143, 176, 189, .4);
    padding: 3px 9px;
    white-space: nowrap
}

.hb-rule {
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, rgba(143, 176, 189, .25), rgba(143, 176, 189, .04))
}

.hb-icons {
    display: flex;
    gap: 5px
}

.hb-icons span {
    width: 30px;
    height: 22px;
    border: 1px solid rgba(143, 176, 189, .25);
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(8, 16, 21, .55)
}

.hb-icons svg {
    width: 16px;
    height: 12px;
    fill: none;
    stroke: #8fb0bd;
    stroke-width: 1.3;
    opacity: .8
}

@media (max-width:900px) {

    .hb-meter,
    .hb-alpha,
    .hb-icons {
        display: none
    }
}

.probe {
    position: absolute;
    pointer-events: none;
    border: 1px solid rgba(143, 176, 189, .5);
    background: rgba(6, 11, 14, .94);
    padding: 6px 9px;
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .13em;
    color: var(--hud);
    text-transform: uppercase;
    white-space: nowrap;
    opacity: 0;
    transition: opacity .12s;
    transform: translate(12px, -50%);
    z-index: 5
}

.probe b {
    display: block;
    font-size: 12px;
    color: #fff;
    letter-spacing: .1em;
    margin-bottom: 2px
}

.probe.show {
    opacity: 1
}

/* ---- map overlay ---- */
.hit {
    fill: transparent;
    stroke: none;
    cursor: pointer
}

.hit:focus {
    outline: none
}

.tint,
.scrim {
    pointer-events: none;
    transition: fill .3s, fill-opacity .3s
}

.tint {
    fill: transparent;
    fill-opacity: 0
}

.scrim {
    fill: #02060a;
    fill-opacity: 0
}

/* Province borders: one thin dark line, no glow, no casing. They sit almost
 invisible until a province is chosen, then come up enough to read. */
.bline {
    fill: none;
    stroke: #05080a;
    stroke-width: 2.2;
    stroke-linejoin: round;
    stroke-linecap: round;
    opacity: .1;
    pointer-events: none;
    transition: opacity .3s
}

.natline {
    fill: none;
    stroke: #05080a;
    stroke-width: 3;
    stroke-linejoin: round;
    opacity: .14;
    pointer-events: none;
    transition: opacity .3s
}

/* railways: dark bed, light dashed rail on top */
.railbed {
    fill: none;
    stroke: #241a12;
    stroke-linecap: round;
    opacity: .62;
    pointer-events: none;
    transition: opacity .2s
}

.railline {
    fill: none;
    stroke-linecap: butt;
    opacity: .85;
    pointer-events: none;
    transition: opacity .2s, stroke-width .2s
}

.railline.on {
    opacity: 1;
    stroke: #fff6e2 !important;
    stroke-width: 4.4 !important
}

.railline.off {
    opacity: .3
}

.railbed.off {
    opacity: .28
}

/* under-construction lines stay fully visible at all times -- their progress should
 always read clearly, not dim just because another line is being inspected */
.railline.spotlight {
    opacity: 1 !important
}

.railbed.spotlight {
    opacity: 1 !important
}

.railghost.spotlight {
    opacity: 1
}

/* clickable stroke, invisible but wide */
.railhit {
    fill: none;
    stroke: transparent;
    stroke-width: 18;
    pointer-events: stroke;
    cursor: pointer
}

.railhit:focus {
    outline: none
}

/* the part of an alignment that has not been built yet */
.railghost {
    fill: none;
    stroke-linecap: butt;
    stroke-dasharray: 2 10;
    opacity: .4;
    pointer-events: none
}

/* the map column: plate on top, construction returns beneath it */
.mapcol {
    display: grid;
    gap: 10px;
    min-width: 0
}

/* construction tracker: its own panel below the map, not an overlay on it */
.consect {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 11px 14px 13px;
}

.consect-h {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    border-bottom: 1px solid rgba(143, 176, 189, .2);
    padding-bottom: 7px;
    margin-bottom: 11px;
}

.consect-h span:first-child {
    font-family: var(--f-disp);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    color: #dfe9ee;
}

.consect-h span:last-child {
    font-family: var(--f-data);
    font-size: 9px;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: var(--hud-dim);
    white-space: nowrap;
}

/* Construction routes are stacked so each progress bar spans the map column. */
#tracker-rows {
    display: grid;
    grid-template-columns: 1fr;
    gap: 12px 22px
}

.trk {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 10px;
    align-content: start
}

.trk .tn {
    font-family: var(--f-data);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #e6edf1;
    line-height: 1.3
}

.trk .tp {
    font-family: var(--f-data);
    font-size: 12px;
    color: #fff;
    font-variant-numeric: tabular-nums;
    align-self: start
}

.trk .tb {
    grid-column: 1/-1;
    position: relative;
    height: 7px;
    background: #0d1a21;
    border: 1px solid #23333c;
    margin-top: 2px
}

.trk .tf {
    display: block;
    height: 100%;
    transition: width .5s cubic-bezier(.2, .7, .2, 1)
}

.trk .tnote {
    grid-column: 1/-1;
    font-family: var(--f-data);
    font-size: 8.5px;
    letter-spacing: .09em;
    color: var(--hud-dim);
    text-transform: uppercase;
    line-height: 1.35
}

.trk.offmap .tn {
    color: #cfdce2
}

@media (max-width:900px) {
    .corner {
        display: none
    }

    .consect-h span:last-child {
        display: none
    }
}

/* alignment handles: invisible and inert until the map is unlocked */
.railnode {
    fill: #12202a;
    stroke: #e8dcc8;
    stroke-width: 2.5;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s
}

#railnodes>g {
    pointer-events: none
}

svg.unlocked #railnodes>g {
    pointer-events: auto;
    cursor: grab
}

svg.unlocked .railnode {
    opacity: .92;
    pointer-events: auto
}

svg.unlocked #railnodes>g.drag {
    cursor: grabbing
}

svg.unlocked #railnodes>g.drag .railnode,
svg.unlocked #railnodes>g:focus .railnode {
    fill: #e8dcc8;
    stroke: #fff
}

#railnodes>g:focus {
    outline: none
}

svg.sel .bline {
    opacity: .6
}

svg.sel .natline {
    opacity: .45
}

/* selection outline: the only bright stroke on the map, and only while selected */
.psel {
    fill: none;
    stroke: #ffffff;
    stroke-width: 3;
    stroke-linejoin: round;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s
}

.psel.on {
    opacity: .95
}

#labels text,
#cities text,
#sites text {
    pointer-events: none
}

/* marks take the pointer in both modes: click opens the dossier, drag only when unlocked */
#cities>g,
#sites>g {
    pointer-events: auto;
    cursor: pointer
}

#cities>g *,
#sites>g * {
    pointer-events: auto
}

svg.unlocked #cities>g,
svg.unlocked #sites>g {
    cursor: grab
}

svg.unlocked #cities>g.drag,
svg.unlocked #sites>g.drag {
    cursor: grabbing
}

#cities>g:focus,
#sites>g:focus {
    outline: none
}

.movering {
    fill: none;
    stroke: #9fe6ff;
    stroke-width: 2;
    stroke-dasharray: 5 5;
    opacity: 0
}

svg.unlocked .movering {
    opacity: .75
}

#cities>g.drag .movering,
#sites>g.drag .movering {
    stroke: #fff;
    opacity: 1
}

svg.unlocked #cities>g:focus .movering,
svg.unlocked #sites>g:focus .movering {
    stroke: #fff;
    opacity: 1;
    stroke-dasharray: none
}

.maplabel {
    font-family: var(--f-disp);
    font-weight: 700;
    fill: #fff;
    letter-spacing: .15em;
    text-transform: uppercase
}

.region-label {
    font-size: 26px;
    opacity: .95;
    paint-order: stroke;
    stroke: rgba(3, 7, 10, .9);
    stroke-width: 6px;
    stroke-linejoin: round
}

.city-label {
    font-size: 23px;
    letter-spacing: .1em
}

.town-label {
    font-size: 17px;
    letter-spacing: .12em;
    fill: #eef3f5
}

.site-label {
    font-size: 18px;
    fill: #e3ecef;
    letter-spacing: .14em;
    paint-order: stroke;
    stroke: rgba(3, 7, 10, .9);
    stroke-width: 5.5px;
    stroke-linejoin: round
}

.labelbox {
    fill: #04080a;
    fill-opacity: .86
}

#labels text {
    transition: opacity .2s
}

/* The autonomous zone: hatching and its own outline on one path, so both rise and
 fall together. Held at a readable level if motion is unwelcome. */
.saz {
    pointer-events: none;
    opacity: .5;
    stroke: #e1382e;
    stroke-opacity: .45;
    stroke-width: 2.5;
    stroke-linejoin: round
}

/* dims with everything else when another province is chosen */
#sazlayer {
    transition: opacity .3s
}

/* The autonomous zone blob around Glowburg */
.saz-blob {
    fill: #e59b2b;
    fill-opacity: .38;
    stroke: #f59e0b;
    stroke-width: 2.2;
    stroke-dasharray: 6 3.5;
    stroke-linejoin: round;
    pointer-events: all;
    cursor: pointer;
    transition: fill-opacity .2s, stroke .2s, stroke-width .2s, filter .2s;
}

.saz-blob:hover {
    fill-opacity: .62;
    stroke: #fbbf24;
    stroke-width: 3;
    stroke-dasharray: none;
    filter: drop-shadow(0 0 8px rgba(245, 158, 11, .85));
}

.saz-blob.selected {
    fill: #f59e0b;
    fill-opacity: .72;
    stroke: #fffbeb;
    stroke-width: 3.6;
    stroke-dasharray: none;
    filter: drop-shadow(0 0 14px rgba(245, 158, 11, 1));
}

@media (prefers-reduced-motion:no-preference) {
    .pulse {
        animation: pulse 3.6s ease-out infinite
    }

    @keyframes pulse {
        0% {
            r: 12;
            opacity: .85
        }

        70% {
            r: 52;
            opacity: 0
        }

        100% {
            r: 52;
            opacity: 0
        }
    }

    /* ...otherwise it breathes slowly from prominent to gone and back */
    .saz {
        animation: sazBreathe 4s ease-in-out infinite
    }

    @keyframes sazBreathe {

        0%,
        100% {
            opacity: 0
        }

        50% {
            opacity: 1
        }
    }

    /* ...and the SAZ enclave blob breathes with a distinct yellow-orange pulse */
    .saz-blob {
        animation: sazBlobBreathe 4.5s ease-in-out infinite;
    }

    @keyframes sazBlobBreathe {
        0%,
        100% {
            fill-opacity: .32;
            stroke-opacity: .8;
        }

        50% {
            fill-opacity: .52;
            stroke-opacity: 1;
        }
    }

    .saz-blob:hover,
    .saz-blob.selected {
        animation: none;
    }
}

/* ---- intel panel ---- */
.intel {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, var(--panel-2), var(--panel));
    display: flex;
    flex-direction: column
}

.tabs {
    display: flex;
    border-bottom: 1px solid var(--line);
    background: #091217
}

.tab {
    flex: 1;
    font-family: var(--f-disp);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .18em;
    text-transform: uppercase;
    background: none;
    border: 0;
    border-bottom: 2px solid transparent;
    color: var(--hud-dim);
    padding: 9px 8px;
    cursor: pointer;
    transition: color .15s, border-color .15s;
}

.tab:hover {
    color: #cfdce2
}

.tab:focus-visible {
    outline: 2px solid #9fe6ff;
    outline-offset: -2px
}

.tab[aria-selected="true"] {
    color: #fff;
    border-bottom-color: #e8552e
}

.partners {
    grid-column: 1/-1;
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .1em;
    color: var(--hud-dim)
}

.cultural-leader {
    display: flex;
    align-items: center;
    gap: 9px;
    margin: 10px 12px 0;
    padding: 9px 10px;
    border: 1px solid rgba(143, 176, 189, .28);
    background: #0b171e;
    font-family: var(--f-data);
}

.cultural-leader .cl-label {
    font-size: 9px;
    letter-spacing: .13em;
    color: var(--hud-dim);
    text-transform: uppercase;
}

.cultural-leader .cl-flag, .country-flag { line-height: 1; }

.flag-icon {
    width: 16px;
    height: 11px;
    display: inline-block;
    position: relative;
    flex: none;
    vertical-align: -2px;
    border: 1px solid rgba(230, 237, 241, .38);
    background: #46535a;
    overflow: hidden;
}

.flag-ru { background: linear-gradient(to bottom, #fff 0 33.33%, #1d55a5 33.33% 66.66%, #c9303d 66.66%); }
.flag-cn { background: #de2910; }
.flag-cn::after { content: "★"; position: absolute; top: -2px; left: 1px; color: #ffde00; font-size: 8px; }
.flag-il { background: linear-gradient(to bottom, #fff 0 15%, #1f5daa 15% 27%, #fff 27% 73%, #1f5daa 73% 85%, #fff 85%); }
.flag-il::after { content: "✡"; position: absolute; inset: 0; color: #1f5daa; font: 8px/10px Arial, sans-serif; text-align: center; }
.flag-us { background: repeating-linear-gradient(to bottom, #b22234 0 0.85px, #fff 0.85px 1.7px); }
.flag-us::after { content: ""; position: absolute; inset: 0 auto auto 0; width: 7px; height: 5px; background: #3c3b6e; }
.flag-generic::after { content: "?"; position: absolute; inset: 0; color: #fff; font: 700 8px/10px var(--f-data); text-align: center; }

.cultural-leader .cl-name {
    color: #fff;
    font-family: var(--f-disp);
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.econ-settings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 12px;
    margin: 14px 0 18px;
}

.econ-setting {
    border: 1px solid var(--line);
    background: #0b171e;
    padding: 10px;
    font-family: var(--f-data);
    font-size: 10px;
    color: var(--hud-dim);
    letter-spacing: .06em;
    text-transform: uppercase;
}

.econ-setting label { display: block; margin-bottom: 7px; }
.econ-setting input, .econ-setting select { width: 100%; }
.econ-setting output { color: #fff; font-size: 12px; }
.partner-flag-input { width: 38px; text-align: center; }

/* party pies on the map */
#pies {
    pointer-events: none
}

.piedisc {
    fill: #05090c;
    fill-opacity: .5
}

.pieslice {
    stroke: #05090c;
    stroke-width: 1.5;
    stroke-linejoin: round
}

.piering {
    fill: none;
    stroke: #e6edf1;
    stroke-width: 2;
    opacity: .75
}

.partybtns {
    display: flex;
    flex-direction: column;
    gap: 5px
}

.partybtn {
    display: flex;
    align-items: center;
    gap: 9px;
    width: 100%;
    text-align: left;
    cursor: pointer;
    font-family: var(--f-disp);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    background: #0d1a21;
    color: #9fb6c0;
    border: 1px solid #24343d;
    padding: 7px 10px;
    transition: background .15s, color .15s, border-color .15s;
}

.partybtn:hover {
    background: #12222b;
    color: #dbe7ec
}

.partybtn:focus-visible {
    outline: 2px solid #9fe6ff;
    outline-offset: 1px
}

.partybtn[aria-pressed="true"] {
    background: #1b2f3a;
    color: #fff;
    border-color: #4d6b79
}

.partybtn .dot {
    width: 12px;
    height: 12px;
    flex: none;
    border: 1px solid rgba(0, 0, 0, .5)
}

.partybtn .pct {
    margin-left: auto;
    font-family: var(--f-data);
    font-size: 11.5px;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0
}

.segmented {
    display: flex;
    gap: 0;
    margin: 0 0 12px
}

.segbtn {
    flex: 1;
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    background: #0d1a21;
    color: #9fb6c0;
    border: 1px solid #24343d;
    padding: 6px 8px;
    cursor: pointer;
}

.segbtn+.segbtn {
    border-left: 0
}

.segbtn:hover {
    background: #12222b;
    color: #dbe7ec
}

.segbtn:focus-visible {
    outline: 2px solid #9fe6ff;
    outline-offset: -2px
}

.segbtn[aria-pressed="true"] {
    background: #1b2f3a;
    color: #fff;
    border-color: #4d6b79
}

/* one column per partner, each a stack of 50M blocks */
.ctry-chart {
    display: flex;
    gap: 9px;
    align-items: stretch;
    min-height: 214px;
    margin-bottom: 12px
}

.ctry {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    gap: 5px
}

.ctry .cval {
    font-family: var(--f-data);
    font-size: 11px;
    color: #fff;
    font-variant-numeric: tabular-nums
}

.ctry .stack {
    display: flex;
    flex-direction: column-reverse;
    gap: 2px;
    width: 100%
}

.ctry .blk {
    height: 21px;
    border: 1px solid rgba(0, 0, 0, .5);
    box-sizing: border-box
}

.ctry .cname {
    font-family: var(--f-disp);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: #cfdce2;
    text-align: center;
    line-height: 1.1
}

.blocklegend {
    display: flex;
    flex-wrap: wrap;
    gap: 5px 13px;
    margin-bottom: 11px
}

.blocklegend span {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .12em;
    color: var(--hud-dim);
    text-transform: uppercase
}

.ctrylist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 7px
}

.ctrylist li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 1px 10px
}

.ctrylist .cn {
    font-family: var(--f-disp);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .11em;
    text-transform: uppercase;
    color: #e6edf1
}

.ctrylist .cv {
    font-family: var(--f-data);
    font-size: 11.5px;
    color: #fff;
    font-variant-numeric: tabular-nums
}

.ctrylist .cd {
    grid-column: 1/-1;
    font-family: var(--f-data);
    font-size: 11px;
    letter-spacing: .06em;
    color: #b3c4cc
}

.unalloc {
    margin: 12px 0 0;
    font-family: var(--f-data);
    font-size: 10.5px;
    letter-spacing: .1em;
    color: var(--hud-dim);
    line-height: 1.6
}

.unalloc b {
    color: #cfdce2;
    font-weight: 400
}

.aidlist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 11px
}

.aidlist li {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 2px 10px
}

.aidlist .src {
    font-family: var(--f-disp);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .12em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 7px
}

.aidlist .val {
    font-family: var(--f-data);
    font-size: 12.5px;
    color: #fff;
    font-variant-numeric: tabular-nums;
    white-space: nowrap
}

.aidlist .what {
    grid-column: 1/-1;
    font-size: 12.5px;
    color: #b3c4cc;
    line-height: 1.35
}

.aidlist li.major .src {
    color: #e8c15a
}

.intel-head {
    padding: 10px 14px 12px;
    border-bottom: 1px solid var(--line);
    background: #0b141a
}

.desig {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .18em;
    color: var(--hud-dim)
}

.provname {
    font-family: var(--f-disp);
    font-size: 27px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    margin: 3px 0 7px;
    line-height: 1.05
}

.status {
    display: inline-block;
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    padding: 3px 8px;
    border: 1px solid currentColor;
    color: var(--hud)
}

.status.saz {
    color: #f59e0b;
    background: rgba(245, 158, 11, .12)
}

.status.risk {
    color: var(--signal);
    background: rgba(225, 56, 46, .09)
}

.status.closed {
    color: #d9c13c;
    background: rgba(217, 193, 60, .08)
}

.facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1px;
    margin: 0;
    background: var(--line);
    border-bottom: 1px solid var(--line)
}

.fact {
    background: var(--panel);
    padding: 9px 14px
}

.fact dt {
    font-family: var(--f-data);
    font-size: 9.5px;
    letter-spacing: .17em;
    color: var(--hud-dim);
    text-transform: uppercase;
    margin: 0
}

.fact dd {
    margin: 2px 0 0;
    font-family: var(--f-data);
    font-size: 13.5px;
    font-variant-numeric: tabular-nums;
    color: var(--bone)
}

.fact dd.sm {
    font-size: 12px
}

.sect {
    padding: 12px 14px
}

.sect+.sect {
    border-top: 1px solid var(--line)
}

.sect-h {
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .18em;
    color: var(--hud-dim);
    text-transform: uppercase;
    display: flex;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px
}

.settle {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 5px 16px
}

.settle li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--f-data);
    font-size: 12px;
    letter-spacing: .08em;
    color: #cfdce2
}

.settle li .mk {
    color: #e8552e;
    font-size: 11px
}

.settle li.site {
    color: var(--hud-dim)
}

.settle li.site .mk {
    color: #c8917a
}

.settle li.none {
    color: var(--hud-dim);
    font-style: italic
}

.settle li.town .mk {
    color: #d8cfc4;
    font-size: 9px
}

.empbar {
    display: flex;
    height: 14px;
    border: 1px solid #1b2831;
    background: #0f1b22;
    overflow: hidden
}

.empbar i {
    display: block;
    height: 100%;
    transition: width .4s cubic-bezier(.2, .7, .2, 1)
}

.emplist {
    list-style: none;
    margin: 9px 0 0;
    padding: 0;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px 14px
}

.emplist li {
    display: flex;
    align-items: center;
    gap: 7px;
    font-family: var(--f-data);
    font-size: 11.5px;
    letter-spacing: .06em;
    color: #cfdce2;
    font-variant-numeric: tabular-nums
}

.emplist li b {
    margin-left: auto;
    color: #fff;
    font-weight: 400
}

.emplist li.zero {
    color: var(--hud-dim)
}

.emplist li.zero b {
    color: var(--hud-dim)
}

.rows {
    display: flex;
    flex-direction: column;
    gap: 11px
}

.row {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 3px 10px;
    align-items: baseline
}

.row-name {
    font-family: var(--f-disp);
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 7px
}

.swatch {
    width: 9px;
    height: 9px;
    flex: none;
    display: inline-block
}

.row-val {
    font-family: var(--f-data);
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    color: #fff;
    white-space: nowrap
}

.row-val .u {
    color: var(--hud-dim);
    font-size: 10px;
    letter-spacing: .05em
}

.track {
    grid-column: 1/-1;
    position: relative;
    height: 9px;
    background: #0f1b22;
    border: 1px solid #1b2831
}

.track.stack {
    display: flex;
    gap: 1px
}

.bar {
    display: block;
    height: 100%;
    transition: width .45s cubic-bezier(.2, .7, .2, 1)
}

.seg {
    display: block;
    height: 100%
}

.mean {
    position: absolute;
    top: -3px;
    bottom: -3px;
    width: 1px;
    background: #7d97a3;
    opacity: .7
}

.row-sub {
    grid-column: 1/-1;
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .12em;
    color: var(--hud-dim);
    display: flex;
    justify-content: space-between;
    gap: 10px
}

.rank {
    color: #9fb6c0
}

.note {
    margin: 0;
    font-size: 12.5px;
    color: #b3c4cc
}

/* ---- party profile: mocked-up logo slot, no real emblem on file ---- */
.partyhead {
    display: flex;
    gap: 16px;
    align-items: flex-start
}

.party-logo-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: none
}

.party-logo {
    width: 58px;
    height: 58px;
    border: 1.5px dashed currentColor;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--f-disp);
    font-weight: 700;
    font-size: 18px;
    letter-spacing: .03em
}

.party-logo-cap {
    font-family: var(--f-data);
    font-size: 7px;
    letter-spacing: .1em;
    color: var(--hud-dim);
    text-transform: uppercase;
    text-align: center;
    line-height: 1.35
}

.party-facts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 14px;
    margin: 0;
    flex: 1;
    min-width: 0
}

.party-facts dt {
    font-family: var(--f-data);
    font-size: 9px;
    letter-spacing: .14em;
    color: var(--hud-dim);
    text-transform: uppercase;
    margin: 0
}

.party-facts dd {
    margin: 1px 0 8px;
    font-family: var(--f-data);
    font-size: 11.5px;
    color: #cfdce2;
    letter-spacing: .02em;
    line-height: 1.3
}

.party-facts dd.wide {
    grid-column: 1/-1
}

/* ---- politics backend: full-viewport working paper, opened from .backendrow ---- */
.backdrop {
    position: fixed;
    inset: 0;
    background: rgba(4, 9, 12, .92);
    display: none;
    align-items: flex-start;
    justify-content: center;
    padding: 36px 20px;
    z-index: 30;
    overflow-y: auto
}

.backdrop.show {
    display: flex
}

.backpanel {
    background: var(--panel);
    border: 1px solid var(--line);
    width: 100%;
    max-width: 980px;
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 72px)
}

.backpanel-h {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 20px;
    border-bottom: 1px solid var(--line);
    background: var(--panel-2)
}

.backpanel-h h2 {
    font-family: var(--f-disp);
    font-size: 18px;
    font-weight: 700;
    letter-spacing: .09em;
    text-transform: uppercase;
    margin: 0;
    color: #eaf1f4
}

.backpanel-h p {
    margin: 3px 0 0;
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .08em;
    color: var(--hud-dim);
    text-transform: uppercase;
    max-width: 60ch
}

.backpanel-body {
    padding: 6px 20px 22px;
    overflow-y: auto
}

.backpanel-body h3 {
    font-family: var(--f-disp);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .13em;
    text-transform: uppercase;
    color: #dfe9ee;
    margin: 22px 0 4px;
    border-bottom: 1px solid rgba(143, 176, 189, .2);
    padding-bottom: 5px
}

.backpanel-body p.lede {
    margin: 0 0 12px;
    font-size: 12px;
    color: #b3c4cc;
    max-width: 78ch
}

/* ---- party compass ---- */
.compassrow {
    display: flex;
    gap: 20px;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 14px
}

.compasssvg {
    width: 380px;
    height: 380px;
    flex: none;
    background: #0b141a;
    border: 1px solid var(--line);
    touch-action: none
}

.compass-dot {
    cursor: grab
}

.compass-dot:active {
    cursor: grabbing
}

.compass-dot-circle {
    stroke: #0a1218;
    stroke-width: 1.5;
    transition: stroke .15s, stroke-width .15s
}

.compass-dot-circle.sel {
    stroke: #fff;
    stroke-width: 2.5
}

.compass-label {
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .03em;
    fill: #dfe9ee;
    paint-order: stroke;
    stroke: #04080a;
    stroke-width: 3px;
    pointer-events: none
}

.compass-grid {
    stroke: rgba(143, 176, 189, .16);
    stroke-width: 1
}

.compass-grid.mid {
    stroke: rgba(143, 176, 189, .36)
}

.compass-border {
    fill: none;
    stroke: var(--line);
    stroke-width: 1.5
}

.compass-axis {
    font-family: var(--f-data);
    font-size: 9px;
    letter-spacing: .1em;
    fill: var(--hud-dim);
    text-transform: uppercase
}

.compassaside {
    flex: 1;
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.compass-picked {
    border: 1px solid var(--line);
    background: var(--panel);
    padding: 10px 12px
}

.compass-picked-name {
    font-family: var(--f-disp);
    font-size: 14px;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: #eaf1f4;
    margin-bottom: 6px
}

.compass-picked-vals {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-family: var(--f-data);
    font-size: 11px;
    color: #cfdce2
}

.compass-picked-vals b {
    color: #fff;
    font-weight: 400;
    font-variant-numeric: tabular-nums
}

.compass-sliderlabel {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .07em;
    color: var(--hud-dim);
    text-transform: uppercase
}

.compass-sliderlabel input[type=range] {
    width: 100%;
    accent-color: #9fe6ff
}

.compass-sliderval {
    align-self: flex-end;
    font-size: 12px;
    color: #fff;
    font-variant-numeric: tabular-nums
}

.compass-swatch {
    width: 11px;
    height: 11px;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, .5)
}

.compasstable-row {
    cursor: pointer
}

.compasstable-row:hover td {
    background: rgba(143, 176, 189, .06)
}

.compasstable-row.sel td {
    background: rgba(159, 230, 255, .08)
}

.compass-dot-sm {
    stroke-width: 1;
    opacity: .8
}

.compass-dot-sm.sel {
    stroke: #fff;
    stroke-width: 2.2;
    opacity: 1
}

.compass-fieldlabel {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .07em;
    color: var(--hud-dim);
    text-transform: uppercase
}

.compass-textinput {
    font-family: var(--f-data);
    font-size: 12px;
    letter-spacing: .02em;
    color: #fff;
    background: #0d1a21;
    border: 1px solid #24343d;
    padding: 6px 8px;
    text-transform: none
}

.compass-textinput:focus {
    outline: 2px solid #9fe6ff;
    outline-offset: 1px
}

.compass-splitgrid {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 5px 8px;
    margin: 8px 0;
    align-items: center
}

.compass-splitgrid label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--f-data);
    font-size: 10.5px;
    color: #cfdce2
}

.compass-splitgrid label i {
    width: 8px;
    height: 8px;
    flex: none;
    display: inline-block;
    border: 1px solid rgba(0, 0, 0, .5)
}

.compass-splitgrid input {
    width: 60px;
    font-family: var(--f-data);
    font-size: 11.5px;
    color: #fff;
    background: #0d1a21;
    border: 1px solid #24343d;
    padding: 4px 6px;
    text-align: right
}

.compass-sum {
    font-family: var(--f-data);
    font-size: 10.5px;
    letter-spacing: .05em;
    color: var(--hud-dim);
    text-transform: uppercase;
    margin-bottom: 8px
}

.compass-sum.bad {
    color: #e2734a
}

.compass-warn {
    font-family: var(--f-data);
    font-size: 10.5px;
    letter-spacing: .02em;
    color: #e2734a;
    background: rgba(226, 84, 58, .12);
    border: 1px solid rgba(226, 84, 58, .4);
    padding: 7px 9px;
    margin-bottom: 8px;
    text-transform: none
}

.compass-warn.good {
    color: #7fd4a0;
    background: rgba(127, 212, 160, .12);
    border-color: rgba(127, 212, 160, .4)
}

.stakebar {
    display: flex;
    height: 11px;
    border: 1px solid #1b2831;
    background: #0f1b22;
    overflow: hidden;
    min-width: 70px
}

.stakebar .seg {
    display: block;
    height: 100%
}

.backtable {
    width: 100%;
    border-collapse: collapse;
    font-family: var(--f-data);
    font-size: 11px
}

.backtable th {
    text-align: left;
    font-size: 9px;
    letter-spacing: .1em;
    text-transform: uppercase;
    color: var(--hud-dim);
    font-weight: 400;
    padding: 4px 8px 6px
}

.backtable td {
    padding: 5px 8px;
    border-top: 1px solid rgba(35, 51, 60, .6);
    color: #cfdce2;
    vertical-align: middle
}

.stakename {
    color: #e6edf1
}

.stakename small {
    display: block;
    color: var(--hud-dim);
    font-size: 9px;
    letter-spacing: .06em;
    margin-top: 1px
}

.leadchip {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap
}

.leadchip i {
    width: 8px;
    height: 8px;
    flex: none
}

.numcell {
    font-variant-numeric: tabular-nums;
    white-space: nowrap
}

.regionblock {
    margin-top: 20px
}


/* ---- economy backend styling ---- */
.econ-alert-banner {
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 3px;
    font-family: var(--f-disp);
    font-size: 12px;
    letter-spacing: .04em;
    line-height: 1.4;
}
.econ-alert-banner.err {
    background: #301717;
    border: 1px solid #733030;
    color: #fca8a8;
}
.econ-alert-banner.ok {
    background: #142e1e;
    border: 1px solid #2d6b43;
    color: #a4f2c0;
}

.econ-kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
    margin-bottom: 20px;
}
.econ-kpi-card {
    background: #0b171f;
    border: 1px solid rgba(143, 176, 189, .22);
    padding: 12px 14px;
    border-radius: 3px;
    display: flex;
    flex-direction: column;
}
.econ-kpi-card .kpi-lbl {
    font-family: var(--f-disp);
    font-size: 10px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--hud-dim);
    margin-bottom: 4px;
}
.econ-kpi-card .kpi-val {
    font-family: var(--f-data);
    font-size: 20px;
    font-weight: 700;
    color: #fff;
}
.econ-kpi-card .kpi-sub {
    font-family: var(--f-disp);
    font-size: 11px;
    color: var(--hud);
    margin-top: 2px;
}
.econ-kpi-card.surplus .kpi-val { color: #8ee3a4; }
.econ-kpi-card.deficit .kpi-val { color: #f79292; }

.econ-section-h {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}
.econ-section-h h3 {
    margin: 0 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}
.econ-section-h .subtext {
    font-size: 12px;
    color: var(--hud-dim);
}

.econ-chips-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 16px;
}
.econ-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 3px;
    font-family: var(--f-data);
    font-size: 11px;
    border: 1px solid rgba(255,255,255,.1);
}
.econ-chip.balanced {
    background: #0f241a;
    border-color: #27593c;
    color: #9fe6bd;
}
.econ-chip.unallocated {
    background: #2b2311;
    border-color: #6b5220;
    color: #ffd88a;
}
.econ-chip.overallocated {
    background: #301717;
    border-color: #733030;
    color: #fca8a8;
}

.econ-chart-wrapper {
    background: #081116;
    border: 1px solid rgba(143, 176, 189, .25);
    border-radius: 4px;
    padding: 16px;
    margin-bottom: 20px;
}
.econ-chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 14px;
    flex-wrap: wrap;
    gap: 10px;
}
.econ-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-size: 11.5px;
}
.econ-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}
.econ-legend i.swatch {
    width: 10px;
    height: 10px;
    border-radius: 1px;
}

.econ-partners-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 14px;
    align-items: end;
    min-height: 220px;
    padding-top: 10px;
}
.econ-partner-col {
    background: #0c1820;
    border: 1px solid rgba(35, 51, 60, .9);
    border-radius: 3px;
    padding: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    transition: border-color 0.15s ease, background 0.15s ease;
}
.econ-partner-col.drag-over {
    border-color: #8fb0bd !important;
    background: #142834 !important;
}
.econ-partner-col .col-val {
    font-family: var(--f-data);
    font-size: 13px;
    font-weight: 700;
    color: var(--hud-hi);
    margin-bottom: 6px;
}
.econ-partner-stack {
    display: flex;
    flex-direction: column-reverse;
    gap: 4px;
    width: 100%;
    min-height: 90px;
    background: rgba(4, 9, 12, 0.6);
    border: 1px dashed rgba(143, 176, 189, .2);
    border-radius: 2px;
    padding: 6px;
    margin-bottom: 8px;
}
.econ-block-item {
    height: 20px;
    border-radius: 2px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 6px;
    font-family: var(--f-disp);
    font-size: 10px;
    font-weight: 700;
    color: #0d1a22;
    cursor: grab;
    user-select: none;
    box-shadow: 0 1px 3px rgba(0,0,0,0.4);
    transition: transform .1s ease, filter .1s ease;
}
.econ-block-item:hover {
    filter: brightness(1.15);
    transform: translateY(-1px);
}
.econ-block-item:active {
    cursor: grabbing;
}
.econ-block-item .del-btn {
    background: transparent;
    border: none;
    color: rgba(0,0,0,0.6);
    font-weight: bold;
    font-size: 12px;
    cursor: pointer;
    padding: 0 2px;
    line-height: 1;
}
.econ-block-item .del-btn:hover {
    color: #000;
}

.econ-partner-col .col-name-input {
    background: transparent;
    border: 1px solid transparent;
    color: #fff;
    font-family: var(--f-disp);
    font-size: 12px;
    font-weight: 700;
    text-align: center;
    width: 100%;
    margin-bottom: 6px;
    padding: 2px;
}
.econ-partner-col .col-name-input:focus {
    border-color: var(--hud);
    background: #071015;
}
.econ-partner-col .partner-tools {
    display: flex;
    gap: 4px;
    width: 100%;
    margin-top: 4px;
}
.econ-partner-col .partner-tools select {
    flex: 1;
    font-size: 10px;
    padding: 2px 4px;
    background: #071015;
    color: var(--hud);
    border: 1px solid rgba(143, 176, 189, .3);
    border-radius: 2px;
    cursor: pointer;
}
.econ-partner-col .del-partner-btn {
    background: transparent;
    border: 1px solid rgba(143, 176, 189, .2);
    color: var(--hud-dim);
    font-size: 11px;
    padding: 2px 5px;
    border-radius: 2px;
    cursor: pointer;
}
.econ-partner-col .del-partner-btn:hover {
    border-color: #8c3b3b;
    color: #fca8a8;
    background: #211212;
}

.econ-unalloc-box {
    margin-top: 12px;
    font-family: var(--f-data);
    font-size: 11px;
    color: var(--hud-dim);
    border-top: 1px solid rgba(143, 176, 189, .15);
    padding-top: 8px;
}

.econ-table-wrap {
    overflow-x: auto;
    margin-bottom: 14px;
}
.econ-prod-table th, .econ-import-table th {
    background: #0c1820;
}
.econ-prod-table td input[type="number"], .econ-import-table td input[type="number"] {
    width: 75px;
    background: #050b0e;
    border: 1px solid rgba(143, 176, 189, .3);
    color: #fff;
    font-family: var(--f-data);
    font-size: 12px;
    padding: 3px 5px;
    text-align: right;
    border-radius: 2px;
}
.econ-import-table td input[type="text"] {
    width: 100%;
    background: #050b0e;
    border: 1px solid rgba(143, 176, 189, .3);
    color: #fff;
    font-family: var(--f-disp);
    font-size: 11.5px;
    padding: 3px 6px;
    border-radius: 2px;
}

/* ---- campaign control panel ---- */
.campaign-panel {
    background: #081116;
    border: 1px solid rgba(143, 176, 189, .25);
    border-radius: 4px;
    padding: 16px;
    margin: 18px 0 24px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.campaign-panel-h {
    margin-bottom: 12px;
}

.campaign-panel-h h3 {
    margin: 0 0 4px 0 !important;
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.campaign-scopes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 14px;
    background: #0b171f;
    padding: 12px;
    border: 1px solid rgba(35, 51, 60, .8);
    border-radius: 3px;
}

.scope-field label {
    display: block;
    font-family: var(--f-disp);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--hud);
    margin-bottom: 5px;
}

.searchable-select-wrap {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.searchable-select-wrap select {
    cursor: pointer;
}

.campaign-table {
    margin-bottom: 14px;
}

.campaign-table th {
    background: #0c1820;
}

.campaign-party-cell {
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    font-family: var(--f-disp);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .05em;
}

.campaign-party-cell .dot {
    width: 10px;
    height: 10px;
    flex: none;
}

.campaign-party-cell .pct-badge {
    font-family: var(--f-data);
    font-size: 10px;
    color: var(--hud-dim);
    margin-left: auto;
}

.swing-btn-group {
    display: inline-flex;
    gap: 4px;
    align-items: center;
}

.swing-btn {
    padding: 3px 6px;
    font-family: var(--f-data);
    font-size: 10px;
    font-weight: 600;
    border-radius: 2px;
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .12s;
    background: #13222a;
    color: #cfdce2;
}

.swing-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 5px rgba(0,0,0,0.4);
}

.swing-btn.major-boost {
    background: #143522;
    color: #72e09c;
    border-color: #23633d;
}
.swing-btn.major-boost:hover {
    background: #1b4b30;
    color: #98ffbe;
}

.swing-btn.minor-boost {
    background: #112920;
    color: #8ed0aa;
    border-color: #1a4a35;
}
.swing-btn.minor-boost:hover {
    background: #17382c;
    color: #aff0cc;
}

.swing-btn.minor-loss {
    background: #331f18;
    color: #f1a995;
    border-color: #552d21;
}
.swing-btn.minor-loss:hover {
    background: #46271e;
    color: #ffc2b3;
}

.swing-btn.major-loss {
    background: #3d1615;
    color: #ff8c87;
    border-color: #6b2422;
}
.swing-btn.major-loss:hover {
    background: #541d1b;
    color: #ffa5a1;
}

.campaign-queue-wrap {
    background: #0a141b;
    border: 1px solid rgba(143, 176, 189, .2);
    border-radius: 3px;
    padding: 10px 14px;
}

.campaign-queue-h {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
    flex-wrap: wrap;
    gap: 8px;
    font-family: var(--f-disp);
    font-size: 12px;
    letter-spacing: .05em;
    text-transform: uppercase;
    color: var(--hud);
}

.campaign-actions {
    display: flex;
    gap: 8px;
}

.campaign-queue-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    min-height: 28px;
    align-items: center;
}

.queue-empty {
    color: var(--hud-dim);
    font-style: italic;
    font-size: 11px;
}

.swing-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #152731;
    border: 1px solid rgba(143, 176, 189, .3);
    border-radius: 3px;
    padding: 2px 8px;
    font-family: var(--f-data);
    font-size: 10.5px;
    color: #e6edf1;
}

.swing-chip.pos {
    border-color: #2a6f4e;
    background: #0f281e;
    color: #8ed0aa;
}

.swing-chip.neg {
    border-color: #792e2b;
    background: #2b1312;
    color: #f1a995;
}

.swing-chip .chip-del {
    cursor: pointer;
    color: var(--hud-dim);
    font-weight: 700;
    padding: 0 2px;
}

.swing-chip .chip-del:hover {
    color: #ff6b6b;
}

.edit-cat-btn {
    background: transparent;
    border: 1px solid rgba(143, 176, 189, .25);
    color: var(--hud);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 9.5px;
    border-radius: 2px;
    margin-left: 6px;
    transition: all .12s;
}
.edit-cat-btn:hover {
    background: #1a2f3b;
    color: #fff;
    border-color: var(--hud);
}

.recalc-vectors-btn {
    background: #142330 !important;
    border-color: #2b4c68 !important;
    color: #8ec4ec !important;
    transition: all 0.2s ease;
}
.recalc-vectors-btn:hover {
    background: #1d354a !important;
    border-color: #4376a3 !important;
    color: #c0e2fa !important;
}
.recalc-vectors-btn.needs-recalc {
    background: #332612 !important;
    border-color: #8c6323 !important;
    color: #ffd27d !important;
    box-shadow: 0 0 8px rgba(255, 187, 51, 0.4);
    animation: pulse-recalc 1.6s infinite ease-in-out;
}
@keyframes pulse-recalc {
    0%, 100% { box-shadow: 0 0 6px rgba(255, 187, 51, 0.3); border-color: #8c6323; }
    50% { box-shadow: 0 0 14px rgba(255, 187, 51, 0.7); border-color: #d69836; }
}

.regionblock-h {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 10px;
    margin-bottom: 5px
}

.regionblock-h b {
    font-family: var(--f-disp);
    font-size: 12.5px;
    letter-spacing: .09em;
    text-transform: uppercase;
    color: #dfe9ee
}

.regionblock-h span {
    font-family: var(--f-data);
    font-size: 9.5px;
    letter-spacing: .08em;
    color: var(--hud-dim);
    text-transform: uppercase
}

@media (max-width:720px) {

    .backtable th:nth-child(2),
    .backtable td:nth-child(2) {
        display: none
    }
}

/* ---- settlement dossier ---- */
.backrow {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 6px
}

.backlink {
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--hud);
    background: none;
    border: 0;
    padding: 0;
    cursor: pointer;
}

.backlink:hover {
    color: #fff;
    text-decoration: underline
}

.backendrow {
    padding: 9px 14px;
    border-bottom: 1px solid var(--line);
    background: #0b141a
}

.backendrow .backlink {
    font-weight: 700;
    letter-spacing: .14em
}

.kindchip {
    font-family: var(--f-data);
    font-size: 9.5px;
    letter-spacing: .18em;
    text-transform: uppercase;
    padding: 2px 7px;
    border: 1px solid currentColor;
    color: #9fb6c0;
}

.kindchip.city {
    color: #e8552e
}

.kindchip.town {
    color: #d8cfc4
}

.kindchip.site {
    color: #d9c13c
}

.kindchip.line {
    color: #e0cf9a
}

.kindchip.saz,
.kindchip.zone {
    color: #f59e0b;
    border-color: #f59e0b;
    background: rgba(245, 158, 11, .12)
}

.stoplist {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 0
}

.stoplist li {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--f-data);
    font-size: 12.5px;
    letter-spacing: .07em;
    color: #cfdce2;
    padding: 3px 0;
    position: relative
}

.stoplist li::before {
    content: "";
    width: 9px;
    height: 9px;
    flex: none;
    border-radius: 50%;
    background: #0d1a21;
    border: 2px solid #e0cf9a
}

.stoplist li:not(:last-child)::after {
    content: "";
    position: absolute;
    left: 4px;
    top: 19px;
    width: 1px;
    height: calc(100% - 10px);
    background: #4a5a63
}

.stoplist li.site::before {
    border-radius: 0;
    border-color: #d9c13c
}

.stoplist li.town::before {
    width: 7px;
    height: 7px;
    border-radius: 0;
    border-color: #d8cfc4
}

.stoplist li .in {
    margin-left: auto;
    color: var(--hud-dim);
    font-size: 10.5px;
    letter-spacing: .1em
}

.role {
    font-family: var(--f-data);
    font-size: 11.5px;
    letter-spacing: .1em;
    color: var(--hud);
    margin: 0 0 2px
}

.notable {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 6px
}

.notable li {
    display: flex;
    gap: 9px;
    font-size: 12.5px;
    color: #c6d4da;
    line-height: 1.35;
}

.notable li::before {
    content: "\25B8 ";
    color: var(--hud-dim);
    flex: none
}

.notable li.none {
    color: var(--hud-dim);
    font-style: italic
}

.notable li::before {}

.editbtn {
    font-family: var(--f-disp);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    background: #0d1a21;
    color: #9fb6c0;
    border: 1px solid #24343d;
    padding: 5px 12px;
    cursor: pointer;
}

.editbtn:hover {
    background: #12222b;
    color: #dbe7ec
}

.editbtn.primary {
    background: #1d2c1f;
    color: #dff3e2;
    border-color: #4e7a55
}

.editrow {
    display: flex;
    gap: 7px;
    margin-top: 11px;
    flex-wrap: wrap
}

.field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 9px
}

.field label {
    font-family: var(--f-data);
    font-size: 9.5px;
    letter-spacing: .17em;
    text-transform: uppercase;
    color: var(--hud-dim);
}

.field input,
.field textarea {
    background: #0a1218;
    color: #e6edf1;
    border: 1px solid #24343d;
    padding: 6px 8px;
    font-family: var(--f-ui);
    font-size: 12.5px;
    width: 100%;
    resize: vertical;
}

.field input:focus,
.field textarea:focus {
    outline: 1px solid #6f96a6;
    border-color: #6f96a6
}

.field input.big {
    font-family: var(--f-disp);
    font-size: 20px;
    letter-spacing: .06em;
    text-transform: uppercase
}

.field textarea {
    min-height: 76px
}

.hint-inline {
    font-family: var(--f-data);
    font-size: 9.5px;
    letter-spacing: .12em;
    color: var(--hud-dim);
    margin: 0
}

[hidden] {
    display: none !important
}

.foot {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #0c161d, #080f14);
    padding: 9px 12px;
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap
}

.foot-label {
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .2em;
    color: var(--hud-dim);
    text-transform: uppercase
}

.filters {
    display: flex;
    gap: 6px;
    flex-wrap: wrap
}

.showcase-controls { display: flex; gap: 4px; align-items: center; }
.showcase-btn {
    width: 24px;
    height: 24px;
    padding: 0;
    font-size: 0;
    border: 1px solid #334650;
    background: #0b151b;
    cursor: pointer;
}
.showcase-btn::before { content: ""; display: block; width: 6px; height: 6px; margin: auto; border-radius: 50%; background: #718b97; }
.showcase-btn:hover { border-color: #8fb0bd; background: #14232b; }
.showcase-btn.showcase-back::before { width: 6px; height: 6px; border: solid #718b97; border-width: 0 0 1px 1px; border-radius: 0; background: none; transform: rotate(45deg); }
.showcase-btn.showcase-back:hover::before { border-color: #e6edf1; }

.showcase-rail-glow {
    stroke: #e1382e !important;
    filter: drop-shadow(0 0 6px #e1382e) drop-shadow(0 0 14px rgba(225, 56, 46, .85));
    animation: showcaseRailGlow 1.1s ease-in-out infinite alternate;
}
.showcase-rail-bed { stroke: #6d1515 !important; opacity: 1 !important; }
.showcase-block-out { animation: showcaseBlockOut .09s ease-in forwards; }
@keyframes showcaseBlockOut { to { opacity: 0; transform: translateY(-8px) scale(.7); } }
@keyframes showcaseRailGlow { to { filter: drop-shadow(0 0 11px #ff3d2e) drop-shadow(0 0 24px rgba(225, 56, 46, 1)); } }

.fbtn {
    font-family: var(--f-disp);
    font-size: 13.5px;
    font-weight: 700;
    letter-spacing: .15em;
    text-transform: uppercase;
    background: #0d1a21;
    color: #9fb6c0;
    border: 1px solid #24343d;
    padding: 6px 13px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 7px;
    transition: background .15s, color .15s, border-color .15s
}

.fbtn:hover {
    background: #12222b;
    color: #dbe7ec
}

.fbtn:focus-visible {
    outline: 2px solid #9fe6ff;
    outline-offset: 1px
}

.fbtn[aria-pressed="true"] {
    background: #172a34;
    color: #fff;
    border-color: #4d6b79
}

.legend {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .13em;
    color: var(--hud-dim);
    font-variant-numeric: tabular-nums
}

.legend[hidden] {
    display: none
}

.ramp {
    width: 110px;
    height: 8px;
    border: 1px solid #24343d
}

.keynote {
    font-family: var(--f-data);
    font-size: 10px;
    letter-spacing: .13em;
    color: var(--hud-dim);
    display: flex;
    align-items: center;
    gap: 7px
}

.keyline {
    display: inline-block;
    width: 24px;
    height: 0;
    border-top: 2px solid #05080a;
    box-shadow: 0 0 0 1px rgba(143, 176, 189, .35)
}

.keyriver {
    display: inline-block;
    width: 24px;
    height: 0;
    border-top: 2px solid #cfe9f5
}

.keyrail {
    display: inline-block;
    width: 24px;
    height: 0;
    border-top: 2px dashed #e8dcc8
}

.editgroup {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap
}

.lockbtn[aria-pressed="true"] {
    background: #1d2c1f;
    color: #dff3e2;
    border-color: #4e7a55
}

#lockHint {
    min-width: 14ch
}

#saveBtn[disabled],
#resetBtn[disabled] {
    opacity: .4;
    cursor: default;
    pointer-events: none
}

/* fallback when the host cannot hand over a file */
.sheet {
    position: absolute;
    inset: 0;
    background: rgba(4, 9, 12, .9);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 9
}

.sheet.show {
    display: flex
}

.sheet-inner {
    background: var(--panel);
    border: 1px solid var(--line);
    padding: 16px;
    max-width: 640px;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px
}

.sheet h2 {
    font-family: var(--f-disp);
    font-size: 19px;
    letter-spacing: .14em;
    text-transform: uppercase;
    margin: 0;
    font-weight: 700
}

.sheet p {
    margin: 0;
    font-size: 12.5px;
    color: #b3c4cc
}

.sheet textarea {
    width: 100%;
    height: 190px;
    background: #0a1218;
    color: #cfdce2;
    border: 1px solid var(--line);
    font-family: var(--f-data);
    font-size: 11px;
    padding: 8px;
    resize: vertical
}

.sheet-row {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    align-items: center;
}

.dropzone-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10, 18, 24, 0.88);
    border: 3px dashed #8fb0bd;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.dropzone-overlay.active {
    display: flex;
}

.dropzone-box {
    background: var(--panel-2);
    border: 1px solid var(--hud);
    padding: 24px 36px;
    text-align: center;
    border-radius: 4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.6);
}

.dropzone-box h3 {
    margin: 0 0 8px 0;
    color: var(--bone);
    font-family: var(--f-disp);
    font-size: 20px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.dropzone-box p {
    margin: 0;
    color: var(--hud);
    font-size: 13px;
}

@media (max-width:1120px) {
    .stage {
        grid-template-columns: 1fr
    }
}

@media (max-width:640px) {
    .clockblock {
        display: none
    }

    .facts {
        grid-template-columns: 1fr
    }
}

/* sign-in / account links under the clock */
.userbox {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    font-family: var(--f-data);
    font-size: 11px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.userbox a, .userbox button {
    color: var(--hud);
    text-decoration: none;
    background: none;
    border: 0;
    padding: 0;
    font: inherit;
    letter-spacing: inherit;
    text-transform: inherit;
    cursor: pointer;
}
.userbox a:hover, .userbox button:hover { color: var(--bone); text-decoration: underline; }
.userbox form { margin: 0; }
