.table-menu-body {
  margin: 0;
  background: #fff8ed;
}

.table-menu,
.table-menu * {
  box-sizing: border-box;
}

.table-menu {
  --tm-ink: #2b1915;
  --tm-red: #821b17;
  --tm-red-dark: #4d0f0c;
  --tm-gold: #d2a252;
  --tm-cream: #fff8ed;
  --tm-paper: #ffffff;
  --tm-muted: #75645c;
  --tm-line: #eaded4;
  min-height: 100vh;
  padding-bottom: calc(92px + env(safe-area-inset-bottom));
  color: var(--tm-ink);
  background:
    radial-gradient(circle at 10% 0%, rgb(210 162 82 / 18%), transparent 28rem),
    var(--tm-cream);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.45;
  overflow-x: clip;
}

.table-menu button,
.table-menu input {
  font: inherit;
}

.table-menu [hidden] {
  display: none !important;
}

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

.tm-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: calc(20px + env(safe-area-inset-top)) 18px 22px;
  color: #fffaf1;
  background:
    linear-gradient(135deg, rgb(255 255 255 / 7%), transparent 44%),
    linear-gradient(145deg, var(--tm-red-dark), #180706 78%);
  border-bottom: 3px solid var(--tm-gold);
}

.tm-header__eyebrow {
  margin: 0 0 4px;
  color: #f4d89f;
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.tm-header h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.8rem, 8vw, 2.5rem);
  line-height: 1;
}

.tm-language {
  display: grid;
  grid-template-columns: 1fr 1fr;
  flex: 0 0 auto;
  padding: 3px;
  border: 1px solid rgb(255 255 255 / 24%);
  border-radius: 999px;
  background: rgb(0 0 0 / 22%);
}

.tm-language button {
  min-width: 48px;
  min-height: 44px;
  padding: 0 10px;
  color: #fff;
  background: transparent;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
}

.tm-language button[aria-pressed="true"] {
  color: #351812;
  background: #f4d89f;
  box-shadow: 0 2px 10px rgb(0 0 0 / 25%);
}

.tm-order-notice {
  margin: 0;
  padding: 12px 18px;
  color: #fff;
  background: var(--tm-red);
  font-size: 0.92rem;
  font-weight: 750;
  text-align: center;
}

.tm-tools {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 12px 0 8px;
  background: rgb(255 248 237 / 96%);
  border-bottom: 1px solid var(--tm-line);
  box-shadow: 0 8px 24px rgb(77 15 12 / 7%);
  backdrop-filter: blur(12px);
}

.tm-search {
  position: relative;
  display: block;
  margin: 0 16px 10px;
}

.tm-search::before {
  content: "⌕";
  position: absolute;
  left: 14px;
  top: 50%;
  color: var(--tm-red);
  font-size: 1.35rem;
  transform: translateY(-53%);
  pointer-events: none;
}

.tm-search input {
  width: 100%;
  min-height: 48px;
  padding: 10px 14px 10px 42px;
  color: var(--tm-ink);
  background: var(--tm-paper);
  border: 1px solid #d9c7b9;
  border-radius: 14px;
  box-shadow: 0 4px 14px rgb(43 25 21 / 6%);
}

.tm-search input::placeholder {
  color: #8a766c;
}

.tm-categories {
  display: flex;
  gap: 8px;
  padding: 0 16px 4px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.tm-categories::-webkit-scrollbar {
  display: none;
}

.tm-categories button {
  flex: 0 0 auto;
  min-height: 44px;
  padding: 8px 15px;
  color: var(--tm-red-dark);
  background: #fff;
  border: 1px solid #ddc9b9;
  border-radius: 999px;
  font-weight: 750;
  cursor: pointer;
}

.tm-categories button[aria-pressed="true"] {
  color: #fff;
  background: var(--tm-red);
  border-color: var(--tm-red);
  box-shadow: 0 5px 14px rgb(130 27 23 / 24%);
}

.tm-results {
  min-height: 0;
  margin: 0;
  padding: 0 16px;
  color: var(--tm-muted);
  font-size: 0.86rem;
}

.tm-results:not(:empty) {
  padding-top: 12px;
}

.tm-section {
  width: min(100%, 780px);
  margin: 0 auto;
  padding: 24px 14px 8px;
}

.tm-section__heading {
  padding: 0 4px 14px;
}

.tm-section__heading p {
  margin: 0 0 2px;
  color: var(--tm-red);
  font-size: 0.78rem;
  font-weight: 850;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.tm-section__heading h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  line-height: 1.15;
}

.tm-featured-grid,
.tm-item-grid {
  display: grid;
  gap: 14px;
}

.tm-card {
  position: relative;
  display: flex;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  color: inherit;
  text-align: left;
  background: var(--tm-paper);
  border: 1px solid var(--tm-line);
  border-radius: 17px;
  box-shadow: 0 8px 24px rgb(72 37 26 / 10%);
  cursor: pointer;
}

.tm-card--featured {
  flex-direction: column;
  border-color: #dcc39a;
}

.tm-card--featured::after {
  content: "View details →";
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 7px 10px;
  color: #fff;
  background: rgb(77 15 12 / 86%);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  backdrop-filter: blur(6px);
}

html[lang="zh-Hant"] .tm-card--featured::after {
  content: "查看詳情 →";
}

.tm-card__image {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eaded4;
}

.tm-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-width: 0;
  padding: 13px 14px 14px;
}

