:root {
  color-scheme: light;
  font-size: 18px;
  --ink: #1c140c;
  --paper: #fff3e6;
  --card: #fffaf4;
  --line: #f0c49a;
  --orange: #e85d04;
  --orange-dark: #c2410c;
  --teal: #157a62;
  --teal-dark: #0e5c4a;
  --warn: #c2410c;
  --bad: #9a3412;
  --good: #157a62;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html, body {
  margin: 0;
  min-height: 100%;
}

body {
  font-family: "Segoe UI", system-ui, sans-serif;
  background-color: #140e09;
  background-image: linear-gradient(rgba(20, 14, 9, 0.28), rgba(20, 14, 9, 0.42)), url("gala-poster.jpg");
  background-size: cover;
  background-position: center top;
  background-attachment: fixed;
  color: var(--ink);
  line-height: 1.35;
  overflow-x: hidden;
}

.app-main {
  min-height: 100dvh;
  background: rgba(255, 243, 230, 0.88);
}

button, input, select { font: inherit; font-size: 1.15rem; }

button, .file-btn {
  min-height: 52px;
  border-radius: 14px;
  border: 2px solid transparent;
  padding: 12px 16px;
  width: 100%;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

a.text-button {
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.12s ease, filter 0.12s ease, box-shadow 0.12s ease;
}

button.pressed,
button:active:not(:disabled),
.file-btn.pressed,
.file-btn:active,
a.text-button.pressed,
a.text-button:active {
  transform: translateY(3px) scale(0.96);
  filter: brightness(0.78);
  box-shadow: inset 0 4px 10px rgba(28, 20, 12, 0.35);
}

@media (hover: hover) {
  button:hover:not(:disabled),
  .file-btn:hover,
  a.text-button:hover {
    filter: brightness(1.08);
  }
}

@media (prefers-reduced-motion: reduce) {
  button, .file-btn, a.text-button { transition: none; }
  button.pressed,
  button:active:not(:disabled),
  .file-btn.pressed,
  .file-btn:active,
  a.text-button.pressed,
  a.text-button:active { transform: none; }
}

.primary, .btn-teal { background: var(--teal); color: white; border-color: var(--teal-dark); }
.btn-orange { background: var(--orange); color: white; border-color: var(--orange-dark); }
.sold-veg { background: #157a62; color: #fff; border-color: #0e5c4a; }
.sold-nonveg { background: #c81e1e; color: #fff; border-color: #8f1212; }
.btn-quiet { background: #fff7f0; color: var(--ink); border-color: var(--line); }
.primary:disabled, .btn-teal:disabled, .btn-orange:disabled { background: #c8b8a4; color: #fff; }
.secondary, .file-btn {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}
.text-button {
  width: auto;
  min-height: 44px;
  background: transparent;
  color: var(--teal-dark);
  text-decoration: underline;
  padding: 8px;
}

input, select {
  display: block;
  width: 100%;
  min-height: 58px;
  margin-top: 6px;
  padding: 12px 14px;
  border: 2px solid var(--line);
  border-radius: 12px;
  background: white;
  font-size: 1.2rem;
}

label { display: block; font-weight: 650; margin: 14px 0; font-size: 1.15rem; }

.gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: max(24px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom));
  text-align: center;
}

.gate-message {
  max-width: 16rem;
  margin: 0 auto 12px;
  font-size: 1.45rem;
}

@media (max-width: 820px), (pointer: coarse) {
html.is-mobile #login.screen,
#login.screen {
  min-height: 100dvh;
  min-height: 100svh;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(20px, env(safe-area-inset-top)) 18px max(20px, env(safe-area-inset-bottom));
}

html.is-mobile #login .panel,
#login .panel {
  width: 100%;
  margin: 0;
  padding: 22px 18px;
}

html.is-mobile #login h1,
#login h1 {
  font-size: 2.1rem;
  text-align: center;
  margin-bottom: 16px;
}

html.is-mobile #login label,
#login label {
  font-size: 1.2rem;
}

html.is-mobile #login input,
#login input,
html.is-mobile #login .primary,
#login .primary {
  font-size: 1.25rem;
  min-height: 64px;
}
}

.screen {
  width: 100%;
  max-width: 480px;
  margin-left: auto;
  margin-right: auto;
  padding: max(12px, env(safe-area-inset-top)) 12px max(20px, env(safe-area-inset-bottom));
  text-align: center;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.topbar .text-button { min-height: 44px; }

.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px;
  margin: 0 auto 12px;
  text-align: center;
}

