/* 88 Executes Journal — theme tokens first; everything else uses them. Dark is the default. */
@font-face { font-family: "Geist"; src: url("../fonts/geist-latin.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "InterVar"; src: url("../fonts/inter-latin.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }

:root, :root[data-theme="dark"] {
  color-scheme: dark;
  --font: "Geist", "InterVar", "Inter", "Segoe UI Variable Text", "Segoe UI", -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --mono: "JetBrains Mono", "Cascadia Mono", "SF Mono", Consolas, monospace;
  --bg: #0b0d11;
  --bg-2: #0f1217;
  --surface: #14171d;
  --surface-2: #1a1e26;
  --surface-3: #222732;
  --line: #262b35;
  --line-2: #1d212a;
  --text: #e9ebf0;
  --text-2: #9aa3b2;
  --text-3: #687183;
  --accent: #8af0c6;
  --accent-2: #5fdcaa;
  --accent-soft: rgba(138, 240, 198, .12);
  --on-accent: #ffffff;
  --pos: #2ecc71;
  --pos-soft: rgba(46, 204, 113, .13);
  --neg: #f25f5c;
  --neg-soft: rgba(242, 95, 92, .13);
  --warn-soft: rgba(242, 166, 0, .12);
  --warn-line: rgba(242, 166, 0, .35);
  --s1: #3b8cf0; --s2: #e8743a; --s3: #1fae8e; --s4: #8a72ff;       /* chart series (validated for dark) */
  --up: #26a269; --down: #e5534b;
  --shadow: 0 1px 0 rgba(255, 255, 255, .02) inset, 0 8px 24px rgba(0, 0, 0, .25);
  --radius: 14px;
  --sidebar: #0e1015;
}
:root[data-theme="light"] {
  color-scheme: light;
  --bg: #f4f5f8;
  --bg-2: #eef0f4;
  --surface: #ffffff;
  --surface-2: #f7f8fa;
  --surface-3: #eef0f3;
  --line: #e4e7ec;
  --line-2: #eff1f4;
  --text: #14161b;
  --text-2: #5e6573;
  --text-3: #959cab;
  --accent: #0a5c44;
  --accent-2: #084b37;
  --accent-soft: #e1f0ea;
  --on-accent: #ffffff;
  --pos: #0b8a3e;
  --pos-soft: #e6f5ec;
  --neg: #d63a3a;
  --neg-soft: #fcebeb;
  --warn-soft: #fff8e6;
  --warn-line: #f3dfa9;
  --s1: #257de0; --s2: #f47230; --s3: #00b894; --s4: #6a4ce2;
  --up: #1f9d55; --down: #e5484d;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 1px 3px rgba(16, 24, 40, .05);
  --sidebar: #ffffff;
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body { font-family: var(--font); font-size: 13.5px; color: var(--text); background: var(--bg); display: flex; -webkit-font-smoothing: antialiased;
  font-feature-settings: "cv11", "ss01"; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; font-weight: 500; letter-spacing: -.015em; }
h1 { font-size: 24px; letter-spacing: -.025em; }
h2 { font-size: 15px; }
h3 { font-size: 13.5px; }
.num, td.n, .mono, .kpi .value { font-variant-numeric: tabular-nums; }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.flat, .muted { color: var(--text-2); }
.dim { color: var(--text-3); }
.small { font-size: 12px; }
::selection { background: var(--accent-soft); }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 8px; border: 2px solid var(--bg); }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- layout ---------- */
.sidebar { width: 232px; flex: none; background: var(--sidebar); border-right: 1px solid var(--line); display: flex; flex-direction: column;
  padding: 20px 12px; position: sticky; top: 0; height: 100vh; }
.brand { display: flex; gap: 12px; align-items: center; padding: 2px 8px 24px; }
.brand .logo { width: 36px; height: 36px; border-radius: 10px; display: block; }
.brand b { display: block; font-size: 14px; letter-spacing: -.01em; }
.brand small { color: var(--text-2); font-size: 12px; }
nav a { display: flex; align-items: center; gap: 12px; padding: 8px 12px; border-radius: 10px; color: var(--text-2); font-weight: 500; margin-bottom: 2px;
  position: relative; transition: background .12s, color .12s; }
nav a:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
nav a.active { background: var(--accent-soft); color: var(--text); }
nav a.active::before { content: ""; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 3px; border-radius: 0 4px 4px 0; background: var(--accent); }
nav a.active .ni { color: var(--accent); }
nav .ni { width: 18px; height: 18px; display: grid; place-items: center; flex: none; }
nav .ni svg { width: 18px; height: 18px; }
.side-foot { margin-top: auto; padding: 12px 8px; font-size: 12px; color: var(--text-2); display: flex; flex-direction: column; gap: 6px; }
.theme-toggle { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2);
  border-radius: 10px; padding: 8px 12px; cursor: pointer; font: inherit; font-weight: 500; margin-bottom: 8px; }
.theme-toggle:hover { color: var(--text); }
.theme-toggle svg { width: 16px; height: 16px; }
main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--bg) 86%, transparent); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line); padding: 12px clamp(16px, 2vw, 32px); display: flex; gap: 8px; align-items: center; flex-wrap: wrap; min-height: 57px; }
.topbar .spacer { flex: 1; }
.view { padding: 24px clamp(16px, 2vw, 32px) 80px; width: 100%; }
.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head p { margin: 4px 0 0; color: var(--text-2); }
.loading { color: var(--text-2); padding: 40px; }

/* ---------- controls ---------- */
select, input, textarea, button { font: inherit; color: inherit; }
select, input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=search], textarea {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 8px 12px; outline: none; min-width: 0; color: var(--text);
}
select { padding-right: 28px; }
select:hover, input:hover, textarea:hover { border-color: color-mix(in srgb, var(--line) 50%, var(--text-3)); }
select:focus, input:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--text-3); }
textarea { width: 100%; resize: vertical; min-height: 84px; line-height: 1.55; }
.btn { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); border-radius: 8px; padding: 8px 12px; cursor: pointer; font-weight: 500;
  display: inline-flex; gap: 8px; align-items: center; white-space: nowrap; transition: background .12s, border-color .12s; }
.btn:hover { border-color: var(--text-3); text-decoration: none; }
.btn.primary { background: var(--accent); color: var(--on-accent); border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn.danger { color: var(--neg); }
.btn.sm { padding: 4px 8px; font-size: 12px; }
.btn:disabled { opacity: .45; cursor: default; }
.icon-btn { border: 0; background: transparent; cursor: pointer; font-size: 15px; color: var(--text-2); padding: 4px 8px; border-radius: 8px; }
.icon-btn:hover { background: var(--surface-2); color: var(--text); }
.seg { display: inline-flex; background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 4px; gap: 2px; flex-wrap: wrap; }
.seg button { border: 0; background: transparent; padding: 4px 12px; border-radius: 8px; cursor: pointer; color: var(--text-2); font-weight: 500; font-size: 12.5px; }
.seg button:hover { color: var(--text); }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
label.field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); font-weight: 500; }
label.field > input, label.field > select, label.field > textarea { color: var(--text); font-size: 13.5px; font-weight: 400; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.check { display: flex; gap: 8px; align-items: flex-start; padding: 6px 0; cursor: pointer; }
.check input { margin-top: 2px; accent-color: var(--accent); }
details summary { cursor: pointer; }

/* ---------- cards ---------- */
.grid { display: grid; gap: 16px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2-1 { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); }
.g-1-2 { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); }
@media (max-width: 1100px) { .g2, .g3, .g-2-1, .g-1-2 { grid-template-columns: 1fr; } }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px 20px; box-shadow: var(--shadow); min-width: 0; overflow-x: auto; }
.card-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.card-head p { margin: 4px 0 0; color: var(--text-2); font-size: 12px; }
.chart-box { position: relative; height: clamp(240px, 30vh, 420px); }
.chart-box.tall { height: clamp(300px, 38vh, 520px); }
.chart-box.short { height: clamp(190px, 22vh, 300px); }
.price-chart { height: clamp(420px, 56vh, 760px); border-radius: 10px; overflow: hidden; }

.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 12px; margin-bottom: 16px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px; box-shadow: var(--shadow); min-width: 0; }
.kpi .label { font-size: 12px; color: var(--text-2); font-weight: 500; display: flex; justify-content: space-between; }
.kpi .value { font-size: clamp(19px, 1.5vw, 26px); font-weight: 500; margin-top: 8px; letter-spacing: -.02em; white-space: nowrap; }
.kpi .sub { font-size: 12px; color: var(--text-2); margin-top: 4px; }
.meter { height: 6px; background: var(--surface-3); border-radius: 4px; overflow: hidden; margin-top: 8px; display: flex; gap: 2px; }
.meter i { display: block; height: 100%; border-radius: 4px; }

.stat-list { display: grid; grid-template-columns: 1fr auto; gap: 0; }
.stat-list > div { padding: 8px 0; border-bottom: 1px solid var(--line-2); font-variant-numeric: tabular-nums; }
.stat-list > div:nth-child(odd) { color: var(--text-2); }
.stat-list > div:nth-child(even) { text-align: right; font-weight: 500; }
.stat-list > div:nth-last-child(-n+2) { border-bottom: 0; }
.exec-h { margin: 16px 0 2px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.topbar select { max-width: 170px; }

.score { display: flex; align-items: center; gap: 20px; }
.score .big { font-size: 46px; font-weight: 500; letter-spacing: -.04em; }
.score .bar { flex: 1; }

/* ---------- tables ---------- */
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); box-shadow: var(--shadow); }
table { border-collapse: collapse; width: 100%; }
th, td { padding: 12px 12px; text-align: left; border-bottom: 1px solid var(--line-2); white-space: nowrap; }
th { font-size: 11.5px; color: var(--text-3); font-weight: 500; background: var(--surface); position: sticky; top: 0; z-index: 1; text-transform: uppercase; letter-spacing: .03em; }
th.sortable { cursor: pointer; user-select: none; }
th.sortable:hover { color: var(--text); }
th.sorted { color: var(--text); }
th.sorted::after { content: " ↓"; }
th.sorted.asc::after { content: " ↑"; }
td.n, th.n { text-align: right; font-variant-numeric: tabular-nums; }
tbody tr.click { cursor: pointer; }
tbody tr.click:hover { background: var(--surface-2); }
tr:last-child td { border-bottom: 0; }
td .note-preview { max-width: 260px; overflow: hidden; text-overflow: ellipsis; display: inline-block; vertical-align: bottom; color: var(--text-2); }
td.wrap { white-space: normal; min-width: 140px; }
td.tagcell { min-width: 300px; max-width: 420px; }
td.tagcell .tagline { display: flex; gap: 4px; align-items: center; overflow: hidden; white-space: nowrap; }
td.tagcell .tagline .pill { flex: none; }
td.tagcell .note-preview { display: block; margin-top: 4px; max-width: 420px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-3); font-size: 12px; }
.card table th { position: static; }
.card .table-wrap { box-shadow: none; }

/* ---------- pills / tags ---------- */
.pill { display: inline-flex; align-items: center; gap: 4px; padding: 2px 8px; border-radius: 999px; font-size: 11.5px; font-weight: 500;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap; margin: 1px 0; }
.pill .dot { width: 7px; height: 7px; border-radius: 50%; }
.pill.long { background: color-mix(in srgb, var(--s1) 18%, transparent); color: var(--s1); }
.pill.short { background: color-mix(in srgb, var(--s2) 18%, transparent); color: var(--s2); }
.pill.win { background: var(--pos-soft); color: var(--pos); }
.pill.loss { background: var(--neg-soft); color: var(--neg); }
.pill.mistake { background: var(--neg-soft); color: var(--neg); }
.pill.demo { background: var(--warn-soft); color: #d39b14; }
.pill.server { background: var(--pos-soft); color: var(--pos); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--surface-2); padding: 4px 12px; border-radius: 999px; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.chip:hover { color: var(--text); border-color: var(--text-3); }
.chip.on { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.chip.mistake.on { border-color: var(--neg); background: var(--neg-soft); color: var(--neg); }
.tag-cat { margin-top: 12px; }
.tag-cat .lbl { display: flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 500; color: var(--text-2); margin-bottom: 8px; }
.tag-cat .lbl i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.stars { display: inline-flex; gap: 2px; }
.stars button { border: 0; background: none; cursor: pointer; font-size: 20px; color: var(--surface-3); padding: 0 1px; }
.stars button.on { color: #f2a600; }

/* ---------- calendar ---------- */
.cal { display: grid; grid-template-columns: repeat(5, 1fr) 140px; gap: 8px; }
.cal .dow { font-size: 11.5px; font-weight: 500; color: var(--text-3); padding: 0 4px; text-transform: uppercase; letter-spacing: .03em; }
.cal .cell { min-height: clamp(86px, 11vh, 130px); border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 2px; }
.cal .cell.out { background: transparent; border-style: dashed; opacity: .45; }
.cal .cell.has { cursor: pointer; }
.cal .cell.has:hover { outline: 2px solid var(--accent); outline-offset: -1px; }
.cal .cell .d { font-size: 12px; color: var(--text-2); font-weight: 500; display: flex; justify-content: space-between; }
.cal .cell .p { font-size: clamp(14px, 1.1vw, 18px); font-weight: 500; margin-top: auto; font-variant-numeric: tabular-nums; }
.cal .cell .t { font-size: 11.5px; color: var(--text-2); }
.cal .week { background: var(--bg-2); }

/* ---------- trade page ---------- */
.trade-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.trade-head .big { font-size: 28px; font-weight: 500; letter-spacing: -.03em; }
.tf-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
.legend-inline { display: flex; gap: 16px; font-size: 12px; color: var(--text-2); flex-wrap: wrap; }
.legend-inline i { display: inline-block; width: 14px; height: 0; border-top: 2px dashed; vertical-align: middle; margin-right: 4px; }
.legend-inline i.solid { border-top-style: solid; }
.legend-inline b { font-size: 13px; margin-right: 4px; }
.rules { list-style: none; padding: 0; margin: 0; }
.empty { padding: 36px; text-align: center; color: var(--text-2); }
.empty b { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
.callout { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 12px 16px; color: var(--text-2); font-size: 12.5px; line-height: 1.6; }
.callout b { color: var(--text); white-space: nowrap; }
.callout.warn { background: var(--warn-soft); border-color: var(--warn-line); }
code { font-family: var(--mono); font-size: 12px; background: var(--surface-3); padding: 1px 4px; border-radius: 4px; }
pre { font-family: var(--mono); font-size: 12px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 12px 12px; overflow: auto; }

/* ---------- modal / toast ---------- */
.modal-wrap { position: fixed; inset: 0; background: rgba(5, 7, 10, .55); display: grid; place-items: center; z-index: 50; padding: 20px; backdrop-filter: blur(2px); }
.modal { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; width: min(560px, 100%); max-height: 90vh; overflow: auto; box-shadow: 0 24px 60px rgba(0, 0, 0, .35); }
.modal.wide { width: min(1000px, 100%); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px; display: flex; flex-direction: column; gap: 16px; }
.toast { position: fixed; bottom: 20px; left: 50%; transform: translate(-50%, 8px); background: var(--text); color: var(--bg); padding: 12px 16px; border-radius: 10px;
  opacity: 0; transition: .2s; z-index: 60; max-width: 460px; font-weight: 500; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.err { background: var(--neg); color: #fff; }

.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 20px; flex-wrap: wrap; }
.tabs button { border: 0; background: none; padding: 12px 16px; cursor: pointer; color: var(--text-2); font-weight: 500; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs button:hover { color: var(--text); }
.tabs button.on { color: var(--text); border-color: var(--accent); }
.setup-card h2 .pb-dot { width: 10px; height: 10px; margin-right: 8px; vertical-align: 1px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- reports: performance ---------- */
.perf-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1200px) { .perf-grid { grid-template-columns: 1fr; } }
.metric-bar { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; margin-bottom: 12px; }
.metric { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); padding-left: 8px; gap: 6px; }
.metric i { width: 3px; height: 16px; border-radius: 2px; }
.metric select { border: 0; background: transparent; padding: 6px 24px 6px 0; font-weight: 500; max-width: 210px; }
.metric select:focus { box-shadow: none; }
.metric .x { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 0 8px 0 0; }
.metric .x:hover { color: var(--neg); }
.add-metric { border: 0; background: none; color: var(--accent); font-weight: 500; cursor: pointer; padding: 6px 4px; }
.summary-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1100px) { .summary-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.summary-grid > div { padding: 16px 20px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); }
.summary-grid .k { font-size: 12.5px; color: var(--text-2); display: flex; gap: 4px; align-items: center; }
.summary-grid .v { font-size: clamp(18px, 1.35vw, 22px); font-weight: 500; margin-top: 6px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.summary-grid .v small { font-size: 12px; font-weight: 500; color: var(--text-2); margin-left: 6px; }
.info { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--text-3); color: var(--text-3); font-size: 9px; display: inline-grid; place-items: center; cursor: help; font-style: normal; }

/* ---------- screenshots ---------- */
.att-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin: 16px 0 8px; flex-wrap: wrap; }
.att-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 12px; border: 1px dashed transparent; border-radius: 10px; padding: 2px; outline: none; }
.att-grid.over, .att-grid:focus-visible { border-color: var(--accent); background: var(--accent-soft); }
.att { position: relative; margin: 0; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; aspect-ratio: 16 / 10; background: var(--surface-2); cursor: zoom-in; }
.att img { width: 100%; height: 100%; object-fit: cover; display: block; }
.att-x { position: absolute; top: 6px; right: 6px; border: 0; background: rgba(10, 12, 16, .75); color: #fff; border-radius: 6px; width: 24px; height: 24px; cursor: pointer; font-size: 12px; opacity: 0; transition: opacity .15s; }
.att-x.wide { width: auto; padding: 0 8px; opacity: 1; background: var(--neg); }
.att:hover .att-x, .att-x:focus { opacity: 1; }
.att-add { aspect-ratio: 16 / 10; border: 1px dashed var(--line); border-radius: 8px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--text-2); cursor: pointer; font-size: 20px; gap: 2px; }
.att-add span { font-size: 12px; font-weight: 500; }
.att-add:hover { border-color: var(--accent); color: var(--accent); }
.lightbox { background: #000; border-radius: 10px; overflow: hidden; display: grid; place-items: center; max-height: 74vh; }
.lightbox img { max-width: 100%; max-height: 74vh; display: block; }
.dropzone { border: 1.5px dashed var(--line); border-radius: 12px; padding: 28px 16px; text-align: center; cursor: pointer; display: flex; flex-direction: column; gap: 4px; background: var(--surface-2); transition: .15s; }
.dropzone b { font-size: 15px; }
.dropzone span { color: var(--text-2); font-size: 12.5px; }
.dropzone:hover, .dropzone.over, .dropzone:focus-visible { border-color: var(--accent); background: var(--accent-soft); outline: none; }
.dropzone.busy { opacity: .7; cursor: progress; }

/* ---------- Ask Claude ---------- */
.claude-fab { position: fixed; right: 22px; bottom: 22px; z-index: 40; display: inline-flex; align-items: center; gap: 8px; border: 1px solid var(--line); cursor: pointer;
  background: var(--surface-3); color: var(--text); padding: 12px 16px; border-radius: 999px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .3); }
:root[data-theme="light"] .claude-fab { background: #14161b; color: #fff; border-color: #14161b; }
.claude-fab:hover { filter: brightness(1.1); }
.claude-fab svg, .btn.claude svg, .cp-title svg { color: #f0a34a; }
body.claude-open .claude-fab { display: none; }
.claude-panel { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 100vw); z-index: 45; background: var(--surface);
  border-left: 1px solid var(--line); box-shadow: -16px 0 40px rgba(0, 0, 0, .25); display: flex; flex-direction: column;
  transform: translateX(105%); transition: transform .2s ease; }
body.claude-open .claude-panel { transform: none; }
@media (min-width: 1700px) { body.claude-open main { margin-right: 480px; } }
@media (prefers-reduced-motion: reduce) { .claude-panel { transition: none; } }
.cp-head { display: flex; justify-content: space-between; align-items: center; padding: 16px 16px; border-bottom: 1px solid var(--line); gap: 8px; }
.cp-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
.cp-title svg { flex: none; }
.cp-title .pill { overflow: hidden; text-overflow: ellipsis; max-width: 280px; }
.cp-body { flex: 1; overflow-y: auto; padding: 16px; }
.cp-empty p { color: var(--text-2); margin: 4px 0 16px; line-height: 1.55; }
.cp-quick { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.cp-quick .chip { text-align: left; }
.cp-msg { margin-bottom: 16px; }
.cp-msg.user { display: flex; justify-content: flex-end; }
.cp-msg.user .bubble { background: var(--surface-3); padding: 8px 12px; border-radius: 12px 12px 4px 12px; max-width: 85%; white-space: pre-wrap; line-height: 1.5; }
.cp-step { font-size: 12px; color: var(--text-3); margin: 2px 0; }
.cp-step.edit { color: var(--pos); font-weight: 500; }
.md { line-height: 1.62; font-size: 13.5px; }
.md p { margin: 6px 0 12px; }
.md h2, .md h3, .md h4 { font-size: 14px; margin: 16px 0 6px; }
.md ul, .md ol { padding-left: 20px; margin: 6px 0 12px; }
.md li { margin: 4px 0; }
.md pre { white-space: pre-wrap; }
.md hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0; }
.md-table { overflow-x: auto; margin: 8px 0 12px; border: 1px solid var(--line); border-radius: 8px; }
.md-table th, .md-table td { padding: 6px 8px; font-size: 12.5px; }
.md-table th { position: static; }
.cp-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.cp-typing { display: inline-flex; gap: 4px; padding: 6px 0; }
.cp-typing i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); animation: cpdot 1s infinite ease-in-out; }
.cp-typing i:nth-child(2) { animation-delay: .15s; } .cp-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes cpdot { 0%, 80%, 100% { opacity: .3; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-3px); } }
.cp-input { display: flex; gap: 8px; padding: 12px 16px 6px; border-top: 1px solid var(--line); align-items: flex-end; }
.cp-input textarea { min-height: 44px; max-height: 160px; resize: vertical; }
.cp-foot { font-size: 11px; padding: 0 16px 12px; }
.btn.claude { background: var(--surface-3); border-color: var(--line); }
:root[data-theme="light"] .btn.claude { background: #14161b; color: #fff; border-color: #14161b; }
.btn.claude:hover { filter: brightness(1.12); }

/* =====================================================================================================
   v1.1 — polish, rich notes, trade layout, Notebook
   ===================================================================================================== */
:root, :root[data-theme="dark"] { --card-top: rgba(255, 255, 255, .018); --ring: 0 0 0 3px var(--accent-soft); }
:root[data-theme="light"] { --card-top: rgba(255, 255, 255, 0); }
.card { background: linear-gradient(180deg, var(--card-top), transparent 120px), var(--surface); }
.card-head h2 { font-size: 14.5px; }
.page-head h1 { font-size: 26px; }
.crumbs { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--text-3); margin-bottom: 8px; font-weight: 500; }
.crumbs a { color: var(--text-2); }
.crumbs a:hover { color: var(--text); text-decoration: none; }
.topbar-title { font-weight: 500; color: var(--text-2); font-size: 13px; letter-spacing: .01em; }
.btn.ghost { background: transparent; }
.btn.ghost:hover { background: var(--surface-2); }
.btn svg { flex: none; }
.btn-group { display: inline-flex; }
.btn-group .btn { border-radius: 0; }
.btn-group .btn:first-child { border-radius: 8px 0 0 8px; }
.btn-group .btn:last-child { border-radius: 0 8px 8px 0; margin-left: -1px; }
.btn:focus-visible, .chip:focus-visible, .seg button:focus-visible, .icon-btn:focus-visible { outline: none; box-shadow: var(--ring); }
.icon-btn.sm { padding: 4px 4px; font-size: 13px; line-height: 0; }
.icon-btn.on { color: var(--accent); background: var(--accent-soft); }
.icon-btn svg { display: block; }
.seg.sm button { padding: 4px 12px; font-size: 12px; }
.pill.setup { background: var(--surface-3); color: var(--text); }
.pill.setup i { width: 7px; height: 7px; border-radius: 50%; display: inline-block; }
.pill.xs { font-size: 10.5px; padding: 1px 6px; }
.spacer { flex: 1; }
.kpi { background: linear-gradient(180deg, var(--card-top), transparent 80px), var(--surface); }
tbody tr.click:hover td { background: var(--surface-2); }

