:root {
  color-scheme: light;
  --bg: #f5f5f5;
  --panel: #ffffff;
  --line: #d9d9d9;
  --line-light: #f0f0f0;
  --line-lighter: #f0f0f0;
  --fill: #fafafa;
  --fill-light: #fafafa;
  --text: rgba(0, 0, 0, 0.88);
  --regular: rgba(0, 0, 0, 0.65);
  --muted: rgba(0, 0, 0, 0.45);
  --accent: #1677ff;
  --accent-dark: #0958d9;
  --accent-light: #e6f4ff;
  --danger: #ff4d4f;
  --ok: #52c41a;
  --warn: #faad14;
  --radius-small: 2px;
  --radius-base: 6px;
  --radius-large: 8px;
  --radius-round: 999px;
  --shadow-light: 0 6px 16px 0 rgba(0, 0, 0, 0.08), 0 3px 6px -4px rgba(0, 0, 0, 0.12), 0 9px 28px 8px rgba(0, 0, 0, 0.05);
  --shadow-lighter: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --app-version: "v1.20.0";
}

.cost-settings-panel {
  max-width: 980px;
}

.purchase-record-status-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  border: 1px solid #d6e4ff;
  border-radius: 8px;
  background: #f5f9ff;
  padding: 12px 16px;
}

.purchase-record-status-strip div {
  display: grid;
  gap: 2px;
  min-width: 180px;
}

.purchase-record-status-strip span,
.purchase-account-command-panel label span,
.purchase-record-detail-toolbar span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.purchase-record-status-strip strong {
  color: var(--text);
  font-size: 14px;
}

.purchase-record-status-strip p {
  margin: 0;
  color: var(--regular);
  font-size: 13px;
  line-height: 1.6;
}

.purchase-records-account-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(290px, 340px);
  gap: 16px;
  align-items: start;
  margin-top: 16px;
}

.purchase-record-account-form label,
.purchase-account-command-panel label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.purchase-record-account-form label {
  font-size: 13px;
}

.purchase-record-account-form input,
.purchase-record-account-form select,
.purchase-record-account-form textarea,
.purchase-account-command-panel input,
.purchase-account-command-panel select,
.purchase-account-command-panel textarea,
.purchase-record-detail-toolbar input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 9px 11px;
  font: inherit;
  color: var(--text);
  background: #fff;
}

.purchase-record-account-form textarea {
  min-height: 116px;
  resize: vertical;
}

.purchase-records-list-panel {
  min-width: 0;
}

.purchase-records-table-scroll {
  width: 100%;
  overflow-x: auto;
}

.purchase-records-table {
  min-width: 1120px;
}

.data-table.purchase-account-summary-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
}

.purchase-account-summary-table th:nth-child(1),
.purchase-account-summary-table td:nth-child(1) {
  width: 18%;
}

.purchase-account-summary-table th:nth-child(2),
.purchase-account-summary-table td:nth-child(2) {
  width: 18%;
}

.purchase-account-summary-table th:nth-child(3),
.purchase-account-summary-table td:nth-child(3) {
  width: 38%;
}

.purchase-account-summary-table th:nth-child(4),
.purchase-account-summary-table td:nth-child(4) {
  width: 26%;
}

.purchase-records-table th,
.purchase-records-table td,
.purchase-account-summary-table th,
.purchase-account-summary-table td {
  vertical-align: middle;
}

.purchase-account-name-cell {
  display: grid;
  justify-items: start;
  gap: 6px;
  min-width: 0;
}

.purchase-account-name-cell strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.purchase-account-summary-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.purchase-account-notes-cell {
  color: var(--regular);
  line-height: 1.5;
  white-space: normal;
}

.purchase-account-notes-text {
  display: block;
  max-height: 4.5em;
  overflow: auto;
  white-space: pre-line;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.purchase-account-start-button {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  font: inherit;
  color: var(--regular);
  background: #fff;
  text-align: left;
}

.purchase-account-summary-table tr.selected td {
  background: #f0f7ff;
}

.purchase-account-summary-actions {
  display: flex;
  flex-wrap: wrap;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.purchase-account-summary-actions button {
  width: 100%;
  min-height: 34px;
  padding: 6px 10px;
}

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

.purchase-account-metrics span {
  display: grid;
  gap: 2px;
}

.purchase-account-metrics b {
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.purchase-account-metrics em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.2;
}

.purchase-account-fetch-state {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.purchase-account-fetch-state div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.purchase-account-fetch-state em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.2;
}

.purchase-account-fetch-state strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.purchase-account-fetch-state span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.purchase-account-fetch-primary strong {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px;
}

.purchase-account-fetch-primary .purchase-account-fetch-age {
  color: #0faf62;
  font-size: 13px;
  font-weight: 600;
}

.purchase-account-fetch-primary .purchase-account-fetch-time {
  color: var(--text);
  font-size: 13px;
  font-weight: 600;
}

.purchase-account-fetch-secondary span {
  color: var(--muted);
  font-size: 12px;
}

.purchase-account-summary-action-cell {
  background: #fff;
}

.purchase-account-summary-table tr.selected .purchase-account-summary-action-cell {
  background: #f0f7ff;
}

.purchase-account-command-panel {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 14px;
}

.purchase-account-command-empty,
.purchase-account-command-content {
  display: grid;
  gap: 14px;
}

.purchase-account-command-empty h2,
.purchase-account-command-head h2 {
  margin: 0;
  font-size: 20px;
}

.purchase-account-command-empty p,
.purchase-command-last-message {
  margin: 0;
  color: var(--regular);
  font-size: 13px;
  line-height: 1.6;
}

.purchase-account-command-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.purchase-account-command-head span:first-child {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.purchase-account-command-panel textarea {
  min-height: 104px;
  resize: vertical;
}

.purchase-account-command-panel textarea[readonly] {
  background: #f8fafc;
  color: var(--text);
  cursor: default;
}

.purchase-account-command-panel textarea.editing {
  background: #fff;
  border-color: #91caff;
}

.purchase-command-note-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.purchase-account-command-panel .hidden,
.purchase-command-note-actions .hidden {
  display: none !important;
}

.purchase-command-note-actions button:first-child,
.purchase-command-note-actions button:last-child {
  grid-column: 1 / -1;
}

.purchase-command-credential-state {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  padding: 10px 12px;
  background: #fafafa;
}

.purchase-command-credential-state div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.purchase-command-credential-state strong {
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
}

.purchase-command-divider {
  height: 1px;
  background: var(--line-light);
}

.purchase-record-detail-toolbar {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) auto auto;
  gap: 12px;
  align-items: end;
}

.purchase-record-detail-toolbar label {
  display: grid;
  gap: 8px;
}

.purchase-record-image-placeholder {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 48px;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
}

.purchase-record-image-box {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 8px;
  background: #f8fafc;
}

.purchase-record-image {
  width: 48px;
  height: 48px;
  display: block;
  object-fit: cover;
  border-radius: 8px;
  background: #f8fafc;
}

.purchase-record-product {
  min-width: 220px;
  max-width: 360px;
  line-height: 1.45;
}

.purchase-record-product a {
  color: var(--text);
  font-weight: 700;
  text-decoration: none;
}

.purchase-record-product a:hover {
  color: var(--accent);
}

.purchase-record-date {
  display: grid;
  gap: 2px;
}

.purchase-record-date small {
  color: var(--muted);
  font-size: 12px;
}

.purchase-record-fetch-result {
  display: grid;
  gap: 8px;
  margin: 0 0 12px;
}

.purchase-record-fetch-result:empty {
  display: none;
}

.purchase-record-account-modal {
  width: min(760px, calc(100vw - 32px));
}

.purchase-record-credential-modal {
  width: min(520px, calc(100vw - 32px));
}

.purchase-record-account-form {
  display: grid;
  gap: 14px;
}

.purchase-record-account-form .inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
}

.purchase-record-account-list {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.purchase-account-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 12px;
  align-items: center;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  padding: 12px;
  background: #fff;
}

.purchase-account-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  line-height: 1.45;
}

.purchase-account-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 2px 9px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.purchase-account-status.ok {
  background: #f0fdf4;
  color: #15803d;
}

.purchase-account-status.warning {
  background: #fffbeb;
  color: #b45309;
}

.purchase-account-status.danger {
  background: #fef2f2;
  color: #b42318;
}

.ant-alert.success {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: #135200;
}

.cost-settings-form {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.cost-settings-form label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-weight: 700;
}

.cost-settings-form input {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  font: inherit;
  font-weight: 600;
  color: var(--text);
  background: #fff;
}

.cost-settings-form small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
}

.cost-settings-actions {
  display: flex;
  grid-column: 1 / -1;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 6px;
}

.cost-settings-preview {
  display: grid;
  gap: 12px;
  margin-top: 14px;
}

.cost-settings-formula,
.cost-settings-note,
.cost-settings-scope {
  border: 1px solid var(--line-light);
  border-radius: 6px;
  background: #fff;
  padding: 14px 16px;
}

.cost-settings-formula {
  display: grid;
  gap: 8px;
}

.cost-settings-formula strong,
.cost-settings-scope span {
  color: var(--muted);
  font-size: 12px;
}

.cost-settings-formula span,
.cost-settings-note,
.cost-settings-scope b {
  color: var(--text);
  font-weight: 700;
}

.cost-settings-scope {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cost-settings-scope.muted {
  background: #f8fafc;
}

.cost-settings-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.cost-settings-rules article {
  border: 1px solid var(--line-light);
  border-radius: 6px;
  background: #fff;
  padding: 14px 16px;
}

.cost-settings-rules h3 {
  margin: 0 0 8px;
  font-size: 14px;
  line-height: 1.4;
}

.cost-settings-rules p {
  margin: 6px 0 0;
  color: var(--regular);
  font-size: 13px;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .purchase-record-status-strip,
  .purchase-records-account-layout,
  .purchase-record-detail-toolbar {
    grid-template-columns: 1fr;
    display: grid;
  }

  .purchase-record-status-strip {
    align-items: start;
  }

  .purchase-account-row {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .purchase-account-command-panel {
    position: static;
  }

  .cost-settings-form {
    grid-template-columns: 1fr;
  }

  .cost-settings-rules {
    grid-template-columns: 1fr;
  }

  .cost-settings-scope {
    align-items: flex-start;
    flex-direction: column;
  }
}

.embedded-tool-main {
  padding-bottom: 24px;
}

.embedded-tool-panel {
  padding: 0;
  overflow: hidden;
}

.embedded-tool-frame {
  display: block;
  width: 100%;
  height: calc(100vh - 168px);
  min-height: 720px;
  border: 0;
  background: #fff;
}

.listing-pricing-page .embedded-tool-main {
  padding: 0;
}

.listing-pricing-page .embedded-tool-panel {
  border: 0;
  border-radius: 0;
  background: transparent;
  margin: 0;
}

.listing-pricing-page .embedded-tool-frame {
  height: calc(100vh - 74px);
  min-height: 760px;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 0;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.5;
  overflow-x: hidden;
}

body.has-local-env-banner {
  padding-top: 32px;
}

.local-env-banner {
  align-items: center;
  background: #fff4d6;
  border-bottom: 1px solid #f0d58a;
  color: #9a5b00;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  height: 32px;
  justify-content: center;
  left: 0;
  letter-spacing: 0;
  line-height: 18px;
  position: fixed;
  right: 0;
  top: 0;
  z-index: 10000;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(circle at 20% 10%, rgba(22, 119, 255, 0.12), transparent 32%),
    linear-gradient(135deg, #f5f5f5 0%, #eef5ff 100%);
}

.login-card {
  width: min(420px, 100%);
  display: grid;
  gap: 24px;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--panel);
  box-shadow: var(--shadow-light);
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 28px;
}

.login-card p {
  margin: 0;
  color: var(--muted);
}

.login-form {
  display: grid;
  gap: 16px;
}

.login-form label,
.modal-form label {
  display: grid;
  gap: 6px;
  color: var(--regular);
  font-weight: 600;
}

.login-form input {
  width: 100%;
}

.form-error {
  min-height: 20px;
  color: var(--danger);
  font-weight: 600;
}

.auth-user-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 8px 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-round);
  background: var(--panel);
  color: var(--regular);
  font-weight: 600;
}

.auth-user-chip button {
  height: 24px;
  padding: 0 8px;
  border: 0;
  background: var(--fill);
  color: var(--regular);
  box-shadow: none;
}

.permission-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-top: 10px;
}

.permission-group {
  min-width: 0;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.permission-group legend {
  padding: 0 6px;
  color: var(--regular);
  font-size: 12px;
  font-weight: 700;
}

.permission-group-items {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.permission-item,
.checkbox-line {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: var(--fill);
  color: var(--text);
}

.permission-item {
  width: 100%;
}

.permission-item span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.permission-item input,
.checkbox-line input {
  width: auto;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  margin-right: 6px;
  padding: 0 7px;
  border: 1px solid var(--line);
  border-radius: var(--radius-round);
  background: var(--fill);
  color: var(--regular);
  font-size: 12px;
  font-weight: 700;
}

.status-tag.ok {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: #389e0d;
}

.status-tag.danger {
  border-color: #ffccc7;
  background: #fff2f0;
  color: #cf1322;
}

.muted-cell {
  color: var(--regular);
}

.password-cell {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.password-cell code {
  padding: 2px 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: var(--fill);
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12px;
}

.user-modal-card {
  max-width: 560px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  transition: grid-template-columns 0.18s ease;
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 76px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  flex-direction: column;
  width: 248px;
  height: 100vh;
  min-height: 0;
  padding: 18px 10px;
  background: #fff;
  color: var(--text);
  box-shadow: inset -1px 0 0 var(--line-light);
  overflow: hidden;
}

.sidebar-toggle {
  flex: 0 0 auto;
  display: inline-grid;
  gap: 4px;
  place-content: center;
  width: 44px;
  height: 36px;
  margin: 0 0 22px 0;
  border: 0;
  border-radius: var(--radius-base);
  background: var(--accent);
  box-shadow: 0 2px 0 rgba(0, 0, 0, 0.05);
}

.sidebar-toggle:hover {
  background: #4096ff;
}

.sidebar-toggle > span {
  display: block;
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #fff;
}

.ant-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  fill: currentColor;
}

.sidebar-brand {
  flex: 0 0 auto;
  padding: 0 8px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-brand h1 {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 18px;
  color: #fff;
  white-space: nowrap;
}

.sidebar-brand h1::after {
  content: var(--app-version);
  display: inline-flex;
  align-items: center;
  min-height: 18px;
  padding: 0 6px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.68);
  font-size: 11px;
  font-weight: 650;
  line-height: 18px;
}

.sidebar-brand p {
  color: rgba(255, 255, 255, 0.45);
  white-space: nowrap;
}

.side-nav {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  margin-top: 16px;
  padding-bottom: 20px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.24) transparent;
}

.side-nav::-webkit-scrollbar {
  width: 6px;
}

.side-nav::-webkit-scrollbar-thumb {
  border-radius: var(--radius-round);
  background: rgba(255, 255, 255, 0.24);
}

.side-nav-section {
  display: grid;
  gap: 4px;
}

.side-nav-section[hidden] {
  display: none;
}

.side-nav-section-title {
  height: 24px;
  padding: 6px 12px 0;
  color: rgba(255, 255, 255, 0.36);
  font-size: 12px;
  font-weight: 700;
  line-height: 18px;
  white-space: nowrap;
}

.side-nav-group {
  display: grid;
  gap: 4px;
}

.side-nav-item {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: rgba(255, 255, 255, 0.65);
  text-align: left;
  font-weight: 600;
}

.side-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.side-nav-item.active {
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.side-nav-parent {
  margin-bottom: 0;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: inherit;
  font-size: 16px;
}

.nav-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-caret {
  justify-self: end;
  color: inherit;
  font-size: 14px;
}

.side-submenu {
  display: grid;
  gap: 2px;
  padding: 6px 0 8px;
  background: rgba(0, 0, 0, 0.18);
}

.side-submenu.collapsed {
  display: none;
}

.side-subitem {
  grid-template-columns: minmax(0, 1fr);
  height: 38px;
  padding-left: 48px;
  color: rgba(255, 255, 255, 0.58);
  border-radius: 0;
}

.side-subitem.active {
  background: rgba(22, 119, 255, 0.18);
  color: #fff;
}

.side-nested-group {
  display: grid;
  gap: 2px;
}

.side-nested-group[hidden] {
  display: none;
}

.side-nested-parent {
  grid-template-columns: minmax(0, 1fr) 16px;
  padding-left: 48px;
  color: rgba(255, 255, 255, 0.62);
}

.side-third-submenu {
  display: grid;
  gap: 2px;
}

.side-third-submenu.collapsed {
  display: none;
}

.side-third-item {
  padding-left: 66px;
  color: rgba(255, 255, 255, 0.5);
}

.side-nav-item[hidden],
.side-nav-group[hidden] {
  display: none;
}

.adult-product-overview,
.adult-product-workbench {
  padding: 0;
  overflow: hidden;
}

.adult-product-toolbar {
  display: grid;
  grid-template-columns: auto minmax(220px, 1fr) auto;
  gap: 18px;
  align-items: center;
  min-height: 72px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-light);
  background: #fff;
}

.adult-product-store-control {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.adult-product-store-control > span {
  color: var(--regular);
  font-weight: 700;
}

.adult-product-current-brief {
  min-width: 0;
  color: var(--regular);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adult-product-toolbar-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.adult-product-upload-button {
  min-width: 112px;
}

.adult-product-overview-grid,
.adult-product-workbench-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 0;
  align-items: stretch;
}

.adult-product-upload-card,
.adult-product-version-card {
  min-width: 0;
  padding: 20px;
}

.adult-product-upload-card {
  border-right: 1px solid var(--line-light);
}

.adult-product-drop-zone {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 182px;
  height: auto;
  padding: 24px;
  border-color: #91caff;
  border-radius: var(--radius-large);
  background: #fbfdff;
  color: var(--text);
}

.adult-product-drop-zone:hover,
.adult-product-drop-zone:focus-within {
  border-color: var(--accent);
  background: #f0f7ff;
}

.adult-product-drop-zone.is-uploading {
  cursor: wait;
}

.adult-product-upload-icon {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border: 1px solid #91caff;
  border-radius: 18px;
  background: #e6f4ff;
  color: var(--accent);
  font-size: 30px;
  font-weight: 700;
  line-height: 1;
}

.adult-product-drop-zone span:not(.adult-product-upload-icon) {
  color: var(--text);
  font-size: 16px;
  font-weight: 750;
}

.adult-product-drop-zone small {
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}

.adult-product-version-empty {
  display: grid;
  gap: 6px;
  min-height: 182px;
  align-content: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-large);
  padding: 18px;
  background: #fafafa;
  color: var(--regular);
}

.adult-product-version-empty strong {
  color: var(--text);
  font-size: 16px;
}

.adult-product-version-empty span {
  color: var(--muted);
}

.adult-product-version-summary {
  display: grid;
  gap: 18px;
}

.adult-product-version-meta {
  display: grid;
  gap: 4px;
}

.adult-product-version-meta h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.adult-product-version-meta p {
  margin: 0;
  color: var(--muted);
}

.adult-product-version-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-top: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
}

.adult-product-version-stats > div {
  min-width: 0;
  padding: 14px 12px;
  border-right: 1px solid var(--line-light);
}

.adult-product-version-stats > div:last-child {
  border-right: 0;
}

.adult-product-version-stats span,
.adult-product-version-stats small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.adult-product-version-stats strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.adult-product-diff-panel {
  padding: 0;
  overflow: hidden;
}

.adult-product-diff-head {
  padding: 16px 20px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line-light);
}

.adult-product-diff-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.adult-product-diff-actions .pill {
  margin-left: 0;
}

.adult-product-diff {
  display: grid;
  gap: 0;
  margin-top: 0;
  max-height: none;
  padding-right: 0;
  overflow: visible;
}

.adult-product-diff-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  padding: 16px 20px;
  border-bottom: 1px solid var(--line-light);
  background: #fff;
}

.adult-product-version {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  margin-top: 12px;
}

.adult-product-version h3,
.adult-product-upload h3 {
  margin: 0 0 8px;
}

.adult-product-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.adult-store-switch {
  margin-bottom: 0;
}

.adult-product-stats,
.adult-product-categories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  margin-top: 16px;
  max-height: 420px;
  padding-right: 4px;
  overflow: auto;
}

.adult-product-stats.compact-stats {
  grid-template-columns: repeat(auto-fit, minmax(118px, 1fr));
  max-height: none;
  margin-top: 12px;
  padding-right: 0;
  overflow: visible;
}

.adult-product-stat,
.adult-product-diff-card,
.adult-category-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.adult-product-diff-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 12px;
  align-items: center;
  min-height: 76px;
  border-radius: 0;
  border-width: 0 1px 0 0;
  text-align: left;
  box-shadow: none;
}

.adult-product-diff-card:first-child {
  border-left: 1px solid var(--line-light);
  border-radius: var(--radius-large) 0 0 var(--radius-large);
}

.adult-product-diff-card:last-child {
  border-right: 1px solid var(--line-light);
  border-radius: 0 var(--radius-large) var(--radius-large) 0;
}

.adult-product-diff-card::before {
  content: "";
  grid-row: 1 / span 2;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--accent-light);
}

.adult-product-diff-card.ok::before {
  background: #f6ffed;
}

.adult-product-diff-card.danger::before {
  background: #fff1f0;
}

.adult-product-diff-card.warn::before {
  background: #fff7e6;
}

.adult-product-diff-card.purple::before {
  background: #f9f0ff;
}

.adult-product-diff-card:hover,
.adult-product-diff-card.active {
  border-color: #91caff;
  background: #f7fbff;
  color: var(--text);
}

.adult-product-diff-card strong {
  margin-top: 2px;
}

.adult-product-diff-card small {
  color: var(--muted);
  font-size: 12px;
}

.adult-product-change-panel {
  display: grid;
  gap: 0;
  padding: 0 20px 20px;
}

.adult-product-change-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 0 12px;
}

.adult-product-change-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.adult-product-change-tabs button {
  height: 32px;
  border-color: var(--line);
  background: #fff;
  color: var(--regular);
  box-shadow: none;
  font-size: 13px;
}

.adult-product-change-tabs button.active,
.adult-product-change-tabs button:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.adult-product-change-toolbar input {
  flex: 0 1 280px;
  min-width: 180px;
}

.adult-product-change-table-wrap {
  border-radius: var(--radius-large);
}

.adult-product-change-table {
  min-width: 980px;
}

.adult-product-change-table th {
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
}

.adult-product-change-table td {
  height: 44px;
}

.adult-product-change-title {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adult-product-change-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: var(--radius-base);
  padding: 0 8px;
  background: #e6f4ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.adult-product-change-tag.added {
  background: #f6ffed;
  color: #389e0d;
}

.adult-product-change-tag.removed {
  background: #fff1f0;
  color: #cf1322;
}

.adult-product-change-tag.price_changed {
  background: #fff7e6;
  color: #d46b08;
}

.adult-product-change-tag.sku_changed {
  background: #f9f0ff;
  color: #722ed1;
}

.adult-product-price-check-panel {
  padding: 0;
  overflow: hidden;
}

.adult-product-price-check-head {
  padding: 12px 16px;
  margin-bottom: 0;
  border-bottom: 1px solid var(--line-light);
}

.adult-product-price-check-head p {
  margin-top: 2px;
  font-size: 12px;
}

.adult-product-price-check {
  display: grid;
  gap: 0;
}

.adult-product-price-settings {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr)) auto;
  gap: 10px;
  align-items: end;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-light);
  background: #fbfcfe;
}

.adult-product-price-settings label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.adult-product-price-settings input {
  width: 100%;
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 7px 9px;
  color: var(--text);
  font: inherit;
  background: #fff;
}

.adult-product-price-settings button {
  min-height: 34px;
  white-space: nowrap;
}

.adult-product-price-loading {
  display: grid;
  gap: 6px;
  min-height: 128px;
  align-content: center;
  padding: 20px;
  color: var(--muted);
}

.adult-product-price-loading strong {
  color: var(--text);
}

.adult-product-price-progress {
  display: grid;
  gap: 8px;
  max-width: 560px;
}

.adult-product-progress-head,
.adult-product-progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.adult-product-progress-head span {
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
}

.adult-product-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #edf2f7;
}

.adult-product-progress-track span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #1677ff;
  transition: width .2s ease;
}

.adult-product-progress-meta {
  color: var(--muted);
  font-size: 12px;
}

.adult-product-price-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border-bottom: 1px solid var(--line-light);
  background: #fff;
}

.adult-product-price-kpis > div {
  min-width: 0;
  padding: 16px 20px;
  border-right: 1px solid var(--line-light);
}

.adult-product-price-kpis > div:last-child {
  border-right: 0;
}

.adult-product-price-kpis span,
.adult-product-price-kpis small {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.adult-product-price-kpis strong {
  display: block;
  margin: 4px 0 2px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.adult-product-price-body {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  border-bottom: 1px solid var(--line-light);
}

.adult-product-price-chart,
.adult-product-price-rules {
  min-width: 0;
  padding: 18px 20px;
}

.adult-product-price-chart {
  border-right: 1px solid var(--line-light);
}

.adult-product-price-chart-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.adult-product-price-chart-head strong,
.adult-product-price-rules strong {
  color: var(--text);
  font-size: 15px;
}

.adult-product-price-chart-head span,
.adult-product-price-rules p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.adult-product-price-rules {
  display: grid;
  align-content: start;
  gap: 8px;
  background: #fbfcfe;
}

.adult-product-price-bars {
  display: grid;
  gap: 8px;
}

.adult-product-price-bar-row {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr) 56px;
  align-items: center;
  gap: 10px;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--regular);
  text-align: left;
  box-shadow: none;
}

.adult-product-price-bar-row:hover,
.adult-product-price-bar-row.active {
  color: var(--accent);
}

.adult-product-price-bar-row span {
  min-width: 0;
  overflow: hidden;
  color: inherit;
  font-size: 13px;
  font-weight: 650;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adult-product-price-bar-row i {
  display: block;
  max-width: 100%;
  height: 12px;
  border-radius: 3px;
  background: #d9d9d9;
}

.adult-product-price-bar-row i.danger {
  background: #ff7875;
}

.adult-product-price-bar-row i.warn {
  background: #ffc53d;
}

.adult-product-price-bar-row i.ok {
  background: #73d13d;
}

.adult-product-price-bar-row i.muted {
  background: #d9d9d9;
}

.adult-product-price-bar-row b {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.adult-product-price-table-panel {
  padding-top: 0;
}

.adult-product-price-table-wrap {
  border-radius: var(--radius-large);
}

.adult-product-price-table {
  min-width: 1260px;
}

.adult-product-price-status {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: var(--radius-base);
  padding: 0 8px;
  background: #f5f5f5;
  color: var(--regular);
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.adult-product-price-status.risk {
  background: #fff1f0;
  color: #cf1322;
}

.adult-product-price-status.watch {
  background: #fff7e6;
  color: #ad6800;
}

.adult-product-price-status.normal {
  background: #f6ffed;
  color: #237804;
}

.adult-product-price-status.missing_catalog,
.adult-product-price-status.missing_sale_price {
  background: #f5f5f5;
  color: var(--muted);
}

.adult-price-negative {
  color: #cf1322;
  font-weight: 700;
}

.adult-price-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}

.adult-price-detail-tabs[hidden] {
  display: none;
}

.adult-price-detail-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--regular);
  font-weight: 650;
}

.adult-price-detail-tabs button.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.adult-price-detail-tabs span {
  color: inherit;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.adult-product-stat span,
.adult-product-diff-card span,
.adult-category-card span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.adult-product-stat strong,
.adult-product-diff-card strong,
.adult-category-card strong {
  display: block;
  margin-top: 6px;
  font-size: 24px;
  line-height: 1.15;
}

.adult-product-import-note,
.adult-product-diff-details {
  grid-column: 1 / -1;
}

.adult-product-import-note {
  padding: 12px 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-lg);
  color: var(--muted);
  background: #fafcff;
}

.adult-product-diff-details {
  display: grid;
  gap: 10px;
}

.adult-product-diff-details details {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: #fff;
}

.adult-product-diff-details summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--text);
  font-weight: 700;
}

.adult-product-diff-list {
  display: grid;
  gap: 8px;
  padding: 0 14px 14px;
}

.adult-product-diff-list div {
  display: grid;
  grid-template-columns: minmax(96px, 0.16fr) minmax(180px, 1fr) minmax(180px, 0.48fr);
  gap: 10px;
  align-items: center;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.adult-product-diff-list strong,
.adult-product-diff-list span,
.adult-product-diff-list small {
  min-width: 0;
}

.adult-product-diff-list span,
.adult-product-diff-list small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adult-product-diff-list small {
  color: var(--muted);
}

.adult-category-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
  height: auto;
  min-height: 132px;
  color: var(--text);
  cursor: pointer;
  text-align: left;
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.adult-category-card:hover {
  background: #fff;
  border-color: var(--accent);
  color: var(--text);
  box-shadow: var(--shadow-light);
  transform: translateY(-1px);
}

.adult-category-card.active {
  background: var(--accent-light);
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.1);
}

.adult-category-card.primary-cat {
  border-color: #91caff;
  background: linear-gradient(135deg, #e6f4ff 0%, #fff 62%);
}

.adult-category-card h3 {
  margin: 0 0 12px;
  color: var(--text);
  font-size: 15px;
  line-height: 1.35;
  font-weight: 700;
}

.adult-category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.adult-category-card em {
  margin-top: auto;
  color: var(--accent);
  font-style: normal;
  font-weight: 700;
}

.segmented-control {
  display: inline-flex;
  gap: 4px;
  width: max-content;
  max-width: 100%;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f7f9fc;
}

.segmented-control button {
  flex: 0 0 auto;
  min-height: 34px;
  padding: 0 14px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
  white-space: nowrap;
  box-shadow: none;
}

.segmented-control button.active {
  background: #fff;
  color: var(--accent);
  box-shadow: var(--shadow-light);
}

.segmented-control button[hidden] {
  display: none;
}

.spot-control-panel {
  display: grid;
  gap: 14px;
  padding-bottom: 16px;
}

.spot-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: stretch;
}

.spot-toolbar .segmented-control {
  align-self: center;
  flex: 0 0 auto;
}

.spot-toolbar .drop-zone {
  flex: 1 1 340px;
  min-height: 46px;
  margin: 0;
  padding: 8px 12px;
  border-style: dashed;
  border-radius: 6px;
  background: #fafcff;
  text-align: left;
}

.spot-toolbar .drop-zone span {
  display: block;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
}

.spot-toolbar small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  word-break: break-word;
}

.spot-toolbar #spot-upload {
  flex: 0 0 auto;
  min-width: 112px;
}

.spot-version-meta {
  display: grid;
  flex: 1 1 280px;
  align-content: center;
  gap: 2px;
  min-height: 46px;
  padding: 6px 10px;
  border: 1px solid var(--line-light);
  border-radius: 6px;
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.spot-version-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spot-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-light);
  border-radius: 6px;
  background: #fff;
  overflow: hidden;
}

.spot-kpi {
  min-width: 0;
  padding: 12px 14px;
  border-right: 1px solid var(--line-light);
}

.spot-kpi:last-child {
  border-right: 0;
}

.spot-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.spot-kpi strong {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 22px;
  line-height: 1.1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.spot-kpi small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.spot-category-panel,
.spot-detail-panel {
  padding-top: 18px;
}

.spot-category-panel {
  padding-bottom: 14px;
}

.spot-detail-table th,
.spot-detail-table td {
  padding: 9px 10px;
  font-size: 13px;
  vertical-align: middle;
}

.spot-detail-table thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafafa;
}

.spot-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.spot-sort-button:hover,
.spot-sort-button.active {
  color: #0f7bff;
}

.spot-sort-indicator {
  width: 12px;
  color: #0f7bff;
  font-size: 12px;
  line-height: 1;
}

.spot-product-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: #f7f9fc;
  object-fit: cover;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

img.spot-product-thumb {
  display: block;
}

.spot-category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-top: 2px;
}

.spot-category-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  max-width: 220px;
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 13px;
  line-height: 1;
  box-shadow: none;
}

.spot-category-pill:hover {
  border-color: #91caff;
  color: var(--accent);
}

.spot-category-pill.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(22, 119, 255, 0.08);
}

.spot-category-pill span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.spot-category-pill strong {
  color: inherit;
  font-size: 13px;
  font-weight: 800;
}

.spot-list-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 12px 0;
  padding: 8px 10px;
  border: 1px solid var(--line-light);
  border-radius: 6px;
  background: #fafcff;
  color: var(--muted);
  font-size: 13px;
}

.spot-list-summary span {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
}

.spot-list-summary span:not(:last-child)::after {
  content: "";
  width: 1px;
  height: 12px;
  margin-left: 8px;
  background: var(--line-light);
}

.spot-list-summary .spot-list-summary-title {
  color: var(--text);
  font-weight: 700;
}

.spot-list-summary strong {
  color: var(--text);
  font-weight: 800;
}

.spot-inline-filters {
  grid-template-columns: 170px 150px 220px;
  gap: 10px;
  margin: 10px 0 0;
}

.adult-category-filterbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  margin-top: 14px;
  padding: 0 20px;
}

.adult-category-filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-width: 100%;
  min-width: 0;
}

.adult-category-filter-group button {
  max-width: 100%;
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
}

