:root {
  color-scheme: light;
  --page: #eceef1;
  --background: #f6f7f9;
  --surface: #ffffff;
  --surface-soft: #f1f2f4;
  --surface-warm: #fff5ef;
  --text: #202124;
  --text-muted: #6d7178;
  --text-faint: #92969d;
  --line: #e3e5e8;
  --line-strong: #cfd2d7;
  --accent: #df5e2f;
  --accent-pressed: #c94f24;
  --accent-soft: #fff0e8;
  --success: #2f7455;
  --success-soft: #eaf6ef;
  --warning: #8a5b13;
  --warning-soft: #fff6df;
  --danger: #b64444;
  --danger-soft: #fff0f0;
  --shadow-dock: 0 -8px 28px rgb(50 54 60 / 0.10);
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --font-number: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --page: #0d0f11;
    --background: #111315;
    --surface: #191c1f;
    --surface-soft: #22262a;
    --surface-warm: #2a1d18;
    --text: #f1f2f3;
    --text-muted: #b0b4b9;
    --text-faint: #858a91;
    --line: #30343a;
    --line-strong: #444a52;
    --accent: #f07c4e;
    --accent-pressed: #ff9167;
    --accent-soft: #3a241d;
    --success: #72be96;
    --success-soft: #183126;
    --warning: #e3b765;
    --warning-soft: #352a16;
    --danger: #ed8d8d;
    --danger-soft: #381f20;
    --shadow-dock: 0 -8px 28px rgb(0 0 0 / 0.34);
  }
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--page);
  font-family: var(--font-sans);
  -webkit-text-size-adjust: 100%;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  color: var(--text);
  background: var(--background);
  font-family: var(--font-sans);
  line-height: 1.5;
}

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

a {
  color: var(--accent);
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

h1,
h2,
h3,
p {
  margin: 0;
}

[hidden] {
  display: none !important;
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 42%, transparent);
  outline-offset: 2px;
}

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

.mobile-app-shell {
  width: 100%;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--background);
}

@media (min-width: 560px) {
  .mobile-app-shell {
    max-width: 520px;
    border-inline: 1px solid var(--line);
  }
}

.button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  padding: 0 18px;
  font-size: 15px;
  font-weight: 700;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.button:active:not(:disabled) {
  transform: scale(0.98);
}

.button:disabled,
.button.is-disabled,
.button[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: 0.45;
  pointer-events: none;
}

.button-primary {
  color: #fffaf7;
  background: var(--accent);
  border-color: var(--accent);
}

.button-primary:active:not(:disabled) {
  background: var(--accent-pressed);
}

.button-secondary {
  color: var(--text);
  background: var(--surface);
  border-color: var(--line-strong);
}

.button-quiet {
  color: var(--text-muted);
  background: transparent;
  border-color: transparent;
}

.storefront-body {
  padding: 0;
}

.shop-header,
.subpage-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: grid;
  min-height: 54px;
  align-items: center;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px;
  border-bottom: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 96%, transparent);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.shop-header {
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px;
}

