:root {
  --background: #f3f5f7;
  --surface: #ffffff;
  --surface-muted: #f8f9fa;
  --border: #dce2e8;
  --border-strong: #c4cdd5;
  --text: #18212b;
  --text-muted: #62707d;
  --primary: #176b4d;
  --primary-hover: #10543c;
  --primary-soft: #e4f3ec;
  --blue: #2563a6;
  --blue-soft: #e8f1fb;
  --orange: #a65212;
  --orange-soft: #fff0df;
  --red: #b4232f;
  --red-soft: #fdebed;
  --shadow: 0 8px 24px rgba(26, 39, 52, 0.08);
  --topbar-height: 64px;
  --sidebar-width: 224px;
  font-family: Inter, "Segoe UI", "Microsoft YaHei", system-ui, sans-serif;
  color: var(--text);
  background: var(--background);
}

/* Readable operation dialogs and compact after-sales workspace. */
.order-list-product-title > span {
  color: #d33131 !important;
  font-weight: 800;
}

#operation-dialog .operation-detail {
  font-size: 14px;
}

#operation-dialog .conversation-message {
  font-size: 15px;
  line-height: 1.48;
}

#operation-dialog .conversation-message .incoming-translation {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.42;
}

#operation-dialog .conversation-message > small:last-child {
  font-size: 11px;
}

#operation-dialog .conversation-item-summary .product-title-link,
#operation-dialog .conversation-item-summary .message-item-cell > div > span,
#operation-dialog .claim-order-summary .product-title-link,
#operation-dialog .claim-order-summary .message-item-cell > div > span {
  max-width: none;
  overflow: visible;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}

#operation-dialog .message-item-cell small {
  font-size: 13px;
  font-weight: 700;
}

#operation-dialog .dialog-order-link,
#operation-dialog .message-order-id,
#operation-dialog .message-item-id {
  font-size: 15px;
  font-weight: 900;
}

.conversation-item-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(360px, 1fr);
  align-items: center;
  gap: 10px;
}

.message-order-parameters {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.3;
}

.message-order-parameters .message-variation {
  grid-column: 1 / -1;
  color: #d33131 !important;
  font-weight: 800;
}

.message-order-parameters .message-logistics-status {
  color: #176f66 !important;
  font-weight: 800;
}

#operation-dialog.compact-question-dialog {
  width: min(760px, calc(100% - 24px));
}

#operation-dialog.compact-question-dialog .operation-detail {
  max-height: min(68vh, 620px);
  gap: 10px;
  padding: 12px;
}

.question-dialog-summary {
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
}

.question-dialog-image {
  width: 118px;
  height: 118px;
}

.question-dialog-information {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.question-dialog-information > div {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 5px;
  background: #fff;
  font-size: 14px;
  line-height: 1.35;
}

.question-dialog-information span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}

.question-dialog-information strong,
.question-dialog-information a {
  font-size: 15px;
  overflow-wrap: anywhere;
}

#operation-dialog .question-dialog-content {
  min-width: min(520px, 88%);
  padding: 10px 12px;
  font-size: 16px;
}

@media (min-width: 761px) {
  #operation-dialog.claim-dialog #operation-dialog-meta .detail-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    margin-top: 2px;
  }

  #operation-dialog.claim-dialog #operation-dialog-meta .detail-grid > div {
    min-height: 0;
    max-height: 58px;
    padding: 4px 7px;
    overflow: auto;
    font-size: 12.5px;
    line-height: 1.25;
  }

  #operation-dialog.claim-dialog #operation-dialog-meta .detail-grid span {
    margin-bottom: 2px;
    font-size: 10.5px;
  }

  #operation-dialog.claim-dialog .claim-order-summary {
    min-height: 70px;
    padding: 4px 8px;
  }

  #operation-dialog.claim-dialog .operation-detail {
    margin: 2px 0;
    padding: 5px;
  }

  #operation-dialog.claim-dialog .conversation-thread {
    min-height: 380px;
    gap: 6px;
  }

  #operation-dialog.claim-dialog #operation-reply-label textarea {
    min-height: 52px;
    max-height: 64px;
  }
}

@media (max-width: 760px) {
  #operation-dialog .conversation-message,
  #operation-dialog.claim-dialog .conversation-message {
    font-size: 16px;
    line-height: 1.48;
  }

  #operation-dialog .conversation-message .incoming-translation,
  #operation-dialog.claim-dialog .conversation-message .incoming-translation {
    font-size: 14px;
    line-height: 1.42;
  }

  .conversation-item-summary {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .message-order-parameters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
    font-size: 12px;
  }

  #operation-dialog .dialog-order-link,
  #operation-dialog .message-order-id,
  #operation-dialog .message-item-id {
    font-size: 14px;
  }

  #operation-dialog .question-dialog-summary {
    grid-template-columns: 78px minmax(0, 1fr);
  }

  #operation-dialog .question-dialog-image {
    width: 78px;
    height: 78px;
  }

  .question-dialog-information {
    grid-template-columns: 1fr 1fr;
    gap: 3px;
  }

  .question-dialog-information > div {
    padding: 4px;
    font-size: 12px;
  }

  .question-dialog-information span {
    font-size: 10px;
  }

  .question-dialog-information strong,
  .question-dialog-information a {
    font-size: 12px;
  }
}

