/* FreeCrypto Biz design system */
:root {
  --bg: #0a0e17;
  --bg-2: #0f1522;
  --panel: #121a2a;
  --panel-2: #172135;
  --line: #22304a;
  --line-2: #2c3d5c;
  --text: #e6edf7;
  --text-2: #9aabc6;
  --text-3: #6b7d9c;
  --brand: #17e6a1;
  --brand-2: #0fbf85;
  --brand-ink: #032a1d;
  --violet: #8b7bff;
  --up: #1fd18a;
  --down: #ff5c7a;
  --warn: #ffb547;
  --info: #5aa8ff;
  --up-bg: rgba(31, 209, 138, .12);
  --down-bg: rgba(255, 92, 122, .12);
  --warn-bg: rgba(255, 181, 71, .12);
  --info-bg: rgba(90, 168, 255, .12);
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --radius: 14px;
  --radius-sm: 9px;
  --font: 'Inter', system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-2: #eef1f8;
  --panel: #ffffff;
  --panel-2: #f6f8fc;
  --line: #e1e6f0;
  --line-2: #cfd7e6;
  --text: #121a2b;
  --text-2: #4f5d78;
  --text-3: #7b88a1;
  --brand: #0fb37c;
  --brand-2: #0a9466;
  --brand-ink: #ffffff;
  --up: #0f9f65;
  --down: #e23c5d;
  --up-bg: rgba(15, 159, 101, .1);
  --down-bg: rgba(226, 60, 93, .1);
  --shadow: 0 8px 24px rgba(20, 30, 60, .08);
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  background: var(--bg);
  color: var(--text);
  font: 14px/1.5 var(--font);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; letter-spacing: -.01em; }
p { margin: 0 0 .8em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.up { color: var(--up); }
.down { color: var(--down); }
.muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12px; }
.tiny { font-size: 11px; }
.bold { font-weight: 600; }
.right { text-align: right; }
.center { text-align: center; }
.nowrap { white-space: nowrap; }
.hidden { display: none !important; }
.row { display: flex; gap: 12px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; gap: 12px; }
.grow { flex: 1; min-width: 0; }
.gap-s { gap: 6px; }
.mt { margin-top: 16px; }
.mb { margin-bottom: 16px; }
.mt-s { margin-top: 8px; }

/* ---------- buttons & inputs ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line-2); background: var(--panel-2); color: var(--text);
  padding: 9px 16px; border-radius: var(--radius-sm); font: 600 13px var(--font);
  cursor: pointer; transition: .15s; white-space: nowrap; text-decoration: none !important;
}
.btn:hover { border-color: var(--text-3); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: var(--brand-ink); border-color: transparent; }
.btn.primary:hover { filter: brightness(1.08); }
.btn.buy { background: var(--up); color: #fff; border-color: transparent; }
.btn.sell { background: var(--down); color: #fff; border-color: transparent; }
.btn.ghost { background: transparent; border-color: transparent; color: var(--text-2); }
.btn.ghost:hover { color: var(--text); background: var(--panel-2); }
.btn.danger { color: var(--down); border-color: rgba(255, 92, 122, .4); background: transparent; }
.btn.sm { padding: 5px 10px; font-size: 12px; border-radius: 7px; }
.btn.lg { padding: 13px 22px; font-size: 15px; border-radius: 12px; }
.btn.block { width: 100%; }
.icon-btn { background: none; border: 0; color: var(--text-2); cursor: pointer; padding: 6px; border-radius: 8px; display: inline-flex; position: relative; }
.icon-btn:hover { color: var(--text); background: var(--panel-2); }

input, select, textarea {
  width: 100%; background: var(--bg-2); border: 1px solid var(--line); color: var(--text);
  border-radius: var(--radius-sm); padding: 9px 12px; font: 14px var(--font); outline: none; transition: .15s;
}
input:focus, select:focus, textarea:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(23, 230, 161, .12); }
textarea { resize: vertical; min-height: 80px; }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.field-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; }
.input-group { position: relative; }
.input-group .suffix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); color: var(--text-3); font-size: 12px; pointer-events: none; }
.input-group input { padding-right: 56px; }
.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-2); cursor: pointer; }
.check input { width: auto; }

.seg { display: inline-flex; background: var(--bg-2); border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { background: none; border: 0; color: var(--text-2); padding: 6px 12px; border-radius: 7px; font: 600 12px var(--font); cursor: pointer; }
.seg button.active { background: var(--panel-2); color: var(--text); box-shadow: 0 1px 0 var(--line-2) inset; }
.seg.buysell button.active.buy { background: var(--up); color: #fff; }
.seg.buysell button.active.sell { background: var(--down); color: #fff; }
.seg.full { display: flex; }
.seg.full button { flex: 1; }

/* ---------- cards ---------- */
.card { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; min-width: 0; }
.card.tight { padding: 12px; }
.card.flush { padding: 0; overflow: hidden; }
.card-h { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-h h3 { margin: 0; font-size: 15px; }
.card.flush .card-h { padding: 14px 16px 0; }
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main, .g3 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 640px) { .g2, .g4 { grid-template-columns: minmax(0, 1fr); } }

