/* ==========================================================================
   TraderLogs. Design system
   Themes: dark (night), light (day), sepia. Day and night share the website's teal palette. All colors are role tokens.
   ========================================================================== */
:root, [data-theme="dark"] {
  color-scheme: dark;
  --bg: #071113;
  --bg-glow: rgba(42, 156, 144, .035);
  --surface: #0b181b;
  --surface-2: #0e1e21;
  --surface-3: #132629;
  --border: #172a2d;
  --border-strong: #213a3d;
  --text: #cddcd9;
  --text-2: #97b0ad;
  --text-3: #7a9693;
  --accent: #2a9c90;
  --accent-2: #3fb0a3;
  --accent-ink: #021614;
  --accent-soft: rgba(42, 156, 144, .13);
  --pos: #3aa86a;
  --pos-soft: rgba(58, 168, 106, .12);
  --neg: #d9677a;
  --neg-soft: rgba(217, 103, 122, .12);
  --pos-ink: #9fe3bc;
  --neg-ink: #f5aab8;
  --warn: #d9a03d;
  --warn-soft: rgba(217, 160, 61, .12);
  --series-1: #2a9c90;
  --series-2: #c9693e;
  --series-3: #8f82d9;
  --grid: rgba(190, 235, 228, .045);
  --axis: #7a9693;
  --shadow: 0 1px 2px rgba(0,8,10,.4), 0 8px 24px rgba(0,8,10,.25);
  --shadow-lg: 0 24px 64px rgba(0,8,10,.55);
  --scrim: rgba(2, 7, 8, .7);
  --hm-0: #12272a;
}
[data-theme="light"] {
  color-scheme: light;
  --bg: #eef4f3;
  --bg-glow: rgba(11, 115, 102, .06);
  --surface: #ffffff;
  --surface-2: #f5f9f8;
  --surface-3: #e7f0ee;
  --border: #d8e4e1;
  --border-strong: #bccfcb;
  --text: #0e2a2d;
  --text-2: #3c5a5d;
  --text-3: #4e6a6c;
  --accent: #0b7366;
  --accent-2: #095f55;
  --accent-ink: #ffffff;
  --accent-soft: rgba(11, 115, 102, .1);
  --pos: #0a7d47;
  --pos-soft: rgba(12, 148, 85, .1);
  --neg: #c8303e;
  --neg-soft: rgba(216, 58, 71, .09);
  --pos-ink: #05502c;
  --neg-ink: #7a121d;
  --warn: #946000;
  --warn-soft: rgba(242, 177, 59, .16);
  --series-1: #0b7366;
  --series-2: #e0622c;
  --series-3: #6a55d4;
  --grid: rgba(14, 42, 45, .06);
  --axis: #4e6a6c;
  --shadow: 0 1px 2px rgba(14,42,45,.05), 0 4px 16px rgba(14,42,45,.06);
  --shadow-lg: 0 24px 64px rgba(14,42,45,.18);
  --scrim: rgba(10, 30, 32, .4);
  --hm-0: #e4eeec;
}
[data-theme="sepia"] {
  color-scheme: light;
  --bg: #f1e8d6;
  --bg-glow: rgba(160, 97, 42, .07);
  --surface: #faf4e7;
  --surface-2: #f5ecdb;
  --surface-3: #ede2cc;
  --border: #e0d2b6;
  --border-strong: #cfbe9c;
  --text: #33281c;
  --text-2: #65543f;
  --text-3: #6b583f;
  --accent: #8a4e1d;
  --accent-2: #7f4719;
  --accent-ink: #fffaf0;
  --accent-soft: rgba(154, 90, 38, .12);
  --pos: #356b24;
  --pos-soft: rgba(63, 125, 44, .12);
  --neg: #b23f35;
  --neg-soft: rgba(178, 63, 53, .1);
  --pos-ink: #1f4414;
  --neg-ink: #6e1f18;
  --warn: #865a05;
  --warn-soft: rgba(168, 112, 10, .14);
  --series-1: #8a4e1d;
  --series-2: #2f6a8f;
  --series-3: #5d7f3a;
  --grid: rgba(51, 40, 28, .08);
  --axis: #6b583f;
  --shadow: 0 1px 2px rgba(80,55,20,.06), 0 4px 16px rgba(80,55,20,.07);
  --shadow-lg: 0 24px 64px rgba(80,55,20,.2);
  --scrim: rgba(51, 40, 28, .35);
  --hm-0: #e8dcc4;
}

:root {
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Inter", "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "Roboto Mono", Menlo, Consolas, monospace;
  --r-sm: 8px;
  --r: 12px;
  --r-lg: 16px;
  --r-xl: 22px;
  --sidebar: 248px;
  --topbar: 64px;
  --tabbar: 64px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --ease: cubic-bezier(.2, .8, .2, 1);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}
img, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 650; letter-spacing: -.01em; }
p { margin: 0; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.muted { color: var(--text-2); }
.faint { color: var(--text-3); }
.pos { color: var(--pos); }
.neg { color: var(--neg); }
.warn { color: var(--warn); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--accent-soft); }