.collector-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}
.collector-status-strip > div { padding: 10px 14px; border-right: 1px solid var(--border); }
.collector-status-strip > div:last-child { border-right: 0; }
.collector-status-strip span { color: var(--text-muted); }
.collector-status-strip strong { float: right; font-size: 17px; }
.collector-online { color: #0b806b; }
.collector-offline { color: #c43131; }
.collector-actions {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 12px;
  padding: 10px 12px;
}
.collector-actions label { display: grid; gap: 4px; min-width: 190px; }
.collector-actions label:nth-child(2) { min-width: 130px; }
.collector-actions select,
.collector-actions input { min-height: 38px; }
/* 并发窗口数上限提示：跟随输入框的小字说明，深色模式下不额外定义变量。 */
.collector-field-hint { font-size: 11px; color: var(--text-muted); }
.collector-field-hint:empty { display: none; }
.collector-layout { display: grid; grid-template-columns: 270px minmax(0, 1fr); gap: 12px; }
.collector-options,
.collector-main { display: grid; align-content: start; gap: 12px; }
.collector-options .data-section,
.collector-main .data-section { padding: 0; overflow: hidden; }
.collector-panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 44px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
}
.collector-panel-heading h2 { margin: 0; font-size: 16px; }
.collector-check-list { max-height: 300px; overflow: auto; padding: 6px; }
.collector-check-row {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 5px;
  cursor: pointer;
}
.collector-check-row:hover { background: #f1f7f6; }
.collector-check-row span { display: grid; min-width: 0; }
.collector-check-row strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collector-check-row small { color: var(--text-muted); }
.collector-summary {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 8px;
  padding: 10px;
}
.collector-summary-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 3px 8px;
  padding: 9px 10px;
  border: 1px solid var(--border);
  border-radius: 6px;
}
.collector-summary-card strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.collector-summary-card span { color: var(--text-muted); }
.collector-summary-card b { grid-row: 1 / span 2; grid-column: 2; align-self: center; font-size: 22px; color: #127567; }
.collector-log-list { max-height: 260px; overflow: auto; }
.collector-log-row {
  display: grid;
  grid-template-columns: 145px minmax(0, 1fr);
  gap: 10px;
  padding: 6px 12px;
  border-bottom: 1px solid var(--border);
}
.collector-log-row time { color: var(--text-muted); }
.collector-log-row.error span { color: #c43131; }
.collector-log-row.warn span { color: #b26300; }
.collector-guide-dialog { width: min(760px, calc(100% - 24px)); }
.collector-guide-steps { display: grid; gap: 10px; margin: 4px 0; padding-left: 28px; }
.collector-guide-steps li { padding-left: 6px; }
.collector-guide-steps strong,
.collector-guide-steps span { display: block; }
.collector-guide-steps span { margin-top: 3px; color: var(--text-muted); line-height: 1.55; }
.collector-guide-note { padding: 10px 12px; border-radius: 6px; background: #eef8f5; line-height: 1.55; }
.claim-message-send-status {
  margin-left: 8px;
  font-weight: 800;
}
.claim-message-send-status.success { color: #087f5b; }
#operation-reply-submit.reply-submit-failed {
  background: #c43131;
  border-color: #c43131;
}

@media (max-width: 900px) {
  .collector-status-strip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .collector-status-strip > div:nth-child(2) { border-right: 0; }
  .collector-layout { grid-template-columns: 1fr; }
  .collector-actions { flex-wrap: wrap; }
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  background: var(--background);
}

button,
input,
select {
  font: inherit;
}

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

button,
a.primary-button,
a.secondary-button,
a.alert-shortcut {
  transition: transform 90ms ease, filter 90ms ease, box-shadow 140ms ease, background-color 140ms ease;
}

button:not(:disabled):active,
a.primary-button:active,
a.secondary-button:active,
a.alert-shortcut:active {
  transform: translateY(1px) scale(0.97);
  filter: brightness(0.9);
}

button:not(:disabled):hover {
  filter: brightness(0.97);
  box-shadow: 0 3px 10px rgba(48, 56, 82, 0.1);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 3px solid rgba(37, 99, 166, 0.24);
  outline-offset: 2px;
}

.hidden {
  display: none !important;
}

.loading-screen {
  min-height: 100vh;
  display: grid;
  place-content: center;
  justify-items: center;
  gap: 14px;
  color: var(--text-muted);
}

.loading-mark {
  width: 34px;
  height: 34px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(90deg, transparent 49.8%, rgba(24, 33, 43, 0.035) 50%, transparent 50.2%),
    var(--background);
}

.auth-panel {
  width: min(440px, 100%);
  padding: 36px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.brand-block,
.topbar-brand,
.user-summary,
.dialog-heading,
.data-section-heading,
.section-heading {
  display: flex;
  align-items: center;
}

.brand-block {
  gap: 16px;
  margin-bottom: 30px;
}

.brand-block h1,
.section-heading h1,
.dialog-heading h2,
.data-section-heading h2 {
  margin: 0;
  letter-spacing: 0;
}

.brand-block h1 {
  font-size: 24px;
}

.brand-block p,
.dialog-heading p,
.data-section-heading p,
.section-subtitle {
  margin: 6px 0 0;
  color: var(--text-muted);
  line-height: 1.5;
}

.brand-mark {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  background: var(--primary);
  color: #fff;
  border-radius: 8px;
  font-weight: 800;
}

.brand-mark.small {
  width: 34px;
  height: 34px;
  border-radius: 6px;
  font-size: 13px;
}

.form-stack,
.dialog-body {
  display: grid;
  gap: 18px;
}

label {
  display: grid;
  gap: 8px;
  color: #374451;
  font-size: 14px;
  font-weight: 600;
}

input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

select {
  min-height: 42px;
  padding: 0 36px 0 12px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

input:focus {
  border-color: var(--blue);
}

.primary-button,
.secondary-button,
.text-button,
.icon-button,
.alert-shortcut,
.nav-button {
  border: 0;
  cursor: pointer;
}

.primary-button,
.secondary-button {
  min-height: 42px;
  padding: 10px 16px;
  border-radius: 6px;
  font-weight: 700;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.primary-button:hover {
  background: var(--primary-hover);
}

.secondary-button {
  color: #344150;
  background: #fff;
  border: 1px solid var(--border-strong);
}

.secondary-button:hover {
  background: var(--surface-muted);
}

.text-button {
  color: var(--primary);
  background: transparent;
  padding: 8px;
  font-weight: 700;
}

.icon-button {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 22px;
}

.icon-button:hover {
  background: var(--surface-muted);
}

.full-width {
  width: 100%;
}

.form-error {
  min-height: 22px;
  margin: 14px 0 0;
  color: var(--red);
  font-size: 14px;
}

.notice {
  padding: 12px 14px;
  border: 1px solid #f2c37c;
  border-radius: 6px;
  background: var(--orange-soft);
  color: #75400e;
  line-height: 1.5;
}

.notice.neutral {
  background: var(--blue-soft);
  border-color: #b9d0ec;
  color: #1d4d7d;
}

.notice.success {
  background: var(--primary-soft);
  border-color: #a9d5c0;
  color: #12533d;
}

.notice.error {
  background: #fff1f1;
  border-color: #ef9a9a;
  color: #b42318;
  font-weight: 700;
}

.claim-action-failed,
.claim-action-failed:hover {
  background: #d92d20;
  border-color: #d92d20;
  color: #fff;
}

.app-shell {
  min-height: 100vh;
}

.topbar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 30;
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  background: #fff;
  border-bottom: 1px solid var(--border);
}

.topbar-brand {
  gap: 10px;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.user-summary {
  align-items: flex-end;
  flex-direction: column;
  gap: 2px;
}

.user-summary small {
  color: var(--text-muted);
}

.alert-shortcut {
  min-height: 36px;
  padding: 6px 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  border-radius: 6px;
  color: var(--red);
  background: var(--red-soft);
  font-weight: 700;
}

.count-badge {
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  background: var(--red);
  color: #fff;
  font-size: 12px;
}

.sidebar {
  position: fixed;
  z-index: 20;
  inset: var(--topbar-height) auto 0 0;
  width: var(--sidebar-width);
  padding: 20px 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #202a33;
  color: #fff;
}

.sidebar nav {
  display: grid;
  gap: 6px;
}

.nav-button {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  text-align: left;
  color: #cbd4db;
  background: transparent;
  border-radius: 6px;
  font-weight: 650;
}

.nav-button:hover,
.nav-button.active {
  color: #fff;
  background: #33414d;
}

.nav-button.active {
  box-shadow: inset 3px 0 0 #5cc294;
}

.sidebar-status {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #aebbc5;
  font-size: 12px;
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #5cc294;
}

.content {
  min-height: 100vh;
  margin-left: var(--sidebar-width);
  padding: calc(var(--topbar-height) + 30px) 32px 48px;
}

.view-section {
  max-width: 1440px;
  margin: 0 auto;
}

.section-heading {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 24px;
}

.section-heading h1 {
  font-size: 27px;
}

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

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 20px;
}

.metric-tile {
  min-height: 142px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: var(--surface);
  border: 1px solid var(--border);
  border-top: 3px solid var(--primary);
  border-radius: 6px;
}

.metric-tile span,
.metric-tile small {
  color: var(--text-muted);
}

.metric-tile strong {
  font-size: 36px;
  line-height: 1;
}

.metric-tile.accent-blue { border-top-color: var(--blue); }
.metric-tile.accent-orange { border-top-color: var(--orange); }
.metric-tile.accent-red { border-top-color: var(--red); }

.dashboard-columns {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
  gap: 20px;
  align-items: start;
}

.order-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 20px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.order-status-strip > div {
  min-height: 70px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-right: 1px solid var(--border);
}

.order-status-strip > div:last-child {
  border-right: 0;
}

.order-status-strip span {
  color: var(--text-muted);
  font-size: 13px;
}

.order-status-strip strong {
  font-size: 22px;
}

.data-section,
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
}

.data-section-heading {
  justify-content: space-between;
  gap: 16px;
  min-height: 80px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.data-section-heading h2 {
  font-size: 17px;
}

.data-section-heading p {
  font-size: 13px;
}

.status-label {
  padding: 5px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

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

.status-label.active {
  background: var(--primary-soft);
  color: var(--primary);
}

.status-label.inactive {
  background: #edf0f2;
  color: #586571;
}

.table-action.danger {
  color: #b42318;
}

.table-action-disabled {
  color: #84909a;
  font-size: 13px;
}

.alert-list {
  min-height: 180px;
}

.store-status-panel .compact-list {
  min-height: 0;
}

.alert-item,
.compact-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
}

.alert-item:last-child,
.compact-item:last-child {
  border-bottom: 0;
}

.alert-item.unread {
  background: #fffaf4;
}

.alert-copy {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  overflow: hidden;
}

.alert-copy strong {
  flex: 0 0 auto;
  margin: 0;
  font-size: 14px;
}

.compact-item strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
}

.alert-copy span,
.compact-item span {
  color: var(--text-muted);
  font-size: 12px;
}

.alert-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.pagination-bar,
.page-buttons,
.page-jump-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.pagination-bar {
  justify-content: flex-end;
  flex-wrap: wrap;
  padding: 12px 16px;
  border-top: 1px solid var(--border);
}

.pagination-bar .secondary-button {
  min-height: 34px;
  padding: 6px 10px;
}

.page-button {
  width: 34px;
  height: 34px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
}

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

.page-jump-form label {
  color: var(--text-muted);
  font-size: 12px;
}

.page-jump-form input {
  width: 62px;
  min-height: 34px;
  padding: 5px 7px;
}

.alert-read-state {
  color: var(--text-muted);
  font-size: 12px;
}

#alerts-panel {
  scroll-margin-top: calc(var(--topbar-height) + 16px);
}

.severity-marker {
  width: 4px;
  align-self: stretch;
  min-height: 38px;
  border-radius: 2px;
  background: var(--blue);
}

.severity-marker.warning { background: var(--orange); }
.severity-marker.critical { background: var(--red); }

.empty-inline,
.empty-state {
  color: var(--text-muted);
  text-align: center;
}

.empty-inline {
  padding: 54px 20px;
}

.empty-state {
  padding: 70px 20px;
}

.empty-state strong {
  color: var(--text);
}

.table-section {
  overflow: hidden;
}

.dashboard-detail-section,
.trend-section,
.export-section {
  margin-top: 20px;
}

.reputation-stack {
  display: grid;
  gap: 6px;
  min-width: 540px;
}

.reputation-line {
  display: grid;
  grid-template-columns: 112px repeat(4, minmax(92px, auto));
  align-items: center;
  gap: 8px;
  font-size: 12px;
  min-height: 30px;
}

.dashboard-detail-table thead th {
  position: sticky;
  z-index: 8;
  top: var(--topbar-height);
  background: #fff;
  box-shadow: 0 1px 0 var(--border);
}

.dashboard-detail-table td { padding-top: 7px; padding-bottom: 7px; }
.dashboard-detail-table .reputation-metric { font-size: 14px; font-weight: 700; }
.dashboard-detail-table .quota-limit-highlight { color: #1769e0; }
.dashboard-detail-table .reputation-site-name { width: 26px; min-width: 26px; }
.dashboard-detail-table .site-reputation-color { width: 13px; height: 13px; margin-left: 2px; }

.store-data-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 12px;
  margin: 0 0 10px;
}

.store-data-date-control {
  display: grid;
  gap: 4px;
  color: #52606d;
  font-size: 12px;
  font-weight: 700;
}

.store-data-date-control input {
  min-height: 38px;
  padding: 7px 10px;
  border: 1px solid #d6dee7;
  border-radius: 8px;
  background: #fff;
  color: #172033;
  font: inherit;
}

.store-data-date-control input.active {
  border-color: #176b4d;
  box-shadow: 0 0 0 2px rgba(23, 107, 77, 0.12);
}

.store-data-periods {
  display: flex;
  gap: 8px;
}

.store-data-period {
  min-width: 82px;
  padding: 9px 18px;
  border: 1px solid #d6dee7;
  border-radius: 9px;
  background: #fff;
  color: #344054;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
}

.store-data-period.active {
  border-color: #176b4d;
  background: #e9f6f1;
  color: #0c694d;
}

/* 统计口径说明：默认折叠，避免常驻一大块文字把表格挤下去。 */
.store-data-notes-details {
  margin-bottom: 10px;
  border: 1px solid #dbe7e2;
  border-radius: 10px;
  background: #f6fbf9;
}

.store-data-notes-details > summary {
  padding: 6px 14px;
  color: #176b4d;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.store-data-notes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  padding: 0 14px 9px;
  color: #52606d;
  font-size: 13px;
}

.store-data-notes strong { color: #176b4d; }

.store-data-section { overflow: hidden; }
/* 访客指标采集弹窗：控件与窗口列表都按高密度排布，窗口多列显示以减少滚动。 */
.store-data-collector-dialog { width: min(1040px, calc(100vw - 24px)); }

.store-data-collector-dialog .dialog-body {
  display: grid;
  gap: 6px;
  padding: 12px 14px;
}

.store-data-collector-dialog .dialog-heading h2 { font-size: 17px; }
.store-data-collector-dialog .dialog-heading p { margin: 2px 0 0; font-size: 12px; }

.store-data-collector-dialog .collector-actions {
  margin: 0;
  padding: 0;
  gap: 8px;
}

.store-data-collector-dialog .collector-actions label {
  gap: 2px;
  min-width: 210px;
  font-size: 12px;
}

.store-data-collector-dialog .collector-actions label:nth-child(2) { min-width: 116px; }

.store-data-collector-dialog .collector-actions select,
.store-data-collector-dialog .collector-actions input {
  height: 30px;
  min-height: 30px;
  font-size: 13px;
}

.store-data-collector-dialog .collector-actions button {
  min-height: 30px;
  padding: 4px 12px;
  font-size: 13px;
}

.store-data-collector-dialog .collector-panel-heading {
  min-height: 30px;
  padding: 3px 8px;
}

.store-data-collector-dialog .collector-panel-heading h2 { font-size: 13px; }

.store-data-collector-dialog .collector-panel-heading label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
}

/* 全局 input 是 width:100%，不加这条「全选」复选框会被拉成一条大方块。 */
.store-data-collector-dialog .collector-panel-heading input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
}

.store-data-collector-dialog .collector-check-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  align-content: start;
  gap: 2px;
  max-height: min(46vh, 380px);
  padding: 4px;
}

.store-data-collector-dialog .collector-check-row {
  grid-template-columns: 15px minmax(0, 1fr);
  gap: 6px;
  padding: 3px 6px;
  font-size: 12px;
  line-height: 1.25;
}

.store-data-collector-dialog .collector-check-row input {
  width: 14px;
  height: 14px;
  margin: 0;
}

.store-data-collector-dialog .collector-check-row small { font-size: 11px; }

.store-data-collector-dialog .empty-state {
  grid-column: 1 / -1;
  padding: 14px;
  font-size: 12px;
}

/* 自动采集开关：与窗口列表同处弹窗，同样按高密度排布。 */
.store-data-collector-dialog .collector-schedule-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 10px;
  padding: 4px 8px;
  border: 1px solid var(--border-color, #dce2e8);
  border-radius: 6px;
  background: #f7f9fb;
}

.store-data-collector-dialog .collector-schedule-toggle {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 12px;
}

/* 全局 input 是 width:100%，不钉住尺寸这个开关会被拉成一条大方块。 */
.store-data-collector-dialog .collector-schedule-toggle input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  flex: none;
}

.store-data-collector-dialog .collector-schedule-row .collector-field-hint {
  flex: 1 1 260px;
}

/* 失败窗口可能很多：状态栏限制高度并允许滚动，不把弹窗撑高。 */
.store-data-collector-dialog #store-data-visitor-status {
  max-height: 72px;
  overflow-y: auto;
}


.store-data-table {
  min-width: 1120px;
  table-layout: fixed;
}

.store-data-table th,
.store-data-table td {
  padding: 9px 10px;
  vertical-align: middle;
  white-space: nowrap;
}

.store-data-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f7f9fc;
}

.store-data-table th:nth-child(1) { width: 150px; }
.store-data-table th:nth-child(2) { width: 130px; }
.store-data-table th:nth-child(3) { width: 90px; }
.store-data-table th:nth-child(4) { width: 100px; }
.store-data-table th:nth-child(5) { width: 130px; }
.store-data-table th:nth-child(6) { width: 100px; }
.store-data-table th:nth-child(7) { width: 110px; }
.store-data-table th:nth-child(8) { width: 140px; }
.store-data-table th:nth-child(9) { width: 140px; }
.store-data-table thead th.store-data-number { text-align: right; }

.store-data-summary-row {
  background: #eef8f3;
  border-bottom: 2px solid #b7dccc;
}

.store-data-summary-row th,
.store-data-summary-row td {
  font-weight: 800;
}

