/* Apple Store proportions applied to the existing local purchase flow. */
:root {
  --canvas: #f5f5f7;
  --canvas-strong: #e8e8ed;
  --surface: #f5f5f7;
  --surface-strong: #fff;
  --surface-muted: #f5f5f7;
  --ink: #1d1d1f;
  --ink-soft: #6e6e73;
  --ink-faint: #6e6e73;
  --line: #d2d2d7;
  --line-strong: #86868b;
  --accent: #0068ce;
  --accent-hover: #005bb5;
  --action: #0068ce;
  --action-hover: #005bb5;
  --accent-soft: #edf5fd;
  --accent-ink: #0068ce;
  --brand-ground: #f5f5f7;
  --brand-ink: #1d1d1f;
  --brand-muted: #6e6e73;
  --success: #0068ce;
  --success-soft: #edf5fd;
  --warning: #835b0d;
  --warning-soft: #faf5eb;
  --danger: #b42332;
  --danger-soft: #fff2f3;
  --shadow-modal: 0 24px 80px -20px #0005;
  --shadow-lift: 0 8px 24px -10px #0004;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}

body:has(dialog[open]) { overflow: hidden; }
[hidden] { display: none !important; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; letter-spacing: inherit; }
button:not(:disabled), a, summary { cursor: pointer; }
button:disabled { cursor: not-allowed; }
a { text-underline-offset: 4px; }
::selection { background: #cde5ff; color: #1d1d1f; }
:is(dialog, .delivery-section) :focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.checkout-screen:focus, #delivery-title:focus, #queryResult:focus { outline: none; }

.button, .text-button, .copy-button, .state-button, .channel-button, .qty-button {
  min-height: 44px;
  border: 0;
  background: transparent;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease, transform .2s var(--ease-out);
}
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 112px; min-height: 50px; padding: 11px 24px; border-radius: 999px; font-size: 17px; font-weight: 400; line-height: 1.4; text-decoration: none; text-align: center; }
.button.primary { background: var(--action); color: #fff; }
.button.primary:hover:not(:disabled) { background: var(--action-hover); }
.button.secondary { background: var(--surface-muted); color: var(--accent-ink); }
.button.secondary:hover:not(:disabled) { background: var(--canvas-strong); }
.button.ghost { color: var(--accent-ink); }
.button.ghost:hover:not(:disabled) { background: var(--surface-muted); }
.button.danger { background: var(--danger); color: #fff; }
.button:disabled { background: var(--canvas-strong); color: var(--ink-soft); border-color: transparent; }
.button.wide { width: 100%; }
.text-button { padding: 0 12px; border-radius: 999px; color: var(--accent-ink); font-size: 15px; font-weight: 400; }
.text-button:hover { background: var(--accent-soft); }
.copy-button { display: inline-flex; align-items: center; justify-content: center; min-width: 88px; padding: 0 18px; border-radius: 999px; background: var(--surface-muted); color: var(--accent-ink); font-size: 14px; font-weight: 400; text-decoration: none; }
.copy-button:hover { background: var(--canvas-strong); }
.copy-button:disabled { background: var(--canvas-strong); color: var(--ink-soft); }
:is(.button, .copy-button, .channel-button, .qty-button):active:not(:disabled) { transform: scale(.98); }
[data-copy-feedback="success"] { background: var(--accent-soft); color: var(--accent-ink); animation: copy-confirm .24s var(--ease-out); }
[data-copy-feedback="error"] { color: var(--danger); }
.preview-label { margin: 0; font-size: 12px; line-height: 1.65; color: var(--ink-soft); }

/* Native dialog holds the fixed checkout action outside its scrolling content. */
dialog { width: min(680px, calc(100% - 48px)); max-height: min(920px, calc(100dvh - 64px)); margin: auto; padding: 0; border: 0; border-radius: 28px; background: #fff; color: var(--ink); font-family: var(--font-body); box-shadow: var(--shadow-modal); overflow: hidden; color-scheme: light; }
dialog[open] { animation: dialog-arrive .36s var(--ease-out); }
dialog[open]::backdrop { animation: backdrop-arrive .16s ease-out; }
dialog::backdrop { background: #0000007a; }
.dialog-scroll { max-height: min(920px, calc(100dvh - 64px)); overflow: auto; overscroll-behavior: contain; scroll-padding: 28px; scrollbar-color: #aaaab0 #fff; scrollbar-width: thin; }
.dialog-head { position: sticky; z-index: 2; top: 0; display: flex; align-items: flex-start; justify-content: space-between; gap: 24px; padding: 42px 36px 26px 48px; background: #fff; color: var(--ink); }
.dialog-head > div { min-width: 0; }
.dialog-title, .dialog-head h2 { margin: 0; font-size: 38px; font-weight: 600; line-height: 1.18; letter-spacing: -.025em; }
.dialog-subtitle { margin: 10px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; overflow-wrap: anywhere; }
.close-button { position: relative; width: 44px; height: 44px; flex: none; margin-top: -3px; padding: 0; border: 0; border-radius: 50%; background: var(--surface-muted); color: var(--ink-soft); transition: background-color .2s ease, color .2s ease, transform .2s var(--ease-out); }
.close-button:hover { background: var(--canvas-strong); color: var(--ink); }
.close-button:active { transform: scale(.94); }
.close-button::before, .close-button::after { content: ""; position: absolute; top: 21px; left: 14px; width: 16px; height: 1.5px; border-radius: 2px; background: currentColor; }
.close-button::before { transform: rotate(45deg); }
.close-button::after { transform: rotate(-45deg); }
.dialog-body { padding: 12px 48px 48px; }
.dialog-actions { display: flex; justify-content: flex-end; flex-wrap: wrap; gap: 12px; margin-top: 36px; }
.agent-recruit-details { margin: 0; }
.agent-recruit-details dt { margin-top: 24px; font-size: 17px; font-weight: 600; line-height: 1.5; }
.agent-recruit-details dt:first-child { margin-top: 0; }
.agent-recruit-details dd { margin: 6px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.65; }
.agent-recruit-note { margin: 24px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.65; }
.agent-recruit-content { text-align: center; }
.agent-recruit-pitch { margin: 0; font-size: clamp(20px, 3vw, 24px); font-weight: 600; line-height: 1.5; text-wrap: balance; }
.agent-recruit-benefits { margin: 12px 0 0; color: var(--ink-soft); font-size: 16px; line-height: 1.65; text-wrap: balance; }
.agent-recruit-contact { margin: 24px 0 0; }
.agent-recruit-contact img { display: block; width: min(232px, 100%); height: auto; margin-inline: auto; }
.agent-recruit-contact figcaption { margin-top: 12px; font-size: 17px; font-weight: 600; line-height: 1.5; }
.agent-recruit-contact figcaption span { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 14px; font-weight: 400; }

#checkoutDialog { width: min(980px, calc(100% - 48px)); }
#checkoutDialog[open] { display: flex; flex-direction: column; }
#checkoutDialog > .dialog-head { position: static; flex: 0 0 auto; padding-bottom: 22px; }
#checkoutDialog > .dialog-scroll { min-height: 0; max-height: none; scroll-padding-top: 84px; }
#checkoutDialog .dialog-title { font-size: 42px; }
#checkoutDialog .dialog-body { padding: 0; }
.checkout-steps { position: sticky; top: 0; z-index: 2; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 28px; margin: 0; padding: 16px 48px 0; background: #fff; }
.checkout-step { padding: 0 0 18px; border-bottom: 1px solid var(--line); color: var(--ink-soft); font-size: 14px; line-height: 1.6; transition: color .2s ease, border-color .2s ease; }
.checkout-step.active { border-bottom: 2px solid var(--accent); padding-bottom: 17px; color: var(--accent-ink); }
.checkout-step[aria-current="step"] { font-weight: 600; }
.checkout-screen.entering { animation: checkout-arrive .24s var(--ease-out); }
.checkout-screen { min-width: 0; }
#checkoutFormScreen { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.checkout-summary { min-width: 0; padding: 34px 24px 40px 48px; }
#checkoutForm { min-width: 0; padding: 42px 48px 40px 32px; }
#checkoutForm .field-grid { margin: 0; gap: 32px; }
.checkout-product { display: grid; align-items: start; gap: 0; }
.checkout-product-art { display: grid; place-items: center; width: 100%; min-height: 156px; margin-bottom: 26px; border-radius: 24px; background: var(--surface-muted); }
.checkout-product img { display: block; width: 104px; height: 104px; object-fit: contain; }
.checkout-product img.apple-art { padding: 8px; }
.checkout-product > span:not(.checkout-product-price) { min-width: 0; }
.checkout-product strong { display: block; font-size: 28px; font-weight: 600; line-height: 1.2; letter-spacing: -.02em; }
.checkout-product span span { display: block; margin-top: 7px; color: var(--ink-soft); font-size: 17px; line-height: 1.5; }
.checkout-product-price { display: flex; align-items: baseline; gap: 9px; margin-top: 18px; font-family: var(--font-numeric); font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; font-variant-numeric: tabular-nums; }
.checkout-product-price small { color: var(--ink-soft); font-family: var(--font-body); font-size: 14px; font-weight: 400; letter-spacing: 0; }
.purchase-notice { margin-top: 30px; }
.purchase-notice > summary { min-height: 44px; padding: 10px 0; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.4; }
.checkout-details { color: var(--ink-soft); font-size: 15px; line-height: 1.7; }
.checkout-details p { margin: 0 0 12px; }
.checkout-details ul { display: grid; gap: 6px; margin: 0; padding-left: 19px; }
#checkoutStock { margin: 22px 0 0; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
#checkoutStock::before { display: none; }

/* Membership terms stay inside the native, initially collapsed purchase notice. */
#checkoutFormScreen.has-membership-notice { grid-template-columns: minmax(0, 1fr); }
.membership-notice { min-width: 0; padding: 20px 0 0; color: var(--ink-soft); font-size: 15px; line-height: 1.75; overflow-wrap: anywhere; }
.membership-notice-intro { margin: 0 0 28px; padding: 16px 18px; border-radius: 12px; background: var(--surface-muted); color: var(--ink); }
.membership-notice h3 { margin: 0 0 16px; color: var(--ink); font-size: 19px; font-weight: 600; line-height: 1.4; }
.membership-notice ul { display: grid; gap: 15px; margin: 0; padding-left: 20px; }
.membership-notice li { padding-left: 3px; }
.membership-notice ul + h3 { margin-top: 32px; }
.membership-notice strong { color: var(--ink); font-weight: 600; }
.membership-notice-acceptance { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--line); color: var(--ink); font-weight: 600; }
.membership-form-heading { margin-bottom: 28px; }
.membership-form-heading h3 { margin: 0 0 8px; font-size: 19px; font-weight: 600; line-height: 1.4; }
.membership-form-heading p { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
@media (min-width: 661px) {
  #checkoutFormScreen.has-membership-notice > .checkout-summary { padding: 32px 48px 28px; }
  .has-membership-notice .checkout-product { grid-template-columns: 80px minmax(0, 1fr) auto; align-items: center; gap: 20px; }
  .has-membership-notice .checkout-product-art { min-height: 80px; margin: 0; border-radius: 16px; }
  .has-membership-notice .checkout-product img { width: 56px; height: 56px; }
  .has-membership-notice .checkout-product-price { margin: 0; }
  #checkoutFormScreen.has-membership-notice > #checkoutForm { padding: 28px 48px 40px; border-top: 1px solid var(--line); }
}
@media (max-width: 660px) {
  .membership-notice { font-size: 14px; }
  .membership-notice h3 { font-size: 18px; }
  .membership-form-heading p { font-size: 13px; }
}

.field-grid { display: grid; gap: 28px; margin-top: 28px; }
.field { min-width: 0; }
.field label, .field-label { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 5px 8px; margin-bottom: 12px; color: var(--ink); font-size: 17px; font-weight: 600; line-height: 1.5; }
.field label small, .field-label small { align-self: center; color: var(--ink-soft); font-size: 12px; font-weight: 400; }
.input { display: block; width: 100%; min-width: 0; height: 56px; padding: 0 16px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; color: var(--ink); font-size: 17px; caret-color: var(--accent); transition: border-color .2s ease; }
.input::placeholder { color: var(--ink-soft); opacity: 1; }
.input:hover:not(:disabled) { border-color: var(--ink-soft); }
.input:focus { border-color: var(--accent); outline: 2px solid var(--accent); outline-offset: 2px; }
.input:disabled { background: var(--surface-muted); color: var(--ink-soft); }
.input[aria-invalid="true"], .qty-control:has([aria-invalid="true"]) { border-color: var(--danger); }
.field-error { margin-top: 9px; color: var(--danger); font-size: 13px; line-height: 1.6; }
.field-error:empty { display: none; }
.qty-control { display: grid; grid-template-columns: 52px minmax(0, 1fr) 52px; width: 176px; max-width: 100%; height: 56px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; overflow: hidden; }
.qty-button { min-width: 0; min-height: 54px; padding: 0; border-radius: 0; color: var(--accent-ink); }
.qty-button:hover:not(:disabled) { background: var(--surface-muted); }
.qty-button:disabled { color: #a1a1a6; }
.qty-value { min-width: 0; width: 100%; padding: 0; border: 0; border-radius: 0; background: #fff; color: var(--ink); font-family: var(--font-numeric); font-size: 19px; font-weight: 400; text-align: center; font-variant-numeric: tabular-nums; caret-color: var(--accent); }
.qty-control :focus-visible { outline-offset: -3px; }
.minus-shape, .plus-shape { position: relative; display: block; width: 14px; height: 14px; margin: auto; }
.minus-shape::before, .plus-shape::before, .plus-shape::after { content: ""; position: absolute; top: 6px; left: 1px; width: 12px; height: 1.5px; border-radius: 2px; background: currentColor; }
.plus-shape::after { transform: rotate(90deg); }
.captcha-row { display: grid; grid-template-columns: minmax(0, 1fr) 124px; gap: 12px; }
.captcha-card { display: grid; place-items: center; min-width: 0; min-height: 56px; padding: 0 8px; border: 0; border-radius: 12px; background: var(--surface-muted); color: var(--ink); font-family: var(--font-numeric); font-size: 17px; font-weight: 400; font-variant-numeric: tabular-nums; transition: background-color .2s ease; }
button.captcha-card:hover { background: var(--canvas-strong); }

.checkout-footer { flex: 0 0 auto; display: flex; justify-content: space-between; align-items: center; gap: 36px; padding: 24px 48px; border-top: 1px solid var(--line); background: #fff; }
.totals { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; }
.totals span { color: var(--ink-soft); font-size: 14px; }
.totals strong { color: var(--ink); font-family: var(--font-numeric); font-size: 32px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; white-space: nowrap; font-variant-numeric: tabular-nums; }
.checkout-footer .totals { flex: 1; align-items: center; }
.checkout-footer .dialog-actions { flex-wrap: nowrap; margin: 0; }
.checkout-footer .button { min-height: 50px; }
.checkout-total-label { display: grid; gap: 5px; }
.checkout-total-label small { color: var(--ink-soft); font-family: var(--font-numeric); font-size: 12px; font-variant-numeric: tabular-nums; }

/* Payment is a receipt and a channel choice, with no completed-state decoration. */
#paymentScreen, #confirmingScreen { padding: 40px 48px; }
.payment-summary { display: flex; align-items: center; justify-content: space-between; gap: 24px 36px; margin-bottom: 34px; }
.payment-summary > div:first-child { flex: 1; min-width: 0; }
.payment-summary h3 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.payment-summary p { margin: 9px 0 0; color: var(--ink-soft); font-size: 17px; line-height: 1.5; }
.payment-total { text-align: right; }
.payment-total > span { color: var(--ink-soft); font-size: 14px; }
.payment-amount { display: block; margin-top: 8px; font-family: var(--font-numeric); font-size: 56px; font-weight: 600; line-height: 1.08; letter-spacing: -.03em; font-variant-numeric: tabular-nums; white-space: nowrap; }
.channel-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.channel-button { display: grid; grid-template-columns: 36px minmax(0, 1fr) 20px; align-items: center; gap: 14px; min-width: 0; min-height: 84px; padding: 16px 20px; border: 1px solid var(--line-strong); border-radius: 12px; background: #fff; text-align: left; }
.channel-button::after { content: ""; width: 20px; height: 20px; border: 1px solid var(--line-strong); border-radius: 50%; }
.channel-button:hover { background: var(--surface-muted); }
.channel-button.active { padding: 15px 19px; border: 2px solid var(--accent); }
.channel-button.active::after { border: 6px solid var(--accent); background: #fff; }
.channel-mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 8px; color: #fff; }
.channel-mark.wechat { background: #087a43; }
.channel-mark.alipay { background: #075fcc; }
.channel-mark svg { width: 26px; height: 26px; }
.channel-button strong { display: block; font-size: 17px; font-weight: 600; }
.channel-button small { display: block; margin-top: 4px; color: var(--ink-soft); font-size: 13px; }
.payment-panel { display: grid; grid-template-columns: 258px minmax(0, 1fr); align-items: center; gap: 44px; margin-top: 38px; }
.qr-preview { display: grid; justify-items: center; gap: 14px; padding: 24px 20px; border-radius: 24px; background: var(--surface-muted); }
.qr-preview small { color: var(--ink-soft); font-size: 12px; line-height: 1.6; }
.demo-qr { display: grid; grid-template-columns: repeat(21, 1fr); grid-template-rows: repeat(21, 1fr); gap: 1px; width: 210px; height: 210px; padding: 14px; border-radius: 4px; background: #fff; }
.demo-qr-cell { background: transparent; }
.demo-qr-cell.dark { background: #1d1d1f; }
.payment-copy h3 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.payment-copy p { margin: 14px 0 0; color: var(--ink-soft); font-size: 17px; line-height: 1.6; }
.payment-copy .button { min-width: 202px; margin-top: 26px; }
.payment-note { margin-top: 14px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
#paymentScreen > .dialog-actions { justify-content: flex-start; margin-top: 32px; }
.confirming-panel { display: grid; place-items: center; min-height: 340px; text-align: center; }
.confirming-panel h3 { margin: 0; font-size: 34px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; }
.confirming-panel p { max-width: 38ch; margin: 18px auto 0; color: var(--ink-soft); font-size: 17px; line-height: 1.65; }
.confirming-ring { width: 46px; height: 46px; margin: 0 auto 28px; border: 2px solid var(--canvas-strong); border-top-color: var(--accent); border-radius: 50%; animation: flow-spin .85s linear infinite; }

/* Fulfilled content comes first; the quieter order record remains beside it. */
.delivery-section { width: 100%; max-width: 1080px; margin: 0 auto; padding: 36px 0 80px; scroll-margin-top: 28px; font-family: var(--font-body); }
.delivery-navigation { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 44px; }
.delivery-navigation > div { display: flex; align-items: center; gap: 24px; }
.delivery-navigation h1 { margin: 0; font-size: 24px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.delivery-navigation .text-button { padding-left: 0; }
.delivery-stage { min-width: 0; background: transparent; }
.delivery-status { display: grid; grid-template-columns: 64px minmax(0, 1fr) auto; align-items: center; gap: 24px; margin: 0 0 46px; color: var(--ink); }
.status-icon { display: grid; place-items: center; width: 64px; height: 64px; border-radius: 50%; background: var(--accent-soft); color: var(--accent); }
.delivery-status.pending .status-icon { background: var(--canvas-strong); color: var(--ink-soft); }
.delivery-status.confirming .status-icon { background: var(--accent-soft); color: var(--accent); }
.delivery-status.shortage .status-icon { background: var(--warning-soft); color: var(--warning); }
.delivery-status.exception .status-icon { background: var(--danger-soft); color: var(--danger); }
.delivery-status h3 { margin: 0; font-size: 40px; font-weight: 600; line-height: 1.2; letter-spacing: -.025em; }
.delivery-status p { margin: 12px 0 0; color: var(--ink-soft); font-size: 17px; line-height: 1.6; }
.status-time { max-width: 13em; color: var(--ink-soft); font-size: 13px; line-height: 1.6; text-align: right; font-variant-numeric: tabular-nums; }
.check-shape { display: block; width: 20px; height: 12px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg) translate(1px, -1px); }
.clock-shape { position: relative; display: block; width: 20px; height: 20px; border: 1.5px solid currentColor; border-radius: 50%; }
.clock-shape::before { content: ""; position: absolute; top: 3px; left: 8px; width: 5px; height: 6px; border-left: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; }
.alert-shape { position: relative; display: block; width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 50%; }
.alert-shape::before { content: ""; position: absolute; left: 9px; top: 4px; width: 1.5px; height: 7px; background: currentColor; }
.alert-shape::after { content: ""; position: absolute; left: 9px; bottom: 4px; width: 1.5px; height: 1.5px; border-radius: 50%; background: currentColor; }
.delivery-workspace { display: grid; grid-template-columns: minmax(0, 1fr) 272px; align-items: start; gap: 44px; }
.fulfillment-pane { min-width: 0; }
.delivery-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 0 0 20px; }
.delivery-toolbar h4 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.delivery-toolbar .text-button { flex: none; }
.fulfillment-list { display: grid; gap: 24px; margin: 0; }
.fulfillment-group { min-width: 0; overflow: hidden; border-radius: 24px; background: #fff; }
.group-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 76px; padding: 24px 32px 12px; color: var(--ink); }
.group-head strong { font-size: 19px; font-weight: 600; }
.group-head span { color: var(--ink-soft); font-size: 12px; }
.delivery-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 8px 16px; margin: 0 32px; padding: 12px 0 28px; }
.delivery-item + .delivery-item { padding-top: 22px; border-top: 1px solid var(--line); }
.delivery-item > div:first-child { display: contents; }
.delivery-item label { grid-column: 1; grid-row: 1; color: var(--ink-soft); font-size: 14px; line-height: 1.6; }
.delivery-value { grid-column: 1 / -1; grid-row: 2; min-width: 0; padding-top: 10px; color: var(--ink); font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace; font-size: 22px; font-weight: 500; line-height: 1.6; letter-spacing: -.02em; overflow-wrap: anywhere; user-select: all; font-variant-numeric: tabular-nums; }
.delivery-item:has(.delivery-actions) .delivery-value { font-size: 17px; letter-spacing: 0; }
.delivery-item > .copy-button { grid-column: 2; grid-row: 1; }
.delivery-actions { grid-column: 2; grid-row: 1; display: flex; justify-content: flex-end; gap: 8px; }
.delivery-actions .copy-button:last-child { background: var(--action); color: #fff; }
.delivery-actions .copy-button:last-child:hover { background: var(--action-hover); }
.delivery-hint { max-width: 64ch; margin: 24px 0 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; }
.order-details { min-width: 0; padding-top: 2px; color: var(--ink); }
.order-details > summary { min-height: 44px; padding: 9px 0; cursor: pointer; font-size: 15px; font-weight: 600; line-height: 1.7; }
.order-details[open] > summary { margin-bottom: 26px; }
.order-facts { display: grid; gap: 24px; }
.fact { min-width: 0; }
.fact span { display: block; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.fact strong { display: block; margin-top: 6px; font-size: 15px; font-weight: 400; line-height: 1.6; overflow-wrap: anywhere; font-variant-numeric: tabular-nums; }
.delivery-progress { display: grid; gap: 6px; margin-top: 32px; }
.delivery-progress-step { position: relative; min-width: 0; padding: 0 8px 17px 23px; color: var(--ink-soft); font-size: 13px; line-height: 1.6; }
.delivery-progress-step::before { content: ""; position: absolute; z-index: 1; top: 5px; left: 0; width: 8px; height: 8px; border-radius: 50%; background: var(--line); }
.delivery-progress-step::after { content: ""; position: absolute; top: 13px; bottom: -6px; left: 3.5px; width: 1px; background: var(--line); }
.delivery-progress-step:last-child::after { display: none; }
.delivery-progress-step.active { color: var(--ink); }
.delivery-progress-step.active::before { background: var(--accent); }
.delivery-progress-step.current::before { border: 2px solid var(--accent); background: #fff; }
.delivery-commands { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 20px; }
.order-details .delivery-commands .button { width: 100%; min-width: 0; font-size: 14px; }
.order-details .button.secondary { background: #fff; }
.order-details .button.secondary:hover { background: var(--canvas-strong); }
.status-empty { display: grid; place-items: center; min-height: 370px; padding: 48px 40px; border-radius: 24px; background: #fff; text-align: center; }
.status-empty-inner { max-width: 42ch; }
.status-empty h4 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.3; letter-spacing: -.02em; }
.status-empty p { margin: 18px 0 0; color: var(--ink-soft); font-size: 17px; line-height: 1.65; }
.status-empty .button { margin-top: 30px; }
.loading-line { width: min(320px, 80%); height: 3px; margin: 28px auto 0; border-radius: 3px; background: var(--canvas-strong); overflow: hidden; }
.loading-line::after { content: ""; display: block; width: 40%; height: 100%; background: var(--accent); animation: flow-loading 1.4s ease-in-out infinite; }

#checkoutDeliveryScreen { padding: 36px 48px 44px; background: var(--canvas); }
.checkout-delivery .delivery-status { grid-template-columns: 52px minmax(0, 1fr) auto; gap: 18px; margin-bottom: 30px; }
.checkout-delivery .status-icon { width: 52px; height: 52px; }
.checkout-delivery .delivery-status p { font-size: 15px; }
.checkout-delivery .delivery-status h3 { font-size: 32px; }
.checkout-delivery .delivery-workspace { grid-template-columns: 1fr; gap: 28px; }
.checkout-delivery .delivery-toolbar h4 { font-size: 24px; }
.checkout-delivery .order-details { padding-top: 16px; border-top: 1px solid var(--line); }
.checkout-delivery .order-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.checkout-delivery .order-details .delivery-commands .button { width: auto; }
.checkout-delivery .full-delivery-link { margin-top: 26px; }

/* Find an order, get help, or contact support using the same control language. */
.query-intro { max-width: 54ch; margin: 0; color: var(--ink-soft); font-size: 17px; line-height: 1.65; }
#queryForm .field-grid { margin-top: 32px; }
.query-result { margin-top: 36px; padding: 32px; border-radius: 24px; background: var(--surface-muted); color: var(--ink); animation: checkout-arrive .24s var(--ease-out); }
.query-result > strong { display: block; font-size: 24px; font-weight: 600; line-height: 1.35; letter-spacing: -.015em; }
.query-result p { margin: 12px 0 26px; color: var(--ink-soft); font-size: 15px; line-height: 1.7; overflow-wrap: anywhere; }
.query-result[data-state="confirming"] > strong { color: var(--accent-ink); }
.query-result[data-state="exception"] > strong { color: var(--danger); }
.query-result[data-state="shortage"] > strong { color: var(--warning); }
#helpDialog { width: min(980px, calc(100% - 48px)); }
.help-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); align-items: start; gap: 56px; padding-top: 22px; }
.help-aside { color: var(--ink-soft); font-size: 17px; }
.help-aside p { margin: 0 0 22px; line-height: 1.65; }
.help-aside .button { min-width: 0; margin-top: 6px; font-size: 15px; }
.faq-list { display: grid; gap: 0; }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list details:first-child summary { padding-top: 0; }
.faq-list summary { position: relative; display: flex; align-items: center; min-height: 76px; padding: 24px 34px 24px 0; list-style: none; color: var(--ink); font-size: 19px; font-weight: 600; line-height: 1.5; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: ""; position: absolute; right: 5px; width: 9px; height: 9px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-3px); transition: transform .24s var(--ease-out); }
.faq-list details[open] summary::after { transform: rotate(225deg); }
.faq-list details p { max-width: 60ch; margin: -2px 0 28px; color: var(--ink-soft); font-size: 17px; line-height: 1.65; }
#supportDialog { width: min(800px, calc(100% - 48px)); }
.qr-layout { display: grid; grid-template-columns: 258px minmax(0, 1fr); align-items: center; gap: 40px; padding-top: 22px; }
.qr-layout img { display: block; width: 258px; height: 258px; padding: 24px; border-radius: 24px; object-fit: contain; background: var(--surface-muted); }
.qr-layout h3 { margin: 0; font-size: 28px; font-weight: 600; line-height: 1.25; letter-spacing: -.02em; }
.qr-layout p { margin: 16px 0 28px; color: var(--ink-soft); font-size: 17px; line-height: 1.65; }

.toast { position: fixed; z-index: 100; left: 50%; bottom: max(24px, env(safe-area-inset-bottom)); width: max-content; max-width: calc(100% - 32px); padding: 15px 22px; border-radius: 16px; background: #1d1d1f; color: #fff; box-shadow: var(--shadow-lift); text-align: center; font-family: var(--font-body); font-size: 14px; font-weight: 400; line-height: 1.6; opacity: 0; transform: translate(-50%, 12px); transition: transform .24s var(--ease-out), opacity .2s ease; pointer-events: none; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.demo-tools { margin-top: 48px; border-top: 1px solid var(--line); }
.demo-tools > summary { min-height: 48px; padding: 16px 0; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.demo-tools p { margin: 0 0 14px; color: var(--ink-soft); font-size: 13px; line-height: 1.7; }
.state-lab { display: flex; flex-wrap: wrap; gap: 8px; padding-bottom: 8px; }
.state-button { padding: 0 16px; border-radius: 999px; color: var(--ink-soft); font-size: 14px; font-weight: 400; }
.state-button:hover { background: var(--canvas-strong); color: var(--ink); }
.state-button.active { background: var(--accent-soft); color: var(--accent-ink); }

@keyframes flow-spin { to { transform: rotate(360deg); } }
@keyframes flow-loading { from { transform: translateX(-110%); } to { transform: translateX(260%); } }

@keyframes dialog-arrive { from { opacity: 0; transform: translateY(20px) scale(.985); } to { opacity: 1; transform: none; } }
@keyframes backdrop-arrive { from { opacity: 0; } to { opacity: 1; } }
dialog[open].is-closing, #checkoutDialog[open].is-closing { animation: dialog-depart .18s ease-out both; pointer-events: none; }
dialog[open].is-closing::backdrop { animation: dialog-depart .18s ease-out both; }
@keyframes dialog-depart { from { opacity: 1; } to { opacity: 0; } }
@keyframes checkout-arrive { from { opacity: .3; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes copy-confirm { from { transform: scale(.96); } to { transform: scale(1); } }

@media (max-width: 960px) {
  .dialog-head { padding-inline: 36px 28px; }
  .dialog-body, .checkout-steps { padding-inline: 36px; }
  .checkout-summary { padding: 32px 20px 36px 36px; }
  #checkoutForm { padding: 36px 36px 36px 20px; }
  .checkout-product-art { min-height: 136px; }
  .checkout-footer { gap: 24px; padding-inline: 36px; }
  .checkout-footer .button { padding-inline: 20px; font-size: 15px; }
  #paymentScreen, #confirmingScreen, #checkoutDeliveryScreen { padding-inline: 36px; }
  .payment-panel { grid-template-columns: 236px minmax(0, 1fr); gap: 30px; }
  .qr-preview { padding-inline: 16px; }
  .demo-qr { width: 200px; height: 200px; }
  .payment-copy h3 { font-size: 24px; }
  .delivery-workspace { grid-template-columns: minmax(0, 1fr) 240px; gap: 28px; }
  .delivery-status h3 { font-size: 36px; }
  .delivery-actions { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; margin-top: 12px; }
  .delivery-item:has(.delivery-actions) label { min-height: 32px; display: flex; align-items: center; }
  .group-head { padding-inline: 26px; }
  .delivery-item { margin-inline: 26px; }
  .delivery-value { font-size: 20px; }
  .help-layout { grid-template-columns: 208px minmax(0, 1fr); gap: 36px; }
  .qr-layout { grid-template-columns: 236px minmax(0, 1fr); gap: 28px; }
  .qr-layout img { width: 236px; height: 236px; padding: 20px; }
}

@media (max-width: 660px) {
  dialog, #helpDialog, #supportDialog { position: fixed; inset: var(--dialog-viewport-top, 0px) 0 auto; width: calc(100% - 20px); max-height: calc(var(--dialog-viewport-height, 100dvh) - 20px); margin: 10px auto; border-radius: 24px; }
  .dialog-scroll { max-height: calc(var(--dialog-viewport-height, 100dvh) - 20px); scroll-padding: 22px; }
  .dialog-head { padding: 30px 18px 24px 26px; gap: 14px; }
  .dialog-title, .dialog-head h2 { font-size: 28px; line-height: 1.2; }
  .dialog-subtitle { margin-top: 8px; font-size: 12px; }
  .dialog-body { padding: 6px 26px 32px; }
  .close-button { margin-top: -5px; }
  .dialog-actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 10px; margin-top: 28px; }
  .dialog-actions .button { min-width: 0; padding-inline: 12px; font-size: 15px; }
  #checkoutDialog { width: 100%; max-width: 100%; height: var(--dialog-viewport-height, 100dvh); max-height: var(--dialog-viewport-height, 100dvh); margin: 0; border-radius: 0; }
  #checkoutDialog[open] { animation-name: backdrop-arrive; }
  #checkoutDialog > .dialog-head { padding: max(24px, env(safe-area-inset-top)) 18px 18px 24px; }
  #checkoutDialog .dialog-title { font-size: 28px; }
  #checkoutDialog > .dialog-scroll { flex: 1; scroll-padding-top: 78px; }
  .checkout-steps { gap: 20px; padding: 12px 24px 0; }
  .checkout-step { padding-bottom: 15px; font-size: 13px; }
  .checkout-step.active { padding-bottom: 14px; }
  #checkoutFormScreen { grid-template-columns: 1fr; }
  .checkout-summary { padding: 26px 24px 30px; }
  .checkout-product { grid-template-columns: 86px minmax(0, 1fr); align-items: center; gap: 0 20px; }
  .checkout-product-art { grid-column: 1; grid-row: 1 / 3; min-height: 100px; margin: 0; border-radius: 18px; }
  .checkout-product img { width: 60px; height: 60px; }
  .checkout-product img.apple-art { padding: 4px; }
  .checkout-product strong { font-size: 25px; }
  .checkout-product span span { margin-top: 5px; font-size: 14px; }
  .checkout-product-price { grid-column: 2; margin-top: 13px; font-size: 28px; }
  .checkout-product-price small { font-size: 12px; }
  .checkout-details { margin-top: 26px; font-size: 14px; line-height: 1.65; }
  .checkout-details h3 { margin-bottom: 10px; font-size: 16px; }
  .checkout-details ul { gap: 5px; }
  #checkoutStock { margin-top: 16px; font-size: 12px; }
  #checkoutForm { padding: 26px 24px 34px; border-top: 1px solid var(--line); }
  #checkoutForm .field-grid, .field-grid { gap: 26px; }
  .field label, .field-label { font-size: 16px; margin-bottom: 11px; }
  .input { height: 54px; font-size: 17px; }
  .captcha-row { grid-template-columns: minmax(0, 1fr) 118px; gap: 12px; }
  .captcha-card { min-height: 54px; }
  .checkout-footer { display: block; padding: 18px 24px max(18px, env(safe-area-inset-bottom)); }
  .checkout-footer .totals { gap: 16px; }
  .checkout-footer .totals strong { font-size: 30px; }
  .checkout-footer .dialog-actions { display: grid; margin-top: 14px; }
  .checkout-footer .button { min-height: 48px; font-size: 15px; }
  #paymentScreen, #confirmingScreen { padding: 30px 24px; }
  .payment-summary { flex-wrap: wrap; gap: 24px; margin-bottom: 28px; }
  .payment-summary > div:first-child { flex-basis: 100%; }
  .payment-summary h3 { font-size: 26px; }
  .payment-summary p { font-size: 15px; }
  .payment-total { display: flex; width: 100%; justify-content: space-between; align-items: baseline; gap: 12px; }
  .payment-amount { margin: 0; font-size: 46px; }
  .channel-grid { gap: 12px; }
  .channel-button { grid-template-columns: 30px minmax(0, 1fr) 16px; gap: 9px; min-height: 78px; padding: 14px 12px; }
  .channel-button.active { padding: 13px 11px; }
  .channel-mark { width: 30px; height: 30px; }
  .channel-mark svg { width: 23px; height: 23px; }
  .channel-button::after { width: 16px; height: 16px; }
  .channel-button.active::after { border-width: 5px; }
  .channel-button strong { font-size: 15px; }
  .channel-button small { font-size: 12px; }
  .payment-panel { grid-template-columns: 1fr; gap: 30px; margin-top: 30px; }
  .qr-preview { width: max-content; max-width: 100%; margin: auto; padding: 22px 26px; }
  .demo-qr { width: 198px; height: 198px; }
  .payment-copy { text-align: center; }
  .payment-copy h3 { font-size: 26px; }
  .payment-copy p { max-width: 38ch; margin-inline: auto; font-size: 16px; }
  .payment-copy .button { width: 100%; margin-top: 24px; }
  .payment-note { font-size: 12px; }
  #paymentScreen > .dialog-actions { margin-top: 28px; }
  .confirming-panel { min-height: 310px; }
  .confirming-panel h3 { font-size: 28px; }
  .confirming-panel p { font-size: 16px; }
  .delivery-section { padding: 24px 0 52px; }
  .delivery-navigation { flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
  .delivery-navigation > div { width: 100%; justify-content: space-between; gap: 12px; }
  .delivery-navigation h1 { font-size: 23px; }
  .delivery-store-name { display: none; }
  .delivery-navigation .preview-label { font-size: 12px; }
  .delivery-status { grid-template-columns: 48px minmax(0, 1fr); align-items: start; gap: 8px 16px; margin-bottom: 32px; }
  .status-icon { width: 48px; height: 48px; margin-top: 1px; }
  .delivery-status h3 { font-size: 28px; line-height: 1.2; }
  .delivery-status p { margin-top: 10px; font-size: 15px; }
  .status-time { grid-column: 2; max-width: none; font-size: 12px; text-align: left; }
  .delivery-workspace { grid-template-columns: 1fr; gap: 36px; }
  .delivery-toolbar { margin-bottom: 18px; gap: 10px; }
  .delivery-toolbar h4 { font-size: 25px; }
  .delivery-toolbar .text-button { padding-inline: 8px; }
  .fulfillment-list { gap: 22px; }
  .fulfillment-group { border-radius: 22px; }
  .group-head { min-height: 70px; padding: 22px 24px 12px; }
  .group-head strong { font-size: 17px; }
  .delivery-item { gap: 8px 12px; margin-inline: 24px; padding: 10px 0 26px; }
  .delivery-item + .delivery-item { padding-top: 20px; }
  .delivery-value { padding-top: 12px; font-size: 19px; }
  .delivery-item:has(.delivery-actions) .delivery-value { font-size: 15px; }
  .copy-button { padding-inline: 16px; font-size: 13px; }
  .delivery-actions { width: 100%; gap: 10px; margin-top: 14px; }
  .delivery-actions .copy-button { flex: 1; }
  .delivery-hint { margin-top: 22px; font-size: 14px; }
  .order-details { padding-top: 18px; border-top: 1px solid var(--line); }
  .order-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .delivery-commands .button { flex: 1 1 128px; }
  .order-details .delivery-commands .button { width: auto; }
  .status-empty { min-height: 320px; padding: 36px 24px; }
  .status-empty h4 { font-size: 25px; }
  .status-empty p { font-size: 16px; }
  #checkoutDeliveryScreen { padding: 30px 24px; }
  .checkout-delivery .delivery-status { grid-template-columns: 44px minmax(0, 1fr); gap: 8px 14px; }
  .checkout-delivery .status-icon { width: 44px; height: 44px; }
  .checkout-delivery .delivery-status h3 { font-size: 28px; }
  .checkout-delivery .delivery-status p { font-size: 14px; }
  .checkout-delivery .delivery-toolbar h4 { font-size: 23px; }
  .checkout-delivery .group-head { padding-inline: 20px; }
  .checkout-delivery .delivery-item { margin-inline: 20px; }
  .checkout-delivery .delivery-value { font-size: 18px; }
  .checkout-delivery .full-delivery-link { width: 100%; }
  .query-intro { font-size: 16px; }
  .query-result { padding: 26px 22px; }
  .query-result > strong { font-size: 22px; }
  .query-result .button { width: 100%; }
  .help-layout { grid-template-columns: 1fr; gap: 32px; padding-top: 12px; }
  .help-aside { order: 2; font-size: 16px; }
  .help-aside .button { margin-top: 0; }
  .faq-list summary { min-height: 72px; font-size: 18px; }
  .faq-list details p { font-size: 16px; }
  .qr-layout { grid-template-columns: 1fr; gap: 30px; padding-top: 12px; text-align: center; }
  .qr-layout img { width: 248px; height: 248px; margin: auto; padding: 22px; }
  .qr-layout h3 { font-size: 26px; }
  .qr-layout p { max-width: 30ch; margin-inline: auto; font-size: 16px; }
  .demo-tools { margin-top: 36px; }
}

@media (max-width: 370px) {
  .dialog-head { padding-inline: 20px 12px; gap: 10px; }
  .dialog-title, .dialog-head h2 { font-size: 25px; }
  .dialog-body { padding-inline: 20px; }
  #checkoutDialog > .dialog-head { padding-inline: 18px 12px; }
  #checkoutDialog .dialog-title { font-size: 25px; }
  .checkout-steps { padding-inline: 18px; gap: 14px; }
  .checkout-summary, #checkoutForm, #paymentScreen, #confirmingScreen, #checkoutDeliveryScreen { padding-inline: 18px; }
  .checkout-product { grid-template-columns: 74px minmax(0, 1fr); column-gap: 16px; }
  .checkout-product-art { min-height: 90px; }
  .checkout-product img { width: 54px; height: 54px; }
  .checkout-product strong { font-size: 23px; }
  .checkout-product-price { font-size: 26px; }
  .checkout-footer { padding-inline: 18px; }
  .field label, .field-label { font-size: 15px; }
  .field label small, .field-label small { font-size: 11px; }
  .captcha-row { grid-template-columns: minmax(0, 1fr) 108px; gap: 10px; }
  .channel-button { grid-template-columns: 26px minmax(0, 1fr) 14px; gap: 7px; padding-inline: 9px; }
  .channel-button.active { padding-inline: 8px; }
  .channel-mark { width: 26px; height: 26px; border-radius: 7px; }
  .channel-mark svg { width: 21px; height: 21px; }
  .channel-button::after { width: 14px; height: 14px; }
  .channel-button.active::after { border-width: 4px; }
  .channel-button strong { font-size: 14px; }
  .channel-button small { font-size: 11px; }
  .payment-amount { font-size: 42px; }
  .delivery-navigation h1 { font-size: 21px; }
  .delivery-status { grid-template-columns: 42px minmax(0, 1fr); column-gap: 12px; }
  .status-icon { width: 42px; height: 42px; }
  .delivery-status h3 { font-size: 28px; }
  .delivery-toolbar h4, .checkout-delivery .delivery-toolbar h4 { font-size: 22px; }
  .delivery-toolbar .text-button { padding-inline: 4px; font-size: 13px; }
  .group-head { padding-inline: 20px; }
  .delivery-item { margin-inline: 20px; }
  .delivery-value { font-size: 17px; }
  .copy-button { min-width: 78px; padding-inline: 13px; }
  .order-facts { gap: 22px 18px; }
  .fact strong { font-size: 14px; }
}

@media (max-width: 960px) and (max-height: 500px) {
  #checkoutDialog { max-height: calc(var(--dialog-viewport-height, 100dvh) - 8px); }
  #checkoutDialog > .dialog-head { padding-block: 10px; }
  #checkoutDialog .dialog-title { font-size: 23px; }
  #checkoutDialog .dialog-subtitle { margin-top: 3px; font-size: 11px; }
  .checkout-footer { padding-block: 10px; }
  .checkout-footer .totals strong { font-size: 26px; }
  .checkout-footer .dialog-actions { margin-top: 8px; }
  .checkout-footer .button { min-height: 44px; padding-block: 8px; }
  .checkout-steps { padding-top: 10px; }
  .checkout-step { padding-bottom: 10px; }
  .checkout-step.active { padding-bottom: 9px; }
}

@media (prefers-reduced-motion: reduce) {
  dialog, dialog::backdrop, :is(dialog, .delivery-section, .toast) *, .toast { animation: none !important; transition: none !important; }
  .loading-line::after { animation: none; transform: translateX(70%); }
}
