/* dps.axi.link. Every colour comes from the overlay's own themes (apps/axidps-overlay/page/ui.js THEMES);
   theme.js writes them onto :root. The values here are Midnight, used until it runs. */
:root {
  --ground: #0c0f15; --bg: #12151b; --raise: #1a1e26; --raise-hi: #222833; --btn: #232a35; --btn-hi: #2e3746;
  --line: #242a34; --line-hi: #343c49; --text: #e8eaee; --title: #f2f4f7; --dim: #8d96a5; --faint: #646d7a;
  --accent: #7aa2f7; --accent-hi: #a9c1ff; --accent-line: #34456a; --accent-soft: rgba(122,162,247,.13);
  --good: #9ece6a; --bad: #f7768e; --on-accent: #0c0f15;
  --wfont: "IBM Plex Sans", system-ui, sans-serif; --wr: 10px; --wrs: 6px; --wbw: 1px; --wcaps: none;
  --display: "Archivo", "IBM Plex Sans", system-ui, sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  --measure: 34rem;
  --pad: clamp(1.25rem, 4vw, 4rem);
  color-scheme: dark;
}
:root[data-light] { color-scheme: light; }

* { box-sizing: border-box; }
html { background: var(--ground); color: var(--text); -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 400 1.0625rem/1.6 var(--body); background: var(--ground); color: var(--text);
  transition: background-color .4s, color .4s; }
img, svg, canvas { display: block; }
a { color: var(--accent-hi); text-underline-offset: .2em; text-decoration-thickness: 1px; }
a:hover { color: var(--title); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
kbd { font: 500 .8em/1 var(--mono); padding: .2em .45em; border: 1px solid var(--line-hi); border-bottom-width: 2px;
  border-radius: 5px; background: var(--raise); color: var(--title); white-space: nowrap; }
code { font: .88em var(--mono); }
.skip { position: absolute; left: -999px; top: 0; padding: .5rem 1rem; background: var(--accent); color: var(--on-accent); z-index: 100; }
.skip:focus { left: 1rem; top: 1rem; }
.fine { font-size: .875rem; color: var(--dim); margin: 0; }

h1, h2, h3 { font-family: var(--display); color: var(--title); margin: 0; font-weight: 800; }
h1 { font-size: clamp(2.4rem, 4.2vw, 3.9rem); line-height: .98; font-stretch: 112%; letter-spacing: -.02em; text-wrap: balance; }
h2 { font-size: clamp(2rem, 3.6vw, 3.1rem); line-height: 1.02; font-stretch: 108%; letter-spacing: -.015em; text-wrap: balance; }
h3 { font-size: 1.35rem; line-height: 1.15; font-stretch: 100%; font-weight: 700; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: .5em; padding: .8em 1.35em; border-radius: 999px;
  background: var(--accent); color: var(--on-accent); font: 600 1rem/1 var(--body); text-decoration: none;
  border: 0; cursor: pointer; transition: background-color .2s, transform .15s; }
.btn:hover { background: var(--accent-hi); color: var(--on-accent); }
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: .45; cursor: default; }
.btn-small { padding: .55em 1em; font-size: .875rem; }
.btn-ghost { background: transparent; color: var(--text); box-shadow: inset 0 0 0 1px var(--line-hi); }
.btn-ghost:hover:not([disabled]) { background: var(--raise); color: var(--title); }
.link { color: var(--text); font-weight: 500; text-decoration: underline; text-decoration-color: var(--accent-line); }
.link:hover { text-decoration-color: var(--accent); }

/* ---------- header / footer ---------- */
.top { position: sticky; top: 0; z-index: 50; display: flex; align-items: center; gap: 2rem;
  padding: .8rem var(--pad); background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: .55rem; color: var(--title); text-decoration: none;
  font: 800 1.2rem/1 var(--display); font-stretch: 115%; letter-spacing: -.01em; }
.mark { flex: none; color: var(--title); vertical-align: middle; }
.mark .mark-accent { fill: var(--accent); }
.top nav { display: flex; gap: 1.5rem; margin-left: auto; }
.top nav a { color: var(--dim); text-decoration: none; font-size: .95rem; }
.top nav a:hover, .top nav a[aria-current] { color: var(--title); }
@media (max-width: 720px) { .top nav { display: none; } .top .btn { margin-left: auto; } }

.foot { padding: 3rem var(--pad) 3.5rem; border-top: 1px solid var(--line); display: grid; gap: 1rem;
  grid-template-columns: 1fr auto; align-items: center; color: var(--dim); font-size: .95rem; }
.foot p { margin: 0; display: flex; align-items: center; gap: .6rem; }
.foot nav { display: flex; flex-wrap: wrap; gap: .4rem 1.4rem; }
.foot nav a { color: var(--dim); }
.foot .fine { grid-column: 1 / -1; }
@media (max-width: 720px) { .foot { grid-template-columns: 1fr; } }

/* =========================================================================
   Overlay windows (the demo), drawn with the theme's own shape and type.
   ========================================================================= */
.win { position: absolute; left: var(--x); top: var(--y); background: var(--bg); color: var(--text);
  border: var(--wbw) solid var(--line); border-radius: var(--wr); font: 400 13px/1.3 var(--wfont);
  box-shadow: 0 18px 40px -18px rgba(0,0,0,.6); overflow: hidden; touch-action: none;
  transition: background-color .4s, border-color .4s, border-radius .3s, opacity .25s, transform .25s; }