.adult-category-filter-group button.active {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.breadcrumb {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 14px;
}

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

.adult-product-filters {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.adult-product-filters label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.adult-product-filters input,
.adult-product-filters select {
  min-width: 0;
}

.adult-product-title-cell {
  min-width: 260px;
}

.adult-product-title-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.adult-product-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  overflow: hidden;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: #f7f9fc;
}

.adult-product-thumb img,
img.adult-product-thumb {
  width: 40px;
  height: 40px;
  object-fit: cover;
}

.adult-product-thumb-empty {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.adult-product-title-text {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.adult-product-title-link {
  color: inherit;
  text-decoration: none;
}

.adult-product-title-link:hover {
  color: var(--accent);
}

.adult-product-sort-group {
  min-width: 92px;
}

.adult-sort-button,
.adult-sortable {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  text-align: left;
  cursor: pointer;
}

.adult-sort-button:hover,
.adult-sort-button.active,
.adult-sortable:hover,
.adult-sortable.active {
  color: var(--accent);
}

.adult-action-link {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.adult-action-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.adult-action-link.danger {
  color: #cf1322;
}

.adult-action-muted {
  color: var(--muted);
  font-size: 12px;
}

.spot-sku-name {
  margin-top: 3px;
  color: rgba(0, 0, 0, 0.36);
  font-size: 12px;
  line-height: 1.35;
  font-weight: 400;
}

.adult-product-pager {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.sku-detail-row td {
  padding: 0;
  background: #fafafa;
}

.sku-detail-inner {
  padding: 14px;
  overflow-x: auto;
}

.adult-empty {
  padding: 32px 16px;
  color: var(--muted);
  text-align: center;
}

.adult-empty.compact {
  width: 100%;
  padding: 14px 10px;
  border: 1px dashed var(--line);
  border-radius: 6px;
  background: #fafafa;
  font-size: 13px;
}

@media (max-width: 980px) {
  .adult-product-overview-grid,
  .adult-product-workbench-grid,
  .adult-product-version {
    grid-template-columns: 1fr;
  }

  .adult-product-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .adult-product-toolbar-actions {
    justify-content: flex-start;
  }

  .adult-product-upload-card {
    border-right: 0;
    border-bottom: 1px solid var(--line-light);
  }

  .adult-product-diff-kpis,
  .adult-product-price-kpis,
  .adult-product-version-stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .adult-product-price-body {
    grid-template-columns: 1fr;
  }

  .adult-product-price-chart {
    border-right: 0;
    border-bottom: 1px solid var(--line-light);
  }

  .adult-product-diff-card,
  .adult-product-diff-card:first-child,
  .adult-product-diff-card:last-child {
    border: 1px solid var(--line-light);
    border-radius: var(--radius-large);
  }

  .adult-product-change-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .adult-product-diff-actions {
    justify-content: flex-start;
  }

  .adult-product-change-toolbar input {
    flex-basis: auto;
    width: 100%;
  }

  .adult-product-actions {
    justify-content: flex-start;
  }

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

@media (max-width: 520px) {
  .adult-product-overview {
    padding: 14px;
  }

  .adult-product-toolbar,
  .adult-product-upload-card,
  .adult-product-version-card,
  .adult-product-diff-head,
  .adult-product-price-check-head,
  .adult-product-diff-kpis,
  .adult-product-price-kpis,
  .adult-product-price-chart,
  .adult-product-price-rules,
  .adult-product-change-panel {
    padding-left: 12px;
    padding-right: 12px;
  }

  .adult-product-store-control {
    align-items: stretch;
    flex-direction: column;
  }

  .adult-product-toolbar-actions > *,
  .adult-product-toolbar-actions button,
  .adult-product-toolbar-actions a {
    width: 100%;
  }

  .adult-product-drop-zone {
    min-height: 150px;
    padding: 18px 12px;
  }

  .adult-product-diff-kpis,
  .adult-product-price-kpis,
  .adult-product-version-stats {
    grid-template-columns: 1fr;
  }

  .adult-product-price-bar-row {
    grid-template-columns: 92px minmax(0, 1fr) 42px;
  }

  .adult-category-filterbar,
  .adult-category-filter-group {
    width: 100%;
  }

  .adult-category-filter-group button {
    flex: 1 1 auto;
  }

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

  .adult-product-stats,
  .adult-product-diff,
  .adult-product-categories {
    grid-template-columns: 1fr;
    max-height: 360px;
  }
}

.app-shell.sidebar-collapsed .sidebar {
  padding-left: 16px;
  padding-right: 16px;
}

.app-shell.sidebar-collapsed .sidebar-brand,
.app-shell.sidebar-collapsed .sidebar-brand h1::after,
.app-shell.sidebar-collapsed .side-nav-section-title,
.app-shell.sidebar-collapsed .nav-label,
.app-shell.sidebar-collapsed .nav-caret,
.app-shell.sidebar-collapsed .side-submenu {
  display: none;
}

.app-shell.sidebar-collapsed .side-nav-item {
  grid-template-columns: 1fr;
  justify-items: center;
  padding: 0;
}

.content-shell {
  min-width: 0;
}

.inventory-page,
.inventory-page .content-shell,
.inventory-page main {
  background: #fff;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 28px;
  background: #ffffff;
  border-bottom: 1px solid var(--line);
  min-width: 0;
}

.inventory-top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.inventory-top-actions button {
  min-height: 36px;
  padding: 0 18px;
  border-radius: var(--radius-base);
  font-size: 14px;
  font-weight: 850;
}

.inventory-top-actions button.secondary {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--regular);
}

.topbar > div:first-child {
  min-width: 0;
}

.topbar h1,
.topbar p {
  overflow-wrap: anywhere;
}

.page-title-with-version {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-title-with-version span {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-round);
  background: var(--fill);
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  line-height: 22px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
  min-width: 0;
}

.ghost-button {
  min-height: 32px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: var(--regular);
  font-size: 13px;
  font-weight: 650;
}

.ghost-button:hover {
  background: var(--fill-light);
  color: var(--accent);
}

.analysis-calc-actions {
  align-items: flex-start;
}

.analysis-calc-control {
  display: grid;
  justify-items: end;
  gap: 6px;
}

.analysis-calc-control small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.analysis-calc-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 156px;
}

.calc-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #fff;
  border-radius: 999px;
}

.analysis-calc-button.is-loading .calc-spinner {
  display: inline-block;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

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

h1 {
  font-size: 22px;
  font-weight: 700;
}

h2 {
  font-size: 16px;
  margin-bottom: 8px;
}

h3 {
  font-size: 14px;
  margin-bottom: 8px;
}

p {
  color: var(--muted);
  margin-top: 4px;
}

main {
  width: 100%;
  max-width: 1440px;
  margin: 0;
  padding: clamp(14px, 2vw, 22px);
  min-width: 0;
}

.report-page-shell {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 344px;
  align-items: start;
  gap: 16px;
}

.report-main-column {
  display: grid;
  min-width: 0;
  gap: 0;
}

.panel {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  padding: 18px;
  margin-bottom: 18px;
}

.catalog-overview {
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

.catalog-overview:hover,
.catalog-overview:focus-visible {
  border-color: var(--accent);
  box-shadow: var(--shadow-light);
  outline: none;
}

.catalog-overview-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.9fr) minmax(0, 2fr);
  gap: 12px;
  margin-top: 12px;
}

.catalog-total-card,
.catalog-brand-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.catalog-total-card {
  min-height: 118px;
  padding: 18px;
  background: var(--fill);
}

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

.catalog-brand-card {
  padding: 12px;
}

.catalog-total-card span,
.catalog-brand-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.catalog-total-card b {
  display: block;
  color: var(--text);
  font-size: 28px;
  line-height: 1.15;
}

.catalog-brand-card b {
  display: block;
  color: var(--text);
  font-size: 20px;
  line-height: 1.2;
}

.catalog-total-card small,
.catalog-brand-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-style: normal;
}

.catalog-total-card em,
.catalog-brand-card em {
  color: var(--danger);
  font-style: normal;
  font-weight: 650;
}

.upload-panel,
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-width: 0;
}

.upload-panel > *,
.section-head > * {
  min-width: 0;
}

.section-head.compact {
  margin-bottom: 10px;
}

.drop-zone {
  display: flex;
  align-items: center;
  justify-content: center;
  width: min(100%, 420px);
  min-width: min(320px, 100%);
  height: 58px;
  padding: 0 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-base);
  background: var(--fill-light);
  color: var(--regular);
  font-weight: 650;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.drop-zone input {
  display: none;
}

.drop-zone.dragover,
.drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.inventory-panel input[type="file"] {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

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

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

.inventory-mode-tabs {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  width: 240px;
  max-width: 100%;
  height: 48px;
  margin: 0 0 16px;
  padding: 0;
  border: 1px solid #d9dfe8;
  border-radius: 7px;
  background: #fff;
  overflow: hidden;
}

.qn-tagging-panel {
  margin-top: 14px;
}

.qn-tagging-page main {
  max-width: none;
  padding: clamp(16px, 1.7vw, 24px) clamp(18px, 1.7vw, 28px);
}

.qn-tagging-page .qn-tagging-panel {
  width: 100%;
}

.qn-tagging-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 10px;
}

.qn-tagging-search {
  width: 190px;
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.qn-tagging-toolbar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.qn-tagging-toolbar select {
  min-width: 136px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font-size: 13px;
}

.qn-tagging-layout {
  display: grid;
  grid-template-columns: 228px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.qn-tagging-run-list {
  max-height: 760px;
  overflow-y: auto;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fbfcfe;
}

.qn-tagging-date-rail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 12px 8px;
  border-bottom: 1px solid var(--line-light);
}

.qn-tagging-date-rail-head b {
  color: var(--text);
  font-size: 14px;
}

.qn-tagging-date-rail-head span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.qn-tagging-date-rail {
  display: grid;
  gap: 8px;
  padding: 10px;
}

.qn-tagging-day {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  width: 100%;
  min-height: 74px;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.qn-tagging-day:hover,
.qn-tagging-day.active {
  border-color: #9ec8ff;
  background: #eef6ff;
}

.qn-tagging-day.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.qn-tagging-day span,
.qn-tagging-day em {
  min-width: 0;
}

.qn-tagging-day b {
  display: block;
  font-size: 14px;
}

.qn-tagging-day em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
}

.qn-tagging-time-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.qn-tagging-time-head h3 {
  margin: 0 0 4px;
  font-size: 18px;
}

.qn-tagging-time-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.qn-tagging-time-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.qn-tagging-time-card {
  display: grid;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 110px;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: 7px;
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  box-shadow: none;
}

.qn-tagging-time-card:hover,
.qn-tagging-time-card.active {
  border-color: #9ec8ff;
  background: #f4f9ff;
}

.qn-tagging-time-card.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.qn-tagging-time-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.qn-tagging-time-card-top b {
  font-size: 16px;
}

.qn-tagging-time-card strong {
  display: block;
  min-width: 0;
  font-size: 13px;
  overflow-wrap: anywhere;
}

.qn-tagging-time-summary {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.qn-tagging-progress {
  display: block;
  height: 7px;
  overflow: hidden;
  border-radius: var(--radius-round);
  background: #edf2f7;
}

.qn-tagging-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #16a34a, #1677ff);
}

.qn-tagging-time-orders {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 86px;
  overflow: auto;
}

.qn-tagging-time-orders.muted {
  color: var(--muted);
  font-size: 12px;
}

.qn-tagging-time-orders button {
  min-height: 26px;
  padding: 3px 7px;
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: none;
}

.qn-tagging-detail-content {
  min-width: 0;
}

.qn-tagging-run-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.qn-tagging-run-table th,
.qn-tagging-run-table td {
  padding: 10px 11px;
  border-bottom: 1px solid var(--line-light);
  text-align: left;
  vertical-align: middle;
}

.qn-tagging-run-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.qn-tagging-run-table tbody tr {
  cursor: pointer;
  background: #fff;
}

.qn-tagging-run-table tbody tr:hover,
.qn-tagging-run-table tbody tr.active {
  background: #eef6fc;
}

.qn-tagging-run-table tbody tr.active {
  box-shadow: inset 3px 0 0 var(--accent);
}

.qn-tagging-run-table td:nth-child(3),
.qn-tagging-run-table td:nth-child(4) {
  color: var(--regular);
  line-height: 1.45;
}

.qn-tagging-date-group {
  padding: 12px;
  border-bottom: 1px solid var(--line-light);
}

.qn-tagging-date-group:last-child {
  border-bottom: 0;
}

.qn-tagging-date {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.qn-tagging-run {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 7px 8px;
  width: 100%;
  margin: 0 0 8px;
  padding: 10px;
  border: 1px solid var(--line-light);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  text-align: left;
  box-shadow: none;
}

.qn-tagging-run:last-child {
  margin-bottom: 0;
}

.qn-tagging-run:hover,
.qn-tagging-run.active {
  border-color: var(--accent);
  background: #eef6fc;
}

.qn-tagging-run span,
.qn-tagging-run small {
  min-width: 0;
}

.qn-tagging-run b {
  display: block;
  font-size: 14px;
}

.qn-tagging-run em,
.qn-tagging-run small {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.qn-tagging-run small {
  grid-column: 1 / -1;
}

.qn-tagging-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #e5e7eb;
  color: #374151;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  white-space: nowrap;
}

.qn-tagging-badge.ok {
  background: #dcfce7;
  color: #166534;
}

.qn-tagging-badge.warn {
  background: #fef3c7;
  color: #92400e;
}

.qn-tagging-badge.error {
  background: #fee2e2;
  color: #991b1b;
}

.qn-tagging-badge:empty {
  display: none;
}

.qn-tagging-detail-head,
.qn-tagging-store-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.qn-tagging-detail-head {
  margin-top: 14px;
}

.qn-tagging-detail-head h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.qn-tagging-detail-head p,
.qn-tagging-store-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.qn-tagging-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
}

.qn-tagging-metrics.compact {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.qn-tagging-metric {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fbfcfe;
}

.qn-tagging-metric span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.qn-tagging-metric b {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 20px;
}

.qn-tagging-metric.ok b {
  color: #166534;
}

.qn-tagging-metric.warn b {
  color: #92400e;
}

.qn-tagging-metric.error b {
  color: #991b1b;
}

.qn-tagging-detail-card {
  margin-top: 16px;
  padding: 16px 0 0;
  border: 0;
  border-top: 1px solid var(--line-light);
  border-radius: 0;
  background: transparent;
}

.qn-tagging-order-card {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.qn-tagging-order-head,
.qn-tagging-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.qn-tagging-order-head h3,
.qn-tagging-card-head h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.qn-tagging-order-head p,
.qn-tagging-card-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.qn-copy-orders.copied,
.qn-tagging-order-list button.copied,
.qn-order-inline-copy.copied {
  border-color: #16a34a;
  background: #dcfce7;
  color: #166534;
}

.qn-tagging-order-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  max-height: 120px;
  overflow: auto;
}

.qn-tagging-order-list button,
.qn-order-inline-copy {
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid #d7e0ea;
  border-radius: 6px;
  background: #f8fafc;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: none;
}

.qn-order-inline-copy {
  min-height: 24px;
  padding: 2px 6px;
}

.qn-detail-order-text {
  display: inline-block;
  color: var(--text);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.qn-target-tag {
  font-weight: 900;
  white-space: nowrap;
}

.qn-target-tag.purple {
  color: #7c3aed;
}

.qn-target-tag.gray {
  color: #6b7280;
}

.qn-target-tag.orange {
  color: #ea580c;
}

.qn-target-tag.none {
  color: var(--text);
}

.qn-detail-note {
  display: -webkit-box;
  overflow: hidden;
  white-space: normal;
  overflow-wrap: anywhere;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.qn-tagging-detail-table-wrap {
  overflow: auto;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
}

.qn-tagging-detail-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 12px;
}

.qn-tagging-detail-table th,
.qn-tagging-detail-table td {
  padding: 9px 10px;
  border-bottom: 1px solid var(--line-light);
  text-align: left;
  vertical-align: top;
}

.qn-tagging-detail-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.qn-tagging-detail-table td {
  color: var(--regular);
  line-height: 1.45;
}

.qn-tagging-detail-table th:nth-child(2),
.qn-tagging-detail-table td:nth-child(2) {
  width: 190px;
  min-width: 190px;
}

.qn-detail-order-cell {
  overflow: visible;
  white-space: nowrap;
}

.qn-tagging-raw-files {
  margin-top: 14px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fbfcfe;
}

.qn-tagging-raw-files > summary {
  cursor: pointer;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 900;
}

.qn-tagging-raw-files .qn-tagging-store,
.qn-tagging-raw-files .qn-tagging-report-title,
.qn-tagging-raw-files .qn-tagging-report {
  margin-left: 14px;
  margin-right: 14px;
}

.qn-tagging-raw-files .qn-tagging-report {
  margin-bottom: 14px;
}

.qn-tagging-store {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.qn-tagging-store-head {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-light);
  background: #fbfcfe;
}

.qn-tagging-store-head b {
  display: block;
  margin-bottom: 4px;
}

.qn-tagging-section {
  border-bottom: 1px solid var(--line-light);
}

.qn-tagging-section:last-child {
  border-bottom: 0;
}

.qn-tagging-section summary {
  cursor: pointer;
  padding: 11px 14px;
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
}

.qn-tagging-section-body {
  padding: 0 14px 14px;
}

.qn-tagging-section-body > p {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.qn-tagging-table-wrap {
  max-height: 460px;
  overflow: auto;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
}

.qn-tagging-table {
  width: 100%;
  min-width: 860px;
  border-collapse: collapse;
  font-size: 12px;
}

.qn-tagging-table th,
.qn-tagging-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line-light);
  text-align: left;
  vertical-align: top;
}

.qn-tagging-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #f8fafc;
  color: var(--muted);
  font-weight: 800;
  white-space: nowrap;
}

.qn-tagging-table td {
  max-width: 340px;
  color: var(--regular);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.qn-tagging-pre,
.qn-tagging-report {
  margin: 0;
  max-height: 460px;
  overflow: auto;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #111827;
  color: #e5e7eb;
  font-size: 12px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.qn-tagging-pre {
  background: #f8fafc;
  color: var(--text);
}

.qn-tagging-report-title {
  margin: 18px 0 8px;
  font-size: 15px;
}

.qn-tagging-status,
.qn-tagging-empty {
  color: var(--muted);
  font-size: 14px;
  line-height: 1.6;
}

.qn-tagging-status.error {
  color: var(--danger);
  font-weight: 800;
}

.inventory-mode-tabs button {
  position: relative;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 0;
  color: var(--regular);
  background: #fff;
  font-size: 14px;
  font-weight: 750;
  box-shadow: none;
}

.inventory-mode-tabs button + button {
  border-left: 1px solid var(--line);
}

.inventory-mode-tabs button::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: transparent;
}

.inventory-mode-tabs button.active {
  color: var(--accent);
  background: #fff;
  box-shadow: none;
}

.inventory-mode-tabs button.active::after {
  background: var(--accent);
}

#inventory-auto-panel,
.inventory-auto-panel {
  margin-top: 14px;
}

.inventory-auto-workbench {
  display: grid;
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
  gap: 14px;
}

.inventory-auto-panel.inventory-auto-upload-only .inventory-auto-workbench {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.inventory-auto-panel.inventory-auto-upload-only .inventory-upload-card {
  min-height: 136px;
  padding: 10px 14px;
}

.inventory-auto-panel.inventory-auto-upload-only .inventory-dropzone {
  min-height: 70px;
  padding: 10px 14px;
  gap: 4px;
}

.inventory-auto-panel.inventory-auto-upload-only .drop-icon {
  width: 22px;
  height: 22px;
  font-size: 13px;
}

.inventory-auto-panel.inventory-auto-upload-only .drop-main {
  font-size: 14px;
}

.inventory-auto-panel.inventory-auto-upload-only .drop-meta {
  font-size: 12px;
}

.inventory-auto-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
  box-shadow: var(--shadow-lighter);
}

.inventory-current-card {
  display: grid;
  align-content: center;
  gap: 12px;
}

.inventory-current-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.inventory-current-head h2 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 17px;
  line-height: 1.25;
}

.inventory-current-head p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.inventory-current-progress {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf2;
}

.inventory-current-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

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

.inventory-current-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
}

.inventory-current-step > b {
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: #eef2f7;
  color: #718096;
  font-size: 12px;
  font-weight: 900;
}

.inventory-current-step.active > b {
  background: var(--accent);
  color: #fff;
}

.inventory-current-step.done > b {
  background: #e7f7ef;
  color: #0faf62;
}

.inventory-current-step strong,
.inventory-current-step span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-current-step strong {
  color: var(--text);
  font-size: 13px;
}

.inventory-current-step span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.inventory-current-steps.workflow-steps .inventory-current-step strong,
.inventory-current-steps.workflow-steps .inventory-current-step span {
  overflow: visible;
  text-overflow: initial;
  white-space: normal;
}

.inventory-current-step.active strong {
  color: var(--accent);
}

.inventory-current-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.inventory-current-actions .history-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.3;
  text-decoration: none;
}

.inventory-current-actions .history-action-link:hover {
  border-color: #b7d2ff;
  background: #f3f8ff;
  text-decoration: none;
}

.inventory-current-actions .history-action-link.current-primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.inventory-current-actions .history-action-link.current-primary:hover {
  background: #0958d9;
  color: #fff;
}

.inventory-current-actions .history-action-link.current-secondary {
  border-color: #b7d2ff;
  background: #f7fbff;
  color: var(--accent);
}

.inventory-current-actions .history-action-link.current-disabled,
.inventory-current-actions .history-action-link:disabled {
  border-color: var(--line);
  background: #f6f8fb;
  color: var(--muted);
  cursor: not-allowed;
}

.inventory-current-empty {
  min-height: 72px;
  display: grid;
  place-items: center;
  border: 1px dashed var(--line);
  border-radius: var(--radius-small);
  color: var(--muted);
  font-size: 13px;
}

.inventory-auto-card h2,
.inventory-auto-card .field-label {
  margin: 0 0 10px;
  color: var(--text);
  font-size: 15px;
  font-weight: 800;
}

.inventory-upload-card {
  position: relative;
}

.inventory-upload-card input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.inventory-brand-extract {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 14px;
  border-top: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #f8fafc;
}

.inventory-brand-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.inventory-brand-head > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.inventory-brand-head b {
  color: var(--text);
  font-size: 14px;
}

.inventory-brand-head span {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inventory-brand-empty {
  display: grid;
  gap: 4px;
  min-height: 72px;
  align-content: center;
  padding: 14px;
  border: 1px dashed #cbd5e1;
  border-radius: var(--radius-small);
  background: #fff;
}

.inventory-brand-empty b {
  color: var(--regular);
  font-size: 13px;
}

.inventory-brand-empty span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inventory-brand-rows {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  gap: 10px;
}

.inventory-brand-row {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 14px;
  min-height: 150px;
  padding: 14px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: #fff;
}

.inventory-brand-row.primary {
  border-color: #91caff;
  background: linear-gradient(180deg, #f7fbff 0%, #fff 100%);
  box-shadow: 0 8px 22px rgba(22, 119, 255, 0.08);
}

.inventory-brand-row > div:first-child {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.inventory-brand-title {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.inventory-brand-row b {
  color: var(--text);
  font-size: 14px;
}

.inventory-brand-badge {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  padding: 0 7px;
  border-radius: 999px;
  background: #eef3fb;
  color: var(--regular);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.inventory-brand-row.primary .inventory-brand-badge {
  background: var(--accent-light);
  color: var(--accent);
}

.inventory-brand-count {
  color: var(--text);
  font-size: 24px;
  font-weight: 850;
  line-height: 1.15;
}

.inventory-brand-row p {
  margin: 0;
  color: var(--regular);
  font-size: 12px;
  line-height: 1.55;
}

.inventory-brand-actions {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  flex-wrap: wrap;
}

.inventory-brand-actions button {
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
}

.inventory-brand-actions .primary-action {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.inventory-brand-actions button:hover:not(:disabled) {
  border-color: #91caff;
  background: #f0f7ff;
  color: #0958d9;
}

.inventory-brand-actions .primary-action:hover:not(:disabled) {
  border-color: #0958d9;
  background: #0958d9;
  color: #fff;
}

.inventory-brand-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.inventory-brand-source-panel {
  display: grid;
  gap: 8px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: #fbfcfe;
}

.inventory-brand-source-panel b {
  color: var(--text);
  font-size: 13px;
}

.inventory-brand-source-panel table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.inventory-brand-source-panel th,
.inventory-brand-source-panel td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-light);
  text-align: left;
  vertical-align: top;
}

.inventory-brand-source-panel th {
  color: var(--muted);
  font-weight: 750;
  white-space: nowrap;
}

.inventory-brand-source-panel textarea {
  width: 100%;
  min-height: 140px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-small);
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 12px;
  line-height: 1.6;
}

.inventory-patagonia-upload {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 280px);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: #fff;
}

.inventory-patagonia-upload > div:first-child {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.inventory-patagonia-upload b {
  color: var(--text);
  font-size: 13px;
  font-weight: 800;
}

.inventory-patagonia-upload span {
  color: var(--regular);
  font-size: 12px;
  line-height: 1.55;
}

.inventory-patagonia-upload input[type="file"] {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.inventory-dropzone.compact {
  min-height: 56px;
  padding: 10px 12px;
  gap: 2px;
  border-radius: var(--radius-small);
}

.inventory-dropzone.compact .drop-main {
  font-size: 13px;
}

.inventory-dropzone.compact .drop-meta {
  font-size: 12px;
}

.inventory-history-panel {
  margin-top: 14px;
  padding: 0;
  border: 0;
  box-shadow: none;
  background: transparent;
}

.inventory-history-workbench {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 320px);
  gap: 14px;
  align-items: start;
  margin-top: 12px;
}

.inventory-page-main {
  min-width: 0;
}

.inventory-history-workbench.manual-mode {
  grid-template-columns: 1fr;
}

.inventory-history-workbench .inventory-history-panel {
  margin-top: 12px;
}

.inventory-history-panel .section-head {
  margin: 0 0 8px;
}

.inventory-history-panel .section-head h2 {
  font-size: 18px;
}

.field-label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-weight: 650;
}

.inventory-dropzone {
  display: grid;
  place-items: center;
  justify-items: center;
  align-content: center;
  gap: 8px;
  min-height: 118px;
  padding: 14px;
  border: 1px dashed #aab4c3;
  border-radius: var(--radius-base);
  background: #fbfcfe;
  text-align: center;
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease;
}

.drop-icon {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 2px solid var(--accent);
  border-radius: 999px;
  color: var(--accent);
  font-size: 16px;
  font-weight: 900;
  line-height: 1;
}

.inventory-dropzone:hover,
.inventory-dropzone.dragging,
.inventory-upload-card.dragging .inventory-dropzone {
  border-color: var(--accent);
  background: var(--accent-light);
}

.inventory-dropzone.invalid {
  border-color: var(--danger);
  background: #fff1f0;
}

.drop-main {
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
  line-height: 1.45;
}

.drop-meta {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}

.file-name {
  color: var(--accent);
  font-weight: 650;
}

.inventory-upload-card .file-name {
  display: none;
}

.inventory-upload-file-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: 12px;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fbfcfe;
}

.inventory-upload-file-icon {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: #16a34a;
  color: #fff;
  font-size: 14px;
  font-weight: 900;
}

.inventory-upload-file-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.inventory-upload-file-main b {
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-upload-file-main span,
.inventory-auto-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inventory-upload-state {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  padding: 8px 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: #fff;
}

.inventory-upload-state span {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.inventory-upload-state small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.inventory-upload-state.uploading,
.inventory-upload-state.processing {
  border-color: #b7d2ff;
  background: #f7fbff;
}

.inventory-upload-state.uploaded {
  border-color: #b7eb8f;
  background: #f6ffed;
}

.inventory-upload-state.failed {
  border-color: #ffccc7;
  background: #fff2f0;
}

.inventory-upload-state.failed span {
  color: var(--danger);
}

.inventory-upload-state-track {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf2;
}

.inventory-upload-state-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}

.inventory-upload-file-card button {
  width: 28px;
  height: 28px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 22px;
  line-height: 1;
}

.inventory-auto-note {
  margin: 8px 0 0;
}

.inventory-extract-card {
  display: grid;
  grid-column: 1 / -1;
  align-content: start;
}

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

.inventory-extract-metrics div {
  display: grid;
  gap: 8px;
  min-height: 88px;
  padding: 16px 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
  text-align: center;
}

.inventory-extract-metrics span {
  color: var(--regular);
  font-size: 12px;
}

.inventory-extract-metrics b {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.inventory-extract-metrics b.accent {
  color: var(--accent);
}

.inventory-extract-summary {
  display: grid;
  gap: 8px;
  margin-top: 14px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line-light);
}

.inventory-extract-summary b {
  color: var(--text);
  font-size: 13px;
}

.inventory-extract-summary p {
  margin: 0;
  color: var(--regular);
  font-size: 13px;
  line-height: 1.6;
}

.inventory-extract-controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(220px, 280px);
  gap: 14px;
  align-items: end;
  margin-top: 16px;
}

.inventory-auto-controls {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.inventory-fetch-mode {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.inventory-fetch-mode label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.inventory-fetch-mode select {
  min-width: 220px;
  height: 40px;
  padding: 0 30px 0 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: #fff;
  color: var(--regular);
  font: inherit;
  font-size: 13px;
  font-weight: 650;
}

.hidden-actions {
  display: none;
}

.inventory-fetch-mode select:disabled {
  color: var(--muted);
  background: #f4f6f9;
}

.inventory-auto-summary {
  color: var(--regular);
  font-size: 13px;
  font-weight: 650;
}

.inventory-auto-steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 16px;
}

.inventory-auto-step {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 86px;
  padding: 14px 14px 14px 44px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: var(--fill-light);
}

.inventory-auto-step::before {
  position: absolute;
  top: 14px;
  left: 14px;
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 999px;
  background: #e8edf5;
  color: var(--regular);
  font-size: 12px;
  font-weight: 800;
  content: attr(data-step-index);
}

.inventory-auto-step[data-auto-step="extract"]::before {
  content: "1";
}

.inventory-auto-step[data-auto-step="fetch"]::before {
  content: "2";
}

.inventory-auto-step[data-auto-step="generate"]::before {
  content: "3";
}

.inventory-auto-step b {
  color: var(--text);
  font-size: 14px;
}

.inventory-auto-step span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.inventory-auto-step.active {
  border-color: var(--accent);
  background: var(--accent-light);
}

.inventory-auto-step.active::before {
  background: var(--accent);
  color: #fff;
}

.inventory-auto-step.done {
  border-color: #b7eb8f;
  background: #f6ffed;
}

.inventory-auto-step.done::before {
  background: #52c41a;
  color: #fff;
}

.inventory-auto-progress {
  display: grid;
  gap: 8px;
  margin-top: 16px;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fbfcfe;
}

.inventory-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--regular);
  font-size: 13px;
  font-weight: 650;
  flex-wrap: wrap;
}

.inventory-progress-track {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf2;
}

#inventory-auto-progress-bar {
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}

.inventory-auto-failures {
  color: var(--danger);
  font-size: 13px;
  line-height: 1.5;
  word-break: break-word;
}

.inventory-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  flex-wrap: wrap;
}

#inventory-status {
  color: var(--muted);
  font-size: 14px;
}

#inventory-auto-status {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  font-size: 14px;
}

#inventory-status.error {
  color: var(--danger);
  font-weight: 650;
}

#inventory-auto-status.error {
  color: var(--danger);
  font-weight: 650;
}

#inventory-status.ok {
  color: #237804;
  font-weight: 650;
}

#inventory-auto-status.ok {
  color: #237804;
  font-weight: 650;
}

#inventory-status a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

#inventory-auto-status a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

#inventory-status a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

#inventory-auto-status a:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

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

.inventory-rule-card {
  display: grid;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: var(--fill-light);
}

.inventory-rule-card b {
  color: var(--text);
  font-size: 15px;
}

.inventory-rule-card span {
  color: var(--regular);
  font-size: 13px;
}

.recent-upload-card {
  display: grid;
  min-height: 112px;
  padding: 0 14px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.recent-upload-list {
  display: grid;
}

.recent-upload-header {
  display: grid;
  grid-template-columns: 160px 110px 88px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-light);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.recent-upload-item {
  display: grid;
  grid-template-columns: 160px 110px 88px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px 0;
  border-top: 1px solid var(--line-light);
}

.recent-upload-item:first-child {
  border-top: 0;
  padding-top: 0;
}

.recent-upload-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.recent-upload-time {
  color: var(--text);
  font-size: 13px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.recent-upload-uploader,
.recent-upload-row-count {
  min-width: 0;
  color: var(--regular);
  font-size: 12px;
  font-weight: 750;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-upload-row-count {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.recent-upload-item strong,
.recent-upload-main a {
  color: var(--regular);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.recent-upload-main a:hover {
  color: var(--brand);
  text-decoration: underline;
}

.recent-upload-main span,
.recent-empty {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.inventory-history-list {
  display: grid;
  gap: 12px;
  border: 0;
  background: transparent;
  padding: 0;
}

.inventory-history-empty {
  margin: 0;
  padding: 18px;
  color: var(--muted);
  font-size: 13px;
}

.inventory-history-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line-light);
}

.inventory-history-item:last-child {
  border-bottom: 0;
}

.inventory-history-main {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.inventory-history-title {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.inventory-history-title b {
  color: var(--text);
  font-size: 15px;
}

.inventory-history-chip {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef3fb;
  color: var(--regular);
  font-size: 12px;
  font-weight: 750;
}

.inventory-history-item.running .inventory-history-chip,
.inventory-history-item.queued .inventory-history-chip,
.inventory-history-item.canceling .inventory-history-chip {
  background: var(--accent-light);
  color: var(--accent);
}

.inventory-history-item.done .inventory-history-chip {
  background: #f6ffed;
  color: #237804;
}

.inventory-history-item.error .inventory-history-chip,
.inventory-history-item.canceled .inventory-history-chip {
  background: #fff2f0;
  color: var(--danger);
}

.inventory-history-meta,
.inventory-history-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inventory-history-summary {
  color: var(--regular);
}

.inventory-history-progress {
  display: grid;
  gap: 6px;
  max-width: 720px;
}

.inventory-history-progress-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--regular);
  font-size: 12px;
  font-weight: 650;
}

.inventory-history-progress-track {
  height: 7px;
  overflow: hidden;
  border-radius: 999px;
  background: #e5eaf2;
}

.inventory-history-progress-track span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
}

.inventory-history-actions {
  display: grid;
  justify-items: start;
  align-content: center;
  gap: 8px;
  min-width: 340px;
}

.inventory-history-action-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px 12px;
  flex-wrap: wrap;
}

.inventory-history-action-row.outputs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  width: 100%;
  align-content: center;
}

.inventory-history-summary-item > .inventory-history-action-row.outputs {
  padding: 20px 24px;
}

.inventory-history-action-row.outputs .history-action-link {
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.inventory-history-action-label {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
}

.inventory-history-summary-list .inventory-history-action-label {
  display: none;
}

.inventory-history-empty.table-empty {
  grid-column: 1 / -1;
  padding: 28px 24px;
  border: 0;
}

.inventory-history-action-row.secondary {
  color: var(--muted);
}

.inventory-history-actions .history-action-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
}

.inventory-history-actions .history-action-link:hover {
  background: transparent;
  color: #0958d9;
  text-decoration: underline;
  text-underline-offset: 2px;
  box-shadow: none;
}

.inventory-history-action-row.primary .history-action-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  text-align: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid #b7d2ff;
  border-radius: var(--radius-base);
  background: #f7fbff;
  color: var(--accent);
  font-size: 13px;
  font-weight: 850;
  text-decoration: none;
}

.inventory-history-action-row.primary .history-action-link:hover {
  background: #eaf3ff;
  text-decoration: none;
  box-shadow: 0 2px 8px rgba(22, 119, 255, 0.12);
}

