:root {
  --bg: #04060d;
  --bg2: #080c1a;
  --surface: rgba(16, 22, 42, 0.72);
  --surface-solid: #0e1428;
  --surface-hi: rgba(26, 35, 66, 0.8);
  --border: rgba(125, 145, 255, 0.14);
  --border-hi: rgba(125, 145, 255, 0.32);
  --text: #e8ecff;
  --muted: #8a94c0;
  --faint: #5a638c;
  --cyan: #22d3ee;
  --violet: #8b5cf6;
  --magenta: #e879f9;
  --green: #34d399;
  --red: #fb7185;
  --amber: #fbbf24;
  --grad: linear-gradient(120deg, #22d3ee 0%, #8b5cf6 55%, #e879f9 100%);
  --radius: 16px;
  --radius-sm: 10px;
  --shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
  --glow: 0 0 24px rgba(139, 92, 246, 0.35);
  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-display: 'Space Grotesk', 'Inter', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'Cascadia Code', Consolas, monospace;
  --nav-h: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; margin: 0; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font); color: var(--text); background: var(--bg);
  min-height: 100vh; min-height: 100dvh; font-size: 14.5px; line-height: 1.5;
  background-image:
    radial-gradient(1100px 600px at 85% -10%, rgba(139, 92, 246, 0.22), transparent 60%),
    radial-gradient(900px 520px at -5% 10%, rgba(34, 211, 238, 0.14), transparent 60%),
    radial-gradient(800px 500px at 50% 120%, rgba(232, 121, 249, 0.12), transparent 60%);
  background-attachment: fixed;
}
body::before {
  content: ''; position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image: linear-gradient(rgba(125,145,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(125,145,255,.045) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 0%, #000 20%, transparent 75%);
}
a { color: var(--cyan); text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
input, select, textarea { font: inherit; color: var(--text); }
::selection { background: rgba(139, 92, 246, 0.5); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(125,145,255,.22); border-radius: 10px; border: 2px solid transparent; background-clip: padding-box; }
.mono { font-family: var(--mono); font-feature-settings: 'tnum'; }
.muted { color: var(--muted); }
.hide { display: none !important; }

/* ── Layout ─────────────────────────────── */
#app { position: relative; z-index: 1; min-height: 100vh; min-height: 100dvh; display: flex; }
.sidebar {
  width: 248px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; height: 100dvh;
  padding: 20px 14px; display: flex; flex-direction: column; gap: 6px;
  background: linear-gradient(180deg, rgba(10,14,30,.9), rgba(6,9,20,.9));
  border-right: 1px solid var(--border); backdrop-filter: blur(18px); overflow-y: auto;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 18px; font-family: var(--font-display); font-weight: 700; font-size: 18px; letter-spacing: .2px; }
.brand-mark { width: 34px; height: 34px; border-radius: 10px; background: var(--grad); display: grid; place-items: center; box-shadow: var(--glow); }
.brand-mark svg { width: 20px; height: 20px; }
.brand small { display: block; font: 500 10px var(--mono); color: var(--muted); letter-spacing: 2px; text-transform: uppercase; }
.nav-label { font: 600 10px var(--mono); letter-spacing: 2px; color: var(--faint); text-transform: uppercase; padding: 14px 10px 6px; display: flex; justify-content: space-between; align-items: center; }
.nav-item {
  display: flex; align-items: center; gap: 11px; padding: 9px 12px; border-radius: 11px; color: var(--muted);
  border: 1px solid transparent; background: none; text-align: left; width: 100%; transition: .18s;
}
.nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.nav-item:hover { color: var(--text); background: rgba(125,145,255,.07); }
.nav-item.active { color: #fff; background: linear-gradient(90deg, rgba(139,92,246,.28), rgba(34,211,238,.1)); border-color: var(--border-hi); box-shadow: inset 0 0 18px rgba(139,92,246,.12); }
.nav-item .count { margin-left: auto; font: 500 11px var(--mono); color: var(--faint); }
.nav-pairs { display: flex; flex-direction: column; gap: 2px; }
.nav-add { color: var(--cyan); cursor: pointer; background: none; border: none; font-size: 18px; line-height: 1; }
.sidebar-foot { margin-top: auto; padding-top: 12px; border-top: 1px solid var(--border); font-size: 12px; color: var(--muted); }

.main { flex: 1; min-width: 0; padding: 28px clamp(16px, 3vw, 40px) 60px; max-width: 1500px; margin: 0 auto; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.page-title { font-family: var(--font-display); font-size: clamp(24px, 3vw, 32px); font-weight: 700; letter-spacing: -.5px; }
.page-title .grad, .grad-text { background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.page-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }

.bottom-nav { display: none; }
@media (max-width: 900px) {
  .sidebar { display: none; }
  .main { padding: 18px 14px calc(var(--nav-h) + var(--safe-b) + 28px); }
  .bottom-nav {
    display: flex; position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; height: calc(var(--nav-h) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: rgba(7,10,22,.9); backdrop-filter: blur(20px); border-top: 1px solid var(--border-hi);
  }
  .bottom-nav button { flex: 1; background: none; border: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; font-size: 10.5px; color: var(--muted); }
  .bottom-nav button svg { width: 22px; height: 22px; }
  .bottom-nav button.active { color: var(--cyan); }
  .bottom-nav button.active svg { filter: drop-shadow(0 0 6px var(--cyan)); }
}

/* ── Surfaces ───────────────────────────── */
.card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  backdrop-filter: blur(14px); box-shadow: var(--shadow); position: relative;
}
.card.pad { padding: 18px; }
.card-title { font: 600 11px var(--mono); letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); margin-bottom: 12px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.grid { display: grid; gap: 14px; }
.stats { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { padding: 16px 18px; overflow: hidden; }
.stat::after { content: ''; position: absolute; inset: auto -20% -60% -20%; height: 90%; background: radial-gradient(closest-side, rgba(139,92,246,.25), transparent); pointer-events: none; }
.stat-label { font: 600 10.5px var(--mono); letter-spacing: 1.6px; text-transform: uppercase; color: var(--muted); }
.stat-value { font: 700 28px var(--font-display); margin-top: 4px; letter-spacing: -.5px; }
.pos { color: var(--green); } .neg { color: var(--red); } .neu { color: var(--amber); }

/* ── Buttons / inputs ───────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 9px 16px; border-radius: 11px;
  border: 1px solid var(--border-hi); background: rgba(125,145,255,.08); font-weight: 600; font-size: 13.5px; transition: .18s; white-space: nowrap;
}
.btn:hover { background: rgba(125,145,255,.16); border-color: rgba(125,145,255,.5); }
.btn:active { transform: scale(.97); }
.btn svg { width: 16px; height: 16px; }
.btn-primary { background: var(--grad); border-color: transparent; color: #060814; box-shadow: 0 6px 24px rgba(139,92,246,.4); }
.btn-primary:hover { background: var(--grad); filter: brightness(1.12); box-shadow: 0 8px 30px rgba(34,211,238,.35); }
.btn-danger { color: var(--red); border-color: rgba(251,113,133,.35); background: rgba(251,113,133,.07); }
.btn-ghost { background: none; border-color: transparent; color: var(--muted); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 9px; }
.btn-icon { padding: 8px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

.field { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.field > label { font: 600 10.5px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); }
.field .hint { font-size: 11.5px; color: var(--faint); }
input[type=text], input[type=email], input[type=password], input[type=number], input[type=date], input[type=time], input[type=url], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: rgba(5,8,20,.65);
  outline: none; transition: .15s; font-size: 14px; min-height: 42px;
}
textarea { resize: vertical; min-height: 84px; }
input:focus, select:focus, textarea:focus { border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34,211,238,.15); }
select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238a94c0' fill='none' stroke-width='1.6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
select option { background: #0e1428; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; }
.form-section { font: 700 12px var(--mono); letter-spacing: 2px; text-transform: uppercase; margin: 18px 0 10px; display: flex; align-items: center; gap: 10px; }
.form-section::after { content: ''; flex: 1; height: 1px; background: linear-gradient(90deg, var(--border-hi), transparent); }

.seg { display: inline-flex; padding: 3px; border-radius: 12px; background: rgba(5,8,20,.7); border: 1px solid var(--border); gap: 2px; flex-wrap: wrap; }
.seg button { border: none; background: none; padding: 7px 14px; border-radius: 9px; color: var(--muted); font-weight: 600; font-size: 13px; transition: .15s; }
.seg button.active { background: rgba(139,92,246,.35); color: #fff; box-shadow: 0 0 14px rgba(139,92,246,.35); }
.seg button.bull.active { background: rgba(52,211,153,.25); box-shadow: 0 0 14px rgba(52,211,153,.3); }
.seg button.bear.active { background: rgba(251,113,133,.25); box-shadow: 0 0 14px rgba(251,113,133,.3); }

.chip { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 99px; font: 600 11px var(--mono); border: 1px solid var(--border-hi); background: rgba(125,145,255,.08); color: var(--muted); white-space: nowrap; }
.chip.bull { color: var(--green); border-color: rgba(52,211,153,.4); background: rgba(52,211,153,.1); }
.chip.bear { color: var(--red); border-color: rgba(251,113,133,.4); background: rgba(251,113,133,.1); }
.chip.neu { color: var(--amber); border-color: rgba(251,191,36,.35); background: rgba(251,191,36,.08); }
.chip.cy { color: var(--cyan); border-color: rgba(34,211,238,.4); background: rgba(34,211,238,.08); }
.chip.vi { color: #c4b5fd; border-color: rgba(139,92,246,.5); background: rgba(139,92,246,.14); }
button.chip { cursor: pointer; } button.chip:hover { border-color: var(--cyan); color: var(--text); }

/* ── Pair workspace ─────────────────────── */
.toolbar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.toolbar .spacer { flex: 1; }
.month-nav { display: inline-flex; align-items: center; gap: 4px; }
.month-nav .label { min-width: 150px; text-align: center; font: 700 17px var(--font-display); }

.pinned {
  position: sticky; top: 0; z-index: 12; margin: 0 -4px 16px; padding: 4px;
}
.bias-card { padding: 14px 16px; border-left: 3px solid var(--violet); }
.bias-card.bull { border-left-color: var(--green); background: linear-gradient(90deg, rgba(52,211,153,.1), var(--surface) 40%); }
.bias-card.bear { border-left-color: var(--red); background: linear-gradient(90deg, rgba(251,113,133,.1), var(--surface) 40%); }
.bias-card.neutral { border-left-color: var(--amber); }
.bias-card.empty { border-left-color: var(--faint); border-style: dashed; }
.bias-row { display: flex; gap: 14px; align-items: flex-start; flex-wrap: wrap; }
.bias-main { flex: 1; min-width: 200px; }
.bias-tag { font: 700 10.5px var(--mono); letter-spacing: 2px; color: var(--muted); text-transform: uppercase; }
.bias-dir { font: 700 20px var(--font-display); display: flex; align-items: center; gap: 8px; margin: 2px 0; }
.bias-meta { font-size: 13px; color: var(--muted); }
.bias-meta b { color: var(--text); font-weight: 600; }
.pin-split { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 760px) { .pin-split { grid-template-columns: 1fr; } .pinned { position: static; } }

.week-strip { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; scrollbar-width: thin; }
.week-pill { flex-shrink: 0; padding: 8px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--surface); text-align: left; transition: .15s; min-width: 120px; }
.week-pill b { display: block; font: 700 13px var(--font-display); }
.week-pill span { font-size: 11.5px; color: var(--muted); }
.week-pill .dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; background: var(--faint); }
.week-pill .dot.bull { background: var(--green); box-shadow: 0 0 8px var(--green); }
.week-pill .dot.bear { background: var(--red); box-shadow: 0 0 8px var(--red); }
.week-pill .dot.neutral { background: var(--amber); }
.week-pill.active { border-color: var(--cyan); background: linear-gradient(135deg, rgba(34,211,238,.14), rgba(139,92,246,.18)); box-shadow: 0 0 20px rgba(34,211,238,.18); }

.day { margin-bottom: 12px; overflow: hidden; }
.day-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; cursor: pointer; flex-wrap: wrap; user-select: none; }
.day-head .dname { font: 700 15px var(--font-display); min-width: 98px; }
.day-head .dname small { display: block; font: 500 11px var(--mono); color: var(--muted); }
.day.today .dname::after { content: 'TODAY'; margin-left: 8px; font: 700 9px var(--mono); padding: 2px 6px; border-radius: 6px; background: var(--grad); color: #060814; vertical-align: middle; }
.day-head .caret { margin-left: auto; transition: .2s; color: var(--muted); }
.day.open .caret { transform: rotate(180deg); }
.day-body { display: none; padding: 0 16px 16px; }
.day.open .day-body { display: block; }
.day-actions { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 12px; }

.trade-list { display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); }
.trade {
  border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: rgba(8,12,28,.7); display: flex; flex-direction: column; transition: .18s;
}
.trade:hover { border-color: var(--border-hi); transform: translateY(-2px); box-shadow: var(--shadow); }
.trade.win { border-top: 2px solid var(--green); } .trade.loss { border-top: 2px solid var(--red); } .trade.be { border-top: 2px solid var(--amber); } .trade.open { border-top: 2px solid var(--cyan); }
.trade-body { padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.trade-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.trade-r { margin-left: auto; font: 700 18px var(--mono); }
.trade-crumbs { display: flex; gap: 5px; flex-wrap: wrap; align-items: center; font-size: 11px; color: var(--faint); }
.trade-notes { color: var(--muted); font-size: 13px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.trade-foot { display: flex; gap: 6px; padding: 8px 12px; border-top: 1px solid var(--border); justify-content: flex-end; }

/* ── Media ──────────────────────────────── */
.media-strip { display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; background: #02040a; }
.media-strip.multi { grid-auto-columns: 86%; }
.media-strip::-webkit-scrollbar { display: none; }
.media-cell { scroll-snap-align: start; position: relative; aspect-ratio: 16/9; cursor: zoom-in; background: #02040a; overflow: hidden; }
.media-cell img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.media-cell:hover img { transform: scale(1.03); }
.media-tag { position: absolute; left: 8px; top: 8px; padding: 2px 8px; border-radius: 8px; background: rgba(4,6,13,.78); backdrop-filter: blur(6px); font: 600 10px var(--mono); letter-spacing: 1px; text-transform: uppercase; border: 1px solid var(--border-hi); }
.media-fallback { width: 100%; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--muted); font-size: 12px; text-align: center; padding: 10px; background: repeating-linear-gradient(45deg, rgba(125,145,255,.05) 0 10px, transparent 10px 20px); }
.media-fallback a { font-weight: 600; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumb { width: 92px; height: 58px; border-radius: 9px; overflow: hidden; border: 1px solid var(--border-hi); position: relative; cursor: zoom-in; background: #02040a; flex-shrink: 0; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb .media-fallback { font-size: 9px; padding: 2px; }
.gallery { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
.g-item { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: var(--surface); cursor: zoom-in; transition: .18s; }
.g-item:hover { border-color: var(--cyan); box-shadow: 0 0 24px rgba(34,211,238,.18); transform: translateY(-2px); }
.g-item .media-cell { cursor: zoom-in; }
.g-cap { padding: 10px 12px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; font-size: 12px; }

.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(2,3,8,.94); backdrop-filter: blur(10px); display: flex; flex-direction: column; animation: fade .2s; }
.lb-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px; color: var(--muted); font-size: 13px; }
.lb-bar .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lb-stage { flex: 1; min-height: 0; display: grid; place-items: center; padding: 0 10px 16px; position: relative; overflow: auto; }
.lb-stage img { max-width: 100%; max-height: 100%; border-radius: 10px; box-shadow: 0 0 60px rgba(139,92,246,.3); object-fit: contain; }
.lb-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 46px; height: 46px; border-radius: 50%; border: 1px solid var(--border-hi); background: rgba(10,14,30,.8); font-size: 22px; }
.lb-nav.prev { left: 12px; } .lb-nav.next { right: 12px; }

/* ── Matrix / tables ────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
th { text-align: left; font: 600 10.5px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--border-hi); white-space: nowrap; }
td { padding: 11px 12px; border-bottom: 1px solid var(--border); vertical-align: middle; }
tr.group-row { cursor: pointer; transition: background .15s; }
tr.group-row:hover { background: rgba(125,145,255,.07); }
tr.group-detail > td { padding: 12px; background: rgba(4,6,13,.5); }
.bar { height: 7px; border-radius: 99px; background: rgba(125,145,255,.12); overflow: hidden; min-width: 70px; }
.bar > i { display: block; height: 100%; background: var(--grad); border-radius: 99px; }
td.num, th.num { text-align: right; font-family: var(--mono); }

/* ── Modal ──────────────────────────────── */
.overlay { position: fixed; inset: 0; z-index: 60; background: rgba(2,3,8,.72); backdrop-filter: blur(6px); display: flex; align-items: center; justify-content: center; padding: 20px; animation: fade .18s; }
.modal { width: min(820px, 100%); max-height: calc(100dvh - 40px); display: flex; flex-direction: column; background: linear-gradient(180deg, #0f1630, #090e22); border: 1px solid var(--border-hi); border-radius: 20px; box-shadow: 0 30px 90px rgba(0,0,0,.7), var(--glow); animation: pop .22s ease; }
.modal.sm { width: min(460px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-head h3 { font: 700 18px var(--font-display); }
.modal-body { padding: 8px 20px 20px; overflow-y: auto; flex: 1; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 20px; border-top: 1px solid var(--border); }
@media (max-width: 700px) {
  .overlay { align-items: flex-end; padding: 0; }
  .modal { max-height: 94dvh; border-radius: 22px 22px 0 0; width: 100%; animation: sheet .26s ease; }
  .modal-foot { padding-bottom: calc(14px + var(--safe-b)); }
}
@keyframes fade { from { opacity: 0 } }
@keyframes pop { from { opacity: 0; transform: translateY(14px) scale(.98) } }
@keyframes sheet { from { transform: translateY(100%) } }

/* media editor */
.dropzone { border: 1.5px dashed var(--border-hi); border-radius: 14px; padding: 14px; background: rgba(5,8,20,.5); transition: .15s; }
.dropzone.drag { border-color: var(--cyan); background: rgba(34,211,238,.08); }
.dz-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.dz-actions input[type=url] { flex: 1; min-width: 180px; }
.media-items { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; margin-top: 12px; }
.mi { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #02040a; }
.mi .media-cell { aspect-ratio: 16/10; }
.mi-foot { display: flex; gap: 4px; padding: 5px; }
.mi-foot select { min-height: 30px; padding: 3px 24px 3px 8px; font-size: 12px; background-position: right 8px center; }
.mi-foot button { border: none; background: rgba(251,113,133,.12); color: var(--red); border-radius: 8px; width: 30px; flex-shrink: 0; }
.mi.loading .media-cell::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, rgba(34,211,238,.25), transparent); animation: sweep 1s infinite; }
@keyframes sweep { from { transform: translateX(-100%) } to { transform: translateX(100%) } }

/* toasts */
#toasts { position: fixed; z-index: 200; right: 16px; bottom: 16px; display: flex; flex-direction: column; gap: 8px; }
@media (max-width: 900px) { #toasts { left: 14px; right: 14px; bottom: calc(var(--nav-h) + var(--safe-b) + 14px); } }
.toast { padding: 11px 16px; border-radius: 12px; background: #11183a; border: 1px solid var(--border-hi); box-shadow: var(--shadow); animation: pop .2s; font-weight: 500; }
.toast.error { border-color: rgba(251,113,133,.6); color: #ffd0d8; }
.toast.ok { border-color: rgba(52,211,153,.5); }

.spinner { width: 34px; height: 34px; border-radius: 50%; border: 3px solid rgba(125,145,255,.2); border-top-color: var(--cyan); animation: spin .8s linear infinite; margin: 80px auto; }
@keyframes spin { to { transform: rotate(360deg) } }
.empty { text-align: center; padding: 40px 20px; color: var(--muted); }
.empty .big { font: 700 18px var(--font-display); color: var(--text); margin-bottom: 4px; }
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 90; text-align: center; padding: 5px; background: var(--amber); color: #1a1200; font: 700 12px var(--mono); }

/* ── Auth ───────────────────────────────── */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 20px; position: relative; z-index: 1; width: 100%; }
.auth-card { width: min(420px, 100%); padding: 32px 28px; border-radius: 22px; }
.auth-card::before { content: ''; position: absolute; inset: -1px; border-radius: 23px; padding: 1px; background: var(--grad); -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; opacity: .55; pointer-events: none; }
.auth h1 { font: 700 28px var(--font-display); margin: 14px 0 4px; }
.auth form { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; }
.err { color: var(--red); font-size: 13px; min-height: 18px; }

.eq-wrap svg { width: 100%; height: 170px; display: block; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.sp { flex: 1; }
.cols-2 { grid-template-columns: 1.6fr 1fr; }
@media (max-width: 1000px) { .cols-2 { grid-template-columns: 1fr; } }
.pair-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.pair-card { padding: 16px; cursor: pointer; transition: .18s; text-align: left; }
.pair-card:hover { border-color: var(--cyan); transform: translateY(-3px); box-shadow: 0 0 28px rgba(34,211,238,.15); }
.pair-card .pname { font: 700 20px var(--font-display); }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }

/* pair picker */
.chip.sel { color: #fff; background: rgba(34,211,238,.25); border-color: var(--cyan); box-shadow: 0 0 12px rgba(34,211,238,.35); }
.chip[disabled] { opacity: .35; cursor: default; }
.pick-group { margin-top: 14px; }
.pick-group h4 { font: 700 11px var(--mono); letter-spacing: 1.8px; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; display: flex; gap: 10px; align-items: center; }
.pick-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.pick-chips .chip { font-size: 12px; padding: 5px 10px; }

/* grouped pair lists */
.side-search { margin: 4px 0 8px; min-height: 36px !important; padding: 7px 11px !important; font-size: 13px !important; }
.nav-group { margin-bottom: 2px; }
.nav-group-head { width: 100%; display: flex; align-items: center; gap: 8px; padding: 7px 10px; border: none; background: none; color: var(--muted); font: 600 11px var(--mono); letter-spacing: 1.4px; text-transform: uppercase; border-radius: 9px; }
.nav-group-head:hover { color: var(--text); background: rgba(125,145,255,.06); }
.nav-group-head .count { margin-left: auto; font-weight: 500; color: var(--faint); }
.nav-group-head .caret { transition: .2s; font-size: 14px; line-height: 1; }
.nav-group.open .nav-group-head .caret { transform: rotate(180deg); }
.nav-group-items { display: none; padding-left: 6px; }
.nav-group.open .nav-group-items { display: block; }
.nav-group-items .nav-item { padding: 6px 10px; font-size: 13px; }
.nav-pairs { overflow-y: auto; min-height: 0; flex: 1; }
.pairs-section .card-title span { color: var(--faint); font-weight: 500; }
