/* Ghost-Trax — shared styles for the app and the static pages.
   Identity: a dark room with one teal light (the ghost). Color is spent on
   the karaoke screen; everything around it stays quiet. */
:root {
  --bg: #05090a;
  --s1: #0a1112;
  --s2: #0f1a1b;
  --s3: #142322;
  --line: #1a2b2a;
  --line2: #29433f;
  --text: #eefbf8;
  --mute: #8ea8a4;
  --dim: #5f7773;
  --spirit: #4fe8d4;
  --spirit-ink: #00201c;
  --deep: #1d7a72;
  --warn: #ffb454;
  --bad: #ff7b7b;
  --ok: #7ef0a4;
  --display: "Bricolage Grotesque", "Avenir Next", "Segoe UI Variable Display", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Mono", "SF Mono", Menlo, Consolas, monospace;
  --r: 10px;
  --r-lg: 16px;
  --gutter: clamp(16px, 4vw, 32px);
  --maxw: 1120px;
  color-scheme: dark;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: var(--body); font-size: 16px; line-height: 1.55;
  min-height: 100vh; display: flex; flex-direction: column;
  overflow-x: hidden;
}
main { flex: 1; }
a { color: var(--spirit); text-underline-offset: 3px; }
a:hover { color: #86f3e3; }
img, canvas, video, svg { max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 650; letter-spacing: -0.02em; line-height: 1.12; margin: 0; }
h1 { font-size: clamp(2.1rem, 5.2vw, 3.6rem); font-weight: 700; letter-spacing: -0.035em; }
h2 { font-size: clamp(1.45rem, 3vw, 2rem); }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
p { margin: 0 0 1em; }
.lede { font-size: clamp(1.05rem, 2vw, 1.25rem); color: var(--mute); max-width: 56ch; }
.muted { color: var(--mute); }
.dim { color: var(--dim); }
.small { font-size: .875rem; }
.mono { font-family: var(--mono); font-size: .86em; }
.nowrap { white-space: nowrap; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hidden { display: none !important; }
:focus-visible { outline: 2px solid var(--spirit); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--spirit); color: var(--spirit-ink); }

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.narrow { max-width: 760px; }
.stack > * + * { margin-top: var(--gap, 1rem); }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.row.between { justify-content: space-between; }
.grow { flex: 1 1 auto; }

/* ---------- header / footer ---------- */
.topbar { border-bottom: 1px solid var(--line); background: rgba(5, 9, 10, .88); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 30; }
.topbar .wrap { display: flex; align-items: center; gap: 1.2rem; min-height: 60px; flex-wrap: wrap; padding-top: 8px; padding-bottom: 8px; }
.brand { display: flex; align-items: center; gap: .6rem; color: var(--text); text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; }
.brand:hover { color: var(--text); }
.brand svg { width: 20px; height: 24px; flex: none; }
.brand .g-body { fill: var(--spirit); } .brand .g-eye { fill: var(--bg); }
.nav { display: flex; gap: .15rem; flex: 1; overflow-x: auto; scrollbar-width: none; }
.nav::-webkit-scrollbar { display: none; }
.nav a { color: var(--mute); text-decoration: none; padding: .45rem .8rem; border-radius: 8px; font-size: .95rem; white-space: nowrap; }
.nav a:hover { color: var(--text); background: var(--s2); }
.nav a[aria-current="page"] { color: var(--text); background: var(--s3); }
.topbar .end { display: flex; align-items: center; gap: .6rem; margin-left: auto; }
.credit-pill { font-family: var(--mono); font-size: .8rem; padding: .35rem .7rem; border: 1px solid var(--line2); border-radius: 999px; color: var(--text); text-decoration: none; white-space: nowrap; }
.credit-pill b { color: var(--spirit); font-weight: 600; }
.credit-pill.low { border-color: var(--warn); }
.credit-pill.low b { color: var(--warn); }
@media (max-width: 720px) {
  .topbar .wrap { gap: .5rem; }
  .nav { order: 3; flex-basis: 100%; margin: 0 -4px; }
}
.foot { border-top: 1px solid var(--line); margin-top: 4rem; padding: 2rem 0 3rem; color: var(--mute); font-size: .9rem; }
.foot .wrap { display: flex; gap: 1rem 2rem; flex-wrap: wrap; justify-content: space-between; }
.foot nav { display: flex; gap: 1.2rem; flex-wrap: wrap; }
.foot a { color: var(--mute); }
.foot a:hover { color: var(--spirit); }

/* ---------- buttons & fields ---------- */
.btn {
  font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .65rem 1.1rem; border-radius: var(--r); border: 1px solid var(--line2);
  background: var(--s2); color: var(--text); min-height: 42px; transition: background .12s, border-color .12s, transform .06s;
}
.btn:hover { border-color: var(--spirit); color: var(--text); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--spirit); border-color: var(--spirit); color: var(--spirit-ink); }
.btn.primary:hover { background: #7cf0e0; border-color: #7cf0e0; color: var(--spirit-ink); }
.btn.quiet { background: transparent; border-color: transparent; color: var(--mute); }
.btn.quiet:hover { color: var(--text); background: var(--s2); border-color: var(--line); }
.btn.danger { color: var(--bad); }
.btn.danger:hover { border-color: var(--bad); }
.btn.small { min-height: 34px; padding: .35rem .75rem; font-size: .85rem; }
.btn.big { min-height: 50px; padding: .8rem 1.6rem; font-size: 1.02rem; }
.btn[disabled], .btn[aria-disabled="true"] { opacity: .45; cursor: not-allowed; pointer-events: none; }
.linkbtn { background: none; border: 0; color: var(--spirit); font: inherit; padding: 0; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }

.field { display: block; margin: 0 0 1rem; }
.field > span, .label { display: block; font-size: .85rem; font-weight: 600; color: var(--mute); margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=password], input[type=number], select, textarea {
  width: 100%; font: inherit; color: var(--text); background: var(--bg); border: 1px solid var(--line2);
  border-radius: var(--r); padding: .65rem .8rem; min-height: 42px;
}
input:hover, select:hover, textarea:hover { border-color: var(--dim); }
input:focus, select:focus, textarea:focus { outline: 2px solid var(--spirit); outline-offset: 1px; border-color: var(--spirit); }
input[type=color] { width: 44px; height: 44px; padding: 3px; border-radius: 10px; border: 1px solid var(--line2); background: var(--bg); cursor: pointer; }
input[type=range] { accent-color: var(--spirit); width: 100%; }
input[type=checkbox], input[type=radio] { accent-color: var(--spirit); width: 18px; height: 18px; flex: none; margin: 0; }
.hint { font-size: .85rem; color: var(--mute); margin-top: .3rem; }
.pw { position: relative; }
.pw input { padding-right: 4.6rem; }
.pw button { position: absolute; right: 6px; top: 6px; }
.check { display: flex; gap: .7rem; align-items: flex-start; cursor: pointer; }
.check span { font-size: .95rem; }
.check small { display: block; color: var(--mute); font-size: .85rem; }

.msg { font-size: .92rem; padding: .7rem .9rem; border-radius: var(--r); border: 1px solid var(--line2); background: var(--s2); }
.msg.err { border-color: rgba(255,123,123,.5); background: rgba(255,123,123,.08); color: #ffc4c4; }
.msg.ok { border-color: rgba(126,240,164,.45); background: rgba(126,240,164,.07); color: #c4f8d6; }
.msg.warn { border-color: rgba(255,180,84,.5); background: rgba(255,180,84,.08); color: #ffdba8; }
.msg a { color: inherit; }

.card { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: clamp(1rem, 3vw, 1.6rem); }
.card.flat { background: transparent; }
.card > h2, .card > h3 { margin-bottom: .5rem; }
.panel-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }

.badge { display: inline-flex; align-items: center; gap: .35rem; font-size: .75rem; font-weight: 600; padding: .18rem .55rem; border-radius: 999px; border: 1px solid var(--line2); color: var(--mute); background: var(--s2); white-space: nowrap; }
.badge.spirit { color: var(--spirit); border-color: var(--deep); }
.badge.warn { color: var(--warn); border-color: rgba(255,180,84,.4); }
.badge.bad { color: var(--bad); border-color: rgba(255,123,123,.4); }
.badge.ok { color: var(--ok); border-color: rgba(126,240,164,.35); }
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.live .dot { animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .25; } }

/* segmented + choice cards */
.seg { display: inline-flex; border: 1px solid var(--line2); border-radius: var(--r); overflow: hidden; background: var(--bg); }
.seg label { cursor: pointer; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: .55rem .95rem; font-size: .9rem; color: var(--mute); border-right: 1px solid var(--line); min-height: 40px; }
.seg label:last-child span { border-right: 0; }
.seg input:checked + span { background: var(--s3); color: var(--text); box-shadow: inset 0 -2px 0 var(--spirit); }
.seg input:focus-visible + span { outline: 2px solid var(--spirit); outline-offset: -2px; }
.choices { display: grid; gap: .6rem; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.choice { position: relative; cursor: pointer; }
.choice input { position: absolute; opacity: 0; pointer-events: none; }
.choice > div { border: 1px solid var(--line2); border-radius: var(--r); padding: .8rem .95rem; height: 100%; background: var(--bg); transition: border-color .12s, background .12s; }
.choice b { display: block; font-size: .95rem; }
.choice small { color: var(--mute); font-size: .84rem; display: block; margin-top: .15rem; }
.choice input:checked + div { border-color: var(--spirit); background: rgba(79,232,212,.06); }
.choice input:focus-visible + div { outline: 2px solid var(--spirit); outline-offset: 2px; }
.choice:hover > div { border-color: var(--dim); }

/* ---------- landing ---------- */
.hero { padding: clamp(2rem, 6vw, 4.5rem) 0 2rem; }
.hero .wrap { display: grid; gap: 2.5rem; align-items: center; }
@media (min-width: 900px) { .hero .wrap { grid-template-columns: 1.05fr .95fr; } }
.hero h1 { margin-bottom: 1.1rem; }
.hero .cta { margin-top: 1.6rem; }
.screen-frame { background: #000; border: 1px solid var(--line2); border-radius: 18px; padding: 10px; box-shadow: 0 0 0 1px #000, 0 30px 80px -30px rgba(79,232,212,.25); }
.screen-frame canvas { display: block; width: 100%; height: auto; aspect-ratio: 25 / 18; border-radius: 8px; background: #000; }
.screen-cap { display: flex; justify-content: space-between; gap: 1rem; align-items: center; margin-top: .7rem; font-size: .82rem; color: var(--mute); }
.ghostfader { display: flex; align-items: center; gap: .8rem; margin-top: .9rem; font-size: .88rem; color: var(--mute); }
.ghostfader input { flex: 1; }
.section { padding: clamp(2rem, 5vw, 3.5rem) 0; }
.section > .wrap > h2 { margin-bottom: .6rem; }
.section .lede { margin-bottom: 1.6rem; }
.steps { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); counter-reset: s; }
.steps li { list-style: none; background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.2rem; counter-increment: s; }
.steps li::before { content: counter(s); display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--s3); color: var(--spirit); font-weight: 700; font-size: .85rem; margin-bottom: .7rem; }
.steps h3 { margin-bottom: .3rem; }
.steps p { color: var(--mute); margin: 0; font-size: .95rem; }
ol.steps { padding: 0; margin: 0; }
.filelist { border: 1px solid var(--line); border-radius: var(--r-lg); background: var(--s1); overflow: hidden; }
.filelist li { list-style: none; display: grid; grid-template-columns: 1fr auto; gap: .2rem 1rem; padding: .85rem 1.1rem; border-bottom: 1px solid var(--line); align-items: baseline; }
.filelist li:last-child { border-bottom: 0; }
.filelist .fn { font-family: var(--mono); font-size: .86rem; word-break: break-all; }
.filelist .fd { color: var(--mute); font-size: .85rem; grid-column: 1 / -1; }
.filelist .fs { color: var(--spirit); font-family: var(--mono); font-size: .8rem; }
ul.filelist { padding: 0; margin: 0; }
.features { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r-lg); overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); }
.features > div { background: var(--s1); padding: 1.3rem; }
.features h3 { margin-bottom: .35rem; font-size: 1.05rem; }
.features p { color: var(--mute); margin: 0; font-size: .95rem; }

/* ---------- pricing ---------- */
.packs { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.pack { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.3rem; display: flex; flex-direction: column; gap: .35rem; position: relative; }
.pack.best { border-color: var(--deep); background: linear-gradient(180deg, rgba(79,232,212,.07), var(--s1) 55%); }
.pack .n { font-family: var(--display); font-size: 2.2rem; font-weight: 700; letter-spacing: -.03em; line-height: 1; }
.pack .n small { font-size: 1rem; font-weight: 500; color: var(--mute); letter-spacing: 0; }
.pack .price { font-size: 1.2rem; font-weight: 600; }
.pack .per { color: var(--mute); font-size: .88rem; }
.pack .save { color: var(--spirit); font-size: .88rem; font-weight: 600; min-height: 1.3em; }
.pack .btn { margin-top: auto; }
.pack .btn:first-of-type { margin-top: 1rem; }

/* ---------- auth ---------- */
.auth-wrap { display: grid; gap: 2rem; padding-top: clamp(1.5rem, 5vw, 3.5rem); padding-bottom: clamp(1.5rem, 5vw, 3.5rem); }
@media (min-width: 880px) { .auth-wrap { grid-template-columns: 1fr 1fr; align-items: start; } }
.auth-card { max-width: 440px; width: 100%; }
.tabs { display: flex; gap: .3rem; border-bottom: 1px solid var(--line); margin-bottom: 1.2rem; }
.tabs a { padding: .6rem .9rem; color: var(--mute); text-decoration: none; border-bottom: 2px solid transparent; margin-bottom: -1px; font-weight: 600; }
.tabs a[aria-current="page"] { color: var(--text); border-color: var(--spirit); }

/* ---------- workspace ---------- */
.page { padding-top: clamp(1.4rem, 4vw, 2.6rem); }
.page-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.4rem; }
.page-head h1 { font-size: clamp(1.7rem, 4vw, 2.3rem); }
.two { display: grid; gap: 1.4rem; align-items: start; }
@media (min-width: 980px) { .two { grid-template-columns: minmax(0, 1fr) 360px; } .two .sticky { position: sticky; top: 84px; } }
.form-sec { padding: 1.2rem 0; border-top: 1px solid var(--line); }
.form-sec:first-child { border-top: 0; padding-top: 0; }
.form-sec > h3 { margin-bottom: .2rem; }
.form-sec > .sub { color: var(--mute); font-size: .9rem; margin-bottom: .9rem; }
.fields2 { display: grid; gap: 0 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

.drop { border: 1.5px dashed var(--line2); border-radius: var(--r-lg); padding: 1.6rem 1rem; text-align: center; background: var(--bg); cursor: pointer; transition: border-color .12s, background .12s; display: block; }
.drop:hover, .drop.over { border-color: var(--spirit); background: rgba(79,232,212,.05); }
.drop input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.drop:focus-within { outline: 2px solid var(--spirit); outline-offset: 2px; }
.drop .big { font-family: var(--display); font-size: 1.2rem; font-weight: 600; display: block; margin-bottom: .2rem; }
.drop.has { border-style: solid; border-color: var(--deep); text-align: left; display: flex; gap: .9rem; align-items: center; }
.drop .fileinfo { min-width: 0; }
.drop .fileinfo b { display: block; overflow-wrap: anywhere; }
.progress { height: 8px; background: var(--s3); border-radius: 99px; overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--deep), var(--spirit)); transition: width .2s; }
.progress.ind > i { width: 40%; animation: slide 1.2s ease-in-out infinite; }
@keyframes slide { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
.cost { display: flex; justify-content: space-between; align-items: baseline; padding: .8rem 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 1rem 0; }
.cost b { font-family: var(--display); font-size: 1.6rem; }

/* look controls */
.look { display: grid; gap: 1.2rem; }
@media (min-width: 640px) { .look.side { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } }
.look .colors { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.colorfield { display: flex; align-items: center; gap: .7rem; }
.colorfield .t { font-size: .88rem; line-height: 1.25; }
.colorfield .t small { display: block; color: var(--mute); font-family: var(--mono); font-size: .75rem; }
.fontgrid { display: grid; gap: .5rem; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
.fontopt { position: relative; cursor: pointer; }
.fontopt input { position: absolute; opacity: 0; pointer-events: none; }
.fontopt > div { border: 1px solid var(--line2); border-radius: var(--r); padding: .55rem .7rem; background: var(--bg); }
.fontopt .aa { font-size: 1.5rem; line-height: 1.1; display: block; font-weight: 700; }
.fontopt small { color: var(--mute); font-size: .76rem; }
.fontopt input:checked + div { border-color: var(--spirit); background: rgba(79,232,212,.06); }
.fontopt input:focus-visible + div { outline: 2px solid var(--spirit); outline-offset: 2px; }

/* dashboard */
.jobs { display: grid; gap: 1rem; }
.job { background: var(--s1); border: 1px solid var(--line); border-radius: var(--r-lg); padding: 1.1rem 1.2rem; display: grid; gap: .9rem; }
.job.active { border-color: var(--deep); }
.job-top { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; align-items: flex-start; }
.job-title { font-family: var(--display); font-size: 1.15rem; font-weight: 650; letter-spacing: -.015em; overflow-wrap: anywhere; }
.job-title a { color: var(--text); text-decoration: none; }
.job-title a:hover { color: var(--spirit); }
.job-meta { color: var(--mute); font-size: .85rem; display: flex; gap: .3rem .9rem; flex-wrap: wrap; margin-top: .15rem; }
.badges { display: flex; gap: .35rem; flex-wrap: wrap; }
.stepper { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 4px; margin: 0; padding: 0; list-style: none; }
.stepper li { position: relative; padding-top: 12px; font-size: .78rem; color: var(--dim); min-width: 0; }
.stepper li::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; border-radius: 4px; background: var(--s3); }
.stepper li b { display: block; font-weight: 600; color: inherit; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stepper li span { font-family: var(--mono); font-size: .72rem; }
.stepper li.done { color: var(--mute); } .stepper li.done::before { background: var(--deep); }
.stepper li.now { color: var(--text); } .stepper li.now::before { background: linear-gradient(90deg, var(--deep), var(--spirit), var(--deep)); background-size: 200% 100%; animation: sweep 1.6s linear infinite; }
.stepper li.wait { color: var(--warn); } .stepper li.wait::before { background: var(--warn); }
.stepper li.fail { color: var(--bad); } .stepper li.fail::before { background: var(--bad); }
@keyframes sweep { to { background-position: -200% 0; } }
.later { display: flex; gap: .4rem; flex-wrap: wrap; }
.job-foot { display: flex; justify-content: space-between; gap: .8rem; flex-wrap: wrap; align-items: center; }
.empty { text-align: center; padding: 3rem 1rem; border: 1.5px dashed var(--line2); border-radius: var(--r-lg); }
.empty h2 { margin-bottom: .4rem; }
@media (max-width: 560px) { .stepper li span { display: none; } .stepper li { font-size: .7rem; } }

/* track page */
.dl-grid { display: grid; gap: .7rem; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); }
.dl { border: 1px solid var(--line2); border-radius: var(--r); padding: .8rem .95rem; display: grid; gap: .35rem; background: var(--bg); align-content: start; }
.dl b { font-size: .95rem; }
.dl small { color: var(--mute); font-size: .82rem; }
.dl.main { border-color: var(--deep); background: rgba(79,232,212,.05); }
.dl .row { margin-top: .2rem; }
.savebar { position: sticky; bottom: 0; z-index: 20; margin-top: 1.4rem; background: rgba(10,17,18,.96); backdrop-filter: blur(8px); border: 1px solid var(--deep); border-radius: var(--r-lg); padding: .8rem 1rem; display: flex; gap: .8rem 1.2rem; align-items: center; justify-content: space-between; flex-wrap: wrap; box-shadow: 0 -12px 30px rgba(0,0,0,.5); }
.render-state { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; font-size: .9rem; }
video { width: 100%; border-radius: var(--r); background: #000; aspect-ratio: 16 / 9; }

/* timing editor */
.editor { display: grid; gap: 1rem; }
.transport { display: grid; gap: .9rem; }
@media (min-width: 900px) { .transport { grid-template-columns: minmax(0, 1fr) 320px; } }
.tp-left { display: grid; gap: .8rem; min-width: 0; }
.tp-bar { display: flex; gap: .6rem; align-items: center; flex-wrap: wrap; }
.tp-time { font-family: var(--mono); font-size: 1rem; min-width: 8.5ch; }
.wave { position: relative; border: 1px solid var(--line2); border-radius: var(--r); background: var(--bg); overflow: hidden; touch-action: none; }
.wave canvas { display: block; width: 100%; }
.wave.full canvas { height: 54px; cursor: pointer; }
.wave.zoom canvas { height: 108px; cursor: grab; }
.wave.zoom canvas.drag { cursor: grabbing; }
.mix { display: grid; gap: .6rem; grid-template-columns: 1fr 1fr; }
.mix label { font-size: .82rem; color: var(--mute); }
.inspector { border: 1px solid var(--line2); border-radius: var(--r); padding: .9rem 1rem; background: var(--s2); display: grid; gap: .8rem; }
.inspector.empty-i { color: var(--mute); text-align: center; }
.insp-grid { display: grid; gap: .8rem; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.nudges { display: flex; gap: .3rem; flex-wrap: wrap; align-items: center; }
.nudges .btn { min-height: 32px; padding: .2rem .55rem; font-family: var(--mono); font-size: .78rem; }
.lines { border: 1px solid var(--line); border-radius: var(--r); max-height: 460px; overflow: auto; background: var(--s1); }
.line { padding: .6rem .9rem; border-bottom: 1px solid var(--line); display: grid; gap: .4rem; grid-template-columns: 78px 1fr auto; align-items: start; }
.line:last-child { border-bottom: 0; }
.line.cur { background: rgba(79,232,212,.05); }
.line .lt { font-family: var(--mono); font-size: .75rem; color: var(--dim); padding-top: .45rem; }
.chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.chip { font: inherit; font-size: .95rem; color: var(--text); background: var(--s2); border: 1px solid var(--line2); border-radius: 8px; padding: .25rem .55rem; cursor: pointer; }
.chip:hover { border-color: var(--dim); }
.chip.past { color: var(--mute); }
.chip.on { background: var(--spirit); color: var(--spirit-ink); border-color: var(--spirit); font-weight: 600; }
.chip.sel { outline: 2px solid var(--warn); outline-offset: 1px; }
.chip.bad { border-color: var(--bad); }
.line .lshift { display: flex; gap: .25rem; }
.line .lshift .btn { min-height: 28px; padding: .1rem .45rem; font-family: var(--mono); font-size: .72rem; }
@media (max-width: 640px) { .line { grid-template-columns: 1fr; } .line .lt { padding: 0; } }
.kbd { display: grid; grid-template-columns: auto 1fr; gap: .3rem 1rem; font-size: .88rem; color: var(--mute); }
kbd { font-family: var(--mono); font-size: .78rem; padding: .1rem .4rem; border: 1px solid var(--line2); border-bottom-width: 2px; border-radius: 5px; background: var(--s2); color: var(--text); }
details.fold { border: 1px solid var(--line); border-radius: var(--r); background: var(--bg); }
details.fold > summary { cursor: pointer; padding: .75rem 1rem; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; gap: 1rem; }
details.fold > summary::-webkit-details-marker { display: none; }
details.fold > summary::after { content: "+"; color: var(--mute); font-size: 1.2rem; line-height: 1; }
details.fold[open] > summary::after { content: "–"; }
details.fold > .body { padding: 0 1rem 1rem; }

/* white-label */
.wl { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
.wl-slot { border: 1px solid var(--line2); border-radius: var(--r); padding: .9rem; background: var(--bg); display: grid; gap: .6rem; }
.wl-thumb { aspect-ratio: 16 / 9; border-radius: 8px; background: repeating-conic-gradient(#0d1516 0% 25%, #121d1e 0% 50%) 50% / 16px 16px; display: grid; place-items: center; overflow: hidden; color: var(--dim); font-size: .85rem; }
.wl-thumb img { width: 100%; height: 100%; object-fit: contain; }

/* toast + dialog */
.toasts { position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%); z-index: 100; display: grid; gap: .5rem; width: min(92vw, 420px); pointer-events: none; }
.toast { pointer-events: auto; background: var(--s3); border: 1px solid var(--line2); border-radius: var(--r); padding: .75rem 1rem; box-shadow: 0 10px 40px rgba(0,0,0,.6); font-size: .93rem; animation: tin .18s ease-out; }
.toast.err { border-color: rgba(255,123,123,.6); } .toast.ok { border-color: rgba(126,240,164,.5); }
@keyframes tin { from { opacity: 0; transform: translateY(8px); } }
dialog { background: var(--s1); color: var(--text); border: 1px solid var(--line2); border-radius: var(--r-lg); padding: 1.4rem; max-width: min(92vw, 440px); }
dialog::backdrop { background: rgba(0,0,0,.7); }
dialog h3 { margin-bottom: .5rem; }
dialog .row { justify-content: flex-end; margin-top: 1.2rem; }

.banner { border-bottom: 1px solid rgba(255,180,84,.4); background: rgba(255,180,84,.09); color: #ffdba8; font-size: .92rem; }
.banner .wrap { padding-top: .6rem; padding-bottom: .6rem; display: flex; gap: .4rem 1rem; align-items: center; flex-wrap: wrap; }
.banner a, .banner .linkbtn { color: #fff; }
.loading { display: grid; place-items: center; padding: 4rem 1rem; color: var(--mute); }
.spinner { width: 22px; height: 22px; border-radius: 50%; border: 2px solid var(--line2); border-top-color: var(--spirit); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* static content pages */
.prose { max-width: 720px; }
.prose h1 { font-size: clamp(2rem, 4.5vw, 2.8rem); margin-bottom: .5rem; }
.prose h2 { font-size: 1.35rem; margin: 2rem 0 .5rem; }
.prose p, .prose li { color: #cfe3df; }
.prose ul { padding-left: 1.2rem; }
.prose li { margin-bottom: .35rem; }
.prose code, .doc code { font-family: var(--mono); font-size: .88em; background: var(--s2); padding: .1em .4em; border-radius: 5px; }
pre.code { font-family: var(--mono); font-size: .82rem; line-height: 1.5; background: #030607; border: 1px solid var(--line); border-radius: var(--r); padding: 1rem; overflow-x: auto; margin: .6rem 0 1.2rem; color: #d8efeb; position: relative; }
.doc table { width: 100%; border-collapse: collapse; font-size: .92rem; margin: .6rem 0 1.4rem; }
.doc th, .doc td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--line); vertical-align: top; }
.doc th { color: var(--mute); font-weight: 600; font-size: .82rem; }
.doc-tbl { overflow-x: auto; }
.updated { color: var(--dim); font-size: .85rem; margin-bottom: 1.5rem; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}
