/* The pairing and error screens still centre on the page; the app itself uses
   the shell below. */
.app { max-width: 1440px; margin: 0 auto; padding: 12px clamp(12px, 2.5vw, 28px) 130px; }

/* Shell: a dark rail of lists beside the screen. Once Prep is one of several
   lists, an app bar can't hold them all and still show what's left on each. */
:root { --rail-w: 232px; }
.shell { display: grid; grid-template-columns: var(--rail-w) minmax(0, 1fr); align-items: start; }
.rail { position: sticky; top: 0; height: 100vh; background: var(--rail); color: var(--rail-ink);
  display: flex; flex-direction: column; gap: 6px; padding: 16px 12px 12px; overflow: auto; }
.rail-head { display: flex; flex-direction: column; gap: 3px; padding: 0 8px 12px; }
.rail-loc { font: 700 25px/1 var(--cond); }
.rail-device { font-size: 13px; color: var(--rail-muted); }
.rail-device .sep { background: var(--rail-muted); }
.rail-items { display: flex; flex-direction: column; gap: 6px; }
.rail-item { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 8px; min-height: 72px;
  padding: 10px 12px; border: 0; border-radius: 8px; background: var(--rail-2); color: var(--rail-ink); text-align: left; }
.rail-item-main { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.rail-item-name { font: 700 22px/1 var(--cond); }
.rail-item-sub { font-size: 13px; color: var(--rail-muted); overflow-wrap: anywhere; }
.rail-item-left { font: 700 32px/1 var(--cond); }
.rail-item-left.is-clear { color: var(--ok); }
/* The list you're on lifts out of the rail. In light mode that means taking the
   page's own background, so it reads as part of the screen it opens; in dark the
   page is darker than the rail, so it lifts to its own tone instead. */
.rail-item.is-active { background: var(--rail-on); color: var(--rail-on-ink); }
.rail-item.is-active .rail-item-sub { color: var(--rail-on-muted); }
/* A list that hasn't opened yet sits back rather than nagging. */
.rail-item.is-dim .rail-item-left { color: var(--rail-muted); }
.rail-foot { margin-top: auto; padding-top: 12px; display: flex; flex-direction: column; gap: 6px; }
.rail-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.rail-btn { min-height: var(--touch); padding: 0 10px; border: 0; border-radius: 8px;
  background: var(--rail-2); color: var(--rail-ink); font-weight: 600; font-size: 15px; }
.rail-btn.is-active { background: var(--rail-on); color: var(--rail-on-ink); }
.rail-btn.ghost { background: transparent; border: 1px solid var(--rail-2); }
.rail-elev { display: flex; justify-content: space-between; align-items: center; gap: 8px; min-height: var(--touch);
  padding: 0 12px; border: 0; border-radius: 8px; background: var(--tape); color: var(--tape-ink); font-weight: 600; font-size: 15px; }
.rail-elev span:last-child { font-variant-numeric: tabular-nums; }
.rail-crew { display: flex; flex-direction: column; gap: 8px; padding: 10px 12px; border: 1px solid var(--rail-2);
  border-radius: 8px; background: transparent; color: var(--rail-ink); text-align: left; min-height: var(--touch); }
.rail-crew-head { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; font-weight: 600; }
.rail-crew-head .muted { color: var(--rail-muted); }
.rail-crew-chips { display: flex; gap: 4px; flex-wrap: wrap; }
.rail-sync { display: flex; align-items: center; gap: 8px; min-height: var(--touch); padding: 0 8px; border: 0;
  background: transparent; color: var(--rail-muted); font-size: 13px; text-align: left; }
.rail-dot { width: 8px; height: 8px; flex: none; border-radius: 50%; background: var(--ok); }
.rail-dot.is-off { background: var(--warn); }
.rail :focus-visible { outline-color: var(--rail-ink); }

.main { min-width: 0; padding: 16px clamp(12px, 2vw, 24px) 130px; }
.main-in { display: flex; flex-direction: column; gap: 18px; }
.main-in > * { margin-bottom: 0; }

/* Prep's own two screens. Not siblings of the checklists, so they sit inside it. */
.subtabs { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.subtabs .seg button { font: 600 20px/1 var(--cond); padding: 0 22px; }
.subtabs-hint { font-size: 14px; color: var(--muted); }

@media (max-width: 900px) {
  :root { --rail-w: 0px; }
  .shell { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; height: auto; flex-direction: row; flex-wrap: wrap; align-items: center; padding: 10px 12px; }
  .rail-head { padding: 0 8px 0 0; }
  .rail-items { flex-direction: row; overflow-x: auto; flex: 1; }
  .rail-item { min-width: 168px; }
  .rail-foot { margin: 0; padding: 0; flex-direction: row; flex-wrap: wrap; align-items: center; width: 100%; }
  .rail-nav { grid-template-columns: auto auto; }
  .rail-crew { flex-direction: row; align-items: center; gap: 12px; }
  .rail-sync { margin-left: auto; }
}

/* checklists */
/* No day dot on a checklist, and the progress block keeps its own column. */
.listhead { grid-template-columns: minmax(0, 1fr) 230px; }
.row-freq { font-size: 13px; color: var(--muted); white-space: nowrap; }
/* A reading's empty box says a number goes here, without a stepper on the row. */
.reading { display: flex; align-items: center; justify-content: flex-end; gap: 5px; min-width: 96px; height: 54px;
  padding: 0 12px; border: 2px solid var(--line); border-radius: var(--r-control); }
.reading.empty { border-style: dashed; border-color: var(--line-strong); }
.reading-n { font: 700 28px/1 var(--cond); color: var(--muted); }
.reading-unit { font: 600 16px/1 var(--cond); color: var(--muted); }
.reading-done { font: 700 24px/1 var(--cond); white-space: nowrap; }

/* recipes */
.recipe-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: 14px; }
.recipe-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-height: 120px;
  padding: 16px; border: 1px solid var(--line); border-top: 5px solid var(--ink); border-radius: var(--r-panel);
  background: var(--surface); text-align: left; }
