/* flows.css -- the /flows/ surface.
   Tokens only, both themes. Colours come from theme.css and from
   config/tickers.js for the per-instrument bands; nothing here hardcodes a
   palette value, so light mode inherits without a second implementation. */

/* The page names its own typeface. theme.css carries colour tokens and no
   typography at all, so a surface that does not set a stack renders in the
   browser default serif; /charts/ does exactly that on production today. Body
   is Inter and every number is JetBrains Mono, which is the site's canon. */
.fl-wrap, .fl-toast {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.fl-wrap { max-width: 1180px; margin: 0 auto; padding: 28px 20px 64px; }

.fl-head h1 { font-size: 2.6rem; font-weight: 800; letter-spacing: -0.02em; margin: 0 0 10px; color: var(--cebe-text-primary); }
.fl-lede { color: var(--cebe-text-secondary); font-size: 1.3rem; line-height: 1.7; margin: 0 0 8px; max-width: 78ch; }
.fl-half { display: inline-block; font-family: 'JetBrains Mono', monospace; font-size: 0.95rem;
  letter-spacing: 0.08em; text-transform: uppercase; color: var(--cebe-brand-orange-text);
  border: 1px solid var(--cebe-border-strong); border-radius: 20px; padding: 4px 12px; margin-bottom: 14px; }

.fl-section { margin-top: 30px; }
.fl-section-label { font-family: 'JetBrains Mono', monospace; font-size: 1.05rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--cebe-text-secondary); margin-bottom: 12px; }
.fl-loading { color: var(--cebe-text-secondary); font-size: 1.2rem; }

.fl-card { background: var(--cebe-surface-card); border: 1px solid var(--cebe-border-solid);
  border-radius: 12px; padding: 20px 20px 16px; }
.fl-card-title { font-size: 1.7rem; font-weight: 700; color: var(--cebe-text-primary); margin: 0 0 4px; }
.fl-card-how { font-family: 'JetBrains Mono', monospace; font-size: 1.0rem; color: var(--cebe-text-secondary); margin: 0 0 14px; }

/* Plot */
.fl-svg { width: 100%; height: auto; display: block; overflow: visible; }
.fl-tick-lbl { font: 500 11px 'JetBrains Mono', monospace; fill: var(--cebe-text-secondary); }
.fl-end-lbl { font: 700 12px 'JetBrains Mono', monospace; fill: var(--cebe-text-primary); }
.fl-bar-lbl { font: 500 9px 'JetBrains Mono', monospace; fill: var(--cebe-text-secondary); }
.fl-side-lbl { font: 600 10px 'JetBrains Mono', monospace; fill: var(--cebe-text-secondary); letter-spacing: 0.08em; }
.fl-grid { stroke: var(--cebe-border-solid); stroke-width: 1; }
.fl-axis { stroke: var(--cebe-border-strong); stroke-width: 1.4; }
.fl-marker { stroke: var(--cebe-semantic-scenario); stroke-width: 1.4; stroke-dasharray: 5 4; }
.fl-marker-lbl { font: 600 10px 'JetBrains Mono', monospace; fill: var(--cebe-semantic-scenario); }

.fl-legend { display: flex; flex-wrap: wrap; gap: 12px 18px; margin: 12px 0 0; }
.fl-legend span { display: inline-flex; align-items: center; gap: 7px; font-size: 1.08rem; color: var(--cebe-text-secondary); }
.fl-legend i { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.fl-legend b { font-family: 'JetBrains Mono', monospace; color: var(--cebe-text-primary); font-weight: 600; }

/* Basis print. Mandatory on every face: a layer that cannot state its basis
   does not render, so this block is never empty when a plot is present. */
.fl-basis { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--cebe-border-solid); }
.fl-basis-row { display: flex; gap: 10px; font-size: 1.08rem; line-height: 1.7; color: var(--cebe-text-secondary); }
.fl-basis-row span { min-width: 15ch; }
.fl-basis-row b { color: var(--cebe-text-primary); font-family: 'JetBrains Mono', monospace; font-weight: 600; }

