/* /tools/backtester: Tesla's Trip Planner (tesla.com/trips) rebuilt as Bull Run's Strategy Backtester. The chart is the map:
   full-bleed on a light canvas, with a white card of inputs floating over its left side and square controls at the bottom
   right. On a phone the chart sits on top and the card becomes a sheet under it. Scoped to #bt. Colours: content/site.json
   "colors" (strategy colours under strategies.*.color, written in by assets/backtester.js). */
.callbar{display:none}
/* the end card's buttons keep their own look (assets/endcard.css): :where() leaves these resets' weight unchanged */
#bt button:where(:not(.rbtn,.code-copy)),#bt input,#bt select{font:inherit;color:inherit}
#bt button:where(:not(.rbtn,.code-copy)){cursor:pointer;background:none;border:0;padding:0}
#bt :focus-visible{outline:2px solid var(--blue);outline-offset:2px}
#bt [hidden]{display:none!important}
#bt .blue{color:var(--blue);font-size:12px;font-weight:500;line-height:16px;text-decoration:none}
#bt .blue:hover{text-decoration:underline;text-underline-offset:3px}
#bt .neg{color:var(--red)}
#bt .g{color:var(--gold-dark)}

/* ---------------- the stage ---------------- */
#bt .stage{position:relative;height:calc(100vh - 56px);min-height:740px;max-height:1040px;background:var(--canvas);overflow:hidden}

