/* TradingView-style light theme (loaded after the built-in styles, so it wins) */
:root {
  --bg:#ffffff; --panel:#ffffff; --panel2:#f0f3fa; --line:#e0e3eb; --text:#131722; --dim:#787b86;
  --acc:#2962ff; --acc2:#2962ff; --up:#089981; --down:#f23645; --warn:#ff9800;
  --buy:#2962ff; --sell:#f23645; --gap:#e0e3eb; --hover:#f0f3fa;
}
html, body { background:var(--gap); font-family:-apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; }
.num { font-family:-apple-system, BlinkMacSystemFont, "Trebuchet MS", Roboto, Ubuntu, sans-serif; }

/* layout: white panels separated by thin grey gaps */
#app { grid-template-rows:38px 1fr; gap:4px; }
header { background:#fff; gap:2px; padding:0 8px; }
main { gap:4px; }
.logo { font:700 14px -apple-system, "Trebuchet MS", sans-serif; color:var(--text); padding:0 8px 0 2px; border-right:1px solid var(--line); margin-right:6px; }
.sym { font-weight:600; font-size:14px; border-radius:4px; padding:5px 8px; }
.sym:hover, .sname:hover { background:var(--hover); }
.sname { border-radius:4px; padding:5px 8px; color:var(--dim); }
.tfs { gap:0; padding:0 4px; border-left:1px solid var(--line); border-right:1px solid var(--line); margin:0 4px; }
.tfs button { background:none; color:var(--text); font-size:13px; font-weight:400; height:30px; padding:0 7px; border-radius:4px; }
.tfs button:hover { background:var(--hover); color:var(--text); }
.tfs button.on { background:none; color:var(--acc); font-weight:600; }
.hbtn { background:none; color:var(--text); height:30px; border-radius:4px; font-size:13px; }
.hbtn:hover { background:var(--hover); }
.hbtn.on { color:var(--acc); }
.clock { color:var(--dim); font-size:13px; }
.clock b { color:var(--text); }

/* left drawing toolbar */
.tools { background:#fff; padding:4px 0; gap:0; overflow-y:auto; overflow-x:visible; }
.tools .tb { position:relative; width:52px; display:flex; justify-content:center; }
.tools button { width:38px; height:38px; border-radius:4px; color:var(--text); }
.tools button:hover { background:var(--hover); color:var(--text); }
.tools button.on { color:var(--acc); background:none; }
.tools button.on:hover { background:var(--hover); }
.tools svg { width:24px; height:24px; stroke-width:1.2; }
.tools .more { position:absolute; right:0; top:0; width:12px; height:38px; display:none; place-items:center; cursor:pointer; color:var(--dim); border-radius:4px; }
.tools .tb:hover .more { display:grid; }
.tools .more:hover { background:var(--hover); color:var(--text); }
.tools .more svg { width:8px; height:8px; stroke-width:2; }
.tools hr { width:30px; border-top:1px solid var(--line); margin:4px auto; }
.flyout { position:fixed; z-index:46; background:#fff; border-radius:6px; box-shadow:0 2px 12px #0002, 0 0 0 1px var(--line); padding:6px 0; min-width:230px; max-height:calc(100vh - 20px); overflow-y:auto; color:var(--text); font:14px -apple-system, "Trebuchet MS", Roboto, sans-serif; }
.flyout .h { padding:10px 16px 4px; font-size:11px; color:var(--dim); letter-spacing:.04em; text-transform:uppercase; }
.flyout .it { display:flex; align-items:center; gap:12px; padding:0 16px; height:36px; cursor:pointer; white-space:nowrap; }
.flyout .it:hover { background:var(--hover); }
.flyout .it.on { color:var(--acc); }
.flyout .it svg { width:24px; height:24px; stroke:currentColor; fill:none; stroke-width:1.2; stroke-linecap:round; stroke-linejoin:round; flex:none; }
.flyout .it kbd { margin-left:auto; font:12px -apple-system, sans-serif; color:var(--dim); }

/* context menu */
.ctx { position:fixed; z-index:47; background:#fff; border-radius:6px; box-shadow:0 2px 12px #0002, 0 0 0 1px var(--line); padding:6px 0; min-width:240px; color:var(--text); font:14px -apple-system, "Trebuchet MS", Roboto, sans-serif; }
.ctx .it { display:flex; align-items:center; gap:10px; padding:0 16px; height:34px; cursor:pointer; white-space:nowrap; }
.ctx .it:hover { background:var(--hover); }
.ctx .it svg { width:20px; height:20px; stroke:currentColor; fill:none; stroke-width:1.3; stroke-linecap:round; stroke-linejoin:round; }
.ctx .it .ph { width:20px; }
.ctx .it kbd { margin-left:auto; font:12px -apple-system, sans-serif; color:var(--dim); padding-left:16px; }
.ctx .it.red { color:var(--down); }
.ctx hr { border:0; border-top:1px solid var(--line); margin:6px 0; }

/* bottom bar */
.center { gap:4px; grid-template-rows:1fr 38px; }
.tradebar { background:#fff; padding:0 8px; gap:4px; }
.tradebar .b, .tradebar .s { height:28px; padding:0 14px; border-radius:4px; font-weight:600; font-size:13px; }
.tradebar .s { color:#fff; }
.tradebar input { height:28px; background:#fff; border:1px solid var(--line); border-radius:4px; color:var(--text); }
.tradebar .bal { background:none; border:1px solid var(--line); border-radius:4px; padding:4px 10px; }
.replay { color:var(--text); border-left:1px solid var(--line); }
.rbtn { color:var(--text); height:28px; border-radius:4px; }
.rbtn:hover { background:var(--hover); }
.rbtn.play { color:var(--text); }
.replay select, .replay input { height:28px; background:#fff; border:1px solid var(--line); border-radius:4px; color:var(--text); font-size:13px; }
.replay .sep { background:var(--line); }

/* right panel + widget bar */
aside { border-left:0; }
.sec h3 { color:var(--text); font-size:13px; text-transform:none; letter-spacing:0; }
.seg { background:var(--panel2); border-radius:6px; }
.seg button { color:var(--dim); border-radius:4px; }
.seg button.on { background:#fff; color:var(--text); box-shadow:0 1px 2px #0002; }
.seg.side button.on.short { color:#fff; }
.field input, .field select { background:#fff; border-color:var(--line); border-radius:4px; color:var(--text); }
.pick { background:#fff; border-radius:4px; }
.summary div, .stats div, .pos { background:var(--panel2); border-radius:6px; }
.place { border-radius:4px; }
.place.short { color:#fff; }
.pos .acts button { background:#fff; border-radius:4px; }
#eq { background:var(--panel2); }
.rail { background:#fff; gap:2px; padding:6px 0; }
.rail button { color:var(--text); border-radius:4px; }
.rail button:hover { background:var(--hover); }
.rail button.on { background:none; color:var(--acc); }
.railtab { background:#fff; color:var(--dim); box-shadow:0 0 0 1px var(--line); }
.railtab:hover { color:var(--text); background:var(--hover); }

/* floating bits */
.quick { background:#fff; border:0; border-radius:6px; box-shadow:0 2px 12px #0002, 0 0 0 1px var(--line); }
.quick .go.short { color:#fff; }
.quick .x { background:var(--panel2); color:var(--text); }
.toast { background:#131722; color:#fff; border:0; border-radius:6px; }
.loading { color:var(--dim); }

/* sessions page + modals */
.spage { background:#f8f9fd; }
.primary { background:var(--acc); border-radius:6px; }
.ghost { background:#fff; border-color:#d1d4dc; border-radius:6px; color:var(--text); }
.snew, .scard, .card { background:#fff; border-radius:8px; }
.scard { box-shadow:0 1px 2px #0000000d; }
.grid3 input, .grid3 select, .grid2 input, .grid2 select, .scard .nm input { background:#fff; border-color:var(--line); border-radius:6px; color:var(--text); }
.scard .nums div, .scard .badge { background:var(--panel2); }
.modal { background:#0006; }
.sitem { background:#fff; }
.shead h2, .snew h3, .card h2, .stats b, .scard .nums b { font-family:-apple-system, "Trebuchet MS", Roboto, sans-serif; }
main { grid-template-columns:52px 1fr 310px var(--railw,52px); }
body.collapsed main { grid-template-columns:52px 1fr var(--railw,52px); }
.clock { margin-right:10px; }

.flyout.grid { display:grid; grid-template-columns:repeat(6, 40px); gap:2px; padding:6px; min-width:0; }
.flyout.grid .h { grid-column:1 / -1; }
.flyout.grid .it { height:40px; padding:0; justify-content:center; border-radius:4px; }
.flyout.grid .it span { display:none; }
.flyout.grid .it svg { width:26px; height:26px; }

/* favourites: star in the tool menus + floating toolbar */
.flyout .it kbd { min-width:0; }
.flyout .it .fav { margin-left:8px; width:22px; height:22px; flex:none; display:grid; place-items:center; border-radius:4px; color:#b2b5be; visibility:hidden; cursor:pointer; }
.flyout .it:hover .fav, .flyout .it .fav.on { visibility:visible; }
.flyout .it .fav:hover { background:#e0e3eb; color:#131722; }
.flyout .it .fav svg { width:16px; height:16px; stroke:currentColor; fill:none; stroke-width:1.5; stroke-linejoin:round; }
.flyout .it .fav.on { color:#131722; }
.flyout .it .fav.on svg { fill:currentColor; }
.flyout.grid .it { position:relative; }
.flyout.grid .it .fav { position:absolute; top:-2px; right:-2px; width:16px; height:16px; margin:0; }
.flyout.grid .it .fav svg { width:11px; height:11px; }
.favbar { position:fixed; z-index:39; display:flex; align-items:center; gap:2px; padding:3px; background:#fff; border-radius:6px; box-shadow:0 2px 8px #0002, 0 0 0 1px #e0e3eb; user-select:none; }
.favbar[hidden] { display:none; }
.favbar button { width:34px; height:34px; border:0; border-radius:4px; background:none; color:#131722; cursor:pointer; display:grid; place-items:center; padding:0; }
.favbar button:hover { background:#f0f3fa; }
.favbar button.on { color:#2962ff; }
.favbar svg { width:24px; height:24px; stroke:currentColor; fill:none; stroke-width:1.2; stroke-linecap:round; stroke-linejoin:round; }
.favbar .grip { width:14px; height:34px; display:grid; place-items:center; cursor:grab; color:#b2b5be; }
.favbar .grip svg { width:14px; height:14px; }