.stat .label { color: var(--text-2); font-size: 12px; font-weight: 500; margin-bottom: 6px; display: flex; align-items: center; gap: 6px; }
.stat .value { font: 600 24px var(--mono); letter-spacing: -.02em; }
.stat .sub { font-size: 12px; margin-top: 4px; }

.badge { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font: 600 11px var(--font); letter-spacing: .02em; background: var(--panel-2); color: var(--text-2); border: 1px solid var(--line); white-space: nowrap; }
.badge.up { background: var(--up-bg); color: var(--up); border-color: transparent; }
.badge.down { background: var(--down-bg); color: var(--down); border-color: transparent; }
.badge.warn { background: var(--warn-bg); color: var(--warn); border-color: transparent; }
.badge.info { background: var(--info-bg); color: var(--info); border-color: transparent; }
.badge.brand { background: rgba(23, 230, 161, .12); color: var(--brand); border-color: transparent; }
.badge.violet { background: rgba(139, 123, 255, .14); color: var(--violet); border-color: transparent; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; background: var(--text-3); }
.dot.live { background: var(--up); box-shadow: 0 0 0 0 rgba(31, 209, 138, .6); animation: pulse 2s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 7px rgba(31, 209, 138, 0); } 100% { box-shadow: 0 0 0 0 rgba(31, 209, 138, 0); } }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table.t { width: 100%; border-collapse: collapse; font-size: 13px; }
table.t th { text-align: left; color: var(--text-3); font-weight: 500; font-size: 11px; text-transform: uppercase; letter-spacing: .05em; padding: 8px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; position: sticky; top: 0; background: var(--panel); }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t tr:last-child td { border-bottom: 0; }
table.t tbody tr.click { cursor: pointer; }
table.t tbody tr.click:hover td { background: var(--panel-2); }
table.t th.right, table.t td.right { text-align: right; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
.empty { padding: 36px 16px; text-align: center; color: var(--text-3); }
.empty .icon { font-size: 28px; margin-bottom: 6px; }

.coin { display: inline-flex; align-items: center; gap: 10px; }
.coin-ico { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; font: 700 11px var(--font); color: #fff; flex: none; }
.coin-ico.sm { width: 22px; height: 22px; font-size: 9px; }
.coin .sym { font-weight: 600; }
.coin .pair { color: var(--text-3); font-size: 12px; }

/* ---------- app shell ---------- */
.shell { display: grid; grid-template-columns: 232px minmax(0, 1fr); min-height: 100vh; }
.sidebar { background: var(--bg-2); border-right: 1px solid var(--line); padding: 16px 12px; position: sticky; top: 0; height: 100vh; overflow-y: auto; display: flex; flex-direction: column; gap: 4px; z-index: 30; }
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; color: var(--text) !important; text-decoration: none !important; }
.brand img { width: 32px; height: 32px; }
.brand .name { font-weight: 800; font-size: 16px; letter-spacing: -.02em; }
.brand .name span { color: var(--brand); }
.brand .tag { font-size: 10px; color: var(--text-3); letter-spacing: .08em; text-transform: uppercase; }
.nav-sec { font-size: 10px; text-transform: uppercase; letter-spacing: .1em; color: var(--text-3); padding: 14px 10px 6px; }
.nav a { display: flex; align-items: center; gap: 11px; padding: 9px 10px; border-radius: 9px; color: var(--text-2); font-weight: 500; text-decoration: none !important; }
.nav a svg { width: 18px; height: 18px; flex: none; opacity: .85; }
.nav a:hover { background: var(--panel); color: var(--text); }
.nav a.active { background: var(--panel-2); color: var(--text); box-shadow: inset 3px 0 0 var(--brand); }
.nav a .pill { margin-left: auto; }
.sidebar .foot { margin-top: auto; padding: 12px 8px 0; border-top: 1px solid var(--line); font-size: 11px; color: var(--text-3); }

.main { min-width: 0; display: flex; flex-direction: column; }
.topbar { height: 60px; display: flex; align-items: center; gap: 14px; padding: 0 22px; border-bottom: 1px solid var(--line); background: color-mix(in srgb, var(--bg) 85%, transparent); backdrop-filter: blur(10px); position: sticky; top: 0; z-index: 20; }
.topbar .title { font-weight: 700; font-size: 17px; }
.search { position: relative; width: 280px; max-width: 40vw; }
.search input { padding-left: 34px; height: 36px; background: var(--panel); }
.search svg { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); width: 15px; color: var(--text-3); }
.search-results { position: absolute; top: 42px; left: 0; right: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); max-height: 360px; overflow-y: auto; z-index: 50; }
.search-results a { display: flex; justify-content: space-between; align-items: center; padding: 9px 12px; color: var(--text); text-decoration: none !important; }
.search-results a:hover, .search-results a.sel { background: var(--panel-2); }
.equity-chip { display: flex; flex-direction: column; align-items: flex-end; line-height: 1.15; }
.equity-chip .l { font-size: 10px; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; }
.equity-chip .v { font: 600 15px var(--mono); }
.bell-count { position: absolute; top: 1px; right: 1px; background: var(--down); color: #fff; font: 700 9px var(--font); min-width: 16px; height: 16px; border-radius: 8px; display: grid; place-items: center; padding: 0 4px; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--violet), var(--brand)); display: grid; place-items: center; font-weight: 700; color: #fff; cursor: pointer; border: 0; }
.dropdown { position: absolute; top: 52px; right: 16px; background: var(--panel); border: 1px solid var(--line-2); border-radius: 12px; box-shadow: var(--shadow); min-width: 220px; z-index: 60; overflow: hidden; }
.dropdown .item { display: flex; gap: 10px; padding: 10px 14px; color: var(--text); cursor: pointer; border: 0; background: none; width: 100%; font: 14px var(--font); text-align: left; text-decoration: none !important; }
.dropdown .item:hover { background: var(--panel-2); }
.dropdown .head { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.notif-panel { width: 360px; max-height: 440px; overflow-y: auto; }
.notif { padding: 11px 14px; border-bottom: 1px solid var(--line); }
.notif.unread { background: rgba(23, 230, 161, .05); }
.notif .t { font-weight: 600; font-size: 13px; }
.notif .b { font-size: 12px; color: var(--text-2); }
.content { padding: 22px; max-width: 1600px; width: 100%; margin: 0 auto; flex: 1; }
.page-h { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 18px; flex-wrap: wrap; }
.page-h h1 { font-size: 24px; margin: 0; }
.page-h p { margin: 4px 0 0; color: var(--text-2); }
.menu-btn { display: none; }
.paper-flag { font-size: 11px; }
@media (max-width: 900px) {
  .shell { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; width: 250px; transform: translateX(-100%); transition: .2s; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .menu-btn { display: inline-flex; }
  .search { display: none; }
  .topbar { padding: 0 12px; gap: 8px; }
  .content { padding: 16px; }
  .equity-chip { display: none; }
  .paper-flag { display: none; }
}

/* ---------- tickers ---------- */
.ticker-tape { display: flex; gap: 28px; overflow: hidden; white-space: nowrap; mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent); }
.ticker-track { display: flex; gap: 28px; animation: tape 60s linear infinite; }
.ticker-tape:hover .ticker-track { animation-play-state: paused; }
@keyframes tape { to { transform: translateX(-50%); } }
.tt-item { display: inline-flex; gap: 8px; font-size: 13px; align-items: center; }
.flash-up { animation: flashUp .8s; }
.flash-down { animation: flashDown .8s; }
@keyframes flashUp { from { background: var(--up-bg); } }
@keyframes flashDown { from { background: var(--down-bg); } }

/* ---------- trade terminal ---------- */
.term { display: grid; grid-template-columns: minmax(0, 1fr) 300px 320px; gap: 12px; }
.term .chart-card { min-height: 560px; display: flex; flex-direction: column; }
.chart-box { flex: 1; min-height: 440px; position: relative; }
.chart-tools { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; padding: 10px 14px; border-bottom: 1px solid var(--line); }
.sym-head { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 14px 16px; border-bottom: 1px solid var(--line); }
.sym-head .big { font: 700 22px var(--mono); }
.sym-head .kv .k { font-size: 11px; color: var(--text-3); }
.sym-head .kv .v { font: 500 13px var(--mono); }
.book { font: 12px var(--mono); }
.book .r { display: grid; grid-template-columns: 1fr 1fr 1fr; padding: 2px 12px; position: relative; }
.book .r span { position: relative; z-index: 1; }
.book .r span:nth-child(2), .book .r span:nth-child(3) { text-align: right; }
.book .r i { position: absolute; right: 0; top: 0; bottom: 0; z-index: 0; }
.book .ask i { background: var(--down-bg); }
.book .bid i { background: var(--up-bg); }
.book .mid { padding: 8px 12px; font: 700 16px var(--mono); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.book .hdr { color: var(--text-3); font: 11px var(--font); padding: 8px 12px 4px; display: grid; grid-template-columns: 1fr 1fr 1fr; }
.book .hdr span:nth-child(2), .book .hdr span:nth-child(3) { text-align: right; }
.order-form { display: flex; flex-direction: column; gap: 12px; }
.pct-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.pct-row button { background: var(--bg-2); border: 1px solid var(--line); color: var(--text-2); border-radius: 7px; padding: 5px 0; font: 600 11px var(--font); cursor: pointer; }
.pct-row button:hover { border-color: var(--brand); color: var(--text); }
.kv-list { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.kv-list > div { display: flex; justify-content: space-between; gap: 10px; }
.kv-list .k { color: var(--text-2); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); padding: 0 12px; overflow-x: auto; }
.tabs button { background: none; border: 0; color: var(--text-2); padding: 12px 12px; font: 600 13px var(--font); cursor: pointer; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.active { color: var(--text); border-bottom-color: var(--brand); }
@media (max-width: 1300px) { .term { grid-template-columns: minmax(0, 1fr) 320px; } .term .book-card { display: none; } }
@media (max-width: 900px) { .term { grid-template-columns: minmax(0, 1fr); } }

/* ---------- signal gauge ---------- */
.gauge { position: relative; height: 8px; border-radius: 4px; background: linear-gradient(90deg, var(--down), #6b7d9c 50%, var(--up)); }
.gauge i { position: absolute; top: -4px; width: 4px; height: 16px; background: var(--text); border-radius: 2px; transform: translateX(-50%); box-shadow: 0 0 0 2px var(--panel); }
.action-pill { font: 800 12px var(--font); letter-spacing: .04em; padding: 4px 10px; border-radius: 7px; }
.action-pill.buy { background: var(--up-bg); color: var(--up); }
.action-pill.sell { background: var(--down-bg); color: var(--down); }
.action-pill.hold { background: var(--panel-2); color: var(--text-2); }
.reason { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: 13px; }
.reason:last-child { border-bottom: 0; }
.sig-card { cursor: pointer; transition: .15s; }
.sig-card:hover { border-color: var(--line-2); transform: translateY(-1px); }
.bar-mini { height: 6px; border-radius: 3px; background: var(--bg-2); overflow: hidden; }
.bar-mini i { display: block; height: 100%; border-radius: 3px; }

/* ---------- insights ---------- */
.insight { display: flex; gap: 12px; padding: 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--panel-2); }
.insight .ic { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; flex: none; font-weight: 800; }
.insight.good .ic { background: var(--up-bg); color: var(--up); }
.insight.bad .ic { background: var(--down-bg); color: var(--down); }
.insight.warn .ic { background: var(--warn-bg); color: var(--warn); }
.insight.info .ic { background: var(--info-bg); color: var(--info); }
.insight .tt { font-weight: 600; margin-bottom: 2px; }
.insight .tx { color: var(--text-2); font-size: 13px; }
.bars { display: flex; align-items: flex-end; gap: 3px; height: 120px; }
.bars .b { flex: 1; border-radius: 3px 3px 0 0; min-height: 2px; position: relative; }
.bars .b:hover::after { content: attr(data-tip); position: absolute; bottom: 100%; left: 50%; transform: translateX(-50%); background: var(--panel-2); border: 1px solid var(--line-2); padding: 3px 7px; border-radius: 6px; font-size: 11px; white-space: nowrap; margin-bottom: 4px; z-index: 5; }
.bars-axis { display: flex; gap: 3px; font-size: 10px; color: var(--text-3); margin-top: 4px; }
.bars-axis span { flex: 1; text-align: center; }
.alloc-bar { display: flex; height: 10px; border-radius: 5px; overflow: hidden; gap: 2px; }

/* ---------- markdown ---------- */
.md { line-height: 1.65; font-size: 14.5px; }
.md h1, .md h2, .md h3 { margin: 1.3em 0 .5em; }
.md h2 { font-size: 18px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.md h3 { font-size: 15px; }
.md > :first-child { margin-top: 0; }
.md ul, .md ol { padding-left: 1.3em; margin: 0 0 1em; }
.md li { margin: .25em 0; }
.md table { border-collapse: collapse; margin: 0 0 1em; font-size: 13px; width: auto; }
.md th, .md td { border: 1px solid var(--line); padding: 6px 10px; text-align: left; }
.md th { background: var(--panel-2); }
.md code { background: var(--bg-2); padding: 1px 5px; border-radius: 5px; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 1.2em 0; }
.md blockquote { border-left: 3px solid var(--brand); margin: 0 0 1em; padding: 4px 14px; color: var(--text-2); }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; height: calc(100vh - 160px); min-height: 480px; }
.chat-log { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 14px; }
.msg { max-width: 82%; padding: 12px 15px; border-radius: 14px; }
.msg.user { align-self: flex-end; background: linear-gradient(135deg, rgba(23, 230, 161, .16), rgba(139, 123, 255, .16)); border: 1px solid var(--line-2); white-space: pre-wrap; }
.msg.assistant { align-self: flex-start; background: var(--panel-2); border: 1px solid var(--line); }
.msg .tool { font: 11px var(--mono); color: var(--text-3); padding: 2px 0; }
.chat-input { display: flex; gap: 10px; padding: 14px; border-top: 1px solid var(--line); }
.chat-input textarea { min-height: 46px; max-height: 160px; }
.suggest { display: flex; flex-wrap: wrap; gap: 8px; }
.suggest button { background: var(--panel-2); border: 1px solid var(--line); color: var(--text-2); border-radius: 999px; padding: 7px 13px; font: 13px var(--font); cursor: pointer; }
.suggest button:hover { color: var(--text); border-color: var(--brand); }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); margin-right: 3px; animation: blink 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .2s; }
.typing span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }

/* ---------- modal / toast ---------- */
.modal-bg { position: fixed; inset: 0; background: rgba(3, 6, 12, .6); backdrop-filter: blur(3px); display: grid; place-items: center; z-index: 100; padding: 16px; }
.modal { background: var(--panel); border: 1px solid var(--line-2); border-radius: 16px; width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow-y: auto; box-shadow: var(--shadow); }
.modal.wide { max-width: 820px; }
.modal-h { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-h h3 { margin: 0; }
.modal-b { padding: 20px; }
.modal-f { padding: 14px 20px; border-top: 1px solid var(--line); display: flex; justify-content: flex-end; gap: 10px; }
.toasts { position: fixed; bottom: 18px; right: 18px; display: flex; flex-direction: column; gap: 10px; z-index: 200; max-width: calc(100vw - 36px); }
.toast { background: var(--panel); border: 1px solid var(--line-2); border-left: 4px solid var(--info); border-radius: 10px; padding: 11px 14px; box-shadow: var(--shadow); width: 340px; max-width: 100%; animation: slideIn .2s; }
.toast.ok { border-left-color: var(--up); }
.toast.err { border-left-color: var(--down); }
.toast .t { font-weight: 600; font-size: 13px; }
.toast .b { font-size: 12px; color: var(--text-2); }
@keyframes slideIn { from { transform: translateY(10px); opacity: 0; } }
.spinner { width: 18px; height: 18px; border: 2px solid var(--line-2); border-top-color: var(--brand); border-radius: 50%; animation: spin .7s linear infinite; display: inline-block; vertical-align: middle; }
@keyframes spin { to { transform: rotate(360deg); } }
.skeleton { background: linear-gradient(90deg, var(--panel-2), var(--line), var(--panel-2)); background-size: 200% 100%; animation: sk 1.2s infinite; border-radius: 8px; min-height: 16px; }
@keyframes sk { to { background-position: -200% 0; } }
.loading-block { display: grid; place-items: center; padding: 60px; color: var(--text-3); gap: 10px; }

/* ---------- auth ---------- */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-side { background: radial-gradient(800px 500px at 20% 10%, rgba(23, 230, 161, .18), transparent 60%), radial-gradient(700px 500px at 90% 90%, rgba(139, 123, 255, .2), transparent 60%), var(--bg-2); padding: 48px; display: flex; flex-direction: column; justify-content: space-between; border-right: 1px solid var(--line); }
.auth-form { display: grid; place-items: center; padding: 32px 16px; }
.auth-form form { width: 100%; max-width: 380px; display: flex; flex-direction: column; gap: 14px; }
.auth-form h1 { font-size: 26px; }
.err-msg { color: var(--down); font-size: 13px; min-height: 18px; }
@media (max-width: 900px) { .auth-wrap { grid-template-columns: 1fr; } .auth-side { display: none; } }

.disclaimer { font-size: 12px; color: var(--text-3); line-height: 1.5; }
.kbd { font: 11px var(--mono); border: 1px solid var(--line-2); border-radius: 5px; padding: 1px 5px; color: var(--text-3); }
