/* The Panel style's live screen, after the app's pages/live/panel_cards.dart, panel_paint.dart,
   widgets/panel_parts.dart and flip_clock.dart: timings and proportions are the app's. */
:root[data-style="panel"] {
  /* Dial faces: cream by day; lit green at night (the app's "Dial lighting"). */
  --face-light: #f5eedb; --face-dark: #d9ccad; --ink: #1d1b17; --ink-soft: #4b463b; --needle: #c43a22; --tick-glow: transparent;
}
:root[data-style="panel"][data-night="1"] {
  --face-light: #14251c; --face-dark: #07100b; --ink: #a6f5bd; --ink-soft: #7fd39a; --needle: #ff8a55;
  --tick-glow: color-mix(in srgb, #a6f5bd 22%, transparent);
}
.pn { font-family: 'Oswald', var(--font-sys); }
.pn-label { font-family: 'Oswald', var(--font-sys); font-size: 11px; letter-spacing: 1.6px; color: var(--muted); }
.pn-mono { font-family: 'RobotoMono', ui-monospace, monospace; font-variant-numeric: tabular-nums; font-size: 15px; color: var(--fg); }

/* A plate set into the panel: a darker recess (PanelPlate). */
.pn-plate { padding: 12px; border-radius: 10px; background: color-mix(in srgb, var(--bg) 65%, #000);
  border: 1px solid #0009; box-shadow: 0 1px 0 #ffffff0d; }
:root[data-mode="light"] .pn-plate { background: color-mix(in srgb, var(--bg) 93%, #000); border-color: var(--line); box-shadow: 0 1px 0 #ffffff99; }

/* ---- dials ---- */
.pn-dial { position: relative; margin: 0 auto; }
.pn-dial svg { display: block; width: 100%; height: 100%; overflow: visible; }
.pn-dial .labels text { transform-box: fill-box; transform-origin: center; }
.pn-dial .labels.old text { animation: pnLabelOut .65s cubic-bezier(.42, 0, 1, 1) both; }
.pn-dial .labels.new text { animation: pnLabelIn .49s .16s cubic-bezier(0, 0, .58, 1) both; }
@keyframes pnLabelOut { to { opacity: 0; transform: scale(1.35); } }
@keyframes pnLabelIn { from { opacity: 0; transform: scale(.8); } }
.pn-dial .over { position: absolute; left: 0; right: 0; display: flex; justify-content: center; align-items: center; }
.pn-dial .over .pn-label { color: var(--ink-soft); letter-spacing: .5px; }
.pn-dial .over .pn-label.now { color: var(--ink); }

/* ---- drum counters: each digit rolls up to the next (380 ms) ---- */
.pn-drums { display: inline-flex; gap: 2px; padding: 3px; background: #0d0c0b; border-radius: 4px; box-shadow: 0 1px 0 #000; --h: 28px; }
.pn-drums > span { position: relative; width: calc(var(--h) * .72); height: var(--h); border-radius: 2px; overflow: hidden;
  background: linear-gradient(#050505, #2b2b2b 30%, #343434 50%, #2b2b2b 70%, #050505); }
.pn-drums > span.red { background: linear-gradient(#3a0703, #9b1f12 30%, #b02a18 50%, #9b1f12 70%, #3a0703); }
.pn-drums b { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'RobotoMono', ui-monospace, monospace; font-weight: 700; font-size: calc(var(--h) * .64); line-height: 1; color: #f2eee4; }
.pn-drums b.in { animation: pnRollIn .38s cubic-bezier(.25, .1, .25, 1) both; }
.pn-drums b.out { animation: pnRollOut .38s cubic-bezier(.25, .1, .25, 1) both; }
@keyframes pnRollIn { from { transform: translateY(100%); } }
@keyframes pnRollOut { to { transform: translateY(-100%); } }

/* ---- the split-flap clock (FlipClock, 460 ms a flip) ---- */
.pn-clock { display: flex; justify-content: center; gap: 8px; --h: 52px; }
.pn-clock .win { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pn-clock .glass { position: relative; padding: calc(var(--h) * .07); background: #0a0a0a; border: 1.5px solid #3a3936;
  border-radius: calc(var(--h) * .12); box-shadow: 0 3px 0 #0008; }
.pn-clock .glass::after { content: ''; position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: linear-gradient(#ffffff1f, transparent 45%); }
.pn-clock .unit { font-size: calc(var(--h) * .2); letter-spacing: 1.5px; color: var(--muted); }
.pn-flap { position: relative; width: calc(var(--h) * 1.05); height: var(--h); perspective: calc(var(--h) * 3); }
.pn-flap .half { position: absolute; left: 0; right: 0; height: 50%; overflow: hidden; backface-visibility: hidden; }
.pn-flap .half.top { top: 0; transform-origin: bottom; border-radius: calc(var(--h) * .07) calc(var(--h) * .07) 0 0; }
.pn-flap .half.bot { bottom: 0; transform-origin: top; border-radius: 0 0 calc(var(--h) * .07) calc(var(--h) * .07); }
.pn-flap .half > span { position: absolute; left: 0; right: 0; height: var(--h); display: flex; align-items: center; justify-content: center;
  background: linear-gradient(#2a2a2a, #1c1c1c 49%, #151515 51%, #222); font-weight: 600; font-size: calc(var(--h) * .72);
  line-height: 1; color: #f4f1ea; font-variant-numeric: tabular-nums; font-family: var(--font-sys); }
.pn-flap .half.top > span { top: 0; }
.pn-flap .half.bot > span { bottom: 0; }
.pn-flap .half::after { content: ''; position: absolute; inset: 0; background: #000; opacity: 0; }
.pn-flap .fold.top { z-index: 2; animation: pnFoldTop .23s cubic-bezier(.42, 0, 1, 1) both; }
.pn-flap .fold.bot { z-index: 2; animation: pnFoldBot .23s .23s cubic-bezier(0, 0, .58, 1) both; }
.pn-flap .fold.top::after { animation: pnShadeIn .23s both; }
.pn-flap .fold.bot::after { animation: pnShadeOut .23s .23s both; }
@keyframes pnFoldTop { to { transform: rotateX(-90deg); } }
@keyframes pnFoldBot { from { transform: rotateX(90deg); } }
@keyframes pnShadeIn { to { opacity: .35; } }
@keyframes pnShadeOut { from { opacity: .35; } }
.pn-flap .split { position: absolute; left: 0; right: 0; top: calc(50% - .5px); height: max(1px, calc(var(--h) * .025)); background: #000; z-index: 3; }
.pn-flap .pin { position: absolute; top: calc(50% - var(--h) * .07); width: calc(var(--h) * .05); height: calc(var(--h) * .14); background: #55534e; z-index: 3; }
.pn-flap .pin.r { right: 0; }

/* ---- neon glow lamps (NeonLamp): strike up in 160 ms, die in 320 ms, never quite steady ---- */
.pn-lamp { --size: 30px; --c: #5fd068; position: relative; width: calc(var(--size) * .72); height: var(--size); flex: none; }
.pn-lamp .halo { position: absolute; left: 50%; top: 41%; width: calc(var(--size) * 1.5); height: calc(var(--size) * 1.5); translate: -50% -50%;
  border-radius: 50%; background: radial-gradient(closest-side, color-mix(in srgb, var(--c) 38%, transparent), transparent); }
.pn-lamp .glass { position: absolute; left: 8%; width: 84%; top: 0; height: 82%;
  border-radius: calc(var(--size) * .3) calc(var(--size) * .3) calc(var(--size) * .086) calc(var(--size) * .086);
  background: linear-gradient(90deg, #151513, #2e2e2b, #151513); overflow: hidden; }
.pn-lamp .light { position: absolute; inset: 0; background: radial-gradient(circle at 50% 50%, color-mix(in srgb, var(--c) 75%, transparent),
  color-mix(in srgb, var(--c) 12%, transparent) 75%); }
.pn-lamp .el { position: absolute; top: 20%; height: 44%; width: max(1.5px, calc(var(--size) * .094)); border-radius: 99px; background: #55534e;
  translate: -50% 0; transition: background-color .32s, box-shadow .32s; }
.pn-lamp .el.a { left: 32%; } .pn-lamp .el.b { left: 68%; }
.pn-lamp .socket { position: absolute; left: 14%; width: 72%; top: 78%; height: 22%; border-radius: calc(var(--size) * .043);
  background: linear-gradient(90deg, #2a2a27, #8b8a85 45%, #2a2a27); }
.pn-lamp .hl { position: absolute; left: 20%; top: 6%; width: 14%; height: 60%; border-radius: 99px; background: linear-gradient(90deg, #fff6, transparent); }
.pn-lamp .halo, .pn-lamp .light { opacity: 0; transition: opacity .32s; }
.pn-lamp.on .halo, .pn-lamp.on .light { opacity: 1; transition-duration: .16s; }
.pn-lamp.on .el { background: color-mix(in srgb, var(--c) 35%, #fff); box-shadow: 0 0 calc(var(--size) * .12) var(--c); transition-duration: .16s; }
.pn-lamp.small .el { display: none; }
.pn-lamp.on .glow { animation: pnFlicker 4.1s infinite; animation-delay: var(--dly, 0s); }
.pn-lamp .glow { position: absolute; inset: 0; }
@keyframes pnFlicker { 0%, 100% { opacity: 1; } 31% { opacity: .97; } 32% { opacity: .82; } 33.5% { opacity: 1; } 70% { opacity: .96; }
  71% { opacity: .84; } 71.8% { opacity: .98; } 72.6% { opacity: .86; } 73.5% { opacity: 1; } }
.pn-lamps { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); }
.pn-lamps > div { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.pn-lamps .pn-label { font-size: 10.5px; }
.pn-lamps .lit .pn-label { color: var(--fg); }

/* ---- the hero, meters and counters ---- */
.pn-hero { container-type: inline-size; text-align: center; }
.pn-hero .when { margin: 8px 0 6px; font-size: 13px; letter-spacing: 3px; }
.pn-hero .when.active { color: var(--accent-text); }
.pn-meters { display: flex; justify-content: space-evenly; align-items: flex-start; gap: 12px; container-type: inline-size; }
.pn-meters > div { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.pn-range { display: flex; align-items: center; gap: 6px; }
.pn-range .pn-label { font-size: 10.5px; }
.pn-counters { display: flex; justify-content: space-between; align-items: flex-end; gap: 10px; margin-top: 14px; }
.pn-counters > div { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.pn-counters > div.end { align-items: flex-end; }
.pn-counters .pn-label { font-size: 10.5px; }
.pn-cycles { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.pn-cycles .pn-label { font-size: 10.5px; }

/* ---- cells: an edgewise strip meter per cell ---- */
.pn-cells .head { display: flex; align-items: center; gap: 10px; }
.pn-cells .head .title { flex: 1; font-size: 15px; letter-spacing: 4px; font-weight: 600; color: var(--fg); }
.pn-cells .head .pn-mono { font-size: 13px; color: var(--muted); }
.pn-key { width: 72px; height: 34px; border: 0; border-radius: 3px 3px 6px 6px; cursor: pointer; color: #26251f;
  font-family: 'Oswald', var(--font-sys); font-size: 11.5px; letter-spacing: 1.4px; font-weight: 500; text-transform: uppercase;
  background: linear-gradient(#f2f1ec, #bdbcb5); box-shadow: 0 4px 0 #3b3a35, 0 5px 6px #00000089;
  transition: transform .11s, box-shadow .11s, background .11s; }
.pn-key[aria-pressed="true"] { transform: translateY(3px); background: linear-gradient(#a9a8a1, #d7d6cf); box-shadow: 0 1px 0 #3b3a35; }
.pn-cells .stopline { margin-top: 6px; font-size: 12.5px; letter-spacing: 1px; color: var(--accent-text); }
.pn-cells .stopline.near { color: var(--warn); }
.pn-cells .note { font-size: 11px; color: var(--muted); }
.pn-cells .fine-note { margin-top: 6px; font-size: 12px; color: var(--muted); }
.pn-strips { display: grid; gap: 12px 8px; margin-top: 10px; }
.pn-strip { display: flex; flex-direction: column; align-items: center; min-width: 0; }
.pn-strip > .pn-lamp { margin-bottom: 6px; }
.pn-strip .meter { position: relative; width: 100%; height: 210px; border-radius: var(--r, 6px);
  background: linear-gradient(90deg, #5f5e59, #ecebe6 45%, #8b8a85 65%, #f6f6f3);
  outline: 2px solid transparent; transition: outline-color .3s; }
.pn-strips.dense .meter { height: 150px; }
.pn-strip.ringed .meter { outline-color: #c43a22; }
.pn-strip .face { position: absolute; inset: var(--pad, 4px); border-radius: 3px; overflow: hidden;
  background: linear-gradient(var(--face-light), var(--face-dark)); }
.pn-strip .zone { position: absolute; right: 0; width: 5px; }
.pn-strip .zone.hi { top: 6px; background: #c43a22; }
.pn-strip .zone.lo { bottom: 6px; background: #d58a1c; }
.pn-strip .scale { position: absolute; left: 0; right: 0; top: 6px; bottom: 6px; }
.pn-strip .tick { position: absolute; left: 0; width: 7px; height: 1.2px; translate: 0 50%; background: var(--ink); }
.pn-strip .tick.major { width: 12px; height: 2.2px; }
.pn-strip .mark { position: absolute; left: 15px; translate: 0 50%; font-size: 10.5px; font-weight: 500; color: var(--ink); line-height: 1; }
.pn-strips.dense .mark, .pn-strips.unlabelled .mark { display: none; }
.pn-strip .glass { position: absolute; inset: 0; background: linear-gradient(90deg, #ffffff42, transparent 50%); pointer-events: none; }
.pn-strip .track { position: absolute; left: calc(var(--pad, 4px) - 2px); right: calc(var(--pad, 4px) - 2px);
  top: calc(var(--pad, 4px) + 6px); bottom: calc(var(--pad, 4px) + 6px); }
.pn-strip .ptr { position: absolute; left: 0; right: 0; height: 3px; bottom: 0; translate: 0 50%; background: var(--needle);
  box-shadow: 0 2px 0 #00000038; transition: bottom var(--ms, 1300ms) cubic-bezier(.3, 1.4, .5, 1); }
.pn-strip .stop { position: absolute; left: 0; right: 0; height: 2px; translate: 0 50%; opacity: 0; transition: opacity .35s;
  background: repeating-linear-gradient(90deg, #c43a22 0 3.5px, transparent 3.5px 6px); }
.pn-cells.charging:not(.fine) .stop { opacity: 1; }
.pn-strip .v { margin-top: 6px; font-size: 13px; white-space: nowrap; }
.pn-strip.warn .v { color: var(--danger-soft); }
.pn-strip .pn-label { font-size: 10px; white-space: nowrap; }

/* ---- temperatures ---- */
.pn-temps { display: grid; gap: 10px 8px; justify-items: center; }
.pn-temps > div { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 110px; }
.pn-temps .pn-mono { font-size: 13px; margin-top: 2px; }
.pn-temps .pn-label { font-size: 10px; }

/* ---- the protection banner: a riveted metal plate (PanelWarning) ---- */
.pn-warn { position: relative; display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-radius: 8px;
  background: linear-gradient(#d9d8d2, #b4b3ac 48%, #c9c8c1 52%, #9c9b94); box-shadow: 0 2px 0 #000; }
.pn-warn .screw { position: absolute; width: 9px; height: 9px; margin: 6px; border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #f5f5f2, #6e6d68); }
.pn-warn .screw::after { content: ''; position: absolute; left: 1.5px; top: 3.9px; width: 6px; height: 1.2px; background: #4a4944; rotate: 34deg; }
.pn-warn .screw.tl { left: 0; top: 0; } .pn-warn .screw.tr { right: 0; top: 0; }
.pn-warn .screw.bl { left: 0; bottom: 0; } .pn-warn .screw.br { right: 0; bottom: 0; }
.pn-warn .title, .pn-warn .detail { font-family: 'Oswald', var(--font-sys); color: #2b2a26; text-shadow: 0 1px 0 #ffffff8c; }
.pn-warn .title { font-size: 15px; font-weight: 600; letter-spacing: 2px; text-transform: uppercase; }
.pn-warn .detail { font-size: 13px; letter-spacing: .3px; margin-top: 4px; }
.reveal.open .pn-warn .pn-lamp { animation: pnTrip 1.6s step-end both; }
@keyframes pnTrip { 0% { opacity: 1; } 12.5% { opacity: .3; } 25% { opacity: 1; } 37.5% { opacity: .3; } 50% { opacity: 1; } 62.5% { opacity: .3; } 75% { opacity: 1; } }