/* ---------- trade page: stats left, charts right ---------- */
.trade-layout { display: grid; grid-template-columns: minmax(300px, 380px) minmax(0, 1fr); gap: 16px; align-items: start; }
@media (max-width: 1100px) { .trade-layout { grid-template-columns: 1fr; } }
.trade-side, .trade-main { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.stat-hero .hero-row { display: flex; justify-content: space-between; align-items: flex-end; gap: 12px; }
.stat-hero .lbl { font-size: 12px; color: var(--text-2); font-weight: 500; }
.stat-hero .hero { font-size: 30px; font-weight: 500; letter-spacing: -.035em; font-variant-numeric: tabular-nums; margin-top: 4px; }
.stat-hero .hero-r { text-align: right; }
.stat-hero #headR { font-size: 18px; font-weight: 500; margin-top: 4px; font-variant-numeric: tabular-nums; }
.mini-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line-2); border-radius: 10px; overflow: hidden; margin-top: 16px; border: 1px solid var(--line-2); }
.mini-grid > div { background: var(--surface-2); padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; }
.mini-grid span { font-size: 11px; color: var(--text-3); font-weight: 500; }
.mini-grid b { font-size: 13px; font-variant-numeric: tabular-nums; }
.trade-side .form-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.form-grid > * { min-width: 0; }
.form-grid label.field > input, .form-grid label.field > select { width: 100%; }
.trade-side .form-grid > :first-child { grid-column: 1 / -1; }
.chart-card { padding: 16px 16px; }
.price-chart.tall { height: clamp(440px, 60vh, 820px); }
.collapsible { padding: 0; overflow: visible; }
.coll-head { display: flex; align-items: center; gap: 12px; padding: 12px 16px; flex-wrap: wrap; }
.coll-toggle { display: flex; align-items: center; gap: 8px; border: 0; background: none; cursor: pointer; padding: 2px 4px 2px 0; color: var(--text); }
.coll-toggle svg { transition: transform .15s; transform: rotate(-90deg); color: var(--text-2); }
.collapsible.open .coll-toggle svg { transform: none; }
.coll-body { display: none; padding: 0 16px 16px; }
.collapsible.open .coll-body { display: block; }
.collapsible.open .coll-head { border-bottom: 1px solid var(--line-2); margin-bottom: 16px; }
.collapsible .coll-body table { margin-top: -6px; }

/* ---------- day page ---------- */
.day-bottom { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); gap: 16px; align-items: start; }
@media (max-width: 1250px) { .day-bottom { grid-template-columns: 1fr; } }

