/* NEXUS design system v3 — dark (default) and light themes, mobile first. */
:root {
  color-scheme: dark;
  --bg: #070b14;
  --bg-2: #0b1220;
  --surface: #111a2c;
  --surface-2: #17223a;
  --surface-3: #1f2c49;
  --border: #22304e;
  --border-2: #2c3d63;
  --text: #e8edf7;
  --text-2: #b4bfd6;
  --muted: #7d8aa6;
  --accent: #4f8cff;
  --accent-2: #7c5cff;
  --accent-soft: rgba(79, 140, 255, .14);
  --up: #1fd17b;
  --up-soft: rgba(31, 209, 123, .13);
  --down: #ff5a6a;
  --down-soft: rgba(255, 90, 106, .13);
  --warn: #ffb547;
  --warn-soft: rgba(255, 181, 71, .14);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 16px;
  --radius-sm: 11px;
  --tab-h: 64px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-family: var(--font);
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f3f5fa;
  --bg-2: #ffffff;
  --surface: #ffffff;
  --surface-2: #f1f4fa;
  --surface-3: #e6ebf5;
  --border: #e1e6f0;
  --border-2: #d2d9e7;
  --text: #0e1626;
  --text-2: #36425c;
  --muted: #6b7690;
  --accent: #2f6df6;
  --accent-soft: rgba(47, 109, 246, .1);
  --up: #0fa968;
  --up-soft: rgba(15, 169, 104, .1);
  --down: #e5384a;
  --down-soft: rgba(229, 56, 74, .09);
  --warn: #d98a06;
  --warn-soft: rgba(217, 138, 6, .1);
  --shadow: 0 8px 24px rgba(16, 24, 40, .08);
}

* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); }
html.no-scroll { overflow: hidden; }
body { min-height: 100dvh; -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; font-size: 15px; line-height: 1.45; }
button { font: inherit; color: inherit; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
.up { color: var(--up); }
.down { color: var(--down); }
.warn { color: var(--warn); }
.num { font-variant-numeric: tabular-nums; }
.mt0 { margin-top: 0 !important; }
.mt8 { margin-top: 8px; }
.mt12 { margin-top: 12px; }
.mt16 { margin-top: 16px; }
.center { text-align: center; }
.full { width: 100%; }

/* ---------- app frame ---------- */
.topbar {
  position: sticky; top: 0; z-index: 10; display: grid; grid-template-columns: 44px 1fr auto; align-items: center; gap: 6px;
  padding: calc(env(safe-area-inset-top) + 10px) 12px 10px; background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px); border-bottom: 1px solid var(--border);
}
.topbar h1 { font-size: 18px; font-weight: 700; margin: 0; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .brand { display: flex; align-items: center; gap: 8px; }
.topbar .brand img { border-radius: 8px; }
.top-actions { display: flex; align-items: center; gap: 6px; }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; cursor: pointer;
  background: transparent; border: 0; color: var(--text-2);
}
.icon-btn:active { background: var(--surface-2); transform: scale(.95); }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
.live { width: 8px; height: 8px; border-radius: 50%; background: var(--muted); margin: 0 6px; }
.live.ok { background: var(--up); box-shadow: 0 0 0 4px var(--up-soft); }
.live.bad { background: var(--down); box-shadow: 0 0 0 4px var(--down-soft); }

main { padding: 14px 16px calc(var(--tab-h) + env(safe-area-inset-bottom) + 24px); max-width: 820px; margin: 0 auto; outline: none; }
.page-enter { animation: fade .18s ease-out; }
@keyframes fade { from { opacity: .3; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: grid; grid-template-columns: repeat(5, 1fr);
  height: calc(var(--tab-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg-2) 92%, transparent); backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px); border-top: 1px solid var(--border);
}
.tabbar button { background: none; border: 0; color: var(--muted); display: grid; place-items: center; align-content: center; gap: 3px; font-size: 10.5px; font-weight: 600; cursor: pointer; }
.tabbar button.on { color: var(--accent); }
.tabbar button.on svg { filter: drop-shadow(0 0 6px var(--accent-soft)); }

/* ---------- typography / sections ---------- */
.sec-title { display: flex; justify-content: space-between; align-items: center; margin: 22px 2px 10px; }
.sec-title > span { font-size: 13px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; color: var(--muted); }
.sec-title a, .link { color: var(--accent); font-size: 14px; font-weight: 600; text-decoration: none; background: none; border: 0; cursor: pointer; padding: 0; }
.page-head { margin: 4px 2px 14px; }
.page-head h2 { font-size: 26px; margin: 0; letter-spacing: -.4px; }
.page-head p { margin: 4px 0 0; color: var(--muted); }
.note { font-size: 13px; color: var(--muted); margin: 10px 2px 0; }
.hint { font-size: 13.5px; color: var(--text-2); line-height: 1.5; background: var(--surface-2); border-radius: var(--radius-sm); padding: 11px 13px; }
.error { color: var(--down); min-height: 1.2em; font-size: 14px; }