.tm-card__name {
  display: -webkit-box;
  overflow: hidden;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.1rem;
  font-weight: 800;
  line-height: 1.2;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tm-card--featured .tm-card__name {
  padding-right: 4.5rem;
  font-size: 1.35rem;
}

.tm-card__description {
  display: -webkit-box;
  margin-top: 7px;
  overflow: hidden;
  color: var(--tm-muted);
  font-size: 0.83rem;
  line-height: 1.35;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tm-card__meta {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
  padding-top: 12px;
}

.tm-card__serving {
  color: var(--tm-muted);
  font-size: 0.76rem;
}

.tm-card__price {
  flex: 0 0 auto;
  color: var(--tm-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.22rem;
  font-weight: 900;
}

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

.tm-card--standard {
  flex-direction: column;
}

.tm-card--standard .tm-card__body {
  min-height: 142px;
  padding: 11px;
}

.tm-card--standard .tm-card__name {
  font-size: 0.98rem;
}

.tm-card--standard .tm-card__description {
  font-size: 0.76rem;
}

.tm-card--standard .tm-card__price {
  font-size: 1.08rem;
}

.tm-footer {
  width: min(100% - 32px, 748px);
  margin: 26px auto 0;
  padding: 18px;
  color: #5e4a42;
  background: #f3e6d6;
  border: 1px solid #e2cfbc;
  border-radius: 16px;
  text-align: center;
}

.tm-footer p {
  margin: 0;
}

.tm-footer p + p {
  margin-top: 7px;
  font-size: 0.82rem;
}

.tm-bottom-notice {
  position: fixed;
  right: 12px;
  bottom: calc(10px + env(safe-area-inset-bottom));
  left: 12px;
  z-index: 30;
  max-width: 700px;
  min-height: 52px;
  margin: auto;
  padding: 14px 18px;
  color: #fff;
  background: rgb(77 15 12 / 96%);
  border: 1px solid rgb(210 162 82 / 72%);
  border-radius: 15px;
  box-shadow: 0 10px 28px rgb(0 0 0 / 28%);
  font-size: 0.88rem;
  font-weight: 800;
  text-align: center;
  backdrop-filter: blur(12px);
}

.tm-dialog {
  width: min(calc(100% - 24px), 540px);
  max-height: calc(100dvh - 24px);
  padding: 0;
  overflow: auto;
  color: var(--tm-ink);
  background: var(--tm-paper);
  border: 0;
  border-radius: 22px;
  box-shadow: 0 30px 80px rgb(0 0 0 / 45%);
}

.tm-dialog::backdrop {
  background: rgb(27 10 8 / 72%);
  backdrop-filter: blur(3px);
}

.tm-dialog__close {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 46px;
  height: 46px;
  padding: 0;
  color: #fff;
  background: rgb(35 14 11 / 84%);
  border: 1px solid rgb(255 255 255 / 35%);
  border-radius: 50%;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
}

.tm-dialog > img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: #eaded4;
}

.tm-dialog__body {
  padding: 20px 20px calc(24px + env(safe-area-inset-bottom));
}

.tm-dialog__body h2 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.65rem;
  line-height: 1.15;
}

.tm-dialog__body > p {
  margin: 10px 0 0;
}

.tm-dialog__meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  color: var(--tm-muted);
}

.tm-dialog__meta strong {
  color: var(--tm-red);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.5rem;
}

.tm-dialog__tags {
  color: var(--tm-muted);
  font-size: 0.8rem;
}

.tm-dialog__notice {
  padding: 12px;
  color: var(--tm-red-dark);
  background: #faeee3;
  border-left: 4px solid var(--tm-gold);
  border-radius: 8px;
  font-size: 0.86rem;
  font-weight: 800;
}

.table-menu button:focus-visible,
.table-menu input:focus-visible,
.tm-dialog:focus-visible {
  outline: 3px solid #1a73e8;
  outline-offset: 3px;
}

.table-menu .tm-card:active {
  transform: scale(0.985);
}

.table-menu + .reserve-sticky {
  display: none;
}

@media (max-width: 359px) {
  .tm-item-grid {
    grid-template-columns: 1fr;
  }

  .tm-card--standard {
    display: grid;
    grid-template-columns: 42% 1fr;
  }

  .tm-card--standard .tm-card__body {
    min-height: 0;
  }
}

@media (min-width: 700px) {
  .tm-header,
  .tm-tools > * {
    padding-right: max(24px, calc((100% - 780px) / 2));
    padding-left: max(24px, calc((100% - 780px) / 2));
  }

  .tm-search {
    margin-right: max(24px, calc((100% - 780px) / 2));
    margin-left: max(24px, calc((100% - 780px) / 2));
  }

  .tm-featured-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .tm-card--featured:first-child {
    grid-column: 1 / -1;
  }

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

@media (prefers-reduced-motion: no-preference) {
  .tm-card,
  .tm-language button,
  .tm-categories button {
    transition: transform 140ms ease, box-shadow 140ms ease, background-color 140ms ease;
  }
}

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