/* Remedy for Mac demo styles. Colours come from CSS variables that js/data.js (themeVars) sets on
   #win for the chosen mode, colour and design; the numbers follow the SwiftUI source (HUDKit, MacShells, Cards). */
@font-face { font-family: "Oxanium"; src: url("fonts/Oxanium-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Oxanium"; src: url("fonts/Oxanium-Bold.woff2") format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Chakra Petch"; src: url("fonts/ChakraPetch-SemiBold.woff2") format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "Chakra Petch"; src: url("fonts/ChakraPetch-Bold.woff2") format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "JB Mono"; src: url("fonts/JetBrainsMono-400.woff2") format("woff2"); font-weight: 400; font-display: block; }
@font-face { font-family: "JB Mono"; src: url("fonts/JetBrainsMono-500.woff2") format("woff2"); font-weight: 500; font-display: block; }
@font-face { font-family: "JB Mono"; src: url("fonts/JetBrainsMono-600.woff2") format("woff2"); font-weight: 600; font-display: block; }
@font-face { font-family: "JB Mono"; src: url("fonts/JetBrainsMono-700.woff2") format("woff2"); font-weight: 700; font-display: block; }
@font-face { font-family: "Inter Demo"; src: url("fonts/Inter-var.woff2") format("woff2"); font-weight: 100 900; font-display: block; }

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; overflow: hidden; background: transparent; }
body { font: 13px/1.19 "Inter Demo", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
       -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; font-feature-settings: "cv11", "ss03"; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-align: inherit; line-height: inherit; letter-spacing: inherit; }
button:focus { outline: none; }
button:focus-visible { outline: 2px solid var(--flare); outline-offset: 2px; }
button[disabled] { cursor: default; }
svg { display: block; flex: none; overflow: visible; }
b { font-weight: 700; }
h1 { margin: 0; }
img { display: block; }

/* ---------- Window ---------- */
#win { position: absolute; left: 0; top: 0; width: 1240px; height: 800px; overflow: hidden; border-radius: 16px; transform-origin: 0 0;
       background: var(--groundDeep); color: var(--t1); user-select: none; -webkit-user-select: none; isolation: isolate; }
#win.light { box-shadow: inset 0 0 0 .5px rgba(0,0,0,.18); }
#win.dark { box-shadow: inset 0 0 0 .5px rgba(255,255,255,.14); }
#app { position: absolute; inset: 0; }
.lights { position: absolute; left: 9px; top: 9px; display: flex; gap: 9px; z-index: 20; }
.lights i { width: 14px; height: 14px; border-radius: 50%; display: block; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.12); }
.lights i:nth-child(1) { background: #FF5F57; } .lights i:nth-child(2) { background: #FEBC2E; } .lights i:nth-child(3) { background: #28C840; }
#ground { position: absolute; inset: 0; overflow: hidden; }
.gglow { position: absolute; inset: 0; display: block; }
.aurora { position: absolute; inset: 0; filter: blur(60px); }
.blob { position: absolute; display: block; border-radius: 50%; }
.blob.b1 { animation: drift1 14s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); }
.blob.b2 { animation: drift2 14s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes drift1 { to { transform: translate(-120px, 70px) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-160px, -60px) scale(.9); } }

#shell { position: absolute; left: 0; right: 0; top: 32px; bottom: 0; display: flex; }
#shell.col { flex-direction: column; }
#shell.row { align-items: stretch; }
#main { position: relative; flex: 1 1 0; min-width: 0; min-height: 0; display: flex; flex-direction: column; }
#area { position: relative; flex: 1 1 0; min-height: 0; }
#scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; }
#scroll::-webkit-scrollbar { display: none; }
#area.has-scroll #scroll { right: 17px; }
.scroller { position: absolute; right: 0; top: 0; bottom: 0; width: 17px; display: none; z-index: 4; }
#area.has-scroll .scroller { display: block; }
#win.dark .scroller { background: rgba(255,255,255,.035); box-shadow: inset 1px 0 0 rgba(255,255,255,.06); }
#win.light .scroller { background: rgba(250,250,250,.9); box-shadow: inset 1px 0 0 rgba(0,0,0,.06); }
.thumb { position: absolute; left: 4px; width: 9px; border-radius: 5px; background: rgba(128,128,128,.62); }
#win.dark .thumb { background: rgba(180,180,180,.55); }
.sweepband { position: absolute; left: 0; right: 0; top: 0; height: 140px; pointer-events: none; z-index: 3;
             background: linear-gradient(transparent, var(--g7), var(--g12), transparent);
             animation: sweepband 8s linear infinite; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes sweepband { from { transform: translateY(-140px); } to { transform: translateY(768px); } }

/* ---------- Common ---------- */
.col { display: flex; flex-direction: column; }
.row { display: flex; align-items: center; }
.sp { flex: 1 1 0; min-width: 0; }
.ell { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.abs { position: absolute; display: block; }
.abs-c { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; justify-content: center; }
.ox { font-family: "Oxanium", "Inter Demo", sans-serif; font-weight: 700; line-height: 1; font-style: normal; }
.cp { font-family: "Chakra Petch", "Inter Demo", sans-serif; line-height: 1.3; }
.mono { font-family: "JB Mono", ui-monospace, Menlo, monospace; line-height: 1.2; }
.hl { display: block; height: 1px; flex: none; }
.sym { color: inherit; }
.gt { background: var(--textG); -webkit-background-clip: text; background-clip: text; color: transparent; display: inline-block; }

/* riseIn: opacity 0 → 1 and 10 px up, cubic-bezier(.2,.7,.2,1) over .6 s + delay */
.rise { animation: rise .6s cubic-bezier(.2,.7,.2,1) both; animation-delay: var(--rd, 0s); }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } }

/* Infinite animations keep their phase across re-renders: delay = per-element offset − time since load */
.spin { animation: spin var(--sd, 4s) linear infinite; animation-delay: calc(var(--ad, 0s) - var(--clock, 0s)); }
@keyframes spin { to { transform: rotate(360deg); } }
.abs-c > .spin, .abs-c .dring.spin { transform-origin: 50% 50%; }
.pulse-o { animation: pulseO var(--pd, 1.6s) ease-in-out infinite alternate; animation-delay: calc(var(--ad, 0s) - var(--clock, 0s)); display: inline-flex; }
@keyframes pulseO { to { opacity: var(--lo, .35); } }

