/* ============================================================
   BGRTX SPV · HTML5 + CSS · 100% GRIN
   Free SPV surface · rides BGF · never folds into field
   No plastic chrome · raised SDF shells · dark neon
   Cascade vars = live tokens · |1 spirit in odd-friendly units
   ============================================================ */

/* --- design tokens (BGF-ish deltas as CSS custom props) --- */
:root {
  /* ground / ink */
  --bgs-bg: #050607;
  --bgs-bg2: #0a0c0b;
  --bgs-ink: #e8e4df;
  --bgs-mute: #8a9188;
  --bgs-line: #1e2822;

  /* neon RGB */
  --spv-r: #ff2a6d;
  --spv-g: #05f2a0;
  --spv-b: #2de2e6;
  --spv-y: #f9f871;
  --spv-grin: #e8c547; /* 100% GRIN gold truth */
  --spv-sdf: #c4788a;
  --spv-phi: #7aa2ff;
  --spv-thermo-cool: #2de2e6;
  --spv-thermo-warm: #f9f871;
  --spv-thermo-hot: #ff2a6d;

  /* BGF measure tokens (odd = live |1 friendly) */
  --bgf-gap: 9px;
  --bgf-pad: 13px;
  --bgf-radius-cut: 11px;
  --bgf-line: 1px;
  --bgf-stripe: 5px;

  /* type */
  --font-ui: "Segoe UI", system-ui, ui-sans-serif, sans-serif;
  --font-mono: ui-monospace, "Cascadia Code", "SF Mono", Menlo, monospace;

  /* motion (SPV free · not field) */
  --spv-pulse: 1.7s;
  --spv-scan: 2.3s;
}

/* --- HTML5 reset · ours --- */
*, *::before, *::after { box-sizing: border-box; }
html { height: 100%; }
body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(ellipse 90% 55% at 0% -10%, rgba(232, 197, 71, 0.12), transparent 55%),
    radial-gradient(ellipse 70% 45% at 100% 0%, rgba(5, 242, 160, 0.08), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 100%, rgba(255, 42, 109, 0.06), transparent 45%),
    var(--bgs-bg2);
  color: var(--bgs-ink);
  font-family: var(--font-ui);
  line-height: 1.45;
}

/* --- raised SDF shell (not drop-shadow plastic) --- */
/* clip-path only on chrome shells — NEVER on media player (cuts video) */
.raised-sdf,
.spv-card,
figure.spv-figure,
nav.spv-nav {
  border: var(--bgf-line) solid var(--bgs-line);
  background: linear-gradient(165deg, #121816 0%, #0c100e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45);
  clip-path: polygon(
    0 0,
    calc(100% - var(--bgf-radius-cut)) 0,
    100% var(--bgf-radius-cut),
    100% 100%,
    0 100%
  );
}

/* plugs: border/bg only · no clip (video/audio/sliders stay whole) */
.spv-dom,
article.spv-article {
  border: var(--bgf-line) solid var(--bgs-line);
  background: linear-gradient(165deg, #121816 0%, #0c100e 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.05),
    inset 0 -1px 0 rgba(0, 0, 0, 0.45);
  border-radius: 0;
  overflow: visible;
  max-width: 100%;
}

/* media-safe plug · never clip */
.spv-dom[data-plug="mp4.dom"],
.spv-player,
.spv-player * {
  clip-path: none !important;
}

/* --- HTML5 landmarks as SPV surfaces --- */
header.spv-banner {
  display: flex;
  flex-wrap: wrap;
  gap: var(--bgf-gap);
  align-items: center;
  padding: var(--bgf-pad);
  border-bottom: var(--bgf-line) solid var(--bgs-line);
  background: #0e1210;
}
header.spv-banner h1 {
  margin: 0;
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--spv-grin);
  text-shadow: 0 0 12px rgba(232, 197, 71, 0.35);
}
header.spv-banner p {
  margin: 0;
  width: 100%;
  font-size: 0.72rem;
  color: var(--bgs-mute);
  font-family: var(--font-mono);
}

nav.spv-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 11px;
  margin: var(--bgf-gap) 0;
}
nav.spv-nav a,
nav.spv-nav button {
  appearance: none;
  border: var(--bgf-line) solid var(--bgs-line);
  background: #0a0e0c;
  color: var(--bgs-ink);
  padding: 7px 11px;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  font-family: var(--font-mono);
}
nav.spv-nav a:hover,
nav.spv-nav button:hover,
nav.spv-nav a[aria-current="page"],
nav.spv-nav button[aria-pressed="true"] {
  border-color: var(--spv-grin);
  color: var(--spv-grin);
  box-shadow: 0 0 10px rgba(232, 197, 71, 0.3);
}

main.spv-main {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--bgf-gap);
  padding: var(--bgf-pad);
}
@media (min-width: 720px) {
  main.spv-main.spv-split {
    grid-template-columns: 1.4fr 0.9fr;
  }
}