.shop-brand {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.shop-brand strong {
  overflow: hidden;
  font-size: 16px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shop-brand span {
  color: var(--text-muted);
  font-size: 11px;
}

.shop-header-actions {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 2px;
  white-space: nowrap;
}

.header-order-link,
.header-admin-link,
.header-text-button,
.back-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  border: 0;
  padding: 7px 0;
  color: var(--accent);
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

.header-order-link {
  padding-inline: 5px;
}

.header-admin-link {
  border-radius: 9px;
  padding-inline: 9px;
  color: var(--accent);
  background: var(--accent-soft);
}

.subpage-header {
  grid-template-columns: 1fr auto 1fr;
  text-align: center;
}

.subpage-header > :first-child {
  justify-self: start;
}

.subpage-header > :last-child {
  justify-self: end;
}

.subpage-header > strong {
  font-size: 16px;
}

.institution-strip {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface-warm);
}

.institution-strip > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.institution-strip span {
  color: var(--text-muted);
  font-size: 11px;
}

.institution-strip strong {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-tier-label {
  flex: 0 0 auto;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--accent) !important;
  background: var(--accent-soft);
  font-size: 12px !important;
  font-weight: 700;
}

.catalog-toolbar {
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.catalog-search {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  margin: 8px 12px 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 11px;
  background: var(--surface-soft);
}

.catalog-search > span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 700;
}

.catalog-search input {
  width: 100%;
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
}

.catalog-search input::placeholder {
  color: var(--text-faint);
}

.category-filters {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 0 14px;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
}

.category-filters::-webkit-scrollbar {
  display: none;
}

.category-filter {
  position: relative;
  flex: 0 0 auto;
  min-width: 44px;
  min-height: 44px;
  scroll-snap-align: center;
  border: 0;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  font-size: 13px;
  white-space: nowrap;
}

.category-filter[aria-pressed="true"] {
  color: var(--text);
  font-weight: 700;
}

.category-filter[aria-pressed="true"]::after {
  position: absolute;
  right: 22%;
  bottom: 0;
  left: 22%;
  height: 3px;
  border-radius: 2px 2px 0 0;
  background: var(--accent);
  content: "";
}

.catalog-main,
.checkout-main,
.order-page-main {
  padding-bottom: calc(90px + env(safe-area-inset-bottom));
}

.catalog-list-heading {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 12px 14px 8px;
}

.catalog-list-heading h1 {
  font-size: 17px;
  line-height: 1.3;
}

.catalog-list-heading span {
  color: var(--text-muted);
  font-family: var(--font-number);
  font-size: 12px;
}

.product-list {
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.product-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  min-height: 126px;
  gap: 12px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.product-row.is-selected {
  background: color-mix(in srgb, var(--accent-soft) 44%, var(--surface));
}

.product-media {
  display: grid;
  overflow: hidden;
  place-items: center;
  border-radius: 10px;
  background: var(--surface-soft);
}

.product-media-card {
  width: 112px;
  height: 88px;
  align-self: start;
}

.product-media-summary {
  width: 76px;
  height: 60px;
}

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

.product-sheet-crop {
  width: 100%;
  height: auto;
  background-image: url("/product-images/xiaohou-daen-price-sheet.png");
  background-repeat: no-repeat;
  background-position: 72.696534% var(--sheet-position-y, 8.740048%);
  background-size: 404.113111% auto;
}

.product-placeholder {
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  padding: 8px;
  color: var(--text-faint);
  font-size: 11px;
  text-align: center;
}

.product-row-body {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.product-row-body h2 {
  display: -webkit-box;
  overflow: hidden;
  min-height: 40px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  line-height: 20px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-spec {
  overflow: hidden;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-row-bottom {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.product-pricing {
  display: flex;
  min-width: 0;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 2px 4px;
}

.product-pricing strong,
.summary-item-copy strong,
.checkout-dock strong,
.public-order-total strong,
.public-order-item b {
  font-family: var(--font-number);
  font-variant-numeric: tabular-nums;
}

.product-pricing strong {
  color: var(--accent);
  font-size: 17px;
  letter-spacing: -0.04em;
}

.product-pricing span {
  color: var(--text-muted);
  font-size: 10px;
}

.product-pricing del {
  width: 100%;
  color: var(--text-faint);
  font-family: var(--font-number);
  font-size: 10px;
}

.quantity-control {
  display: grid;
  flex: 0 0 auto;
  grid-template-columns: 44px 34px 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  background: var(--surface);
}

.quantity-button,
.quantity-input {
  min-width: 0;
  border: 0;
  border-radius: 0;
  padding: 0;
  background: transparent;
  text-align: center;
}

.quantity-button {
  color: var(--accent);
  font-size: 20px;
  line-height: 42px;
}

.quantity-button:disabled {
  color: var(--text-faint);
}

.quantity-input {
  width: 34px;
  color: var(--text);
  background: var(--surface-soft);
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 700;
  appearance: textfield;
  -moz-appearance: textfield;
}

.quantity-input::-webkit-inner-spin-button,
.quantity-input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.checkout-dock {
  position: fixed;
  z-index: 30;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 132px;
  gap: 12px;
  min-height: calc(68px + env(safe-area-inset-bottom));
  align-items: center;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-dock);
}

@media (min-width: 560px) {
  .checkout-dock {
    right: calc((100vw - 520px) / 2);
    left: calc((100vw - 520px) / 2);
  }
}

.dock-summary {
  display: flex;
  min-width: 0;
  flex-direction: column;
  align-items: flex-start;
  border: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.dock-summary strong {
  overflow: hidden;
  color: var(--accent);
  font-size: 20px;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dock-summary span {
  color: var(--text-muted);
  font-size: 11px;
}

.dock-submit {
  width: 100%;
}

.state-panel {
  margin: 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 28px 20px;
  background: var(--surface);
  text-align: center;
}

.state-panel h1,
.state-panel h2,
.state-panel h3 {
  margin: 0 0 6px;
  font-size: 18px;
}

.state-panel p {
  margin-bottom: 16px;
  color: var(--text-muted);
  font-size: 13px;
}

.state-panel.compact {
  margin: 0;
  padding: 20px;
}

.skeleton-product {
  min-height: 126px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, var(--surface) 0 30%, var(--surface-soft) 30% 31%, var(--surface) 31% 100%);
}

.mobile-legal {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 12px;
  padding: 18px 14px 24px;
  color: var(--text-muted);
  font-size: 11px;
}

.mobile-legal p {
  width: 100%;
}

/* Checkout */
.checkout-context {
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: var(--surface-warm);
}

.checkout-context > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
  padding: 10px 14px;
}

.checkout-context > div + div {
  border-left: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
}

.checkout-context > [data-context-plan-row] {
  grid-column: 1 / -1;
  border-top: 1px solid color-mix(in srgb, var(--accent) 18%, transparent);
  border-left: 0;
}

.checkout-context span {
  color: var(--text-muted);
  font-size: 11px;
}

.checkout-context strong {
  overflow: hidden;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-section {
  margin-top: 10px;
  padding: 14px;
  border-block: 1px solid var(--line);
  background: var(--surface);
}

.mobile-section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.mobile-section-title.stacked {
  align-items: flex-start;
  flex-direction: column;
  gap: 3px;
}

.mobile-section-title h1,
.mobile-section-title h2 {
  font-size: 17px;
}

.mobile-section-title a,
.mobile-section-title > span {
  color: var(--text-muted);
  font-family: var(--font-number);
  font-size: 12px;
}

.mobile-section-title p {
  color: var(--text-muted);
  font-size: 12px;
}

.summary-loading,
.admin-loading,
.detail-loading {
  padding: 18px 0;
  color: var(--text-muted);
  font-size: 13px;
  text-align: center;
}

.summary-items {
  border-top: 1px solid var(--line);
}

.summary-item {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.summary-item-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.summary-item-copy h3 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 13px;
  font-weight: 650;
  line-height: 18px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.summary-item-copy > p {
  color: var(--text-muted);
  font-size: 11px;
}

.summary-item-copy > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-top: auto;
}

.summary-item-copy > div span {
  color: var(--text-muted);
  font-size: 11px;
}

.summary-item-copy > div strong {
  color: var(--text);
  font-size: 13px;
}

.summary-total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 12px;
}

.summary-total > span,
.summary-total > div span {
  color: var(--text-muted);
  font-size: 12px;
}

.summary-total > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.summary-total strong {
  color: var(--accent);
  font-family: var(--font-number);
  font-size: 20px;
}

.field-block {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field-block label {
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
}

.field-block label span {
  color: var(--danger);
}

.field-block input,
.field-block textarea,
.field-block select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 12px;
  outline: 0;
  background: var(--surface);
  font-size: 15px;
}

.field-block textarea {
  min-height: 84px;
  resize: vertical;
}

.field-block input::placeholder,
.field-block textarea::placeholder {
  color: var(--text-faint);
}

.field-block input:focus,
.field-block textarea:focus,
.field-block select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

.field-block input[aria-invalid="true"],
.field-block textarea[aria-invalid="true"] {
  border-color: var(--danger);
}

.field-help,
.field-error {
  min-height: 0;
  font-size: 11px;
}

.field-help {
  color: var(--text-muted);
}

.field-error {
  color: var(--danger);
}

.consent-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  color: var(--text-muted);
  font-size: 11px;
}

.consent-row input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.consent-error {
  margin: 5px 0 0 28px;
}

.form-alert {
  margin: 12px 0;
  border: 1px solid color-mix(in srgb, var(--danger) 35%, var(--line));
  border-radius: 10px;
  padding: 10px 12px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 12px;
}

.offline-payment-note {
  margin-top: 14px;
  border-left: 3px solid var(--accent);
  padding: 9px 10px;
  color: var(--text-muted);
  background: var(--surface-warm);
  font-size: 12px;
}

/* Public order */
.order-page-main {
  padding-top: 10px;
}

.order-page-loading {
  display: grid;
  gap: 10px;
  padding: 0 12px;
}

.skeleton-block {
  min-height: 120px;
  border-radius: 12px;
  background: var(--surface-soft);
}

.skeleton-block.tall {
  min-height: 210px;
}

.new-order-notice {
  margin: 0 12px 10px;
  border: 1px solid color-mix(in srgb, var(--success) 32%, var(--line));
  border-radius: 12px;
  padding: 12px 14px;
  background: var(--success-soft);
}

.new-order-notice strong {
  color: var(--success);
  font-size: 15px;
}

.new-order-notice p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.order-status-panel {
  margin: 0 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 14px 14px;
  background: var(--surface);
}

.order-status-panel > span {
  color: var(--text-muted);
  font-size: 11px;
}

.order-status-panel h1 {
  margin-top: 2px;
  font-size: 25px;
  letter-spacing: -0.03em;
}

.order-status-panel > p {
  margin-top: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.status-timeline {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin: 22px 0 0;
  padding: 0;
  list-style: none;
}

.status-timeline li {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 7px;
  color: var(--text-faint);
  font-size: 10px;
}

.status-timeline li::before,
.status-timeline li::after {
  position: absolute;
  top: 5px;
  width: 50%;
  height: 2px;
  background: var(--line-strong);
  content: "";
}

.status-timeline li::before {
  left: 0;
}

.status-timeline li::after {
  right: 0;
}

.status-timeline li:first-child::before,
.status-timeline li:last-child::after {
  display: none;
}

.status-timeline li span {
  position: relative;
  z-index: 1;
  width: 12px;
  height: 12px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  outline: 2px solid var(--line-strong);
  background: var(--surface);
}

.status-timeline li.is-active {
  color: var(--success);
}

.status-timeline li.is-active::before,
.status-timeline li.is-active::after,
.status-timeline li.is-active span {
  background: var(--success);
}

.status-timeline li.is-active span {
  outline-color: var(--success);
}

.status-timeline.is-cancelled li.is-active {
  color: var(--danger);
}

.status-timeline.is-cancelled li.is-active::before,
.status-timeline.is-cancelled li.is-active::after,
.status-timeline.is-cancelled li.is-active span {
  background: var(--danger);
}

.status-timeline.is-cancelled li.is-active span {
  outline-color: var(--danger);
}

.compact-detail-list {
  display: grid;
  gap: 10px;
  margin: 0;
}

.compact-detail-list > div {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  gap: 10px;
}

.compact-detail-list dt {
  color: var(--text-muted);
  font-size: 12px;
}

.compact-detail-list dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 13px;
}

.compact-detail-list dd button {
  border: 0;
  padding: 2px 7px;
  color: var(--accent);
  background: transparent;
  font-size: 12px;
}

.public-order-items {
  border-top: 1px solid var(--line);
}

.public-order-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.public-order-item > div {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.public-order-item > div:last-child {
  align-items: end;
}

.public-order-item strong,
.public-order-item b {
  font-size: 13px;
}

.public-order-item span {
  color: var(--text-muted);
  font-size: 11px;
}

.public-order-total {
  display: grid;
  gap: 6px;
  padding-top: 12px;
}

.public-order-total > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.public-order-total span,
.public-order-total small {
  color: var(--text-muted);
  font-size: 11px;
}

.public-order-total strong {
  color: var(--accent);
  font-size: 22px;
}

.public-order-total del {
  color: var(--text-faint);
  font-family: var(--font-number);
  font-size: 13px;
}

.offline-payment-card {
  margin: 10px 12px 0;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 12px;
  padding: 16px;
  background: var(--surface-warm);
}

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

.offline-payment-card p {
  margin: 4px 0 14px;
  color: var(--text-muted);
  font-size: 12px;
}

.offline-payment-card .button {
  width: 100%;
}

.private-link-note {
  padding: 16px 22px;
  color: var(--text-faint);
  font-size: 11px;
  text-align: center;
}

.image-dialog {
  width: min(100%, 520px);
  max-width: 520px;
  height: 100dvh;
  max-height: 100dvh;
  margin: auto;
  border: 0;
  padding: 0;
  color: var(--text);
  background: var(--background);
}

.image-dialog::backdrop {
  background: rgb(0 0 0 / 0.62);
}

.image-dialog-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 60px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.image-dialog-header > div {
  display: flex;
  flex-direction: column;
}

.image-dialog-header strong {
  font-size: 15px;
}

.image-dialog-header span {
  color: var(--text-muted);
  font-size: 11px;
}

.image-dialog-header button {
  border: 0;
  padding: 8px 0 8px 12px;
  color: var(--accent);
  background: transparent;
  font-weight: 700;
}

.image-preview-wrap {
  display: grid;
  place-items: start center;
  min-height: calc(100dvh - 130px);
  padding: 14px 14px 90px;
}

.image-preview-wrap img {
  width: 100%;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.16);
}

.image-dialog-actions {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

@media (min-width: 560px) {
  .image-dialog-actions {
    right: calc((100vw - 520px) / 2);
    left: calc((100vw - 520px) / 2);
  }
}

.toast-region {
  position: fixed;
  z-index: 100;
  top: calc(68px + env(safe-area-inset-top));
  right: 14px;
  left: 14px;
  display: grid;
  justify-items: center;
  pointer-events: none;
}

.toast {
  max-width: 420px;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 10px 14px;
  color: var(--text);
  background: var(--surface);
  box-shadow: 0 8px 24px rgb(0 0 0 / 0.14);
  font-size: 13px;
}

.toast-success {
  border-color: color-mix(in srgb, var(--success) 38%, var(--line));
}

.toast-error {
  border-color: color-mix(in srgb, var(--danger) 38%, var(--line));
}

/* Legacy legal page */
.app-frame {
  min-height: 100dvh;
}

.page-width {
  width: min(100%, 520px);
  margin-inline: auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.topbar-inner {
  display: flex;
  min-height: 56px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
}

.wordmark {
  display: flex;
  min-width: 0;
  flex-direction: column;
  color: var(--text);
}

.wordmark-main {
  font-size: 15px;
  font-weight: 700;
}

.wordmark-sub {
  color: var(--text-muted);
  font-size: 11px;
}

.legal-page {
  padding: 24px 16px 48px;
}

.legal-page header,
.legal-page section,
.legal-warning {
  margin-bottom: 24px;
}

.legal-page h1 {
  font-size: 28px;
}

.legal-page h2 {
  margin-bottom: 8px;
  font-size: 17px;
}

.legal-page p {
  margin-bottom: 8px;
  color: var(--text-muted);
  font-size: 13px;
}

.eyebrow {
  color: var(--accent) !important;
  font-size: 12px !important;
  font-weight: 700;
}

.legal-warning {
  border-left: 3px solid var(--warning);
  padding: 12px;
  color: var(--warning);
  background: var(--warning-soft);
  font-size: 12px;
}

.site-footer {
  border-top: 1px solid var(--line);
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  padding: 16px;
  color: var(--text-muted);
  font-size: 11px;
}

@media (max-width: 359px) {
  .product-row {
    grid-template-columns: 96px minmax(0, 1fr);
    gap: 9px;
    padding-inline: 10px;
  }

  .product-media-card {
    width: 96px;
    height: 76px;
  }

  .quantity-control {
    grid-template-columns: 44px 32px 44px;
  }

  .product-row-bottom {
    align-items: flex-end;
    flex-direction: column;
    gap: 4px;
  }
}

@media (prefers-reduced-transparency: reduce) {
  .shop-header,
  .subpage-header {
    background: var(--surface);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}

/* Mobile staff workbench */
.admin-body {
  padding: 0;
  background: var(--page);
}

.admin-login-shell,
.admin-app {
  width: 100%;
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--background);
}

@media (min-width: 560px) {
  .admin-login-shell,
  .admin-app {
    max-width: 520px;
    border-inline: 1px solid var(--line);
  }
}

.admin-login-shell {
  display: grid;
  align-items: center;
  padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
}

.admin-login-panel {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px 18px;
  background: var(--surface);
}

.admin-login-copy {
  margin: 32px 0 24px;
}

.admin-login-copy h1 {
  font-size: 25px;
  letter-spacing: -0.03em;
}

.admin-login-copy p,
.admin-login-help {
  color: var(--text-muted);
  font-size: 12px;
}

.admin-login-button {
  width: 100%;
}

.admin-login-help {
  display: grid;
  gap: 4px;
  margin-top: 16px;
  text-align: center;
}

.admin-mobile-topbar .topbar-inner {
  padding-top: max(8px, env(safe-area-inset-top));
}

.admin-brand-block {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.admin-top-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.admin-user {
  display: flex;
  min-width: 0;
  max-width: 92px;
  flex-direction: column;
  align-items: flex-end;
  color: var(--text-muted);
  line-height: 1.2;
}

.admin-user b,
.admin-user small {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-user b {
  color: var(--text);
  font-size: 11px;
}

.admin-user small {
  font-size: 9px;
}

.admin-main {
  padding: 0 12px calc(86px + env(safe-area-inset-bottom));
}

.admin-view-header {
  padding: 18px 2px 12px;
}

.admin-view-header h1 {
  font-size: 24px;
  letter-spacing: -0.03em;
}

.admin-view-header p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.overview-section {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 14px;
  background: var(--surface);
}

.section-heading-row,
.section-heading-stack {
  display: flex;
  margin-bottom: 12px;
}

.section-heading-row {
  align-items: center;
  justify-content: space-between;
}

.section-heading-stack {
  flex-direction: column;
  gap: 3px;
}

.section-heading-row h2,
.section-heading-stack h2 {
  font-size: 17px;
}

.section-heading-stack p {
  color: var(--text-muted);
  font-size: 11px;
}

.stats-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--line);
}

.stat-cell {
  display: flex;
  min-height: 106px;
  flex-direction: column;
  padding: 12px;
  background: var(--surface);
}

.stat-cell-wide {
  grid-column: 1 / -1;
  min-height: 92px;
}

.stat-cell > span,
.stat-cell small {
  color: var(--text-muted);
  font-size: 10px;
}

.stat-cell strong {
  overflow: hidden;
  margin: 5px 0 auto;
  font-family: var(--font-number);
  font-size: 22px;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.04em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.stat-cell-primary strong {
  color: var(--accent);
}

.form-grid {
  display: grid;
  gap: 0 10px;
}

.form-grid.two-columns,
.mobile-two-columns {
  grid-template-columns: 1fr 1fr;
}

.order-link-form .field-block {
  margin-bottom: 12px;
}

.discount-builder {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(108px, 0.65fr);
  gap: 0 10px;
  align-items: start;
}

.discount-input-wrap {
  position: relative;
}

.discount-input-wrap input {
  padding-right: 42px;
  font-family: var(--font-number);
  font-size: 18px;
  font-weight: 700;
}

.discount-input-wrap > span {
  position: absolute;
  top: 50%;
  right: 13px;
  color: var(--text-muted);
  font-size: 12px;
  transform: translateY(-50%);
  pointer-events: none;
}

.discount-quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
}

.discount-quick-actions button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0 5px;
  color: var(--text-muted);
  background: var(--surface-soft);
  font-size: 11px;
  font-weight: 650;
}

.discount-quick-actions button[aria-pressed="true"] {
  color: var(--accent);
  border-color: color-mix(in srgb, var(--accent) 46%, var(--line));
  background: var(--accent-soft);
}

.discount-quick-actions button:active {
  transform: scale(0.98);
}

.discount-explanation {
  min-height: 18px;
  color: var(--success);
  font-size: 11px;
}

.discount-explanation.is-error {
  color: var(--danger);
}

.order-link-version-help {
  line-height: 1.55;
}

.order-link-submit {
  width: 100%;
}

.order-link-result {
  margin-top: 14px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.order-link-result-copy {
  display: flex;
  flex-direction: column;
}

.order-link-result-copy > span,
.order-link-result-copy p {
  color: var(--text-muted);
  font-size: 11px;
}

.order-link-result-copy strong {
  font-size: 17px;
}

.order-link-result-copy .pricing-plan-line {
  color: var(--text);
  font-family: var(--font-number);
  overflow-wrap: anywhere;
}

.order-link-qr {
  display: grid;
  min-height: 150px;
  place-items: center;
  margin: 12px 0;
  border-radius: 10px;
  padding: 12px;
  background: #ffffff;
}

.order-link-qr img {
  width: 184px;
  height: 184px;
}

.order-link-qr p {
  color: #62666d;
  font-size: 12px;
  text-align: center;
}

.order-link-result > input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 8px 10px;
  background: var(--surface-soft);
  font-size: 12px;
}

.order-link-result > .field-help {
  margin: 6px 0 10px;
}

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

.order-link-actions .button-quiet {
  grid-column: 1 / -1;
}

.admin-bottom-tabs {
  position: fixed;
  z-index: 35;
  right: 0;
  bottom: 0;
  left: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  min-height: calc(62px + env(safe-area-inset-bottom));
  padding: 0 4px env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: var(--surface);
  box-shadow: var(--shadow-dock);
}

.admin-bottom-tabs.admin-tabs-enabled {
  grid-template-columns: repeat(4, 1fr);
}

@media (min-width: 560px) {
  .admin-bottom-tabs {
    right: calc((100vw - 520px) / 2);
    left: calc((100vw - 520px) / 2);
  }
}

.admin-bottom-tabs button {
  position: relative;
  border: 0;
  padding: 8px 4px;
  color: var(--text-muted);
  background: transparent;
  font-size: 12px;
  font-weight: 650;
}

.admin-bottom-tabs button[aria-current="page"] {
  color: var(--accent);
}

.admin-bottom-tabs button[aria-current="page"]::before {
  position: absolute;
  top: 0;
  right: 32%;
  left: 32%;
  height: 3px;
  border-radius: 0 0 2px 2px;
  background: var(--accent);
  content: "";
}

.tab-count {
  position: absolute;
  top: 6px;
  left: calc(50% + 18px);
  min-width: 17px;
  border-radius: 999px;
  padding: 1px 4px;
  color: #fffaf7;
  background: var(--danger);
  font-family: var(--font-number);
  font-size: 9px;
}

.mobile-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 7px;
  align-items: end;
  margin-bottom: 10px;
}

.mobile-search .field-block {
  margin: 0;
}

.mobile-search .button {
  min-height: 44px;
  padding-inline: 12px;
}

.status-filters {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin-inline: -12px;
  padding: 0 12px 10px;
  scrollbar-width: none;
}

.status-filters::-webkit-scrollbar {
  display: none;
}

.status-filter {
  flex: 0 0 auto;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 0 11px;
  color: var(--text-muted);
  background: var(--surface);
  font-size: 11px;
}

.status-filter[aria-pressed="true"] {
  color: #fffaf7;
  border-color: var(--accent);
  background: var(--accent);
}

.admin-mobile-list {
  display: grid;
  gap: 10px;
}

.admin-mobile-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: var(--surface);
}

.admin-mobile-card-top {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.order-card-heading {
  min-width: 0;
}

.order-card-heading h2 {
  overflow: hidden;
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-number,
.order-card-contact,
.order-card-meta {
  color: var(--text-muted);
  font-size: 11px;
}

.order-number {
  font-family: var(--font-number);
}

.order-card-amount {
  flex: 0 0 auto;
  color: var(--accent);
  font-family: var(--font-number);
  font-size: 16px;
}

.order-card-statuses {
  display: flex;
  gap: 6px;
  margin: 10px 0 8px;
}

.status-badge {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--text-muted);
  background: var(--surface-soft);
  font-size: 10px;
  font-weight: 700;
}

.status-paid,
.status-shipped,
.status-delivered {
  color: var(--success);
  background: var(--success-soft);
}

.status-pending {
  color: var(--warning);
  background: var(--warning-soft);
}

.status-cancelled,
.status-refunded {
  color: var(--danger);
  background: var(--danger-soft);
}

.order-card-contact {
  margin-top: 4px;
}

.order-card-meta {
  margin-top: 2px;
}

.order-card-action,
.product-card-action {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
  font-size: 12px;
}

.products-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.products-toolbar .button {
  flex: 0 0 auto;
  min-height: 44px;
  padding-inline: 13px;
  font-size: 12px;
}

.product-admin-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
}

.product-admin-media {
  display: grid;
  width: 82px;
  height: 72px;
  overflow: hidden;
  place-items: center;
  border-radius: 9px;
  color: var(--text-faint);
  background: var(--surface-soft);
  font-size: 11px;
}

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

.product-admin-content,
.product-admin-card-top > div {
  min-width: 0;
}

.product-admin-card-top h2 {
  display: -webkit-box;
  overflow: hidden;
  font-size: 14px;
  line-height: 19px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.product-admin-card-top p,
.product-admin-flags {
  color: var(--text-muted);
  font-size: 10px;
}

.product-admin-price {
  margin: 10px 0;
  color: var(--accent);
  font-family: var(--font-number);
  font-size: 12px;
  font-weight: 700;
}

.account-section {
  overflow: hidden;
}

.full-width-button {
  width: 100%;
}

.staff-account-list {
  display: grid;
  gap: 10px;
}

.staff-account-card {
  border-top: 1px solid var(--line);
  padding-top: 13px;
}

.staff-account-card:first-child {
  border-top: 0;
  padding-top: 0;
}

.staff-account-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
}

.staff-account-heading > div:first-child {
  min-width: 0;
}

.staff-account-heading h3 {
  overflow: hidden;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.staff-account-heading p,
.staff-self-help {
  color: var(--text-muted);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.staff-account-heading p {
  font-family: var(--font-number);
}

.staff-account-badges {
  display: flex;
  flex: 0 0 auto;
  gap: 4px;
}

.staff-account-edit-form {
  margin-top: 12px;
}

.staff-account-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(116px, 0.55fr);
  gap: 8px;
}

.staff-inline-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 5px;
  color: var(--text-muted);
  font-size: 10px;
}

.staff-inline-field input,
.staff-inline-field select,
.staff-reset-panel input {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 9px;
  padding: 8px 10px;
  outline: 0;
  background: var(--surface);
  font-size: 13px;
}

.staff-inline-field input:focus,
.staff-inline-field select:focus,
.staff-reset-panel input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 13%, transparent);
}

.staff-account-edit-form > .button,
.staff-account-actions .button {
  width: 100%;
  margin-top: 8px;
}

.staff-account-actions {
  display: grid;
}

.staff-reset-panel {
  margin-top: 8px;
  border-top: 1px solid var(--line);
}

.staff-reset-panel summary {
  display: flex;
  min-height: 44px;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 650;
  cursor: pointer;
}

.staff-reset-panel summary::after {
  color: var(--text-faint);
  content: "展开";
  font-size: 10px;
  font-weight: 400;
}

.staff-reset-panel[open] summary::after {
  content: "收起";
}

.staff-reset-panel form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding-bottom: 10px;
}