/* ---------- Panels (panelGlass) ---------- */
.pg { position: relative; min-width: 0; }
.pg.cc { background: var(--panelGrad); box-shadow: inset 0 0 0 1px var(--hudLine); }
#win.light .pg.cc, #win.light .pg.gl { box-shadow: inset 0 0 0 1px var(--hudLine), 0 6px 28px rgba(120,64,30,.10); }
.pg.ck { isolation: isolate; }
.pg.ck::before, .pg.ck::after { content: ""; position: absolute; z-index: -1; pointer-events: none; }
.pg.ck::before { inset: 0; background: var(--l28); clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); }
.pg.ck::after { inset: 1px; background: linear-gradient(var(--panelTop), var(--panelBot)); clip-path: polygon(13.6px 0, 100% 0, 100% calc(100% - 13.6px), calc(100% - 13.6px) 100%, 0 100%, 0 13.6px); }
#win.light .pg.ck { filter: drop-shadow(0 6px 14px rgba(120,64,30,.10)); }
.tk { position: absolute; width: 10px; height: 10px; pointer-events: none; display: block; }
.tk.tr { top: 6px; right: 6px; border-top: 1.5px solid var(--e80); border-right: 1.5px solid var(--e80); }
.tk.bl { bottom: 6px; left: 6px; border-bottom: 1.5px solid var(--e80); border-left: 1.5px solid var(--e80); }
.pg.gl { background: var(--panelGrad); box-shadow: inset 0 0 0 1px var(--hudLine); }
#win.light .pg.gl { background: rgba(255,252,247,.62); box-shadow: inset 0 0 0 1px rgba(255,255,255,.85), 0 0 0 1px var(--l10), 0 10px 30px rgba(120,64,30,.10); }
.pgbtn { display: block; width: 100%; text-align: left; }
.hp { display: flex; flex-direction: column; min-width: 0; height: 100%; }
.ph { display: flex; align-items: center; gap: 7px; min-height: 12px; }
.hlabel { font: 600 10.5px/1 "JB Mono", monospace; letter-spacing: 1.5px; color: var(--t3); text-transform: uppercase; white-space: nowrap; }
#win[data-d="cockpit"] .hlabel { font-family: "Oxanium", sans-serif; letter-spacing: 1.8px; color: var(--flare); }
.htag { font: 500 10px/1 "JB Mono", monospace; letter-spacing: .6px; color: var(--t3); text-transform: uppercase; white-space: nowrap; }
#win[data-d="cockpit"] .htag { font-family: "Oxanium", sans-serif; font-weight: 600; letter-spacing: 1.4px; }
.hdot { position: relative; width: 19px; height: 19px; display: flex; align-items: center; justify-content: center; flex: none; }
.hdot::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--pc); opacity: .12; animation: hdot 1.2s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); }
.hdot i { position: relative; width: 7px; height: 7px; border-radius: 50%; background: var(--pc); box-shadow: 0 0 8px var(--pc); }
@keyframes hdot { to { opacity: .6; } }
.ro { display: inline-flex; align-items: baseline; gap: 3px; white-space: nowrap; }
.ro b { font-weight: 700; }
.ro i { font-weight: 600; font-style: normal; }
.ping { position: relative; flex: none; display: inline-block; }
.ping::after { content: ""; position: absolute; inset: 0; border-radius: 50%; background: var(--pc); box-shadow: 0 0 8px color-mix(in srgb, var(--pc) 80%, transparent); }
.ping::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid color-mix(in srgb, var(--pc) 60%, transparent);
                animation: ping 2s ease-out infinite; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes ping { from { transform: scale(1); opacity: 1; } to { transform: scale(3); opacity: 0; } }
.klabel { font-size: 10.5px; font-weight: 600; letter-spacing: 1.5px; color: var(--t3); white-space: nowrap; }
.lbl2 { font-size: 10px; font-weight: 600; letter-spacing: 2px; color: var(--t2); white-space: nowrap; }
.ph2 { font-size: 14px; font-weight: 700; letter-spacing: .9px; color: var(--t1); white-space: nowrap; line-height: 1.2; }
.k10 { font-size: 10px; font-weight: 600; letter-spacing: 1.6px; color: var(--t3); }
.k95, .k95b { font-size: 9.5px; font-weight: 600; letter-spacing: 1.4px; color: var(--t3); white-space: nowrap; }

/* Neon wordmark */
.neon { font-weight: 700; white-space: nowrap; line-height: 1.3; display: inline-block; }
.neon.flick { animation: flick 15s linear infinite; animation-delay: calc(0s - var(--clock, 0s)); }
/* BrandMark + breathingHalo */
.mark { position: relative; flex: none; border-radius: 50%; display: inline-block; }
.mark::before { content: ""; position: absolute; inset: 0; border-radius: 50%; background: #000; box-shadow: 0 0 var(--h0) var(--g45);
                animation: halo 2s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); }
.mark::after { content: ""; position: absolute; inset: -1px; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--e30); animation: haloRing 2s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); }
.mark img { position: relative; width: 100%; height: 100%; border-radius: 50%; }
.mark.fixed::before { box-shadow: 0 0 var(--h0) rgba(255,106,16,.45); animation-name: haloFixed; }
.mark.fixed::after { box-shadow: inset 0 0 0 1px rgba(255,106,16,.3); animation: none; }
@keyframes halo { to { box-shadow: 0 0 var(--h1) var(--g80); } }
@keyframes haloFixed { to { box-shadow: 0 0 var(--h1) rgba(255,106,16,.8); } }
@keyframes haloRing { to { box-shadow: inset 0 0 0 1px var(--e55); } }
.mark.ring2::after { box-shadow: inset 0 0 0 1px rgba(255,255,255,.9); }

/* Buttons */
.ebtn { position: relative; display: inline-flex; align-items: stretch; flex: none; overflow: hidden; isolation: isolate; color: var(--onFill);
        background: var(--emberG); box-shadow: 0 2px 28px var(--eg), inset 0 1px 0 rgba(255,255,255,.35); white-space: nowrap; }
