/* CSR235 v0.4.9 — compact, synchronized analysis. No font-floor reductions.
   Cash palette is ordered luminance + explicit percentages, not a risk rating. */
:root { --cash-low: #000000; --cash-mid: #6a5b3d; --cash-high: #d3b579; --cash-none: #93908a; }
.graph-compact { padding: 0; overflow: visible; }
.graph-compact .graph-title-row { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; padding: 9px 18px; border-bottom: 1px solid #c4a66d27; background: #1a1917; border-radius: 12px 12px 0 0; }
.graph-compact .graph-title-row h2 { font-size: 21px; font-weight: 550; color: #f2e6cc; line-height: 1.35; margin: 0; }
.graph-compact .button { min-height: 36px; padding: 5px 11px; font-size: var(--ui-min); line-height: 1.4; }
.graph-compact .graph-focus-toggle { color: #e2c68f; white-space: nowrap; }
.graph-compact .chart-common-toolbar { position: sticky; top: 0; z-index: 8; background: #171715f7; backdrop-filter: blur(12px); padding: 8px 16px 2px; border-bottom: 1px solid #b8a27225; box-shadow: 0 5px 12px #0000001a; }
.graph-compact .chart-toolbar-top { display: flex; gap: 12px; align-items: center; justify-content: space-between; min-width: 0; }
.graph-compact .chart-range { flex-shrink: 0; display: flex; margin: 0; gap: 2px; }
.graph-compact .chart-range button { font-size: var(--ui-min); min-height: 36px; padding: 5px 9px; line-height: 1.4; }
.graph-compact .chart-window-label { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; margin-left: auto; }
.graph-compact .chart-window-label strong { font-size: var(--ui-min); color: #e5dfd1; font-variant-numeric: tabular-nums; white-space: nowrap; font-weight: 550; }
.graph-compact .chart-window-mode { font-size: var(--ui-min); padding: 3px 6px; line-height: 1.3; }
.graph-compact .chart-slide-row { display: grid; grid-template-columns: 34px 34px minmax(0,1fr) 34px 34px; gap: 7px; margin: 0; }
.graph-compact .chart-slide-row .chart-step { min-width: 34px; min-height: 34px; padding: 0; font-size: 19px; line-height: 1; }
.graph-compact .chart-slider { height: 38px; }
.graph-compact .chart-slider::-webkit-slider-runnable-track { height: 6px; }
.graph-compact .chart-slider::-webkit-slider-thumb { width: 22px; height: 22px; margin-top: -9px; }
.graph-compact .chart-legend { display: flex; align-items: center; gap: 17px; margin: 0; padding: 6px 18px 0; min-height: 28px; font-size: var(--ui-min); }
.graph-compact .line-key { gap: 6px; white-space: nowrap; }
.graph-compact .line-key::before { width: 20px; flex: 0 0 20px; }
.graph-compact .cash-scale { margin-left: auto; gap: 5px; display: inline-flex; align-items: center; flex-basis: auto; }
.cash-scale .cash-swatch { display: inline-block; border: 1px solid #ffffff40; border-radius: 3px; width: 11px; height: 11px; margin-left: 5px; }
.cash-scale .cash-low { background: var(--cash-low); }
.cash-scale .cash-mid { background: var(--cash-mid); }
.cash-scale .cash-high { background: var(--cash-high); }
.cash-scale i { background: linear-gradient(to right,var(--cash-low),var(--cash-mid),var(--cash-high)); }
.cash-green { color: var(--cash-high); }.cash-yellow { color: var(--cash-mid); }.cash-red { color: var(--cash-low); }
.graph-compact .price-chart, .graph-compact .realized-chart { width: 100%; margin: 0; padding: 0 12px; min-height: 0; }
.graph-compact .price-chart svg,.graph-compact .realized-chart svg { width: 100%; height: auto; display: block; }
.graph-compact .chart-axis { font-size: var(--ui-min); fill: #bcb5a5; }
.graph-compact .chart-point { stroke: #f0dfc477; stroke-width: .65; }
.graph-compact .chart-grid { stroke: #bca3701e; }
.graph-compact .chart-plot { fill: #151613; }
.graph-compact .chart-cursor { stroke: #e1c58799; }
.graph-compact .compact-readout { margin: 0 16px; padding: 5px 1px; display: flex; align-items: center; gap: 15px; flex-wrap: nowrap; font-size: var(--ui-min); line-height: 1.45; min-height: 33px; border: 0; border-bottom: 1px solid #ae965a22; border-radius: 0; background: transparent; white-space: nowrap; overflow-x: auto; scrollbar-width: thin; scrollbar-color: #786745 transparent; }
.graph-compact .compact-readout strong { font-size: var(--ui-min); font-weight: 650; color: #e2c78e; }
.graph-compact .compact-readout b { font-size: var(--ui-min); font-weight: 550; }
.graph-compact .compact-readout span { flex-shrink: 0; }
.graph-compact .compact-readout .readout-rate { color: #efd298; font-weight: 750; }
.graph-compact .cash-readout { display: inline-flex; align-items: center; gap: 5px; }
.graph-compact .cash-meter { display: inline-block; width: 42px; height: 6px; border: 1px solid #d9c38e70; background: #34322e; border-radius: 2px; overflow: hidden; }
.graph-compact .cash-meter i { display: block; height: 100%; border-radius: 1px; }
.graph-compact .realized-panel { margin: 0; padding: 8px 0 0; border-top: 0; }
.graph-compact .realized-heading { display: flex; flex-wrap: nowrap; gap: 12px; align-items: center; padding: 0 18px 2px; min-width: 0; }
.graph-compact .realized-heading h3 { margin: 0 0 3px; font-size: 19px; line-height: 1.35; font-weight: 550; }
.graph-compact .realized-legend { display: flex; gap: 14px; flex-wrap: wrap; color: #c6bfb1; font-size: var(--ui-min); }
.graph-compact .amount-key::before { border-color: #cac4b7; border-top-style: dashed; border-top-width: 2px; }
.graph-compact .return-key::before { border-color: #eccd8e; border-top-width: 3px; }
.graph-compact .realized-kpi { margin-left: auto; text-align: right; min-width: 225px; flex-shrink: 0; }
.graph-compact .realized-kpi>span { font-size: var(--ui-min); line-height: 1.3; }
.graph-compact .realized-kpi>strong { font-size: 34px; font-weight: 650; line-height: 1.1; margin: 3px 0 2px; letter-spacing: -.015em; font-variant-numeric: tabular-nums; }
.graph-compact .realized-kpi .realized-amount-label { font-size: var(--ui-min); color: #bdb6a7; }
.graph-compact #v4-realized-total { font-size: 19px; color: #dfd7c5; font-weight: 500; }
.graph-compact .realized-positive { color: #efd298; }.graph-compact .realized-negative { color: #dfa1b1; }.graph-compact .realized-neutral { color: #dfd7c8; }
.graph-compact .realized-area { fill: #d9c6a0; opacity: .045; }
.graph-compact .realized-amount-line { fill: none; stroke: #d0c5b0; stroke-width: 1.7; stroke-dasharray: 4 4; opacity: .87; vector-effect: non-scaling-stroke; }
.graph-compact .realized-return-line { fill: none; stroke: #edcc89; stroke-width: 2.5; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.graph-compact .return-axis { fill: #dfc189; }
.graph-compact .realized-rate-dot { fill: #e8c57d; stroke: #191914; stroke-width: 1.3; }
.graph-compact .realized-cursor-point { fill: #dad1bf; stroke: #151511; stroke-width: 1.3; }
.graph-compact .realized-zero { opacity: .5; }
.graph-compact .chart-detail-sheet { margin: 0 16px; font-size: var(--ui-min); color: #bfb9ac; }
.graph-compact .chart-detail-sheet>summary { min-height: 34px; line-height: 1.45; padding: 7px 0; cursor: pointer; color: #c5b69a; }
.graph-compact .chart-detail-sheet p { font-size: var(--ui-min); line-height: 1.6; margin: 7px 0 10px; }
.graph-compact .selection-detail-grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 8px 18px; }
.graph-compact .selection-detail-grid span { display: flex; gap: 6px; flex-wrap: wrap; }
.graph-compact .rate-unavailable-note { color: #e5c899; }
.graph-compact .empty { padding: 20px 16px; font-size: var(--ui-min); min-height: 70px; }
body.chart-focus-open { overflow: hidden; }
.graph-card.graph-focused { position: fixed; z-index: 5000; inset: 12px; width: auto; height: auto; max-height: none; margin: 0 !important; overflow-y: auto; overflow-x: hidden; background: #161714; box-shadow: 0 0 0 100vmax #080807d9; }
.graph-focused .chart-common-toolbar { top: 0; }
@media (max-width: 1180px) {
 .graph-compact .chart-toolbar-top { gap: 7px; flex-wrap: wrap; }
 .graph-compact .chart-window-label { order: 3; width: 100%; margin: 0; justify-content: space-between; gap: 5px; }
 .graph-compact .chart-toolbar-top>[data-action="v4-chart-latest"] { margin-left: auto; }
}
.mobile-ui .graph-compact .graph-title-row { padding: 7px 10px; gap: 5px; }
.mobile-ui .graph-compact .graph-title-row h2 { font-size: 18px; line-height: 1.35; }
.mobile-ui .graph-compact .graph-focus-toggle { font-size: 15px; min-height: 38px; padding: 4px 7px; }
.mobile-ui .graph-compact .chart-common-toolbar { padding: 5px 8px 0; }
.mobile-ui .graph-compact .chart-toolbar-top { flex-wrap: wrap; gap: 4px; }
.mobile-ui .graph-compact .chart-range { display: flex; width: auto; flex: 1; gap: 1px; margin-top: 0; }
.mobile-ui .graph-compact .chart-range button { font-size: 15px; padding: 5px 5px; min-height: 40px; flex: 1; }
.mobile-ui .graph-compact .chart-toolbar-top>.button { min-height: 40px; font-size: 15px; padding: 4px 7px; }
.mobile-ui .graph-compact .chart-window-label { order: 3; flex-basis: 100%; justify-content: space-between; width: 100%; margin: 0; padding: 1px 2px; gap: 4px; }
.mobile-ui .graph-compact .chart-window-label strong { font-size: 15px; }
.mobile-ui .graph-compact .chart-window-mode { font-size: 15px; padding: 2px 4px; }
.mobile-ui .graph-compact .chart-slide-row { grid-template-columns: 30px 30px minmax(0,1fr) 30px 30px; gap: 4px; }
.mobile-ui .graph-compact .chart-slide-row .chart-step { min-width: 30px; min-height: 36px; }
.mobile-ui .graph-compact .chart-slider { height: 38px; }
.mobile-ui .graph-compact .chart-legend { padding: 5px 11px 0; gap: 5px 12px; font-size: 15px; flex-wrap: wrap; }
.mobile-ui .graph-compact .cash-scale { flex-basis: auto; margin-left: auto; gap: 4px; }
.mobile-ui .graph-compact .cash-scale small { font-size: 15px; }
.mobile-ui .graph-compact .price-chart,.mobile-ui .graph-compact .realized-chart { width: 100%; margin: 0; padding: 0 4px; }
.mobile-ui .graph-compact .compact-readout { margin: 0 10px; min-height: 31px; padding: 4px 0; gap: 12px; font-size: 15px; }
.mobile-ui .graph-compact .compact-readout strong,.mobile-ui .graph-compact .compact-readout b { font-size: 15px; }
.mobile-ui .graph-compact .realized-panel { padding: 7px 0 0; margin: 0; }
.mobile-ui .graph-compact .realized-heading { padding: 0 10px 2px; align-items: center; gap: 8px; }
.mobile-ui .graph-compact .realized-heading h3 { font-size: 18px; margin-bottom: 3px; }
.mobile-ui .graph-compact .realized-legend { font-size: 15px; gap: 2px; display: flex; flex-direction: column; }
.mobile-ui .graph-compact .realized-legend .line-key::before { width: 14px; flex-basis: 14px; }
.mobile-ui .graph-compact .realized-kpi { min-width: 0; flex-shrink: 1; max-width: 58%; text-align: right; }
.mobile-ui .graph-compact .realized-kpi>span { font-size: 15px; }
.mobile-ui .graph-compact .realized-kpi>strong { font-size: 29px; line-height: 1.12; overflow-wrap: anywhere; }
.mobile-ui .graph-compact #v4-realized-total { font-size: 17px; }
.mobile-ui .graph-compact .chart-detail-sheet { margin: 0 10px; font-size: 15px; }
.mobile-ui .graph-compact .chart-detail-sheet>summary { min-height: 34px; padding: 6px 0; }
.mobile-ui .graph-compact .selection-detail-grid { grid-template-columns: 1fr; }
.mobile-ui .graph-card.graph-focused { inset: 4px; border-radius: 9px; }
@media (max-width: 420px) {
 .mobile-ui .graph-compact .cash-scale { flex-basis: 100%; margin-left: 0; padding-top: 1px; }
 .mobile-ui .graph-compact .graph-title-row h2 { font-size: 17px; }
 .mobile-ui .graph-compact .realized-legend { font-size: 15px; }
}
@media print {
 .graph-compact .chart-common-toolbar,.graph-focus-toggle { display: none !important; }
 .graph-card.graph-focused { position: static; overflow: visible; box-shadow: none; }
 .graph-compact .realized-return-line { stroke: #705114; }
 .graph-compact .realized-amount-line { stroke: #555; }
 .graph-compact .chart-axis { fill: #333; }
 .graph-compact .compact-readout { white-space: normal; flex-wrap: wrap; }
}
/* On phones, expose cash percentage without making users pan a hidden tooltip.
   Two short lines replace the old padded card; the expanded detail retains all values. */
.mobile-ui .graph-compact .compact-readout { flex-wrap: wrap; white-space: normal; gap: 2px 12px; overflow: visible; }
.mobile-ui .graph-compact .compact-readout .readout-secondary { display: none; }
