:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", sans-serif;
  --bg: #090b10;
  --panel: #12151c;
  --panel-2: #171b24;
  --line: #252b36;
  --text: #f5f7fb;
  --muted: #8e97a7;
  --accent: #6d7cff;
  --ok: #34c759;
  --warn: #ff9f0a;
  --bad: #ff453a;
  --blocked: #bf5af2;
  --radius: 22px;
}
* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { min-height: 100dvh; }
button, input, select { font: inherit; }
button { border: 0; }
.shell { max-width: 780px; margin: 0 auto; min-height: 100dvh; padding: max(20px, env(safe-area-inset-top)) 16px calc(92px + env(safe-area-inset-bottom)); }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 20px; }
.brand { display:flex; align-items:center; gap:12px; }
.logo { width: 42px; height: 42px; border-radius: 13px; background: linear-gradient(135deg,#7381ff,#8d56ff); display:grid; place-items:center; font-weight:800; }
h1 { font-size: 26px; margin: 0; letter-spacing: -.03em; }
h2 { font-size: 20px; margin: 0 0 12px; }
h3 { font-size: 15px; margin: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 14px; box-shadow: 0 14px 40px rgba(0,0,0,.18); }
.card.tappable { cursor: pointer; transition: transform .12s ease, border-color .12s ease; }
.card.tappable:active { transform: scale(.99); }
.row { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.stack { display:grid; gap:12px; }
.grid2 { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.btn { min-height: 46px; border-radius: 14px; padding: 0 16px; background: var(--panel-2); color: var(--text); font-weight: 700; cursor:pointer; }
.btn.primary { background: var(--accent); }
.btn.danger { background: rgba(255,69,58,.12); color: #ff7b73; }
.btn.full { width:100%; }
.btn:disabled { opacity:.45; cursor:not-allowed; }
.iconbtn { width:44px; height:44px; border-radius:14px; background:var(--panel-2); color:var(--text); }
.badge { display:inline-flex; align-items:center; gap:7px; padding:7px 10px; border-radius:999px; font-size:12px; background:#171b24; color:var(--muted); }
.dot { width:8px; height:8px; border-radius:50%; background:var(--muted); }
.dot.ok { background:var(--ok); }
.dot.warn { background:var(--warn); }
.dot.bad { background:var(--bad); }
.switch { position:relative; width:50px; height:30px; background:#2b313d; border-radius:999px; cursor:pointer; flex:0 0 auto; }
.switch input { opacity:0; width:0; height:0; position:absolute; }
.switch span { position:absolute; top:3px; left:3px; width:24px; height:24px; background:white; border-radius:50%; transition:.18s; }
.switch input:checked + span { transform:translateX(20px); }
.switch:has(input:checked) { background:var(--accent); }
.field { display:grid; gap:7px; }
label { font-size:13px; color:var(--muted); }
input, select { width:100%; min-height:48px; border-radius:14px; border:1px solid var(--line); background:#0f1218; color:var(--text); padding:0 13px; outline:none; }
input:focus, select:focus { border-color:var(--accent); }
.section-title { margin:22px 4px 10px; color:var(--muted); font-size:12px; text-transform:uppercase; letter-spacing:.09em; font-weight:800; }
.surface { display:grid; gap:8px; }
.history { display:flex; gap:3px; height:28px; align-items:stretch; overflow:hidden; }
.bar { flex:1 1 0; min-width:3px; border-radius:3px; background:#252b36; }
.bar.SUCCEEDED { background:var(--ok); }
.bar.FAILED { background:var(--bad); }
.bar.BLOCKED { background:var(--blocked); }
.bar.RUNNING { background:var(--warn); }
.stats { display:grid; grid-template-columns:repeat(3,1fr); gap:8px; margin-top:10px; }
.stat { background:#0f1218; border-radius:14px; padding:10px; }
.stat b { display:block; font-size:18px; }
.pair-head { display:flex; justify-content:space-between; gap:14px; align-items:flex-start; }
.pair-name { font-size:18px; font-weight:800; }
.provider-line { font-size:13px; color:var(--muted); margin-top:4px; }
.nav { position:fixed; left:50%; transform:translateX(-50%); bottom:0; width:min(780px,100%); padding:10px 16px calc(10px + env(safe-area-inset-bottom)); background:rgba(9,11,16,.9); backdrop-filter:blur(20px); border-top:1px solid rgba(255,255,255,.06); display:grid; grid-template-columns:repeat(3,1fr); gap:8px; z-index:20; }
.nav button { background:transparent; color:var(--muted); min-height:48px; border-radius:14px; font-weight:700; }
.nav button.active { color:var(--text); background:var(--panel-2); }
.modal { position:fixed; inset:0; z-index:50; background:rgba(0,0,0,.62); display:grid; align-items:end; }
.sheet { max-height:92dvh; overflow:auto; background:#10131a; border-radius:28px 28px 0 0; border:1px solid var(--line); padding:18px 16px calc(22px + env(safe-area-inset-bottom)); }
.sheet-inner { max-width:720px; margin:0 auto; }
.progress { display:grid; grid-template-columns:repeat(4,1fr); gap:6px; margin:10px 0 20px; }
.progress span { height:5px; border-radius:99px; background:#252b36; }
.progress span.on { background:var(--accent); }
.code { font-size:34px; letter-spacing:.12em; font-weight:900; text-align:center; padding:18px; background:#0c0f14; border-radius:18px; }
.login { min-height:100dvh; display:grid; place-items:center; padding:24px; }
.login-card { width:min(420px,100%); background:var(--panel); border:1px solid var(--line); border-radius:28px; padding:22px; }
.toast { position:fixed; top:max(18px,env(safe-area-inset-top)); left:50%; transform:translateX(-50%); z-index:100; padding:12px 16px; border-radius:14px; background:#1d2430; border:1px solid var(--line); box-shadow:0 10px 30px rgba(0,0,0,.3); }
.error { color:#ff8a83; font-size:13px; }
hr { border:0; border-top:1px solid var(--line); margin:14px 0; }
@media (min-width:700px) {
  .sheet { width:min(760px,calc(100% - 32px)); margin:0 auto 20px; border-radius:28px; align-self:center; }
  .modal { align-items:center; }
}