article.spv-article {
  padding: calc(var(--bgf-pad) + 2px);
}
article.spv-article > header h2 {
  margin: 0 0 7px;
  font-size: 0.85rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--spv-g);
}
article.spv-article > header .meta {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--bgs-mute);
  margin-bottom: 11px;
}
article.spv-article p {
  margin: 0 0 9px;
  color: var(--bgs-ink);
  font-size: 0.9rem;
}
article.spv-article footer {
  margin-top: 11px;
  padding-top: 9px;
  border-top: var(--bgf-line) solid var(--bgs-line);
  font-size: 0.7rem;
  color: var(--bgs-mute);
  font-family: var(--font-mono);
}

section.spv-section {
  padding: var(--bgf-pad);
  border-left: 3px solid var(--spv-b);
  background: rgba(14, 18, 16, 0.85);
  margin: var(--bgf-gap) 0;
}
section.spv-section h3 {
  margin: 0 0 7px;
  font-size: 0.75rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--spv-b);
}

figure.spv-figure {
  margin: var(--bgf-gap) 0;
  padding: 0;
  overflow: hidden;
}
figure.spv-figure .spv-canvas-like {
  min-height: 120px;
  background:
    repeating-linear-gradient(
      90deg,
      var(--spv-r) 0 3px,
      var(--spv-g) 3px 6px,
      var(--spv-b) 6px 9px,
      transparent 9px 17px
    ),
    #000;
  opacity: 0.9;
}
figure.spv-figure figcaption {
  padding: 9px 11px;
  font-size: 0.7rem;
  font-family: var(--font-mono);
  color: var(--bgs-mute);
  border-top: var(--bgf-line) solid var(--bgs-line);
}

aside.spv-aside {
  padding: var(--bgf-pad);
  border: var(--bgf-line) dashed #2a3830;
  background: #080b0a;
  font-size: 0.8rem;
  color: var(--bgs-mute);
}
aside.spv-aside strong {
  color: var(--spv-grin);
  letter-spacing: 0.08em;
}

/* --- GRIN 100% truth pole --- */
.spv-grin-panel {
  border-color: rgba(232, 197, 71, 0.55);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(232, 197, 71, 0.18), transparent 60%),
    linear-gradient(165deg, #1a1810 0%, #0c0b08 100%);
}
.spv-grin-panel .spv-title {
  color: var(--spv-grin);
  letter-spacing: 0.16em;
  text-shadow: 0 0 14px rgba(232, 197, 71, 0.45);
}
.spv-grin-mark {
  display: inline-block;
  padding: 3px 9px;
  border: 1px solid var(--spv-grin);
  color: var(--spv-grin);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: grin-pulse var(--spv-pulse) ease-in-out infinite;
}
@keyframes grin-pulse {
  0%, 100% { box-shadow: 0 0 4px rgba(232, 197, 71, 0.2); }
  50% { box-shadow: 0 0 16px rgba(232, 197, 71, 0.55); }
}

/* --- generic SPV dom (existing plugs) --- */
.spv-dom {
  padding: calc(var(--bgf-pad) + 1px);
  margin: 0;
}
.spv-title {
  font-size: 0.78rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 8px;
  color: var(--spv-g);
}
.spv-stripe {
  height: var(--bgf-stripe);
  margin: 8px 0 12px;
  background: linear-gradient(90deg, var(--spv-r), var(--spv-g), var(--spv-b), var(--spv-grin));
  background-size: 200% 100%;
  animation: spv-scan var(--spv-scan) linear infinite;
}
@keyframes spv-scan {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}
.spv-body {
  color: var(--bgs-mute);
  font-size: 0.88rem;
  margin: 0 0 10px;
}
.spv-meta {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--spv-g);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}
.spv-hud {
  margin-top: 12px;
  padding: 8px 10px;
  border: 1px solid #2a3830;
  background: #050807;
  color: var(--spv-r);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
}
.spv-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px solid #1a221c;
  font-size: 0.8rem;
}
.spv-row code {
  color: var(--spv-y);
  font-family: var(--font-mono);
}
.spv-note {
  font-size: 0.72rem;
  color: var(--bgs-mute);
  margin-top: 10px;
}

/* atom color variants */
.spv-dom[data-plug="ezzie.dom"] .spv-title { color: var(--spv-b); }
.spv-dom[data-plug="phi.dom"] .spv-title { color: var(--spv-phi); }
.spv-dom[data-plug="thermo.dom"] .spv-title { color: var(--spv-thermo-warm); }
.spv-dom[data-plug="grin.dom"] .spv-title { color: var(--spv-grin); }
.spv-dom[data-plug="article.dom"] .spv-title { color: var(--spv-g); }