.recipe-card:active { background: var(--surface-2); }
.recipe-card-station { font-size: 13px; font-weight: 600; color: var(--muted); }
.recipe-card-name { font: 700 26px/1.1 var(--cond); overflow-wrap: anywhere; }
.recipe-card-yield { margin-top: auto; font-size: 15px; color: var(--muted); }

/* The recipe sheet is read at arm's length on a counter, so it gets the room. */
.sheet.wide { width: min(1120px, 100%); padding: 0; display: flex; flex-direction: column; }
.recipe-head { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; padding: 14px 20px; border-bottom: 1px solid var(--line); }
.recipe-title { min-width: 0; }
.recipe-title h2 { font-size: 34px; }
.recipe-title .sub { margin: 0; font-size: 15px; }
.scale-seg { margin-left: auto; }
.scale-seg button { min-width: 72px; font: 700 24px/1 var(--cond); }
.recipe-body { display: grid; grid-template-columns: 400px minmax(0, 1fr); min-height: 0; overflow: auto; }
.recipe-side { border-right: 1px solid var(--line); background: var(--surface-2); padding: 20px;
  display: flex; flex-direction: column; gap: 14px; }
/* A slot for the photo that will come later, so adding one is not a relayout. */
.recipe-photo { aspect-ratio: 16 / 10; border: 2px dashed var(--line-strong); border-radius: var(--r-panel);
  display: grid; place-items: center; color: var(--muted); font-size: 15px; background: var(--surface); }
.recipe-sidehead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.recipe-sidehead h3 { font-size: 24px; }
.recipe-ing { list-style: none; margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r-panel);
  background: var(--line); display: flex; flex-direction: column; gap: 1px; overflow: hidden; }
.recipe-ing li { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 10px; align-items: baseline;
  padding: 12px 14px; background: var(--surface); }