/* ---------- daily journal panel ---------- */
.dj-top { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.dj-meta { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.dj-meta label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.dj-meta select { padding: 4px 28px 4px 8px; font-size: 12.5px; }
.dots { display: inline-flex; gap: 4px; }
.dots button { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--text-3); background: transparent; cursor: pointer; padding: 0; }
.dots button.on { background: var(--accent); border-color: var(--accent); }
.dots button:hover { border-color: var(--accent); }

/* ---------- rich text editor ---------- */
.rte { position: relative; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.rte-tpls { display: flex; align-items: center; gap: 8px; padding: 12px 12px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.rte-tpl-label { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-3); font-weight: 500; margin-right: 2px; }
.rte-chip { border: 1px solid var(--line); background: var(--surface-2); color: var(--text); padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 500; cursor: pointer; display: inline-flex; gap: 4px; align-items: center; }
.rte-chip:hover { border-color: var(--text-3); }
.rte-chip.add { color: var(--accent); border-style: dashed; background: transparent; }
.rte-chip.ghost { background: transparent; color: var(--text-2); }
.rte-bar { display: flex; align-items: center; gap: 4px; padding: 6px 8px; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; position: sticky; top: 57px; z-index: 3;
  background: var(--surface); border-radius: 12px 12px 0 0; }
.rte-tpls + .rte-bar { border-radius: 0; }
.rte-group { display: flex; align-items: center; gap: 2px; padding: 0 4px; border-right: 1px solid var(--line-2); }
.rte-group:last-of-type, .rte-group.end { border-right: 0; }
.rte-spacer { flex: 1; }
.rte-btn { border: 0; background: transparent; color: var(--text-2); height: 30px; min-width: 30px; padding: 0 8px; border-radius: 8px; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-size: 13px; }
.rte-btn:hover { background: var(--surface-2); color: var(--text); }
.rte-btn.on { background: var(--accent-soft); color: var(--text); }
.rte-btn.rec { background: var(--neg-soft); color: var(--neg); animation: rec 1.2s infinite; }
@keyframes rec { 50% { opacity: .6; } }
.rte-btn.wide { min-width: 96px; justify-content: space-between; }
.rte-btn.drop > svg:last-child, .rte-btn.caret svg { opacity: .7; }
.rte-btn.caret { min-width: 18px; padding: 0 4px; }
.rte-split { display: inline-flex; }
.rte-split .rte-btn:first-child { border-radius: 8px 0 0 8px; }
.rte-split .rte-btn.caret { border-radius: 0 8px 8px 0; }
.rte-aa { font-weight: 500; font-size: 13px; }
.rte-tt { font-weight: 500; font-size: 12px; color: var(--text-3); }
.rte-size { display: inline-flex; align-items: center; gap: 1px; }
.rte-size input { width: 42px; text-align: center; padding: 4px 2px; height: 28px; -moz-appearance: textfield; }
.rte-size input::-webkit-inner-spin-button { -webkit-appearance: none; }
.rte-btn.sq { min-width: 26px; padding: 0; }
.rte-a { display: inline-flex; flex-direction: column; align-items: center; font-weight: 500; line-height: 1; position: relative; }
.rte-a i { display: block; width: 16px; height: 3px; border-radius: 2px; margin-top: 2px; background: currentColor; }
.rte-status { font-size: 11.5px; color: var(--text-3); margin-right: 6px; min-width: 52px; text-align: right; }
.rte-status.ok { color: var(--text-3); }
.rte-status.err { color: var(--neg); font-weight: 500; }
.rte-pop { position: absolute; z-index: 20; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 6px;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .35); min-width: 190px; max-height: 360px; overflow: auto; }
.rte-pop-h { font-size: 11px; color: var(--text-3); font-weight: 500; text-transform: uppercase; letter-spacing: .04em; padding: 4px 6px 6px; }
.rte-item { display: flex; align-items: center; gap: 8px; width: 100%; border: 0; background: none; text-align: left; padding: 8px 8px; border-radius: 8px; cursor: pointer; color: var(--text); font-size: 13px; }
.rte-item:hover { background: var(--surface-2); }
.rte-item kbd { margin-left: auto; font-family: var(--font); font-size: 11px; color: var(--text-3); }
.rte-item.blk-h1 { font-size: 19px; font-weight: 500; } .rte-item.blk-h2 { font-size: 16px; font-weight: 500; } .rte-item.blk-h3 { font-size: 14px; font-weight: 500; }
.rte-item.blk-blockquote { border-left: 3px solid var(--text-3); border-radius: 0 8px 8px 0; color: var(--text-2); }
.rte-item.blk-pre { font-family: var(--mono); font-size: 12px; }
.rte-swatches { display: grid; grid-template-columns: repeat(6, 24px); gap: 6px; padding: 4px 6px 8px; }
.rte-swatches .sw { width: 24px; height: 24px; border-radius: 6px; border: 1px solid var(--line); cursor: pointer; padding: 0; }
.rte-swatches .sw:hover { transform: scale(1.1); }
.rte-swatches .sw.none { background: linear-gradient(135deg, transparent 45%, var(--neg) 45% 55%, transparent 55%), var(--surface-2); }
.rte-custom { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: 12px; color: var(--text-2); padding: 4px 6px 2px; }
.rte-custom input[type=color] { width: 34px; height: 24px; border: 1px solid var(--line); border-radius: 6px; padding: 0; background: none; cursor: pointer; }
.rte-link { display: flex; gap: 6px; padding: 2px 4px 4px; min-width: 320px; }
.rte-link input { flex: 1; }
.rte-body { position: relative; padding: 16px 20px 24px; outline: none; line-height: 1.65; font-size: 14px; color: var(--text); overflow-wrap: anywhere; cursor: text; border-radius: 0 0 12px 12px; }
.rte-body.empty::before { content: attr(data-ph); color: var(--text-3); position: absolute; top: 16px; left: 20px; right: 20px; text-align: left; pointer-events: none; }
.rte-body.drop { outline: 2px dashed var(--accent); outline-offset: -6px; background: var(--accent-soft); }
.rte-body > :first-child { margin-top: 0; }
.rte-body p { margin: 0 0 8px; }
.rte-body h1 { font-size: 24px; margin: 20px 0 8px; } .rte-body h2 { font-size: 19px; margin: 16px 0 6px; } .rte-body h3 { font-size: 15.5px; margin: 16px 0 6px; }
.rte-body ul, .rte-body ol { padding-left: 24px; margin: 4px 0 12px; }
.rte-body li { margin: 4px 0; }
.rte-body blockquote { margin: 8px 0; padding: 4px 16px; border-left: 3px solid var(--accent); color: var(--text-2); background: var(--surface-2); border-radius: 0 8px 8px 0; }
.rte-body pre { margin: 8px 0; white-space: pre-wrap; }
.rte-body hr { border: 0; border-top: 1px solid var(--line); margin: 16px 0; }
.rte-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.rte-body img { display: block; max-width: 100%; height: auto; border-radius: 10px; border: 1px solid var(--line); margin: 12px 0; cursor: zoom-in; }
.rte-body img.sel { outline: 3px solid var(--accent); outline-offset: 2px; }
.rte-body table { border-collapse: collapse; margin: 12px 0; width: auto; min-width: 50%; }
.rte-body td, .rte-body th { border: 1px solid var(--line); padding: 6px 12px; min-width: 70px; white-space: normal; vertical-align: top; }
.rte-body ul.checklist { list-style: none; padding-left: 4px; }
.rte-body ul.checklist > li { position: relative; padding-left: 28px; }
.rte-body ul.checklist > li::before { content: ""; position: absolute; left: 2px; top: 4px; width: 15px; height: 15px; border: 1.5px solid var(--text-3); border-radius: 4px; cursor: pointer; }
.rte-body ul.checklist > li[data-checked="true"] { color: var(--text-3); text-decoration: line-through; }
.rte-body ul.checklist > li[data-checked="true"]::before { background: var(--accent) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 12px no-repeat; border-color: var(--accent); }
.rte-body.readonly { border: 1px solid var(--line); border-radius: 10px; max-height: 56vh; overflow: auto; }
.rte-imgbar { position: absolute; z-index: 15; display: flex; gap: 2px; background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 4px; box-shadow: 0 8px 24px rgba(0, 0, 0, .3); }
.rte-imgbar button { border: 0; background: none; color: var(--text-2); font-size: 12px; font-weight: 500; padding: 4px 8px; border-radius: 6px; cursor: pointer; display: inline-flex; }
.rte-imgbar button:hover { background: var(--surface-2); color: var(--text); }
.rte.compact .rte-body { padding: 12px 16px 16px; }
.rte.compact .rte-body.empty::before { top: 12px; left: 14px; right: 14px; }
.rte.rte-full { position: fixed; inset: 12px; z-index: 48; display: flex; flex-direction: column; box-shadow: 0 30px 80px rgba(0, 0, 0, .5); }
.rte.rte-full .rte-bar { top: 0; }
.rte.rte-full .rte-body { flex: 1; overflow: auto; min-height: 0 !important; padding: 28px max(28px, calc(50% - 440px)); font-size: 15px; }
.rte.rte-full .rte-body.empty::before { top: 28px; left: max(28px, calc(50% - 440px)); right: max(28px, calc(50% - 440px)); }
body.rte-noscroll { overflow: hidden; }
.loose { margin-top: 12px; padding: 12px; border: 1px dashed var(--line); border-radius: 12px; display: flex; flex-direction: column; gap: 12px; align-items: flex-start; }
.loose-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 12px; width: 100%; }
.loose figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.loose img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 8px; border: 1px solid var(--line); cursor: zoom-in; }
.hist { display: grid; grid-template-columns: 260px 1fr; gap: 16px; }
@media (max-width: 760px) { .hist { grid-template-columns: 1fr; } }
.hist-list { display: flex; flex-direction: column; gap: 4px; max-height: 60vh; overflow: auto; }
.hist-item { text-align: left; border: 1px solid transparent; background: none; border-radius: 8px; padding: 8px 12px; cursor: pointer; display: flex; flex-direction: column; gap: 2px; color: var(--text); }
.hist-item span { font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hist-item:hover { background: var(--surface-2); }
.hist-item.on { background: var(--accent-soft); border-color: var(--accent); }
.tpl-list { display: flex; flex-direction: column; }
.tpl-row { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.tpl-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- Notebook ---------- */
.nb { display: grid; grid-template-columns: 230px 320px minmax(0, 1fr); gap: 0; min-height: calc(100vh - 140px); border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--surface); overflow: hidden; box-shadow: var(--shadow); }

@media (max-width: 980px) { .nb { grid-template-columns: 1fr; } .nb-side, .nb-list { border-right: 0 !important; border-bottom: 1px solid var(--line); } .nb-list { max-height: 320px; } }
.nb-side { border-right: 1px solid var(--line); padding: 16px 12px; background: var(--bg-2); display: flex; flex-direction: column; gap: 2px; }
.nb-title { display: flex; align-items: center; gap: 8px; padding: 0 6px 12px; color: var(--text); }
.nb-title svg { color: var(--accent); }
.nb-search { display: flex; align-items: center; gap: 8px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 8px; padding: 0 8px; margin-bottom: 12px; color: var(--text-3); }
.nb-search input { border: 0; background: none; padding: 8px 0; flex: 1; box-shadow: none !important; }
.nb-sec { display: flex; justify-content: space-between; align-items: center; font-size: 11px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; padding: 16px 8px 6px; }
.nb-folder { display: flex; align-items: center; gap: 12px; padding: 8px 8px; border-radius: 8px; color: var(--text-2); font-weight: 500; flex: none; min-width: 0; }
.nb-folder-row .nb-folder { flex: 1; }
.nb-folder span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nb-folder em { font-style: normal; font-size: 11.5px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.nb-folder:hover { background: var(--surface-2); color: var(--text); text-decoration: none; }
.nb-folder.on { background: var(--accent-soft); color: var(--text); }
.nb-folder.on svg { color: var(--accent); }
.nb-folder-row { display: flex; align-items: center; }
.nb-folder-row .nb-more { opacity: 0; }
.nb-folder-row:hover .nb-more { opacity: 1; }
.nb-dot { width: 10px; height: 10px; border-radius: 4px; display: inline-block; flex: none; }
.nb-empty-books { padding: 0 8px; line-height: 1.5; }
.nb-list { border-right: 1px solid var(--line); display: flex; flex-direction: column; min-width: 0; max-height: calc(100vh - 140px); }
.nb-list-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 16px 16px 6px; flex-wrap: wrap; }
.nb-list-head h3 { font-size: 14px; display: flex; align-items: center; gap: 8px; }
.nb-list-head input[type=date] { padding: 4px 8px; font-size: 12px; }
.nb-hint { margin: 0; padding: 0 16px 12px; font-size: 12px; color: var(--text-3); }
.nb-items { overflow-y: auto; flex: 1; padding: 0 8px 12px; }
.nb-item { display: block; padding: 12px 12px; border-radius: 10px; color: var(--text); border: 1px solid transparent; margin-bottom: 2px; }
.nb-item:hover { background: var(--surface-2); text-decoration: none; }
.nb-item.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.nb-item-top { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.nb-item-top b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px; }
.nb-item-top span { font-weight: 500; font-variant-numeric: tabular-nums; font-size: 12.5px; }
.nb-item-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; }
.nb-item-prev { font-size: 12px; color: var(--text-2); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.45; }
.nb-none, .nb-loading { padding: 20px 16px; color: var(--text-3); font-size: 12.5px; line-height: 1.5; }
.nb-doc { padding: 24px 28px 40px; min-width: 0; overflow: visible; }
.nb-doc-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 16px; flex-wrap: wrap; }
.nb-doc-head h1 { font-size: 22px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.nb-doc-head p { margin: 6px 0 0; }
.nb-kicker { display: flex; align-items: center; gap: 6px; font-size: 11.5px; font-weight: 500; color: var(--text-3); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 6px; }
.nb-title-input { width: 100%; font-size: 22px; font-weight: 500; letter-spacing: -.02em; background: transparent !important; border: 1px solid transparent !important; padding: 2px 6px !important; margin-left: -8px; border-radius: 8px; }
.nb-title-input:hover { border-color: var(--line) !important; }
.nb-title-input:focus { border-color: var(--accent) !important; }
.nb-move { font-size: 11.5px; padding: 2px 24px 2px 6px; text-transform: none; letter-spacing: 0; font-weight: 500; }
.nb-stats { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; margin-bottom: 16px; }
.nb-stats > div { padding: 12px 16px; border-right: 1px solid var(--line-2); display: flex; flex-direction: column; gap: 4px; }
.nb-stats > div:last-child { border-right: 0; }
.nb-stats span { font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.nb-stats b { font-size: 17px; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.nb-stats.empty { display: block; padding: 12px 16px; color: var(--text-3); font-size: 12.5px; }
.nb-range { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; margin-bottom: 16px; }
.nb-range label { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--text-3); font-weight: 500; }
.nb-range .chips { margin-bottom: 4px; }
.nb-trades { margin: 6px 0 16px; border: 1px solid var(--line); border-radius: 12px; padding: 8px 12px; }
.nb-trades h3 { font-size: 13px; display: inline; }
.nb-trades summary { padding: 4px 0; list-style-position: inside; }
.nb-trades table td { padding: 8px 8px; }
.nb-blank { height: 100%; min-height: 360px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px; text-align: center; color: var(--text-2); }
.nb-blank svg { width: 34px; height: 34px; color: var(--text-3); }
.nb-blank p { max-width: 380px; margin: 0 0 6px; line-height: 1.55; }
.nb-colors { display: flex; gap: 8px; margin-top: 4px; }
.nb-colors button { width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.nb-colors button.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.nb .rte-bar { top: 57px; }

/* ---------- calendar notebook links ---------- */
.cal .cell { position: relative; }
.cal .cell.today { border-color: var(--accent); }
.cal .cell.today .d > span:first-child { color: var(--accent); }
.cal .nb-link { color: var(--text-3); opacity: .45; display: inline-flex; padding: 2px; border-radius: 4px; line-height: 0; transition: opacity .12s; }
.cal .cell:hover .nb-link, .cal .nb-link:focus-visible { opacity: 1; }
.cal .nb-link:hover { color: var(--accent); background: var(--accent-soft); text-decoration: none; }
.cal .nb-link.on { color: var(--accent); opacity: 1; }

/* ---------- reports: vertical breakdowns + metric colours ---------- */
.bd-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 1400px) { .bd-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 900px) { .bd-grid { grid-template-columns: 1fr; } }
.bd-card .card-head { margin-bottom: 8px; }
.bd-card h2 { font-size: 13.5px; }
.metric .gear { border: 0; background: none; color: var(--text-3); cursor: pointer; padding: 0 2px; display: inline-flex; line-height: 0; }
.metric .gear:hover { color: var(--text); }
.metric i { flex: none; }
.color-pop { position: fixed; z-index: 70; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; width: 282px;
  box-shadow: 0 18px 50px rgba(0, 0, 0, .4); display: flex; flex-direction: column; gap: 12px; }
.cpop-title { font-weight: 500; font-size: 13px; }
.cpop-row { display: flex; flex-direction: column; gap: 6px; }
.cpop-label { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--text-2); font-weight: 500; }
.cpop-label i { width: 14px; height: 14px; border-radius: 4px; display: inline-block; border: 1px solid var(--line); }
.cpop-sw { display: grid; grid-template-columns: repeat(9, 24px); gap: 4px; }
.cpop-sw button { width: 24px; height: 24px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; padding: 0; }
.cpop-sw button.on { border-color: var(--text); box-shadow: 0 0 0 2px var(--surface) inset; }
.cpop-sw button:hover { transform: scale(1.08); }
.cpop-custom { width: 24px; height: 24px; border-radius: 6px; overflow: hidden; border: 1px dashed var(--text-3); position: relative; cursor: pointer;
  background: conic-gradient(#f25f5c, #f59e0b, #22c55e, #06b6d4, #3b8cf0, #8a72ff, #ec4899, #f25f5c); }
.cpop-custom input { opacity: 0; position: absolute; inset: 0; width: 100%; height: 100%; cursor: pointer; }
.cpop-foot { display: flex; justify-content: space-between; gap: 8px; border-top: 1px solid var(--line-2); padding-top: 12px; }
/* the toolbar adapts to the editor's own width (Notebook, trade page, panels) */
.rte { container-type: inline-size; }
@container (max-width: 800px) {
  .rte-btn.wide { min-width: 0; } .rte-btn.wide [data-fontname] { display: none; }
  .rte-group { padding: 0 2px; } .rte-status { min-width: 0; font-size: 0; } .rte-status.err { font-size: 11px; }
  .rte-tpl-label span, .rte-tpl-label { font-size: 0; gap: 0; }
}
@container (max-width: 760px) {
  .rte-bar { gap: 1px; padding: 6px 4px; } .rte-group { padding: 0 1px; }
  .rte-btn { min-width: 27px; padding: 0 4px; } .rte-btn.sq { min-width: 20px; } .rte-btn.caret { min-width: 14px; }
  .rte-size input { width: 34px; } .rte-btn.drop > svg:last-child { display: none; }
}
@container (max-width: 520px) { .rte-size { display: none; } }

/* Notebook on mid-size windows: folders become a bar across the top */
@media (max-width: 1450px) {
  .nb { grid-template-columns: 280px minmax(0, 1fr); }
  .nb-side { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; gap: 4px 6px; border-right: 0; border-bottom: 1px solid var(--line); padding: 12px 16px; }
  .nb-title { padding: 0 12px 0 2px; } .nb-title h2 { font-size: 14px; }
  .nb-search { margin: 0 8px 0 0; width: 200px; }
  .nb-sec { padding: 0 2px 0 12px; border-left: 1px solid var(--line); margin-left: 4px; }
  .nb-folder { padding: 6px 8px; } .nb-folder-row .nb-more { opacity: 1; }
  .nb-empty-books { display: none; }
  .nb-list { max-height: calc(100vh - 190px); }
}

/* v1.2 — daily entry delete */
.dj-meta .dj-del { color: var(--text-3); }
.dj-meta .dj-del:hover { color: var(--neg); }
.dj-meta .dj-del[hidden] { display: none; }

/* v1.2 — trades multi-select + bulk actions */
.trades-table .sel-col { width: 34px; padding-left: 12px; padding-right: 2px; }
.trades-table .sel-col input { width: 15px; height: 15px; margin: 0; cursor: pointer; accent-color: var(--accent); vertical-align: middle; }
.trades-table tr.selected td { background: color-mix(in srgb, var(--accent) 10%, transparent); }
.trades-table tr.selected:hover td { background: color-mix(in srgb, var(--accent) 15%, transparent); }
.bulk-bar { display: none; }
.bulk-bar.on { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  padding: 8px 12px 8px 16px; margin-bottom: 12px; border: 1px solid color-mix(in srgb, var(--accent) 45%, var(--line));
  background: color-mix(in srgb, var(--accent) 9%, var(--surface)); border-radius: var(--radius); box-shadow: var(--shadow);
  animation: bulkIn .14s ease-out; }
.bulk-info { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; font-size: 13px; }
.linkish { background: none; border: 0; padding: 0; color: var(--accent); font: inherit; font-size: 12.5px; cursor: pointer; }
.linkish:hover { text-decoration: underline; }
@keyframes bulkIn { from { opacity: 0; transform: translateY(-3px); } to { opacity: 1; transform: none; } }

/* v1.2 — Edge Lab › Statistical edge */
.stat-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 16px; flex-wrap: wrap; margin: 28px 0 12px; }
.stat-head h2 { font-size: 18px; margin: 0 0 4px; letter-spacing: -.01em; }
.stat-head p { margin: 0; color: var(--text-2); font-size: 13px; }
.kpis-6 { grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); margin-bottom: 12px; }
.kpis-6 .kpi { box-shadow: none; background: var(--surface-2); }
.kpis-6 .kpi .sub { font-size: 11.5px; line-height: 1.45; }
.stat-note { line-height: 1.65; }
.verdict { display: inline-flex; align-items: center; gap: 8px; padding: 4px 12px; border-radius: 999px; font-size: 12.5px; font-weight: 500;
  border: 1px solid var(--line); background: var(--surface-2); color: var(--text-2); white-space: nowrap; }
.verdict::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.verdict.pos { color: var(--pos); border-color: color-mix(in srgb, var(--pos) 40%, var(--line)); background: color-mix(in srgb, var(--pos) 10%, var(--surface)); }
.verdict.neg { color: var(--neg); border-color: color-mix(in srgb, var(--neg) 40%, var(--line)); background: color-mix(in srgb, var(--neg) 10%, var(--surface)); }
.verdict.warn { color: var(--warn, #d9a13b); border-color: var(--warn-line, var(--line)); background: var(--warn-soft, var(--surface-2)); }
.forest { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.forest .chart-box { height: auto; min-height: 180px; }
@media (max-width: 1100px) { .forest { grid-template-columns: 1fr; } }
.ftab { width: 100%; font-size: 12.5px; }
.ftab th { font-size: 11.5px; }
.ftab td, .ftab th { padding: 6px 8px; }
.ftab tr.thin td { opacity: .55; }
.sigdot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 8px; background: var(--text-3); opacity: .5; vertical-align: 1px; }
.sigdot.pos { background: var(--pos); opacity: 1; } .sigdot.neg { background: var(--neg); opacity: 1; }
.mini-stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 12px; margin-bottom: 16px; }
.mini-stats > div { background: var(--surface-2); border: 1px solid var(--line); border-radius: 10px; padding: 8px 12px; min-width: 0; }
.mini-stats > div > span { display: block; font-size: 11.5px; color: var(--text-2); font-weight: 500; }
.mini-stats b { display: block; font-size: 16px; margin-top: 4px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mini-stats em { display: block; font-style: normal; font-size: 11px; color: var(--text-3); margin-top: 2px; line-height: 1.35; }

/* =====================================================================================================
   v1.4 — Minimal refinement (Light & Dark)
   Principle: the numbers are the loudest thing on screen. Chrome recedes — neutral greys, hairlines instead of
   shadows, one surface per idea, sentence-case labels.
   ===================================================================================================== */
/* Dark ("night desk"): three clear depths — sidebar darkest, page, then cards — hairline borders instead of grey
   lines, secondary text that passes contrast, and a profit green that's clearly not the brand mint. */
:root, :root[data-theme="dark"] {
  --bg: #111215; --bg-2: #141519;
  --surface: #18191d; --surface-2: #1e2025; --surface-3: #272930;
  --line: rgba(255, 255, 255, .085); --line-2: rgba(255, 255, 255, .05);
  --text: #eceef1; --text-2: #a9adb6; --text-3: #83878f;
  --accent: #8af0c6; --accent-2: #a6f5d4; --accent-soft: rgba(138, 240, 198, .09);
  --pos: #4fd17a; --pos-soft: rgba(79, 209, 122, .11);
  --neg: #f2685f; --neg-soft: rgba(242, 104, 95, .11);
  --up: #3fb96a; --down: #e85a51;
  --warn-soft: rgba(242, 166, 0, .10); --warn-line: rgba(242, 166, 0, .30);
  --shadow: inset 0 1px 0 rgba(255, 255, 255, .035), 0 1px 2px rgba(0, 0, 0, .25);
  --card-top: rgba(255, 255, 255, .012); --sidebar: #0c0d0f;
  --radius: 16px; --r-ctl: 9px;
  --ring: 0 0 0 3px rgba(138, 240, 198, .26);
  --on-accent: #04261a;
}
:root[data-theme="light"] {
  --bg: #f7f7f8; --bg-2: #f1f1f3;
  --surface: #ffffff; --surface-2: #f6f6f8; --surface-3: #eeeef1;
  --line: #e6e7eb; --line-2: #efeff2;
  --text: #111217; --text-2: #5c606b; --text-3: #989ba5;
  --pos: #0f8a43; --pos-soft: #e8f5ee; --neg: #d63f3f; --neg-soft: #fcecec;
  --shadow: 0 1px 2px rgba(17, 18, 23, .035); --card-top: transparent; --sidebar: #f7f7f8;
  --ring: 0 0 0 3px rgba(10, 92, 68, .22);
  --on-accent: #ffffff;
}
body { font-feature-settings: "cv02", "cv03", "cv04", "cv11", "calt"; letter-spacing: -.003em; }
.kpi .value, td.n, th.n, .mini-stats b, .num, .pnl { font-variant-numeric: tabular-nums; }

/* ---- type ---- */
.page-head { margin-bottom: 24px; align-items: flex-end; }
.page-head h1 { font-size: 26px; font-weight: 500; letter-spacing: -.03em; }
.page-head p { color: var(--text-3); font-size: 13px; margin-top: 6px; }
.card-head { margin-bottom: 16px; }
.card-head h2 { font-size: 14px; font-weight: 500; letter-spacing: -.01em; }
.card-head p { color: var(--text-3); font-size: 12.5px; margin-top: 4px; }
th, .cal .dow, .nb-sec, .nb-kicker, .rte-pop-h { text-transform: none; letter-spacing: 0; }
th { font-size: 12px; font-weight: 500; color: var(--text-3); border-bottom-color: var(--line); }

/* ---- surfaces: one hairline, no drop shadows ---- */
.card { background: var(--surface); border-color: var(--line-2); box-shadow: var(--shadow); padding: 20px 24px; }
:root[data-theme="light"] .card { border-color: var(--line); }
.grid { gap: 16px; }
.kpi { background: var(--surface); box-shadow: var(--shadow); border-color: var(--line-2); }
.kpi .label { color: var(--text-2); font-weight: 500; }
.kpi .value { font-weight: 500; letter-spacing: -.025em; }
.kpi .sub { color: var(--text-3); }
.card .kpi { background: var(--surface-2); border-color: transparent; box-shadow: none; }

/* headline numbers: one strip split by hairlines instead of a row of separate boxes */
#view > .kpis { gap: 0; background: var(--surface); border: 1px solid var(--line-2); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); grid-template-columns: repeat(auto-fit, minmax(158px, 1fr)); margin-bottom: 16px; }
:root[data-theme="light"] #view > .kpis { border-color: var(--line); }
#view > .kpis > .kpi { background: transparent; border: 0; border-radius: 0; box-shadow: -1px 0 0 var(--line-2), 0 -1px 0 var(--line-2); padding: 16px 20px 16px; }
:root[data-theme="light"] #view > .kpis > .kpi { box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); }
#view > .kpis > .kpi .value { font-size: clamp(20px, 1.55vw, 26px); margin-top: 8px; }

/* ---- chrome ---- */
.sidebar { background: var(--sidebar); border-right-color: var(--line-2); }
:root[data-theme="light"] .sidebar { border-right-color: var(--line); }
nav a { padding: 8px 12px; border-radius: var(--r-ctl); font-weight: 500; color: var(--text-2); }
nav a:hover { background: var(--surface-2); }
nav a.active { background: var(--surface-3); color: var(--text); }
nav a.active::before { display: none; }
nav a .ni { opacity: .85; }
nav a.active .ni { color: var(--accent); opacity: 1; }
:root[data-theme="light"] nav a.active { background: var(--surface); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(17, 18, 23, .05); }
.topbar { background: color-mix(in srgb, var(--bg) 82%, transparent); border-bottom-color: var(--line-2); }
:root[data-theme="light"] .topbar { border-bottom-color: var(--line); }

/* ---- controls ---- */
.btn { border-radius: var(--r-ctl); background: var(--surface); border-color: var(--line); font-weight: 500; }
.btn:hover { background: var(--surface-2); border-color: var(--line); }
:root[data-theme="light"] .btn:not(.primary):not(.ghost):not(.claude) { box-shadow: 0 1px 1px rgba(17, 18, 23, .04); }
.btn.primary:hover { filter: none; }
.seg { background: var(--surface-2); border-color: transparent; border-radius: 10px; }
:root[data-theme="light"] .seg { background: var(--surface-3); }
.seg button { border-radius: 8px; font-weight: 500; }
.seg button.on { background: var(--surface-3); box-shadow: none; }
:root[data-theme="light"] .seg button.on { background: var(--surface); box-shadow: 0 1px 2px rgba(17, 18, 23, .08), 0 0 0 1px rgba(17, 18, 23, .03); }
select, input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time], input[type=search], textarea {
  border-radius: var(--r-ctl); background-color: var(--surface); border-color: var(--line); }
select:hover, input:hover, textarea:hover { border-color: color-mix(in srgb, var(--line) 60%, var(--text-3)); }
.chip { border-radius: 999px; }

/* ---- tables ---- */
td { border-bottom-color: var(--line-2); }
tbody tr.click:hover td { background: var(--surface-2); }
.table-wrap { border-color: var(--line-2); box-shadow: var(--shadow); }
:root[data-theme="light"] .table-wrap { border-color: var(--line); }

/* ---- quiet scrollbars ---- */
* { scrollbar-width: thin; scrollbar-color: color-mix(in srgb, var(--text-3) 45%, transparent) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--text-3) 38%, transparent); border-radius: 10px; border: 3px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background-color: color-mix(in srgb, var(--text-3) 60%, transparent); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { transition: none !important; animation: none !important; } }