.ebtn .eb-in { display: flex; align-items: center; position: relative; z-index: 1; }
.ebtn .pb-t { font-size: 13px; font-weight: 700; letter-spacing: .5px; line-height: 1; }
.ebtn.off { background: var(--surfaceAlt); color: var(--t3); box-shadow: inset 0 0 0 1px var(--hudLine); }
.ebtn .sheen { position: absolute; top: -100%; bottom: -100%; left: 0; width: max(24px, 40%); z-index: 0; pointer-events: none;
               background: linear-gradient(to right, transparent, rgba(255,255,255,.19), rgba(255,255,255,.55), rgba(255,255,255,.19), transparent);
               transform: translateX(-300%) rotate(12deg); animation: sheen 3.4s ease-in-out infinite; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes sheen { from { transform: translateX(-300%) rotate(12deg); } to { transform: translateX(350%) rotate(12deg); } }
.ebtn:not(.off):active { filter: brightness(.92); }
.gbtn { display: inline-flex; align-items: center; flex: none; white-space: nowrap; color: var(--t1); background: var(--e5); box-shadow: inset 0 0 0 1px var(--l28);
        border-radius: 4px 11px 4px 11px; }
.gbtn.off { background: var(--e2); box-shadow: inset 0 0 0 1px var(--l14); color: var(--t3); }
.gbtn:not(.off):active { filter: brightness(1.2); }
.gbtn .sb-t { font-size: 12px; font-weight: 600; }
.dbtn { display: inline-flex; align-items: center; gap: 8px; padding: 0 18px; flex: none; background: var(--danger); color: #fff; border-radius: 4px 12px 4px 12px; white-space: nowrap; }
.dbtn .cp { font-size: 13px; font-weight: 700; letter-spacing: .5px; }
.eicon { display: flex; align-items: center; justify-content: center; flex: none; background: var(--e12); box-shadow: inset 0 0 0 1px var(--l25); color: var(--flare); }
.mbadge { font-size: 10px; font-weight: 600; color: var(--flare); padding: 3px 6px; background: var(--e14); box-shadow: inset 0 0 0 1px var(--l25); border-radius: 3px 7px 3px 7px; white-space: nowrap; line-height: 1; }
.spill { display: inline-flex; align-items: center; gap: 8px; padding: 7px 11px; border-radius: 3px 9px 3px 9px; flex: none;
         background: color-mix(in srgb, var(--pc) 8%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 28%, transparent); color: var(--pc); }
.spill .ox { font-size: 11px; letter-spacing: 1.6px; }
.safe { display: flex; align-items: center; gap: 6px; color: var(--t2); }
.safe svg { color: var(--ok); }
.access { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 4px 14px 4px 14px; background: rgba(232,179,65,.06); box-shadow: inset 0 0 0 1px rgba(232,179,65,.3); color: var(--warn); }
#win.light .access { background: rgba(232,179,65,.12); }
.access .tx { color: var(--t2); }
.access .lnk, .lnk { font-size: 12.5px; font-weight: 700; color: var(--warn); white-space: nowrap; }
.lnk.b { font-size: 12px; }
.ulink { color: var(--flare); text-decoration: underline; text-underline-offset: 2px; }
.glink { margin-top: 12px; font-size: 12px; font-weight: 700; align-self: flex-start; }
.tog { position: relative; width: 50px; height: 24px; border-radius: 12px; background: rgba(128,128,128,.35); flex: none; transition: background .15s; }
.tog.on { background: var(--brandDeep); }
.tog::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.18); transition: transform .15s ease-in-out; }
.tog.on::after { transform: translateX(26px); }
.rcheck { width: 16px; height: 16px; flex: none; display: inline-flex; align-items: center; justify-content: center; border-radius: 3px 6px 3px 6px; box-shadow: inset 0 0 0 1.5px var(--l40); color: var(--onFill); }
.rcheck.dis { box-shadow: inset 0 0 0 1.5px var(--l20); }
.rcheck.on { background: var(--emberG); box-shadow: 0 0 10px var(--g50); }
.meter { display: flex; gap: 3px; }
.meter i { flex: 1 1 0; border-radius: 1.5px; background: var(--l10); display: block; }
.meter i.lit { background: var(--segG); box-shadow: 0 0 6px var(--g55); }
.meter i.head { animation: head 1.2s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes head { to { opacity: .25; } }
.hbar { position: relative; flex: none; }
.hbar .tr { position: absolute; inset: 0; background: var(--hbarTrack); display: block; }
.hbar .fl { position: absolute; left: 0; top: 0; bottom: 0; background: var(--barG); display: block; overflow: hidden; }
.hbar .fl .sheen { position: absolute; top: -200%; bottom: -200%; left: 0; width: 40%; background: linear-gradient(to right, transparent, rgba(255,255,255,.5), transparent);
                   animation: sheen 3.4s ease-in-out infinite; animation-delay: calc(0s - var(--clock, 0s)); }
.pulse { display: flex; align-items: flex-end; gap: 3px; height: 30px; }
.pulse i { width: 4px; height: 100%; border-radius: 1px; background: linear-gradient(var(--pb), color-mix(in srgb, var(--pb) 15%, transparent)); transform-origin: bottom; transform: scaleY(var(--lo)); display: block; }
.pulse.on i { transform: scaleY(var(--lo)); animation: pulse .9s ease-in-out infinite alternate; animation-delay: calc(var(--ad) - var(--clock, 0s)); }
@keyframes pulse { to { transform: scaleY(var(--hi)); } }
.stepper { display: flex; gap: 4px; isolation: isolate; }
.stp { flex: 1 1 0; position: relative; height: 34px; display: flex; align-items: center; justify-content: center; color: var(--t3); }
.stp .ox { font-size: 11px; letter-spacing: 1.3px; position: relative; }
.stp::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--e7); clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%, 9px 50%); }
.stp.first::before { clip-path: polygon(0 0, calc(100% - 9px) 0, 100% 50%, calc(100% - 9px) 100%, 0 100%); }
.stp.done { color: var(--ok); }
.stp.done::before { background: color-mix(in srgb, var(--ok) 10%, transparent); }
.stp.on { color: var(--onFill); filter: drop-shadow(0 0 8px var(--g60)); }
.stp.on::before { background: var(--emberG); }
.sbar { display: flex; gap: 2px; width: 100%; }
.sbar i { display: block; height: 100%; }
.dring { display: block; }
.rad { position: relative; display: block; }
.rad i { position: absolute; inset: 0; border-radius: 50%; display: block; opacity: 0; animation: rad 2s ease-out infinite; animation-delay: calc(var(--ad) - var(--clock, 0s)); }
@keyframes rad { from { transform: scale(var(--rf)); opacity: .8; } to { transform: scale(var(--rt)); opacity: 0; } }
.gring { position: relative; }
.gring .trk { position: absolute; inset: 0; border-radius: 50%; display: block; }
.gring .arcw { position: absolute; inset: 0; }
.gring .arc { position: absolute; inset: 0; border-radius: 50%; display: block;
              -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - var(--lw)), #000 calc(100% - var(--lw) + .5px)), conic-gradient(#000 var(--f), transparent var(--f));
              -webkit-mask-composite: source-in; mask: radial-gradient(farthest-side, transparent calc(100% - var(--lw)), #000 calc(100% - var(--lw) + .5px)) intersect, conic-gradient(#000 var(--f), transparent var(--f)); }
.gring .cap { position: absolute; border-radius: 50%; display: block; }
.arcw.draw { animation: drawRing 1.2s ease-out both; animation-delay: var(--ad, 0s); }
@keyframes drawRing { from { clip-path: circle(0 at 50% 50%); opacity: 0; } 40% { opacity: 1; } to { clip-path: circle(75% at 50% 50%); } }
.flow { display: block; flex: none; }
.flow.run { animation: flow 1s linear infinite; animation-delay: calc(0s - var(--clock, 0s)); }
.flow:not(.v).run { animation-name: flowH; }
.flow.v.run { animation-name: flowV; }
@keyframes flowH { from { background-position: 0 0; } to { background-position: var(--per) 0; } }
@keyframes flowV { from { background-position: 0 0; } to { background-position: 0 var(--per); } }
.drive { flex: none; }
.kv { display: flex; align-items: center; gap: 8px; }
.kv b { margin-left: auto; }

/* BatteryCell */
.cell { display: flex; flex-direction: column; align-items: center; gap: 4px; flex: none; }
.cell .nub { width: 30px; height: 6px; border-radius: 2px; background: color-mix(in srgb, var(--flare) 60%, transparent); display: block; flex: none; }
.cell .cbody { position: relative; width: 100%; flex: 1; border-radius: 4px 12px 4px 12px; padding: 7px; background: var(--well);
               box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--flare) 45%, transparent), 0 0 8px var(--bg1); animation: cellB 2s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes cellB { to { box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--flare) 45%, transparent), 0 0 24px var(--bg1); } }
