/* =====================================================================
   outpost.css — Colony "Outpost planner"  (mount #outpost-planner, prefix opl-)
   Builds on base.css tokens + shared components (.panel, .btn, .chip,
   .readout, .segbar, .dot, .label, .mono). Every rule is scoped to .opl.
   ===================================================================== */

.opl {
  --opl-fill: #08111b;
  --opl-ink: rgba(228, 238, 250, 0.86);
  --opl-ink-dim: rgba(190, 208, 228, 0.5);
  --opl-ink-faint: rgba(170, 195, 225, 0.24);
  --opl-w: var(--tint-home);
  position: relative;
  display: block;
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  margin-top: clamp(28px, 4vw, 48px);
  color: var(--text);
}
.opl *, .opl *::before, .opl *::after { box-sizing: border-box; }
.opl-shell { display: grid; gap: 14px; }

/* ------------------------------------------------------------- header */
.opl-head {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 14px 24px; padding-bottom: 14px; border-bottom: 1px solid var(--line);
}
.opl-head__id { display: flex; align-items: center; gap: 14px; min-width: 0; }
.opl-head__mark { width: 38px; height: 38px; flex: none; color: var(--silver-hi); border: 1px solid var(--line-strong); border-radius: 2px; display: grid; place-items: center; }
.opl-head__mark svg { width: 30px; height: 30px; }
.opl-head__k { font-family: var(--f-display); font-size: 0.56rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--text-faint); line-height: 1.5; }
.opl-head__t { font-family: var(--f-display); font-size: 0.86rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text); line-height: 1.4; }
.opl-head__t .mono { display: inline-block; margin-left: 10px; font-size: 0.6rem; letter-spacing: 0.12em; color: var(--text-faint); }
.opl-head__actions { display: flex; flex-wrap: wrap; gap: 8px; }
.opl .opl-btn .opl-ico { width: 10px; height: 10px; flex: none; }
.opl .opl-run { gap: 10px; }

/* ------------------------------------------------------------- worlds */
.opl-worlds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.opl-world {
  position: relative; display: flex; align-items: center; gap: 12px; min-height: 60px;
  padding: 11px 14px; text-align: left;
  border: 1px solid var(--line); border-radius: 2px; background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.3s, background 0.3s;
}
.opl-world::after {
  content: ""; position: absolute; left: -1px; right: -1px; top: -1px; height: 2px;
  background: var(--w-tint); transform: scaleX(0); transform-origin: left; transition: transform 0.5s var(--ease-out);
}
.opl-world:hover { border-color: var(--line-strong); }
.opl-world[aria-pressed="true"] { border-color: var(--line-strong); background: rgba(255, 255, 255, 0.045); }
.opl-world[aria-pressed="true"]::after { transform: scaleX(1); }
.opl-world__glyph {
  position: relative; width: 26px; height: 26px; flex: none; border-radius: 50%;
  background: radial-gradient(circle at 34% 30%, rgba(255, 255, 255, 0.5), transparent 46%), var(--w-tint);
  box-shadow: inset -7px -5px 9px rgba(0, 0, 0, 0.72);
  opacity: 0.7; transition: opacity 0.3s, box-shadow 0.3s;
}
.opl-world__glyph::after { content: ""; position: absolute; inset: -5px; border-radius: 50%; border: 1px solid var(--w-tint); opacity: 0; transition: opacity 0.3s; }
.opl-world[aria-pressed="true"] .opl-world__glyph { opacity: 1; }
.opl-world[aria-pressed="true"] .opl-world__glyph::after { opacity: 0.45; }
.opl-world__txt { display: grid; min-width: 0; }
.opl-world__txt b { font-family: var(--f-display); font-weight: 400; font-size: 0.66rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--text); line-height: 1.4; }
.opl-world__txt small { font-size: 0.64rem; color: var(--text-faint); letter-spacing: 0.04em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.opl-world__sol { margin-left: auto; font-size: 0.7rem; color: var(--text-dim); padding-left: 6px; }
.opl-world[aria-pressed="true"] .opl-world__sol { color: var(--ignite); }

/* ---------------------------------------------------------- conditions */
.opl-cond { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 24px; }
.opl-cond__facts { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; }
.opl-cond__facts > div { display: flex; gap: 8px; align-items: baseline; padding: 5px 10px; border: 1px solid var(--line); border-radius: 2px; }
.opl-cond__facts dt { font-family: var(--f-display); font-size: 0.52rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint); }
.opl-cond__facts dd { margin: 0; font-size: 0.7rem; color: var(--text); }
.opl-cond__blurb { flex: 1 1 320px; font-size: 0.86rem; line-height: 1.55; color: var(--text-dim); max-width: 72ch; }

/* --------------------------------------------------------------- grid */
.opl-grid {
  display: grid; gap: 14px; align-items: start;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: "cat" "mid" "status";
}
.opl-cat { grid-area: cat; min-width: 0; }
.opl-mid { grid-area: mid; display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; min-width: 0; }
.opl-status { grid-area: status; min-width: 0; }
@media (min-width: 720px) {
  .opl-grid { grid-template-columns: minmax(250px, 290px) minmax(0, 1fr); grid-template-areas: "cat mid" "status status"; align-items: stretch; }
  .opl-mid, .opl .opl-status { align-self: start; }
  /* catalogue takes the row height set by the schematic (and status, on desktop) and scrolls inside,
     so the open accordion never leaves a tall empty gutter beside the blueprint */
  .opl .opl-cat { display: flex; flex-direction: column; contain: size; min-height: 560px; }
  .opl .opl-cat .opl-cat__groups {
    flex: 1 1 auto; min-height: 0; overflow-y: auto; overscroll-behavior: auto;
    scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
    -webkit-mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent);
    mask-image: linear-gradient(180deg, #000 calc(100% - 36px), transparent);
    padding-bottom: 28px;
  }
  .opl .opl-cat .opl-cat__groups::-webkit-scrollbar { width: 6px; }
  .opl .opl-cat .opl-cat__groups::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, 0.16); border-radius: 3px; }
}
@media (min-width: 1100px) {
  .opl-grid { grid-template-columns: 272px minmax(0, 1fr) 296px; grid-template-areas: "cat mid status"; }
}