/* ---------- cards ---------- */
.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px; }
.card.flush { padding: 4px 16px; }
.card.hero-card {
  background: radial-gradient(120% 140% at 0% 0%, color-mix(in srgb, var(--accent) 20%, var(--surface)) 0%, var(--surface) 55%);
  border-color: var(--border-2);
}
.card.tap { cursor: pointer; transition: transform .1s ease, border-color .15s; }
.card.tap:active { transform: scale(.985); border-color: var(--border-2); }
.stack { display: grid; gap: 10px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.kpis { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.kpis.k3 { grid-template-columns: repeat(3, 1fr); }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 13px 14px; min-width: 0; }
.kpi-l { font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-v { font-size: 22px; font-weight: 750; margin-top: 3px; font-variant-numeric: tabular-nums; letter-spacing: -.3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi-s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpis.k3 .kpi-v { font-size: 18px; }

.kv { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; min-width: 0; overflow-wrap: anywhere; }

.badge { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; font-weight: 750; letter-spacing: .3px; padding: 3px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.up { background: var(--up-soft); color: var(--up); }
.badge.down { background: var(--down-soft); color: var(--down); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--accent-soft); color: var(--accent); }
.pill { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 13.5px; padding: 5px 9px; border-radius: 8px; min-width: 76px; text-align: center; }
.pill.up { background: var(--up-soft); color: var(--up); }
.pill.down { background: var(--down-soft); color: var(--down); }

/* ---------- hero (dashboard) ---------- */
.hero-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.hero-label { font-size: 13px; color: var(--muted); font-weight: 600; }
.hero-value { font-size: 34px; font-weight: 800; letter-spacing: -.8px; font-variant-numeric: tabular-nums; margin-top: 2px; }
.hero-sub { font-size: 13.5px; color: var(--text-2); margin-top: 2px; }
.status-strip { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 12px; }
.status-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--border); border-radius: 999px; padding: 5px 10px; cursor: pointer; }
.status-chip i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.status-chip i.ok { background: var(--up); }
.status-chip i.bad { background: var(--down); }
.status-chip i.mid { background: var(--warn); }

/* ---------- segmented / chips ---------- */
.seg { display: grid; grid-auto-columns: 1fr; grid-auto-flow: column; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; padding: 3px; gap: 2px; }
.seg button { border: 0; border-radius: 9px; padding: 8px 6px; background: none; color: var(--muted); font-weight: 650; font-size: 13.5px; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0, 0, 0, .25); }
:root[data-theme="light"] .seg button.on { box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
.seg.small button { padding: 6px 4px; font-size: 12.5px; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 4px; scrollbar-width: none; margin: 0 -16px; padding-left: 16px; padding-right: 16px; }
.chips::-webkit-scrollbar { display: none; }
.chip { white-space: nowrap; padding: 7px 13px; border-radius: 999px; background: var(--surface); border: 1px solid var(--border); color: var(--text-2); font-size: 13.5px; font-weight: 650; cursor: pointer; }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin: 12px 2px 10px; }
.toolbar .summary { font-size: 13px; color: var(--muted); }