/* ---------- Boot ---------- */
.boot { min-height: 100dvh; display: grid; place-items: center; }
.boot-mark, .brand-mark {
  width: 28px; height: 28px; border-radius: 8px; flex: none;
  background:
    linear-gradient(var(--accent), var(--accent)) 5px 15px / 4px 8px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 12px 10px / 4px 13px no-repeat,
    linear-gradient(var(--accent), var(--accent)) 19px 5px / 4px 18px no-repeat,
    var(--accent-soft);
}
.boot-mark { width: 44px; height: 44px; transform: scale(1.4); }

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -.01em; min-width: 0; }
.brand-md { font-size: 17px; }
.brand-lg { font-size: 20px; }
.brand-lg .brand-mark { transform: scale(1.15); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 40px; padding: 0 16px; border-radius: 10px; border: 0;
  background: var(--surface-2); color: var(--text); font-weight: 600; font-size: 14px;
  white-space: nowrap; transition: background .15s, border-color .15s, transform .1s; user-select: none;
}
.btn:hover { background: var(--surface-3); text-decoration: none; }
.btn:active { transform: scale(.98); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-3); }
.btn-danger { color: var(--neg); }
.btn-danger:hover { background: var(--neg-soft); border-color: var(--neg-soft); }
.btn-sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn-lg { height: 48px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn-icon { width: 40px; padding: 0; }
.btn-icon.btn-sm { width: 32px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Form controls ---------- */
.field { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.field > span:first-child, .label { font-size: 12px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.input, .field input:not([type=checkbox]):not([type=radio]):not([type=range]), .field select, .field textarea, .select {
  width: 100%; min-width: 0; height: 44px; padding: 0 12px; border-radius: 10px;
  border: 0; background: var(--surface-3); color: var(--text);
  outline: none; transition: border-color .15s, box-shadow .15s; font-size: 16px; /* 16px stops mobile zoom */
}
.field textarea { height: auto; min-height: 88px; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.field select, .select { appearance: none; padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 10px center; background-size: 16px; }
.input:focus, .field input:focus, .field select:focus, .field textarea:focus, .select:focus {
  border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft);
}
.field .hint { font-size: 12px; color: var(--text-3); }
.input-affix { position: relative; display: flex; }
.input-affix input { padding-right: 44px !important; }
.input-affix .affix { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); font-size: 12px; color: var(--text-3); pointer-events: none; }
.check { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; }
.check input { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }

.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.form-grid .span-2 { grid-column: span 2; }
@media (min-width: 720px) { .form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); } .form-grid.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

/* segmented control */
.seg { display: inline-flex; padding: 3px; gap: 2px; border-radius: 10px; background: var(--surface-3); max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.seg::-webkit-scrollbar { display: none; }
.seg button { flex: 1 0 auto; height: 32px; padding: 0 12px; border: 0; border-radius: 8px; background: transparent; color: var(--text-2); font-weight: 600; font-size: 13px; white-space: nowrap; }
.seg button.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.seg.block { display: flex; width: 100%; }
.seg.lg button { height: 40px; font-size: 14px; }
.seg .long.on { background: var(--pos); color: #fff; }
.seg .short.on { background: var(--neg); color: #fff; }
[data-theme="dark"] .seg .long.on, [data-theme="dark"] .seg .short.on { color: #06110f; }

/* chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.chips.scroll { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; margin: 0 -2px; padding-left: 2px; }
.chips.scroll::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 12px; flex: none;
  border-radius: 999px; border: 0; background: var(--surface-3); color: var(--text-2);
  font-size: 13px; font-weight: 600; white-space: nowrap; transition: all .15s;
}
.chip:hover { background: var(--border); color: var(--text); }
.chips:not(.scroll) .chip { max-width: 100%; white-space: normal; height: auto; min-height: 34px; padding-top: 6px; padding-bottom: 6px; line-height: 1.3; text-align: left; overflow-wrap: anywhere; }
.chips.scroll .chip { max-width: 85vw; overflow: hidden; text-overflow: ellipsis; }
.chip.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.chip.on.bad { background: var(--neg-soft); color: var(--neg-ink); box-shadow: inset 0 0 0 1.5px var(--neg); }
.chip.on.good { background: var(--pos-soft); color: var(--pos-ink); box-shadow: inset 0 0 0 1.5px var(--pos); }
.chip .em { font-size: 15px; line-height: 1; }
.chip-add { background: transparent; color: var(--accent); }
.chip-x { display: inline-grid; place-items: center; width: 32px; height: 32px; margin: -8px -12px -8px -4px; border: 0; background: none; color: var(--text-3); border-radius: 50%; padding: 0; flex: none; }
.chip-x:hover { background: var(--surface-3); color: var(--neg); }
.chip-x svg { width: 14px; height: 14px; }

/* toggle switch */
.switch { position: relative; display: inline-flex; align-items: center; gap: 10px; cursor: pointer; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch i { width: 42px; height: 24px; border-radius: 99px; background: var(--border-strong); border: 0; position: relative; transition: .2s; flex: none; }
.switch i::after { content: ""; position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.3); transition: .2s var(--ease); }
.switch input:checked + i { background: var(--accent); border-color: var(--accent); }
.switch input:checked + i::after { transform: translateX(18px); }

/* stars / scale */
.scale { display: flex; gap: 6px; }
.scale button { flex: 1; height: 40px; min-width: 0; border-radius: 10px; border: 0; background: var(--surface-3); color: var(--text-2); font-weight: 700; }
.scale button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

/* ---------- Layout ---------- */
.shell { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: var(--sidebar); z-index: 30;
  background: var(--surface); border-right: 0;
  display: flex; flex-direction: column; padding: 18px 14px; gap: 6px;
}
.sidebar .brand { padding: 4px 10px 18px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; flex: 1; min-height: 0; }
.nav-label { font-size: 11px; font-weight: 700; color: var(--text-3); text-transform: uppercase; letter-spacing: .08em; padding: 14px 12px 6px; }
.nav a {
  display: flex; align-items: center; gap: 12px; height: 40px; padding: 0 12px; border-radius: 10px;
  color: var(--text-2); font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden;
}
.nav a svg { width: 19px; height: 19px; flex: none; }
.nav a:hover { background: var(--surface-2); color: var(--text); }
.nav a.on { background: var(--accent-soft); color: var(--accent); }
.sidebar-foot { border-top: 1px solid var(--border); padding-top: 12px; display: flex; flex-direction: column; gap: 10px; }
.user-chip { display: flex; align-items: center; gap: 10px; padding: 6px 8px; min-width: 0; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-weight: 700; font-size: 13px; flex: none; }
.user-chip .who { min-width: 0; flex: 1; }
.user-chip .who b { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-chip .who span { font-size: 12px; color: var(--text-3); }

.main { margin-left: var(--sidebar); min-width: 0; min-height: 100dvh; display: flex; flex-direction: column; padding-bottom: 96px; } /* room for the floating Pip and colour buttons */
.topbar {
  position: sticky; top: 0; z-index: 20; height: var(--topbar);
  display: flex; align-items: center; gap: 12px; padding: 0 28px;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--border); }
.topbar h1 { font-size: 20px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar .back { display: none; }
.topbar-actions { display: flex; align-items: center; gap: 8px; flex: none; }
.content { width: 100%; max-width: 1320px; margin: 0 auto; padding: 8px 28px 48px; display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.tabbar, .fab { display: none; }

/* Tablet: icon rail */
@media (max-width: 1100px) and (min-width: 721px) {
  :root { --sidebar: 76px; }
  .sidebar { padding: 18px 12px; align-items: stretch; }
  .sidebar .brand span:last-child, .sidebar .nav-txt, .nav-label, .nav a span, .user-chip .who, .sidebar-foot .theme-pick { display: none; }
  .sidebar .brand { justify-content: center; padding: 4px 0 18px; }
  .nav a { justify-content: center; padding: 0; }
  .user-chip { justify-content: center; }
}

/* Mobile: app layout */
@media (max-width: 720px) {
  body { font-size: 15px; }
  .sidebar { display: none; }
  .main { margin-left: 0; padding-bottom: calc(var(--tabbar) + var(--safe-b) + 84px); }
  .topbar { height: calc(56px + var(--safe-t)); padding: var(--safe-t) 8px 0 16px; }
  .topbar h1 { font-size: 19px; }
  .topbar .back { display: inline-flex; margin-left: -8px; }
  .topbar .hide-m { display: none; }
  .content { padding: 4px 16px 24px; gap: 16px; }
  .tabbar {
    display: grid; grid-template-columns: repeat(5, 1fr); align-items: stretch;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
    height: calc(var(--tabbar) + var(--safe-b)); padding-bottom: var(--safe-b);
    background: color-mix(in srgb, var(--surface) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(16px); -webkit-backdrop-filter: saturate(1.4) blur(16px);
    border-top: 1px solid var(--border);
  }
  .tabbar a, .tabbar button {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    color: var(--text-3); font-size: 11px; font-weight: 600; text-decoration: none; border: 0; background: none; min-width: 0;
  }
  .tabbar a svg, .tabbar button svg { width: 22px; height: 22px; }
  .tabbar a.on { color: var(--accent); }
  .tabbar .tab-add span.plus {
    width: 52px; height: 52px; border-radius: 18px; background: var(--accent); color: var(--accent-ink);
    display: grid; place-items: center; box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 45%, transparent);
    margin-top: -18px;
  }
  .tabbar .tab-add span.plus svg { width: 26px; height: 26px; }
}

/* ---------- Cards ---------- */
.card { background: var(--surface); border: 0; border-radius: var(--r-lg); box-shadow: var(--shadow); min-width: 0; }
.card-pad { padding: 20px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 16px 20px 0; min-width: 0; flex-wrap: wrap; }
.card-head h3 { font-size: 15px; font-weight: 650; min-width: 0; }
.card-head .sub { font-size: 12px; color: var(--text-3); font-weight: 500; margin-top: 2px; }
.card-body { padding: 16px 20px 20px; min-width: 0; }
.card-body.flush { padding: 8px 0 4px; }
@media (max-width: 720px) {
  .card { border-radius: var(--r); }
  .card-pad { padding: 16px; }
  .card-head { padding: 14px 16px 0; }
  .card-body { padding: 12px 16px 16px; }
}

.grid { display: grid; gap: 20px; min-width: 0; }
.grid > * { min-width: 0; }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-main { grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); }
@media (max-width: 1100px) { .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); } .g-main { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 860px) { .g-2, .g-3 { grid-template-columns: minmax(0, 1fr); } .grid { gap: 16px; } }

/* KPI tiles */
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; }
.kpis.k4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.kpis.k6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
@media (max-width: 1279px) and (min-width: 721px) { .kpis.k6 { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 1100px) and (min-width: 721px) { .kpis.k4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.kpi { padding: 16px 18px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.kpi .k-label { font-size: 12px; color: var(--text-2); font-weight: 600; display: flex; align-items: center; gap: 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kpi .k-sub { font-size: 12px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.delta { display: inline-flex; align-items: center; gap: 2px; font-weight: 700; font-size: 12px; }
@media (max-width: 720px) {
  .kpis, .kpis.k4, .kpis.k6 { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .kpi { padding: 14px; }
  .kpi .k-value { font-size: 20px; }
}

/* Hero equity block */
.hero { padding: 20px 20px 8px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px; }
.hero .h-label { font-size: 12px; color: var(--text-2); font-weight: 600; }
.hero .h-value { font-size: 34px; font-weight: 750; letter-spacing: -.03em; font-variant-numeric: tabular-nums; line-height: 1.1; margin-top: 4px; }
.hero .h-sub { display: flex; gap: 10px; flex-wrap: wrap; font-size: 13px; margin-top: 6px; }
@media (max-width: 720px) { .hero { padding: 16px 16px 4px; } .hero .h-value { font-size: 28px; } }

/* Today / guardrail strip */
.today { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; }
.today > div { padding: 14px 18px; border-right: 0; min-width: 0; }
.today > div:last-child { border-right: 0; }
.today .t-label { font-size: 12px; color: var(--text-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.today .t-value { font-size: 16px; font-weight: 700; font-variant-numeric: tabular-nums; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meter { height: 6px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; border-radius: 99px; background: var(--accent); transition: width .5s var(--ease); }
.meter.good i { background: var(--pos); } .meter.bad i { background: var(--neg); } .meter.warn i { background: var(--warn); }
@media (max-width: 720px) {
  .today { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .today > div:nth-child(2) { border-right: 0; }
  .today > div:nth-child(-n+2) { border-bottom: 1px solid var(--border); }
  .today > div { padding: 12px 14px; }
}

/* Insights */
.insights { display: flex; flex-direction: column; }
.insight { display: grid; grid-template-columns: 36px minmax(0, 1fr); gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); }
.insight:first-child { border-top: 0; }
.insight .ic { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; }
.insight .ic svg { width: 18px; height: 18px; }
.insight.bad .ic { background: var(--neg-soft); color: var(--neg); }
.insight.warn .ic { background: var(--warn-soft); color: var(--warn); }
.insight.good .ic { background: var(--pos-soft); color: var(--pos); }
.insight.info .ic { background: var(--accent-soft); color: var(--accent); }
.insight h4 { font-size: 14px; font-weight: 650; }
.insight p { font-size: 13px; color: var(--text-2); margin-top: 3px; }
.insight .tip { margin-top: 8px; font-size: 13px; color: var(--text); display: flex; gap: 6px; align-items: flex-start; }
.insight .tip svg { width: 15px; height: 15px; flex: none; margin-top: 2px; color: var(--accent); }
@media (max-width: 720px) { .insight { padding: 14px 16px; } }

/* Tables */
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; min-width: 0; }
table.tbl { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.tbl th { text-align: left; font-size: 12px; font-weight: 600; color: var(--text-3); padding: 10px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; background: var(--surface); position: sticky; top: 0; }
.tbl td { padding: 12px 14px; border-bottom: 1px solid var(--border); white-space: nowrap; font-size: 13.5px; }
.tbl tr:last-child td { border-bottom: 0; }
.tbl th.r, .tbl td.r { text-align: right; }
.tbl tbody tr { transition: background .1s; }
.tbl tbody tr.click { cursor: pointer; }
.tbl tbody tr.click:hover { background: var(--surface-2); }
.tbl th.sortable { cursor: pointer; user-select: none; }
.tbl th.sortable:hover { color: var(--text); }
.tbl .best { color: var(--pos); font-weight: 700; }

/* Trade list rows (mobile-first list) */
.tlist { display: flex; flex-direction: column; }
.trow { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 16px; border-top: 1px solid var(--border); cursor: pointer; text-decoration: none; color: inherit; }
.trow:first-child { border-top: 0; }
.trow:hover { background: var(--surface-2); text-decoration: none; }
.dir { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; }
.dir svg { width: 18px; height: 18px; }
.dir.long { background: var(--pos-soft); color: var(--pos); }
.dir.short { background: var(--neg-soft); color: var(--neg); }
.trow .t-main { min-width: 0; }
.trow .t-main b { display: block; font-size: 14.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .t-main > span { display: block; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.trow .t-res { text-align: right; font-variant-numeric: tabular-nums; min-width: 0; max-width: 46vw; }
@media (min-width: 901px) { .trow .t-res { max-width: 22rem; } }
.trow .t-res b { display: block; font-size: 14.5px; }
.trow .t-res span { display: block; font-size: 12.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.day-head { display: flex; justify-content: space-between; padding: 10px 16px; font-size: 12px; font-weight: 700; color: var(--text-3); background: var(--surface-2); border-top: 1px solid var(--border); text-transform: uppercase; letter-spacing: .05em; }
.day-head:first-child { border-top: 0; border-radius: var(--r-lg) var(--r-lg) 0 0; }

/* Badges */
.badge { display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px; border-radius: 6px; font-size: 11.5px; font-weight: 700; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.badge.pos { background: var(--pos-soft); color: var(--pos); }
.badge.neg { background: var(--neg-soft); color: var(--neg); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.acc { background: var(--accent-soft); color: var(--accent); }

/* Toolbar / filters */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; min-width: 0; }
.toolbar .grow { flex: 1; min-width: 0; }
.toolbar .select { width: auto; height: 38px; font-size: 14px; }
.search { position: relative; flex: 1; min-width: 180px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; color: var(--text-3); }
.search input { width: 100%; height: 38px; border-radius: 10px; border: 0; background: var(--surface); padding: 0 12px 0 36px; outline: none; font-size: 16px; }
.search input:focus { border-color: var(--accent); }
@media (max-width: 720px) {
  .toolbar { gap: 8px; }
  .toolbar .seg { width: 100%; }
  .toolbar .seg button { flex: 1 0 auto; }
  .toolbar .select { flex: 1; min-width: 0; }
}

/* Section titles */
.section-title { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.section-title h2 { font-size: 16px; }
.section-title a { font-size: 13px; font-weight: 600; }

/* Calendar heatmap */
.cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal .dow { font-size: 11px; color: var(--text-3); text-align: center; font-weight: 700; padding-bottom: 2px; }
.cal .d { aspect-ratio: 1 / .82; border-radius: 8px; background: var(--hm-0); padding: 5px 6px; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; overflow: hidden; position: relative; cursor: default; border: 0; }
.cal .d.has { cursor: pointer; }
.cal .d.has:hover { filter: brightness(1.06); }
.cal .d.out { visibility: hidden; }
.cal .d .dn { font-size: 11px; font-weight: 700; color: var(--text-3); }
.cal .d .dv { font-size: 10.5px; letter-spacing: -.02em; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal .d.p .dv, .cal .d.p .dn { color: var(--pos-ink); }
.cal .d.n .dv, .cal .d.n .dn { color: var(--neg-ink); }
/* Today: always the accent pill with its own ink, whatever the day's result. */
.cal .d.today .dn, .cal .d.p.today .dn, .cal .d.n.today .dn { align-self: flex-start; padding: 0 5px; border-radius: 5px; background: var(--accent); color: var(--accent-ink); }
@media (max-width: 520px) { .cal { gap: 4px; } .cal .d { padding: 4px; border-radius: 6px; } .cal .d .dv { font-size: 9.5px; } .cal .d .dn { font-size: 10px; } }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 12px; }
.cal-head b { font-size: 14px; }

/* Charts */
.chart { position: relative; width: 100%; min-width: 0; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.chart svg { overflow: visible; }
.chart text { fill: var(--axis); font-size: 11px; font-family: var(--font); font-variant-numeric: tabular-nums; }
.chart .grid-line { stroke: var(--grid); stroke-width: 1; shape-rendering: crispEdges; }
.chart .zero-line { stroke: var(--border-strong); stroke-width: 1; shape-rendering: crispEdges; }
.chart .xhair { stroke: var(--text-3); stroke-width: 1; stroke-dasharray: 3 3; }
.chart .dot { stroke: var(--surface); stroke-width: 2; }
.chart .bar { transition: opacity .15s; }
.chart.hovering .bar:not(.hot) { opacity: .45; }
.chart-tip {
  position: absolute; z-index: 5; pointer-events: none; min-width: 120px; max-width: 240px;
  background: var(--surface); border: 0; box-shadow: var(--shadow-lg); border-radius: 10px;
  padding: 8px 10px; font-size: 12px; opacity: 0; transition: opacity .12s; transform: translate3d(0,0,0);
}
.chart-tip.show { opacity: 1; }
.chart-tip .tt { font-weight: 700; color: var(--text); margin-bottom: 4px; white-space: nowrap; }
.chart-tip .tr { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--text-2); white-space: nowrap; }
.chart-tip .tr b { color: var(--text); font-variant-numeric: tabular-nums; }
.chart-tip .sw { width: 8px; height: 8px; border-radius: 2px; display: inline-block; margin-right: 6px; }
.legend { display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 12px; color: var(--text-2); }
.legend span { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; flex: none; }
.legend i.line { height: 3px; border-radius: 2px; width: 14px; }
.legend i.dash { height: 0; border-top: 2px dashed; width: 14px; border-radius: 0; background: none !important; }

/* Breakdown bars (horizontal, HTML) */
.hbars { display: flex; flex-direction: column; gap: 10px; }
.hbar { display: grid; grid-template-columns: minmax(64px, 110px) minmax(0, 1fr) 72px; align-items: center; gap: 10px; font-size: 13px; }
.hbar .hl { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); font-weight: 600; }
.hbar .ht { position: relative; height: 22px; }
.hbar .ht::before { content: ""; position: absolute; left: 50%; top: -2px; bottom: -2px; width: 1px; background: var(--border-strong); }
.hbar .ht i { position: absolute; top: 3px; bottom: 3px; border-radius: 4px; }
.hbar .ht i.p { left: 50%; background: var(--pos); border-radius: 0 4px 4px 0; }
.hbar .ht i.n { right: 50%; background: var(--neg); border-radius: 4px 0 0 4px; }
.hbar .hv { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.hbar .hn { font-size: 11px; color: var(--text-3); font-weight: 500; display: block; }

/* Empty states */
.empty { text-align: center; padding: 40px 20px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.empty .e-ic { width: 56px; height: 56px; border-radius: 16px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.empty .e-ic svg { width: 26px; height: 26px; }
.empty h3 { font-size: 16px; }
.empty p { color: var(--text-2); max-width: 380px; font-size: 14px; }
.empty .btn { margin-top: 8px; }

/* Alerts */
.alert { padding: 12px 14px; border-radius: 10px; font-size: 13.5px; display: flex; gap: 10px; align-items: flex-start; }
.alert svg { width: 18px; height: 18px; flex: none; margin-top: 1px; }
.alert-bad { background: var(--neg-soft); color: var(--neg); }
.alert-warn { background: var(--warn-soft); color: var(--warn); }
.alert-good { background: var(--pos-soft); color: var(--pos); }
.alert-info { background: var(--accent-soft); color: var(--accent); }
.alert b { font-weight: 700; }
.alert .grow { flex: 1; min-width: 0; }

/* ---------- Sheet (mobile bottom sheet / desktop drawer) ---------- */
.scrim { position: fixed; inset: 0; background: var(--scrim); z-index: 60; opacity: 0; transition: opacity .25s; backdrop-filter: blur(2px); }
.scrim.show { opacity: 1; }
.sheet {
  position: fixed; z-index: 61; background: var(--surface); display: flex; flex-direction: column;
  top: 0; right: 0; bottom: 0; width: min(620px, 100vw); border-left: 0;
  box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .32s var(--ease);
}
.sheet.show { transform: none; }
.sheet.modal { top: 50%; left: 50%; right: auto; bottom: auto; width: min(480px, calc(100vw - 32px)); max-height: calc(100dvh - 48px); border-radius: var(--r-xl); border: 0; transform: translate(-50%, -46%) scale(.97); opacity: 0; transition: transform .25s var(--ease), opacity .2s; }
.sheet.modal.show { transform: translate(-50%, -50%); opacity: 1; }
.sheet-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px 14px 20px; border-bottom: 1px solid var(--border); flex: none; }
.sheet-head h2 { font-size: 17px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sheet-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: 20px; display: flex; flex-direction: column; gap: 22px; min-height: 0; }
.sheet-foot { flex: none; display: flex; gap: 10px; padding: 12px 20px calc(12px + var(--safe-b)); border-top: 1px solid var(--border); background: var(--surface); }
.sheet-foot .btn { flex: 1; }
.sheet-foot .btn.flex-0 { flex: 0 0 auto; }
.grab { display: none; }
@media (max-width: 720px) {
  .sheet { top: auto; left: 0; width: 100%; height: calc(100dvh - 12px - var(--safe-t)); border-left: 0; border-radius: 20px 20px 0 0; transform: translateY(100%); }
  .sheet.short { height: auto; max-height: 86dvh; }
  .sheet.modal { top: auto; left: 0; bottom: 0; width: 100%; max-height: 86dvh; border-radius: 20px 20px 0 0; transform: translateY(100%); opacity: 1; }
  .sheet.modal.show { transform: none; }
  .grab { display: block; width: 40px; height: 4px; border-radius: 9px; background: var(--border-strong); margin: 8px auto 0; flex: none; }
  .sheet-head { padding: 8px 8px 10px 16px; }
  .sheet-body { padding: 16px; gap: 20px; }
  .sheet-foot { padding: 10px 16px calc(10px + var(--safe-b)); }
}

/* form section inside sheet */
.fsec { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.fsec-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.fsec-head h3 { font-size: 13px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.calc-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
.calc-strip > div { background: var(--surface-3); padding: 10px 12px; min-width: 0; border-radius: 10px; }
.calc-strip span { display: block; font-size: 11px; color: var(--text-3); font-weight: 600; }
.calc-strip b { display: block; font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 420px) { .calc-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
details.more { border: 0; border-radius: 12px; background: var(--surface-2); }
details.more > summary { list-style: none; cursor: pointer; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; font-weight: 600; font-size: 14px; }
details.more > summary::-webkit-details-marker { display: none; }
details.more > summary svg { width: 18px; height: 18px; transition: transform .2s; color: var(--text-3); }
details.more[open] > summary svg { transform: rotate(180deg); }
details.more > .more-body { padding: 0 14px 14px; display: flex; flex-direction: column; gap: 14px; }

/* Checklist */
.checklist { display: flex; flex-direction: column; gap: 8px; }
.cl-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border: 0; border-radius: 10px; cursor: pointer; background: var(--surface-2); transition: all .15s; }
.cl-item input { width: 20px; height: 20px; accent-color: var(--pos); margin: 0; flex: none; }
.cl-item span { flex: 1; min-width: 0; font-size: 14px; }
.cl-item.on { border-color: color-mix(in srgb, var(--pos) 40%, var(--border)); background: var(--pos-soft); }
.cl-summary { display: flex; align-items: center; gap: 10px; }
.cl-summary .meter { flex: 1; margin: 0; }

/* Screenshots */
.shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.shot-drop { position: relative; aspect-ratio: 16 / 10; border: 0; border-radius: 12px; display: grid; place-items: center; text-align: center; color: var(--text-3); font-size: 12.5px; cursor: pointer; overflow: hidden; background: var(--surface-2); padding: 8px; }
.shot-drop:hover { border-color: var(--accent); color: var(--accent); }
.shot-drop svg { width: 22px; height: 22px; margin: 0 auto 6px; }
.shot-drop img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot-drop .shot-x { position: absolute; top: 6px; right: 6px; z-index: 2; width: 28px; height: 28px; border-radius: 8px; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; }
.shot-drop .shot-x svg { width: 14px; height: 14px; margin: 0; }
.shot-drop .shot-tag { position: absolute; left: 6px; bottom: 6px; z-index: 2; background: rgba(0,0,0,.6); color: #fff; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 6px; }
.shot-drop.busy::after { content: "Uploading…"; position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--surface) 80%, transparent); color: var(--text); font-weight: 600; }

.compare { position: relative; width: 100%; aspect-ratio: 16 / 9; max-height: 72vh; border-radius: 12px; overflow: hidden; background: var(--surface-3); touch-action: none; }
.compare img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; pointer-events: none; }
.compare .c-after { clip-path: inset(0 0 0 50%); }
.compare .c-handle { position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; background: #fff; box-shadow: 0 0 0 1px rgba(0,0,0,.25); transform: translateX(-1px); pointer-events: none; }
.compare .c-handle::after { content: ""; position: absolute; top: 50%; left: 50%; width: 36px; height: 36px; border-radius: 50%; transform: translate(-50%, -50%); background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23222' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 6l-6 6 6 6M15 6l6 6-6 6'/%3E%3C/svg%3E") center / 20px no-repeat; box-shadow: 0 2px 10px rgba(0,0,0,.35); }
.compare .c-lbl { position: absolute; top: 10px; z-index: 2; background: rgba(0,0,0,.65); color: #fff; font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; pointer-events: none; }
.compare .c-lbl.l { left: 10px; } .compare .c-lbl.r { right: 10px; }
.side-by-side { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.side-by-side figure { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.side-by-side img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 10px; cursor: zoom-in; background: var(--surface-3); }
.side-by-side figcaption { font-size: 12px; font-weight: 700; color: var(--text-3); }
@media (max-width: 560px) { .side-by-side { grid-template-columns: minmax(0, 1fr); } }
.lightbox { position: fixed; inset: 0; z-index: 90; background: rgba(0,0,0,.92); display: grid; place-items: center; padding: 16px; cursor: zoom-out; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: 6px; }

/* Detail view */
.dl { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0; background: var(--surface); overflow: hidden; }
.dl > div { background: var(--surface); padding: 12px 16px; min-width: 0; box-shadow: 1px 1px 0 var(--border); } /* lines drawn by cells, so a short last row leaves no tinted gap */
.dl dt { font-size: 11.5px; color: var(--text-3); font-weight: 600; }
.dl dd { margin: 2px 0 0; font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* the last item stretches to fill a short final row */
.dl > div:last-child:nth-child(4n+1) { grid-column: span 4; }
.dl > div:last-child:nth-child(4n+2) { grid-column: span 3; }
.dl > div:last-child:nth-child(4n+3) { grid-column: span 2; }
@media (max-width: 720px) { .dl { grid-template-columns: repeat(2, minmax(0, 1fr)); } .dl > div:last-child { grid-column: auto; } .dl > div:last-child:nth-child(odd) { grid-column: span 2; } }
.notes { white-space: pre-wrap; overflow-wrap: anywhere; color: var(--text); font-size: 14px; }
.tagline { display: flex; flex-wrap: wrap; gap: 6px; }

/* Floating color-mode button */
.theme-fab { position: fixed; right: 24px; bottom: 24px; z-index: 45; display: flex; flex-direction: column; align-items: flex-end; gap: 10px; }
.tf-btn { width: 48px; height: 48px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); box-shadow: var(--shadow-lg); display: grid; place-items: center; transition: transform .15s; }
.tf-btn:hover { transform: scale(1.05); }
.tf-btn svg { width: 22px; height: 22px; }
.theme-fab.open .tf-btn { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tf-menu { display: none; flex-direction: column; gap: 2px; padding: 6px; min-width: 150px; background: var(--surface); border: 0; border-radius: 14px; box-shadow: var(--shadow-lg); animation: toastIn .18s var(--ease); }
.theme-fab.open .tf-menu { display: flex; }
.tf-menu button { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 12px; border: 0; border-radius: 9px; background: none; color: var(--text); font-weight: 600; text-align: left; }
.tf-menu button:hover { background: var(--surface-2); }
.tf-menu button.on { background: var(--accent-soft); color: var(--accent); }
.tf-sw { width: 16px; height: 16px; border-radius: 50%; border: 1px solid var(--border-strong); flex: none; }
.tf-light { background: #fff; } .tf-sepia { background: #f1e8d6; } .tf-dark { background: #071113; } .tf-auto { background: linear-gradient(135deg, #fff 50%, #071113 50%); }
.content { padding-bottom: 96px; }
@media (max-width: 720px) {
  .theme-fab { right: 14px; bottom: calc(var(--tabbar) + var(--safe-b) + 14px); }
  .tf-btn { width: 44px; height: 44px; }
  .content { padding-bottom: 72px; }
}

/* Weekly focus */
.focus { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 16px 18px; border-color: color-mix(in srgb, var(--accent) 35%, var(--border)); background: linear-gradient(135deg, var(--accent-soft), transparent 60%), var(--surface); }
.focus-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; }
.focus-ic svg { width: 20px; height: 20px; }
.focus-main { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.f-label { font-size: 11.5px; font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: .06em; }
.f-text { font-size: 15px; font-weight: 650; overflow-wrap: anywhere; }
.f-sugg { overflow-wrap: anywhere; }
.f-days { display: flex; gap: 6px; margin-top: 4px; }
.f-dot { width: 24px; height: 24px; border-radius: 7px; display: grid; place-items: center; font-size: 10.5px; font-weight: 700; background: var(--surface-3); color: var(--text-3); }
.f-dot.k { background: var(--pos); color: #fff; } .f-dot.b { background: var(--neg); color: #fff; }
.f-dot.now { box-shadow: 0 0 0 2px var(--accent); }
.f-act { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: flex-end; }
.f-yes { color: var(--pos); } .f-no { color: var(--neg); }
@media (max-width: 720px) {
  .focus { grid-template-columns: 36px minmax(0, 1fr); padding: 14px; gap: 12px; }
  .focus-ic { width: 36px; height: 36px; }
  .f-act { grid-column: 1 / -1; justify-content: flex-start; }
  .f-act .f-q { margin-right: auto; }
  .f-act .btn:not(.btn-icon):not(.btn-ghost) { flex: 1; }
}

/* Sample-size meter */
.sample { display: inline-grid; grid-template-columns: auto 56px; align-items: center; gap: 8px; justify-content: end; }
.sample .meter { margin: 0; height: 5px; }
.sample.wide { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; justify-content: stretch; }

/* Playbooks */
.pb-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.pb-card { border: 0; border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; min-width: 0; background: var(--surface-2); }
.pb-card > img, .pb-noimg { width: 100%; aspect-ratio: 16 / 8; object-fit: cover; cursor: zoom-in; background: var(--surface-3); }
.pb-noimg { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; color: var(--text-3); font-size: 12px; cursor: default; }
.pb-noimg svg { width: 22px; height: 22px; }
.pb-body { padding: 12px 14px 14px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.pb-snip { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; overflow-wrap: anywhere; }
.pb-box { display: flex; gap: 12px; padding: 12px; border: 0; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.pb-box img { width: 120px; height: 72px; object-fit: cover; border-radius: 8px; cursor: zoom-in; flex: none; }
.pb-rules { min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.pb-rules .notes { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; color: var(--text-2); }
@media (max-width: 420px) { .pb-box img { width: 88px; height: 56px; } }

/* Position sizing line */
.size-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; font-size: 13px; padding: 10px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--text); min-width: 0; }
.size-line > span { display: inline-flex; align-items: center; gap: 4px; flex-wrap: wrap; min-width: 0; }
.size-line svg { width: 16px; height: 16px; color: var(--accent); margin-right: 4px; flex: none; }

/* Quick tag */
.qt { padding: 14px; display: flex; flex-direction: column; gap: 8px; box-shadow: none; transition: border-color .2s; }
.qt.ok { border-color: color-mix(in srgb, var(--pos) 50%, var(--border)); }
.qt-head { display: flex; align-items: center; gap: 12px; min-width: 0; }
.qt-head .t-main b, .qt-head .t-main span { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.qt-ok { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; background: var(--surface-3); color: transparent; flex: none; }
.qt-ok svg { width: 14px; height: 14px; }
.qt.ok .qt-ok { background: var(--pos); color: #fff; }
.qt .label { margin-top: 2px; }

/* Pause screen */
.pause-hero { display: flex; flex-direction: column; align-items: center; gap: 4px; text-align: center; padding: 6px 0; }
.pause-hero .ic { width: 56px; height: 56px; border-radius: 18px; background: var(--neg-soft); color: var(--neg); display: grid; place-items: center; margin-bottom: 6px; }
.pause-hero .ic svg { width: 28px; height: 28px; }
.pause-hero b { font-size: 28px; }

/* Today's session */
.ss-steps { display: flex; gap: 6px; flex-wrap: wrap; }
.ss-step { display: inline-flex; align-items: center; gap: 5px; height: 26px; position: relative; padding: 0 10px; border-radius: 99px; font-size: 12px; font-weight: 700; background: var(--surface-3); color: var(--text-3); white-space: nowrap; }
.ss-step i { width: 8px; height: 8px; border-radius: 50%; border: 1.5px solid currentColor; display: inline-block; }
.ss-step svg { width: 13px; height: 13px; }
.ss-step.on { background: var(--pos-soft); color: var(--pos); }
.ss-k { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-3); }
.ss-plan { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 0; min-width: 0; }
.ss-clamp { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; }
.ss-cta { display: flex; align-items: center; gap: 12px; width: 100%; padding: 14px; border-radius: 12px; border: 0; background: var(--accent-soft); color: var(--text); text-align: left; }
.ss-cta:hover { border-color: var(--accent); }
.ss-cta > span:nth-child(2) { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.ss-cta > svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.ss-cta-ic { width: 40px; height: 40px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.ss-cta-ic svg { width: 20px; height: 20px; }
.ss-quick { display: flex; gap: 8px; min-width: 0; }
.ss-quick .input { flex: 1; min-width: 0; }
.ss-live { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.ss-live li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 8px; font-size: 13.5px; overflow-wrap: anywhere; }
.ss-foot { border-top: 1px solid var(--border); padding-top: 12px; flex-wrap: wrap; }
.ss-review { display: flex; flex-direction: column; gap: 6px; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 0; }
.inst { border: 0; border-radius: 12px; padding: 12px 14px; background: var(--surface-2); }
.inst.mine { border-color: var(--accent); background: var(--accent-soft); }
.inst ol { margin: 8px 0 0; padding-left: 20px; display: flex; flex-direction: column; gap: 4px; font-size: 14px; }

/* Backtest lab */
.bt-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 16px; }
.bt-card { padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; color: var(--text); text-decoration: none; transition: border-color .15s, transform .15s; min-width: 0; }
.bt-card:hover { border-color: var(--accent); text-decoration: none; transform: translateY(-1px); }
.bt-mini { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.bt-mini span { display: block; font-size: 11px; color: var(--text-3); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bt-mini b { font-size: 15px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.verdict { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); gap: 0; overflow: hidden; }
.verdict .v-main { padding: 20px; display: flex; flex-direction: column; gap: 8px; border-right: 0; min-width: 0; }
.verdict.v-good .v-main { background: linear-gradient(135deg, var(--pos-soft), transparent 70%); }
.verdict.v-bad .v-main, .verdict.v-weak .v-main { background: linear-gradient(135deg, var(--neg-soft), transparent 70%); }
.verdict.v-promising .v-main, .verdict.v-early .v-main { background: linear-gradient(135deg, var(--warn-soft), transparent 70%); }
.v-title { font-size: 24px; font-weight: 750; letter-spacing: -.02em; }
.v-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.v-cols > div { padding: 20px; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.v-cols > div + div { border-left: 0; }
.v-big { font-size: 28px; font-weight: 750; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
@media (max-width: 900px) { .verdict { grid-template-columns: minmax(0, 1fr); } .verdict .v-main { border-right: 0; border-bottom: 1px solid var(--border); } }
@media (max-width: 720px) { .verdict .v-main, .v-cols > div { padding: 16px; } .v-big { font-size: 22px; } .v-title { font-size: 21px; } }
.bt-quick { display: grid; grid-template-columns: minmax(0, 1.4fr) auto 90px auto auto auto; gap: 8px; align-items: center; }
.bt-quick .input { height: 40px; font-size: 15px; }
.bt-w { color: var(--pos); } .bt-l { color: var(--neg); }
.bt-note { max-width: 260px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-2); }
@media (max-width: 720px) {
  .bt-quick { grid-template-columns: minmax(0, 1fr) auto; }
  .bt-quick .input[data-q=date] { grid-column: 1 / -1; }
  .bt-quick > .btn { width: 100%; }
  .bt-quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bt-quick .seg { width: 100%; }
  .bt-quick .seg button { flex: 1; }
}

/* How to use */
.qs { display: flex; flex-direction: column; }
.qs-item { display: grid; grid-template-columns: 32px minmax(0, 1fr) 18px; gap: 12px; align-items: center; padding: 12px 20px; border: 0; border-top: 1px solid var(--border); background: none; color: var(--text); text-align: left; }
.qs-item:first-child { border-top: 0; }
.qs-item:hover { background: var(--surface-2); }
.qs-item > svg { width: 18px; height: 18px; color: var(--text-3); }
.qs-ck { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 13px; background: var(--surface-3); color: var(--text-2); }
.qs-ck svg { width: 16px; height: 16px; }
.qs-item.done .qs-ck { background: var(--pos); color: #fff; }
.qs-item.done b { text-decoration: line-through; color: var(--text-3); }
.qs-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.g-ic { width: 30px; height: 30px; border-radius: 9px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; flex: none; }
.g-ic svg { width: 16px; height: 16px; }
.g-steps { margin: 0; padding-left: 22px; display: flex; flex-direction: column; gap: 8px; font-size: 14px; line-height: 1.55; }
.g-steps li::marker { color: var(--accent); font-weight: 700; }
@media (max-width: 720px) { .qs-item { padding: 12px 16px; } }

/* Low-noise comparisons */
.hbar.few .ht { opacity: .4; }
.badge svg { width: 12px; height: 12px; }
.badge.sig-few, .badge.sig-none { background: var(--surface-3); color: var(--text-3); }
.cmp-builders { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.cmp-side { border: 0; border-radius: 12px; padding: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.cmp-tag { font-size: 11px; font-weight: 800; letter-spacing: .08em; color: var(--series-1); }
.cmp-b .cmp-tag { color: color-mix(in srgb, var(--series-2) 62%, var(--text)); }
.cmp-tag { color: color-mix(in srgb, var(--series-1) 80%, var(--text)); }
.em-row .badge.pos { color: var(--pos-ink); }
.em-row .badge.neg { color: var(--neg-ink); }
.cmp-more { border: 0; } .cmp-more > summary { padding: 4px 0; font-size: 13px; color: var(--text-2); } .cmp-more > .more-body { padding: 8px 0 0; }
.cmp-verdict { display: flex; gap: 10px; align-items: flex-start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 0; }
.cmp-verdict.sig-real { border-color: color-mix(in srgb, var(--accent) 45%, var(--border)); background: var(--accent-soft); }
.cmp-verdict .badge { flex: none; margin-top: 1px; }
.cmp-verdict p { font-size: 14px; }
.cmp-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; background: var(--series-1); }
.cmp-dot.b { background: var(--series-2); }
.cmp-names td { padding-top: 6px; padding-bottom: 6px; color: var(--text-2); white-space: normal; max-width: 220px; }
.cmp-tbl td.best { color: var(--accent); font-weight: 700; }
@media (max-width: 860px) { .cmp-builders { grid-template-columns: minmax(0, 1fr); } }
.edge-map { display: flex; flex-direction: column; gap: 8px; }
.em-row { display: grid; grid-template-columns: 62px minmax(0, 1fr); gap: 12px; align-items: start; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); border: 0; }
.em-k { justify-content: center; }
.em-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.em-main b { overflow-wrap: anywhere; }
.proc td:first-child { white-space: normal; }
.proc-h { font-weight: 600; margin-bottom: 4px; }
.proc td { vertical-align: top; }
@media (max-width: 720px) { .cmp-verdict { flex-direction: column; gap: 6px; } }

/* Glossary */
.content .card[id], .content details[id] { scroll-margin-top: calc(var(--topbar) + 16px); }
@media (max-width: 720px) { .content .card[id], .content details[id] { scroll-margin-top: calc(56px + var(--safe-t) + 12px); } }
.gl { margin: 0; display: flex; flex-direction: column; }
.gl-letter { font-size: 12px; font-weight: 800; color: var(--accent); letter-spacing: .08em; padding: 14px 0 4px; border-bottom: 1px solid var(--border); }
.gl-letter:first-child { padding-top: 0; }
.gl-item { padding: 10px 0; border-bottom: 1px solid var(--border); }
.gl-item:last-child { border-bottom: 0; }
.gl dt { font-weight: 650; font-size: 14.5px; overflow-wrap: anywhere; }
.gl dd { margin: 3px 0 0; color: var(--text-2); font-size: 13.5px; line-height: 1.5; }
.chip svg { width: 15px; height: 15px; flex: none; }

/* Security checkup */
.sec-item { align-items: flex-start; }
.sec-ic { width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center; flex: none; margin-top: 1px; }
.sec-ic svg { width: 15px; height: 15px; }
.sec-ic.ok { background: var(--pos-soft); color: var(--pos); }
.sec-ic.bad { background: var(--warn-soft); color: var(--warn); }

/* Auth extras */
.login-alt { text-align: center; font-size: 14px; color: var(--text-2); }
.login-alt a { font-weight: 650; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.check-top { align-items: flex-start; font-size: 13.5px; line-height: 1.45; color: var(--text-2); }
.check-top input { margin-top: 2px; }
.trust-row { list-style: none; margin: 0; padding: 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 6px 16px; font-size: 12.5px; color: var(--text-3); }
.trust-row li::before { content: "✓"; color: var(--pos); font-weight: 800; margin-right: 6px; }

/* Plan & billing */
.plan-bar { padding: 10px 28px; font-size: 13.5px; border-bottom: 1px solid var(--border); }
.plan-bar.info { background: var(--accent-soft); color: var(--text); }
.plan-bar.warn { background: var(--warn-soft); color: var(--text); }
.plan-bar.bad { background: var(--neg-soft); color: var(--text); }
.plan-bar-in { max-width: 1320px; margin: 0 auto; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.plan-bar-in > svg { width: 18px; height: 18px; flex: none; color: var(--accent); }
.plan-bar.bad .plan-bar-in > svg { color: var(--neg); } .plan-bar.warn .plan-bar-in > svg { color: var(--warn); }
.pb-text { flex: 1; min-width: 200px; }
.pb-act { display: flex; gap: 8px; flex-wrap: wrap; }
@media (max-width: 720px) { .plan-bar { padding: calc(10px + var(--safe-t)) 16px 10px; } .pb-act { width: 100%; } .pb-act .btn { flex: 1; } }
.pw-hero { display: flex; flex-direction: column; gap: 8px; }
.pw-price { display: flex; align-items: baseline; gap: 10px; }
.pw-price b { font-size: 30px; letter-spacing: -.02em; }
.pw-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.pw-list li { display: flex; gap: 10px; align-items: center; font-size: 14.5px; }
.pw-list svg { width: 18px; height: 18px; color: var(--pos); flex: none; }
.danger-zone summary { color: var(--neg); }

/* Dialog */
.dlg-wrap { position: fixed; inset: 0; z-index: 95; background: var(--scrim); display: grid; place-items: center; padding: 20px; animation: toastIn .2s var(--ease); }
.dlg { width: min(380px, 100%); padding: 20px; display: flex; flex-direction: column; gap: 16px; box-shadow: var(--shadow-lg); }
.dlg-text { font-size: 15px; font-weight: 600; }
.dlg .row { justify-content: flex-end; }
.btn-danger-solid { background: var(--neg); border-color: var(--neg); color: #fff; }

/* Toast */
.toasts { position: fixed; z-index: 100; left: 50%; transform: translateX(-50%); bottom: 24px; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; width: max-content; max-width: calc(100vw - 32px); }
@media (max-width: 720px) { .toasts { bottom: calc(var(--tabbar) + var(--safe-b) + 14px); } }
.toast { pointer-events: auto; background: var(--text); color: var(--bg); padding: 10px 16px; border-radius: 12px; font-size: 14px; font-weight: 600; box-shadow: var(--shadow-lg); display: flex; align-items: center; gap: 12px; animation: toastIn .3s var(--ease); max-width: 100%; }
.toast button { background: none; border: 0; color: var(--accent-2); font-weight: 700; padding: 0; }
[data-theme="dark"] .toast button { color: var(--accent); }
.toast.bad { background: var(--neg); color: #fff; }
@keyframes toastIn { from { transform: translateY(12px); opacity: 0; } }

/* Settings list */
.slist { display: flex; flex-direction: column; }
.sitem { display: flex; align-items: center; gap: 12px; padding: 14px 20px; border-top: 1px solid var(--border); min-width: 0; }
.sitem:first-child { border-top: 0; }
.sitem .s-main { flex: 1; min-width: 0; }
.sitem .s-main b { display: block; font-size: 14px; font-weight: 600; }
.sitem .s-main > span { display: block; font-size: 12.5px; color: var(--text-3); overflow-wrap: anywhere; }
.sitem > .btn, .sitem > .seg, .sitem > .switch, .sitem > .input { flex: none; }
@media (max-width: 720px) { .sitem { padding: 14px 16px; flex-wrap: wrap; } .sitem > .seg { width: 100%; } }
.editlist { display: flex; flex-direction: column; gap: 8px; }
.editrow { display: flex; gap: 8px; align-items: center; }
.editrow .input { flex: 1; height: 40px; }

/* More menu (mobile) */
.menu-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.menu-grid a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; padding: 18px 8px; border-radius: 14px; background: var(--surface); border: 0; color: var(--text); font-weight: 600; font-size: 13px; text-decoration: none; text-align: center; }
.menu-grid a svg { width: 24px; height: 24px; color: var(--accent); }

/* Theme picker */
.theme-pick { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
.theme-pick button { height: 34px; border-radius: 9px; border: 0; background: var(--surface-2); font-size: 12px; font-weight: 600; color: var(--text-2); display: flex; align-items: center; justify-content: center; gap: 6px; padding: 0 4px; }
.theme-pick button i { width: 12px; height: 12px; border-radius: 50%; border: 1px solid var(--border-strong); flex: none; }
.theme-pick button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
.theme-pick .t-light i { background: #fff; } .theme-pick .t-sepia i { background: #f1e8d6; } .theme-pick .t-dark i { background: #071113; }

/* Score ring */
.ring { position: relative; width: 112px; height: 112px; flex: none; }
.ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.ring .rb { fill: none; stroke: var(--surface-3); stroke-width: 10; }
.ring .rf { fill: none; stroke-width: 10; stroke-linecap: round; transition: stroke-dashoffset .8s var(--ease); }
.ring .rv { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; }
.ring .rv b { font-size: 26px; font-weight: 750; letter-spacing: -.02em; display: block; line-height: 1; }
.ring .rv span { font-size: 11px; color: var(--text-3); font-weight: 600; }
.score-row { display: flex; gap: 20px; align-items: center; flex-wrap: wrap; }
.score-row .s-list { flex: 1; min-width: 200px; display: flex; flex-direction: column; gap: 10px; }
.s-line { display: grid; grid-template-columns: minmax(0, 1fr) 44px; gap: 4px 12px; font-size: 13px; align-items: center; }
.s-line .meter { grid-column: 1 / -1; margin: 0; }
.s-line b { text-align: right; font-variant-numeric: tabular-nums; }

/* Rules */
.rules { display: flex; flex-direction: column; gap: 14px; }

/* Utility */
@media (max-width: 720px) { .tbl .hide-m { display: none; } .tbl th, .tbl td { padding-left: 10px; padding-right: 10px; } }
.m-only { display: none; }
@media (max-width: 720px) { .m-only { display: block; } }
.row { display: flex; align-items: center; gap: 10px; min-width: 0; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.mt-0 { margin-top: 0; }
.w-100 { width: 100%; }
.hide { display: none !important; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.divider { height: 1px; background: var(--border); }
.small { font-size: 12.5px; }
.offline-bar { background: var(--warn-soft); color: var(--warn); font-size: 13px; font-weight: 600; text-align: center; padding: 6px 12px; }
.page-enter { animation: pageIn .28s var(--ease); }
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ==========================================================================
   Login
   ========================================================================== */
.login-body { background: var(--bg); }
.login { min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
.login-hero {
  position: relative; overflow: hidden; display: flex; align-items: center; padding: 48px;
  background:
    radial-gradient(1200px 600px at 10% -10%, var(--bg-glow), transparent 60%),
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 100% 48px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 48px 100%,
    var(--surface-2);
  border-right: 0;
}
.login-hero-inner { width: 100%; max-width: 560px; margin: 0 auto; display: flex; flex-direction: column; gap: 32px; }
.login-headline { font-size: clamp(30px, 3.4vw, 44px); line-height: 1.12; letter-spacing: -.03em; font-weight: 750; }
.login-headline span { color: var(--accent); }
.login-chart { width: 100%; height: 200px; }
.login-line { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linecap: round; stroke-dasharray: 900; stroke-dashoffset: 900; animation: draw 2.2s .3s var(--ease) forwards; }
.login-area { opacity: 0; animation: fade 1.2s 1.2s forwards; }
.login-candles g { opacity: 0; animation: rise .5s var(--ease) forwards; }
.login-candles line { stroke-width: 1.5; }
.login-candles .up line { stroke: var(--pos); } .login-candles .up rect { fill: var(--pos); opacity: .55; }
.login-candles .dn line { stroke: var(--neg); } .login-candles .dn rect { fill: var(--neg); opacity: .55; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes fade { to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.login-points { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.login-points li { display: flex; flex-direction: column; gap: 4px; padding-top: 14px; border-top: 2px solid var(--border-strong); min-width: 0; }
.login-points b { font-size: 14px; }
.login-points span { font-size: 13px; color: var(--text-2); }
.login-panel { display: grid; place-items: center; padding: 32px 24px; position: relative; }
.login-card { width: 100%; max-width: 400px; display: flex; flex-direction: column; gap: 16px; }
.login-card h2 { font-size: 28px; letter-spacing: -.02em; font-weight: 750; }
.login-card .muted { margin-top: -10px; }
.login-card-brand { display: none; }
.login-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 14px; }
.login-row a { font-weight: 600; }
.pw-wrap { position: relative; display: block; }
.pw-wrap input { padding-right: 48px !important; }
.pw-toggle { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 36px; border: 0; background: none; color: var(--text-3); display: grid; place-items: center; border-radius: 8px; }
.pw-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.pw-toggle.on { color: var(--accent); }
.login-themes { display: flex; gap: 10px; justify-content: center; margin-top: 8px; }
.login-themes button { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--border-strong); padding: 0; }
.login-themes [data-t="light"] { background: #fff; } .login-themes [data-t="sepia"] { background: #f1e8d6; } .login-themes [data-t="dark"] { background: #071113; }
html[data-theme="light"] .login-themes [data-t="light"], html[data-theme="sepia"] .login-themes [data-t="sepia"], html[data-theme="dark"] .login-themes [data-t="dark"] { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@media (max-width: 960px) {
  .login { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto 1fr; }
  .login-hero { padding: calc(28px + var(--safe-t)) 24px 28px; border-right: 0; border-bottom: 1px solid var(--border); }
  .login-hero-inner { gap: 18px; }
  .login-headline { font-size: 26px; }
  .login-chart { height: 110px; }
  .login-points { display: none; }
  .login-panel { place-items: start center; padding: 28px 20px calc(28px + var(--safe-b)); }
  .login-card h2 { font-size: 24px; }
}

/* deposit / withdrawal shortcuts */
.cash-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin: 0 2px 12px; }
.cash-btns .btn { padding: 0 8px; gap: 6px; min-width: 0; }
.cash-btns .btn svg { flex: none; }
.cash-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.cash-row .btn { height: 46px; min-width: 0; padding: 0 10px; white-space: normal; line-height: 1.15; }
@media (max-width: 1100px) and (min-width: 721px) { .cash-btns { grid-template-columns: minmax(0, 1fr); margin: 0 0 12px; } .cash-btns .btn { padding: 0; } }
.seg.units button { min-width: 44px; }
.sec-ic.tip { background: var(--accent-soft, rgba(51,189,176,.14)); color: var(--accent); }

/* ===== Focus mode: a calm, full-screen space for logging a live trade =====
   Nothing from the page underneath shows through. One centred column. */
.scrim.zen { background: var(--bg); backdrop-filter: none; opacity: 0; transition: opacity .22s; }
.scrim.zen.show { opacity: 1; }
.sheet.zen { inset: 0; width: 100%; height: 100%; max-height: none; border: 0; border-radius: 0; background: var(--bg); transform: none; opacity: 0; transition: opacity .22s; }
.sheet.zen.show { opacity: 1; transform: none; }
.sheet.zen .grab { display: none; }
.sheet.zen .sheet-head { border-bottom: 0; padding: 14px max(16px, calc((100vw - 640px) / 2)) 8px; padding-top: calc(14px + var(--safe-t)); }
.sheet.zen .sheet-head h2 { font-size: 15px; font-weight: 600; color: var(--text-2); letter-spacing: .01em; }
.sheet.zen .sheet-body { padding: 8px max(16px, calc((100vw - 640px) / 2)) 32px; gap: 18px; }
.sheet.zen .sheet-foot { border-top: 1px solid var(--border); background: var(--bg); padding-left: max(16px, calc((100vw - 640px) / 2)); padding-right: max(16px, calc((100vw - 640px) / 2)); }
@media (prefers-reduced-motion: reduce) { .sheet.zen, .scrim.zen { transition: none; } }

/* Trade entry: essentials first, extras on request */
.intent { margin-bottom: 2px; }
.intent button { font-weight: 600; }
#f-trade, #f-nt { display: flex; flex-direction: column; gap: 18px; }
#f-trade.hide, #f-nt.hide { display: none; }
.fsec.ess { gap: 14px; }
.form-grid.prices { grid-template-columns: repeat(auto-fit, minmax(118px, 1fr)); }
.sizing { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field > span em { font-style: normal; font-weight: 400; margin-left: 6px; }
.opt-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 4px; border-top: 1px dashed var(--border); padding-top: 14px; }
.opt-bar.hide { display: none; }
.opt-l { font-size: 12.5px; color: var(--text-3); font-weight: 600; margin-right: 2px; }
.opt-bar .chip.set { border-style: solid; color: var(--text); }
.fsec.opt { padding: 14px 16px; border: 0; border-radius: var(--r-lg); background: var(--surface); }
.fsec.opt.hide { display: none; }
.fsec.opt .fsec-head { gap: 8px; }
.fsec.opt .fsec-head .small { flex: 1; min-width: 0; }
.opt-x { margin-left: auto; width: 32px; height: 32px; }
.nt-lead { margin: 0; color: var(--text-2); font-size: 14px; }
.nt-date { max-width: 260px; }
.nt-more summary { font-weight: 600; }

/* No-trade days around the app */
.cal .d.nt { border: 0; cursor: pointer; background: repeating-linear-gradient(135deg, var(--hm-0) 0 6px, var(--surface-3) 6px 12px); }
.cal .d .ntv { color: var(--text-3); font-size: 9.5px; letter-spacing: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nt-card .notes { margin: 0; }
.nt-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 10px; }
.nt-imgs img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-sm); border: 0; cursor: zoom-in; }
.nt-sum { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.nt-sum b { font-size: 26px; }
.nt-list { display: grid; margin-top: 12px; border-top: 1px solid var(--border); }
.nt-row { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); color: var(--text); text-decoration: none; font-size: 13.5px; }
.nt-row:hover { color: var(--accent); }
.ss-nt { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--text-2); }
.ss-nt span { flex: 1; min-width: 0; }
.ss-nt svg, .ss-ntbtn svg { width: 16px; height: 16px; }
.ss-ntbtn { align-self: flex-start; margin-left: -8px; color: var(--text-2); }
@media (max-width: 720px) { .nt-row { grid-template-columns: 92px minmax(0, 1fr); } }
.size-line.quiet { background: none; padding: 0 2px; font-size: 12.5px; }
.calc-strip.hide { display: none; }
.more-chips { display: contents; }
.more-chips.hide { display: none; }
@media (max-width: 720px) { .form-grid.prices { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; } .form-grid.prices .close-only:not(.hide) { grid-column: 1 / -1; } }
.sheet-body > *, #f-trade > *, #f-nt > *, .fsec > * { flex-shrink: 0; }

/* ===== Trade form: Before → During → After ===== */
.trade-sheet #f-trade { gap: 0; }
.phase-nav { position: sticky; top: -20px; z-index: 3; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 6px; margin: -6px 0 18px; background: var(--surface-2); border: 0; border-radius: 12px; }
.sheet.zen .phase-nav { top: -8px; background: var(--surface); }
.phase-nav a { display: flex; align-items: center; justify-content: center; gap: 6px; min-height: 36px; border-radius: 9px; color: var(--text-2); font-weight: 600; font-size: 13.5px; text-decoration: none; }
.phase-nav a::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--ph, var(--accent)); opacity: .55; }
.phase-nav a.on { background: var(--surface); color: var(--text); box-shadow: var(--shadow); }
.phase-nav a.on::before { opacity: 1; }
.phase-nav [data-ph=before], #ph-before { --ph: var(--accent); }
.phase-nav [data-ph=during], #ph-during { --ph: var(--warn); }
.phase-nav [data-ph=after], #ph-after { --ph: var(--pos); }
.phase { position: relative; padding: 0 0 28px 46px; }
.phase:last-child { padding-bottom: 8px; }
.phase:last-child::before { bottom: 8px; }
.phase + .phase { padding-top: 22px; border-top: 1px solid var(--border); }
.phase + .phase .phase-head .phase-n { top: 22px; }
.phase-head { display: flex; align-items: center; gap: 12px; min-height: 32px; margin-bottom: 16px; }
.phase-head .phase-n { position: absolute; left: 0; top: 0; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 14px; color: color-mix(in srgb, var(--ph) 60%, var(--text)); background: color-mix(in srgb, var(--ph) 16%, transparent); border: 0; }
.phase-head h3 { font-size: 17px; line-height: 1.2; }
.phase-head > div > span { display: block; font-size: 12.5px; color: var(--text-3); }
.phase-body { display: flex; flex-direction: column; gap: 14px; }
.phase-body > *, .phase-stack > * { flex-shrink: 0; }
.phase-stack { display: flex; flex-direction: column; gap: 14px; }
.phase-stack.hide, .phase-wait.hide { display: none; }
.sub-h { font-size: 12.5px; font-weight: 600; color: var(--text-3); padding-top: 12px; border-top: 1px dashed var(--border); margin-top: 4px; }
.phase-body > .sub-h:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.phase-wait { margin: 0; padding: 12px 14px; border-radius: 10px; background: var(--surface-2); color: var(--text-2); font-size: 13.5px; }
.form-grid.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.shots.one { grid-template-columns: minmax(0, 1fr); max-width: 420px; }
@media (max-width: 720px) {
  .phase { padding-left: 0; }
  .phase::before { display: none; }
  .phase-head .phase-n { position: static; width: 28px; height: 28px; font-size: 13px; flex: none; }
  .phase-head { margin-bottom: 12px; }
  .form-grid.g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid.g3 > :last-child:nth-child(odd) { grid-column: 1 / -1; }
  .shots.one { max-width: none; }
  .phase-nav { top: -16px; }
}

/* Payment history (Settings → Plan & billing) */
.pay { border-top: 1px solid var(--border); padding-top: 14px; }
.pay-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.pay-head h4 { margin: 0; font-size: 15px; }
.pay-empty { margin: 4px 0 0; }
.pay-list { list-style: none; margin: 0 0 10px; padding: 0; }
.pay-row { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; gap: 6px 16px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.pay-row:last-child { border-bottom: 0; }
.pay-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pay-main b { font-weight: 600; overflow-wrap: anywhere; }
.pay-main .faint { overflow-wrap: anywhere; }
.pay-side { display: flex; flex-direction: column; align-items: flex-end; gap: 3px; }
.pay-side .strike { text-decoration: line-through; color: var(--text-3); }
.pay-st { font-size: 12px; font-weight: 600; padding: 2px 8px; border-radius: 999px; background: var(--surface-3); color: var(--text-2); white-space: nowrap; }
.pay-st.pos { background: var(--pos-soft); color: var(--pos); }
.pay-st.neg { background: var(--neg-soft); color: var(--neg); }
.pay-st.warn { background: var(--warn-soft); color: var(--warn); }
.pay-rc { min-width: 0; }
.pay-rc .ic { width: 16px; height: 16px; }
@media (max-width: 520px) {
  .pay-row { grid-template-columns: minmax(0, 1fr) auto; }
  .pay-rc { grid-column: 1 / -1; justify-self: start; }
  .pay-rc:empty { display: none; }
  .pay-rc span { display: inline; }
}
@media (min-width: 521px) { .pay-row { grid-template-columns: minmax(0, 1fr) auto 108px; } .pay-rc { justify-self: end; } }
.demo-plan .seg { max-width: 100%; overflow-x: auto; scrollbar-width: none; }
.demo-plan .seg button { flex: 1 0 auto; }

/* ---------- Fit to trade? (Pip) ---------- */
.fit-fab { position: fixed; left: calc(var(--sidebar) + 20px); bottom: 24px; z-index: 44; display: flex; align-items: flex-end; gap: 8px; pointer-events: none; }
.fit-btn { pointer-events: auto; position: relative; width: 56px; height: 56px; padding: 0; border: 0; border-radius: 50%; background: var(--surface); box-shadow: var(--shadow-lg); display: grid; place-items: center; cursor: pointer; transition: transform .2s; }
.fit-btn .pip { width: 44px; height: 44px; transform-origin: 50% 90%; animation: pip-bounce .5s cubic-bezier(.3, .6, .4, 1) .8s 2 both; } /* two small hops when Pip appears, then still */
.fit-btn:hover { transform: translateY(-2px) rotate(-6deg); }
.fit-btn:hover .pip { animation: pip-wiggle .5s ease-in-out; }
.fit-dot { position: absolute; top: 4px; right: 4px; width: 12px; height: 12px; border-radius: 50%; background: #ff8fa3; border: 2px solid var(--surface); }
.fit-bubble { pointer-events: auto; cursor: pointer; margin-bottom: 30px; padding: 9px 13px; border-radius: 14px 14px 14px 4px; background: var(--surface); color: var(--text); font-size: 13px; font-weight: 600; box-shadow: var(--shadow-lg); white-space: nowrap; animation: pip-pop .35s cubic-bezier(.3,1.6,.6,1); }
@keyframes pip-bounce { 0%, 100% { transform: translateY(0); } 45% { transform: translateY(-7px); } 70% { transform: translateY(0); } 85% { transform: translateY(-1.5px); } }
@keyframes pip-wiggle { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-9deg); } 75% { transform: rotate(9deg); } }
@keyframes pip-pop { 0% { opacity: 0; transform: scale(.6) translateY(6px); } 100% { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .fit-btn .pip, .fit-bubble { animation: none; } }
@media (max-width: 900px) { .fit-fab { left: 14px; bottom: calc(var(--tabbar) + var(--safe-b) + 14px); } .fit-btn { width: 52px; height: 52px; } }
.fit-sheet .sheet-body { padding-top: 8px; }
.fit { display: flex; flex-direction: column; gap: 14px; min-height: 360px; }
.fit-top { display: flex; align-items: center; gap: 14px; }
.fit-top .pip { flex: none; }
.fit-say { display: flex; flex-direction: column; gap: 2px; padding: 10px 14px; border-radius: 16px 16px 16px 4px; background: var(--surface-2); min-width: 0; }
.fit-say b { font-size: 15px; }
.fit-say span { font-size: 13px; color: var(--text-2); }
.fit-dots { display: flex; gap: 6px; }
.fit-dots i { flex: 1; height: 6px; border-radius: 3px; background: var(--surface-3); transition: background .2s; }
.fit-dots i.done { background: var(--accent); }
.fit-dots i.now { background: color-mix(in srgb, var(--accent) 45%, var(--surface-3)); }
.fit-q { margin: 6px 0 0; font-size: 19px; line-height: 1.3; }
.fit-opts { display: grid; gap: 8px; }
.fit-o { min-height: 50px; padding: 12px 16px; border: 0; border-radius: 14px; background: var(--surface-2); color: var(--text); font-size: 15px; font-weight: 600; text-align: left; cursor: pointer; transition: background .15s, transform .1s; }
.fit-o:hover { background: var(--surface-3); }
.fit-o:active { transform: scale(.98); }
.fit-o.on { background: var(--accent); color: var(--accent-ink); }
.fit-back { align-self: flex-start; }
.fit-result { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 10px; padding-top: 6px; }
.fit-result .pip { animation: pip-pop .45s cubic-bezier(.3,1.6,.6,1); }
.fit-result h3 { margin: 4px 0 0; font-size: 22px; }
.fit-result > p { margin: 0; color: var(--text-2); max-width: 36ch; }
.fit-why { align-self: stretch; text-align: left; padding: 12px 14px; border-radius: 14px; background: var(--surface-2); display: grid; gap: 8px; }
.fit-why p { margin: 0; }
.fit-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-top: 4px; }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.fit-note { display: flex; gap: 12px; align-items: center; padding: 10px 12px; margin-bottom: 14px; border-radius: 14px; background: var(--warn-soft); }
.fit-note.red { background: var(--neg-soft); }
.fit-note b { display: block; font-size: 14px; } .fit-note span { font-size: 13px; color: var(--text-2); }
.fit-note .pip { flex: none; }
.fit-hero .card-body { display: flex; gap: 22px; align-items: center; flex-wrap: wrap; padding: 22px; }
.fit-hero .pip { flex: none; }
.fit-hero-txt { flex: 1; min-width: 220px; display: grid; gap: 8px; justify-items: start; }
.fit-hero-txt h2 { margin: 0; font-size: 22px; }
.fit-hero-txt p { margin: 0; }
.fit-days { display: grid; grid-template-columns: repeat(14, minmax(0, 1fr)); gap: 6px; }
.fit-days .fd { display: flex; flex-direction: column; align-items: center; gap: 6px; }
.fit-days .fd i { width: 100%; max-width: 30px; aspect-ratio: 1; border-radius: 50%; background: var(--surface-3); }
.fit-days .fd.green i { background: var(--pos); } .fit-days .fd.amber i { background: #e0a63a; } .fit-days .fd.red i { background: var(--neg); }
.fit-days small { font-size: 11px; color: var(--text-3); }
.fit-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 10px; }
.fit-stat { display: flex; gap: 10px; align-items: center; padding: 12px; border-radius: 14px; background: var(--surface-2); min-width: 0; }
.fit-stat b { display: block; font-size: 14px; } .fit-stat span { font-size: 12.5px; color: var(--text-2); }
@media (max-width: 720px) { .fit-stats { grid-template-columns: minmax(0, 1fr); } .fit-days { gap: 3px; } }
.ss-fit { border: 0; background: var(--surface-3); cursor: pointer; font: inherit; }
.ss-fit::after { content: ""; position: absolute; inset: -9px -4px; } /* 44px tap area */
.ss-fit.green { background: var(--pos-soft); color: var(--pos); } .ss-fit.amber { background: var(--warn-soft); color: var(--warn); } .ss-fit.red { background: var(--neg-soft); color: var(--neg); }
.ss-fit .fd-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; display: inline-block; }

/* ===================================================== Journal prompts */
.pr-hero .card-body { padding: 22px; background: linear-gradient(135deg, var(--accent-soft), transparent 70%); border-radius: inherit; }
.pr-hero-txt { display: flex; flex-direction: column; gap: 10px; max-width: 68ch; }
.pr-hero-txt h2 { font-size: 21px; line-height: 1.3; letter-spacing: -.01em; }
.pr-hero-txt .row { gap: 8px; margin-top: 4px; }
.pr-tabs { margin: 4px 0 2px; }
.pr-intro { margin: 0 2px; }
.pr-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 12px; }
.pr-cat { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-rows: auto auto; gap: 10px 12px; padding: 16px; color: var(--text); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.pr-cat:hover { transform: translateY(-1px); box-shadow: var(--shadow-lg, var(--shadow)); }
.pr-cat-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pr-cat-txt b { font-size: 14.5px; line-height: 1.3; }
.pr-cat-txt span { font-size: 12.5px; color: var(--text-3); }
.pr-meter { grid-column: 1 / -1; height: 5px; border-radius: 99px; background: var(--surface-3); overflow: hidden; }
.pr-meter i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }
.pr-ic { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.pr-ic svg { width: 19px; height: 19px; }
.pr-ic.lg { width: 52px; height: 52px; border-radius: 16px; } .pr-ic.lg svg { width: 26px; height: 26px; }
.pr-head .card-body { display: flex; gap: 16px; align-items: flex-start; }
.pr-head h2 { font-size: 20px; margin: 2px 0 6px; }
.pr-head p { max-width: 70ch; }
.pr-list { display: flex; flex-direction: column; padding: 6px; }
.pr-row { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 0; border-radius: 12px; background: transparent; color: var(--text); text-align: left; font: inherit; cursor: pointer; }
.pr-row:hover { background: var(--surface-3); }
.pr-row > svg { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.pr-row-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1; }
.pr-row-txt span { font-size: 14.5px; line-height: 1.4; }
.pr-row-txt small { font-size: 12px; color: var(--text-3); }
.pr-tick { display: grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--surface-3); color: #fff; flex: none; }
.pr-tick svg { width: 14px; height: 14px; }
.pr-row.done .pr-tick { background: var(--pos); }
.pr-foot { margin: 0 2px; }
.pr-ans { display: flex; flex-direction: column; gap: 12px; }
.pr-ans-cat { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13px; font-weight: 600; color: var(--text-2); }
.pr-ans-cat svg { width: 16px; height: 16px; color: var(--accent); }
.pr-ans-q { font-size: 18px; line-height: 1.35; }
.pr-prev-item { padding: 10px 12px; border-radius: 10px; background: var(--surface-3); }
.pr-prev-item + .pr-prev-item { margin-top: 8px; }
.pr-prev-item p { margin-top: 4px; white-space: pre-wrap; font-size: 14px; }
.pr-sheet .grow { flex: 1; }
.pr-filter { display: flex; flex-direction: column; gap: 10px; }
.pr-answers { display: flex; flex-direction: column; gap: 10px; }
.pr-answer { display: flex; flex-direction: column; gap: 6px; padding: 16px; border: 0; text-align: left; font: inherit; color: var(--text); cursor: pointer; width: 100%; }
.pr-answer b { font-size: 14.5px; line-height: 1.35; }
.pr-answer p { font-size: 14px; color: var(--text-2); white-space: pre-wrap; }
.pr-answer:hover { box-shadow: var(--shadow-lg, var(--shadow)); }
.pr-empty { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 8px; padding: 32px 20px; }
.pr-empty svg { width: 30px; height: 30px; color: var(--accent); }
.pr-empty p { max-width: 52ch; }
.pr-mini-q { font-size: 15px; line-height: 1.45; margin-bottom: 12px; max-width: 70ch; }
.fit-prompt { margin-top: 12px; text-align: center; }
@media (max-width: 720px) { .pr-grid { grid-template-columns: minmax(0, 1fr); } .pr-hero-txt h2 { font-size: 18px; } .pr-head .card-body { flex-direction: column; } }
@media (prefers-reduced-motion: reduce) { .pr-cat { transition: none; } .pr-cat:hover { transform: none; } }

/* Journal prompt photos and timestamps */
.pr-pics { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 8px; }
.pr-pic { position: relative; aspect-ratio: 1; border-radius: 10px; overflow: hidden; background: var(--surface-3); }
.pr-pic img { width: 100%; height: 100%; object-fit: cover; cursor: zoom-in; display: block; }
.pr-pic .shot-x { position: absolute; top: 4px; right: 4px; width: 26px; height: 26px; border-radius: 8px; border: 0; background: rgba(0,0,0,.6); color: #fff; display: grid; place-items: center; cursor: pointer; }
.pr-pic .shot-x svg { width: 13px; height: 13px; margin: 0; }
.pr-pic-add { aspect-ratio: 1; border-radius: 10px; background: var(--surface-3); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; font-size: 12.5px; font-weight: 600; color: var(--text-2); cursor: pointer; text-align: center; padding: 8px; }
.pr-pic-add:hover, .pr-pic-add:focus-visible { color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.pr-pic-add svg { width: 20px; height: 20px; }
.pr-pic-add.busy { opacity: .6; pointer-events: none; }
.pr-photos { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.pr-photos img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; cursor: zoom-in; }
.pr-photos.sm img { width: 52px; height: 52px; }
.pr-when { margin-top: -4px; }

/* Placeholders use the same muted ink as hint text, so they stay readable in every theme. */
input::placeholder, textarea::placeholder { color: var(--text-3); opacity: 1; }

/* Support tickets */
.sitem.tk-row { width: 100%; background: none; border-left: 0; border-right: 0; border-bottom: 0; text-align: left; font: inherit; color: inherit; cursor: pointer; }
.sitem.tk-row:first-child { border-top: 0; }
.sitem.tk-row:hover { background: var(--surface-2); }
.sitem.tk-row:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.sitem.tk-row .s-main b { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tk-no { color: var(--text-3); font-variant-numeric: tabular-nums; margin-right: 4px; }
.sitem.tk-row > .badge { flex: none; }
.tk-msg { margin: 4px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
#support .card-head { gap: 12px; }
@media (max-width: 520px) { #support .card-head { flex-wrap: wrap; } }

/* ---------- Date range picker ---------- */
.dr-presets { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.dr-fields { grid-template-columns: 1fr 1fr; }
.dr-fields input[type="date"] { min-width: 0; }
.dr-hint { margin: 10px 0 0; }
.dr-err { margin: 8px 0 0; color: var(--neg-ink); font-size: 13px; font-weight: 600; }
.dr-sheet .sheet-foot .grow { flex: 1; }
.dr-chip { white-space: nowrap; }
.dr-btn { white-space: nowrap; }
.dr-btn.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); }
.dr-btn svg, .dr-chip svg { width: 16px; height: 16px; }
@media (max-width: 420px) { .dr-fields { grid-template-columns: 1fr; } }

/* ---------- Fit to trade: history calendar, day sheet, trade row ---------- */
.fit-amber-c { color: #e0a63a; }
.fc-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.fc-head b { font-size: 15px; }
.fc-head .btn-icon[disabled] { opacity: .35; pointer-events: none; }
.fit-cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.fit-cal .dow { font-size: 11px; color: var(--text-3); text-align: center; font-weight: 700; padding-bottom: 2px; }
.fc-d { position: relative; min-width: 0; aspect-ratio: 1 / .86; border: 0; border-radius: 10px; padding: 5px 6px; display: flex; flex-direction: column; justify-content: space-between; align-items: flex-start; background: var(--surface-2); color: var(--text); font: inherit; cursor: pointer; overflow: hidden; text-align: left; }
.fc-d:hover { outline: 2px solid color-mix(in srgb, var(--accent) 55%, transparent); outline-offset: -2px; }
.fc-d:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.fc-d.future { cursor: default; background: transparent; color: var(--text-3); }
.fc-d.green { background: color-mix(in srgb, var(--pos) 32%, var(--surface)); }
.fc-d.amber { background: color-mix(in srgb, #e0a63a 30%, var(--surface)); }
.fc-d.red { background: color-mix(in srgb, var(--neg) 30%, var(--surface)); }
.fc-d.today .fc-n { background: var(--accent); color: var(--accent-ink); border-radius: 999px; padding: 0 6px; }
.fc-n { font-size: 12px; font-weight: 700; line-height: 18px; }
.fc-v { width: 100%; font-size: 11px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-variant-numeric: tabular-nums; color: var(--text-2); }
.fc-v.pos { color: var(--pos-ink); } .fc-v.neg { color: var(--neg-ink); }
.fc-sum { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; margin-top: 12px; font-size: 13px; color: var(--text-2); }
.fc-sum .lg { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.fc-sum .lg.green { background: var(--pos); } .fc-sum .lg.amber { background: #e0a63a; } .fc-sum .lg.red { background: var(--neg); }
.fc-sum .fc-net { margin-left: auto; white-space: nowrap; }
@media (max-width: 520px) { .fit-cal { gap: 4px; } .fc-d { padding: 4px; border-radius: 8px; } .fc-v { font-size: 10px; letter-spacing: -.01em; } .fc-sum .fc-net { margin-left: 0; width: 100%; } }
.fit-stat { position: relative; }
.fit-stat .fit-net { margin-left: auto; white-space: nowrap; font-variant-numeric: tabular-nums; }

.fd-fit { display: flex; gap: 14px; align-items: center; padding: 14px; border-radius: 14px; background: var(--surface-2); }
.fd-fit > div { display: grid; gap: 6px; justify-items: start; min-width: 0; }
.fd-fit .pip { flex: none; }
.fd-fit .chips { display: flex; flex-wrap: wrap; gap: 6px; }
.fd-total { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-top: 14px; }
.fd-total > div { display: grid; gap: 2px; padding: 12px; border-radius: 12px; background: var(--surface-2); min-width: 0; }
.fd-total b { font-size: 18px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.fd-h { margin: 18px 0 8px; font-size: 14px; }
.fd-sheet .tlist { margin: 0 -4px; }
.fd-empty { margin: 4px 0 0; }
.fd-sheet .sheet-foot .grow { flex: 1; }

.fit-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 44px; padding: 6px 10px; margin: -6px -10px 2px; width: calc(100% + 20px); border: 0; border-radius: 10px; background: transparent; color: var(--text); font: inherit; cursor: pointer; text-align: left; }
.fit-row:hover { background: var(--surface-2); }
.fit-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 0; }
.fit-row-v { margin-left: auto; display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.fit-row svg:last-child:not(.pip) { width: 16px; height: 16px; color: var(--text-3); flex: none; }
.tbl td.few, .tbl td.few.pos, .tbl td.few.neg { color: var(--text-3); font-style: italic; }
@media (max-width: 720px) {
  /* Trades filters: dates get their own row so the strategy and account names fit */
  .toolbar .dr-btn { flex: 1 1 calc(100% - 52px); justify-content: center; }
  .toolbar .dr-x { flex: none; }
}
.badge-btn { border: 0; font: inherit; font-size: 11.5px; font-weight: 700; cursor: pointer; min-height: 28px; }
.badge-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.more-wrap { display: flex; justify-content: center; margin-top: 4px; }
@media (max-width: 560px) { .tbl .rec-b { display: flex; width: fit-content; margin-top: 4px; } }
.badge-btn { position: relative; } .badge-btn::after { content: ""; position: absolute; inset: -8px -2px; } /* 44px tap area */

/* ---------- Today's plan inside the trade form: one quiet line, details on tap ---------- */
.dp { display: grid; gap: 8px; padding: 8px 10px 10px; margin-bottom: 14px; border-radius: 12px; background: var(--surface-2); }
.dp-head { display: flex; align-items: center; gap: 8px; min-height: 36px; width: 100%; min-width: 0; padding: 0 2px; border: 0; background: none; color: var(--text-2); font: inherit; font-size: 13px; text-align: left; cursor: pointer; }
.dp-head svg { width: 16px; height: 16px; flex: none; color: var(--text-3); }
.dp-head svg:last-child { transition: transform .15s; }
.dp.open .dp-head svg:last-child { transform: rotate(180deg); }
.dp-l { flex: none; font-weight: 700; color: var(--text); }
.dp-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dp-head:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 8px; }
.dp-full { display: grid; gap: 6px; padding: 2px 4px 2px 26px; font-size: 13px; color: var(--text-2); white-space: pre-line; }
.dp-full p { margin: 0; }
.dp-warn { margin: 0; padding: 8px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; line-height: 1.4;
  background: color-mix(in srgb, #e0a63a 18%, var(--surface)); color: var(--text); }
.dp-q { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding-left: 26px; font-size: 12.5px; color: var(--text-3); }
.dp-yn { display: inline-flex; gap: 6px; }
.dp-yn button { position: relative; min-width: 48px; height: 30px; padding: 0 12px; border: 0; border-radius: 999px; background: var(--surface-3); color: var(--text-2); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; }
.dp-yn button::after { content: ""; position: absolute; inset: -7px -3px; } /* 44px tap area */
.dp-yn button.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1.5px var(--accent); }
.dp-yn button:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.day-link { border: 0; padding: 0; background: none; color: inherit; font: inherit; cursor: pointer; text-decoration: underline; text-decoration-color: color-mix(in srgb, currentColor 35%, transparent); text-underline-offset: 3px; }
.day-link:hover { text-decoration-color: currentColor; }
.warn-t { color: var(--text); }
.fd-plan { margin-top: 12px; padding: 10px 14px; border-radius: 14px; background: var(--surface-2); font-size: 13px; }
.fd-plan summary { display: flex; gap: 10px; align-items: baseline; cursor: pointer; list-style: none; min-height: 28px; }
.fd-plan summary::-webkit-details-marker { display: none; }
.fd-plan summary .small { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fd-plan[open] summary .small { display: none; }
.fd-plan p { margin: 8px 0 0; color: var(--text-2); white-space: pre-line; }
.fd-live { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 4px; color: var(--text-2); }
.fd-live .num { display: inline-block; min-width: 46px; }
.dp-full[hidden], .dp-warn[hidden] { display: none; }
.fd-plan summary b { flex: none; white-space: nowrap; }
.badge-btn::after { inset: -8px 0; }
.day-link { position: relative; } .day-link::after { content: ""; position: absolute; inset: -13px 0; } /* 44px tap area */

/* ---------- Help button in the top bar ---------- */
.help-q { flex: none; color: var(--text-3); }
.help-q:hover, .help-q[aria-expanded="true"] { color: var(--text); }
.help-q svg { width: 20px; height: 20px; }
.help-menu { position: fixed; z-index: 120; width: 260px; padding: 6px; border-radius: 14px; background: var(--surface); box-shadow: 0 12px 40px rgba(0,0,0,.22), 0 0 0 1px var(--border); display: grid; gap: 2px; animation: hm-in .14s ease-out; }
.help-menu button { display: flex; gap: 12px; align-items: center; width: 100%; min-height: 48px; padding: 8px 10px; border: 0; border-radius: 10px; background: none; color: var(--text); font: inherit; text-align: left; cursor: pointer; }
.help-menu button:hover, .help-menu button:focus-visible { background: var(--surface-2); outline: none; }
.help-menu button svg { width: 18px; height: 18px; flex: none; color: var(--text-3); }
.help-menu b { display: block; font-size: 14px; } .help-menu small { display: block; font-size: 12px; color: var(--text-3); }
@keyframes hm-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Tour ---------- */
.tour { position: fixed; inset: 0; z-index: 200; }
.tour-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(6, 14, 16, .62); transition: all .25s ease; pointer-events: none; }
.tour.center .tour-hole { box-shadow: 0 0 0 9999px rgba(6, 14, 16, .62); }
.tour-card { position: fixed; padding: 16px 16px 14px; border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: 0 18px 50px rgba(0,0,0,.3); transition: top .25s ease, left .25s ease; outline: none; }
.tour-top { display: flex; align-items: center; justify-content: space-between; margin: -4px -6px 4px 0; }
.tour-n { font-size: 12px; font-weight: 700; color: var(--text-3); }
.tour-x { display: inline-grid; place-items: center; width: 36px; height: 36px; border: 0; border-radius: 50%; background: none; color: var(--text-3); cursor: pointer; }
.tour-x:hover { background: var(--surface-2); color: var(--text); }
.tour-x svg { width: 16px; height: 16px; }
.tour-card h3 { margin: 0 0 6px; font-size: 17px; }
.tour-p { margin: 0; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.tour-dots { display: flex; gap: 5px; margin: 14px 0 12px; }
.tour-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-3); transition: width .2s; }
.tour-dots i.done { background: color-mix(in srgb, var(--accent) 45%, var(--surface-3)); }
.tour-dots i.on { width: 18px; background: var(--accent); }
.tour-foot { display: flex; align-items: center; gap: 8px; }
.tour-foot .grow { flex: 1; }
.tour-foot [hidden] { display: none; }
@media (prefers-reduced-motion: reduce) { .tour-hole, .tour-card, .help-menu { transition: none; animation: none; } }
.tour-offer { position: fixed; z-index: 90; right: 20px; bottom: 24px; width: min(360px, calc(100vw - 24px)); padding: 14px 14px 12px 16px; border-radius: 16px; background: var(--surface); box-shadow: 0 14px 40px rgba(0,0,0,.22), 0 0 0 1px var(--border); display: grid; gap: 10px; animation: hm-in .2s ease-out; }
.tour-offer b { display: block; font-size: 15px; } .tour-offer span { font-size: 13.5px; color: var(--text-2); }
.tour-offer .row { justify-content: flex-end; gap: 8px; }
@media (max-width: 900px) { .tour-offer { right: 12px; bottom: calc(var(--tabbar) + var(--safe-b) + 84px); } }

/* ---------- A day in your journal ---------- */
.wf-cta { display: block; color: inherit; text-decoration: none; }
.wf-cta .card-body { display: flex; align-items: center; gap: 14px; }
.wf-cta:hover { box-shadow: 0 0 0 1.5px var(--accent); }
.wf-cta b { display: block; font-size: 15px; }
.wf-cta svg { width: 18px; height: 18px; color: var(--text-3); flex: none; }
.wf-cta-ic { display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 12px; background: var(--accent-soft); color: var(--accent); flex: none; }
.wf-cta-ic svg { color: var(--accent); width: 20px; height: 20px; }
.wf-intro .card-body { display: grid; gap: 16px; }
.wf-intro h2 { margin: 0 0 6px; font-size: 22px; }
.wf-intro p { margin: 0; max-width: 62ch; }
.wf-toc { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 8px; }
.wf-toc a { display: flex; gap: 10px; align-items: center; min-height: 48px; padding: 8px 10px; border-radius: 12px; background: var(--surface-2); color: var(--text); text-decoration: none; }
.wf-toc a:hover { box-shadow: inset 0 0 0 1.5px var(--accent); }
.wf-toc b { display: block; font-size: 13.5px; } .wf-toc small { display: block; font-size: 12px; color: var(--text-3); }
.wf-n { display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); font-size: 12.5px; font-weight: 700; flex: none; }
.wf-step { scroll-margin-top: 80px; }
.wf-step .card-body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: 28px; align-items: start; }
.wf-text { display: grid; gap: 12px; justify-items: start; min-width: 0; }
.wf-when { display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600; color: var(--text-3); }
.wf-text h3 { margin: 0; font-size: 19px; }
.wf-what { margin: 0; padding-left: 18px; display: grid; gap: 6px; color: var(--text-2); font-size: 14px; line-height: 1.5; }
.wf-sample { width: 100%; padding: 12px 14px; border-radius: 12px; background: var(--surface-2); }
.wf-sample .label { margin-bottom: 6px; }
.wf-sample dl { margin: 0; display: grid; gap: 8px; }
.wf-sample dl > div { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 10px; }
.wf-sample dt { font-size: 12.5px; font-weight: 700; color: var(--text-3); }
.wf-sample dd { margin: 0; font-size: 13.5px; line-height: 1.45; }
.wf-tip { margin: 0; display: flex; gap: 8px; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.wf-tip svg { width: 16px; height: 16px; flex: none; margin-top: 2px; color: var(--accent); }
.wf-shot { margin: 0; border-radius: 14px; overflow: hidden; background: var(--surface-2); box-shadow: 0 0 0 1px var(--border); }
.wf-shot img { display: block; width: 100%; height: auto; }
.wf-shot.phone { justify-self: center; width: min(300px, 100%); border-radius: 22px; }
.wf-end { display: flex; flex-wrap: wrap; gap: 14px; align-items: center; justify-content: space-between; }
.wf-end b { display: block; }
@media (max-width: 900px) {
  .wf-step .card-body { grid-template-columns: 1fr; gap: 18px; }
  .wf-sample dl > div { grid-template-columns: 1fr; gap: 2px; }
}
.wf-shot.tall { justify-self: center; width: min(420px, 100%); }
body.touring .fit-bubble, body.touring .tour-offer { display: none !important; }
.wf-n { color: color-mix(in srgb, var(--accent) 55%, var(--text)); }

/* Phones: fixed-height day cells so they never grow wider than their column (that hid the gaps). */
@media (max-width: 720px) { .fc-d { aspect-ratio: auto; height: 52px; } .fc-d.future { height: 52px; } }
.size-note { margin: 6px 0 0; font-size: 12px; color: var(--text-3); line-height: 1.4; }
.rv-seg { width: fit-content; } @media (max-width: 720px) { .rv-seg { width: 100%; } .rv-seg button { flex: 1; } }
@media (max-width: 380px) { .fc-d { padding: 3px 4px; } .fc-v { font-size: 9.5px; letter-spacing: -.02em; } .fc-d.today .fc-n { padding: 0 4px; } }
.sheet:focus { outline: none; }

/* Settings: symbols in the trade form */
.sym-seg { flex-wrap: wrap; }
.sym-seg .faint { font-weight: 500; margin-left: 2px; }
.sym-auto { display: flex; gap: 8px; align-items: flex-start; margin: 0; }
.sym-auto svg { width: 16px; height: 16px; flex: none; margin-top: 2px; }
.sym-add .input { flex: 1; min-width: 0; }
.sym-foot { justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 8px; }
