:root {
  font-family: "DM Sans","Microsoft JhengHei","PingFang TC",sans-serif;
  color: #272720;
  background: #f8f6f0;
  --ink: #272720;
  --berry: #bd2451;
  --berry-deep: #90183b;
  --paper: #fffefa;
  --line: #dfdcd2;
  --muted: #68665c;
  --radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body {
  height: 100%;
  overflow: hidden;
}

body {
  margin: 0;
  height: 100dvh;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}

button,select {
  font: inherit;
  color: inherit;
}

button,a,select {
  touch-action: manipulation;
}

#dishes:focus-visible {
  outline: 3px solid var(--berry);
  outline-offset: -3px;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: default;
}

button:focus-visible,a:focus-visible,select:focus-visible,input:focus-visible {
  outline: 3px solid #c02f67;
  outline-offset: 3px;
}

button {
  border: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

h1,h2,h3,p {
  margin: 0;
}

h1,h2,h3 {
  line-height: 1.25;
}

button:disabled:not(.dish) {
  opacity: .55;
}

.skip {
  position: absolute;
  z-index: 6;
  top: -100px;
  background: white;
  padding: 10px;
}

.skip:focus {
  top: 0;
}

.top {
  z-index: 4;
  border-bottom: 1px solid var(--line);
  background: #fffefaf8;
}

.top-inner,main {
  width: min(1240px,calc(100% - 72px));
  margin: auto;
}

main {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin: 0 auto;
}

.top-inner {
  min-height: 70px;
  display: flex;
  align-items: center;
  gap: 26px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  font-family: "Microsoft JhengHei","PingFang TC",sans-serif;
  letter-spacing: .12em;
  font-size: 1.45rem;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  background: var(--berry);
  color: white;
  width: 39px;
  height: 39px;
  font-family: "PMingLiU","Songti TC",serif;
  font-size: 29px;
  line-height: 1;
  border-radius: 11px 11px 11px 3px;
  letter-spacing: 0;
}

.store-control {
  padding-left: 24px;
  border-left: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 1px;
  max-width: 220px;
}

.store-control label {
  font-size: .69rem;
  color: var(--muted);
  font-weight: 650;
}

.store-control select {
  border: 0;
  background: transparent;
  max-width: 100%;
  font-size: .9rem;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 15px 4px 0;
}

.global {
  margin-left: auto;
  display: flex;
  gap: 17px;
  align-items: center;
}

.global a,.global button {
  font-size: .86rem;
  font-weight: 650;
  white-space: nowrap;
}

.global button {
  padding: 9px 1px;
  background: transparent;
}

.global a {
  border: 1px solid var(--line);
  border-radius: 100px;
  padding: 8px 13px;
}

.global a:hover,.global button:hover {
  color: var(--berry);
}

.page-heading {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin: 18px 0 10px;
}

h1 {
  font-family: "Microsoft JhengHei","PingFang TC",sans-serif;
  font-size: clamp(1.55rem, 4vw, 2.3rem);
  font-weight: 900;
  letter-spacing: -.03em;
}

.demo {
  font-size: .8rem;
  color: var(--muted);
}

.layout {
  display: grid;
  flex: 1;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr) minmax(245px, 300px);
  grid-template-rows: minmax(0, 1fr);
  gap: 24px;
}

.catalog {
  display: flex;
  flex-direction: column;
  min-width: 0;
  min-height: 0;
}

#categories {
  display: flex;
  align-items: center;
  flex: none;
  gap: 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #c9c1b8 transparent;
  padding: 4px 2px 9px;
}

.category {
  flex: none;
  min-height: 44px;
  padding: 8px 16px;
  border-radius: 99px;
  border: 1px solid var(--line);
  background: var(--paper);
  color: #49473e;
  font-size: .95rem;
  line-height: 1.35;
  font-weight: 700;
  white-space: nowrap;
}

#categories.large-text .category {
  font-size: 1.2rem;
  padding: 10px 20px;
}

.category[aria-pressed="true"] {
  background: var(--berry);
  border-color: var(--berry);
  color: white;
}

.view-switch {
  display: flex;
  flex: none;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 2px;
  background: var(--paper);
}

.view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 44px;
  padding: 0 12px;
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: .9rem;
  font-weight: 700;
}

.view[aria-pressed="true"] {
  background: var(--berry);
  color: white;
}

.grid-icon {
  width: 5px;
  height: 5px;
  background: currentColor;
  box-shadow: 7px 0 currentColor,0 7px currentColor,7px 7px currentColor;
  transform: translate(-3px,-3px);
}

