:root {
  --ink: #4f383b;
  --ink-soft: #806769;
  --ink-faint: #a38f90;
  --paper: #fffdfb;
  --canvas: #fff6f1;
  --rose: #b85f68;
  --rose-dark: #984c56;
  --rose-soft: #fbe9e8;
  --peach: #d6975e;
  --peach-soft: #fff0dd;
  --sage: #7f9b89;
  --sage-soft: #edf4ef;
  --line: #eaded9;
  --shadow: 0 14px 38px rgba(89, 57, 61, 0.15);
  --shadow-soft: 0 8px 22px rgba(89, 57, 61, 0.09);
  --radius: 8px;
  --content-width: 560px;
  --bottom-dock-height: 58px;
  --display-font:
    "Songti SC",
    "STSong",
    "SimSun",
    serif;
  color-scheme: light;
  font-family:
    "PingFang SC",
    "Microsoft YaHei",
    "Noto Sans CJK SC",
    "Source Han Sans SC",
    Arial,
    sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: #eadbd5;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background: #eadbd5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.modal-open {
  overflow: hidden;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

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

img {
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
}

[hidden] {
  display: none !important;
}

.icon-slot {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
}

.icon-slot svg {
  width: 1em;
  height: 1em;
  stroke-width: 1.9;
}

.theme-backdrop {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 50%;
  z-index: 0;
  width: min(100%, var(--content-width));
  background-color: var(--canvas);
  background-image: url("./theme/main.webp");
  background-repeat: no-repeat;
  background-position: center top;
  background-size: cover;
  opacity: var(--page-bg-opacity, 0.2);
  filter: saturate(0.78) brightness(1.08);
  transform: translateX(-50%);
  pointer-events: none;
}

.app-shell {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: var(--content-width);
  min-height: 100vh;
  margin: 0 auto;
  background: rgba(255, 247, 242, 0.56);
}

/* Home */

.home-screen {
  position: relative;
  min-height: 100dvh;
  overflow: hidden;
  background-color: #f4dfd8;
  background-image: url("./theme/main.webp");
  background-position: var(--home-bg-position, center 42%);
  background-repeat: no-repeat;
  background-size: cover;
}

.home-screen::before {
  position: absolute;
  inset: 0;
  content: "";
  background: rgba(255, 248, 244, calc(var(--home-bg-opacity, 0.35) * 0.55));
}

.home-content {
  position: relative;
  z-index: 1;
  display: flex;
  min-height: 100dvh;
  flex-direction: column;
  padding: max(20px, env(safe-area-inset-top)) 22px calc(var(--bottom-dock-height) + 8px);
}

.home-title-row {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  flex-wrap: nowrap;
}

.home-screen h1 {
  min-width: 0;
  max-width: none;
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(29px, 9vw, 38px);
  line-height: 1.08;
  letter-spacing: 0;
  white-space: nowrap;
}

.home-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 56px;
  height: 28px;
  padding: 0 9px;
  color: var(--rose-dark);
  background: rgba(255, 253, 251, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  box-shadow: 0 5px 15px rgba(89, 57, 61, 0.09);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: lowercase;
}

.home-category-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
  max-width: 390px;
  margin-top: 14px;
  padding-top: 0;
  padding-bottom: 32px;
}

.home-category-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 44px;
  padding: 5px 9px 5px 6px;
  color: var(--ink);
  background: rgba(255, 253, 251, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 6px 20px rgba(87, 52, 59, 0.1);
  cursor: pointer;
  text-align: left;
  backdrop-filter: blur(10px);
  transition:
    transform 160ms ease,
    background 160ms ease;
}

.home-category-button:active {
  transform: scale(0.985);
}

.home-category-thumb {
  width: 38px;
  height: 34px;
  background-color: #f3e8e3;
  background-position: center;
  background-size: cover;
  border: 1px solid rgba(255, 255, 255, 0.84);
  border-radius: 6px;
}