.staff-reset-panel .form-alert {
  grid-column: 1 / -1;
}

.staff-reset-panel .button {
  padding-inline: 12px;
}

.compact-alert {
  margin: 8px 0 0;
}

.staff-self-help {
  margin-top: 8px;
  border-left: 2px solid var(--line-strong);
  padding-left: 8px;
}

.admin-dialog {
  width: min(100%, 520px);
  max-width: 520px;
  height: 100dvh;
  max-height: 100dvh;
  margin: auto;
  border: 0;
  padding: 0;
  color: var(--text);
  background: var(--background);
}

.admin-dialog::backdrop {
  background: rgb(0 0 0 / 0.64);
}

.dialog-header {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  min-height: 62px;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: max(10px, env(safe-area-inset-top)) 14px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.dialog-header h2 {
  font-family: var(--font-number);
  font-size: 16px;
}

.dialog-kicker {
  color: var(--text-muted);
  font-size: 10px;
}

.dialog-scroll {
  min-height: calc(100dvh - 62px);
  padding: 14px 14px calc(24px + env(safe-area-inset-bottom));
}

.detail-section {
  margin-bottom: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 13px;
  background: var(--surface);
}

.detail-section > h3 {
  margin-bottom: 12px;
  font-size: 15px;
}

.detail-list,
.detail-totals {
  display: grid;
  gap: 9px;
  margin: 0;
}

.detail-list > div,
.detail-totals > div {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 8px;
}

.detail-list dt,
.detail-totals dt {
  color: var(--text-muted);
  font-size: 11px;
}

.detail-list dd,
.detail-totals dd {
  margin: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.detail-items {
  border-top: 1px solid var(--line);
}

.detail-item {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
}

.detail-item-copy {
  display: flex;
  flex-direction: column;
}

.detail-item-copy strong {
  font-size: 13px;
}

.detail-item-copy span {
  color: var(--text-muted);
  font-size: 10px;
}

.detail-item-pricing {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px 12px;
  margin: 8px 0 0;
}

.detail-item-pricing > div {
  display: flex;
  justify-content: space-between;
  gap: 5px;
}

.detail-item-pricing dt {
  color: var(--text-muted);
  font-size: 10px;
}

.detail-item-pricing dd {
  margin: 0;
  font-family: var(--font-number);
  font-size: 10px;
}

.detail-totals {
  margin-top: 12px;
}

.detail-totals dd {
  justify-self: end;
  font-family: var(--font-number);
}

.detail-order-total {
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.detail-order-total dd {
  color: var(--accent);
  font-size: 18px;
  font-weight: 700;
}

.status-form .button {
  width: 100%;
}

/* Fulfillment evidence workflow */
.workflow-section-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}

.workflow-section-heading h3 {
  font-size: 15px;
}

.workflow-section-heading p {
  max-width: 34em;
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.workflow-current-state {
  flex: 0 0 auto;
  border: 1px solid color-mix(in srgb, var(--accent) 28%, var(--line));
  border-radius: 8px;
  padding: 5px 8px;
  color: var(--accent);
  background: var(--accent-soft);
  font-size: 11px;
  font-weight: 700;
}

.workflow-action-list {
  display: grid;
  gap: 10px;
}

.workflow-action-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}

.workflow-action-card.is-current {
  border-color: color-mix(in srgb, var(--accent) 48%, var(--line));
  box-shadow: inset 3px 0 0 var(--accent);
}

.workflow-action-card.is-complete .workflow-step-mark {
  color: var(--surface);
  background: var(--success);
}

.workflow-action-card.is-locked {
  background: var(--surface-soft);
}

.workflow-action-head {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
}

.workflow-step-mark {
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 9px;
  color: var(--accent);
  background: var(--accent-soft);
  font-family: var(--font-number);
  font-size: 13px;
  font-weight: 700;
}

.workflow-action-head h4 {
  margin: 0;
  font-size: 14px;
}

.workflow-action-head p {
  margin-top: 1px;
  color: var(--text-muted);
  font-size: 11px;
}

.workflow-action-card form {
  border-top: 1px solid var(--line);
  padding: 12px;
}

.workflow-action-card .shipping-fields {
  grid-template-columns: 1fr;
}

.workflow-action-card.is-locked form {
  opacity: 0.58;
}

.workflow-action-card form > .button {
  width: 100%;
}

.workflow-action-card .field-block:last-of-type {
  margin-bottom: 0;
}

.workflow-action-card textarea {
  min-height: 74px;
}

.evidence-picker-block input[type="file"] {
  min-height: 48px;
  padding: 4px;
  color: var(--text-muted);
  font-size: 12px;
}

.evidence-picker-block input[type="file"]::file-selector-button {
  min-height: 38px;
  margin-right: 8px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
}

.evidence-local-preview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 3px;
}

.evidence-local-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 0;
  color: var(--text-muted);
  background: var(--surface-soft);
  text-align: left;
}

