/* Daily flow workspace: share the application's light/dark tokens. */
.fund-flow-view { min-width: 0; }
.fund-flow-view > *, .ff-tools-grid > *, .ff-weekly-grid > * { min-width: 0; }
.fund-flow-view h2 { margin: 0; font-size: 19px; line-height: 1.4; }
.fund-flow-view p { line-height: 1.65; }
.fund-flow-view label { font-size: 14px; }
.fund-flow-view .panel { padding: 22px; }
.ff-hero { border-top: 3px solid var(--blue); }
.ff-hero-heading, .ff-section-heading, .ff-report-bar { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.ff-hero-heading { align-items: flex-start; }
.ff-eyebrow { color: var(--blue); font-size: 12px; font-weight: 750; letter-spacing: .08em; margin: 0 0 10px; }
.ff-hero h2 { font-size: clamp(20px, 2vw, 26px); }
.ff-description { color: var(--muted); font-size: 14px; margin: 9px 0 0; }
.ff-actions, .ff-form-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; }
.ff-actions { justify-content: flex-end; flex-shrink: 0; }
.fund-flow-view button { min-height: 39px; white-space: nowrap; }
.fund-flow-view input, .fund-flow-view select { min-width: 0; max-width: 100%; font-size: 14px; }
.ff-report-bar { padding: 20px 0 12px; flex-wrap: wrap; }
.ff-report-bar > div { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.ff-report-bar strong { font-size: 17px; font-variant-numeric: tabular-nums; }
.ff-report-bar span, .ff-report-bar small { color: var(--muted); font-size: 13px; }
.ff-report-bar label, .ff-section-heading > label { display: flex; align-items: center; gap: 9px; flex-shrink: 0; white-space: nowrap; }
.ff-report-bar select, .ff-section-heading > label select { width: auto; }
.ff-report-bar select { min-width: 175px; }
.ff-status { font-size: 14px; color: var(--muted); margin: 7px 0; overflow-wrap: anywhere; }
.ff-status[data-error="true"] { color: var(--red); }
.ff-summary-strip { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin-top: 20px; border-top: 1px solid var(--line); padding-top: 20px; gap: 20px; }
.ff-summary-strip > div { display: grid; gap: 6px; }
.ff-summary-strip span { font-size: 13px; color: var(--muted); }
.ff-summary-strip strong { font-size: 30px; letter-spacing: -.04em; font-weight: 700; }
.ff-summary-strip small { font-size: 12px; color: var(--muted); line-height: 1.6; }
#ff-inflow-count { color: var(--green); }
#ff-outflow-count { color: var(--red); }
.ff-tools-grid, .ff-weekly-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; align-items: start; }
.fund-flow-view .ff-details { box-shadow: none; }
.ff-details summary { font-size: 15px; font-weight: 700; cursor: pointer; line-height: 1.7; }
.ff-details summary > span { display: inline-block; margin-left: 9px; color: var(--muted); font-size: 12px; font-weight: 400; }
.ff-form { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 15px; margin-top: 20px; }
.ff-form label { display: grid; gap: 7px; }
.ff-form label small { font-size: 12px; line-height: 1.6; }
.ff-full { grid-column: 1 / -1; }
.ff-form .ff-checkbox { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 600; }
.ff-checkbox input { width: 18px; height: 18px; margin: 0; }
.ff-form input[type="file"] { width: 100%; font-size: 13px; }
.ff-help { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.ff-form-actions a, .ff-source-links a { color: var(--blue); font-size: 13px; text-decoration: none; }
.ff-form-actions a:hover, .ff-source-links a:hover { text-decoration: underline; }
.ff-section-heading { margin-bottom: 20px; align-items: flex-start; }
.ff-section-heading p { color: var(--muted); margin: 6px 0 0; font-size: 13px; }
.ff-caption { font-size: 13px; color: var(--muted); white-space: nowrap; padding-top: 4px; }
.ff-table-wrap { overflow-x: auto; width: 100%; max-width: 100%; scrollbar-width: thin; }
.ff-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.ff-table th, .ff-table td { font-size: 14px; white-space: nowrap; text-align: right; padding: 14px 12px; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums; }
.ff-table th { color: var(--muted); font-weight: 600; }
.ff-table td { line-height: 1.6; }
.ff-table th:first-child, .ff-table td:first-child { text-align: left; padding-left: 0; }
.ff-table th:last-child, .ff-table td:last-child { padding-right: 0; }
.ff-table td strong { color: var(--text); font-size: 14px; }
.ff-table td small { display: block; color: var(--muted); font-size: 12px; font-weight: 400; }
.ff-table td .ff-row-note { max-width: 230px; white-space: normal; }
.ff-row-details { margin-top: 6px; }
.ff-row-details summary { font-size: 12px; color: var(--blue); cursor: pointer; }
.ff-row-details > div { display: grid; gap: 5px; padding-top: 9px; font-size: 12px; }
.ff-row-details > div > span { display: flex; justify-content: space-between; gap: 15px; color: var(--muted); }
.ff-row-details > div b { color: var(--text); font-weight: 500; }
.ff-table td a { color: var(--blue); }
.ff-table .ff-empty { text-align: center; white-space: normal; }
.ff-etf-panel > .ff-help { margin-top: 15px; }
.ff-positive { color: var(--green); }
.ff-negative { color: var(--red); }
.ff-badge { display: inline-flex; align-items: center; border-radius: 5px; background: color-mix(in srgb, var(--muted) 9%, transparent); color: var(--muted); padding: 3px 8px; font-size: 12px; white-space: nowrap; font-weight: 600; }
.ff-badge.inflow, .ff-badge.ready { background: color-mix(in srgb, var(--green) 11%, transparent); color: var(--green); }
.ff-badge.outflow, .ff-badge.error { background: color-mix(in srgb, var(--red) 9%, transparent); color: var(--red); }
.ff-empty { color: var(--muted); font-size: 14px; padding: 20px 12px; text-align: center; margin: 0; }
.ff-filings { display: grid; gap: 0; }
.ff-filing { padding: 16px 0; border-top: 1px solid var(--line); }
.ff-filing:first-child { padding-top: 0; border-top: 0; }
.ff-filing-heading { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; }
.ff-filing-heading strong { font-size: 14px; overflow-wrap: anywhere; }
.ff-filing-heading > a { margin-left: auto; font-size: 13px; color: var(--blue); }
.ff-filing-meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 9px 0 0; color: var(--muted); font-size: 13px; }
.ff-filing details { margin-top: 12px; font-size: 13px; }
.ff-filing details summary { cursor: pointer; color: var(--blue); }
.ff-filing .ff-table { margin-top: 10px; }
.ff-weekly-entry { border-top: 1px solid var(--line); padding: 14px 0; }
.ff-weekly-entry:first-child { border-top: 0; padding-top: 0; }
.ff-weekly-entry:last-child { padding-bottom: 0; }
.ff-weekly-title { font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.ff-weekly-date { display: block; font-size: 12px; color: var(--muted); margin-top: 4px; }
.ff-weekly-values { display: flex; flex-wrap: wrap; gap: 12px 28px; margin-top: 11px; }
.ff-weekly-values > div { display: grid; gap: 5px; }
.ff-weekly-values span { color: var(--muted); font-size: 12px; }
.ff-weekly-values b { font-size: 17px; font-variant-numeric: tabular-nums; }
.ff-weekly-entry a { font-size: 12px; color: var(--blue); }
.ff-sources { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; }
.ff-source { border-left: 2px solid var(--line); padding-left: 12px; min-width: 0; }
.ff-source-heading { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; font-size: 13px; margin-bottom: 8px; }
.ff-source p { font-size: 12px; color: var(--muted); margin: 3px 0; overflow-wrap: anywhere; }
.ff-source .ff-source-error { color: var(--red); }
.ff-source-links { display: flex; gap: 12px 24px; flex-wrap: wrap; border-top: 1px solid var(--line); margin-top: 22px; padding-top: 18px; }
.ff-source-panel > .ff-help { margin-top: 12px; }
.fund-flow-view [hidden] { display: none !important; }
html[data-theme="dark"] .fund-flow-view .ff-positive,
html[data-theme="dark"] .fund-flow-view .ff-badge.inflow,
html[data-theme="dark"] .fund-flow-view .ff-badge.ready,
html[data-theme="dark"] .fund-flow-view #ff-inflow-count { color: var(--green) !important; }
html[data-theme="dark"] .fund-flow-view .ff-negative,
html[data-theme="dark"] .fund-flow-view .ff-badge.outflow,
html[data-theme="dark"] .fund-flow-view .ff-badge.error,
html[data-theme="dark"] .fund-flow-view .ff-source-error,
html[data-theme="dark"] .fund-flow-view .ff-status[data-error="true"],
html[data-theme="dark"] .fund-flow-view #ff-outflow-count { color: var(--red) !important; }
@media (max-width: 1200px) {
  .ff-hero-heading { flex-direction: column; }
  .ff-actions { justify-content: flex-start; }
  .ff-summary-strip { gap: 15px; }
  .ff-weekly-grid { grid-template-columns: 1fr; }
}
@media (max-width: 850px) {
  .ff-tools-grid, .ff-sources { grid-template-columns: 1fr; }
  .ff-summary-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
}
@media (max-width: 540px) {
  .fund-flow-view .panel { padding: 17px; }
  .ff-actions { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .ff-actions button:first-child { grid-column: 1 / -1; }
  .ff-hero-heading { gap: 16px; }
  .ff-report-bar, .ff-section-heading { gap: 14px; }
  .ff-report-bar { align-items: flex-start; }
  .ff-report-bar > div { row-gap: 5px; }
  .ff-report-bar small { flex-basis: 100%; }
  .ff-report-bar label { width: 100%; justify-content: space-between; }
  .ff-report-bar select { flex: 1; min-width: 0; }
  .ff-section-heading { flex-direction: column; }
  .ff-section-heading > label { width: 100%; justify-content: space-between; }
  .ff-section-heading select { flex: 1; }
  .ff-summary-strip strong { font-size: 27px; }
  .ff-summary-strip small { font-size: 12px; }
  .ff-form { grid-template-columns: 1fr; }
  .ff-table td, .ff-table th { padding: 12px 10px; }
  .ff-details summary > span { display: block; margin-left: 16px; }
  .ff-filing-heading > a { margin-left: 0; }
}

.ff-report-viewer { border-top: 3px solid var(--blue); scroll-margin-top: 20px; }
.ff-report-brief { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px 28px; margin: 0 0 20px; }
.ff-report-brief h3 { margin: 0 0 6px; font-size: 15px; }
.ff-report-brief p { margin: 0; font-size: 14px; color: var(--muted); overflow-wrap: anywhere; }
.ff-table td:first-child small { max-width: 230px; white-space: normal; }
@media (max-width: 540px) { .ff-report-brief { grid-template-columns: 1fr; } .ff-caption { white-space: normal; } }