.fl-caption { color: var(--cebe-text-secondary); font-size: 1.18rem; line-height: 1.7; margin: 12px 0 0; max-width: 84ch; }
.fl-source { color: var(--cebe-text-muted); font-size: 1.02rem; line-height: 1.6; margin: 10px 0 0; max-width: 84ch; }

/* The ledger bridge. Open by default it would bury the chart, closed it would
   hide a normalization; a disclosure keeps it one click from the figure. */
.fl-bridge { margin-top: 14px; border: 1px solid var(--cebe-border-solid); border-radius: 10px; padding: 10px 14px; }
.fl-bridge summary { cursor: pointer; font-family: 'JetBrains Mono', monospace; font-size: 1.02rem;
  color: var(--cebe-brand-orange-text); }
.fl-bridge-lede { color: var(--cebe-text-secondary); font-size: 1.06rem; line-height: 1.65; margin: 10px 0 4px; max-width: 84ch; }
.fl-bridge-grp { margin-top: 10px; }
.fl-bridge-grp h4 { font-size: 1.05rem; font-weight: 600; color: var(--cebe-text-primary); margin: 0 0 4px; }
.fl-bridge-grp ul { margin: 0; padding-left: 20px; }
.fl-bridge-grp li { color: var(--cebe-text-secondary); font-size: 1.05rem; line-height: 1.7; }
.fl-bridge code { font-family: 'JetBrains Mono', monospace; font-size: 0.96em; color: var(--cebe-text-primary); }

/* Table. Wide content scrolls inside its own box rather than pushing the page
   sideways on a phone, which is the repo's standing wide-content convention. */
.fl-table-wrap { overflow-x: auto; max-width: 100%; }
.fl-table { width: 100%; border-collapse: collapse; font-size: 1.08rem; min-width: 860px; }
.fl-table th { text-align: left; font-family: 'JetBrains Mono', monospace; font-size: 0.95rem;
  letter-spacing: 0.06em; text-transform: uppercase; color: var(--cebe-text-secondary);
  font-weight: 500; padding: 8px 12px; border-bottom: 1px solid var(--cebe-border-strong); white-space: nowrap; }
.fl-table td { padding: 12px; border-bottom: 1px solid var(--cebe-border-subtle);
  color: var(--cebe-text-primary); vertical-align: top; }
.fl-table .fl-num { text-align: right; }
.fl-table .fl-mono { font-family: 'JetBrains Mono', monospace; }
.fl-sub { display: block; font-family: 'JetBrains Mono', monospace; font-size: 0.92rem;
  color: var(--cebe-text-muted); font-weight: 400; margin-top: 3px; }
.fl-up { color: var(--cebe-semantic-negative); }
.fl-down { color: var(--cebe-semantic-positive); }

.fl-actions { display: flex; gap: 8px; margin-top: 14px; }
.fl-btn { font-family: 'JetBrains Mono', monospace; font-size: 1.02rem; padding: 6px 12px; cursor: pointer;
  background: transparent; color: var(--cebe-text-secondary);
  border: 1px solid var(--cebe-border-solid); border-radius: 7px; }
.fl-btn:hover { color: var(--cebe-text-primary); border-color: var(--cebe-brand-orange); }

.fl-toast { position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%);
  background: var(--cebe-surface-card); border: 1px solid var(--cebe-border-solid); color: var(--cebe-text-primary);
  padding: 9px 16px; border-radius: 8px; font-family: 'JetBrains Mono', monospace; font-size: 1.05rem;
  z-index: 99999; opacity: 0; pointer-events: none; transition: opacity .2s; }
.fl-toast.show { opacity: 1; }

@media (max-width: 640px) {
  .fl-wrap { padding: 20px 14px 48px; }
  .fl-head h1 { font-size: 2.1rem; }
  .fl-card { padding: 16px 14px 14px; }
  .fl-basis-row { flex-direction: column; gap: 0; margin-bottom: 6px; }
  .fl-basis-row span { min-width: 0; }
  .fl-tick-lbl { font-size: 13px; }
  .fl-end-lbl { font-size: 14px; }
  .fl-side-lbl { font-size: 12px; }
  .fl-marker-lbl { font-size: 12px; }
}