/* the map: the chart */
#bt .canvas{position:absolute;inset:0;display:flex;flex-direction:column;padding:24px 84px 18px 448px}
#bt .cv-head{display:flex;justify-content:space-between;align-items:flex-start;gap:20px}
#bt .cv-title{min-width:0;flex:1}
#bt .cv-title h2{margin:0;font-family:var(--disp);font-size:21px;line-height:27px;font-weight:500;font-variant-numeric:tabular-nums;max-width:640px}
#bt .cv-title h2 b{font-weight:600}
#bt .cv-title p{margin:4px 0 0;font-size:12px;line-height:17px;color:var(--gray)}
#bt .cv-title p b{color:var(--ink2);font-weight:500}
#bt .kpis{display:grid;grid-template-columns:repeat(4,minmax(112px,auto));gap:8px;flex:0 0 auto}
#bt .kpi{background:#fff;border-radius:4px;padding:10px 14px 9px;box-shadow:0 1px 3px rgba(0,0,0,.06)}
#bt .kpi b{display:block;font-family:var(--disp);font-size:20px;line-height:24px;font-weight:500;font-variant-numeric:tabular-nums;white-space:nowrap}
#bt .kpi span{display:block;margin-top:2px;font-size:11px;line-height:14px;color:var(--gray);white-space:nowrap}
#bt .kpi small{display:block;margin-top:3px;font-size:11px;line-height:14px;color:var(--ink2);font-variant-numeric:tabular-nums;white-space:nowrap}
#bt .kpi small:empty{display:none}
#bt .kpi small i{display:inline-block;width:10px;border-top:1.5px dashed var(--pin);vertical-align:3px;margin-right:4px}
#bt .kpi.gold b{color:var(--gold-dark)}
#bt .kpi.neg b{color:var(--red)}
#bt .per{display:flex;gap:4px;margin-top:14px;flex-wrap:wrap}
#bt .per button{height:28px;min-width:38px;padding:0 10px;border-radius:4px;background:rgba(255,255,255,.7);font-size:12px;font-weight:500;color:var(--ink2)}
#bt .per button:hover{background:#fff}
#bt .per button[aria-pressed="true"]{background:var(--ink);color:#fff}
#bt .per button:disabled{opacity:.35;cursor:default}
#bt .plot{position:relative;flex:1;min-height:220px;margin-top:10px}
#bt .plot svg{position:absolute;inset:0;width:100%;height:100%;overflow:visible;touch-action:pan-y}
#bt .ax{font-size:11px;fill:var(--gray);font-family:var(--text);font-variant-numeric:tabular-nums}
#bt .mk{font-size:10px;font-family:var(--text);font-weight:500}
#bt .tip{position:absolute;top:0;left:0;z-index:4;pointer-events:none;background:#fff;border-radius:4px;box-shadow:0 6px 20px rgba(0,0,0,.14);padding:9px 11px;font-size:12px;line-height:18px;min-width:180px;display:none}
#bt .tip b{display:block;font-size:11px;font-weight:600;color:var(--gray);margin-bottom:3px;letter-spacing:.02em}
#bt .tip span{display:flex;align-items:center;gap:8px;white-space:nowrap}
#bt .tip span i{width:10px;height:3px;border-radius:2px;flex:0 0 auto}
#bt .tip span em{margin-left:auto;padding-left:12px;font-style:normal;font-weight:600;font-variant-numeric:tabular-nums}
#bt .cmsg{position:absolute;inset:0;display:flex;align-items:center;justify-content:center;gap:10px;text-align:center;padding:24px;font-size:14px;color:var(--ink2);z-index:3}
#bt .cmsg .pill{background:#fff;border-radius:4px;padding:12px 16px;box-shadow:0 1px 3px rgba(0,0,0,.08);max-width:420px;line-height:20px}
#bt .cmsg.err .pill{color:var(--err)}
#bt .spin{width:18px;height:18px;border-radius:50%;border:2px solid var(--outline2);border-top-color:var(--ink);animation:btspin .8s linear infinite}
@keyframes btspin{to{transform:rotate(360deg)}}
#bt .lgd{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px;min-height:30px}
#bt .lgd button{display:inline-flex;align-items:center;gap:7px;height:30px;padding:0 11px;border-radius:4px;background:#fff;font-size:12px;color:var(--ink2);box-shadow:0 1px 2px rgba(0,0,0,.05);transition:opacity .2s}
#bt .lgd button i{width:14px;height:0;border-top:2.5px solid var(--c);border-radius:2px}
#bt .lgd button i.dash{border-top-style:dashed;border-top-width:2px}
#bt .lgd button b{font-weight:600;color:var(--ink);font-variant-numeric:tabular-nums}
#bt .lgd button[aria-pressed="false"]{opacity:.45}
#bt .lgd button[aria-pressed="false"] b{text-decoration:line-through}
#bt .live{margin-top:6px;font-size:11px;line-height:16px;color:var(--gray);display:flex;flex-wrap:wrap;gap:4px 14px}
#bt .live .ln{display:inline-block;width:14px;border-top:2px solid var(--gold);opacity:.45;vertical-align:3px;margin-right:5px}
#bt .live i{display:inline-block;width:8px;height:8px;border-radius:2px;background:var(--c);margin:0 4px 0 6px;vertical-align:0}
#bt .live b{font-weight:500;color:var(--ink2)}
#bt .brush{position:relative;height:40px;margin-top:10px;background:#fff;border-radius:4px;box-shadow:0 1px 2px rgba(0,0,0,.05);touch-action:none;cursor:pointer}
#bt .brush svg{position:absolute;inset:0;width:100%;height:100%}
#bt .win{position:absolute;top:0;bottom:0;background:rgba(201,168,76,.10);box-shadow:inset 0 0 0 1.5px var(--gold);border-radius:3px;cursor:grab;touch-action:none}
#bt .win:active{cursor:grabbing}
#bt .win .h{position:absolute;top:6px;bottom:6px;width:8px;margin-left:-4px;border-radius:2px;background:#fff;box-shadow:0 0 0 1.5px var(--gold);cursor:ew-resize}
#bt .win .h[data-h="l"]{left:0}
#bt .win .h[data-h="r"]{left:100%}
#bt .ndates{display:flex;justify-content:space-between;gap:12px;margin-top:6px;font-size:11px;color:var(--gray)}
#bt .ndates span:first-child,#bt .ndates span:last-child{font-weight:500;color:var(--ink2);white-space:nowrap}
#bt .ctl{position:absolute;right:24px;bottom:96px;display:flex;flex-direction:column;gap:8px;z-index:5}
#bt .ctl button{width:40px;height:40px;border-radius:4px;background:#fff;color:var(--ink2);display:grid;place-items:center;box-shadow:0 1px 4px rgba(0,0,0,.12);transition:background-color .2s,color .2s}
#bt .ctl button:hover{background:var(--soft)}
#bt .ctl button[aria-pressed="true"]{background:var(--ink);color:#fff}
#bt .ctl svg{width:20px;height:20px}