.ing-qty { font: 700 26px/1 var(--cond); }
.ing-qty small { font: 600 17px/1 var(--cond); color: var(--muted); }
.ing-name { font-size: 18px; overflow-wrap: anywhere; }
.recipe-steps { padding: 22px 28px; }
.recipe-steps h3 { font-size: 24px; margin-bottom: 10px; }
.steps { list-style: none; margin: 0; padding: 0; }
.steps li { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 14px; padding: 14px 0; border-top: 1px solid var(--line); }
.step-n { font: 700 40px/1 var(--cond); color: var(--muted); }
.step-text { font: 500 22px/1.4 var(--sans); text-wrap: pretty; }
/* A note can run to several lines, as written. */
.recipe-note { margin: 14px 0 0; font-size: 18px; white-space: pre-line; }
@media (max-width: 820px) {
  .recipe-body { grid-template-columns: minmax(0, 1fr); }
  .recipe-side { border-right: 0; border-bottom: 1px solid var(--line); }
  .recipe-steps { padding: 18px 20px; }
}

/* the sign-off sheet's way into the recipe: one extra tap, never in the way */
.sheet-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; }
.recipe-btn { flex: none; display: flex; align-items: center; gap: 10px; min-height: 52px;
  padding: 0 16px 0 10px; background: var(--surface-2); font-size: 16px; }
.recipe-btn-mark { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 6px;
  background: var(--ink); color: var(--surface); font: 700 18px/1 var(--cond); }
/* start the clock: optional, beside the recipe button (ADR 0025) */
.sheet-head-btns { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.start-btn { flex: none; display: flex; align-items: center; gap: 10px; min-height: 52px;
  padding: 0 18px 0 10px; border-color: var(--accent); color: var(--accent); font-size: 16px; }
.start-mark { width: 30px; height: 30px; flex: none; display: grid; place-items: center; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink); font-size: 13px; }
.started-note { margin: 12px 0 4px; }
@media (max-width: 560px) {
  .sheet-head { flex-direction: column; }
  .sheet-head-btns { justify-content: flex-start; }
}

/* staff grid: tonight's crew first, everyone else one tap below */
.staffhead { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; margin-top: 6px; }
.staffgrid.off { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px;
  margin-top: 8px; padding-top: 10px; border-top: 1px dashed var(--line); }
.staff.small { min-height: 60px; padding: 8px 10px; gap: 10px; background: var(--surface); font-size: 15px; }
.staff.small .staff-init { width: 38px; height: 38px; font-size: 17px; background: var(--surface-2);
  border: 1px solid var(--line); color: var(--ink); }
.btn.dashed { align-self: flex-start; margin-top: 10px; border-style: dashed; border-color: var(--line-strong);
  background: transparent; color: var(--muted); }
.qty-note { margin-left: auto; font-weight: 600; color: var(--muted); }

/* who's on tonight */
.crewgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 10px; margin: 6px 0 0; }
.crew-tile { display: flex; align-items: center; gap: 12px; min-height: 70px; padding: 10px 14px;
  border: 2px solid var(--line); border-radius: var(--r-control); background: var(--surface); text-align: left; }
.crew-tile .staff-init { width: 46px; height: 46px; flex: none; display: grid; place-items: center;
  background: var(--surface-2); color: var(--muted); font: 400 20px/1 var(--marker); }
.crew-tile .staff-name { flex: 1; font-weight: 600; }
.crew-tile.is-on { border-color: var(--ok); background: var(--ok-bg); }
.crew-tile.is-on .staff-init { background: var(--tape); color: var(--tape-ink); }
.crew-here { font-size: 13px; font-weight: 600; color: var(--ok); }