/* ---------- appearance switch: Light | Dark ---------- */
.theme-box { display: flex; flex-direction: column; gap: 6px; margin-bottom: 8px; }
.theme-seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2px; padding: 4px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--line); }
.theme-seg button { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 6px 4px; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-3); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; }
.theme-seg button svg { width: 15px; height: 15px; flex: none; }
.theme-seg button:hover { color: var(--text); }
.theme-seg button.on { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .18); }
:root[data-theme="light"] .theme-seg button.on { background: #fff; box-shadow: 0 1px 3px rgba(16, 24, 40, .12); }
  background: var(--surface-2); color: var(--text-2); font: inherit; font-size: 12px; font-weight: 500; cursor: pointer; text-align: left; }
  box-shadow: 0 1px 3px rgba(0, 0, 0, .3); transition: transform .18s; }

/* =====================================================================================================
   v1.5 — 88 Executes brand: logo lockup, Geist, mint accent
   ===================================================================================================== */
.brand { display: block; padding: 4px 8px 24px; text-decoration: none; }
.brand:hover { text-decoration: none; }
.brand-lockup { display: block; height: 62px; width: auto; max-width: 100%; object-fit: contain; object-position: left center; }
.brand-lockup.on-light { display: none; }
:root[data-theme="light"] .brand-lockup.on-dark { display: none; }
:root[data-theme="light"] .brand-lockup.on-light { display: block; }
body { font-feature-settings: "calt", "liga"; letter-spacing: -.005em; }
.kpi .value, td.n, th.n, .mini-stats b, .num, .pnl, .page-head h1 { font-feature-settings: "tnum"; }
.page-head h1 { font-weight: 500; letter-spacing: -.035em; }
.kpi .value { font-weight: 500; letter-spacing: -.03em; }
.card-head h2 { font-weight: 500; }
nav a { font-weight: 500; letter-spacing: -.005em; }
a { color: var(--accent); }
:root[data-theme="light"] a { color: var(--accent); }

/* ---------- v1.5 customisable dashboard ---------- */
.tiles .tile { position: relative; display: flex; flex-direction: column; }
.tiles .tile .label { align-items: center; gap: 6px; }
.tile-gear { display: inline-grid; place-items: center; width: 24px; height: 24px; margin: -4px -6px -4px 0; border: 0; border-radius: 8px;
  background: transparent; color: var(--text-3); cursor: pointer; opacity: 0; transition: opacity .12s, background .12s, color .12s; flex: none; }
.tile:hover .tile-gear, .widget:hover .tile-gear, .tile-gear:focus-visible, .editing .tile-gear { opacity: 1; }
.tile-gear:hover { background: var(--surface-3); color: var(--text); }
.tile-gear:focus-visible { outline: none; box-shadow: var(--ring); }
@media (hover: none) { .tile-gear { opacity: .8; } }
.tile .meter { margin-top: auto; padding-top: 0; }
.tile.s-line .sub { margin-bottom: 12px; }
.tile.s-trend .spark { display: block; width: 100%; height: 38px; margin-top: 12px; }
.tile.s-gauge { align-items: stretch; }
.tile.s-gauge .sub { text-align: center; margin-top: 2px; }
.halfpie { position: relative; width: 100%; max-width: 168px; margin: 6px auto 0; }
.halfpie svg { display: block; width: 100%; height: auto; overflow: visible; }
.halfpie-c { position: absolute; left: 0; right: 0; bottom: 2px; text-align: center; line-height: 1.1; }
.halfpie-c .value { margin: 0; font-size: clamp(17px, 1.3vw, 22px); }
.halfpie-c .sub { margin: 2px 0 0; }
.tile-x { position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line); background: var(--surface);
  color: var(--text-2); font-size: 11px; cursor: pointer; display: grid; place-items: center; z-index: 3; }
.tile-x:hover { color: var(--neg); border-color: var(--neg); }
.editing .tile .tile-gear { margin-right: 24px; }
.tile-add, .widget-add { border: 1.5px dashed var(--line); background: transparent; color: var(--text-3); font: inherit; font-weight: 500; cursor: pointer;
  border-radius: 12px; min-height: 90px; transition: color .12s, border-color .12s, background .12s; }
.tile-add { margin: 12px; }
.tile-add:hover, .widget-add:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
.dash-hint { margin: -8px 0 16px; color: var(--text-3); font-size: 12.5px; }
.editing .tile { cursor: grab; }
.editing .tile:hover { background: var(--surface-2); }
.tile.dragging, .widget.dragging { opacity: .35; }

.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 16px; align-items: stretch; }
.widget { grid-column: span 6; display: flex; flex-direction: column; }
.widget.w-4 { grid-column: span 4; } .widget.w-6 { grid-column: span 6; } .widget.w-8 { grid-column: span 8; } .widget.w-12 { grid-column: span 12; }
.widget .w-body { flex: 1; min-width: 0; }
.widget .card-head > div:first-child { display: block; min-width: 0; }
.widget .card-head .row { flex-wrap: nowrap; }
.widget-add { grid-column: span 4; min-height: 160px; }
.editing .widget { outline: 1.5px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: 3px; cursor: grab; }
.editing .widget .w-body { pointer-events: none; }
.grip { display: inline-grid; place-items: center; color: var(--text-3); margin: 0 6px 0 -4px; vertical-align: -2px; }
.widget .card-head h2 { display: inline; }
.widget .card-head p { display: block; }
@media (max-width: 1180px) { .widget.w-4, .widget.w-6, .widget-add { grid-column: span 6; } .widget.w-8, .widget.w-12 { grid-column: span 12; } }
@media (max-width: 820px) { .dash-grid > * { grid-column: span 12 !important; } }

.dash-pop { position: fixed; z-index: 60; width: 270px; padding: 12px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .28), 0 2px 6px rgba(0, 0, 0, .12); animation: popIn .12s ease-out; }
:root[data-theme="light"] .dash-pop { box-shadow: 0 16px 40px rgba(17, 18, 23, .12), 0 2px 6px rgba(17, 18, 23, .06); }
.pop-h { font-size: 12px; color: var(--text-3); font-weight: 500; margin: 2px 0 6px; }
.pop-h:not(:first-child) { margin-top: 12px; }
.pop-seg { display: flex; width: 100%; }
.pop-seg button { flex: 1; }
.dash-pop select { width: 100%; }
.pop-row { display: flex; gap: 6px; margin-top: 16px; flex-wrap: wrap; }
.pop-row .danger { margin-left: auto; }
.pop-note { margin: 6px 0 0; font-size: 12px; color: var(--text-3); }
@keyframes popIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 12px; }
.g-item { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; text-align: left; padding: 12px 16px; border-radius: 12px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; cursor: pointer; transition: border-color .12s, background .12s; }
.g-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.g-item.used { opacity: .6; }
.g-t { font-weight: 500; }
.g-v { font-size: 18px; font-weight: 500; letter-spacing: -.02em; font-feature-settings: "tnum"; }
.g-d { font-size: 12px; color: var(--text-3); line-height: 1.4; }

.hm { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 4px; }
.hm-days, .hm-col { display: grid; grid-template-rows: 16px repeat(5, 24px); gap: 4px; flex: 1; min-width: 22px; }
.hm-days { flex: none; min-width: 30px; font-size: 11px; color: var(--text-3); }
.hm-days span { display: flex; align-items: center; height: 100%; }
.hm-wk { font-size: 10.5px; color: var(--text-3); white-space: nowrap; font-feature-settings: "tnum"; }
.hm-c { display: block; height: 24px; border-radius: 4px; background: color-mix(in srgb, var(--c) calc(var(--a) * 100%), var(--surface-2)); }
a.hm-c:hover { outline: 2px solid var(--text-3); outline-offset: 1px; }
.hm-c.empty { background: var(--surface-2); }
.hm-key { display: flex; align-items: center; gap: 4px; justify-content: flex-end; margin-top: 12px; font-size: 11.5px; color: var(--text-3); }
.hm-key span { margin: 0 4px; }
.hm-key i { width: 14px; height: 14px; border-radius: 4px; background: color-mix(in srgb, var(--c) calc(var(--a) * 100%), var(--surface-2)); }
.hm-key i.z { background: var(--surface-2); }