.store-data-summary-label { color: #0c694d; }
.store-data-summary-date { color: #52606d; font-size: 13px; }

.store-data-store {
  width: 150px;
  background: #fbfcfd;
  color: #101828;
  font-size: 15px;
  text-align: left;
}

.store-data-site {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 15px;
}

.store-data-number {
  color: #101828;
  font-size: 15px;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

.store-data-number.positive {
  color: #087443;
  font-weight: 800;
}

.store-data-unavailable {
  color: #98a2b3;
  text-align: center;
}

.store-data-updated {
  color: #667085;
  font-size: 12px;
}
.store-data-visitor-hint {
  display: block;
  color: #667085;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
}

.site-flag {
  display: inline-block;
  width: 22px;
  margin-right: 4px;
  font-size: 15px;
}

.site-flag-image,
.site-flag-fallback {
  width: 24px;
  height: 18px;
  margin-right: 7px;
  display: inline-block;
  flex: 0 0 auto;
  vertical-align: -4px;
  object-fit: cover;
  border-radius: 2px;
  box-shadow: 0 0 0 1px rgba(24, 33, 43, 0.12);
}

.site-flag-fallback {
  height: auto;
  box-shadow: none;
}

.reputation-metric {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  white-space: nowrap;
}

.reputation-site-name {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.site-reputation-color {
  width: 10px;
  height: 10px;
  margin-left: 6px;
  border-radius: 50%;
  background: #8a959f;
  box-shadow: 0 0 0 2px #fff, 0 0 0 3px rgba(24, 33, 43, 0.14);
}

.site-reputation-color.green { background: #16824f; }
.site-reputation-color.light_green { background: #65b84f; }
.site-reputation-color.yellow { background: #d5a000; }
.site-reputation-color.orange { background: #d46b1d; }
.site-reputation-color.red { background: var(--red); }

.reputation-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #8a959f;
}

.reputation-dot.green,
.reputation-dot.light_green { background: #16824f; }
.reputation-dot.yellow { background: #d5a000; }
.reputation-dot.orange { background: #d46b1d; }
.reputation-dot.red { background: var(--red); }

.sync-error {
  display: block;
  max-width: 320px;
  margin-top: 4px;
  color: var(--red);
  white-space: normal;
}

.filter-actions,
.export-actions,
.chart-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.operation-filters {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 14px;
}

.operation-filters select {
  min-width: 150px;
}

.inline-checkbox {
  display: inline-flex;
  grid-template-columns: none;
  flex-direction: row;
  align-items: center;
  gap: 7px;
  color: var(--text-muted);
  font-size: 13px;
}

.inline-checkbox input {
  width: 17px;
  height: 17px;
}

.cell-copy {
  display: block;
  max-width: 340px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-site-stack {
  display: grid;
  gap: 6px;
  min-width: 190px;
}

.product-site-line {
  display: grid;
  grid-template-columns: 112px minmax(150px, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 30px;
}

.today-orders-by-site {
  display: grid;
  gap: 4px;
  min-width: 112px;
}

.today-orders-by-site > span {
  display: flex;
  align-items: center;
  min-height: 30px;
  color: var(--text-muted);
  font-size: 11px;
  white-space: nowrap;
}

.today-orders-by-site b {
  margin-left: auto;
  font-variant-numeric: tabular-nums;
}

.today-orders-by-site .has-orders {
  color: var(--text-main);
  font-weight: 800;
}

.product-site-line strong,
.reputation-line > strong {
  display: flex;
  align-items: center;
  min-width: 0;
  position: relative;
  white-space: nowrap;
}

.product-site-line .site-ban-indicator {
  position: absolute;
  z-index: 3;
  left: 1px;
  top: 50%;
  color: #dc1e2f;
  font-size: 22px;
  font-weight: 900;
  line-height: 1;
  text-shadow: 0 0 2px #fff, 0 0 2px #fff;
  transform: translate(-68%, -52%);
}

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

.product-site-stack {
  min-width: 430px;
}

.product-site-line {
  grid-template-columns: 108px minmax(300px, 1fr);
  gap: 8px;
}

.product-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(64px, 1fr));
  gap: 5px;
}

.product-stat-grid > span {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1px;
  min-width: 0;
  padding: 2px 5px;
  border-radius: 5px;
  background: #f6f8fb;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.product-stat-grid small {
  color: var(--text-muted);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}

.product-stat-grid b {
  color: var(--text-main);
  font-size: 12px;
  line-height: 1.35;
  white-space: nowrap;
}

.order-status-badge {
  padding: 3px 9px;
  border-radius: 999px;
  color: #fff !important;
  font-size: 11px;
  font-weight: 800;
}
.order-status-badge.ready { background: #2374e1; }
.order-status-badge.shipped { background: #55a86b; }
.order-status-badge.delivered { background: #167347; }
.order-status-badge.cancelled { background: #d93645; }
.order-status-badge.other { background: #728096; }
.order-fulfillment-status.review { color: #d93645; }
.order-fulfillment-status.deadline { color: #1d2a3b; }
.order-fulfillment-status.pending { color: var(--text-muted); }

.claim-status { font-weight: 800; }
.claim-status.action-required { color: #d33131; }
.claim-status.waiting-external { color: #b25e09; }
.claim-status.resolved { color: #16824f; }
.claim-status.platform-removed { color: #667085; }
.claim-reputation-status {
  display: inline-block;
  font-weight: 700;
  line-height: 1.25;
}
.claim-reputation-status.affected { color: #d33131; }
.claim-reputation-status.protected { color: #d46b1d; }
.claim-reputation-status.not-affected { color: #111827; }
.claim-reputation-status.unknown { color: #667085; }
.claim-resolution-controls { display: flex; align-items: center; flex-wrap: wrap; gap: 7px; margin: 6px 0; }
.claim-resolution-controls select { width: auto; min-width: 210px; padding: 7px; }

.page-buttons { display: inline-flex; align-items: center; gap: 4px; }
.page-buttons .active { color: #fff; border-color: var(--primary); background: var(--primary); }
.page-gap { padding: 0 2px; color: var(--text-muted); }

#operation-dialog .dialog-header { padding-top: 8px; padding-bottom: 7px; }
#operation-dialog .detail-grid { gap: 2px; margin-bottom: 5px; }
#operation-dialog .detail-grid > div { min-height: 0; padding: 5px 8px; font-size: 12px; }
#operation-dialog .detail-grid span { margin-bottom: 1px; font-size: 10px; }
#operation-dialog .conversation-thread { max-height: 390px; gap: 5px; }
#operation-dialog .conversation-message { padding: 6px 8px; font-size: 12px; line-height: 1.35; }
#operation-dialog .conversation-message small { margin-top: 2px; font-size: 10px; }
#operation-dialog .conversation-item-summary { padding: 5px; }
#operation-dialog textarea { min-height: 64px; }

.product-stat-grid .remaining-listings.healthy b {
  color: #128447;
}

.product-stat-grid .remaining-listings.danger b {
  color: #d33131;
}

.dashboard-sync-button {
  display: block;
  margin-top: 5px;
  padding: 3px 7px;
  font-size: 11px;
}

.incoming-translation {
  display: block;
  margin-top: 3px;
  color: #64748b;
  font-size: 11px;
  font-weight: 400;
  line-height: 1.4;
  white-space: normal;
}

.incoming-translation.translation-unavailable {
  color: #9a6b24;
}

.chart-wrap {
  position: relative;
  height: 320px;
  padding: 18px 20px 0;
}

#orders-trend-chart {
  width: 100%;
  height: 100%;
}

.chart-legend {
  padding: 14px 20px 20px;
  color: var(--text-muted);
  font-size: 12px;
}

.chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.legend-mark {
  width: 16px;
  height: 3px;
  border-radius: 2px;
}

.export-actions {
  padding: 20px;
}

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

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

.return-address-table {
  min-width: 860px;
  table-layout: fixed;
}

.return-address-table th,
.return-address-table td {
  padding: 10px 12px;
  text-align: center;
  vertical-align: middle;
}

.return-address-table th:first-child,
.return-address-table td:first-child {
  width: 210px;
  text-align: left;
}

.return-address-table th:last-child,
.return-address-table td:last-child {
  width: 58px;
}

.return-address-country-heading {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  white-space: nowrap;
}

.return-address-country-heading .site-flag-image {
  width: 20px;
  height: 15px;
  border-radius: 1px;
  box-shadow: 0 0 0 1px rgba(24, 33, 43, 0.1);
}

.return-address-notes-dialog {
  width: min(920px, calc(100% - 32px));
  max-height: calc(100dvh - 24px);
  overflow: hidden;
}

.return-address-notes-dialog .dialog-body {
  gap: 16px;
  padding: 24px 28px;
  max-height: calc(100dvh - 24px);
  overflow-y: auto;
}

.return-address-notes-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 16px;
}

.return-address-notes-fields label:last-child {
  grid-column: 1 / -1;
}

.return-address-note-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.return-address-note-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.return-address-expand-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex: 0 0 auto;
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: var(--surface-muted);
  color: var(--primary);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.return-address-expand-button:hover,
.return-address-expand-button.is-expanded {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.return-address-expand-button:focus-visible {
  outline: 2px solid rgba(23, 107, 77, 0.24);
  outline-offset: 1px;
}

.return-address-note-label .site-flag-image {
  width: 20px;
  height: 15px;
}

.return-address-notes-fields textarea {
  width: 100%;
  height: 100px;
  resize: vertical;
  padding: 9px 11px;
  border: 1px solid var(--border-strong);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
  line-height: 1.45;
}

.return-address-notes-fields textarea.is-expanded {
  height: min(320px, 42dvh);
}

.return-address-notes-fields textarea:focus {
  outline: 2px solid rgba(23, 107, 77, 0.16);
  border-color: var(--primary);
}

.return-address-store-dialog {
  width: min(680px, calc(100% - 32px));
}

.return-address-store-options {
  display: grid;
  gap: 8px;
  max-height: min(52vh, 460px);
  overflow-y: auto;
}

.return-address-store-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
  cursor: pointer;
}

.return-address-store-option:has(input:checked) {
  border-color: var(--primary);
  background: var(--primary-soft);
}

.return-address-store-option input {
  width: 18px;
  height: 18px;
  margin: 0;
  flex: 0 0 auto;
  accent-color: var(--primary);
}

.return-address-store-option-copy,
.return-address-store-identity {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.return-address-store-option-copy strong,
.return-address-store-option-copy span,
.return-address-store-option-copy small,
.return-address-store-identity strong,
.return-address-store-identity span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.return-address-store-option-copy span,
.return-address-store-option-copy small,
.return-address-store-identity span {
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 400;
}

.return-address-store-options-message {
  margin: 0;
  padding: 28px 16px;
  color: var(--text-muted);
  text-align: center;
}

@media (max-width: 620px) {
  .return-address-notes-dialog .dialog-body { padding: 14px; gap: 9px; }
  .return-address-notes-fields { grid-template-columns: 1fr; gap: 7px; }
  .return-address-notes-fields label:last-child { grid-column: auto; }
  .return-address-notes-fields label { gap: 3px; font-size: 12px; }
  .return-address-notes-fields textarea { height: 48px; padding: 6px 8px; }
  .return-address-notes-fields textarea.is-expanded { height: min(280px, 50dvh); }
}

.return-address-status {
  width: 100%;
  min-width: 98px;
  padding: 7px 8px;
  border: 1px solid transparent;
  border-radius: 4px;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: filter 0.15s ease, transform 0.05s ease;
}

.return-address-status:hover { filter: brightness(0.96); }
.return-address-status:active { transform: translateY(1px); }
.return-address-status.has-address {
  background: var(--orange-soft);
  border-color: rgba(194, 107, 0, 0.22);
  color: var(--orange);
}

.return-address-status.needs-removal {
  background: var(--red-soft);
  border-color: rgba(180, 35, 47, 0.28);
  color: var(--red);
}

.return-address-status.no-address {
  background: var(--primary-soft);
  border-color: rgba(23, 107, 77, 0.18);
  color: var(--primary);
}

@media (max-width: 760px) {
  .section-heading-actions { width: 100%; }
  .section-heading-actions > button { flex: 1; }
}

.dashboard-detail-section table {
  min-width: 1420px;
  table-layout: auto;
}

.order-list-section {
  display: block;
}

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

.order-list-card {
  overflow: hidden;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
  box-shadow: 0 2px 8px rgba(26, 39, 52, 0.04);
}

.order-list-header,
.order-list-identity,
.order-list-buyer,
.order-list-status {
  display: flex;
  align-items: center;
}

.order-list-header {
  min-height: 56px;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
}

.order-list-identity,
.order-list-buyer {
  min-width: 0;
  gap: 12px;
}

.order-list-identity span,
.order-list-buyer span {
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-list-status {
  min-height: 66px;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 16px;
}

.order-list-status > div {
  display: grid;
  gap: 3px;
}

.order-list-status span,
.order-list-product span {
  color: var(--text-muted);
  font-size: 12px;
}

.order-list-products {
  display: grid;
  gap: 8px;
  padding: 0 16px 16px;
}

.order-list-product {
  display: grid;
  grid-template-columns: 58px minmax(240px, 1fr) 120px 72px minmax(180px, 260px);
  align-items: center;
  gap: 14px;
  min-height: 76px;
  padding: 8px 12px;
  border-radius: 5px;
  background: var(--surface-muted);
}

.order-list-product.pending-product {
  display: block;
  min-height: 0;
  color: var(--text-muted);
}

.order-list-product-image {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
}

.order-list-product-image.placeholder {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 11px;
}

.order-list-product-title,
.order-list-product > div:not(.order-list-product-title):not(.order-list-product-image) {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.order-list-product-title strong,
.order-list-product-sku strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-list-product-sku small {
  overflow: hidden;
  color: var(--text-muted);
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.order-list-empty {
  padding: 50px 20px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

table {
  width: 100%;
  border-collapse: collapse;
  white-space: nowrap;
}

th,
td {
  padding: 15px 18px;
  text-align: left;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}

th {
  color: var(--text-muted);
  background: var(--surface-muted);
  font-size: 12px;
}

td strong {
  display: block;
  font-size: 14px;
}

td small {
  color: var(--text-muted);
}

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

.table-action {
  padding: 7px 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: var(--primary);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
}

.table-action:hover {
  background: var(--primary-soft);
}

.table-action.emphasized {
  border: 1px solid #9bcab6;
  background: var(--primary-soft);
}

.table-action.emphasized:hover {
  background: #cde8dc;
  box-shadow: 0 2px 8px rgba(23, 107, 77, 0.16);
}

.table-action.danger {
  color: var(--red);
}

.settings-section {
  padding: 24px;
}

.narrow-form {
  max-width: 480px;
}

.feishu-settings-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(360px, 1.3fr);
  gap: 28px;
  margin-top: 16px;
}

.settings-copy h2 {
  margin: 0 0 6px;
  font-size: 18px;
}

.settings-copy p,
.settings-help {
  color: var(--text-muted);
}

.settings-copy p {
  margin: 0;
  line-height: 1.6;
}

.settings-help {
  margin-top: -8px;
}

.settings-help.success {
  color: var(--primary);
}

.settings-help.error {
  color: var(--red);
}

.feishu-enabled-row {
  justify-content: flex-start;
  width: fit-content;
}

.settings-actions {
  display: flex;
  gap: 10px;
}

@media (max-width: 720px) {
  .feishu-settings-section {
    grid-template-columns: 1fr;
  }
}

dialog {
  width: min(460px, calc(100% - 32px));
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 24px 70px rgba(17, 29, 40, 0.24);
}

dialog::backdrop {
  background: rgba(24, 33, 43, 0.52);
}

.operation-dialog {
  width: min(760px, calc(100% - 32px));
}

.operation-detail {
  display: grid;
  gap: 10px;
  max-height: min(48vh, 440px);
  margin: 18px 0;
  padding: 14px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface-muted);
}

.order-products,
.order-conversation {
  display: grid;
  gap: 8px;
}

.order-products h3,
.order-conversation h3 {
  margin: 8px 0 0;
  font-size: 15px;
}

.order-product {
  display: grid;
  grid-template-columns: 62px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

.order-product-image {
  width: 62px;
  height: 62px;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
}

.order-product-image.placeholder {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 11px;
}

.order-product-main,
.order-product-price {
  display: grid;
  gap: 4px;
}

.order-product-main span,
.order-product-main small,
.order-product-price span {
  color: var(--text-muted);
  font-size: 12px;
}

.order-product-price {
  justify-items: end;
  white-space: nowrap;
}

.conversation-message {
  max-width: 88%;
  padding: 10px 12px;
  border-left: 3px solid var(--primary);
  background: var(--surface);
  white-space: pre-wrap;
}

.conversation-message.from-store {
  margin-left: auto;
  border-left: 0;
  border-right: 3px solid var(--blue);
}

.conversation-message small {
  display: block;
  margin-top: 5px;
  color: var(--text-muted);
}

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

.detail-grid div {
  padding: 10px;
  background: var(--surface);
}

.detail-grid span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 12px;
}

.dialog-body {
  padding: 24px;
}

.wide-dialog {
  min-width: min(560px, calc(100vw - 32px));
}

.dialog-heading {
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
}

.dialog-heading h2 {
  font-size: 20px;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 4px;
}

.checkbox-list {
  max-height: 340px;
  overflow-y: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
}

.checkbox-row {
  display: flex;
  grid-template-columns: none;
  flex-direction: row;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-bottom: 1px solid var(--border);
}

.checkbox-row:last-child {
  border-bottom: 0;
}

.checkbox-row input {
  width: 18px;
  height: 18px;
}

.mobile-only {
  display: none;
}

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

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

@media (max-width: 760px) {
  :root {
    --topbar-height: 58px;
  }

  .mobile-only {
    display: grid;
  }

  .topbar {
    padding: 0 10px;
  }

  .topbar-brand strong,
  .user-summary,
  #logout-button {
    display: none;
  }

  .topbar-actions {
    gap: 8px;
  }

  .sidebar {
    transform: translateX(-100%);
    transition: transform 180ms ease;
    box-shadow: var(--shadow);
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .operation-filters select {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }

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

  .content {
    margin-left: 0;
    padding: calc(var(--topbar-height) + 20px) 14px 32px;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .section-heading h1 {
    font-size: 23px;
  }

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

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

  .order-status-strip > div:nth-child(2) {
    border-right: 0;
  }

  .order-status-strip > div:nth-child(-n+2) {
    border-bottom: 1px solid var(--border);
  }

  .filter-actions {
    width: 100%;
  }

  .filter-actions select {
    flex: 1 1 150px;
  }

  .chart-wrap {
    height: 250px;
    padding-inline: 10px;
  }

  .metric-tile {
    min-height: 124px;
    padding: 15px;
  }

  .metric-tile strong {
    font-size: 30px;
  }

  .metric-tile small {
    line-height: 1.4;
  }

  .data-section-heading {
    align-items: flex-start;
  }

  .alert-item,
  .compact-item {
    padding: 14px;
  }

  .pagination-bar {
    justify-content: center;
  }

  .page-jump-form {
    order: 3;
    width: 100%;
    justify-content: center;
  }

  .order-product {
    grid-template-columns: 54px minmax(0, 1fr);
  }

  .order-product-image {
    width: 54px;
    height: 54px;
  }

  .order-product-price {
    grid-column: 2;
    justify-items: start;
    grid-auto-flow: column;
  }

  .order-list-header,
  .order-list-status {
    align-items: flex-start;
    flex-direction: column;
  }

  .order-list-buyer {
    width: 100%;
  }

  .order-list-buyer .table-action {
    margin-left: auto;
  }

  .order-list-product {
    grid-template-columns: 52px minmax(0, 1fr);
    gap: 8px 12px;
  }

  .order-list-product > div:not(.order-list-product-image) {
    grid-column: 2;
  }

  .order-list-product-title strong,
  .order-list-product-sku strong {
    white-space: normal;
    overflow-wrap: anywhere;
  }

  .auth-panel {
    padding: 26px 22px;
  }

  th,
  td {
    padding: 13px 14px;
  }
}

/* Order dialog header: larger metadata with less padding and no repeated identifiers. */
#operation-dialog.order-dialog .dialog-heading {
  padding: 0 0 3px;
}

#operation-dialog.order-dialog .operation-title-line h2 {
  font-size: 17px;
  line-height: 1.2;
}

#operation-dialog.order-dialog #operation-dialog-subtitle:empty {
  display: none;
}

#operation-dialog.order-dialog #operation-dialog-meta .detail-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1px 3px;
  margin-top: 3px;
}

#operation-dialog.order-dialog #operation-dialog-meta .detail-grid > div {
  min-height: 0;
  padding: 2px 5px;
  font-size: 12.5px;
  font-weight: 600;
  line-height: 1.2;
}

#operation-dialog.order-dialog #operation-dialog-meta .detail-grid span {
  margin-bottom: 1px;
  font-size: 10.5px;
  line-height: 1.1;
}

/* After-sales dialog: reserve the window for the conversation and keep messages compact. */
@media (min-width: 761px) {
  #operation-dialog.claim-dialog {
    width: min(1120px, calc(100vw - 18px));
  }

  #operation-dialog.claim-dialog .dialog-body {
    display: flex;
    min-height: 0;
    flex-direction: column;
    gap: 4px;
    height: min(96vh, 920px);
    padding: 9px 11px;
    overflow: hidden;
  }
}

#operation-dialog.claim-dialog .dialog-heading {
  padding: 0 0 3px;
}

#operation-dialog.claim-dialog .operation-detail {
  display: flex;
  min-height: 0;
  flex: 1 1 auto;
  flex-direction: column;
  gap: 4px;
  margin: 4px 0;
  padding: 6px;
  overflow: hidden;
}

#operation-dialog.claim-dialog .claim-order-summary {
  flex: 0 0 auto;
  gap: 8px;
  padding: 3px 6px;
}

#operation-dialog.claim-dialog .claim-resolution-controls {
  flex: 0 0 auto;
  margin: 2px 0 4px;
}

#operation-dialog.claim-dialog .conversation-thread {
  min-height: 300px;
  max-height: none;
  flex: 1 1 auto;
  gap: 5px;
  padding: 3px 7px 18px;
  scroll-padding-bottom: 18px;
  scroll-behavior: auto;
  overscroll-behavior-y: contain;
}

#operation-dialog.claim-dialog .conversation-message {
  width: fit-content;
  min-height: 0;
  max-width: 68%;
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 7px;
  font-size: 12px;
  line-height: 1.35;
  box-shadow: none;
}

#operation-dialog.claim-dialog .conversation-message .incoming-translation {
  margin-top: 1px;
  line-height: 1.3;
}

#operation-dialog.claim-dialog .conversation-message > small:last-child {
  margin-top: 1px;
}

#operation-dialog.claim-dialog #operation-reply-label > span,
#operation-dialog.claim-dialog .attachment-field > span {
  font-size: 12px;
  line-height: 1.2;
}

#operation-dialog.claim-dialog textarea {
  min-height: 48px;
  max-height: 62px;
  padding: 6px 8px;
}

#operation-dialog.claim-dialog .attachment-field {
  margin-top: 2px;
}

#operation-dialog.claim-dialog .attachment-field input {
  padding: 5px 7px;
}

#operation-dialog.claim-dialog .dialog-actions {
  margin-top: 3px;
}

@media (max-width: 760px) {
  #operation-dialog.claim-dialog {
    width: calc(100vw - 8px);
    max-width: none;
    height: calc(100vh - 8px);
    height: calc(100dvh - 8px);
    max-height: calc(100vh - 8px);
    max-height: calc(100dvh - 8px);
    margin: 4px;
    border-radius: 6px;
  }

  #operation-dialog.claim-dialog .dialog-body {
    box-sizing: border-box;
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: max(5px, env(safe-area-inset-top)) 6px max(5px, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  #operation-dialog.claim-dialog .dialog-heading {
    flex: 0 0 auto;
    gap: 5px;
    padding: 0;
  }

  #operation-dialog.claim-dialog .operation-title-line {
    gap: 5px;
    flex-wrap: nowrap;
  }

  #operation-dialog.claim-dialog .operation-title-line h2 {
    font-size: 17px;
    line-height: 1.1;
  }

  #operation-dialog.claim-dialog #operation-dialog-title-suffix {
    min-width: 0;
    gap: 3px;
    font-size: 11px;
    white-space: nowrap;
  }

  #operation-dialog.claim-dialog #operation-dialog-subtitle {
    margin: 1px 0 0;
    font-size: 10px;
    line-height: 1.1;
  }

  #operation-dialog.claim-dialog .icon-button {
    width: 34px;
    min-width: 34px;
    height: 34px;
  }

  #operation-dialog.claim-dialog #operation-dialog-meta .detail-grid {
    grid-template-columns: 58px 64px minmax(0, 1fr) 70px;
    gap: 1px;
    margin-top: 2px;
  }

  #operation-dialog.claim-dialog #operation-dialog-meta .detail-grid > div {
    max-height: 43px;
    padding: 2px 3px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.15;
  }

  #operation-dialog.claim-dialog #operation-dialog-meta .detail-grid span {
    margin-bottom: 1px;
    font-size: 8px;
    line-height: 1.1;
  }

  #operation-dialog.claim-dialog #operation-dialog-meta .incoming-translation {
    display: none;
  }

  #operation-dialog.claim-dialog .operation-detail {
    min-height: 0;
    flex: 1 1 auto;
    gap: 2px;
    margin: 2px 0;
    padding: 3px;
  }

  #operation-dialog.claim-dialog .claim-order-summary {
    min-height: 46px;
    gap: 5px;
    padding: 2px 4px;
    font-size: 11px;
  }

  #operation-dialog.claim-dialog .claim-order-summary > strong {
    max-width: 92px;
    line-height: 1.15;
  }

  #operation-dialog.claim-dialog .claim-order-summary .message-item-cell {
    min-width: 0;
    gap: 5px;
  }

  #operation-dialog.claim-dialog .claim-order-summary .question-item-image,
  #operation-dialog.claim-dialog .claim-order-summary .order-product-image {
    width: 42px;
    height: 42px;
  }

  #operation-dialog.claim-dialog .claim-order-summary .product-title-link,
  #operation-dialog.claim-dialog .claim-order-summary .message-item-cell > div > span {
    max-width: none;
    font-size: 11px;
    line-height: 1.2;
  }

  #operation-dialog.claim-dialog .claim-resolution-controls {
    min-height: 27px;
    display: flex;
    flex-wrap: nowrap;
    gap: 3px;
    margin: 1px 0 2px;
    overflow-x: auto;
  }

  #operation-dialog.claim-dialog .claim-resolution-controls button,
  #operation-dialog.claim-dialog .claim-resolution-controls select {
    min-height: 27px;
    padding: 3px 7px;
    font-size: 10px;
    white-space: nowrap;
  }

  #operation-dialog.claim-dialog .conversation-thread {
    min-height: 0;
    flex: 1 1 auto;
    gap: 3px;
    padding: 3px 3px max(18px, env(safe-area-inset-bottom));
    overflow-y: auto;
    scroll-padding-bottom: max(18px, env(safe-area-inset-bottom));
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
  }

  #operation-dialog.claim-dialog .conversation-message {
    max-width: 92%;
    padding: 4px 6px;
    font-size: 11px;
    line-height: 1.28;
  }

  #operation-dialog.claim-dialog #operation-reply-label {
    flex: 0 0 auto;
    gap: 2px;
  }

  #operation-dialog.claim-dialog textarea {
    min-height: 42px;
    max-height: 48px;
    padding: 4px 6px;
  }

  #operation-dialog.claim-dialog .attachment-field {
    flex: 0 0 auto;
    gap: 2px;
    margin: 0;
  }

  #operation-dialog.claim-dialog .attachment-field input {
    min-height: 31px;
    padding: 3px 5px;
    font-size: 10px;
  }

  #operation-dialog.claim-dialog .dialog-actions {
    flex: 0 0 auto;
    gap: 4px;
    margin: 1px 0 0;
  }

  #operation-dialog.claim-dialog .dialog-actions button {
    min-height: 32px;
    padding: 4px 8px;
    font-size: 11px;
  }
}