/* ---------------------------------------------------------- catalogue */
.opl .opl-cat { padding: 0; }
.opl-cat__head { display: grid; gap: 2px; padding: 14px 16px 12px; border-bottom: 1px solid var(--line); flex: none; }
.opl-cat__sum { font-size: 0.62rem; color: var(--text-faint); white-space: nowrap; }
.opl-grp { border-bottom: 1px solid var(--line); }
.opl-grp:last-child { border-bottom: 0; }
.opl-grp__head {
  width: 100%; display: flex; align-items: center; gap: 10px; min-height: 46px; padding: 11px 16px; text-align: left;
  transition: background 0.25s;
}
.opl-grp__head:hover { background: rgba(255, 255, 255, 0.03); }
.opl-grp__head:focus-visible { outline-offset: -2px; }
.opl-grp__id { width: 30px; font-size: 0.66rem; color: var(--ignite); letter-spacing: 0.06em; }
.opl-grp__name { flex: 1; font-family: var(--f-display); font-size: 0.58rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text); }
.opl-grp__n { min-width: 24px; padding: 1px 6px; font-size: 0.62rem; text-align: center; color: var(--text-faint); border: 1px solid var(--line); border-radius: 2px; transition: color 0.3s, border-color 0.3s; }
.opl-grp__n.is-on { color: var(--signal); border-color: rgba(116, 196, 80, 0.35); }
.opl-grp__chev { width: 12px; height: 12px; color: var(--text-faint); transition: transform 0.35s var(--ease-out); }
.opl-grp__head[aria-expanded="true"] .opl-grp__chev { transform: rotate(180deg); }
.opl-grp__body { padding: 0 10px 12px; }
.opl-grp__body[hidden] { display: none; }
.opl-grp__note { padding: 0 6px 8px; font-size: 0.74rem; line-height: 1.45; color: var(--text-faint); }
.opl-grp__list { display: grid; gap: 6px; }