.ini.sm { font-size: 14px; padding: 3px 6px; }
.banner-n { font-weight: 700; color: var(--warn); white-space: nowrap; }
.banner-unsent { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
.banner-unsent > span { flex: 1 1 30ch; }
.banner-unsent .btn { min-height: var(--touch); }

.elevated { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; background: var(--ink); color: var(--bg);
  padding: 10px 14px; border-radius: 10px; margin-bottom: 14px; font-weight: 600; }
.elevated .grow { margin-right: auto; }
.elevated .btn { min-height: var(--touch); background: transparent; color: var(--bg); border-color: currentColor; }

/* day header */
.dayhead { display: grid; grid-template-columns: auto 1fr auto; align-items: center; gap: 20px; margin-bottom: 18px; }
.dayhead h1 { font-size: clamp(28px, 3.4vw, 42px); }
.progress { min-width: 230px; text-align: right; }
.progress-num { font: 600 18px/1 var(--cond); color: var(--muted); margin-bottom: 8px; }
.progress-num strong { font-size: 36px; color: var(--ink); }
progress { appearance: none; -webkit-appearance: none; width: 100%; height: 10px; border: 1px solid var(--line); border-radius: 5px; background: var(--surface-2); overflow: hidden; }
progress::-webkit-progress-bar { background: var(--surface-2); }
progress::-webkit-progress-value { background: var(--ok); }
progress::-moz-progress-bar { background: var(--ok); }
@media (max-width: 720px) { .dayhead { grid-template-columns: auto 1fr; } .progress { grid-column: 1 / -1; text-align: left; } }

.chip-n { display: inline-block; min-width: 26px; margin-left: 6px; padding: 1px 7px; border-radius: 12px; background: var(--surface-2); color: var(--ink); font-size: 14px; text-align: center; }
.chip[aria-pressed="true"] .chip-n { background: var(--surface); color: var(--ink); }
.station-chips { margin-bottom: 16px; }
/* Cooks tap these: the full 48px, where the admin page's chips may be 44. */
.chip { min-height: var(--touch); }

/* stations and rows */
.stations { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 460px), 1fr)); gap: 18px; align-items: start; }
.station { background: var(--surface); border: 1px solid var(--line); border-top: 5px solid var(--ink); border-radius: 4px; }
.station-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 12px 16px 10px; border-bottom: 1px solid var(--line); }
.station-head h2 { font-size: 25px; }
.station-left { color: var(--muted); font-weight: 600; white-space: nowrap; }
.rows { list-style: none; margin: 0; padding: 0; }
.rows > li + li { border-top: 1px solid var(--line); }
.row { display: grid; grid-template-columns: 1fr auto 40px; align-items: center; gap: 14px; width: 100%; min-height: 78px; padding: 12px 16px; border: 0; background: transparent; text-align: left; }
.row:active { background: var(--surface-2); }
.row-main { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.row-name { font: 600 23px/1.15 var(--cond); overflow-wrap: anywhere; }
.row-meta { font-size: 15px; color: var(--muted); }
.make { display: flex; flex-direction: column; align-items: flex-end; line-height: 1; }
.make-label { font-size: 13px; color: var(--muted); margin-bottom: 3px; }
.make-qty { font: 600 16px/1 var(--cond); color: var(--muted); white-space: nowrap; }
.make-qty b { font-size: 38px; color: var(--ink); font-weight: 700; margin-right: 3px; }
.check { width: 38px; height: 38px; border-radius: 50%; border: 2px solid var(--line); display: grid; place-items: center; justify-self: end; color: transparent; }
.is-done .check { background: var(--ok); border-color: var(--ok); color: var(--on-ok); }
.is-done .row-name { color: var(--muted); }
.is-done .make-qty b { color: var(--muted); font-size: 26px; }
.is-pending .check { background: transparent; border-style: dashed; border-color: var(--ok); color: var(--ok); }
/* started, not finished: an accent edge and who has it, so nobody starts it twice */
.row.is-started { box-shadow: inset 5px 0 0 var(--accent); }
.row.is-started .check { border-color: var(--accent); }
.started-tag { align-self: flex-start; font-size: 15px; font-weight: 600; color: var(--accent); }
.row .tape { align-self: flex-start; margin-top: 5px; }
.pending-note { font: 500 14px/1 var(--sans); }
.atpar { margin: 0; padding: 10px 16px 14px; border-top: 1px dashed var(--line); color: var(--muted); font-size: 15px; }

.empty { background: var(--surface); border: 1px dashed var(--line); border-radius: 6px; padding: 28px; max-width: 760px; }
.empty h2 { font-size: 30px; margin-bottom: 8px; }
.empty p { margin: 0 0 18px; color: var(--muted); max-width: 62ch; }

/* count */
.counthead { display: flex; flex-wrap: wrap; gap: 16px 24px; align-items: flex-end; margin-bottom: 10px; }
/* The par picker: the profile's name over the days it covers. */
.seg-par button { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding: 6px 18px; line-height: 1.15; }
.seg-par small { font-size: 12px; font-weight: 600; color: var(--muted); }
.seg-par button[aria-pressed="true"] small { color: var(--bg); opacity: .75; }
.count-intro { margin: 0 0 16px; max-width: 75ch; }
.crow { display: grid; grid-template-columns: 1fr auto 88px; align-items: center; gap: 12px; padding: 10px 16px; min-height: 78px; }
.stepper { display: flex; align-items: center; gap: 6px; }
.stepper-btn { width: var(--touch-step); height: var(--touch-step); border-radius: 10px; border: 1px solid var(--line); background: var(--surface-2); font: 600 28px/1 var(--sans); display: grid; place-items: center; }
.stepper-btn:active { background: var(--line); }
.count-input { width: 86px; height: 54px; text-align: center; border: 2px solid var(--line); border-radius: 10px; background: var(--surface); font: 700 28px/1 var(--cond); }
.crow.counted .count-input { border-color: var(--ok); background: var(--ok-bg); }
.unit { min-width: 48px; color: var(--muted); font-size: 15px; }
.need { text-align: right; font: 600 18px/1.1 var(--cond); color: var(--muted); }
.need b { color: var(--ink); font-size: 26px; }
.countbar { position: fixed; left: var(--rail-w); right: 0; bottom: 0; z-index: 5; background: var(--surface); border-top: 1px solid var(--line);
  padding: 12px clamp(12px, 2.5vw, 28px) calc(12px + env(safe-area-inset-bottom)); display: flex; gap: 10px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.countbar .grow { margin-right: auto; font-weight: 600; }
@media (max-width: 640px) { .crow { grid-template-columns: 1fr auto; } .need { grid-column: 1 / -1; text-align: left; } .unit { display: none; } }

/* modal content */
.qtyrow { display: flex; align-items: center; gap: 8px; margin: 6px 0 20px; }
.staffgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; margin-top: 6px; }
.staff { display: flex; align-items: center; gap: 12px; min-height: 74px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface-2); text-align: left; }
.staff:active { background: var(--tape); color: var(--tape-ink); }
.staff:disabled { opacity: .5; }
.staff-init { width: 50px; height: 50px; flex: none; display: grid; place-items: center; background: var(--tape); color: var(--tape-ink); font: 400 22px/1 var(--marker); }
.staff-name { font-weight: 600; overflow-wrap: anywhere; }
.pinshow { font: 700 40px/1 var(--cond); letter-spacing: .3em; min-height: 56px; margin: 8px 0 14px; }
.pinpad { display: grid; grid-template-columns: repeat(3, 84px); gap: 10px; }
.pinpad button { height: 70px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface-2); font: 700 30px/1 var(--cond); }
.pinpad button:active { background: var(--line); }

/* pairing */
.pairing { max-width: 640px; margin: 8vh auto 0; }
.pairing .brandmark { display: block; width: 88px; height: 88px; margin-bottom: 20px; }
.pairing h1 { font-size: 44px; margin-bottom: 10px; }
.pairing p { color: var(--muted); max-width: 55ch; }
.code-input { width: 100%; max-width: 360px; height: 76px; font: 700 44px/1 var(--cond); letter-spacing: .12em; text-align: center; text-transform: uppercase;
  border: 2px solid var(--line); border-radius: 12px; background: var(--surface); margin: 18px 0 14px; }

/* added with the app shell */
body.modal-open { overflow: hidden; }
.panel-tools { display: flex; gap: 8px; flex-wrap: wrap; }
.panel-tools .input { min-width: 240px; }
.pin-error { color: var(--warn); font-weight: 600; min-height: 1.4em; margin: 0 0 10px; }
.pinpad .unlock { font: 600 20px/1 var(--sans); background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.pinpad .unlock:disabled { opacity: .45; }
.center-screen { max-width: 640px; margin: 10vh auto 0; }
.row .tape-init { font-size: 22px; }
