/* Trading journal. All workspace components share the course palette. */
.jr-page { padding:clamp(22px,3vw,39px) clamp(12px,3.2vw,38px) 30px; font-variant-numeric:tabular-nums; }
.jr-page button, .jr-page select, .jr-page input, .jr-page textarea { font-family:inherit; }
.jr-titlebar, .jr-title-actions, .jr-chart-bar, .jr-detail-head, .jr-section-heading, .jr-modal-head, .jr-bottom { display:flex; align-items:center; justify-content:space-between; gap:12px; }
.jr-titlebar { margin-bottom:22px; }
.jr-titlebar h1 { margin:9px 0 6px; font-weight:680; font-size:clamp(36px,4.5vw,58px); letter-spacing:-.064em; line-height:1.04; }
.jr-titlebar p:not(.eyebrow), .jr-dialog p, .jr-analytics p { color:var(--muted); font-size:13px; }
.jr-title-actions { gap:7px; flex-wrap:wrap; }
.jr-btn { display:inline-flex; align-items:center; justify-content:center; gap:6px; padding:7px 11px; background:#1c1c1b; border:1px solid #343330; border-radius:5px; color:#dedbd6; font-size:12px; font-weight:600; line-height:1.25; min-height:32px; }
.jr-btn:hover:not(:disabled) { background:#292625; border-color:#65514c; color:#fff; }
.jr-btn:disabled { opacity:.55; cursor:default; }
.jr-btn.jr-plan-btn { color:#f2b0a7; background:#261b1a; border-color:#57312f; }
.jr-dot { display:inline-block; width:6px; height:6px; border-radius:50%; background:#ee867d; }
.jr-stats { display:grid; grid-template-columns:1.35fr 1fr 1fr 1fr; border:1px solid #353330; border-radius:9px; overflow:hidden; background:#191919; }
.jr-stat { padding:14px clamp(11px,1.7vw,22px) 13px; display:flex; flex-direction:column; gap:5px; min-width:0; }
.jr-stat + .jr-stat { border-left:1px solid #353330; }
.jr-stat small, .jr-pair>span, .jr-risk small, .jr-stat>span, .jr-select>span { font-size:11px; line-height:1.3; color:#b5b0aa; }
.jr-stat strong,.jr-pair strong { font-size:clamp(24px,2.7vw,34px); font-weight:600; letter-spacing:-.05em; line-height:1.12; }
.jr-stat em,.jr-pair em { font:500 11px/1.2 Consolas,monospace; color:#b5afa8; letter-spacing:0; }
.jr-stat>span, .jr-stat canvas,.jr-stat .jr-meter { margin-top:auto; }
.jr-net { background:linear-gradient(109deg,#262020,#1a1918 85%); }

.jr-meter { height:3px; border-radius:3px; background:#383633; width:88px; margin-bottom:5px; }
.jr-meter i { display:block; height:100%; background:#bca9a1; }
.jr-loss { color:#f08c82; } .jr-gain { color:#f1eee8; }
.jr-section-heading { margin-top:19px; border-bottom:1px solid var(--line); }
.jr-section-heading nav,.jr-detail-tabs,.jr-chart-tools,.jr-filter-actions,.jr-chart-foot { display:flex; flex-wrap:wrap; align-items:center; gap:5px; }
.jr-section-heading nav { gap:20px; }
.jr-section-heading nav .jr-btn { padding:11px 1px; background:transparent; color:var(--muted); border:0; border-bottom:2px solid transparent; border-radius:0; font-size:14px; }
.jr-section-heading nav .jr-active { color:var(--text); border-bottom-color:var(--red); }
.jr-section-heading nav small { font:10px Consolas,monospace; color:#c6a39d; }
.jr-section-heading>span,.jr-bottom { font:11px/1.5 Consolas,monospace; color:var(--muted); }
.jr-filters { display:flex; flex-wrap:wrap; align-items:center; gap:8px; padding:12px 0; }
.jr-select { position:relative; display:flex; align-items:center; gap:5px; border:1px solid #343331; border-radius:5px; background:#171717; padding:0 6px 0 9px; }
.jr-select select { background:#171717; color:var(--text); border:0; font-size:12px; line-height:1.2; min-height:32px; min-width:0; cursor:pointer; }
.jr-filter-actions { margin-left:auto; }
.jr-table-wrap { min-width:0; max-width:100%; overflow-x:auto; container-type:inline-size; border:1px solid #343331; border-radius:7px; }
.jr-table { width:100%; border-collapse:collapse; text-align:left; font-size:12px; }
.jr-table>thead>tr>th { background:#1b1b1a; padding:9px 7px; font-weight:500; color:#aaa59e; font-size:11px; white-space:nowrap; }
.jr-table>thead>tr>th:first-child, .jr-row>td:first-child { padding-left:14px; }
.jr-sort { padding:0; min-height:0; border:0; background:transparent; font-size:inherit; color:inherit; }
.jr-row { cursor:pointer; }
.jr-row>td { padding:8px 7px; border-top:1px solid #2c2b2a; white-space:nowrap; }
.jr-row:hover { background:#1c1b1a; }
.jr-row.jr-chosen { background:#272322; }
.jr-chosen>td:first-child { box-shadow:inset 2px 0 #e87970; }
.jr-row [data-trade] { padding:0; background:transparent; border:0; text-align:left; display:flex; gap:9px; align-items:center; }
.jr-row [data-trade] b { display:block; font-size:13px; letter-spacing:.01em; }
.jr-row [data-trade] small { color:#aca6a0; display:block; font-size:10px; font-weight:400; }
.jr-asset { flex:none; display:grid; place-items:center; width:30px; height:30px; border-radius:50%; background:#292622; border:1px solid #4a4237; color:#c9b8a4; font:normal 19px/1 Georgia,serif; }
.jr-eth { color:#c5c4d2; background:#222329; border-color:#3e404b; }.jr-sol { color:#b8c5c4; background:#202524; border-color:#35403d; }
.jr-side { display:inline-flex; align-items:center; gap:4px; padding:3px 6px; border:1px solid #403c37; border-radius:4px; color:#d1cbc3; font-size:11px; }
.jr-side.short { border-color:#4d3330; color:#e5a49b; }
.jr-direction { position:relative; flex:none; width:10px; height:10px; transform:rotate(-45deg); }
.jr-side.short .jr-direction { transform:rotate(45deg); }
.jr-direction::before { content:""; position:absolute; left:1px; right:1px; top:4.5px; height:1px; background:currentColor; }
.jr-direction::after { content:""; position:absolute; width:5px; height:5px; right:1px; top:2.5px; border:solid currentColor; border-width:1px 1px 0 0; transform:rotate(45deg); }
.jr-pnl { font-family:Consolas,monospace; font-weight:600; font-size:13px; }
.jr-caret { color:#bfafa6; text-align:right; }
.jr-open>td { padding:0; }
.jr-detail { width:100%; max-width:100cqw; padding:12px 14px; border-block:1px solid #403733; background:#1b1a19; }
.jr-detail-head { margin-bottom:10px; flex-wrap:wrap; }
.jr-detail-head strong { margin-right:10px; font-size:14px; }
.jr-detail-head span { color:#b7afa7; font-size:11px; }
.jr-detail-tabs { gap:3px; }
.jr-detail-tabs .jr-btn,.jr-chart-tools .jr-btn,.jr-chart-foot .jr-btn { background:transparent; border:1px solid transparent; color:#b9b3ac; min-height:29px; padding:4px 8px; }
.jr-btn.jr-active,.jr-btn.jr-on { color:#f2e6df; border-color:#56423d; background:#302725; }
.jr-review { display:grid; grid-template-columns:minmax(0,2.45fr) minmax(195px,1fr); gap:12px; align-items:stretch; }
.jr-chart,.jr-ledger { min-width:0; border:1px solid #33312e; border-radius:6px; background:#141413; }
.jr-chart-bar { min-height:36px; padding:0 8px 0 12px; border-bottom:1px solid #292826; }
.jr-chart-bar b { font-size:13px; }.jr-chart-bar b span { color:#a39d95; font-size:11px; font-weight:500; }
.jr-candles { width:100%; height:clamp(158px,16vw,210px); display:block; touch-action:pan-y; }
.jr-chart-info { min-height:20px; padding:3px 10px; font:10px/1.5 Consolas,monospace; color:#c5b5ac; overflow-wrap:anywhere; }
.jr-chart-foot { border-top:1px solid #292826; padding:3px 6px; }
.jr-chart-foot span { margin-left:auto; color:#958f88; font:10px Consolas,monospace; }
.jr-chart-foot .jr-btn { font-size:11px; min-height:25px; }
.jr-ledger { display:flex; flex-direction:column; padding:12px 14px; }
.jr-pair { display:grid; gap:3px; }.jr-pair strong { font-size:24px; }
.jr-ledger dl { display:grid; gap:4px; margin:10px 0; }
.jr-ledger dl>div { display:flex; justify-content:space-between; gap:8px; }
.jr-ledger dt { color:#aaa49c; font-size:11px; } .jr-ledger dd { margin:0; font:12px Consolas,monospace; }
.jr-risk { display:grid; grid-template-columns:1fr 1fr; gap:10px; border-top:1px solid var(--line); padding-top:8px; }
.jr-risk>div { display:grid; gap:3px; }.jr-risk b { font:600 14px/1.4 Consolas,monospace; }
.jr-btn.jr-link { align-self:flex-start; padding:4px 0; border:0; background:transparent; color:#e8a298; min-height:27px; font-weight:500; }
.jr-detail-strip,.jr-note-actions { display:flex; align-items:center; flex-wrap:wrap; gap:4px 18px; padding-top:9px; color:#aaa49e; font-size:11px; }
.jr-detail-strip b { font:12px Consolas,monospace; color:#e4dfd7; }
.jr-excursions { margin-top:8px; font-size:11px; color:#bcb4ac; }.jr-excursions summary { cursor:pointer; }.jr-excursions p { margin:5px 0 0; max-width:85ch; }
.jr-bottom { flex-wrap:wrap; margin:12px 1px 0; }.jr-bottom strong { margin-left:5px; }
.jr-fill-list { overflow:auto; max-width:100%; border:1px solid #34322f; border-radius:6px; background:#151514; }
.jr-fill-list table { width:100%; border-collapse:collapse; text-align:left; font-size:12px; }
.jr-fill-list caption { text-align:left; padding:10px; font-weight:600; }
.jr-fill-list td,.jr-fill-list th { padding:7px 10px; border-top:1px solid #302e2b; white-space:nowrap; }
.jr-fill-list th { color:var(--muted); font-size:11px; font-weight:500; }.jr-in { color:#ed8d80; }
.jr-notes { display:grid; grid-template-columns:1fr 1fr; gap:10px; }
.jr-notes>label,.jr-dialog form>label { display:grid; gap:5px; font-size:12px; color:#c8c3bc; }
.jr-page textarea,.jr-dialog input[type=number] { width:100%; border:1px solid #423e3a; border-radius:5px; padding:9px; background:#151514; color:var(--text); font:13px/1.5 inherit; }
.jr-page textarea { font-size:13px; resize:vertical; }.jr-note-actions { grid-column:1/-1; gap:7px 12px; }.jr-note-actions .jr-btn { margin-left:auto; }
.jr-empty, .jr-analytics { padding:20px; background:#1a1918; border-radius:6px; }.jr-empty { display:flex; justify-content:space-between; gap:8px; align-items:center; }.jr-analytics p { margin:4px 0 12px; }
.jr-group { display:grid; grid-template-columns:1fr 2fr 1fr 1fr; align-items:center; gap:12px; padding:10px 0; border-top:1px solid var(--line); font-size:13px; }
.jr-group>div { height:4px; background:#33312e; }.jr-group i { display:block; height:100%; }.jr-group small { color:var(--muted); }
.jr-dialog { width:min(490px,calc(100% - 20px)); max-width:calc(100vw - 16px); max-height:90dvh; margin:auto; padding:clamp(16px,2.4vw,25px); border:1px solid #49433d; border-radius:10px; background:#1c1b1a; color:var(--text); box-shadow:0 20px 70px #0008; }
.jr-dialog::backdrop { background:#080808be; }.jr-dialog.jr-wide { width:min(1020px,calc(100% - 20px)); }.jr-wide .jr-candles { height:clamp(230px,48vh,500px); }
.jr-modal-head { margin-bottom:11px; }.jr-modal-head h2 { font-size:clamp(21px,3vw,27px); letter-spacing:-.04em; }.jr-btn.jr-close { width:32px; padding:0; font-size:19px; }
.jr-dialog p+p,.jr-dialog form,.jr-dialog .jr-risk,.jr-dialog .jr-fill-list { margin-top:12px; }.jr-dialog .jr-risk { margin-bottom:12px; }
.jr-plan-grid,.jr-checks { display:grid; grid-template-columns:1fr 1fr; gap:9px; margin:13px 0; }
.jr-plan-grid section { padding:12px; background:#141413; border:1px solid #36332f; border-radius:6px; }.jr-plan-grid section:last-child { border-color:#64413c; }.jr-plan-grid h3 { font-size:15px; margin-bottom:5px; }
.jr-dialog .jr-primary { background:#e47a70; color:#211311; border-color:#e47a70; padding:9px 13px; }.jr-dialog .jr-primary:hover:not(:disabled) { background:#efa398; color:#211311; }
.jr-dialog form>label+label { margin-top:9px; }.jr-dialog .jr-error { color:#f59c8f; margin:7px 0 10px; }.jr-checks label { font-size:13px; }.jr-checks input { accent-color:#da776b; }
@media(max-width:1000px) { .jr-filter-actions { margin-left:0; } .jr-select { gap:3px; } }
@media (min-width:681px) and (max-width:860px) { .app-bar { padding-inline:13px; } #app-nav { gap:8px; }.app-bar .access-tag { font-size:10px; } }
@media(max-width:760px) { .jr-titlebar { align-items:flex-start; flex-direction:column; gap:10px; } .jr-titlebar h1 { font-size:40px; }.jr-review { grid-template-columns:minmax(0,1.7fr) minmax(175px,1fr); gap:6px; }.jr-ledger { padding:10px; }}
@media(max-width:580px) { .jr-page { padding:19px 10px; }.jr-titlebar { margin:0 2px 15px; }.jr-titlebar h1 { font-size:clamp(33px,8.4vw,41px); }
 .jr-stats { grid-template-columns:1.1fr 1fr; }.jr-stat:nth-child(3) { border-left:0; }.jr-stat:nth-child(n+3) { border-top:1px solid #353330; }
 .jr-stat { padding:10px 12px; }.jr-stat strong { font-size:25px; }.jr-section-heading { margin-top:10px; }.jr-section-heading>span { font-size:9px; text-align:right; max-width:80px; }
 .jr-filters { display:grid; grid-template-columns:1fr 1fr; gap:5px; }.jr-select { justify-content:space-between; }.jr-filter-actions { grid-column:1/-1; }.jr-detail { padding:8px; }
 .jr-row>td,.jr-table>thead>tr>th { padding-inline:4px; }.jr-row>td:first-child,.jr-table>thead>tr>th:first-child { padding-left:6px; }.jr-asset { width:23px; height:23px; font-size:15px; }.jr-row [data-trade] { gap:5px; }
 .jr-detail-head { gap:5px; }.jr-detail-head>div { display:flex; flex-wrap:wrap; gap:1px 3px; align-items:center; }.jr-review { grid-template-columns:1fr; }.jr-candles { height:176px; }
 .jr-ledger { display:grid; grid-template-columns:1fr 1fr; gap:6px 12px; align-items:start; }.jr-ledger dl { margin:0; }.jr-ledger .jr-link { justify-self:end; align-self:end; }.jr-detail-strip { gap:3px 10px; }
 .jr-notes { grid-template-columns:1fr; }.jr-chart-foot { gap:1px; }.jr-chart-foot .jr-btn { padding:4px 5px; }.jr-group { grid-template-columns:1fr 1fr; gap:5px; }.jr-title-actions .jr-btn { min-height:34px; } }
@media(max-width:360px) { #mobile-nav .nav-button { font-size:11px; padding-inline:2px; }.jr-select { padding-left:5px; }.jr-select>span { font-size:10px; }.jr-select select { font-size:11px; }.jr-section-heading nav { gap:9px; }.jr-table>thead>tr>th { font-size:10px; }.jr-pnl { font-size:12px; }.jr-detail-tabs .jr-btn { padding-inline:6px; }.jr-checks,.jr-plan-grid { grid-template-columns:1fr; } }

/* Cumulative closed-trade result and the matching preview in the course feed. */
.jr-stats { grid-template-columns:minmax(0,1.45fr) minmax(230px,1fr); }
.jr-stats .jr-net { grid-row:span 3; justify-content:center; padding:15px 21px 12px; }
.jr-stats .jr-stat:not(.jr-net) { display:grid; grid-template-columns:minmax(0,1fr) auto; align-content:center; gap:4px 12px; padding:9px 21px; border-left:1px solid #353330; }
.jr-stats .jr-stat:nth-child(n+3) { border-top:1px solid #353330; }
.jr-stats .jr-stat:not(.jr-net)>strong { grid-column:2; grid-row:1/span 2; align-self:center; font-size:26px; }
.jr-stats .jr-stat:not(.jr-net)>span,.jr-stats .jr-stat .jr-meter { grid-column:1; margin:0; }
.jr-curve { min-width:0; color:#ead7cf; }
.jr-curve svg { display:block; width:100%; height:90px; overflow:visible; touch-action:pan-y; cursor:crosshair; }
.jr-curve svg:focus-visible { outline:1px solid var(--red); outline-offset:2px; border-radius:3px; }
.jr-curve svg text { fill:#b6ada7; font:10px Consolas,monospace; }
.jr-curve .grid,.jr-curve .zero { stroke:#453c39; stroke-dasharray:2 4; }.jr-curve .zero { stroke:#745b54; }
.jr-curve .curve-line { stroke:#e9b6a7; stroke-width:2.1; fill:none; stroke-linejoin:round; }
.jr-curve .area { fill:#db8274; fill-opacity:.1; }.jr-curve circle { fill:#f1c5b6; }.jr-curve .guide { stroke:#bfa398; stroke-opacity:.6; stroke-dasharray:2 3; }.jr-curve .cursor { fill:#f3d1c3; stroke:#251b19; stroke-width:1.7px; }
.jr-curve-readout,.jr-curve-empty { margin-top:4px; color:#bfb6ad; font:11px/1.4 Consolas,monospace; }
.jr-preview-head { display:flex; justify-content:space-between; align-items:flex-end; flex-wrap:wrap; gap:12px; margin-bottom:18px; }
.jr-preview-head .page-head { margin:0; }
.jr-preview-head .page-head p { color:var(--muted); }
.jr-preview-grid { display:grid; grid-template-columns:minmax(0,1.45fr) minmax(250px,1fr); background:#1a1918; border:1px solid #363330; border-radius:9px; overflow:hidden; }
.jr-preview-grid>.jr-net { padding:21px clamp(15px,2vw,25px); }
.jr-preview .jr-curve svg { height:104px; }
.jr-preview-trades { min-width:0; padding:19px clamp(14px,2vw,23px) 13px; border-left:1px solid #363330; }
.jr-preview-trades h3 { font-size:15px; font-weight:600; margin:0 0 6px; }
.jr-preview-trade { display:flex; align-items:center; gap:8px; width:100%; text-align:left; color:var(--text); background:transparent; border:0; border-bottom:1px solid #34302f; padding:7px 1px; }
.jr-preview-trade:hover { background:#24201f; }.jr-preview-trade>span { display:grid; }
.jr-preview-trade b { font-size:12px; }.jr-preview-trade strong { margin-left:auto; font:600 14px Consolas,monospace; }
.jr-preview-trade small,.jr-preview-caption { font:10px/1.4 Consolas,monospace; color:#aaa39c; }.jr-preview-trade i:last-child { color:#bc958b; font-style:normal; }.jr-preview-caption { margin:8px 0 0; }
.jr-scroll-tools { display:flex; align-items:center; gap:7px; padding:3px 0 8px; }
.jr-scroll-tools label { font:11px/1.3 Consolas,monospace; color:#b5ada7; margin-right:4px; }
.jr-scroll-tools button { border:1px solid #423d39; background:#1d1b19; border-radius:4px; font-size:15px; width:30px; min-height:28px; padding:0; }
.jr-scroll-tools button:disabled { opacity:.4; cursor:default; }
.jr-scroll-tools input { flex:1; min-width:35px; height:24px; margin:0; accent-color:#ca8d80; cursor:ew-resize; }
.jr-table-wrap { overscroll-behavior-x:contain; scrollbar-color:#9c756b #282321; }
.jr-table>thead>tr>th,.jr-row>td { padding-inline:12px; }
.jr-table .jr-optional { display:table-cell; min-width:100px; }
.jr-table>thead>tr>th:first-child,.jr-row>td:first-child { position:sticky; left:0; z-index:1; border-right:1px solid #3c3835; }
.jr-row>td:first-child { background:#151515; }.jr-chosen>td:first-child { background:#272322; }.jr-row:hover>td:first-child { background:#242120; }
.jr-open>td>.jr-detail { position:sticky; left:0; }
@media(max-width:680px) {
 .jr-preview-grid { grid-template-columns:1fr; }.jr-preview-trades { border-left:0; border-top:1px solid #363330; }.jr-preview-grid>.jr-net,.jr-preview-trades { padding:14px; }
 .jr-preview-head { align-items:flex-start; }.jr-preview-trades h3 { margin-bottom:3px; }
 .jr-stats { grid-template-columns:repeat(3,minmax(0,1fr)); }
 .jr-stats .jr-net { grid-column:1/-1; grid-row:auto; padding:12px 14px; }
 .jr-stats .jr-stat:not(.jr-net) { display:flex; align-items:flex-start; justify-content:space-between; gap:5px; border-top:1px solid #353330; padding:9px; }
 .jr-stats .jr-stat:nth-child(2) { border-left:0; }.jr-stats .jr-stat:not(.jr-net)>strong { align-self:flex-start; font-size:22px; }
 .jr-stats .jr-stat:not(.jr-net)>span { font-size:10px; }.jr-stats .jr-meter { max-width:100%; }
 .jr-table>thead>tr>th,.jr-row>td { padding-inline:8px; }.jr-table .jr-optional { min-width:90px; }
 .jr-scroll-tools { gap:5px; }.jr-scroll-tools label { max-width:9ch; }.jr-scroll-tools button { min-height:32px; }
}

[data-theme="light"] :is(.jr-btn,.jr-stats,.jr-net,.jr-select,.jr-select select,.jr-chart,.jr-ledger,.jr-fill-list,.jr-empty,.jr-analytics,.jr-dialog,.jr-plan-grid section,.jr-preview-grid,.jr-scroll-tools button,.jr-page textarea,.jr-dialog input[type=number]) { background:var(--surface); border-color:var(--line); color:var(--text); }
[data-theme="light"] :is(.jr-meter,.jr-group>div,.jr-detail,.jr-table>thead>tr>th,.jr-row>td:first-child) { background:var(--raised); border-color:var(--line); color:var(--text); }
[data-theme="light"] :is(.jr-row:hover,.jr-row:hover>td:first-child,.jr-preview-trade:hover,.jr-btn:hover:not(:disabled)) { background:#e8e4e2; color:var(--text); }
[data-theme="light"] :is(.jr-btn.jr-active,.jr-btn.jr-on,.jr-btn.jr-plan-btn,.jr-row.jr-chosen,.jr-chosen>td:first-child) { background:var(--red-dim); color:var(--red-strong); border-color:#c6a1a8; }
[data-theme="light"] .jr-meter i { background:var(--red); }
[data-theme="light"] :is(.jr-stat small,.jr-pair>span,.jr-risk small,.jr-stat>span,.jr-select>span,.jr-section-heading nav .jr-btn,.jr-section-heading nav small,.jr-section-heading>span,.jr-bottom,.jr-sort,.jr-row [data-trade] small,.jr-caret,.jr-detail-head span,.jr-detail-tabs .jr-btn,.jr-chart-tools .jr-btn,.jr-chart-foot .jr-btn,.jr-chart-bar b,.jr-chart-info,.jr-chart-foot span,.jr-ledger dt,.jr-detail-strip,.jr-note-actions,.jr-excursions,.jr-fill-list th,.jr-notes>label,.jr-dialog form>label,.jr-curve-readout,.jr-curve-empty,.jr-preview-trade small,.jr-preview-caption,.jr-scroll-tools label) { color:var(--muted); }
[data-theme="light"] :is(.jr-side,.jr-detail-strip b,.jr-section-heading nav .jr-active,.jr-preview-trade,.jr-stat em,.jr-pair em) { color:var(--text); }
[data-theme="light"] :is(.jr-side.short,.jr-loss,.jr-link,.jr-btn.jr-link) { color:var(--red); }
[data-theme="light"] .jr-dialog .jr-primary { color:white; background:var(--red); }
[data-theme="light"] .jr-preview-trades,[data-theme="light"] .jr-detail>section { border-color:var(--line); }
[data-theme="light"] .jr-curve svg text { fill:var(--muted); }
[data-theme="light"] .jr-curve :is(.grid,.zero) { stroke:#c8c3c1; }
[data-theme="light"] .jr-curve :is(.curve-line,.guide) { stroke:var(--red); }
[data-theme="light"] .jr-curve .area { fill:#b74657; }
[data-theme="light"] .jr-curve circle { fill:var(--red); }
[data-theme="light"] .jr-curve .cursor { stroke:var(--surface); }

:root[data-trade-palette] .jr-side.long { color:var(--trade-positive); border-color:color-mix(in srgb,var(--trade-positive) 42%,var(--line)); }
:root[data-trade-palette] .jr-side.short { color:var(--trade-negative); border-color:color-mix(in srgb,var(--trade-negative) 42%,var(--line)); }
:root[data-trade-palette] :is(.jr-gain,.desk .pnl-value.gain,[data-trade-price="entry"],.jr-curve-readout.gain) { color:var(--trade-positive); }
:root[data-trade-palette] :is(.jr-loss,.desk .pnl-value.loss,[data-trade-price="exit"],.jr-curve-readout.loss) { color:var(--trade-negative); }

button.trade-colors-trigger {
  background:var(--surface); color:var(--text); border:1px solid var(--line);
  border-radius:6px; padding:5px 8px; white-space:nowrap; cursor:pointer; font-size:12px;
}
dialog.trade-colors-dialog {
  width:min(390px,calc(100% - 24px)); max-height:90dvh; margin:auto; padding:16px;
  border:1px solid var(--line); border-radius:12px; background:var(--surface); color:var(--text);
}
.trade-colors-dialog form { display:grid; gap:12px; }
.trade-colors-dialog h2 { margin:0; font-size:20px; }
.trade-colors-dialog fieldset { display:grid; gap:4px; margin:0; padding:0; border:0; min-width:0; }
.trade-colors-dialog legend { padding:0; margin-bottom:6px; color:var(--muted); font-size:12px; }
.trade-colors-dialog label {
  display:grid; grid-template-columns:auto auto 1fr; gap:10px; align-items:center;
  padding:6px 8px; margin:0; border:1px solid var(--line); border-radius:6px;
  cursor:pointer; font-size:13px; color:var(--text);
}
.trade-colors-dialog label:has(input:checked) { border-color:var(--muted); background:var(--stage,var(--surface)); }
.trade-colors-dialog input[type="radio"] { width:14px; height:14px; margin:0; padding:0; accent-color:var(--red); cursor:pointer; }
.trade-colors-dialog small { display:block; font-size:11px; color:var(--muted); }
.trade-color-swatches { display:flex; gap:3px; }
.trade-color-swatches i { width:11px; height:11px; border:1px solid var(--sample-up-ink); border-radius:2px; background:var(--sample-up); }
.trade-color-swatches i+i { border-color:var(--sample-down-ink); background:var(--sample-down); }
.trade-color-preview { padding:5px 8px 8px; border:1px solid var(--line); border-radius:6px; background:var(--stage,var(--surface)); }
.trade-color-candles { position:relative; height:99px; background:repeating-linear-gradient(0deg,transparent 0 23px,var(--line) 23px 24px); }
.trade-color-candles i {
  position:absolute; width:8px; left:var(--x); top:var(--y); height:var(--height);
  transform:translateX(-50%); background:var(--sample-fill); border:1px solid var(--sample-ink); border-radius:1px;
}
.trade-color-candles i::before,.trade-color-candles i::after {
  content:""; position:absolute; width:1px; height:5px; left:50%; transform:translateX(-50%); background:var(--sample-ink);
}
.trade-color-candles i::before { bottom:100%; }
.trade-color-candles i::after { top:100%; }
.trade-color-preview .sample-up { --sample-fill:var(--sample-up); --sample-ink:var(--sample-up-ink); }
.trade-color-preview .sample-down { --sample-fill:var(--sample-down); --sample-ink:var(--sample-down-ink); }
.trade-color-legend { display:flex; gap:6px; flex-wrap:wrap; justify-content:space-between; padding-top:5px; }
.trade-color-legend > * { color:var(--sample-ink); border:1px solid var(--line); border-radius:3px; font-size:11px; padding:2px 5px; }
.trade-color-actions { display:flex; gap:7px; justify-content:flex-end; }
.trade-color-actions button { cursor:pointer; border:1px solid var(--line); background:var(--stage,var(--surface)); color:var(--text); border-radius:6px; padding:6px 10px; }
.trade-color-actions button[type="submit"] { color:#fff; background:#a72f41; border-color:#a72f41; }
