/* ── Reset & Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:    #6a0f1b;   /* deep burgundy — headers, nav, login */
  --blue:    #c81e2c;   /* brand red — accents, focus, buttons */
  --blue-lt: #fbe3e5;   /* light red tint */
  --bg:      #f4f6fa;
  --card:    #ffffff;
  --row-alt: #f0f4f9;
  --border:  #dde3ed;
  --text:    #1c2b3a;
  --muted:   #6b7a8d;
  --green:   #27ae60;
  --red:     #e74c3c;
  --warn:    #f39c12;
  --radius:  10px;
  --shadow:  0 2px 8px rgba(0,0,0,.08);
  --tap:     48px;   /* minimum touch target height */
}

html { font-size: 16px; -webkit-text-size-adjust: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100dvh;
  padding-bottom: 80px; /* room for bottom nav */
}

/* ── Login ────────────────────────────────────────────────────────────────── */
#login-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100dvh; padding: 24px;
  background: var(--navy);
}

.login-card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 32px 24px;
  width: 100%; max-width: 360px;
  box-shadow: 0 8px 32px rgba(0,0,0,.25);
  text-align: center;
}

.login-logo {
  font-size: 2.4rem; margin-bottom: 4px;
}

.login-card h1 {
  font-size: 1.15rem; font-weight: 700;
  color: var(--navy); margin-bottom: 4px;
  letter-spacing: .5px; text-transform: uppercase;
}

.login-card p {
  font-size: .85rem; color: var(--muted); margin-bottom: 24px;
}

.login-card input[type="password"] {
  width: 100%; padding: 14px 16px;
  font-size: 1.1rem; border-radius: var(--radius);
  border: 2px solid var(--border);
  background: var(--bg); color: var(--text);
  margin-bottom: 12px;
  transition: border-color .2s;
}

.login-card input:focus {
  outline: none; border-color: var(--blue);
}

.btn-primary {
  width: 100%; padding: 14px;
  background: var(--blue); color: #fff;
  font-size: 1rem; font-weight: 700;
  border: none; border-radius: var(--radius);
  cursor: pointer; letter-spacing: .5px;
  transition: background .2s, transform .1s;
}
.btn-primary:active { transform: scale(.98); background: #1f6fa0; }

.login-error {
  color: var(--red); font-size: .85rem; margin-top: 10px;
  min-height: 1.2em;
}

/* ── App Shell ────────────────────────────────────────────────────────────── */
#app-screen { display: none; }
#app-screen.visible { display: block; }

/* ── Top Header ───────────────────────────────────────────────────────────── */
.app-header {
  position: sticky; top: 0; z-index: 50;
  background: var(--navy);
  padding: 12px 16px 10px;
  display: flex; align-items: center; gap: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
}

.header-title {
  flex: 1;
  font-size: 1rem; font-weight: 700;
  color: #fff; letter-spacing: .5px; text-transform: uppercase;
}

/* ── Search ───────────────────────────────────────────────────────────────── */
.search-btn {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: 1rem;
  width: 34px; height: 34px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  transition: background .2s;
}
.search-btn:hover { background: rgba(255,255,255,.25); }

.search-input {
  display: none;
  flex: 1;
  padding: 7px 12px;
  font-size: .95rem;
  border: none;
  border-radius: 20px;
  background: rgba(255,255,255,.18);
  color: #fff;
  outline: none;
  min-width: 0;
}
.search-input::placeholder { color: rgba(255,255,255,.55); }

.search-clear {
  display: none;
  background: none; border: none;
  color: rgba(255,255,255,.7);
  font-size: 1rem; font-weight: 700;
  cursor: pointer; padding: 4px 6px;
  flex-shrink: 0;
}
.search-clear:hover { color: #fff; }

/* Active search state */
.app-header.search-active #header-title { display: none; }
.app-header.search-active .search-btn   { display: none; }
.app-header.search-active #header-name-btn { display: none; }
.app-header.search-active .search-input { display: block; }
.app-header.search-active .search-clear { display: block; }

/* No-results message */
.search-empty {
  padding: 32px 16px;
  text-align: center;
  color: var(--muted);
  font-size: .9rem;
}

/* Name screen */
#name-screen {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; min-height: 100dvh; padding: 24px;
  background: var(--navy);
}

/* Header name pill */
.header-name-btn {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: .75rem; font-weight: 700;
  padding: 5px 12px; border-radius: 20px;
  cursor: pointer; white-space: nowrap; max-width: 130px;
  overflow: hidden; text-overflow: ellipsis;
  transition: background .2s; line-height: 1.4;
  flex-shrink: 0;
}
.header-name-btn:hover { background: rgba(255,255,255,.25); }
.header-name-btn:empty { display: none; }

/* Language toggle (kept for legacy) */
.lang-toggle {
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.3);
  color: #fff; font-size: .8rem; font-weight: 700;
  padding: 6px 12px; border-radius: 20px;
  cursor: pointer; white-space: nowrap;
  transition: background .2s;
}
.lang-toggle:hover { background: rgba(255,255,255,.25); }

