@font-face {
  font-family: "Menu Kai";
  src: url("assets/lxgw-wenkai-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Menu Kuaile";
  src: url("assets/zcool-kuaile-subset.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #fff8e9;
  --paper-deep: #f6e8d2;
  --card: #fffdf7;
  --ink: #302821;
  --ink-soft: #6c6054;
  --tomato: #d84b34;
  --tomato-deep: #9f2d20;
  --tomato-wash: #f8d9ce;
  --yolk: #f4b638;
  --yolk-wash: #fbe9b9;
  --green: #34724b;
  --green-wash: #dfe9d8;
  --line: #d8c4a5;
  --shadow: rgba(48, 40, 33, 0.16);
  --font-body: "Menu Kai", "PingFang SC", "Hiragino Sans GB", sans-serif;
  --font-display: "Menu Kuaile", "Menu Kai", "PingFang SC", sans-serif;
  --shell: 520px;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  -webkit-text-size-adjust: 100%;
  background: var(--paper);
}

body {
  min-width: 320px;
  margin: 0;
  color: var(--ink);
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 7%, rgba(244, 182, 56, 0.2), transparent 24%),
    radial-gradient(circle at 92% 34%, rgba(52, 114, 75, 0.1), transparent 24%),
    linear-gradient(rgba(216, 75, 52, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(216, 75, 52, 0.025) 1px, transparent 1px);
  background-size: auto, auto, 28px 28px, 28px 28px;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.is-locked {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible {
  outline: 3px solid var(--green);
  outline-offset: 2px;
}

button:disabled {
  cursor: default;
}

svg {
  display: block;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.page-shell {
  position: relative;
  width: min(100%, var(--shell));
  min-height: 100dvh;
  margin: 0 auto;
  padding-top: env(safe-area-inset-top);
  overflow: clip;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 12px;
}

.brand-kicker {
  margin: 0 0 1px;
  color: var(--green);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.2em;
}

.brand h1 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 9vw, 39px);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: 0.02em;
}

.brand h1 span {
  color: var(--tomato);
}

.child-switch {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 88px;
  min-height: 44px;
  padding: 8px 13px 8px 10px;
  border: 1.7px solid var(--ink);
  border-radius: 14px;
  background: var(--card);
  box-shadow: 2px 3px 0 var(--shadow);
  font-size: 15px;
  font-weight: 700;
  transition:
    transform 160ms ease,
    background 160ms ease,
    color 160ms ease,
    box-shadow 160ms ease;
}

.switch-box {
  display: grid;
  width: 20px;
  height: 20px;
  place-items: center;
  border: 1.7px solid currentColor;
  border-radius: 6px;
  background: var(--paper);
  transition:
    background 160ms ease,
    color 160ms ease;
}

.switch-box svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.2;
  opacity: 0;
  transform: scale(0.6) rotate(-8deg);
  transition:
    opacity 140ms ease,
    transform 180ms ease;
}

.child-switch[aria-checked="true"] {
  color: var(--card);
  background: var(--green);
  border-color: var(--ink);
  box-shadow: 2px 3px 0 var(--ink);
}

.child-switch[aria-checked="true"] .switch-box {
  color: var(--green);
  background: var(--card);
}

.child-switch[aria-checked="true"] .switch-box svg {
  opacity: 1;
  transform: scale(1) rotate(0);
}

.child-switch:active {
  transform: translate(1px, 2px);
  box-shadow: 1px 1px 0 var(--shadow);
}

.view {
  animation: view-in 260ms ease both;
}

#drawView {
  padding-bottom: calc(102px + env(safe-area-inset-bottom));
}

.hero-card {
  position: relative;
  min-height: 158px;
  margin: 2px 16px 16px;
  padding: 20px 18px 13px;
  overflow: visible;
  border: 2px solid var(--ink);
  border-radius: 22px 22px 16px 22px;
  background:
    radial-gradient(circle at 88% 15%, rgba(255, 253, 247, 0.58), transparent 30%),
    linear-gradient(135deg, #f8d9bf 0%, #f6cda9 100%);
  box-shadow: 4px 5px 0 var(--shadow);
}

.hero-card::after {
  position: absolute;
  right: 15px;
  bottom: 12px;
  width: 74px;
  height: 9px;
  content: "";
  border-top: 2px solid rgba(48, 40, 33, 0.16);
  border-bottom: 2px solid rgba(48, 40, 33, 0.12);
  transform: rotate(-4deg);
}

.hero-tape {
  position: absolute;
  z-index: 2;
  top: -10px;
  left: 30px;
  width: 82px;
  height: 24px;
  border-right: 1px solid rgba(159, 45, 32, 0.22);
  border-left: 1px solid rgba(159, 45, 32, 0.22);
  background:
    repeating-linear-gradient(
      90deg,
      rgba(255, 255, 255, 0.32) 0 5px,
      transparent 5px 10px
    ),
    #e7a339;
  opacity: 0.92;
  transform: rotate(-3deg);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: 66%;
  padding-right: 8px;
}

.hero-eyebrow {
  display: inline-block;
  margin: 0 0 7px;
  padding: 2px 8px;
  border: 1px solid rgba(48, 40, 33, 0.42);
  border-radius: 999px;
  background: rgba(255, 253, 247, 0.46);
  color: var(--tomato-deep);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.45;
}

.hero-lead {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(19px, 5.3vw, 22px);
  line-height: 1.4;
}

.hero-foot {
  margin: 8px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.45;
}

.hero-doodle {
  position: absolute;
  z-index: 1;
  top: 16px;
  right: -1px;
  width: 128px;
  height: 112px;
  transform: rotate(4deg);
}

.hero-doodle svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.hero-doodle .steam {
  fill: none;
  stroke: var(--green);
  stroke-linecap: round;
  stroke-width: 2.5;
  opacity: 0.7;
}

.hero-stats {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 8px;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1.5px dashed rgba(48, 40, 33, 0.35);
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.4;
}

.hero-stats strong {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 400;
}

.stat-dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--tomato);
}

