:root {
  --bg: #ffffff;
  --paper: #ffffff;
  --ink: #151515;
  --muted: #6f6f6a;
  --line: #cfcfc8;
  --sage: #f4f4f1;
  --rose: #151515;
  --cocoa: #f7f7f4;
  --gold: #8a7a60;
  --shadow: none;
  --radius: 8px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", "PingFang TC", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  letter-spacing: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

a[aria-disabled="true"] {
  pointer-events: none;
  opacity: 0.55;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.admin-auth-pending #adminApp[hidden],
#adminApp[hidden] {
  display: none !important;
}

.admin-boot-status {
  width: min(92vw, 680px);
  margin: 18vh auto 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--line, #d8d1c8);
  border-radius: 14px;
  background: #fff;
  color: #5f554d;
  text-align: center;
}

.admin-boot-status.error,
.data-load-status.error {
  color: #9b2c2c;
  border-color: #e9b6b6;
  background: #fff7f7;
}

.data-load-status {
  margin: 0;
  padding: 0.75rem 0.9rem;
  border-radius: 10px;
  background: #f7f4ef;
}

.admin-login-page {
  min-height: 100vh;
  background: #f5f0e9;
}

.admin-login-shell {
  width: min(92vw, 440px);
  margin: 0 auto;
  padding: clamp(2rem, 9vh, 6rem) 0;
}

.admin-login-brand {
  width: max-content;
  margin: 0 auto 1.5rem;
}

.admin-login-card,
.migration-panel {
  padding: clamp(1.25rem, 4vw, 2rem);
  border: 1px solid #ddd3c8;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 18px 50px rgb(79 60 44 / 8%);
}

.admin-login-card h1 {
  margin: 0.25rem 0 1.25rem;
}

.admin-login-form {
  display: grid;
  gap: 1rem;
}

.admin-login-form label {
  display: grid;
  gap: 0.4rem;
}

.admin-mfa-instructions,
.admin-mfa-recovery,
.admin-mfa-qr p {
  color: var(--muted);
  line-height: 1.65;
}

.admin-mfa-instructions {
  margin: -0.45rem 0 1rem;
}

.admin-mfa-qr {
  display: grid;
  justify-items: center;
  gap: 0.65rem;
  margin: 0 0 1rem;
  padding: 1rem;
  border: 1px solid #e6ddd3;
  border-radius: 16px;
  background: #faf7f3;
}

.admin-mfa-qr[hidden] {
  display: none;
}

.admin-mfa-qr img {
  display: block;
  width: min(100%, 240px);
  aspect-ratio: 1;
  background: #fff;
}

.admin-mfa-qr p,
.admin-mfa-recovery {
  margin: 0;
  font-size: 12px;
}

.admin-mfa-manual {
  margin: 0 0 1rem;
  padding: 0.8rem 1rem;
  border: 1px solid #e6ddd3;
  border-radius: 14px;
  background: #faf7f3;
}

.admin-mfa-manual[hidden] {
  display: none;
}

.admin-mfa-manual summary {
  cursor: pointer;
  font-weight: 700;
}

.admin-mfa-manual > div {
  display: grid;
  gap: 0.8rem;
  margin-top: 0.8rem;
}

.admin-mfa-manual p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.65;
}

.admin-mfa-manual code {
  display: block;
  padding: 0.8rem;
  overflow-wrap: anywhere;
  border-radius: 10px;
  background: #fff;
  color: var(--ink);
  font-size: 0.95rem;
  letter-spacing: 0.08em;
  user-select: all;
}

.admin-mfa-panel input[name="code"] {
  text-align: center;
  font-size: 1.35rem;
  letter-spacing: 0.32em;
}

.admin-mfa-recovery {
  margin-top: 1rem;
}

.migration-panel {
  margin-top: 1.5rem;
}

.migration-report {
  max-width: 100%;
  overflow: auto;
  margin-top: 1rem;
  padding: 1rem;
  border-radius: 12px;
  background: #f7f4ef;
  white-space: pre-wrap;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  padding: 0 22px;
  background: rgba(255, 255, 255, 0.9);
  border-bottom: 1px solid rgba(207, 207, 200, 0.9);
  backdrop-filter: blur(18px);
}

.brand,
.nav-links,
.cart-link {
  display: inline-flex;
  align-items: center;
}

.brand {
  gap: 10px;
  color: var(--ink);
  font-weight: 760;
}

.brand-mark {
  display: block;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  overflow: hidden;
  background: #fff;
}

.brand-mark img {
  display: block;
  width: 122%;
  height: 122%;
  object-fit: cover;
  transform: translate(-9%, -9%);
}

.nav-links {
  gap: 18px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 650;
}

.cart-link {
  gap: 7px;
  border: 0;
  background: transparent;
  color: var(--rose);
  font-weight: 760;
}

#cartCount {
  display: inline-grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--rose);
  color: #fff;
  font-size: 10px;
}

main {
  width: min(1260px, 100%);
  margin: 0 auto;
}

.order-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  padding: 22px;
  align-items: start;
}

.catalog-panel {
  min-width: 0;
}

.hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: var(--shadow);
}

.hero-media,
.hero-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-media img {
  object-fit: cover;
  display: none;
}

.hero-media img.active {
  display: block;
}

.hero-title {
  position: absolute;
  left: 38px;
  bottom: 62px;
  z-index: 1;
  max-width: min(720px, calc(100% - 76px));
  color: #fff;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(48px, 9vw, 118px);
  font-weight: 500;
  line-height: 0.95;
  text-shadow: 0 3px 18px rgba(0, 0, 0, 0.34);
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 760;
  letter-spacing: 0;
  text-transform: uppercase;
}

.hero .eyebrow {
  color: var(--gold);
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0;
}

h1 {
  max-width: 540px;
  font-size: clamp(40px, 6.5vw, 78px);
  line-height: 1.02;
}

h2 {
  font-size: clamp(25px, 3.2vw, 40px);
  line-height: 1.12;
}

.hero-dots {
  position: absolute;
  left: 42px;
  bottom: 30px;
  z-index: 2;
  display: flex;
  gap: 8px;
}

.hero-dots button {
  position: relative;
  width: 22px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.hero-dots button::before {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 7px;
  height: 7px;
  border: 1px solid rgba(21, 21, 21, 0.42);
  border-radius: 50%;
  content: "";
  background: rgba(255, 255, 255, 0.56);
  transform: translate(-50%, -50%);
}

.hero-dots button.active::before {
  background: var(--ink);
}

.order-lookup-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 18px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
}

.order-lookup-entry > span:first-child {
  display: grid;
  gap: 4px;
}

.order-lookup-entry strong {
  font-size: 16px;
}

.order-lookup-entry small,
.order-lookup-entry > span:last-child {
  color: var(--muted);
  font-size: 13px;
}

.custom-order-notice {
  display: grid;
  gap: 11px;
  margin-top: 24px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f7f4;
}

.custom-order-notice-copy {
  min-width: 0;
}

.custom-order-notice-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.7;
}

.custom-order-notice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.custom-order-notice-actions .button {
  min-height: 40px;
  padding: 0 13px;
  font-size: 12px;
  font-weight: 700;
}

.catalog {
  padding: 54px 0 0;
}

.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.catalog-service-note {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.catalog-title {
  color: #9a9a94;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 650;
}

.sort-control {
  display: grid;
  gap: 6px;
  min-width: 160px;
  color: #9a9a94;
  font-size: 12px;
  font-weight: 650;
}

select,
input,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font-size: 15px;
}

.sort-control select {
  color: #9a9a94;
}

select,
input {
  min-height: 44px;
  padding: 0 12px;
}

textarea {
  resize: vertical;
  padding: 12px;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.product-card {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-width: 0;
  aspect-ratio: 3 / 5;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: inherit;
  cursor: pointer;
  text-align: left;
}

.product-art {
  position: relative;
  display: block;
  width: 100%;
  min-height: 0;
  height: 100%;
  padding: 0;
  border: 0;
  overflow: hidden;
  background: #f4f4f1;
}

.product-art img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transition: transform 480ms ease;
}

.product-seasonal-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 1;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--ink);
  font-size: 11px;
  font-weight: 800;
}

.product-empty-state {
  grid-column: 1 / -1;
}

.product-card:hover .product-art img {
  transform: scale(1.035);
}

.product-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 34px;
  align-items: end;
  gap: 10px;
  min-height: 72px;
  padding: 12px 14px;
}

.product-title-row {
  display: block;
  min-width: 0;
  line-height: 1.28;
}

.product-title-row h3 {
  display: block;
  overflow-wrap: anywhere;
  color: #5f5f5a;
  font-size: 15px;
  font-weight: 400;
  line-height: inherit;
}