.inventory-history-action-row.primary .history-action-link.output-ready {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.inventory-history-action-row.primary .history-action-link.output-ready:hover {
  background: #0958d9;
  color: #fff;
}

.inventory-history-action-row.primary .history-action-link.output-pending,
.inventory-history-action-row.primary .history-action-link.output-generating,
.inventory-history-action-row.primary .history-action-link.output-unavailable {
  border-color: var(--line);
  background: #f6f8fb;
  color: var(--muted);
}

.inventory-history-action-row.primary .history-action-link.output-generating {
  color: #7c5b00;
  background: #fff8e6;
  border-color: #f0d58a;
}

.inventory-history-action-row.primary .history-action-link:disabled,
.inventory-history-action-row.primary .history-action-link:disabled:hover {
  background: #f6f8fb;
  color: var(--muted);
  text-decoration: none;
  box-shadow: none;
}

.inventory-history-action-row.primary .history-action-link.output-generating:disabled,
.inventory-history-action-row.primary .history-action-link.output-generating:disabled:hover {
  color: #7c5b00;
  background: #fff8e6;
}

.inventory-history-action-row.primary .history-action-link.output-ready.action_list,
.inventory-history-action-row.primary .history-action-link.output-ready.update-detail {
  border-color: #b7d2ff;
  background: #f7fbff;
  color: var(--accent);
}

.inventory-history-action-row.primary .history-action-link.output-ready.action_list:hover,
.inventory-history-action-row.primary .history-action-link.output-ready.update-detail:hover {
  background: #eaf3ff;
  color: var(--accent);
}

.inventory-history-action-row.primary .history-action-link.taobao_template.output-ready,
.inventory-history-action-row.primary .history-action-link.taobao_template.output-available {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.inventory-history-action-row.primary .history-action-link.taobao_template.output-ready:hover,
.inventory-history-action-row.primary .history-action-link.taobao_template.output-available:hover {
  background: #0958d9;
  color: #fff;
}

.inventory-history-action-row.recalculate .history-action-link {
  color: #7b8494;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}

.inventory-history-action-row.recalculate .history-action-link:hover {
  color: #4b5563;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inventory-history-action-row.downloads {
  gap: 6px 12px;
}

.inventory-history-action-row.secondary .history-action-link {
  color: #6b7280;
  font-weight: 650;
  font-size: 12px;
}

.inventory-history-action-row.secondary .history-action-link:hover {
  color: var(--accent-dark);
}

.inventory-history-action-row.detail-toggle {
  padding-top: 1px;
}

.inventory-history-action-row.detail-toggle .history-action-link {
  color: #8c96a6;
  font-size: 12px;
  font-weight: 650;
}

.inventory-history-action-row.detail-toggle .history-action-link:hover {
  color: #4b5563;
}

.inventory-history-actions .history-action-link:disabled {
  color: var(--muted);
  cursor: not-allowed;
  text-decoration: none;
}

.inventory-history-actions .danger-text,
.inventory-history-actions .danger-text:hover {
  color: var(--danger);
}

.inventory-update-detail-main {
  display: grid;
  gap: 14px;
}

.inventory-update-detail-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.inventory-update-filter-area {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  min-width: 0;
}

.inventory-update-brand-tabs {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.inventory-update-brand-tabs button {
  min-width: 96px;
  height: 36px;
  padding: 0 14px;
  border: 0;
  border-right: 1px solid var(--line);
  background: #fff;
  color: var(--regular);
  font: inherit;
  font-size: 13px;
  font-weight: 750;
  cursor: pointer;
}

.inventory-update-brand-tabs button:last-child {
  border-right: 0;
}

.inventory-update-brand-tabs button:hover {
  background: var(--fill-light);
}

.inventory-update-brand-tabs button.active {
  background: var(--accent-light);
  color: var(--accent);
  box-shadow: inset 0 -3px 0 var(--accent);
}

.inventory-update-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.inventory-update-summary span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.inventory-update-summary b {
  color: var(--text);
}

.inventory-update-summary .good,
.inventory-update-direction.increase {
  color: #0f8a47;
}

.inventory-update-summary .bad,
.inventory-update-direction.decrease {
  color: #b42318;
}

.inventory-update-detail-toolbar label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.inventory-update-detail-toolbar input {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  padding: 0 10px;
  font: inherit;
}

.inventory-update-detail-list {
  display: grid;
  gap: 12px;
}

.inventory-update-direction-board {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.inventory-update-direction-lane {
  overflow: hidden;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-large);
  background: #fff;
}

.inventory-update-direction-lane.increase {
  box-shadow: inset 4px 0 0 #18a85c;
}

.inventory-update-direction-lane.decrease {
  box-shadow: inset 4px 0 0 var(--danger);
}

.inventory-update-lane-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 64px;
  padding: 14px 16px 14px 20px;
  border-bottom: 1px solid var(--line-light);
}

.inventory-update-lane-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 22px;
  font-weight: 850;
}

.inventory-update-lane-head p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.inventory-update-lane-count {
  flex: 0 0 auto;
  min-height: 26px;
  padding: 4px 9px;
  border-radius: var(--radius-base);
  background: #f6f8fb;
  color: var(--regular);
  font-size: 12px;
  font-weight: 750;
}

.inventory-update-direction-lane.increase .inventory-update-lane-count {
  background: #eefbf4;
  color: #0f8a47;
}

.inventory-update-direction-lane.decrease .inventory-update-lane-count {
  background: #fff1f0;
  color: #b42318;
}

.inventory-update-lane-body {
  display: grid;
}

.inventory-update-lane-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 86px;
  gap: 12px;
  align-items: start;
  min-height: 108px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-light);
}

.inventory-update-lane-row:last-child {
  border-bottom: 0;
}

.inventory-update-lane-row .inventory-update-thumb {
  width: 54px;
  height: 54px;
}

.inventory-update-row-main {
  min-width: 0;
}

.inventory-update-row-main h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-update-row-main p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-update-brand {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: var(--radius-base);
  font-size: 12px;
  font-weight: 800;
}

.inventory-update-brand.montbell {
  background: #e6f4ff;
  color: #0958d9;
}

.inventory-update-brand.patagonia {
  background: #fff4d6;
  color: #8a5300;
}

.inventory-update-sku-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.inventory-update-sku-pill {
  display: inline-grid;
  gap: 1px;
  max-width: 180px;
  min-height: 30px;
  padding: 4px 8px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--text);
}

.inventory-update-sku-pill b {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
  line-height: 16px;
  font-weight: 750;
}

.inventory-update-sku-pill small {
  color: var(--muted);
  font-size: 11px;
  line-height: 14px;
}

.inventory-update-more-sku {
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  min-height: 30px;
  padding: 0 4px;
}

.inventory-update-more-sku:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.inventory-update-row-action {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.inventory-update-lane-empty {
  margin: 0;
  border: 0;
  border-radius: 0;
}

.inventory-update-item {
  display: grid;
  gap: 12px;
}

.inventory-update-item-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
}

.inventory-update-thumb {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #f8fafc;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.inventory-update-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inventory-update-thumb.empty {
  background: #f1f5f9;
}

.inventory-update-item-title {
  min-width: 0;
}

.inventory-update-item-title h2 {
  margin: 4px 0 3px;
  color: var(--text);
  font-size: 16px;
  line-height: 1.35;
  font-weight: 850;
}

.inventory-update-item-title p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.inventory-update-item-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.inventory-update-item-meta strong {
  color: var(--accent);
  font-size: 15px;
}

.inventory-update-item-stats {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
  max-width: 260px;
}

.inventory-update-item-stats span {
  min-height: 26px;
  padding: 4px 8px;
  border-radius: var(--radius-base);
  background: #f6f8fb;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.inventory-update-item-stats .good {
  background: #eefbf4;
  color: #0f8a47;
}

.inventory-update-item-stats .bad {
  background: #fff1f0;
  color: #b42318;
}

.inventory-update-sku-table {
  overflow-x: auto;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
}

.inventory-update-sku-table .data-table {
  min-width: 860px;
  border: 0;
}

.inventory-update-sku-table .data-table th,
.inventory-update-sku-table .data-table td {
  white-space: normal;
  vertical-align: top;
}

.inventory-update-sku-name {
  color: var(--text);
  font-weight: 750;
}

.inventory-update-sku-name + small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.inventory-update-direction {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: var(--radius-base);
  background: #f6f8fb;
  font-size: 12px;
  font-weight: 800;
}

.inventory-history-summary-list {
  --inventory-history-columns: minmax(230px, 1.15fr) minmax(112px, 0.48fr) minmax(210px, 0.82fr) minmax(104px, 0.4fr);
  display: grid;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
  overflow: hidden;
}

.inventory-history-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 14px;
}

.inventory-history-filters button {
  min-width: 72px;
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--regular);
  font-size: 13px;
  font-weight: 800;
}

.inventory-history-filters button.active {
  border-color: #b7d2ff;
  background: #f3f8ff;
  color: var(--accent);
  box-shadow: inset 0 0 0 1px #d6e7ff;
}

.inventory-history-filters button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.inventory-history-table-head {
  display: grid;
  grid-template-columns: var(--inventory-history-columns);
  min-height: 38px;
  border-bottom: 1px solid var(--line-light);
  background: #fbfcfe;
}

.inventory-history-table-head span {
  display: flex;
  align-items: center;
  padding: 0 16px;
  color: #8b95a5;
  font-size: 12px;
  font-weight: 800;
}

.inventory-history-table-head span + span {
  border-left: 1px solid var(--line-light);
}

.inventory-history-summary-list.older {
  opacity: 0.92;
}

.inventory-history-summary-item {
  display: grid;
  grid-template-columns: var(--inventory-history-columns);
  align-items: stretch;
  min-height: 138px;
  padding: 0;
  border-top: 1px solid var(--line-light);
}

.inventory-history-summary-item:first-child {
  border-top: 0;
}

.inventory-history-summary-item.warning {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.045), #fff 46%);
}

.inventory-history-summary-item.selected {
  background: #fbfdff;
  box-shadow: inset 3px 0 0 var(--accent);
}

.inventory-history-summary-item.muted {
  min-height: 138px;
}

.inventory-history-summary-main {
  display: grid;
  align-content: center;
  gap: 7px;
  min-width: 0;
  padding: 20px 24px;
}

.inventory-history-summary-item > * + * {
  border-left: 1px solid var(--line-light);
}

.inventory-history-summary-headline,
.inventory-history-summary-metrics {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 8px 14px;
  flex-wrap: wrap;
}

.inventory-history-summary-meta,
.inventory-history-summary-file,
.inventory-history-summary-owner {
  min-width: 0;
  overflow: hidden;
  color: #7f8a9c;
  font-size: 12px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-history-summary-owner {
  color: #6f7a8c;
}

.inventory-history-summary-headline i {
  display: inline-block;
  flex: 0 0 auto;
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: #16a34a;
}

.inventory-history-summary-headline i.warn {
  background: #f59e0b;
}

.inventory-history-summary-headline b {
  color: var(--text);
  font-size: 14px;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-history-summary-headline span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.inventory-history-state-badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: #eef3fb;
  color: var(--regular);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.inventory-history-state-badge.ok {
  background: #f0fdf4;
  color: #15803d;
}

.inventory-history-state-badge.warning {
  background: #fff7ed;
  color: #b45309;
}

.inventory-history-state-badge.bad {
  background: #fff1f0;
  color: var(--danger);
}

.inventory-history-state-badge.pending,
.inventory-history-state-badge.running {
  background: var(--accent-light);
  color: var(--accent);
}

.inventory-history-summary-metrics {
  color: var(--regular);
  font-size: 12px;
  justify-content: flex-start;
}

.inventory-history-metric-cards {
  display: grid;
  align-content: center;
  gap: 8px;
  min-width: 0;
  padding: 20px 24px;
}

.inventory-history-metric-card {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.inventory-history-metric-card span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
}

.inventory-history-metric-card b {
  color: var(--text);
  font-size: 13px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.inventory-history-metric-card b.ok {
  color: #15803d;
}

.inventory-history-metric-card b.bad {
  color: var(--danger);
}

.inventory-history-metric-card .retry-inline {
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8c96a6;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.2;
}

.inventory-history-metric-card .retry-inline:hover {
  background: transparent;
  color: #4b5563;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inventory-history-summary-metrics span,
.inventory-history-failure-inline {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  min-width: 0;
  white-space: nowrap;
}

.inventory-history-summary-metrics .ok {
  color: #15803d;
  font-weight: 750;
}

.inventory-history-failure-inline b {
  color: var(--regular);
  font-size: 12px;
  font-weight: 750;
}

.inventory-history-failure-inline b.bad {
  color: var(--danger);
}

.inventory-history-failure-inline .retry-inline {
  display: inline-flex;
  align-items: baseline;
  height: auto;
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8c96a6;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
}

.inventory-history-failure-inline .retry-inline:hover {
  background: transparent;
  color: #4b5563;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inventory-history-detail-panel {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px 18px;
  margin-top: -2px;
  padding: 12px 14px;
  border-top: 1px dashed var(--line);
  background: #fbfcfe;
}

.inventory-history-summary-item > .inventory-history-detail-panel {
  border-left: 0;
}

.inventory-history-support-actions {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 6px;
  min-width: 0;
}

.inventory-history-summary-item > .inventory-history-support-actions {
  padding: 20px 16px;
}

.inventory-history-support-actions .inventory-history-action-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.inventory-history-support-actions .history-action-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #6b7280;
  font-size: 12px;
  font-weight: 650;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
  box-shadow: none;
}

.inventory-history-support-actions .history-action-link:hover {
  background: transparent;
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  box-shadow: none;
}

.inventory-history-support-actions .danger-text,
.inventory-history-support-actions .danger-text:hover {
  color: var(--danger);
}

.inventory-task-detail-panel {
  display: grid;
  gap: 11px;
  position: sticky;
  top: 16px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.inventory-task-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line-light);
}

.inventory-task-detail-head h3 {
  margin: 0 0 6px;
  color: var(--text);
  font-size: 16px;
}

.inventory-task-detail-head p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inventory-task-detail-metrics,
.inventory-update-preview-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.inventory-task-detail-metric {
  display: grid;
  gap: 4px;
  padding: 7px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: #fbfcfe;
}

.inventory-task-detail-metric span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.inventory-task-detail-metric b {
  color: var(--text);
  font-size: 14px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
}

.inventory-task-detail-metric b.ok {
  color: #15803d;
}

.inventory-task-detail-metric b.bad {
  color: var(--danger);
}

.inventory-task-detail-section {
  display: grid;
  gap: 8px;
}

.inventory-task-detail-section h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
}

.inventory-task-detail-files {
  display: grid;
  gap: 7px;
}

.inventory-task-detail-file {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 8px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: #fff;
}

.inventory-task-detail-file b,
.inventory-update-preview-item b {
  display: block;
  color: var(--text);
  font-size: 12px;
  font-weight: 850;
}

.inventory-task-detail-file span,
.inventory-update-preview-item span {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.inventory-task-detail-file span {
  display: none;
}

.inventory-task-detail-file .history-action-link {
  justify-content: center;
  min-width: 72px;
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid #b7d2ff;
  border-radius: var(--radius-small);
  background: #f7fbff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  text-decoration: none;
}

.inventory-task-detail-file .history-action-link.taobao_template.output-ready,
.inventory-task-detail-file .history-action-link.taobao_template.output-available {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.inventory-task-detail-file .history-action-link:disabled {
  border-color: var(--line);
  background: #f6f8fb;
  color: var(--muted);
}

.inventory-update-preview-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.inventory-update-preview-item {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  min-width: 0;
  min-height: 38px;
  padding: 5px 6px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: #fff;
}

.inventory-update-preview-item b,
.inventory-update-preview-item span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-update-preview-thumb {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid var(--line-light);
  border-radius: 7px;
  background: #f8fafc;
  overflow: hidden;
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
}

.inventory-update-preview-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.inventory-update-preview-thumb.empty {
  background: #f1f5f9;
}

.inventory-update-preview-more {
  justify-self: start;
  margin-top: 7px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.inventory-update-preview-more:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.inventory-task-detail-empty {
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-small);
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.inventory-task-detail-empty b {
  color: var(--text);
  font-size: 14px;
}

.inventory-task-detail-empty.error {
  border-color: #ffccc7;
  background: #fff2f0;
  color: var(--danger);
}

.inventory-history-detail-panel div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.inventory-history-detail-panel span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-history-detail-panel b {
  min-width: 0;
  color: var(--regular);
  font-size: 12px;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.inventory-history-more-toggle {
  justify-self: start;
  width: fit-content;
  min-height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 13px;
  font-weight: 750;
}

.inventory-history-more-toggle:hover {
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
  background: transparent;
}

.inventory-active-task {
  min-width: 0;
  overflow: hidden;
  border: 1px solid #8fb9ff;
  border-radius: var(--radius-base);
  background: linear-gradient(180deg, #f7fbff 0%, #fff 100%);
}

.inventory-active-task.queued {
  border-color: #d9e3f0;
  background: #fbfcfe;
}

.inventory-active-task.canceling {
  border-color: #f0d58a;
  background: #fffaf0;
}

.inventory-active-task-head {
  display: flex;
  align-items: center;
  min-height: 38px;
  padding: 0 16px;
  border-bottom: 1px solid #cfe1ff;
  color: var(--accent);
  font-size: 13px;
}

.inventory-active-task-body {
  display: grid;
  grid-template-columns: minmax(220px, 1.15fr) minmax(180px, 0.9fr) minmax(150px, 0.7fr) minmax(180px, 0.8fr);
  align-items: center;
  gap: 14px;
  min-height: 86px;
  padding: 14px 16px;
}

.inventory-active-task-body .inventory-history-actions {
  width: 100%;
  min-width: 0;
  justify-items: stretch;
}

.inventory-active-task-body .inventory-history-action-row.outputs,
.inventory-active-task-body .inventory-history-support-actions {
  padding: 0;
}

.inventory-active-info {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.inventory-active-status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--accent);
  font-size: 13px;
}

.inventory-active-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-light);
}

.inventory-active-task.queued .inventory-active-dot {
  background: #94a3b8;
  box-shadow: 0 0 0 4px #eef3fb;
}

.inventory-active-task.canceling .inventory-active-dot {
  background: #f59e0b;
  box-shadow: 0 0 0 4px #fff7ed;
}

.inventory-active-file {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.inventory-active-file b {
  color: var(--text);
  font-size: 13px;
  overflow-wrap: anywhere;
}

.inventory-active-file span,
.inventory-active-progress span,
.inventory-active-stats span {
  color: var(--muted);
  font-size: 12px;
}

.inventory-active-progress {
  display: grid;
  gap: 6px;
}

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

.inventory-active-stats div {
  display: grid;
  gap: 3px;
}

.inventory-active-stats b {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.inventory-active-stats b.ok {
  color: #16a34a;
}

.inventory-active-stats b.bad {
  color: var(--danger);
}

.inventory-history-group-title {
  padding: 2px 4px 0;
  color: var(--regular);
  font-size: 13px;
  font-weight: 750;
}

.inventory-history-table {
  overflow-x: auto;
  overflow-y: hidden;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
}

.inventory-history-table-row {
  display: grid;
  grid-template-columns: 112px minmax(220px, 1fr) 70px 88px 58px 96px 86px 82px 112px minmax(250px, 290px);
  align-items: center;
  gap: 10px;
  min-width: 1220px;
  min-height: 58px;
  padding: 9px 12px;
  border-top: 1px solid var(--line-light);
  color: var(--regular);
  font-size: 12px;
}

.inventory-history-table-row:first-child {
  border-top: 0;
}

.inventory-history-table-head {
  min-height: 36px;
  padding-top: 0;
  padding-bottom: 0;
  background: #fbfcfe;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.inventory-history-table-row > span {
  min-width: 0;
}

.inventory-history-table-row > span:not(.history-cell-task):not(.history-cell-file):not(.history-cell-actions):not(.history-cell-failure) {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-cell-task,
.history-cell-file {
  overflow: visible;
  white-space: normal;
  overflow-wrap: anywhere;
  line-height: 1.42;
}

.history-cell-actions {
  overflow: visible;
  white-space: normal;
}

.inventory-history-table-head .history-cell-actions {
  text-align: center;
}

.history-cell-failure {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  overflow: visible;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.history-cell-failure .bad {
  color: var(--danger);
}

.inventory-table-status {
  display: inline-flex;
  align-items: flex-start;
  gap: 7px;
  line-height: 1.42;
}

.inventory-table-status i {
  display: inline-block;
  flex: 0 0 auto;
  margin-top: 1px;
  width: 14px;
  height: 14px;
  border-radius: 999px;
  background: #16a34a;
}

.inventory-table-status i.warn {
  background: #f59e0b;
}

.history-cell-actions .inventory-history-actions {
  justify-content: flex-start;
  justify-items: start;
  gap: 5px;
  align-content: center;
}

.history-cell-actions .inventory-history-action-row {
  justify-content: flex-start;
}

.history-cell-actions .inventory-history-actions .history-action-link {
  white-space: nowrap;
}

.inventory-listing-alert {
  display: grid;
  gap: 8px;
  min-width: 1220px;
  padding: 10px 12px 12px 132px;
  border-top: 1px solid var(--line-light);
  background: #f7fff9;
}

.inventory-listing-alert > b {
  color: #15803d;
  font-size: 13px;
}

.inventory-listing-alert-list {
  display: grid;
  gap: 6px;
}

.inventory-listing-alert-item {
  display: grid;
  grid-template-columns: 150px minmax(360px, 1fr) 160px;
  align-items: center;
  gap: 12px;
  color: var(--regular);
  font-size: 12px;
}

.inventory-listing-alert-item span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.inventory-listing-alert-item strong {
  color: #15803d;
  font-variant-numeric: tabular-nums;
}

.history-cell-failure .retry-inline {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8c96a6;
  font-size: 12px;
  line-height: 1.35;
}

.history-cell-failure .retry-inline:hover {
  background: transparent;
  color: #4b5563;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.report-status-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.report-flow-panel {
  position: sticky;
  top: 0;
  z-index: 12;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: -4px 0 18px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow-lighter);
  backdrop-filter: blur(10px);
}

.final-save-rail {
  position: sticky;
  top: 18px;
  z-index: 11;
  display: grid;
  align-content: start;
  gap: 14px;
  min-width: 0;
  max-height: calc(100vh - 36px);
  padding: 16px;
  border: 1px solid rgba(22, 119, 255, 0.28);
  border-radius: var(--radius-base);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-light);
  overflow: hidden;
  overscroll-behavior: contain;
}

.final-rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-light);
}

.final-rail-head .step-state {
  align-self: flex-start;
  margin-top: 0;
}

.final-rail-head h2 {
  margin: 0;
  font-size: 18px;
}

.final-rail-meta {
  display: grid;
  gap: 4px;
  margin-top: 8px;
}

.final-rail-meta span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 238px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.65;
}

.final-rail-meta b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.final-rail-body {
  min-height: 0;
  max-height: calc(100vh - 238px);
  overflow: auto;
  padding-right: 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.final-rail-section {
  display: grid;
  gap: 10px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line-light);
}

.final-rail-section:last-child {
  margin-bottom: 0;
}

.final-detail-toggle {
  width: 100%;
}

.final-detail-list.hidden {
  display: none;
}

.final-condition-list {
  display: grid;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.final-condition-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 38px;
  border-bottom: 1px solid var(--line-light);
}

.final-condition-row:last-child {
  border-bottom: 0;
}

.final-condition-row span {
  color: var(--regular);
  font-size: 13px;
}

.final-condition-row b {
  color: var(--text);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.final-condition-row b.ok {
  color: var(--text);
}

.final-condition-row b.warn {
  color: #b45309;
}

.final-condition-row b.todo {
  color: var(--muted);
}

.rail-buttons,
.rail-buttons button {
  width: 100%;
}

.rail-buttons {
  display: grid;
  justify-content: stretch;
  position: static;
  margin: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-light);
  background: #fff;
}

.final-summary-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.final-summary-list .summary-card {
  padding: 12px;
}

.final-summary-list .summary-card:not(.final-profit-card) {
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.final-summary-list .summary-card > span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.final-summary-list .summary-card strong {
  margin-bottom: 8px;
  font-size: 15px;
}

.final-profit-card {
  border: 1px solid #b7e6dc;
  border-radius: var(--radius-base);
  background: #f0fbf8;
}

.final-profit-card b {
  display: block;
  margin-top: 6px;
  color: #0f766e;
  font-size: 26px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.final-mini-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.final-mini-metrics .summary-card b {
  display: block;
  margin-top: 6px;
  font-size: 20px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.final-summary-list .metric {
  display: flow-root;
  min-height: 0;
  padding: 8px 0;
  border: 0;
  border-bottom: 1px solid var(--line-light);
  border-radius: 0;
  background: transparent;
}

.final-summary-list .metric:last-child {
  border-bottom: 0;
}

.final-summary-list .metric span {
  display: inline-block;
  color: var(--regular);
  font-size: 13px;
}

.final-summary-list .metric b {
  float: right;
  margin-top: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.5;
  font-variant-numeric: tabular-nums;
}

.final-summary-list .metric.warn {
  margin-top: 6px;
  padding: 8px 10px;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-base);
  background: #fff7ed;
}

.final-summary-list .wide-summary {
  grid-column: auto;
}

.other-fee-detail-list {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid var(--line-light);
}

.other-fee-detail-list strong {
  display: block;
  margin-bottom: 4px;
}

.final-summary-list .mini-table {
  font-size: 12px;
}

.final-summary-list .mini-table th,
.final-summary-list .mini-table td {
  padding: 8px 6px;
}

.flow-step {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  align-items: center;
  gap: 2px 10px;
  min-height: 56px;
  height: auto;
  padding: 8px 10px;
  border-color: var(--line-light);
  background: #fff;
  color: var(--regular);
  text-align: left;
  box-shadow: none;
}

.flow-step:hover,
.flow-step:focus-visible {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--text);
  outline: none;
}

.flow-step span {
  grid-row: span 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-round);
  background: var(--fill);
  color: var(--muted);
  font-weight: 750;
}

.flow-step b,
.flow-step small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.flow-step b {
  color: var(--text);
  font-size: 14px;
}

.flow-step small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.flow-step.done span,
.step-state.done {
  background: var(--fill);
  color: var(--regular);
}

.flow-step.warn span,
.step-state.warn {
  background: #fff7ed;
  color: #b45309;
}

.flow-step.todo span,
.step-state.todo {
  background: var(--fill);
  color: var(--muted);
}

.status-card {
  min-height: 96px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.status-card small {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.status-card b {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
}

.status-card span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.status-card.done {
  border-color: var(--line);
  background: #fff;
}

.status-card.warn {
  border-color: #fed7aa;
  background: #fff7ed;
}

.status-card.todo {
  background: var(--fill-light);
}

.uploaded-file-card {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: var(--fill-light);
  font-size: 13px;
}

.uploaded-file-card > div {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.uploaded-file-card span {
  color: var(--muted);
  white-space: nowrap;
}

.uploaded-file-card a {
  color: var(--accent);
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.uploaded-file-card small {
  color: var(--muted);
  font-size: 13px;
}

.upload-result-card {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid #91caff;
  border-radius: var(--radius-base);
  background: #f5faff;
}

.upload-result-card strong {
  font-size: 14px;
}

.upload-result-card small {
  color: var(--muted);
}

.upload-result-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 8px 12px;
}

.upload-result-grid span {
  color: var(--muted);
  font-size: 13px;
}

.upload-result-grid b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.result-stack {
  display: grid;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  overflow: hidden;
}

.result-overview {
  display: grid;
  grid-template-columns: 1.35fr 1fr 1fr;
  gap: 12px;
  padding: 16px;
  background: #fff;
}

.result-kpi {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: var(--fill-light);
}

.result-kpi.primary {
  border-color: #91caff;
  background: #f5faff;
}

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

.result-kpi b {
  color: var(--text);
  font-size: 24px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.result-section {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px 18px 18px 26px;
  border-top: 1px solid var(--line-light);
  background: #fff;
}

.result-section::before {
  content: "";
  position: absolute;
  left: 15px;
  top: 18px;
  bottom: 18px;
  width: 2px;
  border-radius: 999px;
  background: #1677ff;
}

.result-section-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}

.result-section-head > span {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  margin-top: 7px;
  border-radius: 999px;
  background: #1677ff;
  box-shadow: 0 0 0 4px #e6f4ff;
}

.result-section-head h3 {
  margin: 0;
  font-size: 16px;
}

.result-section-head p {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.result-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
}

.result-tag.warning {
  color: #ad6800;
  border: 1px solid #ffd591;
  background: #fff7e6;
}

.result-tag.danger {
  color: #cf1322;
  border: 1px solid #ffa39e;
  background: #fff1f0;
}

.result-descriptions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  overflow: hidden;
}

.result-desc-item {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 46px;
  padding: 11px 12px;
  border-right: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
  background: #fff;
}

.result-desc-item:nth-child(4n) {
  border-right: 0;
}

.result-desc-item.strong {
  background: #f5faff;
}

.result-desc-item span {
  color: var(--muted);
  font-size: 13px;
}

.result-desc-item b {
  color: var(--text);
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.result-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
}

.result-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

.result-table th,
.result-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-light);
  text-align: right;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.result-table th {
  color: var(--muted);
  background: var(--fill-light);
  font-weight: 650;
}

.result-table th:first-child,
.result-table td:first-child {
  text-align: left;
}

  .result-table tbody tr:last-child td {
    border-bottom: 0;
  }

@media (max-width: 1180px) {
  .commission-edit-layout {
    grid-template-columns: 1fr;
  }

  .commission-basic-panel .commission-basic-grid,
  .commission-metric-strip {
    grid-template-columns: 1fr;
  }

  .commission-metric-money,
  .commission-metric-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commission-process-panel .module-title {
    display: grid;
  }

  .commission-process-panel .module-actions {
    margin-left: 0;
  }

  .commission-row {
    align-items: stretch;
    grid-template-columns: minmax(220px, 1fr) minmax(260px, 1fr);
  }

  .commission-row > div:first-child {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .commission-group {
    grid-column: 2;
  }

  .commission-group.adjustment {
    grid-template-columns: 1fr;
  }

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

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

  .commission-row .card-link {
    grid-column: auto;
    grid-row: auto;
  }
}

.compact-drop {
  min-width: 0;
  width: 100%;
  height: 36px;
  justify-content: flex-start;
  font-size: 13px;
}

.drop-zone.adult-product-drop-zone {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  min-height: 182px;
  height: auto;
  padding: 24px;
  border-color: #91caff;
  border-radius: var(--radius-large);
  background: #fbfdff;
  color: var(--text);
}

.drop-zone.adult-product-drop-zone.drag-over,
.drop-zone.adult-product-drop-zone.dragover,
.drop-zone.adult-product-drop-zone:hover,
.drop-zone.adult-product-drop-zone:focus-within {
  border-color: var(--accent);
  background: #f0f7ff;
  color: var(--text);
}

.drop-zone.adult-product-drop-zone .adult-product-upload-icon {
  color: var(--accent);
}

.adult-product-diff-card,
.adult-product-diff-card strong {
  color: var(--text);
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.workflow-strip,
.store-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.ant-steps {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-bottom: 18px;
  padding: 16px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.ant-step {
  position: relative;
  display: grid;
  justify-items: center;
  gap: 8px;
  min-width: 0;
  text-align: center;
  color: var(--muted);
}

.ant-step:not(:last-child)::after {
  content: "";
  position: absolute;
  top: 12px;
  left: calc(50% + 20px);
  right: calc(-50% + 20px);
  height: 1px;
  background: var(--line-light);
}

.ant-step-icon {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.ant-step-content {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0 8px;
}

.ant-step-content b {
  color: var(--regular);
  font-weight: 600;
}

.ant-step-content small {
  color: var(--muted);
  font-size: 12px;
}

.ant-step.active .ant-step-icon {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent);
  color: #fff;
}

.ant-step.active .ant-step-content b {
  color: var(--accent);
}

.ant-step.done .ant-step-icon {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.ant-step.done .ant-step-content b {
  color: var(--text);
}

.ant-step.done:not(:last-child)::after {
  background: var(--accent);
}

.workflow-chip,
.store-tab {
  height: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-round);
  padding: 0 14px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  transition: all 0.16s ease;
}

.workflow-chip.active,
.store-tab.active {
  border-color: #a0cfff;
  background: var(--accent-light);
  color: var(--accent);
}

.workflow-chip.done {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: var(--ok);
}

.store-tab {
  cursor: pointer;
}

.store-tab:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.step {
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  padding: 12px;
  background: #fff;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.step.active {
  border-color: #a0cfff;
  background: var(--accent-light);
  color: var(--accent);
}

.step.done {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: var(--ok);
}

.grid {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 18px;
}

.step-module {
  display: grid;
  gap: 16px;
  scroll-margin-top: 92px;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

.step-module.is-highlighted {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 119, 255, 0.12);
}

.module-title {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.module-title > div {
  flex: 1 1 auto;
  min-width: 0;
}

.module-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 28px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
}

.step-state {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  min-height: 24px;
  padding: 0 9px;
  border-radius: var(--radius-round);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.muted-index {
  background: var(--fill);
  color: var(--muted);
}

.fill-items-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
  gap: 10px;
  align-items: end;
}

.fill-items-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.fill-items-grid label.hidden {
  display: none;
}

.fill-items-grid .rate-field {
  grid-column: span 1;
}

.report-fee-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr)) auto;
  align-items: end;
}

.report-fee-grid .shipping-mode-field {
  width: auto;
}

.other-fee-section {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  min-width: 0;
}

.other-fee-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.other-fee-head h3 {
  margin: 0;
  font-size: 15px;
}

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

.fill-ledger-group {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: #fff;
}

.fill-ledger-group h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.25;
}

.fill-group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

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

.fill-ledger-form label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.fill-ledger-form label.hidden {
  display: none;
}

.shipping-mode-field {
  width: 220px;
}

.other-fee-ledger {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
}

.other-fee-ledger table {
  width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
}

.other-fee-ledger th,
.other-fee-ledger td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-light);
  text-align: left;
}

.other-fee-ledger th {
  background: var(--fill);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.other-fee-ledger td:first-child {
  width: 150px;
}

.other-fee-ledger th:nth-child(3),
.other-fee-ledger td:nth-child(3) {
  width: 82px;
  text-align: center;
}

.other-fee-ledger th:nth-child(4),
.other-fee-ledger td:nth-child(4) {
  width: 138px;
}

.other-fee-ledger th:last-child,
.other-fee-ledger td:last-child {
  width: 68px;
  text-align: center;
}

.other-fee-ledger input {
  min-height: 34px;
  font-size: 14px;
}

.other-fee-ledger input[readonly] {
  background: var(--fill);
  color: var(--regular);
  cursor: default;
}

.other-fee-ledger select {
  width: 100%;
  min-height: 34px;
  font-size: 14px;
}

.other-fee-ledger select:disabled {
  background: var(--fill);
  color: var(--muted);
  cursor: not-allowed;
  opacity: 0.72;
}

.other-fee-split-check {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 34px;
  color: var(--regular);
  font-size: 13px;
  font-weight: 650;
}

.other-fee-split-check input {
  width: 16px;
  height: 16px;
  min-height: 0;
  margin: 0;
  accent-color: var(--accent);
  flex: 0 0 auto;
}

.system-other-fee-row {
  background: #fafcff;
}

.system-fee-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: var(--radius-round);
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.other-fee-total {
  display: flex;
  justify-content: flex-end;
  gap: 14px;
  padding: 13px 16px;
  background: #fff;
  font-weight: 750;
}

.other-fee-total b {
  color: var(--accent);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.fill-ledger-actions {
  display: flex;
  justify-content: flex-end;
}

.module-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.stacked-actions {
  align-items: stretch;
  flex-direction: column;
}

.module-actions .inline-form {
  flex: 1 1 420px;
  margin-bottom: 0;
}

.upload-primary {
  margin: 0;
}

.upload-primary .drop-zone {
  width: 100%;
  height: 64px;
  justify-content: center;
}

.upload-primary .drop-zone:focus-visible {
  outline: 3px solid rgba(22, 119, 255, 0.22);
  outline-offset: 2px;
}

.drop-zone.is-uploading {
  border-color: var(--accent);
  background: var(--accent-light);
}

.secondary-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.link-button {
  height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-weight: 500;
}

.link-button:hover {
  background: transparent;
  color: var(--accent-dark);
}

.link-button:disabled {
  color: var(--muted);
}

.sub-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.manual-status-grid {
  margin-top: 16px;
}

.manual-priority-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 16px;
}

.manual-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.manual-task-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 12px;
}

.manual-task-card {
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  min-height: 184px;
  height: 100%;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: var(--fill-light);
  overflow: hidden;
}

.manual-task-card.primary {
  border-color: #91caff;
  background: #fbfdff;
}

.compact-manual-card.missing-price-panel {
  grid-column: 1 / -1;
  margin-bottom: 0;
  border-color: var(--line);
  background: var(--fill-light);
}

.compact-manual-card.missing-price-panel .missing-price-list {
  max-height: 440px;
  overflow: auto;
  padding-right: 4px;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.compact-manual-card .manual-group-head {
  gap: 10px;
  min-height: 0;
  padding-bottom: 8px;
}

.compact-manual-card .manual-group-head h3 {
  font-size: 15px;
}

.compact-manual-card .manual-group-head p {
  margin-top: 3px;
  font-size: 12px;
  line-height: 1.45;
}

.compact-manual-card .count-list-row {
  min-height: 30px;
  font-size: 13px;
}

.compact-count-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

#filtered-summary-list.compact-count-list {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.compact-count-list .count-list-row {
  display: grid;
  gap: 2px;
  min-height: 46px;
  padding: 6px 8px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: rgba(255, 255, 255, 0.72);
}

