:root {
  --bg: #f7f4ea;
  --surface: #fffefa;
  --surface-2: #edf4ee;
  --surface-sage: #f3f7f1;
  --surface-warm: #fbf7ec;
  --ink: #17211b;
  --muted: #657268;
  --line: #dbe3d8;
  --accent: #16834a;
  --accent-2: #0f6d54;
  --warn: #9a5b00;
  --danger: #b42318;
  --shadow: 0 12px 32px rgba(69, 62, 42, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 0%, rgba(22, 131, 74, 0.045), transparent 30rem),
    linear-gradient(180deg, #fbf8ef 0, var(--bg) 300px);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Segoe UI", "Noto Sans TC", system-ui, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app {
  min-height: 100vh;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px clamp(16px, 4vw, 40px);
  background: rgba(247, 244, 234, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

h1,
h2,
h3,
p {
  margin: 0;
}

h1 {
  font-size: clamp(24px, 3vw, 36px);
}

.topbar-title {
  flex: 1 1 auto;
  min-width: 0;
}

/* 方案 C（Owner 2026-10-02）：頁首只留店名與購物車，不擋下單。 */
.topbar-brand {
  display: block;
  color: var(--ink);
  font-size: 18px;
  font-weight: 800;
}

/* 店家資訊與市場公休日集中在「基本資料」頁末。 */
.store-info-block {
  display: grid;
  gap: 10px;
  margin-top: 24px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

/* 下單身分與瀏覽器提醒移到購物車頂端，結帳時才看得到。 */
.cart-scroll > .ordering-identity {
  margin-bottom: 12px;
}

.cart-scroll > .browser-surface-notice {
  margin-bottom: 14px;
}

.history-section > .customer-feedback-callout {
  margin-top: 24px;
}

.business-contact-details {
  min-width: 0;
}

.business-contact-details summary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(15, 109, 84, 0.22);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.9);
  color: #233326;
  cursor: pointer;
  font-weight: 800;
  list-style: none;
}

.business-contact-details summary::-webkit-details-marker {
  display: none;
}

.business-contact-details summary span {
  color: var(--accent-2);
  font-size: 13px;
}

.business-contact-details summary strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.business-contact-details summary::after {
  content: "展開";
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
}

.business-contact-details[open] summary::after {
  content: "收合";
}

.business-contact {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
  color: #233326;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.5;
}

.business-contact span {
  padding: 4px 9px;
  border: 1px solid rgba(15, 109, 84, 0.2);
  border-radius: 6px;
  background: rgba(255, 254, 250, 0.86);
  white-space: nowrap;
}

.ordering-identity {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  min-height: 34px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid rgba(23, 33, 27, 0.13);
  border-radius: 8px;
  background: rgba(243, 247, 241, 0.9);
  color: var(--ink);
}

.ordering-identity span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ordering-identity strong {
  min-width: 0;
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-notice-details {
  width: 100%;
}

.market-notice-details > summary {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(154, 91, 0, 0.28);
  border-radius: 8px;
  background: #fff8e8;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}

.market-notice-details > summary::-webkit-details-marker {
  display: none;
}

.market-notice-icon {
  display: grid;
  flex: 0 0 30px;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: 999px;
  background: #f0b429;
  color: #473000;
  font-size: 13px;
  font-weight: 900;
}

.market-notice-copy {
  display: flex;
  min-width: 0;
  flex: 1 1 auto;
  align-items: baseline;
  gap: 8px;
}

.market-notice-copy strong {
  flex: 0 0 auto;
  color: #6d4400;
  font-size: 14px;
}

.market-notice-copy small {
  min-width: 0;
  overflow: hidden;
  color: #665a43;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-notice-details > summary::after {
  content: "展開";
  flex: 0 0 auto;
  color: var(--warn);
  font-size: 12px;
  font-weight: 800;
}

.market-notice-details[open] > summary::after {
  content: "收合";
}

.topbar-announcement {
  width: min(680px, 100%);
  margin-top: 8px;
  padding: 8px 10px;
  border-left: 3px solid #d48a00;
  border-radius: 4px;
  background: #fff8e8;
  color: #6d4400;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.topbar-announcement:empty {
  display: none;
}

.cart-button,
.submit-button,
.category-tabs button,
.qty-row button {
  border: 0;
  cursor: pointer;
}

.cart-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 8px 14px;
  border-radius: 8px;
  background: var(--ink);
  color: white;
}

.cart-button strong {
  display: grid;
  min-width: 26px;
  height: 26px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
}

.unsent-cart-reminder {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(74px + env(safe-area-inset-bottom));
  z-index: 34;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 8px clamp(16px, 4vw, 40px);
  border-bottom: 2px solid #f2a100;
  background: #fff1bf;
  color: #5f3a00;
  box-shadow: 0 8px 22px rgba(95, 58, 0, 0.16);
}

.unsent-cart-reminder div,
.unsent-cart-reminder span {
  display: block;
}

.unsent-cart-reminder strong {
  font-size: 16px;
}

/* 提示列出現時，頁面底部多留白（底部導覽＋提示列＋喘息空間），最後一張卡片的按鈕能捲到提示列上方。 */
body:has(#unsentCartReminder:not(.hidden)) .shop {
  padding-bottom: calc(230px + env(safe-area-inset-bottom));
}

.unsent-cart-reminder button {
  flex: 0 0 auto;
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  background: #7a4700;
  color: white;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 900;
}

.identity-panel {
  max-width: 680px;
  margin: 64px auto;
  padding: 28px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.identity-panel p {
  margin-top: 10px;
  color: var(--muted);
}

.identity-relogin {
  width: 100%;
  margin: 12px 0;
  padding: 13px 16px;
  border: 0;
  border-radius: 12px;
  background: #1f6f43;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.browser-surface-notice {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border: 1px solid #d8c7a8;
  border-radius: 10px;
  background: #fff8e8;
  color: #5f421d;
}

.browser-surface-notice strong {
  font-size: 14px;
}

.browser-surface-notice span {
  font-size: 13px;
  line-height: 1.5;
}

.browser-surface-notice.hidden {
  display: none;
}

.identity-application-form {
  display: grid;
  gap: 14px;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.identity-application-form.hidden {
  display: none;
}

.identity-application-form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.identity-line-profile {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: end;
}

.identity-avatar {
  width: 56px;
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 50%;
  object-fit: cover;
  background: white;
}

.identity-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.identity-form-status {
  min-height: 20px;
  font-weight: 700;
}

.identity-application-form button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.identity-application-form button:disabled {
  opacity: .62;
}

.demo-picker {
  margin-top: 18px;
}

.demo-picker label,
.note-field span,
.search-box span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

select,
input {
  min-height: 42px;
  padding: 8px 10px;
}

textarea {
  padding: 10px;
  resize: vertical;
}

.delivery-date-status {
  display: block;
  margin-top: 6px;
  color: #0f766e;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.45;
}

.delivery-date-status.blocked {
  color: var(--danger);
}

.minimum-delivery-guide {
  display: grid;
  gap: 13px;
  padding: 15px;
  border: 1px solid rgba(154, 91, 0, 0.24);
  border-radius: 12px;
  background: linear-gradient(145deg, #fffbef 0%, #fff7e6 100%);
  box-shadow: 0 10px 24px rgba(115, 72, 11, 0.08);
}

.minimum-delivery-guide:focus-visible {
  outline: 3px solid rgba(22, 131, 74, 0.3);
  outline-offset: 3px;
}

.minimum-delivery-summary {
  display: grid;
  gap: 5px;
}

.minimum-delivery-kicker {
  color: #98600a;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.minimum-delivery-summary > strong {
  color: #633d07;
  font-size: 17px;
  line-height: 1.35;
}

.minimum-delivery-summary p {
  color: #765521;
  font-size: 13px;
  line-height: 1.5;
}

.minimum-delivery-progress {
  height: 7px;
  margin-top: 4px;
  overflow: hidden;
  border-radius: 99px;
  background: rgba(154, 91, 0, 0.13);
}

.minimum-delivery-progress span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #d18a17, #16834a);
  transition: width 180ms ease;
}

.minimum-delivery-actions {
  display: grid;
  gap: 8px;
}

.minimum-action {
  position: relative;
  display: grid;
  gap: 2px;
  width: 100%;
  min-height: 54px;
  padding: 10px 42px 10px 12px;
  border: 1px solid rgba(23, 33, 27, 0.12);
  border-radius: 9px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.minimum-action::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: 14px;
  translate: 0 -50%;
  font-size: 24px;
  line-height: 1;
}

.minimum-action strong {
  font-size: 15px;
}

.minimum-action small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.minimum-action.continue {
  border-color: #16834a;
  background: #16834a;
  color: #fff;
}

.minimum-action.continue small {
  color: rgba(255, 255, 255, 0.83);
}

.minimum-action.pickup {
  border-color: rgba(15, 109, 84, 0.35);
  background: #f2f9f5;
}

.minimum-action.request {
  border-color: rgba(180, 74, 24, 0.28);
  background: #fffaf6;
  color: #8b421f;
}

.minimum-action.selected {
  border-width: 2px;
  border-color: #0f6d54;
  box-shadow: 0 0 0 3px rgba(15, 109, 84, 0.1);
}

.minimum-action.selected::after {
  content: "✓";
  color: #0f6d54;
  font-size: 18px;
  font-weight: 900;
}

.minimum-delivery-decision-status {
  min-height: 18px;
  color: #5f4c29;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.45;
}

input.blocked {
  border-color: rgba(180, 35, 24, 0.6);
  background: #fff7f7;
}

.shop {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 18px clamp(14px, 3vw, 28px) 110px;
}

.section {
  margin-top: 24px;
}

.profile-section {
  margin-top: 18px;
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.account-section {
  display: grid;
  gap: 12px;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.section-head.compact {
  align-items: center;
  margin-bottom: 10px;
}

.section-head h2 {
  font-size: 22px;
}

.section-kicker {
  margin: 0 0 2px;
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.section-head > span {
  color: var(--muted);
  font-size: 14px;
}

.section-head button,
.profile-form button {
  min-height: 36px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
  padding: 0 12px;
}

.account-overview {
  display: grid;
  gap: 10px;
}

.account-sections {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-panel {
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.account-panel-basic {
  border-color: rgba(22, 131, 74, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 254, 250, 0.98), rgba(237, 244, 238, 0.96)),
    repeating-linear-gradient(135deg, rgba(15, 109, 84, 0.035) 0 1px, transparent 1px 8px);
}

.account-panel-head span,
.payment-ledger span,
.payment-method span,
.holiday-summary-group > span,
.account-identity > div > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.account-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 13px;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(15, 61, 46, 0.09);
}

.account-panel-head > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.account-panel-head h3 {
  font-size: 17px;
  line-height: 1.25;
}

.account-panel-head strong {
  color: var(--accent-2);
  font-size: 12px;
  line-height: 1.4;
  text-align: right;
}

.account-identity {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.account-identity-mark {
  display: inline-grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border-radius: 14px 14px 14px 5px;
  background: #173d2a;
  color: white;
  font-size: 19px;
  font-weight: 950;
  box-shadow: 0 7px 16px rgba(23, 61, 42, 0.14);
}

.account-identity h3 {
  margin-top: 3px;
  overflow-wrap: anywhere;
  font-size: 22px;
  line-height: 1.2;
}

.account-line-status {
  margin-top: 5px;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 800;
}

.profile-summary,
.holiday-summary {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.profile-summary strong,
.holiday-summary > strong {
  color: var(--ink);
}

.holiday-summary {
  display: grid;
  gap: 10px;
}

.holiday-summary p {
  margin: 0;
}

.holiday-summary small {
  color: var(--muted);
  font-size: 12px;
}

.holiday-summary-group {
  display: grid;
  gap: 7px;
}

.holiday-chips {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
}

.holiday-chips strong {
  padding: 5px 9px;
  border: 1px solid rgba(15, 109, 84, 0.18);
  border-radius: 999px;
  background: #edf8f0;
  color: var(--accent-2);
  font-size: 13px;
}

.holiday-chips-temporary strong {
  border-color: rgba(154, 91, 0, 0.2);
  background: #fff8eb;
  color: var(--warn);
}

.payment-method {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.payment-method strong {
  color: var(--ink);
  font-size: 14px;
  text-align: right;
}

.account-payment-summary {
  display: grid;
  gap: 8px;
}

.payment-ledger {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(15, 109, 84, 0.16);
  border-radius: 8px;
  background: #f4fbf5;
}

.payment-ledger.has-unpaid {
  border-color: rgba(154, 91, 0, 0.24);
  background: #fff8eb;
}

.payment-ledger strong {
  color: var(--accent-2);
  font-size: 26px;
  line-height: 1.1;
}

.payment-ledger.has-unpaid strong {
  color: var(--warn);
}

.payment-ledger small,
.account-muted {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(15, 109, 84, 0.2);
  border-radius: 10px;
  background: #f8fbf8;
}

.profile-form-group {
  display: grid;
  gap: 10px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: #fff;
}

.profile-form-heading {
  display: flex;
  align-items: flex-start;
  gap: 9px;
}

.profile-form-heading > span {
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.profile-form-heading h3 {
  font-size: 16px;
}

.profile-form-heading p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.profile-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.checkout-profile-guidance {
  padding: 12px 14px;
  border: 2px solid #d97706;
  border-radius: 8px;
  background: #fff7ed;
  color: #7c2d12;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.5;
}

.checkout-profile-guidance:not(.hidden) + .profile-form {
  border: 1px solid rgba(217, 119, 6, 0.35);
  background: #fffdf8;
}

.profile-form label span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.profile-form .full,
.profile-form button {
  grid-column: 1 / -1;
}

.profile-form button {
  background: var(--accent);
  color: white;
}

.holiday-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
}

.holiday-toggle input {
  width: 18px;
  min-height: 18px;
  margin: 0;
  flex: 0 0 auto;
}

.holiday-toggle span {
  margin: 0;
  color: var(--ink);
}

.holiday-weekday {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.holiday-weekday legend {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  padding: 0 4px;
}

.holiday-weekday label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfa;
  padding: 5px 9px;
  color: var(--ink);
  font-weight: 800;
}

.holiday-weekday input {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

.temporary-holiday {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.temporary-holiday > button {
  grid-column: auto;
  min-height: 42px;
  background: var(--surface-2);
  color: var(--ink);
}

.temporary-holiday-list {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.temporary-holiday-list button {
  min-height: 32px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff7f7;
  color: var(--danger);
  padding: 4px 10px;
}

.history-section {
  padding: 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.history-list {
  display: grid;
  gap: 10px;
}

.order-center-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px;
  margin: 12px 0;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-2);
}

#refreshHistory {
  min-width: 88px;
  white-space: nowrap;
}

.customer-feedback-callout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  margin-bottom: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(15, 109, 84, 0.2);
  border-left: 4px solid var(--accent-2);
  border-radius: 10px;
  background:
    linear-gradient(110deg, rgba(235, 246, 238, 0.98), rgba(255, 252, 235, 0.96)),
    repeating-linear-gradient(135deg, rgba(15, 109, 84, 0.025) 0 1px, transparent 1px 9px);
  box-shadow: 0 8px 24px rgba(35, 72, 50, 0.09);
}

.customer-feedback-callout > div {
  display: grid;
  gap: 3px;
}

.customer-feedback-callout > div span {
  color: #8b6200;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.04em;
}

.customer-feedback-callout strong {
  color: var(--ink);
  font-size: clamp(15px, 2vw, 18px);
  line-height: 1.45;
}

.customer-feedback-callout .customer-feedback-trigger {
  min-height: 44px;
  border: 1px solid rgba(15, 109, 84, 0.22);
  border-radius: 8px;
  background: var(--accent-2);
  color: #fff;
  padding: 0 16px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 6px 16px rgba(15, 109, 84, 0.18);
}

.customer-feedback-trigger span {
  display: inline-block;
  margin-right: 3px;
  color: #f7d98a;
}

.order-center-tabs button {
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-weight: 900;
}

.order-center-tabs button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 2px 8px rgba(30, 41, 32, 0.08);
}

.order-center-tabs span {
  display: inline-grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  margin-left: 5px;
  border-radius: 999px;
  background: rgba(15, 109, 84, 0.1);
  font-size: 12px;
}

.history-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.history-item.is-unpaid {
  border-color: rgba(180, 35, 24, 0.28);
  background: #fffafa;
}

.history-item.is-estimate {
  border-color: rgba(177, 123, 0, 0.34);
  background: #fffdf7;
}

.history-item > div,
.history-item footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-item span {
  flex: 0 0 auto;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 800;
}

.history-item .history-order-status.status-new {
  background: #fff1c7;
  color: #765000;
}

.history-item .history-order-status.status-preparing {
  background: #e9f2ff;
  color: #17558b;
}

.history-item .history-order-status.status-delivering {
  background: #e9f7ee;
  color: #17633f;
}

.history-item .history-order-status.status-delivered {
  background: #e5f6f1;
  color: #0f6d54;
}

.history-item .history-order-status.status-canceled {
  background: #f3f3f3;
  color: #666;
}

.history-item.is-pending-sync {
  border-color: rgba(177, 123, 0, 0.34);
  background: #fffdf7;
}

.order-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-card-head > div {
  display: grid;
  gap: 2px;
}

.order-contents {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(15, 109, 84, 0.18);
  border-radius: 7px;
  background: rgba(238, 248, 243, 0.72);
}

.order-contents.is-summary-only {
  border-style: dashed;
  background: #fff;
}

.order-contents-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.order-contents-head h3 {
  margin: 0;
  color: var(--accent-2);
  font-size: 14px;
}

.order-contents-head small {
  color: var(--muted);
  font-weight: 800;
}

.order-contents > p {
  margin: 0;
  color: var(--ink);
  font-weight: 800;
}

.order-contents-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.order-contents-list li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid rgba(15, 61, 46, 0.1);
}

.order-contents-list li:first-child {
  padding-top: 0;
  border-top: 0;
}

.order-contents-list li:last-child {
  padding-bottom: 0;
}

.order-contents-list li > strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.order-contents-list li > div {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
}

.order-contents-list b {
  color: var(--ink);
  white-space: nowrap;
}

.order-contents-list small,
.order-contents-note {
  color: var(--muted);
  font-size: 11px;
}

.order-status-grid {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px !important;
}

.order-status-grid > div {
  display: grid;
  min-width: 0;
  gap: 3px;
  padding: 9px;
  border: 1px solid rgba(15, 61, 46, 0.1);
  border-radius: 6px;
  background: #fff;
}

.order-status-grid span {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-size: 11px;
}

.order-status-grid strong {
  min-width: 0;
  color: var(--ink);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.order-editability {
  display: grid !important;
  justify-content: stretch !important;
  gap: 3px !important;
  padding: 9px 10px;
  border-left: 3px solid #b17b00;
  background: #fff8df;
}

.order-editability span {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: #5f470d;
  font-size: 13px;
}

.order-local-preview-note {
  color: var(--danger) !important;
  font-weight: 900;
}

.order-timeline summary {
  cursor: pointer;
  color: var(--accent-2);
  font-size: 13px;
  font-weight: 900;
}

.order-timeline ol {
  display: grid;
  gap: 8px;
  margin: 8px 0 0;
  padding: 0 0 0 18px;
}

.order-timeline li {
  display: grid;
  gap: 2px;
  color: var(--muted);
  font-size: 12px;
}

.order-timeline li span {
  padding: 0;
  border-radius: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
}

.order-card-actions {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px !important;
}

.history-progress {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  margin: 2px 0 0;
  padding: 0;
  list-style: none;
}

.history-progress li {
  position: relative;
  min-width: 0;
  padding-top: 17px;
  color: #8a918b;
  font-size: 11px;
  font-weight: 800;
  text-align: center;
}

.history-progress li::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 50%;
  z-index: 2;
  width: 9px;
  height: 9px;
  border: 2px solid #c8ceca;
  border-radius: 50%;
  background: #fff;
  transform: translateX(-50%);
}

.history-progress li::after {
  content: "";
  position: absolute;
  top: 8px;
  right: 50%;
  width: 100%;
  height: 2px;
  background: #dfe3e0;
}

.history-progress li:first-child::after {
  display: none;
}

.history-progress li.done,
.history-progress li.current {
  color: var(--accent-2);
}

.history-progress li.done::before,
.history-progress li.current::before {
  border-color: var(--accent-2);
  background: var(--accent-2);
}

.history-progress li.done::after,
.history-progress li.current::after {
  background: var(--accent-2);
}

.history-progress span {
  display: block;
  padding: 0 2px;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  overflow-wrap: anywhere;
}

.history-sync-note {
  color: #765000;
  font-weight: 800;
}

.history-item p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.45;
}

.history-item small {
  min-width: 0;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.history-settlement {
  display: grid;
  gap: 5px;
  padding: 12px;
  border: 1px solid rgba(15, 109, 84, 0.18);
  border-radius: 8px;
  background: #f2fbf5;
}

.history-settlement.has-unpaid {
  border-color: rgba(180, 35, 24, 0.26);
  background: #fff7f5;
}

.history-settlement div,
.history-payment-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.history-settlement-breakdown {
  display: grid;
  gap: 4px;
  margin: 3px 0;
}

.history-settlement-breakdown div {
  min-height: 24px;
  border-top: 1px solid rgba(15, 61, 46, 0.1);
  padding-top: 4px;
}

.history-settlement-breakdown dt,
.history-settlement-breakdown dd {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-settlement-breakdown dd {
  color: var(--ink);
}

.history-settlement span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.history-settlement strong {
  color: var(--ink);
  font-size: 20px;
}

.history-settlement.has-unpaid strong {
  color: var(--danger);
}

.history-settlement p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.history-payment {
  flex: 0 0 auto;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.history-payment.paid {
  background: #e9f7ee;
  color: var(--accent-2);
}

.history-payment.unpaid {
  background: #ffe8e5;
  color: var(--danger);
}

.history-payment.pending {
  background: #fff1c7;
  color: #765000;
}

@media (max-width: 480px) {
  .history-payment-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

.search-box {
  width: min(260px, 48vw);
}

.category-tabs {
  position: sticky;
  top: 81px;
  z-index: 10;
  display: flex;
  gap: 8px;
  margin: 18px -2px 0;
  padding: 10px 2px;
  overflow-x: auto;
  background: rgba(247, 244, 234, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(10px);
}

.category-tabs button {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  border: 1px solid var(--line);
}

.category-tabs button.active {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.category-tabs button.special-request {
  background: #fff4e8;
  color: var(--danger);
  border-color: #efb27c;
  font-weight: 800;
}

.category-tabs button.special-request.active {
  background: var(--danger);
  color: white;
  border-color: var(--danger);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.product-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-card.needs-final-price {
  border-color: #f1b6b6;
  background: #fffafa;
}

.product-image {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  background: linear-gradient(135deg, #dce8dd, #f3f5ef);
}

.product-image.has-image {
  background-size: cover;
  background-position: center;
}

.product-title-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 8px;
}

.product-title-row h3 {
  min-width: 0;
  font-size: 17px;
  line-height: 1.3;
}

.product-actions {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
}

.favorite-toggle {
  min-height: 26px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: white;
  color: var(--muted);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  padding: 3px 8px;
}

.favorite-toggle.active {
  background: #fff3db;
  border-color: #e4bf77;
  color: var(--warn);
}

.price-type {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--accent-2);
  font-size: 12px;
  font-weight: 700;
}

.price-type.floating,
.price-type.quote {
  background: #ffe5e5;
  color: var(--danger);
}

.needs-final-price .price-type {
  background: #ffe5e5;
  color: var(--danger);
}

.price-display {
  margin-top: 6px;
  color: var(--ink);
  font-weight: 700;
}

.supply,
.price-note {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.price-note.urgent {
  display: inline-block;
  margin-top: 6px;
  padding: 5px 8px;
  border-radius: 8px;
  background: #ffe5e5;
  color: var(--danger);
  font-weight: 800;
}

.special-request-panel {
  display: grid;
  gap: 10px;
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #efb27c;
  border-radius: 8px;
  background: #fffaf2;
}

.special-request-panel span {
  display: block;
  margin-bottom: 6px;
  color: var(--warn);
  font-size: 13px;
  font-weight: 800;
}

.special-request-panel textarea {
  min-height: 82px;
}

.special-request-file {
  min-height: auto;
  padding: 8px;
  background: white;
}

.special-request-preview {
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 10px;
}

.special-request-preview img {
  width: 72px;
  height: 72px;
  border-radius: 8px;
  object-fit: cover;
  border: 1px solid var(--line);
}

.special-request-clear {
  min-height: 34px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--danger);
  cursor: pointer;
  font-weight: 800;
}

.qty-row {
  display: grid;
  grid-template-columns: 34px minmax(56px, 1fr) auto 34px;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
}

.qty-row button {
  height: 34px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
}

.qty-input {
  min-height: 34px;
  text-align: center;
}

.unit {
  min-width: 24px;
  color: var(--muted);
  font-size: 14px;
}

.add-to-cart {
  width: 100%;
  min-height: 38px;
  margin-top: 10px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 800;
}

.add-to-cart:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  justify-content: end;
  background: rgba(15, 25, 19, 0.34);
}

.cart-drawer.open {
  display: flex;
}

.cart-panel {
  width: min(430px, 100%);
  height: 100%;
  max-height: 100dvh;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.cart-scroll {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  /* 購物車只上下捲動，不可左右滑（Owner 2026-10-02 手機回報）。 */
  overflow-x: hidden;
  touch-action: pan-y;
  overscroll-behavior-y: contain;
  -webkit-overflow-scrolling: touch;
}

.cart-scroll > * {
  flex-shrink: 0;
  min-width: 0;
  max-width: 100%;
}

/* iOS 的日期欄位有內建最小寬度，會把購物車撐寬。 */
.cart-panel input[type="date"] {
  display: block;
  min-width: 0;
  max-width: 100%;
  -webkit-appearance: none;
  appearance: none;
}

.cart-checkout {
  flex: 0 0 auto;
  display: grid;
  gap: 10px;
  padding-top: 12px;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.cart-head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-head button {
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  font-size: 24px;
}

.cart-prefill-notice {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  margin: 0;
  border: 1px solid #d8b768;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff9e8, #fff4cc);
  padding: 14px;
  color: #6b4a09;
  box-shadow: 0 10px 28px rgba(107, 74, 9, 0.08);
}

.cart-prefill-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: #224f3d;
  color: #fff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
}

.cart-prefill-copy {
  min-width: 0;
  display: grid;
  gap: 3px;
  line-height: 1.45;
}

.cart-prefill-copy strong {
  color: #3f2e08;
  font-size: 15px;
}

.cart-prefill-copy > span {
  font-size: 13px;
  font-weight: 750;
}

.cart-prefill-copy small {
  color: #7c621e;
  font-size: 12px;
  font-weight: 850;
}

.cart-prefill-notice.success {
  border-color: rgba(28, 111, 79, 0.35);
  background: linear-gradient(135deg, #eaf5ef, #dff1e7);
  color: #174f3a;
}

.cart-prefill-notice.success .cart-prefill-copy strong,
.cart-prefill-notice.success .cart-prefill-copy small {
  color: #174f3a;
}

.cart-prefill-notice.error {
  border-color: rgba(180, 55, 31, 0.28);
  background: linear-gradient(135deg, #fff4ee, #ffe9dd);
  color: #8b2f1d;
}

.cart-prefill-notice.error .cart-prefill-mark {
  background: #8b2f1d;
}

.cart-prefill-notice.error .cart-prefill-copy strong,
.cart-prefill-notice.error .cart-prefill-copy small {
  color: #8b2f1d;
}

.cart-prefill-notice.is-busy .cart-prefill-mark {
  animation: cart-prefill-pulse 1.2s ease-in-out infinite;
}

@keyframes cart-prefill-pulse {
  50% { transform: scale(0.94); opacity: 0.72; }
}

@media (prefers-reduced-motion: reduce) {
  .cart-prefill-notice.is-busy .cart-prefill-mark { animation: none; }
}

.cart-items {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.cart-item:last-child {
  border-bottom: 0;
}

.cart-item p {
  color: var(--muted);
  font-size: 13px;
}

.cart-special-note {
  margin-top: 4px;
  color: var(--warn) !important;
  overflow-wrap: anywhere;
}

.cart-price-pending,
.cart-warning {
  color: var(--danger) !important;
  font-weight: 800;
}

.cart-warning {
  margin-top: 3px;
}

.quote-intent {
  display: grid;
  gap: 6px;
  margin-top: 8px;
  padding: 8px;
  border: 1px solid #efb27c;
  border-radius: 8px;
  background: #fffaf2;
}

.quote-intent legend {
  padding: 0 4px;
  color: var(--warn);
  font-size: 13px;
  font-weight: 800;
}

.quote-intent label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  font-size: 13px;
  font-weight: 700;
}

.quote-intent input {
  width: auto;
  min-height: auto;
}

.cart-item-actions {
  display: grid;
  justify-items: end;
  gap: 8px;
}

.cart-qty-control {
  display: grid;
  grid-template-columns: 32px 64px auto 32px;
  align-items: center;
  gap: 6px;
}

.cart-qty-control button {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-weight: 800;
}

.cart-qty-input {
  min-height: 32px;
  padding: 4px 6px;
  text-align: center;
}

.cart-qty-control span {
  color: var(--muted);
  font-size: 13px;
}

.cart-remove {
  border: 0;
  background: transparent;
  color: var(--danger);
  cursor: pointer;
}

.cart-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 18px;
}

.price-warning {
  color: var(--warn);
  font-size: 14px;
  line-height: 1.45;
}

.same-day-delivery-prompt {
  display: grid;
  gap: 10px;
  margin: 0;
  border: 2px solid #d97706;
  border-radius: 8px;
  background: #fff7ed;
  padding: 14px;
}

.same-day-delivery-prompt legend {
  padding: 0 6px;
  color: #9a3412;
  font-weight: 900;
}

.same-day-delivery-prompt p {
  color: #7c2d12;
  font-size: 14px;
  line-height: 1.5;
}

.same-day-delivery-prompt label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid rgba(217, 119, 6, 0.34);
  border-radius: 8px;
  background: white;
  padding: 10px;
  cursor: pointer;
}

.same-day-delivery-prompt input {
  width: auto;
  min-height: auto;
  margin-top: 4px;
}

.same-day-delivery-prompt span,
.same-day-delivery-prompt small {
  display: block;
}

.same-day-delivery-prompt small {
  margin-top: 2px;
  color: var(--muted);
}

.notice-section {
  display: grid;
  gap: 12px;
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(154, 91, 0, 0.2);
  border-radius: 8px;
  background: rgba(255, 254, 250, 0.98);
  box-shadow: 0 10px 24px rgba(67, 50, 16, 0.09);
}

.announcement-cards {
  display: grid;
  gap: 10px;
}

.announcement-cards article,
.holiday-card {
  border: 1px solid rgba(15, 61, 46, 0.12);
  border-radius: 8px;
  background: #fffef8;
  padding: 14px;
}

.announcement-cards strong {
  display: block;
  margin-bottom: 4px;
  color: var(--accent);
  font-size: 15px;
}

.announcement-cards .maintenance-card {
  border-color: rgba(180, 35, 24, 0.32);
  background: #fff7f5;
}

.announcement-cards .maintenance-card strong {
  color: var(--danger);
}

.announcement-cards p,
.holiday-list p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.holiday-head {
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.holiday-head h2 {
  margin: 0;
  font-size: 22px;
}

.holiday-head span {
  color: var(--muted);
  font-size: 14px;
}

.holiday-head button {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 24px;
  font-weight: 900;
}

.holiday-list {
  display: grid;
  gap: 8px;
}

.holiday-list article {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 10px;
  border-top: 1px solid rgba(15, 61, 46, 0.1);
  padding-top: 10px;
}

.holiday-list article:first-child {
  border-top: 0;
  padding-top: 0;
}

.holiday-list strong {
  color: #b4371f;
  font-size: 14px;
}

.holiday-list span {
  display: block;
  margin-bottom: 2px;
  color: var(--ink);
  font-weight: 800;
}

.meat-subcategory-tabs {
  display: flex;
  gap: 8px;
  margin: -8px 0 18px;
  overflow-x: auto;
  padding: 0 0 6px;
}

.meat-subcategory-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid rgba(180, 55, 31, 0.22);
  border-radius: 8px;
  background: #fff8f3;
  color: #74301f;
  padding: 0 13px;
  font-weight: 900;
}

.meat-subcategory-tabs button.active {
  background: #b4371f;
  color: #fff;
}

.meat-subcategory-tabs span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.75);
  color: #74301f;
  padding: 2px 7px;
  font-size: 12px;
}

.meat-subcategory-tabs button.active span {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

.submit-button {
  min-height: 48px;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  font-weight: 800;
}

.submit-button:disabled {
  cursor: not-allowed;
  opacity: 0.65;
}

.submit-status {
  min-height: 20px;
  color: var(--accent-2);
  font-size: 14px;
}

.hidden {
  display: none !important;
}

.view-hidden {
  display: none !important;
}

.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 35;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  padding: 7px max(10px, env(safe-area-inset-left)) calc(7px + env(safe-area-inset-bottom)) max(10px, env(safe-area-inset-right));
  border-top: 1px solid rgba(15, 61, 46, 0.14);
  background: rgba(255, 254, 250, 0.97);
  box-shadow: 0 -12px 28px rgba(30, 41, 32, 0.1);
  backdrop-filter: blur(14px);
}

.bottom-nav button {
  position: relative;
  display: grid;
  place-items: center;
  gap: 3px;
  min-height: 54px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #6b756d;
  cursor: pointer;
}

.bottom-nav button.active {
  color: var(--accent);
  background: #eef7f0;
}

.bottom-nav span {
  font-size: 22px;
  line-height: 1;
}

.bottom-nav strong {
  font-size: 11px;
  line-height: 1.2;
  white-space: nowrap;
}

.bottom-nav em {
  position: absolute;
  top: 4px;
  right: clamp(10px, 22%, 24px);
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: var(--danger);
  color: white;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
}

.history-reorder,
.order-edit-action {
  width: 100%;
  min-height: 38px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: white;
  cursor: pointer;
  font-weight: 900;
}

.order-edit-action {
  background: #b4371f;
}

.history-reorder:disabled {
  background: var(--surface-2);
  color: var(--muted);
  cursor: not-allowed;
}

.history-action-status {
  min-height: 20px;
  margin-top: 10px;
  color: var(--accent-2);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.45;
}

.history-action-status.warning {
  color: var(--danger);
}

.order-edit-dialog {
  width: min(680px, calc(100vw - 24px));
  max-height: min(820px, calc(100vh - 24px));
  border: 0;
  border-radius: 8px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(18, 31, 22, 0.3);
}

.order-edit-dialog::backdrop {
  background: rgba(18, 31, 22, 0.56);
  backdrop-filter: blur(3px);
}

.customer-feedback-dialog {
  width: min(620px, calc(100vw - 24px));
  max-height: min(860px, calc(100vh - 24px));
  border: 0;
  border-radius: 12px;
  padding: 0;
  color: var(--ink);
  box-shadow: 0 28px 80px rgba(18, 31, 22, 0.3);
}

.customer-feedback-dialog::backdrop {
  background: rgba(18, 31, 22, 0.58);
  backdrop-filter: blur(3px);
}

.customer-feedback-panel {
  max-height: min(860px, calc(100vh - 24px));
  overflow: auto;
  background:
    linear-gradient(145deg, rgba(255, 254, 250, 0.98), rgba(243, 247, 241, 0.98)),
    repeating-linear-gradient(135deg, rgba(15, 109, 84, 0.025) 0 1px, transparent 1px 9px);
}

.customer-feedback-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid rgba(15, 109, 84, 0.14);
}

.customer-feedback-panel > header > div {
  display: grid;
  gap: 3px;
}

.customer-feedback-panel > header span {
  color: #b16a00;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.customer-feedback-panel > header h2,
.customer-feedback-panel > header p {
  margin: 0;
}

.customer-feedback-panel > header h2 {
  font-size: 24px;
}

.customer-feedback-panel > header p {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.customer-feedback-panel > header button {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: rgba(15, 109, 84, 0.09);
  color: var(--ink);
  font-size: 24px;
}

#customerFeedbackForm {
  display: grid;
  gap: 12px;
  padding: 16px 20px 20px;
}

.customer-feedback-question {
  display: grid;
  gap: 9px;
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.9);
}

.customer-feedback-question legend,
.customer-feedback-note > span {
  padding: 0 5px;
  color: var(--ink);
  font-weight: 900;
}

.customer-feedback-question legend span,
.customer-feedback-note b {
  margin-right: 6px;
  color: var(--accent-2);
  font-size: 12px;
  letter-spacing: 0.08em;
}

.customer-feedback-options {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.customer-feedback-options label {
  position: relative;
  min-height: 38px;
  cursor: pointer;
}

.customer-feedback-options input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.customer-feedback-options label {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid #ced9ce;
  border-radius: 999px;
  background: #fff;
  color: #39483d;
  font-size: 14px;
  font-weight: 800;
}

.customer-feedback-options label:has(input:checked) {
  border-color: var(--accent-2);
  background: var(--accent-2);
  color: #fff;
  box-shadow: 0 4px 12px rgba(15, 109, 84, 0.16);
}

.customer-feedback-options label:has(input:focus-visible) {
  outline: 3px solid rgba(22, 131, 74, 0.2);
  outline-offset: 2px;
}

.customer-feedback-note {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 254, 250, 0.9);
}

.customer-feedback-note textarea {
  width: 100%;
  resize: vertical;
  border: 1px solid #ced9ce;
  border-radius: 8px;
  background: #fff;
  padding: 10px;
  color: var(--ink);
  line-height: 1.5;
}

.customer-feedback-privacy {
  padding: 10px 12px;
  border-left: 3px solid #b17b00;
  background: #fff8df;
  color: #6b531a;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.5;
}

.customer-feedback-status {
  min-height: 21px;
  margin: 0;
  color: var(--accent-2);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.5;
}

.customer-feedback-status.warning {
  color: var(--danger);
}

#customerFeedbackForm footer {
  display: grid;
  grid-template-columns: auto auto 1fr;
  gap: 8px;
}

#customerFeedbackForm footer button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent-2);
  color: #fff;
  padding: 0 14px;
  font-weight: 900;
}

#customerFeedbackForm footer button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.order-edit-panel {
  display: grid;
  gap: 14px;
  max-height: min(820px, calc(100vh - 24px));
  overflow: auto;
  padding: 18px;
  background: #fff;
}

.order-edit-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.order-edit-panel > header > div {
  display: grid;
  gap: 2px;
}

.order-edit-panel > header span {
  color: #b4371f;
  font-size: 12px;
  font-weight: 900;
}

.order-edit-panel > header h2 {
  margin: 0;
  font-size: 22px;
}

.order-edit-panel > header button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--ink);
  font-size: 24px;
}

.order-edit-safety {
  display: grid;
  gap: 3px;
  padding: 10px 12px;
  border-left: 3px solid #b17b00;
  background: #fff8df;
}

.order-edit-safety span {
  color: #6b531a;
  font-size: 13px;
}

.order-edit-items {
  display: grid;
  gap: 8px;
}

.order-edit-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.order-edit-row > div:first-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.order-edit-row strong,
.order-edit-row small {
  overflow-wrap: anywhere;
}

.order-edit-qty {
  display: grid;
  grid-template-columns: 44px 68px auto 44px;
  align-items: center;
  gap: 5px;
}

.order-edit-qty button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--accent);
  font-size: 20px;
  font-weight: 900;
}

.order-edit-qty input {
  width: 68px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  text-align: center;
  font-weight: 900;
}

.order-edit-add {
  display: grid;
  gap: 10px;
  padding-top: 4px;
}

.order-edit-add-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.order-edit-add-heading span,
.order-edit-search span {
  color: var(--muted);
  font-size: 13px;
}

.order-edit-favorites {
  display: grid;
  gap: 8px;
  padding: 10px 0 12px;
  border-block: 1px solid var(--line);
}

.order-edit-favorites > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.order-edit-favorites > header strong {
  color: #a56b00;
}

.order-edit-favorites > header span {
  color: var(--muted);
  font-size: 12px;
}

.order-edit-favorite-products {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 1px 1px 5px;
  scrollbar-width: thin;
}

.order-edit-favorite-button {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  flex: 0 0 min(190px, 64vw);
  align-items: center;
  gap: 8px;
  min-height: 52px;
  border: 1px solid #d8b768;
  border-radius: 6px;
  background: #fff9e8;
  padding: 7px 8px 7px 10px;
  color: var(--ink);
  text-align: left;
}

.order-edit-favorite-button > span {
  display: grid;
  min-width: 0;
  gap: 1px;
}

.order-edit-favorite-button strong,
.order-edit-favorite-button small {
  overflow-wrap: anywhere;
}

.order-edit-favorite-button small {
  color: var(--muted);
}

.order-edit-favorite-button b {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 18px;
}

.order-edit-search {
  display: grid;
  gap: 5px;
}

.order-edit-search input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 12px;
  color: var(--ink);
  font: inherit;
}

.order-edit-search input:focus {
  border-color: var(--accent);
  outline: 3px solid rgba(28, 111, 79, 0.14);
}

.order-edit-category-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 1px 1px 5px;
  scrollbar-width: thin;
}

.order-edit-category-tabs button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  padding: 0 10px;
  color: var(--ink);
  font-weight: 800;
}

.order-edit-category-tabs button span {
  color: var(--muted);
  font-size: 12px;
}

.order-edit-category-tabs button.active {
  border-color: var(--accent);
  background: #eaf5ef;
  color: var(--accent);
}

.order-edit-product-results {
  display: grid;
  max-height: 232px;
  overflow-y: auto;
  border-block: 1px solid var(--line);
}

.order-edit-product-result {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 9px 2px;
  border-bottom: 1px solid var(--line);
}

.order-edit-product-result:last-child {
  border-bottom: 0;
}

.order-edit-product-result > div {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.order-edit-product-result strong,
.order-edit-product-result small {
  overflow-wrap: anywhere;
}

.order-edit-product-result small {
  color: var(--muted);
}

.order-edit-product-result button {
  min-width: 64px;
  min-height: 44px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.order-edit-product-empty {
  margin: 0;
  padding: 18px 8px;
  color: var(--muted);
  text-align: center;
}

.order-edit-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 12px;
  background: var(--surface-2);
}

.order-edit-diff-panel {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(180, 55, 31, 0.22);
  border-radius: 8px;
  background: #fff8f3;
}

.order-edit-diff-panel h3 {
  margin: 0 0 3px;
  font-size: 16px;
}

.order-edit-amount-diff {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  color: #6b301f;
}

.order-edit-amount-diff span {
  font-size: 12px;
  font-weight: 900;
}

.order-edit-diff {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding-top: 7px;
  border-top: 1px solid rgba(180, 55, 31, 0.14);
}

.order-edit-diff span {
  color: #b4371f;
  font-size: 12px;
  font-weight: 900;
}

.order-edit-status {
  min-height: 20px;
  color: var(--danger);
  font-size: 13px;
  font-weight: 800;
}

.order-edit-panel > footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.order-edit-panel > footer button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 900;
}

.order-edit-panel > footer button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.order-edit-panel > footer button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.annotation-toggle {
  position: fixed;
  right: 18px;
  bottom: 90px;
  z-index: 80;
  min-width: 76px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: #0f3d2e;
  color: #fff;
  font-weight: 900;
  letter-spacing: 0;
  box-shadow: 0 14px 34px rgba(15, 61, 46, 0.28);
}

.annotation-toggle.active {
  background: #b4371f;
}

.annotation-layer {
  position: fixed;
  inset: 0;
  z-index: 60;
  cursor: crosshair;
  background: rgba(15, 61, 46, 0.08);
}

.annotation-selection,
.annotation-mark {
  position: fixed;
  border: 2px solid #f05a28;
  border-radius: 8px;
  background: rgba(240, 90, 40, 0.13);
  box-shadow: 0 0 0 9999px rgba(12, 20, 15, 0.08);
  pointer-events: none;
}

.annotation-mark {
  z-index: 62;
  display: grid;
  place-items: start;
  box-shadow: none;
}

.annotation-mark span {
  transform: translate(-2px, -100%);
  border-radius: 6px 6px 0 0;
  background: #f05a28;
  color: #fff;
  padding: 3px 7px;
  font-size: 12px;
  font-weight: 900;
}

.annotation-panel {
  position: fixed;
  z-index: 90;
  width: min(360px, calc(100vw - 28px));
  border: 1px solid rgba(15, 61, 46, 0.16);
  border-radius: 8px;
  background: #fffef8;
  color: var(--ink);
  box-shadow: 0 22px 60px rgba(15, 31, 24, 0.22);
}

.annotation-composer {
  padding: 14px;
  border-top: 1px solid rgba(15, 61, 46, 0.1);
  background: #fffaf2;
}

.annotation-composer label,
.annotation-composer div,
.annotation-actions,
.annotation-toolbar {
  display: grid;
  gap: 10px;
}

.annotation-composer span,
.annotation-panel-head span {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.annotation-composer textarea {
  resize: vertical;
  min-height: 96px;
}

.annotation-composer button,
.annotation-actions button,
.annotation-panel-head button {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 800;
}

.annotation-composer button:first-child,
.annotation-actions button:first-child,
.annotation-toolbar button {
  background: var(--accent);
  color: #fff;
}

.annotation-panel {
  right: 18px;
  bottom: 78px;
  max-height: min(620px, calc(100vh - 110px));
  display: grid;
  grid-template-rows: auto auto auto 1fr auto;
  overflow: hidden;
}

.annotation-panel-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  border-bottom: 1px solid rgba(15, 61, 46, 0.1);
}

.annotation-panel-head div {
  display: grid;
  gap: 4px;
}

.annotation-panel-head button {
  width: 36px;
  border: 0;
  background: var(--surface-2);
  font-size: 22px;
}

.annotation-toolbar {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 61, 46, 0.1);
}

