@font-face { font-family: "Sora"; src: url(/fonts/sora.woff2) format("woff2"); font-weight: 100 800; font-display: swap; }
@font-face { font-family: "Playfair"; src: url(/fonts/playfair-italic.woff2) format("woff2"); font-weight: 400 900; font-style: italic; font-display: swap; }

:root {
  --bg: #12051f;
  --bg2: #1b0833;
  --panel: rgba(38, 12, 70, .72);
  --panel-solid: #26103f;
  --panel-hi: rgba(64, 24, 112, .55);
  --line: rgba(246, 205, 106, .22);
  --line-soft: rgba(196, 150, 255, .16);
  --text: #f6eeff;
  --muted: #b9a6d6;
  --faint: #8a76a8;
  --gold-1: #fff6c9;
  --gold-2: #f8d46a;
  --gold-3: #e0a52a;
  --gold-4: #9a6412;
  --gold: linear-gradient(180deg, var(--gold-1) 0%, var(--gold-2) 38%, var(--gold-3) 70%, var(--gold-4) 100%);
  --violet: #b56cff;
  --violet-2: #8b3dff;
  --magenta: #e04bd6;
  --ok: #7ee2b0;
  --due: #ffb547;
  --late: #ff6b8a;
  --radius: 20px;
  --radius-s: 12px;
  --shadow: 0 18px 50px rgba(5, 0, 14, .55);
  --display: "Playfair", Georgia, serif;
  --ui: "Sora", system-ui, -apple-system, "Segoe UI", sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body {
  font-family: var(--ui);
  font-size: 15px;
  line-height: 1.45;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}
img { display: block; max-width: 100%; height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

/* ---------- backdrop ---------- */
.sky {
  position: fixed; inset: 0; z-index: -1; overflow: hidden;
  background:
    radial-gradient(1200px 700px at 50% 40%, rgba(18, 5, 31, .35), rgba(18, 5, 31, .92) 75%),
    url(/img/backdrop.webp) center / cover no-repeat,
    var(--bg);
}
.sky::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(18, 5, 31, .2), rgba(18, 5, 31, .75));
}
.sky i {
  position: absolute; width: 3px; height: 3px; border-radius: 50%;
  background: var(--gold-1); box-shadow: 0 0 12px 3px rgba(248, 212, 106, .7);
  animation: twinkle 5s ease-in-out infinite; z-index: 1;
}
.sky i:nth-child(1) { top: 18%; left: 72%; }
.sky i:nth-child(2) { top: 64%; left: 28%; animation-delay: 1.7s; }
.sky i:nth-child(3) { top: 82%; left: 84%; animation-delay: 3.1s; }
@keyframes twinkle { 0%, 100% { opacity: 0; transform: scale(.4); } 50% { opacity: 1; transform: scale(1); } }

.gold-text {
  background: var(--gold);
  -webkit-background-clip: text; background-clip: text;
  color: transparent;
  filter: drop-shadow(0 1px 0 rgba(90, 40, 0, .6)) drop-shadow(0 0 14px rgba(248, 190, 80, .25));
}

/* ---------- shell ---------- */
.shell { display: grid; grid-template-columns: 250px minmax(0, 1fr); min-height: 100vh; }
.rail {
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column; gap: 28px;
  padding: 30px 18px 26px;
  background: linear-gradient(180deg, rgba(30, 9, 56, .88), rgba(20, 6, 38, .92));
  border-right: 1px solid var(--line);
  backdrop-filter: blur(14px);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; padding: 0 6px; }
