/* The Real Wage. Builds on ui.css. */
.app-real-wage{--hatch:repeating-linear-gradient(135deg,var(--line) 0 2px,transparent 2px 7px)}

/* controls: 44px touch targets, and value pills as wide as their longest value so a label never re-wraps mid-drag */
.app-real-wage input[type=range]{height:44px}
.app-real-wage .card>details>summary{min-height:44px}
.app-real-wage .ctl output{text-align:center}
#payO{min-width:calc(5ch + 22px)}
#comO,#prepO,#daysO,#homeO{min-width:calc(6ch + 22px)}
#costO{min-width:calc(7ch + 22px)}
#hrsO,#extraO,#dropO{min-width:calc(8ch + 22px)}
.ctl input:disabled{opacity:.35;cursor:not-allowed}

/* step 1: the week, one column per working day, read top to bottom from alarm to sofa */
.wkcards{align-items:stretch}
.wkcards>.card{container-type:inline-size}
.wkcards>.card:last-child{justify-content:space-between}
.wk{display:grid;grid-template-columns:repeat(5,minmax(0,1fr));gap:8px}
.wd{display:flex;flex-direction:column;gap:6px;text-align:center;font:500 12px/1.2 var(--mono);letter-spacing:.05em;text-transform:uppercase;min-width:0}
.wd b{font-weight:500;font-size:13px;font-variant-numeric:tabular-nums;text-transform:none;letter-spacing:-.02em;word-spacing:-.3em;white-space:nowrap}
.wd em{font-style:normal;color:var(--grey);min-height:1.2em;margin-top:-2px}
.wd-col{height:320px;border:var(--b-m) solid var(--ink);border-radius:var(--r-s);overflow:hidden;background:var(--hatch) var(--paper);display:flex;flex-direction:column}
.wd-col i{display:grid;place-items:center;flex:none;height:0;overflow:hidden;border-bottom:var(--b-s) solid var(--ink);transition:height .5s var(--spring),border-width .2s;font:500 12px/1 var(--mono);font-style:normal;letter-spacing:-.02em;word-spacing:-.3em;text-transform:none;white-space:nowrap}
.wd-col i.z{border-bottom-width:0}
.c-paid{background:var(--lime)}.c-extra{background:var(--pink)}.c-com{background:var(--violet)}.c-prep{background:var(--yellow)}
.c-free{background:var(--hatch) var(--paper)}
.app-real-wage .key span{white-space:nowrap}
#wkKey span:last-child{flex-basis:100%;white-space:normal}
#wkKey b{font-weight:500;white-space:nowrap}
/* a narrow chart card (small phones, and the two-column layout on small tablets) */
@container (max-width:285px){
  .wk{gap:4px}
  .wd b{font-size:12px;word-spacing:-.6em}
  .wd-col i span{display:none}
  /* the live figure always takes its own line here, so the card keeps one height whatever the figure is */
  #wkKey b{display:block;margin-left:22px}
}

/* step 2: two rates and the gap between them */
.rates{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:14px}
.rate{display:flex;flex-direction:column;gap:6px;min-width:0}
.rate b{font:800 clamp(34px,9.2vw,68px)/1.1 var(--display);letter-spacing:-.04em;font-variant-numeric:tabular-nums;white-space:nowrap}
/* the real wage wears the system highlight, sized like the h1 sticker and pulled left so the digits line up with the label */
.rate.real .hot{display:inline-block;line-height:1;padding:.04em .14em .09em;margin-left:-.14em;border-radius:.14em}
.rate .small{font-size:13px;line-height:1.35}
.gapbar{height:48px;border:var(--bw) solid var(--ink);border-radius:var(--r-m);overflow:hidden;background:repeating-linear-gradient(135deg,var(--pink) 0 3px,var(--paper) 3px 9px)}
.gapbar i{display:block;height:100%;width:100%;min-width:12px;max-width:calc(100% - 12px);background:var(--lime);border-right:var(--bw) solid var(--ink);transition:width .5s var(--spring)}
.gapbar i.full{border-right-width:0;max-width:none}

/* step 3: the week before and after */
.lv{display:flex;flex-direction:column;gap:8px}
.lv-lab{display:flex;justify-content:space-between;gap:10px;font:500 12px/1.3 var(--mono);letter-spacing:.06em;text-transform:uppercase;font-variant-numeric:tabular-nums}
.lv-bar+.lv-lab{margin-top:6px}
.lv-bar{display:flex;height:48px;border:var(--bw) solid var(--ink);border-radius:var(--r-m);overflow:hidden;background:var(--hatch) var(--paper)}
.lv-bar i{display:block;flex:none;width:0;height:100%;border-right:var(--b-s) solid var(--ink);transition:width .5s var(--spring),border-width .2s}
.lv-bar i.z{border-right-width:0}

/* verdict */
#stampK{text-wrap:balance}

@media (max-width:640px){
  /* the unit sits under the big number, so the number changing width never moves the sliders below it */
  .hero .payrow{flex-direction:column;gap:2px}
  .wd-col{height:288px}
  .rates{gap:10px}
}
@media (prefers-reduced-motion:reduce){.wd-col i,.lv-bar i,.gapbar i{transition:none}}