.home-category-name {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.home-category-arrow {
  color: var(--rose);
  font-size: 18px;
}

/* Catalog */

.catalog-screen {
  min-height: 100dvh;
  padding-bottom: calc(var(--bottom-dock-height) + 20px);
  background: var(--category-soft, rgba(255, 247, 242, 0.74));
}

.catalog-stage {
  position: relative;
  height: 176px;
  overflow: hidden;
  background: #ead9d4;
}

.stage-photo {
  position: absolute;
  inset: 0 41.6667% 0 0;
  z-index: 0;
  background-repeat: no-repeat;
  background-size: cover;
}

.stage-vertical-line {
  position: absolute;
  top: 0;
  bottom: 0;
  left: calc(58.3333% - 11px);
  z-index: 3;
  width: 22px;
  background: linear-gradient(
    90deg,
    rgba(255, 248, 244, 0) 0%,
    rgba(255, 248, 244, 0.74) 48%,
    rgba(255, 248, 244, 0.9) 58%,
    rgba(255, 248, 244, 0) 100%
  );
  filter: blur(2px);
  pointer-events: none;
}

.stage-vertical-line::after {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 10px;
  width: 2px;
  content: "";
  background: repeating-linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.84) 0 8px,
    transparent 8px 15px
  );
  border-radius: 999px;
}

.stage-title-panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  left: 58.3333%;
  z-index: 1;
  overflow: hidden;
  background-color: var(--category-soft, #fff6f1);
}

.stage-title-panel::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background-color: rgba(255, 248, 244, 0.34);
}

.stage-title-blur {
  position: absolute;
  inset: -12%;
  z-index: 0;
  background-repeat: no-repeat;
  background-size: cover;
  filter: blur(12px) saturate(0.82) brightness(1.08);
  opacity: 0.76;
  transform: scale(1.08);
}

.stage-title-card {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 116px;
  min-height: 84px;
  padding: 14px 12px;
  overflow: hidden;
  background: #fffdf9;
  border: 1px solid #e6d5ce;
  border-radius: 4px;
  box-shadow: 0 9px 22px rgba(89, 57, 61, 0.13);
  transform: translate(-50%, -50%) rotate(-2deg);
}

.stage-title-card::before {
  position: absolute;
  top: -9px;
  left: 14px;
  width: 34px;
  height: 16px;
  content: "";
  background: rgba(214, 151, 94, 0.54);
  border-radius: 2px;
  transform: rotate(-7deg);
}

.stage-title-card::after {
  position: absolute;
  right: 12px;
  bottom: -9px;
  width: 30px;
  height: 13px;
  content: "";
  background: rgba(127, 155, 137, 0.42);
  border-radius: 2px;
  transform: rotate(7deg);
}

.stage-title-paw {
  position: absolute;
  right: 8px;
  bottom: 7px;
  z-index: 2;
  width: 17px;
  height: 17px;
  color: var(--category-color, var(--rose));
  background: transparent;
  opacity: 0.34;
  font-size: 17px;
}

.stage-title-panel h1 {
  position: relative;
  z-index: 1;
  max-width: 86px;
  margin: 0;
  font-family: var(--display-font);
  font-size: clamp(22px, 6.5vw, 27px);
  line-height: 1.05;
  text-wrap: balance;
  text-align: center;
}

.stage-doodle {
  position: absolute;
  z-index: 2;
  color: var(--category-color, var(--rose));
  pointer-events: none;
  display: none;
}

.stage-doodle-heart {
  right: 13px;
  bottom: 17px;
  opacity: 0.42;
  font-size: 18px;
  transform: rotate(8deg);
}

.stage-doodle-paw {
  top: 43%;
  left: 62%;
  opacity: 0.27;
  font-size: 16px;
  transform: rotate(-18deg);
}

.stage-doodle-paw-two {
  top: 67%;
  left: 66%;
  opacity: 0.21;
  font-size: 14px;
  transform: rotate(17deg);
}

