/* Settlement Sandbox
   Layout: sticky tool bar; summary (balance beams + flags) over a tabbed workspace. */
:root {
  --bg: #F2F4F7; --panel: #FFFFFF; --panel-2: #E8ECF2; --ink: #17202D; --muted: #5A6577;
  --line: #D2D9E3; --line-2: #BCC5D2;
  --pa: #3452A0; --pa-soft: #DEE5F6; --pb: #A3346A; --pb-soft: #F4DEE8; --on-party: #FFFFFF;
  --ok: #2C7A4D; --ok-soft: #DCEFE3; --warn: #A86300; --warn-soft: #FAEBD4;
  --bad: #B3261E; --bad-soft: #F8DFDC; --info: #46566E; --info-soft: #E3E8F0;
  --focus: #3452A0; --shadow: 0 1px 2px rgba(23,32,45,.06), 0 6px 18px rgba(23,32,45,.08);
  --f-display: 'Newsreader', Georgia, 'Times New Roman', serif;
  --f-body: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-num: 'IBM Plex Mono', ui-monospace, SFMono-Regular, Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) {
  --bg: #10151D; --panel: #18202B; --panel-2: #212A37; --ink: #E5E9F0; --muted: #9AA5B6;
  --line: #2C3747; --line-2: #3B4859;
  --pa: #93AAEE; --pa-soft: #222E4E; --pb: #EB8DBA; --pb-soft: #43213A; --on-party: #0E131A;
  --ok: #6FC995; --ok-soft: #163423; --warn: #F2B55E; --warn-soft: #3A2B12;
  --bad: #F38A80; --bad-soft: #42201C; --info: #A9B6CA; --info-soft: #232D3B;
  --focus: #93AAEE; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.3); color-scheme: dark; } }
:root[data-theme="dark"] {
  --bg: #10151D; --panel: #18202B; --panel-2: #212A37; --ink: #E5E9F0; --muted: #9AA5B6;
  --line: #2C3747; --line-2: #3B4859;
  --pa: #93AAEE; --pa-soft: #222E4E; --pb: #EB8DBA; --pb-soft: #43213A; --on-party: #0E131A;
  --ok: #6FC995; --ok-soft: #163423; --warn: #F2B55E; --warn-soft: #3A2B12;
  --bad: #F38A80; --bad-soft: #42201C; --info: #A9B6CA; --info-soft: #232D3B;
  --focus: #93AAEE; --shadow: 0 1px 2px rgba(0,0,0,.3), 0 6px 18px rgba(0,0,0,.3); color-scheme: dark; }

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; }
body { background: var(--bg); color: var(--ink); font-family: var(--f-body); font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased; }
[hidden] { display: none !important; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
h2 { font-family: var(--f-display); font-weight: 600; font-size: 21px; }
h3 { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
p { margin: 0; }
.num { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.wrap { max-width: 1440px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 18px 56px; }

/* controls */
.btn { border: 1px solid var(--line-2); background: var(--panel); border-radius: 6px; padding: 6px 11px; font-weight: 500; font-size: 13px; white-space: nowrap; }
.btn:hover:not(:disabled) { background: var(--panel-2); }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn.primary { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn.primary:hover:not(:disabled) { background: var(--ink); opacity: .9; }
.btn.danger { color: var(--bad); border-color: var(--bad); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 3px 8px; font-size: 12px; }
input[type=number], input[type=text], input[type=date], select, textarea { border: 1px solid var(--line-2); background: var(--panel); border-radius: 5px; padding: 5px 7px; min-width: 0; }
input[type=number] { font-family: var(--f-num); font-variant-numeric: tabular-nums; }
textarea { width: 100%; resize: vertical; min-height: 64px; }
.seg { display: inline-flex; border: 1px solid var(--line-2); border-radius: 7px; overflow: hidden; background: var(--panel); }
.seg button { border: 0; background: transparent; padding: 6px 11px; font-size: 13px; font-weight: 500; color: var(--muted); }
.seg button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* top bar */
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--panel); }
.bar { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--panel); border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 1440px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 10px; display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; }
.brand { display: flex; gap: 10px; align-items: center; min-width: 0; }
.brand-mark { width: 30px; height: 30px; color: var(--ink); flex: none; }
.brand-name { font-family: var(--f-display); font-weight: 600; font-size: 20px; line-height: 1.1; }
.brand-case { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bar-tools { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filestate { font-size: 12px; color: var(--muted); max-width: 260px; }
.filestate.unsaved { color: var(--warn); }
.menu { position: relative; }
.menu-pop { position: absolute; right: 0; top: calc(100% + 6px); background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; box-shadow: var(--shadow); padding: 6px; display: flex; flex-direction: column; min-width: 200px; z-index: 40; }
.menu-pop button { border: 0; background: transparent; text-align: left; padding: 7px 10px; border-radius: 5px; }
.menu-pop button:hover { background: var(--panel-2); }
.menu-pop hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }

/* welcome */
.welcome { max-width: 760px; margin: 48px auto; display: flex; flex-direction: column; gap: 22px; }
.welcome h1 { font-family: var(--f-display); font-weight: 600; font-size: clamp(30px, 5vw, 42px); line-height: 1.1; letter-spacing: -.01em; }
.welcome .lede { font-size: 16px; color: var(--muted); max-width: 62ch; }
.welcome .actions { display: flex; gap: 10px; flex-wrap: wrap; }
.welcome .btn { padding: 9px 16px; font-size: 14px; }
.points { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 12px; }
.point { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; }
.point b { display: block; margin-bottom: 4px; }
.point p { color: var(--muted); font-size: 13px; }
.privacy { font-size: 13px; color: var(--muted); border-left: 3px solid var(--line-2); padding-left: 12px; }

/* case head */
.chead { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.chead h1 { font-family: var(--f-display); font-weight: 600; font-size: 24px; }
.chead .sub { color: var(--muted); font-size: 13px; }
.legend { display: flex; gap: 14px; font-size: 13px; }
.swatch { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.sw-A { background: var(--pa); } .sw-B { background: var(--pb); }

/* summary */
.summary { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); gap: 14px; margin-bottom: 16px; }
@media (max-width: 1060px) { .summary { grid-template-columns: minmax(0, 1fr); } }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 14px; min-width: 0; }
.beams { display: flex; flex-direction: column; gap: 14px; }
.beam-row { display: grid; gap: 5px; }
.beam-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; flex-wrap: wrap; }
.beam-head .lbl { font-size: 12px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); }
.beam-head .lbl.on { color: var(--ink); }
.beam { position: relative; height: 30px; border-radius: 6px; overflow: hidden; display: flex; background: var(--panel-2); }
.beam.thin { height: 14px; }
.beam .bA, .beam .bB { display: flex; align-items: center; padding: 0 8px; color: var(--on-party); font-family: var(--f-num); font-size: 12px; white-space: nowrap; overflow: hidden; min-width: 0; }
.beam .bA { background: var(--pa); }
.beam .bB { background: var(--pb); justify-content: flex-end; }
.beam .tgt { position: absolute; top: -3px; bottom: -3px; width: 2px; background: var(--ink); transform: translateX(-1px); }
.beam-foot { display: flex; justify-content: space-between; gap: 10px; font-size: 12px; color: var(--muted); flex-wrap: wrap; }
.gapline b { font-family: var(--f-num); font-weight: 500; }
.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: 1px; }
.d-ok { background: var(--ok); } .d-warn { background: var(--warn); } .d-bad { background: var(--bad); } .d-info { background: var(--info); }
.kpis { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.kpi .k { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
.kpi .v { font-family: var(--f-num); font-size: 15px; margin-top: 2px; }
.cA { color: var(--pa); } .cB { color: var(--pb); }
.solver { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; border-top: 1px solid var(--line); padding-top: 12px; }
.solver label { font-size: 12px; color: var(--muted); }
.solver select { flex: 1 1 220px; max-width: 100%; }

.flags-head { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 8px; }
.counts { display: flex; gap: 10px; font-size: 12px; color: var(--muted); }
.flags { display: flex; flex-direction: column; gap: 8px; max-height: 460px; overflow: auto; padding-right: 2px; }
.flag { border-left: 3px solid var(--info); background: var(--info-soft); border-radius: 0 7px 7px 0; padding: 8px 10px; }
.flag.bad { border-color: var(--bad); background: var(--bad-soft); }
.flag.warn { border-color: var(--warn); background: var(--warn-soft); }
.flag.ok { border-color: var(--ok); background: var(--ok-soft); }
.flag .t { font-weight: 600; font-size: 13px; }
.flag .b { font-size: 12.5px; margin-top: 3px; }
.flag ul { margin: 4px 0 0; padding-left: 18px; }

/* tabs */
.tabs { display: flex; gap: 2px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { border: 0; background: transparent; padding: 9px 14px; font-weight: 500; color: var(--muted); border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--ink); }
.toolrow { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; align-items: center; margin-bottom: 10px; }

/* board */
.board { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 1060px) { .board { grid-template-columns: minmax(0, 1fr); } }
.zone { background: var(--panel); border: 1px solid var(--line); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 120px; min-width: 0; }
.zone.over { outline: 2px dashed var(--focus); outline-offset: -4px; }
.zone-A { border-top: 4px solid var(--pa); } .zone-B { border-top: 4px solid var(--pb); } .zone-S { border-top: 4px solid var(--line-2); }
.zone > header { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; flex-wrap: wrap; padding: 2px 2px 4px; }
.zt { font-family: var(--f-num); font-size: 12px; color: var(--muted); }
.zt b { color: var(--ink); font-weight: 500; }
.cards { display: flex; flex-direction: column; gap: 8px; }
.outside { margin-top: 12px; }
.outside .cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.empty { color: var(--muted); font-size: 12px; text-align: center; padding: 16px 4px; border: 1px dashed var(--line-2); border-radius: 8px; }
.acard { background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 9px 10px; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 3px 8px; }
.acard.dragging { opacity: .4; }
.grip { grid-row: 1 / span 6; cursor: grab; color: var(--muted); user-select: none; font-size: 14px; line-height: 1; padding-top: 2px; }
.acard .nm .lnk { border: 0; background: transparent; padding: 0; font-weight: 600; font-size: 13.5px; text-align: left; }
.acard .nm .lnk:hover { text-decoration: underline; }
.chips { display: flex; gap: 4px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; font-size: 11px; font-weight: 500; border-radius: 999px; padding: 1px 7px; background: var(--panel-2); color: var(--muted); white-space: nowrap; }
.chip.est { background: var(--warn-soft); color: var(--warn); }
.chip.sep { background: var(--info-soft); color: var(--info); }
.valrow { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.valbtn { border: 1px dashed transparent; background: transparent; padding: 1px 4px; margin-left: -4px; border-radius: 4px; font-family: var(--f-num); font-size: 15px; font-variant-numeric: tabular-nums; }
.valbtn:hover { border-color: var(--line-2); }
.valin { width: 140px; }
.refv { font-size: 11px; color: var(--muted); font-family: var(--f-num); }
.shares { font-family: var(--f-num); font-size: 12px; display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.slider { display: flex; align-items: center; gap: 8px; }
.slider input[type=range] { flex: 1; min-width: 0; accent-color: var(--pa); }
.slider input[type=number] { width: 78px; }
.mv { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 3px; }
.mv button { border: 1px solid var(--line-2); background: var(--panel); border-radius: 5px; font-size: 11.5px; padding: 2px 8px; color: var(--muted); }
.mv button[aria-pressed="true"] { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.mv button:disabled { opacity: .45; cursor: not-allowed; }
.note-line { font-size: 11.5px; color: var(--muted); }

/* tables */
.tblwrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); }
table { border-collapse: collapse; width: 100%; font-size: 13px; }
th, td { padding: 7px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; white-space: nowrap; }
th { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 600; background: var(--panel-2); }
th.r, td.r { text-align: right; }
td.n { font-family: var(--f-num); font-variant-numeric: tabular-nums; text-align: right; }
tr.sect td { background: var(--panel-2); font-weight: 600; font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; }
tr.tot td { font-weight: 600; border-top: 2px solid var(--line-2); }
tr.out td { color: var(--muted); }
td input[type=number] { width: 120px; }
td input.pct { width: 80px; }

/* payments + settings */
.grid-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(330px, 1fr)); gap: 12px; }
.pcard { display: flex; flex-direction: column; gap: 10px; }
.fgrid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px 12px; }
.fgrid label, .field { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); min-width: 0; }
.fgrid label > input, .fgrid label > select, .fgrid label > textarea { color: var(--ink); width: 100%; }
.fgrid .full { grid-column: 1 / -1; }
.fgrid .help { font-size: 11.5px; color: var(--muted); }
label.check { flex-direction: row; align-items: center; gap: 7px; color: var(--ink); font-size: 13px; }
label.check input { width: auto; }
.calc { background: var(--panel-2); border-radius: 7px; padding: 8px 10px; font-size: 12.5px; display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; }
.calc .num { text-align: right; }
.fine { font-size: 12.5px; color: var(--muted); max-width: 75ch; padding-left: 18px; margin: 0; }
.fine li { margin-bottom: 5px; }
@media (max-width: 520px) { .fgrid { grid-template-columns: minmax(0, 1fr); } }