.opl-card {
  position: relative; padding: 10px 10px 9px 12px;
  border: 1px solid var(--line); border-radius: 2px; background: rgba(255, 255, 255, 0.012);
  transition: border-color 0.3s, background 0.3s;
}
.opl-card::before {
  content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 2px; background: var(--signal);
  transform: scaleY(0); transform-origin: top; transition: transform 0.45s var(--ease-out);
}
.opl-card.is-on { border-color: rgba(255, 255, 255, 0.14); background: rgba(255, 255, 255, 0.03); }
.opl-card.is-on::before { transform: scaleY(1); }
.opl-card__top { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.opl-card__code { font-size: 0.68rem; font-weight: 500; letter-spacing: 0.04em; color: var(--ignite); }
.opl-card__name { font-size: 0.84rem; font-weight: 700; line-height: 1.3; color: var(--text); }
.opl .opl-card__late { margin-left: auto; padding: 2px 6px; font-size: 0.5rem; letter-spacing: 0.16em; }
.opl-card__role { margin-top: 3px; font-size: 0.74rem; line-height: 1.42; color: var(--text-dim); }
.opl-card__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.opl-card__stats { display: flex; flex-wrap: wrap; gap: 2px 9px; min-width: 0; font-size: 0.62rem; color: var(--text-faint); }
.opl-card__s.is-pos { color: var(--signal); }
.opl-card__s.is-neg { color: var(--text-dim); }
.opl-card__req { margin-top: 7px; font-size: 0.6rem; letter-spacing: 0.02em; color: var(--ignite); }
.opl-card.is-locked .opl-card__name, .opl-card.is-locked .opl-card__role { opacity: 0.6; }
.opl-card.is-flash { animation: opl-flash 1.1s var(--ease-out); }
@keyframes opl-flash { 0%, 45% { border-color: var(--ignite); background: rgba(255, 138, 42, 0.08); } 100% { } }

.opl-qty { display: inline-flex; align-items: stretch; flex: none; border: 1px solid var(--line-strong); border-radius: 2px; }
.opl-qty__b { width: 30px; height: 28px; display: grid; place-items: center; color: var(--text-dim); transition: color 0.2s, background 0.2s; }
.opl-qty__b svg { width: 11px; height: 11px; }
.opl-qty__b:hover:not(:disabled):not([aria-disabled="true"]) { color: var(--void); background: var(--text); }
.opl-qty__b--add:hover:not(:disabled):not([aria-disabled="true"]) { color: #1a0b00; background: var(--ignite); }
.opl-qty__b:disabled, .opl-qty__b[aria-disabled="true"] { opacity: 0.28; cursor: not-allowed; }
.opl-qty__b:focus-visible { outline-offset: 1px; }
.opl-qty__n { min-width: 24px; display: grid; place-items: center; font-size: 0.72rem; color: var(--text); border-inline: 1px solid var(--line); }
@media (hover: none) {
  .opl-qty__b { width: 40px; height: 38px; }
}

/* ---------------------------------------------------------- schematic */
.opl-map {
  position: relative; min-width: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: radial-gradient(120% 90% at 50% 42%, #0a1521 0%, #060c13 58%, #04080d 100%);
}
.opl-svg { display: block; width: 100%; height: auto; -webkit-user-select: none; user-select: none; touch-action: manipulation; }
.opl-map__hud { position: absolute; z-index: 2; left: 14px; right: 14px; top: 12px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px; pointer-events: none; }
.opl-map__title { font-family: var(--f-display); font-size: 0.56rem; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(214, 226, 240, 0.82); }
.opl-map__meta { font-size: 0.6rem; letter-spacing: 0.06em; color: rgba(190, 208, 228, 0.55); }
.opl-map__foot {
  position: absolute; z-index: 2; left: 14px; right: 14px; bottom: 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px;
  font-family: var(--f-mono); font-size: 0.58rem; letter-spacing: 0.04em; color: rgba(190, 208, 228, 0.5); pointer-events: none;
}
.opl-lg { display: inline-flex; align-items: center; gap: 6px; }
.opl-lg i { display: inline-block; width: 18px; height: 6px; }
.opl-lg__cor { border-top: 1px solid rgba(228, 238, 250, 0.7); border-bottom: 1px solid rgba(228, 238, 250, 0.7); }
.opl-lg__tun { border-top: 1px dashed rgba(228, 238, 250, 0.7); border-bottom: 1px dashed rgba(228, 238, 250, 0.7); }
.opl .opl-lg__pwr { height: 0; border-top: 1px dashed var(--ignite); }
.opl-scale { margin-left: auto; display: inline-flex; align-items: center; gap: 6px; }
.opl-scale i { display: inline-block; width: 64px; height: 5px; border: 1px solid rgba(228, 238, 250, 0.55); border-top: 0; }
@media (max-width: 519px) { .opl-lg--opt, .opl-lg:nth-child(2) { display: none; } }

/* svg primitives — hairlines stay 1px at any scale */
.opl-svg .opl-b { fill: var(--opl-fill); stroke: var(--opl-ink); stroke-width: 1; vector-effect: non-scaling-stroke; transition: stroke 0.3s; }
.opl-svg .opl-d { fill: none; stroke: var(--opl-ink-dim); stroke-width: 1; vector-effect: non-scaling-stroke; transition: stroke 0.3s; }
.opl-svg .opl-dash { stroke-dasharray: 3 3; }
.opl-svg .opl-cell { fill: none; stroke: rgba(190, 208, 228, 0.38); stroke-width: 0.8; vector-effect: non-scaling-stroke; transition: stroke 0.35s; }
.opl-svg .opl-a { fill: rgba(255, 138, 42, 0.6); stroke: none; }
.opl-svg .opl-fill { fill: var(--signal); opacity: 0.5; transition: fill 0.3s; }
.opl-svg .opl-fill.is-low { fill: var(--warn); }
.opl-svg text { font-family: var(--f-mono); }
.opl-svg .opl-t { font-size: 9px; letter-spacing: 0.08em; fill: rgba(222, 233, 246, 0.84); }
.opl-svg .opl-t2 { font-size: 7.5px; letter-spacing: 0.1em; fill: rgba(190, 208, 228, 0.46); }
.opl-svg .opl-t--env { font-size: 7px; fill: rgba(190, 208, 228, 0.62); }
.opl-svg .opl-tag { font-size: 7px; letter-spacing: 0.14em; fill: var(--signal); }
.opl-svg .opl-hit { fill: transparent; stroke: none; }
.opl-svg .opl-hitline { fill: none; stroke: transparent; stroke-width: 12; pointer-events: stroke; }
.opl-svg .opl-ring { fill: none; stroke: var(--ignite); stroke-dasharray: 2 3; opacity: 0; vector-effect: non-scaling-stroke; transition: opacity 0.25s; }
.opl-svg .opl-shield { stroke: rgba(205, 218, 234, 0.55); }
.opl-svg .opl-shell { stroke: rgba(143, 220, 255, 0.55); stroke-dasharray: 5 3; }
.opl-svg .opl-barrier { fill: none; stroke: rgba(228, 238, 250, 0.72); }

/* nodes */
.opl-node { cursor: pointer; outline: none; }
.opl-node:focus { outline: none; }
.opl-node:hover .opl-b { stroke: #fff; }
.opl-node:focus-visible .opl-ring, .opl-node.is-sel .opl-ring { opacity: 1; }
.opl-node.is-sel .opl-b { stroke: var(--ignite-hot); }
.opl-node--env:hover .opl-d, .opl-node--env:focus-visible .opl-d, .opl-node--env.is-sel .opl-d,
.opl-node--env:hover .opl-b, .opl-node--env.is-sel .opl-b { stroke: var(--ignite-hot); }
.opl-node--env:focus-visible .opl-t--env, .opl-node--env.is-sel .opl-t--env { fill: var(--ignite-hot); }
.opl-node.is-unlinked .opl-b { stroke: var(--ignite); stroke-dasharray: 3 3; fill: rgba(255, 138, 42, 0.04); }
.opl-node.is-unlinked .opl-tag, .opl-node.is-offline .opl-tag { fill: var(--ignite); }
.opl-node.is-offline .opl-node__body { opacity: 0.5; }
.opl-node.is-fault .opl-b, .opl-node--env.is-fault .opl-d { stroke: var(--warn); animation: opl-fault 1.4s ease-in-out infinite; }
@keyframes opl-fault { 50% { stroke-opacity: 0.3; } }
.opl-node__body { transform-box: fill-box; transform-origin: center; }
.opl-node.is-new .opl-node__body { animation: opl-build 0.8s var(--ease-out) var(--opl-d, 0ms) both; }
.opl-node.is-new .opl-b { animation: opl-build-ink 1s ease-out var(--opl-d, 0ms) both; }
@keyframes opl-build { 0% { opacity: 0; transform: scale(0.55); } 55% { opacity: 1; } 100% { opacity: 1; transform: none; } }
@keyframes opl-build-ink { 0%, 35% { stroke: var(--ignite-hot); } 100% { stroke: var(--opl-ink); } }
.opl-node.is-leaving { pointer-events: none; }
.opl-node.is-leaving .opl-node__body { animation: opl-leave 0.4s var(--ease-io) forwards; }
@keyframes opl-leave { to { opacity: 0; transform: scale(0.6); } }
.opl-svg[data-sun="day"] .opl-node--solar .opl-cell { stroke: var(--ignite-hot); }
.opl-svg[data-sun="day"] .opl-node--solar .opl-b { stroke: rgba(255, 179, 92, 0.9); }

/* links */
.opl-link__out { fill: none; stroke: rgba(228, 238, 250, 0.5); stroke-width: 7; vector-effect: non-scaling-stroke; }
.opl-link__in { fill: none; stroke: #07101a; stroke-width: 5; vector-effect: non-scaling-stroke; }
.opl-link--tun .opl-link__out { stroke-dasharray: 7 3; }
.opl-link--pwr .opl-link__out, .opl-link--feed .opl-link__out { stroke: rgba(255, 138, 42, 0.5); stroke-width: 1; stroke-dasharray: 3 3; }
.opl-link--feed .opl-link__out { stroke-width: 1.3; stroke: rgba(255, 138, 42, 0.62); }
.opl-svg[data-sun="day"] .opl-link--feed .opl-link__out,
.opl-svg[data-sun="day"] .opl-link--pwr .opl-link__out { stroke: var(--ignite-hot); animation: opl-flow 0.9s linear infinite; }
@keyframes opl-flow { to { stroke-dashoffset: -12; } }
.opl-svg.is-paused .opl-link__out { animation-play-state: paused; }
.opl-link.is-new { animation: opl-link-in 0.7s ease-out both; }
@keyframes opl-link-in { from { opacity: 0; } }

/* zones, terrain, overlays */
.opl-svg .opl-zone { fill: rgba(255, 138, 42, 0.016); stroke: rgba(255, 179, 92, 0.22); stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; transition: stroke 0.3s; }
.opl-svg.is-storm .opl-zone { stroke: rgba(255, 138, 42, 0.75); }
.opl-svg .opl-zone-t { font-family: var(--f-display); font-size: 7px; letter-spacing: 0.24em; fill: rgba(200, 215, 232, 0.5); }
.opl-svg .opl-zone-t--bus { fill: rgba(255, 138, 42, 0.7); }
.opl-svg .opl-zone-t--warn { fill: var(--ignite); }
.opl-svg .opl-zone-hint { font-size: 8px; letter-spacing: 0.16em; fill: rgba(190, 208, 228, 0.34); }
.opl-svg .opl-bus { stroke: rgba(255, 138, 42, 0.7); stroke-width: 2; vector-effect: non-scaling-stroke; }
.opl-svg .opl-stage { fill: rgba(255, 138, 42, 0.03); stroke: rgba(255, 138, 42, 0.35); stroke-dasharray: 2 4; vector-effect: non-scaling-stroke; }
.opl-svg .opl-compass circle, .opl-svg .opl-compass path { fill: none; stroke: rgba(200, 215, 232, 0.32); vector-effect: non-scaling-stroke; }
.opl-svg .opl-compass .opl-compass__n { fill: rgba(222, 233, 246, 0.72); stroke: none; }
.opl-svg .opl-compass text { font-size: 7px; fill: rgba(200, 215, 232, 0.6); }
.opl-svg .opl-ter { fill: none; stroke: rgba(150, 190, 235, 0.12); stroke-width: 1; vector-effect: non-scaling-stroke; }
.opl-svg .opl-ter--sea { stroke: rgba(111, 168, 200, 0.18); }
.opl-svg .opl-ter-t { font-size: 7px; letter-spacing: 0.18em; fill: rgba(170, 195, 225, 0.3); }
.opl-svg .opl-night { fill: #01040a; opacity: 0; pointer-events: none; }
.opl-map.is-sim .opl-svg { cursor: progress; }

/* empty state + module details */
.opl-empty {
  position: absolute; inset: 0; z-index: 3; display: grid; place-content: center; justify-items: center; gap: 10px; padding: 24px; text-align: center;
  opacity: 0; visibility: hidden; transition: opacity 0.4s, visibility 0.4s;
}
.opl-map.is-empty .opl-empty { opacity: 1; visibility: visible; }
.opl-empty__t { max-width: 28ch; font-family: var(--f-display); font-size: 0.8rem; line-height: 1.45; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text); }
.opl-empty__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }

.opl .opl-info { position: absolute; z-index: 4; left: 12px; bottom: 34px; width: min(280px, calc(100% - 24px)); display: grid; gap: 4px; padding: 14px; }
.opl .opl-info.is-right { left: auto; right: 12px; }
.opl .opl-info[hidden] { display: none; }
.opl-info__top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.opl-info__code { font-size: 0.64rem; letter-spacing: 0.06em; color: var(--ignite); }
.opl-info__x { width: 30px; height: 30px; margin: -6px -6px 0 0; display: grid; place-items: center; color: var(--text-dim); }
.opl-info__x:hover { color: var(--text); }
.opl-info__x svg { width: 11px; height: 11px; }
.opl-info__name { font-family: var(--f-display); font-size: 0.72rem; letter-spacing: 0.12em; line-height: 1.4; text-transform: uppercase; color: var(--text); }
.opl-info__role { font-size: 0.8rem; line-height: 1.45; color: var(--text-dim); }
.opl-info__stats { font-size: 0.66rem; color: var(--text); }
.opl-info__state { font-size: 0.6rem; letter-spacing: 0.1em; color: var(--signal); }
.opl-info__state.is-warn { color: var(--ignite); }
.opl .opl-info__rm { justify-self: start; margin-top: 8px; --btn-fill: var(--warn); }

/* ------------------------------------------------- view toggle (3D / Blueprint) */
.opl-mid[data-view="3d"] > .opl-map, .opl-mid[data-view="bp"] > .opl-scene { display: none; }
.opl-viewbar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: -6px; }
.opl-viewbar[hidden] { display: none; }
.opl-vt { display: inline-flex; padding: 3px; gap: 3px; border: 1px solid var(--line); border-radius: 2px; background: rgba(255, 255, 255, 0.015); }
.opl-vt__b {
  position: relative; display: inline-flex; align-items: center; gap: 8px; min-height: 32px; padding: 0 12px;
  font-family: var(--f-display); font-size: 0.56rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-faint);
  border: 1px solid transparent; border-radius: 2px; transition: color 0.25s, border-color 0.25s, background 0.25s;
}
.opl-vt__b svg { width: 13px; height: 13px; flex: none; }
.opl-vt__b:hover { color: var(--text); }
.opl-vt__b[aria-pressed="true"] { color: var(--text); border-color: var(--line-strong); background: rgba(255, 255, 255, 0.05); }
.opl-vt__b[aria-pressed="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 1px; background: var(--ignite); }
.opl-vt__b:focus-visible { outline-offset: 1px; }
.opl-viewbar__note { display: inline-flex; align-items: center; gap: 8px; font-size: 0.6rem; letter-spacing: 0.06em; color: var(--text-faint); }
.opl-viewbar__note i { width: 6px; height: 6px; border-radius: 50%; background: var(--ignite-hot); box-shadow: 0 0 8px rgba(255, 179, 92, 0.7); }
@media (max-width: 519px) { .opl-viewbar__note { display: none; } .opl-vt { width: 100%; } .opl-vt__b { flex: 1; justify-content: center; white-space: nowrap; } }
@media (max-width: 379px) { .opl-vt__b { gap: 6px; padding: 0 6px; letter-spacing: 0.12em; } }

/* ------------------------------------------------------------ 3D diorama */
.opl-scene {
  position: relative; width: 100%; min-width: 0; overflow: hidden; isolation: isolate;
  aspect-ratio: 5 / 4; min-height: 420px; max-height: 640px;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: radial-gradient(120% 90% at 50% 40%, #121821 0%, #070b10 58%, #040608 100%);
}
.opl-scene[hidden] { display: none; }
.opl-scene__vp { position: absolute; inset: 0; z-index: 1; outline: none; }
/* the canvas is a positioned child, so it paints over the host's own outline / shadow — the focus ring is a sibling layer */
.opl-scene__focus { position: absolute; inset: 3px; z-index: 5; border: 1px solid var(--ignite); border-radius: 2px; pointer-events: none; opacity: 0; transition: opacity 0.2s; }
.opl-scene__vp:focus-visible ~ .opl-scene__focus { opacity: 1; }
/* soft scrims keep the HUD legible over bright skies */
.opl-scene__vp::after { content: ""; position: absolute; left: 0; right: 0; top: 0; height: 96px; z-index: 2; pointer-events: none; background: linear-gradient(180deg, rgba(4, 6, 8, 0.5), rgba(4, 6, 8, 0)); }
.opl-scene__vp .a3d-canvas { cursor: grab; }
.opl-scene__vp .a3d-canvas:active { cursor: grabbing; }
/* the kit's chrome sits clear of the time bar + zoom column.
   The kit sets [hidden] on its touch controls but styles them display:inline-flex, so [hidden] never wins — restore it here. */
.opl-scene .a3d-tap[hidden], .opl-scene .a3d-done[hidden], .opl-scene .a3d-live-ring[hidden] { display: none; }
.opl-scene .a3d-hint { bottom: 64px; }
.opl-scene .a3d-tap { bottom: 66px; }
.opl-scene .a3d-done { top: auto; bottom: 66px; right: 12px; }
.opl-scene.is-ready .opl-scene__boot { opacity: 0; visibility: hidden; }
.opl-scene__boot {
  position: absolute; inset: 0; z-index: 2; display: grid; place-items: center; pointer-events: none;
  font-family: var(--f-display); font-size: 0.56rem; letter-spacing: 0.26em; text-transform: uppercase; color: var(--text-faint);
  transition: opacity 0.6s, visibility 0.6s;
}
.opl-scene__boot span { padding: 8px 12px; border: 1px solid var(--line); border-radius: 2px; }
.opl-scene__fade { position: absolute; inset: 0; z-index: 6; background: #040608; opacity: 0; pointer-events: none; transition: opacity 0.28s var(--ease-io); }
.opl-scene.is-swapping .opl-scene__fade { opacity: 1; }
.opl-scene::after { z-index: 7; }
.opl-scene.is-fail .opl-scene__vp { box-shadow: inset 0 0 0 1px rgba(255, 90, 60, 0.5), inset 0 0 90px rgba(255, 60, 30, 0.16); }

/* HUD */
.opl-scene__hud { position: absolute; z-index: 3; left: 14px; right: 14px; top: 12px; display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; pointer-events: none; }
.opl-scene__id { display: grid; gap: 4px; min-width: 0; }
.opl-scene__title { font-family: var(--f-display); font-size: 0.56rem; letter-spacing: 0.22em; text-transform: uppercase; color: rgba(226, 234, 244, 0.86); text-shadow: 0 1px 8px rgba(0, 0, 0, 0.6); }
.opl-scene__meta { font-size: 0.6rem; letter-spacing: 0.06em; color: rgba(196, 210, 228, 0.6); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.6); }
.opl-phase {
  display: inline-flex; align-items: center; gap: 8px; flex: none; padding: 5px 10px; font-size: 0.6rem; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--ignite-hot); border: 1px solid var(--line-strong); border-radius: 2px; background: rgba(4, 6, 8, 0.55); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: color 0.4s, border-color 0.4s;
}
.opl-phase[data-phase="dusk"] { color: #ffb88a; }
.opl-phase[data-phase="night"] { color: var(--cyan); }
.opl-phase[data-phase="storm"] { color: var(--ignite); border-color: rgba(255, 138, 42, 0.45); }
.opl-phase[data-phase="flare"] { color: var(--cyan); border-color: rgba(143, 220, 255, 0.45); }
.opl-phase[data-phase="fail"] { color: var(--warn); border-color: rgba(255, 90, 60, 0.55); background: rgba(40, 6, 4, 0.6); }

/* camera buttons */
.opl-zoom { position: absolute; z-index: 3; right: 12px; top: 50%; transform: translateY(-50%); display: grid; gap: 4px; }
.opl-zoom__b {
  width: 32px; height: 32px; display: grid; place-items: center; color: var(--text-dim);
  border: 1px solid var(--line-strong); border-radius: 2px; background: rgba(4, 6, 8, 0.58); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
}
.opl-zoom__b svg { width: 12px; height: 12px; }
.opl-zoom__b:hover { color: var(--void); background: var(--text); border-color: var(--text); }
.opl-zoom__b[data-zoom="reset"] { margin-top: 4px; }
@media (hover: none) { .opl-zoom__b { width: 40px; height: 40px; } }

/* time-lapse bar */
.opl-tb {
  position: absolute; z-index: 3; left: 12px; right: 12px; bottom: 12px; display: flex; align-items: center; gap: 12px;
  padding: 6px 12px 6px 6px; border: 1px solid var(--line-strong); border-radius: 2px;
  background: rgba(4, 6, 8, 0.62); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
}
.opl-tb__play { width: 30px; height: 30px; flex: none; display: grid; place-items: center; color: var(--ignite); border: 1px solid rgba(255, 138, 42, 0.4); border-radius: 2px; transition: background 0.2s, color 0.2s; }
.opl-tb__play:hover { background: var(--ignite); color: #1a0b00; }
.opl-tb__play .opl-ico { width: 10px; height: 10px; }
.opl-tb__play[aria-pressed="true"] .opl-ico:not(.opl-ico--pause), .opl-tb__play[aria-pressed="false"] .opl-ico--pause { display: none; }
.opl-tb__track { position: relative; flex: 1 1 auto; min-width: 0; height: 26px; }
.opl-tb__bands { position: absolute; left: 0; right: 0; top: 10px; height: 6px; overflow: hidden; background: rgba(255, 179, 92, 0.13); border-radius: 1px; }
.opl-tb__bands i { position: absolute; top: 0; bottom: 0; }
.opl-tb__n { background: rgba(10, 18, 34, 0.95); }
.opl-tb__e { background: repeating-linear-gradient(45deg, rgba(255, 138, 42, 0.8) 0 1px, transparent 1px 4px); box-shadow: inset 0 1px 0 var(--ignite); }
.opl-tb__e.is-flare { background: repeating-linear-gradient(45deg, rgba(143, 220, 255, 0.8) 0 1px, transparent 1px 4px); box-shadow: inset 0 1px 0 var(--cyan); }
.opl-tb__s { width: 1px; background: rgba(255, 255, 255, 0.35); }
.opl-tb__f { width: 2px; margin-left: -1px; background: var(--warn); box-shadow: 0 0 6px var(--warn); }
.opl-tb__range { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; background: transparent; cursor: pointer; -webkit-appearance: none; appearance: none; touch-action: pan-y; }
.opl-tb__range:focus { outline: none; }
.opl-tb__range::-webkit-slider-runnable-track { height: 100%; background: transparent; }
.opl-tb__range::-moz-range-track { height: 100%; background: transparent; }
.opl-tb__range::-webkit-slider-thumb { -webkit-appearance: none; width: 3px; height: 22px; margin-top: 2px; border: 0; border-radius: 1px; background: var(--ignite-hot); box-shadow: 0 0 0 1px rgba(4, 6, 8, 0.8), 0 0 10px rgba(255, 179, 92, 0.7); }
.opl-tb__range::-moz-range-thumb { width: 3px; height: 22px; border: 0; border-radius: 1px; background: var(--ignite-hot); box-shadow: 0 0 0 1px rgba(4, 6, 8, 0.8), 0 0 10px rgba(255, 179, 92, 0.7); }
.opl-tb__range:focus-visible::-webkit-slider-thumb { box-shadow: 0 0 0 2px var(--ignite), 0 0 12px rgba(255, 179, 92, 0.9); }
.opl-tb__range:focus-visible::-moz-range-thumb { box-shadow: 0 0 0 2px var(--ignite), 0 0 12px rgba(255, 179, 92, 0.9); }
.opl-tb__clk { flex: none; min-width: 94px; text-align: right; font-size: 0.68rem; letter-spacing: 0.04em; color: var(--text); }

/* projected module labels */
.opl-scene__tags { position: absolute; inset: 0; z-index: 2; overflow: hidden; pointer-events: none; }
.opl-tag3 {
  position: absolute; left: 0; top: 0; translate: -50% calc(-100% - 8px); white-space: nowrap;
  padding: 3px 7px; font-family: var(--f-display); font-size: 0.5rem; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text); border: 1px solid var(--line-strong); border-radius: 2px; background: rgba(4, 6, 8, 0.72);
}
.opl-tag3::after { content: ""; position: absolute; left: 50%; top: 100%; width: 1px; height: 8px; background: currentColor; opacity: 0.6; }
.opl-tag3.is-hov { color: var(--text-dim); }
.opl-tag3.is-sel { color: var(--ignite-hot); border-color: rgba(255, 179, 92, 0.55); }
.opl-tag3.is-warn { color: var(--ignite); border-color: rgba(255, 138, 42, 0.5); }
.opl-tag3.is-fail { color: var(--warn); border-color: rgba(255, 90, 60, 0.6); background: rgba(30, 6, 4, 0.78); }
.opl-tag3.is-zone { translate: 0 -50%; padding: 2px 6px; border: 0; background: rgba(4, 6, 8, 0.5); font-size: 0.48rem; letter-spacing: 0.24em; color: rgba(222, 232, 244, 0.8); text-shadow: 0 1px 6px rgba(0, 0, 0, 0.8); }
.opl-tag3.is-zone::after { display: none; }
.opl-tag3.is-zone.is-warn { color: var(--ignite); }

/* the shared empty state + module card move into whichever view is showing */
.opl-scene .opl-empty { background: radial-gradient(closest-side, rgba(4, 6, 8, 0.66), rgba(4, 6, 8, 0)); }
.opl-scene.is-empty .opl-empty { opacity: 1; visibility: visible; }
.opl .opl-scene .opl-info { bottom: 64px; z-index: 5; }
.opl .opl-scene .opl-info.is-right { right: 54px; }

@media (max-width: 519px) {
  .opl-scene { min-height: 440px; }
  .opl-scene .a3d-tap { white-space: nowrap; padding: 0 14px; font-size: 0.56rem; letter-spacing: 0.14em; }
  .opl-scene__meta { display: none; }
  .opl-tb { gap: 8px; padding-right: 8px; }
  .opl-tb__clk { min-width: 76px; font-size: 0.62rem; }
  .opl .opl-scene .opl-info { bottom: 62px; }
}
@media (prefers-reduced-motion: reduce) {
  .opl-scene__fade, .opl-scene__boot { transition: none; }
}

/* --------------------------------------------------------------- chart */
.opl .opl-chart { padding: 14px 16px 12px; }
.opl-chart__head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-bottom: 8px; }
.opl-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 0.58rem; color: var(--text-faint); }
.opl-legend li { display: inline-flex; align-items: center; gap: 6px; }
.opl-legend i { display: inline-block; width: 10px; height: 8px; }
.opl-k-pos { background: rgba(116, 196, 80, 0.6); }
.opl-k-neg { background: rgba(255, 138, 42, 0.66); }
.opl .opl-k-bat { width: 14px; height: 0; border-top: 1.5px solid var(--silver-hi); }
.opl-k-night { background: rgba(2, 5, 12, 0.95); border: 1px solid var(--line-strong); }
.opl-k-ev { border: 1px solid rgba(255, 138, 42, 0.45); background: repeating-linear-gradient(45deg, rgba(255, 138, 42, 0.5) 0 1px, transparent 1px 4px); }
.opl-chart__wrap { position: relative; width: 100%; min-width: 0; }
.opl-canvas { display: block; width: 100%; height: 214px; cursor: crosshair; touch-action: pan-y; }
.opl-chart__sum { min-height: 1.5em; margin-top: 6px; font-size: 0.62rem; letter-spacing: 0.04em; color: var(--text-faint); }

/* -------------------------------------------------------------- status */
.opl .opl-status { display: grid; gap: 18px; align-content: start; }
.opl-banner {
  position: relative; display: flex; align-items: flex-start; gap: 12px; padding: 14px 14px 14px 16px;
  color: var(--silver); border: 1px solid var(--line-strong); border-radius: 2px; background: rgba(255, 255, 255, 0.02);
  transition: color 0.4s, border-color 0.4s, background 0.4s;
}
.opl-banner::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 3px; background: currentColor; }
.opl-banner .dot { margin-top: 6px; }
.opl-banner__t { font-family: var(--f-display); font-size: 0.72rem; line-height: 1.5; letter-spacing: 0.14em; text-transform: uppercase; color: currentColor; }
.opl-banner__clk { display: block; margin-top: 2px; font-size: 0.8rem; letter-spacing: 0.04em; white-space: nowrap; }
.opl-banner__d { margin-top: 4px; font-size: 0.82rem; line-height: 1.5; color: var(--text-dim); }
.opl-banner[data-state="ok"] { color: var(--signal); border-color: rgba(116, 196, 80, 0.4); background: rgba(116, 196, 80, 0.06); }
.opl-banner[data-state="fail"] { color: var(--warn); border-color: rgba(255, 90, 60, 0.45); background: rgba(255, 90, 60, 0.07); }
.opl-banner[data-state="run"] { color: var(--ignite); border-color: rgba(255, 138, 42, 0.42); background: rgba(255, 138, 42, 0.05); }

.opl-crew, .opl-read, .opl-sys, .opl-netw, .opl-logw { transition: opacity 0.4s; }
.opl-status.is-sim .opl-read, .opl-status.is-sim .opl-sys, .opl-status.is-sim .opl-logw { opacity: 0.32; }
.opl-crew { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding-bottom: 14px; border-bottom: 1px solid var(--line); }
.opl .opl-crew__v { font-size: 2.3rem; line-height: 1; color: var(--text); }
.opl-crew__pips { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 3px; max-width: 150px; }
.opl-crew__pips i { width: 6px; height: 11px; background: var(--signal); opacity: 0.85; }

.opl-read { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 10px; margin: 0; }
.opl-read dd { margin: 0; }
.opl .opl-read .readout__k { font-size: 0.5rem; letter-spacing: 0.16em; line-height: 1.5; }
.opl .opl-read .readout__v { font-size: 0.9rem; }
/* the 296px desktop status column fits two readouts per row without wrapping the Michroma labels */
@media (min-width: 1100px) {
  .opl-read { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opl .opl-read .readout__k { white-space: nowrap; }
}

.opl-sys { display: grid; gap: 10px; }
.opl-sys__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 5px; }
.opl-sys__k { font-family: var(--f-display); font-size: 0.56rem; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text); }
.opl-sys__v { font-size: 0.62rem; text-align: right; color: var(--text-dim); }
.opl-sys__row.is-warn .opl-sys__v { color: var(--ignite); }
.opl-sys__row.is-crit .opl-sys__v, .opl-sys__row.is-crit .opl-sys__k { color: var(--warn); }
.opl .opl-seg { display: flex; width: 100%; gap: 3px; }
.opl .opl-seg .segbar__seg { flex: 1; width: auto; height: 6px; }

