/* barj capital · portfolio lab: the Monitor's language (monitor.css): Geist, Geist Mono for figures, hairline
   rules, square corners, gold for the account you chose, blue for the cheapest one. */
.lab {
  --panel: #0E1424; --line: rgba(244,239,230,0.16); --line-soft: rgba(244,239,230,0.08);
  --fg: #F4EFE6; --fg-2: #D9D4C9; --muted: #9AA0B4; --faint: #8C92A8; --gold: #C9A87A; --blue: #7AA6D9;
  color: var(--fg); font-variant-numeric: lining-nums tabular-nums; color-scheme: dark;
  padding-bottom: 4rem;
}
.lab *, .lab *::before, .lab *::after { box-sizing: border-box; }
.lab button, .lab input, .lab select { font: inherit; color: inherit; }
.lab .wrap { max-width: 1280px; margin: 0 auto; padding: 0 var(--gutter); }
.lab .kicker, .lab .lbl, .lab .stamp, .lab .card-title, .lab .note { font-size: 12.5px; color: var(--faint); font-weight: 500; }
.lab h2 { font-weight: 400; font-size: var(--fs-h2); margin: 0; line-height: 1.2; }
.lab h3 { font-weight: 500; font-size: 1rem; margin: 0 0 0.6rem; }
.lab code { font-family: var(--mono); font-size: 0.9em; color: var(--fg-2); }

/* hero */
.lab .lab-hero { padding-top: clamp(6.5rem, 12vh, 9rem); padding-bottom: 1.25rem; }
.lab-hero h1 { font-weight: 400; font-size: clamp(2.1rem, 4.6vw, 3.6rem); line-height: 1.05; margin: 0.7rem 0 1.2rem; max-width: 20ch; }
.lab .lead { max-width: 68ch; color: var(--fg-2); font-size: 1.1rem; line-height: 1.6; margin: 0; }
.lab .stamp { margin: 1.1rem 0 0; font-family: var(--mono); font-weight: 400; }

/* control bar */
.lab-bar { position: sticky; top: 64px; z-index: 30; background: rgba(10,15,28,0.94); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); margin: 1.5rem 0 2.5rem; }
.lab-controls { display: flex; flex-wrap: wrap; gap: 0.7rem 1.6rem; padding-top: 0.8rem; padding-bottom: 0.8rem; align-items: flex-end; }
.lab .ctl { display: flex; flex-direction: column; gap: 0.3rem; min-width: 0; }
.lab .chips { display: inline-flex; flex-wrap: wrap; border: 1px solid var(--line); }
.lab .chips button { border: 0; border-left: 1px solid var(--line-soft); background: none; padding: 0.38rem 0.6rem; cursor: pointer; white-space: nowrap;
  font-size: 12.5px; color: var(--muted); transition: color .2s, background .2s; }
.lab .chips button:first-child { border-left: 0; }
.lab .chips button:hover { color: var(--fg); }
.lab .chips button[aria-pressed=true] { color: var(--fg); background: rgba(244,239,230,0.07); box-shadow: inset 0 -1px 0 var(--gold); font-weight: 500; }
.lab [data-ctl=size] button { font-family: var(--mono); font-size: 12px; }
.lab select, .lab input[type=number] { background: var(--panel); border: 1px solid var(--line); border-radius: 0; padding: 0.38rem 0.5rem; font-size: 13px; }
.lab select { max-width: min(340px, 100%); }
.lab .ctl-broker { flex: 1 1 220px; max-width: 360px; }
.lab .gross-in { display: inline-flex; gap: 0.5rem 0.7rem; align-items: center; flex-wrap: wrap; }
.lab input[type=number] { width: 5.5rem; font-family: var(--mono); }
.lab input.is-default { color: var(--muted); }
.lab .gross-note { font-size: 12px; color: var(--faint); }
.lab .link { background: none; border: 0; padding: 0; color: var(--gold); cursor: pointer; font-size: 12.5px; text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 720px) {
  .lab-bar { position: static; }
  .lab-controls { gap: 0.6rem 1rem; }
  .lab .ctl-broker { flex-basis: 100%; max-width: none; }
  .lab select { max-width: 100%; width: 100%; }
}