.wl { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.wl .halfpie { max-width: 240px; }
.wl .halfpie-c .value { font-size: 28px; font-weight: 500; letter-spacing: -.03em; }
.wl-legend { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; font-size: 12.5px; color: var(--text-2); }
.wl-legend div { display: flex; align-items: center; gap: 6px; }
.wl-legend i { width: 9px; height: 9px; border-radius: 4px; }
.wl-legend b { color: var(--text); margin-left: 2px; font-feature-settings: "tnum"; }

.ls { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ls-col { padding: 16px 16px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.ls-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.ls-col .value { font-size: 22px; font-weight: 500; letter-spacing: -.03em; margin-bottom: 12px; font-feature-settings: "tnum"; }
.ls-stats { display: flex; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font-size: 12px; color: var(--text-3); }
.ls-stats b { color: var(--text); font-weight: 500; }

/* ---------- v1.5 collapsible settings ---------- */
.settings-grid { align-items: start; }
.settings-grid > .card { padding-top: 6px; padding-bottom: 6px; }
.sec-head { cursor: pointer; margin: 0 -24px !important; padding: 16px 24px; border-radius: 0; user-select: none; }
.sec-head + .sec-body { padding: 2px 0 16px; }
.sec-head + .sec-body + .sec-head { border-top: 1px solid var(--line-2); }
.sec-head:hover h2 { color: var(--accent); }
.sec-head:focus-visible { outline: none; box-shadow: inset 0 0 0 2px var(--accent); border-radius: 10px; }
.sec-head > div:first-child { display: grid; grid-template-columns: 22px 1fr; align-items: center; column-gap: 4px; }
.sec-head > div:first-child p { grid-column: 2; }
.sec-head .chev { color: var(--text-3); transition: transform .15s; transform: rotate(-90deg); }
.sec-head.open .chev { transform: none; color: var(--accent); }
.sec-head:not(.open) p { display: none; }
@media (prefers-reduced-motion: reduce) { .sec-head .chev { transition: none; } }
.widget { container-type: inline-size; }
@container (max-width: 440px) { .ls { grid-template-columns: 1fr; } }

/* ---------- v1.6 Settings › Note templates ---------- */
.settings-grid > .tpl-card { grid-column: 1 / -1; }
.tplm { display: grid; grid-template-columns: minmax(240px, 300px) minmax(0, 1fr); gap: 20px; align-items: start; }
.tplm-side { display: flex; flex-direction: column; gap: 12px; min-width: 0; position: sticky; top: 70px; }
.tplm-tools { display: flex; align-items: center; gap: 4px; }
.tplm-tools .spacer { flex: 1; }
.tplm-search { width: 100%; }
.tplm-list { display: flex; flex-direction: column; gap: 4px; max-height: 560px; overflow-y: auto; margin: 0 -4px; padding: 0 4px; }
.tplm-item { display: flex; flex-direction: column; gap: 4px; text-align: left; padding: 12px 12px; border-radius: 12px; border: 1px solid transparent;
  background: transparent; color: var(--text); font: inherit; cursor: pointer; transition: background .12s, border-color .12s; }
.tplm-item:hover { background: var(--surface-2); }
.tplm-item.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 40%, transparent); }
.tplm-item:focus-visible { outline: none; box-shadow: var(--ring); }
.tplm-name { font-weight: 500; font-size: 13.5px; }
.tplm-snip { font-size: 12px; color: var(--text-3); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tplm-meta { display: flex; flex-wrap: wrap; gap: 4px; }
.tplm-tag { font-size: 10.5px; font-weight: 500; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); }
.tplm-tag.def { background: var(--accent-soft); color: var(--accent); }
.tplm-empty { padding: 16px 12px; color: var(--text-3); font-size: 12.5px; }
.tplm-main { min-width: 0; }
.tplm-head { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.tplm-title { flex: 1; min-width: 0; font: inherit; font-size: 18px; font-weight: 500; letter-spacing: -.02em; color: var(--text);
  border: 1px solid transparent !important; background: transparent !important; box-shadow: none !important; padding: 6px 8px; margin-left: -8px; border-radius: 8px; }
.tplm-title:hover { border-color: var(--line) !important; }
.tplm-title:focus { border-color: var(--accent) !important; box-shadow: var(--ring) !important; }
.tplm-opts { display: flex; flex-wrap: wrap; gap: 12px 28px; align-items: flex-start; padding: 4px 0 16px; margin-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.tplm-defaults { display: flex; flex-direction: column; gap: 6px; }
.tplm-defaults .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.tplm-blank { padding: 40px 24px; text-align: center; border: 1.5px dashed var(--line); border-radius: 14px; color: var(--text-2); }
.tplm-blank b { display: block; color: var(--text); font-size: 15px; margin-bottom: 6px; }
.tplm-blank p { margin: 0 auto 16px; max-width: 420px; font-size: 13px; }
@media (max-width: 900px) { .tplm { grid-template-columns: 1fr; } .tplm-side { position: static; } }

/* ---------- v1.7 settings columns, report chart type ---------- */
.settings-grid { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }      /* one column of sections: no holes when one opens */
.settings-grid > .card[hidden] { display: none; }
.settings-grid .card { padding-top: 6px; padding-bottom: 6px; }
.cpop-shape { display: flex; width: 100%; margin-top: 6px; }
.cpop-shape button { flex: 1; }

/* ---------- v1.7 Import: platform picker ---------- */
.import-grid { align-items: start; }
.plat-pick { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; padding: 12px 12px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); cursor: default; }
.plat-pick-txt { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.plat-pick select { border: 0 !important; background-color: transparent !important; box-shadow: none !important; padding: 0 28px 0 0; font-weight: 500; font-size: 14px; color: var(--text); cursor: pointer; }
.plat-logo { width: 36px; height: 36px; flex: none; border-radius: 8px; display: grid; place-items: center; overflow: hidden;
  background: var(--surface); border: 1px solid var(--line); }
.plat-logo.has-img { background: #fff; padding: 4px; }
.plat-logo img { width: 100%; height: 100%; object-fit: contain; display: block; }
.plat-mono { font-size: 12px; font-weight: 500; letter-spacing: -.02em; color: var(--text-2); }
.plat-help-h { display: block; margin-bottom: 6px; }
.plat-steps { margin: 0; padding-left: 20px; display: grid; gap: 4px; line-height: 1.55; }
.plat-steps li::marker { color: var(--text-3); font-weight: 500; }

/* ---- v1.9: data folder & backups ---- */
.path-box { word-break: break-all; padding: 8px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); }
.path-box.dim { color: var(--text-3); font-family: inherit; }

/* playbook name + emoji */
.emoji-name { display: flex; gap: 8px; margin-top: 6px; }
.emoji-name input { flex: 1; }
.emoji-btn { width: 40px; flex: none; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2); font-size: 19px; line-height: 1; cursor: pointer; }
.emoji-btn:hover { border-color: var(--text-3); }
.emoji-btn.none { color: var(--text-3); font-size: 18px; }
.emoji-pop { margin-top: 8px; padding: 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); }
.emoji-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(34px, 1fr)); gap: 4px; }
.emoji-grid button { height: 34px; border: 0; border-radius: 8px; background: none; font-size: 19px; cursor: pointer; }
.emoji-grid button:hover, .emoji-grid button:focus-visible { background: var(--surface-2); }
.keep-row { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.keep-row input { width: 64px; padding: 4px 8px; }

/* accounts list */
.acct-list { display: flex; flex-direction: column; }
.acct-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.acct-row:last-child { border-bottom: 0; }
.btn.danger-text { color: var(--neg); }
.btn.danger-text:hover { background: var(--neg-soft, rgba(239, 68, 68, .1)); }

/* notebook: fold the list column */
.nb.list-folded { grid-template-columns: 230px 44px minmax(0, 1fr); }
.nb.list-folded .nb-list > :not(.nb-rail) { display: none; }
.nb-rail { display: flex; flex-direction: column; align-items: center; gap: 12px; width: 100%; height: 100%; padding: 16px 0; border: 0;
  background: none; color: var(--text-3); cursor: pointer; font: inherit; }
.nb-rail:hover { background: var(--surface-2); color: var(--text); }
.nb-rail span { writing-mode: vertical-rl; transform: rotate(180deg); font-size: 12.5px; font-weight: 500; letter-spacing: .01em; white-space: nowrap; }
.nb-list-head .nb-fold { margin-left: -6px; color: var(--text-3); }
.nb-list-head .nb-fold:hover { color: var(--text); }
.nb-list-head:has(.nb-fold) { justify-content: flex-start; }
.nb-list-head:has(.nb-fold) h3 { margin-right: auto; }
/* mid-size windows: folders are a bar across the top, so only the strip + the note share the row */
@media (max-width: 1450px) { .nb.list-folded { grid-template-columns: 44px minmax(0, 1fr); } }
@media (max-width: 980px) { .nb.list-folded { grid-template-columns: 1fr; } .nb-rail { flex-direction: row; height: auto; padding: 12px 16px; } .nb-rail span { writing-mode: horizontal-tb; transform: none; } }

/* settings: tags & note templates switcher */
.org-tabs { margin-top: 4px; }
.org-pane[hidden] { display: none; }

/* playbook Tag manager */
.tm-group { padding: 12px 0; border-top: 1px solid var(--line-2); }
.tm-head { gap: 12px; flex-wrap: wrap; margin-bottom: 8px; }
.tm-dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.tm-name { width: 180px; font-weight: 500; }
.tm-colors { display: flex; gap: 4px; margin-left: auto; }
.swatch { width: 18px; height: 18px; border-radius: 50%; border: 2px solid transparent; cursor: pointer; padding: 0; }
.swatch.on { border-color: var(--text); }
.tm-new { padding-top: 12px; border-top: 1px solid var(--line-2); gap: 12px; }

/* ---- v1.13: Filters panel ---- */
.fp-btn { gap: 6px; }
.fp-btn.active { border-color: var(--accent); color: var(--accent); }
.fp-n { display: inline-grid; place-items: center; min-width: 18px; height: 18px; padding: 0 4px; margin-left: 6px; border-radius: 8px;
  background: var(--accent); color: var(--on-accent); font-size: 11px; font-weight: 500; line-height: 1; }
.filters-on { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.filters-on i { width: 8px; height: 8px; border-radius: 50%; background: #e5484d; box-shadow: 0 0 0 3px rgba(229, 72, 77, .18); }
.fp-wrap { position: fixed; inset: 0; z-index: 60; }
.fp { position: fixed; width: min(720px, calc(100vw - 24px)); height: min(560px, calc(100vh - 90px)); display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 18px 50px rgba(0, 0, 0, .28); overflow: hidden; }
.fp-cols { display: grid; grid-template-columns: 190px minmax(0, 1fr); min-height: 0; flex: 1; }
.fp-nav { display: flex; flex-direction: column; gap: 2px; padding: 12px; border-right: 1px solid var(--line); background: var(--bg-2); overflow: auto; }
.fp-nav button { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid transparent; border-radius: 8px;
  background: none; color: var(--text-2); font: inherit; font-size: 13.5px; font-weight: 500; text-align: left; cursor: pointer; }
.fp-nav button:hover { background: var(--surface-2); color: var(--text); }
.fp-nav button.on { background: var(--surface); border-color: var(--accent); color: var(--text); }
.fp-nav button:focus-visible, .fp-tag:focus-visible, .fp-check input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fp-pane { padding: 16px 20px 20px; overflow: auto; }
.fp-pane h4 { margin: 16px 0 6px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.fp-pane h4:first-child { margin-top: 2px; }
.fp-check { display: flex; align-items: center; gap: 12px; padding: 4px 2px; font-size: 13.5px; cursor: pointer; color: var(--text); }
.fp-check input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.fp-sw { width: 9px; height: 9px; border-radius: 50%; margin-left: auto; }
.fp-help { margin: 0 0 12px; }
.fp-match { display: flex; align-items: center; gap: 12px; margin-bottom: 8px; }
.fp-group { margin-bottom: 12px; }
.fp-lbl { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 500; color: var(--text-2); margin-bottom: 6px; }
.fp-lbl i, .fp-pbname i { width: 8px; height: 8px; border-radius: 50%; }
.fp-pb { padding: 12px 0 2px; border-top: 1px solid var(--line-2); }
.fp-pbname { display: flex; align-items: center; gap: 8px; font-weight: 500; font-size: 13px; margin-bottom: 8px; }
.fp-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.fp-tag { display: inline-flex; align-items: center; gap: 4px; padding: 4px 12px; border: 1px solid var(--line); border-radius: 999px;
  background: var(--surface); color: var(--text-2); font: inherit; font-size: 12.5px; cursor: pointer; }
.fp-tag:hover { border-color: var(--text-3); color: var(--text); }
.fp-mark { font-size: 11px; font-weight: 500; width: 0; overflow: hidden; transition: width .1s; }
.fp-tag.in { background: color-mix(in srgb, var(--pos) 14%, transparent); border-color: color-mix(in srgb, var(--pos) 55%, transparent); color: var(--text); }
.fp-tag.in .fp-mark { width: 10px; color: var(--pos); }
.fp-tag.out { background: color-mix(in srgb, var(--neg) 12%, transparent); border-color: color-mix(in srgb, var(--neg) 50%, transparent); color: var(--text-2); text-decoration: line-through; }
.fp-tag.out .fp-mark { width: 10px; color: var(--neg); text-decoration: none; }
.fp-exc { display: flex; align-items: center; gap: 12px; }
.fp-exc input { width: 96px; }
.fp-foot { display: flex; align-items: center; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
@media (max-width: 640px) { .fp-cols { grid-template-columns: 1fr; } .fp-nav { flex-direction: row; overflow-x: auto; border-right: 0; border-bottom: 1px solid var(--line); } }

/* trade page: playbook tags */
.pb-tags { margin-top: 4px; padding-top: 4px; border-top: 1px solid var(--line-2); }
.xf-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 24px; padding: 12px 16px; margin-bottom: 16px; }
.xf-item { display: flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 500; color: var(--text-2); }
.xf-item input { width: 76px; padding: 4px 8px; }
.xf-note { margin-left: auto; }

/* playbook marker: a colour dot in front of the name (a name that starts with an emoji shows the emoji instead) */
.pb-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 8px; flex: none; vertical-align: 1px; }
.pill .pb-dot { width: 7px; height: 7px; margin-right: 4px; }
.fp-check .pb-dot, .fp-pbname .pb-dot { margin-right: 0; }
.fp-check span { display: inline-flex; align-items: center; gap: 8px; }

/* tab switches: the new content settles in, quickly and once */
@keyframes tab-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.tab-in { animation: tab-in .18s ease-out both; }
@media (prefers-reduced-motion: reduce) { .tab-in { animation: none; } }

/* ---- Edge Lab › Advanced statistics ---- */
.lab-tabs { margin-bottom: 16px; }
.adv-intro { margin: 0 0 16px; }
.adv-card { margin-bottom: 16px; }
.adv-lead { margin: 4px 0 16px; font-size: 13.5px; line-height: 1.55; color: var(--text-2); max-width: 85ch; }
.adv-lead b { color: var(--text); }
.adv-note { margin: 12px 0 0; max-width: 95ch; line-height: 1.5; }
.adv-kpis { margin: 4px 0 12px; }
.adv-table { width: 100%; margin-top: 12px; }
.adv-table td.pos { color: var(--pos); } .adv-table td.neg { color: var(--neg); }
.adv-table tr.faint td { opacity: .62; }
.adv-table tr.hl td { background: var(--surface-2); }
.adv-inputs { gap: 16px; flex-wrap: wrap; margin-bottom: 12px; }
.adv-inputs .field { width: 170px; }
.eff-bar { display: inline-block; width: 90px; height: 6px; border-radius: 4px; background: var(--surface-3); margin-right: 8px; vertical-align: middle; overflow: hidden; }
.eff-bar i { display: block; height: 100%; background: var(--accent); border-radius: 4px; }
.fx-table td.fx { width: 34%; min-width: 180px; }
.fx-track { position: relative; height: 16px; }
.fx-zero { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: var(--line); }
.fx-range { position: absolute; top: 6px; height: 4px; border-radius: 2px; background: var(--surface-3); }
.fx-bar { position: absolute; top: 4px; height: 8px; border-radius: 2px; }
.fx-bar.up { background: var(--pos); } .fx-bar.down { background: var(--neg); }
.adv-combos { margin-top: 16px; gap: 24px; }
.adv-combos h3 { margin: 0 0 8px; }
.combo-list { margin: 0; padding-left: 20px; }
.combo-list li { padding: 4px 0; border-bottom: 1px solid var(--line-2); font-size: 13px; }
.combo-list li > span:first-child { display: inline-block; width: calc(100% - 140px); vertical-align: top; }
.combo-list li .n { display: inline-block; width: 60px; text-align: right; font-weight: 500; }
.combo-list li .pos { color: var(--pos); } .combo-list li .neg { color: var(--neg); }
.combo-list li .small { display: inline-block; width: 72px; text-align: right; }

/* ===================== online journal: account, mentor mode, comments ===================== */
.link-btn { background: none; border: 0; padding: 0; color: var(--text-2); cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.link-btn:hover { color: var(--text); }
.link-btn.danger-text { color: var(--neg); }
.acct-box { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.acct-name { font-weight: 500; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 120px; }
.jswitch { display: grid; gap: 4px; margin-bottom: 6px; }
.jswitch select { width: 100%; }
nav a .nav-badge { margin-left: auto; min-width: 18px; height: 18px; padding: 0 4px; border-radius: 8px; background: var(--neg); color: #fff;
  font-size: 11px; font-weight: 500; display: inline-grid; place-items: center; }
nav a[hidden] { display: none; }
.view-banner { display: flex; align-items: center; gap: 12px; padding: 8px 16px; margin: 0 0 4px; background: var(--warn-soft);
  border: 1px solid var(--warn-line); border-radius: 12px; font-size: 13px; position: sticky; top: 8px; z-index: 30; }
.view-banner .vb-dot { width: 8px; height: 8px; border-radius: 50%; background: #f2a600; box-shadow: 0 0 0 3px rgba(242, 166, 0, .2); }
body.read-only .trade-side :is(input, select, textarea):disabled, body.read-only .trade-side [aria-disabled="true"] { opacity: .7; cursor: default; }
.rte.read-only .rte-body { cursor: default; }

.cm-card .cm-list { display: grid; gap: 12px; margin-bottom: 12px; }
.cm-thread { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; background: var(--surface-2); }
.cm { display: grid; gap: 4px; }
.cm.reply { margin: 12px 0 0 16px; padding-left: 12px; border-left: 2px solid var(--line); }
.cm-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.cm-head .spacer { flex: 1; }
.cm-role { font-size: 11px; font-weight: 500; color: var(--accent); background: var(--accent-soft); padding: 1px 8px; border-radius: 6px; }
.cm-body { line-height: 1.55; white-space: normal; overflow-wrap: anywhere; }
.cm-reply-btn { margin-top: 8px; }
.cm-new textarea, .cm-reply textarea { width: 100%; resize: vertical; min-height: 64px; margin-bottom: 8px; }
.cm-reply { margin-top: 12px; }
.cm-reply .row { justify-content: flex-end; gap: 6px; }
.cm-journal { margin-bottom: 16px; }
.cm-inbox-item { padding: 16px 0; border-top: 1px solid var(--line-2); }
.cm-inbox-item.unread .cm-inbox-head b::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--neg); margin-right: 8px; vertical-align: middle; }
.cm-inbox-head { margin-bottom: 8px; gap: 12px; }
.cm-new-pill { background: var(--neg-soft); color: var(--neg); }

.switch-row { display: flex; gap: 12px; align-items: flex-start; cursor: pointer; }
.switch-row input { position: absolute; opacity: 0; pointer-events: none; }
.switch { flex: none; width: 38px; height: 22px; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line); position: relative; transition: background .15s; margin-top: 2px; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
.switch-row input:checked + .switch { background: var(--accent); border-color: var(--accent); }
.switch-row input:checked + .switch::after { transform: translateX(16px); background: var(--on-accent); }
.switch-row input:focus-visible + .switch { outline: 2px solid var(--accent); outline-offset: 2px; }
.share-parts { display: grid; gap: 6px; margin-left: 52px; }
.share-parts.off { opacity: .5; }
@media (prefers-reduced-motion: reduce) { .switch, .switch::after { transition: none; } }
/* mentor view: hide everything that would edit the student's journal */
body.read-only .rte-bar, body.read-only .rte-tpls, body.read-only .btn.claude, body.read-only #pbTm,
body.read-only #tagsCard .coll-head .btn, body.read-only #del, body.read-only [data-act="history"] { display: none !important; }
body.read-only .trade-side .stars, body.read-only .trade-side [data-star] { pointer-events: none; }
nav a .nav-badge[hidden] { display: none; }

/* ===================== phones & small tablets ===================== */
.tabbar, .sheet-head, .scrim, .m-only { display: none; }
.tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }

@media (max-width: 820px) {
  :root { --tabbar-h: 60px; --safe-b: env(safe-area-inset-bottom, 0px); }
  body { display: block; font-size: 14px; }
  main { min-height: 100vh; padding-bottom: calc(var(--tabbar-h) + var(--safe-b)); }
  .m-only { display: revert; }
  .d-only { display: none !important; }

  /* bottom tab bar */
  .tabbar { display: grid; grid-template-columns: repeat(5, 1fr); position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar-h) + var(--safe-b)); padding: 0 max(6px, env(safe-area-inset-left)) var(--safe-b) max(6px, env(safe-area-inset-right));
    background: color-mix(in srgb, var(--sidebar) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
    border-top: 1px solid var(--line-2); margin: 0; }
  :root[data-theme="light"] .tabbar { border-top-color: var(--line); }
  .tabbar a, .tabbar button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; padding: 6px 2px 4px;
    margin: 0; border: 0; border-radius: 0; background: none; color: var(--text-3); font-size: 10.5px; font-weight: 500; cursor: pointer;
    position: relative; -webkit-tap-highlight-color: transparent; }
  .tabbar a:hover { background: none; text-decoration: none; }
  .tabbar svg { width: 23px; height: 23px; }
  .tabbar a.active, .tabbar button.active { color: var(--text); background: none; box-shadow: none; }
  .tabbar a.active svg, .tabbar button.active svg { color: var(--accent); }
  .tabbar a.active::before { display: none; }
  :root[data-theme="light"] .tabbar a.active, :root[data-theme="light"] .tabbar a:hover { background: none; box-shadow: none; }
  .tab-dot { position: absolute; top: 7px; left: calc(50% + 8px); width: 8px; height: 8px; border-radius: 50%; background: var(--neg);
    box-shadow: 0 0 0 2px var(--sidebar); }
  .tab-dot[hidden] { display: none; }

  /* the sidebar becomes the "More" sheet */
  .sidebar { position: fixed; left: 0; right: 0; bottom: 0; top: auto; z-index: 70; width: auto; height: auto; max-height: 86vh; overflow-y: auto;
    border-right: 0; border-top: 1px solid var(--line); border-radius: 16px 16px 0 0; padding: 6px 16px calc(16px + var(--safe-b));
    transform: translateY(105%); transition: transform .22s cubic-bezier(.2, .8, .2, 1); box-shadow: 0 -18px 50px rgba(0, 0, 0, .35);
    background: var(--surface); visibility: hidden; }
  body.menu-open .sidebar { transform: none; visibility: visible; }
  .scrim { display: block; position: fixed; inset: 0; z-index: 65; background: rgba(5, 7, 10, .5); }
  .scrim[hidden] { display: none; }
  .sheet-head { display: flex; align-items: center; gap: 8px; padding: 6px 2px 12px; position: relative; }
  .sheet-head b { font-size: 15px; }
  .sheet-grab { position: absolute; left: 50%; top: 0; width: 38px; height: 4px; border-radius: 2px; background: var(--line); transform: translateX(-50%); }
  .sheet-close { margin-left: auto; font-size: 15px; width: 36px; height: 36px; }
  .sidebar .brand { display: none; }
  .sidebar nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
  .sidebar nav a { margin: 0; padding: 12px; min-height: 48px; border: 1px solid var(--line-2); background: var(--surface-2); font-size: 14px; }
  .sidebar nav a.active { border-color: var(--accent); }
  .side-foot { padding: 16px 2px 0; margin-top: 12px; border-top: 1px solid var(--line-2); font-size: 13px; }
  .jswitch select { font-size: 16px; padding: 12px 12px; }

  /* top bar: only on pages with date filters; one scrollable row */
  .topbar { position: sticky; top: 0; min-height: 0; padding: 8px 12px; gap: 8px; padding-top: max(8px, env(safe-area-inset-top)); }
  .topbar:has(.topbar-title) { display: none; }
  #rangeSeg { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; flex: 1 1 100%; }
  #rangeSeg::-webkit-scrollbar { display: none; }
  #rangeSeg button { flex: none; padding: 8px 12px; }
  .topbar .spacer { display: none; }
  .topbar .filters-on { margin-right: auto; }
  .topbar input[type=date] { flex: 1; }
  .view-banner { position: sticky; top: 0; margin: 0; border-radius: 0; border-left: 0; border-right: 0; padding: 8px 12px;
    padding-top: max(8px, env(safe-area-inset-top)); font-size: 12.5px; }

  /* page frame */
  .view { padding: 16px 16px 28px; }
  .page-head { margin-bottom: 16px; gap: 12px; align-items: flex-start; }
  .page-head > div:first-child { min-width: 0; flex: 1 1 100%; }
  .page-head h1 { font-size: 23px; }
  .page-head .row { flex-wrap: wrap; gap: 8px; width: 100%; }
  .page-head .row input[type=search] { width: 100% !important; flex: 1 1 100%; }
  .card { padding: 16px; border-radius: 14px; }
  .card-head { flex-wrap: wrap; gap: 8px; }
  .btn { min-height: 38px; }
  .btn.sm { min-height: 32px; }
  .row { flex-wrap: wrap; }

  /* iOS zooms into any field under 16px: keep them at 16 */
  input[type=text], input[type=password], input[type=number], input[type=date], input[type=datetime-local], input[type=time],
  input[type=search], input:not([type]), select, textarea { font-size: 16px; }
  .rte-body { font-size: 16px; }

  /* numbers strip: two per row */
  .kpis, #view > .kpis, .kpis-6 { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
  #view > .kpis > .kpi { padding: 12px 16px; }
  .kpi .value, #view > .kpis > .kpi .value { font-size: 20px; }
  .kpi .sub { font-size: 11.5px; }

  /* tabs that don't fit scroll sideways instead of wrapping */
  .tabs, .seg:not(.fp-nav) { flex-wrap: nowrap; overflow-x: auto; max-width: 100%; scrollbar-width: none; }
  .tabs::-webkit-scrollbar, .seg::-webkit-scrollbar { display: none; }
  .tabs button, .seg button { flex: none; white-space: nowrap; }

  /* charts */
  .price-chart { height: 340px; }
  .price-chart.tall { height: 380px; }

  /* dialogs come up from the bottom */
  .modal-wrap { padding: 0; place-items: end stretch; }
  .modal, .modal.wide { width: 100%; max-height: 92vh; border-radius: 16px 16px 0 0; padding-bottom: var(--safe-b); }
  .fp { left: 0 !important; right: 0 !important; top: auto !important; bottom: 0 !important; width: 100% !important;
    height: min(88vh, 640px) !important; border-radius: 16px 16px 0 0; }

  /* Ask button sits above the tab bar; the panel takes the whole screen */
  .claude-fab { bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); right: 14px; padding: 12px 16px; }
  .claude-panel { width: 100vw; z-index: 80; padding-bottom: var(--safe-b); }
  .toast { bottom: calc(var(--tabbar-h) + var(--safe-b) + 14px); max-width: calc(100vw - 32px); }

  /* note editor: toolbar scrolls sideways, sticks to the top of the screen */
  .rte-bar, .nb .rte-bar { top: 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .rte-bar::-webkit-scrollbar { display: none; }
  .rte-group { flex: none; }

  /* trade page */
  .trade-head { flex-wrap: wrap; gap: 6px; }
  .trade-head h1 { font-size: 23px; }
  .trade-side .card, .trade-main .card { margin-bottom: 0; }
  .tf-row { flex-wrap: wrap; gap: 8px; }
  .legend-inline { flex-wrap: wrap; gap: 8px 12px; font-size: 11.5px; }

  /* notebook: folders become a sideways strip above the list */
  .nb { min-height: 0; border-radius: 14px; }
  .nb-side { flex-direction: row; flex-wrap: wrap; gap: 6px; padding: 12px 12px; align-items: center; }
  .nb, .nb.list-folded { grid-template-columns: minmax(0, 1fr); }
  .nb-search { width: auto; flex: 1 1 170px; margin: 0; }
  .nb-list { max-height: 300px; border-right: 0 !important; border-bottom: 1px solid var(--line); }
  .nb-rail { flex-direction: row; height: auto; padding: 12px 16px; }
  .nb-rail span { writing-mode: horizontal-tb; transform: none; }
  .nb-stats { grid-template-columns: repeat(3, minmax(0, 1fr)); }

  /* Ask: a round button above the tab bar, so it covers less of the page */
  .claude-fab { width: 52px; height: 52px; padding: 0; justify-content: center; border-radius: 50%; }
  .claude-fab span { display: none; }
  .claude-fab svg { width: 20px; height: 20px; }

  /* settings & reports grids */
  .settings-grid { grid-template-columns: 1fr !important; }
  .form-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .field[style*="grid-column"] { grid-column: auto !important; }

  /* calendar: five narrow days; the week total becomes a strip under each week */
  .cal { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 4px; }
  .cal .dow:nth-child(6) { display: none; }
  .cal .dow { font-size: 10.5px; text-align: center; }
  .cal .cell { min-height: 58px; padding: 4px 4px 6px; border-radius: 8px; }
  .cal .cell .d { font-size: 11px; }
  .cal .cell .nb-link { display: none; }
  .cal .cell .p { font-size: 11.5px; letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: clip; }
  .cal .cell .t { display: none; }
  .cal .cell.week { grid-column: 1 / -1; min-height: 0; flex-direction: row; align-items: center; gap: 12px; padding: 6px 12px; margin-bottom: 6px; }
  .cal .cell.week .d { flex: none; }
  .cal .cell.week .p { margin: 0 0 0 auto; font-size: 13px; }
  .cal .cell.week .t { display: block; }
  .cal .cell.week .nb-link { display: inline-flex; opacity: 1; }

  /* trade rows become two-line cards */
  table.trades-table thead { display: none; }
  table.trades-table, table.trades-table tbody { display: block; }
  tr.trow { display: grid; grid-template-columns: auto auto minmax(0, 1fr) auto; grid-template-areas: "sym side . pnl" "date date date r" "tags tags tags grade";
    align-items: center; gap: 4px 8px; padding: 12px 12px; border-bottom: 1px solid var(--line-2); }
  table.trades-table tr.trow { grid-template-columns: 26px auto auto minmax(0, 1fr) auto;
    grid-template-areas: "sel sym side . pnl" "sel date date date r" "sel tags tags tags grade"; }
  tr.trow > td { display: block; padding: 0; border: 0; background: none !important; white-space: nowrap; }
  tr.trow > .c-sel { grid-area: sel; align-self: start; padding-top: 2px; }
  tr.trow > .c-sym { grid-area: sym; font-size: 14.5px; }
  tr.trow > .c-side { grid-area: side; }
  tr.trow > .c-pnl { grid-area: pnl; text-align: right; font-size: 14.5px; }
  tr.trow > .c-r { grid-area: r; text-align: right; font-size: 12px; }
  tr.trow > .c-date { grid-area: date; font-size: 12px; color: var(--text-2); }
  tr.trow > .c-tags { grid-area: tags; white-space: normal; min-width: 0; }
  tr.trow > .c-tags .note-preview { display: none; }
  tr.trow > .c-tags .tagline { white-space: normal; display: flex; flex-wrap: wrap; gap: 4px; overflow: visible; }
  tr.trow > .c-grade { grid-area: grade; text-align: right; font-size: 12px; }
  tr.trow > .c-x { display: none; }
  tr.trow.selected { background: var(--accent-soft); }
  .trades-table tr > td.empty { display: block; }
  #view .table-wrap:has(> .trades-table) { max-height: none !important; overflow: visible; }

  .page-head .btn-group { margin-left: auto; }
  .day-bottom { gap: 12px; }
}

@media (max-width: 380px) {
  .view { padding-left: 12px; padding-right: 12px; }
  .kpi .value, #view > .kpis > .kpi .value { font-size: 18px; }
  .tabbar a span, .tabbar button span { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) { .sidebar { transition: none; } }
.warn-text { color: var(--warn); font-weight: 500; }
.metric .m-name { display: none; }

/* ===================== phones: quieter, denser (1.16) =====================
   One type scale: 20 page title · 14 card title · 13 body · 12 meta · 11 labels. Chrome shrinks so content starts
   in the first quarter of the screen. Fields stay 16px where iOS would otherwise zoom on tap. */
@media (max-width: 640px) {
  body { font-size: 13px; }
  .view { padding: 12px 12px 24px; }

  /* top bar: one row (date range scrolls, Filters is an icon) */
  .topbar { flex-wrap: nowrap; padding: 6px 12px; gap: 6px; padding-top: max(6px, env(safe-area-inset-top)); }
  #rangeSeg { flex: 1 1 auto; min-width: 0; padding: 2px; }
  #rangeSeg button { padding: 4px 8px; font-size: 12px; }
  .topbar .filters-on { display: none; }
  .topbar #fClear { padding: 4px 8px; font-size: 12px; min-height: 30px; flex: none; }
  .topbar .fp-btn { flex: none; min-height: 30px; padding: 4px 8px; }
  .topbar .fp-btn .fp-label { display: none; }
  .topbar input[type=date] { min-width: 0; }

  /* page headings */
  .page-head { margin-bottom: 12px; gap: 8px; }
  .page-head h1 { font-size: 20px; letter-spacing: -.02em; }
  .page-head p { font-size: 12px; margin-top: 4px; line-height: 1.4; }
  .page-head .row { gap: 6px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .page-head .row::-webkit-scrollbar { display: none; }
  .page-head .row > * { flex: none; }
  .page-head .row input[type=search] { flex: 1 1 100%; min-width: 0; }
  .page-head .btn { min-height: 32px; padding: 4px 12px; font-size: 12.5px; }
  .page-head .check { font-size: 12.5px; white-space: nowrap; }
  #view .page-head:has(input[type=search]) .row { flex-wrap: wrap; overflow: visible; }

  /* cards */
  .card { padding: 12px 16px; border-radius: 12px; }
  .card-head { margin-bottom: 12px; }
  .card-head h2 { font-size: 14px; }
  .card-head p { font-size: 12px; margin-top: 2px; }
  .btn { font-size: 13px; min-height: 34px; padding: 6px 12px; }
  .btn.sm { font-size: 12px; min-height: 30px; padding: 4px 12px; }
  .small, .small.dim { font-size: 12px; }
  .field { font-size: 12px; gap: 4px; }
  .pill { font-size: 11px; padding: 2px 8px; }
  td, th { font-size: 12.5px; }
  th { font-size: 11px; }

  /* numbers strip */
  #view > .kpis { gap: 6px; }
  #view > .kpis > .kpi, .kpi { padding: 12px 12px; border-radius: 12px; }
  .kpi .label { font-size: 11px; }
  .kpi .value, #view > .kpis > .kpi .value { font-size: 18px; letter-spacing: -.02em; }
  .kpi .sub { font-size: 11px; line-height: 1.35; }

  /* tabs */
  .tabs { margin-bottom: 12px; gap: 2px; }
  .tabs button { font-size: 13px; padding: 8px 12px; }
  .seg button { font-size: 12px; padding: 4px 12px; }

  /* tab bar */
  :root { --tabbar-h: 54px; }
  .tabbar svg { width: 21px; height: 21px; }
  .tabbar a span, .tabbar button span { font-size: 10px; }

  /* trade cards */
  tr.trow { padding: 8px 12px; gap: 2px 8px; }
  tr.trow > .c-sym, tr.trow > .c-pnl { font-size: 13.5px; }
  tr.trow > .c-date, tr.trow > .c-r, tr.trow > .c-grade { font-size: 11.5px; }

  /* Reports › Performance: each metric is a small chip; tap it for the native picker */
  .metric-bar { gap: 6px; margin-bottom: 6px; }
  .metric { position: relative; padding: 0 4px 0 8px; gap: 4px; height: 28px; border-radius: 8px; }
  .metric i { height: 12px; }
  .metric .m-name { display: block; font-size: 12px; font-weight: 500; max-width: 38vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .metric .m-name::after { content: " ▾"; color: var(--text-3); font-size: 10px; }
  .metric select { position: absolute; inset: 0; width: 100%; max-width: none; opacity: 0; font-size: 16px; padding: 0; }
  .metric .gear { display: none; }
  .metric .x { position: relative; z-index: 1; padding: 0 4px; font-size: 11px; }
  .add-metric { font-size: 12.5px; padding: 4px 2px; }
  .metric-bar > select { height: 28px; padding: 2px 24px 2px 8px; border-radius: 8px; }
  .chart-box.tall { height: 260px; }
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .summary-grid .v { font-size: 15px; }
  .summary-grid .k { font-size: 11px; }

  /* calendar & day */
  .cal-head h2, .cal-title { font-size: 16px; }

  /* trade page */
  .trade-head h1 { font-size: 20px; }
  .stat-hero .hero { font-size: 26px; }

  /* sheets */
  .sidebar nav a { font-size: 13px; min-height: 44px; padding: 12px; }
  .modal h2, .modal-head h2 { font-size: 16px; }
}
@media (max-width: 640px) { .tile-gear { display: none !important; } }

/* ---------- chart drawing tools (1.16) ---------- */
.price-chart { position: relative; }
.dw-host { display: flex; min-width: 0; }
.dw-bar { display: flex; align-items: center; gap: 2px; padding: 2px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line-2);
  overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.dw-bar::-webkit-scrollbar { display: none; }
.dw-b { flex: none; display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 28px; min-width: 28px; padding: 0 6px;
  border: 0; border-radius: 8px; background: transparent; color: var(--text-2); cursor: pointer; font: inherit; font-size: 12px; }
.dw-b:hover:not(:disabled) { background: var(--surface-3); color: var(--text); }
.dw-b.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent); }
.dw-b:disabled { opacity: .35; cursor: default; }
.dw-b:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.dw-color i { width: 13px; height: 13px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface-2), 0 0 0 3px var(--line); }
.dw-sep { flex: none; width: 1px; height: 18px; background: var(--line); margin: 0 4px; }
.dw-pop { position: fixed; z-index: 90; display: grid; grid-template-columns: repeat(7, 22px); gap: 6px; padding: 8px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--line); box-shadow: 0 8px 24px rgba(0,0,0,.25); }
.dw-pop button { width: 22px; height: 22px; border-radius: 50%; border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px rgba(255,255,255,.15); }
.dw-pop button:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
.dw-input { position: absolute; z-index: 5; width: 180px; height: 28px; padding: 0 8px; border-radius: 8px; border: 1px solid var(--accent);
  background: var(--surface); color: var(--text); font: inherit; font-size: 13px; }
