:root {
    --bg: #0c0e11;
    --bg-raise: #161a1f;
    --panel: #1c2127;
    --panel-2: #242b33;
    --line: #3a434d;
    --text: #f3efe6;
    --muted: #9aa4ae;
    --orange: #ff8a14;
    --orange-2: #ffb15a;
    --yellow: #f0c014;
    --green: #9adf46;
    --red: #ff5d4a;
    --amber: #ffb020;
    --nuclear: #c6f25a;
    --shadow: 0 18px 50px rgba(0, 0, 0, .35);
    --font: "Titillium Web", "Segoe UI", sans-serif;
    --display: "Saira", "Arial Narrow", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    min-height: 100vh;
    color: var(--text);
    font-family: var(--font);
    background-color: var(--bg);
    background-image:
        radial-gradient(ellipse at 0% -10%, rgba(255, 138, 20, .16), transparent 36%),
        linear-gradient(rgba(255, 255, 255, .025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, .025) 1px, transparent 1px);
    background-size: auto, 56px 56px, 56px 56px;
    padding-left: 14px;
}
a { color: var(--orange-2); text-decoration: none; }
a:hover { color: white; }
button, input, select { font: inherit; color: inherit; }
img { max-width: 100%; }

.hazard-rail {
    position: fixed;
    inset: 0 auto 0 0;
    width: 14px;
    background: repeating-linear-gradient(-45deg, var(--yellow) 0 8px, #141414 8px 16px);
    z-index: 5;
}

.topbar {
    position: sticky;
    top: 0;
    z-index: 4;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 14px 28px;
    background: rgba(12, 14, 17, .92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(8px);
}
.topbar::after {
    content: "";
    position: absolute;
    left: 0; right: 0; bottom: -1px;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--orange), transparent);
}
.brand { display: flex; align-items: center; color: var(--text); line-height: 0; }
.brand-logo { display: block; height: 54px; width: auto; max-width: min(280px, 46vw); object-fit: contain; object-position: left center; }
.eyebrow {
    display: block;
    margin: 0;
    color: var(--orange);
    font-family: var(--display);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: .18em;
    text-transform: uppercase;
}
.nav-toggle {
    display: none;
    flex: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    padding: 12px 10px;
    border: 1px solid var(--line);
    background: #12161b;
    cursor: pointer;
}
.nav-toggle > span:not(.sr) {
    display: block;
    height: 2px;
    background: var(--text);
    transform-origin: center;
    transition: transform .18s ease, opacity .18s ease;
}
.topbar.is-open .nav-toggle > span:nth-child(2) { transform: translateY(7px) rotate(45deg); }
.topbar.is-open .nav-toggle > span:nth-child(3) { opacity: 0; }
.topbar.is-open .nav-toggle > span:nth-child(4) { transform: translateY(-7px) rotate(-45deg); }
.nav-toggle:hover, .nav-toggle:focus-visible { border-color: var(--orange); }
.nav-toggle:focus-visible { outline: 2px solid var(--orange); outline-offset: 2px; }
.top-nav { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 18px; }
.top-nav a[aria-current="page"] { color: var(--orange); }
.top-nav a { font-family: var(--display); letter-spacing: .08em; text-transform: uppercase; font-size: 14px; }

.shell { width: min(1120px, calc(100% - 36px)); margin: 0 auto; padding: 28px 0 48px; }
.page-head, .panel-head, .rename-form { display: flex; justify-content: space-between; gap: 18px; align-items: end; }
.panel-head { padding: 14px 14px 0; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: .02em; margin: 0; }
h1 { font-size: 42px; line-height: 1; text-transform: uppercase; }
h2 { font-size: 22px; text-transform: uppercase; }
.lede { color: var(--muted); max-width: 62ch; line-height: 1.45; }
.colophon { color: var(--muted); text-align: center; font-size: 13px; padding: 0 16px 28px; }

