/* Priced in Hours. Builds on ui.css. */
.app-priced-in-hours .hero .hot{background:var(--ink);color:var(--yellow)}
/* the second sentence of the headline moves to a new line as one piece */
.app-priced-in-hours .hero h1 .nb{display:inline-block}
/* a full list greys the add buttons but leaves them focusable */
.app-priced-in-hours .btn[aria-disabled="true"],.app-priced-in-hours .chip[aria-disabled="true"]{opacity:.4;cursor:not-allowed;translate:none;box-shadow:var(--o) var(--o) 0 var(--sc)}
/* the big answer stays on one line down to a 320px screen ("4.1 working weeks" is the longest) */
.app-priced-in-hours .ans b{font-size:clamp(27px,8.6vw,64px);text-wrap:balance}
/* room for two lines of sentence under it (three on a phone), so the block keeps its height as the price moves.
   On a wide screen the room belongs to the whole block and the words sit in the middle of it, so a one-line sentence leaves no empty strip underneath. */
@media (min-width:641px){.app-priced-in-hours .ans{justify-content:center;min-height:calc(119px + clamp(27px,8.6vw,64px))}}
.app-priced-in-hours .math .eq{display:inline-block;margin-right:1.4em;max-width:100%}
/* wide enough for "Added. See step 2", so the button does not change size when it flashes */
#add{min-width:190px}
.app-priced-in-hours #stampK span{white-space:nowrap}
.app-priced-in-hours .ctl label,#picL{text-wrap:balance}

/* step 1: working time as boxes. An hour of minutes, a day of hours, or a year of days, all in one box of one height so the card never jumps. */
#pic{--gh:208px;display:flex;flex-direction:column;gap:9px}
.pic-lab{display:flex;justify-content:space-between;gap:6px 14px;flex-wrap:wrap;font:500 12px/1.3 var(--mono);letter-spacing:.06em;text-transform:uppercase;font-variant-numeric:tabular-nums}
.g{display:grid;gap:3px;height:var(--gh);grid-auto-rows:minmax(0,1fr)}
.g i{display:block;position:relative;min-width:0;min-height:0;border:2px solid var(--ink);border-radius:5px;background:var(--paper-2);overflow:hidden;font-style:normal}
.g i::after{content:"";position:absolute;inset:0;background:var(--pink);transform-origin:0 50%;transform:scaleX(var(--f,0));transition:transform .24s var(--ease) var(--d,0ms)}
/* five weeks to a row, with a sliver of air between the weeks */
.g-year{--wk:minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr) minmax(0,1fr);--air:4px;grid-template-columns:repeat(4,var(--wk) var(--air)) var(--wk)}
.g-day{grid-template-columns:repeat(8,minmax(0,1fr));gap:6px}
.g-day i{border-width:2.5px;border-radius:var(--r-s)}
.g-day i span{position:absolute;z-index:1;top:7px;left:0;right:0;text-align:center;font:500 12px/1 var(--mono)}
.g-hour{grid-template-columns:repeat(12,minmax(0,1fr));gap:4px}

/* step 2: the year as a ruler, January to December, with the list under it */
/* the eighth fill: ink dots on paper, on a 6px grid so the swatch and both bar heights hold whole rows. Plain paper would read as a gap in the bar. */
.app-priced-in-hours{--dot:radial-gradient(circle,var(--ink) 1.5px,transparent 2px) 0 0/6px 6px var(--paper)}
.yl{display:flex;flex-direction:column;gap:20px}
.yr{padding-top:38px}
.yr.none{padding-top:0}
.yr-bar{position:relative;height:48px;border:var(--bw) solid var(--ink);border-radius:var(--r-m);background:repeating-linear-gradient(135deg,var(--line) 0 2px,transparent 2px 7px) var(--paper)}
.yr-fill{position:absolute;inset:0;display:flex;overflow:hidden;border-radius:calc(var(--r-m) - 3px)}
.yr-fill i{display:block;flex:none;width:0;height:100%;border-right:2.5px solid var(--ink);transition:width .5s var(--spring)}
.yr-fill i.t,.yr-fill i.z{border-right-width:0}
.yr-flag{position:absolute;top:-38px;bottom:-3px;left:0;width:0;border-left:var(--bw) solid var(--ink);margin-left:-1.5px;transition:left .5s var(--spring)}
.yr-flag span{position:absolute;top:0;left:-3px;background:var(--yellow);border:2.5px solid var(--ink);border-radius:var(--r-s) var(--r-s) var(--r-s) 0;padding:4px 8px;font:500 12.5px/1.2 var(--mono);white-space:nowrap}
.yr-flag.flip span{left:auto;right:0;border-radius:var(--r-s) var(--r-s) 0 var(--r-s)}
.yr-mon{display:grid;margin:0 3px;font:500 11.5px/1 var(--mono);letter-spacing:.04em;color:var(--grey)}
.yr-mon span{border-left:2px solid var(--ink);padding:6px 0 0 4px;overflow:hidden}