/* sections and cards */
.lab .lab-sec { margin-top: clamp(3rem, 6vw, 4.5rem); }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; flex-wrap: wrap; }
.lab .card { background: var(--panel); border: 1px solid var(--line-soft); padding: clamp(1rem, 2.4vw, 1.6rem); }
.lab .card-title { margin: 0 0 1.1rem; font-family: var(--mono); font-weight: 400; color: var(--muted); overflow-wrap: anywhere; }
.lab .note { margin: 1rem 0 0; font-weight: 400; line-height: 1.55; }
.lab .empty { color: var(--fg-2); margin: 0; }

/* waterfall */
.wf { display: grid; gap: 6px; }
.wf-row { display: grid; grid-template-columns: minmax(9rem, 13rem) 1fr 5.2rem 6.6rem; align-items: center; gap: 0.8rem; font-size: 13.5px; }
.wf-l { color: var(--fg-2); }
.wf-track { position: relative; height: 18px; background: linear-gradient(90deg, var(--line-soft) 1px, transparent 1px) 0 0 / 10% 100%; }
.wf-bar { position: absolute; top: 2px; bottom: 2px; min-width: 2px; background: var(--fg-2); transition: left .6s var(--ease), width .6s var(--ease), background .3s; }
.wf-row.gross .wf-bar { background: rgba(244,239,230,0.45); }
.wf-row.net .wf-bar { background: var(--gold); }
.wf-row.net .wf-l, .wf-row.net .wf-v { color: var(--fg); font-weight: 500; }
.wf-v, .wf-u { font-family: var(--mono); font-size: 12.5px; text-align: right; white-space: nowrap; }
.wf-u { color: var(--muted); }
.wf-row.cost .wf-v { color: #E8A0A0; }
.wf-zoom { margin: 0 0 0.9rem; }
.wf-row.zoomed .wf-track::before { content: ""; position: absolute; left: 0; top: -2px; bottom: -2px; width: 6px;
  background: repeating-linear-gradient(135deg, transparent 0 2px, var(--panel) 2px 4px); z-index: 1; }
.wf-split { display: flex; height: 6px; margin-top: 1rem; gap: 1px; }
.wf-split span { min-width: 2px; transition: flex-grow .6s var(--ease); }
.wf-sum { margin: 1rem 0 0; color: var(--fg-2); line-height: 1.55; }
.wf-sum b { color: var(--fg); font-weight: 500; }
@media (max-width: 600px) {
  .wf-row { grid-template-columns: 1fr auto auto; grid-template-areas: "l v u" "t t t"; gap: 0.15rem 0.7rem; }
  .wf-l { grid-area: l; } .wf-v { grid-area: v; } .wf-u { grid-area: u; } .wf-track { grid-area: t; height: 14px; }
}

/* fan */
.fan-wrap { position: relative; width: 100%; }
.fan-wrap canvas { display: block; touch-action: pan-y; }
.fan-tip { position: absolute; top: 6px; transform: translateX(-50%); background: rgba(10,15,28,0.94); border: 1px solid var(--line); padding: 0.35rem 0.55rem;
  font: 12px/1.45 var(--mono); display: flex; flex-direction: column; pointer-events: none; white-space: nowrap; }
.fan-tip[hidden] { display: none; }
.fan-tip .t-sel { color: var(--gold); } .fan-tip .t-best { color: var(--blue); } .fan-tip .t-gross { color: var(--muted); }
.legend { display: flex; flex-wrap: wrap; gap: 0.4rem 1.4rem; margin-top: 0.8rem; font-size: 12.5px; color: var(--muted); }
.legend .lg { display: inline-flex; align-items: center; gap: 0.45rem; }
.legend i { display: inline-block; width: 18px; height: 0; border-top: 2px solid var(--gold); }
.legend .best i { border-top: 2px dashed var(--blue); }
.legend .gross i { border-top: 1px dotted rgba(244,239,230,0.7); }
.fan-sum { margin: 0.9rem 0 0; color: var(--fg-2); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); margin: 1rem 0 0; }
.kpi { background: var(--panel); padding: 0.75rem 0.9rem 0.8rem; min-width: 0; }
.kpi > span { display: block; font-size: 12.5px; color: var(--faint); }
.kpi > b { display: block; font: 500 1.35rem/1.25 var(--mono); margin-top: 0.2rem; }
.kpi small { display: block; font: 400 12px/1.4 var(--mono); color: var(--muted); margin-top: 0.25rem; }