/* CSS grid demo surface */
.spv-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(99px, 1fr));
  gap: 7px;
  margin-top: 11px;
}
.spv-grid > div {
  min-height: 49px;
  border: 1px solid var(--bgs-line);
  background: #0a0e0c;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--spv-g);
  clip-path: polygon(0 0, calc(100% - 7px) 0, 100% 7px, 100% 100%, 0 100%);
}
.spv-grid > div:nth-child(3n) { color: var(--spv-r); border-color: rgba(255,42,109,.35); }
.spv-grid > div:nth-child(3n+1) { color: var(--spv-grin); border-color: rgba(232,197,71,.35); }

/* data table HTML5 */
table.spv-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  margin-top: 9px;
}
table.spv-table th,
table.spv-table td {
  border: 1px solid var(--bgs-line);
  padding: 6px 8px;
  text-align: left;
}
table.spv-table th {
  color: var(--spv-b);
  background: #0e1210;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
table.spv-table td { color: var(--bgs-ink); }
table.spv-table tr:nth-child(even) td { background: rgba(5, 242, 160, 0.03); }

/* progress / meter free visual */
.spv-meter {
  height: 7px;
  background: #121816;
  border: 1px solid var(--bgs-line);
  overflow: hidden;
  margin: 9px 0;
}
.spv-meter > i {
  display: block;
  height: 100%;
  width: 35%;
  background: linear-gradient(90deg, var(--spv-g), var(--spv-grin));
  animation: meter-run 2.1s ease-in-out infinite alternate;
}
@keyframes meter-run {
  from { width: 21%; }
  to { width: 89%; }
}

/* shell layout extras */
#stripe {
  height: 6px;
  background: linear-gradient(90deg, var(--spv-r), var(--spv-g), var(--spv-b), var(--spv-grin));
  background-size: 200% 100%;
  animation: spv-scan 3s linear infinite;
}
button.plug-btn.on {
  border-color: var(--spv-grin) !important;
  color: var(--spv-grin) !important;
  box-shadow: 0 0 10px rgba(232, 197, 71, 0.35) !important;
}

/* ============================================================
   HTML5_ALL · forms · media · hidden · perfect display
   ============================================================ */
.html5-all .spv-pre {
  background: #050807;
  border: 1px solid var(--bgs-line);
  padding: 11px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--spv-g);
}
.html5-all label {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
  font-size: 0.78rem;
  color: var(--bgs-mute);
}
.html5-all input[type="text"],
.html5-all input[type="search"],
.html5-all input[type="email"],
.html5-all input[type="url"],
.html5-all input[type="tel"],
.html5-all input[type="number"],
.html5-all input[type="date"],
.html5-all input[type="time"],
.html5-all input[type="password"],
.html5-all textarea,
.html5-all select {
  background: #050807;
  border: 1px solid var(--bgs-line);
  color: var(--bgs-ink);
  padding: 5px 7px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  min-width: 9rem;
}
.html5-all fieldset {
  border: 1px solid var(--bgs-line);
  padding: 11px;
  margin: 0;
}
.html5-all legend {
  color: var(--spv-grin);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding: 0 6px;
}
.html5-all button,
.html5-all input[type="submit"],
.html5-all input[type="reset"],
.html5-all input[type="button"] {
  background: #121816;
  border: 1px solid var(--bgs-line);
  color: var(--bgs-ink);
  padding: 6px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: var(--font-mono);
}
.html5-all button:hover {
  border-color: var(--spv-grin);
  color: var(--spv-grin);
}
/* video/audio base rules live in ESSIE player block below */
.spv-canvas {
  display: block;
  border: 1px solid var(--bgs-line);
  background: #000;
  margin: 9px 0;
  image-rendering: pixelated;
}
.spv-svg { display: inline-block; vertical-align: middle; margin: 6px; }
.spv-form progress,
.spv-form meter {
  width: 100%;
  max-width: 240px;
  height: 11px;
}
/* hidden existence — still in DOM; do not remove from tree */
.spv-hidden-block[hidden],
[hidden].spv-hidden-block { display: none !important; }
.spv-display-none { display: none !important; }
.spv-vis-hidden { visibility: hidden; height: 0; overflow: hidden; }
.spv-aria-hidden { /* visible to layout tests optional; keep for existence */ }
.spv-foot {
  margin-top: 13px;
  padding: 11px;
  border-top: 1px solid var(--bgs-line);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--spv-grin);
  letter-spacing: 0.08em;
}
/* perfect display density */
.html5-all {
  max-width: 52rem;
  margin: 0 auto;
}
.html5-all h2 {
  margin: 0 0 9px;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--spv-g);
}
.html5-all .spv-aside {
  margin: 11px 0;
  padding: 11px;
  border-left: 3px solid var(--spv-phi);
  background: rgba(122, 162, 255, 0.06);
  font-size: 0.82rem;
  color: var(--bgs-mute);
}
.html5-all .spv-search {
  display: block;
  margin: 11px 0;
  padding: 9px;
  border: 1px dashed var(--bgs-line);
}
.html5-all ruby {
  ruby-position: over;
  color: var(--spv-g);
}
.html5-all math {
  color: var(--spv-phi);
  font-size: 1.05em;
  margin: 0 6px;
}
.spv-clip-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
}
/* ============================================================
   ESSIE media player · dark default · rainbow theater lights
   ============================================================ */