/* The image spans the product and status rows without increasing card height. */
.order-list-product {
  position: relative;
  grid-template-columns: 88px minmax(210px, 1fr) 100px 58px minmax(150px, 230px);
}

.order-list-product-image,
img.order-list-product-image {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 82px;
  height: 82px;
}

.order-list-product-title { grid-column: 2; }
.order-list-product-price { grid-column: 3; }
.order-list-product-quantity { grid-column: 4; }
.order-list-product-sku { grid-column: 5; }
.order-list-status { padding-left: 110px; }

/* Dense desktop operations layout. */
@media (min-width: 761px) {
  :root { --sidebar-width: 184px; }

  .sidebar { padding: 10px 7px; }
  .sidebar nav { gap: 2px; }
  .nav-button { min-height: 36px; padding: 0 10px; font-size: 13px; }
  .content { padding: calc(var(--topbar-height) + 16px) 14px 28px; }
  .view-section { max-width: none; }
  .section-heading { margin-bottom: 12px; }

  .order-list-card { font-size: 12px; }
  .order-list-header { min-height: 34px; padding: 4px 9px; }
  .order-list-status { min-height: 38px; gap: 8px; padding: 4px 9px; }
  .order-list-status > div { min-width: 78px; }
  .order-list-products { padding: 4px 9px 6px; }
  .order-list-product { min-height: 48px; padding: 3px 6px; }
  .order-list-product-image { width: 36px; height: 36px; }

  .operation-dialog { width: min(980px, calc(100vw - 28px)); }
  .operation-dialog .dialog-body {
    height: min(90vh, 860px);
    display: flex;
    flex-direction: column;
    padding: 12px;
  }
  .operation-dialog .dialog-heading { gap: 8px; }
  .operation-dialog .dialog-heading h2 { margin: 0; font-size: 16px; }
  .operation-dialog .dialog-heading p { margin: 2px 0 0; font-size: 11px; }
  .operation-dialog .operation-detail {
    min-height: 0;
    max-height: none;
    flex: 1;
    margin: 7px 0;
    padding: 8px;
  }
  .operation-dialog .detail-grid { gap: 5px; font-size: 12px; }
  .operation-dialog .detail-grid div { padding: 5px 7px; }
  .operation-dialog .order-product { padding: 5px; }
  .operation-dialog .order-product-image { width: 44px; height: 44px; }
  .operation-dialog .conversation-thread { min-height: 240px; max-height: none; }
  .operation-dialog textarea { min-height: 66px; max-height: 90px; }
  .operation-dialog .attachment-field { margin-top: 4px; }
  .operation-dialog .dialog-actions { margin-top: 5px; }
}