.compact-count-list .count-list-row span,
.compact-count-list .count-list-row b {
  font-size: 12px;
}

.compact-count-list .count-list-row div {
  justify-content: flex-start;
}

.compact-count-list .filtered-count-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  min-height: 56px;
}

.compact-count-list .count-list-label {
  display: grid;
  min-width: 0;
  gap: 2px;
  color: var(--regular);
}

.compact-count-list .count-list-label strong {
  overflow: hidden;
  color: var(--regular);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-count-list .count-list-label small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-count-list .ant-alert {
  grid-column: 1 / -1;
}

.manual-action-panel {
  display: grid;
  gap: 10px;
}

.manual-action-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 14px;
}

.primary-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: var(--radius-base);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
}

.primary-action-link:hover {
  background: var(--accent-dark);
  color: #fff;
}

.primary-action-link.is-disabled,
.manual-action-links .is-disabled {
  cursor: not-allowed;
  opacity: 0.48;
  pointer-events: none;
}

.manual-legacy-panel {
  margin-top: 2px;
  padding-top: 8px;
  border-top: 1px dashed var(--line);
}

.manual-legacy-panel summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 20px;
}

.manual-legacy-panel[open] summary {
  margin-bottom: 8px;
}

.manual-legacy-content {
  display: grid;
  gap: 8px;
}

.compact-manual-card .ant-alert {
  min-height: 38px;
  padding: 9px 10px;
  font-size: 13px;
}

.compact-manual-card .ant-alert.success {
  border-color: var(--line);
  background: #fff;
}

.compact-manual-card .upload-primary .drop-zone {
  min-height: 38px;
  height: 38px;
  padding: 8px 10px;
  font-size: 13px;
}

.manual-group-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.manual-group-card.primary {
  border-color: #91caff;
  background: #f5faff;
}

.missing-price-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid #ffd591;
  border-radius: var(--radius-base);
  background: #fffaf0;
}

.manual-group-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-light);
}

.manual-group-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.manual-group-head h3 span {
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.manual-group-head p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.count-list {
  display: grid;
}

.count-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 44px;
  border-bottom: 1px solid var(--line-light);
}

.count-list-row:last-child {
  border-bottom: 0;
}

.count-list-row span {
  color: var(--regular);
  font-weight: 500;
}

.count-list-row div {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.count-list-row b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.count-list-row a {
  color: var(--accent);
  font-size: 13px;
  font-weight: 600;
}

.missing-price-list,
.missing-price-rows,
.missing-price-preview-rows {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.missing-price-group {
  display: grid;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.missing-price-group-head,
.missing-price-row,
.missing-price-preview-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.missing-price-group-head > div {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.missing-price-group-head strong,
.missing-price-row b,
.missing-price-preview-row b {
  color: var(--text);
}

.missing-price-row,
.missing-price-preview-row {
  min-width: 0;
  max-width: 100%;
  min-height: 48px;
  padding: 10px 0;
  border-top: 1px solid var(--line-light);
  overflow: hidden;
}

.missing-price-row > div,
.missing-price-preview-row > div {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.missing-price-row small,
.missing-price-preview-row small,
.missing-price-row em {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.missing-price-row span,
.missing-price-preview-row span {
  flex: 0 0 auto;
  color: var(--regular);
  font-size: 13px;
  font-weight: 600;
}

.compact-manual-card .missing-price-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 4px 10px;
  align-items: center;
}

.compact-manual-card .manual-price-row {
  grid-template-columns: minmax(0, 1fr) auto auto minmax(150px, 180px);
}

.compact-manual-card .missing-price-row > div {
  min-width: 0;
}

.compact-manual-card .missing-price-row em {
  grid-column: 1 / -1;
  min-width: 0;
}

.manual-price-input {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.manual-price-input span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.manual-price-input input {
  width: 100%;
  height: 34px;
  margin: 0;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 13px;
}

.missing-price-preview-row.warn span {
  color: #b42318;
}

.missing-price-preview-row a {
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.final-actions-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: var(--fill-light);
}

.final-actions-card strong {
  display: block;
  color: var(--text);
  font-size: 16px;
}

.final-actions-card p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.final-buttons {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.danger-zone {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-color: #ffccc7;
  background: #fff7f6;
}

.danger-zone h2 {
  margin: 0;
  font-size: 18px;
}

.danger-zone p {
  margin: 6px 0 0;
  color: var(--muted);
}

.manual-secondary-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.manual-priority-card,
.manual-secondary-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.manual-priority-card.primary {
  border-color: #91caff;
  background: #f5faff;
}

.manual-secondary-card.muted {
  background: var(--fill-light);
}

.manual-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.manual-card-head.compact {
  align-items: center;
}

.manual-card-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.manual-card-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.narrow-form {
  max-width: 420px;
}

.form-help {
  color: var(--muted);
  margin-top: -4px;
}

button,
input,
select {
  height: 36px;
  border-radius: var(--radius-base);
  border: 1px solid var(--line);
  font: inherit;
}

button {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
  padding: 0 14px;
  cursor: pointer;
  font-weight: 600;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

button:hover {
  background: var(--accent-dark);
}

button:focus-visible,
a.secondary:focus-visible,
input:focus-visible,
select:focus-visible {
  border-color: var(--accent);
  outline: 3px solid rgba(22, 119, 255, 0.22);
  outline-offset: 2px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

button.is-loading {
  position: relative;
  opacity: 0.78;
}

button.secondary,
a.secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  color: var(--accent);
  background: #fff;
  border-color: var(--line);
  font-weight: 650;
  text-decoration: none;
}

button.secondary:hover,
a.secondary:hover {
  background: var(--accent-light);
  border-color: var(--accent);
  color: var(--accent-dark);
}

button.danger-text,
a.danger-text {
  color: var(--danger);
}

button.danger-text:hover,
a.danger-text:hover {
  border-color: var(--danger);
  background: #fff1f0;
  color: var(--danger);
}

.compact-action {
  min-height: 30px;
  padding: 0 10px;
  font-size: 13px;
}

button.danger-button,
.danger-button {
  background: #fff;
  border-color: #ffccc7;
  color: #cf1322;
}

button.danger-button:hover,
.danger-button:hover {
  background: #fff1f0;
  border-color: var(--danger);
  color: #a8071a;
}

.icon-button {
  width: 32px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

input,
select {
  background: #fff;
  color: var(--text);
  padding: 0 10px;
  min-width: 0;
  transition: border-color 0.16s ease, box-shadow 0.16s ease;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(5, 145, 255, 0.1);
}

.inline-form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-bottom: 12px;
}

.toolbar-form {
  display: grid;
  grid-template-columns: 120px 150px auto;
  gap: 8px;
  align-items: center;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.modal-card {
  position: relative;
  z-index: 1;
  width: min(460px, 100%);
  padding: 18px;
  border-radius: var(--radius-large);
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: var(--shadow-light);
}

.modal-form {
  display: grid;
  gap: 14px;
  margin-top: 16px;
}

.modal-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 4px;
}

.confirm-card {
  width: min(420px, 100%);
}

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

.fee-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.fee-grid label.hidden {
  display: none;
}

.fee-grid button {
  align-self: end;
}

.catalog-form {
  display: grid;
  grid-template-columns: 120px 110px 90px 80px 120px 1fr 1.2fr auto;
  gap: 8px;
}

.progress-line {
  min-height: 24px;
  margin-bottom: 12px;
  color: var(--muted);
  font-weight: 650;
}

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

.stat-card,
.summary-card,
.report-card,
.list-item,
.raw-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.stat-card {
  padding: 12px;
}

.catalog-filter-card {
  display: block;
  height: auto;
  padding: 12px;
  border-color: var(--line);
  background: #fff;
  color: var(--text);
  text-align: left;
}

.catalog-filter-card:hover,
.catalog-filter-card.selected {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--text);
}

.catalog-filter-card.selected {
  box-shadow: inset 0 0 0 1px var(--accent);
}

.catalog-variant-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #b7c4d8;
  border-radius: 999px;
  background: #f6f8fb;
  color: #40516a;
  font-size: 12px;
  font-weight: 700;
}

.catalog-filter-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
}

.catalog-tag-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
}

.catalog-tag-filters button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--regular);
}

.catalog-tag-filters button.active,
.catalog-tag-filters button:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.catalog-tag-filters b {
  font-size: 12px;
}

.catalog-update-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #f8fafc;
}

.catalog-update-label,
.catalog-update-preview {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.catalog-update-label {
  padding-left: 6px;
}

.catalog-update-preview {
  min-width: 72px;
  text-align: right;
}

.catalog-update-segments {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 2px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.catalog-update-segments button {
  min-height: 26px;
  padding: 0 9px;
  border: 0;
  border-radius: calc(var(--radius-base) - 2px);
  background: transparent;
  color: var(--text);
  font-weight: 650;
}

.catalog-update-segments button.active,
.catalog-update-segments button:hover {
  background: var(--accent-light);
  color: var(--accent);
}

.catalog-update-control > button {
  min-height: 30px;
}

.catalog-fetch-panel {
  display: grid;
  gap: 12px;
}

.catalog-fetch-grid {
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(150px, 0.8fr) minmax(280px, 1.6fr) auto;
  align-items: end;
  gap: 12px;
}

.catalog-fetch-field {
  display: grid;
  gap: 6px;
  margin: 0;
}

.catalog-fetch-field span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.catalog-fetch-field select,
.catalog-fetch-field textarea {
  width: 100%;
  min-height: 36px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--text);
  font: inherit;
}

.catalog-fetch-field textarea {
  min-height: 76px;
  resize: vertical;
}

.catalog-fetch-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 260px;
}

.catalog-fetch-preview {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--line-lighter);
  border-radius: var(--radius-base);
  background: #f8fafc;
  line-height: 1.5;
}

.catalog-fetch-preview b {
  color: var(--text);
}

.catalog-fetch-preview small {
  color: var(--muted);
}

.catalog-fetch-progress {
  display: grid;
  gap: 8px;
}

.catalog-fetch-progress-head,
.catalog-fetch-metrics {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.catalog-fetch-progress-head span,
.catalog-fetch-metrics span {
  color: var(--regular);
  font-size: 13px;
}

.catalog-fetch-progress-track {
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8edf5;
}

.catalog-fetch-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 0.2s ease;
}

.catalog-fetch-history {
  display: grid;
  gap: 8px;
}

.catalog-fetch-history-title {
  color: var(--regular);
  font-size: 13px;
  font-weight: 750;
}

.catalog-fetch-job {
  display: grid;
  grid-template-columns: minmax(120px, 0.7fr) minmax(120px, 0.8fr) minmax(260px, 1.5fr) minmax(150px, auto);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid var(--line-lighter);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--regular);
  font-size: 13px;
}

.catalog-fetch-job b {
  color: var(--text);
}

.catalog-fetch-job small {
  color: var(--muted);
  text-align: right;
}

@media (max-width: 980px) {
  .catalog-fetch-grid {
    grid-template-columns: 1fr;
  }

  .catalog-fetch-actions {
    justify-content: flex-start;
    min-width: 0;
  }

  .catalog-fetch-job {
    grid-template-columns: 1fr;
  }

  .catalog-fetch-job small {
    text-align: left;
  }
}

.catalog-tag-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 190px;
  max-width: 300px;
  white-space: normal;
}

.catalog-store-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 86px;
}

.catalog-image-cell {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 68px;
}

.catalog-item-meta-standalone {
  min-width: 84px;
}

.catalog-item-meta-standalone b,
.catalog-item-meta-standalone small {
  display: block;
}

.catalog-item-meta-standalone small {
  margin-top: 4px;
}

.catalog-item-image {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  overflow: hidden;
  border: 1px solid var(--line-light);
  border-radius: 10px;
  background: #f7f9fc;
  flex: 0 0 48px;
}

.catalog-item-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-item-image.empty {
  background: #fafbfc;
}

.catalog-item-image-placeholder {
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}

.catalog-store-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #d6dde8;
  border-radius: 999px;
  background: #f6f8fb;
  color: #40516a;
  font-size: 12px;
  font-weight: 700;
}

.catalog-business-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #d6dde8;
  border-radius: 999px;
  background: #fff;
  color: #4b5b70;
  font-size: 12px;
  font-weight: 700;
}

.catalog-business-tag small {
  font-size: 10px;
  font-weight: 750;
  line-height: 1;
}

.catalog-business-tag.listed {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: #237804;
}

.catalog-business-tag.sold,
.catalog-business-tag.sold-count {
  border-color: #91caff;
  background: #e6f4ff;
  color: #0958d9;
}

.catalog-business-tag.hot {
  border-color: #ffccc7;
  background: #fff1f0;
  color: #cf1322;
}

.catalog-business-tag.price-update {
  border-color: #ffd591;
  background: #fff7e6;
  color: #ad4e00;
}

.catalog-business-tag.unmarked {
  border-color: #d9d9d9;
  background: #fafafa;
  color: #6b7280;
}

.stat-card span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.stat-card b {
  font-size: 20px;
}

.stat-card small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  line-height: 1.45;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.summary-card {
  padding: 14px;
  min-width: 0;
  overflow: hidden;
}

.wide-summary {
  grid-column: span 2;
  min-width: 0;
}

.summary-card strong {
  display: block;
  font-size: 18px;
  margin-bottom: 8px;
}

.mini-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 10px;
  font-size: 13px;
}

.mini-table th,
.mini-table td {
  padding: 9px 8px;
  border-bottom: 1px solid var(--line-light);
  text-align: right;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-table th:first-child,
.mini-table td:first-child {
  text-align: left;
}

.mini-table th:first-child,
.mini-table td:first-child {
  width: 26%;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.report-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}

.store-overview-head {
  padding-bottom: 12px;
}

.trend-panel,
.current-report-panel,
.history-panel {
  margin-top: 16px;
}

.trend-panel {
  padding: 0;
  overflow: hidden;
}

.trend-split-card {
  display: grid;
  grid-template-columns: minmax(280px, 0.82fr) minmax(420px, 1.55fr);
  min-height: 360px;
  background: linear-gradient(180deg, #fff 0%, #f7faff 100%);
}

.trend-latest,
.trend-chart-side {
  min-width: 0;
  padding: clamp(18px, 2vw, 22px);
}

.trend-latest {
  border-right: 1px solid var(--line-light);
}

.trend-chart-side {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.trend-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.trend-card-head span {
  color: var(--text);
  font-weight: 650;
}

.trend-card-head small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.trend-latest h2 {
  margin: 0;
  color: var(--text);
  font-size: 32px;
  line-height: 1.1;
}

.trend-latest p {
  margin: 8px 0 18px;
  color: var(--muted);
}

.trend-kpis {
  display: grid;
  grid-template-columns: 1fr;
  gap: 7px;
  margin-bottom: 18px;
}

.trend-kpis div,
.trend-kpi-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--muted);
}

.trend-kpis b,
.trend-kpi-row b {
  color: var(--text);
}

.trend-kpi-row {
  width: 100%;
  height: auto;
  margin: 0;
  padding: 3px 0;
  border: 0;
  border-radius: var(--radius-base);
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.trend-kpi-row:hover {
  color: var(--regular);
  background: rgba(22, 119, 255, 0.06);
}

.trend-kpi-row b,
.trend-kpi-row .kpi-label {
  display: inline-flex;
  align-items: center;
}

.trend-kpi-row .kpi-label {
  gap: 5px;
}

.trend-kpi-row .info-dot {
  display: inline-grid;
  width: 14px;
  height: 14px;
  place-items: center;
  border: 1px solid rgba(0, 0, 0, 0.28);
  border-radius: 50%;
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  line-height: 1;
  opacity: 1;
}

.trend-popover-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
}

.trend-popover-actions button,
.trend-popover-actions a {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--regular);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
}

.trend-popover-actions button:hover,
.trend-popover-actions a:hover {
  border-color: #91caff;
  color: var(--accent);
  background: #f5faff;
}

.chart-legend {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 13px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-bar,
.legend-line {
  display: inline-block;
  width: 18px;
  height: 8px;
  border-radius: 2px;
}

.legend-bar {
  background: #1677ff;
}

.legend-line {
  height: 3px;
  background: #adc6ff;
}

.trend-chart-wrap {
  flex: 0 0 auto;
  min-width: 0;
  overflow: hidden;
}

.trend-chart {
  display: block;
  width: 100%;
  height: clamp(260px, 28vw, 320px);
}

.chart-axis {
  stroke: #d9d9d9;
  stroke-width: 1;
}

.chart-grid {
  stroke: #f0f0f0;
  stroke-width: 1;
}

.profit-bar {
  fill: #1677ff;
}

.sales-line {
  fill: none;
  stroke: #adc6ff;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sales-dot {
  fill: #fff;
  stroke: #adc6ff;
  stroke-width: 1.6;
}

.chart-label {
  fill: var(--muted);
  font-size: 18px;
}

.chart-y-label {
  fill: #8c8c8c;
  font-size: 18px;
}

.chart-axis-title {
  font-size: 18px;
  font-weight: 600;
}

.chart-y-left {
  fill: #1677ff;
}

.chart-y-right {
  fill: #8c8c8c;
}

.chart-hover-zone {
  fill: transparent;
  cursor: crosshair;
}

.chart-hover-line,
.chart-tooltip {
  display: none;
}

.chart-hover-line {
  stroke: rgba(22, 119, 255, 0.22);
  stroke-width: 1;
}

.chart-tooltip rect {
  fill: rgba(0, 0, 0, 0.82);
}

.chart-tooltip text {
  fill: #fff;
  font-size: 13px;
}

.chart-tooltip .tooltip-title {
  font-size: 14px;
  font-weight: 700;
}

.chart-tooltip .tooltip-label {
  fill: rgba(255, 255, 255, 0.92);
}

.chart-tooltip .tooltip-label.muted,
.chart-tooltip .tooltip-value.muted {
  fill: rgba(255, 255, 255, 0.72);
}

.chart-tooltip .tooltip-value {
  font-weight: 700;
}

.chart-hover-group:hover .chart-hover-line,
.chart-hover-group:hover .chart-tooltip {
  display: block;
}

.metric-popover {
  position: fixed;
  z-index: 50;
  min-width: 260px;
  max-width: 360px;
  padding: 14px;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.18);
  border: 1px solid var(--line-light);
}

.metric-popover::before {
  content: "";
  position: absolute;
  left: -7px;
  top: 22px;
  width: 12px;
  height: 12px;
  border-left: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
  background: #fff;
  transform: rotate(45deg);
}

.metric-popover strong {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 15px;
}

.metric-popover div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 5px 0;
  color: var(--muted);
}

.metric-popover b {
  color: var(--text);
  white-space: nowrap;
}

.current-report-body {
  display: grid;
  gap: 16px;
}

.current-report-body > .report-card {
  max-width: 520px;
}

.primary-link {
  margin-top: 0;
  padding: 0 12px;
  height: 32px;
  align-items: center;
  border: 1px solid #91caff;
  border-radius: var(--radius-base);
  background: #e6f4ff;
}

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

.history-row {
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  overflow: hidden;
}

.history-main {
  display: grid;
  grid-template-columns: 18px 96px minmax(150px, 1fr) minmax(170px, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: 100%;
  height: auto;
  padding: 12px 14px;
  border: 0;
  background: transparent;
  color: var(--regular);
  text-align: left;
}

.history-main:hover {
  background: var(--fill-light);
}

.history-main strong {
  color: var(--text);
  font-size: 15px;
}

.history-main span {
  color: var(--muted);
}

.history-main b {
  margin-left: 6px;
  color: var(--text);
}

.history-main small {
  margin-left: 8px;
  color: var(--muted);
}

.history-main em {
  justify-self: end;
  padding: 2px 8px;
  border: 1px solid #91caff;
  border-radius: var(--radius-base);
  background: #e6f4ff;
  color: #0958d9;
  font-size: 12px;
  font-style: normal;
}

.history-detail {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 4px 18px;
  padding: 10px 14px 14px 44px;
  border-top: 1px solid var(--line-light);
  background: var(--fill-light);
}

.history-detail .report-chart-block {
  grid-column: 1 / -1;
  width: 100%;
  min-width: 0;
}

.report-card {
  display: block;
  padding: 14px;
  color: var(--text);
  text-decoration: none;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.report-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-light);
}

.report-card.readonly {
  background: #fafafa;
}

.report-card.readonly:hover {
  border-color: var(--line);
  box-shadow: none;
}

.report-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}

.report-card-head strong {
  font-size: 18px;
}

.metric {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: var(--muted);
}

.metric b {
  color: var(--text);
  font-weight: 650;
}

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

.metric-value {
  display: inline-grid;
  justify-items: end;
  gap: 1px;
  min-width: 92px;
  text-align: right;
  line-height: 1.15;
}

.metric.highlight {
  align-items: flex-start;
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) minmax(104px, auto);
  padding: 8px 0 10px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--line-light);
}

.metric-toggle {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr) minmax(104px, auto);
  align-items: center;
  gap: 8px;
  width: 100%;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-align: left;
}

.metric-toggle:hover {
  background: var(--fill);
  color: var(--regular);
}

.metric-toggle b {
  color: var(--text);
}

.metric-toggle.highlight b {
  color: var(--accent);
}

.ant-chevron {
  width: 12px;
  height: 12px;
  display: inline-block;
  transform: rotate(0deg);
  transition: transform 0.18s ease;
  color: currentColor;
}

.ant-chevron::before {
  content: "";
  display: block;
  width: 6px;
  height: 6px;
  margin: 2px 0 0 1px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
}

.ant-chevron.expanded {
  transform: rotate(90deg);
}

.profit-details,
.fee-details {
  padding: 4px 0 6px 26px;
}

.metric.highlight b {
  color: var(--accent);
  font-size: 22px;
  line-height: 1.1;
}

.metric.highlight small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.status-tag {
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--regular);
  font-size: 12px;
  font-weight: 500;
  text-decoration: none;
}

.status-tag.green {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: #389e0d;
}

.status-tag.gold {
  border-color: #ffe58f;
  background: #fffbe6;
  color: #d48806;
}

.status-tag.default {
  border-color: var(--line);
  background: var(--fill);
  color: var(--muted);
}

.status-tag.blue {
  border-color: #91caff;
  background: #e6f4ff;
  color: #0958d9;
}

.card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 8px;
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  white-space: nowrap;
}

.card-note {
  display: inline-flex;
  margin-top: 8px;
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line-light);
}

.card-actions .card-link {
  margin-top: 0;
}

.detail-button {
  height: 30px;
  padding: 0 10px;
}

.chart-section {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 10px;
  min-width: 0;
}

.wide-chart {
  grid-column: 1 / -1;
}

.split-chart {
  min-width: 0;
}

.stacked-cell {
  display: inline-grid;
  justify-items: end;
  gap: 2px;
  min-width: 76px;
  line-height: 1.15;
}

.stacked-cell b {
  color: var(--text);
  font-weight: 650;
}

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

.report-chart-block {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line-light);
}

.drawer {
  position: fixed;
  inset: 0;
  z-index: 35;
}

.drawer-mask {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
}

.drawer-panel {
  position: absolute;
  top: 0;
  right: 0;
  width: min(760px, 92vw);
  height: 100%;
  display: grid;
  grid-template-rows: auto 1fr;
  background: #fff;
  box-shadow: var(--shadow-light);
}

.drawer-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--line);
}

.drawer-body {
  overflow: auto;
  padding: 18px 20px 24px;
}

.drawer-section {
  margin-bottom: 18px;
}

.drawer-section h3 {
  margin-bottom: 10px;
}

.drawer-metric-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 4px 22px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: var(--fill);
}

.drawer-list {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: var(--fill);
}

.drawer-brand-row b small,
.drawer-metric-grid b small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 500;
}

.chart-table {
  min-width: 0;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.chart-table h3 {
  min-width: 0;
  padding: 12px 14px;
  margin: 0;
  border-bottom: 1px solid var(--line-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chart-table table {
  width: 100%;
  min-width: 720px;
  table-layout: auto;
  border-collapse: collapse;
}

.chart-table th,
.chart-table td {
  padding: 8px 10px;
  font-size: 13px;
  white-space: nowrap;
}

.chart-table .title-cell {
  min-width: 220px;
  max-width: 420px;
  white-space: normal;
  line-height: 1.45;
}

.chart-product-cell {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.chart-product-cell span:not(.chart-product-thumb) {
  min-width: 0;
}

.chart-product-thumb {
  width: 44px;
  height: 44px;
  display: block;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: var(--fill);
  object-fit: cover;
}

.chart-product-thumb.is-empty::before {
  content: "无图";
  display: grid;
  width: 100%;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-size: 11px;
}

.columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  min-width: 0;
}

.list {
  display: grid;
  gap: 8px;
}

.ant-alert {
  padding: 10px 12px;
  border: 1px solid #b7eb8f;
  border-radius: var(--radius-base);
  background: #f6ffed;
  color: var(--regular);
}

.ant-alert.success {
  border-color: #b7eb8f;
  background: #f6ffed;
}

.ant-alert.warning {
  border-color: #ffe58f;
  background: #fffbe6;
}

.ant-list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 54px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line-light);
}

.ant-list-row:first-child {
  border-top: 1px solid var(--line-light);
}

.ant-list-row b {
  display: block;
  color: var(--text);
  font-weight: 600;
}

.ant-list-row small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
}

.ant-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-base);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.ant-tag.blue {
  border: 1px solid #91caff;
  background: #e6f4ff;
  color: #0958d9;
}

.ant-tag.gold {
  border: 1px solid #ffd591;
  background: #fff7e6;
  color: #ad6800;
}

.list-item {
  padding: 10px;
}

.list-item small {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.list-item.clickable {
  cursor: pointer;
}

.list-item.clickable:hover {
  border-color: var(--accent);
  background: var(--accent-light);
}

.import-result-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid #b7eb8f;
  border-radius: var(--radius-base);
  background: #f6ffed;
}

.import-result-summary span {
  color: var(--muted);
  font-size: 13px;
}

.import-result-summary small {
  width: 100%;
  color: var(--muted);
  font-size: 12px;
}

.import-result-groups {
  display: grid;
  gap: 8px;
  margin-top: 10px;
}

.import-result-group {
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  overflow: hidden;
}

.import-result-group summary {
  display: grid;
  grid-template-columns: auto minmax(96px, 1fr) auto minmax(120px, auto);
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
}

.import-result-group summary::-webkit-details-marker {
  display: none;
}

.import-result-group summary::before {
  content: "›";
  color: var(--muted);
  font-weight: 700;
  transform: rotate(0deg);
  transition: transform 0.16s ease;
}

.import-result-group[open] summary::before {
  transform: rotate(90deg);
}

.import-result-group summary span {
  font-weight: 700;
}

.import-result-group summary b {
  justify-self: end;
  font-size: 18px;
}

.import-result-group summary small {
  color: var(--muted);
  font-size: 12px;
  text-align: right;
}

.import-result-lines {
  border-top: 1px solid var(--line-lighter);
}

.import-result-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) minmax(58px, auto) repeat(5, minmax(90px, auto)) minmax(150px, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px 14px;
  border-top: 1px solid var(--line-lighter);
  color: var(--regular);
  font-size: 13px;
  white-space: nowrap;
}

.import-result-row:first-child {
  border-top: 0;
}

.import-result-row b {
  color: var(--text);
}

.import-result-error {
  display: block;
  color: var(--warn);
  white-space: normal;
}

.pill {
  display: inline-flex;
  align-items: center;
  height: 22px;
  margin-left: 8px;
  padding: 0 8px;
  border-radius: var(--radius-round);
  background: var(--accent-light);
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
}

.raw-detail {
  display: grid;
  gap: 8px;
}

.raw-row {
  padding: 10px;
}

.raw-row small {
  display: block;
  color: var(--muted);
  margin: 4px 0 8px;
}

.raw-row pre {
  max-height: 240px;
  overflow: auto;
  margin: 0;
  padding: 10px;
  border-radius: var(--radius-base);
  background: var(--fill);
  color: var(--text);
  font-size: 12px;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
}

.table-wrap {
  overflow: auto;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  -webkit-overflow-scrolling: touch;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table-wrap table {
  min-width: 980px;
}

th,
td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-lighter);
  text-align: left;
  white-space: nowrap;
}

th {
  position: sticky;
  top: 0;
  background: var(--fill);
  color: var(--regular);
  font-weight: 700;
  z-index: 1;
}

tbody tr:hover {
  background: var(--fill-light);
}

td.title-cell {
  max-width: 360px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.price-change-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  min-width: 150px;
  max-width: 180px;
}

.price-change-main {
  display: flex;
  align-items: center;
  gap: 6px;
}

.price-change-tag {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 8px;
  border: 1px solid #ffd591;
  border-radius: 999px;
  background: #fff7e6;
  color: #d46b08;
  font-size: 12px;
  font-weight: 700;
}

.price-change-amount {
  display: inline;
  color: #ad4e00;
  font-size: 11px;
  font-weight: 650;
  line-height: 1.2;
  white-space: nowrap;
}

.price-updates-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}

.price-updates-toolbar .pill {
  margin-left: 0;
}

.price-update-source {
  max-width: 150px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.catalog-price-diff {
  white-space: nowrap;
}

.price-change-date {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.price-change-date.up,
.catalog-price-diff.up {
  color: #cf1322;
  font-weight: 700;
}

.price-change-date.down,
.catalog-price-diff.down {
  color: #237804;
  font-weight: 700;
}

.catalog-price-diff.neutral {
  color: var(--muted);
}

.diff-up {
  color: var(--danger);
  font-weight: 700;
}

.diff-down {
  color: var(--ok);
  font-weight: 700;
}

.warn {
  color: var(--warn);
}

.hidden {
  display: none;
}

[hidden] {
  display: none !important;
}

.modal-form label.hidden {
  display: none;
}

.commission-list {
  display: block;
  min-width: 0;
}

.commission-table-wrap {
  width: 100%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.commission-ledger-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: collapse;
  table-layout: fixed;
}

.commission-ledger-table th,
.commission-ledger-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--line-light);
  vertical-align: middle;
}

.commission-ledger-table th {
  color: var(--muted);
  background: var(--fill-light);
  font-size: 12px;
  font-weight: 650;
  line-height: 16px;
  text-align: left;
}

.commission-ledger-table tbody tr:last-child td {
  border-bottom: 0;
}

.commission-ledger-table tbody tr:hover {
  background: #fafbfc;
}

.commission-ledger-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.commission-ledger-table .number-cell b {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.commission-ledger-table .number-cell.primary b {
  color: var(--accent-dark);
}

.commission-period-cell,
.commission-source-cell,
.commission-adjustment-cell,
.commission-categories-cell {
  min-width: 0;
}

.commission-period-cell strong {
  display: block;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 20px;
}

.commission-period-cell small,
.commission-source-cell,
.commission-adjustment-cell small {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.commission-source-cell,
.commission-adjustment-cell small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-adjustment-cell small {
  display: block;
  margin-top: 4px;
}

.commission-source-cell {
  color: var(--text);
}

.commission-adjustment-cell {
  line-height: 18px;
}

.commission-adjustment-chip {
  display: inline-flex;
  width: fit-content;
  min-height: 22px;
  align-items: center;
  border-radius: 4px;
  padding: 0 8px;
  font-size: 12px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.commission-adjustment-chip.up {
  color: var(--ok);
  background: #e7f7ef;
}

.commission-adjustment-chip.down {
  color: var(--danger);
  background: #fdecec;
}

.commission-adjustment-chip.neutral {
  color: var(--muted);
  background: var(--fill-light);
}

.commission-adjustment-empty {
  color: var(--muted);
  font-size: 12px;
}

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

.commission-category-cell {
  min-width: 0;
  padding: 6px 7px;
  border: 1px solid var(--line-light);
  border-radius: 4px;
  background: #fafbfc;
}

.commission-category-cell span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 14px;
}

.commission-category-cell em {
  color: var(--muted);
  font-style: normal;
  font-weight: 600;
  white-space: nowrap;
}

.commission-category-cell b {
  display: block;
  margin-top: 2px;
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  line-height: 16px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.commission-ledger-table .action-cell {
  text-align: right;
}

.commission-ledger-table .card-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 0;
  padding-left: 0;
  border-left: 0;
  color: var(--accent);
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.commission-row {
  position: relative;
  align-items: center;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(220px, 1.1fr) minmax(150px, 0.7fr) minmax(280px, 1.2fr) minmax(190px, 0.8fr);
  padding: 14px 82px 14px 16px;
  overflow: hidden;
}

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

.commission-row .card-link {
  position: absolute;
  top: 14px;
  right: 16px;
  margin-top: 0;
  padding-left: 0;
  border-left: 0;
}

.commission-row strong,
.commission-row b {
  color: var(--text);
}

.commission-row small,
.commission-row span {
  color: var(--muted);
  display: block;
  margin-top: 4px;
}

.commission-row small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-main {
  display: grid;
  gap: 4px;
}

.commission-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-height: 22px;
}

.commission-tag {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-style: normal;
  font-size: 12px;
  font-weight: 650;
}

.commission-tag.warning {
  color: #ad6800;
  border: 1px solid #ffd591;
  background: #fff7e6;
}

.commission-tag.danger {
  color: #cf1322;
  border: 1px solid #ffa39e;
  background: #fff1f0;
}

.commission-tag.info {
  color: #0958d9;
  border: 1px solid #91caff;
  background: #e6f4ff;
}

.commission-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
  min-width: 0;
  padding-left: 16px;
  border-left: 1px solid var(--line-light);
}

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

.commission-group.adjustment {
  grid-template-columns: minmax(0, 1fr);
}

.commission-group-title {
  grid-column: 1 / -1;
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.commission-pair {
  min-width: 0;
}

.commission-pair span {
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
}

.commission-pair b {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.commission-pair.primary b {
  color: var(--accent-dark);
  font-size: 16px;
}

.commission-adjustment-amount {
  text-align: right;
}

.commission-adjustment-amount.up {
  color: var(--ok);
}

.commission-adjustment-amount.down {
  color: var(--danger);
}

.commission-adjustment-amount.neutral {
  color: var(--muted);
}

.commission-adjustment-detail {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-breakdown {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding-top: 12px;
  border-top: 1px solid var(--line-light);
}

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

.commission-breakdown-item {
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: var(--fill-light);
}

.commission-breakdown-item span {
  margin-top: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.commission-breakdown-item b {
  display: block;
  margin-top: 2px;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
}

.commission-breakdown-item small {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-basic-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(5, minmax(0, 1fr)) auto;
}

.commission-basic-grid label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 650;
  gap: 6px;
}

.commission-basic-grid button {
  align-self: end;
}

.inline-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  margin-top: 12px;
}

.commission-edit-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 376px;
  gap: 18px;
  align-items: start;
}

.commission-edit-main,
.commission-file-sidebar,
.commission-result-sidebar {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.commission-basic-panel .commission-basic-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.commission-basic-panel .commission-basic-grid > button {
  grid-column: span 2;
  width: 100%;
}

.commission-linked-account {
  display: grid;
  gap: 6px;
  min-height: 54px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: var(--fill-light);
}

.commission-linked-account span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.commission-linked-account b {
  color: var(--text);
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-linked-account.hidden {
  display: none;
}

.commission-adjustment-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 12px;
  border: 1px dashed #91caff;
  border-radius: var(--radius-base);
  background: #f5faff;
}

.commission-adjustment-row.hidden {
  display: none;
}

.commission-adjustment-row label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 650;
  gap: 6px;
}

.commission-adjustment-row p {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 760px) {
  .commission-adjustment-row {
    grid-template-columns: 1fr;
  }

  .commission-adjustment-row button {
    width: 100%;
  }
}

.commission-process-panel .module-title,
.commission-file-sidebar .module-title.compact {
  justify-content: space-between;
}

.commission-process-panel .module-title {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
}

.commission-process-panel .module-actions {
  grid-column: 2;
  flex: 0 0 auto;
  margin-top: 4px;
  margin-left: 0;
  justify-content: flex-start;
}

.commission-process-panel .module-actions button {
  padding-inline: 12px;
  white-space: nowrap;
}

.commission-process-panel .module-actions button.subtle {
  border-color: var(--line-light);
  color: var(--muted);
  background: #fff;
  font-weight: 600;
}

.commission-process-panel .module-actions button.subtle:hover,
.commission-process-panel .module-actions button.subtle:focus-visible {
  color: var(--accent-dark);
  border-color: #91caff;
  background: #f5faff;
}

.hidden-upload-form {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
}

.visually-hidden-file {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  opacity: 0;
  pointer-events: none;
}

.commission-process-feed {
  display: grid;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-large);
  overflow: hidden;
}

.commission-process-table-wrap {
  width: 100%;
  overflow-x: auto;
  background: #fff;
}

.commission-process-table {
  width: 100%;
  min-width: 640px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
}

.commission-process-table th,
.commission-process-table td {
  border-bottom: 1px solid var(--line-light);
  vertical-align: middle;
}

.commission-process-table tr:last-child td {
  border-bottom: 0;
}

.commission-process-table th {
  height: 48px;
  padding: 0 16px;
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  line-height: 14px;
  font-weight: 700;
  text-align: left;
  white-space: nowrap;
}

.commission-process-table td {
  height: 72px;
  padding: 12px 16px;
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
}

.commission-process-table th:nth-child(1),
.commission-process-table td:nth-child(1) {
  width: 64px;
  text-align: center;
}

.commission-process-table th:nth-child(2),
.commission-process-table td:nth-child(2) {
  width: 26%;
}

.commission-process-table th:nth-child(3),
.commission-process-table td:nth-child(3),
.commission-process-table th:nth-child(4),
.commission-process-table td:nth-child(4) {
  width: 84px;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.commission-process-table th:nth-child(5),
.commission-process-table td:nth-child(5) {
  width: 92px;
  text-align: center;
}

.commission-process-table th:nth-child(6),
.commission-process-table td:nth-child(6) {
  width: 156px;
  text-align: right;
}

.commission-process-table strong {
  display: block;
  color: var(--text);
  font-size: 15px;
  line-height: 22px;
  font-weight: 700;
}

.commission-process-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.process-step-index {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-round);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 800;
  line-height: 1;
}

.process-status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 4px;
  background: #f5f6f7;
  color: #626c70;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.process-status.ok {
  background: #e7f7ef;
  color: #0faf62;
}