:root {
  --player-theme: dark;
  /* file paths for local shell; pack overwrites with data URIs */
  --player-bg-dark: url("../assets/player/theme-dark.jpg");
  --player-bg-rainbow: url("../assets/player/theme-rainbow.jpg");
  --player-accent: var(--spv-grin);
  --player-track: #1a221c;
  --player-fill: var(--spv-g);
  --player-glow: rgba(232, 197, 71, 0.25);
}

.spv-video,
.spv-video-main,
video.spv-video {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  background: #000;
  border: 1px solid var(--bgs-line);
  margin: 0;
  vertical-align: top;
  object-fit: contain;
}

.spv-audio,
audio.spv-audio {
  display: block;
  width: 100%;
  max-width: 100%;
  margin: 9px 0;
  accent-color: var(--spv-g);
}

/* player shell */
.spv-player,
[data-plug="mp4.dom"].spv-player,
[data-plug="mp4.dom"] {
  position: relative;
  max-width: 52rem;
  padding: calc(var(--bgf-pad) + 2px);
  /* dark default backdrop */
  background:
    linear-gradient(180deg, rgba(5, 6, 7, 0.88) 0%, rgba(5, 6, 7, 0.94) 100%),
    var(--player-bg-dark) center / cover no-repeat,
    #050607;
  border: 1px solid var(--bgs-line);
  transition: background 0.55s ease, border-color 0.4s ease, box-shadow 0.55s ease;
}

/* RAINBOW theater lights ON */
.spv-player.theme-rainbow,
[data-plug="mp4.dom"].theme-rainbow,
[data-mode="rainbow"] .spv-player,
body.theme-rainbow [data-plug="mp4.dom"] {
  --player-accent: #ff6ad5;
  --player-fill: linear-gradient(90deg, #ff2a6d, #f9f871, #05f2a0, #2de2e6, #7aa2ff, #ff6ad5);
  --player-glow: rgba(255, 106, 213, 0.45);
  border-color: rgba(255, 106, 213, 0.55);
  box-shadow:
    0 0 0 1px rgba(45, 226, 230, 0.25),
    0 0 28px var(--player-glow),
    inset 0 0 40px rgba(122, 162, 255, 0.08);
  background:
    linear-gradient(165deg, rgba(8, 4, 16, 0.72) 0%, rgba(5, 6, 7, 0.85) 100%),
    var(--player-bg-rainbow) center / cover no-repeat,
    #0a0612;
}

.spv-player.theme-rainbow .spv-title,
[data-plug="mp4.dom"].theme-rainbow .spv-title {
  color: #ff6ad5;
  text-shadow:
    0 0 8px rgba(255, 106, 213, 0.6),
    0 0 18px rgba(45, 226, 230, 0.35);
  background: linear-gradient(90deg, #ff2a6d, #f9f871, #05f2a0, #2de2e6, #7aa2ff);
  -webkit-background-clip: text;
  background-clip: text;
  /* fallback solid if clip unsupported still has color above */
}

.spv-player-stage {
  position: relative;
  width: 100%;
  background: #000;
  border: 1px solid var(--bgs-line);
  overflow: hidden;
  /* letterbox without clipping controls outside */
  aspect-ratio: 16 / 9;
  max-height: min(70vh, 480px);
}

.spv-player-stage video,
.spv-player-stage .spv-video-main,
.spv-player-stage #spv-mp4 {
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: contain;
  border: 0;
  margin: 0;
  background: #000;
}

/* custom controls bar */
.spv-player-bar {
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 10px;
  background: #080a09;
  border: 1px solid var(--bgs-line);
  font-family: var(--font-mono);
  font-size: 0.72rem;
}

.spv-player.theme-rainbow .spv-player-bar {
  border-color: rgba(255, 106, 213, 0.35);
  background: linear-gradient(90deg, #0a0612, #080a09 40%, #0a0612);
}

.spv-player-bar button,
.spv-player-ctrl {
  appearance: none;
  background: #121816;
  border: 1px solid var(--bgs-line);
  color: var(--bgs-ink);
  padding: 6px 10px;
  font-size: 0.72rem;
  font-family: var(--font-mono);
  cursor: pointer;
  line-height: 1.2;
}

.spv-player-bar button:hover,
.spv-player-ctrl:hover {
  border-color: var(--spv-grin);
  color: var(--spv-grin);
}

.spv-player.theme-rainbow .spv-player-bar button:hover {
  border-color: #ff6ad5;
  color: #2de2e6;
  box-shadow: 0 0 10px rgba(255, 106, 213, 0.35);
}

/* smooth seek slider */
.spv-seek,
.spv-vol {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 8px;
  border-radius: 0;
  background: var(--player-track);
  outline: none;
  cursor: pointer;
  margin: 0;
  vertical-align: middle;
}

.spv-seek::-webkit-slider-thumb,
.spv-vol::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 14px;
  height: 14px;
  background: var(--spv-grin);
  border: 2px solid #050607;
  cursor: grab;
  box-shadow: 0 0 8px var(--player-glow);
}

.spv-seek::-moz-range-thumb,
.spv-vol::-moz-range-thumb {
  width: 14px;
  height: 14px;
  background: var(--spv-grin);
  border: 2px solid #050607;
  border-radius: 0;
  cursor: grab;
  box-shadow: 0 0 8px var(--player-glow);
}

.spv-seek::-webkit-slider-runnable-track,
.spv-vol::-webkit-slider-runnable-track {
  height: 8px;
  background: linear-gradient(
    90deg,
    var(--spv-g) 0%,
    var(--spv-g) var(--seek-pct, 0%),
    var(--player-track) var(--seek-pct, 0%),
    var(--player-track) 100%
  );
}

.spv-player.theme-rainbow .spv-seek::-webkit-slider-thumb,
.spv-player.theme-rainbow .spv-vol::-webkit-slider-thumb {
  background: #ff6ad5;
}

.spv-player.theme-rainbow .spv-seek::-webkit-slider-runnable-track {
  background: linear-gradient(
    90deg,
    #ff2a6d,
    #f9f871,
    #05f2a0,
    #2de2e6,
    #7aa2ff
  );
  opacity: 0.95;
}

.spv-player-time {
  color: var(--bgs-mute);
  white-space: nowrap;
  min-width: 7.5rem;
  text-align: center;
}

.spv-player-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
}