.product-title-link {
  color: #2457a6;
  font-weight: 700;
  text-decoration: none;
}

.product-title-link:hover { text-decoration: underline; }

.message-item-cell {
  min-width: 230px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-item-cell > div:last-child { min-width: 0; }
.message-item-cell .product-title-link,
.message-item-cell > div > span {
  max-width: 260px;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.message-item-cell small { display: block; color: var(--text-muted); font-size: 10px; }
.message-item-placeholder {
  width: 40px;
  height: 40px;
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 10px;
}
.conversation-item-summary {
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--surface);
}

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

  .metric-tile {
    min-height: 108px;
  }

  .alert-shortcut {
    font-size: 12px;
  }
}

/* 沃橙跨境 V1.0 visual refresh */
:root {
  --background: #f7f8fc;
  --surface-muted: #f8f9fd;
  --border: #e7e9f1;
  --border-strong: #d9dce8;
  --primary: #176f66;
  --primary-hover: #105950;
  --blue: #4f67df;
  --shadow: 0 8px 26px rgba(48, 56, 82, 0.08);
}

.brand-logo {
  display: block;
  object-fit: contain;
  background: #fff;
}

.auth-logo {
  width: 126px;
  height: 72px;
}

.topbar-logo {
  width: 72px;
  height: 48px;
}

.topbar {
  box-shadow: 0 2px 12px rgba(48, 56, 82, 0.04);
}

.sidebar {
  background: #202631;
}

.sidebar-status {
  display: grid;
  gap: 6px;
}

.sidebar-status > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sidebar-status small {
  padding-left: 16px;
  color: #8491a2;
  font-weight: 700;
}

.sidebar-status > .sidebar-exchange-rate {
  display: grid;
  gap: 3px;
  padding: 10px 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.05);
}

.sidebar-exchange-rate span {
  font-size: 11px;
  color: #aebbc5;
}

.sidebar-exchange-rate strong {
  color: #fff;
  font-size: 13px;
  line-height: 1.35;
}

.sidebar-exchange-rate small,
.sidebar-status > .sidebar-exchange-rate small {
  padding-left: 0;
  color: #8491a2;
  font-size: 11px;
  font-weight: 600;
}

.sidebar-exchange-rate.stale strong,
.sidebar-exchange-rate.stale small {
  color: #b45309;
}

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

.metric-tile {
  min-height: 116px;
  padding: 16px 18px;
  text-align: left;
  color: var(--text);
  cursor: pointer;
  border-top-width: 1px;
  border-radius: 8px;
  box-shadow: 0 5px 18px rgba(48, 56, 82, 0.045);
}

.metric-tile:hover {
  transform: translateY(-2px);
  border-color: #cfd4e7;
  box-shadow: 0 9px 22px rgba(48, 56, 82, 0.1);
}

.metric-tile strong {
  font-size: 27px;
}