/* ── Bottom Navigation ────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0;
  background: var(--navy);
  display: flex;
  box-shadow: 0 -2px 8px rgba(0,0,0,.2);
  z-index: 50;
}

.nav-btn {
  flex: 1;
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px;
  padding: 10px 4px;
  color: rgba(255,255,255,.55);
  font-size: .7rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px;
  border: none; background: none; cursor: pointer;
  transition: color .2s;
  min-height: var(--tap);
}

.nav-btn .nav-icon { font-size: 1.3rem; }
.nav-btn.active { color: #fff; }
.nav-btn.active .nav-icon { filter: drop-shadow(0 0 4px rgba(255,255,255,.5)); }

/* ── Sheet Pages ──────────────────────────────────────────────────────────── */
.sheet-page { display: none; padding: 12px 12px 0; }
.sheet-page.active { display: block; }

/* ── Section ──────────────────────────────────────────────────────────────── */
.section-block {
  margin-bottom: 14px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.section-header {
  background: var(--navy);
  color: #fff;
  padding: 10px 14px;
  font-size: .9rem; font-weight: 700;
  letter-spacing: .4px;
  display: flex; align-items: center; gap: 6px;
}

.section-header > span:first-child { flex: 1; }

/* FOH & BAR zone — distinct teal, lives below the kitchen list */
.section-header.foh { background: #0e6e66; }

.zone-divider {
  margin-top: 22px;
  padding: 12px 14px;
  background: #e0f2f0;
  border-top: 3px solid #0e6e66;
  color: #0b5a54;
  font-size: .85rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .5px;
}

.section-header .timer-badge {
  background: rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
  font-size: .68rem; font-weight: 600;
  padding: 2px 8px; border-radius: 12px;
  letter-spacing: .3px;
}

/* Section progress pill — X/Y counter */
.section-progress {
  background: rgba(255,255,255,.18);
  color: rgba(255,255,255,.85);
  font-size: .68rem; font-weight: 700;
  padding: 2px 8px; border-radius: 12px;
  letter-spacing: .3px;
  white-space: nowrap;
}
.section-progress.complete {
  background: rgba(39,174,96,.6);
  color: #fff;
}

.section-header.weekly {
  background: #6d3a9c;
}

.section-header.amuse {
  background: #c0392b;
}

/* ── Item Row (prep / order) ──────────────────────────────────────────────── */
.item-row {
  display: flex; align-items: center; gap: 10px;
  padding: 0 14px;
  min-height: var(--tap);
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

.item-row:last-child { border-bottom: none; }
.item-row:nth-child(odd) { background: var(--row-alt); }
.item-row:nth-child(even) { background: var(--card); }
.item-row:active { background: #e8f0fb; }

/* Pending state — untouched prep items get a subtle left border */
.item-row[data-sheet="prep"]:not(.checked):not(.flagged):not(.critical) {
  border-left: 3px solid var(--blue-lt);
  padding-left: 11px;
}

/* Vendor code — shows only while an item is marked for ordering */
.item-src {
  font-size: .68rem;
  color: var(--muted);
  letter-spacing: .2px;
}

/* ── Order tiers — essentials stand out, rare items fold away ────────────── */
.item-row.tier-core .item-label { font-weight: 700; }

.item-row.rare-row { display: none; }
.section-block.rare-open .item-row.rare-row { display: flex; }
.section-block.rare-open .item-row.rare-row .item-label { color: var(--muted); }

.more-toggle {
  padding: 12px 14px;
  font-size: .85rem; font-weight: 600;
  color: var(--blue);
  cursor: pointer;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}
.more-toggle:active { background: var(--blue-lt); }

/* Checked state — done in full */
.item-row.checked { background: #eafaf1 !important; }

/* Flagged state — partial / in-progress / short */
.item-row.flagged { background: #fef9ec !important; }
.item-row.flagged .item-check {
  background: #f39c12;
  border-color: #f39c12;
  color: #fff;
}
.item-row.flagged .item-attr  { color: #b7770d; font-weight: 600; }
.item-row.flagged .item-timer { color: #b7770d; }

/* Critical state — will86 / blocked */
.item-row.critical { background: #fdf0f0 !important; }
.item-row.critical .item-check {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}
.item-row.critical .item-attr  { color: var(--red); font-weight: 600; }
.item-row.critical .item-timer { color: var(--red); }

/* Custom checkbox */
.item-check {
  width: 26px; height: 26px; flex-shrink: 0;
  border-radius: 6px;
  border: 2px solid var(--border);
  background: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  transition: border-color .2s, background .2s;
}

.item-row.checked .item-check {
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}

/* ── Prep only: the box says what to do — TO DO / DONE ─────────────────── */
.item-row[data-sheet="prep"] .item-check {
  width: 54px;
  gap: 3px;
  font-size: .85rem;
}
.item-row[data-sheet="prep"] .item-check::before {
  font-size: .6rem; font-weight: 800; letter-spacing: .3px;
}
/* Untouched row → grey TO DO */
.item-row[data-sheet="prep"]:not(.checked):not(.flagged):not(.critical) .item-check::before {
  content: 'TO DO';
  color: var(--muted);
}
/* Marked ready → DONE ✓ */
.item-row[data-sheet="prep"].checked .item-check::before {
  content: 'DONE';
}

.item-label-wrap {
  flex: 1; display: flex; flex-direction: column; justify-content: center;
  min-width: 0;
}

.item-label {
  font-size: .95rem; line-height: 1.3;
}

.recipe-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 6px;
  min-width: 32px; min-height: 32px;
  padding: 0 4px;
  border: none;
  background: none;
  font-size: 1rem;
  line-height: 1;
  opacity: .7;
  cursor: pointer;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
}
.recipe-link:active { opacity: 1; transform: scale(.9); }

/* Attribution line — who did it + when */
.item-attr {
  font-size: .68rem; color: var(--green);
  margin-top: 1px; line-height: 1.2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Sign-off item attribution uses a slightly different colour */
.item-row.signoff .item-attr {
  color: #8e44ad;
  font-weight: 600;
}

.item-timer {
  font-size: .7rem; color: var(--muted);
  white-space: nowrap; text-align: right;
}

.item-row.checked .item-label { color: var(--muted); }
.item-row.checked .item-timer { color: var(--green); }

/* ── Count sticky column header ───────────────────────────────────────────── */
.count-sticky-hdr {
  position: sticky;
  top: 50px;           /* sits just below the app header */
  z-index: 20;
  display: grid;
  grid-template-columns: 1fr 56px 68px 56px;
  gap: 4px;
  padding: 6px 26px;   /* 12px page-pad + 14px row-pad = 26px each side */
  background: var(--blue-lt);
  font-size: .7rem; font-weight: 700;
  color: var(--navy); text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 2px solid var(--border);
  box-shadow: 0 2px 6px rgba(0,0,0,.07);
}
.count-sticky-hdr.prep-mode {
  grid-template-columns: 1fr 50px 44px 52px 58px;
}

/* ── Count rows ───────────────────────────────────────────────────────────── */
.count-header-row {
  display: grid;
  grid-template-columns: 1fr 56px 68px 80px;
  gap: 4px; padding: 6px 14px;
  background: var(--blue-lt);
  font-size: .7rem; font-weight: 700;
  color: var(--navy); text-transform: uppercase;
  letter-spacing: .3px;
  border-bottom: 1px solid var(--border);
}

.count-item-row {
  display: grid;
  grid-template-columns: 1fr 56px 68px 80px;
  gap: 4px; padding: 4px 14px;
  min-height: var(--tap);
  align-items: center;
  border-bottom: 1px solid var(--border);
}
.count-item-row:last-child { border-bottom: none; }
.count-item-row:nth-child(odd)  { background: var(--row-alt); }
.count-item-row:nth-child(even) { background: var(--card); }

/* Dish rows — small plate dot before the label */
.count-item-row.dish .count-label::before {
  content: '●';
  color: #b0bec5;
  font-size: .45rem;
  margin-right: 5px;
  vertical-align: middle;
}

/* Ingredient rows — muted so servers scan past them */
.count-item-row.ingredient:nth-child(odd)  { background: #dce1e8; }
.count-item-row.ingredient:nth-child(even) { background: #d4dae2; }
.count-item-row.ingredient .count-label    { color: #6b7a8d; }

.count-label {
  font-size: .9rem; line-height: 1.3;
}

.count-input {
  width: 100%; padding: 6px 6px;
  font-size: .95rem; text-align: center;
  border: 1.5px solid var(--border);
  border-radius: 6px; background: #fff;
  color: var(--text);
  -moz-appearance: textfield;
}
.count-input:focus { outline: none; border-color: var(--blue); }
.count-input::-webkit-inner-spin-button,
.count-input::-webkit-outer-spin-button { -webkit-appearance: none; }

.count-need {
  font-size: .95rem; font-weight: 700;
  text-align: center; color: var(--navy);
}
.count-need.positive { color: var(--red); }
.count-need.zero     { color: var(--green); }

/* Locked par — looks like the input cell but is not editable */
.count-par-locked {
  width: 100%; padding: 6px;
  font-size: .95rem; font-weight: 700;
  text-align: center; color: var(--navy);
  background: var(--blue-lt);
  border: 1.5px solid var(--border);
  border-radius: 6px;
  user-select: none;
}

/* ── Count mode toggle ────────────────────────────────────────────────────── */
.count-mode-bar {
  display: flex;
  padding: 12px 12px 0;
  margin-bottom: 12px;
}

.count-mode-btn {
  flex: 1;
  padding: 11px 8px;
  font-size: .82rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .3px;
  border: 2px solid var(--border);
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all .2s;
  line-height: 1;
}
.count-mode-btn:first-child {
  border-radius: var(--radius) 0 0 var(--radius);
}
.count-mode-btn:last-child {
  border-radius: 0 var(--radius) var(--radius) 0;
  border-left: none;
}
.count-mode-btn.active {
  background: var(--navy);
  border-color: var(--navy);
  color: #fff;
}

/* 5-column layout — PREP mode */
.count-header-row.prep-mode,
.count-item-row.prep-mode {
  grid-template-columns: 1fr 50px 44px 52px 58px;
}

/* ACTION cell — prep mode right column */
.count-action {
  font-size: .8rem; font-weight: 700;
  text-align: center;
  padding: 5px 3px;
  border-radius: 6px;
  line-height: 1.2;
}
.count-action.good  { color: var(--green); }
.count-action.prep  { color: #b7770d; background: #fef9ec; border: 1px solid #f39c12; }
.count-action.order { color: #fff; background: var(--red); padding: 5px 2px; }

/* STATUS cell — service mode right column */
.count-status {
  font-size: .75rem; font-weight: 700;
  text-align: center;
  padding: 4px 8px;
  border-radius: 20px;
  white-space: nowrap;
  line-height: 1.2;
}
.count-status.status-good { color: var(--green); }
.count-status.status-prep { color: #fff; background: #d97706; }
.count-status.status-86   { color: #fff; background: var(--red); }

/* On-hand value display — service mode (read-only, not an input) */
.count-val {
  font-size: .95rem; font-weight: 700;
  text-align: center; color: var(--navy);
}

/* ── Notes section ────────────────────────────────────────────────────────── */
.notes-block {
  margin: 0 0 16px;
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.notes-header {
  background: #34495e;
  color: #fff;
  padding: 10px 14px;
  font-size: .9rem; font-weight: 700;
  letter-spacing: .4px;
}

.notes-inner { padding: 12px 14px; display: flex; flex-direction: column; gap: 10px; }

.note-field {
  display: flex; flex-direction: column; gap: 4px;
}

.note-label {
  font-size: .75rem; color: var(--muted); font-weight: 600; text-transform: uppercase;
}

.note-textarea {
  width: 100%;
  min-height: 72px;
  padding: 10px 12px;
  font-size: .95rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  resize: vertical;
  font-family: inherit;
  color: var(--text);
  background: var(--bg);
}
.note-textarea:focus { outline: none; border-color: var(--blue); }

.notes-meta {
  font-size: .7rem; color: var(--muted); text-align: right;
  padding: 0 14px 10px;
}

/* ── Utility ──────────────────────────────────────────────────────────────── */
.hidden { display: none !important; }

/* loading spinner */
.spinner {
  width: 36px; height: 36px;
  border: 4px solid var(--border);
  border-top-color: var(--blue);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin: 40px auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

.loading-wrap { text-align: center; padding: 40px 0; }
.loading-wrap p { color: var(--muted); font-size: .9rem; margin-top: 10px; }

/* toast */
#toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff;
  padding: 10px 20px; border-radius: 20px;
  font-size: .85rem; font-weight: 600;
  box-shadow: 0 4px 16px rgba(0,0,0,.25);
  opacity: 0; pointer-events: none;
  transition: opacity .25s;
  z-index: 100; white-space: nowrap;
}
#toast.show { opacity: 1; }

/* ── Reason picker (bottom sheet) ─────────────────────────────────────────── */
#reason-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 200;
  align-items: flex-end;
  justify-content: center;
}
#reason-overlay.open { display: flex; }

#reason-sheet {
  background: var(--card);
  border-radius: 18px 18px 0 0;
  width: 100%; max-width: 520px;
  padding: 12px 16px 32px;
  box-shadow: 0 -4px 24px rgba(0,0,0,.18);
}

/* Desktop: center the popup as a dialog instead of a bottom sheet */
@media (min-width: 700px) {
  #reason-overlay { align-items: center; }
  #reason-sheet   { border-radius: 18px; padding-bottom: 16px; }
}

.reason-handle {
  width: 40px; height: 4px;
  background: var(--border);
  border-radius: 2px;
  margin: 0 auto 16px;
}

.reason-title {
  font-size: .8rem; font-weight: 700;
  color: var(--muted); text-transform: uppercase;
  letter-spacing: .4px; margin-bottom: 10px;
  text-align: center;
}

.reason-btn {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 14px 16px;
  margin-bottom: 6px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: .95rem; font-weight: 600;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  transition: background .15s, border-color .15s;
}
.reason-btn:active { background: var(--blue-lt); border-color: var(--blue); }
.reason-btn.done-btn  { border-color: var(--green); color: var(--green); }
.reason-btn.flag-btn  { border-color: #f39c12; color: #b7770d; }
.reason-btn.prog-btn  { border-color: var(--blue); color: var(--blue); }
.reason-btn.crit-btn  { border-color: var(--red); color: var(--red); }

/* Big DONE — the fast path, most taps end here */
.reason-btn.big-done {
  justify-content: center;
  padding: 22px 16px;
  margin-bottom: 12px;
  font-size: 1.2rem; font-weight: 800;
  letter-spacing: .5px;
  background: var(--green);
  border-color: var(--green);
  color: #fff;
}
.reason-btn.big-done:active { background: #1e8e4e; border-color: #1e8e4e; }

.reason-btn-icon { font-size: 1.2rem; flex-shrink: 0; }

.reason-clear {
  display: block; width: 100%; margin-top: 10px;
  padding: 12px; border: none; background: none;
  color: var(--red); font-size: .9rem; font-weight: 600;
  cursor: pointer; text-align: center;
}

/* ── Duties tab ───────────────────────────────────────────────────────────── */

/* Period group divider */
.duties-period-hdr {
  padding: 18px 14px 4px;
  font-size: .7rem; font-weight: 800;
  text-transform: uppercase; letter-spacing: .7px;
  color: var(--muted);
}
.duties-period-hdr:first-child { padding-top: 6px; }

/* Section header colour variants */
.section-header.duties-daily    { background: #2c6e49; } /* forest green */
.section-header.duties-weekly   { background: #1a3a5c; } /* deep blue    */
.section-header.duties-periodic { background: #6d3a9c; } /* purple       */

/* Clock badge */
.duty-clock {
  width: 32px; height: 32px; flex-shrink: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
}
.duty-clock.green  { background: #eafaf1; color: var(--green); }
.duty-clock.yellow { background: #fef9ec; color: #b7770d; }
.duty-clock.red    { background: #fdf0f0; color: var(--red); }

/* ── Recipe viewer (modal) ────────────────────────────────────────────────── */
#recipe-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 300;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#recipe-overlay.open { display: flex; }

#recipe-sheet {
  background: var(--card);
  border-radius: 16px;
  width: 100%; max-width: 560px;
  max-height: 88vh;
  display: flex; flex-direction: column;
  box-shadow: 0 12px 40px rgba(0,0,0,.28);
  overflow: hidden;
}

.recipe-topbar {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 16px 18px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--navy);
  color: #fff;
}
.recipe-heading { flex: 1; min-width: 0; }
.recipe-title {
  font-size: 1.05rem; font-weight: 700; line-height: 1.25;
}
.recipe-subtitle {
  font-size: .75rem; opacity: .7; margin-top: 2px;
}
.recipe-close {
  flex-shrink: 0;
  width: 34px; height: 34px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.15);
  color: #fff; font-size: 1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.recipe-close:active { background: rgba(255,255,255,.3); }

.recipe-body {
  padding: 16px 20px 24px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.recipe-h {
  font-size: .72rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: .5px;
  color: var(--blue);
  margin: 18px 0 6px;
}
.recipe-h:first-child { margin-top: 0; }
.recipe-p {
  font-size: .92rem; line-height: 1.5; color: var(--text);
  margin: 6px 0;
}
.recipe-ul, .recipe-ol {
  margin: 6px 0 6px 1.1rem;
  padding: 0;
}
.recipe-ul li, .recipe-ol li {
  font-size: .92rem; line-height: 1.45; color: var(--text);
  margin: 3px 0;
}
.recipe-note {
  font-size: .85rem; line-height: 1.45;
  color: var(--muted); font-style: italic;
  margin: 14px 0 0;
  padding: 10px 12px;
  background: var(--bg);
  border-radius: 8px;
  border-left: 3px solid var(--border);
}

/* ── Responsive helpers ───────────────────────────────────────────────────── */
@media (min-width: 600px) {
  .sheet-page { max-width: 720px; margin: 0 auto; }
}

/* ══════════════════════════════════════════════════════════════════════════
   RED THEME v2 — gradients · depth · bevel · refined hierarchy
   Appended overrides (win by cascade order). Palette flip lives in :root above.
   ══════════════════════════════════════════════════════════════════════════ */
:root{
  --red-bright:#e23744;
  --red-brand:#c81e2c;
  --red-deep:#8f1420;
  --red-dark:#5c0d16;
  --grad-header: linear-gradient(135deg,#a5182a 0%,#6a0f1b 100%);
  --grad-accent: linear-gradient(135deg,#e23744 0%,#b71b28 100%);
  --bevel-top: inset 0 1px 0 rgba(255,255,255,.20);
  --bevel-bottom: inset 0 -1px 0 rgba(0,0,0,.28);
  --shadow-soft: 0 1px 2px rgba(31,10,14,.06), 0 6px 18px rgba(31,10,14,.10);
  --shadow-pop:  0 2px 4px rgba(31,10,14,.12), 0 12px 30px rgba(120,15,26,.20);
}

/* Warm background wash */
body{
  background:
    radial-gradient(1100px 380px at 50% -8%, #fdeef0 0%, rgba(253,238,240,0) 60%),
    var(--bg);
}

/* Login — burgundy stage + glass card */
#login-screen{
  background:
    radial-gradient(900px 520px at 50% 0%, #a5182a 0%, rgba(165,24,42,0) 55%),
    linear-gradient(160deg,#6a0f1b 0%,#3d0810 100%);
}
.login-card{
  background:linear-gradient(180deg,#ffffff 0%,#fff5f6 100%);
  border:1px solid rgba(255,255,255,.55);
  box-shadow: var(--shadow-pop), var(--bevel-top);
}
.login-logo{ filter: drop-shadow(0 2px 3px rgba(106,15,27,.4)); }
.login-card h1{ color:var(--red-deep); }

/* Primary button — glossy red, bevel + lift */
.btn-primary{
  background: var(--grad-accent);
  box-shadow: var(--bevel-top), 0 4px 14px rgba(200,30,44,.38);
  text-shadow: 0 1px 1px rgba(0,0,0,.28);
}
.btn-primary:active{
  background: linear-gradient(135deg,#c11f2b,#8f1420);
  transform: translateY(1px) scale(.99);
}

/* Top header — gradient bar + embossed title */
.app-header{
  background: var(--grad-header);
  box-shadow: 0 2px 12px rgba(60,8,16,.35), var(--bevel-bottom);
}
.header-title{
  font-size:1.02rem; font-weight:800; letter-spacing:.6px;
  text-shadow: 0 1px 2px rgba(0,0,0,.35);
}

/* Bottom nav — matching gradient, active pill underline */
.bottom-nav{
  background: var(--grad-header);
  box-shadow: 0 -2px 14px rgba(60,8,16,.35), inset 0 1px 0 rgba(255,255,255,.14);
}
.nav-btn{ position:relative; }
.nav-btn.active{ color:#fff; }
.nav-btn.active .nav-icon{ filter: drop-shadow(0 0 5px rgba(255,190,195,.9)); }
.nav-btn.active::after{
  content:''; position:absolute; bottom:6px;
  width:22px; height:3px; border-radius:3px;
  background:linear-gradient(90deg,#ff9aa2,#e23744);
}

/* Cards — softer float */
.section-block{
  box-shadow: var(--shadow-soft);
  border:1px solid rgba(120,15,26,.06);
}

/* Section headers — gradient + bevel + strong embossed hierarchy */
.section-header{
  background: var(--grad-header);
  padding:12px 14px;
  font-size:.86rem; font-weight:800; letter-spacing:.6px; text-transform:uppercase;
  text-shadow:0 1px 2px rgba(0,0,0,.30);
  box-shadow: var(--bevel-top), var(--bevel-bottom);
}
.section-header.foh{ background: linear-gradient(135deg,#b5182b,#7c1020); }
.section-header .timer-badge{
  background: rgba(0,0,0,.20);
  color:#ffe8ea;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.12);
}
.section-progress.complete{ text-shadow:0 1px 1px rgba(0,0,0,.25); }

/* Item text hierarchy: SECTION ▸ core item ▸ item ▸ vendor/price line */
.item-label{ font-size:.96rem; font-weight:600; line-height:1.32; letter-spacing:.1px; }
.item-row.tier-core .item-label{ font-weight:800; }
.item-src{
  font-size:.66rem; color:#9a6a70; letter-spacing:.2px;
  font-variant-numeric: tabular-nums;
}
.item-row:active{ background:#fbe3e5; }
.item-row[data-sheet="prep"]:not(.checked):not(.flagged):not(.critical){
  border-left:3px solid var(--red-brand);
}

/* Focus states → red */
.count-input:focus, .login-card input:focus, .note-textarea:focus{ border-color:var(--red-brand); }

/* Reason picker — on-theme selected/progress states */
.reason-btn:active{ background:#fbe3e5; border-color:var(--red-brand); }
.reason-btn.prog-btn{ border-color:var(--red-brand); color:var(--red-brand); }