.spv-player-row label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.72rem;
  color: var(--bgs-mute);
  flex: 1 1 12rem;
}

/* theme toggle · dark default · rainbow lights */
.spv-theme-toggle {
  display: inline-flex;
  gap: 0;
  border: 1px solid var(--bgs-line);
  overflow: hidden;
}

.spv-theme-toggle button {
  appearance: none;
  border: 0;
  border-right: 1px solid var(--bgs-line);
  background: #0a0e0c;
  color: var(--bgs-mute);
  padding: 7px 12px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.spv-theme-toggle button:last-child {
  border-right: 0;
}

.spv-theme-toggle button.on {
  background: #121816;
  color: var(--spv-grin);
  box-shadow: inset 0 0 12px rgba(232, 197, 71, 0.15);
}

.spv-theme-toggle button[data-theme="rainbow"].on {
  color: #ff6ad5;
  background: linear-gradient(90deg, rgba(255, 42, 109, 0.2), rgba(45, 226, 230, 0.15));
  box-shadow: inset 0 0 16px rgba(255, 106, 213, 0.25);
}

/* theater lights strip (rainbow mode only) */
.spv-theater-lights {
  display: none;
  height: 6px;
  margin: 0 0 10px;
  background: linear-gradient(
    90deg,
    #ff2a6d,
    #f9f871,
    #05f2a0,
    #2de2e6,
    #7aa2ff,
    #ff6ad5,
    #ff2a6d
  );
  background-size: 200% 100%;
  animation: theater-scan 2.4s linear infinite;
}

.spv-player.theme-rainbow .spv-theater-lights,
[data-plug="mp4.dom"].theme-rainbow .spv-theater-lights {
  display: block;
}

@keyframes theater-scan {
  0% { background-position: 0% 0; }
  100% { background-position: 200% 0; }
}

/* MP4 plug fields */
[data-plug="mp4.dom"] .spv-note {
  display: block;
  margin: 7px 0;
  font-size: 0.78rem;
  color: var(--bgs-mute);
}

[data-plug="mp4.dom"] input[type="url"],
[data-plug="mp4.dom"] input[type="file"],
[data-plug="mp4.dom"] input[type="text"] {
  display: block;
  margin-top: 4px;
  width: 100%;
  max-width: 100%;
  background: #050807;
  border: 1px solid var(--bgs-line);
  color: var(--bgs-ink);
  padding: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}

[data-plug="mp4.dom"] #spv-mp4-bunny {
  border-color: var(--spv-grin);
  color: var(--spv-grin);
}

.spv-bunny {
  border: 1px solid rgba(232, 197, 71, 0.4);
  box-shadow: 0 0 12px rgba(232, 197, 71, 0.15);
}