.metric-tile.accent-blue { background: #f3f6ff; }
.metric-tile.accent-violet { border-color: #d9d4ff; background: #f7f5ff; }
.metric-tile.accent-orange { background: #fff8ef; }
.metric-tile.accent-red { background: #fff4f5; }
.metric-tile.accent-green { border-color: #cce8df; background: #f1fbf7; }

.data-section,
.settings-section,
.order-list-card,
dialog,
.auth-panel {
  border-radius: 8px;
  box-shadow: 0 5px 18px rgba(48, 56, 82, 0.045);
}

.heading-actions,
.date-range-fields,
.quick-range-buttons {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.date-range-fields > label {
  flex: 1 1 220px;
}

.quick-range-buttons button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid #cbd3fa;
  border-radius: 6px;
  background: #f1f4ff;
  color: #3f56c7;
  cursor: pointer;
}

.order-sync-panel {
  width: 100%;
  margin: 10px 0 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 3px 12px rgba(48, 56, 82, 0.05);
}

.order-sync-panel .wide-dialog {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) minmax(360px, 1.4fr) auto;
  align-items: end;
  gap: 10px 16px;
  width: 100%;
  min-width: 0;
  padding: 14px;
}

.order-sync-panel .dialog-heading,
.order-sync-panel .form-help,
.order-sync-panel .dialog-actions {
  grid-column: 1 / -1;
}

.order-sync-panel .dialog-heading .icon-button,
.order-sync-panel .dialog-actions .secondary-button {
  display: none;
}

.order-sync-panel .date-range-fields,
.order-sync-panel .quick-range-buttons {
  flex-wrap: nowrap;
}

.order-sync-panel .date-range-fields > label {
  flex: 1 1 0;
  min-width: 0;
}

.order-sync-panel .quick-range-buttons button {
  padding-inline: 9px;
  white-space: nowrap;
}

.order-list-product {
  position: relative;
  grid-template-columns: 88px minmax(210px, 1fr) 100px 58px minmax(150px, 230px);
}

.order-list-product-image {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 82px;
  height: 82px;
}

.order-list-product-title { grid-column: 2; }
.order-list-product-price { grid-column: 3; }
.order-list-product-quantity { grid-column: 4; }
.order-list-product-sku { grid-column: 5; }

.order-list-status {
  padding-left: 110px;
}

@media (max-width: 1100px) {
  .order-sync-panel .wide-dialog {
    grid-template-columns: 1fr;
  }
  .order-sync-panel .wide-dialog > * {
    grid-column: 1;
  }
  .order-sync-panel .date-range-fields,
  .order-sync-panel .quick-range-buttons {
    flex-wrap: wrap;
  }
}

.form-help {
  margin: 0;
  color: var(--text-muted);
  font-size: 12px;
}

.alert-item {
  min-height: 46px;
  padding: 7px 14px;
  gap: 10px;
}

.severity-marker {
  min-height: 26px;
}

.alert-copy {
  flex: 1;
}

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

.alert-time {
  min-width: 108px;
  color: #c03422;
  font-size: 12px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.account-state {
  margin-left: 5px;
  font-size: 15px;
  font-weight: 900;
}

.account-state.temporary { color: #e07a19; }
.account-state.permanent { color: #c72e3a; }

.order-list {
  gap: 9px;
}

.order-list-header {
  min-height: 44px;
  padding: 7px 12px;
  font-size: 12px;
}

.order-list-status {
  min-height: 50px;
  gap: 12px;
  padding: 8px 12px;
  font-size: 12px;
  border-bottom: 1px solid var(--border);
}

.order-list-status > div {
  min-width: 92px;
}

.order-list-status small {
  color: var(--text-muted);
  font-size: 11px;
}

.order-list-status .net-income strong {
  color: #d9233f;
}

.compact-button {
  min-height: 32px;
  padding: 5px 10px;
  font-size: 12px;
  white-space: nowrap;
}

.order-list-products {
  padding: 8px 12px 10px;
}

.order-list-product {
  grid-template-columns: 44px minmax(210px, 1fr) 100px 58px minmax(150px, 230px);
  min-height: 58px;
  padding: 5px 9px;
  font-size: 12px;
}

.order-list-product-image {
  width: 40px;
  height: 40px;
}

img.order-list-product-image {
  position: relative;
  z-index: 1;
  cursor: zoom-in;
  object-fit: contain;
  background: #fff;
  transition: box-shadow 160ms ease, border-color 160ms ease;
}

img.order-list-product-image:hover,
img.order-list-product-image:focus-visible {
  z-index: 12;
  border-color: #55c900;
  box-shadow: 0 0 0 3px rgba(85, 201, 0, 0.2);
}

.order-image-preview {
  position: fixed;
  z-index: 9999;
  inset: 50% auto auto 50%;
  width: min(720px, calc(100vw - var(--sidebar-width) - 90px));
  height: min(720px, calc(100vh - var(--topbar-height) - 60px));
  padding: 14px;
  pointer-events: none;
  transform: translate(-42%, -48%);
  border: 4px solid #55c900;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 18px 50px rgba(31, 42, 68, 0.28);
}

.order-image-preview img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
  background: #fff;
}

.question-item-link {
  min-width: 190px;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  text-decoration: none;
}

.question-item-link img,
.question-image-placeholder {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
}

.question-image-placeholder {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 10px;
}

.question-item-link span span,
.question-item-link small {
  display: block;
}

.question-item-link small {
  max-width: 180px;
  margin-top: 3px;
  overflow: hidden;
  color: var(--text-muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.conversation-thread {
  max-height: 330px;
  display: grid;
  gap: 8px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

.conversation-message.from-customer {
  color: #c92538;
  border-left-color: #dc354b;
  background: #fff4f5;
}

.conversation-message.from-store {
  color: #161c24;
}

.message-attachments {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 7px;
}

.message-attachments img {
  width: 88px;
  height: 88px;
  object-fit: cover;
  border-radius: 6px;
}

.attachment-field input {
  height: auto;
  padding: 9px;
}

.operation-image-status {
  display: block;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.3;
}

.operation-image-status.selected {
  color: var(--primary);
  font-weight: 700;
}

#operation-dialog.dragging-images .attachment-field {
  outline: 2px dashed var(--primary);
  outline-offset: 4px;
  background: rgba(23, 107, 77, 0.06);
}

.translation-status {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  font-weight: 700;
}

.translation-status.pending { color: #8a5b12; }
.translation-status.success { color: var(--primary); }
.translation-status.error { color: var(--red); }

@media (max-width: 1180px) {
  .metric-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .order-list-status { flex-wrap: wrap; }
}

@media (max-width: 760px) {
  .metric-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .topbar-logo { width: 48px; }
  .heading-actions { width: 100%; }
  .heading-actions > * { flex: 1; }
  .alert-copy { display: grid; gap: 2px; }
  .alert-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}

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

.dashboard-detail-table th:nth-child(1) { width: 145px; }
.dashboard-detail-table th:nth-child(2) { width: 500px; }
.dashboard-detail-table th:nth-child(3), .dashboard-detail-table th:nth-child(4), .dashboard-detail-table th:nth-child(5) { width: 95px; text-align: center; }
.dashboard-detail-table td:nth-child(3), .dashboard-detail-table td:nth-child(4), .dashboard-detail-table td:nth-child(5) { text-align: center; }
.alert-quadrants { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 14px; }
.alert-quadrant { min-width: 0; overflow: hidden; }
.alert-quadrant h2 { margin: 0; padding: 10px 13px; border-bottom: 1px solid var(--border); font-size: 15px; }
.alert-quadrant .alert-list { max-height: none; overflow: visible; }
.alert-quadrant .alert-item { width: 100%; min-height: 34px; grid-template-columns: 4px 82px minmax(0,1fr); padding: 5px 9px; border: 0; border-bottom: 1px solid var(--border); text-align: left; cursor: pointer; }
.alert-quadrant .alert-copy strong, .alert-quadrant .alert-copy span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.alert-quadrant .alert-copy strong { font-size: 12px; }
.alert-quadrant .alert-copy span, .alert-quadrant .alert-time { font-size: 10px; }
.mini-pagination { display: flex; justify-content: center; align-items: center; gap: 8px; min-height: 31px; }
.mini-pagination button { width: 25px; height: 23px; border: 1px solid var(--border); border-radius: 4px; background: #fff; cursor: pointer; }
.mini-pagination button:disabled { opacity: .35; cursor: default; }
.nav-icon { width: 20px; display: inline-grid; place-items: center; margin-right: 8px; font-size: 15px; font-weight: 700; }
.operation-heading-copy { flex: 1; min-width: 0; }
#operation-dialog .dialog-heading { align-items: flex-start; padding-bottom: 5px; }
#operation-dialog-meta .detail-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 2px; margin-top: 4px; }
#operation-dialog-meta .detail-grid > div { min-height: 0; padding: 3px 6px; font-size: 10px; }
#operation-dialog-meta .detail-grid span { font-size: 9px; }
.dialog-site-heading { display: flex; align-items: center; gap: 6px; margin-top: 3px; font-size: 11px; }
.question-dialog-summary { display: grid; grid-template-columns: 88px 1fr; gap: 8px; }
.question-dialog-image { width: 88px; height: 88px; object-fit: contain; border: 1px solid var(--border); border-radius: 5px; background: #fff; cursor: zoom-in; }
.compact-question-dialog { width: min(620px, calc(100% - 32px)); }
.compact-question-dialog .operation-detail { max-height: 300px; margin: 7px 0; padding: 8px; }
.conversation-message.from-customer { justify-self: start; }
.conversation-message.from-store { justify-self: end; color: #111; border-left: 0; border-right: 3px solid var(--primary); }
@media (max-width: 860px) { .alert-quadrants { grid-template-columns: 1fr; } }

/* V1.2 readable compact dashboard and dialogs */
body { font-size: 15px; }
.alert-quadrant .alert-item,
.alert-quadrant .alert-item.unread { background: #fff; }
.alert-quadrant .alert-item.unread .alert-copy { font-weight: 800; }
.alert-quadrant .alert-item:not(.unread) .alert-copy,
.alert-quadrant .alert-item:not(.unread) .alert-copy strong,
.alert-quadrant .alert-item:not(.unread) .alert-copy span { font-weight: 400; }
.alert-quadrant .alert-copy span { font-size: 12px; }
.alert-quadrant .alert-time { font-size: 11px; font-weight: 700; }
.operation-title-line { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.operation-title-line h2 { margin: 0; }
#operation-dialog-title-suffix { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
#operation-dialog-title-suffix img { width: 20px; height: 14px; object-fit: cover; }
.conversation-item-summary .message-item-cell .product-title-link,
.conversation-item-summary .message-item-cell > div > span { max-width: none; white-space: normal; overflow: visible; text-overflow: clip; font-size: 14px; line-height: 1.35; }
.conversation-message.from-customer { justify-self: start; margin-right: auto; color: #d62828; }
.conversation-message.from-store { justify-self: end; margin-left: auto; color: #111; }
.alert-quadrant .alert-copy,
.alert-quadrant .alert-copy span,
.operation-detail,
.operation-detail p,
.operation-detail span,
.operation-detail strong { color: #111; }
.alert-quadrant .alert-copy span { display: flex; align-items: center; gap: 5px; }
.alert-quadrant .alert-copy .site-flag-image { width: 20px; height: 14px; flex: 0 0 auto; }
.conversation-message { color: #111; }
.conversation-message.from-customer { justify-self: start; margin-right: auto; color: #d62828; border: 1px solid #ffb3b3; border-left: 3px solid #e63946; }
.conversation-message.from-store { justify-self: end; margin-left: auto; color: #111; border: 1px solid #cbd5e1; border-right: 3px solid #475569; }
.conversation-message > small:last-child { display: block; margin-top: 3px; font-size: 9px; color: #7a8494 !important; text-align: right; }
.incoming-translation { color: #5b6472 !important; }
.order-product-image { cursor: zoom-in; }
.dialog-order-link { padding: 0; border: 0; background: transparent; color: #176f66; font: inherit; font-weight: 800; cursor: pointer; text-decoration: underline; }
.message-read-receipt { margin-left: 4px; color: #1683ff !important; font-size: 11px; font-weight: 900; letter-spacing: -2px; }
.order-reputation-actions { display: inline-flex; align-items: center; gap: 8px; flex: 0 0 auto; }
.order-header-sync { min-height: 27px; padding: 3px 12px; }
.question-time-cell, .question-content-cell { color: #111; font-size: 14px; }
.question-content-cell .cell-copy { font-size: 14px; line-height: 1.45; }
.question-status-cell.waiting { color: #d62828; font-weight: 800; }
.question-reply-button.waiting { border-color: #d62828; background: #d62828; color: #fff; font-weight: 800; box-shadow: 0 2px 7px rgba(214,40,40,.2); }
.product-stat-grid span,
.product-stat-grid b,
.product-site-line,
.dashboard-detail-table td { color: #111; }
.claim-order-summary { display: flex; align-items: center; gap: 12px; padding: 6px 8px; border: 1px solid var(--border); border-radius: 6px; background: #fff; }
.claim-order-summary .message-item-cell { flex: 1; }
.data-section-heading { padding-block: 10px; }
.metric-tile { padding: 14px 16px; }
.dashboard-detail-table th, .dashboard-detail-table td { padding-top: 6px; padding-bottom: 6px; font-size: 13px; }
.dashboard-detail-scroll { overflow: visible; }
.dashboard-detail-table thead th { position: sticky; top: var(--topbar-height); z-index: 4; background: #fff; }
@media (max-width: 1500px) { .dashboard-detail-scroll { overflow-x: auto; } .dashboard-detail-table thead th { position: static; } }

/* V1.1 compact operations workspace */
:root {
  --background: #f6f7fb;
  --surface-muted: #f8f9fc;
  --border: #e6e9f0;
  --border-strong: #d4d9e3;
  --text: #172033;
  --text-muted: #697386;
  --primary-soft: #eaf6f2;
  --shadow: 0 6px 20px rgba(31, 42, 68, 0.055);
}

.topbar {
  padding: 0 20px;
  border-bottom-color: #eceef3;
  box-shadow: 0 2px 8px rgba(31, 42, 68, 0.035);
}

.sidebar {
  padding: 16px 10px;
  background: #fff;
  color: var(--text);
  border-right: 1px solid var(--border);
}

.nav-button {
  min-height: 42px;
  color: #4e596b;
}

.nav-button:hover {
  color: var(--primary);
  background: #f2f7f5;
}

.nav-button.active {
  color: var(--primary);
  background: var(--primary-soft);
  box-shadow: inset 3px 0 0 var(--primary);
}

.sidebar-status,
.sidebar-status small {
  color: #7c8797;
}

.sidebar-status > .sidebar-exchange-rate {
  border-color: #e4e7ec;
  background: #f7f8fa;
}

.sidebar-exchange-rate span {
  color: #7c8797;
}

.sidebar-exchange-rate strong {
  color: #263142;
}

.content {
  padding: calc(var(--topbar-height) + 26px) 28px 42px;
}

.data-section,
.settings-section,
.order-list-card,
.metric-tile,
dialog,
.auth-panel {
  border-color: var(--border);
  box-shadow: var(--shadow);
}

.data-section-heading,
.section-heading {
  border-color: var(--border);
}

.conversation-thread {
  max-height: min(440px, 55vh);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding: 4px 6px 8px;
  overflow-y: auto;
}

.conversation-message {
  width: fit-content;
  max-width: 78%;
  margin: 0;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 8px;
  line-height: 1.55;
  overflow-wrap: anywhere;
  box-shadow: 0 2px 7px rgba(31, 42, 68, 0.045);
}

.conversation-message.from-customer {
  align-self: flex-start;
  margin-right: auto;
  color: #c92538;
  border-color: #f0c7cd;
  border-left: 3px solid #dc354b;
  background: #fff7f8;
}

.conversation-message.from-store {
  align-self: flex-end;
  margin-left: auto;
  color: #151b26;
  border-color: #d9dee8;
  border-right: 3px solid #596579;
  background: #f4f6f9;
}

.message-attachments img {
  width: min(180px, 34vw);
  height: auto;
  max-height: 180px;
  object-fit: contain;
  border: 1px solid var(--border);
  background: #fff;
}

.order-pagination,
.operation-pagination,
.order-pagination-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.order-pagination,
.operation-pagination {
  justify-content: flex-end;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  color: var(--text-muted);
  font-size: 12px;
}

.order-pagination-actions label,
.operation-pagination label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.order-pagination select,
.operation-pagination select {
  min-height: 32px;
  padding-left: 9px;
}

.order-card-main {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 8px;
  padding: 6px 10px 8px;
}

.order-card-large-image {
  position: static;
  width: 82px;
  height: 82px;
  align-self: center;
  object-fit: contain;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
}

img.order-card-large-image {
  cursor: zoom-in;
}

.order-card-large-image.placeholder {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 11px;
}

.order-card-content {
  display: grid;
  min-width: 0;
}

.order-card-content .order-list-products {
  padding: 0;
}

.order-card-content .order-list-product.without-image {
  position: static;
  grid-template-columns: minmax(220px, 1fr) 100px 58px minmax(150px, 220px);
  min-height: 38px;
  padding: 3px 7px;
}

.order-card-content .order-list-product.without-image .order-list-product-title { grid-column: 1; }
.order-card-content .order-list-product.without-image .order-list-product-price { grid-column: 2; }
.order-card-content .order-list-product.without-image .order-list-product-quantity { grid-column: 3; }
.order-card-content .order-list-product.without-image .order-list-product-sku { grid-column: 4; }

.order-card-content .order-list-status {
  min-height: 38px;
  padding: 4px 7px 0;
  border-bottom: 0;
}

.infringement-table {
  min-width: 1180px;
}

.infringement-table th:nth-child(1) { width: 130px; }
.infringement-table th:nth-child(2) { width: 150px; }
.infringement-table th:nth-child(3) { width: 100px; }
.infringement-table th:nth-child(4) { width: 170px; }
.infringement-table th:nth-child(7) { width: 100px; }

.infringement-reason {
  min-width: 260px;
  white-space: normal;
  line-height: 1.45;
}

.infringement-source {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 2px 9px;
  border-radius: 999px;
  background: #fff3d6;
  color: #8a4b08;
  font-weight: 700;
}

.infringement-source.brand_protection {
  background: #ffe7e9;
  color: #a61b2b;
}

.infringement-product {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  min-width: 210px;
}

.infringement-product > div {
  min-width: 0;
}

.infringement-product small {
  max-width: 190px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.infringement-product-image {
  width: 48px;
  height: 48px;
  border: 1px solid var(--border);
  border-radius: 5px;
  background: #fff;
  object-fit: contain;
}

img.infringement-product-image {
  cursor: zoom-in;
}

.infringement-product-image.placeholder {
  display: grid;
  place-items: center;
  color: var(--text-muted);
  font-size: 10px;
}

.primary-button,
.secondary-button,
.table-action,
.text-button,
.alert-shortcut,
.nav-button {
  transition: transform 100ms ease, filter 100ms ease, box-shadow 140ms ease, background-color 140ms ease, border-color 140ms ease;
}

@media (max-width: 760px) {
  .content { padding: calc(var(--topbar-height) + 18px) 14px 30px; }
  .order-list-identity {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 6px 8px;
  }
  .order-list-identity > strong { grid-column: 1; }
  .order-list-identity > span:nth-of-type(1) { grid-column: 2; }
  .order-list-identity > .order-status-badge { grid-column: 3; }
  .order-list-identity > span:nth-of-type(3) { grid-column: 1 / -1; }
  .order-list-identity > .order-reputation-actions { grid-column: 1 / -1; }
  .conversation-message { max-width: 92%; }
  .order-pagination,
  .operation-pagination { align-items: flex-end; flex-direction: column; }
  .order-pagination-actions { width: 100%; flex-wrap: wrap; justify-content: flex-end; }
  .product-site-stack { min-width: 360px; }
  .product-site-line { grid-template-columns: 90px minmax(260px, 1fr); }
  .order-image-preview {
    width: calc(100vw - 28px);
    height: min(70vh, calc(100vw - 28px));
    transform: translate(-50%, -48%);
  }
}

/* Mobile operation dialogs: use the viewport for useful content, not empty canvas. */
@media (max-width: 760px) {
  #operation-dialog {
    box-sizing: border-box;
    width: calc(100vw - 6px);
    max-width: none;
    height: calc(100vh - 6px);
    height: calc(100dvh - 6px);
    max-height: calc(100vh - 6px);
    max-height: calc(100dvh - 6px);
    margin: 3px;
    overflow: hidden;
    border-radius: 5px;
  }

  #operation-dialog[open] {
    display: flex;
    flex-direction: column;
  }

  #operation-dialog > .dialog-body {
    box-sizing: border-box;
    width: 100%;
    height: auto;
    min-height: 0;
    max-height: none;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: max(4px, env(safe-area-inset-top)) 6px max(4px, env(safe-area-inset-bottom));
    overflow: hidden;
  }

  #operation-dialog .dialog-heading {
    min-height: 0;
    flex: 0 0 auto;
    gap: 4px;
    padding: 0 0 2px;
  }

  #operation-dialog .operation-title-line {
    gap: 5px;
    flex-wrap: nowrap;
  }

  #operation-dialog .operation-title-line h2 {
    min-width: 0;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #operation-dialog #operation-dialog-title-suffix {
    min-width: 0;
    gap: 3px;
    overflow: hidden;
    font-size: 10px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #operation-dialog #operation-dialog-subtitle {
    margin: 1px 0 0;
    font-size: 9px;
    line-height: 1.1;
  }

  #operation-dialog .icon-button {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
  }

  #operation-dialog #operation-dialog-meta .detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1px;
    margin-top: 1px;
  }

  #operation-dialog #operation-dialog-meta .detail-grid > div {
    min-height: 0;
    max-height: 38px;
    padding: 2px 3px;
    overflow: hidden;
    font-size: 9px;
    line-height: 1.15;
  }

  #operation-dialog #operation-dialog-meta .detail-grid span {
    margin: 0 0 1px;
    font-size: 8px;
    line-height: 1;
  }

  #operation-dialog #operation-dialog-meta .incoming-translation {
    display: none;
  }

  #operation-dialog .operation-detail,
  #operation-dialog.compact-question-dialog .operation-detail {
    min-height: 0;
    max-height: none;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
    margin: 2px 0;
    padding: 3px;
    overflow: hidden;
  }

  #operation-dialog .conversation-thread {
    min-height: 0;
    max-height: none;
    flex: 1 1 0;
    gap: 3px;
    padding: 3px;
    overflow-y: auto;
  }

  #operation-dialog .conversation-message {
    width: fit-content;
    min-height: 0;
    max-width: 92%;
    flex: 0 0 auto;
    padding: 7px 9px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 1.42;
    box-shadow: none;
  }

  #operation-dialog .conversation-message .incoming-translation {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.38;
  }

  #operation-dialog .conversation-message > small:last-child {
    margin-top: 3px;
    font-size: 10px;
  }

  #operation-dialog .conversation-item-summary,
  #operation-dialog .claim-order-summary {
    min-height: 44px;
    flex: 0 0 auto;
    gap: 5px;
    padding: 2px 4px;
  }

  #operation-dialog .conversation-item-summary .message-item-cell,
  #operation-dialog .claim-order-summary .message-item-cell {
    min-width: 0;
    gap: 5px;
  }

  #operation-dialog .conversation-item-summary .question-item-image,
  #operation-dialog .claim-order-summary .question-item-image,
  #operation-dialog .claim-order-summary .order-product-image {
    width: 42px;
    height: 42px;
  }

  #operation-dialog .conversation-item-summary .product-title-link,
  #operation-dialog .claim-order-summary .product-title-link,
  #operation-dialog .conversation-item-summary .message-item-cell > div > span,
  #operation-dialog .claim-order-summary .message-item-cell > div > span {
    max-width: none;
    overflow: hidden;
    font-size: 11px;
    line-height: 1.2;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  #operation-dialog .order-products {
    max-height: 34%;
    flex: 0 1 auto;
    gap: 3px;
    overflow-y: auto;
  }

  #operation-dialog .order-products h3,
  #operation-dialog .order-conversation h3 {
    margin: 1px 0;
    font-size: 11px;
    line-height: 1.1;
  }

  #operation-dialog .order-product {
    grid-template-columns: 42px minmax(0, 1fr) auto;
    gap: 5px;
    padding: 3px;
    font-size: 10px;
  }

  #operation-dialog .order-product-image {
    width: 42px;
    height: 42px;
  }

  #operation-dialog .order-product-main span,
  #operation-dialog .order-product-main small {
    font-size: 9px;
    line-height: 1.15;
  }

  #operation-dialog .order-conversation {
    min-height: 0;
    flex: 1 1 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  #operation-dialog .question-dialog-summary {
    grid-template-columns: 62px minmax(0, 1fr);
    flex: 0 0 auto;
    gap: 5px;
  }

  #operation-dialog .question-dialog-image {
    width: 62px;
    height: 62px;
  }

  #operation-dialog .question-dialog-summary .detail-grid {
    gap: 2px;
  }

  #operation-dialog .question-dialog-summary .detail-grid > div {
    padding: 3px;
    font-size: 10px;
  }

  #operation-dialog .claim-resolution-controls {
    min-height: 27px;
    flex: 0 0 auto;
    margin: 1px 0;
  }

  #operation-dialog #operation-reply-label,
  #operation-dialog .attachment-field {
    flex: 0 0 auto;
    gap: 2px;
    margin: 0;
  }

  #operation-dialog #operation-reply-label > span,
  #operation-dialog .attachment-field > span {
    font-size: 10px;
    line-height: 1.1;
  }

  #operation-dialog textarea {
    min-height: 40px;
    max-height: 44px;
    padding: 4px 6px;
    font-size: 12px;
  }

  #operation-dialog .attachment-field input {
    min-height: 29px;
    padding: 2px 5px;
    font-size: 10px;
  }

  #operation-dialog .dialog-actions {
    min-height: 31px;
    flex: 0 0 auto;
    gap: 4px;
    margin: 1px 0 0;
  }

  #operation-dialog .dialog-actions button {
    min-height: 31px;
    padding: 3px 7px;
    font-size: 10px;
  }

  input,
  textarea,
  select {
    -webkit-text-size-adjust: 100%;
    font-size: 16px;
  }

  #operation-dialog textarea,
  #operation-dialog .attachment-field input {
    font-size: 16px;
  }

  #operation-dialog .dialog-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(66px, 0.8fr) minmax(132px, 1.55fr) minmax(82px, 1fr);
    align-items: stretch;
    gap: 6px;
  }

  #operation-dialog .dialog-actions button {
    width: 100%;
    min-width: 0;
    min-height: 92px;
    padding: 12px 8px;
    overflow: hidden;
    font-size: 17px;
    font-weight: 800;
    line-height: 1.15;
    text-overflow: ellipsis;
    white-space: nowrap;
    touch-action: manipulation;
  }

  #operation-dialog .dialog-actions button.hidden {
    display: none;
  }

  #operation-dialog.claim-dialog .conversation-message {
    padding: 7px 9px;
    font-size: 14px;
    line-height: 1.42;
  }

  #operation-dialog.claim-dialog .conversation-message .incoming-translation {
    margin-top: 3px;
    font-size: 13px;
    line-height: 1.38;
  }

  #operation-dialog.claim-dialog .conversation-message > small:last-child {
    margin-top: 3px;
    font-size: 10px;
  }

  #operation-dialog.claim-dialog .dialog-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(66px, 0.8fr) minmax(132px, 1.55fr) minmax(82px, 1fr);
    align-items: stretch;
    gap: 6px;
  }

  #operation-dialog.claim-dialog .dialog-actions button {
    width: 100%;
    min-width: 0;
    min-height: 46px;
    padding: 8px 6px;
    font-size: 15px;
    font-weight: 800;
    line-height: 1.15;
  }
}