/* ladder */
.ladder { list-style: none; margin: 1rem 0 0; padding: 0; display: grid; gap: 2px; }
.lad-b { width: 100%; display: grid; grid-template-columns: minmax(12rem, 22rem) 1fr 10.5rem; gap: 0.8rem; align-items: center; background: none; border: 0;
  padding: 0.3rem 0.4rem; text-align: left; cursor: pointer; font-size: 13px; }
.lad-b:hover { background: rgba(244,239,230,0.04); }
.lad.is-sel .lad-b { background: rgba(201,168,122,0.1); box-shadow: inset 2px 0 0 var(--gold); }
.lad.is-best .lad-b { box-shadow: inset 2px 0 0 var(--blue); }
.lad.is-sel.is-best .lad-b { box-shadow: inset 2px 0 0 var(--gold), inset 4px 0 0 var(--blue); }
.lad.is-out { opacity: 0.45; }
.lad-n { display: flex; align-items: baseline; gap: 0.5rem; min-width: 0; }
.lad-r { font-family: var(--mono); color: var(--faint); font-size: 11.5px; min-width: 1.6rem; }
.lad-t { color: var(--fg-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lad-g, .lab .tag { flex: none; }
.lad-g { font-family: var(--mono); font-size: 11px; color: var(--faint); }
.lab .tag { font-size: 10.5px; padding: 0 0.35rem; border: 1px solid currentColor; line-height: 1.5; }
.lab .tag.best { color: var(--blue); } .lab .tag.sel { color: var(--gold); }
.lad-track { height: 10px; }
.lad-bar { display: flex; height: 100%; }
.lad-bar span { min-width: 1px; }
.lad-v { font-family: var(--mono); font-size: 12px; color: var(--muted); text-align: right; }
@media (max-width: 720px) {
  .lad-b { grid-template-columns: 1fr auto; grid-template-areas: "n v" "t t"; gap: 0.2rem 0.6rem; }
  .lad-n { grid-area: n; } .lad-v { grid-area: v; max-width: 11rem; } .lad-track { grid-area: t; height: 6px; }
}
.unpriced .link { font-size: inherit; }
.unpriced { margin-top: 1.2rem; font-size: 13px; color: var(--muted); }
.unpriced summary { cursor: pointer; color: var(--fg-2); }
.unpriced ul { columns: 2 22rem; column-gap: 2rem; padding-left: 1.1rem; }
.unpriced li { break-inside: avoid; margin: 0.15rem 0; }
.unpriced b { color: var(--fg-2); font-weight: 500; }

/* assumptions */
.ass-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 520px), 1fr)); gap: 1px; background: var(--line-soft); border: 1px solid var(--line-soft); margin-top: 1rem; }
.ass { background: var(--bg); padding: clamp(1rem, 2.4vw, 1.6rem); min-width: 0; font-size: 14.5px; line-height: 1.6; color: var(--fg-2); }
.ass p { margin: 0 0 0.8rem; }
.tex-block { overflow-x: auto; overflow-y: hidden; margin: 0.6rem 0 1rem; padding: 0.2rem 0; color: var(--fg); }
.tex-block .katex-display { margin: 0; }
.lab .katex { font-size: 1.05em; }
.mini-wrap { overflow-x: auto; }
.mini { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.mini th, .mini td { padding: 0.3rem 0.5rem; border-bottom: 1px solid var(--line-soft); text-align: right; white-space: nowrap; }
.mini th:first-child { text-align: left; }
.mini thead th { color: var(--faint); font-weight: 500; }
.mini td { font-family: var(--mono); }
.mini tr.is-sel th, .mini tr.is-sel td { color: var(--fg); }
.sources { list-style: none; padding: 0; margin: 0.6rem 0 0; display: grid; gap: 0.7rem; font-size: 13px; }
.sources li { border-left: 1px solid var(--line); padding-left: 0.8rem; overflow-wrap: anywhere; }
.sources .src-rule { display: block; color: var(--fg); font-weight: 500; }
.sources q { display: block; color: var(--muted); font-style: italic; margin: 0.15rem 0; }
.sources a { color: var(--gold); text-decoration: underline; text-underline-offset: 3px; }
.plain { padding-left: 1.1rem; margin: 0; }
.plain li { margin: 0.25rem 0; }
.lab .disclaimer { margin-top: 2.5rem; margin-bottom: 0; font-size: 12.5px; color: var(--faint); }
@media (prefers-reduced-motion: reduce) { .wf-bar, .wf-split span { transition: none; } }
