/* ============================================================================
   vb-calc.css — /tools/video-storage-calculator.
   ----------------------------------------------------------------------------
   The page's two instruments: the Record Video sheet with its readout, and
   the crew tape planner on the cream band. Everything here uses vb.css's
   tokens (the stray-colour lock in marketing-pages.test.js covers vb.css; this
   file declares no :root of its own on purpose, so there is nothing to drift).
   A page shell may carry no private <style>, which is why this is a file:
   ten translated shells link the same one and a translator never sees CSS.
   Behaviour is in vb-calc.js; the shell holds the words and the numbers.
   ========================================================================= */

/* ——— the instrument: sheet | readout ——— */
.calc{display:grid;grid-template-columns:minmax(0,1fr) minmax(0,1fr);gap:clamp(1.2rem,3vw,2.4rem);align-items:start;margin-top:clamp(1.4rem,3vw,2.2rem)}
.calc-sheet{grid-column:1;grid-row:1}
.calc-readout{grid-column:2;grid-row:1;position:sticky;top:1rem}
.calc-strip{display:none}
@media (max-width:859px){
  .calc{grid-template-columns:1fr}
  .calc-sheet,.calc-readout{grid-column:auto;grid-row:auto}
  .calc-readout{position:static}
  /* On a phone the readout sits above the settings, so once it has scrolled
     off the top this one line follows the reader down the sheet: the number
     and whether it fits, nothing else. */
  .calc-strip{display:flex;position:sticky;top:0;z-index:5;align-items:baseline;gap:.75rem;white-space:nowrap;
    background:rgba(10,9,8,.93);-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px);
    border-bottom:1px solid var(--line);padding:.5rem 0 .55rem;margin:0 0 .4rem;
    font-family:var(--mono);font-size:.74rem;letter-spacing:.05em;color:var(--ink-soft)}
  .calc-strip>span:first-child{flex:none}
  .calc-strip b{flex:none;font-family:var(--display);font-weight:400;font-size:1.35rem;letter-spacing:.01em;color:var(--gold)}
  .calc-strip>span:last-child{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis}
}
@media (max-width:379px){.calc-strip>span:first-child{display:none}}