.evidence-local-item img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
}

.evidence-local-item span {
  display: block;
  overflow: hidden;
  padding: 5px 6px;
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.shipment-review-note {
  margin: -4px 0 14px;
  border-left: 3px solid var(--accent);
  padding: 8px 9px;
  color: var(--text-muted);
  background: var(--surface-warm);
  font-size: 11px;
}

.compact-heading {
  margin-bottom: 14px;
}

.fulfillment-timeline {
  position: relative;
  display: grid;
  gap: 0;
}

.fulfillment-event {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  padding-bottom: 18px;
}

.fulfillment-event:last-child {
  padding-bottom: 0;
}

.fulfillment-event::before {
  position: absolute;
  top: 13px;
  bottom: -1px;
  left: 6px;
  width: 2px;
  background: var(--line-strong);
  content: "";
}

.fulfillment-event:last-child::before {
  display: none;
}

.fulfillment-event-node {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  margin-top: 3px;
  border: 3px solid var(--surface);
  border-radius: 50%;
  outline: 2px solid var(--accent);
  background: var(--accent);
}

.fulfillment-event-cancelled .fulfillment-event-node {
  outline-color: var(--danger);
  background: var(--danger);
}

.fulfillment-event-body {
  min-width: 0;
}

.fulfillment-event-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 9px;
}

