/* equyx — functions (bbg-*.js). Every colour is a theme variable, so paper,
   ivory and the dark themes all draw these screens in their own palette. */

/* ---- the screen ---- */
.fn-page { display: flex; flex-direction: column; gap: 14px; }
.fn-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; }
.fn-head h2 { margin: 0; font-size: 16px; letter-spacing: .01em; }
.fn-head .fn-about { color: var(--muted); font-size: 12px; flex: 1 1 260px; min-width: 0; line-height: 1.45; }
.fn-head .fn-about code { font-family: var(--mono); background: var(--chip); padding: 0 4px; border-radius: 4px; }
.fn-head-r { display: flex; gap: 6px; margin-left: auto; }
.fn-head-r .mini { display: inline-flex; align-items: center; gap: 4px; }
.fn-head-r svg { width: 13px; height: 13px; }
.fn-key {
  display: inline-block; font-family: var(--mono); font-weight: 700; font-size: 12px; letter-spacing: .04em;
  color: var(--on-accent, #000); background: var(--accent); border-radius: 4px; padding: 2px 7px;
  box-shadow: inset 0 -2px 0 rgba(0, 0, 0, .22); white-space: nowrap;
}
.fn-sym { font-family: var(--mono); font-size: 15px; }
.fn-needsym { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; padding: 14px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); }
.fn-needsym label { color: var(--muted); font-size: 13px; flex: 1 1 220px; }
.fn-needsym input { font: inherit; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text); min-width: 0; width: 140px; }