.win.off { opacity: 0; transform: scale(.96); pointer-events: none; }
.win.dragging { transition: none; box-shadow: 0 0 0 1px var(--accent), 0 24px 50px -16px rgba(0,0,0,.7); z-index: 5; }
.win-bar { display: flex; align-items: center; gap: .6rem; height: 32px; padding: 0 10px 0 12px; cursor: grab;
  border-bottom: 1px solid var(--line); }
.win-bar b { color: var(--title); font-weight: 600; text-transform: var(--wcaps); letter-spacing: var(--wtrack, 0); }
.win.dragging .win-bar { cursor: grabbing; }
.state { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--good); font-size: 11.5px;
  font-variant-numeric: tabular-nums; }
.state i { width: 7px; height: 7px; border-radius: 50%; background: var(--good); box-shadow: 0 0 6px var(--good); }
.win-foot { display: flex; height: 22px; align-items: center; padding: 0 10px; color: var(--faint); font-size: 11px;
  border-top: 1px solid var(--line); }
.good { color: var(--good); font-weight: 600; } .bad { color: var(--bad); font-weight: 600; }

.tbl-head, .row { display: grid; grid-template-columns: 22px minmax(8.5rem, 1fr) 54px 50px 44px; align-items: center;
  column-gap: 6px; padding: 0 8px; }
.tbl-head { height: 22px; color: var(--faint); font-size: 10.5px; font-weight: 600; text-transform: var(--wcaps); }
.tbl-head .sorted { color: var(--accent); }
.num { text-align: right; font-variant-numeric: tabular-nums; }
.rows { position: relative; height: calc(var(--n, 10) * 21px); }
.row { position: absolute; inset-inline: 0; height: 21px; transition: transform .45s cubic-bezier(.3,.7,.2,1); }
.row .rk { color: var(--faint); font-size: 11px; }
.row.me .rk { color: var(--accent); }
.row .nm { position: relative; display: flex; align-items: center; gap: 5px; height: 19px; padding-left: 4px; min-width: 0;
  white-space: nowrap; color: var(--title); }
.row .nm::before { content: ""; position: absolute; inset: 0 auto 0 0; width: var(--w, 0%); border-radius: 2px;
  background: color-mix(in srgb, var(--pc) 34%, transparent); border-left: 2px solid var(--pc); transition: width .45s; z-index: 0; }
.row .nm img { width: 15px; height: 15px; position: relative; z-index: 1; }
.row .nm span { position: relative; z-index: 1; overflow: hidden; text-overflow: ellipsis; }
.row .num { color: var(--text); font-size: 12px; }
@media (max-width: 520px) { .hide-s { display: none; } .tbl-head, .row { grid-template-columns: 22px 1fr 54px 50px; } }

.you { display: grid; place-items: end; padding: 14px 16px 12px; min-width: 168px; }
.you strong { font: 600 38px/1 var(--wfont); color: var(--title); font-variant-numeric: tabular-nums; }
.you span { color: var(--dim); font-size: 11.5px; }
.fight { display: grid; grid-template-columns: auto auto; gap: 3px 22px; margin: 0; padding: 10px 12px; min-width: 190px; font-size: 12px; }
.fight dt { color: var(--dim); } .fight dd { margin: 0; text-align: right; color: var(--title); font-weight: 600; font-variant-numeric: tabular-nums; }
.tl { width: 300px; height: 74px; margin: 8px 10px 4px; }
.tl polyline { stroke-width: 1.6; stroke-linejoin: round; }
.tl [data-tl="dealt"] { stroke: var(--good); } .tl [data-tl="taken"] { stroke: var(--bad); }

/* =========================================================================
   Landing
   ========================================================================= */
.hero { position: relative; isolation: isolate; overflow: hidden; display: grid; grid-template-columns: minmax(20rem, 32rem) 1fr; gap: clamp(1.5rem, 3vw, 3rem);
  padding: clamp(2rem, 5vw, 4.5rem) var(--pad) clamp(3rem, 6vw, 5rem); align-items: center; min-height: min(92vh, 60rem); }
.hero-copy { display: grid; gap: 1.4rem; align-content: center; }
.hero .lede, .hero .fine { text-shadow: 0 1px 12px var(--ground); }
.lede { font-size: 1.2rem; color: var(--text); margin: 0; max-width: 30rem; }
.cta { display: flex; flex-wrap: wrap; align-items: center; gap: 1rem 1.5rem; }
.themes { border: 0; padding: 1.2rem 0 0; margin: .4rem 0 0; border-top: 1px solid var(--line); display: grid; gap: .7rem; }
.themes legend { float: left; font-weight: 600; color: var(--title); font-size: .95rem; padding: 0; }
.theme-row { clear: both; display: flex; flex-wrap: wrap; gap: .45rem; }
.swatch { display: flex; align-items: center; gap: .45rem; padding: .35rem .7rem .35rem .4rem; border-radius: 999px;
  border: 1px solid var(--line-hi); background: var(--raise); color: var(--text); font: 500 .85rem/1 var(--body); cursor: pointer; }
.swatch i { width: 1.1rem; height: 1.1rem; border-radius: 50%; background: var(--sw-bg); box-shadow: inset 0 0 0 4px var(--sw-bg), inset 0 0 0 9px var(--sw-ac); border: 1px solid rgba(127,127,127,.4); }
.swatch[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--title); }