/* ---------- lists ---------- */
.list { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.li { display: flex; align-items: center; gap: 12px; padding: 13px 14px; border-bottom: 1px solid var(--border); cursor: pointer; background: none; border-left: 0; border-right: 0; border-top: 0; width: 100%; text-align: left; color: var(--text); }
.li:last-child { border-bottom: 0; }
.li:active { background: var(--surface-2); }
.li .ico { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); flex: none; }
.li .body { flex: 1; min-width: 0; }
.li .t { font-weight: 650; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .s { font-size: 12.5px; color: var(--muted); margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.li .end { text-align: right; flex: none; display: flex; align-items: center; gap: 8px; color: var(--muted); }
.li .end .p { font-weight: 650; font-variant-numeric: tabular-nums; color: var(--text); }
.coin-av { width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 800; color: #fff; flex: none; letter-spacing: -.3px; }

/* ---------- signal cards ---------- */
.sig { display: grid; gap: 10px; }
.sig-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sig-sym { display: flex; align-items: center; gap: 10px; min-width: 0; }
.sig-sym .name { font-size: 16.5px; font-weight: 750; }
.sig-sym .sub { font-size: 12px; color: var(--muted); }
.sig-meta { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.sig-move { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.track { position: relative; height: 34px; margin: 2px 4px 0; }
.track .line { position: absolute; left: 0; right: 0; top: 11px; height: 4px; border-radius: 4px; background: linear-gradient(90deg, var(--down) 0%, var(--down-soft) 28%, var(--surface-3) 40%, var(--up-soft) 62%, var(--up) 100%); }
.track .tick { position: absolute; top: 7px; width: 2px; height: 12px; background: var(--border-2); border-radius: 2px; }
.track .tick-l { position: absolute; top: 21px; transform: translateX(-50%); font-size: 10.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.track .marker { position: absolute; top: 4px; width: 18px; height: 18px; margin-left: -9px; border-radius: 50%; background: var(--text); border: 3px solid var(--surface); box-shadow: 0 0 0 2px var(--accent); }
.levels { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.levels div { background: var(--surface-2); border-radius: 9px; padding: 7px 4px; text-align: center; min-width: 0; }
.levels .lk { font-size: 10.5px; color: var(--muted); font-weight: 700; letter-spacing: .4px; }
.levels .lv { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sig-foot { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); }

/* ---------- forms ---------- */
label.field { display: grid; gap: 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
input, select, textarea {
  font: inherit; font-size: 16px; color: var(--text); background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-sm); padding: 12px 14px; width: 100%; outline: none;
}
input:focus, select:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input[type=range] { padding: 0; border: 0; background: transparent; accent-color: var(--accent); height: 32px; box-shadow: none; }
.search { position: relative; }
.search svg { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.search input { padding-left: 42px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid var(--border-2); border-radius: 12px;
  padding: 12px 16px; background: var(--surface-2); color: var(--text); font-weight: 700; font-size: 15px; cursor: pointer;
}
.btn.primary { background: linear-gradient(135deg, var(--accent), var(--accent-2)); border-color: transparent; color: #fff; box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 35%, transparent); }
.btn.danger { color: var(--down); border-color: color-mix(in srgb, var(--down) 40%, transparent); background: var(--down-soft); }
.btn.ghost { background: transparent; }
.btn:disabled { opacity: .5; cursor: default; }
.btn:active:not(:disabled) { transform: scale(.98); }
.btn-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.btn-row.three { grid-template-columns: repeat(3, 1fr); }
.mini { font-size: 13px; font-weight: 700; padding: 7px 11px; border-radius: 9px; border: 1px solid var(--border-2); background: var(--surface-2); color: var(--text); cursor: pointer; }
.mini.danger { color: var(--down); border-color: color-mix(in srgb, var(--down) 35%, transparent); }
.switch { position: relative; width: 52px; height: 32px; flex: none; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 999px; background: var(--surface-3); border: 1px solid var(--border-2); transition: .2s; }
.switch span::after { content: ""; position: absolute; left: 3px; top: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: .2s; }
.switch input:checked + span { background: var(--up); border-color: var(--up); }
.switch input:checked + span::after { transform: translateX(20px); }
.switch input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.setting { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 13px 0; border-bottom: 1px solid var(--border); }
.setting:last-child { border-bottom: 0; }
.setting .t { font-weight: 600; }
.setting .d { font-size: 12.5px; color: var(--muted); margin-top: 2px; }
.range-head { display: flex; justify-content: space-between; font-size: 14px; color: var(--muted); margin-top: 12px; }
.range-head strong { color: var(--text); font-size: 16px; }

/* ---------- charts ---------- */
.chart { position: relative; width: 100%; touch-action: pan-y; }
.chart-svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-empty { padding: 34px 0; text-align: center; color: var(--muted); font-size: 13.5px; }
.chart-grid { stroke: var(--border); stroke-width: 1; stroke-dasharray: 3 5; vector-effect: non-scaling-stroke; }
.chart-zero { stroke: var(--border-2); stroke-width: 1; vector-effect: non-scaling-stroke; }
.chart-line { fill: none; stroke-width: 2.4; vector-effect: non-scaling-stroke; stroke-linejoin: round; }
.is-up .chart-line { stroke: var(--up); } .is-down .chart-line { stroke: var(--down); }
.is-up .grad-a { stop-color: var(--up); stop-opacity: .32; } .is-down .grad-a { stop-color: var(--down); stop-opacity: .3; }
.grad-b { stop-color: var(--bg); stop-opacity: 0; }
.chart-dot { stroke: var(--surface); stroke-width: 2.5; vector-effect: non-scaling-stroke; }
.is-up .chart-dot { fill: var(--up); } .is-down .chart-dot { fill: var(--down); }
.chart-cross { stroke: var(--text-2); stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; }
.chart-last { stroke: var(--accent); stroke-width: 1; stroke-dasharray: 4 4; vector-effect: non-scaling-stroke; }
.chart-label { fill: var(--muted); font-size: 19px; font-weight: 600; }
.bar-up { fill: var(--up); } .bar-down { fill: var(--down); } .bar-n { fill: var(--accent); }
.candle-up { fill: var(--up); stroke: var(--up); } .candle-down { fill: var(--down); stroke: var(--down); }
.wick { stroke-width: 1.2; vector-effect: non-scaling-stroke; }
.chart-tip { position: absolute; top: -6px; transform: translateY(-100%); background: var(--surface-3); color: var(--text); border: 1px solid var(--border-2); border-radius: 9px; padding: 6px 9px; font-size: 12.5px; font-weight: 650; white-space: nowrap; pointer-events: none; box-shadow: var(--shadow); font-variant-numeric: tabular-nums; z-index: 2; }
.spark { width: 64px; height: 24px; }
.spark path { fill: none; stroke-width: 1.8; }
.spark-up { stroke: var(--up); } .spark-down { stroke: var(--down); }
.stack-track { display: flex; height: 10px; border-radius: 999px; overflow: hidden; background: var(--surface-3); }
.stack-seg { height: 100%; }
.stack-seg.up, .dot-up { background: var(--up); } .stack-seg.down, .dot-down { background: var(--down); }
.stack-seg.warn, .dot-warn { background: var(--warn); } .stack-seg.n, .dot-n { background: var(--muted); }
.stack-legend { display: flex; flex-wrap: wrap; gap: 6px 14px; margin-top: 10px; font-size: 12.5px; color: var(--text-2); }
.stack-legend i { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; }
.table { width: 100%; border-collapse: collapse; font-size: 13.5px; font-variant-numeric: tabular-nums; }
.table th { text-align: right; color: var(--muted); font-weight: 650; font-size: 12px; padding: 8px 4px; border-bottom: 1px solid var(--border); }
.table th:first-child, .table td:first-child { text-align: left; }
.table td { text-align: right; padding: 10px 4px; border-bottom: 1px solid var(--border); }
.table tr:last-child td { border-bottom: 0; }
.gauge { height: 8px; border-radius: 999px; background: var(--down-soft); overflow: hidden; }
.gauge > span { display: block; height: 100%; background: var(--up); border-radius: 999px; }

/* ---------- text output ---------- */
.result { white-space: pre-wrap; overflow-wrap: anywhere; font-size: 14.5px; line-height: 1.55; color: var(--text); }
.msg { white-space: pre-wrap; overflow-wrap: anywhere; background: var(--surface-2); border-radius: var(--radius-sm); padding: 12px 13px; font-size: 14px; line-height: 1.5; }

/* ---------- states ---------- */
.loading { padding: 34px 0; text-align: center; color: var(--muted); font-size: 13.5px; }
.spinner { width: 26px; height: 26px; border: 3px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto 10px; }
@keyframes spin { to { transform: rotate(360deg); } }
.skel { height: 92px; border-radius: var(--radius); background: linear-gradient(90deg, var(--surface) 0%, var(--surface-2) 50%, var(--surface) 100%); background-size: 200% 100%; animation: shimmer 1.2s infinite; border: 1px solid var(--border); }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
.empty { text-align: center; color: var(--muted); padding: 32px 16px; background: var(--surface); border: 1px dashed var(--border-2); border-radius: var(--radius); }
.empty p { margin: 0 0 4px; }

/* ---------- login / onboarding ---------- */
.login { min-height: 100dvh; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: max(28px, env(safe-area-inset-top)) 24px max(28px, env(safe-area-inset-bottom));
  background: radial-gradient(90% 60% at 50% 0%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 70%), var(--bg); }
.login-logo { border-radius: 20px; box-shadow: 0 12px 40px color-mix(in srgb, var(--accent) 35%, transparent); }
.login h1 { margin: 16px 0 0; letter-spacing: 6px; font-size: 28px; }
.login .tag { margin: 4px 0 30px; color: var(--muted); }
.login form { width: 100%; max-width: 380px; display: grid; gap: 14px; }
.login .foot { margin-top: 26px; font-size: 12px; color: var(--muted); text-align: center; max-width: 380px; }
.legal-text { font-size: 14px; line-height: 1.6; color: var(--text-2); }
.legal-text h3 { color: var(--text); font-size: 15.5px; margin: 18px 0 6px; }
.legal-text ul { padding-left: 18px; margin: 6px 0; }
.check-row { display: flex; gap: 10px; align-items: flex-start; font-size: 14px; color: var(--text); margin: 14px 0; }
.check-row input { width: 22px; height: 22px; flex: none; accent-color: var(--accent); padding: 0; }

/* ---------- sheet / toast ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 14, .6); backdrop-filter: blur(2px); animation: fade .15s; }
.sheet-panel { position: absolute; left: 0; right: 0; bottom: 0; max-height: 90dvh; display: flex; flex-direction: column; background: var(--bg-2); border-top-left-radius: 22px; border-top-right-radius: 22px; border: 1px solid var(--border); padding-bottom: env(safe-area-inset-bottom); animation: up .22s cubic-bezier(.2, .9, .3, 1); max-width: 820px; margin: 0 auto; box-shadow: var(--shadow); }
.sheet-panel::before { content: ""; width: 38px; height: 5px; border-radius: 3px; background: var(--border-2); margin: 8px auto 0; }
@keyframes up { from { transform: translateY(60px); opacity: .3; } to { transform: none; opacity: 1; } }
.sheet-head { display: flex; justify-content: space-between; align-items: center; padding: 8px 12px 6px 18px; }
.sheet-head h2 { margin: 0; font-size: 19px; }
.sheet-body { overflow-y: auto; padding: 4px 16px 22px; -webkit-overflow-scrolling: touch; }
.toast { position: fixed; left: 50%; bottom: calc(var(--tab-h) + env(safe-area-inset-bottom) + 14px); z-index: 40; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: .22s; max-width: calc(100% - 32px); background: var(--text); color: var(--bg); font-weight: 650; font-size: 14px; padding: 11px 16px; border-radius: 12px; box-shadow: var(--shadow); }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--down); color: #fff; }

@media (min-width: 680px) {
  .kpis { grid-template-columns: repeat(4, 1fr); }
  .kpis.k3 { grid-template-columns: repeat(3, 1fr); }
  .wide-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
}
.major { min-width: 128px; text-align: left; padding: 12px 14px; }
select.w-auto { width: auto; padding: 8px 12px; font-size: 14px; }
button.search { background: none; border: 0; padding: 0; text-align: left; cursor: pointer; }
button.search input { pointer-events: none; }
.li-ico-lg { width: 48px; height: 48px; border-radius: 14px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.link-body { background: none; border: 0; text-align: left; padding: 0; cursor: pointer; color: inherit; }
.onb-card { max-width: 520px; max-height: 62dvh; overflow-y: auto; text-align: left; }
.t { font-weight: 650; }
.onb-card { max-height: 46dvh; }
.onb-actions { width: 100%; max-width: 520px; margin-top: 14px; }
.warn-hint { background: var(--warn-soft); color: var(--warn); font-weight: 600; }

/* ---------- accounts, plans, admin */
.login form#register-form { gap: 12px; }
.switch-line { margin: 4px 0 0; text-align: center; font-size: 14px; color: var(--muted); }
.full-w { width: 100%; text-align: left; color: inherit; font: inherit; }
.grow { flex: 1; min-width: 0; }
.sig-sym .sub, .sig-sym .d { overflow: hidden; text-overflow: ellipsis; }
.d { font-size: 13px; color: var(--muted); margin-top: 2px; line-height: 1.45; }
.upsell { border-color: var(--accent-soft); }
.lock-hint { display: flex; gap: 10px; align-items: flex-start; width: 100%; text-align: left; border: 0; cursor: pointer; font: inherit; font-size: 13.5px; }
.lock-hint svg { flex: none; margin-top: 2px; }
.plan-card .name { font-size: 18px; font-weight: 750; }
.plan-card .sub { font-size: 12.5px; color: var(--accent); font-weight: 650; }
.plan-card.featured { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent-soft); }
.plan-card.current { background: var(--surface-2); }
.plan-price { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.plan-price .muted { font-size: 14px; font-weight: 600; }
.plan-list { list-style: none; margin: 12px 0 0; padding: 0; display: grid; gap: 8px; font-size: 14px; color: var(--text-2); }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list svg { color: var(--up); flex: none; margin-top: 2px; }
.code-box { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 22px; font-weight: 700; letter-spacing: 1.5px; text-align: center; user-select: all; word-break: break-all; }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .5px; }