.cell .liq { position: relative; width: 100%; height: 100%; overflow: hidden; }
.cell .wv { position: absolute; left: 0; bottom: 0; height: 100%; width: 200%; }
.cell .wv svg { width: 100%; height: 100%; }
.cell .wv.front { animation: wave 2.8s linear infinite; animation-delay: calc(0s - var(--clock, 0s)); }
.cell .wv.back { animation: wave 4.2s linear infinite reverse; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes wave { from { transform: translateX(0); } to { transform: translateX(-50%); } }
.cell .ctxt { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: #fff; }
.cell .ctxt b { font-size: 34px; text-shadow: 0 0 8px rgba(0,0,0,.7); }
.cell .ctxt span { font-size: 9.5px; letter-spacing: 2.2px; opacity: .9; }
.bglyph { position: relative; display: inline-block; flex: none; }
.bglyph .bo { position: absolute; left: 0; top: 0; border: 2px solid; display: block; }
.bglyph .bf { position: absolute; left: 4px; top: 4px; display: block; }
.bglyph .bn { position: absolute; right: 0; top: 50%; width: 4px; transform: translateY(-50%); border-radius: 0 2px 2px 0; display: block; }

/* ---------- Top bars ---------- */
.bar { position: relative; flex: none; display: flex; align-items: center; }
.brandrow { display: flex; align-items: center; flex: none; }
.bar.ck { height: 60px; gap: 18px; padding: 0 18px 0 92px; background: linear-gradient(color-mix(in srgb, var(--panelTop) 80%, transparent), color-mix(in srgb, var(--chromeBot) 90%, transparent));
          box-shadow: inset 0 -1px 0 var(--l18); }
.bar.ck::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; opacity: .55;
                 background: linear-gradient(to right, transparent, var(--ember), var(--flareRaw), var(--ember), transparent); }
.ctabs { position: relative; display: flex; align-self: stretch; }
.ctab { position: relative; height: 60px; padding: 0 14px; display: flex; align-items: center; gap: 6px; z-index: 1; }
.ctab .ox { font-size: 12px; font-weight: 600; letter-spacing: 1.2px; color: var(--t3); white-space: nowrap; }
.tglow { position: absolute; bottom: 0; height: 3px; pointer-events: none; display: block; transition: left .45s cubic-bezier(.7,0,.2,1), width .45s cubic-bezier(.7,0,.2,1); }
.tglow .ln { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; display: block; background: var(--barG); box-shadow: 0 0 12px var(--ember), 0 -6px 24px var(--g45); }
.tglow .ell { position: absolute; left: 50%; bottom: -15px; width: 80px; height: 30px; margin-left: -40px; display: block; border-radius: 50%;
              background: radial-gradient(closest-side, var(--g32, var(--g30)), transparent); }
.tglow.ck .ell { bottom: -25px; }
.cicon { width: 30px; height: 30px; flex: none; display: flex; align-items: center; justify-content: center; color: var(--t3); }
.cicon.on { color: var(--flare); background: var(--e12); clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); box-shadow: inset 0 0 0 1px var(--l30); }
.bar.tm { height: 44px; box-shadow: inset 0 -1px 0 var(--l12); justify-content: center; }
.segs { position: relative; display: flex; padding: 3px; background: var(--e6); box-shadow: inset 0 0 0 1px var(--l18); border-radius: 4px 12px 4px 12px; z-index: 1; }
.seg { position: relative; z-index: 1; display: flex; align-items: center; gap: 6px; padding: 5px 14px; font-size: 12px; font-weight: 600; color: var(--t2); white-space: nowrap; }
.seg.on { color: var(--onFill); }
.seg .sb { font-size: 10px; font-weight: 600; }
.tglow.tm { top: 3px; bottom: 3px; height: auto; background: var(--emberG); border-radius: 3px 10px 3px 10px; box-shadow: 0 0 14px var(--g60); transition: left .4s cubic-bezier(.3,1.2,.5,1), width .4s cubic-bezier(.3,1.2,.5,1); }
.tmrow { position: absolute; left: 0; right: 0; top: 0; bottom: 0; display: flex; align-items: center; gap: 8px; padding: 0 14px 0 92px; pointer-events: none; }
.tmrow > * { pointer-events: auto; }
.tmicon { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; color: var(--t3); border-radius: 3px 9px 3px 9px; flex: none; }
.tmicon.on { color: var(--flare); background: var(--e12); }
.bar.ha { height: 56px; padding: 0 22px 0 96px; box-shadow: inset 0 -1px 0 var(--l16); }
.htabs { position: relative; display: flex; align-self: stretch; }
.htab { position: relative; z-index: 1; height: 56px; padding: 0 15px; display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: var(--t2); white-space: nowrap; }
.htab.on { color: var(--t1); }
.tglow.ha { height: 2px; transition: left .45s cubic-bezier(.3,1.15,.5,1), width .45s cubic-bezier(.3,1.15,.5,1); animation: pulseO 1.5s ease-in-out infinite alternate; --lo: .75; animation-delay: calc(0s - var(--clock, 0s)); }
.tglow.ha .ln { left: 4px; right: 4px; height: 2px; box-shadow: 0 0 10px var(--ember), 0 -4px 18px var(--g70); }
.tglow.ha .ell { width: 80px; height: 24px; margin-left: -40px; bottom: -20px; background: radial-gradient(closest-side, var(--g35), transparent); }
.haicon { width: 32px; height: 32px; display: flex; align-items: center; justify-content: center; color: var(--t3); border-radius: 4px 10px 4px 10px; flex: none; }
.haicon.on { color: var(--flare); background: var(--e12); }

/* ---------- Sidebar and rail ---------- */
.side { position: relative; flex: none; height: 100%; }
.sidein { position: relative; display: flex; flex-direction: column; height: 100%; }
.side.glass { height: auto; }
.glassbg { position: absolute; inset: 0; background: var(--panelGrad); box-shadow: inset 0 0 0 1px var(--hudLine); }
#win.light .glassbg { background: rgba(255,252,247,.62); box-shadow: inset 0 0 0 1px rgba(255,255,255,.85), 0 0 0 1px var(--l10), 0 10px 30px rgba(120,64,30,.10); }
.sbrand { display: flex; align-items: center; }
.ver { font-size: 10.5px; font-weight: 500; color: var(--t3); white-space: nowrap; }
.sitem { position: relative; display: flex; align-items: center; width: 100%; font-size: 13px; font-weight: 600; white-space: nowrap; }
.sitem .ibg { position: absolute; inset: 0; display: block; }
.sitem .edge { position: absolute; top: 8px; bottom: 8px; width: 3px; background: var(--ember); border-radius: 0 3px 3px 0; display: block; }
.sitem .si { position: relative; width: 17px; display: flex; justify-content: center; flex: none; }
.sitem .st { position: relative; }
.sitem .st.m { font-size: 11.5px; font-weight: 500; }
.sitem > .mbadge, .sitem > .mono { position: relative; }
.ssep { display: block; height: 1px; flex: none; }
.sfoot { display: flex; flex-direction: column; gap: 2px; padding: 0 8px; font-size: 10.5px; font-weight: 500; color: var(--t3); }
.sfoot b { font-weight: 700; color: var(--t2); }
.sfoot.mono { font-size: 9.5px; }
.rail { position: relative; flex: none; height: 100%; display: flex; flex-direction: column; align-items: center; padding-bottom: 14px; }
.ricon { position: relative; display: flex; width: 100%; justify-content: center; flex: none; }
.rib { position: relative; display: flex; align-items: center; justify-content: center; }
.rbar { position: absolute; top: 50%; transform: translateY(-50%); width: 3px; border-radius: 3px; background: var(--ember); box-shadow: 0 0 10px var(--ember); display: block; }
.rbadge { position: absolute; right: -3px; top: -3px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--ember); color: var(--onFill);
          font-size: 8.5px; display: flex; align-items: center; justify-content: center; box-shadow: 0 0 8px var(--ember); }

/* Reactor Core status strip */
.strip { flex: none; padding: 18px 22px 0; }