.product-price {
  display: block;
  margin-top: 5px;
  color: #62625d;
  font-size: 13px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.product-cart-button {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: #6f6f6a;
}

.product-cart-button svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.product-cart-button:hover {
  border-color: var(--ink);
  color: var(--ink);
}

.site-info {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 54px;
  margin: 72px 22px 0;
  padding: 52px 0 62px;
  border-top: 1px solid var(--line);
  color: #4f4f4b;
}

.site-info h2 {
  grid-column: 1 / -1;
  margin: 0;
  color: #3f3f3b;
  font-size: clamp(22px, 2.4vw, 32px);
  font-weight: 300;
  line-height: 1.2;
  text-align: center;
}

.site-info > div {
  display: grid;
  align-content: start;
  justify-items: center;
  gap: 18px;
  min-width: 0;
  text-align: center;
}

.site-established {
  grid-column: 1 / -1;
  margin: 0;
  text-align: center;
}

.social-contact {
  grid-column: 1 / -1;
}

.social-contact > p {
  font-size: clamp(16px, 1.6vw, 21px);
}

.site-info p {
  margin: 0;
  font-size: clamp(17px, 1.8vw, 24px);
  font-weight: 300;
  line-height: 1.7;
}

.company-info {
  grid-column: 1 / -1;
  width: 100%;
  gap: 4px !important;
}

.company-info p {
  width: 100%;
  color: #5f5f5a;
  font-size: clamp(14px, 1.3vw, 18px);
  font-weight: 400;
}

.social-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 12px;
}

.social-links a {
  position: relative;
  display: inline-grid;
  place-items: center;
  width: 48px;
  height: 48px;
  background: #333;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.social-facebook {
  border-radius: 50%;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 32px !important;
  font-weight: 800 !important;
  line-height: 1;
  padding-top: 6px;
}

.social-instagram,
.social-line {
  border-radius: 6px;
}

.social-instagram::before {
  width: 21px;
  height: 21px;
  border: 2px solid currentColor;
  border-radius: 5px;
  content: "";
}

.social-instagram::after {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.social-instagram span {
  position: absolute;
  width: 9px;
  height: 9px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.social-line {
  font-size: 9px;
}

.social-line::after {
  position: absolute;
  right: 6px;
  bottom: 5px;
  width: 6px;
  height: 5px;
  background: #333;
  clip-path: polygon(0 0, 100% 0, 0 100%);
  content: "";
}

.button {
  border: 0;
  background: transparent;
  color: inherit;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 760;
}

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

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

.button.secondary {
  border-color: var(--ink);
  background: var(--paper);
  color: var(--ink);
}

.button.full {
  width: 100%;
}

.button.disabled {
  opacity: 0.42;
  pointer-events: none;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--rose);
  font-size: 13px;
  font-weight: 760;
}

.cart-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: 22px;
  z-index: 30;
  display: grid;
  gap: 12px;
  width: min(360px, calc(100vw - 28px));
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 50px rgba(21, 21, 21, 0.12);
  backdrop-filter: blur(18px);
}

.cart-popover[hidden] {
  display: none;
}

.cart-popover-head,
.cart-popover-total,
.cart-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cart-popover-items {
  display: grid;
  gap: 10px;
  max-height: 320px;
  overflow: auto;
}

.cart-delivery-note {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.cart-line {
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}

.cart-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cart-line img {
  flex: 0 0 auto;
  width: 54px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
}

.cart-line div {
  display: grid;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.cart-line strong {
  font-size: 14px;
}

.cart-line span {
  color: var(--muted);
  font-size: 12px;
}

.mini-qty-control {
  display: inline-flex !important;
  align-items: center;
  gap: 6px !important;
  margin-top: 4px;
}

.mini-qty-control button {
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
  font-size: 12px;
}

.mini-qty-control button:last-child {
  color: var(--muted);
}

.mini-qty-control em {
  min-width: 16px;
  color: var(--ink);
  font-style: normal;
  text-align: center;
}

.line-benefit {
  color: #5c7553 !important;
  line-height: 1.45;
}

.line-addon {
  color: var(--ink) !important;
  line-height: 1.45;
}

.extra-tableware-control,
.extra-candle-control {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px !important;
  margin-top: 4px;
}

.extra-tableware-control button,
.extra-candle-control button,
.addon-qty-control button {
  min-width: 28px;
  height: 28px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  color: var(--ink);
}

.extra-tableware-control em,
.extra-candle-control em,
.addon-qty-control em {
  min-width: 20px;
  color: var(--ink);
  font-style: normal;
  font-weight: 700;
  text-align: center;
}

.extra-tableware-control small,
.extra-candle-control small {
  flex-basis: 100%;
  color: var(--muted);
}

.cart-line b {
  white-space: nowrap;
  font-size: 13px;
}

.empty-cart {
  margin: 0;
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.checkout-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 420px);
  gap: 24px;
  padding: 22px;
  align-items: start;
}

.checkout-form-panel,
.checkout-summary {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.checkout-form-panel h1 {
  font-size: clamp(34px, 5vw, 54px);
}

.delivery-address-fields {
  display: grid;
  gap: 12px;
}

.delivery-address-fields[hidden] {
  display: none;
}

.delivery-notices {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border-radius: var(--radius);
  background: #f6f6f3;
}

.delivery-notices p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
}

.delivery-risk-notices {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid #dca45d;
  border-radius: var(--radius);
  background: #fff8e9;
  color: #684414;
}

.delivery-risk-notices p,
.delivery-risk-notices span {
  margin: 0;
  line-height: 1.65;
}

.delivery-risk-notices p:last-child,
.delivery-risk-notices p:last-child span {
  display: block;
  font-size: 12px;
}

.checkout-summary {
  position: sticky;
  top: 86px;
}

.checkout-items {
  display: grid;
  gap: 12px;
}

.checkout-line {
  display: grid;
  grid-template-columns: 68px 1fr auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.checkout-line:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.checkout-line img {
  width: 68px;
  height: 68px;
  border-radius: 6px;
  object-fit: cover;
}

.checkout-line div {
  display: grid;
  gap: 4px;
}

.checkout-line span {
  color: var(--muted);
  font-size: 13px;
}

.checkout-price-breakdown,
.query-price-breakdown {
  display: grid;
  gap: 8px;
}

.checkout-price-breakdown > div,
.query-price-breakdown > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
  font-size: 14px;
}

.checkout-price-breakdown > div[hidden] {
  display: none;
}

.checkout-price-breakdown strong,
.query-price-breakdown strong {
  color: var(--ink);
}

.field-hint {
  color: #9a9a94;
  font-size: 12px;
  font-weight: 400;
}

.summary-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 18px;
}

.admin-shell {
  display: grid;
  gap: 18px;
  padding: 22px;
}

.admin-head,
.admin-actions,
.admin-filters,
.admin-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
}

.admin-head h1 {
  font-size: clamp(34px, 5vw, 54px);
}

.admin-actions {
  align-items: center;
  justify-content: end;
}