/* step 2: the list */
.lis{display:flex;flex-direction:column}
.li{display:grid;grid-template-columns:16px minmax(0,1fr) auto auto 44px;gap:4px 12px;align-items:center;padding:10px 0;border-top:2px dashed var(--line)}
.li:first-child{border-top:0;padding-top:0}
.li .sw{width:16px;height:16px;border:2px solid var(--ink);border-radius:4px;background:var(--c)}
.li-n{display:flex;flex-direction:column;gap:2px;min-width:0}
.li-n b{font-weight:700;font-size:16px;line-height:1.25}
.li-n span,.li-h{font:500 13px/1.3 var(--mono);font-variant-numeric:tabular-nums}
.li-n span{color:var(--grey)}
.li-r{display:contents}
.li-h{text-align:right;white-space:nowrap;min-width:64px}
.li-f{--o:2px;padding:10px 12px;font-size:13px;white-space:nowrap;min-height:44px}
.li-f .ico{flex:none;width:13px;height:13px;margin-left:8px;overflow:visible;fill:none;stroke:currentColor;stroke-width:3.2;stroke-linecap:round;stroke-linejoin:round}
/* the bin: a drawn cross, so it is as heavy as the borders around it */
.li-x{position:relative;width:44px;height:44px;padding:0;background:var(--paper);border:2.5px solid var(--ink);border-radius:50%;box-shadow:2px 2px 0 var(--ink);transition:translate .13s var(--ease),box-shadow .13s var(--ease),background-color .13s;-webkit-tap-highlight-color:transparent;touch-action:manipulation}
.li-x::before,.li-x::after{content:"";position:absolute;left:50%;top:50%;width:16px;height:3px;margin:-1.5px 0 0 -8px;border-radius:2px;background:var(--ink);rotate:45deg}
.li-x::after{rotate:-45deg}
@media (hover:hover){.li-x:hover{background:var(--pink);translate:-1px -1px;box-shadow:3px 3px 0 var(--ink)}}
.li-x:active{translate:2px 2px;box-shadow:0 0 0 var(--ink)}
.lis-none{font-weight:600;padding:6px 0 2px}
/* the six add buttons are the step 1 chips with a plus in front, set a little tighter so they share one row on a wide screen */
#adds{gap:10px 8px}
#adds .chip{padding-inline:12px}
#adds .chip::before{content:"+";margin-right:5px;font-weight:700}
#adds .chip .pic{margin-right:6px}

@media (max-width:640px){
  /* the picture: one height for all three, and labels that do not change their line count */
  #pic{--gh:150px}
  .pic-lab{flex-direction:column;flex-wrap:nowrap}
  #picNote{min-height:3em}
  .g{gap:2px}
  .g i{border-width:1.5px;border-radius:4px}
  /* 250 days are too small to outline one by one on a phone: solid tiles in one framed panel */
  .g-year{--air:2px;padding:8px;border:2.5px solid var(--ink);border-radius:var(--r-s);background:var(--paper-2)}
  .g-year i{border:0;border-radius:2px;background:var(--line)}
  .g-hour{gap:3px}
  .g-day{gap:4px}
  .g-day i{border-width:2.5px;border-radius:8px}
  .g-day i span{font-size:10.5px}
  .app-priced-in-hours .ans .s{min-height:4.35em}
  .app-priced-in-hours input[type=range]{height:44px}
  /* list rows: name and bin on the first line, how often and the hours on the second, and they may wrap */
  .li{grid-template-columns:16px minmax(0,1fr) 44px;gap:8px 10px}
  .li-x{grid-column:3;grid-row:1}
  .li-r{grid-column:2/4;grid-row:2;display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:6px 12px}
  .li-h{min-width:0;margin-left:auto}
}
@media (max-width:370px){#picL{min-height:2.6em}}
/* small phones: the second line of a row runs the full width and the chip is set a little tighter, so "every working day" keeps its hours beside it like every other row */
@media (max-width:374px){
  .li-r{grid-column:1/4;gap:6px 8px}
  .li-f{padding-inline:10px}
  .li-f .ico{margin-left:6px}
}
@media (max-width:340px){.li-f{padding-inline:9px;font-size:12.5px}}
/* on a phone the ruler rides along above the list while you edit it, so every tap shows its date */
@media (max-width:640px) and (min-height:600px){
  .yl-yr{position:sticky;top:8px;z-index:2;padding-block:13px 14px;gap:8px;box-shadow:var(--sh-l) var(--sh-l) 0 var(--ink),0 -9px 0 1px var(--yellow)}
  .yl-yr h3{font-size:17px}
  .yl-yr .yr{padding-top:34px}
  .yl-yr .yr.none{padding-top:0}
  .yl-yr .yr-bar{height:36px}
  .yl-yr .yr-flag{top:-34px}
  #yrLine{display:none}
  .yl .li button,#adds .chip{scroll-margin-top:190px}
}
@media (prefers-reduced-motion:reduce){.g i::after,.yr-fill i,.yr-flag{transition:none}}
