/* BLIND TRADER — design tokens */
:root, [data-theme="dark"] {
  --bg: #0b0d12; --bg-2: #10131a; --surface: #151922; --surface-2: #1b202b; --surface-3: #232937;
  --border: #252c3a; --border-2: #323a4c;
  --text: #e8eaf0; --text-2: #b4bac7; --muted: #7d8597;
  --accent: #e3b341; --accent-2: #f0c75e; --accent-ink: #1a1405; --accent-soft: rgba(227,179,65,.13);
  --green: #22c55e; --green-soft: rgba(34,197,94,.14); --red: #f04848; --red-soft: rgba(240,72,72,.14);
  --blue: #4c8dff; --blue-soft: rgba(76,141,255,.14); --violet: #9b7bff;
  --chart-bg: #0d1016; --grid: rgba(255,255,255,.045); --candle-up: #22c55e; --candle-down: #f04848;
  --shadow: 0 10px 40px rgba(0,0,0,.45); --radius: 12px; --radius-sm: 8px;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg: #f4f5f8; --bg-2: #eef0f4; --surface: #ffffff; --surface-2: #f7f8fa; --surface-3: #eceff4;
  --border: #e3e6ec; --border-2: #d4d9e2;
  --text: #121620; --text-2: #3f4655; --muted: #737b8c;
  --accent: #b9860f; --accent-2: #d29a17; --accent-ink: #ffffff; --accent-soft: rgba(185,134,15,.12);
  --green: #12a150; --green-soft: rgba(18,161,80,.11); --red: #dc2f2f; --red-soft: rgba(220,47,47,.1);
  --blue: #2f6fe4; --blue-soft: rgba(47,111,228,.1); --violet: #7652e8;
  --chart-bg: #ffffff; --grid: rgba(0,0,0,.05); --candle-up: #12a150; --candle-down: #dc2f2f;
  --shadow: 0 10px 40px rgba(20,25,40,.12);
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { background: var(--bg); color: var(--text); font: 14px/1.45 Inter, system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
.mono, .num { font-family: "JetBrains Mono", ui-monospace, monospace; font-variant-numeric: tabular-nums; }
.pos { color: var(--green); } .neg { color: var(--red); } .muted { color: var(--muted); }
.hidden { display: none !important; }

.boot { height: 100vh; display: grid; place-items: center; }
.spinner { width: 28px; height: 28px; border: 3px solid var(--border-2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- buttons & inputs */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: var(--radius-sm); border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer;
  font-weight: 500; white-space: nowrap; transition: background .15s, border-color .15s, transform .05s; }
.btn:hover { background: var(--surface-3); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 600; }
.btn.primary:hover { background: var(--accent-2); }
.btn.buy { background: var(--green); border-color: var(--green); color: #fff; font-weight: 600; }
.btn.sell { background: var(--red); border-color: var(--red); color: #fff; font-weight: 600; }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn.sm { height: 28px; padding: 0 10px; font-size: 12.5px; }
.btn.block { width: 100%; }
.btn.danger { color: var(--red); }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: var(--radius-sm);
  border: 1px solid transparent; background: transparent; cursor: pointer; color: var(--text-2); }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.icon-btn.active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent-soft); }
.icon-btn svg, .btn svg, .nav-item svg { width: 18px; height: 18px; flex: none; }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field > label, .label { font-size: 12px; color: var(--muted); font-weight: 500; letter-spacing: .01em; }
.input, select.input, textarea.input { height: 38px; width: 100%; padding: 0 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-2); background: var(--bg-2); outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; min-height: 84px; padding: 10px 12px; resize: vertical; }
.input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.input.sm { height: 32px; padding: 0 10px; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 12px; }
.spacer { flex: 1; }

.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 3px; gap: 2px; }
.seg button { border: 0; background: transparent; height: 28px; padding: 0 12px; border-radius: 7px; cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 13px; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.2); }
[data-theme="dark"] .seg button.on { background: var(--surface-3); }