.admin-entry-nav {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.admin-entry {
  display: grid;
  gap: 8px;
  min-height: 104px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}

.admin-entry.active,
.admin-entry:hover {
  border-color: var(--ink);
  background: var(--sage);
}

.admin-entry span {
  font-size: 18px;
  font-weight: 520;
}

.admin-entry strong {
  align-self: end;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-view {
  display: none;
}

.admin-view.active {
  display: grid;
  gap: 18px;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 12px;
}

.admin-stats article,
.admin-panel,
.admin-filters {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.admin-stats article {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.admin-stats span,
.admin-panel-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.admin-stats strong {
  font-size: 28px;
}

.finance-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.admin-filters {
  display: grid;
  grid-template-columns: 155px 155px 160px minmax(180px, 1fr) auto auto;
  align-items: end;
  padding: 16px;
}

.admin-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 18px;
  align-items: start;
}

.admin-panel {
  display: grid;
  gap: 14px;
  padding: 16px;
  min-width: 0;
}

.admin-panel h2 {
  font-size: 24px;
}

.order-table {
  display: grid;
  gap: 8px;
}

.order-row {
  display: grid;
  grid-template-columns: minmax(132px, 0.9fr) minmax(160px, 1.2fr) auto auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}

.order-row.active,
.order-row:hover {
  border-color: var(--ink);
}

.order-row span {
  min-width: 0;
}

.order-row strong,
.order-row small,
.order-row-items {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-row small,
.order-row-items {
  color: var(--muted);
  font-size: 12px;
}

.status-pill {
  padding: 5px 8px;
  border-radius: 999px;
  background: var(--sage);
  color: var(--ink);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.status-pill[data-status="pending_payment_info"] {
  background: #fff2f4;
  color: #b4394b;
}

.status-pill[data-status="confirmed"] {
  background: #edf4ff;
  color: #2b5c9f;
}

.status-pill[data-status="pending_verification"] {
  background: #fff7e7;
  color: #986313;
}

.status-pill[data-status="cancelled"] {
  background: #eeeeec;
  color: #666;
}

.order-detail {
  position: sticky;
  top: 86px;
}

.detail-stack {
  display: grid;
  gap: 16px;
}

.detail-stack h3 {
  font-size: 24px;
}

.detail-stack p {
  margin: 0;
}

.detail-grid {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 8px 14px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--sage);
}

.detail-grid span,
.detail-note {
  color: var(--muted);
}

.detail-summary {
  max-height: 220px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

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

.profit-grid article {
  display: grid;
  gap: 6px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sage);
}

.profit-grid span,
.cost-breakdown span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profit-grid strong {
  font-size: 20px;
}

.cost-breakdown {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cost-breakdown div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.cost-breakdown span {
  min-width: 0;
}

.cost-breakdown strong {
  white-space: nowrap;
}

.inventory-panel {
  align-items: start;
}

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

.inventory-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sage);
}

.inventory-item span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.inventory-item strong {
  font-size: 22px;
}

.order-form,
fieldset,
label {
  display: grid;
  gap: 12px;
}

fieldset {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

legend {
  margin-bottom: 8px;
  font-weight: 800;
}

label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.form-result,
.order-result {
  margin: 0;
  border-radius: var(--radius);
  background: #f6f6f3;
  color: var(--ink);
}

.form-result {
  padding: 14px;
  line-height: 1.65;
  white-space: pre-line;
}

.order-result {
  display: grid;
  gap: 12px;
  padding: 14px;
}

.order-result[hidden] {
  display: none;
}

#orderProgress[hidden] {
  display: none;
}

.order-result p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.order-result pre {
  max-height: 260px;
  margin: 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  line-height: 1.65;
  white-space: pre-wrap;
}

.order-success-guide {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.order-success-guide[hidden] {
  display: none;
}

.order-success-guide strong {
  font-size: 17px;
}

.order-success-guide .text-button {
  justify-self: start;
}

.customer-order-progress,
.customer-order-cancelled {
  display: grid;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.customer-progress-head {
  display: grid;
  gap: 3px;
}

.customer-progress-head .eyebrow {
  margin: 0;
}

.customer-progress-head h3,
.customer-order-cancelled h3 {
  font-size: 22px;
}

.customer-progress-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.customer-progress-step {
  position: relative;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-height: 40px;
}

.customer-progress-step:not(:last-child)::after {
  position: absolute;
  top: 31px;
  bottom: -9px;
  left: 14px;
  width: 2px;
  background: #dfdfda;
  content: "";
}

.customer-progress-symbol {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: #8b8b85;
  font-size: 15px;
  font-weight: 850;
}

.customer-progress-step[data-progress-state="complete"] .customer-progress-symbol {
  border-color: #4d7b59;
  background: #4d7b59;
  color: #fff;
}

.customer-progress-step strong {
  color: var(--muted);
  font-size: 15px;
}

.customer-progress-step[data-progress-state="complete"] strong {
  color: var(--ink);
}

.remittance-received-notice {
  display: grid;
  gap: 6px;
  padding: 13px;
  border-radius: var(--radius);
  background: #edf8ef;
  color: #2f673c;
  line-height: 1.55;
}

.remittance-received-notice strong {
  font-size: 14px;
}

.remittance-received-notice small {
  color: #58735e;
  font-size: 12px;
}

.customer-order-cancelled {
  grid-template-columns: 34px minmax(0, 1fr);
  align-items: start;
  border-color: #ddc1bc;
  background: #fff5f3;
}

.customer-order-cancelled > span {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #a33a32;
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.customer-order-cancelled > div {
  display: grid;
  gap: 4px;
}

.customer-order-cancelled h3 {
  color: #8f302a;
}

.customer-order-cancelled p {
  margin: 0;
  color: #76534f;
  font-size: 13px;
  line-height: 1.55;
}

.payment-panel[hidden] {
  display: none;
}

.payment-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.payment-card h2 {
  font-size: 24px;
}

.payment-card pre {
  max-height: none;
  background: #f6f6f3;
}

.payment-hint {
  font-size: 13px;
}

.remittance-last-five,
.customer-contact-card {
  display: grid;
  gap: 10px;
}

.remittance-last-five {
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.remittance-last-five input {
  max-width: 180px;
  letter-spacing: 0.22em;
}

.remittance-last-five .button,
.customer-contact-card .button {
  justify-self: start;
}

.remittance-status {
  min-height: 1.5em;
  font-size: 13px;
}

.remittance-status.success {
  color: #386641;
}

.remittance-status.error {
  color: #a33a32;
}

.customer-contact-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.lookup-shell {
  display: grid;
  gap: 22px;
  width: min(920px, calc(100% - 44px));
  margin: 0 auto;
  padding: 42px 0 72px;
}

.lookup-intro {
  display: grid;
  gap: 10px;
}

.lookup-intro h1 {
  font-size: clamp(38px, 6vw, 64px);
}

.lookup-intro > p:last-child {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.lookup-card,
.query-result {
  display: grid;
  gap: 18px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.lookup-mode-switch {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 5px;
  border-radius: 999px;
  background: #f2f2ef;
}

.lookup-mode-switch button {
  min-height: 42px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 760;
}

.lookup-mode-switch button.active {
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 2px 8px rgba(21, 21, 21, 0.08);
}

.lookup-form {
  display: grid;
  gap: 14px;
}

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

.lookup-form > .button,
.lookup-form > .text-button {
  justify-self: start;
}

.lookup-privacy-note,
.lookup-feedback {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.lookup-feedback:empty {
  display: none;
}

.lookup-feedback.success {
  color: #386641;
}

.lookup-feedback.error {
  color: #a33a32;
}

.lookup-choice-list {
  display: grid;
  gap: 10px;
}

.lookup-choice {
  display: grid;
  grid-template-columns: minmax(90px, auto) 1fr;
  gap: 14px;
  align-items: center;
  width: 100%;
  min-height: 56px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--ink);
  text-align: left;
}

.lookup-choice span {
  color: var(--muted);
  line-height: 1.5;
}

.query-result-head,
.query-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.query-order-id {
  padding: 8px 12px;
  border-radius: 999px;
  background: #f2f2ef;
  overflow-wrap: anywhere;
}

.query-meta-grid,
.query-bank-details,
.query-item dl {
  display: grid;
  gap: 12px;
  margin: 0;
}

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

.query-meta-grid > div,
.query-bank-details > div,
.query-item dl > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.query-meta-grid > div {
  padding: 12px;
  border-radius: var(--radius);
  background: #f6f6f3;
}

.query-meta-grid .wide {
  grid-column: 1 / -1;
}

.query-meta-grid dt,
.query-bank-details dt,
.query-item dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.query-meta-grid dd,
.query-bank-details dd,
.query-item dd {
  min-width: 0;
  margin: 0;
  overflow-wrap: anywhere;
}

.query-customer-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #edf4ff;
  color: #2b5c9f;
  font-size: 13px;
  font-weight: 800;
}

.query-customer-status[data-customer-status="completed"] {
  background: #edf8ef;
  color: #2f7340;
}

.query-customer-status[data-customer-status="cancelled"] {
  background: #eeeeec;
  color: #666;
}

.query-remittance-status {
  color: var(--muted);
  font-weight: 760;
}

.query-items-section,
.query-payment-card {
  display: grid;
  gap: 14px;
}

.query-items-section h3,
.query-payment-card h3 {
  font-size: 22px;
}

.query-item-list {
  display: grid;
  gap: 10px;
}

.query-item {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

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

.query-total {
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 18px;
}

.query-payment-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f6f3;
}

.query-bank-details {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.query-payment-card > .button,
.query-payment-card .remittance-last-five > .button {
  justify-self: start;
}

.query-payment-complete {
  margin: 0;
  color: #386641;
  font-weight: 760;
}

.order-result .query-payment-complete {
  color: #386641;
}

.order-result-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.product-dialog {
  width: min(820px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: var(--shadow);
}

.product-dialog::backdrop {
  background: rgba(32, 24, 18, 0.54);
  backdrop-filter: blur(7px);
}

.close-dialog {
  position: sticky;
  top: 10px;
  left: calc(100% - 48px);
  z-index: 2;
  width: 36px;
  height: 36px;
  margin: 10px 10px -46px auto;
  border: 1px solid rgba(227, 217, 204, 0.9);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 22px;
  z-index: 40;
  min-width: 180px;
  max-width: calc(100% - 32px);
  padding: 13px 18px;
  border: 1px solid rgba(33, 28, 24, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 14px;
  font-weight: 760;
  text-align: center;
  box-shadow: 0 14px 40px rgba(58, 42, 31, 0.16);
  transform: translate(-50%, 12px);
  opacity: 0;
  backdrop-filter: blur(14px);
  transition: opacity 180ms ease, transform 180ms ease;
  pointer-events: none;
}

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

.toast[hidden] {
  display: block;
  visibility: hidden;
}

.dialog-layout {
  display: grid;
  grid-template-columns: 1fr 0.86fr;
}

.dialog-media {
  min-height: 520px;
  aspect-ratio: auto;
}

.dialog-media img {
  object-fit: contain;
  background: #f6f6f3;
}

.dialog-copy {
  display: grid;
  gap: 14px;
  align-content: center;
  padding: 34px;
}

.dialog-included,
.dialog-addon {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f6f6f3;
}

.dialog-included {
  color: #5c7553;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.dialog-addon {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.dialog-addon > div {
  display: grid;
  gap: 3px;
}

.dialog-addon small {
  color: var(--muted);
  font-size: 12px;
}

.addon-qty-control {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.dialog-copy p:not(.eyebrow) {
  color: var(--muted);
  line-height: 1.72;
}

.product-card:focus-visible,
.order-row:focus-visible,
.order-lookup-entry:focus-visible,
.lookup-choice:focus-visible,
.lookup-mode-switch button:focus-visible,
.button:focus-visible,
.product-cart-button:focus-visible,
.cart-link:focus-visible,
.text-button:focus-visible,
.close-dialog:focus-visible {
  outline: 1px solid var(--rose);
  outline-offset: 3px;
}

@media (max-width: 1020px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .checkout-shell {
    grid-template-columns: 1fr;
  }

  .checkout-summary {
    position: static;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-entry-nav,
  .finance-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .order-detail {
    position: static;
  }

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

@media (max-width: 720px) {
  .topbar {
    min-height: 58px;
    padding: 0 14px;
  }

  .order-shell {
    padding: 12px;
  }

  .hero {
    min-height: 520px;
  }

  .hero-dots {
    left: 28px;
    bottom: 24px;
  }

  .hero-title {
    left: 28px;
    bottom: 58px;
    max-width: calc(100% - 56px);
  }

  .custom-order-notice {
    padding: 14px;
  }

  .section-head {
    align-items: start;
    flex-direction: column;
  }

  .dialog-layout {
    grid-template-columns: 1fr;
  }

  .dialog-addon {
    align-items: flex-start;
    flex-direction: column;
  }

  .checkout-shell {
    padding: 12px;
  }

  .admin-shell {
    padding: 12px;
  }

  .admin-head,
  .admin-actions,
  .admin-panel-head {
    align-items: start;
    flex-direction: column;
  }

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

  .admin-entry-nav,
  .finance-stats {
    grid-template-columns: 1fr;
  }

  .profit-grid {
    grid-template-columns: 1fr;
  }

  .admin-filters {
    grid-template-columns: 1fr;
  }

  .inventory-grid {
    grid-template-columns: 1fr;
  }

  .order-row {
    grid-template-columns: 1fr auto;
  }

  .order-row-items {
    grid-column: 1 / -1;
  }

  .order-result-actions {
    grid-template-columns: 1fr;
  }

  .order-lookup-entry {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .lookup-shell {
    width: calc(100% - 24px);
    padding: 28px 0 48px;
  }

  .lookup-card,
  .query-result {
    padding: 16px;
  }

  .customer-order-progress,
  .customer-order-cancelled {
    padding: 14px;
  }

  .customer-progress-step {
    min-height: 42px;
  }

  .lookup-form-grid,
  .query-meta-grid,
  .query-bank-details {
    grid-template-columns: 1fr;
  }

  .query-meta-grid .wide {
    grid-column: auto;
  }

  .query-result-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .lookup-form > .button,
  .query-payment-card > .button,
  .query-payment-card .remittance-last-five > .button {
    width: 100%;
  }

  .lookup-choice {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .query-item dl {
    grid-template-columns: 1fr;
  }

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

  .site-info {
    grid-template-columns: 1fr;
    gap: 34px;
    margin: 54px 12px 0;
    padding: 40px 0 48px;
  }

  .dialog-media {
    min-height: 360px;
  }
}

@media (max-width: 430px) {
  .checkout-line {
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .checkout-line img {
    width: 56px;
    height: 56px;
  }

  .checkout-line > b {
    grid-column: 2;
  }

  .product-grid {
    gap: 10px;
  }

  .product-card {
    aspect-ratio: 3 / 5.3;
  }

  .product-body {
    min-height: 54px;
    grid-template-columns: minmax(0, 1fr) 30px;
    gap: 8px;
    padding: 10px;
  }

  .product-title-row h3 {
    font-size: 13px;
  }

  .product-price {
    font-size: 12px;
  }

  .product-cart-button {
    width: 30px;
    height: 30px;
  }

  .hero-dots {
    left: 22px;
  }

  .hero-title {
    left: 22px;
    bottom: 54px;
    max-width: calc(100% - 44px);
  }
}

/* 店主訂單後台：手機優先的核心訂單處理介面 */
.admin-order-shell {
  display: grid;
  gap: 20px;
  width: min(1480px, 100%);
}

.admin-order-head {
  gap: 18px;
}

.admin-local-mode {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.today-summary,
.admin-core-panel,
.admin-secondary-tools {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.today-summary {
  display: grid;
  gap: 16px;
  padding: 20px;
}

.today-summary-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
}

.today-summary-head h2 {
  font-size: clamp(26px, 4vw, 38px);
}

.today-summary-head > span {
  color: var(--muted);
  font-size: 13px;
}

.today-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.today-stats article:nth-child(3),
.today-stats article:nth-child(4) {
  background: #fff7e7;
}

.order-view-tabs {
  position: sticky;
  top: 70px;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(246, 246, 243, 0.96);
  box-shadow: 0 8px 24px rgba(21, 21, 21, 0.08);
  backdrop-filter: blur(16px);
}

.order-view-tabs button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  min-height: 46px;
  padding: 8px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font-weight: 800;
}

.order-view-tabs button.active {
  background: var(--ink);
  color: #fff;
}

.order-view-tabs button span {
  min-width: 24px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-size: 12px;
}

.order-view-tabs button:not(.active) span {
  background: var(--sage);
  color: var(--ink);
}

.admin-core-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
}

.admin-order-filters {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(150px, 0.7fr) minmax(240px, 1.4fr) auto;
  gap: 12px;
  align-items: end;
}

.admin-order-filters .button {
  min-height: 46px;
}

.admin-feedback {
  min-height: 1.5em;
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.admin-feedback.success {
  color: #386641;
}

.admin-feedback.error {
  color: #a33a32;
}

.admin-overdue-notice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border: 1px solid #c66b24;
  border-radius: var(--radius);
  background: #fff4df;
  color: #713c12;
}

.admin-overdue-notice > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.admin-overdue-notice strong,
.admin-overdue-notice span {
  overflow-wrap: anywhere;
}

.admin-overdue-notice span {
  font-size: 12px;
}

.admin-overdue-notice .button {
  flex: 0 0 auto;
}

.admin-order-layout {
  display: grid;
  grid-template-columns: minmax(380px, 0.9fr) minmax(440px, 1.1fr);
  gap: 16px;
  align-items: start;
}

.admin-order-list {
  display: grid;
  gap: 12px;
}

.admin-order-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.admin-order-card.active {
  border-color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink);
}

.admin-order-card.is-overdue {
  border-color: #c66b24;
  box-shadow: inset 4px 0 0 #c66b24;
}

.admin-order-card.active.is-overdue {
  box-shadow: inset 4px 0 0 #c66b24, 0 0 0 1px #c66b24;
}

.admin-order-card-main {
  display: grid;
  gap: 10px;
  width: 100%;
  min-width: 0;
  padding: 15px;
  border: 0;
  background: transparent;
  color: var(--ink);
  text-align: left;
}

.order-card-topline,
.order-card-customer,
.order-card-fulfillment,
.order-card-payment {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.order-card-id,
.order-card-customer span,
.order-card-items,
.order-card-address {
  overflow-wrap: anywhere;
}

.order-card-id {
  font-size: 13px;
  letter-spacing: 0.04em;
}

.order-card-customer > strong {
  font-size: 19px;
}

.order-card-customer span,
.order-card-fulfillment span,
.order-card-payment span,
.order-card-address {
  color: var(--muted);
  font-size: 13px;
}

.order-card-items {
  display: block;
  padding: 10px;
  border-radius: 10px;
  background: var(--sage);
  font-size: 13px;
  line-height: 1.55;
}

.order-card-address {
  margin: 0;
  line-height: 1.55;
}

.order-card-payment strong {
  font-size: 18px;
}

.admin-overdue-badge {
  display: block;
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #d98336;
  border-radius: 6px;
  background: #fff4df;
  color: #713c12;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.35;
  text-align: left;
}

.admin-overdue-badge.detail {
  font-size: 14px;
}

.admin-remittance {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 13px;
}

.admin-remittance.success {
  background: #edf8ef;
  color: #2f7340;
}

.admin-remittance.pending {
  background: #fff7e7;
  color: #986313;
}

.admin-remittance.store-payment {
  background: #f3edff;
  color: #654597;
}

.admin-verification-card {
  display: grid;
  gap: 13px;
  padding: 14px;
  border: 1px solid #d6b56d;
  border-radius: var(--radius);
  background: #fffaf0;
}

.admin-verification-card h4,
.admin-verification-card p {
  margin: 0;
}

.admin-verification-card > div > p:last-child {
  margin-top: 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-verification-card dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.admin-verification-card dl > div {
  min-width: 0;
  padding: 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.75);
}

.admin-verification-card dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.admin-verification-card dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.admin-status-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 9px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.admin-status-actions.compact {
  padding: 12px 15px 15px;
}

.admin-status-actions .button {
  width: 100%;
  min-height: 46px;
}

.admin-status-actions .action-hint {
  grid-column: 1;
  color: #986313;
  font-size: 12px;
  text-align: center;
}

.button.danger {
  border-color: #a33a32;
  background: transparent;
  color: #a33a32;
}

.status-pill[data-status="completed"] {
  background: #edf8ef;
  color: #2f7340;
}

.admin-order-detail {
  position: sticky;
  top: 140px;
  min-width: 0;
  max-height: calc(100vh - 160px);
  overflow: auto;
}

.admin-detail-stack {
  min-width: 0;
}

.admin-detail-title {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.admin-detail-title p,
.admin-detail-section p {
  overflow-wrap: anywhere;
}

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

.admin-detail-grid > div {
  min-width: 0;
  padding: 11px;
  border-radius: 10px;
  background: var(--sage);
}

.admin-detail-grid .wide {
  grid-column: 1 / -1;
}

.admin-detail-grid dt,
.admin-amount-breakdown dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.admin-detail-grid dd,
.admin-amount-breakdown dd {
  margin: 5px 0 0;
  overflow-wrap: anywhere;
  font-weight: 760;
}

.admin-detail-section {
  display: grid;
  gap: 10px;
}

.admin-detail-section h4 {
  font-size: 16px;
}

.admin-detail-items {
  display: grid;
  gap: 9px;
}

.admin-detail-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.admin-detail-item > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.admin-detail-item span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.admin-detail-item strong,
.admin-detail-item span {
  overflow-wrap: anywhere;
}

.admin-amount-breakdown {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.admin-amount-breakdown > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-amount-breakdown dd {
  white-space: nowrap;
}

.admin-amount-breakdown .total {
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.admin-amount-breakdown .total dd {
  color: var(--rose);
  font-size: 21px;
}

.admin-danger-zone {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #e9c4c0;
  border-radius: var(--radius);
  background: #fff8f7;
}

.admin-danger-zone p {
  color: #7d4540;
  font-size: 12px;
  line-height: 1.55;
}

.admin-danger-zone .button {
  justify-self: start;
}

.admin-secondary-tools {
  padding: 16px;
}

.admin-secondary-tools > summary {
  cursor: pointer;
  font-size: 17px;
  font-weight: 800;
}

.admin-secondary-tools > p {
  margin: 8px 0 16px;
  color: var(--muted);
  font-size: 13px;
}

.admin-secondary-tools[open] {
  display: grid;
  gap: 14px;
}

@media (max-width: 1020px) {
  .admin-order-layout {
    grid-template-columns: 1fr;
  }

  .admin-order-detail {
    position: static;
    max-height: none;
    scroll-margin-top: 138px;
  }

  .admin-order-filters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-search-field {
    grid-column: 1 / -1;
  }
}

@media (max-width: 720px) {
  .admin-order-shell {
    gap: 14px;
  }

  .admin-order-head .admin-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    width: 100%;
  }

  .admin-order-head .admin-actions .button {
    width: 100%;
    padding-inline: 10px;
  }

  .today-summary,
  .admin-core-panel {
    padding: 14px;
  }

  .today-summary-head {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

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

  .order-view-tabs {
    top: 64px;
    gap: 3px;
    padding: 4px;
  }

  .order-view-tabs button {
    gap: 5px;
    min-height: 44px;
    padding: 7px 5px;
    font-size: 13px;
  }

  .order-view-tabs button span {
    min-width: 21px;
    padding: 1px 5px;
    font-size: 11px;
  }

  .admin-order-filters {
    grid-template-columns: 1fr;
  }

  .admin-search-field {
    grid-column: auto;
  }

  .admin-order-filters .button {
    width: 100%;
  }

  .admin-overdue-notice {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .admin-overdue-notice .button {
    width: 100%;
  }

  .admin-panel {
    padding: 13px;
  }

  .admin-detail-grid {
    grid-template-columns: 1fr;
  }

  .admin-verification-card dl {
    grid-template-columns: 1fr;
  }

  .admin-detail-grid .wide {
    grid-column: auto;
  }

  .admin-status-actions {
    grid-template-columns: 1fr;
  }

  .admin-status-actions .action-hint {
    grid-column: auto;
  }

  .admin-detail-item {
    grid-template-columns: minmax(0, 1fr);
  }

  .admin-detail-item b {
    justify-self: end;
  }

  .admin-danger-zone .button {
    width: 100%;
  }
}

@media (max-width: 390px) {
  .order-view-tabs button {
    flex-direction: column;
    gap: 2px;
    font-size: 12px;
    line-height: 1.15;
  }

  .order-card-topline,
  .order-card-customer,
  .order-card-fulfillment {
    align-items: flex-start;
  }

  .order-card-customer,
  .order-card-fulfillment {
    flex-direction: column;
    gap: 3px;
  }

  .admin-remittance {
    align-items: flex-start;
    flex-direction: column;
  }
}

.checkout-payment-reminder,
.payment-deadline-notice {
  margin: 0;
  padding: 12px 14px;
  border: 1px solid #e2d5b8;
  border-radius: var(--radius);
  background: #fff9ec;
  color: #725d31;
  font-size: 13px;
  font-weight: 720;
  line-height: 1.6;
}

.checkout-privacy-notice {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f7f7f4;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.checkout-privacy-notice > p,
.privacy-notice-copy p,
.privacy-notice-copy ul {
  margin: 0;
}

.checkout-privacy-details {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.checkout-privacy-details > summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 750;
  list-style: none;
}

.checkout-privacy-details > summary::-webkit-details-marker {
  display: none;
}

.checkout-privacy-details > summary::after {
  content: "＋";
  flex: 0 0 auto;
  font-size: 18px;
  font-weight: 500;
}

.checkout-privacy-details[open] > summary::after {
  content: "−";
}

.privacy-notice-copy {
  display: grid;
  gap: 14px;
  padding-top: 12px;
  color: var(--muted);
  font-size: 15px;
  line-height: 1.75;
}

.privacy-notice-copy section {
  display: grid;
  gap: 8px;
}

.privacy-notice-copy h2,
.privacy-notice-copy h3 {
  margin: 0;
  color: var(--ink);
  font-size: 17px;
}

.privacy-notice-copy ul {
  display: grid;
  gap: 5px;
  padding-left: 1.35rem;
}

.privacy-notice-copy a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.privacy-page-link {
  padding-top: 2px;
}

.privacy-shell {
  width: min(100%, 840px);
  padding: 28px 22px 64px;
}

.privacy-card {
  padding: clamp(20px, 4vw, 36px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.privacy-card > h1 {
  margin: 6px 0 24px;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.2;
}

@media (max-width: 720px) {
  .checkout-privacy-notice {
    padding: 12px;
  }

  .privacy-shell {
    padding: 12px 12px 44px;
  }

  .privacy-card {
    padding: 18px;
  }
}

.payment-deadline-notice {
  font-size: 15px;
  font-weight: 800;
}

.query-cancellation-contact {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid #ddc1bc;
  border-radius: var(--radius);
  background: #fff8f6;
}

.query-cancellation-contact p {
  margin: 0;
  color: #76534f;
  line-height: 1.55;
}

.query-cancellation-contact > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

@media (max-width: 640px) {
  .query-cancellation-contact > div {
    display: grid;
    grid-template-columns: 1fr;
  }

  .query-cancellation-contact .button {
    width: 100%;
  }
}

.date-availability-message {
  min-height: 1.45em;
  font-size: 12px;
  line-height: 1.45;
}

.customer-date-field {
  display: grid;
  gap: 8px;
}

.customer-date-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.customer-date-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  min-height: 48px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
  text-align: left;
}

.customer-date-toggle.has-value {
  color: var(--ink);
}

.customer-date-toggle[aria-expanded="true"] {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 1px var(--ink);
}

.customer-date-toggle span {
  font-size: 15px;
  font-weight: 700;
}

.customer-date-toggle small {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.customer-booking-calendar {
  display: grid;
  gap: 12px;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.customer-booking-calendar[hidden] {
  display: none;
}

.customer-calendar-nav {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 8px;
}

.customer-calendar-nav strong {
  text-align: center;
}

.customer-calendar-nav button {
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--paper);
  color: var(--ink);
  font-weight: 800;
}

.customer-calendar-nav button:disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

.customer-calendar-weekdays,
.customer-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 5px;
}

.customer-calendar-weekdays span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  text-align: center;
}

.customer-calendar-empty,
.customer-calendar-day {
  min-width: 0;
  min-height: 56px;
}

.customer-calendar-day {
  display: grid;
  place-content: center;
  gap: 2px;
  padding: 4px 2px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
}

.customer-calendar-day:not(:disabled):hover {
  border-color: var(--ink);
}

.customer-calendar-day strong {
  font-size: 15px;
}

.customer-calendar-day small {
  min-height: 14px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
}

.customer-calendar-day:disabled {
  border-color: #e1e1dc;
  background: #f3f3f0;
  color: #aaa9a3;
  cursor: not-allowed;
  opacity: 1;
}

.customer-calendar-day[data-date-state="closed"] small {
  color: #555;
}

.customer-calendar-day[data-date-state="manual-full"] small,
.customer-calendar-day[data-date-state="full"] small {
  color: #9b3e4b;
}

.customer-calendar-day[data-date-state="insufficient"] small,
.customer-calendar-day[data-date-state="no-pickup-slots"] small {
  color: #82631e;
}

.customer-calendar-day.today {
  box-shadow: inset 0 0 0 1px #9c9c96;
}

.customer-calendar-day.selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.customer-calendar-day.selected small {
  color: rgba(255, 255, 255, 0.78);
}

.customer-calendar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  padding-top: 9px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
}

.customer-calendar-legend span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.customer-calendar-legend b {
  color: var(--ink);
}

.customer-calendar-legend i {
  width: 10px;
  height: 10px;
  border: 1px solid #e1e1dc;
  border-radius: 2px;
  background: #f3f3f0;
}

.date-availability-message.success {
  color: #386641;
}

.date-availability-message.error {
  color: #a33a32;
}

@media (max-width: 420px) {
  .customer-booking-calendar {
    gap: 9px;
    padding: 10px;
  }

  .customer-calendar-weekdays,
  .customer-calendar-grid {
    gap: 3px;
  }

  .customer-calendar-empty,
  .customer-calendar-day {
    min-height: 49px;
  }

  .customer-calendar-day {
    border-radius: 7px;
  }

  .customer-calendar-day strong {
    font-size: 14px;
  }

  .customer-calendar-day small {
    font-size: 9px;
  }
}

.admin-calendar-panel,
.booking-settings-card,
.booking-calendar-card,
.booking-date-editor {
  display: grid;
  gap: 16px;
}

.admin-calendar-panel[hidden],
.admin-core-panel[hidden],
.admin-secondary-tools[hidden] {
  display: none;
}

.admin-calendar-panel {
  scroll-margin-top: 138px;
}

.calendar-panel-head p,
.date-slot-editor-head p,
.calendar-existing-section > p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.booking-settings-card,
.booking-calendar-card,
.booking-date-editor {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.booking-settings-card h3,
.booking-calendar-card h3,
.booking-date-editor h3 {
  font-size: 24px;
}

.booking-settings-form,
.date-capacity-form,
.booking-fulfillment-form,
.booking-day-controls,
.date-slot-editor,
.calendar-existing-section {
  display: grid;
  gap: 14px;
}

.booking-number-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.pickup-slot-settings {
  display: grid;
  gap: 10px;
}

.pickup-slot-toggle-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.pickup-slot-toggle {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
  min-height: 48px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f6f6f3;
  color: var(--ink);
}

.pickup-slot-toggle:has(input:checked) {
  border-color: #6b8561;
  background: #edf8ef;
}

.pickup-slot-toggle.disabled {
  opacity: 0.48;
}

.pickup-slot-toggle input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin: 0;
}

.pickup-slot-toggle span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.pickup-slot-toggle strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.pickup-slot-toggle small {
  color: var(--muted);
  font-size: 11px;
}

.booking-settings-form > .button,
.date-capacity-form > .button,
.date-slot-editor > .button {
  justify-self: start;
}

.booking-calendar-nav,
.booking-date-editor-head,
.date-slot-editor-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.booking-calendar-nav .button {
  min-width: 46px;
  padding: 0;
}

.booking-weekdays,
.booking-calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
}

.booking-weekdays span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-align: center;
}

.booking-calendar-empty {
  min-height: 78px;
}

.booking-calendar-day {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
  min-height: 78px;
  padding: 7px 4px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  color: var(--ink);
  text-align: center;
}

.booking-calendar-day strong {
  font-size: 17px;
}

.booking-calendar-day span,
.booking-calendar-day small {
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 10px;
  white-space: nowrap;
}

.booking-calendar-day span {
  color: var(--muted);
}

.booking-calendar-day.today {
  box-shadow: inset 0 0 0 1px var(--rose);
}

.booking-calendar-day.selected {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.booking-calendar-day.selected span,
.booking-calendar-day.selected small {
  color: rgba(255, 255, 255, 0.78);
}

.booking-calendar-day[data-booking-state="holiday"] {
  background: #eeeeec;
  color: #666;
}

.booking-calendar-day[data-booking-state="manual-full"],
.booking-calendar-day[data-booking-state="full"] {
  background: #fff2f4;
  color: #a33a4a;
}

.booking-calendar-day[data-booking-state="insufficient"] {
  background: #fff7e7;
  color: #986313;
}

/* Keep the selected date obvious even when that date is full or closed. */
.booking-calendar-day.selected,
.booking-calendar-day.selected[data-booking-state] {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.booking-calendar-day.selected span,
.booking-calendar-day.selected small {
  color: rgba(255, 255, 255, 0.78);
}

.booking-date-editor-head {
  align-items: flex-start;
}

.booking-state-badge {
  max-width: 220px;
  padding: 6px 10px;
  border-radius: 999px;
  background: #edf8ef;
  color: #2f7340;
  font-size: 12px;
  font-weight: 800;
  overflow-wrap: anywhere;
  text-align: center;
}

.booking-state-badge[data-booking-state="holiday"] {
  background: #eeeeec;
  color: #666;
}

.booking-state-badge[data-booking-state="manual-full"],
.booking-state-badge[data-booking-state="full"] {
  background: #fff2f4;
  color: #a33a4a;
}

.booking-date-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.booking-date-stats article {
  display: grid;
  gap: 5px;
  padding: 12px;
  border-radius: 10px;
  background: var(--sage);
}

.booking-date-stats span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.booking-date-stats strong {
  font-size: 20px;
}

.date-capacity-form {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.booking-day-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.booking-fulfillment-form {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #f8f8f5;
}

.booking-fulfillment-toggles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 9px;
}

.booking-fulfillment-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 66px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.booking-fulfillment-toggle:has(input:checked) {
  border-color: #6b8561;
  background: #edf8ef;
}

.booking-fulfillment-toggle.holiday:has(input:checked) {
  border-color: #99704d;
  background: #f2ece5;
}

.booking-fulfillment-toggle input {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  margin: 0;
}

.booking-fulfillment-toggle span {
  display: grid;
  gap: 3px;
}

.booking-fulfillment-toggle small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.booking-fulfillment-toggle:has(input:disabled) {
  opacity: 0.5;
}

.booking-holiday-hint {
  margin: 0;
  color: #7a4b20;
  font-size: 13px;
  font-weight: 800;
}

.booking-holiday-hint[hidden] {
  display: none;
}

.date-slot-editor,
.calendar-existing-section {
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.date-slot-editor h4,
.calendar-existing-section h4 {
  font-size: 17px;
}

.calendar-existing-orders {
  display: grid;
  gap: 8px;
}

.calendar-existing-orders article {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr);
  gap: 4px 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.calendar-existing-orders span,
.calendar-existing-orders small {
  color: var(--muted);
  font-size: 12px;
}

.calendar-existing-orders strong,
.calendar-existing-orders small {
  overflow-wrap: anywhere;
}

.calendar-existing-orders small {
  grid-column: 2;
}

.product-management-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.product-management-panel[hidden] {
  display: none;
}

.prep-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.prep-panel[hidden],
.prep-breakdown[hidden],
.prep-empty-state[hidden] {
  display: none;
}

.prep-panel-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.prep-date-controls {
  display: grid;
  grid-template-columns: auto minmax(190px, 280px);
  align-items: end;
  gap: 12px;
}

.prep-quick-dates {
  display: grid;
  grid-template-columns: repeat(2, minmax(100px, 1fr));
  gap: 8px;
}

.prep-quick-dates .button {
  min-height: 46px;
}

.prep-quick-dates .button.active {
  border-color: var(--ink);
  background: var(--ink);
  color: #fff;
}

.prep-date-controls label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.prep-overview {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
}

.prep-overview > div {
  display: grid;
  gap: 5px;
}

.prep-overview .eyebrow {
  color: rgba(255, 255, 255, 0.68);
}

.prep-overview strong {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.1;
}

.prep-overview > span {
  flex: 0 0 auto;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 750;
}

.prep-empty-state {
  margin: 0;
  padding: 28px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--sage);
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.prep-payment-pending {
  margin: 0;
  padding: 11px 13px;
  border: 1px solid #e2d5b8;
  border-radius: var(--radius);
  background: #fff9ec;
  color: #725d31;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.55;
}

.prep-payment-pending[hidden] {
  display: none;
}

/* 獨立訂單成功頁 */
.order-success-shell {
  display: grid;
  width: min(100% - 32px, 820px);
  margin: 0 auto;
  padding: 54px 0 76px;
}

.success-page-status {
  margin: 0;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  color: var(--muted);
  text-align: center;
}

.success-page-status.error {
  border-color: #ddc1bc;
  background: #fff5f3;
  color: #8f302a;
}

.order-success-content {
  display: grid;
  gap: 18px;
}

.order-success-content[hidden],
#successPaymentSection[hidden] {
  display: none;
}

.order-success-hero {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 16px;
  padding: 24px;
  border: 1px solid #c8ddcd;
  border-radius: var(--radius);
  background: #f1f8f2;
}

.order-success-check {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: #4d7b59;
  color: #fff;
  font-size: 28px;
  font-weight: 850;
}

.order-success-hero > div {
  display: grid;
  gap: 7px;
}

.order-success-hero .eyebrow,
.order-success-hero h1,
.order-success-hero h2,
.order-success-hero p {
  margin: 0;
}

.order-success-hero h1 {
  font-size: clamp(30px, 6vw, 46px);
  line-height: 1.05;
}

.order-success-hero h2 {
  font-size: clamp(17px, 3vw, 22px);
}

.order-success-hero p {
  color: #4d6252;
  line-height: 1.65;
}

.success-order-summary {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.success-summary-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.success-summary-head h2,
.success-summary-head .eyebrow {
  margin: 0;
}

.success-order-number {
  display: grid;
  gap: 3px;
  min-width: 220px;
  padding: 12px 14px;
  border-radius: var(--radius);
  background: var(--ink);
  color: #fff;
}

.success-order-number span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 12px;
  font-weight: 700;
}

.success-order-number strong {
  overflow-wrap: anywhere;
  font-size: 19px;
}

.success-order-number-hint,
.success-email-note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.success-detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin: 0;
}

.success-detail-grid > div {
  min-width: 0;
  padding: 11px;
  border-radius: 10px;
  background: var(--sage);
}

.success-detail-grid .wide {
  grid-column: 1 / -1;
}

.success-detail-grid dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.success-detail-grid dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-size: 14px;
  font-weight: 750;
}

.success-item-list {
  display: grid;
  gap: 9px;
}

.success-order-item {
  display: grid;
  gap: 5px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.success-order-item > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.success-order-item p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.success-price-breakdown {
  display: grid;
  gap: 8px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.success-price-breakdown > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.success-price-breakdown .total {
  align-items: baseline;
  padding-top: 8px;
  font-size: 18px;
}

.success-price-breakdown .total strong {
  font-size: 25px;
}

.success-payment-card {
  gap: 15px;
  padding: 20px;
}

.success-bank-details {
  display: grid;
  gap: 8px;
  margin: 0;
}

.success-bank-details > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding: 11px 12px;
  border-radius: 10px;
  background: var(--sage);
}

.success-bank-details dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.success-bank-details dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 16px;
  font-weight: 800;
  text-align: right;
}

.copy-account-status {
  min-height: 1.45em;
  margin: -5px 0 0;
  color: #386641;
  font-size: 13px;
}

.success-payment-card .remittance-received-notice p {
  margin: 0;
  font-size: 13px;
}

.success-contact-card {
  gap: 14px;
  padding: 18px;
}

.success-contact-card p {
  margin: 0;
  line-height: 1.65;
}

.order-success-social-actions,
.order-success-footer-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.order-success-footer-actions .button {
  flex: 1 1 180px;
}

.order-result.submitting {
  background: #f6f6f3;
}

.order-result.error {
  border: 1px solid #ddc1bc;
  background: #fff5f3;
}

@media (max-width: 640px) {
  .order-success-shell {
    width: min(100% - 22px, 820px);
    padding: 28px 0 54px;
  }

  .order-success-hero {
    grid-template-columns: 42px minmax(0, 1fr);
    gap: 12px;
    padding: 18px 15px;
  }

  .order-success-check {
    width: 40px;
    height: 40px;
    font-size: 22px;
  }

  .success-order-summary,
  .success-payment-card {
    padding: 15px;
  }

  .success-summary-head {
    align-items: stretch;
    flex-direction: column;
  }

  .success-order-number {
    min-width: 0;
  }

  .success-detail-grid {
    grid-template-columns: 1fr;
  }

  .success-detail-grid .wide {
    grid-column: auto;
  }

  .success-order-item > div,
  .success-bank-details > div {
    align-items: flex-start;
    flex-direction: column;
    gap: 4px;
  }

  .success-bank-details dd {
    font-size: 18px;
    text-align: left;
  }

  .order-success-social-actions,
  .order-success-footer-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .order-success-social-actions .button,
  .order-success-footer-actions .button,
  .success-payment-card > .button,
  .success-payment-card .remittance-last-five > .button {
    width: 100%;
  }
}

.prep-breakdown {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.prep-section {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sage);
}

.prep-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.prep-section-head h3 {
  margin-top: 2px;
  font-size: 22px;
}

.prep-section-head > span {
  color: var(--muted);
  font-size: 11px;
  text-align: right;
}

.prep-card-list,
.prep-source-list {
  display: grid;
  gap: 8px;
}

.prep-stat-card,
.prep-product-card {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.prep-stat-card > summary,
.prep-product-card > summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 10px;
  min-height: 60px;
  padding: 12px;
  list-style: none;
  cursor: pointer;
}

.prep-stat-card > summary::-webkit-details-marker,
.prep-product-card > summary::-webkit-details-marker {
  display: none;
}

.prep-stat-card > summary::after,
.prep-product-card > summary::after {
  content: "⌄";
  color: var(--muted);
  font-size: 16px;
  transition: transform 160ms ease;
}

.prep-stat-card[open] > summary::after,
.prep-product-card[open] > summary::after {
  transform: rotate(180deg);
}

.prep-stat-card > summary > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.prep-stat-card > summary strong,
.prep-product-card > summary strong {
  overflow-wrap: anywhere;
}

.prep-stat-card > summary small {
  color: var(--muted);
  font-size: 11px;
}

.prep-stat-card > summary b,
.prep-product-card > summary b {
  font-size: 19px;
  white-space: nowrap;
}

.prep-stat-card-unknown {
  border-color: #caa772;
  background: #fffaf0;
}

.prep-source-list,
.prep-product-sizes {
  padding: 0 12px 12px;
  border-top: 1px solid var(--line);
}

.prep-source-list {
  padding-top: 10px;
}

.prep-source-item {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border-radius: 7px;
  background: var(--sage);
}

.prep-source-item > div {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.prep-source-item strong,
.prep-source-item span,
.prep-special-note p {
  overflow-wrap: anywhere;
}

.prep-source-item strong {
  font-size: 12px;
}

.prep-source-item span {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.prep-special-note {
  font-size: 12px;
}

.prep-special-note summary {
  width: fit-content;
  color: #986313;
  font-weight: 750;
  cursor: pointer;
}

.prep-special-note p {
  margin: 8px 0 0;
  padding: 9px;
  border-left: 3px solid #d4a657;
  background: #fff7e7;
  color: var(--ink);
  line-height: 1.55;
}

.prep-product-sizes {
  display: grid;
  gap: 7px;
  padding-top: 10px;
}

.prep-product-sizes span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.operations-panel {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.operations-panel[hidden] {
  display: none;
}

.operations-panel-head p,
.operations-section-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.operations-period-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.operations-period-card,
.operations-custom-card,
.cost-settings-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.operations-period-card,
.operations-custom-card {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.operations-card-head,
.operations-custom-head,
.cost-product-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.operations-card-head h3,
.operations-section-head h3 {
  margin-top: 2px;
  font-size: 22px;
}

.operations-card-head > span,
.operations-custom-head > span,
.cost-product-head > span {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.operations-metrics {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.operations-metric {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 10px;
  border-radius: 7px;
  background: var(--sage);
}

.operations-metric dt {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.operations-metric dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 17px;
  font-weight: 800;
}

.operations-metric.emphasis {
  background: var(--ink);
  color: #fff;
}

.operations-metric.emphasis dt {
  color: rgba(255, 255, 255, 0.68);
}

.operations-range-form {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto minmax(160px, 1fr) auto;
  align-items: end;
  gap: 10px;
}

.operations-range-form label,
.overhead-setting label,
.cost-variant-row label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.operations-range-form > span {
  align-self: center;
  padding-top: 20px;
  color: var(--muted);
  font-size: 13px;
}

.operations-range-form .button {
  min-height: 44px;
}

.operations-custom-result {
  display: grid;
  gap: 12px;
}

.operations-custom-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.cost-settings-card > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 14px 16px;
  list-style: none;
  cursor: pointer;
}

.cost-settings-card > summary::-webkit-details-marker {
  display: none;
}

.cost-settings-card > summary > span {
  display: grid;
  gap: 3px;
}

.cost-settings-card > summary small,
.cost-settings-card > summary b {
  color: var(--muted);
  font-size: 12px;
}

.cost-settings-card[open] > summary {
  border-bottom: 1px solid var(--line);
}

.cost-settings-form {
  display: grid;
  gap: 16px;
  padding: 16px;
}

.overhead-setting {
  display: grid;
  grid-template-columns: minmax(180px, 280px) minmax(0, 1fr);
  align-items: end;
  gap: 14px;
  padding: 13px;
  border-radius: var(--radius);
  background: var(--sage);
}

.overhead-setting p {
  margin: 0 0 5px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.cost-product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.cost-product-card {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.cost-product-head h4 {
  overflow-wrap: anywhere;
  font-size: 17px;
}

.cost-variant-list {
  display: grid;
  gap: 10px;
}

.cost-variant-row {
  display: grid;
  gap: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.cost-variant-row label {
  grid-template-columns: auto 1fr minmax(110px, 150px);
  align-items: center;
}

.cost-variant-row label strong {
  color: var(--ink);
  font-size: 14px;
}

.cost-variant-row label span {
  justify-self: end;
}

.cost-variant-row dl {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
}

.cost-variant-row dl > div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 8px;
  border-radius: 6px;
  background: var(--sage);
}

.cost-variant-row dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 700;
}

.cost-variant-row dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
  font-weight: 800;
}

.cost-settings-form > .button {
  justify-self: start;
}

.product-management-head,
.product-variant-editor-head,
.admin-product-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.product-management-head p,
.product-variant-editor-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.product-management-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-archive-filter {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  gap: 7px;
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: var(--paper);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.product-archive-filter input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
}

.admin-product-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.admin-product-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
}

.admin-product-card.archived {
  border-style: dashed;
  background: #f8f8f6;
}

.admin-product-image {
  grid-row: span 2;
  min-height: 132px;
  overflow: hidden;
  border-radius: 7px;
  background: var(--sage);
}

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

.admin-product-content {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.admin-product-content h3 {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.admin-product-content p,
.admin-product-content small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}

.admin-product-order {
  flex: 0 0 auto;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.admin-product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 6px;
}

.admin-product-badges span {
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--sage);
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.admin-product-badges [data-product-status="active"] {
  background: #edf8ef;
  color: #386641;
}

.admin-product-badges [data-product-status="inactive"],
.admin-product-badges [data-product-status="archived"] {
  background: #eeeeec;
  color: #666;
}

.admin-product-badges [data-product-seasonal="true"] {
  background: #fff7e7;
  color: #82631e;
}

.admin-product-actions {
  grid-column: 2;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.admin-product-actions.archived-actions {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.admin-product-actions .button {
  min-height: 38px;
  padding: 6px 9px;
  font-size: 12px;
}

.product-editor-dialog {
  width: min(900px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 12px;
  background: var(--paper);
  color: var(--ink);
}

.product-editor-dialog::backdrop {
  background: rgba(32, 24, 18, 0.54);
  backdrop-filter: blur(7px);
}

.product-editor-form {
  display: grid;
  gap: 18px;
  padding: 24px;
}

.product-editor-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.product-description-field,
.product-image-field {
  grid-column: 1 / -1;
}

.product-image-field {
  display: grid;
  gap: 8px;
}

.product-image-field-title {
  font-weight: 700;
}

.product-image-picker {
  position: relative;
  display: grid;
  gap: 4px;
  min-height: 86px;
  padding: 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--sage);
  cursor: pointer;
  place-content: center;
  text-align: center;
}

.product-image-picker input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  opacity: 0;
}

.product-image-picker > span {
  font-weight: 800;
}

.product-image-picker > small {
  color: var(--muted);
  line-height: 1.5;
}

.product-image-remove {
  justify-self: start;
  min-height: 44px;
}

.product-image-preview {
  grid-column: 1 / -1;
  display: grid;
  place-items: center;
  min-height: 190px;
  overflow: hidden;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--sage);
  color: var(--muted);
  font-size: 13px;
  text-align: center;
}

.product-image-preview img {
  width: 100%;
  max-height: 320px;
  object-fit: contain;
}

.product-image-fallback {
  filter: saturate(0.72);
}

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

.admin-product-switch {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  cursor: pointer;
}

.admin-product-switch input,
.variant-active-toggle input {
  width: 20px;
  min-height: 20px;
  accent-color: var(--ink);
}

.admin-product-switch span {
  display: grid;
  gap: 2px;
}

.admin-product-switch small {
  color: var(--muted);
  font-weight: 500;
}

.product-variant-editor {
  display: grid;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

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

.product-variant-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) repeat(3, minmax(105px, 0.6fr)) auto auto;
  align-items: end;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--sage);
}

.variant-active-toggle {
  grid-template-columns: auto auto;
  align-items: center;
  min-height: 44px;
  white-space: nowrap;
}

.product-variant-row > .text-button {
  min-height: 44px;
}

.product-editor-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

@media (max-width: 1020px) {
  .pickup-slot-toggle-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .admin-product-list {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .order-view-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 18px;
  }

  .booking-settings-card,
  .booking-calendar-card,
  .booking-date-editor {
    padding: 14px;
  }

  .booking-number-settings,
  .date-capacity-form,
  .booking-fulfillment-toggles {
    grid-template-columns: 1fr;
  }

  .booking-settings-form > .button,
  .date-capacity-form > .button,
  .booking-fulfillment-form > .button,
  .date-slot-editor > .button {
    width: 100%;
  }

  .booking-calendar-grid,
  .booking-weekdays {
    gap: 3px;
  }

  .booking-calendar-empty,
  .booking-calendar-day {
    min-height: 68px;
  }

  .booking-calendar-day strong {
    font-size: 15px;
  }

  .booking-date-editor-head,
  .date-slot-editor-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .booking-state-badge {
    max-width: 100%;
  }

  .booking-day-actions .button {
    width: 100%;
  }

  .product-management-panel,
  .prep-panel,
  .operations-panel,
  .product-editor-form {
    padding: 14px;
  }

  .prep-date-controls,
  .prep-breakdown {
    grid-template-columns: 1fr;
  }

  .prep-overview {
    align-items: flex-start;
    flex-direction: column;
    padding: 16px;
  }

  .prep-section {
    padding: 12px;
  }

  .prep-stat-card > summary,
  .prep-product-card > summary {
    min-height: 58px;
  }

  .prep-source-item > div {
    flex-direction: column;
    gap: 3px;
  }

  .prep-source-item span {
    text-align: left;
  }

  .order-view-tabs [data-order-view="operations"] {
    grid-column: 1 / -1;
  }

  .operations-period-grid,
  .operations-range-form,
  .overhead-setting,
  .cost-product-list {
    grid-template-columns: 1fr;
  }

  .operations-range-form > span {
    display: none;
  }

  .operations-range-form .button,
  .cost-settings-form > .button {
    width: 100%;
  }

  .operations-custom-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cost-settings-form {
    padding: 12px;
  }

  .cost-variant-row label {
    grid-template-columns: auto 1fr;
  }

  .cost-variant-row label input {
    grid-column: 1 / -1;
  }

  .product-management-head,
  .product-variant-editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .product-management-head > .button,
  .product-variant-editor-head > .button {
    width: 100%;
  }

  .product-management-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .product-archive-filter,
  .product-management-actions > .button {
    width: 100%;
  }

  .product-archive-filter {
    justify-content: center;
  }

  .product-editor-fields,
  .product-editor-switches,
  .product-variant-row {
    grid-template-columns: 1fr;
  }

  .product-description-field,
  .product-image-field,
  .product-image-preview {
    grid-column: auto;
  }

  .variant-active-toggle {
    justify-content: start;
  }
}

@media (max-width: 390px) {
  .pickup-slot-toggle-list {
    grid-template-columns: 1fr;
  }

  .booking-calendar-day span {
    font-size: 9px;
  }

  .booking-calendar-day small {
    font-size: 9px;
  }

  .booking-date-stats {
    grid-template-columns: 1fr;
  }

  .calendar-existing-orders article {
    grid-template-columns: 1fr;
  }

  .calendar-existing-orders small {
    grid-column: auto;
  }

  .admin-product-card {
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
  }

  .admin-product-image {
    min-height: 104px;
  }

  .admin-product-actions {
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
.clipboard-helper {
  position: fixed;
  inset: 0 auto auto 0;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.checkout-turnstile {
  min-height: 65px;
  overflow: hidden;
}

.checkout-turnstile-status {
  margin: -0.4rem 0 0;
  color: var(--muted);
  font-size: 0.86rem;
}

.checkout-turnstile-status[data-state="error"] {
  color: #8b3a32;
}