.meal-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin: 0 16px;
}

.meal-tab {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  column-gap: 7px;
  min-height: 58px;
  padding: 8px 7px 7px;
  border: 1.5px solid transparent;
  border-radius: 15px;
  background: transparent;
  color: var(--ink-soft);
  transition:
    transform 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    box-shadow 150ms ease;
}

.meal-tab:hover {
  background: rgba(255, 253, 247, 0.52);
}

.meal-tab.is-active {
  color: var(--ink);
  background: var(--card);
  border-color: var(--ink);
  box-shadow: 3px 3px 0 var(--shadow);
  transform: translateY(-1px);
}

.meal-mark {
  display: grid;
  grid-row: 1 / span 2;
  width: 30px;
  height: 30px;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 9px;
  background: var(--paper-deep);
  font-family: var(--font-display);
  font-size: 17px;
  line-height: 1;
}

[data-meal="breakfast"] .meal-mark {
  background: var(--yolk-wash);
}

[data-meal="lunch"] .meal-mark {
  background: var(--tomato-wash);
}

[data-meal="dinner"] .meal-mark {
  background: var(--green-wash);
}

.meal-name {
  align-self: end;
  text-align: left;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
}

.meal-count {
  align-self: start;
  color: var(--ink-soft);
  font-size: 10px;
  line-height: 1.2;
  text-align: left;
}

.draw-stage {
  position: relative;
  margin: 14px 16px 0;
  padding-bottom: 7px;
}

.card-stack {
  position: absolute;
  inset: 8px 8px -1px;
  z-index: 0;
  pointer-events: none;
}

.card-stack span {
  position: absolute;
  inset: 0;
  border: 1.5px solid rgba(48, 40, 33, 0.66);
  border-radius: 21px;
  background: #f4dfc3;
}

.card-stack span:first-child {
  transform: rotate(-2.1deg) translate(-2px, 2px);
}

.card-stack span:last-child {
  background: #efd0b2;
  transform: rotate(1.7deg) translate(2px, 3px);
}

.draw-stage.has-result .card-stack {
  opacity: 0.58;
}

.menu-card {
  --meal-accent: var(--tomato);
  position: relative;
  z-index: 2;
  min-height: 260px;
  padding: 19px 18px 18px;
  overflow: hidden;
  border: 2px solid var(--ink);
  border-radius: 21px;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    repeating-linear-gradient(
      0deg,
      transparent 0 30px,
      rgba(216, 75, 52, 0.035) 30px 31px
    );
  box-shadow:
    inset 0 5px 0 var(--meal-accent),
    5px 6px 0 var(--shadow);
  transform: rotate(-0.25deg);
  scroll-margin-top: 14px;
}