.chip { display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; font-size: 13px; color: var(--text-2); }
.chip.on { background: var(--accent-soft); border-color: var(--accent); color: var(--text); }
.tag { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 12px; font-weight: 600; }
.tag.buy { background: var(--green-soft); color: var(--green); }
.tag.sell { background: var(--red-soft); color: var(--red); }
.tag.gold { background: var(--accent-soft); color: var(--accent); }
.tag.plain { background: var(--surface-3); color: var(--text-2); }
.tc0{background:rgba(155,123,255,.18);color:var(--violet)} .tc1{background:rgba(76,141,255,.16);color:var(--blue)}
.tc2{background:rgba(160,160,170,.18);color:var(--text-2)} .tc3{background:rgba(236,72,153,.16);color:#e0559b}
.tc4{background:var(--green-soft);color:var(--green)} .tc5{background:var(--accent-soft);color:var(--accent)}
.tc6{background:rgba(20,184,166,.16);color:#14a89a} .tc7{background:rgba(249,115,22,.16);color:#f07b22}

/* ---------- auth */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.auth-hero { padding: 56px; background: radial-gradient(1200px 600px at 0% 0%, var(--accent-soft), transparent 60%), var(--bg-2);
  display: flex; flex-direction: column; justify-content: space-between; border-inline-end: 1px solid var(--border); }
.auth-hero h1 { font-size: 40px; line-height: 1.1; letter-spacing: -.02em; margin: 0 0 16px; max-width: 520px; }
.auth-hero p { color: var(--text-2); max-width: 460px; font-size: 15px; }
.auth-hero ul { list-style: none; padding: 0; margin: 28px 0 0; display: grid; gap: 12px; }
.auth-hero li { display: flex; gap: 10px; align-items: center; color: var(--text-2); }
.auth-hero li::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.auth-form { display: grid; place-items: center; padding: 32px 20px; }
.auth-card { width: 100%; max-width: 380px; }
.auth-card h2 { margin: 0 0 6px; font-size: 22px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: .02em; }
.brand-mark { width: 30px; height: 30px; border-radius: 8px; background: var(--surface-3); display: grid; place-items: center; }
.brand-mark svg { width: 18px; height: 18px; }
.auth-top { display: flex; justify-content: flex-end; gap: 8px; margin-bottom: 30px; }

/* ---------- shell */
.shell { display: grid; grid-template-columns: 228px 1fr; height: 100vh; }
.sidebar { background: var(--bg-2); border-inline-end: 1px solid var(--border); display: flex; flex-direction: column; padding: 16px 12px; gap: 4px; overflow-y: auto; }
.sidebar .brand { padding: 4px 8px 18px; }
.nav-item { display: flex; align-items: center; gap: 10px; height: 38px; padding: 0 10px; border-radius: var(--radius-sm);
  color: var(--text-2); cursor: pointer; border: 0; background: transparent; width: 100%; text-align: start; font-weight: 500; }
.nav-item:hover { background: var(--surface-2); color: var(--text); }
.nav-item.on { background: var(--surface-2); color: var(--text); box-shadow: inset 2px 0 0 var(--accent); }
[dir="rtl"] .nav-item.on { box-shadow: inset -2px 0 0 var(--accent); }
.nav-item .badge { margin-inline-start: auto; }
.badge { min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: var(--accent-ink); font-size: 11px; font-weight: 700; display: inline-grid; place-items: center; }
.side-foot { margin-top: auto; display: grid; gap: 10px; padding-top: 16px; }
.level-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.level-card .top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.level-card .lv { font-weight: 700; color: var(--text); font-size: 13px; }
.bar { height: 6px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: linear-gradient(90deg, var(--accent), var(--accent-2)); border-radius: 3px; }
.trial-card { font-size: 12px; color: var(--text-2); background: var(--accent-soft); border: 1px solid var(--accent-soft); border-radius: var(--radius); padding: 10px 12px; }
.trial-card b { color: var(--text); }

.main { display: flex; flex-direction: column; min-width: 0; height: 100vh; overflow: hidden; }
.topbar { height: 56px; flex: none; display: flex; align-items: center; gap: 12px; padding: 0 20px; border-bottom: 1px solid var(--border); background: var(--bg); }
.topbar h1 { font-size: 16px; margin: 0; font-weight: 600; }
.content { flex: 1; overflow-y: auto; padding: 22px; }
.content.flush { padding: 0; overflow: hidden; }
.page { max-width: 1240px; margin: 0 auto; }
.mobile-nav { display: none; }

.card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card h3 { margin: 0 0 14px; font-size: 14px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card h3 .muted { font-weight: 400; font-size: 12px; }
.cards { display: grid; gap: 14px; }
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px 16px; }
.kpi .k { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.kpi .v { font-size: 22px; font-weight: 600; letter-spacing: -.01em; font-family: "JetBrains Mono", monospace; }
.kpi .s { font-size: 12px; color: var(--muted); margin-top: 2px; }
.kpi.hero { background: linear-gradient(135deg, var(--accent-soft), transparent 70%), var(--surface); border-color: var(--accent-soft); }

/* ---------- trainer */
.trainer { display: grid; grid-template-columns: 48px 1fr 300px; height: 100%; }
.toolbar { border-inline-end: 1px solid var(--border); background: var(--bg-2); display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 0; }
.toolbar .sep { width: 24px; height: 1px; background: var(--border); margin: 6px 0; }
.chart-wrap { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.chart-head { height: 46px; display: flex; align-items: center; gap: 10px; padding: 0 12px; border-bottom: 1px solid var(--border); flex: none; overflow-x: auto; }
.chart-head .sym { font-weight: 700; }
.chart-head .px { font-size: 15px; font-weight: 600; }
#ctime { white-space: nowrap; }
.qcard .k::first-letter { text-transform: uppercase; }
.chart-area { position: relative; flex: 1; min-height: 0; background: var(--chart-bg); }
.chart-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
.chart-hint { position: absolute; top: 10px; inset-inline-start: 12px; padding: 6px 10px; border-radius: 8px; background: var(--surface); border: 1px solid var(--border); font-size: 12px; color: var(--text-2); pointer-events: none; box-shadow: var(--shadow); }
.play-bar { height: 52px; flex: none; display: flex; align-items: center; gap: 8px; padding: 0 12px; border-top: 1px solid var(--border); background: var(--bg-2); overflow-x: auto; }
.panel { border-inline-start: 1px solid var(--border); background: var(--bg-2); overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 14px; }
.acct { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.acct > div { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 9px 11px; }
.acct .k { font-size: 11px; color: var(--muted); }
.acct .v { font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 14px; }
.order { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 14px; }
.order .bs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 4px; }
.order .bs .btn { height: 44px; flex-direction: column; gap: 0; line-height: 1.1; }
.order .bs .btn small { font-weight: 500; opacity: .85; font-size: 11px; }
.ptool { background: var(--surface); border: 1px solid var(--accent); border-radius: var(--radius); padding: 14px; box-shadow: 0 0 0 3px var(--accent-soft); }
.ptool .line { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.ptool .line b { font-family: "JetBrains Mono", monospace; }
.positions .pos-item { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 10px 12px; margin-bottom: 8px; }
.positions .pos-item .r1 { display: flex; align-items: center; gap: 8px; }
.positions .pos-item .r2 { display: flex; gap: 10px; font-size: 12px; color: var(--muted); margin-top: 4px; }
.section-title { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); font-weight: 600; margin: 0 0 8px; }
.empty { text-align: center; color: var(--muted); padding: 18px 10px; font-size: 13px; }

.start-screen { height: 100%; overflow-y: auto; display: grid; place-items: center; padding: 24px; }
.start-card { max-width: 640px; width: 100%; }
.start-card h2 { font-size: 24px; margin: 0 0 6px; letter-spacing: -.01em; }
.sessions { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; margin: 20px 0; }
.sess { border: 1px solid var(--border-2); border-radius: var(--radius); padding: 14px; cursor: pointer; background: var(--surface); text-align: start; }
.sess:hover { border-color: var(--text-2); }
.sess.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sess .t { font-weight: 600; } .sess .s { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ---------- calendar */
.cal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; flex-wrap: wrap; }
.cal-head h2 { font-size: 20px; margin: 0; min-width: 180px; text-transform: capitalize; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr) 1.1fr; gap: 6px; }
.cal .dow { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; padding: 0 4px 4px; font-weight: 600; }
.day { min-height: 92px; border-radius: 10px; background: var(--surface); border: 1px solid var(--border); padding: 8px; cursor: pointer; display: flex; flex-direction: column; transition: border-color .15s, transform .1s; position: relative; }
.day:hover { border-color: var(--border-2); }
.day.out { opacity: .35; cursor: default; }
.day.today { border-color: var(--accent); }
.day .dn { font-size: 12px; color: var(--muted); font-weight: 600; }
.day .pl { margin-top: auto; font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 15px; }
.day .tc { font-size: 11px; color: var(--muted); }
.day.win { background: linear-gradient(180deg, var(--green-soft), var(--green-soft)), var(--surface); border-color: color-mix(in srgb, var(--green) 35%, transparent); }
.day.loss { background: linear-gradient(180deg, var(--red-soft), var(--red-soft)), var(--surface); border-color: color-mix(in srgb, var(--red) 35%, transparent); }
.day .ck { position: absolute; top: 8px; inset-inline-end: 8px; font-size: 11px; color: var(--muted); }
.week { min-height: 92px; border-radius: 10px; background: var(--surface-2); border: 1px dashed var(--border-2); padding: 8px; display: flex; flex-direction: column; }
.week .wl { font-size: 11px; color: var(--muted); font-weight: 600; }
.week .pl { margin-top: auto; font-family: "JetBrains Mono", monospace; font-weight: 600; }

/* ---------- analytics */
.an-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; margin-top: 14px; }
.an-grid .wide { grid-column: 1 / -1; }
.btable { width: 100%; border-collapse: collapse; font-size: 13px; }
.btable th { text-align: start; font-weight: 500; color: var(--muted); font-size: 11.5px; padding: 6px 6px; border-bottom: 1px solid var(--border); }
.btable td { padding: 8px 6px; border-bottom: 1px solid var(--border); }
.btable tr:last-child td { border-bottom: 0; }
.btable td.n { text-align: end; font-family: "JetBrains Mono", monospace; white-space: nowrap; }
.btable th.n { text-align: end; }
.hbar { position: relative; height: 8px; border-radius: 4px; background: var(--surface-3); min-width: 60px; }
.hbar i { position: absolute; top: 0; bottom: 0; border-radius: 4px; }
.hbar.div i.p { inset-inline-start: 50%; background: var(--green); }
.hbar.div i.n { inset-inline-end: 50%; background: var(--red); }
.hbar.div::after { content: ""; position: absolute; top: -2px; bottom: -2px; left: 50%; width: 1px; background: var(--border-2); }
.eq-canvas { width: 100%; height: 240px; display: block; }
.insight { padding: 12px 14px; border-radius: 10px; background: var(--accent-soft); color: var(--text); font-size: 13px; margin-bottom: 14px; border: 1px solid var(--accent-soft); }

/* ---------- tables, lists */
.list-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface); margin-bottom: 8px; cursor: pointer; }
.list-item:hover { border-color: var(--border-2); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th { text-align: start; color: var(--muted); font-weight: 500; font-size: 12px; padding: 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { padding: 9px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table-wrap { overflow-x: auto; }

/* ---------- modal */
.modal-bg { position: fixed; inset: 0; background: rgba(5,7,12,.6); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .15s; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 560px; max-height: calc(100vh - 32px); overflow-y: auto; background: var(--surface); border: 1px solid var(--border); border-radius: 16px; box-shadow: var(--shadow); animation: pop .18s cubic-bezier(.2,.9,.3,1.2); }
.modal.wide { max-width: 860px; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-head { display: flex; align-items: center; gap: 10px; padding: 16px 20px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--surface); z-index: 2; }
.modal-head h2 { margin: 0; font-size: 16px; }
.modal-body { padding: 18px 20px; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 20px; border-top: 1px solid var(--border); position: sticky; bottom: 0; background: var(--surface); }

.qcard { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 8px; margin-bottom: 18px; }
.qcard > div { background: var(--surface-2); border: 1px solid var(--border); border-radius: 10px; padding: 8px 10px; }
.qcard .k { font-size: 11px; color: var(--muted); }
.qcard .v { font-family: "JetBrains Mono", monospace; font-weight: 600; font-size: 13.5px; }
.checks { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.check { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 9px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; font-size: 13px; user-select: none; }
.check input { display: none; }
.check .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid var(--border-2); display: grid; place-items: center; flex: none; transition: all .12s; }
.check.on { border-color: color-mix(in srgb, var(--accent) 45%, transparent); background: var(--accent-soft); }
.check.on .box { background: var(--accent); border-color: var(--accent); }
.check.on .box::after { content: ""; width: 9px; height: 5px; border: 2px solid var(--accent-ink); border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px,-1px); }
.disc-meter { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); margin: 12px 0 18px; }
.disc-meter .big { font-size: 26px; font-weight: 700; font-family: "JetBrains Mono", monospace; min-width: 84px; }
.disc-meter .bar { flex: 1; height: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 6px; }
.opt { height: 30px; padding: 0 12px; border-radius: 8px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; font-size: 13px; font-weight: 500; }
.opt.on { outline: 2px solid var(--accent); outline-offset: 1px; }
.shot { border: 1.5px dashed var(--border-2); border-radius: 12px; padding: 14px; text-align: center; color: var(--muted); cursor: pointer; font-size: 13px; }
.shot img { max-width: 100%; max-height: 260px; border-radius: 8px; display: block; margin: 0 auto 8px; }
.shot svg { width: 18px; height: 18px; vertical-align: -4px; margin-inline-end: 4px; }
.scale { display: flex; gap: 6px; }
.scale button { flex: 1; height: 40px; border-radius: 10px; border: 1px solid var(--border-2); background: var(--surface-2); cursor: pointer; font-weight: 600; font-size: 15px; }
.scale button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.scale-l { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }

/* ---------- pricing */
.plans { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.plan { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; padding: 22px; cursor: pointer; position: relative; }
.plan.on { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.plan .price { font-size: 34px; font-weight: 700; letter-spacing: -.02em; margin: 8px 0 2px; font-family: "JetBrains Mono", monospace; }
.plan .price small { font-size: 14px; color: var(--muted); font-weight: 500; font-family: Inter, sans-serif; }
.plan .save { position: absolute; top: 16px; inset-inline-end: 16px; }
.plan ul { padding: 0; margin: 14px 0 0; list-style: none; display: grid; gap: 7px; font-size: 13px; color: var(--text-2); }
.plan li::before { content: "✓"; color: var(--accent); font-weight: 700; margin-inline-end: 8px; }
.pay-methods { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pm { border: 1px solid var(--border-2); border-radius: 12px; padding: 14px; cursor: pointer; background: var(--surface-2); text-align: start; }
.pm.on { border-color: var(--accent); background: var(--accent-soft); }
.pm .t { font-weight: 600; } .pm .s { font-size: 12px; color: var(--muted); }

/* ---------- toast */
#toast-root { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); z-index: 200; display: grid; gap: 8px; }
.toast { background: var(--surface-3); color: var(--text); border: 1px solid var(--border-2); padding: 10px 16px; border-radius: 10px; box-shadow: var(--shadow); font-size: 13px; animation: pop .2s; max-width: 90vw; }
.toast.error { border-color: var(--red); }
.toast.ok { border-color: var(--green); }

/* ---------- responsive */
@media (max-width: 1100px) {
  .trainer { grid-template-columns: 44px 1fr 260px; }
}
@media (max-width: 860px) {
  .shell { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .main { height: calc(100vh - 60px); height: calc(100dvh - 60px); }
  .mobile-nav { display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 60px; background: var(--bg-2); border-top: 1px solid var(--border); z-index: 50; padding-bottom: env(safe-area-inset-bottom); }
  .mobile-nav button { flex: 1; border: 0; background: transparent; color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 10.5px; cursor: pointer; }
  .mobile-nav button.on { color: var(--accent); }
  .mobile-nav svg { width: 20px; height: 20px; }
  .content { padding: 14px 16px; }
  .topbar { padding: 0 16px; }
  .trainer { grid-template-columns: 1fr; grid-template-rows: auto minmax(320px, 1fr) auto; height: auto; min-height: 100%; }
  .content.flush { overflow-y: auto; }
  .toolbar { flex-direction: row; border-inline-end: 0; border-bottom: 1px solid var(--border); padding: 4px 8px; overflow-x: auto; order: 0; }
  .toolbar .sep { width: 1px; height: 24px; margin: 0 6px; }
  .chart-wrap { height: 62vh; }
  .panel { border-inline-start: 0; border-top: 1px solid var(--border); }
  .auth { grid-template-columns: 1fr; }
  .auth-hero { display: none; }
  .an-grid, .plans, .pay-methods { grid-template-columns: 1fr; }
  .cal { grid-template-columns: repeat(7, 1fr); gap: 4px; }
  .cal .week, .cal .dow.wk { display: none; }
  .day { min-height: 62px; padding: 5px; }
  .day .pl { font-size: 11px; }
  .day .tc, .day .ck { display: none; }
  .checks { grid-template-columns: 1fr; }
  .grid3 { grid-template-columns: 1fr 1fr; }
  .sessions { grid-template-columns: 1fr; }
  .chart-head { gap: 8px; padding: 0 10px; }
  .chart-head .seg button { padding: 0 8px; }
  .play-bar { flex-wrap: wrap; height: auto; padding: 8px 10px; row-gap: 6px; }
  .mobile-nav button { font-size: 9.5px; min-width: 0; }
  .mobile-nav button span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
.opt svg, .chip svg, .tag svg { width: 14px; height: 14px; vertical-align: -2px; }
/* rectangle tool colours */
.swatches { display: flex; gap: 8px; flex-wrap: wrap; }
.sw { width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.sw.on { border-color: var(--text); }
.sw-accent { background: var(--accent); } .sw-blue { background: var(--blue); } .sw-green { background: var(--green); }
.sw-red { background: var(--red); } .sw-purple { background: #a371f7; } .sw-gray { background: var(--text-2); }
/* extra session window (multi-monitor) */
.shell.room-mode { grid-template-columns: 1fr; }
.shell.room-mode .sidebar, .shell.room-mode .mobile-nav { display: none; }
.room-badge { white-space: nowrap; }
@media (max-width: 860px) { .chart-hint { top: auto !important; bottom: 34px !important; font-size: 12px; } .desk-only { display: none !important; } .shell.room-mode .main { height: 100vh; height: 100dvh; } }
/* ---- split view: two charts side by side */
.chart-area > .pane { position: absolute; inset: 0; }
.chart-area.split { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); }
.chart-area.split > .pane { position: relative; inset: auto; min-width: 0; min-height: 0; background: var(--chart-bg); }
.pane-head { position: absolute; top: 6px; inset-inline-start: 8px; z-index: 2; }
.pane-head .seg { box-shadow: var(--shadow); }
.pane-head .seg button { height: 24px; padding: 0 8px; font-size: 12px; }
@media (max-width: 860px) { .chart-area.split { grid-template-columns: 1fr; grid-template-rows: 1fr 1fr; } }
.icon-btn.active { color: var(--accent); background: var(--accent-soft); }
/* ---- partial close */
.pos-item .r3 { display: flex; align-items: center; gap: 6px; margin-top: 8px; flex-wrap: wrap; font-size: 12px; }
.chip.xs { height: 24px; padding: 0 9px; font-size: 12px; cursor: pointer; }
.input.xs { height: 26px; width: 64px; padding: 0 8px; font-size: 12px; }
.btn.xs { height: 26px; padding: 0 10px; font-size: 12px; }
.fills { display: flex; flex-wrap: wrap; gap: 6px 14px; font-size: 13px; font-weight: 500; }
.fill { white-space: nowrap; }
/* ---- collapsible sidebar */
.side-toggle { margin-inline-start: auto; width: 28px; height: 28px; opacity: .7; }
.side-toggle:hover { opacity: 1; }
.shell.side-collapsed { grid-template-columns: 64px 1fr; }
.shell.side-collapsed .sidebar { padding: 16px 8px; }
.shell.side-collapsed .brand { flex-direction: column; gap: 10px; padding: 4px 0 14px; }
.shell.side-collapsed .brand-text, .shell.side-collapsed .nav-item span:not(.badge), .shell.side-collapsed .side-foot { display: none; }
.shell.side-collapsed .side-toggle { margin: 0; }
.shell.side-collapsed .nav-item { justify-content: center; padding: 0; position: relative; }
.shell.side-collapsed .nav-item .badge { position: absolute; top: 2px; inset-inline-end: 4px; min-width: 16px; height: 16px; font-size: 10px; padding: 0 4px; }
.shell { transition: grid-template-columns .18s ease; }
/* ---- chart appearance modal */
.seg.wrap { flex-wrap: wrap; }
.presets { display: flex; gap: 8px; flex-wrap: wrap; }
.preset { display: flex; gap: 3px; padding: 6px; border-radius: 10px; border: 1.5px solid var(--border); background: var(--surface-2); cursor: pointer; }
.preset i { width: 12px; height: 22px; border-radius: 3px; display: block; }
.preset.on { border-color: var(--accent); }
.color-in { width: 100%; height: 36px; padding: 2px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface-2); cursor: pointer; }
.color-in:disabled { opacity: .4; cursor: not-allowed; }
/* ---- trade replay chart in the journal */
.trade-chart { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--chart-bg); }
.tc-head { display: flex; align-items: center; padding: 6px 8px; border-bottom: 1px solid var(--border); background: var(--surface); }
.tc-head .seg button { height: 24px; padding: 0 9px; font-size: 12px; }
.tc-area { position: relative; height: 360px; }
.tc-area canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; touch-action: none; }
@media (max-width: 860px) { .tc-area { height: 280px; } }
/* ---- positions terminal under the chart (like MT5 / Binance) */
.term { flex: none; border-top: 1px solid var(--border); background: var(--bg-2); display: flex; flex-direction: column; }
.term-head { height: 34px; display: flex; align-items: center; gap: 8px; padding: 0 12px; cursor: pointer; user-select: none; font-size: 12px; border-bottom: 1px solid var(--border); }
.term-title { font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.term-count { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--surface); border: 1px solid var(--border); font-size: 11px; display: inline-flex; align-items: center; justify-content: center; }
.term-head b { font-size: 13px; }
.term-chev svg { width: 16px; height: 16px; transform: rotate(-90deg); transition: transform .15s; color: var(--muted); display: block; }
.term.collapsed .term-chev svg { transform: rotate(90deg); }
.term.collapsed .term-head { border-bottom: 0; }
.term.collapsed .term-body { display: none; }
.term-body { max-height: 148px; overflow: auto; }
.term-body .empty { padding: 12px 10px; }
.ptable { width: 100%; border-collapse: collapse; font-size: 12.5px; white-space: nowrap; }
.ptable th { position: sticky; top: 0; background: var(--bg-2); font-weight: 500; color: var(--muted); font-size: 11px; text-align: start; padding: 6px 10px; border-bottom: 1px solid var(--border); }
.ptable td { padding: 5px 10px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.ptable tbody tr:hover { background: var(--surface); }
.ptable .r { text-align: end; }
.ptable .tag { font-size: 11px; }
.ptable .icon-btn { width: 28px; height: 28px; }
.pt-part { display: flex; align-items: center; gap: 5px; }
.pt-part .input.xs { width: 60px; }
@media (max-width: 860px) {
  .chart-wrap { height: auto; }
  .chart-area { flex: none; height: 52vh; min-height: 300px; }
  .term-body { max-height: 220px; }
}
@media (max-width: 860px) {
  .ptable .c-sym, .ptable .c-price { display: none; }
  .ptable th, .ptable td { padding: 6px 8px; }
  .ptable .c-x { position: sticky; inset-inline-end: 0; background: var(--bg-2); box-shadow: -6px 0 8px -6px rgba(0,0,0,.4); }
}
/* ---- one-click trading on the chart (like MT5) */
.oneclick { position: absolute; top: 8px; inset-inline-start: 8px; z-index: 3; display: flex; align-items: stretch; height: 44px;
  border-radius: 10px; overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--border); background: var(--surface); }
.oc-btn { border: 0; cursor: pointer; color: #fff; min-width: 82px; padding: 0 12px; display: flex; flex-direction: column; align-items: center; justify-content: center; line-height: 1.1; font: inherit; }
.oc-btn span { font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em; opacity: .9; }
.oc-btn b { font-size: 15px; font-weight: 700; }
.oc-btn.sell { background: var(--red); }
.oc-btn.buy { background: var(--green); }
.oc-btn:hover { filter: brightness(1.08); }
.oc-btn:active { filter: brightness(.92); }
.oc-lot { width: 64px; border: 0; background: var(--surface); color: var(--text); text-align: center; font-size: 14px; font-weight: 600; outline: none; }
.oc-lot:focus { box-shadow: inset 0 0 0 2px var(--accent); }
.chart-area .chart-hint { top: 62px; }
.chart-area.split #pane2 .pane-head { top: 6px; }
/* ---- today's stats under the balance */
.day-box { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px; }
.day-box:empty { display: none; }
.day-head { display: flex; align-items: center; gap: 8px; }
.day-spark { width: 110px; height: 30px; }
.day-main { margin: 6px 0 10px; }
.day-main .k { font-size: 11px; color: var(--muted); }
.day-main .v { font-size: 22px; font-weight: 700; line-height: 1.25; }
.day-main .sub { font-size: 11.5px; }
.day-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.day-grid .k { font-size: 11px; color: var(--muted); }
.day-grid .v { font-size: 13px; font-weight: 600; white-space: nowrap; }
@media (max-width: 860px) {
  .oneclick { top: 6px; inset-inline-start: 6px; height: 46px; }
  .oc-btn { min-width: 86px; }
  .oc-lot { width: 58px; font-size: 15px; }
}