/* ---------- Overview pieces (designs-a) ---------- */
.ckwell { background: var(--well); box-shadow: inset 0 0 0 1px var(--l22); clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); display: flex; }
.tile { flex: 1 1 0; flex-direction: column; align-items: center; gap: 6px; padding: 11px 0; }
.tile b { font-size: 26px; }
.tile span { font-size: 9px; font-weight: 600; letter-spacing: 1.4px; color: var(--t3); }
.axis { display: flex; justify-content: space-between; font-size: 10px; color: var(--t3); }
.legend { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; }
.leg { display: flex; align-items: center; gap: 8px; min-width: 0; }
.leg > i { width: 8px; height: 8px; border-radius: 2px; flex: none; display: block; }
.fdabox { display: flex; gap: 8px; align-items: flex-start; padding: 10px 12px 10px 14px; border-radius: 3px 10px 3px 10px; background: rgba(232,179,65,.07); box-shadow: inset 3px 0 0 var(--warn), inset 0 0 0 1px rgba(232,179,65,.28); }
.rgauge { position: relative; flex: none; }
.rpanel { position: relative; width: 100%; height: 100%; }
.rcore { pointer-events: none; }
.hub { position: relative; width: 120px; height: 120px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
       box-shadow: 0 0 18px var(--hg0); animation: hubB 2s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); }
.hubin { position: absolute; inset: 0; border-radius: 50%; box-shadow: inset 0 0 0 1px var(--hi0); animation: hubI 2s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); display: block; }
@keyframes hubB { to { box-shadow: 0 0 44px var(--hg1); } }
@keyframes hubI { to { box-shadow: inset 0 0 0 1px var(--hi1); } }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.rtile { position: relative; display: flex; overflow: hidden; background: var(--e5); box-shadow: inset 0 0 0 1px var(--l16); border-radius: 3px 10px 3px 10px; text-align: left; }
.rbarline { position: absolute; left: 0; bottom: 0; height: 2px; background: var(--barG); box-shadow: 0 0 8px var(--ember); display: block; }
.rstep { position: relative; width: 28px; height: 28px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none;
         background: var(--hub); box-shadow: inset 0 0 0 1.5px var(--l35); color: var(--t2); }
.rstep b { font-size: 12px; }
.rstep.on { background: var(--emberG); color: var(--onFill); box-shadow: 0 0 14px var(--g60); }
.scope { position: relative; flex: none; }
.dish { position: absolute; inset: 0; border-radius: 50%; display: block; }
.blip { position: absolute; width: 0; height: 0; }
.bdot { position: absolute; left: 0; top: 0; transform: translate(-50%, -50%); border-radius: 50%; display: block; }
.btag { position: absolute; top: 0; transform: translateY(-50%); padding: 3px 6px; border-radius: 3px; font-size: 10px; font-weight: 600; white-space: nowrap; color: var(--t1); }
.rcenter { width: 136px; height: 136px; border-radius: 50%; }
.rrow { display: flex; align-items: center; gap: 12px; padding: 8px 10px; }
.tmap { position: relative; }
.tile2 { position: absolute; display: block; padding: 0; text-align: left; }
.tile2.hot { box-shadow: 0 0 18px var(--hg0); animation: hotB 2s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes hotB { to { box-shadow: 0 0 36px var(--hg1); } }
.tclip { position: absolute; inset: 0; overflow: hidden; display: block; }
.tf { position: absolute; inset: 0; display: block; }
.stripes.run { animation: stripes 1.6s linear infinite; animation-delay: calc(0s - var(--clock, 0s)); background-size: 200% 200%; }
@keyframes stripes { from { background-position: 0 0; } to { background-position: 16px 0; } }
.hotsheen { background: linear-gradient(105deg, transparent 30%, rgba(255,255,255,.18) 45%, transparent 60%); background-size: 300% 100%; animation: hots 3.4s ease-in-out infinite; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes hots { from { background-position: 100% 0; } to { background-position: -50% 0; } }
.wm { position: absolute; right: 12px; bottom: 8px; font-size: 64px; }
.tin { position: absolute; inset: 0; padding: 12px 14px; }
.tmstep { width: 36px; height: 36px; flex: none; display: flex; align-items: center; justify-content: center; background: var(--hub); box-shadow: inset 0 0 0 1.5px var(--l30); color: var(--t2); }
.tmstep b { font-size: 14px; }
.tmstep.on { background: var(--emberG); color: var(--onFill); box-shadow: 0 0 14px var(--g60); }
.tmstep.done { color: var(--ok); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 50%, transparent); }
.rchip { font-size: 10.5px; letter-spacing: 2.6px; padding: 6px 10px; }
.pstation { position: relative; width: 44px; height: 44px; flex: none; border-radius: 50%; display: flex; align-items: center; justify-content: center; color: var(--t3);
            background: var(--hub); box-shadow: inset 0 0 0 1.5px var(--l30); }
.pstation.on { color: var(--onFill); background: var(--emberG); box-shadow: 0 0 20px var(--g60); }
.pstation.done { color: var(--ok); box-shadow: inset 0 0 0 1.5px color-mix(in srgb, var(--ok) 60%, transparent); }
.prow { display: flex; align-items: center; gap: 12px; padding: 0 12px; height: 62px; width: 100%; text-align: left; }
.acard { position: relative; overflow: hidden; flex: 1; }
.abar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--warn); display: block; }

