:root {
  --bg: #070d18;
  --panel: #0d1626;
  --panel2: #111c2f;
  --line: #1c2a40;
  --text: #e8eef8;
  --muted: #8a99b2;
  --up: #22d38a;
  --dn: #ff4d5e;
  --blue: #2f7cff;
  --purple: #8b6cff;
  --amber: #f5b53d;
  --radius: 14px;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 14px/1.45 Inter, ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2 { margin: 0; font-weight: 600; }
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.up { color: var(--up); } .dn { color: var(--dn); } .purple { color: var(--purple); } .blue { color: var(--blue); }
.accent { color: var(--up); font-weight: 600; } .accent2 { color: var(--purple); }
.muted { color: var(--muted); } .sm { font-size: 12px; }
.big { font-size: 26px; display: block; font-weight: 600; } .xl { font-size: 34px; display: block; font-weight: 700; letter-spacing: -.5px; }
.center { text-align: center; }
.row { display: flex; align-items: center; } .gap { gap: 10px; flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.narrow { max-width: 760px; }
.empty { color: var(--muted); padding: 18px 0; text-align: center; }

/* shell */
.shell { display: grid; grid-template-columns: 236px 1fr; min-height: 100vh; }
.side { position: sticky; top: 0; height: 100vh; overflow-y: auto; background: #08101d; border-right: 1px solid var(--line); padding: 22px 10px; display: flex; flex-direction: column; }
.brand { padding: 0 14px 22px; text-align: center; }
.brand b { font-size: 27px; letter-spacing: .5px; display: block; } .brand b span { color: var(--blue); }
.brand small { letter-spacing: 2.5px; color: #c6d0e0; font-size: 11px; }
.side nav { display: flex; flex-direction: column; gap: 4px; }
.side nav a { display: flex; align-items: center; gap: 14px; padding: 11px 16px; border-radius: 10px; color: #c9d3e3; font-size: 15px; }
.side nav a:hover { background: var(--panel); }
.side nav a.on { background: linear-gradient(90deg, #13233d, #0f1a2d); color: #fff; box-shadow: inset 3px 0 0 var(--blue); }
.side nav a.on .ic { color: var(--blue); }
.side blockquote { margin: auto 18px 10px; color: #b9c4d6; font-size: 15px; line-height: 1.6; padding-top: 30px; }
main { min-width: 0; padding: 0 18px 28px; }
.top { display: flex; align-items: center; gap: 14px; padding: 12px 0; position: sticky; top: 0; background: rgba(7, 13, 24, .92); backdrop-filter: blur(8px); z-index: 5; }
.top .date { font-weight: 500; }
.page-title { display: none; font-size: 20px; }
.mkt { display: inline-flex; align-items: center; gap: 6px; background: #0f1d2a; color: var(--muted); padding: 4px 10px; border-radius: 8px; font-size: 13px; }
.mkt i { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.mkt.on { color: var(--up); } .mkt.on i { background: var(--up); box-shadow: 0 0 8px var(--up); }
.search { margin-left: auto; display: flex; align-items: center; gap: 8px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 7px 12px; width: min(420px, 36vw); color: var(--muted); }
.search input { background: none; border: 0; outline: 0; width: 100%; }
.iconbtn { background: none; border: 0; cursor: pointer; padding: 6px; position: relative; color: #c9d3e3; display: inline-flex; }
.top > .iconbtn:first-child { display: none; }
.bell b { position: absolute; top: 0; right: 0; background: var(--dn); color: #fff; font-size: 10px; border-radius: 9px; min-width: 16px; height: 16px; display: grid; place-items: center; }
.avatar-btn { width: 34px; height: 34px; border-radius: 50%; background: #3b4a66; display: grid; place-items: center; font-weight: 600; font-size: 13px; }
.scrim, .tabbar { display: none; }
.mobile-only { display: none !important; }

/* grid + cards */
.view { display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; gap: 14px; }
.g-top { grid-template-columns: 1.4fr 1.1fr .8fr 1.1fr; }
.g-mid, .g-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.g-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card { background: linear-gradient(180deg, var(--panel2), var(--panel)); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; min-width: 0; text-align: left; }
.card-h { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.card-h h2 { font-size: 17px; display: flex; align-items: center; gap: 8px; margin-right: auto; }
.link { color: var(--blue); font-size: 13px; background: none; border: 0; cursor: pointer; }
.stat .big { margin-top: 4px; }
.warn-card { border-color: #6b5320; background: linear-gradient(180deg, #2a2312, #1b170d); }

/* kpis */
.kpi { position: relative; min-height: 88px; }
.kpi .xl { margin-top: 4px; }
.kpi-chart { position: absolute; right: -6px; top: -6px; width: 52%; height: 78px; }
.kpi-chart.low { position: static; width: 100%; height: 70px; margin-top: 8px; }
.kpi-row { display: flex; justify-content: space-between; gap: 10px; margin-top: 14px; }
.kpi-row b { display: block; font-size: 22px; font-weight: 600; }
.chart { width: 100%; height: 100%; display: block; overflow: visible; }
.chart .grid { stroke: var(--line); stroke-width: 1; } .chart .axis { fill: var(--muted); font-size: 10px; }
.gauge { width: 130px; height: 130px; }
.gauge-track { fill: none; stroke: #1a2a3f; stroke-width: 10; stroke-linecap: round; }
.gauge-fill { fill: none; stroke: var(--up); stroke-width: 10; stroke-linecap: round; filter: drop-shadow(0 0 6px rgba(34, 211, 138, .5)); }
.gauge-text { fill: var(--text); font-size: 26px; font-weight: 600; }
.minibars { width: 60px; height: 40px; vertical-align: bottom; margin-left: 8px; }

/* bars, rows */
.bar { height: 10px; background: #1a2638; border-radius: 6px; overflow: hidden; flex: 1; }
.bar span { display: block; height: 100%; border-radius: 6px; }
.card > .bar { margin-bottom: 10px; }
.sp-row, .rc-row { display: flex; align-items: center; gap: 12px; padding: 8px 0; }
.sp-name { width: 42%; flex: none; } .sp-pct { width: 40px; text-align: right; } .sp-pnl { width: 70px; text-align: right; font-weight: 600; }
.rc-row > span:first-child { width: 42%; flex: none; } .rc-v { width: 90px; text-align: right; } .rc-t { display: flex; align-items: center; gap: 8px; }
.pill { font-size: 12px; padding: 3px 10px; border-radius: 7px; font-weight: 500; white-space: nowrap; }
.pill.win { background: rgba(34, 211, 138, .15); color: var(--up); } .pill.loss { background: rgba(255, 77, 94, .15); color: var(--dn); }
.pill.open { background: rgba(47, 124, 255, .15); color: var(--blue); }
.dot { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 50%; font-style: normal; font-size: 11px; flex: none; color: #04130c; }
.dot.ok { background: var(--up); } .dot.bad { background: var(--dn); color: #fff; }
.dot.lg { width: 30px; height: 30px; font-size: 16px; }

/* lists */
.checks { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.checks label { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.checks input { accent-color: var(--up); width: 16px; height: 16px; }
.checks li { display: flex; gap: 10px; align-items: flex-start; }
.checks.plan small { display: block; color: var(--muted); font-size: 12px; }
.checks.plan li.bad b { color: #ffb3ba; }
.bullets { margin: 6px 0 0; padding-left: 18px; color: #c9d3e3; }
.rules { margin: 0 0 12px; padding-left: 20px; display: flex; flex-direction: column; gap: 6px; }
.rules .x { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 11px; }
.tbl { width: 100%; border-collapse: collapse; }
.tbl th { color: var(--muted); font-weight: 500; text-align: left; padding: 8px; border-bottom: 1px solid var(--line); }
.tbl td { padding: 10px 8px; border-bottom: 1px solid #142036; }
.tbl tr[data-action] { cursor: pointer; } .tbl tr[data-action]:hover { background: #12203a; }
.r { text-align: right !important; } .c { text-align: center !important; }

/* coach */
.coach-msg { display: flex; gap: 12px; background: #0f1d33; border-radius: 12px; padding: 12px; margin-bottom: 10px; }
.coach-msg p { margin: 0 0 8px; } .avatar { font-size: 26px; }
.watch { border: 1px solid #6b5320; background: #231d0f; border-radius: 12px; padding: 12px; margin-bottom: 10px; color: #f3dca6; }
.watch b { color: var(--amber); } .watch p { margin: 6px 0 0; }
.chat { display: flex; flex-direction: column; gap: 8px; max-height: 50vh; overflow-y: auto; margin-bottom: 12px; }
.msg { padding: 10px 12px; border-radius: 12px; max-width: 85%; }
.msg.me { align-self: flex-end; background: var(--blue); } .msg.coach { background: #182640; }
.ask input { flex: 1; }

/* forms */
.f { display: flex; flex-direction: column; gap: 5px; flex: 1; min-width: 0; }
.f input, .f select, .f textarea { width: 100%; }
.f span { color: var(--muted); font-size: 13px; }
input, select, textarea { background: #0a1322; border: 1px solid #22324b; border-radius: 9px; padding: 9px 11px; outline: none; min-width: 0; }
input:focus, select:focus, textarea:focus { border-color: var(--blue); }
.ptc { display: flex; flex-direction: column; gap: 10px; }
.f2 { display: flex; gap: 10px; }
.verdict { display: flex; align-items: center; gap: 12px; border: 1px solid; border-radius: 12px; padding: 12px; margin-top: 4px; }
.verdict.ok { border-color: rgba(34, 211, 138, .6); background: rgba(34, 211, 138, .07); } .verdict.ok b { color: var(--up); }
.verdict.bad { border-color: rgba(255, 77, 94, .6); background: rgba(255, 77, 94, .07); } .verdict.bad b { color: #ff98a2; }
.verdict small { display: block; color: var(--muted); } .verdict > div { flex: 1; }
#ptc-result .checks { margin: 6px 0 10px; }
#ptc-result > .row { margin-top: 10px; }
.btn { border: 1px solid transparent; border-radius: 10px; padding: 9px 16px; cursor: pointer; font-weight: 600; display: inline-flex; align-items: center; justify-content: center; gap: 8px; white-space: nowrap; }
.btn.primary { background: var(--blue); } .btn.go { background: var(--up); color: #04130c; } .btn.warn { background: #3a1a20; color: #ffb3ba; border-color: #6b2a33; }
.btn.ghost { background: #101b2e; border-color: #22324b; } .btn.danger { background: #2a1015; color: #ff8a95; border-color: #5c1f28; }
.btn.block { width: 100%; padding: 14px; font-size: 16px; }
.switch { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--muted); } .switch input { accent-color: var(--up); }
.days { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.day { display: flex; align-items: center; gap: 4px; font-size: 12px; color: var(--muted); background: #0a1322; border: 1px solid #22324b; border-radius: 8px; padding: 4px 8px; }
.day input { accent-color: var(--up); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0; }
.chip { background: #101b2e; border: 1px solid #22324b; border-radius: 8px; padding: 5px 10px; font-size: 12px; cursor: pointer; }
.chip.on { border-color: rgba(34, 211, 138, .5); color: var(--up); background: rgba(34, 211, 138, .08); }
.tabs { display: inline-flex; background: #0a1322; border: 1px solid var(--line); border-radius: 10px; padding: 3px; gap: 2px; margin-bottom: 12px; }
.tab { background: none; border: 0; border-radius: 8px; padding: 6px 14px; color: var(--muted); cursor: pointer; }
.tab.on { background: var(--blue); color: #fff; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; flex-wrap: wrap; }
.toolbar .tabs { margin: 0; }

/* journal + screenshots */
.j-list { display: flex; flex-direction: column; gap: 8px; }
.j-list.scroll { max-height: 70vh; overflow-y: auto; padding-right: 4px; }
.j-item { display: flex; align-items: center; gap: 12px; background: #0b1424; border: 1px solid var(--line); border-left: 3px solid var(--blue); border-radius: 10px; padding: 8px 10px; cursor: pointer; text-align: left; width: 100%; }
.j-item.b-up { border-left-color: var(--up); } .j-item.b-dn { border-left-color: var(--dn); }
.j-item:hover { background: #10203a; }
.j-thumb { width: 64px; height: 36px; border-radius: 6px; overflow: hidden; background: #050a13; flex: none; }
.j-thumb svg, .j-thumb img { width: 100%; height: 100%; object-fit: cover; }
.j-main { flex: 1; min-width: 0; } .j-main b, .j-main small { display: block; } .j-main small { color: var(--muted); }
.j-right { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.shot { background: #050a13; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.shot img, .shot svg { width: 100%; display: block; }
.shot-cap { display: flex; justify-content: space-between; margin: 8px 0 0; font-size: 13px; }
.candles .c-up { fill: var(--up); stroke: var(--up); } .candles .c-dn { fill: var(--dn); stroke: var(--dn); }
.candles .vol { opacity: .45; stroke: none; } .candles line { stroke-width: 1; }
.candles .lvl.stop { stroke: var(--dn); stroke-dasharray: 4 4; opacity: .6; }
.tag rect { rx: 3; } .tag text { font-size: 11px; font-weight: 600; fill: #fff; }
.tag.entry rect { fill: #1d8a5c; } .tag.stop rect { fill: #d7303f; } .tag.target rect { fill: #1d8a5c; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.shot-card { cursor: pointer; color: inherit; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; margin: 14px 0; }
.kv dt { color: var(--muted); } .kv dd { margin: 0; text-align: right; text-transform: capitalize; }

/* weekly + equity */
.wk-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.wk-stats > div { display: flex; flex-wrap: wrap; align-items: flex-end; }
.wk-stats .muted { width: 100%; }
.callout { margin-top: 14px; background: #0d1a2e; border: 1px solid var(--line); border-radius: 12px; padding: 12px; color: #c9d3e3; }
.eq-wrap { position: relative; height: 180px; }
.eq-chg { position: absolute; right: 4px; top: -2px; font-weight: 700; font-size: 17px; }

/* calendar */
.cal-head, .cal { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal-head span { color: var(--muted); font-size: 12px; text-align: center; padding-bottom: 6px; }
.cal-cell { min-height: 84px; background: #0a1322; border: 1px solid var(--line); border-radius: 10px; padding: 6px 8px; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; cursor: pointer; text-align: left; }
.cal-cell.blank { background: none; border: 0; cursor: default; }
.cal-cell.pos { background: rgba(34, 211, 138, .08); border-color: rgba(34, 211, 138, .35); }
.cal-cell.neg { background: rgba(255, 77, 94, .08); border-color: rgba(255, 77, 94, .35); }
.cal-cell.today { outline: 2px solid var(--blue); }
.cal-d { color: var(--muted); font-size: 12px; } .cal-cell small { color: var(--muted); font-size: 11px; }

#toast { position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 30px); background: #1a2b47; border: 1px solid #2c4268; padding: 10px 16px; border-radius: 10px; opacity: 0; transition: .25s; pointer-events: none; z-index: 50; }
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* responsive */
@media (max-width: 1280px) {
  .g-top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-mid, .g-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .shell { display: block; }
  .side { position: fixed; left: 0; top: 0; z-index: 30; width: 260px; transform: translateX(-100%); transition: transform .2s; }
  .side.open { transform: none; }
  .scrim.open { display: block; position: fixed; inset: 0; background: rgba(0, 0, 0, .55); z-index: 20; }
  main { padding: 0 16px 90px; }
  .top { flex-wrap: wrap; gap: 8px; }
  .top > .iconbtn:first-child { display: inline-flex; }
  .top .date, .mkt { display: none; }
  .page-title { display: block; margin-right: auto; }
  .search { order: 5; width: 100%; margin: 0; }
  .g-top, .g-mid, .g-3, .g-2 { grid-template-columns: minmax(0, 1fr); }
  .g-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .desktop-only { display: none !important; }
  .mobile-only { display: block !important; } a.mobile-only.btn { display: flex !important; }
  .greet h1 { font-size: 22px; } .greet p { margin: 2px 0 0; }
  .tabbar { display: flex; position: fixed; bottom: 0; left: 0; right: 0; z-index: 10; background: rgba(8, 14, 26, .97); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
  .tabbar a, .tabbar button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11px; color: var(--muted); background: none; border: 0; padding: 4px; cursor: pointer; }
  .tabbar a.on { color: var(--blue); }
  .sp-name, .rc-row > span:first-child { width: 36%; }
  .cal-cell { min-height: 58px; padding: 4px; } .cal-cell b { font-size: 11px; } .cal-cell small { display: none; }
  .kpi-row b { font-size: 20px; }
  .tbl th, .tbl td { padding: 8px 4px; }
  .verdict { flex-wrap: wrap; } .verdict .btn { width: 100%; }
}
