:root {
  color-scheme: light;
  --bg: #f7f3ec;
  --surface: #fffaf2;
  --surface-strong: #ffffff;
  --text: #261f1a;
  --muted: #7b6c5f;
  --line: #e8ddce;
  --accent: #d94d37;
  --accent-dark: #b73725;
  --green: #2f7d62;
  --yellow: #f2c14e;
  --shadow: 0 12px 30px rgba(68, 41, 20, 0.12);
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(180deg, rgba(242, 193, 78, 0.2), transparent 230px),
    var(--bg);
  color: var(--text);
}

button,
textarea,
a {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

.app-shell {
  width: min(100%, 520px);
  min-height: 100vh;
  margin: 0 auto;
  padding: max(18px, env(safe-area-inset-top)) 16px 28px;
}

.hero {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  justify-content: space-between;
  padding: 12px 2px 18px;
}

.eyebrow,
.muted,
.canteen {
  color: var(--muted);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(217, 77, 55, 0.22);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent-dark);
  font-weight: 700;
  margin: 0 0 8px;
  font-size: 13px;
}

.hero-note {
  max-width: 340px;
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  max-width: 360px;
  margin-bottom: 0;
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 0;
  font-size: 20px;
}

h3 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.25;
}

.admin-link,
.back-link,
.quiet-button {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--text);
  text-decoration: none;
  white-space: nowrap;
}

.admin-link,
.back-link {
  padding: 9px 13px;
}

.quiet-button {
  padding: 9px 12px;
}

.view {
  display: none;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: max(22px, env(safe-area-inset-bottom));
  z-index: 20;
  max-width: min(88vw, 360px);
  padding: 11px 14px;
  border-radius: 999px;
  background: var(--text);
  color: white;
  box-shadow: var(--shadow);
  font-size: 14px;
  text-align: center;
  transform: translate(-50%, 18px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

.view.is-active {
  display: block;
}

.category-bar {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 2px -16px 18px;
  padding: 0 16px 4px;
  scrollbar-width: none;
}

.category-bar::-webkit-scrollbar {
  display: none;
}

.category-button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--muted);
}

.category-button.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: white;
}

.section-heading,
.admin-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading {
  margin-bottom: 12px;
}

.section-heading span {
  color: var(--muted);
  font-size: 14px;
}

.dish-list,
.order-list {
  display: grid;
  gap: 12px;
}

.dish-card,
.order-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-strong);
  box-shadow: var(--shadow);
}

.dish-card {
  display: grid;
  grid-template-columns: 132px 1fr;
  min-height: 152px;
}

.dish-image {
  width: 100%;
  height: 100%;
  min-height: 152px;
  object-fit: cover;
  background: linear-gradient(135deg, #efe4d4, #f8f0e4);
}

.dish-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 12px;
}

.dish-title-row {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.dish-title-row h3 {
  min-width: 0;
}

.dish-title-row strong,
.price {
  color: var(--accent-dark);
}

.canteen {
  margin: 6px 0 9px;
  font-size: 13px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.tag {
  padding: 4px 7px;
  border-radius: 999px;
  background: #f1eadf;
  color: #66584c;
  font-size: 12px;
}

.want-button,
.primary-button {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: var(--text);
  color: white;
}

.want-button {
  margin-top: auto;
}

.primary-button {
  width: 100%;
  margin-top: 12px;
  background: var(--accent);
  font-weight: 700;
}

.admin-top {
  margin: 8px 0 22px;
}

.admin-heading {
  align-items: flex-end;
}

.order-card {
  padding: 13px;
}

.order-card time {
  display: block;
  margin-bottom: 7px;
  color: var(--muted);
  font-size: 13px;
}

.order-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.order-card p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.empty-state {
  padding: 34px 18px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255, 250, 242, 0.72);
  color: var(--muted);
  text-align: center;
}

.order-dialog {
  width: min(92vw, 420px);
  padding: 0;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

.order-dialog::backdrop {
  background: rgba(24, 18, 13, 0.45);
  backdrop-filter: blur(6px);
}

.dialog-panel {
  position: relative;
  overflow: hidden;
  margin: 0;
  border-radius: 12px;
  background: var(--surface-strong);
}

.dialog-panel img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #efe4d4;
}

.icon-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--text);
  font-size: 24px;
  line-height: 1;
}

.dialog-content {
  padding: 16px;
}

.dialog-content label {
  display: block;
  margin: 14px 0 8px;
  font-weight: 700;
}

textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  background: var(--surface);
  color: var(--text);
  line-height: 1.5;
}

@media (max-width: 390px) {
  .app-shell {
    padding-inline: 12px;
  }

  .category-bar {
    margin-inline: -12px;
    padding-inline: 12px;
  }

  h1 {
    font-size: 25px;
  }

  .dish-card {
    grid-template-columns: 112px 1fr;
  }
}