.brand img { width: 46px; height: 46px; border-radius: 14px; box-shadow: 0 0 0 1px var(--line), 0 6px 18px rgba(139, 61, 255, .45); }
.brand span { font-family: var(--display); font-style: italic; font-size: 25px; line-height: 1; white-space: nowrap; }
.brand b { font-weight: 800; }
.brand em { font-weight: 700; color: #ecdcff; }

.nav { display: flex; flex-direction: column; gap: 6px; }
.nav a {
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px; border-radius: 14px;
  color: var(--muted); text-decoration: none; font-weight: 500;
  border: 1px solid transparent;
  transition: background .2s, color .2s, border-color .2s;
}
.nav a svg { width: 21px; height: 21px; fill: currentColor; flex: none; }
.nav a:hover { color: var(--text); background: rgba(139, 61, 255, .14); }
.nav a.on {
  color: #2a1300; font-weight: 700;
  background: var(--gold);
  box-shadow: 0 6px 22px rgba(224, 165, 42, .35), inset 0 1px 0 rgba(255, 255, 255, .6);
}
.rail-note { margin: auto 6px 0; font-size: 12px; color: var(--faint); }
.install-btn { margin: 0 6px; }

.main { padding: 34px clamp(18px, 4vw, 48px) 60px; max-width: 1180px; width: 100%; outline: none; }

/* ---------- headings / hero ---------- */
.hero {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 18px;
  padding: 28px 30px; margin-bottom: 22px;
  border-radius: 26px;
  background:
    radial-gradient(120% 140% at 100% 0%, rgba(224, 75, 214, .28), transparent 55%),
    linear-gradient(135deg, rgba(64, 20, 118, .92), rgba(30, 9, 58, .92));
  border: 1px solid var(--line);
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255, 240, 200, .12);
}
.hero::before {
  content: ""; position: absolute; inset: auto -10% -60% 30%; height: 120%;
  background: radial-gradient(closest-side, rgba(248, 212, 106, .14), transparent);
  pointer-events: none;
}
.eyebrow { margin: 0 0 6px; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; color: var(--gold-2); font-weight: 600; }
.title { margin: 0; font-family: var(--display); font-style: italic; font-weight: 800; font-size: clamp(34px, 5vw, 52px); line-height: 1.02; }
.lead { margin: 10px 0 0; color: var(--muted); max-width: 52ch; }
.hero-art { width: clamp(110px, 16vw, 170px); filter: drop-shadow(0 18px 30px rgba(10, 0, 30, .6)); animation: float 6s ease-in-out infinite; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; position: relative; }
@keyframes float { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-8px) rotate(2deg); } }

.section-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 28px 0 12px; }
.section-head h2 { margin: 0; font-size: 18px; font-weight: 700; }
.section-head .hint { color: var(--faint); font-size: 13px; }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 1px solid var(--line-soft);
  background: rgba(139, 61, 255, .16); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; text-decoration: none;
  transition: transform .15s, background .2s, box-shadow .2s, border-color .2s;
}
.btn:hover { background: rgba(139, 61, 255, .28); border-color: rgba(196, 150, 255, .4); }
.btn:active { transform: translateY(1px) scale(.98); }
.btn svg { width: 18px; height: 18px; fill: currentColor; }
.btn-gold {
  color: #2a1300; border: 0;
  background: var(--gold);
  box-shadow: 0 8px 24px rgba(224, 165, 42, .35), inset 0 1px 0 rgba(255, 255, 255, .7), inset 0 -2px 0 rgba(120, 70, 0, .35);
}
.btn-gold:hover { background: var(--gold); filter: brightness(1.06); }
.btn-ghost { background: transparent; }
.btn-danger { background: rgba(255, 107, 138, .14); border-color: rgba(255, 107, 138, .35); color: #ffc2cf; }
.btn-danger:hover { background: rgba(255, 107, 138, .26); }
.btn-sm { min-height: 34px; padding: 0 13px; font-size: 13px; }
.btn-block { width: 100%; }
.btn:focus-visible, .nav a:focus-visible, .chip:focus-visible, .card:focus-visible { outline: 2px solid var(--gold-2); outline-offset: 2px; }

/* ---------- stat tiles ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; }
.stat {
  position: relative; overflow: hidden;
  padding: 18px 18px 18px 20px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line-soft);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; gap: 14px;
}
.stat img { width: 58px; height: 58px; object-fit: contain; flex: none; filter: drop-shadow(0 8px 12px rgba(0, 0, 0, .45)); }
.stat .k { font-size: 12px; color: var(--muted); letter-spacing: .04em; }
.stat .v { font-size: 24px; font-weight: 700; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.stat .s { font-size: 12px; color: var(--faint); }
.stat.hl { border-color: var(--line); background: linear-gradient(135deg, rgba(90, 30, 150, .7), rgba(40, 12, 74, .8)); }
.stat.hl .v { color: var(--gold-2); }

/* ---------- toolbar ---------- */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 26px 0 16px; }
.search {
  flex: 1 1 240px; min-width: 0; display: flex; align-items: center; gap: 10px;
  min-height: 46px; padding: 0 16px; border-radius: 999px;
  background: rgba(20, 6, 38, .7); border: 1px solid var(--line-soft);
}
.search svg { width: 18px; height: 18px; fill: var(--faint); flex: none; }
.search input { flex: 1; background: none; border: 0; outline: none; min-width: 0; }
.search:focus-within { border-color: var(--gold-3); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  min-height: 36px; padding: 0 14px; border-radius: 999px; cursor: pointer;
  background: rgba(20, 6, 38, .6); border: 1px solid var(--line-soft); color: var(--muted);
  font-size: 13px; font-weight: 600;
}
.chip b { font-weight: 700; color: var(--text); margin-left: 4px; }
.chip.on { background: rgba(248, 212, 106, .14); border-color: var(--gold-3); color: var(--gold-1); }