.process-step {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto auto;
  gap: 14px;
  align-items: start;
  padding: 15px;
  border-bottom: 1px solid var(--line-light);
  background: #fff;
}

.process-step:last-child {
  border-bottom: 0;
}

.process-step > span {
  display: inline-grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: var(--radius-round);
  background: var(--accent-light);
  color: var(--accent-dark);
  font-weight: 800;
}

.process-step h3 {
  margin: 0;
  font-size: 15px;
}

.process-step p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.process-step em {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--accent-light);
  color: var(--accent-dark);
  font-style: normal;
  font-size: 12px;
  font-weight: 700;
}

.process-step em.ok {
  background: #f6ffed;
  color: #389e0d;
}

.process-step-actions {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.process-step-actions button {
  min-height: 32px;
  padding: 0 12px;
  white-space: nowrap;
}

.process-step-actions .icon-button {
  width: 32px;
  padding: 0;
  color: var(--muted);
}

.process-step-actions .icon-button:hover,
.process-step-actions .icon-button:focus-visible {
  color: var(--accent-dark);
}

.process-share-icon {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.commission-metric-strip {
  display: grid;
  grid-template-columns: minmax(340px, 1.15fr) minmax(0, 1fr);
  gap: 12px;
}

.commission-metric-money {
  display: grid;
  grid-template-columns: 1.25fr 1fr;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid #91caff;
  border-radius: var(--radius-large);
  background: #f5faff;
}

.commission-metric-status {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  min-width: 0;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-large);
  overflow: hidden;
  background: #fff;
}

.commission-metric-money div,
.commission-metric-status div {
  min-width: 0;
}

.commission-metric-status div {
  padding: 14px 10px;
  border-right: 1px solid var(--line-light);
}

.commission-metric-status div:last-child {
  border-right: 0;
}

.commission-metric-status .warn {
  background: #fff7e6;
  color: var(--text);
}

.commission-metric-strip span {
  color: var(--muted);
  font-size: 13px;
}

.commission-metric-strip b {
  display: block;
  margin-top: 8px;
  color: var(--text);
  font-size: 25px;
  line-height: 1;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.commission-metric-money b {
  font-size: 28px;
}

.commission-file-sidebar .uploaded-file-card {
  margin-top: 0;
}

.commission-result-sidebar {
  align-self: start;
}

.commission-result-rail {
  position: sticky;
  top: 18px;
  gap: 14px;
  max-height: calc(100vh - 36px);
  padding: 16px;
  border-color: rgba(22, 119, 255, 0.28);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-light);
  overflow: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
}

.result-rail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line-light);
}

.result-rail-head h2 {
  margin: 0;
  font-size: 18px;
}

.result-rail-head p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
}

.result-rail-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.result-rail-state.ok {
  background: #f6ffed;
  color: #389e0d;
}

.result-rail-state.warning {
  background: #fff7e6;
  color: #ad6800;
}

.result-rail-hero {
  display: grid;
  gap: 4px;
  padding: 14px;
  border: 1px solid #91caff;
  border-radius: var(--radius-base);
  background: #f5faff;
}

.result-rail-hero span,
.result-rail-hero small {
  color: var(--muted);
  font-size: 13px;
}

.result-rail-hero b {
  color: var(--accent-dark);
  font-size: 30px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.result-mini-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  overflow: hidden;
}

.result-mini-grid > div {
  min-height: 64px;
  padding: 10px 12px;
  border-right: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
}

.result-mini-grid > div:nth-child(2n) {
  border-right: 0;
}

.result-mini-grid > div:nth-last-child(-n + 2) {
  border-bottom: 0;
}

.result-mini-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.result-mini-grid b {
  display: block;
  margin-top: 5px;
  color: var(--text);
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.result-rail-section {
  display: grid;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--line-light);
}

.result-rail-section h3 {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin: 0;
  font-size: 14px;
}

.result-rail-section h3 small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  text-align: right;
}

.result-compact-list {
  display: grid;
  gap: 8px;
}

.result-compact-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-height: 24px;
  color: var(--regular);
  font-size: 13px;
}

.result-compact-row b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.commission-result-rail .result-table {
  min-width: 580px;
}

.commission-result-rail .result-table th,
.commission-result-rail .result-table td {
  padding: 9px 10px;
  font-size: 12px;
}

.commission-file-workspace-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 0.95fr);
  gap: 12px;
  align-items: start;
}

.commission-file-list {
  display: grid;
  gap: 10px;
  min-width: 0;
}

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

.commission-delete-panel {
  align-items: center;
  padding: 14px;
  border: 1px solid #ffccc7;
  border-radius: var(--radius-base);
  margin-bottom: 0;
}

.commission-delete-panel .danger-button {
  flex: 0 0 auto;
}

@media (max-width: 1180px) {
  .commission-edit-layout {
    grid-template-columns: 1fr;
  }

  .commission-edit-main,
  .commission-file-sidebar,
  .commission-result-sidebar {
    width: 100%;
  }

  .commission-result-rail {
    position: static;
    max-height: none;
    overflow: visible;
  }
}

@media (max-width: 1350px) {
  .commission-basic-panel .commission-basic-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commission-basic-panel .commission-basic-grid button {
    width: 100%;
  }

  .commission-file-workspace-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1180px) {
  .commission-basic-panel .commission-basic-grid > button {
    grid-column: auto;
  }

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

.commission-manual-page main {
  max-width: none;
  padding: 12px 14px 18px;
}

.commission-manual-page .topbar {
  padding: 16px 18px;
}

.commission-manual-page .panel {
  padding: 14px;
}

.commission-manual-page .report-status-grid {
  gap: 10px;
  margin-bottom: 12px;
}

.commission-manual-editor {
  display: grid;
  gap: 10px;
}

.commission-manual-filter {
  display: grid;
  grid-template-columns: 160px minmax(180px, 1fr) auto auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
}

.commission-manual-filter label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.commission-manual-filter input,
.commission-manual-filter select {
  width: 100%;
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  padding: 7px 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.commission-manual-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.commission-manual-toolbar span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-round);
  background: var(--fill-light);
  color: var(--regular);
  font-size: 12px;
  font-weight: 700;
}

.commission-manual-table-wrap {
  overflow-x: hidden;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
}

.commission-manual-table {
  width: 100%;
  min-width: 0;
  table-layout: fixed;
  border-collapse: collapse;
  background: #fff;
}

.manual-col-image {
  width: 72px;
}

.manual-col-sku {
  width: 92px;
}

.manual-col-product {
  width: auto;
}

.manual-col-quantity {
  width: 50px;
}

.manual-col-type {
  width: 112px;
}

.manual-col-self {
  width: 82px;
}

.manual-col-self-quantity {
  width: 88px;
}

.manual-col-purchase {
  width: 136px;
}

.commission-manual-table th,
.commission-manual-table td {
  padding: 8px 9px;
  border-bottom: 1px solid var(--line-light);
  color: var(--text);
  font-size: 12px;
  text-align: left;
  vertical-align: middle;
  overflow: hidden;
}

.commission-manual-table th {
  background: var(--fill-light);
  color: var(--muted);
  font-weight: 700;
  white-space: nowrap;
}

.commission-manual-table tbody tr:last-child td {
  border-bottom: 0;
}

.commission-manual-table tr.hidden {
  display: none;
}

.commission-manual-table small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.commission-manual-table strong {
  display: block;
  color: var(--text);
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.commission-manual-table .number-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.commission-manual-thumb {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  object-fit: cover;
}

.commission-manual-thumb.empty {
  border-style: dashed;
}

.manual-product-name {
  display: -webkit-box;
  min-width: 0;
  max-width: none;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.manual-brand-text {
  display: none !important;
}

.manual-kids-select,
.manual-self-quantity {
  width: 100%;
  min-width: 0;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  padding: 6px 8px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.manual-self-control {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  white-space: nowrap;
}

.manual-self-control input {
  width: auto;
}

.manual-purchase-location {
  display: -webkit-box;
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.commission-pata-page main {
  max-width: none;
  padding: 12px 18px 22px;
}

.commission-pata-page .topbar {
  padding: 16px 22px;
}

.commission-pata-page .panel {
  padding: 16px 18px;
}

.pata-editor-toolbar {
  display: grid;
  grid-template-columns: minmax(260px, 420px) auto auto minmax(220px, 1fr);
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.pata-editor-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.pata-visible-summary {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-round);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pata-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.pata-compact-table {
  width: 100%;
  min-width: 1060px;
  border-collapse: collapse;
  table-layout: fixed;
}

.pata-compact-table th,
.pata-compact-table td {
  padding: 7px 8px;
  border-bottom: 1px solid var(--line-light);
  text-align: left;
  vertical-align: middle;
}

.pata-compact-table th {
  height: 34px;
  color: var(--muted);
  background: var(--fill-light);
  font-size: 12px;
  line-height: 14px;
  font-weight: 650;
}

.pata-compact-table td {
  height: 48px;
  font-size: 14px;
  line-height: 20px;
}

.pata-compact-table th:nth-child(1),
.pata-compact-table td:nth-child(1) {
  width: 72px;
}

.pata-compact-table th:nth-child(2),
.pata-compact-table td:nth-child(2) {
  width: 110px;
}

.pata-compact-table th:nth-child(3),
.pata-compact-table td:nth-child(3),
.pata-compact-table th:nth-child(4),
.pata-compact-table td:nth-child(4) {
  width: 90px;
}

.pata-compact-table th:nth-child(5),
.pata-compact-table td:nth-child(5) {
  width: 72px;
}

.pata-compact-table th:nth-child(6),
.pata-compact-table td:nth-child(6) {
  width: 120px;
}

.pata-compact-table th:nth-child(7),
.pata-compact-table td:nth-child(7) {
  width: 140px;
}

.pata-compact-table th:nth-child(8),
.pata-compact-table td:nth-child(8) {
  width: 86px;
}

.pata-compact-table th:nth-child(9),
.pata-compact-table td:nth-child(9) {
  width: 100px;
}

.pata-compact-table input {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 8px;
  font-size: 14px;
}

.pata-number-input,
.pata-money-input {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.pata-product-cell {
  text-align: center;
}

.pata-product-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-light);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
  overflow: hidden;
}

.pata-product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pata-match-status {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: 4px;
  font-size: 12px;
  line-height: 22px;
  font-weight: 500;
  white-space: nowrap;
}

.pata-match-ok {
  color: #0faf62;
  background: #e7f7ef;
}

.pata-match-missing {
  color: #9a5b00;
  background: #fff4d6;
}

.pata-row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pata-row-actions button {
  width: auto;
  min-height: 30px;
  border: 0;
  background: transparent;
  color: var(--brand);
  font-weight: 700;
  padding: 0 2px;
}

.pata-row-actions button[data-row-action="delete"] {
  color: #e84646;
}

.pata-empty-row {
  height: 80px;
  color: var(--muted);
  text-align: center !important;
}

.commission-pata-page .report-status-grid:empty {
  display: none;
}

.pata-summary-modal[hidden] {
  display: none;
}

.pata-summary-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
}

.pata-summary-backdrop {
  position: absolute;
  inset: 0;
  background: rgb(25 27 28 / 38%);
}

.pata-summary-dialog {
  position: absolute;
  top: 56px;
  left: 50%;
  display: flex;
  flex-direction: column;
  width: min(980px, calc(100vw - 48px));
  max-height: calc(100vh - 112px);
  transform: translateX(-50%);
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
  box-shadow: 0 20px 60px rgb(25 27 28 / 22%);
  overflow: hidden;
}

.pata-summary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 22px 14px;
  border-bottom: 1px solid var(--line-light);
}

.pata-summary-header h2 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 18px;
  line-height: 24px;
  font-weight: 700;
}

.pata-summary-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 19px;
}

.pata-summary-close {
  width: 32px;
  height: 32px;
  min-height: 32px;
  border: 0;
  background: transparent;
  color: var(--text);
  font-size: 24px;
  line-height: 1;
  font-weight: 400;
}

.pata-summary-content {
  padding: 16px 22px 22px;
  overflow: auto;
}

.pata-summary-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 14px;
}

.pata-summary-metrics > div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: var(--fill-light);
}

.pata-summary-metrics small {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
  line-height: 14px;
  font-weight: 650;
}

.pata-summary-metrics b {
  display: block;
  color: var(--text);
  font-size: 18px;
  line-height: 24px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.pata-summary-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.pata-summary-table {
  width: 100%;
  min-width: 780px;
  border-collapse: collapse;
  table-layout: fixed;
}

.pata-summary-table th,
.pata-summary-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-light);
  text-align: left;
  vertical-align: middle;
}

.pata-summary-table th {
  height: 36px;
  color: var(--muted);
  background: var(--fill-light);
  font-size: 12px;
  line-height: 14px;
  font-weight: 650;
}

.pata-summary-table th:nth-child(1),
.pata-summary-table td:nth-child(1) {
  width: 76px;
}

.pata-summary-table th:nth-child(4),
.pata-summary-table td:nth-child(4) {
  width: 86px;
  text-align: right;
}

.pata-summary-table th:nth-child(5),
.pata-summary-table td:nth-child(5) {
  width: 160px;
  text-align: right;
}

.pata-summary-thumb {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-light);
  border-radius: 4px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  overflow: hidden;
}

.pata-summary-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pata-summary-sku {
  color: var(--text);
  font-size: 14px;
  line-height: 20px;
  font-weight: 750;
}

.pata-summary-color {
  margin-top: 2px;
  color: var(--muted);
  font-size: 13px;
  line-height: 18px;
}

.pata-summary-sizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pata-size-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 4px;
  background: var(--fill-light);
  color: var(--text);
  font-size: 12px;
  line-height: 24px;
  font-weight: 650;
  white-space: nowrap;
}

.pata-summary-number,
.pata-summary-money {
  color: var(--text);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.pata-summary-empty {
  height: 100px;
  color: var(--muted);
  text-align: center !important;
}

@media (max-width: 720px) {
  .pata-editor-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .commission-pata-page main {
    padding: 10px 12px 18px;
  }

  .pata-summary-dialog {
    top: 16px;
    width: calc(100vw - 24px);
    max-height: calc(100vh - 32px);
  }

  .pata-summary-metrics {
    grid-template-columns: 1fr 1fr;
  }
}

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

.sidebar-action-list .button-like {
  justify-content: center;
}

.sidebar-danger-zone {
  align-items: stretch;
}

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

.button-like {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  display: inline-flex;
  font-size: 14px;
  font-weight: 700;
  min-height: 38px;
  padding: 0 14px;
  text-decoration: none;
}

.button-like.secondary {
  background: #fff;
  color: var(--brand);
}

.file-button {
  cursor: pointer;
  position: relative;
}

.file-button input {
  display: none;
}

.stacked-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.stacked-form textarea {
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  font: inherit;
  line-height: 1.6;
  min-height: 120px;
  padding: 12px;
  resize: vertical;
}

.muted-text {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.self-purchase-checkbox {
  height: 18px;
  width: 18px;
}

.table-panel {
  margin-top: 18px;
}

.table-scroll {
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: 100%;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.data-table {
  border-collapse: collapse;
  min-width: 1180px;
  width: 100%;
}

.data-table th,
.data-table td {
  border-bottom: 1px solid var(--line-light);
  padding: 12px 14px;
  text-align: left;
  white-space: nowrap;
}

.data-table th {
  background: var(--surface-muted);
  color: var(--muted);
  font-weight: 700;
}

.data-table .title-cell {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.orders-toolbar,
.orders-import-bar {
  display: grid;
  gap: 14px;
}

.orders-import-bar {
  grid-template-columns: auto minmax(150px, 190px) minmax(210px, 280px) minmax(320px, 1fr);
  align-items: end;
  padding: 14px 16px;
}

.orders-import-label {
  align-self: center;
  color: var(--regular);
  font-weight: 750;
  white-space: nowrap;
}

.orders-import-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.orders-import-field select,
.month-multiselect-trigger {
  width: 100%;
  height: 40px;
}

.orders-month-field {
  position: relative;
}

.month-multiselect {
  position: relative;
  min-width: 0;
}

.month-multiselect-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 0 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  box-shadow: none;
  text-align: left;
}

.month-multiselect-trigger::after {
  content: "⌄";
  color: var(--muted);
  font-size: 13px;
}

.month-multiselect-trigger:hover,
.month-multiselect-trigger[aria-expanded="true"] {
  border-color: var(--accent);
  background: #fff;
  color: var(--text);
}

.month-multiselect-trigger span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.month-multiselect-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  z-index: 20;
  display: grid;
  gap: 4px;
  width: min(280px, calc(100vw - 32px));
  max-height: 320px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  box-shadow: var(--shadow-light);
  overflow: auto;
}

.month-multiselect-menu.hidden {
  display: none;
}

.month-multiselect-actions {
  display: flex;
  justify-content: flex-end;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--line-light);
}

.month-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 34px;
  padding: 0 10px;
  border: 0;
  border-radius: var(--radius-base);
  background: transparent;
  color: var(--regular);
  box-shadow: none;
  text-align: left;
}

.month-option:hover {
  background: var(--fill-light);
  color: var(--text);
}

.month-option.active {
  background: var(--accent-light);
  color: var(--accent-dark);
}

.month-option b {
  color: inherit;
  font-size: 12px;
  font-weight: 750;
}

.orders-import-upload {
  min-width: 0;
}

.orders-import-upload .drop-zone {
  width: 100%;
  min-width: 0;
  height: 40px;
  justify-content: center;
  border-color: var(--line);
  background: #fff;
  font-size: 13px;
}

.orders-import-upload .drop-zone.dragover,
.orders-import-upload .drop-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-light);
}

.orders-import-bar #orders-import-preview {
  grid-column: 1 / -1;
}

.orders-control-grid {
  display: grid;
  grid-template-columns: minmax(160px, 220px) minmax(150px, 190px) minmax(280px, 1fr);
  gap: 14px;
  align-items: end;
}

.orders-control-grid.index-mode {
  grid-template-columns: minmax(160px, 220px) minmax(280px, 1fr);
}

.orders-control-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
}

.orders-control-grid select,
.orders-control-grid input[type="month"] {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  padding: 0 12px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.orders-upload-form {
  min-width: 0;
}

.orders-upload-form .drop-zone {
  width: 100%;
}

.orders-list-panel {
  display: grid;
  gap: 14px;
}

.orders-list-panel .pill {
  align-self: flex-start;
  width: max-content;
}

.orders-list-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
}

.orders-list-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 650;
  white-space: nowrap;
}

.orders-list-filter select {
  width: 132px;
  height: 36px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  padding: 0 10px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

.orders-table-scroll {
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.orders-month-table {
  width: 100%;
  min-width: 1120px;
  border-collapse: collapse;
}

.orders-month-table th,
.orders-month-table td {
  border-bottom: 1px solid var(--line-light);
  padding: 13px 14px;
  text-align: left;
  vertical-align: middle;
}

.orders-month-table th {
  background: var(--surface-muted);
  color: var(--muted);
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
}

.orders-month-table td {
  color: var(--regular);
  font-size: 14px;
}

.orders-month-table tbody tr:last-child td {
  border-bottom: 0;
}

.orders-month-table-row {
  cursor: pointer;
  transition: background 0.16s ease;
}

.orders-month-table-row:hover {
  background: #f8fbff;
}

.orders-status-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 360px;
}

.orders-status-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--surface-muted);
  color: var(--regular);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.orders-status-chip.total {
  background: #eef4ff;
  color: var(--brand);
}

.orders-status-chip b {
  color: var(--text);
}

.orders-status-chip.ok {
  background: #e8f8f2;
  color: #087452;
}

.orders-status-chip.danger {
  background: #fff1f2;
  color: #b42318;
}

.orders-status-chip.warn {
  background: #fff7e6;
  color: #b54708;
}

.orders-status-empty,
.orders-updated-cell {
  color: var(--muted);
  white-space: nowrap;
}

.orders-import-card {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fbfdff;
}

.orders-import-card strong {
  color: var(--text);
}

.orders-import-card p {
  margin: 4px 0 0;
  color: var(--regular);
}

.report-import-card {
  margin-top: 14px;
}

.orders-import-months {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.orders-import-months.discard-months {
  margin-top: 8px;
}

.orders-import-months.vertical {
  display: grid;
  gap: 8px;
}

.orders-import-months span {
  padding: 6px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line-light);
  color: var(--regular);
  font-size: 13px;
}

.orders-discard-month {
  display: grid;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.orders-discard-month .orders-status-list {
  min-width: 0;
}

.orders-import-compare {
  display: grid;
  gap: 10px;
}

.orders-import-compare h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
}

.orders-import-compare-group {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.orders-import-compare-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--regular);
  font-size: 13px;
}

.orders-import-compare-table {
  display: grid;
  grid-template-columns: minmax(160px, 1fr) repeat(3, minmax(72px, auto));
  overflow: hidden;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.orders-import-compare-table > div {
  padding: 8px 10px;
  border-bottom: 1px solid var(--line-light);
  color: var(--regular);
  font-size: 13px;
}

.orders-import-compare-table > div:nth-last-child(-n + 4) {
  border-bottom: 0;
}

.orders-import-compare-head {
  background: var(--surface-muted);
  color: var(--muted) !important;
  font-weight: 750;
}

.orders-import-reminders {
  display: grid;
  gap: 8px;
}

.positive-text {
  color: #087452 !important;
  font-weight: 750;
}

.danger-text {
  color: #b42318 !important;
  font-weight: 750;
}

.orders-import-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.inline-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--regular);
  font-size: 14px;
  white-space: nowrap;
}

.orders-review-list,
.orders-batch-list {
  display: grid;
  gap: 10px;
}

.orders-review-card {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.orders-review-card.resolved {
  opacity: 0.68;
}

.orders-review-card strong,
.orders-review-card small {
  display: block;
}

.orders-review-card small {
  margin-top: 4px;
  color: var(--muted);
}

.orders-review-values {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  min-width: 0;
}

.orders-review-values span {
  min-height: 38px;
  padding: 8px 10px;
  border-radius: var(--radius-base);
  background: var(--surface-muted);
  color: var(--regular);
  white-space: pre-wrap;
  word-break: break-word;
}

.orders-batch-counts {
  color: var(--regular);
  font-size: 13px;
  white-space: nowrap;
}

.orders-summary-group-list {
  display: grid;
  gap: 10px;
}

.orders-detail-main {
  display: grid;
  gap: 14px;
}

.orders-detail-main > .panel,
.orders-detail-main > .summary-grid {
  margin-bottom: 0;
}

.orders-detail-metric-band {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.orders-detail-page .summary-card {
  display: grid;
  gap: 3px;
  padding: 16px;
  border-color: var(--line-light);
}

.orders-detail-page .summary-card strong {
  margin: 0;
  font-size: 24px;
  line-height: 30px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.orders-detail-page .summary-card span {
  color: var(--regular);
  font-size: 13px;
  font-weight: 650;
}

.orders-detail-page .summary-card small {
  color: var(--muted);
  font-size: 12px;
}

.orders-detail-report-panel {
  border-color: #cfdff7;
  background: linear-gradient(180deg, #fff 0%, #fbfdff 100%);
}

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

.orders-detail-summary-bands > .panel {
  margin-bottom: 0;
}

.orders-detail-summary-bands > .panel:last-child {
  grid-column: 1 / -1;
}

.orders-detail-entry-panel {
  padding: 14px 16px;
}

.orders-detail-entry {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.orders-detail-entry h2 {
  display: inline-flex;
  align-items: center;
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 24px;
}

.orders-detail-entry .pill {
  margin-left: 10px;
}

.orders-detail-entry-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0;
  color: var(--accent);
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.orders-detail-entry-link:hover {
  text-decoration: underline;
}

.orders-detail-entry-link[aria-disabled] {
  color: var(--muted);
  pointer-events: none;
}

.orders-summary-group-table {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(90px, 120px) minmax(120px, 150px) minmax(120px, 150px) minmax(80px, 100px);
  overflow: hidden;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.orders-summary-group-table > div {
  min-width: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line-light);
  color: var(--regular);
  font-size: 14px;
}

.orders-summary-group-table > div:nth-last-child(-n + 5) {
  border-bottom: 0;
}

.orders-summary-group-head {
  background: var(--surface-muted);
  color: var(--muted) !important;
  font-size: 12px !important;
  font-weight: 750;
}

.orders-filter-controls {
  display: grid;
  grid-template-columns: repeat(2, minmax(220px, 320px));
  gap: 16px;
  align-items: end;
}

.orders-filter-controls label {
  display: grid;
  gap: 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
}

.orders-filter-controls select {
  width: 100%;
  height: 40px;
}

.orders-filter-workspace {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
}

.orders-filter-rail {
  position: sticky;
  top: 16px;
  align-self: start;
}

.orders-filter-rail-head {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
}

.orders-filter-rail-head h2 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 22px;
}

.orders-filter-rail-head p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.orders-filter-clear {
  min-height: 24px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font-size: 12px;
  line-height: 20px;
  font-weight: 650;
  box-shadow: none;
  white-space: nowrap;
}

.orders-filter-clear:hover {
  background: transparent;
  text-decoration: underline;
}

.orders-filter-active-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.orders-filter-active-chips span {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: var(--radius-base);
  background: #f0f6ff;
  color: var(--accent);
  font-size: 12px;
  line-height: 18px;
  font-weight: 650;
}

.orders-filter-active-chips em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.orders-list-panel {
  min-width: 0;
}

.orders-detail-filter-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.orders-filter-group {
  position: relative;
  min-width: 0;
}

.orders-filter-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 36px;
  padding: 7px 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--text);
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  list-style: none;
}

.orders-filter-group summary::-webkit-details-marker {
  display: none;
}

.orders-filter-group summary::after {
  content: "⌄";
  color: var(--weak);
  font-size: 12px;
}

.orders-filter-group[open] summary {
  border-color: #cfdff7;
  background: #f8fbff;
}

.orders-filter-group[open] summary::after {
  content: "⌃";
}

.orders-filter-group summary b {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
  white-space: nowrap;
}

.orders-filter-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 9px 0 3px;
}

.orders-filter-check {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--regular);
  font-size: 12px;
}

.orders-filter-check input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.orders-filter-check b {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.orders-filter-empty {
  color: var(--muted);
  font-size: 13px;
}

.numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.orders-report-preview-cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.orders-report-preview-cards article {
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.orders-report-preview-cards strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 24px;
  line-height: 30px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}

.orders-report-preview-cards span {
  display: block;
  color: var(--regular);
  font-size: 13px;
  font-weight: 650;
}

.orders-report-preview-cards small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.orders-report-preview-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 16px;
}

.orders-report-preview-group {
  min-width: 0;
}

.orders-report-preview-group h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
}

.orders-row-actions {
  display: grid;
  grid-template-columns: repeat(2, max-content);
  align-items: center;
  justify-content: flex-start;
  justify-items: start;
  gap: 3px 12px;
  min-width: 0;
}

.orders-row-actions button {
  min-height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 12px;
  line-height: 20px;
  font-weight: 650;
  box-shadow: none;
}

.orders-row-actions button:hover {
  background: transparent;
  text-decoration: underline;
}

.orders-text-action.primary {
  color: var(--accent);
}

.orders-text-action.danger {
  color: var(--accent);
}

.orders-action-note {
  color: var(--muted);
  font-size: 12px;
  line-height: 20px;
  white-space: nowrap;
}

.orders-manual-reason {
  display: grid;
  gap: 3px;
  min-width: 180px;
}

.orders-manual-reason strong {
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
  font-weight: 650;
}

.orders-manual-reason small {
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
}