.list-icon {
  width: 14px;
  height: 2px;
  background: currentColor;
  box-shadow: 0 -5px currentColor,0 5px currentColor;
}

#dishes {
  display: grid;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  align-content: start;
  grid-auto-rows: max-content;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 2px 2px 18px;
}

@media (min-width: 576px) {
  #dishes {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 768px) {
  #dishes {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.dish {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  text-align: left;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  transition: border-color .15s,box-shadow .15s;
}

.dish:not(:disabled):hover {
  border-color: #aa7c7d;
  box-shadow: 0 5px 16px #4f352217;
}

.photo {
  display: block;
  width: 100%;
  object-fit: cover;
  aspect-ratio: 4/3;
  background: #ebebe4;
}

.dish > .photo,
.dish > .dish-photo-placeholder {
  width: 100%;
  height: 130px;
  flex: none;
}

.dish-photo-placeholder {
  display: grid;
  place-items: center;
  background: #f2ede5;
  color: #847965;
  font-size: 1.8rem;
}

.dish:disabled .photo {
  filter: grayscale(1);
  opacity: .65;
}

.dish-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
  width: 100%;
  padding: 12px;
}

.dish h3 {
  font-size: .95rem;
  line-height: 1.35;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.dish .description {
  display: none;
}

.detail-desc {
  color: var(--muted);
  font-size: .94rem;
  line-height: 1.6;
}

.dish-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding-top: 8px;
  margin-top: auto;
}

.money {
  color: var(--berry-deep);
  font-size: 1.05rem;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.add-icon {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border-radius: 50%;
  background: #f9e4e9;
  color: var(--berry);
  font-size: 1.3rem;
  font-weight: 500;
  line-height: 1;
}

.sold {
  color: #766e67;
  font-size: .76rem;
  background: #efede6;
  border-radius: 4px;
  padding: 4px 6px;
}

#dishes.is-list {
  grid-template-columns: minmax(0, 1fr);
}

.is-list .dish {
  --list-photo-size: min(140px, 36vw);
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--list-photo-size);
  min-height: var(--list-photo-size);
}

.is-list .dish > .photo,
.is-list .dish > .dish-photo-placeholder {
  grid-column: 2;
  grid-row: 1;
  width: var(--list-photo-size);
  height: 100%;
  min-height: var(--list-photo-size);
  aspect-ratio: auto;
}

.is-list .dish-info {
  grid-column: 1;
  grid-row: 1;
  padding: 12px;
}

.is-list .dish h3,
.is-list .money {
  font-size: 1.3rem;
  line-height: 1.4;
}

.is-list .sold {
  font-size: 1rem;
}

.cart-side {
  display: flex;
  flex-direction: column;
  align-self: start;
  min-height: 0;
  max-height: 100%;
  border-radius: var(--radius);
  padding: 22px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.cart-head,.total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.cart-head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 15px;
}

.cart-head h2 {
  font-size: 1.35rem;
}

.count {
  background: #f4e8e9;
  border-radius: 99px;
  color: var(--berry);
  font-weight: 800;
  padding: 5px 10px;
  font-size: .85rem;
}

.cart-empty {
  padding: 32px 0;
  text-align: center;
  color: var(--muted);
  font-size: .89rem;
}

.lines {
  max-height: 43vh;
  overflow-y: auto;
}

.side-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 10px;
  padding: 12px 0;
  border-bottom: 1px solid #eeece3;
  align-items: start;
  font-size: .84rem;
}

.side-line strong {
  font-size: .9rem;
}

.side-line small {
  color: var(--muted);
  grid-column: 1/-1;
}

.side-foot {
  border-top: 1px solid var(--line);
  padding-top: 16px;
}

.total {
  font-weight: 750;
  padding: 0 0 14px;
}

.total strong {
  font-size: 1.2rem;
}

.primary,.secondary {
  border-radius: 10px;
  font-weight: 750;
  font-size: .92rem;
  padding: 12px 16px;
}

.primary {
  background: var(--berry);
  color: white;
}

.primary:hover:enabled {
  background: var(--berry-deep);
}

.side-foot .primary {
  width: 100%;
}

.secondary {
  background: #f1eee7;
}

.mobile-dock {
  display: none;
}