h1, h2, h3 { line-height: 1.2; margin: 0 0 8px; }
h1 { font-size: 1.9rem; }
h2 { font-size: 1.4rem; }
.eyebrow { margin: 0; letter-spacing: .04em; text-transform: uppercase; font-size: .8rem; color: var(--teal-dark); }
#who { margin: 2px 0 0; font-size: .95rem; }
.people-count { margin: 8px auto 0; font-size: 1.6rem; font-weight: 750; line-height: 1.1; text-align: center; }
.taken-row { display: flex; gap: 8px; align-items: center; margin-top: 8px; }
.taken-row input { width: 5.5rem; flex: 0 0 auto; margin-top: 0; }
.variant-list { margin: 8px 0 0; color: #4d463d; word-break: break-word; }
.taken-variant { color: var(--good); font-weight: 750; }
.counter-switch { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qr-view { display: flex; justify-content: center; margin: 8px 0 12px; }
.qr-view svg { width: 180px; height: 180px; background: #fff; }
.day-heading { margin: 14px 0 0; font-size: 14px; font-weight: 750; letter-spacing: .04em; text-transform: uppercase; color: var(--teal-dark); }
button.day-tab {
  width: 100%;
  text-align: left;
  background: var(--teal);
  color: #fff;
  border-color: var(--teal-dark);
}
button.day-tab:disabled { background: #9ca3af; color: #1f2937; border-color: #6b7280; }
.day-checks { display: grid; gap: 8px; margin: 0; padding: 12px; border: 2px solid var(--line); border-radius: 16px; background: var(--card); text-align: left; grid-column: 1 / -1; }
.magazine-head, #magazine-count { display: none !important; }
html.magazine-on .magazine-head { display: flex !important; }
html.magazine-on #magazine-count { display: block !important; }
.magazine-head { align-items: center; justify-content: space-between; gap: 12px; }
.magazine-head h3 { margin: 0; }
.magazine-left { margin: 0; font-size: 1.8rem; font-weight: 800; color: var(--teal-dark); text-align: right; }
.day-check { display: flex; align-items: center; gap: 10px; min-height: 48px; font-weight: 700; }
.day-check input { width: 28px; height: 28px; min-height: 0; margin: 0; }
.all-done { margin: 8px 0 16px; font-size: 4rem; line-height: 1; color: var(--teal); }
#ticket-screen { padding-bottom: 92px; }
.next-scan-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 30;
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
  background: #fff3e6;
  border-top: 2px solid var(--orange);
}
#ticket-screen[hidden] .next-scan-bar { display: none !important; }
.ticket-board { display: grid; gap: 16px; }
.day-block { display: grid; gap: 8px; }
.volunteer-food {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
  align-items: start;
}
.volunteer-food .done-window { margin-top: 0; }
.volunteer-food .item-pills { grid-template-columns: 1fr; }
button.food-revert { min-height: 40px; margin-top: 4px; }
.bhoomi-books { margin-top: 18px; padding-top: 8px; border-top: 1px solid rgba(20, 32, 48, 0.14); }
.buyer-card { margin: 0 0 10px; padding: 12px; border: 1px solid rgba(20, 32, 48, 0.16); border-radius: 12px; background: white; }
.buyer-card p { margin: 0 0 4px; }
.buyer-name { font-size: 1.15rem; font-weight: 700; }
.buyer-email { font-size: 1rem; word-break: break-word; }
.buyer-qty { font-weight: 650; }
.buyer-card button { margin-top: 8px; }
.sale-qty-input { width: 4.5rem; flex: 0 0 auto; font-size: 1.2rem; text-align: center; }
button.bhoomi-remove { min-height: 40px; width: auto; }
.done-window {
  margin-top: 4px;
  padding: 12px;
  border: 2px solid #157a62;
  border-radius: 16px;
  background: #ecfdf5;
  text-align: left;
}
.done-window h3 { margin: 0 0 8px; color: #14532d; font-size: 1.05rem; }
.done-window .item-pill { aspect-ratio: auto; min-height: 76px; }
.done-box { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 8px; font-size: 14px; font-weight: 750; }
.done-box input { width: 22px; height: 22px; min-height: 0; margin: 0; }
.flow-tabs, .page-tabs, .qr-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 8px; }
.page-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.page-tabs button { font-size: 1rem; padding: 10px 8px; }
.tool-tabs, .admin-tabs { grid-template-columns: 1fr 1fr; }
@media (min-width: 720px) {
  .page-tabs { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
#search-matches { display: grid; gap: 8px; margin: 8px 0; }
.search-line label { grid-column: 1 / -1; margin: 0; text-align: left; }
.mic-btn.is-on { background: var(--orange); border-color: var(--orange-dark); color: #fff; }
.letter-board { display: grid; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); gap: 8px; margin: 10px 0; }
.letter-card {
  height: auto;
  min-height: 124px;
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 4px;
  text-align: left;
  white-space: normal;
  background: #fff7f0;
  color: var(--ink);
  border-color: var(--line);
}
.letter-card.is-on { background: var(--teal); color: #fff; border-color: var(--teal-dark); }
.letter-board.is-picked { display: flex; flex-direction: column; align-items: stretch; }
.letter-board.is-picked .letter-card { width: min(220px, 100%); align-self: flex-start; }
.letter-names { width: 100%; margin-top: 8px; }
.letter-card-letter { font-size: 2rem; font-weight: 750; line-height: 1; }
.letter-card-count { font-size: 1.2rem; font-weight: 750; }
.letter-card-detail { font-size: 0.92rem; line-height: 1.3; font-weight: 650; }
.name-row {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: flex-start;
  gap: 6px;
  height: auto;
  font-size: 1.15rem;
  min-height: 58px;
  text-align: left;
}
.name-row-title { font-weight: 750; }
.ticket-snapshot { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.snapshot-entry { font-size: 0.95rem; font-weight: 700; color: #1d4ed8; }
.snapshot-food { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.food-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 0.92rem; font-weight: 700; }
.food-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  display: inline-block;
  flex: 0 0 auto;
  box-shadow: inset 0 0 0 1px rgba(28, 20, 12, 0.25);
}
.qr-actions { grid-template-columns: 1fr; }
.letter-heading { margin: 14px 0 4px; font-weight: 750; color: var(--orange-dark); text-align: left; }
.spinner-row { display: flex; gap: 10px; align-items: center; justify-content: center; margin: 16px 0; }
.spinner { width: 28px; height: 28px; border: 4px solid #f0c49a; border-top-color: var(--orange); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stat-bar { display: grid; grid-template-columns: 7rem 1fr 2rem; gap: 8px; align-items: center; margin: 6px 0; font-size: 13px; }
.stat-bar span:nth-child(2) { display: block; height: 14px; background: #efe4d4; border-radius: 7px; overflow: hidden; }
.stat-bar i { display: block; height: 100%; background: var(--teal); }
.sale-lane { margin: 18px 0 4px; font-size: 1.35rem; }
.sale-day { margin: 10px 0 2px; font-size: 1rem; color: #334155; }
.sale-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 8px 0 16px; }
.sale-tile {
  position: relative;
  height: auto;
  min-height: 96px;
  padding: 12px 12px 34px;
  white-space: normal;
  text-align: left;
  align-items: flex-start;
  justify-content: flex-start;
  font-size: 1.05rem;
  line-height: 1.2;
  color: #fff;
}
.sale-tile-name { display: block; }
.sale-stock-left { display: block; margin-top: 6px; font-size: 1rem; font-weight: 750; }
.sale-stock-row { display: grid; gap: 6px; margin: 0 0 14px; padding: 10px; border: 1px solid #e7d7c3; border-radius: 12px; text-align: left; }
.sale-stock-row input { width: 100%; }
.sale-stock { display: block; margin-top: 6px; font-size: 1rem; font-weight: 750; }
.sold-row { display: grid; grid-template-columns: 1fr 110px 110px; gap: 8px; margin: 0 0 8px; }
#sold-query { width: 100%; margin: 8px 0; }
.sale-letters { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); }
.sale-letters .letter-card { min-height: 72px; align-items: center; text-align: center; }
.sale-qty {
  position: absolute;
  right: 8px;
  bottom: 8px;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 16px;
  background: #111;
  color: #fff;
  font-weight: 750;
  line-height: 32px;
}
.sale-tile.is-picked { outline: 3px solid #111; outline-offset: 1px; }
.checkout-card {
  text-align: left;
  border: 2px solid var(--orange);
  border-radius: 16px;
  padding: 14px;
  margin: 12px 0;
  background: #fff;
}
.checkout-card h2 { margin-bottom: 6px; }
.checkout-line { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 8px 0; }
.checkout-line span { font-size: 1.05rem; font-weight: 650; }
.checkout-line .text-button { width: auto; flex: 0 0 auto; }
.checkout-total { margin: 10px 0 0; font-size: 1.25rem; font-weight: 750; }
.item-pills { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 10px 0; }
.item-pill {
  width: 100%;
  aspect-ratio: 1;
  min-height: 0;
  margin: 0;
  padding: 10px;
  border-radius: 16px;
  color: #fff;
  font-weight: 750;
  line-height: 1.15;
  white-space: pre-line;
}
.item-pill:disabled { opacity: 1; }
.coupon-mutton { background: #7f1d1d; }
.coupon-chicken { background: #f07167; color: #1f2937; }
.coupon-nonveg { background: #b91c1c; }
.coupon-fish { background: #f97316; color: #1f2937; }
.coupon-veg { background: #15803d; }
.coupon-paneer { background: #f3e6c8; color: #3f2e12; }
.coupon-snack { background: #facc15; color: #1f2937; }
.coupon-entry-fri-adult { background: #0f766e; }
.coupon-entry-fri-kids { background: #99f6e4; color: #134e4a; }
.coupon-entry-fri-student { background: #14b8a6; }
.coupon-entry-fri-senior { background: #115e59; }
.coupon-entry-fri-parents { background: #0d9488; }
.coupon-entry-sat-adult { background: #6d28d9; }
.coupon-entry-sat-kids { background: #ddd6fe; color: #4c1d95; }
.coupon-entry-sat-student { background: #8b5cf6; }
.coupon-entry-sat-senior { background: #4c1d95; }
.coupon-entry-sat-parents { background: #7c3aed; }
.coupon-entry-sun-adult { background: #1e40af; }
.coupon-entry-sun-kids { background: #bfdbfe; color: #1e3a8a; }
.coupon-entry-sun-student { background: #3b82f6; }
.coupon-entry-sun-senior { background: #1e3a8a; }
.coupon-entry-sun-parents { background: #2563eb; }
.coupon-food-other { background: #0f766e; }
.item-pill.picked { background: #9ca3af; color: #1f2937; }
.item-pill.semi { filter: grayscale(0.62); opacity: 0.78; }
.topbar #main-page, .topbar .demo-toggle { width: auto; flex: 1; }
.item-pill.other-lane { background: #d1d5db; color: #4b5563; }
.item-pill.not-yet { background: #374151; color: #e5e7eb; }
.card.complete { background: transparent; color: inherit; }
.card.untaken { background: transparent; }
.tone-entry { background: #1d4ed8; }
.tone-sat-veg { background: #7c3aed; }
.tone-sat-nonveg { background: #4c1d95; }
.tone-sun-veg { background: #15803d; }
.tone-sun-nonveg { background: #0f766e; }
.tone-veg { background: #c2410c; }
.tone-nonveg { background: #b91c1c; }
.tone-other { background: #64748b; }
.item-pill.picked { background: #9ca3af; color: #1f2937; }
.item-pill.checked { outline: 3px solid #111; }
.brand-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 14px 16px 16px;
  background: linear-gradient(180deg, #ff7a1a, #e85d04);
  color: #1c140c;
}
.brand-bar img {
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #ff8a2a;
  object-fit: cover;
}
.wordmark {
  margin: 0;
  font-family: "Segoe Script", "Comic Sans MS", cursive;
  font-size: 2.4rem;
  line-height: 1;
  color: #1c140c;
}
.brand-bar .eyebrow { color: #1c140c; }
#search-order, #export-csv, #admin-export-csv, #main-page, #login-form .btn-orange { background: var(--orange); color: #fff; border-color: var(--orange-dark); }
#scan-btn, #refresh, #admin-refresh, #release-locks, #email-csv, #admin-email-csv { background: var(--teal); color: #fff; border-color: var(--teal-dark); }
#cleanup-all { background: #9a3412; color: #fff; border-color: #7c2d12; }
#show-totals, #show-site-totals, label.file-btn { background: #fff; color: var(--teal-dark); border-color: var(--teal); }
.note { color: #5c4632; font-size: 1.05rem; }
.result { font-size: 1.08rem; }
.app-shell { min-height: 100dvh; }
.app-main { margin-left: 0; min-width: 0; max-width: 100%; overflow-x: hidden; }
.legend.is-open ~ .app-main { margin-left: min(300px, 74vw); max-width: calc(100% - min(300px, 74vw)); }
.legend {
  position: fixed;
  left: 0;
  top: 0;
  width: 104px;
  height: 100dvh;
  z-index: 5;
  overflow-x: hidden;
  overflow-y: auto;
  background: #fffaf4;
  border-right: 4px solid var(--orange);
  padding: 8px;
  touch-action: pan-y;
  transition: width .2s ease;
}
.legend.is-open { width: min(300px, 74vw); }
.legend-stack { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.legend-tile {
  width: 100%;
  aspect-ratio: 1;
  margin: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  border-radius: 12px;
  padding: 6px;
  color: #fff;
  font-weight: 750;
  font-size: 13px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}
.legend.is-open .legend-tile { font-size: 26px; padding: 12px; }
.legend-tile.coupon-entry-fri-kids,
.legend-tile.coupon-entry-sat-kids,
.legend-tile.coupon-entry-sun-kids,
.legend-tile.coupon-paneer,
.legend-tile.coupon-snack,
.legend-tile.coupon-chicken,
.legend-tile.coupon-fish,
.legend-tile.swatch-semi,
.legend-tile.swatch-picked,
.legend-tile.swatch-quiet { color: #1f2937; }
.swatch-entry-other { background: hsl(210 48% 36%); }
.swatch-semi { background: #8d8d8d; }
.swatch-picked { background: #9ca3af; }
.swatch-quiet { background: #d1d5db; }
.swatch-later { background: #374151; }
.sheet-panel { min-width: 0; max-width: 100%; }
.sheet-scroll {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  max-height: calc(100dvh - 180px);
  margin-top: 10px;
  overflow-x: scroll;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: auto;
  scrollbar-color: var(--orange-dark) #efe4d4;
}
.sheet-scroll::-webkit-scrollbar { width: 18px; height: 18px; }
.sheet-scroll::-webkit-scrollbar-track { background: #efe4d4; }
.sheet-scroll::-webkit-scrollbar-thumb {
  background: var(--orange-dark);
  border: 3px solid #efe4d4;
  border-radius: 9px;
}
.sheet-scroll::-webkit-scrollbar-corner { background: #efe4d4; }
.sheet-table { border-collapse: collapse; width: 100%; min-width: 100%; font-size: 1.35rem; line-height: 1.35; }
.sheet-table th, .sheet-table td { border: 1px solid var(--line); padding: 12px 14px; text-align: left; white-space: nowrap; vertical-align: top; background: transparent; }
.sheet-table td.sheet-wrap { white-space: normal; overflow-wrap: anywhere; max-width: 16rem; }
.sheet-table td.sheet-name-cell { max-width: 18rem; min-width: 12rem; }
.sheet-table th { position: sticky; top: 0; background: var(--orange); color: #fff; }
.sheet-toolbar { margin: 8px 0; text-align: left; }
.sheet-toolbar label { margin: 0; }
.sheet-table button {
  width: auto;
  min-height: 0;
  padding: 0;
}
.sheet-sort {
  width: auto;
  min-height: 0;
  padding: 4px 6px;
  background: transparent;
  color: inherit;
  border: 0;
  font: inherit;
  font-weight: 750;
  text-align: left;
}
.sheet-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.sheet-table tr.sheet-picked { background-image: linear-gradient(90deg, #86efac var(--pick, 100%), #fffaf4 var(--pick, 100%)); }
.sheet-table tr.sheet-done td { background: #86efac; }
.sheet-edit { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; white-space: normal; }
.sheet-edit button { width: auto; min-height: 36px; }
.login-row { display: grid; gap: 8px; margin: 12px 0; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.ability-set { display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 8px 0; border: 1px solid var(--line); padding: 8px; }
.ability-set label { display: flex; gap: 6px; align-items: center; margin: 0; }
.sheet-table tr.sheet-partial { box-shadow: inset 0 0 0 1px #166534; }
.sheet-table tr.sheet-locked { background: #fde68a; }
.sheet-table tr.sheet-locked td { font-weight: 650; }
.food-stat, .lock-stat, .sale-check { margin: 6px 0; font-size: 1.05rem; font-weight: 650; text-align: left; }
.sale-veg { color: #0e5c4a; }
.sale-nonveg { color: #9f1239; }
.sale-mixed { color: var(--orange-dark); }
.sale-issue { color: var(--bad); font-weight: 750; }
.lock-stat { color: #92400e; }
.today-mark { display: block; margin-top: 2px; font-size: 13px; font-weight: 750; color: #14532d; }
.sheet-name { font-size: 1.7rem; }
.google-sheet-frame { width: 100%; height: 280px; border: 0; background: #fff; }
.google-sheet-link, .google-sales-link { display: block; margin: 8px 0; font-weight: 750; color: var(--teal-dark); }
.sheet-break { background: #fff3e6; font-weight: 750; text-align: left; }
.sheet-name {
  display: block;
  width: 100%;
  min-height: 0;
  padding: 0;
  font-size: 1.7rem;
  font-weight: 750;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
  color: var(--teal-dark);
  text-align: left;
}
.day-actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0; }
.day-actions button { width: auto; }
.backdrop:has(.pay-dialog) { align-items: center; justify-items: center; overflow: auto; }
.pay-dialog { width: min(480px, 100%); max-height: calc(100dvh - 32px); margin: 0 auto; overflow: auto; }
.pay-grid { display: flex; flex-direction: column; align-items: center; gap: 28px; text-align: center; }
.pay-grid section { width: min(100%, 420px); }
.pay-grid h3 { margin: 0 0 8px; }
.pay-qr { position: relative; width: min(100%, 340px); margin: 0 auto; background: #fff; }
.pay-direct, .pay-zelle, .book-pay-qr { width: min(100%, 340px); height: auto; display: block; margin: 0 auto 12px; background: #fff; object-fit: contain; }
.pay-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 22%;
  aspect-ratio: 1;
  transform: translate(-50%, -50%);
  object-fit: cover;
  object-position: center 78%;
  background: #fff;
  border-radius: 50%;
  border: 4px solid #fff;
  box-shadow: 0 0 0 2px #fff;
}
@media (max-width: 820px), (pointer: coarse) {
  .legend { width: 88px; }
  .app-main { margin-left: 0; max-width: 100%; }
  .legend-tile { font-size: 11px; }
  .legend.is-open { width: min(280px, 78vw); }
  .legend.is-open ~ .app-main { margin-left: min(280px, 78vw); max-width: calc(100% - min(280px, 78vw)); }
  .legend.is-open .legend-tile { font-size: 22px; }
}
.more-fold > summary {
  list-style: none;
  cursor: pointer;
  min-height: 60px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--line);
  border-radius: 14px;
  background: #fff7f0;
  font-size: 1.3rem;
  font-weight: 750;
  margin: 8px 0;
}
.more-fold > summary::-webkit-details-marker { display: none; }
.phone-only { display: none; }
@media (max-width: 820px) {
  html.is-phone { font-size: 22px; }
  html.is-phone .app-main,
  html.is-phone .legend.is-open ~ .app-main { margin-left: 0; max-width: 100%; }
  html.is-phone .legend { width: 0; padding: 0; border: 0; overflow: hidden; }
  html.is-phone .legend.is-open {
    width: min(320px, 88vw);
    padding: 12px;
    border-right: 4px solid var(--orange);
    z-index: 20;
    overflow: auto;
  }
  html.is-phone .legend.is-open .legend-tile { aspect-ratio: auto; min-height: 64px; font-size: 1.15rem; }
  html.is-phone .brand-bar { padding: 8px 12px; }
  html.is-phone .brand-bar img { width: 48px; height: 48px; }
  html.is-phone .wordmark { font-size: 1.7rem; }
  html.is-phone .screen { max-width: none; padding-left: 10px; padding-right: 10px; }
  html.is-phone button,
  html.is-phone input,
  html.is-phone select,
  html.is-phone .more-fold > summary { font-size: 1.3rem; }
  html.is-phone input,
  html.is-phone select,
  html.is-phone button { min-height: 64px; }
  html.is-phone .name-row { font-size: 1.35rem; min-height: 72px; }
  html.is-phone .day-heading,
  html.is-phone .done-window h3,
  html.is-phone .done-box { font-size: 1.15rem; }
  html.is-phone .item-pills,
  html.is-phone .sale-tiles { grid-template-columns: 1fr; }
  html.is-phone button.food-revert { min-height: 44px; font-size: 1rem; }
  html.is-phone button.bhoomi-remove { min-height: 44px; font-size: 1rem; }
  html.is-phone .item-pill,
  html.is-phone .sale-tile { aspect-ratio: auto; min-height: 84px; font-size: 1.25rem; }
  html.is-phone .letter-hint,
  html.is-phone #order-breakdown { display: none; }
  html.is-phone .letter-board { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 6px; }
  html.is-phone .letter-card { min-height: 76px; align-items: center; text-align: center; padding: 8px; }
  html.is-phone .letter-card-letter { font-size: 2.1rem; }
  html.is-phone .letter-card-count { font-size: 1.2rem; }
  html.is-phone .letter-card-detail { display: none; font-size: 1.05rem; }
  html.is-phone .letter-card.is-on .letter-card-detail { display: block; }
  html.is-phone .phone-only { display: block; }
  html.is-phone .topbar { flex-wrap: wrap; }
  html.is-phone #ticket-screen .topbar #main-page,
  html.is-phone #ticket-screen .topbar .demo-toggle { width: auto; flex: 1 1 45%; }
}
@media (min-width: 960px) {
  html:not(.is-phone) details.more-fold { display: contents; }
  html:not(.is-phone) details.more-fold > summary { display: none; }
}
.log-scroll {
  max-height: 220px;
  overflow-x: hidden;
  overflow-y: auto;
  text-align: left;
  font-size: 12px;
  line-height: 1.25;
  padding-right: 4px;
}
.log-scroll p { margin: 3px 0; font-size: 12px; word-break: break-word; }
@media (min-width: 960px) {
  #workspace.screen,
  #ticket-screen.screen,
  #sale-screen.screen {
    max-width: 1120px;
  }
  #workspace {
    display: grid;
    grid-template-columns: minmax(300px, 420px) minmax(0, 1fr);
    column-gap: 16px;
    align-items: start;
  }
  #workspace > .topbar,
  #workspace > .page-tabs,
  #workspace > [data-page-panel="entries"],
  #workspace > [data-page-panel="stats"],
  #workspace > [data-page-panel="admin"] {
    grid-column: 1 / -1;
    min-width: 0;
  }
  #workspace > .order-side {
    max-height: calc(100dvh - 140px);
    overflow-y: auto;
    position: sticky;
    top: 8px;
  }
  #ticket-screen .topbar,
  #sale-screen .topbar {
    flex-wrap: wrap;
    justify-content: flex-start;
  }
  #ticket-screen .topbar button,
  #sale-screen .topbar button {
    width: auto;
    flex: 0 1 auto;
    min-width: 128px;
  }
  .item-pills { grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
  .sale-tiles { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }
  .letter-board { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .day-block.has-open {
    grid-template-columns: minmax(0, 1fr) minmax(240px, 320px);
    align-items: start;
  }
  .day-block.has-open > .day-heading { grid-column: 1 / -1; }
  .day-block.has-open > .item-pills { grid-column: 1; }
  .day-block.has-open > .done-window { grid-column: 2; margin-top: 0; }
  #admin-screen.screen {
    max-width: 1180px;
    text-align: left;
    padding: 20px 24px 48px;
  }
  #admin-screen .panel { text-align: left; }
  #admin-screen .topbar { align-items: center; }
  #admin-screen .topbar #admin-print,
  #admin-screen .topbar .text-button { width: auto; flex: 0 0 auto; }
  #admin-screen .admin-tabs { grid-template-columns: repeat(5, 1fr); max-width: 980px; }
  #admin-screen .sheet-scroll { max-height: 72vh; }
  #admin-screen .sheet-table { font-size: 1.35rem; }
  #admin-screen .sheet-name { font-size: 1.7rem; }
  #admin-screen .search-line { grid-template-columns: 1fr 140px 160px; }
  #admin-screen .search-line label { grid-column: auto; }
  #admin-screen .letter-board { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); }
}
@media (min-width: 720px) {
  .search-line { grid-template-columns: 1fr 140px 160px; }
  .search-line label { grid-column: auto; }
  .tool-tabs { grid-template-columns: repeat(4, 1fr); }
}
.print-slips { display: none; }
.guest-qr {
  background: #fff;
  color: var(--ink);
  border-radius: 16px;
  padding: 16px 12px 20px;
  margin: 0 0 16px;
  text-align: center;
}
.guest-qr-lead { font-size: 1.25rem; font-weight: 750; margin: 0 0 8px; }
.guest-qr-meals { font-size: 2rem; font-weight: 800; margin: 0 0 8px; letter-spacing: 0.02em; }
.guest-qr-code { font-size: 1.7rem; font-weight: 800; letter-spacing: 0.04em; margin: 8px 0; }
.guest-qr .qr-view svg { width: min(100%, 320px); height: auto; background: #fff; }
.pill-wrap { display: grid; gap: 4px; }
.pill-print { min-height: 36px; padding: 4px 8px; }
.print-slip { break-inside: avoid; text-align: center; border-top: 1px dashed var(--line); padding-top: 12px; }
.print-slip-name { font-size: 1.4rem; font-weight: 750; margin: 0; }
.print-slip-id, .print-slip-item { margin: 4px 0; }
.print-slip svg { width: min(100%, 220px); height: auto; background: white; }
@media print {
  .legend, .brand-bar, .topbar, .flow-tabs, .page-tabs, button, .note, .log-scroll { display: none !important; }
  .app-main { margin: 0; max-width: 100%; }
  #ticket-screen { display: block !important; }
  body[data-print="sheet"] #ticket-screen { display: none !important; }
  body[data-print="sheet"] .screen[hidden] { display: none !important; }
  body[data-print="sheet"] .screen:not([hidden]) { display: block !important; max-width: none !important; }
  body[data-print="sheet"] .screen:not([hidden]) .sheet-panel { display: block !important; }
  body[data-print="sheet"] .screen:not([hidden]) .panel:not(.sheet-panel) { display: none !important; }
  body[data-print="sheet"] .sheet-frame-wrap,
  body[data-print="sheet"] .google-sheet-link,
  body[data-print="sheet"] .google-sales-link { display: none !important; }
  body[data-print="sheet"] .sheet-scroll { max-height: none !important; overflow: visible !important; }
  body[data-print="sheet"] .sheet-table { font-size: 11pt; }
  body[data-print="sheet"] .sheet-day-note { display: block !important; color: #111; }
  body[data-print="sheet"] .sheet-name { display: inline !important; color: #111; text-decoration: none; }
  body[data-print="sheet"] .sheet-edit,
  body[data-print="sheet"] .cleanup-scans { display: none !important; }
  body[data-print="sheet"] tr.sheet-done td { background: #86efac !important; }
  body[data-print="ticket"] .print-slips { display: block !important; }
  body[data-print="ticket"] .guest-qr { display: none !important; }
  body[data-print="ticket"] #ticket-body:has(.print-slips) > .card { display: none !important; }
  body[data-print="ticket"] .print-slip {
    break-after: page;
    page-break-after: always;
    border: 0;
  }
  body[data-print="sheet"] tr.sheet-picked,
  body[data-print="sheet"] tr.sheet-picked td {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }
}
.wifi-ask {
  margin: 0 0 12px;
  padding: 12px;
  border: 2px solid #1d4ed8;
  border-radius: 12px;
  background: #eff6ff;
  text-align: left;
}
.wifi-ask p { margin: 0 0 8px; font-weight: 700; }
.wifi-ask a { font-weight: 800; }
.row-buttons { display: grid; gap: 10px; margin: 10px 0; }

.result { min-height: 1.2em; margin: 12px 0 0; padding: 10px 12px; border-left: 6px solid transparent; }
.result:empty { display: none; padding: 0; margin: 0; }
.result.recorded { border-color: var(--good); background: #e8f6ec; }
.result.already_seen, .result.pending { border-color: var(--warn); background: #fff4e4; }
.result.invalid, .result.save_failed { border-color: var(--bad); background: #fdecec; }

.card { border-top: 1px solid var(--line); padding: 12px 0; text-align: center; }
.card p { margin: 4px 0; word-break: break-word; }
.order-toggle { font-weight: 750; }
.seen { color: var(--good); font-weight: 700; }
.unseen { color: var(--warn); font-weight: 700; }

#reader {
  width: 100%;
  max-height: 46dvh;
  overflow: hidden;
  border-radius: 12px;
}
#reader video,
#reader img,
#reader canvas {
  width: 100% !important;
  min-height: 240px;
  max-height: 46dvh !important;
  object-fit: contain;
  background: #111;
  border-radius: 12px;
}
#reader__dashboard_section,
#reader__dashboard_section_csr { width: 100% !important; }
#sheet { display: grid; gap: 12px; }
#sheet img, #sheet svg { width: min(100%, 240px); height: auto; background: white; }

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(29, 26, 22, .5);
  display: grid;
  align-items: end;
  padding: 16px;
  padding-bottom: max(16px, env(safe-area-inset-bottom));
}
.backdrop[hidden] { display: none; }
.dialog { background: white; border-radius: 18px; padding: 16px; }

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }

.desk-food-note {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fff7ed;
  border: 2px solid #c2410c;
  text-align: left;
}
.desk-food-note p { margin: 0 0 8px; font-weight: 700; }
.desk-food-note { margin: 0 0 12px; }
.order-food {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fffaf4;
  border: 2px solid #c2410c;
  text-align: left;
}
.order-food h3 { margin: 0 0 8px; font-size: 1.15rem; }
.order-food ul { margin: 0; padding-left: 1.2rem; }
.order-food li { margin: 4px 0; font-weight: 700; }
.archive-list { display: grid; gap: 10px; }
.archive-card { text-align: left; }
.archive-card small { display: block; font-weight: 650; opacity: 0.75; }
.archive-kpis { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin: 12px 0; }
.archive-kpis p { margin: 0; padding: 10px; border-radius: 12px; background: #f4f7f8; }
.archive-kpis strong { display: block; font-size: 1.4rem; }
.archive-table { width: 100%; border-collapse: collapse; margin: 0 0 16px; }
.archive-table th, .archive-table td { padding: 8px 6px; border-bottom: 1px solid rgba(20, 32, 48, 0.12); text-align: left; }
.archive-table th { font-size: 0.92rem; }
.staff-tools { display: grid; grid-template-columns: 1fr; gap: 8px; margin: 8px 0 4px; }
.staff-tools select, .staff-tools input[type="search"] { width: 100%; }
.staff-meta { margin: 4px 0 8px; }
.staff-table th:nth-child(2),
.staff-table th:nth-child(3),
.staff-table th:nth-child(4),
.staff-table td:nth-child(2),
.staff-table td:nth-child(3),
.staff-table td:nth-child(4) { text-align: right; font-variant-numeric: tabular-nums; }
.staff-table .staff-remove { width: auto; min-height: 40px; padding: 6px 10px; font-size: 0.95rem; }
.staff-table tr.staff-odd td { opacity: 0.72; }
@media (min-width: 720px) {
  .staff-tools { grid-template-columns: 1.4fr 1fr auto auto; align-items: center; }
}
.calendar-nav { display: grid; grid-template-columns: auto 1fr auto; gap: 8px; align-items: center; margin: 0 0 12px; }
.calendar-label { margin: 0; text-align: center; font-weight: 750; }
.calendar-weekdays, .calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.calendar-weekdays { margin: 0 0 6px; }
.calendar-weekdays span { text-align: center; font-size: 0.85rem; font-weight: 700; opacity: 0.7; }
.calendar-day {
  min-height: 64px;
  padding: 8px 6px;
  border: 1px solid #d7e0e6;
  border-radius: 12px;
  background: #fff;
  text-align: left;
  display: grid;
  gap: 4px;
  align-content: start;
}
.calendar-day.is-blank { border: 0; background: transparent; min-height: 0; }
.calendar-day.has-event { border-color: #0e7c7b; background: #e5f4f3; }
.calendar-day.is-selected { outline: 2px solid #d4762c; }
.calendar-day strong { font-size: 1rem; }
.calendar-day small { font-size: 0.72rem; line-height: 1.2; font-weight: 650; opacity: 0.85; }
.calendar-event-card { padding: 12px; border: 1px solid #e7d7c3; border-radius: 12px; background: #fffaf4; }
.analytics-filters, .catalog-form {
  display: grid;
  gap: 10px;
  margin: 0 0 14px;
}
@media (min-width: 720px) {
  .analytics-filters { grid-template-columns: 1.4fr 1fr 0.8fr 0.8fr 0.8fr auto; align-items: end; }
  .catalog-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-form button { grid-column: 1 / -1; justify-self: start; }
  #admin-screen .admin-tabs { grid-template-columns: repeat(5, 1fr); max-width: 980px; }
}