.stage { position: relative; height: clamp(36rem, 74vh, 46rem); }
.stage-hint { position: absolute; right: 16px; bottom: 12px; margin: 0; font-size: .8rem; color: var(--text); opacity: .75;
  text-shadow: 0 1px 6px var(--ground); }
/* In the world, the windows are see-through like the overlay's own. */
.stage .win { background: color-mix(in srgb, var(--bg) 84%, transparent); backdrop-filter: blur(10px) saturate(1.2);
  -webkit-backdrop-filter: blur(10px) saturate(1.2); box-shadow: 0 24px 60px -20px rgba(0,0,0,.75); }
[data-light] .stage .win { background: color-mix(in srgb, var(--bg) 88%, transparent); box-shadow: 0 24px 60px -24px rgba(20,30,50,.45); }
.guide { position: absolute; background: var(--accent); opacity: .7; pointer-events: none; z-index: 6; }
.guide.v { width: 1px; top: 0; bottom: 0; } .guide.h { height: 1px; left: 0; right: 0; }
.toast { position: absolute; left: 50%; top: 14px; translate: -50% -10px; opacity: 0; padding: .5rem .9rem; border-radius: var(--wrs);
  background: var(--bg); border: 1px solid var(--accent-line); color: var(--text); font: 500 13px/1.3 var(--wfont);
  transition: opacity .3s, translate .3s; pointer-events: none; white-space: nowrap; z-index: 7; }
.toast.show { opacity: 1; translate: -50% 0; }
.toast b { color: var(--good); }

@media (max-width: 1240px) {
  .hero { grid-template-columns: 1fr; min-height: 0; }
  .hero-copy { max-width: 40rem; }
}
@media (max-width: 760px) {
  .stage { height: auto; padding: 14px; display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-start; }
  .stage .win { position: relative; left: auto; top: auto; }
  .stage .win[data-win="meter"] { flex: 1 1 100%; }
  .stage-hint { display: none; }
  .tl { width: min(300px, 72vw); }
}