/* ---------- subscriber cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 14px; }
.card {
  position: relative; display: flex; flex-direction: column; gap: 14px;
  padding: 18px; border-radius: var(--radius); cursor: pointer;
  background: linear-gradient(160deg, rgba(56, 18, 102, .78), rgba(28, 8, 52, .82));
  border: 1px solid var(--line-soft);
  box-shadow: 0 10px 30px rgba(5, 0, 14, .35);
  transition: transform .2s, border-color .2s, box-shadow .2s;
  text-decoration: none;
}
.card:hover { transform: translateY(-3px); border-color: var(--line); box-shadow: 0 16px 40px rgba(5, 0, 14, .5), 0 0 0 1px rgba(248, 212, 106, .08); }
.card.off { opacity: .7; }
.card-top { display: flex; gap: 14px; align-items: flex-start; }
.card-name { font-weight: 700; font-size: 16px; line-height: 1.25; overflow-wrap: anywhere; }
.card-sub { color: var(--faint); font-size: 12.5px; margin-top: 2px; overflow-wrap: anywhere; }
.card-mid { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.card-foot { display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; padding-top: 12px; border-top: 1px solid rgba(196, 150, 255, .12); }
.card-foot .fee { font-size: 12px; color: var(--muted); }
.card-foot .fee b { display: block; font-size: 18px; color: var(--text); font-variant-numeric: tabular-nums; }
.card-actions { display: flex; gap: 6px; }

.pkg {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 600;
  background: rgba(181, 108, 255, .16); border: 1px solid rgba(181, 108, 255, .35); color: #e2c8ff;
}
.pkg i { font-style: normal; color: var(--gold-2); }
.tag { padding: 4px 10px; border-radius: 999px; font-size: 11.5px; font-weight: 700; letter-spacing: .03em; }
.tag-clear { background: rgba(126, 226, 176, .13); color: var(--ok); }
.tag-adv { background: rgba(181, 108, 255, .2); color: #dcbcff; }
.tag-due { background: rgba(255, 181, 71, .15); color: var(--due); }
.tag-late { background: rgba(255, 107, 138, .16); color: var(--late); }
.tag-off { background: rgba(185, 166, 214, .14); color: var(--muted); }

/* signal glyph */
.sig {
  flex: none; width: 50px; height: 50px; border-radius: 15px;
  display: grid; place-items: center;
  background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .14), transparent 60%), linear-gradient(160deg, #3b1470, #1d0738);
  border: 1px solid rgba(248, 212, 106, .25);
  box-shadow: inset 0 0 18px rgba(181, 108, 255, .25);
}
.sig svg { width: 28px; height: 28px; }
.sig rect { fill: rgba(196, 150, 255, .2); }
.sig .lit { fill: url(#gGold); }
.sig.s-late .lit { fill: var(--late); }
.sig.s-due .lit { fill: var(--due); }
.sig.s-adv .lit { fill: url(#gViolet); }
.sig.s-off line { stroke: var(--muted); stroke-width: 2.4; stroke-linecap: round; }
.sig-lg { width: 64px; height: 64px; border-radius: 19px; }
.sig-lg svg { width: 36px; height: 36px; }

/* ---------- panels / lists ---------- */
.panel {
  padding: 20px; border-radius: var(--radius);
  background: var(--panel); border: 1px solid var(--line-soft);
  backdrop-filter: blur(10px);
}
.panel + .panel { margin-top: 14px; }
.panel h3 { margin: 0 0 14px; font-size: 15px; font-weight: 700; }
.list { display: flex; flex-direction: column; }
.row {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 14px;
  padding: 13px 4px; border-bottom: 1px solid rgba(196, 150, 255, .1);
}
.row:last-child { border-bottom: 0; }
.row .ic {
  width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none;
  background: rgba(139, 61, 255, .18); color: var(--violet);
}
.row .ic svg { width: 19px; height: 19px; fill: currentColor; }
.row .ic.pay { background: rgba(126, 226, 176, .13); color: var(--ok); }
.row .ic.chg { background: rgba(248, 212, 106, .13); color: var(--gold-2); }
.row .t { font-weight: 600; overflow-wrap: anywhere; }
.row .d { color: var(--faint); font-size: 12.5px; overflow-wrap: anywhere; }
.row .amt { text-align: right; font-variant-numeric: tabular-nums; font-weight: 700; white-space: nowrap; }
.row .amt small { display: block; font-weight: 500; color: var(--faint); font-size: 11.5px; }
.row .amt.plus { color: var(--ok); }
.row .amt.minus { color: var(--gold-2); }
.row-actions { display: flex; gap: 6px; align-items: center; }
a.row { text-decoration: none; }
a.row:hover { background: rgba(139, 61, 255, .08); }
.icon-btn {
  width: 34px; height: 34px; border-radius: 10px; border: 1px solid transparent; cursor: pointer;
  background: transparent; color: var(--faint); display: grid; place-items: center;
}
.icon-btn:hover { color: var(--late); background: rgba(255, 107, 138, .12); }
.icon-btn svg { width: 17px; height: 17px; fill: currentColor; }

/* ---------- detail ---------- */
.back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); text-decoration: none; font-size: 14px; margin-bottom: 14px; }
.back:hover { color: var(--gold-1); }
.back svg { width: 18px; height: 18px; fill: currentColor; }
.who { display: flex; gap: 18px; align-items: center; }
.who h1 { margin: 0; font-family: var(--display); font-style: italic; font-weight: 800; font-size: clamp(30px, 4.4vw, 44px); line-height: 1.05; overflow-wrap: anywhere; }
.who .meta { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: 13.5px; margin-top: 8px; }
.who .meta span { display: inline-flex; align-items: center; gap: 6px; }
.who .meta svg { width: 15px; height: 15px; fill: var(--gold-3); }
.cols { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); gap: 14px; align-items: start; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 10px 16px; margin: 0; font-size: 14px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; text-align: right; font-weight: 600; overflow-wrap: anywhere; }
.notes { margin-top: 14px; padding: 12px 14px; border-radius: var(--radius-s); background: rgba(20, 6, 38, .55); color: var(--muted); font-size: 13.5px; white-space: pre-wrap; overflow-wrap: anywhere; }
.big-balance { font-size: clamp(30px, 4vw, 40px); font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }

/* ---------- empty ---------- */
.empty { text-align: center; padding: 44px 20px; border-radius: 26px; background: var(--panel); border: 1px dashed var(--line); }
.empty img { width: 150px; margin: 0 auto 10px; filter: drop-shadow(0 16px 24px rgba(0, 0, 0, .5)); }
.empty h3 { margin: 0 0 6px; font-family: var(--display); font-style: italic; font-size: 28px; }
.empty p { margin: 0 auto 18px; color: var(--muted); max-width: 42ch; }
.empty .hero-actions { justify-content: center; }
.empty-sm { padding: 26px 10px; text-align: center; color: var(--faint); }

/* ---------- reports ---------- */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 220px; padding: 10px 2px 0; }
.bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 8px; height: 100%; min-width: 0; }
.bar .pair { width: 100%; max-width: 46px; flex: 1; display: flex; align-items: flex-end; gap: 3px; }
.bar .col { flex: 1; border-radius: 7px 7px 3px 3px; min-height: 3px; transition: height .6s cubic-bezier(.2, .8, .2, 1); }
.bar .col.billed { background: linear-gradient(180deg, rgba(196, 150, 255, .7), rgba(139, 61, 255, .35)); }
.bar .col.got { background: var(--gold); box-shadow: 0 0 14px rgba(248, 212, 106, .25); }
.bar .lbl { font-size: 11px; color: var(--faint); white-space: nowrap; }
.legend { display: flex; gap: 16px; font-size: 12.5px; color: var(--muted); }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .l-b { background: var(--violet); }
.legend .l-g { background: var(--gold-2); }
.donut-wrap { display: flex; align-items: center; gap: 22px; flex-wrap: wrap; }
.donut { width: 150px; height: 150px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.donut > div { width: 104px; height: 104px; border-radius: 50%; background: var(--panel-solid); display: grid; place-items: center; text-align: center; }
.donut b { display: block; font-size: 24px; }
.donut small { color: var(--faint); font-size: 11.5px; }
.meter { height: 10px; border-radius: 99px; background: rgba(196, 150, 255, .15); overflow: hidden; margin-top: 10px; }
.meter i { display: block; height: 100%; background: var(--gold); border-radius: 99px; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin-top: 14px; }

/* ---------- settings ---------- */
.set-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.set-grid .panel + .panel, .report-grid .panel + .panel { margin-top: 0; }
.set-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.set-head img { width: 52px; height: 52px; object-fit: contain; }
.set-head h3 { margin: 0; }
.set-head p { margin: 2px 0 0; color: var(--faint); font-size: 13px; }
.btn-col { display: flex; flex-direction: column; gap: 10px; }
.fine { color: var(--faint); font-size: 12.5px; margin: 12px 0 0; }
.fine a { color: var(--gold-2); }

/* ---------- forms / sheet ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 50; display: grid; grid-template-columns: minmax(0, 1fr); place-items: center; padding: 20px; }
.sheet-back { position: absolute; inset: 0; background: rgba(8, 2, 16, .7); backdrop-filter: blur(6px); animation: fade .2s ease; }
.sheet {
  position: relative; width: min(520px, 100%); max-height: calc(100vh - 40px); overflow: auto; overflow-x: hidden;
  padding: 24px; border-radius: 26px;
  background: linear-gradient(170deg, #3a1468, #1f0839 70%);
  border: 1px solid var(--line);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .6), inset 0 1px 0 rgba(255, 240, 200, .14);
  animation: pop .25s cubic-bezier(.2, .9, .3, 1.2);
}
.sheet-grip { display: none; }
.sheet h2 { margin: 0 0 4px; font-family: var(--display); font-style: italic; font-weight: 800; font-size: 30px; }
.sheet .sub { margin: 0 0 18px; color: var(--muted); font-size: 14px; }
.sheet-art { width: 84px; float: right; margin: -8px -4px 0 10px; filter: drop-shadow(0 10px 16px rgba(0, 0, 0, .5)); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(18px) scale(.97); } }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 12px; clear: both; }
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 12.5px; color: var(--muted); font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%; min-height: 46px; padding: 11px 14px; border-radius: 13px;
  background: rgba(14, 4, 28, .65); border: 1px solid var(--line-soft); outline: none;
}
.field textarea { min-height: 80px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--gold-3); box-shadow: 0 0 0 3px rgba(248, 212, 106, .14); }
.field .err { color: var(--late); font-size: 12px; min-height: 0; }
.field input[aria-invalid="true"] { border-color: var(--late); }
.seg { display: flex; padding: 4px; border-radius: 13px; background: rgba(14, 4, 28, .65); border: 1px solid var(--line-soft); gap: 4px; }
.seg label { flex: 1; text-align: center; cursor: pointer; position: relative; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span { display: block; padding: 9px 4px; border-radius: 10px; font-size: 13px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.seg input:checked + span { background: var(--gold); color: #2a1300; }
.seg input:focus-visible + span { outline: 2px solid var(--gold-2); }
.sheet-actions { display: flex; gap: 10px; margin-top: 20px; justify-content: flex-end; flex-wrap: wrap; }
.notice { padding: 12px 14px; border-radius: 13px; background: rgba(248, 212, 106, .1); border: 1px solid rgba(248, 212, 106, .25); color: var(--gold-1); font-size: 13.5px; margin-top: 12px; }
.notice.warn { background: rgba(255, 107, 138, .1); border-color: rgba(255, 107, 138, .3); color: #ffd0da; }
.preview { display: grid; grid-template-columns: 1fr auto; gap: 6px 14px; margin-top: 14px; padding: 14px; border-radius: 14px; background: rgba(14, 4, 28, .5); font-size: 14px; }
.preview b { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- toast ---------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  display: flex; align-items: center; gap: 14px;
  padding: 12px 14px 12px 18px; border-radius: 999px;
  background: #2c0f50; border: 1px solid var(--line); box-shadow: var(--shadow);
  font-size: 14px; font-weight: 600; transition: transform .25s, opacity .25s;
  max-width: calc(100vw - 32px);
}
.toast.show { transform: translate(-50%, 0); opacity: 1; pointer-events: auto; }
.toast button { background: none; border: 0; color: var(--gold-2); font-weight: 700; cursor: pointer; padding: 4px 6px; }

/* ---------- responsive ---------- */
@media (max-width: 980px) {
  .cols, .report-grid, .set-grid { grid-template-columns: 1fr; }
}
@media (max-width: 820px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail {
    position: fixed; z-index: 40; left: 0; right: 0; bottom: 0; top: auto; height: auto;
    flex-direction: row; padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line); gap: 0;
  }
  .rail .brand, .rail-note, .install-btn { display: none; }
  .nav { flex-direction: row; flex: 1; justify-content: space-around; gap: 2px; }
  .nav a { flex: 1; flex-direction: column; gap: 4px; padding: 8px 2px; font-size: 10.5px; border-radius: 12px; text-align: center; }
  .main { padding: 18px 16px 110px; }
  .topbar { display: flex !important; }
  .hero { padding: 22px 20px; grid-template-columns: minmax(0, 1fr) 96px; border-radius: 22px; }
  .hero-art { width: 96px; }
  .toast { bottom: calc(92px + env(safe-area-inset-bottom)); }
  .sheet-wrap { place-items: end center; padding: 0; }
  .sheet { width: 100%; border-radius: 26px 26px 0 0; max-height: 92vh; padding: 14px 18px calc(22px + env(safe-area-inset-bottom)); animation: up .3s cubic-bezier(.2, .9, .3, 1); }
  .sheet-grip { display: block; width: 44px; height: 5px; border-radius: 9px; background: rgba(255, 255, 255, .25); margin: 0 auto 14px; }
  @keyframes up { from { transform: translateY(100%); } }
}
@media (max-width: 520px) {
  .form { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .stat { flex-direction: column; align-items: flex-start; gap: 6px; padding: 14px; }
  .stat img { width: 44px; height: 44px; }
  .stat .v { font-size: 19px; }
  .stats > .stat:first-child { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 14px; }
  .stats > .stat:first-child img { width: 54px; height: 54px; }
  .chips { flex: 1 1 100%; min-width: 0; flex-wrap: nowrap; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
  .chips::-webkit-scrollbar { display: none; }
  .chip { flex: none; }
  .row { gap: 10px; }
  .row-actions .btn-sm { padding: 0 10px; }
  .grid { grid-template-columns: 1fr; }
  .who { flex-direction: column; align-items: flex-start; gap: 12px; }
  .bars { gap: 5px; }
  .bar .lbl { font-size: 9.5px; }
}
.topbar { display: none; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.topbar .brand img { width: 38px; height: 38px; border-radius: 12px; }
.topbar .brand span { font-size: 22px; }

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