/* The Loyalty Tax. Builds on ui.css. */

/* hero: the answer sits on top of the three sliders that make it */
.lt-top{display:flex;flex-direction:column;gap:6px}
.lt-top .label{color:var(--grey)}
/* the small print sits under the number and breaks at one fixed place, so the card keeps one height whatever the sliders say */
.lt-top .payrow{flex-direction:column;flex-wrap:nowrap;align-items:flex-start;gap:6px}
.lt-top .num span{white-space:nowrap}
@media (max-width:599px){.lt-top .num span{display:block}}
@media (max-width:360px){.lt-top .num{font-size:13px}}

/* controls: every pill keeps one width, so no label re-wraps and no slider moves while it is dragged */
.ctl output{text-align:center}
#payO{min-width:calc(5ch + 22px)}
#raiseO{min-width:calc(11ch + 22px)}
#bumpO{min-width:calc(9ch + 22px)}
#hopO{min-width:calc(13ch + 22px)}
#yrsO{min-width:calc(8ch + 22px)}
#costO{min-width:calc(12ch + 22px)}
/* ui.css draws sliders 36px tall and the napkin toggle 28px: both get a full 44px target here */
.app-loyalty-tax input[type=range]{height:44px}
.app-loyalty-tax .card>details>summary{min-height:44px}
.app-loyalty-tax details code{white-space:nowrap}
.stat{min-width:0}
#rcpt div:not(:last-child) b{white-space:nowrap}
.stamp small{text-wrap:balance}
@media (max-width:360px){.stat b{font-size:20px}}

/* step 1: the two pay paths */
.lt-chart svg{display:block;width:100%;height:auto;overflow:visible}
.lt-chart text{font-family:var(--mono);fill:var(--ink);font-variant-numeric:tabular-nums}
.key span.off{opacity:.35}
.key i.ln{height:0;border:0;border-top:4px solid var(--ink);border-radius:0;width:20px;vertical-align:4px}
.key i.ln.dash{border-top:4px dashed var(--violet);width:22px}
.key i.dot{width:12px;height:12px;border-radius:50%;background:var(--yellow)}
.key i.hatch{background:repeating-linear-gradient(135deg,var(--pink) 0 4px,var(--pink-ink) 4px 6px)}
.key i.lime{background:var(--lime)}
.key i.bite{background:var(--orange)}

/* step 2: the ruler */
.lt-rule{position:relative;padding:58px 0;--pg:0;--pa:0}
.lt-track{position:relative;height:36px;border:var(--bw) solid var(--ink);border-radius:var(--r-s);overflow:hidden;background:var(--paper-2)}
.lt-track i{position:absolute;top:0;bottom:0;transition:left .5s var(--spring),width .5s var(--spring)}
.lt-track .got{left:0;background:var(--ink)}
.lt-track .gap{background:repeating-linear-gradient(135deg,var(--pink) 0 8px,var(--pink-ink) 8px 11px);border-right:var(--bw) solid var(--ink)}
.lt-rule.ahead .gap{background:var(--lime);border-right:0;border-left:var(--bw) solid var(--ink)}
/* the scale: one even row of notches under the bar, where no fill can hide it */
.lt-rule::after{content:"";position:absolute;left:2px;right:2px;top:95px;height:7px;padding-right:2px;background:linear-gradient(90deg,var(--ink) 2px,transparent 0) 0 0/var(--tick,10%) 100% content-box border-box}
/* a flag is a stem that slides along the bar and a label that swaps sides without the stem moving */
.lt-flag{position:absolute;width:0;height:58px;display:flex;flex-direction:column;align-items:flex-start;gap:3px;white-space:nowrap;transition:left .5s var(--spring)}
.lt-flag::before{content:"";position:absolute;top:0;bottom:0;left:-1.5px;width:3px;background:var(--ink)}
.lt-flag>*{margin-left:10px;transition:translate .3s var(--ease)}
.lt-flag.flip>*{translate:calc(-100% - 20px) 0}
.lt-flag.get{top:0;left:calc(3px + var(--pg)*(100% - 6px));padding-top:2px}
.lt-flag.ask{bottom:0;left:calc(3px + var(--pa)*(100% - 6px));justify-content:flex-end;padding-bottom:2px}
.lt-flag.ask::before{background:var(--pink-ink)}
.lt-flag b{font:800 24px/1 var(--display);letter-spacing:-.03em;font-variant-numeric:tabular-nums}
.lt-flag span{font:500 11.5px/1.2 var(--mono);letter-spacing:.06em;text-transform:uppercase}
.lt-flag.ask b{color:var(--pink-ink)}
.lt-rule.ahead .lt-flag.ask::before{background:var(--ink)}
.lt-rule.ahead .lt-flag.ask b{color:var(--ink)}
.lt-rule+.ends{margin-top:-8px}
@media (prefers-reduced-motion:reduce){.lt-track i,.lt-flag,.lt-flag>*{transition:none}}