/* ---------- the world (scene.js): every colour from the theme ---------- */
.scene { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -2; pointer-events: none;
  --sky-top: color-mix(in oklab, var(--accent) 7%, var(--ground));
  --sky-mid: color-mix(in oklab, var(--accent) 20%, var(--ground));
  --sky-low: color-mix(in oklab, var(--accent-hi) 58%, var(--ground));
  --m1: color-mix(in oklab, var(--accent) 34%, var(--ground));
  --m1b: color-mix(in oklab, var(--accent) 22%, var(--ground));
  --m2: color-mix(in oklab, var(--accent) 11%, var(--ground));
  --m3: color-mix(in oklab, var(--accent) 4%, var(--ground));
  --m4: var(--ground);
  --fog: color-mix(in oklab, var(--accent-hi) 30%, var(--ground));
  --fire: #ffb24a; }
[data-light] .scene {
  --sky-top: color-mix(in oklab, var(--accent) 28%, #ffffff);
  --sky-mid: color-mix(in oklab, var(--accent) 14%, #ffffff);
  --sky-low: color-mix(in oklab, #ffd9a8 55%, #ffffff);
  --m1: color-mix(in oklab, var(--accent) 30%, #e4e9f1);
  --m1b: color-mix(in oklab, var(--accent) 36%, #c9d3e2);
  --m2: color-mix(in oklab, var(--accent) 40%, #5b6b85);
  --m3: color-mix(in oklab, var(--accent) 22%, #36435a);
  --m4: var(--ground);
  --fog: #ffffff; }
.scene .s-top { stop-color: var(--sky-top); } .scene .s-mid { stop-color: var(--sky-mid); } .scene .s-low { stop-color: var(--sky-low); }
.scene .sun-0 { stop-color: var(--accent-hi); stop-opacity: .75; } .scene .sun-1 { stop-color: var(--accent); stop-opacity: .22; }
.scene .sun-2 { stop-color: var(--accent); stop-opacity: 0; }
.scene .fg-0 { stop-color: var(--fire); stop-opacity: .55; } .scene .fg-1 { stop-color: var(--fire); stop-opacity: 0; }
.scene .m1 { fill: var(--m1); } .scene .m1b { fill: var(--m1b); } .scene .m2, .scene .keep { fill: var(--m2); }
.scene .m3 { fill: var(--m3); } .scene .m4 { fill: var(--m4); }
.scene .gate { fill: color-mix(in oklab, var(--fire) 35%, var(--m2)); }
.scene .pole { stroke: var(--m2); stroke-width: 2; }
.scene .flag { fill: var(--accent); }
.scene .stars circle { fill: var(--title); animation: twinkle 6s ease-in-out infinite alternate; }
[data-light] .scene .stars { display: none; }
.scene .fog ellipse { fill: var(--fog); }
.scene .f1 { opacity: .28; animation: drift 46s ease-in-out infinite alternate; }
.scene .f2 { opacity: .22; animation: drift 60s ease-in-out infinite alternate-reverse; }
.scene .fire { animation: flicker 1.3s ease-in-out infinite alternate; transform-box: fill-box; }
.scene .fire .core { fill: #fff2c4; }
.scene .smoke circle { fill: color-mix(in oklab, var(--m2) 70%, var(--sky-mid)); }
.scene .smoke { opacity: .3; animation: rise 9s ease-in-out infinite; }
.scene .embers circle { fill: var(--fire); animation: ember linear infinite; }
[data-light] .scene .smoke { opacity: .25; }
@keyframes twinkle { to { opacity: .15; } }
@keyframes drift { to { transform: translateX(80px); } }
@keyframes flicker { 0% { opacity: .75; } 40% { opacity: 1; } 100% { opacity: .6; } }
@keyframes rise { 0% { transform: translateY(0); opacity: .3; } 100% { transform: translateY(-40px); opacity: .1; } }
@keyframes ember { 0% { transform: translate(0, 0); opacity: 0; } 15% { opacity: 1; } 100% { transform: translate(var(--dx), -220px); opacity: 0; } }
/* The copy's side of the hero and its foot fade into the page. */
.hero::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(90deg, var(--ground) 0%, color-mix(in srgb, var(--ground) 82%, transparent) 26%, transparent 52%),
    linear-gradient(0deg, var(--ground) 0%, transparent 18%); }
@media (max-width: 1240px) {
  .hero::before { background: linear-gradient(180deg, color-mix(in srgb, var(--ground) 80%, transparent) 0%, transparent 40%),
    linear-gradient(0deg, var(--ground) 0%, transparent 14%); }
}

/* ---------- bands ---------- */
.band { padding: clamp(4rem, 9vw, 8rem) var(--pad); display: grid; grid-template-columns: minmax(18rem, 28rem) 1fr;
  gap: clamp(2rem, 5vw, 5rem); align-items: start; border-top: 1px solid var(--line); }
.band-alt { background: color-mix(in srgb, var(--bg) 45%, var(--ground)); }
.band-copy { display: grid; gap: 1.2rem; }
.band { scroll-margin-top: 4rem; }
.band-copy p { margin: 0; max-width: var(--measure); }
.band > h2 { grid-column: 1 / -1; }
@media (max-width: 960px) { .band { grid-template-columns: 1fr; } }

.facts { display: grid; grid-template-columns: auto 1fr; gap: .9rem 1.2rem; margin: .4rem 0 0; }
.facts dt { font-weight: 600; color: var(--title); }
.facts dd { margin: 0; color: var(--text); }

/* ---------- hub: drawn like the overlay's own (apps/axidps-overlay/page/index.html) ---------- */
.band-hub { grid-template-columns: minmax(18rem, 28rem) 1fr; }
.band-hub .band-copy { grid-column: 1 / -1; grid-template-columns: minmax(18rem, 28rem) 1fr; column-gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.band-hub .band-copy > h2, .band-hub .band-copy > p { grid-column: 1; }
.band-hub .facts { grid-column: 2; grid-row: 1 / span 3; }
.band-hub .hub-world { grid-column: 1 / -1; }
/* The hub opens over the game, dimmed: the same world, blurred and darkened behind it. */
.hub-world { position: relative; isolation: isolate; overflow: hidden; border-radius: 20px; padding: clamp(1rem, 4vw, 3.5rem);
  border: 1px solid var(--line); }
.hub-world .scene { filter: blur(2px) saturate(.9); }
.hub-world .hub { --hub-nav: color-mix(in srgb, var(--raise) 70%, transparent); background: color-mix(in srgb, var(--bg) 80%, transparent);
  backdrop-filter: blur(16px) saturate(1.15); -webkit-backdrop-filter: blur(16px) saturate(1.15); }
.hub-world::before { content: ""; position: absolute; inset: 0; z-index: -1; background: color-mix(in srgb, var(--ground) 22%, transparent); }
[data-light] .hub-world::before { background: color-mix(in srgb, #1d2430 30%, transparent); }
@media (max-width: 960px) { .band-hub .band-copy { grid-template-columns: 1fr; } .band-hub .facts { grid-column: 1; grid-row: auto; } }

.hub { --hub-nav: color-mix(in srgb, var(--raise) 92%, transparent); width: 100%; max-width: 1080px; margin: 0 auto;
  height: 540px; display: flex; flex-direction: column; background: var(--bg); color: var(--text);
  border: var(--wbw) solid var(--line-hi); border-radius: var(--wr); font: 400 13.5px/1.4 var(--wfont);
  box-shadow: 0 50px 90px -40px rgba(0,0,0,.85); overflow: hidden; }
[data-light] .hub { box-shadow: 0 40px 80px -40px rgba(30,40,60,.35); }
.hub button { font: inherit; color: var(--text); cursor: pointer; }
.hub-top { height: 52px; flex: none; display: flex; align-items: center; gap: 18px; padding: 0 14px 0 20px;
  background: var(--hub-nav); border-bottom: 1px solid var(--line); }
.hub-brand { display: flex; align-items: center; gap: 9px; }
.hub-brand svg { fill: none; stroke: var(--accent); stroke-width: 2.6; stroke-linecap: round; }
.hub-brand b { font-size: 16px; color: var(--title); letter-spacing: .02em; text-transform: var(--wcaps); }
.hub-tabs { display: flex; gap: 4px; align-self: stretch; }
.hub-tabs button { display: flex; align-items: center; gap: 8px; padding: 0 16px; color: var(--dim); font-weight: 500;
  background: none; border: 0; border-bottom: 2px solid transparent; border-radius: 0; }
.hub-tabs button:hover { color: var(--text); background: var(--raise-hi); }
.hub-tabs button[aria-selected="true"] { color: var(--title); border-color: var(--accent); background: var(--accent-soft); }
.hub-tabs .n { font-size: 11px; line-height: 16px; padding: 0 7px; border-radius: 8px; color: var(--accent-hi);
  background: var(--accent-soft); border: 1px solid var(--accent-line); }
.hub-tabs .n:empty { display: none; }
.hub-kbd { margin-left: auto; color: var(--faint); font-size: 11.5px; }
.hub-x { color: var(--dim); padding: 0 8px; font-size: 16px; }
.hub-panel { flex: 1; min-height: 0; display: flex; }
.hub-panel[hidden] { display: none; }
.hub-side { width: 240px; flex: none; border-right: 1px solid var(--line); background: var(--hub-nav); padding: 16px 16px 16px 12px; overflow-y: auto; }
#hub-windows .hub-side { width: 290px; }
.hub-main { flex: 1; min-width: 0; overflow-y: auto; }
.hub-h { margin: 4px 8px 8px; font: 600 11px/1.3 var(--wfont); color: var(--faint); letter-spacing: .06em; text-transform: uppercase; }
.hub-main .hub-h { margin: 0 0 10px; }
.hub-note { margin: 12px 8px 0; color: var(--faint); font-size: 11.5px; }
.hub-main .hub-note { margin: 10px 0 0; }
.hbtn { background: var(--btn); border: 1px solid transparent; border-radius: var(--wrs); padding: 4px 11px; }
.hbtn:hover { background: var(--btn-hi); }
.hbtn.primary { background: var(--accent); color: var(--on-accent); font-weight: 600; }
.hbtn.primary:hover { background: var(--accent-hi); }
.hbtn:disabled { opacity: .45; pointer-events: none; }
.tog { width: 34px; height: 20px; border-radius: 10px; background: var(--line-hi); position: relative; flex: none; border: 0; padding: 0; }
.tog i { position: absolute; left: 2px; top: 2px; width: 16px; height: 16px; border-radius: 8px; background: var(--dim); transition: left .15s; }
.tog.on { background: var(--accent); }
.tog.on i { left: 16px; background: var(--bg); }
.field { display: inline-block; min-width: 180px; padding: 3px 8px; border: 1px solid var(--line-hi); border-radius: var(--wrs);
  background: var(--bg); color: var(--title); font: 12px/1.5 var(--wfont); }
.field:focus { outline: none; border-color: var(--accent); }
.field.search { color: var(--faint); text-align: center; }

/* Windows tab: the list, and the picked window's settings */
.wlist { list-style: none; margin: 0; padding: 0; }
.w { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: var(--wrs); cursor: pointer; margin-bottom: 2px; }
.w:hover { background: var(--raise-hi); }
.w.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-line); }
.w .ic { width: 30px; height: 24px; border-radius: 4px; border: 1px solid var(--line-hi); background: var(--bg); flex: none;
  display: flex; flex-direction: column; justify-content: center; gap: 2px; padding: 0 4px; }
.w .ic i { display: block; height: 3px; border-radius: 1px; background: var(--dim); }
.w .ic i:nth-child(2) { width: 70%; } .w .ic i:nth-child(3) { width: 45%; }
.w.on .ic { border-color: var(--accent-line); } .w.on .ic i { background: var(--accent); }
.w .nm { flex: 1; min-width: 0; text-align: left; background: none; border: 0; padding: 0; }
.w .nm b { display: block; color: var(--title); font-weight: 600; }
.w .nm small { display: block; color: var(--dim); font-size: 11.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.w.hid .nm b { color: var(--dim); font-weight: 400; }
.w.hid .ic { border-style: dashed; }
.w .show { padding: 4px 10px; font-size: 12px; color: var(--accent); background: transparent; border: 1px solid var(--accent-line); border-radius: var(--wrs); }
.w .show.hide { color: var(--dim); border-color: var(--line-hi); }
.w .show.hide:hover { color: var(--title); }
.ws { display: flex; flex-direction: column; }
.ws .head { flex: none; padding: 20px 24px 16px; border-bottom: 1px solid var(--line); display: flex; align-items: flex-start; gap: 10px; }
.ws .head > div { flex: 1; min-width: 0; }
.ws .head h4 { margin: 0; font: 600 18px/1.3 var(--wfont); color: var(--title); text-transform: none; }
.ws .head p { margin: 3px 0 0; color: var(--dim); }
.ws .grid { padding: 18px 24px; max-width: 720px; }
.opt { display: flex; align-items: center; gap: 12px; padding: 6px 0; min-height: 44px; border-bottom: 1px solid var(--line); }
.opt > div { flex: 1; color: var(--title); }
.opt small { display: block; color: var(--dim); font-size: 11px; margin-top: 1px; }

/* Plugins tab: filters, then one list of rows with a trust bar at the left (green verified, grey not yet) */
.pfs { list-style: none; margin: 0; padding: 0; }
.pf { display: flex; width: 100%; padding: 9px 10px; border-radius: var(--wrs); color: var(--dim); margin-bottom: 2px;
  background: none; border: 0; text-align: left; }
.pf:hover { background: var(--raise-hi); color: var(--text); }
.pf.on { background: var(--accent-soft); color: var(--title); box-shadow: inset 0 0 0 1px var(--accent-line); }
.pf i { font-style: normal; margin-left: auto; color: var(--faint); font-variant-numeric: tabular-nums; }
.pmain { padding: 16px 20px 20px; }
.store-top { display: flex; margin-bottom: 12px; }
.srows { list-style: none; margin: 0; padding: 0; }
.srow { position: relative; padding: 9px 10px 10px 13px; border-bottom: 1px solid var(--line); }
.srow[hidden] { display: none; }
.srow:hover { background: var(--raise); }
.srow::before { content: ""; position: absolute; left: 0; top: 9px; bottom: 10px; width: 3px; border-radius: 2px; background: var(--line-hi); }
.srow.v::before { background: var(--good); }
.srow .rtop { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: baseline; column-gap: 12px; }
.srow .nm b { color: var(--title); font-weight: 600; font-size: 13px; }
.srow .trust { font-size: 11px; margin-left: 6px; color: var(--faint); }
.srow.v .trust { color: var(--good); }
.srow .au { color: var(--dim); font-size: 11px; margin-left: 8px; }
.srow .ver { color: var(--dim); font-variant-numeric: tabular-nums; text-align: right; }
.srow .ver.up { color: var(--title); font-weight: 500; }
.srow .have { color: var(--good); font-size: 11px; margin-left: 4px; }
.srow .sa { display: flex; align-items: baseline; gap: 6px; }
.srow .sa button { padding: 2px 10px; font-size: 11px; }
.srow .sa .quiet { background: none; border: 1px solid transparent; color: var(--dim); }
.srow .sa .quiet:hover { color: var(--text); border-color: var(--line-hi); }
.srow .desc { margin-top: 3px; max-width: 62ch; color: var(--text); }
.srow .uses { margin-top: 2px; font-size: 11px; color: var(--faint); }
.srow .uses em { font-style: normal; color: var(--accent); }
.srow .snote { margin-top: 2px; font-size: 11px; color: var(--dim); }

/* Options tab */
.opane { padding: 20px 28px 24px; }
.opane > div { max-width: 640px; }
.opane > div[hidden] { display: none; }
.th-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.th { height: 78px; border: 1px solid var(--line); overflow: hidden; display: flex; flex-direction: column; padding: 0; text-align: left; }
.th:hover { border-color: var(--line-hi); }
.th[aria-checked="true"] { box-shadow: 0 0 0 2px var(--accent); }
.th .tb { height: 22px; flex: none; display: flex; align-items: center; padding: 0 8px; font-size: 11px; font-weight: 600; }
.th .rows { padding: 6px 8px; display: flex; flex-direction: column; gap: 4px; }
.th .rows i { height: 6px; display: block; }
.kv { display: grid; grid-template-columns: 140px auto; gap: 6px 12px; margin: 0 0 6px; }
.kv dt { color: var(--dim); } .kv dd { margin: 0; color: var(--title); font-weight: 600; }
.update { margin-top: 16px; padding: 14px; border: 1px dashed var(--line-hi); border-radius: var(--wrs); display: grid; gap: 10px; }
.update-line { margin: 0; color: var(--title); font-weight: 600; }
.update-track { height: 4px; border-radius: 2px; background: var(--line); overflow: hidden; }
.update-track i { display: block; height: 100%; width: 0; background: var(--accent); transition: width .5s; }
.update-checks { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; font-size: 12.5px; min-height: 3.9em; }
.update-checks li { color: var(--dim); } .update-checks li.ok::before { content: "✓ "; color: var(--good); }
.update-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.editor-tabs button { font: 500 13px/1 var(--wfont); color: var(--dim); background: none; border: 0;
  padding: 8px 14px; border-radius: var(--wrs); cursor: pointer; }

/* Hero windows switched from the hub */
.win.no-state .state, .win.no-foot .win-foot, .win.no-rank .rk { display: none; }
.win.no-rank .tbl-head > span:first-child { visibility: hidden; }

@media (max-width: 860px) {
  .hub { height: auto; }
  .hub-kbd { display: none; }
  .hub-top { gap: 4px; padding: 0 8px; }
  .hub-brand b, .hub-x { display: none; }
  .hub-tabs { gap: 0; }
  .hub-tabs button { padding: 0 10px; white-space: nowrap; }
  .srow .rtop { grid-template-columns: minmax(0, 1fr) auto; row-gap: 4px; }
  .srow .sa { grid-column: 1 / -1; justify-content: flex-start; order: 3; }
  .hub-panel { flex-direction: column; }
  .hub-side, #hub-windows .hub-side { width: auto; border-right: 0; border-bottom: 1px solid var(--line); }
  .th-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ws .grid { padding: 14px 16px; } .ws .head { padding: 16px; } .pmain, .opane { padding: 14px 16px; }
}

/* ---------- patch day ---------- */
.patch { grid-column: 2; background: var(--bg); border: var(--wbw) solid var(--line-hi); border-radius: calc(var(--wr) + 4px);
  padding: 18px; font: 400 14px/1.4 var(--wfont); }
.patch-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 14px; }
.patch-head strong { color: var(--title); font: 600 1.4rem/1 var(--wfont); font-variant-numeric: tabular-nums; margin-left: .4rem; }
.features { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
/* One segment per feature: green verified, accent checking, red off. */
.segs { display: flex; gap: 4px; margin: 0 0 14px; }
.segs i { flex: 1; height: 10px; border-radius: 3px; background: var(--good); box-shadow: 0 0 14px -2px color-mix(in srgb, var(--good) 70%, transparent);
  transition: background-color .3s, box-shadow .3s; }
.segs i.pending { background: var(--line-hi); box-shadow: none; }
.segs i.checking { background: var(--accent); box-shadow: 0 0 14px -2px var(--accent); animation: pulse .6s infinite alternate; }
.segs i.off { background: var(--bad); box-shadow: 0 0 14px -2px var(--bad); }
@media (max-width: 620px) { .features { grid-template-columns: 1fr; } }
.feat { display: grid; grid-template-columns: 1.2rem 1fr auto; align-items: center; gap: 10px; padding: 10px 12px;
  border-radius: var(--wrs); background: var(--raise); transition: background-color .3s, opacity .3s; }
.feat .dot { width: 10px; height: 10px; border-radius: 50%; background: var(--good); justify-self: center; transition: background-color .3s; }
.feat b { color: var(--title); font-weight: 500; }
.feat small { color: var(--dim); font-size: 12.5px; }
.feat.checking .dot { background: var(--accent); animation: pulse .6s infinite alternate; }
.feat.checking small { color: var(--accent-hi); }
.feat.off { background: color-mix(in srgb, var(--bad) 9%, var(--raise)); }
.feat.off .dot { background: var(--bad); }
.feat.off small { color: var(--bad); }
.feat.pending .dot { background: var(--faint); }
@keyframes pulse { to { opacity: .35; } }
.patch-out { margin: 14px 0 0; color: var(--text); min-height: 2.8em; }

.guards { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(18rem, 28rem) 1fr; gap: clamp(2rem, 5vw, 5rem);
  padding-top: clamp(2rem, 5vw, 4rem); }
.guards h3 { grid-column: 1; }
.guards .fine { grid-column: 2; }
.chain { grid-column: 2; grid-row: 1; list-style: none; margin: 0; padding: 0; counter-reset: c; display: grid; gap: 0; }
.chain li { counter-increment: c; display: grid; grid-template-columns: 2.6rem 1fr; column-gap: 1rem; padding: 0 0 1.4rem; position: relative; }
.chain li::before { content: counter(c); grid-row: span 2; width: 2rem; height: 2rem; border-radius: 50%; display: grid; place-items: center;
  border: 1.5px solid var(--accent); color: var(--accent-hi); font: 700 .9rem/1 var(--display); background: var(--ground); z-index: 1; }
.chain li:not(:last-child)::after { content: ""; position: absolute; left: calc(1rem - .75px); top: 2rem; bottom: 0; width: 1.5px; background: var(--accent-line); }
.chain b { color: var(--title); font-weight: 600; }
.chain span { color: var(--text); max-width: 38rem; }

.layers-wrap { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(18rem, 28rem) 1fr; gap: clamp(2rem, 5vw, 5rem);
  padding-top: clamp(2rem, 5vw, 4rem); align-items: center; }
.layers-copy { display: grid; gap: 1rem; }
.layers-copy p { margin: 0; }
.layer-text { min-height: 7.5em; padding: 1rem 1.1rem; border-left: 2px solid var(--accent); background: var(--accent-soft); border-radius: 0 8px 8px 0; }
.layer-text b { color: var(--title); display: block; margin-bottom: .25rem; }
.layers { display: grid; }
/* Three walls around a plugin, drawn as walls: a thick ring with battlements (the dashed outline). */
.layer { display: grid; justify-items: center; gap: .6rem; padding: 1rem clamp(.8rem, 3vw, 2.2rem) clamp(1.2rem, 3vw, 2.2rem);
  border-radius: 26px; border: 6px solid var(--line-hi); outline: 4px dashed var(--line-hi); outline-offset: 3px;
  background: color-mix(in srgb, var(--raise) 45%, transparent); margin: 9px;
  transition: border-color .25s, outline-color .25s, background-color .25s, box-shadow .25s; }
.layer > button { font: 700 1rem/1 var(--display); font-stretch: 110%; color: var(--dim); background: none; border: 0; padding: .4rem .7rem;
  border-radius: 999px; cursor: pointer; }
.layer > button:hover { color: var(--title); }
.layer.l3 { border-radius: 34px; }
.layer.l1 { border-radius: 18px; min-width: min(16rem, 60vw); }
.layer.active { border-color: var(--accent); outline-color: var(--accent); background: var(--accent-soft);
  box-shadow: 0 0 40px -10px var(--accent), inset 0 0 30px -16px var(--accent); }
.layer.active > button { color: var(--accent-hi); }
.core { padding: .9rem 1.4rem; border-radius: 10px; background: var(--bg); border: 1px solid var(--line-hi); color: var(--title); font: 500 .95rem/1 var(--wfont); }
@media (max-width: 960px) {
  .patch, .chain, .guards .fine { grid-column: 1; grid-row: auto; }
  .guards, .layers-wrap { grid-template-columns: 1fr; }
}

/* ---------- pipeline ---------- */
.pipe { grid-column: 2; position: relative; height: 19rem; }
.pipe-lines { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.pipe-lines path { fill: none; stroke: var(--line-hi); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.packet { position: absolute; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 10px var(--accent); pointer-events: none; }
.packet.log { background: var(--good); box-shadow: 0 0 10px var(--good); }
.pipe .node { position: absolute; left: var(--nx); top: var(--ny); translate: 0 -50%; display: grid; gap: 2px; text-align: left;
  padding: .75rem 1rem; min-width: 8.5rem; border-radius: 12px; background: var(--bg); border: 1px solid var(--line-hi);
  color: var(--text); font: 400 .85rem/1.2 var(--body); cursor: pointer; transition: border-color .2s, background-color .2s; z-index: 1; }
.pipe .node b { font: 700 1rem/1.1 var(--display); color: var(--title); }
.pipe .node span { color: var(--dim); }
.pipe .node:hover { border-color: var(--accent-line); }
.pipe .node[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); }
.node-text { grid-column: 2; min-height: 6rem; padding: 1rem 1.1rem; border-left: 2px solid var(--accent); background: var(--accent-soft);
  border-radius: 0 8px 8px 0; max-width: 46rem; }
.node-text b { color: var(--title); }
.node-text p { margin: .3rem 0 0; }
@media (max-width: 960px) {
  .pipe, .node-text { grid-column: 1; }
  .pipe { height: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr)); gap: .6rem; }
  .pipe .node { position: static; translate: none; }
  .pipe-lines, .packet { display: none; }
}

/* ---------- dev ---------- */
.dev { grid-column: 1 / -1; display: grid; grid-template-columns: minmax(18rem, 28rem) 1fr; gap: clamp(2rem, 5vw, 5rem);
  padding-top: clamp(2rem, 5vw, 4rem); align-items: start; }
.dev-copy { display: grid; gap: 1rem; }
.dev-copy p { margin: 0; }
.links { display: flex; gap: 1.4rem; flex-wrap: wrap; }
.editor { border: 1px solid var(--line-hi); border-radius: 14px; overflow: hidden; background: var(--bg); display: grid; grid-template-columns: 1fr auto; }
.editor-tabs { grid-column: 1 / -1; display: flex; gap: 2px; padding: 6px; border-bottom: 1px solid var(--line); background: var(--raise); }
.editor-tabs button { font-family: var(--mono); }
.editor-tabs button[aria-selected="true"] { background: var(--bg); color: var(--title); }
.code { margin: 0; padding: 1.1rem 1.2rem; font: 400 .86rem/1.65 var(--mono); color: var(--text); overflow-x: auto; min-height: 12rem; }
.code .k { color: var(--accent-hi); } .code .s { color: var(--good); } .code .f { color: var(--title); font-weight: 500; }
.editor-out { display: grid; align-content: center; gap: .6rem; padding: 1.2rem 1.4rem; border-left: 1px solid var(--line);
  background: color-mix(in srgb, var(--ground) 60%, var(--bg)); min-width: 12rem; }
.plugin-out { font: 600 2.6rem/1 var(--wfont); color: var(--title); font-variant-numeric: tabular-nums; }
@media (max-width: 960px) { .dev { grid-template-columns: 1fr; } }
@media (max-width: 620px) { .editor { grid-template-columns: 1fr; } .editor-out { border-left: 0; border-top: 1px solid var(--line); } }

/* ---------- what you get ---------- */
.box { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); gap: 2.2rem 3rem; margin: 0; }
.box div { padding-top: .2rem; }
.box dt { font: 700 1.15rem/1.2 var(--display); color: var(--title); margin-bottom: .45rem; }
.box .ic { width: 2.6rem; height: 2.6rem; padding: .55rem; margin-bottom: .9rem; border-radius: 12px; fill: none;
  stroke: var(--pc); stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
  background: color-mix(in srgb, var(--pc) 13%, transparent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--pc) 35%, transparent); }
/* Each in a profession colour from the meter's own bars. */
.box div:nth-child(1) { --pc: #f68a87; } .box div:nth-child(2) { --pc: #72c1d9; } .box div:nth-child(3) { --pc: #ffd166; }
.box div:nth-child(4) { --pc: #8cdc82; } .box div:nth-child(5) { --pc: #d09c59; } .box div:nth-child(6) { --pc: #b679d5; }
.box div:nth-child(7) { --pc: #c08f95; } .box div:nth-child(8) { --pc: #52a76f; }
[data-light] .box .ic { stroke: color-mix(in oklab, var(--pc) 70%, #000); }
.box dd { margin: 0; color: var(--text); }

/* ---------- end ---------- */
.end { position: relative; isolation: isolate; overflow: hidden; grid-template-columns: 1fr; justify-items: start; gap: 2.5rem;
  padding-bottom: clamp(10rem, 22vw, 18rem); }
.end::before { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background: linear-gradient(180deg, var(--ground) 0%, color-mix(in srgb, var(--ground) 70%, transparent) 45%, transparent 75%); }
.end h2 { font-size: clamp(2.4rem, 5vw, 4.2rem); font-stretch: 115%; }
.steps { list-style: none; counter-reset: s; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; width: 100%; }
.steps li { counter-increment: s; display: grid; gap: .4rem; align-content: start; }
.steps li::before { content: counter(s); font: 800 3rem/1 var(--display); font-stretch: 120%; color: var(--accent); }
.steps b { color: var(--title); font-size: 1.1rem; }
.steps span { color: var(--text); }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

@media (prefers-reduced-motion: reduce) {
  .scene * { animation: none !important; }
  *, *::before, *::after { transition-duration: 0s !important; animation: none !important; }
}
