:root {
  --ink: #17201c;
  --muted: #65716b;
  --line: #dce3df;
  --soft: #f4f7f5;
  --surface: #ffffff;
  --green: #176b4d;
  --green-dark: #0f513a;
  --green-soft: #e7f3ed;
  --coral: #d9573f;
  --amber: #b76c16;
  --shadow: 0 16px 42px rgba(30, 46, 38, 0.12);
}

* { box-sizing: border-box; }

html { min-width: 320px; background: var(--soft); }

body {
  margin: 0;
  color: var(--ink);
  background: var(--soft);
  font-family: Inter, "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  letter-spacing: 0;
}

button, input { font: inherit; letter-spacing: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  height: 68px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
}

.header-inner {
  width: min(1440px, 100%);
  height: 100%;
  margin: auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  text-decoration: none;
  font-size: 18px;
  font-weight: 750;
}

.brand-mark {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  display: block;
  overflow: hidden;
  border: 1px solid #b9cbd9;
  background: #2f82c5;
  border-radius: 6px;
}

.brand-mark img { width: 100%; height: 100%; display: block; object-fit: cover; }

.header-actions, .catalog-tools { display: flex; align-items: center; gap: 10px; }
.telegram-support { border-color: #168bd2; background: #168bd2; color: white; text-decoration: none; }
.telegram-support:hover { border-color: #1178b8; background: #1178b8; }

.language-control { height: 40px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--green-dark); display: inline-flex; align-items: center; gap: 6px; }
.language-control svg { width: 16px; height: 16px; flex: 0 0 auto; }
.language-control select { max-width: 92px; border: 0; outline: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }

.icon-button, .icon-text-button, .text-button, .primary-button {
  border: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.icon-button {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
}

.icon-button:hover, .icon-button:focus-visible { border-color: #9eb2a8; background: var(--soft); }
.icon-button.compact { width: 32px; height: 32px; }
.icon-button svg, .icon-text-button svg, .primary-button svg, .search-box svg { width: 18px; height: 18px; }

.icon-text-button {
  min-height: 40px;
  padding: 0 15px;
  gap: 8px;
  border-radius: 6px;
  font-weight: 650;
}

.icon-text-button.secondary { background: var(--green-soft); color: var(--green-dark); }

.store-layout {
  width: min(1440px, 100%);
  min-height: calc(100vh - 68px);
  margin: auto;
  display: block;
  background: white;
}

.catalog-sidebar {
  position: sticky;
  top: 92px;
  max-height: calc(100vh - 116px);
  padding: 0 18px 24px 0;
  border-right: 1px solid var(--line);
  background: white;
  overflow-y: auto;
}

.sidebar-heading {
  min-height: 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  font-size: 14px;
  font-weight: 750;
}

.sidebar-heading svg { width: 16px; height: 16px; color: var(--muted); }
.sidebar-heading.small { color: var(--muted); font-size: 12px; text-transform: uppercase; }
.sidebar-divider { height: 1px; margin: 20px 0; background: var(--line); }

.sidebar-category-list { display: grid; gap: 2px; }

.category-item {
  width: 100%;
  min-height: 44px;
  padding: 6px 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  cursor: pointer;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  text-align: left;
  font-size: 13px;
}

.category-item:hover { background: #edf2ef; }
.category-item.active { color: var(--green-dark); background: var(--green-soft); font-weight: 700; }
.category-symbol { width: 26px; height: 26px; display: grid; place-items: center; }
.category-symbol svg { width: 16px; height: 16px; }
.category-count { color: var(--muted); font-size: 11px; font-variant-numeric: tabular-nums; }

.check-row {
  height: 38px;
  display: flex;
  gap: 9px;
  align-items: center;
  color: #435049;
  font-size: 13px;
  cursor: pointer;
}

.check-row input { accent-color: var(--green); width: 16px; height: 16px; }

.catalog-main { min-width: 0; padding: 32px 28px 56px; background: white; }

.catalog-workspace {
  margin-top: 24px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}

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

.catalog-title-row {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  align-items: flex-end;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--green);
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
}

h1, h2, p { overflow-wrap: anywhere; }
h1 { margin: 0; font-size: 30px; line-height: 1.2; }
h2 { margin: 0; font-size: 20px; line-height: 1.35; }

.search-box {
  width: min(360px, 34vw);
  height: 42px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--muted);
}

.search-box:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); background: white; }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }

.sort-control {
  width: 164px;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: white;
  color: var(--green-dark);
  display: flex;
  align-items: center;
  gap: 7px;
}
.sort-control:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.sort-control svg { width: 17px; height: 17px; flex: 0 0 auto; }
.sort-control select { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; color: inherit; cursor: pointer; font: inherit; font-size: 12px; font-weight: 700; }

.catalog-meta {
  min-height: 52px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
  font-size: 12px;
}