.menu-card[data-meal="breakfast"] {
  --meal-accent: var(--yolk);
}

.menu-card[data-meal="lunch"] {
  --meal-accent: var(--tomato);
}

.menu-card[data-meal="dinner"] {
  --meal-accent: var(--green);
}

.menu-card.is-shuffling {
  animation: shuffle-card 560ms cubic-bezier(0.22, 0.76, 0.3, 1);
}

.card-notch {
  position: absolute;
  z-index: 3;
  top: 51%;
  width: 18px;
  height: 18px;
  border: 1.5px solid var(--ink);
  border-radius: 50%;
  background: var(--paper);
}

.card-notch-left {
  left: -11px;
}

.card-notch-right {
  right: -11px;
}

.card-empty {
  display: flex;
  min-height: 220px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.empty-stamp {
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  margin-bottom: 13px;
  border: 2px dashed var(--tomato);
  border-radius: 50%;
  color: var(--tomato);
  font-family: var(--font-display);
  font-size: 33px;
  line-height: 1;
  transform: rotate(-7deg);
}

.empty-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.4;
}

.empty-copy {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 13px;
}

.empty-lines {
  display: grid;
  width: min(210px, 72%);
  gap: 7px;
  margin-top: 20px;
  opacity: 0.56;
}

.empty-lines span {
  height: 2px;
  border-radius: 99px;
  background: var(--line);
}

.empty-lines span:nth-child(2) {
  width: 84%;
  justify-self: center;
}

.empty-lines span:nth-child(3) {
  width: 63%;
  justify-self: center;
}

.card-result {
  animation: result-in 360ms cubic-bezier(0.24, 0.86, 0.32, 1) both;
}

.result-topline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--ink-soft);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.result-source {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink-soft);
  letter-spacing: 0;
}

.result-source::before {
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: var(--meal-accent);
}

.result-number {
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.result-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 13px 0 12px;
  padding-bottom: 10px;
  border-bottom: 1.5px dashed var(--line);
}

.result-meal {
  font-family: var(--font-display);
  font-size: 33px;
  line-height: 1.1;
}

.result-date {
  color: var(--ink-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.result-subline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: -5px 0 10px;
  color: var(--ink-soft);
  font-size: 11px;
}

.child-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px solid rgba(52, 114, 75, 0.42);
  border-radius: 999px;
  background: var(--green-wash);
  color: var(--green);
  font-size: 10px;
  font-weight: 700;
}

.card-dish-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 14px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.card-dish-grid li {
  position: relative;
  min-width: 0;
  padding-left: 13px;
  font-size: 15px;
  line-height: 1.55;
  overflow-wrap: anywhere;
}

.card-dish-grid li::before {
  position: absolute;
  top: 0.63em;
  left: 0;
  width: 5px;
  height: 5px;
  content: "";
  border-radius: 50%;
  background: var(--meal-accent);
}

.card-dish-grid.is-single {
  grid-template-columns: 1fr;
}

.result-note {
  margin: 13px 0 0;
  padding: 8px 10px;
  border: 1px dashed var(--line);
  border-radius: 10px;
  background: rgba(246, 232, 210, 0.42);
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.55;
}

.result-note strong {
  color: var(--tomato-deep);
  font-weight: 700;
}

.result-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 15px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
  color: var(--ink-soft);
  font-size: 10px;
}

.result-stamp {
  display: inline-block;
  padding: 3px 8px;
  border: 1.5px solid var(--tomato);
  border-radius: 3px;
  color: var(--tomato);
  font-family: var(--font-display);
  font-size: 13px;
  line-height: 1.1;
  transform: rotate(-3deg);
}

.draw-button {
  display: flex;
  width: calc(100% - 32px);
  min-height: 58px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  margin: 17px 16px 0;
  padding: 12px 18px;
  border: 2px solid var(--ink);
  border-radius: 18px;
  background: var(--tomato);
  color: #fffdf7;
  box-shadow: 4px 5px 0 var(--ink);
  font-family: var(--font-display);
  font-size: 21px;
  line-height: 1.2;
  transition:
    transform 150ms ease,
    box-shadow 150ms ease,
    background 150ms ease;
}

.draw-button svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.draw-button:hover {
  background: #c9412c;
}