/* dialog */
dialog { border: 1px solid var(--line-2); border-radius: 12px; background: var(--panel); color: var(--ink); padding: 0; width: min(680px, calc(100vw - 32px)); max-height: calc(100vh - 40px); }
dialog::backdrop { background: rgba(10, 14, 20, .45); }
.dlg { display: flex; flex-direction: column; max-height: calc(100vh - 42px); }
.dlg > header { padding: 14px 16px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.dlg .body { padding: 14px 16px; overflow: auto; display: flex; flex-direction: column; gap: 14px; }
.dlg > footer { padding: 12px 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dlg fieldset { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px 12px; margin: 0; min-width: 0; }
.dlg legend { font-size: 11px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 0 4px; font-weight: 600; }
.hist { font-size: 12px; color: var(--muted); font-family: var(--f-num); }
.actions { display: flex; gap: 6px; flex-wrap: wrap; }

.toast { position: fixed; left: 50%; bottom: calc(18px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 9px 14px; border-radius: 8px; font-size: 13px; box-shadow: var(--shadow); max-width: calc(100vw - 32px); z-index: 60; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

/* banners, scenario picker */
.banner { display: flex; flex-wrap: wrap; gap: 8px 14px; align-items: center; justify-content: space-between; border: 1px solid var(--line-2); background: var(--panel); border-radius: 10px; padding: 10px 12px; margin-bottom: 12px; font-size: 13px; }
.banner.info { background: var(--info-soft); }
.scen-pick { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 320px; }
.scen-sel { font-family: var(--f-display); font-weight: 600; font-size: 21px; padding: 3px 8px; max-width: 100%; }
.err { color: var(--bad); font-size: 13px; }
.unlock { display: flex; flex-direction: column; gap: 8px; }
.menu-pop button:disabled { opacity: .45; cursor: not-allowed; }
.seg button:disabled { opacity: .45; cursor: not-allowed; }

/* summary view */
.sv { display: flex; flex-direction: column; gap: 14px; }
.sv h2 { margin-bottom: 8px; }
.sv-beams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 860px) { .sv-beams { grid-template-columns: minmax(0, 1fr); } }
.sv-cols { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
@media (max-width: 860px) { .sv-cols { grid-template-columns: minmax(0, 1fr); } }
.sv-side.sv-A { border-top: 4px solid var(--pa); }
.sv-side.sv-B { border-top: 4px solid var(--pb); }
.sv-list { list-style: none; margin: 0; padding: 0; }
.sv-list li { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line); }
.sv-list li:last-child { border-bottom: 0; }
.sv-name { display: flex; flex-direction: column; min-width: 0; font-weight: 500; }
.sv-name .chip { align-self: flex-start; margin-top: 2px; }
.sv-tags { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.sv-sub { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 3px 12px; margin-top: 10px; padding-top: 10px; border-top: 2px solid var(--line-2); font-size: 13px; }
.sv-sub .num { text-align: right; }
.sv-pay { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; }
.sv-notes { white-space: pre-wrap; max-width: 75ch; }
.sv-actions { justify-content: flex-end; }
.tblwrap.flat { border: 0; }
.flags.tall { max-height: none; }

/* hidden but still holding its place in the tool bar */
.is-off { visibility: hidden; }

/* import report, file drop, links */
.issues { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 6px; font-size: 13px; }
.issues.bad li::marker { color: var(--bad); }
.issues code { font-family: var(--f-num); font-size: 11.5px; background: var(--panel-2); padding: 1px 5px; border-radius: 4px; overflow-wrap: anywhere; }
.menu-pop .menu-link { display: block; padding: 7px 10px; border-radius: 5px; color: inherit; text-decoration: none; }
.menu-pop .menu-link:hover { background: var(--panel-2); }
.privacy a, .dlg a { color: var(--pa); }
body.filedrop #app { outline: 3px dashed var(--focus); outline-offset: -8px; border-radius: 12px; }
a.btn { text-decoration: none; color: inherit; display: inline-flex; align-items: center; }
.sv-how { font-size: 12px; color: var(--ink); font-weight: 400; margin-top: 2px; max-width: 60ch; white-space: normal; }
td input[type=text] { width: 100%; min-width: 220px; }
/* money by type */
.bytype { margin-top: 8px; }
.bytype th.grp { text-align: center; border-bottom: 1px solid var(--line); }
.bytype tr.adj td { color: var(--muted); }
.bytype tr.adj td:first-child { font-style: italic; }
.bytype td:first-child { white-space: nowrap; }
.bytype-note { margin: 6px 0 0; }

/* Edit: one-line scoreboard (the full analysis is in the report) */
.score { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 24px; padding: 12px 16px; margin-bottom: 14px; }
.sc-gaps { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 22px; }
.sc-gap { display: inline-flex; align-items: center; gap: 6px; font-size: 14px; }
.sc-l { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.sc-issues { font-size: 13px; display: inline-flex; align-items: center; gap: 6px; }
.score .solver { margin: 0; padding: 0; border: 0; flex: 1 1 420px; justify-content: flex-end; }
/* board values are case facts: shown here, changed under Whole case > Assets */
.valtxt { font-family: var(--f-num); font-variant-numeric: tabular-nums; font-size: 15px; }
/* report: the deal / how it holds up / assumptions */
.sv h2.part { font-family: var(--f-display); font-size: 22px; font-weight: 600; margin: 10px 0 -4px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.sv h2.part:first-child { margin-top: 0; }
table.register .chips { display: flex; flex-wrap: wrap; gap: 4px; max-width: 360px; }
/* a button that reads as a text link (jumps between tabs and views) */
button.lnk:not(.acard .lnk) { border: 0; background: transparent; padding: 0; color: inherit; font-weight: 600; text-decoration: underline; text-decoration-color: var(--line-2); text-underline-offset: 3px; }
button.lnk:not(.acard .lnk):hover { text-decoration-color: currentColor; }
.sv #issues { scroll-margin-top: 84px; }
.tabs button { padding: 9px 12px; }
.score > * { min-width: 0; }
.score .solver { min-width: 0; flex: 1 1 340px; }
.score .solver select { min-width: 0; }
@media (max-width: 640px) {
  .score .solver label { flex: 1 1 100%; }
  .score .solver select { flex: 1 1 0; width: 0; }
}

/* the three views: web tabs at the top left, right after the title; the active one is
   underlined on the bar's bottom edge. Actions (Undo, Share, File) stay on the right. */
.views { display: flex; align-self: stretch; margin-block: -10px; }
.views button { border: 0; border-block: 3px solid transparent; background: transparent; padding: 0 14px; font-size: 15px; font-weight: 500; color: var(--muted); white-space: nowrap; }
.views button:hover:not(:disabled) { color: var(--ink); }
.views button[aria-pressed="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }
.views button:disabled { opacity: .45; cursor: not-allowed; }
.bar-inner > .bar-tools { margin-left: auto; }
@media (max-width: 900px) {
  /* on narrow screens the tabs get their own full-width row at the bottom of the bar */
  .views { order: 3; flex: 1 1 100%; margin: 0 calc(-1 * max(16px, env(safe-area-inset-left, 0px))) -10px; border-top: 1px solid var(--line); }
  .views button { flex: 1 1 0; padding: 11px 6px 8px; }
}
/* scenario page: balance bars on top of the scoreboard */
.score { flex-direction: column; align-items: stretch; gap: 12px; padding: 14px 16px; }
.score-beams { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
@media (max-width: 860px) { .score-beams { grid-template-columns: minmax(0, 1fr); } }
.score .sc-gaps { justify-content: space-between; border-top: 1px solid var(--line); padding-top: 10px; }
.score .sc-gaps .solver { flex: 1 1 340px; }
/* balance strip that follows you down the scenario page */
.stickybal { position: fixed; left: 0; right: 0; z-index: 15; background: var(--panel); border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px rgb(0 0 0 / .07); transform: translateY(-110%); opacity: 0; pointer-events: none; transition: transform .15s ease, opacity .15s ease; }
.stickybal.show { transform: none; opacity: 1; }
.stickybal-in { max-width: 1440px; margin: 0 auto; padding: 7px max(16px, env(safe-area-inset-left, 0px)); display: flex; flex-wrap: wrap; align-items: center; gap: 4px 26px; font-size: 13px; }
.mb { display: inline-flex; align-items: center; gap: 8px; white-space: nowrap; }
.mb-l { color: var(--muted); font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; }
.mb-bar { position: relative; display: inline-flex; width: 110px; height: 8px; border-radius: 4px; overflow: hidden; background: var(--line); }
.mb-a { background: var(--pa); } .mb-b { background: var(--pb); }
.mb-t { position: absolute; top: 0; bottom: 0; width: 2px; margin-left: -1px; background: var(--ink); }
.mb-g { display: inline-flex; align-items: center; gap: 5px; }
.mb-delta { color: var(--muted); font-size: 13px; }
.score .sc-gaps .mb-delta { margin-right: auto; }
@media (max-width: 640px) { .mb-bar { width: 70px; } .stickybal-in { gap: 2px 16px; } }
