:root {
  color-scheme: light;
  --ink: #30221b;
  --muted: #72645b;
  --accent: #a63d19;
  --accent-dark: #873113;
  --accent-soft: #fae9dc;
  --cream: #fff9f1;
  --line: #ead6c4;
  --admin-bg: #f6f3ee;
  --admin-line: #eae2d7;
  --white: #fff;
  --green: #2a6a4b;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
  color: var(--ink);
  font-synthesis: none;
}

*, *::before, *::after { box-sizing: border-box; }
body, h1, h2, h3, p { margin: 0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: default; }
a { color: var(--accent); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid #a63d1980; outline-offset: 2px; }
.primary {
  min-height: 46px;
  border: 1px solid var(--accent);
  border-radius: 11px;
  padding: 9px 17px;
  background: var(--accent);
  color: var(--white);
  font-weight: 700;
}
.primary:hover:not(:disabled) { background: var(--accent-dark); }
.primary:disabled { color: #765d4d; background: #eadbce; border-color: #eadbce; }
.text-button {
  border: 0;
  padding: 7px 0;
  background: transparent;
  color: var(--accent);
  white-space: nowrap;
}
.text-button:hover { text-decoration: underline; }
.text-button:disabled { opacity: .6; }
.notice, .feedback {
  margin-top: 14px;
  padding: 11px 12px;
  border-radius: 8px;
  color: #802c14;
  background: #fae9dc;
  font-size: 14px;
  overflow-wrap: anywhere;
}
.feedback[data-type="success"] { color: #225b40; background: #e6f1e9; }

.order-page { background: #f5eee5; }
.order-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
  max-width: 480px;
  margin: 0 auto;
  background: var(--cream);
}
.order-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(14px, env(safe-area-inset-top)) 19px 0;
}
.wordmark { position: relative; font-size: 28px; line-height: 1.25; font-weight: 800; }
.wordmark::after {
  content: "";
  position: absolute;
  left: 29%;
  right: 10%;
  bottom: -7px;
  height: 6px;
  border-top: 3px solid #cf7b23;
  border-radius: 50%;
  transform: rotate(-3deg);
}
.refresh { display: inline-flex; align-items: center; gap: 3px; font-size: 14px; }
.order-main { flex: 1; padding: 29px 17px 26px; }
.order-main h1 { font-size: clamp(23px, 8vw, 30px); font-weight: 800; line-height: 1.22; letter-spacing: -.03em; }
.cutoff { margin-top: 8px; color: var(--accent); font-size: 20px; font-weight: 750; line-height: 1.3; }
.identity-form { margin-top: 24px; }
.identity-form h2 { margin-bottom: 25px; font-size: 28px; line-height: 1.25; }
.identity-form label { display: block; margin-bottom: 10px; font-size: 19px; font-weight: 750; }
.identity-form input {
  display: block;
  width: 100%;
  min-height: 48px;
  margin-bottom: 23px;
  border: 1px solid #d7a389;
  border-radius: 10px;
  padding: 9px 15px;
  color: var(--ink);
  background: transparent;
  font-size: 16px;
}
.identity-form input::placeholder { color: #76685f; }
.identity-form .primary { width: 100%; margin-top: 13px; font-size: 20px; }
.identity-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  min-height: 55px;
  margin-top: 5px;
  font-size: 15px;
}
.verified { display: grid; place-items: center; width: 19px; height: 19px; border-radius: 50%; background: var(--accent); color: #fff; }
.person { font-weight: 700; overflow-wrap: anywhere; }
.order-state { padding-left: 9px; border-left: 1px solid var(--line); color: var(--muted); }
.identity-strip .text-button { margin-left: auto; font-size: 12px; }
.location-row, .meal-content, .quantity-row { border-top: 1px solid var(--line); }
.location-row, .quantity-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 17px 0; }
.location-row h2, .meal-content h2, .quantity-row label { font-size: 20px; line-height: 1.25; font-weight: 800; }
.location-row h2, .quantity-row label { flex-shrink: 0; }
.location-row p { text-align: right; font-weight: 650; overflow-wrap: anywhere; }
.meal-content { padding: 20px 0 24px; }
.dish-list { margin: 8px 0 0; padding: 0; list-style: none; overflow-wrap: anywhere; }
.dish-list li + li { margin-top: 4px; }
.meal-content .dish-list { margin-top: 12px; font-size: 16px; line-height: 1.55; }
.stepper { display: flex; align-items: stretch; border: 1px solid #d6a18a; border-radius: 9px; overflow: hidden; }
.stepper button { min-width: 45px; min-height: 42px; padding: 0 9px; border: 0; font-size: 25px; font-weight: 700; }
.stepper button:first-child { color: var(--accent); background: var(--accent-soft); }
.stepper button:last-child { color: white; background: var(--accent); }
.stepper button:disabled { color: #826f63; background: #f4e9df; }
.stepper input {
  width: 58px;
  min-width: 0;
  padding: 3px;
  border: 0;
  border-inline: 1px solid #d6a18a;
  background: transparent;
  color: var(--ink);
  font-size: 19px;
  font-weight: 750;
  text-align: center;
  font-variant-numeric: tabular-nums;
}
.stepper :focus-visible { outline-offset: -3px; }
.submitted, .previous { color: var(--muted); font-size: 13px; line-height: 1.6; }
.order-receipt {
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 18px 12px 12px;
  border-block: 1px solid var(--line);
  text-align: center;
  scroll-margin-block: 12px;
}
.receipt-check {
  display: grid;
  width: 39px;
  height: 39px;
  place-items: center;
  border: 2px solid var(--green);
  border-radius: 50%;
  color: var(--green);
}
.order-receipt h2 { font-size: 27px; line-height: 1.2; }
.receipt-quantity { color: var(--muted); font-size: 16px; font-weight: 650; overflow-wrap: anywhere; }
.receipt-quantity strong { color: var(--accent); font-size: 21px; }
.previous summary { cursor: pointer; color: var(--accent); }
.previous p { overflow-wrap: anywhere; }
.cancel-order { min-height: 44px; font-size: 14px; }
.order-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 11px 12px max(11px, env(safe-area-inset-bottom));
  border-top: 1px solid #f1e4d8;
  background: var(--cream);
}
.order-footer span { min-width: 0; flex: 0 1 36%; padding-left: 5px; font-size: 17px; font-weight: 750; overflow-wrap: anywhere; }
.order-footer strong { color: var(--accent); font-size: 23px; }
.order-footer .primary { flex: 1; min-width: 130px; min-height: 48px; font-size: 20px; }
@media (max-width: 350px) {
  .order-main, .order-header { padding-inline: 13px; }
  .order-footer { gap: 10px; }
  .order-main h1 { font-size: 24px; }
}

.admin-page { min-height: 100vh; background: var(--admin-bg); font-size: 14px; }
.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 56px;
  padding: 8px 22px;
  border-bottom: 1px solid var(--admin-line);
  background: var(--white);
}
.admin-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-weight: 800; text-decoration: none; }
.admin-brand span { display: grid; place-items: center; width: 29px; height: 29px; border-radius: 8px; color: #fff; background: var(--accent); }
.account { display: flex; align-items: center; gap: 14px; }
.account .text-button { padding-left: 12px; border-left: 1px solid var(--admin-line); }
.admin-workspace { display: grid; grid-template-columns: 188px minmax(0, 1fr); min-height: calc(100vh - 56px); }
.admin-nav {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 15px 12px;
  border-right: 1px solid var(--admin-line);
  background: #fbf9f5;
}
.admin-nav a { display: block; padding: 11px 13px; border-radius: 8px; color: #575049; text-decoration: none; }
.admin-nav a:hover { background: var(--accent-soft); }
.admin-nav a[aria-current="page"] { color: var(--accent); background: #fff; font-weight: 750; }
.admin-main { min-width: 0; padding: 18px 22px 30px; }
.admin-main > .feedback { margin: 0 0 12px; }
.admin-card { border: 1px solid var(--admin-line); border-radius: 11px; background: var(--white); }
.login-shell { display: grid; min-height: calc(100vh - 56px); place-items: center; padding: 20px; }
.login-shell form { width: min(100%, 380px); padding: 27px; }
.login-shell h1 { font-size: 23px; }
.page-heading { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.page-heading h1 { font-size: 21px; }
.page-heading p { margin-top: 4px; color: var(--muted); font-size: 13px; }
.admin-page .primary, .secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 7px 13px;
  border-radius: 8px;
  font-size: 13px;
  text-decoration: none;
  white-space: nowrap;
}
.secondary { border: 1px solid #d5ccbd; background: #fff; color: #51463d; }
.secondary:hover:not(:disabled) { background: #fff4e8; }
.secondary:disabled { opacity: .5; }
.stats { display: grid; grid-template-columns: 1fr 1fr 1.3fr; gap: 12px; margin-bottom: 13px; }
.stat { display: grid; gap: 4px; padding: 12px 15px; }
.stat > span, .stat small { color: var(--muted); font-size: 12px; }
.stat strong { font-size: 25px; }
.stat strong small { margin-left: 5px; font-weight: 500; }
.stat .stat-status { color: var(--accent); font-size: 16px; }
.admin-form { display: grid; gap: 14px; }
.admin-form label, .filters label { display: grid; gap: 6px; color: #51463d; font-size: 13px; font-weight: 650; }
.admin-form input, .admin-form select, .admin-form textarea, .filters input, .filters select {
  min-height: 36px;
  min-width: 0;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #dcd1c2;
  border-radius: 8px;
  color: var(--ink);
  background: var(--white);
  font-weight: 400;
}
.admin-form textarea { resize: vertical; }
.admin-form .feedback { margin-top: 0; }
.filters { display: flex; align-items: end; flex-wrap: wrap; gap: 10px; padding: 12px; margin-bottom: 13px; }
.filters label { width: 128px; }
.filters label:has([name="location"]), .filters label:has([name="kind"]) { width: 160px; }
.filter-actions { display: flex; gap: 7px; }
.table-wrap { overflow: auto; }
.table-wrap table { width: 100%; border-collapse: collapse; text-align: left; }
.table-wrap th, .table-wrap td { padding: 10px 12px; vertical-align: middle; }
.table-wrap th { background: #f1ece3; color: #62584f; font-size: 12px; font-weight: 700; white-space: nowrap; }
.table-wrap td { border-top: 1px solid #f0ebe4; font-size: 13px; overflow-wrap: anywhere; }
.table-wrap tbody tr:hover { background: #fffbf7; }
.table-wrap .table-empty { padding: 24px; color: var(--muted); text-align: center; }
.number, .code { font-weight: 700; font-variant-numeric: tabular-nums; }
.muted { color: var(--muted); }
.badge { display: inline-block; padding: 3px 8px; border-radius: 6px; background: #f1ece5; color: #62584f; font-size: 12px; white-space: nowrap; }
.badge.good { background: #e8f3eb; color: var(--green); }
.actions { white-space: nowrap; }
.actions button + button { margin-left: 9px; }
.pager { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 12px; color: var(--muted); font-size: 13px; }
.pager button + button { margin-left: 5px; }
.table-heading { margin: 15px 0 9px; font-size: 17px; }
.report-rule { margin-top: 9px; color: var(--muted); font-size: 13px; }

.menu-calendar-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(275px, 31%); gap: 15px; align-items: start; }
.menu-calendar { min-width: 0; padding: 12px; }
.menu-calendar-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 12px;
  padding: 2px 2px 12px;
}
.menu-calendar-toolbar strong { color: var(--ink); font-size: 16px; font-variant-numeric: tabular-nums; }
.menu-calendar-toolbar .menu-today-button { color: var(--accent); border-color: #d7a389; }
.menu-calendar-scroll { overflow: auto; border: 1px solid var(--admin-line); border-radius: 8px; }
.menu-calendar-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); min-width: 672px; }
.menu-weekday { background: #f1ece3; color: #51463d; font-weight: 700; padding: 9px 3px; text-align: center; }
.menu-day {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  min-height: 143px;
  padding: 11px 9px;
  border: 0;
  border-top: 1px solid var(--admin-line);
  border-right: 1px solid var(--admin-line);
  background: var(--white);
  color: var(--ink);
  text-align: left;
  overflow-wrap: anywhere;
}
.menu-day:nth-child(7n) { border-right: 0; }
.menu-day:hover { background: #fffbf7; }
.menu-day[aria-pressed="true"] { position: relative; background: #fff3e8; box-shadow: inset 0 0 0 1px var(--accent); }
.menu-day:focus-visible { outline-offset: -3px; }
.menu-day-heading { display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.menu-day-heading strong { font-size: 14px; }
.menu-today, .menu-badge { padding: 2px 5px; border-radius: 5px; font-size: 11px; line-height: 1.4; }
.menu-today { background: var(--accent-soft); color: var(--accent); }
.menu-badge { background: #f1ece5; color: #62584f; }
.menu-badge.configured { color: #fff; background: var(--accent); }
.menu-badge.inherited { color: var(--green); background: #e8f3eb; }
.menu-day-dish { font-size: 13px; line-height: 1.45; }
.menu-day-empty { color: var(--muted); font-size: 12px; }
.menu-editor { min-width: 0; padding: 16px; }
.menu-editor h2 { margin-bottom: 14px; font-size: 17px; }
.menu-editor-source, .menu-impact { color: var(--muted); font-size: 13px; line-height: 1.5; }
.menu-editor-source { margin-bottom: 12px; }
.menu-dish-rows { display: grid; gap: 8px; }
.menu-dish-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 6px; }
.menu-sort { display: flex; gap: 2px; }
.menu-sort button, .menu-remove {
  min-width: 23px;
  min-height: 31px;
  padding: 0 3px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #64564d;
}
.menu-sort button:disabled { color: #b9aaa0; }
.menu-sort button:not(:disabled):hover, .menu-remove:hover { background: var(--accent-soft); }
.menu-remove { font-size: 19px; }
.menu-add { justify-self: start; }
.menu-impact { border-top: 1px solid var(--admin-line); padding-top: 13px; }
@media (max-width: 1270px) {
  .menu-calendar-layout { grid-template-columns: minmax(0, 1fr); }
}

.editor {
  width: min(440px, calc(100vw - 28px));
  max-height: calc(100dvh - 36px);
  margin: min(105px, 10vh) min(52px, 5vw) auto auto;
  border: 1px solid var(--admin-line);
  border-radius: 13px;
  padding: 17px;
  color: var(--ink);
  background: var(--white);
  box-shadow: 0 22px 55px #30221b31;
}
.editor::backdrop { background: #30221b44; }
.editor-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--admin-line); padding-bottom: 7px; }
.editor-heading h2 { font-size: 18px; }
.editor-actions { display: flex; justify-content: end; gap: 9px; }
.order-context { font-weight: 700; }
.order-facts { display: grid; grid-template-columns: max-content minmax(0, 1fr); gap: 8px 16px; margin: 0; }
.order-facts dt { color: var(--muted); }
.order-facts dd { margin: 0; overflow-wrap: anywhere; }
@media (max-width: 760px) {
  .admin-workspace { grid-template-columns: minmax(0, 1fr); }
  .admin-nav { flex-direction: row; overflow: auto; border-right: 0; border-bottom: 1px solid var(--admin-line); }
  .admin-nav a { white-space: nowrap; }
  .admin-main { padding-inline: 12px; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats .stat:last-child { grid-column: 1 / -1; }
  .actions { min-width: 114px; }
}