.annotation-toolbar button {
  min-height: 38px;
  border-radius: 8px;
  font-weight: 800;
}

.annotation-toolbar small {
  color: var(--muted);
  line-height: 1.45;
}

.annotation-list {
  display: grid;
  gap: 10px;
  overflow: auto;
  padding: 12px 14px;
}

.annotation-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.annotation-item {
  display: grid;
  gap: 8px;
  border: 1px solid rgba(15, 61, 46, 0.12);
  border-radius: 8px;
  background: #fff;
  padding: 10px;
}

.annotation-item strong {
  color: #b4371f;
  font-size: 13px;
}

.annotation-item p {
  margin: 0;
  line-height: 1.5;
}

.annotation-item button {
  justify-self: end;
  border: 0;
  background: transparent;
  color: var(--danger);
  font-weight: 800;
}

.annotation-actions {
  grid-template-columns: 1fr 1fr;
  padding: 12px 14px 14px;
  border-top: 1px solid rgba(15, 61, 46, 0.1);
}

@media (max-width: 720px) {
  .topbar {
    align-items: flex-start;
    gap: 10px;
    padding: 14px;
  }

  .topbar-title {
    flex: 1 1 auto;
  }

  .topbar .cart-button {
    flex: 0 0 auto;
  }

  .topbar-announcement {
    max-width: calc(100vw - 112px);
  }

  .business-contact-details summary,
  .market-notice-details > summary {
    width: 100%;
  }

  .market-notice-details > summary::after {
    content: "＋";
    font-size: 16px;
  }

  .market-notice-details[open] > summary::after {
    content: "－";
  }

  .market-notice-copy {
    display: grid;
    gap: 0;
  }

  .market-notice-details .notice-section {
    max-height: min(58vh, 520px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .market-notice-details .holiday-head {
    grid-template-columns: 36px 1fr 36px;
    gap: 7px;
  }

  .market-notice-details .holiday-head h2 {
    font-size: 17px;
  }

  .market-notice-details .holiday-head button {
    width: 36px;
    height: 36px;
  }

  .business-contact {
    display: grid;
    gap: 6px;
  }

  .business-contact span {
    white-space: normal;
  }

  .topbar > div:not(.topbar-title) .business-contact {
    display: none;
  }

  .topbar > div:not(.topbar-title)::after {
    content: "店家資訊：台客食品行";
    display: inline-flex;
    max-width: calc(100vw - 112px);
    min-height: 34px;
    align-items: center;
    margin-top: 10px;
    padding: 6px 10px;
    border: 1px solid rgba(15, 109, 84, 0.22);
    border-radius: 8px;
    background: rgba(255, 254, 250, 0.9);
    color: #233326;
    font-weight: 800;
  }

  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .section-head.compact {
    flex-direction: row;
    align-items: center;
  }

  .customer-feedback-callout {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 14px;
  }

  .customer-feedback-callout .customer-feedback-trigger {
    width: 100%;
  }

  .customer-feedback-dialog {
    width: calc(100vw - 16px);
    max-height: calc(100vh - 16px);
  }

  .customer-feedback-panel {
    max-height: calc(100vh - 16px);
  }

  .customer-feedback-panel > header,
  #customerFeedbackForm {
    padding-left: 14px;
    padding-right: 14px;
  }

  .customer-feedback-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .customer-feedback-options label {
    justify-content: center;
  }

  #customerFeedbackForm footer {
    grid-template-columns: 1fr 1fr;
  }

  #sendCustomerFeedback {
    grid-column: 1 / -1;
  }

  .account-sections,
  .profile-form-grid {
    grid-template-columns: 1fr;
  }

  .account-panel {
    padding: 13px;
  }

  .holiday-weekday,
  .temporary-holiday {
    grid-template-columns: 1fr;
  }

  .search-box {
    width: 100%;
  }

  .category-tabs {
    top: 73px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .shop {
    padding-bottom: 120px;
  }

  .cart-item {
    grid-template-columns: 1fr;
  }

  .cart-item-actions {
    justify-items: stretch;
  }

  .holiday-list article {
    grid-template-columns: 1fr;
  }

  .order-status-grid,
  .order-edit-row,
  .order-edit-diff {
    grid-template-columns: 1fr;
  }

  .order-edit-qty {
    grid-template-columns: 44px minmax(64px, 84px) auto 44px;
    justify-content: start;
  }

  .order-edit-add-heading {
    display: grid;
    gap: 2px;
  }

  .order-edit-favorites > header {
    align-items: flex-start;
  }

  .order-edit-product-results {
    max-height: 200px;
  }

  .order-edit-dialog,
  .order-edit-panel {
    max-height: calc(100vh - 12px);
  }

  .order-edit-dialog {
    width: calc(100vw - 12px);
  }

  .annotation-toggle {
    right: 14px;
    bottom: 14px;
  }

  .annotation-panel {
    left: 14px;
    right: 14px;
    bottom: 74px;
    width: auto;
  }
}
.profile-sync-status {
  margin: 0.75rem 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.profile-sync-status[data-status="success"] {
  color: #356447;
}

.profile-sync-status[data-status="error"] {
  color: #9a3f35;
}