.fulfillment-event-header strong {
  min-width: 0;
  font-size: 13px;
}

.fulfillment-event-header time {
  flex: 0 0 auto;
  color: var(--text-faint);
  font-family: var(--font-number);
  font-size: 9px;
}

.fulfillment-event-actor {
  margin-top: 1px;
  color: var(--text-faint);
  font-size: 10px;
}

.fulfillment-event-note {
  margin-top: 7px;
  border-radius: 8px;
  padding: 8px 9px;
  color: var(--text-muted);
  background: var(--surface-soft);
  font-size: 11px;
  overflow-wrap: anywhere;
}

.fulfillment-event-logistics {
  display: grid;
  gap: 4px;
  margin: 8px 0 0;
  border-radius: 8px;
  padding: 8px 9px;
  background: var(--surface-warm);
}

.fulfillment-event-logistics > div {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 8px;
}

.fulfillment-event-logistics dt {
  color: var(--text-muted);
  font-size: 10px;
}

.fulfillment-event-logistics dd {
  min-width: 0;
  margin: 0;
  font-family: var(--font-number);
  font-size: 10px;
  overflow-wrap: anywhere;
}

.fulfillment-evidence-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.fulfillment-evidence-item {
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
}

.fulfillment-evidence-thumb {
  display: grid;
  width: 100%;
  min-height: 76px;
  aspect-ratio: 1;
  place-items: center;
  overflow: hidden;
  border: 0;
  padding: 0;
  color: var(--text-muted);
  background: var(--surface-soft);
}