.stage-back {
  position: absolute;
  top: max(14px, env(safe-area-inset-top));
  left: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow: 0 5px 15px rgba(83, 50, 57, 0.12);
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.stage-back .icon-slot {
  font-size: 20px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  align-items: start;
  min-height: calc(100dvh - 176px);
}

.category-rail {
  position: sticky;
  top: 0;
  z-index: 8;
  display: grid;
  align-content: start;
  gap: 7px;
  max-height: calc(100dvh - var(--bottom-dock-height));
  padding: 10px 7px calc(var(--bottom-dock-height) + 18px);
  overflow-y: auto;
  background: var(--category-soft, rgba(255, 253, 251, 0.8));
  border-right: 1px solid var(--line);
  scrollbar-width: none;
  backdrop-filter: blur(12px);
}

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

.rail-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 57px;
  padding: 6px 4px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.76);
  border: 1px solid var(--line);
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  text-align: center;
  word-break: break-all;
  transition:
    color 160ms ease,
    background 160ms ease,
    border-color 160ms ease;
}

.rail-tab.active {
  color: #fff;
  background: var(--category-color, var(--rose));
  border-color: var(--category-color, var(--rose));
  box-shadow: 0 6px 16px rgba(91, 58, 63, 0.16);
}

.dish-pane {
  min-width: 0;
  padding: 12px 10px 24px;
  background: var(--category-soft, rgba(255, 247, 242, 0.74));
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  min-height: 42px;
  padding: 0 11px;
  color: var(--ink-soft);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 255, 255, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 6px 18px rgba(89, 57, 61, 0.07);
}

.search-box > .icon-slot {
  color: var(--rose);
  font-size: 18px;
}

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

.search-box input::placeholder {
  color: #a49092;
}

.search-box input::-webkit-search-cancel-button {
  display: none;
}

.search-clear {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--ink-soft);
  background: var(--rose-soft);
  border: 0;
  border-radius: 999px;
  cursor: pointer;
}

.search-clear .icon-slot {
  font-size: 14px;
}

/* Custom request */

.custom-request-panel {
  margin-top: 10px;
  padding: 12px;
  background: rgba(251, 233, 232, 0.9);
  border: 1px solid #efd4d2;
  border-radius: var(--radius);
}

.custom-request-copy {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.custom-request-icon {
  width: 32px;
  height: 32px;
  color: var(--rose);
  background: #fff;
  border-radius: 6px;
  font-size: 17px;
}

.custom-request-copy h3 {
  margin: 0;
  font-size: 14px;
}

.custom-request-copy p {
  margin: 3px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.5;
}

.custom-request-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-top: 10px;
}

.custom-request-form input {
  min-width: 0;
  height: 39px;
  padding: 0 10px;
  color: var(--ink);
  background: #fff;
  border: 1px solid #e4ccca;
  border-radius: 6px;
  outline: 0;
  font-size: 12px;
}

.custom-request-form input:focus {
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(184, 95, 104, 0.1);
}

.custom-request-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 39px;
  padding: 0 12px;
  color: #fff;
  background: var(--rose);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
}

.custom-request-form button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* Dish cards */

.dish-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 9px;
  margin-top: 10px;
}

.dish-card {
  position: relative;
  min-width: 0;
  overflow: hidden;
  background: rgba(255, 253, 251, 0.96);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  transition:
    transform 170ms ease,
    box-shadow 170ms ease,
    border-color 170ms ease;
}

.dish-card:active {
  transform: scale(0.985);
}

.dish-image-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #eadfd9;
}

.dish-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-fallback {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  color: #b9868a;
  background: #f2e2e0;
}

.image-fallback svg {
  width: 34px;
  height: 34px;
  stroke-width: 1.4;
}

.dish-card.has-image .image-fallback {
  display: none;
}

.dish-card.image-error .dish-image-wrap img {
  display: none;
}