.dw-tool canvas { cursor: crosshair !important; }
.dw-tool { touch-action: none; }
.dw-hover canvas { cursor: move !important; }
.dc-tools { gap: 8px; flex-wrap: nowrap; min-width: 0; }
.card-head:has(.dc-tools) { flex-wrap: wrap; gap: 8px; }
.tf-row .dw-host { flex: 0 1 auto; }
@media (max-width: 640px) {
  .dw-b { height: 32px; min-width: 32px; }           /* finger-sized */
  .tf-row .dw-host { order: 3; flex-basis: 100%; }
  .tf-row .legend-inline { display: none; }
  .dc-tools { width: 100%; justify-content: space-between; }
  .dc-tools .dw-host { flex: 1 1 auto; }
}

/* ---------- Export PDF dialog (1.16) ---------- */
.pdf-form { display: flex; flex-direction: column; gap: 16px; }
.pdf-form .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); }
.pdf-form .field em { font-style: normal; }
.pdf-form textarea { resize: vertical; min-height: 64px; font: inherit; }
.pdf-secs { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.pdf-sec { display: flex; gap: 12px; align-items: flex-start; padding: 8px 12px; border: 1px solid var(--line); border-radius: 10px; cursor: pointer; }
.pdf-sec:has(input:checked) { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); background: var(--accent-soft); }
.pdf-sec.fixed { cursor: default; opacity: .85; }
.pdf-sec input { margin-top: 2px; accent-color: var(--accent); }
.pdf-sec b { display: block; font-size: 12.5px; font-weight: 500; color: var(--text); }
.pdf-sec span { display: block; font-size: 11.5px; color: var(--text-2); margin-top: 2px; line-height: 1.35; }
.pdf-dims { display: flex; flex-direction: column; gap: 6px; }
.pdf-dims[hidden] { display: none; }
#pdfBtn svg { margin-right: 2px; }
@media (max-width: 640px) {
  .pdf-secs { grid-template-columns: 1fr; }
  .pdf-form .grid.g2 { grid-template-columns: 1fr; }
  #pdfBtn span { display: none; }
}

/* ---------- phone logo (1.18) ---------- */
.m-brand { display: none; }
@media (max-width: 640px) {
  .m-brand { display: inline-flex; align-items: center; flex: none; height: 30px; padding-right: 2px; }
  .m-brand img { height: 26px; width: auto; }
  .topbar:has(.topbar-title) { display: flex; align-items: center; gap: 12px; }
  .topbar-title { font-size: 14px; color: var(--text); font-weight: 500; }
  #pdfBtn span { display: inline; }
}
.m-brand .on-light { display: none; }
:root[data-theme="light"] .m-brand .on-dark { display: none; }
:root[data-theme="light"] .m-brand .on-light { display: block; }

