/*
 * outpost.css — Outpost hub. The content panel (map or grid, depending on
 * sub-view) fills the whole page by default — Outpost's own nav (Build/
 * stock/ALL-MY-SUBST/Shop) lives in a floating drawer (js/pages/outpost.js's
 * drawerView()) opened via the "☰" button, not a permanent sidebar column,
 * per explicit request ("default langsung fullscreen dengan menu-menu
 * tersedia" — content fills the screen by default, menu reachable on
 * demand). Cards/slot-cells/material-cells are flat rgba(58,36,16,a) boxes —
 * the established "nested-on-tan" convention. Tier/position/material accent
 * colors are the same darkened palette used everywhere else in NEW_UI
 * (never the original scene's neon set).
 *
 * Design tokens (2026-09-06 polish pass — "lebih UI friendly dan elegan
 * profesional"): the page previously mixed ~9 different border-radius
 * values (3-12px) and 3 nearly-identical shadow definitions with no
 * apparent system, and several purely-informational labels sat at 8px,
 * uncomfortably small to read. Consolidated to the 3-tier scales below and
 * raised the type floor to 10px — same visual language everywhere else
 * (colors/layout/animation untouched), just consistent now. Scoped as
 * --op-* custom properties on :root (global scope, but the prefix avoids
 * any collision with other pages) so every rule below references one
 * source of truth instead of restating a value.
 */

:root {
    --op-r-sm: 6px;    /* chips, small pills, inputs */
    --op-r-md: 10px;   /* buttons, stat boxes, map controls */
    --op-r-lg: 14px;   /* cards, panels, modals-adjacent surfaces */
    --op-sh-sm: 0 2px 8px rgba(58,36,16,.16);
    --op-sh-md: 0 4px 14px rgba(58,36,16,.22);
    --op-sh-lg: 0 8px 26px rgba(58,36,16,.28);
    --op-border: 1px solid rgba(58,36,16,.15);
    --op-border-strong: 1px solid rgba(58,36,16,.25);
}

.op-main {
    position: relative; z-index: 2; flex: 1;
    display: flex; padding: 16px 20px; min-height: 0; overflow: hidden;
    transition: padding .15s;
}
/* True edge-to-edge map: no outer padding, no tan border-image panel, the
   bottom hotbar is hidden entirely, and the HUD itself floats as a
   transparent overlay instead of a solid in-flow bar (see .op-hud-float
   below + applyMapChrome() in outpost.js) — the map's own background is
   what's visible all the way to the top of the screen. */
.op-main.is-map-full { padding: 0; }
.op-main.is-map-full .op-content { padding: 0; border-width: 0; border-image: none; }
.op-main.is-map-full .op-map-viewport { border-radius: 0; border: none; }
/* The floating HUD occupies the top ~64px as a gradient overlay — push the
   menu button and the map's own float-bar down to sit just below it rather
   than under its text. */
.op-main.is-map-full .op-menu-btn,
.op-main.is-map-full .op-map-float-bar { top: 76px; }

/* HUD becomes a transparent floating overlay while the map fills the full
   screen behind it — toggled via applyMapChrome(), scoped to this page only
   (shell.css's .app-hud stays solid/in-flow everywhere else in the app). */
.app-hud.op-hud-float {
    position: absolute; top: 0; left: 0; right: 0; z-index: 15;
    background: linear-gradient(180deg, rgba(20,10,4,.6) 0%, rgba(20,10,4,.2) 70%, transparent 100%);
}

/* ── Content (fills the whole panel — no sidebar column anymore) ───────────── */

/* Extra left padding clears the floating "☰" menu button (top:16/left:16,
   40x40 — see .op-menu-btn) which sits above every sub-view's content, not
   just the map's own float-bar (which reserves its own clearance below). */
.op-content { flex: 1; min-width: 0; padding: 16px 18px 16px 66px; overflow: hidden; transition: padding .15s; }
/* flex column so the map viewport (when shown) can flex:1 to fill the rest
   of the panel below the header — harmless for the plain card-grid views
   (MY STATION/MY SUBSTATION/join-detail), which just stack normally. */
#op-body { display: flex; flex-direction: column; }