/* audio panel */
.spv-player-audio {
  width: 100%;
  margin-top: 10px;
  padding: 10px;
  border: 1px dashed var(--bgs-line);
  background: rgba(0, 0, 0, 0.35);
}

.spv-player-audio audio {
  width: 100%;
  margin-top: 6px;
}

/* dual ALSA settings */
.spv-audio-settings {
  margin-top: 11px;
  padding: 10px 12px;
  border: 1px solid var(--bgs-line);
  background: rgba(5, 8, 7, 0.75);
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--bgs-mute);
}

.spv-audio-settings summary {
  cursor: pointer;
  color: var(--spv-g);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.7rem;
  list-style: none;
}

.spv-audio-settings summary::-webkit-details-marker {
  display: none;
}

.spv-audio-settings[open] summary {
  margin-bottom: 9px;
  color: var(--spv-grin);
}

.spv-out-select,
.spv-audio-settings select {
  display: block;
  width: 100%;
  max-width: 100%;
  margin-top: 4px;
  background: #050807;
  border: 1px solid var(--bgs-line);
  color: var(--bgs-ink);
  padding: 6px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
}

.spv-audio-status {
  display: block;
  flex: 1 1 100%;
  color: var(--spv-y);
  word-break: break-all;
  font-size: 0.65rem;
  margin-top: 4px;
}

.spv-player.theme-rainbow .spv-audio-settings {
  border-color: rgba(255, 106, 213, 0.35);
  box-shadow: inset 0 0 20px rgba(122, 162, 255, 0.06);
}

/* Stream tab · camera preview */
.spv-stream-stage {
  position: relative;
}
.spv-stream-overlay {
  position: absolute;
  left: 8px;
  bottom: 8px;
  padding: 4px 8px;
  background: rgba(5, 6, 7, 0.75);
  border: 1px solid var(--bgs-line);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--spv-g);
  pointer-events: none;
}
.spv-stream .spv-title {
  color: var(--spv-r);
}

/* protocol SPV family */
.spv-proto .spv-title {
  color: var(--spv-b);
  letter-spacing: 0.1em;
}
.spv-proto input[type="text"],
.spv-proto input[type="number"] {
  display: block;
  margin-top: 4px;
  width: 100%;
  max-width: 22rem;
  background: #050807;
  border: 1px solid var(--bgs-line);
  color: var(--bgs-ink);
  padding: 6px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
}
.spv-proto[data-proto="ssh"] .spv-title,
.spv-proto[data-proto="sftp"] .spv-title,
.spv-proto[data-proto="scp"] .spv-title { color: var(--spv-g); }
.spv-proto[data-proto="rtmp"] .spv-title { color: var(--spv-r); }
.spv-proto[data-proto="https"] .spv-title,
.spv-proto[data-proto="http"] .spv-title { color: var(--spv-phi); }
.spv-proto[data-proto="telnet"] .spv-title { color: var(--spv-y); }

/* CSS 100% tab */
.css-all .css-swatch-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 9px 0;
}
.css-swatch {
  width: 28px;
  height: 28px;
  border: 1px solid var(--bgs-line);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.35);
}
.css-all .spv-form label {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
  color: var(--bgs-mute);
  font-size: 0.78rem;
}

@media (prefers-reduced-motion: reduce) {
  .spv-theater-lights {
    animation: none;
  }
  .spv-player {
    transition: none;
  }
}

/* ============================================================
   100% CSS ENDURANCE · every HTML5 catalog element styled
   Perfect display path · dark neon · rides BGF tokens
   ============================================================ */
.html5-all h1, .html5-all h2, .html5-all h3,
.html5-all h4, .html5-all h5, .html5-all h6 {
  font-family: var(--font-ui);
  line-height: 1.25;
  color: var(--spv-g);
}
.html5-all h1 { font-size: 1.15rem; color: var(--spv-grin); letter-spacing: 0.1em; }
.html5-all h3 { font-size: 0.95rem; color: var(--spv-b); }
.html5-all h4 { font-size: 0.88rem; color: var(--spv-phi); }
.html5-all h5 { font-size: 0.82rem; color: var(--spv-y); }
.html5-all h6 { font-size: 0.75rem; color: var(--bgs-mute); letter-spacing: 0.08em; }