.orders-manual-flow {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.orders-manual-head {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.orders-manual-head span {
  color: var(--weak);
  font-size: 12px;
  font-weight: 650;
}

.orders-manual-head strong {
  min-width: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
  font-weight: 700;
}

.orders-manual-issues {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.orders-manual-issue {
  display: grid;
  grid-template-columns: 18px minmax(86px, 0.9fr) auto minmax(92px, 1fr);
  gap: 5px;
  align-items: center;
  min-width: 0;
  color: var(--regular);
  font-size: 12px;
  line-height: 18px;
}

.orders-manual-check {
  display: inline-grid;
  place-items: center;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #fff4d6;
  color: #9a5b00;
  font-size: 11px;
  font-weight: 800;
  line-height: 16px;
}

.orders-manual-issue.done .orders-manual-check {
  background: #e7f7ef;
  color: #0faf62;
}

.orders-manual-cause,
.orders-manual-result {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-manual-cause {
  color: var(--regular);
}

.orders-manual-arrow {
  color: var(--weak);
  font-size: 12px;
}

.orders-manual-result {
  color: var(--text);
  font-weight: 650;
}

.orders-manual-issue.pending .orders-manual-result {
  color: #9a5b00;
}

.orders-action-tip {
  display: inline-block;
  margin: 2px 4px 2px 0;
  padding: 2px 6px;
  border-radius: var(--radius-base);
  background: var(--surface-muted);
  color: var(--regular);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.orders-manual-record {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 190px;
}

.orders-manual-record span {
  display: inline-block;
  padding: 2px 6px;
  border-radius: var(--radius-base);
  background: #eef6ff;
  color: var(--regular);
  font-size: 12px;
  line-height: 18px;
  white-space: nowrap;
}

.orders-remark-stack {
  display: grid;
  gap: 4px;
  min-width: 220px;
  max-width: 320px;
}

.orders-remark-stack div {
  display: grid;
  gap: 2px;
}

.orders-remark-stack b {
  color: var(--regular);
  font-size: 12px;
  line-height: 16px;
  font-weight: 750;
}

.orders-remark-stack span {
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
  font-weight: 650;
}

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

.orders-compact-groups {
  display: grid;
  gap: 20px;
}

.orders-compact-group {
  display: grid;
  min-width: 0;
  border-top: 1px solid var(--line-light);
}

.orders-compact-group:first-child {
  border-top: 0;
}

.orders-compact-group-head {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0 12px;
}

.orders-compact-group-head > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.orders-compact-group-head span:not(.orders-status-pill) {
  color: var(--muted);
  font-size: 13px;
}

.orders-compact-group-head b {
  color: var(--muted);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.orders-status-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  border-radius: var(--radius-base);
  font-size: 12px;
  line-height: 18px;
  font-weight: 650;
  white-space: nowrap;
}

.orders-status-pill.success {
  background: #e7f7ef;
  color: #0faf62;
}

.orders-status-pill.warning {
  background: #fff4d6;
  color: #9a5b00;
}

.orders-status-pill.danger {
  background: #fdecec;
  color: #e84646;
}

.orders-status-pill.neutral {
  background: var(--surface-muted);
  color: var(--muted);
}

.orders-focus-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: var(--radius-base);
  background: #fff4d6;
  color: #9a5b00;
  font-size: 12px;
  line-height: 18px;
  font-weight: 650;
  white-space: nowrap;
}

.orders-compact-grid-head,
.orders-compact-row {
  display: grid;
  grid-template-columns: minmax(260px, 1.35fr) minmax(300px, 1.5fr) minmax(180px, 0.85fr) minmax(150px, 0.7fr);
  gap: 14px;
  min-width: 0;
}

.orders-compact-grid-head {
  padding: 10px 12px;
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.orders-compact-row {
  padding: 14px 12px;
  border-bottom: 1px solid var(--line-light);
}

.orders-compact-row:last-child {
  border-bottom: 0;
}

.orders-compact-cell {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.orders-compact-title {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: baseline;
  min-width: 0;
}

.orders-compact-title strong,
.orders-compact-title span,
.orders-compact-product,
.orders-compact-muted {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-compact-title strong {
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.orders-compact-title span {
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.orders-compact-product {
  color: var(--text);
  font-size: 13px;
  line-height: 19px;
}

.orders-compact-muted {
  color: var(--muted);
  font-size: 12px;
}

.orders-compact-meta,
.orders-compact-tags,
.orders-finance-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 5px 10px;
  min-width: 0;
}

.orders-compact-meta span,
.orders-finance-stack span {
  color: var(--muted);
  font-size: 12px;
  line-height: 18px;
}

.orders-compact-meta b,
.orders-finance-stack b {
  margin-right: 3px;
  color: var(--weak);
  font-weight: 650;
}

.orders-finance-stack strong {
  width: 100%;
  color: var(--text);
  font-size: 14px;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}

.orders-purchase-splits {
  display: grid;
  width: 100%;
  gap: 3px;
  margin-top: 2px;
}

.orders-purchase-split {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: fit-content;
  max-width: 100%;
  padding: 2px 6px;
  border-radius: var(--radius-base);
  background: #f5f8fc;
  color: var(--muted);
  font-size: 12px;
  line-height: 17px;
}

.orders-purchase-split em {
  overflow: hidden;
  max-width: 120px;
  color: var(--weak);
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-tag-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 22px;
  padding: 2px 7px;
  border-radius: var(--radius-base);
  font-size: 12px;
  line-height: 18px;
  font-weight: 650;
  white-space: nowrap;
}

.orders-tag-pill.blue {
  background: #eef3ff;
  color: #245bff;
}

.orders-tag-pill.red {
  background: #fff0f0;
  color: #e32b2b;
}

.orders-tag-pill.green {
  background: #eaf9ee;
  color: #21b339;
}

.orders-tag-pill.purple {
  background: #f7edff;
  color: #9b2fea;
}

.orders-tag-pill.orange {
  background: #fff2e0;
  color: #f08300;
}

.orders-tag-pill.sky {
  background: #edf8ff;
  color: #3da5e8;
}

.orders-tag-pill.pink {
  background: #fff0f7;
  color: #d93d8b;
}

.orders-tag-pill.olive {
  background: #f8f9e6;
  color: #889a00;
}

.orders-tag-pill.magenta {
  background: #fff0f7;
  color: #e12a8c;
}

.orders-tag-pill.neutral {
  background: var(--surface-muted);
  color: var(--muted);
}

.orders-compact-label {
  color: var(--weak);
  font-size: 12px;
  font-weight: 650;
}

.orders-compact-action .orders-action-tip {
  white-space: normal;
}

.orders-compact-action .orders-row-actions {
  min-width: 0;
}

.orders-compact-action .orders-row-actions button {
  min-height: 24px;
  padding: 0;
}

.orders-compact-row .orders-manual-reason,
.orders-compact-row .orders-manual-flow,
.orders-compact-row .orders-manual-record,
.orders-compact-row .orders-remark-stack {
  min-width: 0;
  max-width: none;
}

.orders-compact-row .orders-manual-record span,
.orders-compact-row .orders-action-tip {
  white-space: normal;
}

button.danger-light {
  border-color: #f3b7b7;
  background: #fff;
  color: #e84646;
}

.orders-year-groups {
  display: grid;
  gap: 16px;
}

.orders-year-section {
  display: grid;
  gap: 10px;
}

.orders-month-list {
  display: grid;
  gap: 8px;
}

.orders-month-row {
  display: grid;
  grid-template-columns: minmax(160px, 1.2fr) repeat(6, minmax(78px, 0.7fr)) minmax(170px, 1fr);
  gap: 10px;
  align-items: center;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.orders-month-row:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-light);
  transform: translateY(-1px);
}

.orders-month-row span,
.orders-month-main {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.orders-month-row b {
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-month-row small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.orders-month-main b {
  font-size: 18px;
}

.orders-month-updated b {
  font-size: 13px;
}

.warn-text b {
  color: var(--warn);
}

.warn-row {
  background: #fff7e6;
}

.analysis-table {
  min-width: 760px;
}

.analysis-table td,
.analysis-table th {
  text-align: right;
}

.analysis-table td:first-child,
.analysis-table th:first-child {
  text-align: left;
}

.analysis-detail-table td:nth-child(2),
.analysis-detail-table th:nth-child(2) {
  text-align: left;
}

.analysis-table td strong,
.analysis-table td small {
  display: block;
}

.analysis-table td small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 400;
}

.analysis-detail-list {
  display: grid;
  gap: 14px;
}

.analysis-period {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.analysis-period-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}

.analysis-period-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.analysis-period-head p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.analysis-total-row td {
  background: var(--fill);
  color: var(--text);
  font-weight: 700;
}

.commission-bar-chart {
  position: relative;
  min-width: 0;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 16px;
  margin-bottom: 10px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--regular);
  font-size: 13px;
  font-weight: 650;
}

.chart-legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.chart-scroll {
  overflow: hidden;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.grouped-bar-svg {
  display: block;
  min-width: 0;
  width: 100%;
  height: auto;
}

.chart-grid-line {
  stroke: var(--line-lighter);
  stroke-width: 1;
}

.chart-axis-line {
  stroke: var(--line);
  stroke-width: 1;
}

.chart-y-text,
.chart-x-text {
  fill: var(--muted);
  font-size: 13px;
}

.chart-value-text {
  fill: var(--text);
  font-size: 11px;
  font-weight: 650;
}

.chart-y-text-right {
  fill: #722ed1;
}

.quantity-line {
  fill: none;
  stroke: #722ed1;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 3;
}

.quantity-point {
  fill: #fff;
  stroke: #722ed1;
  stroke-width: 3;
}

.commission-chart-hover-zone {
  cursor: crosshair;
}

.commission-chart-tooltip {
  position: absolute;
  z-index: 8;
  display: none;
  min-width: 220px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-light);
  pointer-events: none;
}

.commission-chart-tooltip.show {
  display: grid;
  gap: 7px;
}

.commission-chart-tooltip strong {
  color: var(--text);
  font-size: 14px;
}

.commission-chart-tooltip span {
  display: grid;
  grid-template-columns: 10px minmax(82px, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}

.commission-chart-tooltip i {
  width: 8px;
  height: 8px;
  border-radius: 999px;
}

.commission-chart-tooltip b {
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.detail-shop-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(480px, 100%), 1fr));
  gap: 14px;
}

.detail-shop-card {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: var(--fill-light);
}

.detail-shop-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.detail-shop-head h4 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
}

.detail-shop-head span,
.detail-source-header,
.detail-source-row span {
  color: var(--muted);
  font-size: 12px;
}

.detail-shop-head span {
  display: block;
  margin-top: 6px;
}

.detail-help-total {
  display: grid;
  justify-items: end;
  gap: 6px;
  min-width: 120px;
}

.detail-help-total b {
  color: var(--accent-dark);
  font-size: 22px;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
}

.detail-source-list {
  display: grid;
  gap: 8px;
}

.detail-source-header,
.detail-source-row {
  display: grid;
  grid-template-columns: minmax(52px, 0.7fr) minmax(48px, 0.6fr) minmax(90px, 1fr) minmax(150px, 1.35fr);
  align-items: center;
  gap: 8px;
}

.detail-source-header {
  padding: 0 10px;
  font-weight: 700;
}

.detail-source-row {
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.detail-source-row b,
.detail-source-row strong {
  color: var(--text);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
}

.detail-source-row strong {
  color: var(--accent-dark);
}

.detail-help-cell {
  display: inline-grid;
  grid-template-columns: 64px auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.detail-help-cell strong {
  white-space: nowrap;
}

.detail-source-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-width: 48px;
  height: 24px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--regular);
  font-size: 12px;
  font-weight: 700;
}

.mom-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  min-height: 24px;
  padding: 0 8px;
  border-radius: 999px;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  white-space: nowrap;
}

.detail-help-cell .mom-tag {
  font-size: 12px;
  font-weight: 600;
}

.mom-tag.up {
  color: #cf1322;
  background: #fff1f0;
  border: 1px solid #ffa39e;
}

.mom-tag.down {
  color: #237804;
  background: #f6ffed;
  border: 1px solid #b7eb8f;
}

.mom-tag.neutral {
  color: var(--muted);
  background: var(--fill);
  border: 1px solid var(--line);
}

#toast {
  position: fixed;
  right: 20px;
  bottom: 20px;
  max-width: 420px;
  padding: 12px 14px;
  border-radius: var(--radius-base);
  color: #fff;
  background: #303133;
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
  box-shadow: var(--shadow-light);
}

#toast.show {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1180px) {
  .inventory-auto-workbench {
    grid-template-columns: 1fr;
  }

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

  .inventory-active-task-body {
    grid-template-columns: minmax(240px, 1fr) minmax(240px, 1fr) auto;
  }

  .inventory-active-stats {
    grid-column: 1 / 3;
  }

  .inventory-active-task-body .inventory-history-actions {
    justify-content: flex-end;
  }
}

@media (max-width: 1240px) {
  .chart-section,
  .columns {
    grid-template-columns: 1fr;
  }

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

  .spot-kpi {
    border-top: 1px solid var(--line-light);
  }

  .spot-kpi:nth-child(-n + 2) {
    border-top: 0;
  }

  .spot-kpi:nth-child(2n) {
    border-right: 0;
  }

  .commission-row {
    grid-template-columns: minmax(220px, 1fr) minmax(0, 1.2fr);
  }

  .commission-row .card-link {
    justify-content: flex-start;
  }

  .report-page-shell {
    grid-template-columns: minmax(0, 1fr) 320px;
  }

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

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

  .manual-task-grid {
    grid-template-columns: 1fr;
  }

  #filtered-summary-list.compact-count-list {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .qn-tagging-layout {
    grid-template-columns: 1fr;
  }

  .qn-tagging-run-list {
    max-height: 360px;
  }

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

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

  .sidebar {
    position: sticky;
    top: 0;
    z-index: 30;
    display: block;
    align-self: start;
    height: auto;
    padding: 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow: visible;
  }

  .sidebar-toggle {
    display: none;
  }

  .sidebar-brand {
    padding: 0 4px 10px;
  }

  .sidebar-brand p {
    display: none;
  }

  .side-nav {
    flex: 0 0 auto;
    min-height: 0;
    display: flex;
    gap: 6px;
    margin-top: 10px;
    padding-bottom: 2px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
  }

  .side-nav-section {
    display: contents;
  }

  .side-nav-section-title {
    display: none;
  }

  .side-nav-group {
    display: contents;
  }

  .side-nav-item {
    flex: 0 0 auto;
    width: auto;
    height: 38px;
    grid-template-columns: 18px auto;
    gap: 8px;
    padding: 0 10px;
    border-radius: var(--radius-base);
  }

  .nav-caret {
    display: none;
  }

  .side-submenu {
    display: flex;
    gap: 6px;
    padding: 0;
    background: transparent;
  }

  .side-submenu.collapsed {
    display: flex;
  }

  .side-subitem {
    grid-template-columns: auto;
    padding: 0 12px;
    color: rgba(255, 255, 255, 0.62);
    background: rgba(255, 255, 255, 0.06);
  }

  .side-nested-group {
    display: contents;
  }

  .side-nested-parent {
    grid-template-columns: auto;
    padding: 0 12px;
  }

  .side-third-submenu {
    display: flex;
    gap: 6px;
  }

  .side-third-submenu.collapsed {
    display: flex;
  }

  .side-third-item {
    padding: 0 12px;
  }

  .topbar,
  .upload-panel,
  .section-head {
    align-items: stretch;
    flex-direction: column;
  }

  .final-actions-card,
  .danger-zone {
    align-items: stretch;
    flex-direction: column;
  }

  .final-buttons {
    justify-content: flex-start;
  }

  .trend-split-card {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .trend-latest {
    border-right: 0;
    border-bottom: 1px solid var(--line-light);
  }

  .trend-chart {
    height: 300px;
  }

  .history-main {
    grid-template-columns: 18px 1fr;
  }

  .history-main span,
  .history-main em {
    grid-column: 2;
    justify-self: start;
  }

  .history-detail {
    grid-template-columns: 1fr;
    padding-left: 14px;
  }

  .grid,
  .columns,
  .fee-grid,
  .fill-items-grid,
  .fill-ledger-grid,
  .toolbar-form,
  .sub-grid,
  .report-status-grid,
  .manual-overview-grid,
  .manual-task-grid,
  .manual-priority-grid,
  .manual-secondary-grid,
  .ant-steps,
  .catalog-overview-grid,
  .catalog-brand-grid,
  .chart-section,
	  .inventory-upload-grid,
    .inventory-current-steps,
	  .inventory-auto-steps,
	  .inventory-brand-rows,
	  .spot-kpi-strip,
	  .spot-inline-filters,
	  .inventory-rule-grid {
    grid-template-columns: 1fr;
  }

  .recent-upload-item {
    grid-template-columns: 1fr;
    align-items: start;
    gap: 6px;
  }

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

	  .inventory-history-summary-item {
	    grid-template-columns: 1fr;
	    align-items: start;
	  }

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

    .inventory-task-detail-panel {
      position: static;
      margin-top: 0;
    }

	  .inventory-history-summary-item .inventory-history-actions,
	  .inventory-history-summary-item .inventory-history-action-row {
	    justify-items: start;
	    justify-content: flex-start;
	  }

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

	  .inventory-history-actions {
	    justify-content: flex-start;
	  }

  .inventory-extract-controls,
  .inventory-current-actions,
  .inventory-active-task-body {
    grid-template-columns: 1fr;
  }

  .inventory-current-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .inventory-current-actions .history-action-link {
    width: 100%;
  }

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

  .inventory-history-table {
    overflow-x: auto;
  }

  .inventory-history-table-row {
    min-width: 1120px;
  }

  .recent-upload-header {
    display: none;
  }

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

  .fill-group-head {
    align-items: stretch;
    flex-direction: column;
  }

  .shipping-mode-field {
    width: 100%;
  }

  .other-fee-ledger {
    overflow-x: auto;
  }

  .other-fee-ledger table {
    min-width: 560px;
  }

  .final-save-rail {
    position: static;
    top: auto;
    z-index: auto;
    max-height: none;
    margin-bottom: 12px;
    overflow: visible;
  }

  .final-rail-body {
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .rail-buttons {
    position: static;
    margin: 0;
    padding: 0;
    border-top: 0;
    background: transparent;
    backdrop-filter: none;
  }

  .spot-kpi {
    border-right: 0;
    border-top: 1px solid var(--line-light);
  }

  .spot-kpi:first-child {
    border-top: 0;
  }

  .ant-step:not(:last-child)::after {
    display: none;
  }

  .catalog-form {
    grid-template-columns: 1fr 1fr;
  }

  .commission-row,
  .commission-basic-grid {
    grid-template-columns: 1fr;
  }

  .commission-row {
    padding-right: 16px;
  }

  .commission-row > div:first-child,
  .commission-group,
  .commission-row .card-link {
    grid-column: auto;
    grid-row: auto;
  }

  .commission-group,
  .commission-group.amount,
  .commission-group.adjustment {
    grid-template-columns: 1fr 1fr;
    padding: 10px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line-light);
  }

  .commission-group.adjustment {
    grid-template-columns: 1fr;
  }

  .commission-row .card-link {
    position: static;
    justify-content: flex-start;
    padding: 10px 0 0;
    border-left: 0;
    border-top: 1px solid var(--line-light);
  }

  .result-overview,
  .result-descriptions {
    grid-template-columns: 1fr;
  }

  .result-desc-item {
    border-right: 0;
  }

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

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

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

  .final-mini-metrics {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  body {
    font-size: 14px;
  }

  h1 {
    font-size: 22px;
    line-height: 1.25;
  }

  h2 {
    font-size: 17px;
  }

  h3 {
    font-size: 15px;
  }

  .app-shell {
    width: 100%;
    grid-template-columns: minmax(0, 1fr);
    overflow-x: clip;
  }

  .content-shell {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: hidden;
  }

  .sidebar {
    padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  }

  .sidebar-brand {
    padding: 0 2px 8px;
  }

  .sidebar-brand h1 {
    gap: 6px;
    font-size: 17px;
  }

  .sidebar-brand h1::after {
    min-height: 17px;
    padding: 0 6px;
    font-size: 10px;
    line-height: 17px;
  }

  .side-nav {
    gap: 6px;
    margin-top: 8px;
    padding-bottom: 4px;
    scrollbar-width: none;
  }

  .side-nav-section {
    display: contents;
  }

  .side-nav-section-title {
    display: none;
  }

  .side-nav::-webkit-scrollbar {
    display: none;
  }

  .side-nav-item {
    min-height: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: var(--radius-base);
    font-size: 14px;
  }

  .side-subitem {
    min-width: 72px;
    justify-content: center;
  }

  .topbar {
    gap: 12px;
    padding: 14px 16px;
  }

  .topbar p {
    font-size: 13px;
    line-height: 1.55;
  }

  main {
    padding: 12px 10px calc(18px + env(safe-area-inset-bottom));
  }

  .report-flow-panel {
    top: 0;
    gap: 6px;
    margin-bottom: 12px;
    padding: 8px;
  }

  .flow-step {
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 50px;
    padding: 8px;
  }

  .flow-step span {
    width: 24px;
    height: 24px;
  }

  .panel {
    padding: 14px 12px;
    margin-bottom: 12px;
  }

  .module-title {
    flex-wrap: wrap;
  }

  .step-state {
    margin-left: 40px;
  }

  .header-actions {
    width: 100%;
    justify-content: flex-start;
  }

  .header-actions > *,
  .header-actions button,
  .header-actions .button-like {
    width: 100%;
    justify-content: center;
  }

  .header-actions .auth-user-chip {
    width: auto;
    max-width: 100%;
    justify-content: flex-start;
    white-space: nowrap;
  }

  .header-actions .auth-user-chip span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .header-actions .auth-user-chip button {
    width: auto;
    min-height: 24px;
  }

  .permission-group-items {
    grid-template-columns: 1fr;
  }

  button,
  .button-like,
  .card-link,
  input,
  select,
  textarea {
    min-height: 40px;
  }

  .drop-zone {
    width: 100%;
    min-width: 0;
    min-height: 64px;
    height: auto;
    padding: 14px 12px;
    line-height: 1.45;
  }

  .section-head.compact {
    gap: 8px;
  }

  .trend-latest h2 {
    font-size: 28px;
  }

  .trend-panel {
    border-radius: var(--radius-base);
    overflow: hidden;
  }

  .trend-split-card {
    background: #fff;
    min-width: 0;
  }

  .trend-latest,
  .trend-chart-side {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    padding: 16px 14px;
  }

  .trend-card-head {
    gap: 8px;
    margin-bottom: 12px;
  }

  .trend-kpis {
    gap: 5px;
  }

  .trend-kpis div,
  .trend-kpi-row,
  .report-card .metric {
    align-items: baseline;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    width: 100%;
    max-width: 100%;
    gap: 8px;
  }

  .trend-kpis b,
  .trend-kpi-row b,
  .report-card .metric b {
    max-width: 52vw;
    justify-self: end;
    overflow-wrap: anywhere;
    text-align: right;
  }

  .trend-popover-actions {
    gap: 8px;
    margin-bottom: 12px;
  }

  .trend-chart-wrap {
    margin: 0 -4px;
    overflow: hidden;
  }

  .trend-chart {
    min-width: 0;
    height: 248px;
  }

  .trend-card-head,
  .report-card-head,
  .card-actions,
  .import-result-summary,
  .final-buttons,
  .inline-actions,
  .inventory-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .trend-popover-actions > *,
  .final-buttons > *,
  .inline-actions > *,
  .inventory-actions > * {
    width: 100%;
    justify-content: center;
  }

  .stat-grid,
  .steps {
    grid-template-columns: 1fr;
  }

  .compact-count-list,
  #filtered-summary-list.compact-count-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .compact-manual-card .manual-price-row {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .compact-manual-card .manual-price-row .manual-price-input {
    grid-column: 1 / -1;
  }

  .metric,
  .ant-list-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }

  .metric-value,
  .stacked-cell {
    justify-items: start;
    min-width: 0;
    text-align: left;
  }

  .report-card .metric-value,
  .report-card .stacked-cell {
    justify-items: end;
    text-align: right;
  }

  .metric.highlight,
  .metric-toggle {
    grid-template-columns: 18px minmax(0, 1fr);
    min-height: 40px;
  }

  .metric.highlight .metric-value,
  .metric-toggle .metric-value {
    grid-column: 2;
    justify-self: start;
    text-align: left;
  }

  .report-card {
    padding: 14px 12px;
  }

  .report-card-head strong {
    font-size: 17px;
  }

  .current-report-body > .report-card {
    max-width: none;
  }

  .profit-details,
  .fee-details {
    padding-left: 18px;
  }

  .history-main {
    grid-template-columns: 18px 1fr;
    gap: 6px 10px;
    padding: 12px;
  }

  .history-main strong {
    font-size: 16px;
  }

  .history-main span,
  .history-main em {
    grid-column: 2;
    justify-self: start;
  }

  .history-main b,
  .history-main small {
    display: inline-block;
    margin-left: 6px;
  }

  .history-detail {
    gap: 6px;
    padding: 10px 12px 12px 30px;
  }

  .report-chart-block {
    margin-top: 14px;
    padding-top: 12px;
  }

  .chart-section {
    gap: 12px;
  }

  .chart-table {
    border-radius: var(--radius-base);
  }

  .chart-table h3 {
    padding: 12px;
    white-space: normal;
  }

  .chart-table table {
    min-width: 680px;
  }

  .chart-table th,
  .chart-table td {
    padding: 9px 10px;
    font-size: 13px;
  }

  .chart-table .title-cell {
    min-width: 180px;
    max-width: 260px;
  }

  .catalog-form,
  .commission-group,
  .commission-group.amount,
  .commission-group.adjustment,
  .drawer-metric-grid,
  .import-result-group summary {
    grid-template-columns: 1fr;
  }

  .import-result-group summary b,
  .import-result-group summary small {
    justify-self: start;
    text-align: left;
  }

  .import-result-row {
    grid-template-columns: 1fr;
    white-space: normal;
  }

  .table-wrap {
    border-radius: var(--radius-base);
  }

  .table-wrap table {
    min-width: 760px;
  }

  th,
  td {
    padding: 9px 10px;
    font-size: 13px;
  }

  .data-table {
    min-width: 920px;
  }

  .commission-row {
    gap: 12px;
    padding: 12px;
  }

  .commission-group,
  .commission-group.amount,
  .commission-group.adjustment {
    grid-template-columns: 1fr;
  }

  .commission-adjustment-amount {
    text-align: left;
  }

  .commission-adjustment-detail {
    white-space: normal;
  }

  .commission-breakdown-grid {
    grid-template-columns: 1fr;
  }

  .commission-breakdown-item small {
    white-space: normal;
  }

  .commission-row .card-link {
    width: 100%;
  }

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

  .wide-summary {
    grid-column: auto;
  }

  .drawer-panel {
    width: 100%;
  }

  .drawer-head,
  .drawer-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .modal-card {
    width: calc(100% - 24px);
    max-height: calc(100dvh - 32px);
    overflow: auto;
  }

  .modal-actions {
    flex-direction: column-reverse;
  }

  .modal-actions button {
    width: 100%;
  }

  .embedded-tool-frame {
    height: calc(100dvh - 142px);
    min-height: 560px;
  }

  .chart-label,
  .chart-y-label,
  .chart-axis-title {
    font-size: 14px;
  }

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

  .detail-shop-head {
    align-items: stretch;
    flex-direction: column;
  }

  .detail-help-total {
    justify-items: start;
  }

  .detail-source-header {
    display: none;
  }

  .detail-source-row {
    grid-template-columns: minmax(58px, 0.8fr) minmax(48px, 0.6fr) minmax(82px, 1fr);
  }

  .detail-help-cell {
    grid-column: 2 / -1;
  }
}

@media (max-width: 1180px) {
  .commission-edit-layout {
    grid-template-columns: 1fr;
  }

  .commission-edit-main,
  .commission-file-sidebar {
    width: 100%;
  }

  .commission-basic-panel .commission-basic-grid,
  .commission-metric-strip {
    grid-template-columns: 1fr;
  }

  .commission-metric-money,
  .commission-metric-status {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .commission-process-panel .module-title {
    display: grid;
  }

  .commission-process-panel .module-actions {
    margin-left: 0;
  }
}

@media (max-width: 900px) {
  .orders-import-bar,
  .orders-control-grid,
  .orders-review-card,
  .orders-review-values,
  .orders-control-grid.index-mode,
  .orders-filter-controls,
  .orders-detail-metric-band,
  .orders-detail-summary-bands,
  .orders-filter-workspace,
  .orders-detail-filter-grid {
    grid-template-columns: 1fr;
  }

  .orders-detail-summary-bands > .panel:last-child {
    grid-column: auto;
  }

  .orders-detail-entry {
    align-items: flex-start;
    flex-direction: column;
    gap: 8px;
  }

  .orders-filter-rail {
    position: static;
  }

  .orders-summary-group-table {
    grid-template-columns: minmax(120px, 1fr) minmax(72px, 90px) minmax(100px, 120px) minmax(100px, 120px) minmax(72px, 80px);
  }

  .orders-compact-grid-head {
    display: none;
  }

  .orders-compact-row {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .orders-compact-cell {
    gap: 6px;
  }

  .orders-compact-action .orders-row-actions {
    justify-content: flex-start;
  }

  .orders-import-label {
    align-self: start;
  }

  .orders-list-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
    width: 100%;
  }

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

  .orders-month-main,
  .orders-month-updated {
    grid-column: 1 / -1;
  }

  .orders-review-card button {
    width: 100%;
  }

  .orders-batch-counts {
    white-space: normal;
  }
}

.readonly-pill {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: #237804;
}

.purchase-location-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
}

.purchase-location-hero h2 {
  margin: 0 0 6px;
}

.purchase-location-hero p {
  margin: 0;
  color: var(--muted);
}

.purchase-location-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(92px, 1fr));
  gap: 10px;
}

.purchase-location-meta div {
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  padding: 10px 12px;
  background: #fafafa;
}

.purchase-location-meta span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.purchase-location-meta b {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
}

.purchase-location-content {
  display: grid;
  margin-top: 16px;
}

.purchase-location-workbench {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}

.purchase-location-index {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.purchase-location-index button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  padding: 8px 10px;
  background: #fff;
  color: var(--text);
  box-shadow: none;
  text-align: left;
}

.purchase-location-index button:hover,
.purchase-location-index button:focus-visible {
  border-color: #91caff;
  color: var(--accent);
}

.purchase-location-index button.active {
  border-color: #91caff;
  background: #e6f4ff;
  color: #0958d9;
}

.purchase-location-index button span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-location-index button b {
  color: inherit;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.purchase-location-index-note {
  display: grid;
  gap: 4px;
  margin-top: 4px;
  border-left: 3px solid #91caff;
  padding: 2px 0 2px 10px;
  color: var(--regular);
  font-size: 13px;
}

.purchase-location-index-note strong {
  color: var(--text);
}

.purchase-location-index-note span {
  color: var(--regular);
}

.purchase-location-detail {
  padding: 0;
  overflow: hidden;
}

.purchase-location-detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 18px;
  border-bottom: 1px solid var(--line-light);
  background: #fff;
}

.purchase-location-detail-head h2 {
  margin: 0 0 4px;
  font-size: 22px;
  line-height: 1.25;
}

.purchase-location-detail-head p {
  margin: 0;
  color: var(--muted);
}

.purchase-location-ruleset {
  display: grid;
}

.purchase-location-rule-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) 154px;
  gap: 14px;
  padding: 16px 18px;
  border-bottom: 1px solid var(--line-light);
}

.purchase-location-rule-row:last-child {
  border-bottom: 0;
}

.purchase-location-rule-name strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 15px;
}

.purchase-location-rule-name span {
  display: block;
  color: var(--muted);
}

.purchase-location-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.purchase-location-rule-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  padding: 12px;
  background: #fbfbfb;
}

.purchase-location-rule-card h3 {
  margin: 0 0 8px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
}

.purchase-location-rule-card-config {
  background: #fff;
}

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

.purchase-location-config label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.purchase-location-config label span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.purchase-location-config input[type="number"],
.purchase-location-config input[type="text"] {
  width: 100%;
  height: 32px;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--text);
}

.purchase-location-config input[readonly] {
  background: var(--fill);
  color: var(--regular);
}

.purchase-location-switch {
  display: flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px;
}

.purchase-location-switch input {
  width: auto;
}

.purchase-location-config button {
  align-self: end;
  min-height: 32px;
}

.purchase-location-rule-state {
  min-width: 0;
}

.purchase-location-module-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.purchase-location-tag {
  display: inline-flex;
  align-items: center;
  margin: 0 6px 6px 0;
  border: 1px solid #d9d9d9;
  border-radius: 999px;
  padding: 2px 8px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}

.purchase-location-rules {
  margin: 0;
  padding-left: 18px;
  color: var(--text);
  font-size: 13px;
}

.purchase-location-rules li + li {
  margin-top: 5px;
}

.purchase-location-status {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  border-radius: 999px;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 700;
}

.purchase-location-status.implemented {
  background: #e6f4ff;
  color: #0958d9;
}

.purchase-location-status.readonly {
  background: #fff7e6;
  color: #ad6800;
}

.purchase-location-matrix-panel {
  padding: 0;
  overflow: hidden;
}

.purchase-location-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line-light);
  background: #fff;
}

.purchase-location-toolbar p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.purchase-location-brand-tabs {
  display: inline-flex;
  flex-wrap: wrap;
  gap: 4px;
  padding: 3px;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: var(--fill);
}

.purchase-location-brand-tabs button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  border: 0;
  border-radius: var(--radius-base);
  background: transparent;
  color: var(--regular);
  padding: 0 10px;
  font-size: 13px;
  font-weight: 700;
  box-shadow: none;
}

.purchase-location-brand-tabs button:hover,
.purchase-location-brand-tabs button.active {
  background: #1f2937;
  color: #fff;
}

