:root {
  --bg: #050505;
  --bg-2: #101012;
  --surface: #101012;
  --ink: #f6f3ee;
  --muted: #9b968e;
  --line: rgba(255, 255, 255, 0.1);
  --accent: #ff7eb6;
  --accent-ink: #ffd4e8;
  --accent-soft: rgba(255, 126, 182, 0.14);
  --gold: #f3c15a;
  --cyan: #7ad7ff;
  --rec: #ff8eae;
  --rec-soft: rgba(255, 126, 182, 0.14);
  --ok: #3ddea6;
  --warn: #f0a35a;
  --chip: #141416;
  --radius: 14px;
  --shadow: 0 0 0 1px rgba(255, 255, 255, 0.04);
  --trail: linear-gradient(90deg, #f3c15a, #ff7eb6 42%, #7ad7ff 78%, #b8f27a);
  --nav: 64px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100dvh; background: var(--bg); color: var(--ink);
  font-family: "Avenir Next", "PingFang SC", "Noto Sans SC", "Source Han Sans SC", sans-serif; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--cyan); }
#app { min-height: 100dvh; }
.shell {
  min-height: 100dvh;
  padding-bottom: calc(var(--nav) + env(safe-area-inset-bottom));
  background:
    radial-gradient(520px 220px at 100% -8%, rgba(243, 193, 90, 0.1), transparent 62%),
    radial-gradient(420px 260px at 0% 110%, rgba(122, 215, 255, 0.08), transparent 58%);
}
.top {
  position: sticky; top: 0; z-index: 8;
  display: flex; align-items: center; gap: 10px;
  height: 56px; padding: 0 16px;
  background: rgba(7, 7, 8, .92); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 650; letter-spacing: 0.12em; }
.brand small, .brand em {
  display: block; font-weight: 500; font-style: normal;
  color: var(--muted); font-size: 11px; letter-spacing: 0.18em;
}
.brand-art {
  width: 100%; height: 132px; object-fit: cover; object-position: center 38%;
  border-radius: 12px; display: block; margin-bottom: 12px;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.08);
}
.brand strong { display: block; font-size: 15px; font-weight: 650; letter-spacing: 0.28em; }
.grow { flex: 1; }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 28px; padding: 0 10px; border-radius: 999px;
  background: var(--chip); color: var(--muted); font-size: 12px;
  border: 1px solid rgba(255, 126, 182, 0.28);
}
.chip.ok { background: rgba(61, 222, 166, 0.14); color: var(--ok); border-color: transparent; }
.chip.rec { background: var(--rec-soft); color: var(--rec); border-color: transparent; }
.chip.warn { background: rgba(240, 163, 90, 0.16); color: var(--warn); border-color: transparent; }
.page { padding: 16px; max-width: 980px; margin: 0 auto; }
h1 { font-size: 22px; margin: 0 0 8px; letter-spacing: 0.04em; font-weight: 620; }
h2 { font-size: 16px; margin: 0 0 8px; }
.sub { color: var(--muted); font-size: 14px; line-height: 1.5; margin: 0 0 16px; }
.card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px; margin: 0 0 12px;
  box-shadow: var(--shadow);
}
.row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.grid { display: grid; gap: 10px; }
@media (min-width: 800px) {
  .grid.two { grid-template-columns: 1fr 1fr; }
}
.rail { display: none; }
.rail a, .rail button {
  appearance: none; border: 0; background: transparent; text-align: left;
  padding: 9px 12px; border-radius: 8px; color: #d9d4cc; text-decoration: none;
}
.rail a.on, .rail button.on {
  background: linear-gradient(90deg, rgba(243, 193, 90, 0.16), rgba(122, 215, 255, 0.06));
  color: white; box-shadow: inset 2px 0 0 var(--gold); font-weight: 650;
}
label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 6px; }
input, select, textarea {
  width: 100%; border: 1px solid var(--line); border-radius: 10px;
  padding: 11px 12px; background: #0c0c0e; color: var(--ink);
}
textarea { min-height: 92px; resize: vertical; }
.field { margin: 0 0 12px; }
.btn {
  border: 0; border-radius: 999px; padding: 10px 16px; font-weight: 650;
  background: var(--ink); color: #111; text-decoration: none;
}
.btn:active { transform: scale(.98); }
.btn.accent { background: var(--gold); color: #111; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid rgba(255, 255, 255, 0.22); }
.btn.danger { background: transparent; color: var(--rec); border: 1px solid rgba(255, 126, 182, 0.45); }
.btn.wide { width: 100%; text-align: center; }
.btn:disabled { opacity: .45; }
.filters { display: flex; gap: 8px; overflow: auto; padding-bottom: 8px; margin: 0 0 8px; }
.pill {
  flex: none; border: 1px solid transparent; background: transparent; border-radius: 999px;
  padding: 7px 12px; color: var(--muted);
}
.pill.on { background: var(--ink); color: #111; font-weight: 650; }
.script {
  display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; text-align: left; width: 100%; color: inherit; text-decoration: none;
}
.script b { display: block; font-size: 16px; margin-bottom: 4px; }
.meta { color: var(--muted); font-size: 12px; line-height: 1.45; }
.kind { font-size: 11px; font-weight: 700; letter-spacing: .06em; color: var(--gold); }
.run-hero { padding: 8px 0 16px; }
.run-timer { font-size: 42px; font-weight: 720; letter-spacing: -0.04em; font-variant-numeric: tabular-nums; }
.run-stage { font-size: 28px; line-height: 1.25; letter-spacing: -0.03em; margin: 8px 0 12px; }
.progress { height: 6px; background: #141416; border-radius: 99px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--trail); width: 0; }
.stage-list { display: flex; flex-direction: column; gap: 6px; }
.stage-list div {
  display: grid; grid-template-columns: 28px 1fr auto; gap: 8px; align-items: start;
  padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.stage-list div.on { color: var(--gold); font-weight: 650; }
.bottom-nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 9;
  display: grid; grid-template-columns: repeat(4, 1fr);
  height: calc(var(--nav) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(7, 7, 8, .94); backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
}
.bottom-nav a {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; text-decoration: none; color: var(--muted); font-size: 11px; font-weight: 650;
}
.bottom-nav a.on { color: var(--gold); }
.err { color: var(--rec); font-size: 13px; margin: 8px 0; }
.ok { color: var(--ok); }
.muted { color: var(--muted); }
.empty { padding: 28px 8px; color: var(--muted); text-align: center; }
.drop {
  border: 1px dashed var(--line); border-radius: var(--radius); padding: 22px; text-align: center;
  background: #0c0c0e; color: var(--muted);
}
.big-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
@media (prefers-reduced-motion: reduce) {
  .btn:active { transform: none; }
}