.fulfillment-evidence-thumb:disabled {
  cursor: default;
  opacity: 1;
}

.fulfillment-evidence-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.fulfillment-evidence-thumb > span {
  padding: 7px;
  font-size: 9px;
  text-align: center;
}

.fulfillment-evidence-item > div {
  display: grid;
  padding: 6px;
}

.fulfillment-evidence-item strong {
  font-size: 9px;
}

.fulfillment-evidence-item > div span {
  color: var(--text-faint);
  font-size: 8px;
}

.order-cancel-section {
  display: grid;
  gap: 10px;
}

.order-cancel-section h3 {
  margin: 0;
  font-size: 14px;
}

.order-cancel-section p {
  margin-top: 3px;
  color: var(--text-muted);
  font-size: 11px;
}

.order-cancel-section .form-alert {
  margin: 0;
}

.danger-button {
  width: 100%;
  border-color: color-mix(in srgb, var(--danger) 34%, var(--line));
  color: var(--danger);
  background: var(--danger-soft);
}

.public-workflow-section {
  margin-top: 10px;
}

.workflow-title-row {
  align-items: flex-start;
}

.workflow-title-row > div {
  min-width: 0;
}

.workflow-title-row > div span {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 10px;
}

.workflow-title-row > button {
  flex: 0 0 auto;
  min-width: 52px;
  min-height: 44px;
  margin: -10px -8px -10px 0;
  border: 0;
  padding: 0 8px;
  color: var(--accent);
  background: transparent;
  font-size: 12px;
  font-weight: 700;
}