.draw-button:active {
  transform: translate(2px, 3px);
  box-shadow: 2px 2px 0 var(--ink);
}

.draw-button.is-drawing {
  background: var(--tomato-deep);
}

.draw-button.is-drawing svg {
  animation: spin 560ms linear infinite;
}

.mode-hint {
  margin: 11px 24px 0;
  color: var(--ink-soft);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.mode-hint strong {
  color: var(--green);
  font-weight: 700;
}

.house-rules {
  margin: 30px 16px 0;
}

.section-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 9px;
}

.section-heading h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 21px;
  font-weight: 400;
}

.section-heading > span {
  color: var(--ink-soft);
  font-size: 10px;
}

.house-rules ul {
  margin: 0;
  padding: 3px 0;
  border-top: 1.5px dashed var(--line);
  border-bottom: 1.5px dashed var(--line);
  list-style: none;
}

.house-rules li {
  display: grid;
  grid-template-columns: 67px 1fr;
  align-items: start;
  gap: 10px;
  padding: 10px 2px;
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1.55;
}

.house-rules li + li {
  border-top: 1px dotted var(--line);
}

.house-rules li span {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--green-wash);
  color: var(--green);
  font-size: 12px;
  font-weight: 700;
  text-align: center;
}

.view[hidden] {
  display: none;
}

.list-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 14px;
  padding: 8px 20px 9px;
}

.list-kicker {
  margin: 0 0 1px;
  color: var(--tomato);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.16em;
}

.list-intro h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(32px, 9vw, 39px);
  font-weight: 400;
  line-height: 1.15;
}

.sort-button {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  border: 1.5px solid var(--ink);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--shadow);
  font-size: 12px;
  white-space: nowrap;
}

.sort-button svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-width: 1.8;
}

.list-controls {
  position: sticky;
  z-index: 15;
  top: 0;
  margin: 0;
  padding: 8px 16px 7px;
  background: linear-gradient(
    to bottom,
    rgba(255, 248, 233, 0.98) 0%,
    rgba(255, 248, 233, 0.96) 78%,
    rgba(255, 248, 233, 0) 100%
  );
}

.search-box {
  display: flex;
  height: 52px;
  align-items: center;
  gap: 9px;
  padding: 0 11px 0 14px;
  border: 1.8px solid var(--ink);
  border-radius: 16px;
  background: var(--card);
  box-shadow: 3px 3px 0 var(--shadow);
  transition:
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.search-box:focus-within {
  border-color: var(--green);
  box-shadow: 3px 3px 0 rgba(52, 114, 75, 0.2);
}

.search-box > svg {
  width: 21px;
  height: 21px;
  flex: 0 0 auto;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.search-box input {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.search-box input::placeholder {
  color: #968878;
  opacity: 1;
}

.search-clear {
  display: grid;
  width: 34px;
  height: 34px;
  flex: 0 0 auto;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--paper-deep);
}

.search-clear svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.filter-row {
  display: flex;
  gap: 8px;
  margin-top: 10px;
  padding-bottom: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}

.filter-row::-webkit-scrollbar {
  display: none;
}

.filter-chip {
  display: inline-flex;
  min-height: 40px;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 253, 247, 0.62);
  color: var(--ink-soft);
  font-size: 13px;
  line-height: 1;
  transition:
    color 150ms ease,
    background 150ms ease,
    border-color 150ms ease,
    transform 150ms ease;
}

.filter-chip em {
  min-width: 24px;
  padding: 2px 5px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 10px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

.filter-chip.is-active {
  color: var(--card);
  background: var(--ink);
  border-color: var(--ink);
  transform: translateY(-1px);
}

.filter-chip.is-active em {
  background: rgba(255, 253, 247, 0.16);
  color: var(--card);
}

.list-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 20px 2px;
  color: var(--ink-soft);
  font-size: 11px;
}

.list-summary p {
  margin: 0;
}

.list-summary > span {
  display: inline-flex;
  align-items: center;
  padding: 2px 7px;
  border-radius: 999px;
  background: var(--tomato-wash);
  color: var(--tomato-deep);
  white-space: nowrap;
}

.dish-list {
  margin: 0;
  padding: 0 16px 128px;
  list-style: none;
}

.dish-row {
  display: grid;
  width: 100%;
  min-height: 70px;
  grid-template-columns: 38px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 11px;
  padding: 11px 2px;
  border: 0;
  border-bottom: 1px dashed var(--line);
  background: transparent;
  text-align: left;
}

.dish-row:active {
  background: rgba(246, 232, 210, 0.38);
}

.dish-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 1.5px solid var(--ink);
  border-radius: 12px 12px 9px 12px;
  background: var(--paper-deep);
  font-family: var(--font-display);
  font-size: 18px;
  line-height: 1;
  transform: rotate(-3deg);
}