.html5-all p { margin: 0 0 9px; font-size: 0.9rem; color: var(--bgs-ink); }
.html5-all strong, .html5-all b { color: var(--spv-grin); font-weight: 700; }
.html5-all em, .html5-all i { color: var(--spv-phi); font-style: italic; }
.html5-all u { text-decoration-color: var(--spv-b); }
.html5-all s { color: var(--bgs-mute); text-decoration-color: var(--spv-r); }
.html5-all small { font-size: 0.78em; color: var(--bgs-mute); }
.html5-all mark {
  background: rgba(232, 197, 71, 0.25);
  color: var(--spv-grin);
  padding: 0 3px;
}
.html5-all abbr[title] {
  text-decoration: underline dotted var(--spv-b);
  cursor: help;
}
.html5-all dfn { font-style: italic; color: var(--spv-g); }
.html5-all cite { color: var(--spv-sdf); font-style: italic; }
.html5-all q { color: var(--spv-b); quotes: "“" "”" "‘" "’"; }
.html5-all code, .html5-all kbd, .html5-all samp, .html5-all var {
  font-family: var(--font-mono);
  font-size: 0.85em;
  background: #050807;
  border: 1px solid var(--bgs-line);
  padding: 1px 4px;
}
.html5-all kbd { color: var(--spv-y); border-bottom-width: 2px; }
.html5-all samp { color: var(--spv-g); }
.html5-all var { color: var(--spv-phi); font-style: italic; }
.html5-all sub, .html5-all sup { font-size: 0.7em; color: var(--spv-b); }
.html5-all time, .html5-all data {
  font-family: var(--font-mono);
  font-size: 0.85em;
  color: var(--spv-thermo-cool);
}
.html5-all a {
  color: var(--spv-g);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.html5-all a:hover { color: var(--spv-grin); }
.html5-all bdi, .html5-all bdo { font-family: var(--font-mono); color: var(--spv-y); }
.html5-all ins {
  background: rgba(5, 242, 160, 0.12);
  text-decoration: underline;
  color: var(--spv-g);
}
.html5-all del {
  background: rgba(255, 42, 109, 0.1);
  text-decoration: line-through;
  color: var(--spv-r);
}
.html5-all pre,
.html5-all .spv-pre {
  background: #050807;
  border: 1px solid var(--bgs-line);
  padding: 11px;
  overflow: auto;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--spv-g);
  white-space: pre-wrap;
}
.html5-all blockquote {
  margin: 11px 0;
  padding: 9px 13px;
  border-left: 3px solid var(--spv-grin);
  background: rgba(232, 197, 71, 0.05);
  color: var(--bgs-mute);
}
.html5-all hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--spv-grin), transparent);
  margin: 13px 0;
}
.html5-all ul, .html5-all ol, .html5-all menu {
  margin: 7px 0 11px;
  padding-left: 1.4rem;
  color: var(--bgs-ink);
}
.html5-all li { margin: 3px 0; }
.html5-all ul { list-style: square; }
.html5-all ol { list-style: decimal; }
.html5-all menu { list-style: none; padding-left: 0; display: flex; gap: 7px; }
.html5-all dl { margin: 9px 0; }
.html5-all dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--spv-grin);
}
.html5-all dd { margin: 0 0 9px 13px; color: var(--bgs-mute); }
.html5-all address {
  font-style: normal;
  font-size: 0.8rem;
  color: var(--spv-phi);
  border: 1px dashed var(--bgs-line);
  padding: 9px;
  margin: 9px 0;
}
.html5-all hgroup {
  margin: 11px 0;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--bgs-line);
}
.html5-all hgroup h2 { margin: 0; }
.html5-all hgroup p { margin: 4px 0 0; font-size: 0.78rem; color: var(--bgs-mute); }

/* media 100% */
.html5-all picture { display: inline-block; margin: 7px 0; }
.html5-all img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--bgs-line);
  vertical-align: middle;
}
.html5-all audio.spv-audio,
.html5-all .spv-audio {
  width: 100%;
  max-width: 420px;
  margin: 9px 0;
  accent-color: var(--spv-g);
}
.html5-all video.spv-video,
.html5-all .spv-video {
  display: block;
  width: 100%;
  max-width: 720px;
  background: #000;
  border: 1px solid var(--bgs-line);
  margin: 9px 0;
  accent-color: var(--spv-grin);
}
.html5-all canvas.spv-canvas,
.html5-all .spv-canvas {
  display: block;
  border: 1px solid var(--bgs-line);
  background: #000;
  margin: 9px 0;
  image-rendering: pixelated;
}
.html5-all svg.spv-svg,
.html5-all .spv-svg {
  display: inline-block;
  vertical-align: middle;
  margin: 6px;
}

/* table 100% */
.html5-all table.spv-table caption,
.html5-all caption {
  caption-side: top;
  text-align: left;
  padding: 7px 0;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--spv-grin);
}
.html5-all thead th { color: var(--spv-b); }
.html5-all tbody td { color: var(--bgs-ink); }
.html5-all tbody tr:nth-child(even) td { background: rgba(14, 18, 16, 0.6); }
.html5-all tfoot td {
  color: var(--bgs-mute);
  font-size: 0.65rem;
  background: #0a0e0c;
}
.html5-all colgroup, .html5-all col { /* structural */ }