.add-button {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 3;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #fff;
  background: var(--rose);
  border: 2px solid rgba(255, 255, 255, 0.9);
  border-radius: 999px;
  box-shadow: 0 5px 14px rgba(96, 49, 55, 0.22);
  cursor: pointer;
}

.add-button.added {
  background: var(--sage);
}

.add-button .icon-slot {
  font-size: 18px;
}

.quantity-badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  display: none;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  color: #fff;
  background: rgba(184, 95, 104, 0.94);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 800;
  line-height: 24px;
  text-align: center;
}

.quantity-badge.visible {
  display: block;
}

.dish-card-copy {
  padding: 9px 9px 11px;
}

.dish-card-copy h3 {
  overflow: hidden;
  margin: 0;
  font-size: 13px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-hint {
  margin: 4px 0 0;
  color: #7c6669;
  font-size: 10px;
  line-height: 1.35;
}

.empty-state {
  display: flex;
  min-height: 300px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 34px 12px;
  color: var(--ink-soft);
  text-align: center;
}

.empty-icon {
  width: 58px;
  height: 58px;
  color: var(--rose);
  background: var(--rose-soft);
  border-radius: 999px;
  font-size: 27px;
}

.empty-state h3 {
  margin: 15px 0 5px;
  color: var(--ink);
  font-size: 16px;
}

.empty-state p {
  margin: 0;
  font-size: 12px;
  line-height: 1.6;
}

/* Bottom menu entry */

.bottom-dock {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 90;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  height: calc(var(--bottom-dock-height) + env(safe-area-inset-bottom));
  padding: 7px 12px max(7px, env(safe-area-inset-bottom));
  pointer-events: none;
}

.bottom-menu-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: min(164px, calc(100vw - 40px));
  height: 44px;
  padding: 0 16px;
  color: var(--rose-dark);
  background: rgba(255, 253, 251, 0.94);
  border: 1px solid rgba(255, 255, 255, 0.94);
  border-radius: 999px;
  box-shadow: 0 9px 28px rgba(92, 53, 60, 0.2);
  cursor: pointer;
  pointer-events: auto;
  font-size: 13px;
  font-weight: 800;
  backdrop-filter: blur(12px);
}

.bottom-menu-icon {
  font-size: 18px;
}

.red-dot {
  position: absolute;
  top: -7px;
  right: -5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  color: #fff;
  background: #e24d55;
  border: 2px solid #fff;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
}

.red-dot[hidden] {
  display: none !important;
}

/* Modals */

.modal-layer {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(59, 37, 41, 0.52);
  backdrop-filter: blur(4px);
  animation: backdrop-in 180ms ease both;
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(100%, 560px);
  max-height: min(92vh, 920px);
  overflow: hidden;
  background: var(--paper);
  border-radius: var(--radius) var(--radius) 0 0;
  box-shadow: var(--shadow);
  animation: sheet-in 220ms ease both;
}

.modal-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: 0 4px 13px rgba(92, 53, 60, 0.11);
  cursor: pointer;
}

.modal-close .icon-slot {
  font-size: 19px;
}

.detail-card .modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 4;
}

