/* Track One - the design system. Light paper, deep ink, one dash-light amber.
   Mobile first: the base is a phone, min-width enhances. The help pages reuse this file. */

@font-face { font-family: "Bricolage"; src: url(fonts/bricolage.woff2) format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Inter"; src: url(fonts/inter.woff2) format("woff2"); font-weight: 100 900; font-display: swap; }
@font-face { font-family: "Doto"; src: url(fonts/doto.woff2) format("woff2"); font-weight: 100 900; font-display: block; }
@font-face { font-family: "HeeboHeb"; src: url(fonts/heebo-hebrew.woff2) format("woff2"); font-weight: 100 900;
  unicode-range: U+0590-05FF, U+FB1D-FB4F, U+20AA; font-display: swap; }

:root {
  --paper: #fbfaf6;
  --paper-2: #f1ede4;          /* the dash plastic around the instrument */
  --card: #ffffff;
  --ink: #15171c;
  --ink-2: #4b505a;
  --ink-3: #8a8e97;
  --line: #e6e1d6;
  --line-2: #d5cfc1;
  --amber: #ffa21a;            /* the dash light */
  --amber-2: #ffb43f;
  --amber-ink: #9a4d00;        /* amber that reads on white */
  --amber-tint: #fff1d9;
  --amber-want: #ffe2b3;
  --glass-1: #1b1d23;
  --glass-2: #0b0c0f;
  --dot: #ffb030;
  --dot-dim: rgba(255, 176, 48, .42);
  --f-display: "Bricolage", "HeeboHeb", "Segoe UI", system-ui, sans-serif;
  --f-body: "Inter", "HeeboHeb", "Segoe UI", system-ui, sans-serif;
  --f-dot: "Doto", "HeeboHeb", ui-monospace, monospace;
  --pad: 18px;
  --r-pill: 999px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --t-fill: .7s;
  --marq-k: 1;                 /* slows the display's scroll under reduced motion */
}
@media (prefers-reduced-motion: reduce) {
  :root { --t-fill: 1.1s; --marq-k: 2; }
}

*, *::before, *::after { box-sizing: border-box; }
html {
  touch-action: pan-y pinch-zoom;
  overscroll-behavior-x: none;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-width: none;
  background: var(--paper);
}
html::-webkit-scrollbar { display: none; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.45 var(--f-body);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overscroll-behavior-x: none;
}
button { font: inherit; color: inherit; -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; border-radius: 10px; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.page { max-width: 1440px; margin: 0 auto; padding: 0 var(--pad); min-height: 100svh; display: flex; flex-direction: column; }

/* ---------- top ---------- */
.top { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); }
.mark-badge {
  display: inline-grid; place-items: center; width: 34px; height: 28px; border-radius: 8px;
  background: linear-gradient(180deg, var(--glass-1), var(--glass-2));
  color: var(--dot); font: 800 15px/1 var(--f-dot); letter-spacing: .04em;
  text-shadow: 0 0 6px rgba(255, 170, 40, .55);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.1);
}
.mark-word { font: 800 22px/1 var(--f-display); letter-spacing: -.045em; }
.top-nav, .foot-nav { display: flex; gap: 18px; }
.top-nav a, .foot-nav a { color: var(--ink-2); text-decoration: none; font-weight: 600; font-size: 15px; }
.top-nav a:active, .foot-nav a:active { color: var(--ink); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 24px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  font: 750 17px/1 var(--f-display); letter-spacing: -.015em; white-space: nowrap;
  transition: transform .12s var(--ease), background-color .2s, box-shadow .2s, opacity .2s;
  user-select: none;
}
.btn:active { transform: translateY(1px) scale(.985); }
.btn[disabled] { cursor: default; opacity: .45; transform: none; }
.btn-ink { background: var(--ink); color: #fff; }
.btn-line { background: transparent; color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }
.btn-amber { background: var(--amber); color: var(--ink); box-shadow: inset 0 -3px 0 rgba(120, 60, 0, .22); }
.btn-amber:active { background: var(--amber-2); }
.btn-sm { height: 40px; padding: 0 16px; font-size: 15px; }

/* ---------- hero ---------- */
.main { flex: 1; display: flex; flex-direction: column; gap: 22px; padding-bottom: 28px; }
.hero { padding-top: 6px; }
.h1 {
  margin: 0; font: 800 clamp(42px, 12.4vw, 58px)/.93 var(--f-display); letter-spacing: -.05em;
  text-wrap: balance;
}
.lede { margin: 14px 0 0; font-size: 17px; line-height: 1.4; color: var(--ink-2); max-width: 34ch; text-wrap: pretty; }
.promises { list-style: none; margin: 16px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.promises li {
  display: inline-flex; align-items: center; gap: 8px; height: 34px; padding: 0 14px 0 12px;
  border-radius: var(--r-pill); background: var(--card); box-shadow: inset 0 0 0 1.5px var(--line-2);
  font: 700 14.5px/1 var(--f-display); letter-spacing: -.01em;
}
.promises li::before {
  content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--amber);
  box-shadow: 0 0 0 3px var(--amber-tint);
}
body:not([data-phase="empty"]):not([data-phase="reading"]) .hero { display: none; }

/* ---------- the console: display + stick ---------- */
.side { display: flex; flex-direction: column; gap: 18px; view-transition-name: side; }
.console {
  background: var(--paper-2); border-radius: 30px; padding: 12px; display: flex; flex-direction: column; gap: 12px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.7), inset 0 -1px 0 rgba(0,0,0,.04);
}