/* the card */
#bt .panel{position:absolute;left:24px;top:24px;bottom:24px;width:392px;z-index:6;background:#fff;border-radius:4px;box-shadow:0 2px 12px rgba(0,0,0,.08);overflow-y:auto;padding:24px 24px 20px;scrollbar-width:thin;overscroll-behavior:contain}
#bt .grab{display:none}
#bt .car{display:flex;gap:16px;align-items:center}
#bt #mixDonut{width:76px;height:76px;flex:0 0 auto;transform:rotate(-90deg)}
#bt .car-t{flex:1;min-width:0}
#bt .car-h{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
#bt .car-h h2{margin:0;font-family:var(--disp);font-size:21px;line-height:26px;font-weight:500}
#bt .car-t p{margin:3px 0 0;font-size:12px;line-height:16px;color:var(--gray)}
#bt .panel h1{margin:22px 0 0;font-size:16px;line-height:22px;font-weight:600}
#bt .asof{margin:2px 0 0;font-size:12px;color:var(--gray)}
#bt .seg-row{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-top:18px}
#bt .seg-row>span{font-size:14px;font-weight:500}
#bt .seg{display:flex;gap:8px}
#bt .seg button{height:40px;min-width:96px;padding:0 14px;border-radius:4px;font-size:14px;color:var(--ink2);box-shadow:inset 0 0 0 1px var(--outline2);transition:box-shadow .2s}
#bt .seg button:hover{box-shadow:inset 0 0 0 1px var(--axis)}
#bt .seg button[aria-checked="true"],#bt .seg button[aria-pressed="true"]{color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--gray)}
#bt .seg.sm button{height:40px;min-width:40px;padding:0 12px}
#bt .hint{margin:8px 0 0;font-size:12px;line-height:17px;color:var(--gray)}
#bt .hint b{color:var(--ink2);font-weight:600}
#bt .blk{margin-top:26px;padding-top:20px;border-top:1px solid var(--rule2);scroll-margin-top:16px}
#bt .blk h3{margin:0;display:flex;justify-content:space-between;align-items:baseline;font-size:14px;line-height:20px;font-weight:600}
#bt .blk h3 .tot{font-size:12px;font-weight:500;color:var(--gray);font-variant-numeric:tabular-nums}
#bt .blk h3 .tot.bad{color:var(--err)}
#bt .sub{margin:16px 0 0;font-size:12px;font-weight:500;color:var(--gray)}
#bt .f{margin-top:12px}
#bt .f>label,#bt .f>.lab{display:block;font-size:12px;font-weight:500;color:var(--ink2);margin-bottom:6px}
/* Nov 20 2026 (Chris): Each month, the Proposal's Nothing / Add / Withdraw box */
#bt .mseg{display:flex;background:var(--card);border-radius:4px;padding:4px;gap:2px}
#bt .mseg button{flex:1;height:36px;border-radius:4px;font-size:14px;font-weight:500;color:var(--ink2);white-space:nowrap;padding:0 6px;transition:background .15s,box-shadow .15s}
#bt .mseg button.on{background:#fff;color:var(--ink);box-shadow:0 1px 2px rgba(0,0,0,.08)}
#bt .mseg button:focus-visible{outline:2px solid var(--blue);outline-offset:-2px}
#bt .in{width:100%;height:40px;border:0;border-radius:4px;background:var(--card);padding:0 12px;font-size:14px;outline:none;box-shadow:inset 0 0 0 1px transparent;transition:box-shadow .2s;font-variant-numeric:tabular-nums}
#bt .in:focus{box-shadow:inset 0 0 0 1px var(--ink)}
#bt .in::placeholder{color:var(--gray3)}
#bt select.in{appearance:none;-webkit-appearance:none;background-image:var(--chev);background-repeat:no-repeat;background-position:right 12px center;padding-right:32px;cursor:pointer}
#bt input[type="date"].in{padding-right:8px}
#bt .cur{position:relative;display:block}
#bt .cur::before{content:'$';position:absolute;left:12px;top:50%;transform:translateY(-50%);font-size:14px;color:var(--gray);pointer-events:none}
#bt .cur .in{padding-left:24px}
#bt .cur.pct::before{content:'%';left:auto;right:12px}
#bt .cur.pct .in{padding-left:12px;padding-right:28px}
#bt .route .f{position:relative;padding-left:26px}
#bt .route .f::before{content:'';position:absolute;left:3px;top:39px;width:9px;height:9px;border-radius:50%;box-shadow:inset 0 0 0 1.5px var(--ink)}
#bt .route .f+.f::after{content:'';position:absolute;left:7px;top:-23px;height:58px;border-left:1.5px dotted var(--gray3)}
#bt .links{display:flex;flex-wrap:wrap;gap:6px 18px;margin-top:10px;padding-left:26px}
#bt .f.emo,#bt #mcRow{padding-left:26px}
#bt .f.emo{margin-top:18px}
#bt .g2{display:grid;grid-template-columns:1fr 1fr;gap:0 10px}
#bt .amt-row{display:flex;gap:8px}
#bt .amt-row .cur{flex:1}
#bt .mrow{display:grid;grid-template-columns:118px 1fr 64px;align-items:center;gap:10px;margin-top:10px}
#bt .mrow label{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500;white-space:nowrap}
#bt .mrow label i{width:9px;height:9px;border-radius:2px;background:var(--c)}
#bt .rng{-webkit-appearance:none;appearance:none;width:100%;height:20px;background:transparent;margin:0;cursor:pointer}
#bt .rng::-webkit-slider-runnable-track{height:4px;border-radius:2px;background:linear-gradient(90deg,var(--c) var(--f,0%),var(--rule) var(--f,0%))}
#bt .rng::-moz-range-track{height:4px;border-radius:2px;background:linear-gradient(90deg,var(--c) var(--f,0%),var(--rule) var(--f,0%))}
#bt .rng::-webkit-slider-thumb{-webkit-appearance:none;width:16px;height:16px;margin-top:-6px;border-radius:50%;background:#fff;box-shadow:0 0 0 1.5px var(--c),0 1px 3px rgba(0,0,0,.2)}
#bt .rng::-moz-range-thumb{width:16px;height:16px;border:0;border-radius:50%;background:#fff;box-shadow:0 0 0 1.5px var(--c),0 1px 3px rgba(0,0,0,.2)}
#bt .pin-in{position:relative;display:block}
#bt .pin-in .in{padding:0 22px 0 8px;text-align:right;height:36px}
#bt .pin-in em{position:absolute;right:9px;top:50%;transform:translateY(-50%);font-style:normal;font-size:12px;color:var(--gray);pointer-events:none}
#bt .chips{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
#bt .chip{height:32px;padding:0 12px;border-radius:4px;background:var(--card);font-size:12px;font-weight:500;color:var(--ink2);box-shadow:inset 0 0 0 1px transparent;transition:box-shadow .2s,background-color .2s}
#bt .chip:hover{background:var(--hover)}
#bt .chip[aria-pressed="true"]{background:#fff;color:var(--ink);box-shadow:inset 0 0 0 1.5px var(--ink)}
#bt .chip:disabled{opacity:.4;cursor:default}
#bt .sw-row{display:flex;justify-content:space-between;align-items:flex-start;gap:14px;margin-top:14px}
#bt .sw-row label{font-size:13px;line-height:18px;font-weight:500;cursor:pointer}
#bt .sw-row .hint{margin-top:3px}
#bt .sw{-webkit-appearance:none;appearance:none;flex:0 0 auto;position:relative;width:38px;height:22px;margin:0;border-radius:11px;background:var(--outline2);cursor:pointer;transition:background-color .2s}
#bt .sw::after{content:'';position:absolute;left:3px;top:3px;width:16px;height:16px;border-radius:50%;background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.2);transition:transform .2s}
#bt .sw:checked{background:var(--ink)}
#bt .sw:checked::after{transform:translateX(16px)}
#bt .tk{position:relative;margin-top:10px}
#bt .dd{position:absolute;left:0;right:0;top:44px;z-index:20;background:#fff;border-radius:4px;box-shadow:0 8px 28px rgba(0,0,0,.16);max-height:280px;overflow-y:auto;display:none}
#bt .dd.on{display:block}
#bt .dd button{display:flex;width:100%;align-items:baseline;gap:10px;padding:9px 12px;text-align:left;font-size:13px;border-bottom:1px solid var(--rule2)}
#bt .dd button:hover,#bt .dd button.act{background:var(--soft)}
#bt .dd button b{font-weight:600;min-width:52px}
#bt .dd button span{flex:1;color:var(--ink2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#bt .dd button em{font-style:normal;font-size:11px;color:var(--gray)}
#bt .tags{display:flex;flex-wrap:wrap;gap:6px;margin-top:8px}
#bt .tags:empty{display:none}
#bt .tag{display:inline-flex;align-items:center;gap:7px;height:28px;padding:0 6px 0 10px;border-radius:4px;background:var(--card);font-size:12px;font-weight:500}
#bt .tag i{width:12px;border-top:2.5px solid var(--c);border-radius:2px}
#bt .tag.err{color:var(--err)}
#bt .tag button{width:20px;height:20px;border-radius:3px;color:var(--gray);font-size:15px;line-height:20px}
#bt .tag button:hover{background:var(--hover);color:var(--ink)}
#bt .mf{display:grid;grid-template-columns:1fr 78px 30px;gap:8px;align-items:start;margin-top:10px}
#bt .mf .tk{margin:0}
#bt .mf .nm{display:block;margin-top:4px;font-size:11px;line-height:14px;color:var(--gray);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#bt .mf .nm.err{color:var(--err)}
#bt .mf .x{width:30px;height:40px;border-radius:4px;color:var(--gray);font-size:18px}
#bt .mf .x:hover{background:var(--card);color:var(--ink)}
#bt .acts{display:flex;gap:8px;margin-top:28px;position:sticky;bottom:-20px;background:#fff;padding:12px 0 16px;box-shadow:0 -1px 0 var(--rule2)}
#bt .acts .btn{flex:1;min-width:0;padding:0 12px}
#bt .btn-dark{background:var(--ink);color:#fff}
#bt .btn-dark:hover{background:var(--ink2)}
#bt .btn-white{background:#fff;color:var(--ink2);box-shadow:inset 0 0 0 1px var(--outline)}
#bt .btn-white:hover{box-shadow:inset 0 0 0 1px var(--ink)}
#bt .btn[aria-busy="true"]{opacity:.6;pointer-events:none}
#bt .fine{margin:12px 0 0;font-size:11px;line-height:16px;color:var(--gray)}
#bt .fine a{color:var(--ink2);text-decoration:underline;text-underline-offset:2px}