.notice,.empty {
  font-size: .92rem;
  color: var(--muted);
  padding: 20px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.empty {
  grid-column: 1/-1;
}

.notice {
  margin-bottom: 14px;
}

.notice button {
  padding: 6px 12px;
  margin-left: 8px;
  border-radius: 6px;
  background: #f4e7e8;
}

.notice[hidden] {
  display: none;
}

dialog {
  --option-label-size: 1rem;
  --option-rule-size: .85rem;
  --option-heading-size: 1.05rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  width: min(480px,calc(100% - 24px));
  max-height: 90dvh;
  overflow: hidden;
  padding: 0;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 22px 110px #1a100839;
}

body:has(#categories.large-text) dialog {
  --option-label-size: 1.2rem;
  --option-rule-size: 1rem;
  --option-heading-size: 1.3rem;
}

dialog[open] {
  display: flex;
  flex-direction: column;
}

dialog::backdrop {
  background: #251c1f80;
}

.panel-head {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.panel-head h2 {
  font-size: max(1.2rem, var(--option-heading-size));
}

.panel-head button {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #f0eee8;
  font-size: 1.35rem;
}

#panel-body {
  overflow-y: auto;
  overscroll-behavior: contain;
  min-height: 0;
  padding: 18px 20px;
}

#panel-body>.photo {
  max-height: 190px;
  border-radius: 10px;
  margin: 0 0 13px;
}

#panel-actions {
  display: flex;
  flex: none;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding: 14px 20px;
}

#panel-actions:empty {
  display: none;
}

#panel-actions>.primary {
  flex: 1;
}

#panel-actions button {
  min-height: 44px;
  font-size: var(--option-label-size);
}

.detail-desc {
  margin: 0 0 8px;
}

.option-set {
  min-inline-size: 0;
  border: 0;
  padding: 0;
  margin: 18px 0;
}

.option-set legend,.field-title {
  font-weight: 800;
  font-size: var(--option-heading-size);
  margin-bottom: 6px;
}

.option-set legend {
  width: 100%;
  padding: 0;
}

.option-rule {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: var(--option-rule-size);
  font-weight: 650;
  line-height: 1.45;
}

.option-row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 10px 6px;
  font-size: var(--option-label-size);
  line-height: 1.45;
  border-bottom: 1px solid #eeeae2;
  cursor: pointer;
}

.option-row input {
  flex: none;
  accent-color: var(--berry);
  margin: 0;
  width: 1.15em;
  height: 1.15em;
  font-size: inherit;
}

.option-row span:last-child {
  flex: none;
  margin-left: auto;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.option-row:has(:checked) {
  background: #fbeef1;
}

.option-row:has(:disabled) {
  color: var(--muted);
  cursor: default;
}

.option-row:focus-within {
  outline: 2px solid var(--berry);
  outline-offset: -2px;
}

.qty-row,.cart-line,.history-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.qty-row {
  padding-top: 10px;
  font-size: var(--option-label-size);
}

.stepper {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 8px;
  align-items: center;
}

.stepper button {
  width: 34px;
  height: 34px;
  background: transparent;
}

.stepper span {
  min-width: 25px;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-size: .88rem;
}

.qty-row .stepper button {
  width: 44px;
  height: 44px;
}

.qty-row .stepper span {
  font-size: var(--option-label-size);
}

.cart-line,.history-line {
  border-bottom: 1px solid var(--line);
  padding: 11px 0;
}

.cart-line:first-child,.history-line:first-child {
  padding-top: 0;
}

.cart-line>div:first-child {
  min-width: 0;
}

.cart-line strong,.history-line strong,.history-items strong {
  display: block;
  font-size: .95rem;
}

.cart-line small,.history-line small,.history-items small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.cart-line .stepper {
  flex: none;
}

.history-line b {
  white-space: nowrap;
  font-size: .87rem;
}

.history-summary {
  min-height: 44px;
  cursor: pointer;
  list-style: none;
}

.history-summary::-webkit-details-marker {
  display: none;
}

.history-summary::before {
  content: "";
  width: 8px;
  height: 8px;
  flex: none;
  border-right: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: rotate(-45deg);
}

.history-line[open] .history-summary::before {
  transform: rotate(45deg);
}

.history-summary > :first-child {
  flex: 1;
}

.history-items {
  margin-top: 8px;
  padding: 2px 14px;
  background: #f6f3ed;
  border-radius: 8px;
  text-align: start;
  line-height: 1.45;
}

.history-items > div {
  padding: 9px 0;
  overflow-wrap: anywhere;
}

.history-items > div + div {
  border-top: 1px solid var(--line);
}

.panel-total {
  margin-top: 18px;
}

.pay-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.pay-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 13px 9px;
  border: 1px solid var(--line);
  border-radius: 9px;
  font-size: .9rem;
}