/* Final dialog readability overrides. Keep this block last. */
#operation-dialog .operation-detail { font-size: 14px; }
#operation-dialog .conversation-message {
  font-size: 15px;
  line-height: 1.48;
}
#operation-dialog .conversation-message .incoming-translation {
  margin-top: 4px;
  font-size: 14px;
  line-height: 1.42;
}
#operation-dialog .conversation-message > small:last-child { font-size: 11px; }
#operation-dialog .conversation-item-summary .product-title-link,
#operation-dialog .conversation-item-summary .message-item-cell > div > span,
#operation-dialog .claim-order-summary .product-title-link,
#operation-dialog .claim-order-summary .message-item-cell > div > span {
  max-width: none;
  overflow: visible;
  font-size: 15px;
  line-height: 1.35;
  text-overflow: clip;
  white-space: normal;
  overflow-wrap: anywhere;
}
#operation-dialog .message-item-cell small { font-size: 13px; font-weight: 700; }
#operation-dialog .dialog-order-link,
#operation-dialog .message-order-id,
#operation-dialog .message-item-id { font-size: 15px; font-weight: 900; }
.conversation-item-summary {
  display: grid;
  grid-template-columns: minmax(260px, 1.15fr) minmax(360px, 1fr);
  align-items: center;
  gap: 10px;
}
.message-order-parameters {
  min-width: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 10px;
  padding-left: 10px;
  border-left: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.3;
}
.message-order-parameters .message-variation {
  grid-column: 1 / -1;
  color: #d33131 !important;
  font-weight: 800;
}
.message-order-parameters .message-logistics-status {
  color: #176f66 !important;
  font-weight: 800;
}
#operation-dialog.compact-question-dialog { width: min(760px, calc(100% - 24px)); }
#operation-dialog.compact-question-dialog .operation-detail {
  max-height: min(68vh, 620px);
  gap: 10px;
  padding: 12px;
}
#operation-dialog .question-dialog-summary {
  grid-template-columns: 118px minmax(0, 1fr);
  gap: 14px;
}
#operation-dialog .question-dialog-image { width: 118px; height: 118px; }
.question-dialog-information {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}
.question-dialog-information > div {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 5px;
  background: #fff;
  font-size: 14px;
  line-height: 1.35;
}
.question-dialog-information span {
  display: block;
  margin-bottom: 3px;
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
}
.question-dialog-information strong,
.question-dialog-information a { font-size: 15px; overflow-wrap: anywhere; }
#operation-dialog .question-dialog-content {
  min-width: min(520px, 88%);
  padding: 10px 12px;
  font-size: 16px;
}