/* forms 100% */
.html5-all form.spv-form,
.html5-all .spv-form {
  margin: 9px 0;
}
.html5-all fieldset {
  border: 1px solid var(--bgs-line);
  padding: 11px;
  margin: 0;
  min-inline-size: 0;
}
.html5-all legend {
  color: var(--spv-grin);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-size: 0.68rem;
  padding: 0 6px;
}
.html5-all label {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  margin: 6px 0;
  font-size: 0.78rem;
  color: var(--bgs-mute);
}
.html5-all input[type="text"],
.html5-all input[type="search"],
.html5-all input[type="email"],
.html5-all input[type="url"],
.html5-all input[type="tel"],
.html5-all input[type="number"],
.html5-all input[type="password"],
.html5-all input[type="date"],
.html5-all input[type="time"],
.html5-all input[type="datetime-local"],
.html5-all input[type="month"],
.html5-all input[type="week"],
.html5-all textarea,
.html5-all select {
  background: #050807;
  border: 1px solid var(--bgs-line);
  color: var(--bgs-ink);
  padding: 5px 7px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  min-width: 9rem;
}
.html5-all input[type="range"] { accent-color: var(--spv-g); width: 12rem; }
.html5-all input[type="color"] {
  width: 2.5rem;
  height: 1.6rem;
  padding: 0;
  border: 1px solid var(--bgs-line);
  background: #050807;
}
.html5-all input[type="checkbox"],
.html5-all input[type="radio"] { accent-color: var(--spv-grin); }
.html5-all input[type="file"] { color: var(--bgs-mute); font-size: 0.72rem; max-width: 100%; }
.html5-all optgroup { color: var(--spv-phi); font-style: normal; }
.html5-all option { background: #0a0c0b; color: var(--bgs-ink); }
.html5-all button,
.html5-all input[type="submit"],
.html5-all input[type="reset"],
.html5-all input[type="button"] {
  background: #121816;
  border: 1px solid var(--bgs-line);
  color: var(--bgs-ink);
  padding: 6px 10px;
  font-size: 0.72rem;
  cursor: pointer;
  font-family: var(--font-mono);
}
.html5-all button:hover,
.html5-all input[type="submit"]:hover {
  border-color: var(--spv-grin);
  color: var(--spv-grin);
}
.html5-all output {
  font-family: var(--font-mono);
  color: var(--spv-y);
  padding: 2px 6px;
  border: 1px solid var(--bgs-line);
}
.html5-all progress,
.html5-all meter {
  width: 100%;
  max-width: 240px;
  height: 11px;
  accent-color: var(--spv-g);
}
.html5-all datalist { /* option list host */ }

/* interactive / embed 100% */
.html5-all details {
  margin: 9px 0;
  border: 1px solid var(--bgs-line);
  padding: 7px 11px;
  background: #0a0e0c;
}
.html5-all summary {
  cursor: pointer;
  color: var(--spv-g);
  font-family: var(--font-mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
}
.html5-all dialog {
  border: 1px solid var(--spv-grin);
  background: #0c100e;
  color: var(--bgs-ink);
  padding: 13px;
  max-width: 28rem;
}
.html5-all template, .html5-all slot {
  /* inert existence surfaces */
}
.html5-all object,
.html5-all embed,
.html5-all iframe {
  border: 0;
  max-width: 100%;
}
.html5-all map, .html5-all area { /* image map existence */ }

/* ruby / math 100% */
.html5-all ruby {
  ruby-position: over;
  color: var(--spv-g);
}
.html5-all rt {
  font-size: 0.55em;
  color: var(--spv-phi);
}
.html5-all rp { color: var(--bgs-mute); }
.html5-all math {
  color: var(--spv-phi);
  font-size: 1.05em;
  margin: 0 6px;
}
.html5-all noscript {
  display: block;
  padding: 7px;
  border: 1px dashed var(--spv-r);
  color: var(--spv-r);
  font-size: 0.72rem;
  font-family: var(--font-mono);
}

/* 100% badge */
.html5-all[data-html5="100"] .spv-title::after,
.html5-all[data-css="100"] .spv-foot::before {
  content: "";
}
.html5-all .spv-foot {
  background: linear-gradient(90deg, rgba(232, 197, 71, 0.08), transparent);
}

/* focus endurance · a11y */
.html5-all :focus-visible {
  outline: 2px solid var(--spv-grin);
  outline-offset: 2px;
}
.html5-all ::selection {
  background: rgba(232, 197, 71, 0.35);
  color: #050607;
}

/* reduced motion */
@media (prefers-reduced-motion: reduce) {
  .spv-stripe,
  .spv-grin-mark,
  .html5-all * {
    animation: none !important;
    transition: none !important;
  }
}

/* print endurance */
@media print {
  body {
    background: #fff !important;
    color: #000 !important;
  }
  .spv-hud, #bay, #side { display: none !important; }
  .html5-all video { max-width: 100%; }
}
