/* deals.css: the deal analyzer (#deals/<id>), the deal pipeline (#deals) and the comparison (#deals/compare/...).
   Tokens and component classes (panel, rd tiles, seg, chip, btn, sb-* table, ev-pill) come from app.css. Data colours:
   blue --s1 for the highlighted series, amber --s2 for what wants attention, --up and --down for gains and losses. */

/* ---------- shared ---------- */
.dl-acts { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.dl-acts.center { justify-content: center; }
.dl-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: color-mix(in srgb, var(--muted) 35%, transparent); flex: none; }
.dl-dot.g-good { background: var(--up); }
.dl-dot.g-watch { background: var(--s2); }
.dl-dot.g-poor { background: var(--down); }
.dl-gv { display: inline-flex; align-items: center; gap: 7px; }
.dl-msg { color: var(--muted); font-size: 13px; margin: 12px 0 0; }
.dl-pop { min-width: 230px; }
.dl-mi { all: unset; box-sizing: border-box; display: block; width: 100%; padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; }
.dl-mi:hover, .dl-mi:focus-visible { background: var(--panel-2); }
.dl-mi.danger { color: var(--down); }
.dl-card { container-type: inline-size; min-width: 0; }
.dl-card > .panel-h { margin-bottom: 10px; }

/* ---------- analyzer: the bar along the top ---------- */
.dl-bar { display: flex; flex-direction: column; gap: 10px; }
.dl-bar1 { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.dl-back { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-weight: 500; padding: 6px 10px 6px 6px; border-radius: 8px; white-space: nowrap; }
.dl-back:hover { color: var(--fg); background: var(--panel-2); }
.dl-name { flex: 1 1 280px; min-width: 0; font: 600 clamp(20px, 2.3vw, 26px)/1.25 var(--head); letter-spacing: -.01em; color: var(--fg); background: transparent; border: 1px solid transparent; border-radius: 8px; padding: 3px 8px; }
.dl-name:hover { border-color: var(--line); }
.dl-name:focus { outline: none; background: var(--panel); border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.dl-name::placeholder { color: var(--muted); }
.dl-strat { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; }
.dl-strat .sb-lbl:not(:first-child) { margin-left: 8px; }
.dl-model { display: inline-flex; align-items: center; }
.dl-save { display: inline-flex; }
.dl-saved { display: inline-flex; align-items: center; gap: 7px; font-size: 12.5px; color: var(--muted); white-space: nowrap; padding: 0 4px; }
.dl-saved i { width: 7px; height: 7px; border-radius: 50%; background: var(--up); }
.dl-saved.busy i { background: var(--s2); }
.dl-saved.err { color: var(--down); }
.dl-saved.err i { background: var(--down); }

/* ---------- analyzer: inputs beside the results ---------- */
.dl-wrap { container: dl / inline-size; }
.dl-main { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: start; }
@container dl (min-width: 980px) {
  .dl-main { grid-template-columns: 372px minmax(0, 1fr); }
  .dl-form { position: sticky; top: 16px; max-height: calc(100vh - 32px); overflow: auto; overscroll-behavior: contain; }
  .dl-live { display: none !important; }
}
@container dl (min-width: 1380px) { .dl-main { grid-template-columns: 404px minmax(0, 1fr); } }
.dl-form { container: dlf / inline-size; background: var(--panel); border: 1px solid var(--line); border-radius: var(--r); box-shadow: var(--shadow); min-width: 0; scrollbar-width: thin; }
.dl-sec { border-top: 1px solid var(--line); }
.dl-sec:first-child { border-top: 0; }
.dl-sec > summary { display: flex; align-items: center; gap: 10px; padding: 13px 16px; cursor: pointer; list-style: none; user-select: none; -webkit-user-select: none; border-radius: var(--r); }
.dl-sec > summary::-webkit-details-marker { display: none; }
.dl-sec > summary::before { content: ""; flex: none; width: 6px; height: 6px; margin: 0 3px 2px 1px; border-right: 1.7px solid var(--muted); border-bottom: 1.7px solid var(--muted); transform: rotate(-45deg); transition: transform .15s; }
.dl-sec[open] > summary::before { transform: rotate(45deg); margin-bottom: 4px; }
.dl-sec > summary:hover .dl-sh { color: var(--accent); }
.dl-sh { font: 600 14px var(--sans); white-space: nowrap; }
.dl-dg { margin-left: auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12.5px; color: var(--muted); font-variant-numeric: tabular-nums; }
.dl-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px 16px; }
@container dlf (max-width: 330px) { .dl-grid { grid-template-columns: minmax(0, 1fr); } }
.dl-grid > .wide { grid-column: 1 / -1; }
.dl-grid > [hidden] { display: none; }
.dl-f { display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.dl-fl { display: flex; align-items: center; min-height: 16px; font-size: 12px; font-weight: 500; color: var(--muted); }
.dl-fl label { cursor: pointer; }
.dl-fl .help { margin-left: 5px; }
.dl-box { display: flex; align-items: center; min-width: 0; background: var(--panel); border: 1px solid var(--line); border-radius: 8px; transition: border-color .12s, box-shadow .12s; }
.dl-box:hover { border-color: color-mix(in srgb, var(--muted) 45%, var(--line)); }
.dl-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent); }
.dl-box i { flex: none; font-style: normal; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.dl-box i.pre { padding-left: 10px; }
.dl-box i.suf { padding-right: 10px; }
.dl-in { flex: 1 1 auto; width: 100%; min-width: 0; border: 0; background: transparent; padding: 8px 10px; font: 500 14px var(--sans); font-variant-numeric: tabular-nums; color: var(--fg); }
.dl-box i.pre + .dl-in { padding-left: 4px; }
.dl-in:focus, .dl-in:focus-visible { outline: none; }
.dl-in::placeholder { color: color-mix(in srgb, var(--muted) 80%, transparent); font-weight: 400; }
.dl-sel { width: 100%; font-size: 14px; color: var(--fg); }
.dl-pair { display: flex; align-items: center; gap: 8px; min-width: 0; }
.dl-pair .dl-box { flex: 1 1 auto; }
.dl-pair .seg { flex: none; flex-wrap: nowrap; }
.dl-pair .seg[hidden] { display: none; }
.dl-f > .seg { align-self: flex-start; }
.dl-ck { flex-direction: row; align-items: center; min-height: 34px; }
.dl-ckl { display: inline-flex; align-items: center; gap: 8px; font-size: 13.5px; cursor: pointer; }
.dl-ckl input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }
.dl-hint, .dl-calc { grid-column: 1 / -1; margin: 0; font-size: 12.5px; line-height: 1.45; color: var(--muted); }
.dl-calc { font-variant-numeric: tabular-nums; }
.dl-calc:empty { display: none; }
.dl-hint { background: var(--panel-2); border-radius: 8px; padding: 8px 10px; }
.dl-notes { width: 100%; min-height: 92px; }
.dl-rates { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: -4px; }
.dl-rates.empty { display: none; }
.dl-rl { display: inline-flex; align-items: center; font-size: 12px; color: var(--muted); }
.dl-rates .chip { padding: 3px 10px; font-size: 12px; }
.dl-tab { position: relative; }
.dl-ta { position: absolute; left: -1px; right: -1px; top: calc(100% + 4px); z-index: 30; max-height: 300px; overflow: auto; padding: 4px; background: var(--panel); border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--pop); }
.dl-ta[hidden] { display: none; }
.dl-ta-o { all: unset; box-sizing: border-box; display: flex; flex-direction: column; gap: 1px; width: 100%; padding: 7px 9px; border-radius: 7px; cursor: pointer; }
.dl-ta-o b { font-size: 13.5px; font-weight: 600; }
.dl-ta-o small { font-size: 12px; color: var(--muted); }
.dl-ta-o:hover, .dl-ta-o[aria-selected="true"] { background: var(--panel-2); }
.dl-ta-m { margin: 0; padding: 8px 10px; font-size: 13px; color: var(--muted); }
/* On a narrow screen the inputs come first; this strip keeps the headline figures in sight while you type. */
.dl-live { all: unset; box-sizing: border-box; position: sticky; z-index: 6; bottom: calc(var(--mobile-nav-height, 0px) + 10px); display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)) auto; gap: 10px; align-items: center; margin: 0 10px 10px; padding: 9px 14px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--pop); cursor: pointer; }
.dl-live:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.dl-live span { display: flex; flex-direction: column; min-width: 0; }
.dl-live small { font-size: 11px; color: var(--muted); }
.dl-live b { font: 600 15px var(--sans); font-variant-numeric: tabular-nums; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dl-live-go { font-style: normal; font-weight: 700; color: var(--accent); }

/* ---------- analyzer: results ---------- */
.dl-out { container: dlo / inline-size; }
.dl-out, .dl-res, .dl-needbox { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.dl-res[hidden], .dl-needbox[hidden] { display: none; }
.dl-two { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 360px), 1fr)); gap: 16px; align-items: start; }
.dl-tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 178px), 1fr)); gap: 10px; }
/* Nine tiles for a rental, six for a flip: three across at middle widths, then five (or six) across. */
@container dlo (min-width: 560px) { .dl-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@container dlo (min-width: 1000px) { .dl-tiles { grid-template-columns: repeat(5, minmax(0, 1fr)); } .dl-tiles.n6 { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
.rd.dl-tile { cursor: default; gap: 5px; padding: 13px 14px 13px; overflow: hidden; }
.dl-tile::before { content: ""; position: absolute; inset: 0 0 auto; height: 3px; background: transparent; }
.dl-tile.t-good::before { background: var(--up); }
.dl-tile.t-watch::before { background: var(--s2); }
.dl-tile.t-poor::before { background: var(--down); }
.dl-tile .rd-h { flex-wrap: wrap; align-items: flex-start; gap: 4px 6px; font-size: 12.5px; min-height: 0; }
.dl-tt { display: inline-flex; align-items: center; font-weight: 600; color: var(--muted); }
.dl-tile .ev-pill { font-size: 10.5px; }
.dl-tile .rd-b b { font-size: 23px; overflow-wrap: anywhere; }
.dl-tile .rd-b small { font-size: 12px; }
.dl-tile.ghost .rd-b b { color: var(--line); }
.dl-need { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 28px 20px; text-align: center; }
.dl-need > b { font: 600 17px var(--head); }
.dl-need > p { margin: 0 0 8px; max-width: 54ch; color: var(--muted); }

/* each month, from the rent down to the cash flow */
.dl-wf { display: flex; flex-direction: column; }
.dl-wf-r { display: grid; grid-template-columns: minmax(104px, 38%) minmax(50px, 1fr) minmax(72px, auto); gap: 10px; align-items: center; padding: 4px 0; font-size: 13px; }
.dl-wf-l { min-width: 0; }
.dl-wf-r.out .dl-wf-l { color: var(--muted); }
.dl-wf-r > b { text-align: right; font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl-wf-r.sub, .dl-wf-r.tot { margin-top: 3px; padding-top: 8px; border-top: 1px solid var(--line); font-weight: 600; }
.dl-wf-r.sub > b, .dl-wf-r.tot > b { font-weight: 600; }
.dl-wf-r.tot { border-top-color: var(--fg); font-size: 14px; }
.dl-wf-t { position: relative; height: 13px; }
.dl-wf-r.tot .dl-wf-t { height: 17px; }
.dl-wf-z { position: absolute; top: -5px; bottom: -5px; border-left: 1px dashed color-mix(in srgb, var(--muted) 60%, transparent); }
.dl-wf-b { position: absolute; top: 0; bottom: 0; border-radius: 3px; }
.dl-wf-r.in .dl-wf-b { background: var(--up); }
.dl-wf-r.out .dl-wf-b { background: color-mix(in srgb, var(--down) 62%, transparent); }
.dl-wf-r.sub .dl-wf-b { background: var(--s1); }
.dl-wf-r.tot.pos .dl-wf-b { background: var(--up); }
.dl-wf-r.tot.neg .dl-wf-b { background: var(--down); }

.dl-chart { position: relative; margin-top: 8px; }
.dl-chart svg { display: block; width: 100%; height: auto; }

/* the refinance */
.dl-bigs { display: grid; grid-template-columns: repeat(auto-fit, minmax(128px, 1fr)); gap: 12px 18px; }
.dl-big { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl-big small { font-size: 12px; font-weight: 500; color: var(--muted); }
.dl-big b { font: 600 20px/1.2 var(--head); font-variant-numeric: tabular-nums; }
.dl-big span { font-size: 12px; color: var(--muted); }
.dl-back-bar { height: 10px; margin: 14px 0 8px; overflow: hidden; border-radius: 5px; background: var(--panel-2); box-shadow: inset 0 0 0 1px var(--line); }
.dl-back-bar i { display: block; height: 100%; border-radius: 5px; background: var(--s1); }

/* a flip's cash */
.dl-kvs { display: flex; flex-direction: column; }
.dl-kv { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.dl-kv:first-child { border-top: 0; }
.dl-kv b { font-weight: 500; font-variant-numeric: tabular-nums; white-space: nowrap; }
.dl-kv.sum { font-weight: 600; border-top-color: var(--fg); }
.dl-kv.sum b { font-weight: 600; }
.dl-kv.muted { color: var(--muted); }

/* year by year */
.sb-scroll.dl-projs { max-height: min(70vh, 760px); border: 1px solid var(--line); border-radius: 10px; }
.dl-proj { font-size: 13px; }
.dl-proj thead th { padding: 9px 12px; font-size: 12px; color: var(--muted); }
.dl-proj th.r { text-align: right; }
.dl-proj .l { text-align: left; }
.dl-thx { display: inline-flex; align-items: center; justify-content: flex-end; }
.dl-proj td { padding: 7px 12px; font-variant-numeric: tabular-nums; }
.dl-proj tr.dl-y0 td { background: var(--panel-2); }
.dl-proj tbody tr:hover td { background: var(--panel-2); }
.dl-salebar { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; padding: 12px 14px; background: var(--panel-2); border-radius: 10px; }
.dl-salebar > i { font-style: normal; color: var(--muted); font-weight: 600; }
.dl-sb-h, .dl-sb-i { display: flex; flex-direction: column; gap: 1px; }
.dl-sb-h { margin-right: 6px; }
.dl-sb-h b { font-size: 13.5px; }
.dl-salebar small { font-size: 11.5px; color: var(--muted); }
.dl-sb-i b { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.dl-sb-i.net b { font-size: 17px; }

/* stress tests */
.dl-st { display: flex; flex-direction: column; }
.dl-st-r { display: grid; grid-template-columns: minmax(0, 1fr) 96px 52px 62px 96px; gap: 10px; align-items: center; padding: 9px 0; border-top: 1px solid var(--line); font-size: 13px; }
.dl-st-r.head { padding: 0 0 6px; border-top: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.dl-st-r .r { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-st-n { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl-st-n b { font-weight: 600; }
.dl-st-n small { font-size: 12px; line-height: 1.4; color: var(--muted); }
.dl-st-p { display: flex; justify-content: flex-end; }
@container (max-width: 600px) {
  .dl-st-r { grid-template-columns: repeat(3, minmax(0, 1fr)) auto; row-gap: 6px; }
  .dl-st-n { grid-column: 1 / -1; }
  .dl-st-r.head { display: none; }
  .dl-st-r .r { text-align: left; }
  .dl-st-r .r::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted); }
}

/* what it would take */
.dl-svs { display: flex; flex-direction: column; }
.dl-sv { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.dl-sv:first-child { padding-top: 2px; border-top: 0; }
.dl-sv-l { font-size: 13.5px; line-height: 1.9; }
.dl-sv-v { display: flex; flex-direction: column; text-align: right; min-width: 0; }
.dl-sv-v b { font: 600 18px/1.25 var(--head); font-variant-numeric: tabular-nums; }
.dl-sv-v small { font-size: 12px; color: var(--muted); }
.dl-sv-a { display: flex; align-items: center; justify-content: flex-end; gap: 8px; min-width: 76px; }
.inp.dl-tgt { display: inline-block; width: 56px; margin: 0 2px; padding: 3px 6px; text-align: center; font-weight: 600; }
@container (max-width: 520px) {
  .dl-sv { grid-template-columns: minmax(0, 1fr) auto; }
  .dl-sv-l { grid-column: 1 / -1; }
  .dl-sv-v { text-align: left; }
}

/* sensitivity */
.dl-heatg { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 430px), 1fr)); gap: 22px; }
.dl-heatw { min-width: 0; }
.dl-heat-t { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 10px; margin-bottom: 8px; }
.dl-heat-t b { font-size: 13.5px; font-weight: 600; }
.dl-heat-t span { font-size: 12px; }
.dl-heats { overflow-x: auto; }
.dl-heat { width: 100%; border-collapse: separate; border-spacing: 3px; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.dl-heat th { padding: 4px 6px; font-size: 11.5px; font-weight: 600; color: var(--muted); white-space: nowrap; text-align: center; }
.dl-heat tbody th { text-align: right; }
.dl-heat th.at { color: var(--fg); }
.dl-heat td { padding: 7px 4px; text-align: center; white-space: nowrap; border-radius: 5px; background: var(--panel-2); }
.dl-heat td.h-good { background: color-mix(in srgb, var(--up) 18%, var(--panel)); }
.dl-heat td.h-watch { background: color-mix(in srgb, var(--s2) 18%, var(--panel)); }
.dl-heat td.h-poor { background: color-mix(in srgb, var(--down) 16%, var(--panel)); }
.dl-heat td.at { outline: 2px solid var(--fg); outline-offset: -1px; font-weight: 700; }
.dl-heat th.dl-hc { text-align: left; }
.dl-hc span { display: block; font-size: 10.5px; font-weight: 500; line-height: 1.25; }

/* market check */
.dl-mk { display: flex; flex-direction: column; }
.dl-mk-r { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(90px, .6fr) minmax(130px, .8fr) 150px 110px; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--line); font-size: 13px; }
.dl-mk-r.head { padding: 0 0 6px; border-top: 0; font-size: 11.5px; font-weight: 600; color: var(--muted); }
.dl-mk-r .r { text-align: right; }
.dl-mk-n { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.dl-mk-n b { font-weight: 600; }
.dl-mk-n small { font-size: 12px; line-height: 1.4; color: var(--muted); }
.dl-mk-p { display: flex; justify-content: flex-end; }
.dl-src { font-size: 11.5px; color: var(--muted); text-align: right; }
@container (max-width: 720px) {
  .dl-mk-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto; row-gap: 6px; }
  .dl-mk-n, .dl-src { grid-column: 1 / -1; }
  .dl-mk-r.head { display: none; }
  .dl-mk-r .r, .dl-src { text-align: left; }
  .dl-mk-r .r::before { content: attr(data-l); display: block; font-size: 11px; color: var(--muted); }
}

/* ---------- the pipeline ---------- */
.dl-empty .empty { padding-bottom: 18px; }
.dl-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); gap: 12px; max-width: 940px; margin: 0 auto 8px; }
.dl-way { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 16px; background: var(--panel-2); border: 1px solid var(--line); border-radius: var(--r); }
.dl-way b { font: 600 15px var(--head); }
.dl-way p { flex: 1; margin: 0 0 6px; font-size: 13px; color: var(--muted); }
.dl-strip { display: flex; gap: 2px; height: 6px; margin: 5px 0 2px; overflow: hidden; border-radius: 3px; }
.dl-strip i { min-width: 3px; }
.dl-strip .st-0 { background: color-mix(in srgb, var(--muted) 35%, transparent); }
.dl-strip .st-1 { background: color-mix(in srgb, var(--s1) 50%, transparent); }
.dl-strip .st-2 { background: var(--s1); }
.dl-strip .st-3 { background: var(--s2); }
.dl-strip .st-4 { background: var(--up); }
.dl-strip .st-5 { background: color-mix(in srgb, var(--muted) 18%, transparent); }
.dl-t .dl-row { cursor: pointer; }
.dl-nm { display: flex; align-items: center; gap: 10px; min-width: 230px; max-width: 380px; }
.dl-nm > div { min-width: 0; }
.dl-nm .sb-nm, .dl-nm .sb-sub { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dl-nm .sb-sub .ev-pill { flex: none; }
.dl-pick { flex: none; width: 16px; height: 16px; margin: 0; accent-color: var(--accent); cursor: pointer; }
.sb .sel.dl-stsel { padding: 4px 8px; font-size: 12.5px; }
.dl-rng { display: grid; gap: 3px; }
.dl-rng-r { display: grid; grid-template-columns: minmax(150px, 1fr) 14px 90px 90px; gap: 6px; align-items: center; padding: 2px 6px; font-size: 13px; }
.dl-rng-r > span:first-child { display: inline-flex; align-items: center; }
.dl-rng-u { font-size: 12px; color: var(--muted); text-align: right; }
.dl-rng .inp { width: 100%; padding: 5px 8px; font-size: 13px; }

/* ---------- compare ---------- */
.sb-scroll.dl-cmps { max-height: none; border: 1px solid var(--line); border-radius: 10px; }
.dl-cmp thead th { padding: 10px 12px; vertical-align: top; }
.dl-cmp .dl-cmp-h { min-width: 180px; text-align: right; }
.dl-cmp-h .sb-nm, .dl-cmp-h .sb-sub { display: block; text-align: right; }
.dl-cmp-h .btn { margin-top: 6px; }
.dl-cmp tbody th { position: sticky; top: auto; left: 0; z-index: 2; padding: 9px 12px; text-align: left; font-weight: 500; background: var(--panel); color: var(--fg); border-bottom: 1px solid var(--line); box-shadow: 1px 0 0 var(--line); }
.dl-cmp tbody tr.dl-cmp-g th { position: static; padding: 7px 12px; background: var(--panel-2); font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--muted); box-shadow: none; }
.dl-cmp td { font-variant-numeric: tabular-nums; }
.dl-cmp td.best { font-weight: 700; }
.dl-best { margin-left: 6px; padding: 1px 6px; border-radius: 999px; font: 600 10.5px var(--sans); color: var(--s1); background: color-mix(in srgb, var(--s1) 12%, transparent); vertical-align: 1px; }

/* ---------- phones ---------- */
@media (max-width: 900px) {
  .dl-in, .dl-name, .dl-sel, .dl-notes, .inp.dl-tgt, .dl-rng .inp { font-size: 16px; }
  .dl-tiles { grid-template-columns: repeat(auto-fill, minmax(min(100%, 150px), 1fr)); gap: 8px; }
  .rd.dl-tile { padding: 11px 12px; }
  .dl-tile .rd-b b { font-size: 20px; }
  .dl-model .ev-pill { white-space: normal; }
  .dl-sec > summary { min-height: 48px; }
  .dl-rng-r { grid-template-columns: minmax(0, 1fr) 12px 76px 76px; }
}
@media (max-width: 600px) {
  .dl-name { flex-basis: 100%; padding-left: 4px; }
  .dl-bar1 { gap: 8px; }
  .dl-bar1 .sb-grow { display: none; }
  .dl-bar1 .sel { flex: 1 1 auto; min-width: 0; }
  .dl-long, .dl-strat .sb-lbl { display: none; }
  .dl-strat { gap: 8px; }
  .dl-strat .seg { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); width: 100%; }
  .dl-strat .seg button { padding: 7px 8px; }
  .dl-st-r, .dl-mk-r { font-size: 13px; }
}

/* ---------- design pass (2026-11-25) ---------- */
/* The Sample label sits level with the deal's name, not pinned to the top of the bar. */
.dl-bar1 > .ev-pill { align-self: center; }
/* An input and the switch beside it are the same height. */
.dl-pair { align-items: stretch; }
.dl-nw { white-space: nowrap; }
/* The title and its "?" stay together when a tile's title wraps. */
.dl-tt { display: inline; }
.dl-tt .help { vertical-align: 1px; }
/* Tiles in a row share their header line, so every figure starts at the same height whether or not its verdict wrapped. */
.dl-tiles { grid-auto-rows: auto; }
.rd.dl-tile { display: grid; grid-row: span 3; grid-template-rows: subgrid; row-gap: 5px; align-content: start; }
.dl-tile .rd-h { align-self: start; }
/* The sensitivity tables keep their row headings in view while they scroll sideways. */
.dl-heat tbody th, .dl-heat thead th:first-child { position: sticky; left: 0; z-index: 1; background: var(--panel); }
/* Market check, stacked: the verdict column has one width, so "This deal" and the market figure line up from row to row. */
@container (max-width: 720px) { .dl-mk-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) 10.5rem; } }
@container (max-width: 420px) { .dl-mk-r { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); } .dl-mk-p { grid-column: 1 / -1; justify-content: flex-start; } }
@media (max-width: 900px) {
  /* The deal's name is the page title: title-sized, not form-sized. */
  #view .dl-name { font-size: clamp(20px, 5.6vw, 24px); min-height: 44px; }
  .dl-back { min-height: 44px; }
  .dl-tiles > .dl-tile:last-child:nth-child(odd) { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
  /* Back and More share the first line; the name has a line to itself under them. */
  .dl-bar1 > .dl-back { order: -2; }
  .dl-bar1 > span:last-child { order: -1; margin-left: auto; }
  .dl-pick { width: 22px; height: 22px; }
  /* The deal column stays narrow enough on a phone that the figures beside it can scroll into view. */
  .dl-nm { min-width: 0; width: 54vw; max-width: 240px; }
}
/* A field label's "?" stays right after its last word when the label wraps. */
.dl-fl { display: block; }
@media (max-width: 640px) {
  /* The pipeline's status chips scroll in one line, as the metro table's filters do, instead of stacking three rows deep. */
  .dl-pipe .sb-row .chips { flex: 1 1 0; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; min-width: 0; padding: 1px; }
  .dl-pipe .sb-row .chips::-webkit-scrollbar { display: none; }
  .dl-pipe .chip { flex: none; }
}
@media (max-width: 900px) { .dl-cmp-h .sb-nm { padding-block: 12px; margin-block: -12px; } }

/* The tiles' pictures (tile-viz.js): a slim bar at the foot of each tile, without its small labels at this size. */
.dl-viz { margin-top: auto; padding-top: 4px; }
.dl-viz .tv { display: block; width: 100%; height: auto; max-height: 30px; overflow: visible; }
.dl-viz .tv-t { display: none; }

/* ---------- phone pass (Moe's Vestra row 45) ---------- */
/* The deal's live figures: the call, three figures and the arrow on one line (they were five items in four columns, so
   the arrow wrapped and the bar covered a third of the form). */
.dl-live { grid-template-columns: auto repeat(3, minmax(0, 1fr)) auto; }
.dl-live .dl-call { flex-direction: column; }
.dl-live .dl-call > :last-child { white-space: nowrap; }
@media (max-width: 640px) {
  .dl-live { gap: 10px; padding: 8px 12px; margin: 0 0 10px; }
  .dl-live .dl-call > small { display: none; }
  .dl-live small { font-size: 10.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .dl-live b { font-size: 14px; }
}
/* The deals as cards on a phone: name and call, the status, then each chosen column with its name over its value. */
@media (max-width: 640px) {
  .dl-pipe .sb-scroll { overflow: visible; max-height: none; border: 0; }
  table.sb-t.dl-t { display: block; width: 100%; min-width: 0; }
  .dl-t thead { display: none; }
  .dl-t tbody { display: grid; gap: 10px; }
  .dl-t tr.dl-row { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px 10px; padding: 14px 14px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
  .dl-t tr.dl-row:active { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
  .dl-t tr.dl-row > td { position: static; display: flex; flex-direction: column; align-items: flex-start; gap: 2px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; white-space: normal; order: 10; font-variant-numeric: tabular-nums; }
  .dl-t td[data-l]::before { content: attr(data-l); font: 600 10.5px/1.2 var(--sans); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
  .dl-t td[data-k="name"]::before, .dl-t td[data-k="call"]::before, .dl-t td[data-k="status"]::before { content: none; }
  .dl-t td[data-k="name"] { grid-column: 1 / 3; order: 0; }
  .dl-t td[data-k="call"] { grid-column: 3; order: 1; align-items: flex-end; }
  .dl-t td[data-k="status"] { grid-column: 1 / -1; order: 2; }
  .dl-t td[data-k="status"] .dl-stsel { width: auto; min-width: 150px; }
  .dl-t td[data-k="price"] { order: 3; } .dl-t td[data-k="cashFlowMo"] { order: 4; } .dl-t td[data-k="profit"] { order: 4; }
  .dl-t td[data-k="price"], .dl-t td[data-k="cashFlowMo"], .dl-t td[data-k="profit"] { font: 600 15px/1.25 var(--head); }
  .dl-t .dl-nm { align-items: flex-start; }
  .dl-t .sb-sub { white-space: normal; }
}
@media (max-width: 640px) {
  .dl-t tr.dl-row > td[data-k="name"] { order: 0; box-shadow: none; }
  .dl-t tr.dl-row > td[data-k="call"] { order: 1; }
  .dl-t tr.dl-row > td[data-k="status"] { order: 2; }
  .dl-t tr.dl-row > td[data-k="price"] { order: 3; }
  .dl-t tr.dl-row > td[data-k="cashFlowMo"], .dl-t tr.dl-row > td[data-k="profit"] { order: 4; }
  .dl-t tr.dl-row > td::after { content: none; }
  .dl-t .sb-sub { display: block; line-height: 1.6; }
}
@media (max-width: 640px) { .dl-t td[data-k="cashFlowMo"]::before { content: "Cash flow /mo"; letter-spacing: .04em; } .dl-t td[data-k="rentMo"]::before { content: "Rent /mo"; } }