/* ---------- prop firm accounts (1.18) ---------- */
.pill.pos { background: var(--pos-soft); color: var(--pos); }
.pill.neg { background: var(--neg-soft); color: var(--neg); }
.pill.warn { background: var(--warn-soft); color: var(--warn, #c98f10); }
b.warn, .warn-text { color: var(--warn, #c98f10); }
.linkbtn { border: 0; background: none; padding: 0; font: inherit; color: var(--accent); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
.prop-sum { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.prop-list { display: grid; gap: 16px; }
.prop-card h2 { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.prop-card[data-st="breached"] { border-color: color-mix(in srgb, var(--neg) 45%, var(--line)); }
.prop-top { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: 28px; align-items: end; padding: 6px 0 20px; border-bottom: 1px solid var(--line-2); }
.prop-top .big { display: block; font-size: 28px; font-weight: 500; letter-spacing: -.03em; margin: 2px 0 4px; font-variant-numeric: tabular-nums; }
.prop-room .pbar { height: 8px; margin: 4px 0 8px; }
.pbar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; margin: 6px 0; }
.pbar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); transition: width .4s ease; }
.pbar.pos i { background: var(--pos); } .pbar.neg i { background: var(--neg); } .pbar.warn i { background: var(--warn, #c98f10); }
.prop-rows { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 20px 24px; padding: 16px 0; border-bottom: 1px solid var(--line-2); }
.prop-row b { font-size: 16px; font-variant-numeric: tabular-nums; }
.prop-chart { height: 340px; margin-top: 16px; }
.prop-ledger { margin-top: 12px; color: var(--text-2); }
.prop-note { max-width: 70em; margin-top: 16px; line-height: 1.5; }
.prop-fs { border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px 16px; margin: 0; }
.prop-fs legend { padding: 0 6px; font-size: 12.5px; font-weight: 500; color: var(--text); }
.prop-fs legend em { font-style: normal; font-weight: 400; margin-left: 6px; }
.prop-dd { flex-wrap: wrap; }
.prop-form .field em { font-style: normal; }
.prop-add { grid-template-columns: 1.1fr .9fr .9fr 1.6fr auto; gap: 12px; align-items: end; }
.table-wrap tr.tot td { border-top: 1px solid var(--line); }
@media (max-width: 640px) {
  .prop-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prop-top { grid-template-columns: 1fr; gap: 16px; }
  .prop-top .big { font-size: 24px; }
  .prop-add { grid-template-columns: 1fr 1fr; }
  .prop-add .field:nth-child(4), .prop-add .btn { grid-column: 1 / -1; }
  .prop-chart { height: 260px; }
}

/* ---------- session plan (1.18) ---------- */
.plan-nav { gap: 6px; align-items: center; flex-wrap: wrap; }
.plan-nav input[type=date] { width: auto; }
.plan-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 16px; align-items: start; }
.plan-col { display: grid; gap: 16px; min-width: 0; }
.plan-col .field { display: flex; flex-direction: column; gap: 4px; font-size: 12px; color: var(--text-2); margin-top: 12px; }
.plan-col .card-head + .field { margin-top: 0; }
.plan-col textarea { resize: vertical; font: inherit; }
.zone-list { display: grid; gap: 8px; }
.zone { display: grid; grid-template-columns: 72px minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1.15fr) minmax(0, 1fr) 28px; gap: 6px; align-items: center; padding: 6px 6px 6px 12px;
  border-radius: 10px; background: var(--surface-2); border-left: 3px solid var(--zc, var(--text-3)); }
.zone input, .zone select { min-width: 0; font-size: 13px; padding: 6px 8px; }
.zone [data-f="note"] { grid-column: 1 / 6; }
.zone [data-delz] { grid-column: 6; grid-row: 1; }
.zone.ro { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 8px 12px; }
.zone.ro span { color: var(--text-2); font-size: 13px; }
.plan-chart { height: 360px; }
.plan-score { text-align: right; line-height: 1.1; flex: none; }
.plan-score b { display: block; font-size: 26px; font-weight: 500; letter-spacing: -.02em; }
.plan-score span { font-size: 11.5px; color: var(--text-3); }
.plan-checks { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 8px; margin-bottom: 12px; }
.plan-check { display: grid; grid-template-columns: 22px 1fr; gap: 8px; padding: 12px 12px; border-radius: 10px; background: var(--surface-2); }
.plan-check i { font-style: normal; font-weight: 500; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; }
.plan-check.ok i { background: var(--pos-soft); color: var(--pos); }
.plan-check.bad i { background: var(--neg-soft); color: var(--neg); }
.plan-check b { display: block; font-size: 13px; }
.plan-check span { font-size: 12px; color: var(--text-2); }
.plan-trades { display: grid; gap: 2px; border-top: 1px solid var(--line-2); }
.plan-trade { display: grid; grid-template-columns: auto 1fr auto auto; gap: 12px; align-items: center; padding: 8px 2px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: inherit; font-size: 13px; }
.plan-trade:hover { background: var(--surface-2); }
.game-seg button { min-width: 74px; }
.plan-mini { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
@media (max-width: 1100px) { .plan-grid { grid-template-columns: 1fr; } }
@media (max-width: 640px) {
  .zone { grid-template-columns: 1fr 1fr 28px; }
  .zone [data-f="root"] { grid-column: 1 / 3; grid-row: 1; }
  .zone [data-delz] { grid-column: 3; grid-row: 1; }
  .zone [data-f="lo"] { grid-column: 1; grid-row: 2; }
  .zone [data-f="hi"] { grid-column: 2 / 4; grid-row: 2; }
  .zone [data-f="kind"] { grid-column: 1; grid-row: 3; }
  .zone [data-f="side"] { grid-column: 2 / 4; grid-row: 3; }
  .zone [data-f="note"] { grid-column: 1 / -1; grid-row: 4; }
  .plan-chart { height: 280px; }
  .plan-trade { grid-template-columns: auto 1fr auto; }
  .plan-trade > span.small { grid-column: 2 / -1; grid-row: 2; }
}

/* ---------- trade cards (1.18) ---------- */
.card-maker { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 20px; align-items: start; }
.card-preview { background: var(--surface-2); border-radius: 12px; padding: 12px; display: grid; place-items: center; }
.card-preview img { max-width: 100%; max-height: 62vh; border-radius: 8px; box-shadow: 0 10px 30px -12px rgba(0,0,0,.35); }
.card-opts { display: flex; flex-direction: column; gap: 16px; }
.card-opts .field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); }
.card-opts .field em { font-style: normal; }
.card-opts .check { display: flex; gap: 8px; align-items: center; font-size: 13.5px; cursor: pointer; }
.card-opts .check input { accent-color: var(--accent); }
#cardBtn svg { margin-right: 2px; }
@media (max-width: 640px) {
  .card-maker { grid-template-columns: 1fr; }
  .card-preview img { max-height: 46vh; }
}

/* ---------- settings in grouped cards (1.19) ---------- */
.settings-grid { gap: 16px; }
.set-group { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius, 14px); box-shadow: var(--shadow); overflow: hidden; }
.set-group[hidden] { display: none; }
.set-group-head { display: flex; gap: 16px; align-items: center; padding: 20px 24px 16px; }
.set-group-head h2 { margin: 0; font-size: 16px; font-weight: 500; letter-spacing: -.01em; }
.set-group-head p { margin: 2px 0 0; font-size: 12.5px; color: var(--text-2); }
.set-group-ico { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.set-rows > .card { border: 0; border-top: 1px solid var(--line-2); border-radius: 0; box-shadow: none; background: transparent; margin: 0; }
.set-rows > .card::before { display: none; }
.sec-head > div:first-child:has(.sec-ico) { grid-template-columns: 22px 28px 1fr; }
.sec-head > div:first-child:has(.sec-ico) p { grid-column: 3; }
.sec-ico { display: grid; place-items: center; width: 22px; height: 22px; color: var(--text-2); }
.sec-head.open .sec-ico, .sec-head:hover .sec-ico { color: var(--accent); }
@media (max-width: 640px) {
  .set-group-head { padding: 16px 16px 12px; }
  .set-group-ico { width: 32px; height: 32px; border-radius: 8px; }
}

/* ---------- account menu, top right (1.19) ---------- */
.acct-btn { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 12px 0 4px; margin-left: auto; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 13px; font-weight: 500; cursor: pointer; }
.acct-btn:hover, .acct-btn[aria-expanded="true"] { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.acct-btn:not(:has(.acct-av)) { padding: 0; width: 34px; justify-content: center; color: var(--text-2); }
.acct-av { width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--accent); color: var(--on-accent, #fff);
  font-size: 11px; font-weight: 500; letter-spacing: .02em; }
.acct-av.lg { width: 38px; height: 38px; font-size: 14px; }
.acct-menu { position: fixed; z-index: 95; width: 270px; padding: 6px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 18px 40px -12px rgba(0,0,0,.35); }
.acct-menu-who { display: flex; gap: 12px; align-items: center; padding: 12px 12px 12px; border-bottom: 1px solid var(--line-2); margin-bottom: 4px; }
.acct-menu-who b { display: block; font-size: 14px; }
.acct-menu-who div span { display: block; font-size: 12px; color: var(--text-3); }
.acct-menu a, .acct-menu button { display: flex; align-items: center; gap: 12px; width: 100%; padding: 8px 12px; border-radius: 8px; border: 0; background: none;
  color: var(--text); font: inherit; font-size: 13.5px; text-decoration: none; cursor: pointer; text-align: left; }
.acct-menu a svg, .acct-menu button svg { color: var(--text-3); flex: none; }
.acct-menu a:hover, .acct-menu button:hover, .acct-menu a:focus-visible, .acct-menu button:focus-visible { background: var(--surface-2); outline: none; }
.acct-menu a:hover svg, .acct-menu button:hover svg { color: var(--accent); }
.acct-menu-foot { border-top: 1px solid var(--line-2); margin-top: 4px; padding-top: 4px; }
@media (max-width: 640px) {
  .acct-btn { height: 32px; padding: 0 4px; margin-left: auto; }
  .acct-menu { width: min(290px, calc(100vw - 16px)); }
}

/* ---------- people: features (1.19) ---------- */
.person-row { cursor: pointer; border-radius: 10px; }
.person-row:hover { background: var(--surface-2); }
.person-row[aria-expanded="true"] { background: var(--surface-2); }
.person-features { margin: 2px 0 12px; padding: 16px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); }
.chip.static { cursor: default; }
.feat-row { display: grid; grid-template-columns: 1fr auto auto; gap: 16px; align-items: center; padding: 12px 2px; border-top: 1px solid var(--line-2); cursor: pointer; }
.feat-row b { display: block; font-size: 13.5px; }
.feat-row em { display: block; font-style: normal; margin-top: 1px; }
.feat-state { font-size: 12px; font-weight: 500; color: var(--pos); }
.feat-row.off .feat-state { color: var(--text-3); }
.feat-row.off b { color: var(--text-2); }
.fswitch { position: relative; width: 38px; height: 22px; flex: none; }
.fswitch input { position: absolute; inset: 0; opacity: 0; margin: 0; cursor: pointer; z-index: 1; }
.fswitch i { position: absolute; inset: 0; border-radius: 12px; background: var(--surface-3); border: 1px solid var(--line); transition: background .15s; }
.fswitch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: var(--text-2); transition: transform .15s, background .15s; }
.fswitch input:checked + i { background: var(--accent); border-color: var(--accent); }
.fswitch input:checked + i::after { transform: translateX(16px); background: var(--on-accent, #fff); }
.fswitch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }
.locked-card .lock-ico { display: grid; place-items: center; width: 46px; height: 46px; margin: 0 auto 12px; border-radius: 50%; background: var(--surface-2); color: var(--text-2); }
.sec-head { scroll-margin-top: 76px; }

/* ---------- market data, organised (1.19) ---------- */
.md { display: grid; grid-template-columns: minmax(0, 1fr); gap: 16px; margin-bottom: 12px; min-width: 0; }
.md-block { min-width: 0; }
.md-block select, .md-block input[type=password] { width: 100%; max-width: 100%; min-width: 0; }
.md-block { border: 1px solid var(--line); border-radius: 12px; padding: 16px 16px; background: var(--surface); }
.md-block h3 { margin: 0 0 12px; font-size: 12.5px; font-weight: 500; color: var(--text-2); }
.md-block > .field { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); }
.md-keys { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.md-key { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.md-key-head { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.md-key-head b { font-size: 13px; }
.md-key-row { display: flex; gap: 6px; margin-top: 4px; }
.md-key-row input { flex: 1; min-width: 0; }
.toggle-list { display: grid; }
.toggle-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 16px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line-2); cursor: pointer; }
.md-block h3 + .toggle-row, .toggle-list > .toggle-row:first-child { border-top: 0; padding-top: 2px; }
div.toggle-row { cursor: default; }
.toggle-row b { display: block; font-size: 13.5px; font-weight: 500; }
.toggle-row em { display: block; font-style: normal; font-size: 12px; color: var(--text-3); margin-top: 2px; line-height: 1.4; max-width: 60ch; }
.toggle-row.sub { padding-left: 20px; border-left: 2px solid var(--line); margin-left: 2px; }
.toggle-row.off b { color: var(--text-3); }
.toggle-row.off .fswitch { opacity: .45; }
.md-block .toggle-row select { width: auto; min-width: 140px; }
.md-money { display: inline-flex; align-items: center; gap: 4px; color: var(--text-2); font-weight: 500; }
.md-money input { width: 90px; text-align: right; }
.md-note { margin: 0 0 12px; max-width: 90ch; }
@media (max-width: 640px) {
  .md-keys { grid-template-columns: 1fr; }
  .md-block { padding: 12px; }
  .md-block .toggle-row select { min-width: 0; max-width: 128px; }
  .md-key-head .pill { font-size: 11px; }
}

/* 1.20 two-step sign-in in Settings › Your account */
.mfa-step { margin-top: 12px; }
.mfa-steps { margin: 0 0 12px; padding-left: 20px; color: var(--text-2); line-height: 1.6; font-size: 13px; }
.mfa-qr { background: #fff; border-radius: 12px; padding: 12px; width: fit-content; margin: 4px 0 12px; }
.mfa-qr svg { display: block; width: 180px; height: 180px; }
.mfa-secret { font-family: var(--mono); font-size: 12.5px; word-break: break-all; background: var(--surface-2); border: 1px solid var(--line);
  border-radius: 10px; padding: 8px 12px; margin: 8px 0 4px; user-select: all; }
#mfaBox details { margin-bottom: 12px; }
#mfaBox .code-digits, #mfaDigits { font-family: var(--mono); letter-spacing: .3em; }

/* 1.21 Mentors page and "Are you a mentor?" */
.mt-search { display: flex; align-items: center; gap: 12px; padding: 4px 16px; margin-bottom: 20px; color: var(--text-3); }
.mt-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: 12px 0; font-size: 14px; color: var(--text); outline: none; box-shadow: none; }
.mt-search:focus-within { border-color: var(--accent); }
.mt-group { margin-bottom: 24px; }
.mt-group h2 { font-size: 13px; font-weight: 500; color: var(--text-2); margin: 0 0 8px; }
.mt-list { display: grid; gap: 12px; }
.mt-row { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 16px 16px; }
.mt-row.on { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
.mt-main { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 16px; align-items: center; }
.mt-av { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; font-weight: 500; font-size: 14px;
  background: var(--surface-3); color: var(--text); border: 1px solid var(--line); }
.mt-row.on .mt-av { background: var(--accent); color: var(--on-accent, #fff); border-color: var(--accent); }
.mt-name { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.mt-code { font-family: var(--mono); font-size: 11.5px; letter-spacing: .06em; color: var(--text-2); background: var(--surface-2);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 6px; }
.mt-bio { margin: 4px 0 0; color: var(--text-2); font-size: 13px; line-height: 1.45; }
.mt-share { display: flex; align-items: center; gap: 12px; cursor: pointer; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.mt-row.on .mt-share { color: var(--accent); font-weight: 500; }
.mt-detail { margin: 12px 0 0 56px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.mt-detail .mt-always { margin: 0 0 4px; line-height: 1.5; }
.mt-detail .toggle-row:first-of-type { border-top: 0; }
.mt-seen { margin: 8px 0 0; color: var(--text-2); }
.mentor-id { display: grid; grid-template-columns: auto auto 1fr; align-items: center; gap: 6px 16px; margin: 12px 0 16px;
  padding: 12px 16px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; }
.mentor-id > div { display: grid; gap: 2px; }
.mentor-id b { font-size: 20px; letter-spacing: .14em; }
.mentor-id p { grid-column: 1 / -1; margin: 0; }
@media (max-width: 640px) {
  .mt-main { grid-template-columns: auto minmax(0, 1fr); }
  .mt-share { grid-column: 1 / -1; justify-content: space-between; padding-top: 4px; }
  .mt-detail { margin-left: 0; }
  .mentor-id { grid-template-columns: 1fr auto; }
}

/* 1.22 plans */
.plan-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; padding: 2px 0 12px; margin-bottom: 12px; border-bottom: 1px solid var(--line-2); }
.plan-row > span { display: grid; gap: 2px; }
.plan-row em { font-style: normal; }
.plan-row label { display: flex; align-items: center; gap: 8px; color: var(--text-2); }
.no-ai .btn.claude, .no-ai .claude-fab, .no-ai .claude-panel { display: none !important; }

/* 1.23 Students page (mentors), Ask Mentor, share scope */
.st-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.st-card { display: grid; gap: 12px; padding: 16px 20px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px;
  color: inherit; text-decoration: none; transition: border-color .15s, transform .15s; }
.st-card:hover { border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.st-card:focus-visible { outline: none; box-shadow: var(--ring); }
.st-top { display: flex; align-items: center; gap: 12px; min-width: 0; }
.st-who { display: grid; gap: 2px; min-width: 0; }
.st-who b { font-size: 15px; }
.st-counts { display: flex; gap: 8px; flex-wrap: wrap; }
.st-counts span { font-size: 12.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 8px; padding: 4px 8px; }
.st-counts span.hot { color: var(--text); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.st-title { display: flex; align-items: center; gap: 12px; }
.st-tabs { margin: 0 0 16px; }
.st-tabs button[aria-selected="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.st-tabs .nav-badge { position: static; margin-left: 4px; }
.st-note { display: grid; grid-template-columns: 10px minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 16px 0; border-top: 1px solid var(--line-2); }
.st-note:first-child { border-top: 0; padding-top: 2px; }
.st-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; background: transparent; }
.st-note.new .st-dot { background: var(--accent); }
.st-note.done .st-note-body { opacity: .7; }
.st-quote { margin-top: 6px; padding: 8px 12px; border-left: 3px solid var(--line); background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--text-2); font-size: 13px; }
.st-acts { gap: 6px; flex-wrap: nowrap; }
.st-pane > .cm-inbox-item.card { padding: 16px 20px; margin-bottom: 12px; border-top: 1px solid var(--line); }
.ask-list .toggle-row:first-child { border-top: 0; }
.ask-history { margin-top: 16px; display: grid; gap: 8px; padding-top: 12px; border-top: 1px solid var(--line-2); }
.btn.ask-mentor svg { flex: none; }
.mt-scope { margin: 12px 0 2px; display: grid; gap: 8px; }
.mt-scope .seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.mt-dates { display: flex; gap: 12px; flex-wrap: wrap; align-items: end; }
.mt-dates .field { min-width: 150px; }
@media (max-width: 640px) {
  .st-note { grid-template-columns: 10px minmax(0, 1fr); }
  .st-acts { grid-column: 2; flex-wrap: wrap; }
}
.rv-btn { gap: 6px; }
.rv-btn.on { background: color-mix(in srgb, var(--pos) 16%, transparent); border-color: color-mix(in srgb, var(--pos) 55%, var(--line)); color: var(--pos); }
.st-note.done .st-dot { background: transparent; color: var(--pos); width: 14px; height: 14px; margin-top: 4px; margin-left: -4px; }
.st-note { grid-template-columns: 14px minmax(0, 1fr) auto; }
.pill.rv-again { margin-left: 6px; color: var(--warn, #d9a441); border-color: color-mix(in srgb, var(--warn, #d9a441) 45%, var(--line)); background: color-mix(in srgb, var(--warn, #d9a441) 12%, transparent); }
.again-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: start; padding: 12px 0; border-top: 1px solid var(--line-2); }
.again-row:first-of-type { border-top: 0; }
.seg button[aria-pressed="true"] { background: var(--surface-3); color: var(--text); box-shadow: 0 1px 2px rgba(0, 0, 0, .15); }
.rv-filter { gap: 12px; margin: 0 0 12px; align-items: center; flex-wrap: wrap; }
.st-pane .rv-filter { margin-top: 2px; }
.mt-open { color: inherit; text-decoration: none; border-radius: 8px; }
.mt-open:hover b { text-decoration: underline; text-underline-offset: 3px; }
.mt-open:focus-visible { outline: none; box-shadow: var(--ring); }
.mt-chip { font-size: 11.5px; color: var(--text-2); background: var(--surface-2); border: 1px solid var(--line-2); border-radius: 6px; padding: 1px 8px; }
.mt-chip.hot { color: var(--text); border-color: color-mix(in srgb, var(--accent) 55%, var(--line)); background: color-mix(in srgb, var(--accent) 12%, var(--surface-2)); }
.st-title .mt-code { font-size: 12px; font-weight: 500; letter-spacing: .06em; }
.sh-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 16px; align-items: center; padding: 16px 0; border-top: 1px solid var(--line-2); }
.sh-row:first-child { border-top: 0; padding-top: 2px; }
.sh-main { min-width: 0; display: grid; gap: 4px; }
.sh-main .st-quote { margin-top: 4px; }
.sh-state { display: inline-flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.sh-state.pos { color: var(--pos); font-weight: 500; }
@media (max-width: 640px) {
  .sh-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
}
.st-note[hidden], .rv-filter[hidden], .st-pane[hidden] { display: none !important; }
.mt-right { gap: 12px; flex-wrap: nowrap; }
@media (max-width: 640px) { .mt-right { grid-column: 1 / -1; justify-content: space-between; } .mt-right .mt-share { grid-column: auto; } }

/* =====================================================================================================
   1.25 — hand-made pass. Near-black graphite, Geist Mono for meta and counts, quiet chrome.
   Colour lives in the charts and the P&L; the frame stays grey. Buy ▲ / sell ▼ read the same everywhere.
   ===================================================================================================== */
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-400.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Geist Mono"; src: url("../fonts/geist-mono-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
:root, :root[data-theme="dark"] {
  --warn: #e0a43a;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sidebar: #0f0f10; --bg: #0c0c0d; --bg-2: #101011;
  --surface: #141415; --surface-2: #1a1a1c; --surface-3: #232325;
  --line: rgba(237, 237, 237, .08); --line-2: rgba(237, 237, 237, .055);
  --text: #ededed; --text-2: #a1a1a6; --text-3: #85858b;
  --pos: #4cc38a; --pos-soft: rgba(76, 195, 138, .10);
  --neg: #e5484d; --neg-soft: rgba(229, 72, 77, .10);
  --shadow: none; --hi: inset 0 1px 0 rgba(255, 255, 255, .04);
  --radius: 14px; --r-ctl: 8px;
  --btn-main: #ededed; --on-main: #141415;
}
:root[data-theme="light"] {
  --warn: #b7791f;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --sidebar: #fafafa; --bg: #fafafa; --bg-2: #f4f4f5;
  --surface: #ffffff; --surface-2: #f7f7f8; --surface-3: #f0f0f1;
  --line: rgba(23, 23, 23, .09); --line-2: rgba(23, 23, 23, .06);
  --text: #171717; --text-2: #525252; --text-3: #737373;
  --pos: #16a34a; --pos-soft: #ecf7f0; --neg: #dc2626; --neg-soft: #fdeeee;
  --shadow: 0 1px 2px rgba(23, 23, 23, .04); --hi: 0 1px 2px rgba(23, 23, 23, .05);
  --btn-main: #171717; --on-main: #ffffff;
}
body { letter-spacing: 0; }
b, strong { font-weight: 600; }
body { font-feature-settings: "tnum" 0, "calt", "liga"; text-rendering: optimizeLegibility; }
.num, td.n, th.n, .kpi .value, .pnl, .side { font-variant-numeric: tabular-nums; }
code, pre, kbd { font-family: var(--mono); }

/* ---- type: size and grey do the work, not weight ---- */
h1, h2, h3, h4 { font-weight: 600; }
.page-head h1, .trade-head h1 { font-size: 28px; font-weight: 600; letter-spacing: -.025em; line-height: 1.15; }
.page-head p { font-size: 13px; color: var(--text-3); }
.card-head h2 { font-size: 14px; font-weight: 600; letter-spacing: -.005em; }
.card-head p { font-size: 13px; color: var(--text-3); }
.crumbs { font-size: 12.5px; font-weight: 500; gap: 8px; }
.topbar-title { font-weight: 600; letter-spacing: 0; }
th { font-size: 12px; font-weight: 400; color: var(--text-3); }
.kpi .label { font-size: 13px; font-weight: 500; color: var(--text-2); }
.kpi .value, #view > .kpis > .kpi .value { font-size: clamp(22px, 1.7vw, 28px); font-weight: 600; letter-spacing: -.025em; margin-top: 8px; }
.kpi .sub { font-size: 12px; color: var(--text-3); margin-top: 4px; line-height: 16px; }
.meter { height: 4px; margin-top: 12px; }
.stat-hero .lbl, .mini-stats > div > span { font-weight: 400; }
.stat-hero .hero { font-size: 32px; font-weight: 600; letter-spacing: -.03em; }
.stat-hero #headR { font-weight: 600; }
.mini-grid span { font-size: 11.5px; font-weight: 500; }
.mini-grid b, .stat-list > div:nth-child(even) { font-weight: 600; }
.exec-h { font-weight: 500; color: var(--text-2); }

/* ---- surfaces: one hairline, no glow, no gradient ---- */
.card, .kpi, #view > .kpis, .table-wrap { border-color: var(--line); box-shadow: var(--shadow); background: var(--surface); }
#view > .kpis > .kpi { box-shadow: -1px 0 0 var(--line), 0 -1px 0 var(--line); background: transparent; }
.card .kpi { background: var(--surface-2); }

/* ---- sidebar: grouped, with mono section labels and counts ---- */
.nav-sec { font-size: 12px; font-weight: 500; line-height: 16px; color: var(--text-3); padding: 0 10px; margin: 20px 0 6px; }
.nav-sec[hidden] { display: none; }
@media (min-width: 821px) {
  .sidebar { width: 248px; padding: 20px 12px 16px; }
  .brand { padding: 4px 8px 16px; }
  nav .nav-sec:first-child { margin-top: 8px; }
  nav a { height: 34px; padding: 0 10px; gap: 10px; margin-bottom: 2px; font-size: 14px; font-weight: 500; color: var(--text-2);
    border-radius: var(--r-ctl); border: 1px solid transparent; }
  nav a:hover { background: var(--surface-2); color: var(--text); }
  nav a.active { background: var(--surface-3); color: var(--text); border-color: var(--line); box-shadow: var(--hi); }
}
:root[data-theme="light"] nav a.active { background: var(--surface); border-color: var(--line); box-shadow: var(--hi); }
nav a .ni, nav a.active .ni { opacity: 1; color: inherit; }
nav a .nav-count, nav a .nav-badge { margin-left: auto; min-width: 0; height: auto; padding: 0; border-radius: 0; background: none;
  font-size: 12px; font-weight: 500; color: var(--text-3); font-variant-numeric: tabular-nums; }
nav a .nav-badge { color: var(--accent); }
:root[data-theme="light"] nav a .nav-badge { color: var(--accent); }
.theme-seg { border-radius: 10px; }
.theme-seg button { font-weight: 500; border-radius: 6px; }
.theme-seg button.on { background: var(--surface-3); box-shadow: var(--hi); }
:root[data-theme="light"] .theme-seg button.on { background: var(--surface); box-shadow: var(--hi); }
.live { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; }
.live i { width: 6px; height: 6px; border-radius: 50%; background: var(--pos); flex: none; }
.live.demo i { background: #d39b14; }

/* ---- top bar ---- */
.topbar { background: color-mix(in srgb, var(--bg) 88%, transparent); border-bottom-color: var(--line-2); }
.seg { border-radius: 10px; }
.seg button { font-weight: 500; border-radius: 6px; }
.seg button.on { background: var(--surface-3); color: var(--text); box-shadow: var(--hi); }
:root[data-theme="light"] .seg button.on { background: var(--surface); box-shadow: var(--hi); }
kbd { display: inline-block; min-width: 18px; padding: 0 4px; font-size: 11px; line-height: 16px; text-align: center; color: var(--text-3);
  background: var(--surface-2); border: 1px solid var(--line); border-bottom-width: 2px; border-radius: 4px; }
.ask-top { gap: 4px; }
.ask-top kbd:first-of-type { margin-left: 6px; }
.filters-on i { box-shadow: none; width: 6px; height: 6px; }

/* ---- buttons: neutral; the main action is off-white on dark, ink on light ---- */
.btn { font-weight: 500; background: var(--surface); border-color: var(--line); }
.btn:hover { background: var(--surface-2); border-color: color-mix(in srgb, var(--text) 16%, transparent); }
.btn.primary, .btn.primary:hover { background: var(--btn-main); border-color: var(--btn-main); color: var(--on-main); }
.btn.primary:hover { opacity: .9; }
.btn.claude, :root[data-theme="light"] .btn.claude { background: var(--surface); color: var(--text); border-color: var(--line); filter: none; }
.btn.claude:hover { background: var(--surface-2); }
.claude-fab, :root[data-theme="light"] .claude-fab { background: var(--surface-3); color: var(--text); border-color: var(--line);
  font-weight: 500; box-shadow: 0 8px 24px rgba(0, 0, 0, .28); filter: none; }
.claude-fab svg { color: inherit; }
:root[data-theme="light"] .claude-fab { background: var(--surface); box-shadow: 0 8px 24px rgba(23, 23, 23, .12); }
@media (min-width: 821px) { .claude-fab { display: none; } }
@media (max-width: 820px) { .ask-top { display: none; } }
.cp-title svg { display: none; }

/* ---- side: ▲ long / buy, ▼ short / sell — the same marks as the price chart ---- */
.side { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); white-space: nowrap; }
.side i { font-style: normal; font-size: 9px; line-height: 1; }
.side.up i { color: var(--s1); }
.side.dn i { color: var(--s2); }
.trade-head .side, .nb h1 .side { font-size: 14px; font-weight: 400; letter-spacing: 0; }

/* ---- tags: small hairline labels instead of filled pills ---- */
.pill { border-radius: 6px; font-weight: 500; font-size: 12px; padding: 2px 8px; background: transparent; border: 1px solid var(--line); color: var(--text-2); }
.pill.setup { background: transparent; color: var(--text-2); }
.pill.xs { font-size: 11px; padding: 0 6px; }
.pill.win, .pill.loss { border: 0; background: none; padding: 0 2px; font-size: 14px; }
.pill.mistake { background: none; border-color: color-mix(in srgb, var(--neg) 35%, transparent); color: var(--neg); }
.pill.demo, .pill.server { background: none; }
.chip { border-radius: 999px; background: var(--surface-2); border-color: var(--line); font-weight: 500; }
.chip.on { background: var(--accent-soft); border-color: color-mix(in srgb, var(--accent) 70%, transparent); color: var(--text); }

/* ---- Edge Score ---- */
.score { display: flex; align-items: center; gap: 20px; }
.score .big { font-size: 46px; font-weight: 700; letter-spacing: -.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.score .bar { flex: 1; }
.score .meter { margin-top: 0; }

/* ---- calendar: day numbers in mono, icons only when needed ---- */
.cal .dow { font-size: 12px; font-weight: 500; }
.cal .cell { border-radius: 10px; border-color: var(--line-2); padding: 8px 12px; background: transparent; }
.cal .week { background: var(--surface-2); }
:root[data-theme="light"] .cal .week { background: var(--bg-2); }
.cal .cell .d { font-weight: 500; color: var(--text-3); }
.cal .cell .p { font-weight: 600; }
.cal .cell .t { font-size: 11.5px; color: var(--text-3); }
.cal .cell.has:hover { outline: 1px solid color-mix(in srgb, var(--text) 30%, transparent); }
.cal .nb-link { opacity: 0; }
.cal .cell:hover .nb-link, .cal .nb-link:focus-visible, .cal .nb-link.on { opacity: 1; }
@media (hover: none) { .cal .nb-link { opacity: .6; } }
.cal-month { min-width: 140px; text-align: center; font-weight: 600; }

/* ---- small things ---- */
.tile-add, .widget-add, .dropzone { border-width: 1px; }
.dash-pop, .modal { border-radius: 14px; }
.att-add span, label.field { font-weight: 400; }

@media (max-width: 820px) {
  .sidebar nav .nav-sec { grid-column: 1 / -1; margin: 12px 4px 2px; }
  .sidebar nav .nav-sec:first-child { margin-top: 0; }
  .sidebar nav a.active { border-color: color-mix(in srgb, var(--text) 24%, transparent); }
}
.set-group-ico { background: var(--surface-2); color: var(--text-2); border: 1px solid var(--line); }

/* ---- tabs and segmented switches: a sliding marker, and the new content settles in ---- */
:root { --ease: cubic-bezier(.22, 1, .36, 1); }
.seg.has-ink, .tabs.has-ink { position: relative; }
.seg > .ink { position: absolute; left: 0; top: 0; border-radius: 6px; background: var(--surface-3); box-shadow: var(--hi); pointer-events: none; z-index: 0;
  transition: transform .28s var(--ease), width .28s var(--ease), height .28s var(--ease); }
:root[data-theme="light"] .seg > .ink { background: var(--surface); box-shadow: 0 1px 2px rgba(23, 23, 23, .08), 0 0 0 1px rgba(23, 23, 23, .04); }
.seg.has-ink > button { position: relative; z-index: 1; transition: color .18s ease; }
.seg.has-ink > button.on, .seg.has-ink > button[aria-pressed="true"], .seg.has-ink > button[aria-selected="true"],
:root[data-theme="light"] .seg.has-ink > button.on, :root[data-theme="light"] .seg.has-ink > button[aria-pressed="true"] { background: transparent; box-shadow: none; }
.tabs > .ink { position: absolute; left: 0; bottom: -1px; height: 2px; border-radius: 2px; background: var(--accent); pointer-events: none;
  transition: transform .28s var(--ease), width .28s var(--ease); }
.tabs.has-ink > button { transition: color .18s ease; }
.tabs.has-ink > button.on { border-bottom-color: transparent; }
@keyframes tab-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.tab-in { animation: tab-in .26s var(--ease) both; }
@media (prefers-reduced-motion: reduce) { .seg > .ink, .tabs > .ink { transition: none; } .tab-in { animation: none; } }

/* ---- Prop firm accounts (1.25): one card per account, the account as a ruler from limit to target ---- */
.prop-sum { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.prop-tools { display: flex; align-items: center; gap: 12px; margin: 0 0 16px; flex-wrap: wrap; }
.prop-sort { display: inline-flex; align-items: center; gap: 8px; }
.seg-n { margin-left: 6px; color: var(--text-3); font-variant-numeric: tabular-nums; }
.seg button.on .seg-n { color: var(--text-2); }
.prop-list { display: grid; gap: 16px; }
.prop-card { padding: 20px 24px 20px; position: relative; overflow: visible; }
.prop-card[data-st="breached"] { border-color: color-mix(in srgb, var(--neg) 40%, var(--line)); }
.prop-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--line-2); }
.prop-id { display: flex; align-items: center; gap: 12px; min-width: 0; }
.prop-id h2 { font-size: 16px; font-weight: 600; letter-spacing: -.01em; }
.prop-id p { margin: 2px 0 0; font-size: 13px; color: var(--text-3); }
.prop-dot { width: 10px; height: 10px; border-radius: 50%; background: var(--c, var(--accent)); flex: none; }
.prop-status { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; color: var(--text-2); white-space: nowrap; }
.prop-status i { width: 6px; height: 6px; border-radius: 50%; background: var(--text-3); }
.prop-status.pos i { background: var(--pos); } .prop-status.neg { color: var(--neg); } .prop-status.neg i { background: var(--neg); }
.prop-status.warn { color: var(--warn); } .prop-status.warn i { background: var(--warn); }
.prop-acts { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.prop-acts .icon-btn { display: inline-grid; place-items: center; width: 30px; height: 30px; padding: 0; }
.prop-acts .icon-btn.on { color: var(--text); background: var(--surface-3); }
.prop-figs { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 16px 24px; padding: 20px 0 8px; }
.prop-figs span { display: block; font-size: 13px; font-weight: 500; color: var(--text-2); }
.prop-figs b { display: block; font-size: 26px; font-weight: 600; letter-spacing: -.025em; margin: 6px 0 4px; font-variant-numeric: tabular-nums; }
.prop-figs b.warn { color: var(--warn); }
.prop-figs em { display: block; font-style: normal; font-size: 12px; color: var(--text-3); }
.prop-figs em.pos { color: var(--pos); } .prop-figs em.neg { color: var(--neg); }

.ladder { padding: 36px 0 8px; }
.lad-track { position: relative; height: 6px; border-radius: 3px; background: var(--surface-3); }
.lad-fill { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 3px; background: var(--c); transition: width .5s var(--ease, ease); }
.lad-now { position: absolute; top: 50%; width: 14px; height: 14px; margin: -7px 0 0 -7px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 3px var(--surface); transition: left .5s var(--ease, ease); }
.lad-now em { position: absolute; bottom: 20px; left: 50%; transform: translateX(-50%); font-style: normal; font-size: 12px; font-weight: 600; color: var(--text);
  background: var(--surface-3); border: 1px solid var(--line); border-radius: 6px; padding: 2px 8px; white-space: nowrap; font-variant-numeric: tabular-nums; }
.ladder.breached .lad-now { background: var(--neg); }
.ladder.breached .lad-fill { background: var(--neg); }
.lad-marks { position: relative; height: 40px; margin-top: 8px; }
.lad-m { position: absolute; top: 0; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 4px; }
.lad-m i { width: 1px; height: 8px; background: var(--text-3); margin-top: -12px; }
.lad-m span { font-size: 11.5px; color: var(--text-3); text-align: center; line-height: 1.3; white-space: nowrap; }
.lad-m b { display: block; font-weight: 500; color: var(--text-2); font-variant-numeric: tabular-nums; }
.lad-m.lim { transform: none; align-items: flex-start; } .lad-m.lim span { text-align: left; } .lad-m.lim i { background: var(--neg); }
.lad-m.tg { transform: translateX(-100%); align-items: flex-end; } .lad-m.tg span { text-align: right; } .lad-m.tg i { background: var(--pos); }
.prop-breach { margin: 4px 0 0; font-size: 13px; color: var(--neg); }

.prop-body { display: grid; grid-template-columns: minmax(240px, 1fr) minmax(0, 2fr); gap: 24px; padding-top: 16px; margin-top: 8px; border-top: 1px solid var(--line-2); }
.prop-body.solo { grid-template-columns: 1fr; }
.prop-rows { display: flex; flex-direction: column; gap: 16px; padding: 4px 0; border: 0; }
.prop-row .pr-top { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.prop-row .pr-top span { font-size: 13px; color: var(--text-2); }
.prop-row .pr-top b { font-size: 13.5px; font-weight: 600; font-variant-numeric: tabular-nums; }
.prop-row em { display: block; font-style: normal; font-size: 12px; color: var(--text-3); }
.prop-row .pbar, .pt-cell .pbar { height: 4px; margin: 8px 0 6px; }
.pbar i { background: var(--accent); transition: width .5s var(--ease, ease); }
.prop-chart { position: relative; height: 280px; min-width: 0; }
.prop-foot { display: flex; gap: 24px; flex-wrap: wrap; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-2); font-size: 13px; color: var(--text-3); }
.prop-foot b { font-weight: 600; color: var(--text); margin-left: 4px; font-variant-numeric: tabular-nums; }
.prop-foot b.pos { color: var(--pos); } .prop-foot b.neg { color: var(--neg); }
.prop-notes { margin: 12px 0 0; font-size: 13px; color: var(--text-2); line-height: 1.5; white-space: pre-wrap; }
.prop-table td { vertical-align: middle; }
.prop-table .prop-id { gap: 8px; } .prop-table .prop-id svg { width: 13px; height: 13px; vertical-align: -2px; }
.pt-cell { display: grid; grid-template-columns: minmax(80px, 140px) auto; align-items: center; gap: 12px; }
.pt-cell span { font-variant-numeric: tabular-nums; font-size: 13px; }
.prop-empty { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 40px; align-items: center; padding: 32px; }
.prop-empty h2 { font-size: 18px; } .prop-empty p { color: var(--text-2); line-height: 1.55; margin: 8px 0 16px; max-width: 34em; }
.prop-example { border: 1px dashed var(--line); border-radius: 12px; padding: 16px 24px 8px; }
.prop-copy { margin-bottom: 4px; }
.prop-look { display: grid; grid-template-columns: auto minmax(160px, 1fr) auto; gap: 16px 24px; align-items: end; }
.swatches { display: flex; gap: 8px; padding: 4px 0; }
.swatch { width: 24px; height: 24px; border-radius: 50%; border: 0; background: var(--c); cursor: pointer; box-shadow: 0 0 0 2px var(--surface); transition: box-shadow .15s; }
.swatch.on { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--text-2); }
.swatch:focus-visible { outline: none; box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent); }
.prop-pin { padding-bottom: 8px; }
@media (max-width: 1100px) { .prop-body { grid-template-columns: 1fr; } .prop-sum { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 640px) {
  .prop-sum { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .prop-card { padding: 16px; }
  .prop-acts { margin-left: 0; width: 100%; }
  .prop-figs b { font-size: 22px; }
  .prop-empty { grid-template-columns: 1fr; padding: 20px; gap: 24px; }
  .prop-look { grid-template-columns: 1fr; }
  .prop-chart { height: 220px; }
}
:root[data-theme="light"] .sidebar nav a { color: var(--text-2); }
:root[data-theme="light"] .sidebar nav a:hover, :root[data-theme="light"] .sidebar nav a.active { color: var(--text); }
@media (max-width: 640px) { .prop-figs { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; } .prop-tools { gap: 8px; } }

.lad-now.at-l em { left: -4px; transform: none; }
.lad-now.at-r em { left: auto; right: -4px; transform: none; }
.lad-m.st.at-l { transform: none; align-items: flex-start; } .lad-m.st.at-l span { text-align: left; }
:root[data-theme="light"] a.btn { color: var(--text); }
:root[data-theme="light"] a.btn.primary { color: var(--on-main); }
:root[data-theme="light"] .crumbs a { color: var(--text-2); }
:root[data-theme="light"] .crumbs a:hover { color: var(--text); }