@media (min-width: 761px) {
  #operation-dialog.claim-dialog #operation-dialog-meta .detail-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 3px;
    margin-top: 2px;
  }
  #operation-dialog.claim-dialog #operation-dialog-meta .detail-grid > div {
    min-height: 0;
    max-height: 58px;
    padding: 4px 7px;
    overflow: auto;
    font-size: 12.5px;
    line-height: 1.25;
  }
  #operation-dialog.claim-dialog #operation-dialog-meta .detail-grid span {
    margin-bottom: 2px;
    font-size: 10.5px;
  }
  #operation-dialog.claim-dialog .claim-order-summary {
    min-height: 70px;
    padding: 4px 8px;
  }
  #operation-dialog.claim-dialog .operation-detail {
    margin: 2px 0;
    padding: 5px;
  }
  #operation-dialog.claim-dialog .conversation-thread {
    min-height: 380px;
    gap: 6px;
  }
  #operation-dialog.claim-dialog .conversation-message {
    font-size: 15px;
    line-height: 1.48;
  }
  #operation-dialog.claim-dialog #operation-reply-label textarea {
    min-height: 52px;
    max-height: 64px;
  }
}

@media (max-width: 760px) {
  #operation-dialog .conversation-message,
  #operation-dialog.claim-dialog .conversation-message {
    font-size: 16px;
    line-height: 1.48;
  }
  #operation-dialog .conversation-message .incoming-translation,
  #operation-dialog.claim-dialog .conversation-message .incoming-translation {
    font-size: 14px;
    line-height: 1.42;
  }
  .conversation-item-summary { grid-template-columns: 1fr; gap: 4px; }
  .message-order-parameters {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 4px 0 0;
    border-top: 1px solid var(--border);
    border-left: 0;
    font-size: 12px;
  }
  #operation-dialog .dialog-order-link,
  #operation-dialog .message-order-id,
  #operation-dialog .message-item-id { font-size: 14px; }
  #operation-dialog .question-dialog-summary {
    grid-template-columns: 78px minmax(0, 1fr);
    gap: 5px;
  }
  #operation-dialog .question-dialog-image { width: 78px; height: 78px; }
  .question-dialog-information { grid-template-columns: 1fr 1fr; gap: 3px; }
  .question-dialog-information > div { padding: 4px; font-size: 12px; }
  .question-dialog-information span { font-size: 10px; }
  .question-dialog-information strong,
  .question-dialog-information a { font-size: 12px; }
}

/* Keep the conversation scrollable above the fixed reply controls. */
#operation-dialog > .dialog-body {
  box-sizing: border-box;
  min-height: 0;
}

#operation-dialog .operation-detail {
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

#operation-dialog .conversation-thread {
  min-height: 0;
  max-height: none;
  flex: 1 1 auto;
  align-content: start;
  overflow-y: auto;
  padding-bottom: 18px;
  scroll-padding-bottom: 18px;
}

#operation-dialog #operation-reply-label,
#operation-dialog .attachment-field,
#operation-dialog .dialog-actions {
  flex: 0 0 auto;
}

#operation-dialog.claim-dialog .conversation-thread {
  min-height: 0;
}

#operation-dialog.claim-dialog .operation-detail {
  overflow: hidden;
}

/* Desktop conversation priority: reserve the dialog middle for messages. */
@media (min-width: 761px) {
  #operation-dialog:not(.compact-question-dialog) > .dialog-body {
    height: min(94vh, 900px);
    padding: 10px 12px;
    gap: 4px;
  }

  #operation-dialog:not(.compact-question-dialog) .dialog-heading {
    flex: 0 0 auto;
    min-height: 34px;
    padding-bottom: 2px;
  }

  #operation-dialog:not(.compact-question-dialog) .operation-detail {
    min-height: 0;
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 2px 0;
    padding: 5px;
    overflow: hidden;
  }

  #operation-dialog:not(.compact-question-dialog) .conversation-item-summary,
  #operation-dialog:not(.compact-question-dialog) .claim-order-summary {
    flex: 0 0 auto;
    min-height: 0;
    max-height: 112px;
    padding: 4px;
    gap: 6px;
    overflow: hidden;
  }

  #operation-dialog:not(.compact-question-dialog) .conversation-item-summary .product-title-link,
  #operation-dialog:not(.compact-question-dialog) .conversation-item-summary .message-item-cell > div > span {
    font-size: 12px;
    line-height: 1.2;
  }

  #operation-dialog:not(.compact-question-dialog) .message-order-parameters {
    gap: 2px 7px;
    padding-left: 7px;
    font-size: 11px;
    line-height: 1.15;
  }

  #operation-dialog:not(.compact-question-dialog) .message-order-id,
  #operation-dialog:not(.compact-question-dialog) .message-item-id,
  #operation-dialog:not(.compact-question-dialog) .dialog-order-link {
    font-size: 12px;
  }

  #operation-dialog:not(.compact-question-dialog) .conversation-thread {
    min-height: 0;
    max-height: none;
    flex: 1 1 auto;
    gap: 5px;
    padding: 3px 5px 8px;
    overflow-y: auto;
  }

  #operation-dialog:not(.compact-question-dialog) #operation-reply-label,
  #operation-dialog:not(.compact-question-dialog) .attachment-field {
    flex: 0 0 auto;
    gap: 2px;
    margin: 1px 0 0;
  }

  #operation-dialog:not(.compact-question-dialog) #operation-reply-label > span,
  #operation-dialog:not(.compact-question-dialog) .attachment-field > span {
    font-size: 11px;
    line-height: 1.1;
  }

  #operation-dialog:not(.compact-question-dialog) textarea {
    min-height: 42px;
    max-height: 52px;
    padding: 4px 6px;
    font-size: 13px;
  }

  #operation-dialog:not(.compact-question-dialog) .attachment-field input {
    min-height: 32px;
    padding: 2px 5px;
    font-size: 11px;
  }

  #operation-dialog:not(.compact-question-dialog) .operation-image-status {
    font-size: 10px;
    line-height: 1.1;
  }

  #operation-dialog:not(.compact-question-dialog) .dialog-actions {
    flex: 0 0 auto;
    gap: 6px;
    margin-top: 2px;
  }

  #operation-dialog:not(.compact-question-dialog) .dialog-actions button {
    min-height: 36px;
    padding: 5px 12px;
    font-size: 13px;
  }
}

/* Keep every full conversation above the reply controls. */
#operation-dialog:not(.compact-question-dialog) > .dialog-body {
  display: flex;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

#operation-dialog:not(.compact-question-dialog) .operation-detail {
  min-height: 0;
  flex: 1 1 auto;
  overflow: hidden;
}

#operation-dialog:not(.compact-question-dialog) .order-products {
  min-height: 0;
  flex: 0 1 auto;
  overflow-y: auto;
}

#operation-dialog:not(.compact-question-dialog) .order-conversation {
  min-height: 0;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

#operation-dialog:not(.compact-question-dialog) .order-conversation h3 {
  flex: 0 0 auto;
}

#operation-dialog:not(.compact-question-dialog) .conversation-thread {
  box-sizing: border-box;
  min-height: 0;
  flex: 1 1 0;
  max-height: none;
  padding-bottom: 32px;
  scroll-padding-bottom: 32px;
}

/* Dense after-sales rows keep the existing product image dimensions unchanged. */
.claims-operation-table {
  table-layout: fixed;
  min-width: 1300px;
}

.claims-operation-table th,
.claims-operation-table td {
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.25;
  vertical-align: middle;
}

.claims-operation-table th {
  white-space: nowrap;
}

.claims-operation-table td {
  white-space: normal;
  overflow-wrap: anywhere;
}

.claims-operation-table td strong {
  font-size: 13px;
  line-height: 1.2;
}

.claims-operation-table td small {
  display: block;
  margin-top: 2px;
  line-height: 1.2;
}

.claims-operation-table .message-item-cell {
  min-width: 0;
}

.claims-operation-table .message-item-cell .product-title-link,
.claims-operation-table .message-item-cell > div > span {
  width: 100%;
  max-width: none;
}

.claims-operation-table th:nth-child(1),
.claims-operation-table td:nth-child(1) { width: 250px; }

.claims-operation-table th:nth-child(2),
.claims-operation-table td:nth-child(2) { width: 360px; }

.claims-operation-table th:nth-child(3),
.claims-operation-table td:nth-child(3) { width: 200px; }

.claims-operation-table th:nth-child(4),
.claims-operation-table td:nth-child(4) { width: 110px; }

.claims-operation-table th:nth-child(5),
.claims-operation-table td:nth-child(5) { width: 100px; }

.claims-operation-table th:nth-child(6),
.claims-operation-table td:nth-child(6) { width: 100px; }

.claims-operation-table th:nth-child(7),
.claims-operation-table td:nth-child(7) { width: 190px; }

.claims-operation-table th:nth-child(8),
.claims-operation-table td:nth-child(8) {
  width: 86px;
  min-width: 86px;
  text-align: center;
  white-space: nowrap;
}

.claims-operation-table .claim-reputation-type-cell small {
  color: var(--text-muted);
}

.claims-star-filter-button.active {
  border-color: var(--red);
  background: var(--red-soft);
  color: var(--red);
}

.claim-identity-cell {
  min-width: 0;
}

.claim-store-site,
.claim-id-line {
  display: flex;
  align-items: center;
  min-width: 0;
  gap: 6px;
}

.claim-store-site {
  margin-bottom: 4px;
  color: var(--text-muted);
  white-space: nowrap;
}

.claim-store-site strong,
.claim-store-site span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.claim-store-site strong {
  color: var(--text);
}

.claim-store-site .site-flag-image {
  width: 20px;
  height: 15px;
  flex: 0 0 auto;
}

.claim-id-line strong {
  overflow-wrap: anywhere;
}

.claim-star-button {
  width: 24px;
  height: 24px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--text-muted);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.claim-star-button:hover,
.claim-star-button:focus-visible {
  color: var(--red);
}

.claim-star-button.is-starred {
  color: var(--red);
}

.claim-star-button:disabled {
  cursor: wait;
  opacity: 0.65;
}

.claim-note-input {
  width: 100%;
  min-height: 54px;
  padding: 6px 8px;
  border: 1px solid var(--border-strong);
  border-radius: 5px;
  background: #fff;
  color: var(--text);
  font: inherit;
  font-size: 12px;
  line-height: 1.35;
  resize: vertical;
}

.claim-note-input:focus {
  outline: 2px solid rgba(23, 107, 77, 0.16);
  border-color: var(--primary);
}

.claim-note-input.is-saving {
  background: var(--surface-muted);
}
.automatic-label-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 40px;
  cursor: pointer;
  white-space: nowrap;
}

.automatic-label-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.automatic-label-track {
  width: 42px;
  height: 24px;
  padding: 3px;
  flex-shrink: 0;
  border-radius: 20px;
  background: #94a3b8;
  transition: background 0.18s ease;
}

.automatic-label-track::after {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: white;
  transition: transform 0.18s ease;
}

.automatic-label-switch input:checked + .automatic-label-track { background: #2563eb; }
.automatic-label-switch input:checked + .automatic-label-track::after { transform: translateX(18px); }
.automatic-label-switch input:disabled + .automatic-label-track { opacity: 0.45; cursor: not-allowed; }
.automatic-label-switch input:focus-visible + .automatic-label-track { outline: 3px solid #93c5fd; outline-offset: 3px; }
.automatic-label-info { margin: 0 0 18px; font-size: 13px; color: #475569; }
.automatic-label-info p { margin: 8px 0; }
.automatic-label-info summary { cursor: pointer; width: fit-content; }
.automatic-label-table-wrap { overflow-x: auto; max-height: 320px; margin-top: 12px; }
.automatic-label-table { width: 100%; min-width: 780px; }
.automatic-label-table td:last-child { min-width: 200px; white-space: normal; }

@media (max-width: 760px) {
  #view-orders .heading-actions .automatic-label-switch {
    flex: 0 0 100%;
    justify-content: space-between;
  }
}