/* designs-b */
.livepill { display: inline-flex; align-items: center; gap: 7px; height: 32px; padding: 0 12px; flex: none; }
.bigpct b { -webkit-background-clip: text; background-clip: text; color: transparent; }
.cbar { position: relative; height: 10px; }
.cbar > i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.cycles .cseg { position: relative; flex: 1 1 0; height: 100%; overflow: hidden; display: block; }
.cseg > i { position: absolute; left: 0; top: 0; bottom: 0; display: block; }
.cseg.full { background: linear-gradient(var(--flareRaw), var(--ember)) !important; box-shadow: 0 0 8px var(--g50); }
.ohg { position: relative; height: 30px; }
.ohg > i { position: absolute; top: 0; bottom: 0; display: block; }
.ohg .trk { left: 0; right: 0; }
.ohg .fil { left: 0; }
.ohg .mark100 { top: -4px; bottom: -4px; width: 2px; }
.grow { animation: grow 1.2s cubic-bezier(.2,.7,.2,1) both; transform-origin: left; }
@keyframes grow { from { transform: scaleX(0); } }
.scopes { position: relative; overflow: hidden; }
.tr.draw { stroke-dasharray: 1; animation: drawLine 1.4s ease-out both; }
@keyframes drawLine { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.beam { position: absolute; top: 0; bottom: 0; width: 2px; left: 0; display: block; animation: beam 6s linear infinite; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes beam { from { left: 0; } to { left: 100%; } }
.sl { position: absolute; font-size: 9.5px; color: var(--t3); }
.halo { position: relative; flex: none; }
.conicring { display: block; border-radius: 50%; -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px)); mask: radial-gradient(farthest-side, transparent calc(100% - 2.5px), #000 calc(100% - 2px)); }
.core { display: block; width: 300px; height: 300px; border-radius: 50%; }
.float { animation: float 4s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes float { from { transform: translate(-50%, -50%); } to { transform: translate(-50%, calc(-50% - 8px)); } }
.hchip { font-size: 11px; font-weight: 600; letter-spacing: 1px; color: var(--flare); padding: 5px 10px; margin-top: 6px; }
.hnode { position: relative; width: 44px; height: 44px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.hnode.on { background: var(--emberG); }

/* Ember Glass */
.glassbox { display: flex; align-items: center; background: var(--panelGrad); box-shadow: inset 0 0 0 1px var(--hudLine); flex: none; }
#win.light .glassbox { background: rgba(255,252,247,.62); box-shadow: inset 0 0 0 1px rgba(255,255,255,.85), 0 0 0 1px var(--l10), 0 10px 30px rgba(120,64,30,.10); }
.gring-wrap { position: relative; }
.ghub { display: block; border-radius: 50%; }
.breathe { animation: breathe 2s ease-in-out infinite alternate; animation-delay: calc(0s - var(--clock, 0s)); }
.ghub.breathe { box-shadow: 0 0 var(--h0) var(--hc); }
@keyframes breathe { to { box-shadow: 0 0 var(--h1) var(--hc); } }
.gwell { padding: 10px 12px; background: var(--well); min-width: 0; }
#win.light .gwell { background: rgba(255,255,255,.7); }
.gchips { display: flex; flex-wrap: wrap; gap: 8px; }
.gchip { height: 32px; padding: 0 12px 0 10px; display: inline-flex; align-items: center; gap: 8px; border-radius: 16px; white-space: nowrap; }
.gchip > i { display: block; flex: none; }
.gstep { width: 18px; height: 18px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex: none; }
.gstep b { font-size: 10px; }

/* Ring Stack */
.aring { position: relative; }
.arcg.draw circle { animation: ringDraw 1.2s ease-out both; animation-delay: var(--ad, 0s); }
@keyframes ringDraw { from { stroke-dasharray: 0 var(--len); } }
.tipdot.draw { animation: tipIn 1.2s ease-out both, pulseO 1.6s ease-in-out infinite alternate; animation-delay: var(--ad, 0s), calc(0s - var(--clock, 0s)); }
@keyframes tipIn { 0%, 80% { opacity: 0; } }
.ochip { font-size: 11px; font-weight: 600; padding: 4px 8px; white-space: nowrap; }
.obars { position: relative; flex: 1; min-height: 0; display: flex; flex-direction: column; }
.obars .dash { display: block; height: 1px; flex: none; }
.ogrid { position: absolute; left: 0; right: 0; top: 1px; bottom: 0; display: flex; flex-direction: column; justify-content: space-between; padding-top: 12px; }
.ogrid i { display: block; height: 1px; }
.orow { position: relative; flex: 1; display: flex; align-items: flex-end; gap: 4px; padding-top: 12px; }
.obar { flex: 1 1 0; display: block; opacity: .85; transform-origin: bottom; }
.obar.run { animation: obar 1.2s ease-in-out infinite alternate; animation-delay: calc(var(--ad) - var(--clock, 0s)); }
@keyframes obar { to { transform: scaleY(.78); } }

/* Ledger Terminal */
.ledger { line-height: 1.2; }
.lhead { height: 32px; padding: 0 14px; display: flex; align-items: center; flex: none; }
.lrow { height: 25px; display: flex; align-items: center; font-size: 11px; white-space: nowrap; }
.lrow .lt { width: 62px; flex: none; color: var(--t3); opacity: .75; }
.lrow .lv { width: 36px; flex: none; }
.lrow .lx { flex: 1; min-width: 0; color: color-mix(in srgb, var(--t1) 88%, transparent); padding-left: 12px; }
.lrow .ls { min-width: 62px; text-align: right; flex: none; color: var(--t1); }
.typein { animation: typein .25s linear both; animation-delay: var(--ad, 0s); }
@keyframes typein { from { clip-path: inset(0 100% 0 0); } to { clip-path: inset(0 0 0 0); } }
.bcursor { width: 8px; height: 15px; background: var(--ember); box-shadow: 0 0 8px var(--g60); display: block; flex: none; }
.bcursor.blink { animation: blink 1s steps(1) infinite; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes blink { 50% { opacity: 0; } }
.lgrow { height: 39px; display: flex; align-items: center; padding: 0 14px; width: 100%; font-size: 11.5px; text-align: left; background-size: 100% 1px; background-position: 0 100%; background-repeat: no-repeat; gap: 6px; }
.lchip { font-size: 10.5px; padding: 3px 6px; white-space: nowrap; flex: none; }

/* ---------- Screens ---------- */
.page { display: flex; flex-direction: column; gap: 18px; }
.shdr { display: flex; align-items: flex-start; gap: 20px; }
.shdr .l { display: flex; flex-direction: column; gap: 6px; flex: 1; min-width: 0; }
.eyebrow { font-size: 11px; font-weight: 600; letter-spacing: 2px; color: var(--flare); text-transform: uppercase; }
.stitle { font-size: 27px; font-weight: 700; color: var(--t1); line-height: 1.3; }
.ssub { font-size: 12.5px; color: var(--t2); }
.shdr .r { display: flex; gap: 8px; flex: none; }
.card { position: relative; padding: 18px; min-width: 0; background: linear-gradient(var(--fill, var(--surface)), var(--inset)); box-shadow: inset 0 0 0 1px var(--hudLine); border-radius: 4px 16px 4px 16px; }
#win.dark .card { background: linear-gradient(color-mix(in srgb, var(--fill, var(--surface)) 100%, transparent), var(--inset)); }
.bline { display: block; height: 1px; background: var(--border); flex: none; }
.vrule { display: block; width: 1px; height: 46px; background: var(--border); flex: none; }
.sum { display: flex; align-items: center; gap: 30px; }
.sum .big { font-size: 30px; font-weight: 700; }
.capt { font-size: 10px; font-weight: 600; color: var(--t2); white-space: nowrap; }
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat .lbl { font-size: 10px; font-weight: 600; letter-spacing: 1.3px; text-transform: uppercase; color: var(--t2); white-space: nowrap; }
.stat b { font-size: 18px; white-space: nowrap; }
.sum .tr { margin-left: auto; display: flex; flex-direction: column; align-items: flex-end; gap: 5px; }
.sum .tr b { font-size: 12.5px; font-weight: 600; }
.cathead { display: flex; align-items: center; gap: 12px; padding: 12px 14px; width: 100%; }
.cathead .t { font-size: 13.5px; font-weight: 600; }
.cathead .d { font-size: 11px; color: var(--t2); line-height: 1.25; }
.rev { font-size: 9px; font-weight: 700; color: var(--warn); padding: 2px 5px; border-radius: 3px; background: rgba(232,179,65,.16); line-height: 1; }
.cathead .n { font-size: 11px; font-weight: 500; color: var(--t3); white-space: nowrap; }
.cathead .b { font-size: 12.5px; font-weight: 700; color: var(--t3); width: 84px; text-align: right; white-space: nowrap; }
.cathead .on { color: var(--brand); }
.cathead .chev { width: 14px; display: flex; justify-content: center; color: var(--t2); }
.catbody { padding: 14px; display: flex; flex-direction: column; gap: 8px; }
.catbody .ex { font-size: 11px; color: var(--t2); flex: 1; min-width: 0; }
.files { display: flex; flex-direction: column; gap: 2px; }
.frow { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; }
.frow.sel { background: color-mix(in srgb, var(--brand) 10%, transparent); }
.frow .cb { color: var(--t3); display: flex; }
.frow.sel .cb { color: var(--brand); }
.frow .fi { width: 16px; display: flex; justify-content: center; color: var(--t3); }
.frow .nm { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.frow .nm b { font-size: 12.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .nm span { font-size: 10.5px; color: var(--t3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.frow .k { width: 110px; font-size: 11px; color: var(--t2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: none; }
.frow .dt { width: 80px; font-size: 11px; color: var(--t2); flex: none; }
.frow .sz { width: 78px; font-size: 12px; font-weight: 600; text-align: right; flex: none; white-space: nowrap; }
.frow .rv { color: var(--t3); }
.lhead2 { display: flex; align-items: center; gap: 10px; padding: 10px 20px; }
.lhead2 span { font-size: 10px; font-weight: 600; color: var(--t2); }
.ctl { display: flex; flex-direction: column; gap: 14px; }
.ctl .grp { display: flex; flex-direction: column; gap: 5px; }
.popf { display: flex; flex: none; justify-content: center; }
.popup { display: inline-flex; align-items: center; justify-content: space-between; gap: 12px; height: 24px; padding: 0 8px 0 12px; border-radius: 5px; font-size: 13px; white-space: nowrap; color: var(--t1);
         background: rgba(255,255,255,.1); box-shadow: inset 0 .5px 0 rgba(255,255,255,.08); }
#win.light .popup { background: #fff; box-shadow: 0 0 0 .5px rgba(0,0,0,.2), 0 1px 1.5px rgba(0,0,0,.12); }
.popup svg { color: var(--t2); }
.menu { position: absolute; z-index: 40; min-width: 120px; padding: 5px; border-radius: 9px; background: rgba(38,32,28,.97); color: #F5EEE8;
        box-shadow: 0 0 0 .5px rgba(255,255,255,.14), 0 10px 30px rgba(0,0,0,.45); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); }
#win.light .menu { background: rgba(250,248,246,.98); color: #1D1712; box-shadow: 0 0 0 .5px rgba(0,0,0,.14), 0 10px 30px rgba(0,0,0,.2); }
.menu button { display: flex; align-items: center; gap: 6px; width: 100%; height: 22px; padding: 0 12px 0 6px; border-radius: 5px; font-size: 13px; white-space: nowrap; }
.menu button .ck { width: 13px; display: flex; justify-content: center; }
.menu button:hover, .menu button:focus-visible { background: #0A64D8; color: #fff; outline: none; }
.sett { display: flex; flex-direction: column; gap: 14px; }
.stt { font-size: 14px; font-weight: 700; }
.srow { display: flex; align-items: flex-start; gap: 16px; }
.srow .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.srow .tx b { font-size: 12.5px; font-weight: 600; }
.srow .tx span { font-size: 11.5px; color: var(--t2); }
.banner { display: flex; align-items: flex-start; gap: 12px; padding: 14px; background: var(--surfaceAlt); border-radius: 4px 16px 4px 16px;
          box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--tint, var(--warn)) 45%, transparent); }
.banner > svg { color: var(--tint, var(--warn)); margin-top: 1px; }
.banner .tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.banner .tx b { font-size: 13px; font-weight: 600; }
.banner .tx span { font-size: 12px; color: var(--t2); }
.catset { display: flex; flex-direction: column; gap: 9px; }
.catset .h { font-size: 12.5px; font-weight: 600; }
.cs { display: flex; align-items: center; gap: 10px; }
.cs .ic { width: 16px; display: flex; justify-content: center; color: var(--brand); }
.cs .tx { flex: 1; display: flex; flex-direction: column; gap: 1px; }
.cs .tx b { font-size: 12px; font-weight: 400; }
.cs .tx span { font-size: 10.5px; color: var(--t3); }
.thead { font-size: 10.5px; font-weight: 600; letter-spacing: 1.8px; color: var(--flare); }
.modes { display: flex; max-width: 380px; background: var(--inset); box-shadow: inset 0 0 0 1px var(--hudLine); }
.mseg { flex: 1 1 0; padding: 7px 0; text-align: center; font-size: 12px; color: var(--t2); }
.mseg.on { background: var(--accentH); color: var(--onFill); font-weight: 600; }
.cchip { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.cring { padding: 4px; border-radius: 50%; display: block; }
.cring.on { box-shadow: inset 0 0 0 2px var(--t1); }
.cring i { width: 40px; height: 40px; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.cname { width: 74px; font-size: 10.5px; text-align: center; color: var(--t1); }
.cchip[aria-pressed="true"] .cname { letter-spacing: .3px; }
.dgrid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 14px; }
.dcard { display: flex; flex-direction: column; gap: 6px; min-width: 0; text-align: left; }
.dthumb { position: relative; height: 92px; border-radius: 9px; overflow: hidden; display: block; }
.dthumb img { width: 100%; height: 100%; object-fit: cover; }
.dthumb::after { content: ""; position: absolute; inset: 0; border-radius: 9px; box-shadow: inherit; pointer-events: none; }
.dsum { font-size: 10px; color: var(--t3); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ptxt { font-size: 12px; color: var(--t2); }

/* About ID card (always dark Ember) */
.idwrap { display: flex; justify-content: center; }
.idcard { position: relative; width: 640px; padding: 24px; display: flex; flex-direction: column; gap: 18px; overflow: hidden; border-radius: 6px 22px 6px 22px;
          background: radial-gradient(circle, transparent 120px, rgba(255,106,16,.08) 360px), linear-gradient(to bottom right, #1E120A 0%, #070403 60%, #070403 100%);
          box-shadow: inset 0 0 0 1px rgba(255,140,40,.5), 0 0 40px rgba(255,90,0,.22); color: #F5EEE8; }
.idtop { display: flex; align-items: center; gap: 24px; position: relative; z-index: 1; }
.ring { position: relative; width: 182px; height: 182px; flex: none; }
.ring .arc { position: absolute; inset: 0; border-radius: 50%; animation: spin 6s linear infinite; animation-delay: calc(0s - var(--clock, 0s));
             background: conic-gradient(from 90deg, transparent 0 12%, #FF4E00 30%, #FFB020 55%, transparent 75% 100%);
             -webkit-mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px)); mask: radial-gradient(farthest-side, transparent calc(100% - 6px), #000 calc(100% - 6px));
             filter: drop-shadow(0 0 10px rgba(255,106,16,.9)); }
.ring .dash { position: absolute; inset: 12px; border-radius: 50%; border: 1px dashed rgba(255,140,60,.3); animation: spin60 6s linear infinite; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes spin60 { to { transform: rotate(-60deg); } }
.idname { font-size: 36px; font-weight: 700; color: #FFE3C2; text-shadow: 0 0 12px rgba(255,106,16,.9), 0 0 32px rgba(255,78,0,.5); }
.idtag { font-size: 12px; font-weight: 500; letter-spacing: 1px; color: #FF9A4A; padding-top: 7px; }
.fields { display: flex; flex-direction: column; gap: 6px; margin-top: 16px; }
.field { display: flex; align-items: baseline; gap: 12px; }
.field span { width: 176px; flex: none; font: 600 11px/1 "Oxanium", sans-serif; letter-spacing: 1.1px; color: #9C8574; text-transform: uppercase; white-space: nowrap; }
.field b { font: 600 13.5px/14px "Oxanium", sans-serif; color: #F5EEE8; }
.codes { display: flex; align-items: center; gap: 12px; position: relative; z-index: 1; }
.codes .bars { flex: 1 1 0; min-width: 0; width: 0; height: 40px; opacity: .75; filter: drop-shadow(0 0 4px rgba(255,140,40,.6)); }
.codes .qr { width: 64px; height: 64px; border-radius: 3px; overflow: hidden; flex: none; box-shadow: 0 0 14px rgba(255,140,40,.35); }
.idchip { position: absolute; top: 22px; right: 24px; width: 50px; height: 37px; opacity: .92; z-index: 1; pointer-events: none; filter: drop-shadow(0 0 3.5px rgba(255,140,40,.55)); }
.holo { position: absolute; top: -100%; height: 300%; left: 34%; width: 32%; pointer-events: none; z-index: 2; filter: blur(10px);
        background: linear-gradient(to right, transparent, rgba(255,200,120,.05) 30%, rgba(255,200,120,.14) 50%, rgba(255,106,16,.05) 70%, transparent);
        transform: translateX(-312%) rotate(20deg); animation: holo 5s ease-in-out infinite; animation-delay: calc(0s - var(--clock, 0s)); }
@keyframes holo { from { transform: translateX(-312%) rotate(20deg); } to { transform: translateX(312%) rotate(20deg); } }

/* Sheets, toast */
#sheetLayer { position: absolute; inset: 0; z-index: 30; display: none; background: rgba(0,0,0,.28); }
#win.light #sheetLayer { background: rgba(0,0,0,.12); }
#sheetLayer.open { display: block; }
#sheetLayer.anim { animation: fadeIn .2s ease-out; }
.sheet { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); background: var(--bg); color: var(--t1); border-radius: 16px;
         box-shadow: 0 0 0 1px rgba(128,128,128,.25), 0 22px 60px rgba(0,0,0,.55); padding: 22px; display: flex; flex-direction: column; gap: 16px; max-height: 740px; }
#sheetLayer.anim .sheet { animation: sheetIn .28s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetIn { from { transform: translate(-50%, calc(-50% - 24px)); opacity: 0; } to { transform: translate(-50%, -50%); opacity: 1; } }
@keyframes fadeIn { from { opacity: 0; } }
.shd { display: flex; align-items: center; gap: 12px; }
.shd .tx { display: flex; flex-direction: column; gap: 3px; }
.shd .tx b { font-size: 17px; font-weight: 700; }
.shd .tx span { font-size: 12px; color: var(--t2); }
.stats3 { display: flex; justify-content: space-between; }
.sumlist { height: 118px; overflow-y: auto; display: flex; flex-direction: column; gap: 5px; padding: 2px 0; }
.sumrow { display: flex; align-items: center; gap: 8px; }
.sumrow .ic { width: 16px; display: flex; justify-content: center; color: var(--brand); }
.sumrow .t { font-size: 12px; }
.sumrow .c { margin-left: auto; font-size: 11px; color: var(--t2); }
.sumrow .b { width: 80px; text-align: right; font-size: 12px; font-weight: 600; }
.sfoot.s, .sheet .sfoot { display: flex; flex-direction: row; align-items: center; gap: 8px; padding: 0; font-size: 13px; color: inherit; }
.tbox { display: flex; align-items: flex-start; gap: 12px; padding: 14px; border-radius: 9px; background: var(--surfaceAlt); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--brand) 30%, transparent); }
.tbox .tx { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.tbox .tx b { font-size: 13px; font-weight: 600; }
.tbox .tx span { font-size: 11.5px; color: var(--t2); }
#toast { position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 50; padding: 7px 14px; border-radius: 8px; font-size: 12px;
         background: rgba(30,20,14,.94); color: #F5EEE8; box-shadow: 0 0 0 1px rgba(255,122,40,.3), 0 8px 24px rgba(0,0,0,.4); opacity: 0; transition: opacity .2s; pointer-events: none; white-space: nowrap; }
#toast.show { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
  .sweepband, .sheen, .holo, .beam { display: none !important; }
}

/* 01.09: HUDSegmented, Settings notes */
.hseg { flex: none; }
.hseg .mseg { padding: 7px 8px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.snote { font-size: 11.5px; color: var(--t2); }
/* Battery › Health history (HealthTrendChart) */
.hchart { display: flex; flex-direction: column; gap: 4px; }
.hcy { width: 34px; flex: none; align-items: flex-end; font-size: 9px; color: var(--t3); }
.hcx { padding-left: 40px; font-size: 9px; color: var(--t3); }
.hcplot { position: relative; flex: 1; min-width: 0; border-radius: 4px; background: var(--well); }
.hcplot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.hcline { filter: drop-shadow(0 0 4px var(--g60)); }
.hcdot { position: absolute; width: 7px; height: 7px; margin: -3.5px 0 0 -3.5px; border-radius: 50%; background: var(--flare); box-shadow: 0 0 8px var(--g90); }
/* RemovalProgressSheet */
.sheet.rsheet { gap: 0; align-items: center; }
.rring { position: relative; width: 140px; height: 140px; margin: 6px 0; flex: none; }
.rring svg { display: block; }
.rring .abs-c { position: absolute; inset: 0; left: 0; top: 0; transform: none; display: flex; align-items: center; justify-content: center; }
.rring .rcheck2 { margin-top: 2px; overflow: visible; }
.rfacts { width: 340px; gap: 7px; padding: 10px 0; }
.rnote { font-size: 12px; color: var(--t2); text-align: center; padding-bottom: 12px; }
/* NSAlert over the progress window */
.nsalert { position: absolute; left: 50%; top: 290px; transform: translateX(-50%); z-index: 2; width: 260px; padding: 20px 16px 16px; border-radius: 12px; display: flex; flex-direction: column; align-items: center; gap: 8px; text-align: center;
  background: var(--bg); color: var(--t1); box-shadow: 0 0 0 .5px rgba(128,128,128,.4), 0 18px 50px rgba(0,0,0,.5); }
.nsalert b { font-size: 13px; font-weight: 700; }
.nsalert span { font-size: 11px; color: var(--t1); padding-bottom: 6px; }
.nsb { width: 100%; height: 26px; border-radius: 6px; font-size: 13px; color: var(--t1); background: rgba(128,128,128,.22); }
.nsb.def { background: #0A7AFF; color: #fff; }
/* Tools (ToolsView.swift) */
.treadings { gap: 12px; align-items: flex-start; }
.treading { flex: 1 1 0; min-width: 0; gap: 3px; }
.treading > span { font-size: 9.5px; letter-spacing: 1.2px; color: var(--t3); }
.treading > b { font-size: 17px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.treading > b.nr { font-size: 13px; color: var(--t3); }
.treading > i { font-style: normal; font-size: 10.5px; color: var(--t2); white-space: nowrap; }
.ttag { flex: none; padding: 2px 5px; border-radius: 3px; font-size: 9px; font-weight: 700; color: var(--tc); background: var(--tb); white-space: nowrap; }
.spinr { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--l20); border-top-color: var(--t2); animation: spin 0.9s linear infinite; flex: none; width: 10px; height: 10px; margin: 3px; }
.smrow { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; }
.smrow.open { cursor: pointer; }
.smrow.open:hover { background: var(--e6); }
.smic { width: 18px; flex: none; display: flex; justify-content: center; }
.smn { width: 230px; flex: none; font-size: 12.5px; font-weight: 500; }
.smbar { flex: 1; min-width: 0; }
.smsz { width: 92px; flex: none; text-align: right; font-size: 13px; white-space: nowrap; }
.smrv { color: var(--t3); display: flex; flex: none; }
.smch { width: 12px; flex: none; display: flex; justify-content: center; }
.strow { display: flex; align-items: center; gap: 10px; padding: 6px 10px; }
.unrow { display: flex; align-items: center; gap: 12px; width: 100%; padding: 6px 10px; border-radius: 6px; text-align: left; color: var(--t1); }
.unrow.on { background: var(--e8); }
.appic { flex: none; border-radius: 22%; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 14px; font-weight: 700; box-shadow: inset 0 0 0 .5px rgba(0,0,0,.2), 0 1px 2px rgba(0,0,0,.25); }
.unrev { gap: 8px; padding: 8px 10px 8px 50px; }

/* Clickable workflow steps: pointing hand, a little brighter under the pointer. */
[data-step] { cursor: pointer; }
[data-step]:hover { filter: brightness(1.08); }