.display {
  position: relative; overflow: hidden; border-radius: 18px; padding: 10px 16px 12px;
  background:
    radial-gradient(circle, rgba(255, 176, 48, .075) .9px, transparent 1.25px) 0 0 / 5px 5px,
    radial-gradient(120% 90% at 30% 0%, rgba(255,255,255,.07), transparent 55%),
    linear-gradient(180deg, var(--glass-1), var(--glass-2));
  box-shadow: inset 0 1px 0 rgba(255,255,255,.09), inset 0 0 0 1px rgba(255,255,255,.035), 0 14px 30px -18px rgba(15, 16, 20, .55);
  color: var(--dot); font-family: var(--f-dot);
}
.display::after {           /* the glass: one soft sheen across the top */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background: linear-gradient(170deg, rgba(255,255,255,.06) 0%, rgba(255,255,255,0) 38%);
}
.disp-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-weight: 700; font-size: 13px;
  letter-spacing: .06em; color: var(--dot-dim); text-transform: uppercase; line-height: 1.1; min-height: 15px; }
.disp-src { border: 1.5px solid var(--dot-dim); border-radius: 4px; padding: 1px 4px 0; font-size: 11px; }
.disp-main { position: relative; overflow: hidden; white-space: nowrap; margin: 6px 0 4px; height: 1.15em;
  font-size: clamp(25px, 7.4vw, 34px); font-weight: 800; line-height: 1.15; }
.disp-text { display: inline-block; text-transform: uppercase; letter-spacing: .035em; padding-right: 4px;
  text-shadow: 0 0 7px rgba(255, 168, 36, .6), 0 0 1px rgba(255, 200, 110, .9); will-change: transform; }