.pay-option input {
  accent-color: var(--berry);
}

.pay-option:has(:checked) {
  border-color: var(--berry);
  background: #fbeef1;
}

.payment-hint,.inline-message {
  color: var(--muted);
  font-size: .86rem;
  margin: 14px 0 0;
  line-height: 1.55;
}

.inline-message {
  color: var(--berry);
  font-size: var(--option-rule-size);
  font-weight: 650;
}

.receipt {
  text-align: center;
  padding: 8px 0 18px;
}

.receipt span {
  display: block;
  color: var(--muted);
  font-size: .92rem;
}

.receipt strong {
  display: block;
  color: var(--berry);
  font-size: clamp(2rem,10vw,4rem);
  letter-spacing: .04em;
  overflow-wrap: anywhere;
  line-height: 1.18;
  margin: 7px 0;
}

.receipt p {
  line-height: 1.6;
  font-size: .92rem;
}

.receipt-amount {
  display: block;
  border-top: 1px solid var(--line);
  padding-top: 14px;
  text-align: center;
  font-weight: 700;
}

#toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 6;
  max-width: 90vw;
  text-align: center;
  background: var(--ink);
  color: white;
  border-radius: 9px;
  padding: 9px 16px;
  font-size: .9rem;
  pointer-events: none;
}

#toast:empty {
  display: none;
}

@media(max-width:959px) {
  .top-inner,main {
    width: calc(100% - 32px);
  }
  .top-inner {
    min-height: 62px;
    gap: 12px;
  }
  .brand {
    font-size: 1.12rem;
    gap: 6px;
    letter-spacing: .04em;
  }
  .brand-mark {
    width: 31px;
    height: 31px;
    font-size: 23px;
    border-radius: 8px 8px 8px 2px;
  }
  .store-control {
    max-width: 160px;
    padding-left: 12px;
  }
  .store-control label {
    font-size: .63rem;
  }
  .store-control select {
    font-size: .78rem;
  }
  .global {
    gap: 8px;
  }
  .global a,.global button {
    font-size: .78rem;
  }
  .global a {
    padding: 6px 8px;
  }
  .page-heading {
    margin: 10px 0 4px;
  }
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .cart-side {
    display: none;
  }
  .mobile-dock {
    display: block;
    z-index: 3;
    background: var(--paper);
    border-top: 1px solid var(--line);
    padding: 9px 16px max(9px,env(safe-area-inset-bottom));
  }
  .mobile-dock button {
    width: 100%;
    padding: 13px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: var(--berry);
    color: white;
    border-radius: 11px;
    font-weight: 750;
  }
  .mobile-dock b {
    display: inline-block;
    padding: 1px 6px;
    border-radius: 20px;
    margin-left: 4px;
    background: #ffffff33;
    font-size: .8rem;
  }
  #toast {
    bottom: 80px;
  }
  .demo {
    font-size: .75rem;
  }

  .global a span {
    display: none;
  }
}

@media(max-width:420px) {
  .global {
    gap: 6px;
  }
  .top-inner {
    gap: 7px;
  }
  .store-control {
    padding-left: 7px;
    max-width: 104px;
  }
  .global a {
    border: 0;
    padding: 5px 0;
  }
  .global a,.global button {
    font-size: .73rem;
  }
  .cart-line .stepper button {
    width: 29px;
  }
  .view {
    padding: 0 9px;
  }
}

@media(max-height: 480px) and (max-width: 959px) {
  .top-inner {
    min-height: 43px;
  }
  .page-heading {
    margin: 2px 0;
  }
  .page-heading > div:first-child {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .page-heading h1 {
    font-size: 1.25rem;
  }
  #categories {
    padding-bottom: 3px;
  }
  .mobile-dock {
    padding-block: 4px max(4px, env(safe-area-inset-bottom));
  }
}

@media(prefers-reduced-motion:reduce) {
  * {
    scroll-behavior: auto!important;
    transition: none!important;
  }
}

.remove {
  margin-top: 6px;
  background: transparent;
  color: var(--berry);
  padding: 2px 0;
  text-decoration: underline;
  text-underline-offset: 3px;
  font-size: .77rem;
}

.custom-inquiry { display: inline-block; font-size: .8rem; color: inherit; text-underline-offset: .2em; }
.custom-inquiry:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