.public-fulfillment-timeline {
  margin-top: 14px;
}

.evidence-viewer {
  width: min(100%, 520px);
  max-width: 520px;
  height: 100dvh;
  max-height: 100dvh;
  margin: auto;
  border: 0;
  padding: 0;
  color: var(--text);
  background: var(--background);
}

.evidence-viewer::backdrop {
  background: rgb(0 0 0 / 0.72);
}

.evidence-viewer-body {
  display: grid;
  min-height: calc(100dvh - 62px);
  place-items: center;
  padding: 14px;
}

.evidence-viewer-body img {
  width: 100%;
  max-height: calc(100dvh - 92px);
  border-radius: 10px;
  object-fit: contain;
}

.price-fieldset {
  margin: 0 0 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
}

.price-fieldset legend {
  padding: 0 6px;
  font-size: 13px;
  font-weight: 700;
}

.product-image-preview {
  display: grid;
  min-height: 110px;
  overflow: hidden;
  place-items: center;
  border: 1px dashed var(--line-strong);
  border-radius: 10px;
  color: var(--text-faint);
  background: var(--surface-soft);
  font-size: 11px;
}

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

.product-switches {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

.switch-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 9px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 11px;
  background: var(--surface);
}

.switch-row input {
  width: 19px;
  height: 19px;
  margin: 1px 0 0;
  accent-color: var(--accent);
}

.switch-row span {
  display: flex;
  flex-direction: column;
}

.switch-row strong {
  font-size: 13px;
}

.switch-row small {
  color: var(--text-muted);
  font-size: 10px;
}

.dialog-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 16px;
}

@media (max-width: 359px) {
  .form-grid.two-columns,
  .mobile-two-columns {
    grid-template-columns: 1fr;
  }

  .mobile-search {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .mobile-search .button-quiet {
    grid-column: 1 / -1;
  }

  .discount-builder,
  .staff-account-fields {
    grid-template-columns: 1fr;
  }

  .staff-reset-panel form {
    grid-template-columns: 1fr;
  }

  .staff-reset-panel .form-alert {
    grid-column: auto;
  }
}