.detail-scroll {
  max-height: min(92vh, 920px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.detail-hero {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #f1e4df;
}

.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-body {
  padding: 22px 18px 34px;
}

.detail-category {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 10px;
  color: var(--rose-dark);
  background: var(--rose-soft);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
}

.detail-body h2 {
  margin: 12px 0 0;
  font-family: var(--display-font);
  font-size: 27px;
  line-height: 1.28;
}

.ingredient-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 20px;
}

.ingredient-block {
  padding: 13px 14px;
  background: #fff9f6;
  border: 1px solid var(--line);
  border-radius: 6px;
}

.ingredient-block h3,
.detail-section h3 {
  margin: 0;
  color: var(--rose);
  font-size: 12px;
  font-weight: 800;
}

.ingredient-block p {
  margin: 7px 0 0;
  color: #5e474a;
  font-size: 14px;
  line-height: 1.7;
  white-space: pre-wrap;
}

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

.step-list {
  display: grid;
  gap: 12px;
  margin-top: 11px;
}

.step-item {
  display: grid;
  grid-template-columns: 31px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.step-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  color: #fff;
  background: var(--rose);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.step-item p {
  margin: 3px 0 0;
  color: #5d4649;
  font-size: 14px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.note-box {
  margin-top: 11px;
  padding: 14px;
  color: #7a4e35;
  background: var(--peach-soft);
  border-left: 3px solid var(--peach);
  border-radius: 4px;
  font-size: 13px;
  line-height: 1.75;
  white-space: pre-wrap;
}

.tutorial-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 43px;
  margin-top: 11px;
  padding: 0 16px;
  color: #fff;
  background: var(--rose);
  border-radius: 6px;
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.detail-add-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: 100%;
  min-height: 49px;
  margin-top: 26px;
  color: #fff;
  background: var(--rose);
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
}

.detail-add-button.added {
  background: var(--sage);
}

/* Order sheet */

.order-card,
.long-image-card {
  display: flex;
  flex-direction: column;
}

.order-card {
  height: min(92vh, 920px);
}

.order-card-header,
.long-image-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 19px 18px 15px;
  background-color: #fff7f3;
  background-image: url("./theme/all.webp");
  background-position: center 38%;
  background-size: cover;
  background-blend-mode: soft-light;
  border-bottom: 1px solid var(--line);
}

.order-card-header h2,
.long-image-header h2 {
  margin: 0;
  font-family: var(--display-font);
  font-size: 23px;
  line-height: 1.25;
}

.modal-kicker {
  margin: 0 0 5px;
  color: var(--rose);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
}

.order-close {
  position: static;
}

.order-scroll,
.long-image-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
}

.order-scroll {
  padding: 17px 16px 28px;
}

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

.order-section-heading h3 {
  margin: 0;
  font-size: 16px;
}

.order-section-heading span {
  color: var(--ink-faint);
  font-size: 12px;
}

.selected-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.selected-item {
  min-width: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.selected-image {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f1e4df;
}

.selected-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.selected-image .quantity-badge {
  display: block;
}

.selected-copy {
  padding: 10px;
}

.selected-copy h4 {
  overflow: hidden;
  margin: 0;
  font-size: 14px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-controls {
  display: grid;
  grid-template-columns: 31px 1fr 31px 31px;
  align-items: center;
  gap: 5px;
  margin-top: 9px;
}

.selected-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 31px;
  height: 31px;
  padding: 0;
  color: var(--rose);
  background: var(--rose-soft);
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.selected-controls button[data-action="remove"] {
  color: #b54d57;
  background: #fde3e3;
}

.selected-controls .icon-slot {
  font-size: 15px;
}

.selected-quantity {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  text-align: center;
}

.order-custom-section {
  margin-top: 24px;
}

.request-list {
  display: grid;
  gap: 8px;
}

.request-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: center;
  gap: 10px;
  min-height: 50px;
  padding: 9px 9px 9px 13px;
  color: #74494f;
  background: var(--peach-soft);
  border: 1px solid #efd2d0;
  border-radius: 6px;
}

.request-item p {
  margin: 0;
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}

.request-item button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  color: #a24f59;
  background: rgba(255, 255, 255, 0.72);
  border: 0;
  border-radius: 5px;
  cursor: pointer;
}

.order-empty {
  display: flex;
  min-height: 310px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--ink-soft);
  text-align: center;
}

.order-empty > .icon-slot {
  width: 58px;
  height: 58px;
  color: var(--rose);
  background: var(--rose-soft);
  border-radius: 999px;
  font-size: 27px;
}

.order-empty h3 {
  margin: 15px 0 5px;
  color: var(--ink);
  font-size: 17px;
}

.order-empty p {
  margin: 0;
  font-size: 12px;
}