/* ---------------- under the fold: the report ---------------- */
#bt .rep{max-width:1232px;margin:0 auto;padding:8px 24px 40px}
#bt .rsec{padding:56px 0 8px;border-bottom:1px solid var(--rule2)}
#bt .rsec:last-child{border-bottom:0}
#bt .eb{margin:0;font-size:12px;font-weight:600;letter-spacing:.06em;text-transform:uppercase;color:var(--gray)}
#bt .rsec h2{margin:6px 0 0;font-family:var(--disp);font-size:32px;line-height:38px;font-weight:500;letter-spacing:-.005em}
#bt .lede{margin:8px 0 0;max-width:720px;font-size:15px;line-height:22px;color:var(--ink2)}
#bt .note{margin:14px 0 0;max-width:820px;font-size:12px;line-height:18px;color:var(--gray)}
#bt .note b{color:var(--ink2)}
#bt .two{display:grid;grid-template-columns:1.25fr 1fr;gap:48px}
#bt .plan{display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:12px;margin-top:24px}
#bt .pcard{background:var(--card);border-radius:4px;padding:20px 20px 18px;border-top:3px solid var(--c)}
#bt .pcard .nm{display:block;font-size:13px;font-weight:500;color:var(--ink2)}
#bt .pcard .bal{display:block;margin-top:4px;font-family:var(--disp);font-size:28px;line-height:34px;font-weight:500;font-variant-numeric:tabular-nums}
#bt .pcard .cs{display:flex;flex-wrap:wrap;gap:6px;margin-top:12px}
#bt .pcard .cs span{height:24px;padding:0 8px;border-radius:3px;background:var(--c);color:#fff;font-size:12px;font-weight:600;line-height:24px}
#bt .pcard .why{display:block;margin-top:12px;font-size:13px;line-height:19px;color:var(--ink2)}
#bt .pcard .why b{color:var(--ink)}
#bt .nudge{margin-top:14px;padding:12px 16px;border-radius:4px;background:var(--warn-tint);color:var(--warn-ink);font-size:13px;line-height:19px}
#bt .open{display:flex;align-items:center;justify-content:space-between;gap:20px;flex-wrap:wrap;margin-top:20px;padding:18px 0;border-top:1px solid var(--rule)}
#bt .open .l{flex:1;min-width:280px;font-size:14px;line-height:20px;color:var(--ink2)}
#bt .open .l b{color:var(--ink)}
#bt .open .btns{flex-wrap:nowrap}
#bt .tiles{display:grid;grid-template-columns:repeat(3,1fr);gap:1px;margin-top:22px;background:var(--rule2);border-radius:4px;overflow:hidden}
#bt .tile{background:#fff;padding:14px 16px 13px}
#bt .tile .v{display:block;font-family:var(--disp);font-size:22px;line-height:28px;font-weight:500;font-variant-numeric:tabular-nums}
#bt .tile .l{display:block;margin-top:2px;font-size:12px;line-height:16px;color:var(--gray)}
#bt .tile .p{display:block;margin-top:3px;font-size:11px;color:var(--ink2);font-variant-numeric:tabular-nums}
#bt .tile.wide{grid-column:1/-1}
#bt .al{margin-top:22px}
#bt .alrow{display:grid;grid-template-columns:118px 1fr 92px;align-items:center;gap:12px;margin-top:10px}
#bt .alrow .a{font-size:13px;font-weight:500}
#bt .alrow .t{text-align:right;font-size:13px;font-weight:500;font-variant-numeric:tabular-nums}
#bt .albar{display:flex;height:30px;border-radius:3px;overflow:hidden;gap:2px;background:var(--card)}
#bt .albar span{display:flex;align-items:center;justify-content:center;background:var(--c);color:#fff;font-size:11px;font-weight:600;white-space:nowrap;overflow:hidden;cursor:default}
#bt .albar span.idle{background:none;color:var(--gray);font-weight:500}
#bt .altip{position:fixed;z-index:80;pointer-events:none;background:#fff;border-radius:4px;box-shadow:0 6px 20px rgba(0,0,0,.14);padding:9px 11px;font-size:12px;line-height:17px;opacity:0;transition:opacity .15s;min-width:200px}
#bt .altip b{display:block;margin-bottom:2px}
#bt .altip .k{display:block;margin-top:4px;color:var(--gray);font-size:11px}
#bt .altip .r{display:flex;justify-content:space-between;gap:12px;font-variant-numeric:tabular-nums}
#bt .tbl-wrap{margin-top:22px;overflow-x:auto}
#bt .tbl{width:100%;border-collapse:collapse;font-size:14px;font-variant-numeric:tabular-nums}
#bt .tbl th{text-align:right;font-size:11px;font-weight:600;letter-spacing:.05em;text-transform:uppercase;color:var(--gray);padding:10px 12px;border-bottom:1px solid var(--rule);white-space:nowrap}
#bt .tbl th:first-child,#bt .tbl td:first-child{text-align:left}
#bt .tbl th.g{color:var(--gold-dark)}
#bt .tbl td{text-align:right;padding:10px 12px;border-bottom:1px solid var(--rule2);white-space:nowrap}
#bt .tbl td small{display:block;font-size:11px;color:var(--gray)}
#bt .tbl td.g{color:var(--gold-dark);font-weight:600}
#bt .tbl tr.tot td{font-weight:600;border-top:1px solid var(--rule);border-bottom:0}
#bt .best{display:flex;align-items:center;gap:12px;flex-wrap:wrap;margin-top:22px}
#bt .best label{font-size:14px;font-weight:500}
#bt .best .pin-in{width:96px}
#bt .best .pin-in .in{height:40px}
#bt .best .btn{min-width:150px}
#bt .bar{margin-top:14px;height:4px;border-radius:2px;background:var(--rule);overflow:hidden;max-width:520px}
#bt .bar i{display:block;height:100%;width:0;background:var(--ink);transition:width .2s}
#bt .res{margin-top:16px;max-width:820px;font-size:14px;line-height:22px;color:var(--ink2)}
#bt .res b{color:var(--ink)}
#bt .res small{display:block;margin-top:6px;font-size:12px;line-height:18px;color:var(--gray)}
#bt .res .btn{height:32px;min-width:0;margin-left:8px;padding:0 12px;font-size:13px}
#bt .cta{text-align:center;padding-bottom:56px}
#bt .cta .lede{margin-left:auto;margin-right:auto}
#bt .cta .btns{justify-content:center;margin-top:22px}
#bt .disc p{margin:14px 0 0;max-width:920px;font-size:12px;line-height:19px;color:var(--gray)}