.op-section-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px; margin-bottom: 16px; flex-shrink: 0; }
.op-section-title { font-size: 15px; font-weight: 800; letter-spacing: .3px; color: #2c1a08; }
.op-section-sub { font-size: 12.5px; color: #8a6a48; margin-top: 3px; }
.op-toolbar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.op-sort-chip {
    padding: 8px 13px; border-radius: var(--op-r-sm); cursor: pointer; font-size: 12px; font-weight: 700;
    background: rgba(58,36,16,.06); border: var(--op-border); color: #8a6a48;
    transition: background .15s, border-color .15s, color .15s;
}
.op-sort-chip.active { background: rgba(200,100,26,.18); border-color: rgba(200,100,26,.5); color: #c8641a; }

/* ── Explorable map (js/pages/outpost.js's renderAllStations) ──────────────
 * The exact same viewport/canvas/zoom/drag component is reused across all 3
 * drill-down levels — ALL STATION (roots) -> a station's substations -> one
 * substation's alpha/beta slots — same scrollable canvas, same coordinate
 * space, same background, at every level, so drilling in/out never resets
 * or rebuilds a different "stage"; only which pins are drawn (and which are
 * dimmed) changes. Pin positions are computed in JS (computeScatterLayout()
 * for scattered pins, or a fixed offset from the parent's position for
 * level 3's 2 slots) and cached per level — this CSS only draws the
 * viewport/canvas/pins, it doesn't know anything about layout math or which
 * level is active. ────────────────────────────────────────────────────── */

/* Entrance animation each time a level transition swaps #op-body's content
   — 'forward' when drilling in (root->station->slots, mapAnimDir set by
   enterStationLevel()/enterSlotsLevel()) feels like zooming into the map;
   'back' when climbing out (mapGoBack()) feels like pulling away from it.
   Applied to the viewport/float-bar/zoom-ctrl siblings together so they
   animate in sync. Per explicit request ("animasi yang baik agar tidak
   kaku"). */
@keyframes op-map-anim-forward { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: scale(1); } }
@keyframes op-map-anim-back    { from { opacity: 0; transform: scale(1.1); } to { opacity: 1; transform: scale(1); } }
.op-map-anim-forward { animation: op-map-anim-forward .3s cubic-bezier(.25,.7,.35,1) both; }
.op-map-anim-back    { animation: op-map-anim-back .3s cubic-bezier(.25,.7,.35,1) both; }

.op-map-viewport {
    flex: 1; min-height: 0; position: relative;
    overflow: auto; border-radius: var(--op-r-md);
    border: var(--op-border);
    cursor: grab; touch-action: none; /* panning is hand-rolled via Pointer Events, see wireMapDrag() */
    background: #e9d9b8; /* fallback so a canvas smaller than the viewport (few stations) never exposes .app-bg's dark brown behind it */
}
.op-map-viewport.dragging { cursor: grabbing; }
.op-map-viewport::-webkit-scrollbar { width: 9px; height: 9px; }
.op-map-viewport::-webkit-scrollbar-track { background: rgba(58,36,16,.05); }
.op-map-viewport::-webkit-scrollbar-thumb { background: rgba(200,100,26,.3); border-radius: 5px; }

.op-map-float-bar {
    /* left starts past the "☰" button (top:16/left:16, 40x40 + gap) so the
       two never overlap — they read as one aligned toolbar row instead. */
    position: absolute; top: 16px; left: 66px; right: 16px; z-index: 2;
    display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; flex-wrap: wrap;
    background: rgba(233,217,184,.94); border: var(--op-border-strong); border-radius: var(--op-r-md);
    padding: 12px 16px; box-shadow: var(--op-sh-md);
    backdrop-filter: blur(3px);
}
.op-map-float-title { flex-shrink: 0; }

/* Level-2 (station submap) info row — "jumlah sub nya, jumlah pekerjanya
   (member) dlsb" per explicit request. Also reused at level 3 for the
   substation's own material balance stats. */
.op-map-info-stats { display: flex; gap: 16px; flex-shrink: 0; }
.op-map-info-stats > div { text-align: center; }
.op-map-info-stats strong { display: block; font-size: 15px; font-family: var(--font-mono); color: #2c1a08; }
.op-map-info-stats span { font-size: 10.5px; letter-spacing: 1px; color: #8a6a48; }

/* Level 3's "personal" owner card — bigger name + avatar-style icon, so the
   page reads as "this specific person's rig" rather than a bare structural
   label. Per explicit request ("lebih personal agar terkesan ada
   kepemilikan"). */
.op-slot-owner-card { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 160px; }
.op-slot-owner-avatar {
    width: 38px; height: 38px; border-radius: 50%; flex-shrink: 0;
    background: rgba(200,100,26,.15); border: 1.5px solid rgba(200,100,26,.4);
    display: flex; align-items: center; justify-content: center; font-size: 18px;
    overflow: hidden;
}
.op-slot-owner-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.op-slot-owner-name { font-size: 14px; font-weight: 800; color: #2c1a08; }
.op-slot-owner-sub { font-size: 11.5px; color: #8a6a48; margin-top: 1px; }

/* ── Floating menu button + drawer (replaces the old permanent sidebar) ─────
 * Persistent across every sub-view (not just the map) — .op-content's own
 * left padding reserves clearance for it in the normal card-grid views, and
 * .op-map-float-bar reserves its own clearance for the map view. Keep this
 * position in sync with both of those if it ever moves. ─────────────────── */

.op-menu-btn {
    position: absolute; top: 16px; left: 16px; z-index: 10;
    width: 40px; height: 40px; border-radius: var(--op-r-md);
    display: flex; align-items: center; justify-content: center;
    background: rgba(233,217,184,.95); border: var(--op-border-strong);
    color: #2c1a08; font-size: 17px; cursor: pointer;
    box-shadow: var(--op-sh-md);
    transition: transform .15s, background .15s;
}
.op-menu-btn:hover { transform: scale(1.06); background: rgba(233,217,184,1); }

.op-drawer-backdrop {
    position: absolute; inset: 0; z-index: 20;
    background: rgba(10,5,2,.5);
}
.op-drawer {
    position: absolute; top: 0; left: 0; bottom: 0; z-index: 21;
    width: 240px; max-width: 82vw;
    display: flex; flex-direction: column;
    padding: 18px 15px;
    box-shadow: var(--op-sh-lg);
    animation: op-drawer-in .2s ease-out;
}
@keyframes op-drawer-in { from { transform: translateX(-16px); opacity: .4; } to { transform: none; opacity: 1; } }

.op-drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.op-drawer-head .ui-modal-close { position: static; }

.op-build-btn { width: 100%; padding: 12px 6px; font-size: 12px; margin-bottom: 12px; }

.op-stock-row { display: flex; gap: 8px; }
.op-stock-chip {
    flex: 1; text-align: center; background: rgba(58,36,16,.06); border: var(--op-border);
    border-radius: var(--op-r-sm); padding: 8px 4px;
}
.op-stock-chip span { display: block; font-size: 10.5px; letter-spacing: 1px; color: #8a6a48; margin-bottom: 3px; }
.op-stock-chip strong { font-size: 13px; font-family: var(--font-mono); color: #c8641a; }

.op-nav-list { display: flex; flex-direction: column; gap: 4px; }
.op-nav-item { text-align: left; }

.op-shop-link { width: 100%; font-size: 11.5px; padding: 9px 6px; opacity: .85; }

/* Reserves the *visual* (zoomed) scroll size for the viewport — see
   applyZoom() in outpost.js, which resizes this to mapSize * zoom on every
   zoom change. .op-map-canvas inside it keeps its natural, unscaled
   width/height always (so pin left/top never need recalculating) and is
   purely visually scaled via transform to exactly fill this box. */
.op-map-scale-wrap { position: relative; }

.op-map-canvas {
    position: relative;
    transform-origin: 0 0;
    transition: transform .15s ease;
    /* Real hand-drawn fantasy map art. MAP_W/MAP_H in outpost.js are locked
       to this image's exact aspect ratio (2x its native 2048x1830), so
       stretching to 100% 100% here is a clean uniform scale-up, never a
       distortion. */
    background-image: url('../bg/bg_map.png');
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-color: #e9d9b8; /* shows briefly while the image loads */
}

.op-map-marker {
    position: absolute; transform: translate(-50%, -50%);
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    cursor: pointer; user-select: none; transition: opacity .2s;
    width: 100px;
}
.op-map-marker.dimmed { opacity: .22; pointer-events: none; }

.op-map-pin {
    position: relative; width: 46px; height: 46px; border-radius: 50%;
    background: rgba(233,217,184,.95); border: 2px solid rgba(200,100,26,.55);
    display: flex; align-items: center; justify-content: center; font-size: 22px;
    box-shadow: var(--op-sh-sm);
    transition: transform .15s;
}
.op-map-marker:hover .op-map-pin { transform: scale(1.12); }
.op-map-pin.mine { border-color: #c8641a; box-shadow: 0 0 0 3px rgba(200,100,26,.25), var(--op-sh-sm); }
/* Level 3's 3 pins (substation + its 2 slots) — 25% bigger than the base
   pin, per explicit request. */
.op-map-pin.slot-pin { width: 58px; height: 58px; font-size: 28px; }

/* SC_station.png already bakes in its own dark vignette/glow, so this
   variant drops the circular tan background/border entirely and just
   floats the artwork with a drop-shadow for depth — a ring behind it would
   clash with the image's own edge. Ownership shows as a warm glow instead
   of a border ring. */
.op-map-pin.icon-station {
    width: 80px; height: 80px; border-radius: 0;
    background: transparent; border: none; box-shadow: none;
    filter: drop-shadow(0 5px 8px rgba(0,0,0,.5));
}
.op-map-pin.icon-station .op-map-icon { display: block; width: 100%; height: 100%; }
.op-map-pin.icon-station .op-map-icon img { width: 100%; height: 100%; object-fit: contain; }
.op-map-pin.icon-station.mine { filter: drop-shadow(0 5px 8px rgba(0,0,0,.5)) drop-shadow(0 0 12px rgba(255,180,60,.9)); }

/* A player's own uploaded profile photo (js/pages/profile.js) replaces the
   generic pixel-art station image — back to a normal circular bordered pin
   (a ring behind a real photo doesn't clash the way it would with
   SC_station.png's own baked-in vignette), with the photo cropped into the
   circle. Per explicit request ("SC station dan subnya bisa diganti dengan
   foto profil"). */
.op-map-pin.icon-station.has-avatar {
    border-radius: 50%; background: rgba(233,217,184,.95); border: 2px solid rgba(200,100,26,.55);
    filter: drop-shadow(0 3px 8px rgba(58,36,16,.25));
}
.op-map-pin.icon-station.has-avatar.mine { border-color: #c8641a; filter: drop-shadow(0 3px 8px rgba(58,36,16,.25)) drop-shadow(0 0 8px rgba(200,100,26,.6)); }
.op-map-avatar-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; display: block; }
.op-map-badge {
    position: absolute; top: -4px; right: -4px; min-width: 17px; height: 17px; padding: 0 3px;
    border-radius: 9px; background: #2b8a3e; color: #fff8ec; font-size: 11px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; font-family: var(--font-mono);
    border: 1.5px solid #e9d9b8;
}
.op-map-label {
    font-size: 11px; font-weight: 700; color: #2c1a08; text-align: center; line-height: 1.3;
    background: rgba(233,217,184,.85); padding: 2px 7px; border-radius: var(--op-r-sm); max-width: 100%;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
/* Owner-name labels / cards that open a player profile popup on tap. */
.op-map-label.op-owner-link { cursor: pointer; }
.op-map-label.op-owner-link:hover { background: #ffe6b8; color: #7a3f12; box-shadow: 0 0 0 1px rgba(200,100,26,.4); }
.op-map-marker.op-owner-link { cursor: pointer; }
.op-slot-owner-card.op-owner-link { cursor: pointer; border-radius: var(--op-r-sm); transition: background .1s; }
.op-slot-owner-card.op-owner-link:hover { background: rgba(200,100,26,.1); }

.op-map-marker.pulse .op-map-pin { animation: op-map-pulse 1.1s ease-out 2; }
@keyframes op-map-pulse {
    0%   { box-shadow: 0 0 0 0 rgba(200,100,26,.6), var(--op-sh-sm); }
    70%  { box-shadow: 0 0 0 16px rgba(200,100,26,0), var(--op-sh-sm); }
    100% { box-shadow: 0 0 0 0 rgba(200,100,26,0), var(--op-sh-sm); }
}

.op-map-tooltip {
    position: absolute; bottom: calc(100% + 8px); left: 50%; transform: translateX(-50%);
    width: 178px; background: rgba(28,16,6,.97); border: 1px solid rgba(200,100,26,.4);
    border-radius: var(--op-r-md); padding: 10px 12px; text-align: left;
    box-shadow: var(--op-sh-md);
    opacity: 0; pointer-events: none; transition: opacity .15s; z-index: 5;
}
.op-map-marker:hover .op-map-tooltip { opacity: 1; }
.op-map-tt-name { font-size: 13px; font-weight: 800; color: #ffe8a0; }
.op-map-tt-owner { font-size: 11px; color: rgba(200,150,90,.75); margin-top: 3px; }
.op-map-tt-stats { display: flex; justify-content: space-between; font-size: 11px; color: #c8a060; margin-top: 7px; font-family: var(--font-mono); }
.op-map-tt-mine { margin-top: 7px; font-size: 10.5px; letter-spacing: 1px; color: #c8641a; font-weight: 800; }
.op-map-tt-hint { margin-top: 7px; font-size: 10.5px; letter-spacing: .5px; color: rgba(200,150,90,.65); }

/* ── Zoom controls + "dot mode" at max zoom-out ─────────────────────────────
 * Sizes below are picked so they read as a clean small dot once multiplied
 * by the minimum zoom factor (0.35, see ZOOM_LEVELS in outpost.js) — e.g.
 * 22px pin * 0.35 ≈ 8px on screen, not 22px. Icon/badge/label text would be
 * illegible at that scale anyway, so they're just hidden rather than
 * shrunk. ─────────────────────────────────────────────────────────────── */

.op-zoom-ctrl {
    position: absolute; bottom: 20px; right: 20px; z-index: 3;
    display: flex; flex-direction: column; gap: 2px;
    border-radius: var(--op-r-md); overflow: hidden; box-shadow: var(--op-sh-md);
}
.op-zoom-btn {
    width: 38px; height: 38px; border: none; cursor: pointer;
    background: rgba(233,217,184,.95); color: #2c1a08; font-size: 18px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; line-height: 1;
    transition: background .15s;
}
.op-zoom-btn:hover:not(:disabled) { background: rgba(233,217,184,1); }
.op-zoom-btn:disabled { opacity: .35; cursor: default; }
.op-zoom-btn:first-child { border-radius: var(--op-r-md) var(--op-r-md) 0 0; }
.op-zoom-btn:last-child { border-radius: 0 0 var(--op-r-md) var(--op-r-md); }

/* Prev/Next/Reload cluster — mirrors .op-zoom-ctrl on the opposite corner
   (bottom-left vs bottom-right) so the two never collide. Prev/Next step
   the spotlight between pins (focusStep()); Reload re-fetches the current
   level's data in place (reloadCurrentLevel()) — per explicit request
   ("kasih tombol previous dan next dan reload"). Levels 1/2 (scrollable)
   get the full 3-button cluster; level 3 (fixed 3-item stage, nothing to
   jump between) only gets a standalone reload button inline in its
   float-bar — see .op-slot-reload-btn below. */
.op-nav-ctrl {
    position: absolute; bottom: 20px; left: 20px; z-index: 3;
    display: flex; gap: 2px;
    border-radius: var(--op-r-md); overflow: hidden; box-shadow: var(--op-sh-md);
}
.op-nav-btn {
    width: 38px; height: 38px; border: none; border-radius: var(--op-r-sm); cursor: pointer;
    background: rgba(233,217,184,.95); color: #2c1a08; font-size: 15px; font-weight: 800;
    display: flex; align-items: center; justify-content: center; line-height: 1;
    transition: background .15s;
}
.op-nav-btn:hover:not(:disabled) { background: rgba(233,217,184,1); }
.op-nav-btn:disabled { opacity: .35; cursor: default; }
.op-nav-ctrl .op-nav-btn { border-radius: 0; }
.op-nav-ctrl .op-nav-btn:first-child { border-radius: var(--op-r-md) 0 0 var(--op-r-md); }
.op-nav-ctrl .op-nav-btn:last-child { border-radius: 0 var(--op-r-md) var(--op-r-md) 0; }

/* Reload icon spins while its refetch is in flight. */
.op-nav-btn.spinning { animation: op-nav-spin .6s linear infinite; }
@keyframes op-nav-spin { to { transform: rotate(360deg); } }

.op-slot-reload-btn { flex-shrink: 0; }

.op-map-canvas.zoom-dots .op-map-marker { width: 28px; gap: 0; }
.op-map-canvas.zoom-dots .op-map-pin { width: 22px; height: 22px; border-width: 3px; }
.op-map-canvas.zoom-dots .op-map-pin.mine { box-shadow: 0 0 0 5px rgba(200,100,26,.3); }
/* icon-station has no background/border of its own (see above) — dot mode
   needs to give it one back, otherwise "zoomed out" would just be an empty
   invisible box where the pin used to be. */
.op-map-canvas.zoom-dots .op-map-pin.icon-station {
    border-radius: 50%; background: rgba(200,100,26,.9); filter: none;
}
.op-map-canvas.zoom-dots .op-map-icon,
.op-map-canvas.zoom-dots .op-map-avatar-img,
.op-map-canvas.zoom-dots .op-map-badge,
.op-map-canvas.zoom-dots .op-map-label { display: none; }

/* ── Station cards (ALL STATION / MY STATION / MY SUBSTATION grids) ───────── */

.op-station-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }

.op-station-card, .op-mystation-card {
    position: relative; padding-top: 20px;
    transition: transform .15s, box-shadow .15s, border-color .15s;
}
.op-station-card:hover, .op-mystation-card:hover {
    transform: translateY(-2px); box-shadow: var(--op-sh-sm); border-color: rgba(200,100,26,.3);
}
.op-rig-card { border-color: rgba(40,120,192,.25); }
.op-mine-badge {
    position: absolute; top: 9px; right: 9px; background: rgba(200,100,26,.15);
    border: 1px solid rgba(200,100,26,.4); color: #c8641a; font-size: 10.5px; padding: 2px 8px;
    border-radius: var(--op-r-sm); letter-spacing: 1px; font-family: var(--font-mono); font-weight: 700;
}
.op-card-icon-lg { font-size: 32px; margin-bottom: 8px; }
.op-card-name { font-size: 13.5px; font-weight: 800; color: #2c1a08; text-align: center; }
.op-card-owner { font-size: 12px; color: #8a6a48; margin-bottom: 5px; }

.op-card-stats { display: flex; gap: 16px; border-top: var(--op-border); padding-top: 10px; margin-top: 6px; width: 100%; justify-content: center; }
.op-card-stats > div { text-align: center; }
.op-card-stats strong { display: block; font-size: 14px; font-family: var(--font-mono); color: #2c1a08; }
.op-card-stats span { font-size: 11px; color: #8a6a48; }

.op-join-hint { margin-top: 10px; text-align: center; font-size: 11px; letter-spacing: 1px; color: rgba(200,100,26,.75); background: rgba(200,100,26,.07); border: 1px solid rgba(200,100,26,.2); border-radius: var(--op-r-sm); padding: 6px; width: 100%; font-weight: 600; }

.op-tier-badge { position: absolute; top: 9px; left: 9px; font-size: 11px; padding: 2px 8px; border-radius: var(--op-r-sm); border: 1px solid; font-family: var(--font-mono); letter-spacing: 1px; font-weight: 700; }
.op-card-head-row { display: flex; align-items: center; gap: 10px; width: 100%; margin-top: 8px; }
.op-badge-row { display: flex; gap: 6px; flex-wrap: wrap; justify-content: center; width: 100%; margin: 8px 0; }
.op-role-badge { font-size: 11px; padding: 3px 9px; border-radius: var(--op-r-sm); letter-spacing: .5px; font-weight: 600; background: rgba(200,100,26,.1); border: 1px solid rgba(200,100,26,.35); color: #c8641a; }
.op-role-badge.commander { background: rgba(200,100,26,.1); border-color: rgba(200,100,26,.35); color: #c8641a; }
.op-ms-badge { font-size: 11px; padding: 3px 9px; border-radius: var(--op-r-sm); font-weight: 600; background: rgba(156,122,0,.1); border: 1px solid rgba(156,122,0,.35); color: #9c7a00; font-family: var(--font-mono); }

.op-mini-mats { display: flex; gap: 7px; width: 100%; margin-bottom: 6px; }
.op-mini-mats > div { flex: 1; text-align: center; background: rgba(58,36,16,.05); border-radius: var(--op-r-sm); padding: 6px; }
.op-mini-mats strong { display: block; font-size: 12px; font-family: var(--font-mono); }
.op-mini-mats span { font-size: 10.5px; color: #8a6a48; }

/* ── Join-detail (machine slot cards) ────────────────────────────────────── */

.op-detail-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.op-detail-name { font-size: 15px; font-weight: 800; color: #2c1a08; }
.op-detail-sub { font-size: 12.5px; color: #8a6a48; margin-top: 3px; }
.op-detail-stats { display: flex; gap: 12px; margin-bottom: 16px; }
.op-stat-box { background: rgba(58,36,16,.06); border: var(--op-border); border-radius: var(--op-r-md); padding: 12px 18px; text-align: center; flex: 1; }
.op-stat-box strong { display: block; font-size: 18px; font-family: var(--font-mono); color: #2c1a08; }
.op-stat-box span { font-size: 12px; color: #8a6a48; }

/* ── Empty state ──────────────────────────────────────────────────────────── */

.op-empty-state { text-align: center; padding: 60px 20px; }
.op-empty-icon { font-size: 44px; margin-bottom: 14px; }
.op-empty-title { font-size: 15px; font-weight: 800; color: #2c1a08; margin-bottom: 7px; }
.op-empty-sub { font-size: 12px; color: #8a6a48; margin-bottom: 20px; }

/* ── Substation detail: 3-building layout ───────────────────────────────── */

.op-building-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-bottom: 18px; }
.op-building-card {
    position: relative; background: rgba(58,36,16,.05); border: 1.5px solid rgba(58,36,16,.15);
    border-radius: var(--op-r-lg); padding: 22px 14px; text-align: center;
    transition: box-shadow .15s, border-color .15s;
}
.op-building-card:hover { box-shadow: var(--op-sh-sm); }
.op-building-icon { font-size: 40px; margin-bottom: 11px; }
.op-building-lbl { font-size: 11.5px; letter-spacing: 2px; margin-bottom: 9px; font-weight: 700; }
.op-building-name { font-size: 13px; font-weight: 700; color: #2c1a08; margin-bottom: 5px; }
.op-building-owner { font-size: 12px; color: #8a6a48; margin-bottom: 9px; }
.op-building-owner.op-owner-link { cursor: pointer; color: #c8641a; font-weight: 700; text-decoration: underline dotted; text-underline-offset: 2px; }
.op-building-owner.op-owner-link:hover { color: #a3521a; }
.op-building-empty { font-size: 12.5px; color: #8a6a48; font-style: italic; margin-bottom: 9px; }
.op-status-pill { display: inline-block; font-size: 11px; letter-spacing: 1px; font-weight: 600; padding: 3px 11px; border-radius: var(--op-r-sm); background: rgba(43,138,62,.12); border: 1px solid rgba(43,138,62,.35); color: #2b8a3e; }
.op-status-pill.empty { background: rgba(58,36,16,.06); border: 1px dashed rgba(200,100,26,.3); color: #c8641a; }
.op-status-pill.full { background: rgba(43,138,62,.12); border: 1px solid rgba(43,138,62,.35); color: #2b8a3e; font-size: 12.5px; padding: 5px 15px; }
.op-status-pill.partial { background: rgba(200,100,26,.08); border: 1px solid rgba(200,100,26,.25); color: #c8641a; font-size: 12.5px; padding: 5px 15px; }

.op-status-row {
    display: flex; gap: 20px; flex-wrap: wrap; align-items: center;
    background: rgba(58,36,16,.05); border: var(--op-border); border-radius: var(--op-r-md);
    padding: 14px 18px; margin-bottom: 18px;
}
.op-status-row .op-stat-box { flex: 0 0 auto; background: none; border: none; padding: 0; text-align: center; }

.op-rig-panel { background: rgba(40,120,192,.04); border: 1px solid rgba(40,120,192,.15); border-radius: var(--op-r-lg); padding: 18px 20px; }
.op-rig-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }

/* ── Material cell grid (shared by rig card + combine modal) ────────────── */

.op-mat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; margin-bottom: 14px; }
.op-mat-cell { background: rgba(58,36,16,.05); border: var(--op-border); border-radius: var(--op-r-md); padding: 11px 6px; text-align: center; }
.op-mat-val { font-size: 14px; font-weight: 800; font-family: var(--font-mono); margin: 4px 0; }
.op-mat-lbl { font-size: 11px; color: #8a6a48; letter-spacing: .5px; }

/* ── Redeem teaser banner ─────────────────────────────────────────────────── */

.op-redeem-banner { display: flex; justify-content: space-between; align-items: center; border-radius: var(--op-r-md); padding: 14px 18px; margin-bottom: 14px; }
.op-redeem-banner.ready { background: rgba(156,122,0,.08); border: 1px solid rgba(156,122,0,.3); }
.op-redeem-banner.target { background: rgba(58,36,16,.05); border: var(--op-border-strong); }
.op-redeem-banner.alldone { background: rgba(43,138,62,.08); border: 1px solid rgba(43,138,62,.3); text-align: center; color: #2b8a3e; font-weight: 800; letter-spacing: 1px; font-size: 12px; }
.op-redeem-lbl { font-size: 12px; font-weight: 700; letter-spacing: 1.5px; color: #9c7a00; }
.op-redeem-val { font-size: 19px; font-weight: 800; color: #9c7a00; font-family: var(--font-mono); margin: 4px 0; }
.op-redeem-sub { font-size: 12px; color: #8a6a48; font-family: var(--font-mono); }
.op-redeem-next-lbl { font-size: 11px; color: #8a6a48; letter-spacing: 1px; }
.op-redeem-next-val { font-size: 13px; font-weight: 700; color: #c8641a; margin-top: 4px; }
.op-redeem-done { font-family: var(--font-mono); color: #2b8a3e; font-weight: 800; font-size: 13px; }

/* ── Modals (create / join / combine) ───────────────────────────────────── */

.op-modal { width: 100%; max-width: 480px; transition: max-width .15s; }
/* Station-detail (2-column machine grid) and Forge (material/recipe grids)
   both need more breathing room than the plain create/join radio-list
   forms — toggled via openModal(container, html, {wide:true}). */
.op-modal.op-modal-wide { max-width: 680px; }
.op-modal-title { font-size: 16px; font-weight: 800; color: #2c1a08; margin-bottom: 5px; }
.op-modal-title-row { display: flex; justify-content: space-between; align-items: flex-start; }
.op-modal-hint { font-size: 12px; color: #8a6a48; margin-bottom: 16px; line-height: 1.5; }

.op-tier-list { display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.op-tier-radio {
    display: flex; align-items: center; gap: 10px; padding: 10px 13px; border-radius: var(--op-r-sm);
    cursor: pointer; border: var(--op-border); background: rgba(58,36,16,.04);
    transition: background .15s, border-color .15s;
}
.op-tier-radio:hover:not(.disabled) { background: rgba(200,100,26,.06); border-color: rgba(200,100,26,.3); }
.op-tier-radio.disabled { opacity: .5; cursor: default; }
.op-tier-radio-lbl { font-size: 12px; font-weight: 800; font-family: var(--font-mono); }
.op-tier-radio-stock { font-size: 11px; font-family: var(--font-mono); flex-shrink: 0; }
.op-auto-tag { font-size: 10px; padding: 1px 6px; border-radius: var(--op-r-sm); border: 1px solid; flex-shrink: 0; font-weight: 700; }

.op-modal-actions { display: flex; gap: 10px; }
.op-modal-actions .ui-btn { flex: 1; }

.op-recipe-card { background: rgba(58,36,16,.04); border: var(--op-border); border-radius: var(--op-r-md); padding: 15px; margin-bottom: 14px; }
.op-recipe-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 11px; font-size: 12px; }
.op-recipe-status { font-size: 11px; letter-spacing: 1px; font-weight: 600; padding: 2px 9px; border-radius: var(--op-r-sm); border: 1px solid; }
.op-recipe-row { display: flex; align-items: stretch; gap: 7px; flex-wrap: wrap; margin-bottom: 11px; }
.op-plus-sep { align-self: center; color: #8a6a48; font-size: 16px; padding: 0 2px; }

.op-auranite-box {
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(156,122,0,.06); border: 1px solid rgba(156,122,0,.25); border-radius: var(--op-r-md);
    padding: 14px 18px; margin-top: 14px;
}
.op-auranite-val { font-size: 22px; font-weight: 800; color: #9c7a00; font-family: var(--font-mono); }

/* ── Mobile ──────────────────────────────────────────────────────────────── */

@container (max-width: 860px) {
    .op-content { min-height: 400px; }
    .op-menu-btn { top: 16px; left: 16px; width: 38px; height: 38px; }
    .op-building-grid { grid-template-columns: 1fr; }
}