.opl-netw { padding-top: 14px; border-top: 1px solid var(--line); }
.opl-netw__top { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.opl-netw__top .mono { font-size: 0.62rem; color: var(--signal); }
.opl-netw__top .mono.is-warn { color: var(--ignite); }
.opl-netw__help { margin-top: 6px; font-size: 0.76rem; line-height: 1.5; color: var(--text-faint); }
.opl-netw__help b { font-weight: 700; color: var(--text-dim); }

.opl-log { display: grid; margin-top: 8px; font-size: 0.64rem; }
.opl-log li { display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 8px; padding: 6px 0; line-height: 1.4; color: var(--text-dim); border-bottom: 1px dashed rgba(255, 255, 255, 0.07); }
.opl-log li:last-child { border-bottom: 0; }
.opl-log li > span:first-child { color: var(--text-faint); white-space: nowrap; }
.opl-log li.is-ev > span:last-child { color: var(--ignite); }
.opl-log li.is-warn > span:last-child { color: var(--ignite-hot); }
.opl-log li.is-fail > span { color: var(--warn); }
.opl-log li.is-ok > span:last-child { color: var(--signal); }

@media (min-width: 720px) and (max-width: 1099px) {
  .opl .opl-status { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 28px; }
  .opl-banner { grid-column: 1 / -1; }
  .opl-logw { order: 4; }
  .opl-netw { order: 5; grid-column: 1 / -1; }
}

/* ------------------------------------------------------------- closing */
.opl-closing {
  display: flex; align-items: center; gap: 16px; margin-top: 12px;
  font-family: var(--f-body); font-style: italic; font-weight: 300; font-size: clamp(1rem, 1.5vw, 1.25rem); line-height: 1.45; color: var(--text-dim);
}
.opl-closing__rule { width: 48px; height: 1px; flex: none; background: var(--signal); }

/* --------------------------------------------------------------- small */
@media (max-width: 899px) {
  .opl-worlds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 599px) {
  .opl-head__actions { width: 100%; display: grid; grid-template-columns: 1fr auto; }
  .opl-head__actions .opl-run { grid-column: 1 / -1; order: -1; }
  .opl-head__actions .opl-btn { letter-spacing: 0.14em; padding-inline: 12px; }
  .opl-head__t .mono { display: block; margin: 2px 0 0; }
  .opl-world { gap: 10px; padding: 10px; min-height: 56px; }
  .opl-world__sol { display: none; }
  .opl-world__glyph { width: 22px; height: 22px; }
  .opl-cond__facts dd { font-size: 0.66rem; }
  .opl-read { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .opl-closing { align-items: flex-start; }
  .opl-closing__rule { margin-top: 0.75em; width: 28px; }
}

/* ------------------------------------------------------ reduced motion */
@media (prefers-reduced-motion: reduce) {
  .opl-node.is-new .opl-node__body, .opl-node.is-new .opl-b, .opl-link.is-new, .opl-node.is-fault .opl-b { animation: none; }
  .opl-svg[data-sun="day"] .opl-link__out { animation: none; }
}
