#panelThemeToggle {
  flex: 0 0 auto;
  width: 42px;
  min-height: 42px;
  padding: 0;
  font-size: 18px;
  color: #245778;
  background: #edf4f9;
  border-color: #c7d8e5;
}

#ordersView .panel-actions {
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
}

#ordersView .order-card {
  min-width: 0;
  overflow-wrap: anywhere;
}

#consultantViewDialog {
  width: min(440px, calc(100% - 32px));
  box-sizing: border-box;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface);
  color: var(--ink);
}

#consultantViewDialog::backdrop { background: #10252180; }
#consultantViewDialog h2 { margin: 0 0 14px; }
#consultantViewDialog select { display: block; width: 100%; margin-top: 6px; }
#consultantViewDialog .panel-actions { justify-content: flex-end; margin-top: 16px; }
#consultantApp .ts-app-footer { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 16px; }

#cspsCheck330:not([hidden]) {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 14px 0;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--pale);
  color: var(--ink);
}

#cspsCheck330::before {
  content: '';
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border-radius: 50%;
  background: currentColor;
  opacity: .6;
}

.order-meta .order-csv-checked64 {
  font-size: 12px;
}

#summaryStats .stat b {
  font-variant-numeric: tabular-nums;
}

@media (max-width: 600px) {
  #panelThemeToggle {
    width: 38px;
    min-height: 38px;
  }

  #cspsCheck330:not([hidden]) {
    padding: 8px 10px;
  }

  .order-meta .order-csv-checked64 {
    flex-basis: 100%;
  }
}

:root[data-ts-theme="dark"] {
  color-scheme: dark;
  --ink: #e5edf5;
  --text: #e5edf5;
  --muted: #acbfd1;
  --line: #334c61;
  --green: #7dc9b4;
  --green-dark: #a9e5d3;
  --pale: #1d3548;
  --surface: #182c3e;
  --panel: #182c3e;
  --bg: #111f2d;
}

:root[data-ts-theme="dark"] body :is(.login-card,.folder-panel,.order-card,.consultant-piece,.stat,.notice-card,.order-body,.fact,.empty-state,.site-dialog,.gama-field-popup,.gama-field-option,.profile-label) {
  color: var(--ink);
  background: var(--surface);
  border-color: var(--line);
}

:root[data-ts-theme="dark"] .login-gate {
  background: var(--bg);
}

:root[data-ts-theme="dark"] body :is(input,select,button.secondary,#panelThemeToggle,.gama-field-button,.site-tab.active,.order-update-history,.notice-history-tabs,.tag) {
  color: var(--ink);
  background: var(--pale);
  border-color: var(--line);
}

:root[data-ts-theme="dark"] body :is(.order-number,.order-customer,.order-forecast.in-stock,.order-csv-checked64,.order-arrival,.piece-inline-meta,.service-action,.notice-history-tabs button) {
  color: var(--ink);
}

:root[data-ts-theme="dark"] .order-meta .order-forecast:not(.in-stock) {
  color: #e8c482;
}

:root[data-ts-theme="dark"] body :is(.stock-note,.notice-card.unread,.notice-history-tabs button[aria-pressed="true"],.service-action,.gama-field-option:hover) {
  background: var(--pale);
  border-color: var(--line);
}