/* ---- panels ---- */
.fn-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 360px), 1fr)); gap: 12px; align-items: start; }
.fn-panel { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); min-width: 0; display: flex; flex-direction: column; }
.fn-panel.wide { grid-column: 1 / -1; }
.fn-panel-h { display: flex; align-items: baseline; gap: 10px; padding: 10px 12px 0; }
.fn-panel-h h3 { margin: 0; font-size: 12.5px; letter-spacing: .03em; text-transform: uppercase; color: var(--text-2, var(--text)); }
.fn-panel-b { padding: 10px 12px; min-width: 0; }
.fn-src { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 7px 12px 9px; border-top: 1px solid var(--border); color: var(--muted); font-size: 10.5px; line-height: 1.45; }
.fn-src .stale { color: var(--warn, var(--bad)); }
.fn-src .note { flex-basis: 100%; }
.fn-wait { color: var(--muted); font-size: 12.5px; padding: 18px 4px; display: flex; align-items: center; gap: 8px; }
.fn-empty { color: var(--muted); font-size: 12.5px; padding: 12px 2px; line-height: 1.5; }
.fn-err { color: var(--bad-ink, var(--bad)); background: var(--bad-soft, transparent); border: 1px solid var(--bad); border-radius: var(--radius-sm); padding: 10px 12px; font-size: 12.5px; line-height: 1.5; }
.fn-lede { margin: 0 0 10px; font-size: 13px; line-height: 1.55; }
.fn-kv { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 180px), 1fr)); gap: 8px 16px; margin: 0; }
.fn-kv div { min-width: 0; }
.fn-kv dt { color: var(--muted); font-size: 10.5px; text-transform: uppercase; letter-spacing: .04em; }
.fn-kv dd { margin: 2px 0 0; font-size: 13.5px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.fn-kv dd.up, .fn-table td.up, .rm-card .up, .rm-centre .up { color: var(--good); }
.fn-kv dd.down, .fn-table td.down, .rm-card .down, .rm-centre .down { color: var(--bad); }

/* ---- tables ---- */
.fn-tablewrap { overflow-x: auto; max-width: 100%; }
.fn-table { width: 100%; border-collapse: collapse; font-size: 12px; font-variant-numeric: tabular-nums; }
.fn-table th { text-align: left; vertical-align: bottom; font-size: 10.5px; line-height: 1.25; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 600; padding: 6px 8px; border-bottom: 1px solid var(--border); cursor: pointer; position: sticky; top: 0; background: var(--panel); }
.fn-table td.nm { max-width: 220px; }
.fn-table td { padding: 6px 8px; border-bottom: 1px solid var(--border); white-space: nowrap; max-width: 280px; overflow: hidden; text-overflow: ellipsis; }
.fn-table th.num, .fn-table td.num { text-align: right; }
.fn-table tr.click { cursor: pointer; }
.fn-table tr.click:hover td { background: var(--hover); }
.fn-table td.me { color: var(--accent); font-weight: 700; }
.fn-more { margin-top: 8px; }
.fn-spark.up { color: var(--good); }
.fn-spark.down { color: var(--bad); }

/* ---- HELP ---- */
.fn-help { display: flex; flex-direction: column; gap: 14px; }
.fn-feature { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: 10px; }
.fn-tile { text-align: left; display: flex; flex-direction: column; gap: 6px; padding: 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); color: var(--text); font: inherit; cursor: pointer; }
.fn-tile:hover { border-color: var(--accent); }
.fn-tile .fn-key { align-self: flex-start; }
.fn-tile .ab { color: var(--muted); font-size: 12px; line-height: 1.4; }
.fn-help-q { font: inherit; padding: 8px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel); color: var(--text); max-width: 460px; }
.fn-help-g h3 { font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 6px 0 6px; }
.fn-help-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 420px), 1fr)); gap: 4px 14px; }
.fn-help-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; grid-template-rows: auto auto; column-gap: 10px; align-items: center; text-align: left; padding: 7px 8px; border: 0; border-radius: var(--radius-sm); background: transparent; color: var(--text); font: inherit; cursor: pointer; }
.fn-help-row:hover { background: var(--hover); }
.fn-help-row .fn-key { grid-column: 1; grid-row: 1 / 3; align-self: start; min-width: 52px; text-align: center; }
.fn-help-row b { grid-column: 2; grid-row: 1; font-size: 13px; min-width: 0; }
.fn-help-row .ab { grid-column: 2; grid-row: 2; color: var(--muted); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.fn-help-row i { grid-row: 1; grid-column: 3; font-style: normal; font-size: 10.5px; color: var(--faint, var(--muted)); }

/* ---- maps ---- */
.fn-map { display: flex; flex-direction: column; gap: 8px; }
.fn-map-stage { position: relative; height: calc(100vh - 230px); min-height: 420px; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; background: var(--bg-2); }
.fn-map-cv { display: block; width: 100%; height: 100%; cursor: grab; touch-action: none; }
.fn-map-tip { position: absolute; z-index: 3; pointer-events: none; max-width: 260px; padding: 5px 8px; border-radius: 6px; font-size: 11.5px; line-height: 1.35; background: var(--panel); color: var(--text); border: 1px solid var(--border); box-shadow: 0 4px 14px rgba(0, 0, 0, .25); }
.fn-map-zoom { position: absolute; z-index: 2; left: 10px; top: 10px; display: flex; flex-direction: column; gap: 4px; }
.fn-map-zoom button { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); color: var(--text); font-size: 16px; cursor: pointer; }
.fn-map-zoom button[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); }
.fn-map-zoom svg { width: 15px; height: 15px; }
.fn-map-legend { position: absolute; z-index: 2; left: 10px; bottom: 10px; max-width: calc(100% - 20px); display: flex; flex-wrap: wrap; gap: 3px 12px; padding: 6px 10px; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--panel) 90%, transparent); color: var(--text); font: inherit; font-size: 11px; text-align: left; cursor: pointer; }
.fn-map-legend:hover { border-color: var(--accent); }
.fn-map-legend .lg { display: inline-flex; align-items: center; gap: 5px; white-space: nowrap; }
.fn-map-legend .lg .sw { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.fn-map-legend .lg em { font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums; }
.fn-map-legend .lg.bad em { color: var(--bad); }
.fn-map-fail { position: absolute; inset: 0; display: grid; place-items: center; padding: 20px; z-index: 2; }
.fn-map-drawer { position: absolute; z-index: 2; right: 10px; top: 10px; bottom: 10px; width: 300px; overflow-y: auto; padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: color-mix(in srgb, var(--panel) 94%, transparent); display: flex; flex-direction: column; gap: 4px; }
.fn-drawer-h { display: flex; justify-content: space-between; align-items: center; padding-bottom: 4px; }
.fn-layer { display: grid; grid-template-columns: auto auto minmax(0, 1fr); grid-template-rows: auto auto; column-gap: 7px; align-items: center; padding: 5px 4px; border-radius: 6px; cursor: pointer; font-size: 12px; }
.fn-layer:hover { background: var(--hover); }
.fn-layer input { grid-row: 1 / 3; margin: 0; }
.fn-layer .sw { grid-row: 1 / 3; width: 10px; height: 10px; border-radius: 50%; }
.fn-layer .nm { font-weight: 600; }
.fn-layer .st { grid-column: 3; color: var(--muted); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fn-layer[data-fn-layer-state="error"] .st { color: var(--bad); white-space: normal; }
.sw-routes, .sw-airports { background: var(--cyan); }
.sw-chokepoints, .sw-quakes { background: var(--bad); }
.sw-ports { background: var(--good); }
.sw-flows, .sw-ships { background: var(--accent); }
.sw-disruptions, .sw-events { background: var(--warn); }
.sw-pipelines, .sw-hurricanes { background: var(--violet); }
.sw-plants { background: linear-gradient(90deg, var(--bad), var(--warn), var(--good), var(--cyan)); }
.sw-alerts { background: var(--good); border-radius: 2px !important; }
.fn-flow-pick { display: flex; flex-direction: column; gap: 4px; padding: 6px 4px; font-size: 12px; }
.fn-flow-pick select { font: inherit; padding: 4px 6px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel-2); color: var(--text); max-width: 100%; }
.fn-notshown { margin-top: auto; padding: 8px 4px 2px; border-top: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; color: var(--muted); font-size: 10.5px; line-height: 1.4; }
.fn-notshown b { color: var(--text-2, var(--text)); font-size: 11px; }
.fn-map-foot { display: flex; flex-wrap: wrap; gap: 4px 16px; color: var(--muted); font-size: 11px; }
.fn-detail { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 10px 12px; }
.fn-detail-h { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 8px; }
.fn-detail p { margin: 0 0 8px; font-size: 12.5px; line-height: 1.5; }
.fn-bars { width: 100%; height: 70px; display: block; margin: 4px 0 10px; }
.fn-bars rect { fill: var(--bad); opacity: .85; }
.fn-controls { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; }
.fn-controls label { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.fn-controls select { font: inherit; color: var(--text); padding: 5px 8px; border: 1px solid var(--border); border-radius: 6px; background: var(--panel); max-width: 240px; }
.fn-ectr { display: flex; flex-direction: column; gap: 12px; }
.fn-ectr .fn-map-stage { height: 52vh; min-height: 340px; }

/* ---- RMAP ---- */
.rm-grid {
  position: relative; display: grid; gap: 14px 18px;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr) minmax(0, 1fr);
  grid-template-areas: "c1 c2 c3" "c4 c5 c6" "c7 c8 c9";
}
.rm-lines { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; overflow: visible; }
.rm-lines line { stroke: var(--border-strong, var(--border)); stroke-width: 1.2; stroke-dasharray: 3 4; }
.rm-cell { position: relative; z-index: 1; min-width: 0; }
.rm-centre { position: relative; z-index: 1; align-self: center; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 16px; border: 2px solid var(--good); border-radius: var(--radius-lg); background: var(--panel); text-align: center; }
.rm-centre b { font-family: var(--mono); font-size: 22px; }
.rm-centre .nm { font-size: 13px; }
.rm-centre .px { font-family: var(--mono); font-size: 15px; }
.rm-centre .px i { font-style: normal; margin-left: 6px; }
.rm-centre .mk { color: var(--muted); font-size: 11px; }
.rm-centre .go { display: flex; gap: 6px; margin-top: 4px; }
.rm-card { border: 1px solid var(--border); border-radius: var(--radius); background: var(--panel); padding: 9px 11px; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.rm-card header { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; }
.rm-card header b { font-size: 11.5px; text-transform: uppercase; letter-spacing: .05em; }
.rm-card header span { color: var(--muted); font-size: 10.5px; text-align: right; }
.rm-card ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 3px; }
.rm-card li { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; min-width: 0; }
.rm-card li[data-rm-row="peers"], .rm-card li[data-rm-row="news"] { cursor: pointer; }
.rm-card li:hover .a { color: var(--accent); }
.rm-card li .a { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.rm-card li .b { color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; flex-shrink: 0; }
.rm-card .rm-none { color: var(--muted); font-size: 12px; }
.rm-card .fn-src { padding: 6px 0 0; border-top: 1px solid var(--border); }
.rm-card .mini { align-self: flex-start; }
.rm-holders { border-top: 3px solid var(--cyan); }
.rm-analysts { border-top: 3px solid var(--accent); }
.rm-peers { border-top: 3px solid var(--good); }
.rm-insiders { border-top: 3px solid var(--bad); }
.rm-earnings { border-top: 3px solid var(--violet); }
.rm-news { border-top: 3px solid var(--muted); }
.rm-listings { border-top: 3px solid var(--good); }
.rm-balance { border-top: 3px solid var(--warn); }

@media (max-width: 900px) {
  .rm-grid { grid-template-columns: minmax(0, 1fr); grid-template-areas: "c5" "c1" "c2" "c3" "c4" "c6" "c7" "c8" "c9"; }
  .rm-lines { display: none; }
}
@media (max-width: 720px) {
  .fn-head-r { margin-left: 0; width: 100%; }
  .fn-map-stage { height: 58vh; min-height: 340px; max-height: 480px; }
  .fn-map-drawer { left: 8px; right: 8px; top: auto; bottom: 8px; width: auto; max-height: 58%; }
  .fn-table td { max-width: 180px; }
  .fn-map-legend { gap: 2px 9px; padding: 5px 8px; font-size: 10.5px; }
  .fn-map-legend .lg em { display: none; }
}

/* ---- a function table scrolls inside its wrapper and keeps ONE set of columns ----
   console.css turns every `.pane table` on a phone into a block whose head and
   body are each their own table - so each sized its own columns and RV's
   figures sat under the wrong headings (seen at 390 px on 18 Oct 2026). Here
   the wrapper scrolls and the table stays a table. The shadows at the edges say
   there is more to the side. */
@media (max-width: 760px) {
  .pane .fn-table { display: table; max-width: none; overflow: visible; }
  .pane .fn-table > thead { display: table-header-group; width: auto; }
  .pane .fn-table > tbody { display: table-row-group; width: auto; }
}
.fn-tablewrap {
  -webkit-overflow-scrolling: touch;
  background:
    linear-gradient(to right, var(--panel) 30%, transparent) left center / 28px 100% no-repeat local,
    linear-gradient(to left, var(--panel) 30%, transparent) right center / 28px 100% no-repeat local,
    radial-gradient(farthest-side at 0 50%, rgba(0, 0, 0, .22), transparent) left center / 12px 100% no-repeat scroll,
    radial-gradient(farthest-side at 100% 50%, rgba(0, 0, 0, .22), transparent) right center / 12px 100% no-repeat scroll;
}

/* ---- wave 2: equity and options screens ---- */
.fn-big { font-family: var(--mono); font-size: 15px; font-weight: 600; margin-left: auto; white-space: nowrap; }
.fn-big i { font-style: normal; font-size: 12px; margin-left: 6px; }
.fn-big.up i { color: var(--good); } .fn-big.down i { color: var(--bad); }
.fn-launch { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.fn-launch-b { display: inline-flex; align-items: center; gap: 6px; padding: 4px 8px 4px 4px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2, var(--panel)); color: var(--text); font: inherit; font-size: 11.5px; cursor: pointer; }
.fn-launch-b:hover { border-color: var(--accent); }
.fn-launch-b .fn-key { font-size: 10.5px; padding: 1px 5px; }
.fn-seg { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--border); border-radius: var(--radius-sm); overflow: hidden; }
.fn-seg button { font: inherit; font-size: 12px; padding: 5px 10px; border: 0; border-right: 1px solid var(--border); background: var(--panel); color: var(--text); cursor: pointer; }
.fn-seg button:last-child { border-right: 0; }
.fn-seg button.on { background: var(--accent); color: var(--on-accent, #000); font-weight: 600; }
.fn-chart svg { width: 100%; display: block; overflow: visible; }
.fn-chart .gr { stroke: var(--border); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fn-chart .ax { fill: var(--muted); font-size: 10px; font-family: var(--mono); }
.fn-chart .ln { stroke-width: 1.6; stroke-linejoin: round; }
.fn-chart .ln.c0 { stroke: var(--accent); } .fn-chart .ln.c1 { stroke: var(--cyan); stroke-dasharray: 4 3; } .fn-chart .ln.c2 { stroke: var(--violet); stroke-dasharray: 4 3; }
.fn-chart .ref { stroke-width: 1; stroke-dasharray: 3 3; vector-effect: non-scaling-stroke; stroke: var(--muted); }
.fn-chart .ref.good { stroke: var(--good); } .fn-chart .ref.bad { stroke: var(--bad); } .fn-chart .ref.accent { stroke: var(--accent); }
.fn-chart .ref-t.good { fill: var(--good); } .fn-chart .ref-t.bad { fill: var(--bad); } .fn-chart .ref-t.accent { fill: var(--accent); }
.fn-chart .zero { stroke: var(--muted); stroke-width: 1; vector-effect: non-scaling-stroke; }
.fn-chart .hov { stroke: var(--text); stroke-width: 1; opacity: .45; vector-effect: non-scaling-stroke; }
.fn-chart-read { display: flex; flex-wrap: wrap; gap: 4px 14px; min-height: 18px; font-size: 11.5px; font-family: var(--mono); color: var(--text); padding-top: 4px; }
.fn-chart-read .k.c0 { color: var(--accent); } .fn-chart-read .k.c1 { color: var(--cyan); } .fn-chart-read .k.c2 { color: var(--violet); }
.fn-stack { display: flex; height: 26px; border-radius: var(--radius-sm); overflow: hidden; margin-bottom: 10px; font-size: 11px; font-weight: 600; }
.fn-stack span { display: flex; align-items: center; justify-content: center; white-space: nowrap; overflow: hidden; color: #fff; min-width: 0; }
.fn-stack .b-buy { background: var(--good); } .fn-stack .b-hold { background: var(--muted); } .fn-stack .b-sell { background: var(--bad); }
.fn-range { position: relative; height: 42px; margin: 4px 6px 10px; }
.fn-range .bar { position: absolute; left: 0; right: 0; top: 12px; height: 6px; border-radius: 3px; background: linear-gradient(90deg, var(--bad), var(--warn), var(--good)); opacity: .55; }
.fn-range .mk { position: absolute; top: 4px; width: 3px; height: 22px; margin-left: -1px; border-radius: 2px; }
.fn-range .mk.mean { background: var(--accent); } .fn-range .mk.px { background: var(--text); }
.fn-range .lo, .fn-range .hi { position: absolute; top: 28px; font-size: 10.5px; color: var(--muted); font-family: var(--mono); }
.fn-range .lo { left: 0; } .fn-range .hi { right: 0; }
.fn-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 12px; }
.fn-chips { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.fn-chips li { font-size: 11px; padding: 3px 7px; border: 1px solid var(--border); border-radius: 999px; color: var(--text); }
.fn-eps { display: flex; gap: 14px; align-items: flex-end; padding: 6px 2px 12px; overflow-x: auto; }
.fn-eps .q { display: flex; flex-direction: column; align-items: center; gap: 3px; min-width: 64px; font-size: 11px; }
.fn-eps .bars { display: flex; align-items: flex-end; gap: 3px; height: 64px; }
.fn-eps .bars span { width: 14px; border-radius: 2px 2px 0 0; }
.fn-eps .bars .c { background: var(--muted); opacity: .6; } .fn-eps .bars .e.beat { background: var(--good); } .fn-eps .bars .e.miss { background: var(--bad); }
.fn-eps i { font-style: normal; font-family: var(--mono); }
.fn-eps i.up { color: var(--good); } .fn-eps i.down { color: var(--bad); }
.fn-yearbars { display: flex; gap: 6px; align-items: flex-end; height: 104px; padding-top: 6px; overflow-x: auto; }
.fn-yearbars .yb { display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 3px; height: 100%; min-width: 22px; }
.fn-yearbars .yb span { width: 14px; background: var(--accent); border-radius: 2px 2px 0 0; min-height: 1px; }
.fn-yearbars .yb i { font-style: normal; font-size: 10px; color: var(--muted); }
.fn-table tr.sec td { font-weight: 700; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); background: var(--panel-2, transparent); }
.fn-table td.wrap { white-space: normal; max-width: 560px; min-width: 220px; line-height: 1.4; }
.fn-chain th.k, .fn-chain td.k { font-weight: 700; background: var(--panel-2, var(--panel)); border-left: 1px solid var(--border); border-right: 1px solid var(--border); }
.fn-chain td.itm { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.fn-chain tr.atm td { border-top: 2px solid var(--accent); }
.fn-chain tr.sub th { text-align: center; font-size: 10px; padding-top: 0; }
.fn-form { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 170px), 1fr)); gap: 10px; margin-bottom: 10px; }
.fn-field { display: flex; flex-direction: column; gap: 4px; font-size: 11.5px; color: var(--muted); position: relative; }
.fn-field input { font: inherit; font-size: 13px; color: var(--text); padding: 6px 26px 6px 8px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2, var(--panel)); font-variant-numeric: tabular-nums; }
.fn-field i { position: absolute; right: 8px; bottom: 7px; font-style: normal; color: var(--muted); }
.fn-gp .fn-controls, .fn-omon .fn-controls, .fn-fa .fn-controls { margin-bottom: 10px; }
@media (max-width: 720px) {
  .fn-big { margin-left: 0; }
  .fn-seg button { padding: 5px 8px; }
}

/* ---- wave 3: market screens ---- */
.im-stage { position: relative; width: 100%; overflow: hidden; border-radius: var(--radius-sm); background: var(--bg-2, var(--panel)); }
.im-sec { position: absolute; box-sizing: border-box; border: 1px solid var(--bg, #000); pointer-events: none; z-index: 1; }
.im-sec b { position: absolute; left: 4px; top: 1px; font-size: 10.5px; line-height: 14px; text-transform: uppercase; letter-spacing: .03em; color: var(--text); white-space: nowrap; overflow: hidden; max-width: calc(100% - 8px); text-overflow: ellipsis; }
.im-sec b i { font-style: normal; margin-left: 4px; }
.im-sec b i.up { color: var(--good); } .im-sec b i.down { color: var(--bad); }
.im-tile { position: absolute; z-index: 2; box-sizing: border-box; padding: 2px; border: 0; border-radius: 2px; overflow: hidden; cursor: pointer; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; color: #fff; font: inherit; text-shadow: 0 1px 1px rgba(0, 0, 0, .45); }
.im-tile:hover, .im-tile:focus-visible { outline: 2px solid var(--text); outline-offset: -2px; z-index: 3; }
.im-tile .s { font-family: var(--mono); font-weight: 700; font-size: 11px; line-height: 1.1; white-space: nowrap; }
.im-tile .c { font-family: var(--mono); font-size: 10px; line-height: 1.1; white-space: nowrap; }
.im-tile.pale { color: var(--text); text-shadow: none; }
.fn-fxm td.diag { color: var(--muted); }
.fn-fxm td b { font-family: var(--mono); }

/* ---- functions in the rail, sub-tabs and how-to on every function (19 Oct 2026) ---- */
.crail-fns { margin-top: 4px; }
.crail-gh .crail-n { margin-left: auto; font-size: 10.5px; color: var(--faint, var(--muted)); font-variant-numeric: tabular-nums; opacity: 0; transition: opacity .12s; }
.crail:hover .crail-gh .crail-n, .crail.pinned .crail-gh .crail-n, .crail:has(:focus-visible) .crail-gh .crail-n { opacity: 1; }
.crail-gh.holds { color: var(--accent); }
.crail-grp.open > .crail-gh { color: var(--text); font-weight: 600; }
.crail-sub { padding-left: 14px; min-height: 30px; font-size: 12px; gap: 7px; }
.crail-sub .fn-key { font-size: 9.5px; padding: 1px 4px; min-width: 34px; text-align: center; flex: 0 0 auto; }
/* the names under a group show when the rail opens on a desk; on a phone the
   rail is one row of chips (console.css, up to 900 px) and the groups and the
   open group's functions take their place in that row */
@media (min-width: 901px) {
  .crail:not(:hover):not(.pinned):not(:has(:focus-visible)) .crail-sub { display: none; }
}
@media (max-width: 900px) {
  .crail-fns, .crail-grp { display: contents; }
  .crail-gh .crail-n { opacity: 1; margin-left: 2px; }
  .crail-sub { padding-left: 10px; min-height: 40px; }
}
.fn-subtabs { display: flex; gap: 4px; overflow-x: auto; padding: 0 0 8px; margin: -2px 0 2px; border-bottom: 1px solid var(--border); scrollbar-width: thin; }
.fn-subtab { display: inline-flex; align-items: center; gap: 6px; flex: 0 0 auto; padding: 4px 9px 4px 5px; border: 1px solid var(--border); border-radius: 999px; background: var(--panel); color: var(--muted); font: inherit; font-size: 11.5px; cursor: pointer; white-space: nowrap; }
.fn-subtab:hover { color: var(--text); border-color: var(--accent); }
.fn-subtab .fn-key { font-size: 10px; padding: 1px 5px; }
.fn-subtab.on { color: var(--text); border-color: var(--accent); background: var(--accent-soft, var(--panel-2)); font-weight: 600; }
.fn-subtab.grp { padding-left: 9px; color: var(--text-2, var(--text)); font-weight: 600; }
.fn-subtab.grp svg { width: 13px; height: 13px; }
.fn-how { font-size: 12px; color: var(--muted); line-height: 1.5; margin: -6px 0 2px; }
.fn-how b { color: var(--text-2, var(--text)); font-weight: 600; margin-right: 4px; }
/* Back in this tab, another security, and why the page chose the one on screen */
.fn-back { font-family: var(--mono); font-size: 12px; white-space: nowrap; }
.fn-swap { display: inline-flex; }
.fn-swap input { font: inherit; font-size: 12px; padding: 3px 8px; width: 140px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: var(--panel-2); color: var(--text); }
.fn-swap input:focus { outline: none; border-color: var(--accent); }
.fn-why { font-size: 12px; color: var(--muted); line-height: 1.5; margin: -6px 0 2px; }
.fn-why b { font-family: var(--mono); color: var(--text); font-weight: 600; }
.fn-why.bad { color: var(--bad, #e5484d); }
.fn-help-g h3 svg { width: 12px; height: 12px; vertical-align: -1px; margin-right: 4px; }
.fn-help-g.flash { animation: fnflash 1.6s ease-out; border-radius: var(--radius-sm); }
@keyframes fnflash { 0% { background: var(--accent-soft, rgba(255,160,40,.25)); } 100% { background: transparent; } }

/* ---- wave 4 charts ---- */
.rrg-wrap { display: flex; justify-content: center; }
.rrg { width: 100%; max-width: 640px; height: auto; display: block; }
.rrg .q { opacity: .09; }
.rrg .q-lead { fill: var(--good); } .rrg .q-weak { fill: var(--warn); } .rrg .q-lag { fill: var(--bad); } .rrg .q-imp { fill: var(--cyan); }
.rrg .axis { stroke: var(--border-strong, var(--border)); stroke-width: 1; }
.rrg .ql { fill: var(--muted); font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.rrg .rrg-l { fill: var(--text); font-size: 11px; font-family: var(--mono); font-weight: 700; paint-order: stroke; stroke: var(--panel); stroke-width: 3px; }
.rrg .rrg-s { cursor: pointer; }
.beta-sc { width: 100%; max-width: 440px; height: auto; display: block; margin: 0 auto; }
.beta-sc .axis { stroke: var(--border-strong, var(--border)); stroke-width: 1; }
.beta-sc .pt.up { fill: var(--good); opacity: .7; } .beta-sc .pt.down { fill: var(--bad); opacity: .7; }
.beta-sc .fit { stroke: var(--accent); stroke-width: 2; }
.beta-sc .ax { fill: var(--muted); font-size: 10px; font-family: var(--mono); }
.fn-table td.hot { font-weight: 700; }