.order-card-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 9px;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-height: 47px;
  padding: 0 18px;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
  text-decoration: none;
  font-size: 14px;
  font-weight: 800;
}

.primary-button {
  color: #fff;
  background: var(--rose);
}

.primary-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.secondary-button {
  color: var(--ink-soft);
  background: #f6ecea;
}

.primary-button .icon-slot,
.secondary-button .icon-slot {
  font-size: 17px;
}

/* Long image */

.long-image-card {
  height: min(94vh, 940px);
}

.long-image-scroll {
  padding: 13px;
  background: #eaded9;
}

.long-image-scroll img {
  width: 100%;
  height: auto;
  margin: 0 auto;
  background: #fff;
  box-shadow: 0 8px 30px rgba(93, 58, 63, 0.16);
}

.long-image-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px max(14px, env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}

.long-image-footer p {
  margin: 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.long-image-footer .primary-button {
  min-width: 122px;
}

/* Loading and toast */

.loading-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 22px;
  background: rgba(59, 37, 41, 0.56);
  backdrop-filter: blur(4px);
}

.loading-card {
  width: min(100%, 310px);
  padding: 28px 22px;
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  text-align: center;
}

.spinner {
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 15px;
  border: 3px solid #f0deda;
  border-top-color: var(--rose);
  border-radius: 999px;
  animation: spin 750ms linear infinite;
}

.loading-card strong {
  display: block;
  font-size: 15px;
}

.loading-card p {
  margin: 6px 0 0;
  color: var(--ink-soft);
  font-size: 12px;
}

.toast {
  position: fixed;
  right: 50%;
  bottom: calc(var(--bottom-dock-height) + env(safe-area-inset-bottom) + 12px);
  z-index: 300;
  max-width: min(86vw, 420px);
  padding: 11px 15px;
  color: #fff;
  background: rgba(78, 47, 52, 0.94);
  border-radius: 6px;
  box-shadow: 0 10px 28px rgba(75, 43, 48, 0.24);
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  transform: translateX(50%);
  animation: toast-in 180ms ease both;
}

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

@keyframes backdrop-in {
  from {
    opacity: 0;
  }
}

@keyframes sheet-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translate(50%, 8px);
  }
}

@media (min-width: 640px) {
  .app-shell {
    box-shadow: 0 0 50px rgba(92, 59, 63, 0.16);
  }

  .modal-layer {
    align-items: center;
    padding: 24px;
  }

  .modal-card {
    border-radius: var(--radius);
  }

  .detail-body {
    padding: 25px 24px 34px;
  }

  .ingredient-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 360px) {
  .home-content {
    padding-top: max(20px, env(safe-area-inset-top));
  }

  .home-screen h1 {
    font-size: 29px;
  }

  .home-category-list {
    gap: 6px;
    padding-top: 0;
    padding-bottom: 32px;
  }

  .home-category-button {
    min-height: 44px;
  }

  .home-category-thumb {
    width: 36px;
    height: 32px;
  }

  .home-logo {
    min-width: 52px;
    height: 26px;
    padding: 0 7px;
    font-size: 10px;
  }

  .catalog-layout {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .stage-title-panel h1 {
    max-width: 72px;
    font-size: 22px;
  }

  .stage-title-card {
    top: 50%;
    left: 50%;
    width: 98px;
    min-height: 78px;
    padding: 12px 9px;
    transform: translate(-50%, -50%) rotate(-2deg);
  }

  .stage-title-paw {
    width: 15px;
    height: 15px;
    font-size: 15px;
  }

  .stage-doodle-heart {
    right: 8px;
    bottom: 14px;
  }

  .stage-doodle-paw {
    top: 43%;
    left: 61%;
    font-size: 14px;
  }

  .stage-doodle-paw-two {
    top: 67%;
    left: 65%;
    font-size: 12px;
  }

  .dish-pane {
    padding-right: 8px;
    padding-left: 8px;
  }
}

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