.panel, .balance-card, .factory-card, .machine, .gate-card, .story {
    position: relative;
    background:
        linear-gradient(var(--orange), var(--orange)) 0 0 / 14px 2px no-repeat,
        linear-gradient(var(--orange), var(--orange)) 0 0 / 2px 14px no-repeat,
        linear-gradient(var(--orange), var(--orange)) 100% 0 / 14px 2px no-repeat,
        linear-gradient(var(--orange), var(--orange)) 100% 0 / 2px 14px no-repeat,
        linear-gradient(var(--orange), var(--orange)) 0 100% / 14px 2px no-repeat,
        linear-gradient(var(--orange), var(--orange)) 0 100% / 2px 14px no-repeat,
        linear-gradient(var(--orange), var(--orange)) 100% 100% / 14px 2px no-repeat,
        linear-gradient(var(--orange), var(--orange)) 100% 100% / 2px 14px no-repeat,
        linear-gradient(180deg, var(--panel-2), var(--panel));
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 14px;
    border: 1px solid var(--line);
    background: #12161b;
    color: var(--text);
    cursor: pointer;
    font-family: var(--display);
    letter-spacing: .06em;
    text-transform: uppercase;
    text-decoration: none;
}
.btn:hover { border-color: var(--orange); color: white; }
.btn-primary { background: var(--orange); color: #1a1208; border-color: #ffd7a4; font-weight: 700; }
.btn-primary:hover { background: var(--orange-2); color: #1a1208; }
.btn-ghost { background: transparent; }
.btn.is-on { border-color: var(--orange); color: var(--orange-2); }

label, legend { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 14px; }
input, select {
    width: 100%;
    background: #101418;
    border: 1px solid var(--line);
    padding: 10px 12px;
    outline: none;
}
input:focus, select:focus { border-color: var(--orange); }
input[type="range"] { padding: 0; accent-color: var(--orange); }
.hint { color: var(--muted); font-size: 13px; line-height: 1.4; }
.stack { display: grid; gap: 8px; }

.flash { padding: 12px 14px; border: 1px solid var(--line); background: #1a2214; }
.flash-bad { background: #2a1514; border-color: var(--red); color: #ffd0c8; }
.flash-ok { border-color: #4e6a32; }

.gate { display: grid; min-height: 100vh; }
.gate .shell { display: grid; place-items: center; }
.gate-card { width: min(460px, 100%); padding: 28px; }
.gate-card h1 { font-size: 36px; margin: 8px 0; }

.create-panel, .config-panel { padding: 22px; margin: 22px 0; }
.create-form, .machine-form { display: grid; }
.kind-pick { border: 0; margin: 8px 0 16px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kind-card { margin: 0; }
.kind-card input { position: absolute; opacity: 0; }
.kind-card span {
    display: block;
    min-height: 100%;
    padding: 14px;
    border: 1px solid var(--line);
    background: #12161b;
}
.kind-card strong { display: block; font-family: var(--display); letter-spacing: .08em; text-transform: uppercase; }
.kind-card small { display: block; color: var(--muted); margin-top: 6px; line-height: 1.4; }
.kind-card input:checked + span { border-color: var(--orange); box-shadow: inset 3px 0 0 var(--orange); }
.kind-card input:focus-visible + span { outline: 2px solid var(--orange); }
.kind-nuclear input:checked + span { border-color: var(--nuclear); box-shadow: inset 3px 0 0 var(--nuclear); }

.factory-list, .balance { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; margin-top: 18px; }
.factory-card { display: grid; }
.factory-link { display: block; padding: 16px 16px 8px; color: inherit; }
.factory-card h2 { margin: 8px 0; }
.factory-power { font-family: var(--display); font-size: 32px; margin: 0; }
.factory-power small, .remain small { font-size: 14px; color: var(--muted); letter-spacing: .08em; }
.factory-story, .factory-meta { color: var(--muted); }
.factory-card form { padding: 0 16px 16px; }
.factory-card.kind-nuclear { --orange: var(--nuclear); }
.badge {
    display: inline-block;
    padding: 2px 8px;
    border: 1px solid var(--orange);
    color: var(--orange);
    font-family: var(--display);
    letter-spacing: .12em;
    text-transform: uppercase;
    font-size: 12px;
}

.story { padding: 18px 18px 8px; margin-top: 8px; }
.story h2 { font-size: 28px; text-transform: none; }
.story ul { margin: 10px 0 8px; padding-left: 18px; color: var(--muted); }
.story li { margin: 4px 0; }
.story-ok { box-shadow: inset 4px 0 0 var(--green), var(--shadow); }
.story-warn, .story-idle { box-shadow: inset 4px 0 0 var(--amber), var(--shadow); }
.story-bad { box-shadow: inset 4px 0 0 var(--red), var(--shadow); }

.balance-card { padding: 14px 16px 16px; }
.remain { font-family: var(--display); font-size: 34px; margin: 6px 0; }
.tone-ok .remain { color: var(--green); }
.tone-warn .remain, .tone-idle .remain { color: var(--amber); }
.tone-bad .remain { color: var(--red); }
.split { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.meter { height: 8px; background: #0e1216; border: 1px solid #2c343c; }
.meter span { display: block; height: 100%; background: linear-gradient(90deg, var(--orange), var(--yellow)); }
.tone-bad .meter span { background: var(--red); }
.tone-ok .meter span { background: linear-gradient(90deg, #6ea832, var(--green)); }

.add-bar { display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0; }
.split-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.field-panel { display: none; margin-top: 8px; }
.field-panel.is-on { display: block; }
.clock-box.is-off { display: none; }
.flow-row { display: grid; grid-template-columns: 1.3fr .8fr 1fr auto; gap: 8px; margin-bottom: 8px; }
.preview { min-height: 0; margin: 12px 0; padding: 12px; background: #101418; border: 1px dashed var(--line); }
.preview strong { display: block; font-family: var(--display); font-size: 20px; margin-bottom: 6px; }
.preview ul { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.preview .tone-ok { color: var(--green); }
.preview .tone-bad { color: var(--red); }
.preview .tone-warn { color: var(--amber); }

.btn { gap: 8px; }
.game-icon {
    width: 64px;
    height: 64px;
    object-fit: contain;
    flex: none;
    filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .45));
}
.game-icon-sm { width: 34px; height: 34px; }
.game-icon-xs { width: 22px; height: 22px; margin-left: 6px; vertical-align: -6px; filter: none; }
.game-icon-plate { mix-blend-mode: screen; filter: none; }
.kind-card > span { display: flex; gap: 12px; align-items: center; }
.kind-card .kind-copy { display: block; }
.kind-card .game-icon { width: 78px; height: 78px; }
.factory-link { display: flex; gap: 14px; align-items: center; }
.factory-link .game-icon { width: 88px; height: 88px; }
.balance-card .eyebrow { display: flex; align-items: center; gap: 8px; }
.balance-card .game-icon { width: 40px; height: 40px; }
.group-title { display: flex; align-items: center; gap: 10px; margin: 22px 0 8px; color: var(--orange-2); }
.machine-id { display: flex; gap: 12px; align-items: center; }
.panel-head h2 { display: flex; align-items: center; gap: 12px; }
.machine-group { display: grid; gap: 10px; }
.machine {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr auto;
    gap: 12px;
    align-items: center;
    padding: 12px 14px;
}
.machine h3 { font-size: 18px; text-transform: none; }
.machine p { margin: 4px 0 0; color: var(--muted); }
.qty { color: var(--orange); }
.machine-actions { display: flex; gap: 8px; align-items: center; }
.rename-form { display: flex; flex-wrap: wrap; align-items: end; gap: 8px; min-width: min(100%, 340px); }
.rename-form label { width: 100%; margin-top: 0; }
.rename-form input { flex: 1 1 180px; width: auto; min-width: 0; }
.rename-form .btn { flex: 0 0 auto; width: auto; }
.empty { color: var(--muted); padding: 12px 0; }

.sr {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    border: 0;
}
.supervision { margin: 22px 0 8px; }
.supervision-head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 8px 18px; }
.supervision-head h2 { margin: 0; }
.supervision-head p { margin: 0; color: var(--muted); max-width: 62ch; }
.mk-legend { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 12px 0; }
.mk-legend li, .conveyor {
    --mk: #9aa3ad;
}
.mk-legend li[data-mk="1"], .conveyor[data-mk="1"] { --mk: #9aa3ad; }
.mk-legend li[data-mk="2"], .conveyor[data-mk="2"] { --mk: #e07a1f; }
.mk-legend li[data-mk="3"], .conveyor[data-mk="3"] { --mk: #3d8fd4; }
.mk-legend li[data-mk="4"], .conveyor[data-mk="4"] { --mk: #c46be0; }
.mk-legend li[data-mk="5"], .conveyor[data-mk="5"] { --mk: #3cba86; }
.mk-legend li[data-mk="6"], .conveyor[data-mk="6"] { --mk: #f4f1ea; }
.mk-legend li[data-mk="p1"], .conveyor[data-mk="p1"] { --mk: #d4a24a; }
.mk-legend li[data-mk="p2"], .conveyor[data-mk="p2"] { --mk: #ffe08a; }
.mk-legend li {
    padding: 3px 8px;
    border-radius: 999px;
    border: 1px solid var(--mk);
    color: var(--mk);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .04em;
}
.net { margin: 0 0 16px; padding: 12px; border: 1px solid rgba(255,255,255,.08); border-radius: 14px; background: rgba(0,0,0,.22); }
.net h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; font-size: 14px; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); }
.net-scroll { overflow-x: auto; padding-bottom: 6px; }
.net-row { display: flex; align-items: center; gap: 8px; min-width: max-content; }
.net-stack { display: flex; flex-direction: column; gap: 10px; }
.net-hop { display: flex; align-items: center; gap: 8px; }
.plan-card {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 156px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0,0,0,.4);
    border: 1px solid rgba(255,255,255,.1);
}
.plan-card .game-icon { width: 48px; height: 48px; }
.plan-card h3 { margin: 0; font-size: 14px; line-height: 1.15; text-transform: none; letter-spacing: 0; }
.plan-card h3 a { color: inherit; }
.plan-card h3 a:hover { color: var(--orange); }
.plan-mark { margin: 0; color: var(--orange); font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; }
.plan-clock, .plan-power, .plan-card p { margin: 0; color: var(--muted); font-size: 12px; }
.plan-power { color: var(--amber); }
.plan-missing, .plan-rest { color: var(--muted); min-width: 120px; }
.plan-rest h3 { color: var(--green); }
.plan-rest p { color: var(--text); font-size: 18px; font-weight: 700; }
.junction {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 76px;
    min-height: 64px;
    padding: 8px;
    text-align: center;
    border: 1px dashed var(--orange);
    border-radius: 12px;
    background: rgba(255, 138, 20, .08);
}
.junction span { font-size: 12px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--orange); }
.junction small { color: var(--muted); font-size: 11px; }
.conveyor { width: 104px; display: flex; flex-direction: column; gap: 3px; }
.conveyor-top { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; }
.conveyor-top b { color: var(--mk); }
.conveyor-top span, .conveyor small { color: var(--muted); }
.conveyor-track {
    position: relative;
    height: 8px;
    border-radius: 99px;
    background: rgba(255,255,255,.08);
    overflow: hidden;
}
.conveyor-track i {
    display: block;
    width: var(--fill);
    height: 100%;
    background: repeating-linear-gradient(90deg, var(--mk) 0 8px, transparent 8px 14px);
    background-size: 28px 100%;
    animation: belt-move .9s linear infinite;
}
.conveyor[data-mk="1"] .conveyor-track i { animation-duration: 1.15s; }
.conveyor[data-mk="2"] .conveyor-track i { animation-duration: .9s; }
.conveyor[data-mk="3"] .conveyor-track i { animation-duration: .7s; }
.conveyor[data-mk="4"] .conveyor-track i { animation-duration: .55s; }
.conveyor[data-mk="5"] .conveyor-track i { animation-duration: .42s; }
.conveyor[data-mk="6"] .conveyor-track i { animation-duration: .32s; }
.conveyor[data-state="over"], .conveyor[data-state="starved"] { outline: 1px solid var(--red); border-radius: 8px; padding: 2px; }
.conveyor[data-state="starved"] .conveyor-top b { color: var(--red); }
.conveyor-want { color: var(--red) !important; }
.mk-form select {
    width: 100%;
    margin: 0;
    padding: 2px 6px;
    border-radius: 999px;
    border: 1px solid var(--mk);
    background: rgba(0,0,0,.45);
    color: var(--text);
    font-size: 11px;
}
@keyframes belt-move { to { background-position: 28px 0; } }
@media (prefers-reduced-motion: reduce) {
    .conveyor-track i { animation: none; }
}

@media (max-width: 980px) {
    .calc-layout { grid-template-columns: 1fr; }
}
@media (max-width: 860px) {
    h1 { font-size: 32px; }
    .page-head, .kind-pick, .split-fields, .machine, .flow-row, .calc-layout { display: grid; grid-template-columns: 1fr; }
    .panel-head { display: flex; flex-wrap: wrap; }
    .rename-form { display: flex; }
    .machine-actions { justify-content: flex-start; }
    .topbar { padding: 12px 14px; }
    .brand { min-width: 0; flex: 1; }
    .brand-logo { height: 40px; }
    .nav-toggle { display: inline-flex; }
    .top-nav {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 6px 0 8px;
        background: var(--bg);
        border-bottom: 1px solid var(--line);
        box-shadow: var(--shadow);
    }
    .topbar.is-open .top-nav { display: flex; }
    .top-nav a {
        padding: 14px 18px;
        border-top: 1px solid rgba(255, 255, 255, .06);
    }
    .top-nav a[aria-current="page"] { box-shadow: inset 3px 0 0 var(--orange); }
    .shell { width: min(1120px, calc(100% - 20px)); }
    .live-split, .prod-list { grid-template-columns: 1fr; }
}

.live-pill {
    margin: 0;
    width: max-content;
    padding: 8px 12px;
    border: 1px solid var(--green);
    color: var(--green);
    font-family: var(--display);
    letter-spacing: .08em;
    text-transform: uppercase;
    font-size: 13px;
}
.live-pill.is-bad { border-color: var(--red); color: var(--red); }
.elevator-panel { margin-top: 18px; padding: 16px; }
.elevator-score { margin: 0; color: var(--orange); font-family: var(--display); letter-spacing: .06em; }
.part { margin-top: 14px; }
.part-top { display: flex; justify-content: space-between; gap: 12px; }
.part-meta { margin: 6px 0 0; color: var(--muted); font-size: 13px; }
.bar { height: 10px; margin-top: 6px; background: #101418; border-radius: 99px; overflow: hidden; }
.bar span { display: block; height: 100%; background: linear-gradient(90deg, #6ea832, var(--green)); }
.chart-panel { margin-top: 18px; padding: 16px; }
.span-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.span-pick button {
    padding: 4px 10px;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: transparent;
    color: var(--muted);
    font-family: var(--display);
    letter-spacing: .06em;
    cursor: pointer;
}
.span-pick button.is-on { border-color: var(--orange); color: var(--text); background: rgba(255, 138, 20, .16); }
.power-chart { width: 100%; height: auto; margin-top: 8px; border-radius: 8px; }
.chart-bg { fill: #e7ebef; }
.power-chart text { fill: #3c4650; font-size: 12px; font-family: var(--font); }
.grid-line { stroke: rgba(20, 24, 28, .16); }
.line-capacity { fill: none; stroke: #8b939c; stroke-width: 2; }
.line-max { fill: none; stroke: #3b7cff; stroke-width: 2; }
.line-production { fill: none; stroke: #1b1e22; stroke-width: 2.25; }
.area-consumed { fill: rgba(240, 138, 18, .28); stroke: none; }
.line-consumed { fill: none; stroke: #f08a12; stroke-width: 2.75; }
.chart-key { display: flex; flex-wrap: wrap; gap: 14px; margin: 8px 0 0; color: var(--muted); font-size: 13px; }
.chart-key span::before {
    content: "";
    display: inline-block;
    width: 16px;
    height: 3px;
    margin-right: 6px;
    vertical-align: middle;
    background: currentColor;
}
.key-consumed { color: #f08a12; }
.key-max { color: #3b7cff; }
.key-production { color: var(--text); }
.key-production::before { background: #1b1e22; box-shadow: 0 0 0 1px #d7dde3; }
.key-capacity { color: #8b939c; }
.circuit-list { margin: 8px 0 0; padding-left: 18px; color: var(--muted); }
.prod-panel { margin-top: 18px; padding: 16px; }
.prod-panel .lede { margin: 6px 0 0; }
.prod-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 12px; }
.prod-item {
    padding: 12px;
    border: 1px solid var(--line);
    border-left: 4px solid #7eb6ff;
    background: var(--panel-2);
}
.prod-item.tone-surplus { border-left-color: var(--green); }
.prod-item.tone-deficit { border-left-color: var(--red); }
.prod-item-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.prod-item-head em {
    font-style: normal;
    font-family: var(--display);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.tone-surplus .prod-item-head em,
.tone-surplus > p { color: var(--green); }
.tone-balanced .prod-item-head em,
.tone-balanced > p { color: #7eb6ff; }
.tone-deficit .prod-item-head em,
.tone-deficit > p { color: var(--red); }
.prod-meter { display: grid; gap: 6px; margin-top: 8px; }
.prod-meter div { display: grid; grid-template-columns: 76px 1fr 52px; gap: 8px; align-items: center; }
.prod-meter span { color: var(--muted); font-size: 12px; }
.prod-meter b {
    display: block;
    height: 8px;
    min-width: 2px;
    border-radius: 99px;
    background: currentColor;
}
.tone-surplus .prod-meter b { color: var(--green); }
.tone-balanced .prod-meter b { color: #7eb6ff; }
.tone-deficit .prod-meter b { color: var(--red); }
.prod-meter em { font-style: normal; text-align: right; font-variant-numeric: tabular-nums; }
.prod-item > p { margin: 8px 0 0; font-size: 13px; }
.pioneer-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-top: 18px;
    padding-top: 10px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 13px;
}
.pioneer-foot .is-on { color: var(--green); }
.map-jump { margin: 14px 0 0; }

.plan-page {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100dvh;
}
.plan-page .shell {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.plan-page .colophon { display: none; }
.plan-page #plan-root {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}
.plan-page #plan-root > .empty,
.plan-page #plan-root > .story {
    margin: auto;
    padding: 24px;
}
.live-plan { margin-top: 8px; }
.flow-balances { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.flow-balance, .idle-card {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 180px;
    padding: 8px 10px;
    border-radius: 12px;
    background: rgba(0, 0, 0, .28);
    border: 1px solid rgba(255, 255, 255, .08);
}
.flow-balance img, .idle-card img { width: 36px; height: 36px; object-fit: contain; }
.flow-balance img.is-power { mix-blend-mode: screen; }
.flow-balance b, .idle-card b { display: block; font-size: 14px; line-height: 1.15; }
.flow-balance small, .idle-card small { color: var(--muted); font-size: 12px; }
.flow-balance.is-final { border-color: rgba(154, 223, 70, .45); }
.flow-balance.is-low { border-color: rgba(255, 93, 74, .55); }
.flow-balance.is-low small { color: var(--red); }
.flow-viewport {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    border: 0;
    border-radius: 0;
    background:
        radial-gradient(circle at 20% 0%, rgba(255, 177, 90, .06), transparent 42%),
        rgba(0, 0, 0, .22);
    cursor: grab;
    touch-action: none;
}
.flow-viewport.is-panning,
body.is-flow-panning { cursor: grabbing; }
body.is-flow-panning { user-select: none; }
.flow-world {
    width: max-content;
    min-width: 100%;
    transform-origin: 0 0;
    will-change: transform;
}
.flow-board { position: relative; width: max-content; min-width: 100%; min-height: 160px; }
.flow-svg { position: absolute; inset: 0; overflow: visible; pointer-events: none; z-index: 0; }
.flow-svg path {
    transition: opacity .18s ease, stroke-width .18s ease, filter .18s ease;
}
.flow-cols { position: relative; z-index: 1; display: flex; align-items: flex-start; gap: 320px; padding: 16px 28px 40px; }
.flow-col { position: relative; width: 252px; min-height: 120px; }
.flow-card {
    position: absolute;
    left: 0;
    top: 0;
    width: 252px;
    padding: 12px 14px 14px;
    border-radius: 14px;
    background: rgba(18, 22, 26, .96);
    border: 1px solid rgba(255, 255, 255, .1);
    box-shadow: 0 8px 18px rgba(0, 0, 0, .28);
    cursor: pointer;
    transition: opacity .18s ease, border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}
.flow-card:hover { border-color: rgba(255, 177, 90, .55); }
.flow-card.is-low { border-color: rgba(255, 93, 74, .55); }
.flow-card.is-wait { border-color: rgba(255, 138, 20, .85); box-shadow: 0 0 0 1px rgba(255, 138, 20, .28), 0 8px 18px rgba(0, 0, 0, .28); }
.flow-card.is-stop { border-color: rgba(255, 93, 74, .9); box-shadow: 0 0 0 1px rgba(255, 93, 74, .28), 0 8px 18px rgba(0, 0, 0, .28); }
.flow-card.is-boosted:not(.is-wait):not(.is-stop) { border-color: rgba(255, 177, 90, .55); }
.flow-card-top { display: flex; gap: 10px; align-items: center; }
.flow-card .game-icon { width: 58px; height: 58px; }
.flow-card h3 { margin: 0; font-size: 16px; line-height: 1.15; text-transform: none; letter-spacing: 0; }
.flow-settings { display: flex; flex-wrap: wrap; gap: 4px; margin: 5px 0 0; }
.flow-chip {
    display: inline-flex;
    align-items: center;
    padding: 2px 7px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, .14);
    background: rgba(255, 255, 255, .04);
    color: var(--muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .02em;
}
.flow-chip.is-clock { color: var(--orange-2); border-color: rgba(255, 177, 90, .45); }
.flow-chip.is-shard { color: #7eb6ff; border-color: rgba(126, 182, 255, .45); }
.flow-chip.is-sloop { color: #d47be8; border-color: rgba(212, 123, 232, .45); }
.flow-chip.is-wait { color: var(--orange); border-color: rgba(255, 138, 20, .55); background: rgba(255, 138, 20, .12); }
.flow-chip.is-stop { color: var(--red); border-color: rgba(255, 93, 74, .55); background: rgba(255, 93, 74, .12); }
.flow-meter { height: 4px; margin-top: 9px; background: rgba(255, 255, 255, .08); border-radius: 99px; overflow: hidden; }
.flow-meter span { display: block; height: 100%; background: var(--green); }
.flow-card.is-wait .flow-meter span { background: var(--orange); }
.flow-card.is-stop .flow-meter span,
.flow-card.is-low .flow-meter span { background: var(--red); }
.flow-io { display: flex; justify-content: space-between; gap: 10px; margin-top: 9px; }
.flow-side { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.flow-side-out { align-items: flex-end; text-align: right; }
.flow-pin { display: flex; align-items: center; gap: 4px; }
.flow-side-out .flow-pin { flex-direction: row-reverse; }
.flow-pin img { width: 26px; height: 26px; object-fit: contain; }
.flow-pin.is-power img { mix-blend-mode: screen; }
.flow-pin.is-idle { opacity: .72; }
.flow-pin.is-idle b { color: var(--muted); font-weight: 600; font-size: 11px; }
.flow-pin b { display: block; font-size: 13px; font-variant-numeric: tabular-nums; line-height: 1.1; }
.flow-pin small { display: block; color: var(--muted); font-size: 10px; font-weight: 600; }
.flow-svg path.is-ghost { opacity: .45; }
.flow-tag.is-ghost { opacity: .55; filter: grayscale(.35); }
.idle-card .flow-settings { margin-top: 3px; }
.idle-card.is-set { border-color: rgba(255, 177, 90, .35); }
.flow-board.is-focus .flow-card:not(.is-on) { opacity: .28; }
.flow-board.is-focus .flow-card.is-on {
    border-color: #ffb15a;
    box-shadow: 0 0 0 1px rgba(255, 177, 90, .55), 0 12px 28px rgba(0, 0, 0, .4);
    transform: translateY(-1px);
}
.flow-board.is-focus .flow-svg path:not(.is-on) { opacity: .1; }
.flow-board.is-focus .flow-svg path.is-on {
    opacity: 1;
    stroke-width: 3.6;
    filter: drop-shadow(0 0 4px rgba(255, 177, 90, .55));
}
.flow-board.is-focus .flow-tag:not(.is-on) { opacity: .12; }
.flow-board.is-focus .flow-tag.is-on {
    opacity: 1;
    z-index: 4;
    width: 28px;
    height: 28px;
    border-color: #ffb15a;
    box-shadow: 0 0 10px rgba(255, 177, 90, .45);
}
.flow-hint { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
.flow-tag {
    position: absolute;
    z-index: 2;
    width: 24px;
    height: 24px;
    transform: translate(-50%, -50%);
    border-radius: 6px;
    background: #12161a;
    border: 1px solid rgba(255, 255, 255, .2);
    object-fit: contain;
    transition: opacity .18s ease, width .18s ease, height .18s ease, border-color .18s ease;
    pointer-events: none;
}
.idle-box { margin-top: 16px; }
.idle-box summary { cursor: pointer; color: var(--orange-2); font-weight: 700; }
.idle-grid { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.plan-status { margin: 10px 0 0; color: var(--muted); font-size: 13px; }

.map-page {
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100dvh;
}
.map-page .shell {
    flex: 1;
    min-height: 0;
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
    height: auto;
}
.map-page .colophon { display: none; }
.map-stage {
    position: relative;
    height: 100%;
    min-height: 0;
    border: 0;
    background: #071016;
    box-shadow: none;
}
#world-map { height: 100%; background: #071016; }
#world-map img.leaflet-tile[src^="data:"] { opacity: 0; }
#world-map .leaflet-container { font-family: var(--font); background: #071016; }
#world-map .leaflet-bar { border: 1px solid var(--line); box-shadow: none; }
#world-map .leaflet-bar a {
    background: var(--panel);
    color: var(--text);
    border-bottom-color: var(--line);
}
#world-map .leaflet-bar a:hover { background: var(--panel-2); color: white; }
#world-map .leaflet-control-attribution {
    background: rgba(12, 14, 17, .82);
    color: var(--muted);
}
#world-map .leaflet-control-attribution a { color: var(--orange-2); }
.map-roster {
    position: absolute;
    z-index: 500;
    top: 12px;
    left: 12px;
    width: min(280px, calc(100% - 70px));
    max-height: calc(100% - 24px);
    overflow: auto;
    padding: 12px;
    background: rgba(22, 26, 31, .94);
    border: 1px solid var(--line);
}
.map-roster h2 { font-size: 16px; }
.roster-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.roster-top .live-pill { font-size: 11px; padding: 4px 8px; }
.map-layers {
    margin: 14px 0 0;
    padding: 10px 0 0;
    border: 0;
    border-top: 1px solid rgba(255,255,255,.08);
    display: grid;
    gap: 4px;
}
.map-layers legend {
    margin: 0 0 8px;
    padding: 0;
    width: auto;
    float: none;
    color: var(--orange);
    font-family: var(--display);
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.map-layer {
    display: grid;
    grid-template-columns: 18px 22px minmax(0, 1fr);
    align-items: center;
    column-gap: 10px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid transparent;
    color: var(--text);
    cursor: pointer;
}
.map-layer:hover { border-color: var(--line); background: rgba(255,255,255,.04); }
.map-layer input {
    width: 15px;
    height: 15px;
    margin: 0;
    accent-color: var(--orange);
}
.map-layer img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
}
.map-layer span {
    font-size: 14px;
    line-height: 1.2;
}
.map-sprite {
    background: none !important;
    border: 0 !important;
}
.map-sprite img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(0 1px 2px rgba(0,0,0,.85));
    pointer-events: none;
}
.map-sprite img.is-faded { opacity: .38; filter: grayscale(.35) drop-shadow(0 1px 2px rgba(0,0,0,.7)); }
.roster-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.roster-actions .btn { min-height: 32px; padding: 4px 10px; font-size: 12px; }
.roster-list { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.roster-list button {
    width: 100%;
    text-align: left;
    padding: 8px;
    border: 1px solid transparent;
    background: transparent;
    cursor: pointer;
}
.roster-list button:hover, .roster-list button.is-active { border-color: var(--line); background: rgba(255,255,255,.04); }
.roster-list strong { display: block; }
.roster-list small { color: var(--muted); }
.roster-list .is-on strong { color: var(--green); }
.roster-list .is-dead strong { color: var(--red); }
.map-note { margin: 8px 0 0; color: var(--muted); font-size: 12px; }
.pin-icon { background: none; border: 0; }
.pin { width: 132px; display: flex; flex-direction: column; align-items: center; }
.pin-arrow { width: 22px; height: 22px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.8)); }
.pin-label {
    margin-top: 2px;
    padding: 1px 6px;
    background: rgba(12, 14, 17, .88);
    border: 1px solid rgba(255,255,255,.16);
    font-family: var(--display);
    font-size: 12px;
    letter-spacing: .04em;
    white-space: nowrap;
}
.pin.is-off { opacity: .72; }
.pin.is-on .pin-arrow { filter: drop-shadow(0 0 6px currentColor); }
@media (prefers-reduced-motion: no-preference) {
    .pin.is-on .pin-arrow { animation: pin-pulse 1.6s ease-in-out infinite; }
}
@keyframes pin-pulse {
    50% { opacity: .45; }
}
.map-tip {
    background: #161a1f;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 0;
    box-shadow: none;
    font-family: var(--font);
    font-size: 13px;
}
.map-tip::before { border-top-color: var(--line); }
@media (max-width: 860px) {
    .map-roster { max-height: 46%; }
}

.calc-layout {
    display: grid;
    grid-template-columns: minmax(300px, 440px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
    margin-top: 8px;
}
.calc-panel, .calc-log { padding: 18px; }
.calc-log .panel-head { padding: 0; }
.calc-screen {
    margin-bottom: 14px;
    padding: 14px 14px 10px;
    background: #101418;
    border: 1px solid var(--line);
}
.calc-expr {
    width: 100%;
    padding: 0;
    border: 0;
    background: transparent;
    text-align: right;
    font-family: var(--display);
    font-size: 28px;
    letter-spacing: .02em;
}
.calc-expr:focus { border: 0; outline: none; }
.calc-result {
    min-height: 52px;
    margin: 8px 0 0;
    text-align: right;
    font-family: var(--display);
    font-size: 42px;
    line-height: 1;
    color: var(--green);
    font-variant-numeric: tabular-nums;
}
.calc-result.is-partial, .calc-result.is-wait { color: var(--muted); }
.calc-result.is-bad { color: var(--red); font-size: 22px; }
.calc-memory {
    margin: 8px 0 0;
    text-align: right;
    color: var(--orange-2);
    font-family: var(--display);
    letter-spacing: .06em;
}
.calc-pad {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
}
.calc-key {
    width: 100%;
    min-height: 58px;
    font-size: 22px;
}
.calc-key-op { color: var(--orange-2); }
.calc-key-eq {
    background: var(--orange);
    color: #1a1208;
    border-color: #ffd7a4;
    font-weight: 700;
}
.calc-key-eq:hover { background: var(--orange-2); color: #1a1208; }
.calc-key-mem { font-size: 16px; }
.calc-key:disabled { opacity: .4; cursor: default; }
.calc-panel .hint { margin: 12px 0 0; }
.calc-history {
    list-style: none;
    margin: 14px 0 0;
    padding: 0;
    display: grid;
    gap: 8px;
    max-height: 640px;
    overflow: auto;
}
.calc-history li {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: start;
}
.calc-entry {
    min-width: 0;
    display: grid;
    gap: 6px;
}
.calc-recall {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: baseline;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid var(--line);
    background: #101418;
    color: inherit;
    font: inherit;
    text-align: left;
    cursor: pointer;
}
.calc-recall:hover { border-color: var(--orange); }
.calc-recall-expr { color: var(--muted); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calc-recall-result {
    font-family: var(--display);
    font-size: 22px;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}
.calc-note { min-width: 0; }
.calc-note-text,
.calc-note-add {
    display: block;
    width: 100%;
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: var(--orange-2);
    font: inherit;
    font-size: 13px;
    text-align: left;
    cursor: pointer;
}
.calc-note-add { color: var(--muted); }
.calc-note-text:hover,
.calc-note-add:hover { color: var(--orange); }
.calc-note-form {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
}
.calc-note-form input {
    flex: 1 1 160px;
    min-width: 0;
    width: auto;
    padding: 6px 8px;
    font-size: 13px;
}
.calc-note-form .btn {
    flex: 0 0 auto;
    width: auto;
    min-height: 0;
    padding: 6px 10px;
}
.calc-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding-top: 10px;
}
.calc-meta time { color: var(--muted); font-size: 12px; white-space: nowrap; }
.calc-log .empty { margin: 14px 0 0; }
@media (max-width: 860px) {
    .prod-list { grid-template-columns: 1fr; }
}

.hub {
    margin-top: 12px;
    background: #4a4f55;
    color: #f4f1ea;
    border: 1px solid #2c3034;
    box-shadow: var(--shadow);
}
.hub-slim .hub-top {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 12px;
    padding: 8px 10px;
    border-bottom: 1px solid #2c3034;
}
.hub-phase {
    margin: 0;
    font-family: var(--display);
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #ffb15a;
    font-size: 12px;
    white-space: nowrap;
}
.hub-score {
    margin: 0;
    color: #f4f1ea;
    font-size: 12px;
}
.hub-ship {
    display: grid;
    gap: 8px;
    padding: 8px 10px;
    background: #171b1f;
    border-bottom: 1px solid #2c3034;
}
.hub-ship .part { margin: 0; }
.hub-ship .part-top {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
}
.hub-ship .part-meta { margin: 4px 0 0; font-size: 12px; color: #c5ccd3; }
.hub-ship .bar { height: 6px; margin-top: 4px; background: #101418; border-radius: 99px; overflow: hidden; }
.hub-ship .bar span { display: block; height: 100%; background: linear-gradient(90deg, #6ea832, var(--green)); }
.hub-tiers { display: flex; flex: 1; overflow-x: auto; gap: 4px; }
.hub-tier {
    flex: 1 0 36px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    min-height: 40px;
    padding: 4px 2px;
    border: 1px solid transparent;
    background: #3a3f44;
    color: #f4f1ea;
    cursor: pointer;
}
.hub-tier strong { font-family: var(--display); font-size: 15px; font-weight: 600; line-height: 1; }
.hub-tier small { color: #ffb15a; font-size: 10px; letter-spacing: .04em; }
.hub-tier svg { width: 12px; height: 12px; fill: #f4f1ea; }
.hub-tier.is-on { background: #f0a024; color: #1a1208; border-color: #ffd28a; }
.hub-tier.is-on small, .hub-tier.is-on svg { color: #1a1208; fill: #1a1208; }
.hub-tier.is-done:not(.is-on) strong { color: #b7e36a; }
.hub-miles {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    padding: 8px 10px;
    background: #3d4248;
}
.hub-mile {
    flex: 0 1 auto;
    min-height: 0;
    padding: 5px 10px;
    border: 1px solid transparent;
    background: #2c3136;
    color: #f4f1ea;
    cursor: pointer;
    text-align: center;
}
.hub-mile img, .hub-mile i, .hub-cost img, .hub-cost i {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display: grid;
    place-items: center;
    font-style: normal;
    font-family: var(--display);
    font-size: 13px;
}
.hub-mile.is-on { background: #f0a024; color: #1a1208; }
.hub-mile.is-done:not(.is-on) { opacity: .55; }
.hub-mile span, .hub-cost span { font-size: 12px; line-height: 1.2; }
.hub-costbar { padding: 8px 10px 10px; background: #2a2f34; }
.hub-costs { display: flex; flex-wrap: wrap; gap: 8px 12px; }
.hub-cost {
    display: grid;
    grid-template-columns: 28px auto;
    grid-template-rows: auto auto;
    column-gap: 8px;
    align-items: center;
    min-width: 140px;
}
.hub-cost img, .hub-cost i { grid-row: 1 / span 2; }
.hub-cost b { font-family: var(--display); font-size: 14px; line-height: 1.1; }
.hub-cost span { color: #c5ccd3; }
.hub-cost.is-done { opacity: .45; }
.hub-cost.is-partial b { color: #ffb15a; }
.hub-locked { padding: 8px 10px 10px; background: #171b1f; }
.hub-kicker { margin: 0 0 6px; color: #ffb15a; letter-spacing: .08em; text-transform: uppercase; font-size: 11px; }
.hub-wait { margin: 0; color: #c5ccd3; font-size: 13px; }
.hub-locked .part { margin-top: 8px; }
.hub-locked .part-top { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.hub-locked .part-meta { margin: 4px 0 0; font-size: 12px; }
.hub-locked .bar { height: 6px; margin-top: 4px; }
@media (max-width: 980px) {
    .calc-layout { grid-template-columns: 1fr; }
}

.pole {
    margin-top: 10px;
    background: linear-gradient(#3a3e42, #2a2d31 18%, #24272a);
    border: 1px solid #15171a;
    border-radius: 4px 4px 8px 8px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 1px 0 rgba(255, 255, 255, .08);
    color: #ececec;
}
.pole-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    padding: 7px 12px;
    background: linear-gradient(#52565b, #3c4044);
    border-bottom: 1px solid #1c1e21;
    font-family: var(--font);
    font-size: 15px;
}
.pole-glyph {
    width: 14px;
    height: 14px;
    border: 2px solid #d5d8db;
    border-radius: 2px;
    box-shadow: inset 0 0 0 2px #3c4044;
}
.pole-bezel { padding: 10px 12px 0; }
.pole-screen {
    display: grid;
    grid-template-columns: 1fr 92px;
    background: #f4f5f4;
    border: 1px solid #1b1d20;
    box-shadow: inset 0 0 0 1px #8d9296;
}
.pole-plot { min-width: 0; background: #f7f8f6; cursor: grab; touch-action: none; }
.pole-plot.is-panning,
body.is-pole-panning { cursor: grabbing; }
body.is-pole-panning { user-select: none; }
.pole-chart { display: block; width: 100%; height: auto; background: #f7f8f6; }
.pole-chart polyline { fill: none; stroke-linejoin: miter; stroke-linecap: square; }
.pole-max { stroke: #4aa3d8; stroke-width: 2.2; }
.pole-production { stroke: #6f767c; stroke-width: 2.4; }
.pole-capacity { stroke: #c5ccd1; stroke-width: 2.6; }
.pole-consumed { stroke: #e8872a; stroke-width: 2.3; }
.pole-now { stroke: #f08a14; stroke-width: 1.6; }
.pole-now-mark { fill: #f08a14; }
.pole-empty { margin: 0; padding: 48px 12px; text-align: center; color: #667; }
.pole-legend {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 3px 16px;
    margin: 0;
    padding: 4px 12px 10px;
    background: #f7f8f6;
    color: #3a4046;
    font-size: 14px;
}
.pole-legend p { display: flex; align-items: center; gap: 6px; margin: 0; min-width: 0; }
.pole-legend i {
    width: 12px;
    height: 12px;
    flex: none;
}
.pole-legend b { font-weight: 700; }
.sw-cons { background: #e8872a; }
.sw-prod { background: #6f767c; }
.sw-cap { background: #c5ccd1; border: 1px solid #9aa1a6; }
.sw-max { background: #4aa3d8; }
.pole-legend p:nth-child(1) b { color: #e07a16; }
.pole-legend p:nth-child(2) b { color: #5c6368; }
.pole-legend p:nth-child(3) b { color: #8b9298; }
.pole-legend p:nth-child(4) b { color: #3d8ec4; }
.pole-bat {
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 8px 8px 0;
    background: #141618;
    color: white;
    border-left: 1px solid #0c0d0e;
    min-width: 92px;
}
.pole-bat.is-open { min-width: 168px; }
.pole-cells { display: flex; flex-direction: column; gap: 5px; }
.pole-cells i { display: block; height: 22px; background: #1c1e20; border: 1px solid #0a0b0c; }
.pole-cells i.is-on { background: #3eb6e4; border-color: #7fd4f2; }
.pole-bat.is-drain .pole-cells i.is-on { background: #f0a024; border-color: #ffd28a; }
.pole-bat.is-charge .pole-cells i.is-on { background: #5ad0ff; border-color: #b8ecff; }
.pole-bat strong {
    font-family: var(--display);
    font-size: 26px;
    font-weight: 600;
    text-align: center;
    line-height: 1;
}
.pole-bat-clock {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin: 0;
    font-variant-numeric: tabular-nums;
    font-size: 13px;
}
.pole-bat-clock.is-idle { color: #9aa4ae; }
.pole-bat svg { width: 16px; height: 16px; fill: currentColor; }
.pole-bat-panel {
    display: grid;
    gap: 4px;
    padding: 6px;
    background: #0c0e10;
    border: 1px solid #2a2f34;
    font-size: 11px;
}
.pole-bat-panel p {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin: 0;
}
.pole-bat-panel span { color: #9aa4ae; }
.pole-bat-panel b { font-weight: 600; text-align: right; }
.pole-chevron {
    margin-top: auto;
    display: grid;
    place-items: center;
    width: 100%;
    height: 28px;
    border: 0;
    background: #3aa4d4;
    color: white;
    font-weight: 700;
    cursor: pointer;
}
.pole-chevron:hover { background: #5bbcde; }
.pole-foot {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 52px;
}
.pole-tab {
    padding: 5px 16px;
    background: #d7d7d7;
    color: #2c2c2c;
    border-radius: 999px;
    font-family: var(--display);
    font-size: 13px;
    letter-spacing: .16em;
    text-transform: uppercase;
    box-shadow: 0 1px 0 rgba(255,255,255,.4), inset 0 -1px 0 rgba(0,0,0,.15);
}
.pole-plate {
    position: absolute;
    right: 16px;
    display: grid;
    gap: 1px;
    min-width: 92px;
    padding: 4px 8px;
    background: #1a1c1e;
    border: 1px solid #6a6e72;
    font-size: 11px;
    line-height: 1.2;
}
.pole-plate b { font-family: var(--display); font-size: 13px; }
.pole-vents {
    height: 46px;
    margin: 0 22px 14px;
    background: repeating-linear-gradient(to bottom, transparent 0 5px, #1a1c1e 5px 9px);
    opacity: .85;
}
.span-pick { margin-top: 18px; align-items: center; }
.zoom-pick {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: auto;
}
.zoom-pick em {
    min-width: 2.6em;
    font-style: normal;
    text-align: center;
    font-family: var(--display);
    letter-spacing: .04em;
    color: var(--muted);
}
.zoom-pick button {
    min-width: 34px;
    padding: 4px 0;
}
.zoom-pick button:disabled { opacity: .35; cursor: default; }
.pole-scale { fill: #5c6368; font-size: 12px; font-family: var(--font); }
@media (max-width: 460px) {
    .pole-screen { grid-template-columns: 1fr; }
    .pole-bat { border-left: 0; border-top: 1px solid #0c0d0e; }
    .pole-cells { flex-direction: row; }
    .pole-cells i { flex: 1; height: 18px; }
    .pole-chevron { display: none; }
    .pole-legend { grid-template-columns: 1fr; }
    .pole-plate { position: static; }
    .pole-foot { flex-direction: column; gap: 8px; padding-bottom: 8px; }
}

.mam-summary {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.mam-summary article {
    padding: 14px 16px;
    background: linear-gradient(180deg, #232930, #1a1f25);
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.mam-summary span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .12em;
    text-transform: uppercase;
}
.mam-summary strong {
    display: block;
    margin-top: 6px;
    font-family: var(--display);
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
}
.mam-summary small { color: #b7c0c8; font-size: 13px; }
.mam-layout {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr) 260px;
    gap: 16px;
    align-items: start;
}
.mam-trees .panel-head, .mam-main .panel-head, .mam-shop .panel-head {
    align-items: center;
}
.mam-tree-list, .mam-nodes {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(70vh, 760px);
    overflow: auto;
    padding: 12px 14px;
}
.mam-tree, .mam-node, .mam-filter {
    appearance: none;
    border: 1px solid #2f363d;
    background: #171b1f;
    color: inherit;
    cursor: pointer;
    text-align: left;
}
.mam-tree {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
}
.mam-tree img, .mam-tree i, .mam-cost img, .mam-cost i, .mam-unlocks img, .mam-unlocks i {
    width: 28px;
    height: 28px;
    object-fit: contain;
    flex: none;
}
.mam-tree i, .mam-cost i, .mam-unlocks i {
    display: grid;
    place-items: center;
    background: #2a3138;
    color: #ffb15a;
    font-style: normal;
    font-weight: 700;
}
.mam-tree span { display: grid; gap: 2px; min-width: 0; }
.mam-tree strong { font-family: var(--display); font-size: 15px; }
.mam-tree small { color: var(--muted); font-size: 12px; }
.mam-tree.is-on, .mam-node.is-on, .mam-filter.is-on {
    background: #f0a024;
    color: #1a1208;
    border-color: #ffd7a4;
}
.mam-tree.is-on small { color: #5a3b10; }
.mam-tree.is-done:not(.is-on) strong { color: #b7e36a; }
.mam-filters { display: flex; flex-wrap: wrap; gap: 6px; }
.mam-filter {
    padding: 6px 10px;
    font-size: 13px;
}
.mam-filter b { font-family: var(--display); }
.mam-filter.is-on b { color: #1a1208; }
.mam-node {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
}
.mam-node span { font-size: 14px; line-height: 1.25; }
.mam-node-done:not(.is-on) { opacity: .72; }
.mam-node-locked:not(.is-on) { border-style: dashed; }
.mam-badge {
    flex: none;
    padding: 3px 8px;
    font-style: normal;
    font-size: 11px;
    letter-spacing: .06em;
    text-transform: uppercase;
    background: #2f363d;
    color: #d7dde3;
}
.mam-badge-done { background: #2f4a22; color: #c8ef8d; }
.mam-badge-open { background: #4a3214; color: #ffc472; }
.mam-badge-locked { background: #3a3030; color: #ffb0a4; }
.mam-detail {
    border-top: 1px solid #2c3034;
    padding: 14px;
    background: #171b1f;
}
.mam-detail-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 14px;
}
.mam-detail-head h2 {
    margin: 0;
    font-family: var(--display);
    font-size: 22px;
    font-weight: 600;
}
.mam-kicker {
    margin: 0 0 4px;
    color: var(--orange);
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
}
.mam-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}
.mam-detail-grid h3, .mam-shop h3 {
    margin: 0 0 10px;
    font-family: var(--display);
    font-size: 14px;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: #c5ccd3;
}
.mam-costs {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}
.mam-cost {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 92px;
    text-align: center;
}
.mam-cost b { font-family: var(--display); font-size: 16px; }
.mam-cost span, .mam-cost small { font-size: 12px; line-height: 1.2; color: #c5ccd3; }
.mam-cost small { color: var(--muted); }
.mam-unlocks, .mam-recipes {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
}
.mam-unlocks li, .mam-recipes li {
    display: flex;
    align-items: center;
    gap: 8px;
}
.mam-empty { margin: 0; color: var(--muted); }
.mam-shop-meta { margin: 0; color: var(--muted); font-size: 13px; }
.mam-shop .mam-costs { padding: 0 14px 8px; }
.mam-shop .hint { padding: 0 14px 14px; }
@media (max-width: 1100px) {
    .mam-layout { grid-template-columns: 1fr; }
    .mam-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .mam-tree-list, .mam-nodes { max-height: none; }
}
@media (max-width: 640px) {
    .mam-summary { grid-template-columns: 1fr; }
    .mam-detail-grid { grid-template-columns: 1fr; }
    .mam-main .panel-head { align-items: stretch; flex-direction: column; }
}

/* Boutique A.W.E.S.O.M.E. */
.boutique-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}
.boutique-top {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(260px, .8fr);
    gap: 16px;
    margin-bottom: 16px;
    align-items: start;
}
.boutique-sink-list {
    display: grid;
    gap: 14px;
    padding: 14px;
}
.boutique-sink {
    padding: 14px;
    background: #171b1f;
    border: 1px solid #2f363d;
}
.boutique-sink-head {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: start;
    margin-bottom: 12px;
}
.boutique-sink-head h3 {
    margin: 0;
    font-family: var(--display);
    font-size: 18px;
    font-weight: 600;
}
.boutique-sink-head strong {
    font-family: var(--display);
    font-size: 28px;
    line-height: 1;
    color: var(--orange-2);
}
.boutique-sink-head small {
    margin-left: 4px;
    font-size: 13px;
    color: var(--muted);
}
.boutique-sink-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 14px;
    margin-bottom: 12px;
}
.boutique-sink-grid span {
    display: block;
    color: var(--muted);
    font-size: 12px;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.boutique-sink-grid b {
    display: block;
    margin-top: 2px;
    font-family: var(--display);
    font-size: 18px;
}
.boutique-progress {
    height: 8px;
    background: #2a3138;
    overflow: hidden;
}
.boutique-progress i {
    display: block;
    height: 100%;
    background: linear-gradient(90deg, var(--orange), var(--yellow));
}
.boutique-progress-lg { height: 12px; margin: 14px 0; }
.boutique-eta {
    margin: 10px 0 0;
    color: #c5ccd3;
    font-size: 13px;
}
.boutique-spark {
    display: block;
    width: 100%;
    height: 48px;
    margin-top: 12px;
}
.boutique-spark polyline {
    fill: none;
    stroke: var(--orange);
    stroke-width: 2;
    stroke-linejoin: round;
    stroke-linecap: round;
}
.boutique-side-body { padding: 14px; }
.boutique-next {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 12px;
    background: #171b1f;
    border: 1px solid #2f363d;
}
.boutique-next img, .boutique-next i {
    width: 42px;
    height: 42px;
    object-fit: contain;
    flex: none;
}
.boutique-next i {
    display: grid;
    place-items: center;
    background: #2a3138;
    color: #ffb15a;
    font-style: normal;
    font-weight: 700;
}
.boutique-next strong {
    display: block;
    font-family: var(--display);
    font-size: 17px;
}
.boutique-next small {
    color: var(--muted);
    font-size: 13px;
}
.boutique-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 10px;
    padding: 12px 14px 16px;
    max-height: min(70vh, 760px);
    overflow: auto;
}
.boutique-item {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 10px 12px;
    background: #171b1f;
    border: 1px solid #2f363d;
}
.boutique-item.is-affordable {
    border-color: #5a7a2e;
    box-shadow: inset 0 0 0 1px rgba(154, 223, 70, .18);
}
.boutique-item-done { opacity: .7; }
.boutique-item-locked { border-style: dashed; }
.boutique-item-icon img, .boutique-item-icon i,
.boutique-inv-row img, .boutique-inv-row i {
    width: 32px;
    height: 32px;
    object-fit: contain;
    flex: none;
}
.boutique-item-icon i, .boutique-inv-row i {
    display: grid;
    place-items: center;
    background: #2a3138;
    color: #ffb15a;
    font-style: normal;
    font-weight: 700;
}
.boutique-item-body { min-width: 0; flex: 1; }
.boutique-item-head {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: start;
}
.boutique-item-head strong {
    font-family: var(--display);
    font-size: 14px;
    line-height: 1.25;
}
.boutique-item-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 8px;
    align-items: center;
    color: #c5ccd3;
    font-size: 12px;
}
.boutique-cost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.boutique-cost img, .boutique-cost i {
    width: 18px;
    height: 18px;
}
.boutique-cost b { font-family: var(--display); color: var(--text); }
.boutique-missing { color: #ffb0a4; }
.boutique-ok { color: #c8ef8d; }
.boutique-inventory .hint { padding: 0 14px 14px; }
.boutique-inv-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-height: min(70vh, 760px);
    overflow: auto;
    padding: 12px 14px 8px;
}
.boutique-inv-row {
    display: grid;
    grid-template-columns: 32px minmax(0, 1fr) auto auto;
    gap: 8px;
    align-items: center;
}
.boutique-inv-name {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 13px;
}
.boutique-inv-row b {
    font-family: var(--display);
    font-size: 14px;
}
.boutique-inv-row em {
    font-style: normal;
    color: var(--orange-2);
    font-size: 12px;
    white-space: nowrap;
}
@media (max-width: 1100px) {
    .boutique-summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .boutique-top, .boutique-layout { grid-template-columns: 1fr; }
    .boutique-items, .boutique-inv-list { max-height: none; }
}
@media (max-width: 640px) {
    .boutique-summary { grid-template-columns: 1fr; }
    .boutique-sink-grid { grid-template-columns: 1fr; }
}

