.flow-main { max-width:var(--investment-content-width); }
.flow-filter-row { grid-column:1 / -1; min-width:0; }
.flow-filter-row label { flex:1; }
.flow-controls,.flow-toolbar,.flow-chart-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:12px; }
.flow-toolbar { justify-content:space-between; }
.flow-controls label { display:grid; gap:6px; }
.flow-meta { display:flex; flex-wrap:wrap; align-items:center; justify-content:space-between; gap:8px 16px; margin-block:16px 24px; color:var(--modern-muted); font-size:var(--investment-caption-size); }
.flow-meta p { margin:0; }
.flow-end-of-day { display:inline-flex; align-items:center; gap:6px; white-space:nowrap; }
.flow-end-of-day::before { content:''; width:6px; height:6px; border-radius:50%; background:var(--investment-accent); }
.flow-workspace { display:grid; grid-template-columns:minmax(0,1fr) 280px; gap:32px; align-items:start; }
.flow-plot-column { min-width:0; }
.flow-chart-toolbar { justify-content:space-between; margin-bottom:24px; }
#flow-legend { gap:4px; }
#flow-legend button { display:flex; align-items:center; gap:6px; }
#flow-legend button::before { content:''; width:18px; border-top:2px solid; }
#flow-legend [data-investor="0"] { color:#087c65; }
#flow-legend [data-investor="1"] { color:#245bc2; }
#flow-legend [data-investor="1"]::before { border-top-style:dashed; }
#flow-legend [data-investor="2"] { color:#8446a5; }
#flow-legend [data-investor="2"]::before { border-top-style:dotted; }
#flow-legend button[aria-pressed="false"]::before { opacity:.25; }
#flow-legend button[aria-pressed="false"] { color:var(--modern-muted); text-decoration:line-through; }
#flow-charts { outline-offset:6px; touch-action:pan-y pinch-zoom; }
#flow-charts svg { display:block; width:100%; height:180px; overflow:hidden; cursor:crosshair; user-select:none; -webkit-user-select:none; }
#flow-charts svg text { fill:var(--modern-muted); font:11px system-ui,sans-serif; font-variant-numeric:tabular-nums; }
#flow-amount-title { margin-top:20px; }
#flow-amounts { height:250px; }
#flow-help,.flow-caption { color:var(--modern-muted); font-size:var(--investment-caption-size); line-height:1.6; }
.flow-details { position:sticky; top:100px; min-width:0; padding-left:24px; border-left:1px solid var(--modern-border); }
.flow-date-nav { display:flex; align-items:center; justify-content:space-between; gap:8px; font-variant-numeric:tabular-nums; }
.flow-date-nav button { min-width:44px; }
#flow-close-label { margin-block:20px 4px; }
#flow-close { margin-block:0; }
#flow-updated:not(:empty) { margin-top:4px; }
.flow-table-wrap { max-width:100%; overflow-x:auto; }
.flow-table-wrap table { width:100%; border-collapse:collapse; font-size:var(--investment-label-size); font-variant-numeric:tabular-nums; }
.flow-table-wrap th,.flow-table-wrap td { padding:12px 14px; text-align:right; white-space:nowrap; border-bottom:1px solid var(--modern-border); }
.flow-table-wrap th:first-child,.flow-table-wrap td:first-child { text-align:left; }
#flow-detail { font-size:var(--investment-caption-size); }
#flow-detail th,#flow-detail td { padding:12px 6px; }
#flow-detail caption { text-align:left; color:var(--modern-muted); margin-bottom:8px; }
#flow-status:not(:empty) { padding:12px 16px; background:var(--modern-soft); border-left:3px solid var(--investment-accent); font-size:var(--investment-caption-size); line-height:1.6; }
#flow-status:empty { display:none; }
.flow-main [hidden] { display:none !important; }
@media(max-width:1000px) { .flow-workspace { grid-template-columns:minmax(0,1fr); gap:24px; } .flow-details { position:static; padding:24px 0 0; border-left:0; border-top:1px solid var(--modern-border); } .flow-date-nav { justify-content:start; } }
@media(max-width:430px) { .flow-toolbar { gap:8px; } .flow-chart-toolbar { gap:12px; } #flow-legend { width:100%; } #flow-legend button { flex:1; padding-inline:6px; gap:4px; } #flow-legend button::before { width:12px; } }
#flow-legend { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); }
@media(max-width:430px) { #flow-legend button { min-width:0; flex-direction:column; justify-content:center; } #flow-legend button::before { width:20px; } }
.flow-detail-disclosure { min-width:0; position:sticky; top:100px; }
.flow-detail-disclosure > summary { display:none; }
.flow-detail-disclosure .flow-details { position:static; }
.flow-touch-help { display:none; }
.flow-data-meta summary { cursor:pointer; min-height:44px; padding-block:8px; }
@media(max-width:1000px) { .flow-detail-disclosure { position:static; } }
@media(max-width:600px) {
    .flow-meta { margin-block:8px 12px; gap:0; }
    .flow-end-of-day { display:none; }
    .flow-toolbar { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; }
    .flow-toolbar .investment-ui-segments { display:grid; grid-auto-flow:column; grid-auto-columns:minmax(0,1fr); }
    .flow-toolbar button { padding-inline:4px; }
    .flow-chart-toolbar { display:grid; grid-template-columns:minmax(0,1fr); gap:8px; margin-bottom:12px; }
    #flow-modes { display:grid; grid-template-columns:repeat(2,minmax(0,1fr)); }
    #flow-legend { width:100%; }
    #flow-legend button { flex-direction:row; justify-content:center; }
    #flow-legend button::before { width:12px; }
    .flow-touch-inspector { padding-bottom:12px; border-bottom:1px solid var(--modern-border); margin-bottom:12px; font-variant-numeric:tabular-nums; }
    .flow-touch-date { display:grid; grid-template-columns:44px minmax(0,1fr) 44px auto; align-items:center; gap:8px; text-align:center; }
    .flow-touch-date button { padding-inline:8px; }
    .flow-touch-context { margin-top:12px; display:flex; flex-wrap:wrap; justify-content:space-between; gap:4px; font-size:var(--investment-caption-size); color:var(--modern-muted); }
    .flow-touch-values { display:grid; grid-template-columns:repeat(3,minmax(0,1fr)); gap:8px; margin:8px 0 0; }
    .flow-touch-values div { min-width:0; }
    .flow-touch-values dt { font-size:var(--investment-caption-size); color:var(--modern-muted); }
    .flow-touch-values dd { margin:4px 0 0; font-size:var(--investment-label-size); font-weight:650; overflow-wrap:anywhere; }
    .flow-touch-values div:nth-child(1) dd { color:#087c65; }
    .flow-touch-values div:nth-child(2) dd { color:#245bc2; }
    .flow-touch-values div:nth-child(3) dd { color:#8446a5; }
    #flow-charts svg text { font-size:12px; }
    #flow-amount-title { margin-top:8px; }
    #flow-help { display:none; }
    .flow-touch-help { display:block; font-size:var(--investment-caption-size); line-height:1.6; color:var(--modern-muted); }
    .flow-detail-disclosure > summary { display:list-item; min-height:44px; padding-block:12px; cursor:pointer; font-weight:650; }
    .flow-detail-disclosure .flow-details { padding-top:12px; }
}
.flow-touch-date button:disabled { opacity:.4; cursor:default; }

.flow-mode-compact { display:none; }
@media(max-width:600px) {
    .flow-mode-wide { display:none; }
    .flow-mode-compact { display:inline; }
    .flow-chart-toolbar { display:flex; flex-wrap:nowrap; gap:8px; }
    #flow-modes { display:flex; flex:0 0 auto; gap:4px; }
    #flow-modes button { padding-inline:8px; }
    #flow-legend { flex:1; min-width:0; width:auto; gap:2px; }
    #flow-legend button { padding-inline:4px; gap:3px; }
    #flow-legend button::before { width:10px; flex-shrink:0; }
}
