:root {
  --bg: #0d1230; --side: #101639; --surface: #161d47; --surface-2: #1e2653; --line: rgba(159,170,230,.16);
  --text: #eef1ff; --muted: #aab3dd; --cyan: #22d3ee; --indigo: #6366f1; --ok: #34d399; --warn: #fbbf24; --bad: #f87171;
  --grad: linear-gradient(120deg, var(--cyan), var(--indigo));
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: var(--cyan); }
h1 { font-size: 1.6rem; margin: 0 0 4px; letter-spacing: -.01em; }
h2 { font-size: 1.1rem; margin: 0 0 14px; }
p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--cyan); outline-offset: 2px; }

.shell { display: grid; grid-template-columns: 250px 1fr; min-height: 100%; }
.side { background: var(--side); border-right: 1px solid var(--line); padding: 20px 14px; display: flex; flex-direction: column; gap: 22px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.1rem; padding: 0 8px; }
.brand img { width: 30px; height: auto; }
.nav { display: flex; flex-direction: column; gap: 4px; flex: 1; }
.nav a { display: block; padding: 10px 12px; border-radius: 10px; color: var(--muted); text-decoration: none; border-left: 3px solid transparent; }
.nav a:hover { background: var(--surface); color: var(--text); }
.nav a.on { background: var(--surface-2); color: var(--text); border-left-color: var(--cyan); }
.who { padding: 12px; border-top: 1px solid var(--line); font-size: .9rem; color: var(--muted); }
.who strong { display: block; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.who button { margin-top: 8px; }
.main { padding: 32px; min-width: 0; }
.inner { max-width: 980px; margin-inline: auto; display: flex; flex-direction: column; gap: 20px; }
.topbar { display: none; }
.sub { color: var(--muted); }

.card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 22px; min-width: 0; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); }
.stat span { display: block; color: var(--muted); font-size: .88rem; }
.stat span.badge { display: inline-block; font-size: .9rem; margin-top: 4px; color: var(--ok); }
.stat span.badge.bad { color: var(--bad); }
.inner > div:empty { display: none; }
.stat b { font-size: 1.2rem; }
.btn { display: inline-block; padding: 7px 14px; border: 0; border-radius: 8px; background: var(--grad); color: #071027; font-size: .92rem; font-weight: 600; line-height: 1.35; cursor: pointer; text-decoration: none; text-align: center; }
.btn.alt { background: var(--surface-2); color: var(--text); border: 1px solid var(--line); font-weight: 600; }
.btn.small { padding: 5px 10px; font-size: .85rem; }
.btn.danger { background: transparent; color: var(--bad); border: 1px solid rgba(248,113,113,.4); font-weight: 600; }
.btn:disabled { opacity: .55; cursor: default; }
.row { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.between { justify-content: space-between; }
.badge { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .84rem; background: var(--surface-2); color: var(--muted); }
.badge.ok { color: var(--ok); } .badge.warn { color: var(--warn); } .badge.bad { color: var(--bad); }
.link { display: grid; grid-template-columns: 1fr 180px; gap: 22px; align-items: start; }
.code { display: block; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; font: .86rem ui-monospace, monospace; word-break: break-all; margin: 10px 0 12px; }
.qr { width: 180px; height: 180px; border-radius: 10px; background: #fff; }
.list { display: flex; flex-direction: column; }
.item { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; padding-top: 0; }
.item.click { cursor: pointer; text-decoration: none; color: inherit; }
.muted { color: var(--muted); font-size: .9rem; }
.plan { display: flex; flex-direction: column; gap: 6px; }
.price { font-size: 1.8rem; font-weight: 800; }
.plan .btn { align-self: flex-start; margin-top: 12px; }
label { display: block; color: var(--muted); font-size: .9rem; margin-bottom: 12px; }
input, textarea, select { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
textarea { min-height: 120px; resize: vertical; }
.tabs { display: flex; flex-wrap: wrap; gap: 8px; }
.tab { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); cursor: pointer; }
.tab img { width: 20px; height: 20px; object-fit: contain; }
.tab.on { border-color: var(--cyan); color: var(--text); background: var(--surface-2); }
.step { display: grid; grid-template-columns: 34px 1fr; gap: 14px; padding: 16px 0; border-top: 1px solid var(--line); }
.step:first-child { border-top: 0; padding-top: 0; }
.num { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 50%; background: var(--grad); color: #071027; font-weight: 800; }
.step h3 { margin: 4px 0; font-size: 1rem; }
.step .row { margin-top: 10px; }
.msg { padding: 10px 14px; border-radius: 12px; background: var(--surface-2); max-width: 85%; white-space: pre-wrap; overflow-wrap: anywhere; }
.msg.mine { align-self: flex-end; background: rgba(99,102,241,.3); }
.thread { display: flex; flex-direction: column; gap: 10px; }
.notice { padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--muted); }
.notice.err { color: var(--bad); }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); padding: 10px 18px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--line); z-index: 30; }
.center { min-height: 100vh; display: grid; place-items: center; padding: 16px; }
.auth { width: min(440px, 100%); text-align: center; display: flex; flex-direction: column; gap: 16px; align-items: center; }
.auth img.logo { width: 72px; height: auto; }
.pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.scrim { display: none; }
.card > * + .btn, .card > * + .row, .card > * + form, .card > * + .notice, .card > .notice + *, .card > p + p { margin-top: 14px; }
form .btn, form .row { margin-top: 4px; }
.item .btn { margin-top: 0; }

@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .side { position: fixed; z-index: 20; inset: 0 auto 0 0; width: 260px; transform: translateX(-100%); transition: transform .18s ease; }
  .open .side { transform: none; }
  .open .scrim { display: block; position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 15; }
  .topbar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); background: var(--side); position: sticky; top: 0; z-index: 10; }
  .topbar button { background: none; border: 1px solid var(--line); border-radius: 8px; padding: 4px 10px; font-size: 1.1rem; cursor: pointer; }
  .main { padding: 18px 16px; }
  .link { grid-template-columns: 1fr; }
  .qr { justify-self: center; }
}
@media (prefers-reduced-motion: reduce) { .side { transition: none; } }