.category-substrip { margin: 10px 0 0 36px; padding: 10px 0 0 10px; border-left: 1px solid var(--line); display: grid; gap: 3px; }
.category-substrip.hidden { display: none; }
.subcategory-label { padding: 0 8px 5px; color: var(--muted); font-size: 10px; font-weight: 700; white-space: nowrap; }
.subcategory-button { width: 100%; min-height: 32px; padding: 0 8px; border: 1px solid transparent; border-radius: 4px; background: transparent; color: #435049; cursor: pointer; display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left; white-space: nowrap; font-size: 11px; font-weight: 700; }
.subcategory-button:hover { border-color: var(--line); background: var(--soft); }
.subcategory-button.active { border-color: #a8bcb2; background: var(--green-soft); color: var(--green-dark); }
.subcategory-button span:last-child { color: var(--muted); font-variant-numeric: tabular-nums; }

.sync-note { display: flex; align-items: center; gap: 6px; }
.sync-note svg { width: 13px; height: 13px; }

.product-grid {
  padding-top: 22px;
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 14px;
}

.product-card {
  min-width: 0;
  min-height: 284px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
  cursor: pointer;
}

.product-card:hover { border-color: #aabbb2; box-shadow: 0 8px 24px rgba(28, 47, 38, .08); transform: translateY(-2px); }
.product-card:focus-visible { outline: 3px solid var(--green-soft); border-color: var(--green); }

.product-image {
  width: 100%;
  height: 120px;
  object-fit: contain;
  padding: 18px;
  background: #f5f8f6;
}

.product-image-fallback {
  width: 100%;
  height: 120px;
  display: grid;
  place-items: center;
  background: #eef3f0;
  color: var(--green);
  font-family: Georgia, serif;
  font-size: 42px;
}

.product-content { flex: 1; padding: 14px 14px 10px; display: flex; flex-direction: column; }
.product-tags { display: flex; justify-content: space-between; gap: 8px; color: var(--muted); font-size: 10px; }
.source-tag { color: var(--green-dark); font-weight: 700; }
.product-name { margin: 9px 0 14px; min-height: 42px; font-size: 14px; line-height: 1.5; font-weight: 680; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-footer { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 8px; }
.product-price { color: var(--coral); font-size: 19px; font-weight: 800; font-variant-numeric: tabular-nums; }
.product-stock { margin-top: 2px; color: var(--muted); font-size: 10px; }
.buy-button { width: 38px; height: 38px; border: 0; border-radius: 6px; background: var(--green); color: white; cursor: pointer; display: grid; place-items: center; }
.buy-button:hover { background: var(--green-dark); }
.buy-button.pending { background: #6f7d76; }
.buy-button.pending:hover { background: #56625c; }
.buy-button:disabled { cursor: not-allowed; background: #b9c3be; }
.buy-button svg { width: 17px; height: 17px; }

.skeleton { background: linear-gradient(90deg, #eff3f1 25%, #f8faf9 45%, #eff3f1 65%); background-size: 220% 100%; animation: shimmer 1.2s infinite; border-color: transparent; }
@keyframes shimmer { to { background-position: -220% 0; } }

.pagination { min-height: 58px; padding-top: 24px; display: flex; gap: 6px; justify-content: center; align-items: center; }
.page-button { min-width: 34px; height: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: white; cursor: pointer; }
.page-button.active { border-color: var(--green); background: var(--green); color: white; }
.page-button:disabled { opacity: .45; cursor: default; }

.empty-state { min-height: 360px; display: grid; place-items: center; align-content: center; gap: 10px; color: var(--muted); }
.empty-state svg { width: 38px; height: 38px; }
.empty-state h2 { color: var(--ink); }
.text-button { padding: 7px 0; background: transparent; color: var(--green); font-weight: 700; }

.sheet-dialog {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 32px);
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: var(--ink);
}

.sheet-dialog.narrow { width: min(460px, calc(100vw - 24px)); }
.sheet-dialog::backdrop { background: rgba(12, 20, 16, .48); backdrop-filter: blur(2px); }
.dialog-header { min-height: 78px; padding: 17px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-header h2 { max-width: 390px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dialog-body { padding: 20px; overflow-y: auto; }

.checkout-summary { display: grid; grid-template-columns: 88px 1fr; gap: 16px; align-items: center; padding-bottom: 20px; }
.checkout-summary img { width: 88px; height: 88px; border-radius: 6px; object-fit: contain; padding: 8px; background: var(--soft); }
.product-detail-summary { display: grid; grid-template-columns: 132px minmax(0, 1fr); gap: 18px; align-items: center; padding-bottom: 18px; }
.product-detail-summary img { width: 132px; height: 132px; border-radius: 6px; object-fit: contain; padding: 10px; background: var(--soft); }
.product-detail-summary img[hidden] { display: none; }
.product-detail-summary:has(img[hidden]) { grid-template-columns: 1fr; }
.product-detail-dialog .primary-button { margin-top: 18px; }
.muted { color: var(--muted); font-size: 12px; }
.price-large { margin: 5px 0; color: var(--coral); font-size: 24px; font-weight: 800; }
.stock-line { color: var(--muted); font-size: 12px; }

.field-label { display: block; margin: 14px 0 7px; color: #435049; font-size: 12px; font-weight: 700; }
.text-input { width: 100%; height: 44px; padding: 0 12px; border: 1px solid var(--line); border-radius: 6px; outline: 0; }
.text-input:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.text-area { width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 6px; outline: 0; resize: vertical; font: inherit; }
.text-area:focus { border-color: var(--green); box-shadow: 0 0 0 3px var(--green-soft); }
.code-input { font-family: ui-monospace, monospace; text-transform: uppercase; }
.stepper { width: 144px; height: 42px; display: grid; grid-template-columns: 40px 64px 40px; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stepper button { border: 0; background: var(--soft); cursor: pointer; display: grid; place-items: center; }
.stepper button svg { width: 15px; }
.stepper input { width: 64px; border: 0; border-left: 1px solid var(--line); border-right: 1px solid var(--line); outline: 0; text-align: center; }
.order-total { margin: 20px 0 14px; padding-top: 16px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; }
.order-total strong { color: var(--coral); font-size: 22px; }
.primary-button { min-height: 44px; padding: 0 18px; gap: 8px; border-radius: 6px; background: var(--green); color: white; font-weight: 750; }
.primary-button:hover { background: var(--green-dark); }
.primary-button:disabled { background: #9eaaa4; cursor: wait; }
.primary-button.full { width: 100%; }

.purchase-progress, .order-progress { margin: 14px 0; display: grid; gap: 7px; }
.progress-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.progress-heading strong { color: var(--green-dark); font-variant-numeric: tabular-nums; }
.progress-track { position: relative; width: 100%; height: 7px; overflow: hidden; border-radius: 4px; background: #e3e9e6; }
.progress-track > span { display: block; height: 100%; border-radius: inherit; background: var(--green); transition: width .35s ease; }
.progress-track > .progress-10 { width: 10%; }
.progress-track > .progress-15 { width: 15%; }
.progress-track > .progress-20 { width: 20%; }
.progress-track > .progress-30 { width: 30%; }
.progress-track > .progress-50 { width: 50%; }
.progress-track > .progress-70 { width: 70%; }
.progress-track > .progress-85 { width: 85%; }
.progress-track > .progress-95 { width: 95%; }
.progress-track > .progress-100 { width: 100%; }
.progress-track.indeterminate > span { position: absolute; width: 38%; animation: purchase-loading 1.1s ease-in-out infinite; }
.order-progress.failed .progress-track > span { background: var(--coral); }
.order-progress p { margin: 0; color: var(--muted); font-size: 10px; }
.deposit-auto { margin: 10px 0 0; color: var(--green-dark); font-size: 11px; line-height: 1.5; }
@keyframes purchase-loading { from { transform: translateX(-110%); } to { transform: translateX(290%); } }

.order-result { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.status-badge { display: inline-flex; padding: 4px 8px; border-radius: 4px; background: var(--green-soft); color: var(--green-dark); font-size: 11px; font-weight: 750; white-space: nowrap; }
.status-badge.failed { background: #fdece8; color: #9b3524; }
.delivery-box { margin-top: 14px; padding: 12px; border: 1px solid var(--line); border-radius: 5px; background: #f7faf8; font: 12px/1.7 ui-monospace, monospace; white-space: pre-wrap; word-break: break-all; }
.login-guide { margin-top: 16px; padding: 12px 0 0 14px; border-top: 1px solid var(--line); border-left: 3px solid var(--green); }
.login-guide-title { margin: 0; color: var(--green-dark); font-size: 12px; }
.credential-format { margin-top: 10px; padding: 10px; border: 1px solid var(--line); border-radius: 5px; background: #f7faf8; }
.credential-format > div { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; }
.credential-format span { color: var(--muted); font-size: 9px; }
.credential-format code { display: block; margin-top: 7px; color: var(--ink); white-space: normal; overflow-wrap: anywhere; font: 10px/1.6 ui-monospace, SFMono-Regular, Consolas, monospace; }
.login-guide-tutorials { margin-top: 10px; display: grid; gap: 10px; }
.login-guide-tutorial { padding-top: 9px; border-top: 1px solid var(--line); color: #435049; font-size: 10px; line-height: 1.6; }
.login-guide-tutorial strong { color: var(--green-dark); font-size: 11px; }
.login-guide-tutorial ol { margin: 5px 0 0; padding-left: 18px; }
.login-guide-notes { margin: 9px 0 0; padding-left: 16px; color: var(--muted); font-size: 10px; line-height: 1.6; }
.product-description { margin: 0 0 4px; padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.product-description h3 { margin: 0 0 8px; color: var(--green-dark); font-size: 12px; }
.product-description-lines { display: grid; gap: 7px; }
.product-description-lines p { margin: 0; color: #435049; font-size: 11px; line-height: 1.7; overflow-wrap: anywhere; }
.product-description-lines .description-heading { margin-top: 4px; color: var(--green-dark); font-weight: 750; }
.product-description-lines .description-heading:first-child { margin-top: 0; }
.product-description-lines .description-step { padding-left: 10px; border-left: 2px solid #d8e4dd; }
.product-description.collapsible { margin-top: 14px; border-bottom: 0; }
.product-description.collapsible summary { color: var(--green-dark); cursor: pointer; font-size: 11px; font-weight: 750; }
.product-description.collapsible .product-description-lines { margin-top: 10px; }
.payment-preview { margin-top: 10px; padding: 12px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); font-size: 12px; }
.payment-preview div { display: flex; justify-content: space-between; gap: 12px; }
.payment-preview span { color: var(--green-dark); font-family: ui-monospace, monospace; word-break: break-all; }
.payment-preview p { margin: 8px 0 0; color: var(--muted); white-space: pre-wrap; }
.payment-preview img { display: block; width: 160px; height: 160px; margin: 12px auto 0; object-fit: contain; background: white; }
.segmented-control { height: 40px; padding: 3px; display: grid; grid-template-columns: 1fr 1fr; gap: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); }
.segmented-control button { border: 0; border-radius: 4px; background: transparent; cursor: pointer; color: var(--muted); font-weight: 700; }
.segmented-control button.active { background: white; color: var(--green-dark); box-shadow: 0 1px 5px rgba(23, 32, 28, .08); }
.auth-form { margin-top: 12px; }
.auth-form.hidden { display: none; }
.auth-form .primary-button { margin-top: 20px; }
.verification-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 8px; align-items: center; }
.verification-row .small-button { min-height: 42px; white-space: nowrap; }
.verification-code-input { letter-spacing: 4px; font-variant-numeric: tabular-nums; }
.field-help { margin: 8px 0 0; color: var(--muted); font-size: 11px; line-height: 1.55; }
@media (max-width: 440px) {
  .verification-row { grid-template-columns: 1fr; }
  .verification-row .small-button { width: 100%; }
}
.account-summary { padding: 14px; border: 1px solid var(--line); background: var(--soft); display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.account-summary strong { display: block; margin-top: 4px; }
.wallet-summary { margin-top: 12px; padding: 16px; border: 1px solid var(--line); background: var(--green-soft); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.wallet-summary strong { display: block; margin-top: 5px; color: var(--green-dark); font-size: 22px; font-variant-numeric: tabular-nums; }
.wallet-summary .primary-button { min-height: 40px; padding: 0 14px; }
.wallet-activity { margin-top: 10px; }
.wallet-activity-row { min-height: 40px; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 11px; }
.wallet-activity-row span { color: var(--muted); }
.wallet-activity-row strong.credit { color: var(--green); }
.wallet-activity-row strong.debit { color: var(--coral); }
.deposit-presets { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.deposit-presets button { min-width: 0; height: 38px; padding: 0 4px; border: 1px solid var(--line); border-radius: 6px; background: white; color: var(--green-dark); cursor: pointer; font-size: 12px; font-weight: 750; }
.deposit-presets button:hover { border-color: var(--green); background: var(--green-soft); }
.deposit-presets button.active { border-color: var(--green); background: var(--green); color: white; }
.amount-input { position: relative; }
.amount-input input { padding-right: 66px; font-size: 18px; font-weight: 750; }
.amount-input span { position: absolute; top: 0; right: 12px; height: 44px; display: flex; align-items: center; color: var(--muted); font-size: 12px; font-weight: 700; }
.deposit-details { margin-top: 18px; border-top: 1px solid var(--line); padding-top: 18px; }
.deposit-amount { padding: 14px; background: var(--green-soft); text-align: center; }
.deposit-amount span { display: block; color: var(--muted); font-size: 11px; }
.deposit-amount strong { display: block; margin-top: 5px; color: var(--green-dark); font-size: 26px; font-variant-numeric: tabular-nums; }
.deposit-qr { width: min(260px, 100%); aspect-ratio: 1; margin: 16px auto; display: block; object-fit: contain; border: 1px solid var(--line); }
.deposit-address { padding: 11px; background: var(--soft); font-size: 11px; overflow-wrap: anywhere; text-align: center; }
.deposit-status { margin-top: 12px; display: flex; align-items: center; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 11px; }
.account-orders-heading { display: flex; justify-content: space-between; align-items: center; }
.account-orders-heading > div { display: flex; align-items: baseline; gap: 10px; }
.account-orders-updated { color: var(--muted); font-size: 10px; font-variant-numeric: tabular-nums; }
.order-tabs { margin-top: 12px; grid-template-columns: repeat(3, 1fr); }
.order-tabs button { gap: 5px; display: inline-flex; align-items: center; justify-content: center; }
.order-tabs span { min-width: 18px; padding: 1px 5px; border-radius: 9px; background: #e3e9e6; color: var(--muted); font-size: 10px; }
.order-tabs button.active span { background: var(--green-soft); color: var(--green-dark); }
.account-order-list { display: grid; gap: 12px; }
.account-order-list .order-result { margin-top: 0; padding: 16px; border: 1px solid var(--line); border-radius: 6px; }
.order-record-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.order-record-header code { max-width: 48%; color: var(--muted); font-size: 10px; overflow-wrap: anywhere; text-align: right; }
.order-record-summary { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 12px; }
.order-record-summary > div { display: grid; gap: 4px; }
.order-record-summary > div:first-child { color: var(--muted); }
.order-record-total { justify-items: end; }
.order-record-total span { color: var(--muted); font-size: 10px; }
.order-record-summary strong { color: var(--coral); font-size: 16px; }
.order-updated { margin: 7px 0 0; color: var(--muted); font-size: 10px; }
.delivery-label { margin-top: 14px; color: var(--green-dark); font-size: 11px; font-weight: 750; }
.account-order-pagination { min-height: 38px; margin-top: 14px; display: flex; align-items: center; justify-content: center; gap: 12px; color: var(--muted); font-size: 11px; }
.account-order-pagination .small-button:disabled { opacity: .45; cursor: default; }
.status-badge.pending { background: #fff3df; color: #8a5512; }
.empty-inline { padding: 40px 0; color: var(--muted); text-align: center; }
.lookup-section { margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--line); }
.lookup-section summary { color: var(--green-dark); cursor: pointer; font-size: 12px; font-weight: 750; }
.lookup-section form { margin-top: 14px; }

.toast { position: fixed; z-index: 100; right: 22px; bottom: 22px; max-width: min(380px, calc(100vw - 32px)); padding: 12px 15px; border-radius: 6px; background: #17201c; color: white; box-shadow: var(--shadow); opacity: 0; pointer-events: none; transform: translateY(12px); transition: .2s ease; font-size: 13px; }
.toast.visible { opacity: 1; transform: translateY(0); }
.toast.error { background: #8b2f20; }
.hidden, .mobile-only, .mobile-overlay { display: none; }

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

@media (max-width: 860px) {
  .mobile-only { display: inline-flex; }
  .catalog-main { padding: 24px 18px 40px; }
  .product-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .search-box { width: min(340px, 48vw); }
}

@media (max-width: 700px) {
  .product-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  .catalog-workspace { display: block; }
  .catalog-sidebar { position: static; width: 100%; max-height: none; padding: 9px; border: 1px solid var(--line); border-radius: 7px; background: var(--soft); display: flex; align-items: center; gap: 7px; overflow-x: auto; }
  .sidebar-heading { display: none; }
  .sidebar-category-list { display: flex; gap: 7px; }
  .category-item { width: auto; min-height: 38px; padding: 0 11px; flex: 0 0 auto; grid-template-columns: 20px auto auto; border: 1px solid transparent; white-space: nowrap; }
  .category-item:hover { border-color: var(--line); background: white; }
  .category-item.active { border-color: var(--green); background: var(--green); color: white; }
  .category-item.active .category-count { color: inherit; opacity: .75; }
  .category-symbol { width: 20px; height: 20px; }
  .category-substrip { min-width: max-content; margin: 0; padding: 0 0 0 8px; border-left: 1px solid var(--line); display: flex; gap: 5px; }
  .subcategory-label { display: none; }
  .subcategory-button { width: auto; min-height: 34px; padding: 0 9px; gap: 5px; }
  .catalog-meta { margin-top: 6px; }
  .header-inner { padding: 0 14px; }
  .icon-text-button { width: 40px; padding: 0; }
  .icon-text-button span { display: none; }
  .language-control { width: 40px; padding: 0; justify-content: center; }
  .language-control select { position: absolute; width: 40px; height: 40px; opacity: 0; }
  .catalog-title-row { align-items: stretch; flex-direction: column; gap: 18px; }
  .catalog-tools { width: 100%; }
  .search-box { width: auto; flex: 1; }
  .sort-control { width: 142px; flex: 0 0 142px; }
  h1 { font-size: 26px; }
  .catalog-meta { min-height: 44px; }
  .sync-note { display: none; }
  .product-grid { grid-template-columns: 1fr; gap: 10px; padding-top: 14px; }
  .product-card { min-height: 178px; display: grid; grid-template-columns: 112px minmax(0, 1fr); }
  .product-image, .product-image-fallback { width: 112px; height: 100%; min-height: 178px; padding: 14px; }
  .product-name { min-height: 40px; margin-bottom: 8px; }
  .dialog-header h2 { max-width: 280px; }
  .product-detail-summary { grid-template-columns: 96px minmax(0, 1fr); gap: 14px; }
  .product-detail-summary img { width: 96px; height: 96px; }
}

@media (max-width: 380px) {
  .header-inner { padding: 0 10px; }
  .header-actions { gap: 6px; }
  #brandName { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; }
}

.admin-body { background: #f5f7f6; }
.admin-login { min-height: 100vh; display: grid; place-items: center; padding: 24px; background: #eef3f0; }
.admin-login.hidden, .admin-app.hidden { display: none; }
.login-panel { width: min(390px, 100%); padding: 30px; border: 1px solid var(--line); border-radius: 8px; background: white; box-shadow: var(--shadow); display: grid; gap: 18px; }
.login-panel .primary-button { margin-top: 6px; }
.form-error { min-height: 18px; margin: 0; color: #a13a29; font-size: 12px; text-align: center; }
.admin-main { width: min(1440px, 100%); margin: auto; padding: 34px 24px 70px; }
.admin-heading, .section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; }
.admin-tabs { margin-top: 24px; padding: 4px; display: inline-flex; gap: 3px; border: 1px solid var(--line); border-radius: 6px; background: white; }
.admin-tabs button { height: 38px; padding: 0 15px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; display: inline-flex; align-items: center; gap: 7px; font-size: 12px; font-weight: 700; }
.admin-tabs button svg { width: 15px; height: 15px; }
.admin-tabs button.active { background: var(--green); color: white; }
[data-admin-panel].hidden { display: none; }
.stat-grid { margin: 24px 0 34px; display: grid; grid-template-columns: repeat(5, 1fr); border: 1px solid var(--line); border-radius: 7px; background: white; overflow: hidden; }
.stat-item { min-height: 112px; padding: 22px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; }
.stat-item:last-child { border-right: 0; }
.stat-label { color: var(--muted); font-size: 12px; }
.stat-value { font-size: 26px; font-weight: 800; font-variant-numeric: tabular-nums; }
.dashboard-grid { margin: -10px 0 34px; display: grid; grid-template-columns: .9fr 1.1fr; gap: 18px; }
.dashboard-grid.hidden { display: none; }
.dashboard-panel { min-width: 0; padding: 22px; border: 1px solid var(--line); background: white; }
.dashboard-panel-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.dashboard-panel-heading > svg { width: 22px; height: 22px; color: var(--green); }
.dashboard-panel-heading > strong { color: var(--muted); font-size: 12px; }
.readiness-list { margin-top: 18px; border-top: 1px solid var(--line); }
.readiness-list > div { min-height: 48px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 14px; font-size: 12px; }
.readiness-list span { display: inline-flex; align-items: center; gap: 8px; color: #435049; }
.readiness-list svg { width: 15px; height: 15px; }
.readiness-list strong { font-size: 11px; }
.readiness-list .ready { color: var(--green); }
.readiness-list .attention { color: #9b3524; }
.category-distribution { margin-top: 18px; display: grid; gap: 13px; }
.category-distribution > div { display: grid; grid-template-columns: 82px minmax(70px, 1fr) 48px; align-items: center; gap: 10px; font-size: 11px; }
.category-distribution > div > span { color: #435049; }
.category-distribution > div > div { height: 7px; overflow: hidden; background: #e8eeeb; }
.category-distribution i { height: 100%; display: block; background: var(--green); }
.category-distribution .distribution-1 { width: 10%; }
.category-distribution .distribution-2 { width: 20%; }
.category-distribution .distribution-3 { width: 30%; }
.category-distribution .distribution-4 { width: 40%; }
.category-distribution .distribution-5 { width: 50%; }
.category-distribution .distribution-6 { width: 60%; }
.category-distribution .distribution-7 { width: 70%; }
.category-distribution .distribution-8 { width: 80%; }
.category-distribution .distribution-9 { width: 90%; }
.category-distribution .distribution-10 { width: 100%; }
.category-distribution strong { text-align: right; font-variant-numeric: tabular-nums; }
.admin-section { margin-top: 26px; padding: 24px; border: 1px solid var(--line); background: white; }
.supplier-list { margin-top: 18px; border-top: 1px solid var(--line); }
.upstream-balance-grid { margin-top: 18px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.upstream-balance-item { min-height: 92px; padding: 16px; border: 1px solid var(--line); background: #f7faf8; display: grid; align-content: center; gap: 5px; }
.upstream-balance-item.low-balance { border-color: #e3a69b; background: #fff3f0; }
.upstream-balance-item.low-balance strong { color: #a63320; }
.upstream-balance-item span, .upstream-balance-item small { color: var(--muted); }
.upstream-balance-item strong { color: var(--green-dark); font-size: 20px; }
.upstream-balance-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.upstream-balance-heading .icon-button { width: 30px; height: 30px; }
.provider-balance-alerts { margin-top: 14px; display: grid; gap: 8px; }
.provider-balance-alert { padding: 13px 15px; border: 1px solid #e3a69b; border-left: 4px solid #b23b27; background: #fff3f0; color: #7f2819; }
.provider-balance-alert strong { display: block; margin-bottom: 4px; }
.provider-balance-alert small { color: #8d5146; }
.records-heading { margin-top: 28px; }
.sales-report-controls { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.sales-report-period { min-height: 38px; padding: 3px; border: 1px solid var(--line); border-radius: 6px; background: var(--soft); display: inline-flex; gap: 2px; }
.sales-report-period button { min-width: 58px; height: 30px; padding: 0 10px; border: 0; border-radius: 4px; background: transparent; color: var(--muted); cursor: pointer; font-size: 11px; font-weight: 750; }
.sales-report-period button.active { background: var(--green); color: white; }
.report-date-input { width: 150px; height: 38px; padding: 0 10px; font-size: 12px; }
.report-date-input.hidden { display: none; }
.sales-report-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); border: 1px solid var(--line); border-radius: 7px; background: var(--soft); overflow: hidden; }
.sales-report-metric { min-width: 0; min-height: 116px; padding: 17px; border-right: 1px solid var(--line); display: flex; flex-direction: column; justify-content: space-between; gap: 9px; }
.sales-report-metric:last-child { border-right: 0; }
.sales-report-metric span, .sales-report-metric small { color: var(--muted); font-size: 10px; line-height: 1.45; }
.sales-report-metric strong { color: var(--green-dark); font-size: 21px; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.sales-report-metric.negative strong { color: #9b3524; }
.sales-report-suppliers { margin-bottom: 30px; }
.sales-report-suppliers .data-table { min-width: 760px; }
.code-cell { max-width: 180px; overflow-wrap: anywhere; font-family: ui-monospace, SFMono-Regular, Consolas, monospace; font-size: 10px; }
.profit-value { color: var(--green-dark); white-space: nowrap; }
.profit-value.negative { color: #9b3524; }
.delivery-secret { width: min(360px, 42vw); max-height: 120px; margin: 0; padding: 9px; overflow: auto; border: 1px solid var(--line); background: #f7faf8; color: var(--ink); white-space: pre-wrap; overflow-wrap: anywhere; font: 11px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; }
.balance-warning { margin: 12px 0 18px; }
.balance-policy { margin: 10px 0 16px; color: #9b3524; font-size: 11px; line-height: 1.6; }
.supplier-row { min-height: 78px; border-bottom: 1px solid var(--line); display: grid; grid-template-columns: minmax(200px, 1.3fr) minmax(180px, 1fr) minmax(180px, 1fr) auto; gap: 18px; align-items: center; }
.supplier-row:last-child { border-bottom: 0; }
.supplier-name { font-weight: 750; }
.supplier-meta { margin-top: 5px; color: var(--muted); font-size: 11px; }
.health-dot { width: 8px; height: 8px; margin-right: 7px; border-radius: 50%; background: #2c986d; display: inline-block; }
.health-dot.off { background: var(--amber); }
.table-wrap { margin-top: 18px; overflow-x: auto; border-top: 1px solid var(--line); }
.data-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.data-table th { height: 42px; color: var(--muted); font-size: 10px; text-align: left; text-transform: uppercase; white-space: nowrap; }
.data-table td { min-height: 58px; padding: 11px 12px 11px 0; border-top: 1px solid #edf0ee; vertical-align: middle; }
.data-table tbody tr:hover { background: #fafcfb; }
.table-product { min-width: 280px; max-width: 470px; }
.table-product strong { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.table-subtext { margin-top: 4px; color: var(--muted); font-size: 10px; }
.price-input { width: 86px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 5px; }
.price-input:disabled { background: var(--soft); color: var(--muted); }
.auto-price { margin-top: 5px; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; white-space: nowrap; }
.auto-price input { accent-color: var(--green); }
.category-select { width: 118px; height: 34px; padding: 0 7px; border: 1px solid var(--line); border-radius: 5px; background: white; font-size: 11px; }
.small-button { min-height: 32px; padding: 0 10px; border: 1px solid var(--line); border-radius: 5px; background: white; color: var(--green-dark); cursor: pointer; font-weight: 700; font-size: 11px; white-space: nowrap; }
.small-button:hover { border-color: var(--green); background: var(--green-soft); }
.small-button.danger { color: #973624; }
.admin-search { width: 280px; }
.admin-catalog-tools { display: flex; align-items: center; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.admin-filter-control { width: 160px; }
.admin-sort-control { width: 176px; }
.admin-product-summary { min-height: 20px; margin-top: 14px; color: var(--muted); font-size: 11px; }
.status-toggle { accent-color: var(--green); width: 17px; height: 17px; }
.payment-method-list { margin-top: 18px; border-top: 1px solid var(--line); }
.warehouse-link-list { margin-top: 18px; border-top: 1px solid var(--line); }
.warehouse-link-row { min-height: 76px; display: grid; grid-template-columns: 40px minmax(220px, 1fr) minmax(130px, .6fr) auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); }
.warehouse-link-row:last-child { border-bottom: 0; }
.warehouse-url { display: block; max-width: 520px; margin-top: 5px; color: var(--green); font-size: 11px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.warehouse-enabled { margin: 12px 0 18px; }
.payment-method-row { min-height: 72px; display: grid; grid-template-columns: 40px minmax(180px, 1fr) 120px auto; gap: 14px; align-items: center; border-bottom: 1px solid var(--line); }
.payment-method-row:last-child { border-bottom: 0; }
.payment-method-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 6px; background: var(--green-soft); color: var(--green-dark); }
.payment-method-icon svg { width: 18px; height: 18px; }
.row-actions { display: flex; align-items: center; gap: 7px; }
.payment-form-row { margin: 12px 0 18px; display: flex; justify-content: space-between; align-items: end; gap: 20px; }
.account-change-note { margin: 8px 0 2px; color: #8a5512; font-size: 11px; line-height: 1.6; }
.security-confirmation { margin: 16px 0; padding: 14px; border: 1px solid #b8cec2; border-radius: 6px; background: var(--green-soft); }
.security-confirmation-heading { margin-bottom: 12px; display: flex; align-items: center; gap: 8px; color: var(--green-dark); font-size: 12px; }
.security-confirmation-heading svg { width: 17px; height: 17px; }
.security-confirmation .field-label { margin-top: 0; }
.security-confirmation .muted { margin: 8px 0 0; font-size: 10px; line-height: 1.5; }
.qr-upload { min-height: 66px; margin-top: 10px; padding: 12px; border: 1px dashed #9bada4; border-radius: 6px; background: var(--soft); color: var(--green-dark); cursor: pointer; display: flex; align-items: center; gap: 12px; }
.qr-upload:hover { border-color: var(--green); background: var(--green-soft); }
.qr-upload svg { width: 22px; height: 22px; flex: 0 0 auto; }
.qr-upload span { display: grid; gap: 3px; }
.qr-upload small { color: var(--muted); font-size: 11px; }
.qr-upload input { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.qr-admin-preview { margin-top: 10px; padding: 12px; border: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.qr-admin-preview.hidden { display: none; }
.qr-admin-preview img { width: 96px; height: 96px; object-fit: contain; background: white; }
.admin-category-grid { margin-top: 20px; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.admin-category-item { min-width: 0; border: 1px solid var(--line); border-radius: 7px; background: white; overflow: hidden; }
.admin-category-heading { min-height: 78px; padding: 14px; display: flex; align-items: center; gap: 12px; background: var(--soft); }
.admin-category-heading > div { min-width: 0; display: grid; gap: 4px; }
.admin-category-heading strong { font-size: 14px; }
.admin-category-heading span { color: var(--muted); font-size: 11px; }
.admin-subcategory-list { padding: 4px 14px; }
.admin-subcategory-list > div { min-height: 38px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 11px; }
.admin-subcategory-list > div:last-child { border-bottom: 0; }
.admin-subcategory-list span { color: #435049; }
.admin-subcategory-list strong { font-variant-numeric: tabular-nums; }

@media (max-width: 900px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .stat-item { border-bottom: 1px solid var(--line); }
  .stat-item:nth-child(even) { border-right: 0; }
  .stat-item:last-child { border-bottom: 0; }
  .supplier-row { grid-template-columns: 1fr auto; padding: 14px 0; }
  .supplier-row > :nth-child(2), .supplier-row > :nth-child(3) { grid-column: 1; }
  .supplier-row > :last-child { grid-column: 2; grid-row: 1; }
  .payment-method-row { grid-template-columns: 40px 1fr auto; padding: 12px 0; }
  .payment-method-row > :nth-child(3) { grid-column: 2; }
  .payment-method-row > :last-child { grid-column: 3; grid-row: 1 / span 2; }
  .warehouse-link-row { grid-template-columns: 40px 1fr auto; padding: 12px 0; }
  .warehouse-link-row > :nth-child(3) { grid-column: 2; }
  .warehouse-link-row > :last-child { grid-column: 3; grid-row: 1 / span 2; }
  .dashboard-grid { grid-template-columns: 1fr; }
  .admin-category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .admin-catalog-tools { justify-content: flex-start; }
  .sales-report-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .sales-report-metric { border-bottom: 1px solid var(--line); }
  .sales-report-metric:nth-child(3n) { border-right: 0; }
  .sales-report-metric:nth-last-child(-n + 3) { border-bottom: 0; }
}

@media (max-width: 600px) {
  .admin-main { padding: 24px 14px 50px; }
  .admin-section { padding: 18px 14px; }
  .section-heading { align-items: stretch; flex-direction: column; }
  .admin-search { width: 100%; }
  .admin-catalog-tools { width: 100%; }
  .admin-filter-control, .admin-sort-control { width: calc(50% - 24px); flex: 1 1 140px; }
  .stat-value { font-size: 22px; }
  .stat-item { min-height: 96px; padding: 16px; }
  .admin-tabs { width: 100%; display: flex; overflow-x: auto; }
  .admin-tabs button { min-width: 44px; flex: 1 0 44px; padding: 0 6px; justify-content: center; }
  .admin-tabs button span { display: none; }
  .upstream-balance-grid { grid-template-columns: 1fr; }
  .delivery-secret { width: 240px; }
  .admin-category-grid { grid-template-columns: 1fr; }
  .sales-report-controls { width: 100%; justify-content: flex-start; }
  .sales-report-period { flex: 1 1 130px; }
  .sales-report-period button { flex: 1; }
  .report-date-input { flex: 1 1 145px; width: auto; min-width: 0; }
  .sales-report-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-report-metric { min-height: 106px; padding: 14px; }
  .sales-report-metric:nth-child(3n) { border-right: 1px solid var(--line); }
  .sales-report-metric:nth-child(2n) { border-right: 0; }
  .sales-report-metric:nth-last-child(-n + 3) { border-bottom: 1px solid var(--line); }
  .sales-report-metric:nth-last-child(-n + 2) { border-bottom: 0; }
  .sales-report-metric strong { font-size: 19px; }
}