.dish-row:nth-child(4n + 1) .dish-mark {
  background: var(--yolk-wash);
}

.dish-row:nth-child(4n + 2) .dish-mark {
  background: var(--tomato-wash);
}

.dish-row:nth-child(4n + 3) .dish-mark {
  background: var(--green-wash);
  transform: rotate(2deg);
}

.dish-row:nth-child(4n + 4) .dish-mark {
  background: #e9e1d1;
  transform: rotate(1deg);
}

.dish-main {
  min-width: 0;
}

.dish-name {
  display: block;
  font-size: 17px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.dish-name mark {
  padding: 0 2px;
  border-radius: 3px;
  background: #f9d875;
  color: inherit;
}

.dish-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 7px;
  margin-top: 2px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.45;
}

.dish-badge {
  display: inline-block;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 9px;
  line-height: 1.5;
}

.dish-badge.badge-child {
  background: var(--green-wash);
  color: var(--green);
}

.dish-badge.badge-soup {
  background: var(--yolk-wash);
  color: #855b0e;
}

.dish-chevron {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: #a49584;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.list-empty {
  display: flex;
  min-height: 330px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  text-align: center;
}

.list-empty[hidden] {
  display: none;
}

.list-empty > div {
  display: grid;
  width: 74px;
  height: 74px;
  place-items: center;
  border: 2px dashed var(--line);
  border-radius: 50%;
  color: var(--line);
  font-family: var(--font-display);
  font-size: 28px;
  transform: rotate(-7deg);
}

.list-empty p {
  margin: 15px 0 10px;
  color: var(--ink-soft);
  font-size: 15px;
}

.list-empty button {
  min-height: 42px;
  padding: 7px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--card);
  box-shadow: 2px 2px 0 var(--shadow);
  font-size: 13px;
}