/* ——— the settings sheet ——— */
.calc-sheet{background:var(--panel);border:1px solid var(--line-2);border-radius:16px;padding:clamp(.9rem,2vw,1.3rem);display:grid;gap:1.15rem;min-width:0}
.calc-sheet fieldset{border:0;padding:0;margin:0;min-width:0}
.calc-sheet legend{padding:0;margin-bottom:.55rem;display:flex;justify-content:space-between;gap:.6rem;align-items:baseline;width:100%}
.calc-sheet legend small{font-family:var(--body);letter-spacing:0;text-transform:none;font-size:.78rem;color:var(--muted);font-weight:400}
.calc-sheet input[type=radio],.calc-sheet input[type=checkbox]{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
.calc-sheet label:has(input:focus-visible){outline:2px solid var(--gold);outline-offset:2px}

/* segmented control: the mode row, and the two formats */
.calc-seg{display:flex;background:var(--panel-2);border:1px solid var(--line-2);border-radius:11px;padding:3px;gap:3px}
.calc-seg label{position:relative;flex:1 1 0;min-width:0;text-align:center;padding:.5rem .55rem;border-radius:8px;font-size:.9rem;color:var(--ink-soft);cursor:pointer;line-height:1.25;transition:background .15s ease,color .15s ease}
.calc-seg label small{display:block;font-size:.72rem;color:var(--muted);margin-top:.1rem}
.calc-seg label:has(input:checked){background:var(--ink);color:#0a0908;font-weight:650}
.calc-seg label:has(input:checked) small{color:#0a0908;opacity:.7;font-weight:500}

/* the Record Video list: the iPhone's own sheet, with the size on each row */
.calc-list{border:1px solid var(--line);border-radius:12px;overflow:hidden;background:var(--panel-2)}
.calc-list label{display:grid;grid-template-columns:20px minmax(0,1fr) auto;align-items:center;gap:.7rem;padding:.7rem .85rem;border-top:1px solid var(--line);cursor:pointer;font-size:.97rem;color:var(--ink-soft);transition:background .12s ease}
.calc-list label:first-child{border-top:0}
.calc-list label:hover{background:rgba(255,255,255,.025)}
.calc-list .tick{width:18px;height:18px;border-radius:50%;border:1.5px solid var(--line-2);display:grid;place-items:center;flex:none}
.calc-list .tick::after{content:"";width:8px;height:8px;border-radius:50%;background:transparent}
.calc-list label:has(input:checked){color:var(--ink);background:rgba(245,199,66,.07)}
.calc-list label:has(input:checked) .tick{border-color:var(--gold)}
.calc-list label:has(input:checked) .tick::after{background:var(--gold)}
.calc-list .calc-name small{display:block;font-size:.76rem;color:var(--muted)}
.calc-list .calc-mb{font-family:var(--mono);font-size:.82rem;letter-spacing:.02em;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.calc-list label:has(input:checked) .calc-mb{color:var(--gold)}

/* a switch, because that is what the HDR setting is on the phone */
.calc-switch{display:flex;align-items:center;justify-content:space-between;gap:1rem;margin-top:.6rem;padding:.65rem .85rem;border:1px solid var(--line);border-radius:12px;background:var(--panel-2);cursor:pointer;font-size:.97rem;color:var(--ink-soft)}
.calc-switch span small{display:block;font-size:.76rem;color:var(--muted)}
.calc-switch i{width:44px;height:26px;border-radius:999px;background:var(--line-2);position:relative;flex:none;transition:background .15s ease}
.calc-switch i::after{content:"";position:absolute;top:3px;left:3px;width:20px;height:20px;border-radius:50%;background:var(--ink);transition:transform .15s ease}
.calc-switch:has(input:checked){color:var(--ink)}
.calc-switch:has(input:checked) i{background:var(--green)}
.calc-switch:has(input:checked) i::after{transform:translateX(18px)}
.calc-switch:has(input:disabled){opacity:.45;cursor:default}

/* sliders */
.calc-range{-webkit-appearance:none;appearance:none;width:100%;height:6px;border-radius:999px;margin:.6rem 0 .2rem;cursor:pointer;
  background:linear-gradient(90deg,var(--gold) 0 var(--fill,50%),var(--line-2) var(--fill,50%) 100%)}
.calc-range::-webkit-slider-thumb{-webkit-appearance:none;appearance:none;width:26px;height:26px;border-radius:50%;background:var(--ink);border:2px solid var(--black);box-shadow:0 2px 6px rgba(0,0,0,.55)}
.calc-range::-moz-range-thumb{width:22px;height:22px;border-radius:50%;background:var(--ink);border:2px solid var(--black);box-shadow:0 2px 6px rgba(0,0,0,.55)}
.calc-range:focus-visible{outline:2px solid var(--gold);outline-offset:6px}
.calc-dur{display:flex;align-items:baseline;justify-content:space-between;gap:1rem}
.calc-dur output{font-family:var(--display);font-size:1.5rem;color:var(--ink);letter-spacing:.01em;font-variant-numeric:tabular-nums}
.calc-num{display:inline-flex;align-items:center;gap:.4rem;font-size:.9rem;color:var(--muted)}
.calc-num input{width:4.6em;background:var(--panel-2);border:1px solid var(--line-2);color:var(--ink);font:inherit;font-family:var(--display);font-size:1.4rem;line-height:1;padding:.4rem .6rem;border-radius:9px;text-align:right;font-variant-numeric:tabular-nums;-moz-appearance:textfield}
.calc-num input::-webkit-outer-spin-button,.calc-num input::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}
.calc-num input:focus{outline:none;border-color:var(--gold);box-shadow:0 0 0 3px rgba(245,199,66,.16)}
.calc-chips{display:flex;flex-wrap:wrap;gap:.45rem;margin-top:.65rem}
.calc-chips button{font:inherit;font-size:.82rem;line-height:1.2;color:var(--ink-soft);background:none;border:1px solid var(--line-2);border-radius:999px;padding:.38rem .75rem;cursor:pointer;transition:border-color .12s ease,color .12s ease}
.calc-chips button:hover{border-color:var(--ink-soft);color:var(--ink)}
.calc-chips button[aria-pressed=true]{background:var(--ink);color:#0a0908;border-color:var(--ink);font-weight:650}
.calc-chips button b{font-weight:650}
.calc-free{display:flex;align-items:center;gap:.7rem;flex-wrap:wrap}
.calc-free .calc-num input{width:4.6em}
.calc-hint{margin-top:.5rem;font-size:.78rem;color:var(--muted)}
.calc-hint .ui{font-size:.7em}

/* ——— the readout: the deck's screen, with the number on it ——— */
.calc-readout{border:2px solid var(--ink);border-radius:18px;background:#0f0e0d;padding:clamp(1rem,2.4vw,1.5rem);box-shadow:0 0 0 1px #000,0 26px 60px -20px rgba(0,0,0,.9);min-width:0}
.calc-readout .stripes{border-radius:2px;overflow:hidden;margin-bottom:1rem}
.calc-big{font-family:var(--display);font-weight:400;font-size:clamp(3rem,8.5vw,5.4rem);line-height:.95;color:var(--gold);letter-spacing:.01em;margin-top:.45rem;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.calc-big small{font-size:.42em;color:var(--ink-soft);margin-left:.15em;letter-spacing:.03em}
.calc-sum{margin-top:.6rem;color:var(--ink);font-size:1rem;max-width:40ch;line-height:1.45}
.calc-readout .meter{max-width:none;margin-top:1.1rem}
.calc-readout .meter .bar i{transition:width .35s cubic-bezier(.16,1,.3,1)}
.calc-readout .meter.over .bar i{background:var(--rec)}
.calc-readout .meter.over .lab span:last-child{color:#ff8a80}
.calc-facts{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;background:var(--line);border:1px solid var(--line);border-radius:12px;overflow:hidden;margin-top:1rem}
.calc-facts>div{background:var(--panel);padding:.7rem .8rem;min-width:0}
.calc-facts dt{font-family:var(--mono);font-size:.62rem;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.calc-facts dd{margin-top:.25rem;font-family:var(--display);font-size:clamp(1.05rem,2vw,1.35rem);color:var(--ink);line-height:1.1;font-variant-numeric:tabular-nums;overflow-wrap:anywhere}
.calc-facts dd small{display:block;font-family:var(--body);font-size:.72rem;color:var(--muted);margin-top:.2rem;line-height:1.3}
.calc-compare{margin-top:1.15rem;border-top:1px solid var(--line);padding-top:.9rem}
.calc-compare ol{list-style:none;margin-top:.6rem;display:grid;gap:.42rem}
.calc-compare li{display:grid;grid-template-columns:minmax(0,9.5em) minmax(0,1fr) auto;align-items:center;gap:.7rem;font-size:.86rem;color:var(--ink-soft)}
.calc-compare li .bar{height:8px;border-radius:999px;background:var(--line);overflow:hidden}
.calc-compare li .bar i{display:block;height:100%;width:0;background:var(--line-2);border-radius:999px;transition:width .35s cubic-bezier(.16,1,.3,1)}
.calc-compare li.on{color:var(--ink);font-weight:600}
.calc-compare li.on .bar i{background:linear-gradient(90deg,var(--s1),var(--s2))}
.calc-compare li .n{font-family:var(--mono);font-size:.8rem;color:var(--muted);white-space:nowrap;font-variant-numeric:tabular-nums}
.calc-compare li.on .n{color:var(--gold)}
.calc-src{margin-top:1rem;font-size:.78rem;color:var(--muted);line-height:1.5}
.calc-src .ui{font-size:.72em}
.calc-noscript{margin-top:.8rem;font-size:.85rem;color:#ff8a80}
@media (max-width:479px){
  .calc-facts{grid-template-columns:1fr 1fr}
  .calc-facts>div:last-child{grid-column:1 / -1}
  .calc-compare li{grid-template-columns:minmax(0,1fr) auto;grid-auto-flow:dense;row-gap:.25rem;font-size:.82rem}
  .calc-compare li .bar{grid-column:1 / -1}
}

/* ——— the crew planner, on the cream band ——— */
.crew{display:grid;grid-template-columns:minmax(0,.85fr) minmax(0,1.15fr);gap:clamp(1.4rem,4vw,3rem);margin-top:clamp(1.4rem,3vw,2rem);align-items:start}
@media (max-width:819px){.crew{grid-template-columns:1fr}}
.crew fieldset{border:0;padding:0;margin:0;min-width:0}
.crew fieldset+fieldset{margin-top:1.3rem}
.crew legend{padding:0;margin-bottom:.55rem;display:flex;justify-content:space-between;align-items:baseline;gap:.6rem;width:100%;color:var(--cream-soft)}
.crew legend output{font-family:var(--display);font-size:1.35rem;letter-spacing:.01em;color:var(--cream-ink);text-transform:none;font-variant-numeric:tabular-nums}
.crew input[type=radio]{position:absolute;opacity:0;width:1px;height:1px;margin:0;pointer-events:none}
.crew-people{display:grid;grid-template-columns:repeat(8,minmax(0,1fr));gap:.35rem}
.crew-people label{display:grid;place-items:center;aspect-ratio:1;border:1px solid var(--cream-line);border-radius:10px;background:rgba(255,255,255,.45);font-family:var(--display);font-size:1.15rem;color:var(--cream-soft);cursor:pointer;transition:background .12s ease,color .12s ease}
.crew-people label:hover{border-color:var(--cream-soft)}
.crew-people label:has(input:checked){background:var(--cream-ink);color:var(--cream);border-color:var(--cream-ink)}
.crew-people label:has(input:focus-visible){outline:2px solid var(--cream-ink);outline-offset:2px}
.crew .calc-range{background:linear-gradient(90deg,var(--cream-ink) 0 var(--fill,50%),var(--cream-line) var(--fill,50%) 100%)}
.crew .calc-range::-webkit-slider-thumb{background:var(--cream);border-color:var(--cream-ink)}
.crew .calc-range::-moz-range-thumb{background:var(--cream);border-color:var(--cream-ink)}
.crew .calc-range:focus-visible{outline-color:var(--cream-ink)}
.crew-ticks{display:flex;justify-content:space-between;font-family:var(--mono);font-size:.68rem;letter-spacing:.06em;color:var(--cream-soft);margin-top:.15rem}
.crew-out{min-width:0}
.crew-big{font-family:var(--display);font-weight:400;font-size:clamp(1.7rem,3.8vw,2.6rem);line-height:1.05;color:var(--cream-ink);letter-spacing:.005em;max-width:none}
/* The tape itself: 2 hours wide, one lane per person, laid end to end. */
.crew-tape{margin-top:.9rem;border:2px solid var(--cream-ink);border-radius:10px;background:rgba(255,255,255,.55);padding:.4rem;height:58px;position:relative;overflow:hidden}
.crew-tape .lanes{display:flex;gap:3px;height:100%;width:100%}
.crew-tape .lanes i{height:100%;border-radius:4px;flex:0 0 auto;min-width:2px;transition:width .35s cubic-bezier(.16,1,.3,1)}
.crew-tape .lanes i:nth-child(8n+1){background:var(--s1)}
.crew-tape .lanes i:nth-child(8n+2){background:var(--s2)}
.crew-tape .lanes i:nth-child(8n+3){background:var(--s3)}
.crew-tape .lanes i:nth-child(8n+4){background:var(--s4-deep)}
.crew-tape .lanes i:nth-child(8n+5){background:var(--s5)}
.crew-tape .lanes i:nth-child(8n+6){background:var(--green)}
.crew-tape .lanes i:nth-child(8n+7){background:var(--rec)}
.crew-tape .lanes i:nth-child(8n+8){background:var(--cream-soft)}
.crew-tape .rest{flex:1 1 auto;border-radius:4px;background:repeating-linear-gradient(135deg,transparent 0 6px,rgba(0,0,0,.06) 6px 12px)}
.crew-tape.over{border-color:var(--rec)}
.crew-scale{display:flex;justify-content:space-between;font-family:var(--mono);font-size:.68rem;letter-spacing:.06em;color:var(--cream-soft);margin-top:.35rem}
.crew-verdict{margin-top:.9rem;color:var(--cream-ink);font-size:1.02rem}
.crew-clips{margin-top:.4rem;color:var(--cream-soft);font-size:.95rem}
.crew-shelf{margin-top:1rem;padding-top:.9rem;border-top:1px solid var(--cream-line);color:var(--cream-ink);font-size:.95rem;max-width:52ch}
.crew-shelf strong{font-weight:650}

/* ——— the cheat sheet ——— */
/* Wider than vb.css's 520px floor and the setting names never wrap, so on a
   phone the table scrolls sideways inside .tablewrap instead of folding
   "Slo-mo, 1080p HD at 120 fps" into five lines. */
.calc-table{min-width:680px}
.calc-table td:first-child,.calc-table th:first-child{white-space:nowrap}
.calc-table td.na{color:var(--muted);font-weight:400}
.calc-table tr.on td{background:rgba(245,199,66,.06)}
.calc-table td:first-child small{display:block;font-weight:400;color:var(--muted);font-size:.8rem}

@media (prefers-reduced-motion:reduce){
  .calc-readout .meter .bar i,.calc-compare li .bar i,.crew-tape .lanes i,.calc-seg label,.calc-switch i,.calc-switch i::after{transition:none}
}