.purchase-location-brand-tabs button b {
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.primary-button {
  flex: 0 0 auto;
  height: 34px;
  border-radius: var(--radius-base);
  font-size: 13px;
}

.purchase-location-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.purchase-location-rule-table {
  width: 100%;
  min-width: 1256px;
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  font-size: 12.5px;
}

.purchase-location-rule-table.without-point-rate {
  min-width: 1188px;
}

.purchase-location-rule-table th,
.purchase-location-rule-table td {
  border-right: 1px solid var(--line-light);
  border-bottom: 1px solid var(--line-light);
  padding: 8px 7px;
  vertical-align: middle;
  text-align: left;
}

.purchase-location-rule-table th:last-child,
.purchase-location-rule-table td:last-child {
  border-right: 0;
}

.purchase-location-rule-table tbody tr:last-child td {
  border-bottom: 0;
}

.purchase-location-rule-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.purchase-location-rule-table tbody tr {
  background: #fff;
}

.purchase-location-rule-table tbody tr:not(.purchase-location-row-editing):not(.purchase-location-row-new) {
  height: 64px;
}

.purchase-location-rule-table tbody tr:hover {
  background: #fcfcfc;
}

.purchase-location-row-editing td,
.purchase-location-row-new td {
  background: #f7fbff;
  box-shadow: inset 0 1px 0 #d6e8ff, inset 0 -1px 0 #d6e8ff;
}

.purchase-location-row-new td {
  background: #fffdf5;
  box-shadow: inset 0 1px 0 #ffe7a3, inset 0 -1px 0 #ffe7a3;
}

.purchase-location-name {
  display: block;
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-location-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  max-height: 50px;
  overflow: hidden;
}

.purchase-location-chip-list.expanded {
  max-height: none;
  overflow: visible;
}

.purchase-location-chip-list.compact {
  gap: 3px;
  max-height: none;
  overflow: visible;
}

.purchase-location-chip-list.full-text .purchase-location-chip {
  max-width: none;
  min-height: 20px;
  padding: 1px 5px;
  font-size: 11px;
  line-height: 1.25;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.purchase-location-chip-list.module-list .purchase-location-chip {
  max-width: 100%;
  white-space: normal;
  overflow-wrap: anywhere;
}

.purchase-location-commission-rules {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.purchase-location-commission-rule {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: start;
  gap: 6px;
  min-width: 0;
  line-height: 1.35;
}

.purchase-location-commission-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.purchase-location-commission-formula {
  min-width: 0;
  color: var(--regular);
  font-size: 11.5px;
  word-break: break-word;
}

.purchase-location-chip {
  display: inline-flex;
  align-items: center;
  max-width: 86px;
  min-height: 22px;
  border: 1px solid #d9d9d9;
  border-radius: var(--radius-round);
  padding: 1px 6px;
  background: #fff;
  color: var(--regular);
  font-size: 12px;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-location-chip.muted {
  background: var(--fill);
  color: var(--muted);
}

.purchase-location-state {
  display: inline-flex;
  align-items: center;
  height: 24px;
  border-radius: var(--radius-round);
  padding: 0 7px;
  font-size: 12px;
  font-weight: 750;
}

.purchase-location-state.on {
  background: #e6f4ff;
  color: #0958d9;
}

.purchase-location-state.off {
  background: #f5f5f5;
  color: var(--muted);
}

.purchase-location-rule-table .numeric {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.purchase-location-rule-table .strong {
  color: var(--text);
  font-weight: 750;
}

.purchase-location-inline-field {
  display: grid;
  gap: 4px;
}

.purchase-location-inline-field .field-label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.purchase-location-percent-input {
  position: relative;
  display: block;
}

.purchase-location-percent-input input {
  padding-right: 20px;
}

.purchase-location-row-editing .purchase-location-percent-input input,
.purchase-location-row-new .purchase-location-percent-input input {
  padding-right: 7px;
}

.purchase-location-rule-table input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.purchase-location-rule-table input[type="number"]::-webkit-inner-spin-button,
.purchase-location-rule-table input[type="number"]::-webkit-outer-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.purchase-location-percent-input > span {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  pointer-events: none;
}

.purchase-location-row-editing .purchase-location-percent-input > span,
.purchase-location-row-new .purchase-location-percent-input > span {
  display: none;
}

.purchase-location-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--regular);
  font-size: 13px;
  font-weight: 700;
}

.purchase-location-check input {
  width: 16px;
  height: 16px;
}

.purchase-location-rule-table input,
.purchase-location-rule-table select,
.purchase-location-rule-table textarea {
  width: 100%;
  min-width: 0;
  border-color: #cfd7e3;
  background: #fff;
  color: var(--text);
}

.purchase-location-rule-table input,
.purchase-location-rule-table select {
  height: 32px;
  padding: 0 7px;
}

.purchase-location-rule-table textarea {
  min-height: 74px;
  padding: 7px 8px;
  resize: vertical;
  line-height: 1.45;
}

.purchase-location-rule-table input + input {
  margin-top: 6px;
}

.purchase-location-stacked-inputs {
  display: grid;
  gap: 6px;
}

.purchase-location-module-options {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.purchase-location-module-options label {
  display: flex;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  min-height: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  padding: 5px 7px;
  background: #fff;
  color: var(--regular);
  font-size: 12px;
  font-weight: 700;
}

.purchase-location-module-options input {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
}

.purchase-location-module-options span {
  min-width: 0;
  line-height: 1.25;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.purchase-location-action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.table-action {
  height: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--regular);
  padding: 0 8px;
  font-size: 12px;
  font-weight: 750;
  box-shadow: none;
}

.table-action:hover {
  border-color: #91caff;
  background: #f0f7ff;
  color: #0958d9;
}

.table-action.primary {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.table-action.primary:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
  color: #fff;
}

@media (max-width: 900px) {
  .purchase-location-hero {
    grid-template-columns: 1fr;
  }

  .purchase-location-meta,
  .purchase-location-workbench,
  .purchase-location-rule-row,
  .purchase-location-rule-grid {
    grid-template-columns: 1fr;
  }

  .purchase-location-detail-head {
    display: grid;
  }

  .purchase-location-toolbar {
    display: grid;
  }

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

/* 商品档案分析台 v2 */
.adult-analysis-topbar {
  border-bottom: 1px solid var(--line-light);
  background: #fff;
}

.adult-product-analysis-shell {
  padding: 0;
  overflow: hidden;
}

.adult-product-analysis-shell .adult-product-toolbar {
  grid-template-columns: auto minmax(300px, 1fr) auto;
  gap: 12px;
  min-height: 62px;
  padding: 14px 16px;
  background: #fff;
}

.adult-product-analysis-shell .adult-product-current-brief {
  justify-self: end;
  max-width: 520px;
  height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--regular);
  font-size: 13px;
}

.adult-product-summary-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  padding: 8px 16px 12px;
  background: #fff;
}

.adult-analysis-kpi {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "label value"
    "meta value";
  gap: 2px 10px;
  align-items: center;
  min-width: 0;
  min-height: 56px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
}

.adult-analysis-kpi::before {
  content: none;
}

.adult-analysis-kpi span,
.adult-analysis-kpi small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.adult-analysis-kpi span {
  grid-area: label;
  font-weight: 650;
}

.adult-analysis-kpi small {
  grid-area: meta;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adult-analysis-kpi strong {
  grid-area: value;
  color: var(--text);
  font-size: 24px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.adult-product-analysis-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
}

.adult-product-analysis-main,
.adult-product-insight-rail {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.adult-product-price-dashboard,
.adult-product-price-secondary,
.adult-workspace-two-col,
.adult-category-distribution {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  padding: 14px 16px;
}

.adult-product-price-dashboard {
  grid-template-columns: 1fr;
  padding: 10px 14px 6px;
}

.adult-product-price-secondary {
  padding-top: 0;
}

.adult-product-chart-panel {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: #fff;
}

.adult-product-chart-panel.compact {
  min-height: 140px;
}

.adult-product-chart-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.adult-product-chart-head h3 {
  margin: 0;
  color: var(--text);
  font-size: 16px;
  line-height: 1.3;
}

.adult-product-chart-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.adult-product-chart-head select {
  height: 30px;
  min-width: 108px;
  border: 1px solid var(--line);
  border-radius: var(--radius-base);
  background: #fff;
  color: var(--regular);
  font-size: 12px;
}

.adult-margin-chart {
  display: grid;
  grid-template-columns: 136px minmax(0, 1fr);
  gap: 14px;
  min-height: 0;
}

.adult-margin-summary {
  display: grid;
  align-content: center;
  gap: 4px;
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: var(--fill);
}

.adult-margin-summary span,
.adult-margin-summary small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.adult-margin-summary strong {
  color: var(--text);
  font-size: 28px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.adult-margin-rows {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.adult-margin-row {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr) 76px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  min-height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--regular);
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.adult-margin-row:hover,
.adult-margin-row:focus-visible {
  color: var(--text);
}

.adult-margin-row:hover .adult-margin-track,
.adult-margin-row:focus-visible .adult-margin-track {
  background: #e5ecf6;
}

.adult-margin-row:focus-visible {
  outline: 2px solid rgba(22, 119, 255, 0.28);
  outline-offset: 3px;
}

.adult-margin-label {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.adult-margin-label b {
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.adult-margin-label small,
.adult-margin-value small {
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.25;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adult-margin-track {
  display: block;
  height: 12px;
  overflow: hidden;
  border-radius: var(--radius-round);
  background: #eef2f7;
}

.adult-margin-track i {
  display: block;
  height: 100%;
  min-width: 0;
  border-radius: inherit;
  background: #1677ff;
}

.adult-margin-row.risk .adult-margin-track i { background: #ff4d4f; }
.adult-margin-row.watch .adult-margin-track i { background: #ff9f40; }
.adult-margin-row.blue-soft .adult-margin-track i { background: #91caff; }
.adult-margin-row.blue .adult-margin-track i { background: #69b1ff; }
.adult-margin-row.blue-strong .adult-margin-track i { background: #1677ff; }

.adult-margin-value {
  display: grid;
  justify-items: end;
  min-width: 0;
}

.adult-margin-value b {
  color: var(--text);
  font-size: 13px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.adult-profit-distribution-panel {
  padding: 12px 14px 10px;
}

.adult-profit-distribution-panel .adult-product-chart-head {
  margin-bottom: 4px;
}

.adult-profit-distribution-panel .adult-margin-chart {
  min-height: 0;
}

.adult-product-price-check .compact-rules {
  padding: 0 16px 8px;
}

.adult-product-price-check .compact-rules p {
  font-size: 11px;
}

@media (max-width: 720px) {
  .adult-product-price-settings {
    grid-template-columns: 1fr;
  }
}

.adult-risk-rank {
  position: relative;
  display: grid;
  gap: 8px;
  padding: 6px 0;
}

.adult-risk-rank::before {
  content: "";
  position: absolute;
  left: calc(50% + 74px);
  top: 6px;
  bottom: 6px;
  width: 1px;
  background: var(--line);
}

.adult-risk-rank-row {
  display: grid;
  grid-template-columns: 24px 82px minmax(0, 1fr) 78px;
  gap: 8px;
  align-items: center;
  height: 34px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
  color: var(--regular);
  text-align: left;
}

.adult-risk-rank-row .rank {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #e6f4ff;
  color: var(--accent);
  font-size: 12px;
  font-weight: 750;
}

.adult-risk-rank-row .sku {
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 650;
}

.adult-risk-rank-row .bar {
  position: relative;
  height: 12px;
}

.adult-risk-rank-row .bar i {
  position: absolute;
  top: 0;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
}

.adult-risk-rank-row.negative .bar i {
  background: var(--danger);
}

.adult-risk-rank-row b {
  color: var(--accent);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.adult-risk-rank-row.negative b {
  color: var(--danger);
}

.adult-coverage-stack {
  display: grid;
  gap: 14px;
}

.adult-coverage-bar {
  display: flex;
  height: 28px;
  overflow: hidden;
  border-radius: 4px;
  background: var(--fill);
}

.adult-coverage-bar i.matched,
.adult-coverage-legend i.matched { background: #1677ff; }
.adult-coverage-bar i.missing,
.adult-coverage-legend i.missing { background: #fa8c16; }
.adult-coverage-bar i.backfill,
.adult-coverage-legend i.backfill { background: #22c55e; }
.adult-coverage-bar i.failed,
.adult-coverage-legend i.failed { background: #ff4d4f; }

.adult-coverage-legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 12px;
}

.adult-coverage-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--regular);
  font-size: 12px;
}

.adult-coverage-legend i {
  width: 8px;
  height: 8px;
  border-radius: 2px;
}

.adult-coverage-legend b {
  margin-left: auto;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.adult-brand-bars {
  display: grid;
  gap: 10px;
}

.adult-brand-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr) 72px;
  gap: 10px;
  align-items: center;
  min-width: 0;
  color: var(--regular);
  text-decoration: none;
}

.adult-brand-row span {
  overflow: hidden;
  color: var(--regular);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.adult-brand-row i {
  display: block;
  height: 10px;
  overflow: hidden;
  border-radius: 2px;
  background: #edf2f7;
}

.adult-brand-row i b {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: #3b82f6;
}

.adult-brand-row em {
  color: var(--regular);
  font-size: 12px;
  font-style: normal;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.compact-rules {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  padding: 0 20px 14px;
  border-bottom: 1px solid var(--line-light);
  background: #fff;
}

.compact-rules p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.adult-product-workspace-panel {
  padding: 0;
  overflow: hidden;
}

.adult-product-workspace-tabs {
  display: flex;
  gap: 8px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line-light);
  background: #fff;
}

.adult-product-workspace-tabs button {
  height: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-round);
  background: #fff;
  color: var(--regular);
  box-shadow: none;
  font-size: 13px;
}

.adult-product-workspace-tabs button.active,
.adult-product-workspace-tabs button:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  color: var(--accent);
}

.adult-product-workspace-tabs span {
  margin-left: 4px;
  font-variant-numeric: tabular-nums;
}

.adult-product-workspace {
  min-width: 0;
}

.adult-product-workspace > .section-head {
  padding: 16px 20px 0;
}

.adult-category-distribution {
  padding-bottom: 0;
  grid-template-columns: 1fr;
}

.adult-category-bars .adult-brand-row {
  grid-template-columns: 130px minmax(0, 1fr) 64px;
}

.adult-product-insight-rail .panel {
  margin: 0;
}

.adult-product-insight-rail .adult-product-version-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.adult-product-insight-rail .adult-product-version-stats > div {
  min-height: 66px;
  padding: 12px 10px;
}

.adult-product-insight-rail .adult-product-version-stats > div:nth-child(2n) {
  border-right: 0;
}

.adult-product-insight-rail .adult-product-version-stats > div:nth-child(-n + 2) {
  border-bottom: 1px solid var(--line-light);
}

.adult-product-insight-rail .adult-product-version-stats strong {
  font-size: 21px;
  line-height: 1.08;
}

.adult-product-insight-list {
  display: grid;
  gap: 12px;
}

.adult-insight-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-large);
  background: #fff;
}

.adult-insight-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.adult-insight-card strong {
  color: var(--text);
  font-size: 18px;
  line-height: 1.25;
}

.adult-insight-card p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.adult-insight-card.risk { border-color: #ffccc7; background: #fffafa; }
.adult-insight-card.warn,
.adult-insight-card.amber { border-color: #ffe7ba; background: #fffdf7; }
.adult-insight-card.ok { border-color: #b7eb8f; background: #fbfff8; }

.adult-product-insight-rail .adult-product-drop-zone {
  min-height: 136px;
  padding: 16px 12px;
}

.adult-product-insight-rail .adult-product-upload-icon {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 22px;
}

.adult-product-insight-rail .adult-product-drop-zone span:not(.adult-product-upload-icon) {
  font-size: 14px;
  text-align: center;
}

.adult-product-import-card {
  display: grid;
  gap: 12px;
  align-content: center;
  min-height: 140px;
  padding: 18px;
  border: 1px dashed #91caff;
  border-radius: var(--radius-large);
  background: #fbfdff;
}

.adult-product-import-card p,
.adult-version-mini span,
.adult-version-mini small {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.adult-version-mini {
  display: grid;
  gap: 12px;
}

.adult-version-mini strong {
  color: var(--text);
  overflow-wrap: anywhere;
}

.adult-version-mini div {
  display: grid;
  grid-template-columns: repeat(3, auto 1fr);
  gap: 4px 6px;
  align-items: baseline;
}

.adult-version-mini b {
  color: var(--text);
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1280px) {
  .adult-product-summary-kpis {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .adult-product-analysis-grid {
    grid-template-columns: 1fr;
  }

  .adult-product-insight-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .adult-product-insight-rail .adult-product-version-stats > div {
    border-bottom: 0;
  }

  .adult-product-insight-rail .adult-product-version-stats > div:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line-light);
  }
}

@media (max-width: 860px) {
  .adult-product-analysis-shell .adult-product-toolbar,
  .adult-product-price-dashboard,
  .adult-product-price-secondary,
  .adult-workspace-two-col,
  .adult-category-distribution,
  .adult-product-insight-rail {
    grid-template-columns: 1fr;
  }

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

  .adult-product-analysis-shell .adult-product-current-brief {
    justify-self: stretch;
    max-width: none;
  }
}

@media (max-width: 560px) {
  .adult-product-summary-kpis {
    grid-template-columns: 1fr;
    padding: 12px;
  }

  .adult-product-price-dashboard,
  .adult-product-price-secondary,
  .adult-workspace-two-col,
  .adult-category-distribution {
    padding-left: 12px;
    padding-right: 12px;
  }

  .adult-product-workspace-tabs {
    overflow-x: auto;
    padding-left: 12px;
    padding-right: 12px;
  }

  .adult-margin-chart {
    grid-template-columns: 1fr;
  }

  .adult-margin-row {
    grid-template-columns: 1fr 70px;
  }

  .adult-margin-track {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .adult-brand-row,
  .adult-category-bars .adult-brand-row {
    grid-template-columns: 96px minmax(0, 1fr) 56px;
  }
}

.key-products-page {
  display: grid;
  gap: 0;
}

.key-products-control-panel {
  display: grid;
  gap: 14px;
  padding-bottom: 16px;
}

.key-products-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 12px;
}

.key-products-store-field {
  display: grid;
  gap: 5px;
  width: min(220px, 100%);
  color: var(--muted);
  font-size: 13px;
}

.key-products-store-field[hidden],
.key-products-kpis[hidden] {
  display: none;
}

.key-product-file-action {
  cursor: pointer;
  user-select: none;
}

.key-product-file-action.disabled {
  pointer-events: none;
  opacity: 0.55;
}

.key-products-store-field select {
  min-width: 0;
}

.key-products-source-meta {
  display: grid;
  flex: 1 1 420px;
  align-content: center;
  gap: 2px;
  min-height: 48px;
  padding: 7px 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fafafa;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.key-products-source-meta span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-monitor-mode .key-products-control-panel {
  gap: 10px;
  margin-bottom: 0;
  padding: 0 0 12px;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.price-monitor-mode .key-products-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) repeat(3, minmax(118px, 152px));
  align-items: stretch;
  gap: 12px;
}

.price-monitor-mode .key-products-source-meta {
  order: 1;
  flex: unset;
  min-height: 58px;
  padding: 9px 12px;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.price-monitor-mode .key-products-source-meta .key-product-source-primary {
  color: #475569;
  font-weight: 750;
}

.official-monitor-mode .key-products-source-meta .key-product-source-primary {
  color: #475569;
  font-weight: 750;
}

.official-monitor-mode .key-products-control-panel {
  gap: 12px;
  padding: 14px;
  border-color: #e5e7eb;
  box-shadow: none;
}

.official-monitor-mode .key-products-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 220px) minmax(86px, max-content) minmax(112px, max-content) minmax(0, 1fr);
  align-items: stretch;
  gap: 10px;
}

.official-monitor-mode .key-products-store-field,
.official-monitor-mode #key-product-refresh,
.official-monitor-mode #key-product-official-import-label {
  min-height: 40px;
}

.official-monitor-mode .key-products-source-meta {
  min-height: 40px;
  padding: 8px 12px;
  border-color: #e5e7eb;
  background: #f8fafc;
}

.price-monitor-mode #key-product-refresh {
  order: 2;
}

.price-monitor-mode #key-product-fetch-prices {
  order: 3;
}

.price-monitor-mode #key-product-create-monitor {
  order: 4;
}

.price-monitor-mode .key-product-monitor-command {
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 4px;
  width: 100%;
  min-width: 0;
  min-height: 58px;
  padding: 8px 12px;
  border: 1px solid var(--line-light);
  border-radius: 8px;
  background: #fff;
  color: #0f172a;
  box-shadow: none;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
}

.price-monitor-mode .key-product-monitor-command:hover {
  border-color: #91caff;
  background: #f8fbff;
}

.price-monitor-mode #key-product-fetch-prices.key-product-monitor-command {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.price-monitor-mode #key-product-fetch-prices.key-product-monitor-command:hover {
  border-color: var(--accent-dark);
  background: var(--accent-dark);
}

.price-monitor-mode .key-product-monitor-command-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-monitor-mode .key-product-monitor-command small {
  max-width: 100%;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.price-monitor-mode #key-product-fetch-prices.key-product-monitor-command small {
  color: rgba(255, 255, 255, 0.82);
}

.key-product-monitor-form {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #d9e2ef;
  border-radius: var(--radius-base);
  background: #f8fafc;
}

.key-product-monitor-form[hidden] {
  display: none;
}

.key-product-monitor-form-head,
.key-product-monitor-form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.key-product-monitor-form-head strong {
  color: var(--text);
  font-size: 14px;
}

.key-product-monitor-fields,
.key-product-monitor-link-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.key-product-monitor-fields label,
.key-product-monitor-link-fields label {
  display: grid;
  gap: 5px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.key-product-monitor-fields input,
.key-product-monitor-link-fields input {
  width: 100%;
  min-width: 0;
}

.key-products-kpis {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
  overflow: hidden;
}

.key-products-kpi {
  min-width: 0;
  padding: 10px 12px;
  border-right: 1px solid var(--line-light);
}

.key-products-kpi:last-child {
  border-right: 0;
}

.key-products-kpi span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.key-products-kpi strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 19px;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-products-kpi small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.key-products-table-panel {
  padding-top: 14px;
}

.price-monitor-mode .key-products-table-panel {
  padding: 0;
  overflow: visible;
}

.price-monitor-mode .key-products-table-panel > .section-head {
  min-height: 42px;
  margin: 0;
  padding: 12px 18px 6px;
}

.price-monitor-mode .key-products-table-panel > .section-head > div {
  display: none;
}

.price-monitor-mode .key-products-table-panel > .section-head .pill {
  margin-left: auto;
}

.price-monitor-mode .key-products-tabs {
  margin: 0 18px 14px;
}

.key-product-monitor-workspace {
  display: grid;
  gap: 14px;
  align-items: start;
}

.price-monitor-mode .key-product-monitor-workspace.has-drawer {
  grid-template-columns: minmax(760px, 1fr) minmax(320px, 340px);
}

@media (min-width: 1281px) {
  .price-monitor-mode .key-products-table-panel {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(320px, 340px);
    grid-template-rows: auto auto auto 1fr;
    column-gap: 0;
    align-items: stretch;
  }

  .price-monitor-mode .key-products-table-panel > .section-head,
  .price-monitor-mode .key-products-tabs,
  .price-monitor-mode .adult-empty.compact {
    grid-column: 1;
  }

  .price-monitor-mode .key-product-monitor-workspace.has-drawer {
    display: contents;
  }

  .price-monitor-mode .key-products-table-wrap {
    grid-column: 1;
    margin: 0 0 18px 18px;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
  }

  .price-monitor-mode .key-product-monitor-drawer {
    grid-column: 2;
    grid-row: 1 / -1;
    align-self: start;
    position: sticky;
    top: 16px;
    z-index: 2;
    min-height: 0;
    height: calc(100vh - 56px);
    max-height: calc(100vh - 56px);
    border-width: 0 0 0 1px;
    border-radius: 0;
    overflow: auto;
    overscroll-behavior: contain;
  }
}

.key-products-tabs {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin: 0 0 12px;
  padding: 3px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #f7f8fa;
}

.key-product-official-filters {
  display: grid;
  grid-template-columns: minmax(132px, 160px) minmax(132px, 160px) minmax(180px, 240px) minmax(0, 1fr);
  align-items: end;
  gap: 10px;
  margin: 0 0 14px;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background: #f8fafc;
}

.key-product-official-filters[hidden] {
  display: none;
}

.key-product-official-filters label {
  display: grid;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.key-product-official-filters select {
  width: 100%;
  min-height: 34px;
  background-color: #fff;
}

.key-products-mode-tabs {
  margin-right: 10px;
}

.key-product-tab {
  min-width: 68px;
  min-height: 30px;
  padding: 0 12px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.key-product-tab.active {
  background: #fff;
  color: var(--accent);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.key-product-row-action {
  min-width: 72px;
}

.price-monitor-mode .key-product-row-action {
  min-width: 0;
  padding-left: 4px;
  padding-right: 4px;
  font-size: 12px;
}

.key-product-row-action.danger {
  color: #cf1322;
}

.key-product-text-link {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  height: auto;
  min-height: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--accent);
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
}

.key-product-text-link:hover {
  background: transparent;
  color: var(--accent-dark);
  text-decoration: underline;
  text-underline-offset: 2px;
}

button.key-product-text-link:hover,
button.key-product-text-link:focus-visible {
  border-color: transparent;
  background: transparent;
  color: var(--accent-dark);
}

.key-product-text-link.danger {
  color: #cf1322;
}

.key-product-text-link.danger:hover {
  color: #a8071a;
}

.key-products-table-wrap table {
  min-width: 720px;
  table-layout: fixed;
}

.price-monitor-mode .key-products-table-wrap table {
  min-width: 720px;
  table-layout: fixed;
}

.price-monitor-mode .key-products-table th,
.price-monitor-mode .key-products-table td {
  box-sizing: border-box;
}

.price-monitor-mode .key-products-table th:nth-child(1),
.price-monitor-mode .key-products-table td:nth-child(1) {
  width: 40px;
}

.price-monitor-mode .key-products-table th:nth-child(2),
.price-monitor-mode .key-products-table td:nth-child(2) {
  width: 236px;
}

.price-monitor-mode .key-products-table th:nth-child(3),
.price-monitor-mode .key-products-table td:nth-child(3) {
  width: 68px;
}

.price-monitor-mode .key-products-table th:nth-child(4),
.price-monitor-mode .key-products-table td:nth-child(4) {
  width: 74px;
}

.price-monitor-mode .key-products-table th:nth-child(5),
.price-monitor-mode .key-products-table td:nth-child(5) {
  width: 104px;
}

.price-monitor-mode .key-products-table th:nth-child(6),
.price-monitor-mode .key-products-table td:nth-child(6) {
  width: 56px;
}

.price-monitor-mode .key-products-table th:nth-child(7),
.price-monitor-mode .key-products-table td:nth-child(7) {
  width: 112px;
}

.price-monitor-mode .key-products-table th:nth-child(8),
.price-monitor-mode .key-products-table td:nth-child(8) {
  width: 58px;
}

.price-monitor-mode .key-products-table th:nth-child(3),
.price-monitor-mode .key-products-table td:nth-child(3),
.price-monitor-mode .key-products-table th:nth-child(4),
.price-monitor-mode .key-products-table td:nth-child(4),
.price-monitor-mode .key-products-table th:nth-child(5),
.price-monitor-mode .key-products-table td:nth-child(5),
.price-monitor-mode .key-products-table th:nth-child(6),
.price-monitor-mode .key-products-table td:nth-child(6) {
  text-align: right;
}

.price-monitor-mode .key-products-table th:nth-child(3) .key-product-sort-button,
.price-monitor-mode .key-products-table th:nth-child(4) .key-product-sort-button,
.price-monitor-mode .key-products-table th:nth-child(5) .key-product-sort-button,
.price-monitor-mode .key-products-table th:nth-child(6) .key-product-sort-button {
  justify-content: flex-end;
  text-align: right;
}

.price-monitor-mode .key-product-monitor-lowest-cell,
.price-monitor-mode .key-product-monitor-compare-cell,
.price-monitor-mode .key-product-monitor-profit-cell {
  vertical-align: middle;
}

.key-products-table th,
.key-products-table td {
  box-sizing: border-box;
  padding: 7px 8px;
  font-size: 13px;
}

.key-products-table tbody tr {
  height: 52px;
}

.key-products-table tbody td {
  min-height: 46px;
  vertical-align: middle;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease;
}

.key-products-page:not(.price-monitor-mode) .key-products-table th:nth-child(1),
.key-products-page:not(.price-monitor-mode) .key-products-table td:nth-child(1) {
  width: 36px;
}

.key-products-page:not(.price-monitor-mode) .key-products-table th:nth-child(2),
.key-products-page:not(.price-monitor-mode) .key-products-table td:nth-child(2) {
  width: 84px;
}

.key-products-page:not(.price-monitor-mode) .key-products-table th:nth-child(3),
.key-products-page:not(.price-monitor-mode) .key-products-table td:nth-child(3) {
  width: 200px;
}

.key-products-page:not(.price-monitor-mode) .key-products-table th:nth-child(4),
.key-products-page:not(.price-monitor-mode) .key-products-table td:nth-child(4) {
  width: 78px;
}

.key-products-page:not(.price-monitor-mode) .key-products-table th:nth-child(5),
.key-products-page:not(.price-monitor-mode) .key-products-table td:nth-child(5) {
  width: 86px;
}

.key-products-page:not(.price-monitor-mode) .key-products-table th:nth-child(6),
.key-products-page:not(.price-monitor-mode) .key-products-table td:nth-child(6) {
  width: 88px;
}

.key-products-page:not(.price-monitor-mode) .key-products-table th:nth-child(7),
.key-products-page:not(.price-monitor-mode) .key-products-table td:nth-child(7) {
  width: 64px;
}

.key-products-page:not(.price-monitor-mode) .key-products-table th:nth-child(8),
.key-products-page:not(.price-monitor-mode) .key-products-table td:nth-child(8) {
  width: 58px;
}

.key-products-page.official-monitor-mode .key-products-table-wrap {
  overflow-x: auto;
  border-color: #e5e7eb;
  border-radius: 8px;
}

.official-monitor-mode .key-products-table-wrap table,
.key-products-page.official-monitor-mode .key-products-table-wrap table {
  width: 1168px !important;
  min-width: 1168px !important;
  table-layout: fixed !important;
}

.key-products-page.official-monitor-mode .key-products-table th,
.key-products-page.official-monitor-mode .key-products-table td {
  min-width: 0 !important;
  max-width: none !important;
  padding: 9px 10px !important;
  vertical-align: middle !important;
  white-space: normal;
}

.key-products-page.official-monitor-mode .key-products-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
  background: #f8fafc;
  box-shadow: inset 0 -1px 0 #e5e7eb;
}

.key-products-page.official-monitor-mode .key-products-table tbody tr {
  height: 66px;
}

.key-products-page.official-monitor-mode .key-products-table tbody tr:nth-child(even) td {
  background: #fcfdff;
}

.key-products-page.key-products-page.official-monitor-mode .key-products-table tbody tr:hover td {
  background: #f8fbff;
}

.key-products-page.official-monitor-mode .key-products-table th:nth-child(1),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(1) {
  width: 46px !important;
}

.key-products-page.official-monitor-mode .key-products-table th:nth-child(2),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(2) {
  width: 324px !important;
}

.key-products-page.official-monitor-mode .key-products-table th:nth-child(3),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(3) {
  width: 124px !important;
}

.key-products-page.official-monitor-mode .key-products-table th:nth-child(4),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(4) {
  width: 74px !important;
}

.key-products-page.official-monitor-mode .key-products-table th:nth-child(5),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(5) {
  width: 92px !important;
}

.key-products-page.official-monitor-mode .key-products-table th:nth-child(6),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(6),
.key-products-page.official-monitor-mode .key-products-table th:nth-child(7),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(7) {
  width: 76px !important;
}

.key-products-page.official-monitor-mode .key-products-table th:nth-child(8),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(8) {
  width: 112px !important;
}

.key-products-page.official-monitor-mode .key-products-table th:nth-child(9),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(9) {
  width: 244px !important;
}

.key-products-page.official-monitor-mode .key-products-table th:nth-child(5),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(5),
.key-products-page.official-monitor-mode .key-products-table th:nth-child(6),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(6),
.key-products-page.official-monitor-mode .key-products-table th:nth-child(7),
.key-products-page.official-monitor-mode .key-products-table td:nth-child(7) {
  text-align: right;
}

.key-products-page.official-monitor-mode .key-products-table th:nth-child(6) .key-product-sort-button,
.key-products-page.official-monitor-mode .key-products-table th:nth-child(7) .key-product-sort-button {
  justify-content: flex-end;
  text-align: right;
}

.key-product-official-price {
  display: grid;
  grid-template-columns: minmax(0, max-content) auto;
  align-items: baseline;
  justify-content: start;
  gap: 3px 8px;
  min-width: 0;
}

.key-product-official-price strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  font-variant-numeric: tabular-nums;
}

.key-product-official-price small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
}

.key-product-official-price .key-product-text-link {
  margin-left: 0;
  font-size: 12px;
}

.key-product-official-edit {
  padding: 0 2px;
}

.key-product-official-row .key-product-title-layout {
  gap: 9px;
}

.key-product-official-row .key-product-thumb {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 7px;
}

.key-product-official-row .key-product-title-copy {
  padding: 0;
}

.key-product-official-row .key-product-title-main,
.key-product-official-row .key-product-title-link {
  display: -webkit-box;
  max-height: 35px;
  overflow: hidden;
  color: #0f172a;
  font-size: 13px;
  font-weight: 760;
  line-height: 1.32;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.key-product-official-row .key-product-title-spec {
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  line-height: 1.2;
}

.key-product-official-type-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 18px;
  margin-top: 3px;
  padding: 0 6px;
  border-radius: 999px;
  background: #fff7ed;
  color: #c2410c;
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
}

.key-product-official-type-badge.us {
  background: #eff6ff;
  color: #1d4ed8;
}

.key-product-official-row .key-product-status {
  min-height: 22px;
  padding: 0 7px;
  font-size: 11px;
  font-weight: 800;
}

.key-product-official-status-cell {
  text-align: center;
}

.key-product-official-number-cell strong,
.key-products-page.official-monitor-mode .key-product-monitor-money {
  color: #111827;
  font-size: 13px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.key-product-official-category {
  color: #334155;
  font-size: 12px;
  line-height: 1.3;
  white-space: normal;
}

.key-product-official-review {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 6px;
  min-width: 0;
}

.key-product-official-review small {
  flex: 0 0 100%;
  color: #64748b;
  font-size: 11px;
  line-height: 1.25;
  overflow: hidden;
  text-overflow: ellipsis;
}

.key-product-official-review-cell {
  white-space: normal;
}

.key-product-official-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.key-products-table tbody tr:hover td {
  background: #f8fafc;
}

.key-product-rank {
  color: var(--muted);
  font-weight: 700;
}

.key-products-page.official-monitor-mode .key-product-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 24px;
  color: #475569;
  font-variant-numeric: tabular-nums;
}

.key-product-expand {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 42px;
  padding: 0;
  border: 0;
  border-radius: var(--radius-small);
  background: transparent;
  color: #475569;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.14s ease, color 0.14s ease;
}

.key-product-expand:hover {
  background: #eef2f7;
  color: #0f172a;
}

.key-product-expand-icon {
  width: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1;
}

.key-product-rank-number {
  color: #334155;
}

.key-product-parent-row td {
  background: #fff;
}

.key-product-parent-expanded td {
  border-top-color: #e2e8f0;
  background: #f8fafc;
}

.key-product-child-row td {
  background: #fcfcfd;
  color: var(--muted);
  border-top-color: #eef2f7;
}

.key-product-child-row .key-product-sku {
  color: #475569;
  font-weight: 650;
}

.key-product-child-row .key-product-title-cell {
  position: relative;
  padding-left: 30px;
}

.key-product-child-row .key-product-title-cell::before {
  content: "";
  position: absolute;
  left: 14px;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 999px;
  background: #cbd5e1;
}

.key-product-child-row .key-product-title-main {
  color: #334155;
  font-weight: 650;
}

.key-product-child-marker {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  min-height: 22px;
  border-radius: var(--radius-round);
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.key-product-sku {
  color: var(--text);
  font-weight: 700;
}

.key-product-identity {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.key-product-identity strong,
.key-product-identity span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-identity strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.25;
}

.key-product-identity span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.key-product-title-cell {
  max-width: 340px;
  overflow: hidden;
}

.key-product-title-layout {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.key-product-thumb {
  width: 40px;
  height: 40px;
  flex: 0 0 40px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
  object-fit: cover;
}

.key-product-thumb-empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.key-products-page:not(.price-monitor-mode) .key-product-title-layout {
  gap: 7px;
}

.key-products-page:not(.price-monitor-mode) .key-product-thumb {
  width: 32px;
  height: 32px;
  flex-basis: 32px;
}

.key-products-page:not(.price-monitor-mode) .key-product-title-main {
  font-size: 12px;
  line-height: 1.25;
}

.key-products-page:not(.price-monitor-mode) .key-product-title-spec {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.2;
}

.key-products-page.official-monitor-mode .key-product-official-row .key-product-title-layout {
  gap: 9px;
}

.key-products-page.official-monitor-mode .key-product-official-row .key-product-thumb {
  width: 36px;
  height: 36px;
  flex-basis: 36px;
  border-radius: 7px;
}

.key-products-page.official-monitor-mode .key-product-official-row .key-product-title-main {
  font-size: 13px;
  line-height: 1.35;
}

.key-products-page.official-monitor-mode .key-product-official-row .key-product-title-spec {
  margin-top: 3px;
  font-size: 11px;
}

.key-product-title-copy {
  display: block;
  min-width: 0;
  flex: 1 1 auto;
}

.key-product-title-link {
  color: inherit;
  text-decoration: none;
}

.key-product-title-link:hover {
  color: #0f172a;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.key-product-title-main,
.key-product-title-spec {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-title-main {
  color: var(--text);
  font-weight: 700;
  line-height: 1.35;
}

.key-product-title-spec {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.key-product-monitor-row {
  cursor: pointer;
}

.key-product-monitor-row.selected td {
  border-top-color: #d6e8ff;
  border-bottom-color: #d6e8ff;
  background: #f3f8ff;
  box-shadow:
    inset 0 1px 0 #bfdbfe,
    inset 0 -1px 0 #bfdbfe;
}

.key-product-monitor-row.selected:hover td {
  background: #f3f8ff;
}

.key-product-monitor-row.selected td:first-child {
  box-shadow:
    inset 3px 0 0 var(--primary),
    inset 0 1px 0 #bfdbfe,
    inset 0 -1px 0 #bfdbfe;
}

.key-product-monitor-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.key-product-monitor-title strong,
.key-product-monitor-title span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-monitor-title strong {
  color: var(--text);
  font-weight: 750;
  line-height: 1.35;
}

.key-product-monitor-title span {
  color: var(--muted);
  font-size: 12px;
}

.key-product-monitor-title-layout .key-product-title-main {
  font-weight: 800;
}

.key-product-monitor-subline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 3px 7px;
  min-width: 0;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.key-product-monitor-subline > span:first-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-monitor-sku-tags {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 3px;
}

.key-product-monitor-sku-tags span {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 5px;
  border-radius: var(--radius-small);
  background: #f1f5f9;
  color: #475569;
  font-size: 11px;
  font-weight: 750;
  line-height: 18px;
}

.key-product-monitor-subline .key-product-link-chip,
.key-product-monitor-subline .key-product-link-progress {
  min-height: 18px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  font-size: 11px;
  line-height: 1.2;
}

.key-product-monitor-subline .key-product-link-chip.uploaded {
  color: #237804;
}

.key-product-monitor-subline .key-product-link-chip.pending {
  color: var(--muted);
}

.key-product-monitor-subline .key-product-link-progress {
  gap: 4px;
  color: #475569;
}

.key-product-monitor-subline .key-product-link-progress:hover {
  background: transparent;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.key-product-monitor-subline .key-product-link-progress span {
  width: 6px;
  height: 6px;
}

.key-product-monitor-money {
  display: inline-block;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  font-weight: 780;
  white-space: nowrap;
}

.key-product-monitor-lowest,
.key-product-monitor-profit {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.key-product-monitor-lowest {
  align-content: center;
  justify-items: end;
  min-width: 0;
  text-align: right;
}

.key-product-monitor-lowest span,
.key-product-monitor-profit span {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-monitor-lowest strong,
.key-product-monitor-profit strong {
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.key-product-monitor-lowest-price {
  display: block;
  width: 100%;
  color: #111827;
  font-size: 15px;
  line-height: 1.1;
  text-align: right;
}

.key-product-monitor-lowest-name {
  display: block;
  width: 100%;
  color: var(--muted);
  text-align: right;
}

.key-product-price-compare {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  width: 100%;
  min-height: 24px;
  color: #1f2937;
  font-size: 13px;
  font-weight: 850;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.key-product-price-compare.higher {
  color: #cf1322;
}

.key-product-price-compare.lower {
  color: #237804;
}

.key-product-price-compare.equal {
  color: var(--muted);
}

.key-product-monitor-profit-list {
  display: inline-grid;
  justify-items: start;
  gap: 2px;
  min-width: 0;
}

.key-product-monitor-profit-list span {
  display: inline-grid;
  grid-template-columns: max-content max-content;
  align-items: center;
  gap: 4px;
  width: fit-content;
  min-width: 0;
  color: #334155;
  font-size: 11px;
  line-height: 1.2;
}

.key-product-monitor-profit-list b,
.key-product-monitor-profit-list strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-monitor-profit-list b {
  color: var(--muted);
  font-weight: 700;
}

.key-product-monitor-profit-list strong {
  color: #237804;
  font-weight: 850;
  justify-self: start;
  font-variant-numeric: tabular-nums;
}

.key-product-monitor-profit-list .key-product-monitor-profit-primary b {
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.key-product-monitor-profit-list .key-product-monitor-profit-primary strong {
  color: #237804;
  font-size: 15px;
  font-weight: 900;
}

.key-product-monitor-profit-list .key-product-monitor-profit-secondary {
  color: var(--muted);
  font-size: 11px;
}

.key-product-monitor-profit-list .key-product-monitor-profit-secondary strong {
  color: #475569;
  font-weight: 780;
}

.key-product-monitor-profit-list .negative strong {
  color: #cf1322;
}

.key-product-link-progress {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 0 9px;
  border: 0;
  border-radius: var(--radius-round);
  background: transparent;
  color: #475569;
  font: inherit;
  font-size: 12px;
  font-weight: 750;
  cursor: pointer;
  white-space: nowrap;
}

.key-product-link-progress:hover {
  background: #f1f5f9;
  color: var(--text);
}

.key-product-link-progress span {
  width: 7px;
  height: 7px;
  border-radius: var(--radius-round);
  background: #faad14;
}

.key-product-link-progress.complete span {
  background: #52c41a;
}

.key-product-link-progress b {
  font-weight: 750;
}

.key-product-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.key-product-sort-group {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.key-product-sort-group-label {
  min-width: 0;
  overflow: hidden;
  color: var(--regular);
  font-size: 12px;
  font-weight: 760;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-sort-group-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.key-product-sort-group .key-product-sort-button {
  width: auto;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.2;
}

.key-product-sort-button:hover,
.key-product-sort-button.active {
  color: var(--accent);
}

.key-product-sort-indicator {
  width: 12px;
  color: var(--accent);
  font-size: 12px;
  line-height: 1;
}

.key-product-merged-metric,
.key-product-stock-status {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.key-product-merged-metric strong,
.key-product-merged-metric span,
.key-product-stock-status strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-merged-metric strong,
.key-product-stock-status strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 780;
  line-height: 1.25;
}

.key-product-merged-metric strong small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
}

.key-product-merged-metric span {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.2;
}

.key-product-merged-metric.profit strong {
  color: #237804;
}

.key-product-merged-metric.negative strong {
  color: #cf1322;
}

.key-product-unit-rate {
  display: flex;
  align-items: baseline;
  gap: 5px;
  min-width: 0;
}

.key-product-unit-rate strong,
.key-product-unit-rate span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-unit-rate strong {
  color: #237804;
  font-size: 12px;
  font-weight: 820;
}

.key-product-unit-rate span {
  color: var(--muted);
  font-size: 12px;
}

.key-product-unit-rate.negative strong {
  color: #cf1322;
}

.key-product-stock-status .key-product-status {
  width: fit-content;
  min-height: 20px;
  padding: 0 6px;
  font-size: 12px;
}

.key-products-page:not(.price-monitor-mode) .key-product-row-action {
  min-width: 0;
  padding-left: 6px;
  padding-right: 6px;
  font-size: 12px;
}

.key-product-status {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  padding: 0 8px;
  border-radius: var(--radius-round);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.key-product-status.spot {
  background: #e6f4ff;
  color: var(--accent-dark);
}

.key-product-status.ok {
  background: #f6ffed;
  color: #389e0d;
}

.key-product-status.warn {
  background: #fff7e6;
  color: #d46b08;
}

.key-product-status.danger {
  background: #fff1f0;
  color: #cf1322;
}

.key-product-status.unknown {
  background: #f0f5ff;
  color: #1d39c4;
}

.key-product-status.muted {
  background: #f5f5f5;
  color: var(--muted);
}

.key-product-official-review {
  display: grid;
  gap: 4px;
  justify-items: start;
}

.key-product-official-review small {
  max-width: 210px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
}

.key-product-official-category {
  max-width: 180px;
  color: #475569;
  font-size: 12px;
  line-height: 1.35;
}

@media (max-width: 720px) {
  .official-monitor-mode .key-products-control-panel {
    padding: 12px;
  }

  .official-monitor-mode .key-products-toolbar,
  .key-product-official-filters {
    grid-template-columns: minmax(0, 1fr);
  }

  .official-monitor-mode .key-products-source-meta {
    min-height: 0;
  }

  .key-products-page.official-monitor-mode .key-products-table-wrap {
    max-width: 100%;
  }
}

.key-product-link-chip {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid transparent;
  border-radius: var(--radius-round);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

button.key-product-link-chip {
  cursor: pointer;
}

.key-product-link-chip.uploaded {
  border-color: #b7eb8f;
  background: #f6ffed;
  color: #237804;
}

.key-product-link-chip.pending {
  background: #f5f5f5;
  color: var(--muted);
}

.key-product-muted {
  color: var(--muted);
  font-size: 12px;
}

.key-product-competitor-lowest {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.key-product-competitor-lowest strong,
.key-product-competitor-lowest span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-competitor-lowest strong {
  color: var(--text);
  font-size: 12px;
}

.key-product-competitor-lowest span {
  color: #cf1322;
  font-weight: 800;
}

.key-product-competitor-cell {
  min-width: 560px;
}

.key-product-unit-profit-cell {
  min-width: 150px;
}

.key-product-unit-profit-list {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.key-product-unit-profit-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
  color: #334155;
  font-size: 12px;
  line-height: 1.25;
}

.key-product-unit-profit-row b,
.key-product-unit-profit-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-unit-profit-row b {
  color: var(--muted);
  font-weight: 700;
}

.key-product-unit-profit-row strong {
  color: #237804;
  font-weight: 850;
}

.key-product-unit-profit-row.negative strong {
  color: #cf1322;
}

.key-product-profit-revenue {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-competitor-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(112px, 1fr));
  gap: 6px;
  min-width: 0;
}

.key-product-competitor-inline {
  display: grid;
  min-width: 0;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-small);
  background: #fcfcfd;
  overflow: hidden;
}

.key-product-competitor-inline.lowest {
  border-color: #ffd8bf;
  background: #fff7f0;
}

.key-product-competitor-inline.editing {
  grid-column: span 2;
  border-color: #91caff;
  background: #f7fbff;
}

.key-product-competitor-summary {
  display: grid;
  gap: 5px;
  width: 100%;
  min-width: 0;
  padding: 8px;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.key-product-competitor-summary:hover {
  background: rgba(15, 23, 42, 0.03);
}

.key-product-competitor-inline-head,
.key-product-competitor-inline-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.key-product-competitor-inline-head strong,
.key-product-competitor-inline-head span,
.key-product-competitor-inline-meta em,
.key-product-competitor-inline-meta i {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-competitor-inline-head strong {
  color: var(--text);
  font-size: 12px;
}

.key-product-competitor-inline-price {
  color: #cf1322;
  font-size: 12px;
  font-weight: 800;
}

.key-product-competitor-link-state {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 19px;
  padding: 0 7px;
  border-radius: var(--radius-round);
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.key-product-competitor-link-state.uploaded {
  background: #f6ffed;
  color: #237804;
}

.key-product-competitor-link-state.pending {
  background: #f5f5f5;
  color: var(--muted);
}

.key-product-competitor-editor {
  display: grid;
  gap: 7px;
  padding: 0 8px 8px;
}

.key-product-competitor-editor input {
  width: 100%;
  min-width: 0;
  height: 30px;
  padding: 4px 8px;
  font-size: 12px;
}

.key-product-competitor-editor-actions {
  display: flex;
  justify-content: flex-end;
  gap: 6px;
}

.key-product-competitor-inline-meta {
  color: var(--muted);
  font-size: 11px;
}

.key-product-competitor-inline-meta em,
.key-product-competitor-inline-meta i {
  font-style: normal;
}

.key-product-competitor-inline-meta i {
  color: #cf1322;
}

.key-product-competitor-inline-meta .key-product-status {
  min-height: 18px;
  padding: 0 6px;
  font-size: 11px;
}

.key-product-monitor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 9px;
  align-items: center;
}

.price-monitor-mode .key-product-monitor-actions {
  flex-direction: column;
  align-items: flex-start;
  gap: 7px;
}

.price-monitor-mode .key-product-monitor-actions .key-product-row-action {
  display: inline;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.price-monitor-mode .key-product-monitor-actions .key-product-row-action:hover {
  background: transparent;
}

.key-product-monitor-drawer {
  position: sticky;
  top: 14px;
  display: grid;
  align-content: start;
  gap: 16px;
  max-height: calc(100vh - 96px);
  padding: 18px 16px;
  border: 1px solid var(--line-light);
  border-radius: 0 var(--radius-base) var(--radius-base) 0;
  background: #fff;
  box-shadow: none;
  overflow: auto;
}

.key-product-monitor-drawer[hidden] {
  display: none;
}

.key-product-monitor-drawer-head,
.key-product-monitor-drawer-section-head,
.key-product-monitor-drawer-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.key-product-monitor-drawer-head span,
.key-product-monitor-drawer-section-head span,
.key-product-monitor-drawer-product span,
.key-product-monitor-drawer-product small,
.key-product-monitor-drawer-profit > span {
  color: var(--muted);
  font-size: 12px;
}

.key-product-monitor-drawer-head strong,
.key-product-monitor-drawer-product strong,
.key-product-monitor-drawer-section-head strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-monitor-drawer-product {
  display: grid;
  gap: 6px;
  padding: 0 0 16px;
  border-bottom: 1px solid var(--line-light);
  background: transparent;
}

.key-product-monitor-drawer-product > strong {
  font-size: 13px;
  line-height: 1.45;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.key-product-monitor-drawer-thumb {
  width: 48px;
  height: 48px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  background: #f8fafc;
  object-fit: cover;
}

.key-product-monitor-drawer-profit {
  display: grid;
  gap: 9px;
  padding: 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fff;
}

.key-product-monitor-drawer-profit .key-product-unit-profit-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
}

.key-product-monitor-drawer-profit .key-product-unit-profit-row {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 0 8px;
  border-right: 1px solid var(--line-light);
}

.key-product-monitor-drawer-profit .key-product-unit-profit-row:last-child {
  border-right: 0;
}

.key-product-monitor-drawer-profit .key-product-profit-revenue {
  grid-column: 1 / -1;
  margin-top: 6px;
  text-align: center;
}

.key-product-monitor-drawer-section {
  display: grid;
  gap: 10px;
}

.key-product-drawer-competitors {
  display: grid;
  gap: 0;
}

.key-product-drawer-competitor {
  display: grid;
  gap: 8px;
  padding: 11px 0;
  border: 0;
  border-top: 1px solid var(--line-light);
  border-radius: 0;
  background: #fff;
}

.key-product-drawer-competitor:first-child {
  border-top: 0;
  padding-top: 0;
}

.key-product-drawer-competitor.editing {
  margin: 6px 0;
  padding: 10px;
  border: 1px solid #91caff;
  border-radius: 8px;
  border-color: #91caff;
  background: #f7fbff;
}

.key-product-drawer-competitor-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: start;
  gap: 8px 10px;
  min-width: 0;
  padding: 0;
}

.key-product-drawer-competitor-title,
.key-product-drawer-competitor-meta,
.key-product-drawer-competitor-state {
  min-width: 0;
}

.key-product-drawer-competitor-title {
  display: grid;
  gap: 4px;
}

.key-product-drawer-competitor-title strong,
.key-product-drawer-competitor-title a,
.key-product-drawer-competitor-title b,
.key-product-drawer-competitor-title small,
.key-product-drawer-competitor-meta span,
.key-product-drawer-competitor-state small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-drawer-competitor-title strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 800;
}

.key-product-drawer-competitor-link {
  color: var(--accent);
  font-size: 12px;
  font-weight: 800;
  text-decoration: none;
}

.key-product-drawer-competitor-link:hover {
  color: var(--accent-dark);
  text-decoration: underline;
}

.key-product-drawer-competitor-prices {
  display: grid;
  justify-items: start;
  gap: 3px;
  min-width: 0;
}

.key-product-drawer-competitor-original-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: baseline;
  gap: 6px;
  min-width: 0;
}

.key-product-drawer-competitor-prices small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  line-height: 1.2;
}

.key-product-drawer-competitor-price {
  color: #111827;
  font-size: 14px;
  font-weight: 900;
  line-height: 1.15;
}

.key-product-drawer-competitor-original-price {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.15;
}

.key-product-drawer-competitor-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.3;
}

.key-product-drawer-competitor-state {
  display: flex;
  align-items: center;
  gap: 6px;
}

.key-product-drawer-competitor-state .key-product-status {
  max-width: 100%;
  min-height: 20px;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 11px;
}

.key-product-drawer-competitor-state small {
  color: var(--muted);
  font-size: 12px;
}

.key-product-drawer-competitor-actions {
  display: grid;
  grid-column: 2;
  grid-row: 1 / span 3;
  align-content: start;
  justify-items: end;
  gap: 7px;
  min-width: 0;
}

.key-product-drawer-competitor-error {
  margin: 0;
  padding: 0 10px 10px;
  color: #cf1322;
  font-size: 12px;
  line-height: 1.4;
}

.key-product-monitor-detail-row td {
  background: #f8fafc;
  padding: 12px;
}

.key-product-monitor-detail {
  display: grid;
  gap: 12px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius-base);
  background: #fff;
  padding: 12px;
}

.key-product-monitor-detail-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.key-product-monitor-detail-head strong,
.key-product-monitor-detail-head span {
  display: block;
}

.key-product-monitor-detail-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

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

.key-product-competitor-card {
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  border: 1px solid var(--line-light);
  border-radius: var(--radius-base);
  background: #fcfcfd;
}

.key-product-competitor-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}

.key-product-competitor-card-head strong,
.key-product-competitor-card-head small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.key-product-competitor-card-head small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 500;
}

.key-product-competitor-card input {
  width: 100%;
  min-width: 0;
}

.key-product-competitor-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
}

.key-product-competitor-card-meta b {
  color: #cf1322;
}

.key-product-competitor-card-meta em,
.key-product-competitor-card-meta i {
  font-style: normal;
}

.key-product-competitor-card-meta i {
  color: #cf1322;
}

@media (max-width: 1240px) {
  .key-products-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .key-products-kpi {
    border-top: 1px solid var(--line-light);
  }

  .key-products-kpi:nth-child(-n + 2) {
    border-top: 0;
  }

  .key-products-kpi:nth-child(2n) {
    border-right: 0;
  }
}

@media (max-width: 1280px) {
  .price-monitor-mode .key-product-monitor-workspace.has-drawer {
    grid-template-columns: 1fr;
  }

  .price-monitor-mode .key-products-table-wrap,
  .price-monitor-mode .key-product-monitor-drawer {
    margin: 0 18px 18px;
  }

  .key-product-monitor-drawer {
    position: static;
    max-height: none;
  }

  .price-monitor-mode .key-product-monitor-drawer {
    height: auto;
    min-height: 0;
    border: 1px solid var(--line-light);
    border-radius: var(--radius-base);
  }

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

@media (max-width: 980px) {
  .key-products-toolbar {
    display: grid;
    grid-template-columns: 1fr;
  }

  .price-monitor-mode .key-products-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .key-products-store-field {
    width: 100%;
  }

  .key-products-source-meta {
    min-width: 0;
  }

  .key-products-kpis {
    grid-template-columns: 1fr;
  }

  .key-product-monitor-fields,
  .key-product-monitor-link-fields {
    grid-template-columns: 1fr;
  }

  .key-products-kpi {
    border-right: 0;
    border-top: 1px solid var(--line-light);
  }

  .key-products-kpi:first-child {
    border-top: 0;
  }

  .key-products-source-meta span {
    white-space: normal;
  }

  .key-product-competitor-grid {
    grid-template-columns: 1fr;
  }

  .key-product-monitor-detail-head {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 720px) {
  .inventory-update-detail-toolbar {
    align-items: stretch;
  }

  .inventory-update-filter-area,
  .inventory-update-detail-toolbar label {
    width: 100%;
  }

  .inventory-update-brand-tabs,
  .inventory-update-brand-tabs button {
    width: 100%;
  }

  .inventory-update-direction-board {
    grid-template-columns: minmax(0, 1fr);
  }

  .inventory-update-lane-row {
    grid-template-columns: 50px minmax(0, 1fr);
  }

  .inventory-update-lane-row .inventory-update-thumb {
    width: 48px;
    height: 48px;
  }

  .inventory-update-row-action {
    grid-column: 1 / -1;
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .inventory-update-item-head {
    grid-template-columns: 56px minmax(0, 1fr);
    align-items: start;
  }

  .inventory-update-thumb {
    width: 56px;
    height: 56px;
  }

  .inventory-update-item-stats {
    grid-column: 1 / -1;
    justify-content: flex-start;
    max-width: none;
  }
}

.ads-page {
  display: grid;
  gap: 16px;
  width: min(1560px, calc(100% - 56px));
  margin: 0 auto;
  padding: 28px 0 40px;
  min-width: 0;
}

.ads-global-topbar {
  justify-content: flex-end;
  min-height: 64px;
}

.ads-global-topbar .header-actions {
  padding: 0;
}

.ads-page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 24px;
  min-width: 0;
}

.ads-page-head h1 {
  color: var(--text);
  font-size: 24px;
  font-weight: 800;
  line-height: 32px;
  margin: 0;
}

.ads-page-head p {
  color: var(--muted);
  font-size: 14px;
  line-height: 20px;
  margin: 4px 0 0;
}

.ads-primary-action {
  flex: none;
  min-height: 40px;
  border-color: #005ce8;
  background: #005ce8;
  color: #ffffff;
}

.ads-page .panel {
  margin-bottom: 0;
}

.ads-page-body .sidebar {
  background: #ffffff;
  border-right: 1px solid #e5e7e8;
  color: #626c70;
}

.ads-page-body .sidebar-toggle {
  background: #005ce8;
  color: #ffffff;
}

.ads-page-body .sidebar-toggle:hover {
  background: #0e5fd9;
}

.ads-page-body .sidebar-brand {
  border-bottom-color: #e5e7e8;
}

.ads-page-body .sidebar-brand h1 {
  color: #191b1c;
}

.ads-page-body .sidebar-brand h1::after {
  border-color: #e5e7e8;
  background: #f5f6f7;
  color: #626c70;
}

.ads-page-body .sidebar-brand p,
.ads-page-body .side-nav-section-title {
  color: #626c70;
}

.ads-page-body .side-nav {
  scrollbar-color: #b0b7ba transparent;
}

.ads-page-body .side-nav::-webkit-scrollbar-thumb {
  background: #b0b7ba;
}

.ads-page-body .side-nav-item,
.ads-page-body .side-subitem,
.ads-page-body .side-nested-parent,
.ads-page-body .side-third-item {
  color: #626c70;
}

.ads-page-body .side-nav-item:hover,
.ads-page-body .side-subitem:hover,
.ads-page-body .side-nested-parent:hover,
.ads-page-body .side-third-item:hover {
  background: #f5f6f7;
  color: #191b1c;
}

.ads-page-body .side-nav-item.active,
.ads-page-body .side-subitem.active {
  position: relative;
  background: #f0f6ff;
  color: #191b1c;
  font-weight: 700;
}

.ads-page-body .side-nav-item.active::before,
.ads-page-body .side-subitem.active::before {
  background: #005ce8;
  border-radius: 999px;
  content: "";
  height: 22px;
  left: 0;
  position: absolute;
  width: 3px;
}

.ads-page-body .side-submenu {
  background: #ffffff;
}

.ads-hero {
  align-items: stretch;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(0, 1fr) 372px;
}

.ads-overview-panel {
  background: #ffffff;
  border-color: var(--line);
  display: grid;
  gap: 18px;
}

.ads-overview-head {
  align-items: start;
  display: grid;
  gap: 20px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.ads-overview-head > div {
  min-width: 0;
}

.ads-overview-head h2 {
  margin-bottom: 4px;
}

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

.ads-filter-panel {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.ads-filter-panel > div {
  display: grid;
  gap: 8px;
}

.ads-filter-panel span,
.ads-custom-range label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.ads-filter-panel p {
  color: var(--regular);
  font-size: 13px;
  grid-column: 1 / -1;
  line-height: 1.55;
  margin: 0;
}

.ads-range-tabs {
  overflow-x: auto;
  width: auto;
}

.ads-custom-range {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(136px, 1fr)) auto;
}

.ads-custom-range[hidden] {
  display: none;
}

.ads-custom-range label {
  display: grid;
  gap: 6px;
}

.ads-custom-range input {
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--text);
  font: inherit;
  min-height: 34px;
  padding: 6px 9px;
}

.ads-custom-range button {
  min-height: 34px;
  padding: 0 14px;
}

.ads-kpi {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  min-height: 112px;
}

.ads-kpi:first-child {
  border-color: var(--line);
  box-shadow: none;
}

.ads-kpi span {
  color: var(--regular);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.ads-kpi b {
  color: var(--text);
  display: block;
  font-size: 23px;
  line-height: 32px;
  overflow-wrap: anywhere;
  font-variant-numeric: tabular-nums;
}

.ads-kpi small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 1.45;
  margin-top: 8px;
}

.ads-delta {
  color: var(--muted);
  font-weight: 650;
}

.ads-delta.up {
  color: #0faf62;
}

.ads-delta.down {
  color: #e84646;
}

.ads-delta.flat {
  color: var(--muted);
}

.ads-comparison-strip {
  align-items: start;
  background: #fafafa;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 12px 14px;
}

.ads-comparison-strip > span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  line-height: 22px;
  white-space: nowrap;
}

.ads-comparison-strip > div {
  align-items: center;
  color: var(--regular);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  font-size: 12px;
  line-height: 22px;
  min-width: 0;
}

.ads-comparison-strip strong {
  color: var(--text);
  font-size: 12px;
  font-weight: 750;
}

.ads-risk-panel {
  display: grid;
  gap: 10px;
  align-content: start;
}

.ads-risk-label {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.ads-risk-panel > b {
  color: var(--text);
  display: block;
  font-size: 34px;
  line-height: 1.12;
}

.ads-risk-panel > p {
  color: var(--regular);
  font-size: 12px;
  line-height: 18px;
  margin: 0;
}

.ads-risk-list {
  display: grid;
  gap: 0;
}

.ads-risk-row {
  align-items: center;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(86px, 0.8fr) minmax(0, 1.4fr) auto;
  min-height: 44px;
  padding: 10px 0;
}

.ads-risk-row strong {
  color: var(--text);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-risk-row span {
  color: var(--regular);
  font-size: 12px;
  line-height: 1.45;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-risk-empty {
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  padding-top: 12px;
}

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

.ads-grid-leading {
  align-items: stretch;
}

.ads-form {
  display: grid;
  gap: 12px;
}

.ads-drop-zone {
  min-height: 72px;
}

.ads-guide-strip {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 14px 16px;
}

.ads-guide-strip h2 {
  color: var(--text);
  font-size: 14px;
  line-height: 1.35;
  margin: 0;
  white-space: nowrap;
}

.ads-guide-strip p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  margin: 0;
}

.ads-guide-strip dl {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0;
}

.ads-guide-strip dl div {
  display: inline-flex;
  gap: 5px;
  min-width: 0;
}

.ads-guide-strip dt {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
}

.ads-guide-strip dd {
  color: var(--regular);
  font-size: 12px;
  line-height: 1.45;
  margin: 0;
}

.ads-import-panel {
  background: #ffffff;
}

.ads-import-panel-compact {
  padding: 14px 16px;
}

.ads-import-layout {
  align-items: stretch;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(340px, 0.95fr) minmax(360px, 1.05fr);
}

.ads-import-command {
  min-width: 0;
  display: grid;
  align-content: start;
}

.ads-import-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ads-import-title-row h2 {
  margin: 0 0 2px;
}

.ads-import-title-row p {
  color: var(--regular);
  display: none;
  font-size: 12px;
  line-height: 18px;
  margin: 0;
}

.ads-import-form-compact {
  align-items: end;
  background: transparent;
  border: 0;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) 72px;
  padding: 0;
}

.ads-import-form-compact .ads-drop-zone {
  align-content: center;
  align-items: center;
  background: #fafafa;
  border-radius: 6px;
  display: grid;
  gap: 2px;
  min-height: 48px;
  padding: 7px 12px;
  text-align: left;
  width: 100%;
}

.ads-import-form-compact .ads-drop-zone strong {
  color: var(--text);
  font-size: 13px;
  line-height: 18px;
}

.ads-import-form-compact .ads-drop-zone span {
  color: var(--muted);
  font-size: 12px;
  line-height: 16px;
}

.ads-import-form-compact button {
  min-height: 48px;
  padding: 0 14px;
  white-space: nowrap;
}

.ads-import-history {
  min-width: 0;
  display: grid;
  align-content: start;
}

.ads-subhead {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.ads-subhead h3 {
  color: var(--text);
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
}

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

.ads-batch-cards {
  display: grid;
  gap: 5px;
  grid-template-columns: 1fr;
}

.ads-batch-line {
  align-items: baseline;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 1.1fr) 118px minmax(160px, 1fr);
  min-width: 0;
  padding: 0;
}

.ads-batch-line strong,
.ads-batch-line span,
.ads-batch-line small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-batch-line strong {
  color: var(--text);
  font-size: 12px;
  line-height: 18px;
}

.ads-batch-line span,
.ads-batch-line small,
.ads-batch-empty {
  color: var(--regular);
  font-size: 12px;
  line-height: 18px;
}

.ads-batch-line small {
  color: var(--muted);
}

.ads-batch-empty {
  padding: 0;
}

.ads-chart {
  display: grid;
  gap: 10px;
  min-height: 180px;
  min-width: 0;
}

.ads-chart.empty-state {
  align-content: center;
  background: #fafafa;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  justify-content: center;
  padding: 24px;
}

.ads-bar-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 96px minmax(96px, 1fr) minmax(160px, 220px);
}

.ads-bar-label {
  color: var(--text);
  font-size: 12px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-bar-track {
  background: #edf2f5;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.ads-bar-track span {
  background: #005ce8;
  border-radius: inherit;
  display: block;
  height: 100%;
}

.ads-bar-value {
  color: var(--regular);
  font-size: 12px;
  line-height: 1.45;
  white-space: normal;
}

.ads-status {
  border-radius: 4px;
  display: inline-flex;
  font-size: 12px;
  font-weight: 650;
  line-height: 22px;
  margin: 0;
  min-height: 22px;
  padding: 0 7px;
  vertical-align: middle;
  white-space: nowrap;
}

.ads-status.ok {
  background: #e7f7ef;
  color: #0faf62;
}

.ads-status.warn {
  background: #fff4d6;
  color: #9a5b00;
}

.ads-status.danger {
  background: #fdecec;
  color: #e84646;
}

.ads-status.muted {
  background: #f5f5f5;
  color: var(--muted);
}

.ads-table {
  border-collapse: separate;
  border-spacing: 0;
  table-layout: fixed;
  width: 100%;
}

.ads-item-table {
  min-width: 1760px;
}

.ads-report-table {
  min-width: 2120px;
}

.ads-batch-table {
  min-width: 900px;
}

.ads-table th,
.ads-table td {
  vertical-align: middle;
  white-space: nowrap;
}

.ads-table th {
  color: #959fa3;
  font-size: 12px;
  line-height: 14px;
  font-weight: 700;
}

.ads-table td {
  color: #191b1c;
  font-size: 14px;
  line-height: 20px;
  height: 64px;
}

.ads-item-table th:nth-child(n + 2),
.ads-item-table td:nth-child(n + 2),
.ads-report-table th:nth-child(n + 4),
.ads-report-table td:nth-child(n + 4),
.ads-batch-table th:nth-child(4),
.ads-batch-table td:nth-child(4) {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.ads-item-table th:first-child,
.ads-item-table td:first-child,
.ads-item-table th:last-child,
.ads-item-table td:last-child,
.ads-report-table th:nth-child(-n + 3),
.ads-report-table td:nth-child(-n + 3),
.ads-batch-table th,
.ads-batch-table td {
  text-align: left;
}

.ads-table td small {
  color: var(--muted);
  display: block;
  margin-top: 4px;
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ads-status-list {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.ads-profit-cell {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}

.ads-profit-cell strong {
  color: #16794c;
  font-size: 14px;
  line-height: 18px;
}

.ads-profit-cell small {
  color: var(--muted);
  display: block;
  font-size: 12px;
  line-height: 16px;
  margin: 0;
  max-width: 100px;
}

.ads-profit-cell.warn strong {
  color: #a16207;
}

.ads-profit-cell.negative strong {
  color: #b42318;
}

.ads-profit-empty {
  color: var(--muted);
  font-size: 12px;
}

.ads-report-table td:nth-child(3) b {
  display: block;
  max-width: 410px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 1360px) {
  .ads-hero {
    grid-template-columns: minmax(0, 1fr) 388px;
    gap: 16px;
  }

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

  .ads-overview-head,
  .ads-import-layout {
    grid-template-columns: 1fr;
  }

  .ads-range-tabs {
    width: 100%;
  }
}

@media (max-width: 1180px) {
  .ads-page {
    width: min(100% - 40px, 1560px);
  }

  .ads-hero,
  .ads-kpis,
  .ads-grid {
    grid-template-columns: 1fr;
  }

  .ads-overview-head,
  .ads-filter-panel,
  .ads-custom-range,
  .ads-import-form-compact,
  .ads-batch-line {
    grid-template-columns: 1fr;
  }

  .ads-custom-range {
    align-items: stretch;
  }

  .ads-batch-cards,
  .ads-risk-row,
  .ads-bar-row {
    grid-template-columns: 1fr;
  }

  .ads-guide-strip {
    align-items: start;
    grid-template-columns: 1fr;
  }

  .ads-guide-strip dl {
    align-items: flex-start;
    flex-wrap: wrap;
    justify-content: flex-start;
  }

  .ads-risk-row span {
    white-space: normal;
  }
}

@media (max-width: 720px) {
  .ads-hero,
  .ads-kpis,
  .ads-grid {
    grid-template-columns: 1fr;
  }

  .ads-kpi {
    padding: 14px;
  }

  .ads-page {
    width: min(100% - 24px, 1560px);
    padding-top: 20px;
  }
}


/* Pata commission edit: compact the dense operator sidebar without changing global nav data. */
.commission-pata-page .app-shell {
  grid-template-columns: 220px minmax(0, 1fr) !important;
}

.commission-pata-page .sidebar {
  width: 220px !important;
  padding: 14px 10px !important;
}

.commission-pata-page .sidebar-toggle {
  width: 36px !important;
  height: 32px !important;
  margin-bottom: 16px !important;
}

.commission-pata-page .sidebar-brand {
  padding: 0 6px 14px !important;
}

.commission-pata-page .sidebar-brand h1 {
  font-size: 16px !important;
  line-height: 22px !important;
}

.commission-pata-page .sidebar-brand p {
  font-size: 12px !important;
  line-height: 18px !important;
}

.commission-pata-page .side-nav {
  gap: 6px !important;
  margin-top: 12px !important;
  padding-bottom: 12px !important;
}

.commission-pata-page .side-nav-section {
  gap: 2px !important;
}

.commission-pata-page .side-nav-section-title {
  height: 22px !important;
  padding: 4px 10px 0 !important;
  font-size: 11px !important;
  line-height: 16px !important;
}

.commission-pata-page .side-nav-item {
  grid-template-columns: 18px minmax(0, 1fr) 14px !important;
  gap: 9px !important;
  height: 34px !important;
  padding: 0 10px !important;
  border-radius: 5px !important;
  font-size: 13px !important;
  line-height: 18px !important;
}

.commission-pata-page .nav-icon {
  font-size: 14px !important;
}

.commission-pata-page .nav-caret {
  font-size: 12px !important;
}

.commission-pata-page .side-submenu {
  padding: 3px 0 5px !important;
}

.commission-pata-page .side-subitem,
.commission-pata-page .side-nested-parent {
  height: 30px !important;
  padding-left: 38px !important;
  font-size: 12px !important;
  line-height: 16px !important;
}

.commission-pata-page .side-third-item {
  height: 28px !important;
  padding-left: 54px !important;
  font-size: 12px !important;
  line-height: 16px !important;
}

@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .sidebar {
    position: static !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line-light) !important;
  }

  .content-shell,
  main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .inventory-history-workbench,
  .inventory-page-workbench,
  .inventory-auto-workbench,
  .inventory-auto-panel.inventory-auto-upload-only .inventory-auto-workbench,
  .inventory-current-steps,
  .inventory-history-summary-item,
  .inventory-history-action-row.primary {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .inventory-current-card,
  .inventory-upload-card,
  .inventory-extract-card,
  .inventory-history-panel,
  .inventory-task-detail-panel {
    width: 100% !important;
    min-width: 0 !important;
  }

  .inventory-history-table-head {
    display: none !important;
  }

  .inventory-history-summary-list {
    overflow: hidden !important;
  }

  .inventory-history-summary-item > * + * {
    border-left: 0 !important;
    border-top: 1px solid var(--line-light);
  }

  .inventory-history-summary-item > .inventory-history-action-row.outputs,
  .inventory-history-summary-item > .inventory-history-support-actions {
    padding: 14px 16px !important;
  }

  .inventory-history-action-row.outputs .history-action-link,
  .inventory-history-action-row.primary .history-action-link {
    width: 100% !important;
    min-width: 0 !important;
  }

  .commission-edit-page .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .commission-edit-page .sidebar {
    position: static !important;
    width: 100% !important;
  }

  .commission-edit-page .content-shell,
  .commission-edit-page main,
  .commission-edit-page .commission-edit-layout,
  .commission-edit-page .commission-edit-main,
  .commission-edit-page .commission-file-sidebar {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }

  .commission-edit-page .commission-edit-layout,
  .commission-edit-page .commission-basic-panel .commission-basic-grid,
  .commission-edit-page .commission-process-panel .module-title {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .commission-edit-page .commission-process-panel .module-actions {
    grid-column: 1 !important;
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    width: 100%;
  }

  .commission-edit-page .process-step {
    grid-template-columns: 34px minmax(0, 1fr);
    gap: 10px;
  }

  .commission-edit-page .process-step em,
  .commission-edit-page .process-step-actions {
    grid-column: 2;
  }

  .commission-edit-page .process-step-actions {
    justify-content: flex-start;
    flex-wrap: wrap;
  }
}

/* sidebar-guard:start */
.app-shell {
  grid-template-columns: 248px minmax(0, 1fr) !important;
}

.sidebar {
  width: 248px !important;
  background: #fff !important;
  color: var(--text) !important;
  box-shadow: inset -1px 0 0 var(--line-light) !important;
}

.sidebar-toggle {
  background: transparent !important;
  box-shadow: none !important;
}

.sidebar-toggle:hover {
  background: var(--fill-light) !important;
}

.sidebar-toggle > span {
  background: var(--regular) !important;
}

.sidebar-brand {
  border-bottom-color: var(--line-light) !important;
}

.sidebar-brand h1 {
  color: var(--text) !important;
  font-size: 17px !important;
  font-weight: 600 !important;
  line-height: 24px !important;
}

.sidebar-brand h1::after {
  border-color: var(--line-light) !important;
  background: var(--bg) !important;
  color: var(--muted) !important;
  font-size: 10px !important;
  font-weight: 500 !important;
}

.sidebar-brand p,
.side-nav-section-title {
  color: var(--muted) !important;
}

.side-nav {
  scrollbar-color: rgba(98, 108, 112, 0.28) transparent !important;
}

.side-nav::-webkit-scrollbar-thumb {
  background: rgba(98, 108, 112, 0.28) !important;
}

.side-nav-item {
  height: 40px !important;
  border-radius: 6px !important;
  background: transparent !important;
  color: var(--muted) !important;
  font-weight: 500 !important;
}

.side-nav-item:hover {
  background: var(--fill-light) !important;
  color: var(--text) !important;
}

.side-nav-item.active {
  background: var(--accent-light) !important;
  color: var(--text) !important;
  box-shadow: inset 3px 0 0 var(--accent) !important;
  font-weight: 600 !important;
}

.side-nav-parent {
  color: var(--text) !important;
  font-weight: 600 !important;
}

.nav-icon svg,
.nav-icon svg * {
  fill: none !important;
  stroke: currentColor !important;
}

.side-submenu {
  background: transparent !important;
}

.side-submenu::before {
  background: var(--line-light) !important;
}

.side-subitem,
.side-nested-parent,
.side-third-item {
  color: var(--muted) !important;
}

.side-subitem.active {
  background: #fff !important;
  color: var(--accent) !important;
  box-shadow: none !important;
}
@media (max-width: 720px) {
  .app-shell {
    grid-template-columns: minmax(0, 1fr) !important;
    width: 100% !important;
    min-width: 0 !important;
  }

  .sidebar {
    position: static !important;
    width: 100% !important;
    min-height: 0 !important;
    max-height: none !important;
    border-right: 0 !important;
    border-bottom: 1px solid var(--line-light) !important;
  }

  .content-shell,
  main {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
  }
}

/* sidebar-guard:end */