.disp-text.marq { animation: marq calc(var(--dur, 8s) * var(--marq-k)) linear infinite; }
@keyframes marq {
  0%, 16% { transform: translateX(0); }
  84%, 100% { transform: translateX(calc(-1 * var(--shift, 0px))); }
}
.disp-text.swap { animation: swap .38s var(--ease); }
.disp-text.swap.marq { animation: swap .38s var(--ease), marq calc(var(--dur, 8s) * var(--marq-k)) linear .38s infinite; }
@keyframes swap { from { opacity: 0; transform: translateY(.18em); } to { opacity: 1; transform: none; } }
.disp-subtext { overflow: hidden; text-overflow: clip; white-space: nowrap; }
.disp-time { font-variant-numeric: tabular-nums; color: var(--dot); }
.display.idle .disp-text::after {     /* the waiting cursor */
  content: ""; display: inline-block; width: .5em; height: .78em; margin-left: .18em; vertical-align: -.04em;
  background: currentColor; box-shadow: 0 0 8px rgba(255, 168, 36, .6); animation: blink 1.1s steps(2, jump-none) infinite;
}
@media (prefers-reduced-motion: reduce) { .display.idle .disp-text::after { animation-duration: 2.2s; } }
.disp-blink { animation: blink 1.1s steps(2, jump-none) infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* the stick */
.stick { position: relative; display: flex; align-items: center; }
.stick-body {
  position: relative; flex: 1; min-width: 0; min-height: 168px; border-radius: 26px 16px 16px 26px; overflow: hidden;
  background: var(--card); box-shadow: 0 10px 24px -16px rgba(21, 23, 28, .45);
  transition: box-shadow .25s, transform .25s var(--ease);
}
.stick-body::after {          /* the outline sits on top, so the fill never eats the stick's edge */
  content: ""; position: absolute; inset: 0; z-index: 3; border-radius: inherit; pointer-events: none;
  box-shadow: inset 0 0 0 2.5px var(--ink); transition: box-shadow .25s;
}
body.is-dragging .stick-body::after { box-shadow: inset 0 0 0 3px var(--amber); }
.stick-plug {
  flex: none; width: 46px; height: 58%; min-height: 84px; margin-left: -2px; border-radius: 0 9px 9px 0;
  background: linear-gradient(180deg, #f4f4f6, #d6d8dd 55%, #c6c9cf);
  box-shadow: inset 0 0 0 2.5px var(--ink); position: relative;
  display: flex; flex-direction: column; justify-content: center; gap: 14px; padding-left: 13px;
}
.stick-plug i { display: block; width: 13px; height: 11px; border-radius: 2px; background: var(--ink); opacity: .85; }
.stick-led {
  position: absolute; right: 16px; top: 16px; width: 9px; height: 9px; border-radius: 50%;
  background: #d8d2c4; box-shadow: inset 0 0 0 1.5px rgba(21,23,28,.25); transition: background .3s, box-shadow .3s;
}
body.is-dragging .stick-body { transform: translateY(-2px); box-shadow: 0 18px 34px -18px rgba(154, 77, 0, .55); }
body.is-dragging .stick-led,
body:not([data-phase="empty"]) .stick-led { background: var(--amber); box-shadow: 0 0 0 3px rgba(255,162,26,.22), 0 0 12px 2px rgba(255,162,26,.75); }
body[data-phase="working"] .stick-led { animation: led 1.2s steps(2, jump-none) infinite; }
@media (prefers-reduced-motion: reduce) { body[data-phase="working"] .stick-led { animation-duration: 2.4s; } }
@keyframes led { 50% { background: #ffd28a; box-shadow: 0 0 0 3px rgba(255,162,26,.12), 0 0 5px 1px rgba(255,162,26,.45); } }

.stick-in { position: relative; z-index: 2; padding: 18px 18px 18px 20px; display: flex; flex-direction: column; gap: 14px; }
.stick-say { margin: 0; padding-right: 22px; font: 800 21px/1.12 var(--f-display); letter-spacing: -.03em; }
.stick-btns { display: flex; flex-wrap: wrap; gap: 10px; }
.stick-btns .btn { height: 48px; padding: 0 20px; font-size: 16px; }

.stick-want, .stick-fill { position: absolute; left: 0; top: 0; bottom: 0; width: 0; transition: width var(--t-fill) var(--ease); }
.stick-want { background: var(--amber-want); }
.stick-fill { background: var(--amber); }
body.is-over .stick-fill { background: repeating-linear-gradient(-45deg, var(--amber) 0 12px, #ff8f0a 12px 24px); }
.stick-meter { position: absolute; inset: 0; z-index: 2; display: none; align-items: flex-end; justify-content: space-between;
  padding: 16px 18px 15px 22px; gap: 10px; pointer-events: none; }
.meter-used { font: 750 15px/1.15 var(--f-display); letter-spacing: -.01em; color: var(--ink); font-variant-numeric: tabular-nums; }
.meter-used b { display: block; font-size: 30px; font-weight: 800; letter-spacing: -.04em; }
.meter-cap { font: 800 34px/1 var(--f-display); letter-spacing: -.05em; color: var(--ink); text-align: right; }
.meter-cap small { display: block; font: 700 12px/1 var(--f-body); letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 6px; }
body:not([data-phase="empty"]):not([data-phase="reading"]) .stick-in { display: none; }
body:not([data-phase="empty"]):not([data-phase="reading"]) .stick-meter { display: flex; }
body:not([data-phase="empty"]):not([data-phase="reading"]) .stick-body { min-height: 118px; }
body[data-phase="reading"] .stick-btns { visibility: hidden; }

.phone-note { display: none; margin: 2px 6px 4px; font: 700 15px/1.35 var(--f-display); color: var(--amber-ink); letter-spacing: -.01em; }
body.is-phone .phone-note { display: block; }
body.is-phone #pick-folder { display: none; }
body.is-phone #pick-files { background: var(--ink); color: #fff; box-shadow: none; }

/* ---------- controls ---------- */
.controls { display: none; flex-direction: column; gap: 16px; }
body[data-phase="plan"] .controls, body[data-phase="working"] .controls, body[data-phase="done"] .controls { display: flex; }
.sum { display: flex; flex-direction: column; gap: 3px; }
.sum-big { margin: 0; font: 800 24px/1.1 var(--f-display); letter-spacing: -.035em; }
.sum-line { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.4; text-wrap: pretty; }
.sum-scan { margin: 0; color: var(--ink-3); font-size: 13.5px; font-variant-numeric: tabular-nums; min-height: 0; }
.sum-scan:empty { display: none; }

.ctl { display: flex; flex-direction: column; gap: 9px; }
.ctl-label { margin: 0; font: 700 12.5px/1 var(--f-body); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.pills { display: flex; flex-wrap: wrap; gap: 7px; }
.pill {
  position: relative; height: 42px; min-width: 62px; padding: 0 14px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: var(--card); box-shadow: inset 0 0 0 2px var(--line-2); color: var(--ink);
  font: 750 15.5px/1 var(--f-display); letter-spacing: -.02em; white-space: nowrap; font-variant-numeric: tabular-nums;
  transition: background-color .18s, color .18s, box-shadow .18s, transform .12s var(--ease);
}
.pill:active { transform: scale(.97); }
.pill.small { color: var(--ink-3); box-shadow: inset 0 0 0 2px var(--line); }
.pill.best::after {
  content: ""; position: absolute; top: 5px; right: 7px; width: 6px; height: 6px; border-radius: 50%; background: var(--amber);
}
.pill[aria-pressed="true"] { background: var(--ink); color: #fff; box-shadow: none; }
.pill[aria-pressed="true"].small { background: var(--ink-2); }

.nofit { display: none; margin-top: 2px; padding: 12px 14px; border-radius: 16px; background: var(--amber-tint);
  color: var(--ink); font-size: 15px; line-height: 1.4; }
.nofit b { font-weight: 700; }
.nofit .btn { margin-top: 10px; }
body.is-over .nofit { display: block; }
body.is-over .go { display: none; }

.ctl > .seg { align-self: flex-start; }
.ctl-two { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 10px 16px; }
.seg { display: inline-flex; padding: 4px; border-radius: var(--r-pill); background: var(--paper-2); gap: 2px; }
.seg button {
  height: 38px; padding: 0 16px; border: 0; border-radius: var(--r-pill); background: transparent; cursor: pointer;
  font: 700 15px/1 var(--f-display); letter-spacing: -.015em; color: var(--ink-2); white-space: nowrap;
  transition: background-color .18s, color .18s, box-shadow .18s;
}
.seg button[aria-pressed="true"] { background: var(--card); color: var(--ink); box-shadow: 0 1px 2px rgba(21,23,28,.12), 0 0 0 1px rgba(21,23,28,.06); }

.switch { display: inline-flex; align-items: center; gap: 10px; border: 0; background: none; padding: 4px 0; cursor: pointer;
  font: 700 15px/1 var(--f-display); letter-spacing: -.015em; color: var(--ink); }
.sw { position: relative; width: 44px; height: 26px; border-radius: 13px; background: var(--line-2); transition: background-color .2s; flex: none; }
.sw::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform .22s var(--ease); }
.switch[aria-checked="true"] .sw { background: var(--amber); }
.switch[aria-checked="true"] .sw::after { transform: translateX(18px); }
body.is-music .switch { display: none; }
#heb-wrap { display: none; }
body.is-heb #heb-wrap { display: flex; }

.go { display: flex; flex-direction: column; gap: 8px; }
.btn-go { width: 100%; height: 62px; font-size: 20px; font-weight: 800; letter-spacing: -.025em; }
.go-note { margin: 0; text-align: center; color: var(--ink-2); font-size: 14px; }
.go-note:empty { display: none; }
body.is-phone .go .btn-go { display: none; }

.room, .run, .end { display: none; flex-direction: column; gap: 10px; }
body.is-room .room { display: flex; }
body.is-room .go { display: none; }
.room-say { margin: 0; padding: 14px 16px; border-radius: 16px; background: var(--amber-tint); font-size: 15px; line-height: 1.45; }
.room-btns { display: flex; flex-wrap: wrap; gap: 10px; }

body[data-phase="working"] .ctl, body[data-phase="working"] .go, body[data-phase="working"] .room,
body[data-phase="done"] .ctl, body[data-phase="done"] .go, body[data-phase="done"] .room, body[data-phase="done"] .sum { display: none; }
body[data-phase="working"] .run { display: flex; }
.run-big { margin: 0; font: 800 44px/1 var(--f-display); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.run-sub { margin: 0; color: var(--ink-2); font-size: 16px; }
.run .btn { align-self: flex-start; margin-top: 4px; }

body[data-phase="done"] .end { display: flex; }
.end-big { margin: 0; font: 800 clamp(46px, 12vw, 64px)/.95 var(--f-display); letter-spacing: -.055em; }
.end-line { margin: 4px 0 0; font: 700 18px/1.3 var(--f-display); letter-spacing: -.02em; }
.end-fix { margin: 0; color: var(--ink-2); font-size: 15px; line-height: 1.45; }
.end-fix:empty { display: none; }
.end-btns { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 8px; }
#zip-again { display: none; }
body.is-zip #zip-again { display: inline-flex; }

/* ---------- the list ---------- */
.sheet { display: none; flex-direction: column; gap: 6px; min-width: 0; }
body[data-phase="plan"] .sheet, body[data-phase="working"] .sheet, body[data-phase="done"] .sheet { display: flex; }
.sheet-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; padding: 4px 2px 10px; border-bottom: 2.5px solid var(--ink); }
.root { margin: 0; display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.root-label { font: 700 12.5px/1 var(--f-body); letter-spacing: .09em; text-transform: uppercase; color: var(--ink-2); }
.root-name { font: 800 26px/1.05 var(--f-display); letter-spacing: -.04em; cursor: text; border-radius: 8px; overflow-wrap: anywhere; }
.root-name[contenteditable="true"] { outline: 2.5px solid var(--amber); outline-offset: 3px; cursor: text; }
body[data-phase="working"] #add-more, body[data-phase="done"] #add-more { visibility: hidden; }

.fold { margin-top: 18px; }
.fold:first-child { margin-top: 10px; }
.fold-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; padding: 0 2px 8px; }
.fold-name { margin: 0; font: 800 19px/1.15 var(--f-display); letter-spacing: -.03em; overflow-wrap: anywhere; }
.fold-meta { flex: none; color: var(--ink-3); font-size: 13.5px; font-variant-numeric: tabular-nums; }

.rows { list-style: none; margin: 0; padding: 0; position: relative; }
.row {
  position: relative; display: grid; align-items: center;
  grid-template-columns: 22px 40px minmax(0, 1fr) auto;
  grid-template-areas: "grip num name x" ". . meta meta";
  column-gap: 8px; row-gap: 4px; padding: 11px 2px 11px 0; border-top: 1px solid var(--line);
  background: var(--paper); touch-action: pan-y;
}
.row:first-child { border-top: 0; }
.grip { grid-area: grip; align-self: center; width: 22px; height: 34px; border: 0; padding: 0; background: none; cursor: grab;
  touch-action: none; color: var(--ink-3); display: grid; place-items: center; border-radius: 6px; }
.grip svg { width: 10px; height: 16px; }
.num { grid-area: num; font: 800 19px/1 var(--f-display); letter-spacing: -.03em; font-variant-numeric: tabular-nums; color: var(--ink); }
.name { grid-area: name; min-width: 0; font: 600 15.5px/1.3 var(--f-body); letter-spacing: -.005em; overflow-wrap: anywhere; cursor: text;
  border-radius: 6px; padding: 2px 0; unicode-bidi: plaintext; text-align: left; }
.fold-name, .left-name, .root-name, .disp-subtext { unicode-bidi: plaintext; text-align: left; }
.name[contenteditable="true"] { outline: 2.5px solid var(--amber); outline-offset: 3px; background: var(--card); padding: 2px 4px; }
.meta { grid-area: meta; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; min-width: 0; color: var(--ink-2); font-size: 13.5px;
  font-variant-numeric: tabular-nums; }
.len, .size { white-space: nowrap; }
.size s { color: var(--ink-3); text-decoration: none; }
.size s::after { content: "\00a0\2192\00a0"; }
.marks { display: contents; }
.mk {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border: 0; border-radius: var(--r-pill); cursor: pointer;
  background: var(--amber-tint); color: var(--amber-ink); font: 700 12.5px/1 var(--f-body); letter-spacing: 0; white-space: nowrap;
  animation: mk-in .45s var(--ease);
}
.mk.plain, body[data-phase="done"] .mk { background: var(--paper-2); color: var(--ink-2); }
@keyframes mk-in { from { opacity: 0; } to { opacity: 1; } }
.x { grid-area: x; width: 34px; height: 34px; border: 0; border-radius: 50%; background: none; color: var(--ink-3); cursor: pointer;
  display: grid; place-items: center; }
.x svg { width: 12px; height: 12px; }
.x:active { background: var(--paper-2); color: var(--ink); }
.tick { display: none; grid-area: x; width: 26px; height: 26px; justify-self: center; }
.tick path { stroke: var(--amber-ink); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 24; stroke-dashoffset: 24; }

/* rows while it is being made */
body[data-phase="working"] .grip, body[data-phase="done"] .grip { visibility: hidden; }
body[data-phase="working"] .x, body[data-phase="done"] .x { display: none; }
body[data-phase="working"] .name, body[data-phase="done"] .name { cursor: default; }
.row[data-state="waiting"] { color: var(--ink-2); }
.row[data-state="waiting"] .num { color: var(--ink-3); }
.row[data-state="working"] .num, .row[data-state="saving"] .num { color: var(--amber-ink); animation: pulse 1.1s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .row[data-state="working"] .num, .row[data-state="saving"] .num { animation-duration: 2.2s; } }
.row[data-state="done"] .tick { display: block; }
.row[data-state="done"] .tick path { animation: tick .5s var(--ease) forwards; }
@keyframes tick { to { stroke-dashoffset: 0; } }
.row[data-state="failed"] .name { color: var(--ink-3); text-decoration: line-through; text-decoration-thickness: 1.5px; }
.row .fail { color: var(--amber-ink); font-weight: 600; }

/* dragging a row */
.row.lift { z-index: 5; background: var(--card); box-shadow: 0 14px 30px -14px rgba(21,23,28,.45), 0 0 0 1.5px var(--line-2);
  border-radius: 14px; border-top-color: transparent; }
body.is-reordering, body.is-reordering * { cursor: grabbing !important; user-select: none; }

/* left off */
.left { display: none; margin-top: 12px; padding: 14px 16px; border-radius: 18px; background: var(--paper-2); }
.left.on { display: block; }
.left-head { margin: 0 0 8px; font: 800 16px/1.2 var(--f-display); letter-spacing: -.02em; }
.left-row { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 2px 12px; padding: 7px 0; border-top: 1px solid var(--line-2); font-size: 14.5px; }
.left-row:first-of-type { border-top: 0; }
.left-name { font-weight: 600; overflow-wrap: anywhere; min-width: 0; }
.left-why { color: var(--ink-2); }
.left-row .btn { height: 32px; padding: 0 12px; font-size: 14px; }

/* the plain answer behind a mark */
.pop {
  position: fixed; z-index: 40; max-width: min(320px, calc(100vw - 24px)); padding: 12px 14px; border-radius: 14px;
  background: var(--ink); color: #fff; font-size: 14.5px; line-height: 1.4; box-shadow: 0 16px 36px -14px rgba(0,0,0,.5);
  display: none;
}
.pop.on { display: block; animation: mk-in .18s ease; }

/* drop anywhere */
.drag-veil { position: fixed; inset: 0; z-index: 30; pointer-events: none; display: none; align-items: flex-end; justify-content: center; padding-bottom: 28px; }
.drag-veil span { padding: 12px 20px; border-radius: var(--r-pill); background: var(--ink); color: #fff; font: 800 17px/1 var(--f-display); letter-spacing: -.02em; }
body.is-dragging:not([data-phase="empty"]) .drag-veil { display: flex; }

/* ---------- foot ---------- */
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px 20px; padding: 18px 2px 26px;
  border-top: 1px solid var(--line); color: var(--ink-3); font-size: 13.5px; }
.foot-fact { margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.foot-fact::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--ink-3); }

/* ---------- a bit wider: tablets ---------- */
@media (min-width: 620px) {
  :root { --pad: 28px; }
  .h1 { font-size: clamp(52px, 8.4vw, 76px); }
  .row { grid-template-columns: 22px 46px minmax(0, 1fr) auto auto;
    grid-template-areas: "grip num name meta x"; padding: 10px 2px 10px 0; min-height: 58px; }
  .meta { justify-content: flex-end; flex-wrap: nowrap; }
  .marks { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
  .len { min-width: 54px; text-align: right; }
  .size { min-width: 104px; text-align: right; }
  .stick-btns .btn { height: 50px; }
}

/* ---------- desktop: two columns ---------- */
@media (min-width: 1000px) {
  :root { --pad: 40px; }
  .top { height: 76px; }
  .main { display: grid; column-gap: clamp(36px, 4.6vw, 80px); row-gap: 0; padding-bottom: 36px;
    grid-template-columns: minmax(0, 1.08fr) minmax(0, 1fr); grid-template-areas: "hero side"; align-items: center; }
  .hero { grid-area: hero; padding: 0 0 28px; }
  .side { grid-area: side; }
  .sheet { grid-area: sheet; }
  .h1 { font-size: clamp(64px, 6.1vw, 100px); }
  .lede { font-size: 19px; margin-top: 20px; }
  .promises { margin-top: 22px; }
  body[data-phase="empty"] .main, body[data-phase="reading"] .main { min-height: calc(100svh - 76px - 70px); }
  body:not([data-phase="empty"]):not([data-phase="reading"]) .main {
    grid-template-columns: minmax(390px, 450px) minmax(0, 1fr); grid-template-areas: "side sheet"; align-items: start; }
  body:not([data-phase="empty"]):not([data-phase="reading"]) .side { position: sticky; top: 16px; }
  .display { padding: 12px 20px 14px; }
  .disp-main { font-size: clamp(30px, 2.6vw, 40px); }
  .stick-body { min-height: 186px; }
  .stick-in { padding: 24px 26px; gap: 18px; }
  .stick-say { font-size: 25px; }
  .sheet-head { padding-top: 6px; }
}
/* a short screen: the side column keeps everything without scrolling inside itself */
@media (min-width: 1000px) and (max-height: 760px) {
  body:not([data-phase="empty"]):not([data-phase="reading"]) .stick-body { min-height: 96px; }
  body:not([data-phase="empty"]):not([data-phase="reading"]) .meter-cap { font-size: 28px; }
  body:not([data-phase="empty"]):not([data-phase="reading"]) .meter-used b { font-size: 24px; }
  .disp-main { font-size: 30px; margin: 4px 0 2px; }
  .controls { gap: 12px; }
  .pill { height: 38px; }
  .seg button { height: 34px; }
  .btn-go { height: 56px; }
  .stick-body { min-height: 164px; }
}
/* a small laptop (1366x620): one notch tighter, so the button is on screen without scrolling */
@media (min-width: 1000px) and (max-height: 690px) {
  .top { height: 60px; }
  body:not([data-phase="empty"]):not([data-phase="reading"]) .side { top: 10px; gap: 12px; }
  .console { padding: 10px; gap: 10px; border-radius: 26px; }
  .display { padding: 8px 16px 9px; }
  .disp-row { font-size: 11.5px; min-height: 13px; }
  .disp-main { font-size: 26px; margin: 2px 0 1px; }
  body:not([data-phase="empty"]):not([data-phase="reading"]) .stick-body { min-height: 74px; }
  body:not([data-phase="empty"]):not([data-phase="reading"]) .stick-meter { padding: 10px 16px 10px 20px; }
  body:not([data-phase="empty"]):not([data-phase="reading"]) .meter-used { font-size: 13px; }
  body:not([data-phase="empty"]):not([data-phase="reading"]) .meter-used b { font-size: 20px; }
  body:not([data-phase="empty"]):not([data-phase="reading"]) .meter-cap { font-size: 24px; }
  .stick-plug { min-height: 60px; }
  .controls { gap: 10px; }
  .sum-big { font-size: 21px; }
  .sum-line { font-size: 14px; }
  .ctl { gap: 7px; }
  .pill { height: 34px; min-width: 54px; padding: 0 11px; font-size: 14.5px; }
  .seg button { height: 32px; font-size: 14px; }
  .switch { font-size: 14px; }
  .btn-go { height: 52px; font-size: 18px; }
  .go-note { font-size: 13px; }
}
@media (min-width: 1000px) and (max-height: 560px) {
  body:not([data-phase="empty"]):not([data-phase="reading"]) .side { position: static; }
}
/* phones: nine sizes in two rows */
@media (max-width: 619px) {
  .pills { gap: 6px; }
  .pill { height: 40px; min-width: 0; padding: 0 11px; font-size: 14.5px; }
}

/* the console glides from the right to the left when files land (Chrome/Edge) */
::view-transition-group(side) { animation-duration: .55s; animation-timing-function: var(--ease); }
@media (prefers-reduced-motion: reduce) { ::view-transition-group(side) { animation-duration: .35s; } }

/* links to the help pages (top bar + footer) - they wrap, and each is a thumb-sized reach */
.foot-nav { flex-wrap: wrap; gap: 0 18px; }
.top-nav a, .foot-nav a { display: inline-flex; align-items: center; min-height: 44px; }
.doc-foot .foot-fact a { color: var(--ink-2); font-weight: 600; text-decoration: none; display: inline-flex; align-items: center; min-height: 44px; }
/* a dark button in the top bar keeps its own light words (the bar's link colour would turn them grey) */
.top-nav a.btn-ink { color: var(--paper); }