/* share / save */
.bt-ov{position:fixed;inset:0;z-index:200;background:rgba(23,26,32,.42);display:none;align-items:center;justify-content:center;padding:20px}
.bt-ov.on{display:flex}
.bt-modal{position:relative;width:min(520px,100%);max-height:calc(100vh - 40px);overflow-y:auto;background:#fff;border-radius:4px;padding:28px 28px 24px;box-shadow:0 24px 60px rgba(0,0,0,.25)}
.bt-modal h3{margin:0;font-family:var(--disp);font-size:24px;line-height:30px;font-weight:500}
.bt-modal .sub{margin:6px 0 0;font-size:13px;line-height:19px;color:var(--ink2)}
.bt-modal .x{position:absolute;right:14px;top:12px;width:36px;height:36px;border:0;border-radius:4px;background:none;font-size:22px;color:var(--gray);cursor:pointer}
.bt-modal .x:hover{background:var(--card);color:var(--ink)}
.bt-modal .lab{display:block;margin-top:20px;font-size:12px;font-weight:600;color:var(--ink2)}
.bt-modal .row{display:flex;gap:8px;margin-top:8px}
.bt-modal input{flex:1;min-width:0;height:40px;border:0;border-radius:4px;background:var(--card);padding:0 12px;font:inherit;font-size:13px;outline:none}
.bt-modal input:focus{box-shadow:inset 0 0 0 1px var(--ink)}
.bt-modal .btn{min-width:84px;height:40px;padding:0 16px;cursor:pointer;border:0}
.bt-modal .help{margin:8px 0 0;font-size:12px;line-height:17px;color:var(--gray)}
.bt-modal .list{margin-top:8px;border-top:1px solid var(--rule2)}
.bt-modal .it{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:10px 0;border-bottom:1px solid var(--rule2);font-size:13px}
.bt-modal .it small{display:block;color:var(--gray);font-size:11px;margin-top:1px}
.bt-modal .it .acts2{display:flex;gap:4px;flex:0 0 auto}
.bt-modal .it button{height:30px;padding:0 10px;border:0;border-radius:4px;background:var(--card);font:inherit;font-size:12px;font-weight:500;cursor:pointer}
.bt-modal .it button:hover{background:var(--hover)}
.bt-modal .empty{padding:12px 0;font-size:13px;color:var(--gray)}
.bt-toast{position:fixed;left:50%;bottom:28px;transform:translateX(-50%);z-index:220;background:var(--ink);color:#fff;border-radius:4px;padding:11px 16px;font-size:13px;box-shadow:0 8px 24px rgba(0,0,0,.2);transition:opacity .3s}
.bt-toast.out{opacity:0}

/* ---------------- smaller screens ---------------- */
@media (max-width:1279px){
  #bt .canvas{padding-left:432px;padding-right:76px}
  #bt .panel{width:384px}
  #bt .kpis{grid-template-columns:repeat(2,minmax(112px,auto))}
}
@media (max-width:899px){
  #bt .stage{height:auto;min-height:0;max-height:none;overflow:visible;padding-bottom:0}
  #bt .canvas{position:relative;inset:auto;padding:16px 16px 28px}
  #bt .cv-head{display:block}
  #bt .cv-title h2{font-size:19px;line-height:25px}
  #bt .kpis{grid-template-columns:1fr 1fr;margin-top:12px}
  #bt .kpi b{font-size:18px;line-height:22px}
  #bt .per{flex-wrap:nowrap;gap:3px}
  #bt .per button{flex:1 1 0;min-width:0;padding:0;font-size:11.5px}
  #bt .plot{flex:none;height:270px;min-height:0}
  #bt .ndates .hint{display:none}
  #bt .ctl{position:static;flex-direction:row;justify-content:flex-end;margin-top:10px}
  #bt .ctl button{width:44px;height:40px}
  #bt .panel{position:relative;left:auto;top:auto;bottom:auto;width:auto;margin-top:-14px;border-radius:14px 14px 0 0;box-shadow:0 -2px 14px rgba(0,0,0,.08);overflow:visible;padding:10px 20px 8px}
  #bt .grab{display:block;width:40px;height:4px;border-radius:2px;background:var(--outline2);margin:0 auto 16px}
  #bt .acts{bottom:0;margin-left:-20px;margin-right:-20px;padding:12px 20px 14px}
  #bt .seg button{min-width:0;flex:1;padding:0 8px;white-space:nowrap}
  #bt .seg-row{flex-wrap:wrap}
  #bt .seg-row .seg{flex:1;max-width:260px}
  #bt .rep{padding:0 20px 32px}
  #bt .rsec{padding-top:40px}
  #bt .rsec h2{font-size:26px;line-height:32px}
  #bt .two{grid-template-columns:1fr;gap:40px}
  #bt .tiles{grid-template-columns:1fr 1fr}
  #bt .alrow{grid-template-columns:92px 1fr 78px;gap:8px}
  #bt .open .btns{flex-wrap:wrap;width:100%}
  #bt .open .btns .btn{flex:1 1 180px}
  #bt .tbl{font-size:13px}
  #bt .tbl th,#bt .tbl td{padding:9px 8px}
  #bt .best .btn{flex:1}
}
@media (max-width:420px){
  #bt .mrow{grid-template-columns:104px 1fr 58px;gap:8px}
  #bt .tiles{grid-template-columns:1fr 1fr}
  #bt .tile .v{font-size:19px;line-height:24px}
}
/* Nov 19 2026: the plan code under the buttons, and in the Share or save window */
.bt-modal .code-v{font-weight:600;letter-spacing:.03em;word-break:break-all;font-size:15px;margin:6px 0 4px}
.bt-modal .code-msg{font-size:12.5px;color:var(--red);margin-top:6px;min-height:0}