.bottom-nav {
  position: fixed;
  z-index: 60;
  right: max(16px, calc((100vw - var(--shell)) / 2 + 16px));
  bottom: max(10px, env(safe-area-inset-bottom));
  left: max(16px, calc((100vw - var(--shell)) / 2 + 16px));
  display: grid;
  max-width: calc(var(--shell) - 32px);
  min-height: 62px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin: 0 auto;
  padding: 6px;
  border: 1.8px solid var(--ink);
  border-radius: 21px;
  background: rgba(255, 253, 247, 0.93);
  box-shadow:
    3px 4px 0 rgba(48, 40, 33, 0.2),
    0 10px 32px rgba(48, 40, 33, 0.12);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.nav-item {
  display: flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 6px 12px;
  border: 0;
  border-radius: 15px;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  font-weight: 700;
  transition:
    color 150ms ease,
    background 150ms ease,
    transform 150ms ease;
}

.nav-item svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.nav-item.is-active {
  color: var(--card);
  background: var(--tomato);
  box-shadow: inset 0 -2px 0 rgba(48, 40, 33, 0.18);
}

.nav-item:active {
  transform: scale(0.98);
}

.sheet-backdrop {
  position: fixed;
  z-index: 90;
  inset: 0;
  background: rgba(48, 40, 33, 0.38);
  opacity: 0;
  transition: opacity 220ms ease;
}

.sheet-backdrop[hidden] {
  display: none;
}

.sheet-backdrop.is-open {
  opacity: 1;
}

.dish-sheet {
  position: fixed;
  z-index: 100;
  right: 0;
  bottom: 0;
  left: 50%;
  width: min(100%, var(--shell));
  max-height: min(84dvh, 760px);
  padding: 12px 20px calc(26px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border: 2px solid var(--ink);
  border-bottom: 0;
  border-radius: 26px 26px 0 0;
  background: var(--card);
  box-shadow: 0 -18px 50px rgba(48, 40, 33, 0.18);
  transform: translate(-50%, 104%);
  transition: transform 280ms cubic-bezier(0.22, 0.8, 0.3, 1);
}

.dish-sheet[hidden] {
  display: none;
}

.dish-sheet.is-open {
  transform: translate(-50%, 0);
}

.sheet-grab {
  width: 44px;
  height: 5px;
  margin: 0 auto 16px;
  border-radius: 999px;
  background: var(--line);
}

.sheet-close {
  position: absolute;
  top: 15px;
  right: 16px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  padding: 0;
  border: 1.5px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
}

.sheet-close svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: var(--ink-soft);
  stroke-linecap: round;
  stroke-width: 1.8;
}

.sheet-head {
  padding-right: 43px;
}

.sheet-kicker {
  margin: 0 0 2px;
  color: var(--tomato);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
}

.sheet-head h2 {
  margin: 0;
  font-family: var(--font-display);
  font-size: 31px;
  font-weight: 400;
  line-height: 1.3;
}

.sheet-head > p:last-child {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.sheet-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.sheet-tags span {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--paper-deep);
  color: var(--ink-soft);
  font-size: 10px;
}

.sheet-tags span:first-child {
  background: var(--tomato-wash);
  color: var(--tomato-deep);
}

.sheet-section {
  margin-top: 22px;
}

.sheet-section h3 {
  margin: 0 0 9px;
  padding-bottom: 7px;
  border-bottom: 1.5px dashed var(--line);
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 400;
}

.history-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.history-item {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px dotted var(--line);
}

.history-date {
  color: var(--ink-soft);
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.history-date strong {
  display: block;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
}

.history-menu {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.history-note {
  display: block;
  margin-top: 3px;
  color: var(--ink-soft);
  font-size: 10px;
}

.toast {
  position: fixed;
  z-index: 120;
  bottom: calc(88px + env(safe-area-inset-bottom));
  left: 50%;
  max-width: min(86vw, 360px);
  padding: 9px 14px;
  border: 1.5px solid var(--ink);
  border-radius: 12px;
  background: var(--ink);
  color: var(--card);
  box-shadow: 3px 3px 0 rgba(216, 75, 52, 0.35);
  font-size: 12px;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 10px);
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

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

.noscript {
  position: fixed;
  inset: 20px;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 30px;
  border: 2px solid var(--ink);
  background: var(--card);
  text-align: center;
}

@keyframes view-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes shuffle-card {
  0% {
    transform: translateX(0) rotate(-0.25deg);
  }
  18% {
    transform: translateX(-9px) rotate(-2.4deg);
  }
  38% {
    transform: translateX(10px) rotate(2.2deg);
  }
  58% {
    transform: translateX(-6px) rotate(-1.3deg);
  }
  76% {
    transform: translateX(4px) rotate(0.8deg);
  }
  100% {
    transform: translateX(0) rotate(-0.25deg);
  }
}

@keyframes result-in {
  from {
    opacity: 0;
    transform: translateY(10px) rotate(0.6deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotate(0);
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (min-width: 640px) {
  body {
    padding: 18px 0;
  }

  .page-shell {
    min-height: calc(100dvh - 36px);
    border: 1px solid rgba(48, 40, 33, 0.08);
    border-radius: 30px;
    background: rgba(255, 248, 233, 0.42);
    box-shadow: 0 22px 70px rgba(48, 40, 33, 0.12);
  }
}

@media (max-width: 380px) {
  .topbar {
    padding-right: 16px;
    padding-left: 16px;
  }

  .child-switch {
    min-width: 80px;
    padding-right: 10px;
    padding-left: 8px;
  }

  .hero-card {
    min-height: 150px;
    margin-right: 13px;
    margin-left: 13px;
    padding-right: 15px;
    padding-left: 15px;
  }

  .hero-doodle {
    right: -8px;
    width: 114px;
    transform: rotate(4deg) scale(0.94);
    transform-origin: top right;
  }

  .hero-lead {
    font-size: 18px;
  }

  .meal-tabs,
  .draw-stage {
    margin-right: 13px;
    margin-left: 13px;
  }

  .draw-button {
    width: calc(100% - 26px);
    margin-right: 13px;
    margin-left: 13px;
  }

  .menu-card {
    padding-right: 14px;
    padding-left: 14px;
  }

  .card-dish-grid {
    column-gap: 9px;
  }

  .card-dish-grid li {
    font-size: 14px;
  }

  .dish-list {
    padding-right: 13px;
    padding-left: 13px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}
