/* BobaLive canonical UI contract: live-print workbench, light and dark. */
:root {
  color-scheme: dark;
  --boba-canvas: #0d1217;
  --boba-surface: #131920;
  --boba-surface-raised: #181f27;
  --boba-control: #0a1015;
  --boba-text: #f3f0e9;
  --boba-text-secondary: #c9c7c1;
  --boba-text-tertiary: #9ba4ad;
  --boba-text-disabled: #68727c;
  --boba-border: rgba(255, 255, 255, .09);
  --boba-border-strong: rgba(224, 178, 91, .34);
  --boba-brand: #d4a650;
  --boba-brand-strong: #edc775;
  --boba-brand-soft: rgba(212, 166, 80, .14);
  --boba-selected: rgba(212, 166, 80, .16);
  --boba-success: #59cb8c;
  --boba-success-soft: rgba(89, 203, 140, .12);
  --boba-danger: #ed746e;
  --boba-danger-soft: rgba(237, 116, 110, .12);
  --boba-warning: #eda64d;
  --boba-warning-soft: rgba(237, 166, 77, .14);
  --boba-info: #6bbddd;
  --boba-radius-control: 8px;
  --boba-radius-card: 12px;
  --boba-radius-panel: 16px;
  --boba-control-height: 44px;
  --boba-space-1: 4px;
  --boba-space-2: 8px;
  --boba-space-3: 12px;
  --boba-space-4: 16px;
  --boba-space-5: 20px;
  --boba-space-6: 24px;
  --boba-font: "Noto Sans TC", "Noto Sans", "Microsoft JhengHei UI", "Microsoft JhengHei", sans-serif;

  /* Compatibility aliases: legacy files consume the same canonical contract. */
  --theme-bg: var(--boba-canvas);
  --theme-sidebar: var(--boba-canvas);
  --theme-surface: var(--boba-surface);
  --theme-surface-2: var(--boba-surface-raised);
  --theme-input: var(--boba-control);
  --theme-text: var(--boba-text);
  --theme-text-2: var(--boba-text-secondary);
  --theme-muted: var(--boba-text-tertiary);
  --theme-line: var(--boba-border);
  --theme-gold: var(--boba-brand);
  --theme-gold-soft: var(--boba-brand-strong);
  --theme-selected: var(--boba-selected);
  --theme-shadow: transparent;
  --ui-bg: var(--boba-canvas);
  --ui-sidebar: var(--boba-canvas);
  --ui-surface: var(--boba-surface);
  --ui-surface-raised: var(--boba-surface-raised);
  --ui-input: var(--boba-control);
  --ui-line: var(--boba-border);
  --ui-line-strong: var(--boba-border-strong);
  --ui-gold: var(--boba-brand);
  --ui-gold-soft: var(--boba-brand-strong);
  --ui-text: var(--boba-text);
  --ui-muted: var(--boba-text-tertiary);
  --ui-success: var(--boba-success);
  --ui-danger: var(--boba-danger);
  --ui-info: var(--boba-info);
  --ui-radius: var(--boba-radius-panel);
  --ui-control: var(--boba-control-height);
  --rr-bg: var(--boba-canvas);
  --rr-sidebar: var(--boba-canvas);
  --rr-surface: var(--boba-surface);
  --rr-surface-2: var(--boba-surface-raised);
  --rr-line: var(--boba-border);
  --rr-gold: var(--boba-brand);
  --rr-gold-soft: var(--boba-brand-strong);
  --rr-selected: var(--boba-selected);
  --rr-text: var(--boba-text);
  --rr-text-2: var(--boba-text-secondary);
  --rr-muted: var(--boba-text-tertiary);
  --rr-green: var(--boba-success);
  --rr-font: var(--boba-font);
}

/* Explicit multi-device print routing. The selected hardware path is the focal control. */
#comments-view .status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--boba-space-3);
}

.keyword-route-state {
  display: inline-flex;
  align-items: center;
  gap: var(--boba-space-2);
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid var(--boba-border);
  border-radius: 999px;
  color: var(--boba-text-tertiary);
  background: var(--boba-surface-raised);
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
}

.keyword-route-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--boba-text-disabled);
}

.keyword-route-state.active {
  color: var(--boba-success);
  border-color: color-mix(in srgb, var(--boba-success) 34%, transparent);
  background: var(--boba-success-soft);
}

.keyword-route-state.active .keyword-route-dot {
  background: var(--boba-success);
  box-shadow: 0 0 0 4px var(--boba-success-soft);
}

.print-route-panel {
  margin: var(--boba-space-4) 0;
  padding: var(--boba-space-4);
  border: 1px solid var(--boba-border-strong);
  border-radius: var(--boba-radius-card);
  background: var(--boba-surface-raised);
}

.local-bridge-panel {
  margin: var(--boba-space-4) 0;
  padding: var(--boba-space-4);
  border: 1px solid var(--boba-border);
  border-radius: var(--boba-radius-card);
  background: var(--boba-surface);
}

#comments-view .content-card > .local-bridge-panel {
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

#comments-view .local-bridge-panel .local-bridge-heading {
  min-height: 24px;
}

#comments-view .local-bridge-panel .ingest-key-title-group {
  display: block;
}

#comments-view .local-bridge-panel .ingest-key-title-group h2 {
  margin: 0;
  color: var(--boba-text);
  font-size: 16px;
  line-height: 1.25;
}

/* The route indicator above this card is the visible connection state. Keep
   this internal bridge badge in the DOM for state updates, but do not make the
   compact Key-and-printer card compete with a duplicate status pill. */
#comments-view .local-bridge-panel .local-bridge-badge {
  display: none;
}

#comments-view .local-bridge-panel .ingest-key-panel {
  gap: var(--boba-space-2);
  padding: var(--boba-space-2) 0 var(--boba-space-3);
  border-top: 0;
}

#comments-view .local-bridge-panel .ingest-key-description {
  margin: 0;
}

#comments-view .local-bridge-panel .ingest-key-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--boba-space-2);
  align-items: center;
}

#comments-view .local-bridge-panel .ingest-key-value code,
#comments-view .local-bridge-panel .ingest-key-value .ghost-btn {
  min-height: 40px;
  border-radius: var(--boba-radius-control);
}

#comments-view .local-bridge-panel .ingest-key-value .ghost-btn {
  padding: 0 14px;
  color: var(--boba-brand-strong);
  border-color: var(--boba-border-strong);
  background: transparent;
}

.local-bridge-printer-settings {
  padding-top: var(--boba-space-3);
  border-top: 1px solid var(--boba-border);
}

#comments-view .local-bridge-panel .local-bridge-detail {
  display: none;
}

.local-bridge-heading,
.local-bridge-controls,
.local-bridge-actions {
  display: flex;
  align-items: center;
}

.local-bridge-heading {
  justify-content: space-between;
  gap: var(--boba-space-4);
}

.local-bridge-heading h2 {
  margin: 0;
  color: var(--boba-text);
  font-size: 20px;
  line-height: 1.25;
}

.local-bridge-badge {
  min-height: 34px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--boba-text-tertiary);
  background: var(--boba-control);
  font-size: 14px;
  font-weight: 750;
}

.local-bridge-badge.ready,
.local-bridge-badge.authorized {
  color: var(--boba-success);
  background: var(--boba-success-soft);
}

.local-bridge-badge.error {
  color: var(--boba-danger);
  background: var(--boba-danger-soft);
}

.local-bridge-detail {
  margin: var(--boba-space-2) 0 var(--boba-space-3);
  color: var(--boba-text-tertiary);
  font-size: 14px;
  line-height: 1.45;
}

.local-bridge-controls {
  gap: var(--boba-space-3);
}

.local-printer-field {
  display: grid;
  grid-template-columns: 112px minmax(240px, 1fr);
  align-items: center;
  flex: 1 1 auto;
  gap: var(--boba-space-3);
  color: var(--boba-text-secondary);
  font-size: 15px;
  font-weight: 650;
}

.local-printer-field select {
  width: 100%;
  min-width: 0;
  min-height: var(--boba-control-height);
  border: 1px solid var(--boba-border);
  border-radius: var(--boba-radius-control);
  color: var(--boba-text);
  background: var(--boba-control);
  font: inherit;
}

.local-printer-field select:focus-visible {
  outline: 3px solid var(--boba-brand-soft);
  border-color: var(--boba-brand);
}

.local-bridge-actions {
  flex: 0 0 auto;
  gap: var(--boba-space-2);
}

.print-route-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--boba-space-4);
  margin-bottom: var(--boba-space-3);
}

.print-route-kicker {
  margin: 0 0 2px;
  color: var(--boba-brand);
  font-size: 14px;
  font-weight: 750;
  letter-spacing: .08em;
}

.print-route-heading h2 {
  margin: 0;
  color: var(--boba-text);
  font-size: 20px;
  line-height: 1.25;
  letter-spacing: -.01em;
}

.print-route-summary {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 5px 11px;
  border-radius: 999px;
  color: var(--boba-text-tertiary);
  background: var(--boba-control);
  font-size: 14px;
  font-weight: 700;
}

.print-route-summary.online {
  color: var(--boba-success);
  background: var(--boba-success-soft);
}

.print-device-field {
  display: grid;
  grid-template-columns: 150px minmax(260px, 1fr);
  align-items: center;
  gap: var(--boba-space-3);
  margin-bottom: var(--boba-space-3);
  color: var(--boba-text-secondary);
  font-size: 15px;
  font-weight: 650;
}

.print-device-field select {
  width: 100%;
  min-width: 0;
  min-height: var(--boba-control-height);
  color: var(--boba-text);
  border: 1px solid var(--boba-border);
  border-radius: var(--boba-radius-control);
  background: var(--boba-control);
  font: inherit;
}

.print-device-field select:focus-visible {
  outline: 3px solid var(--boba-brand-soft);
  border-color: var(--boba-brand);
}

.print-device-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--boba-space-2);
}

.offline-device-disclosure {
  margin-top: var(--boba-space-3);
  padding-top: var(--boba-space-3);
  border-top: 1px solid var(--boba-border);
}

.offline-device-toggle {
  min-height: 38px;
  padding: 7px 12px;
  border: 1px solid var(--boba-border);
  border-radius: var(--boba-radius-control);
  color: var(--boba-text-secondary);
  background: var(--boba-control);
  font: inherit;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
}

.offline-device-toggle:hover,
.offline-device-toggle:focus-visible {
  border-color: var(--boba-border-strong);
  color: var(--boba-text);
}

.offline-device-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--boba-space-2);
  margin-top: var(--boba-space-2);
}

.offline-device-diagnostic {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 4px var(--boba-space-2);
  min-height: 64px;
  padding: 12px;
  border: 1px dashed var(--boba-border);
  border-radius: var(--boba-radius-control);
  color: var(--boba-text-tertiary);
  background: var(--boba-control);
  opacity: .76;
}

.offline-device-diagnostic strong,
.offline-device-diagnostic small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.offline-device-diagnostic strong {
  color: var(--boba-text-secondary);
  font-size: 15px;
}

.offline-device-diagnostic small,
.offline-device-diagnostic .print-device-state {
  font-size: 14px;
}

.offline-device-diagnostic .print-device-state {
  color: var(--boba-danger);
}

.print-device-option {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  grid-template-areas: "radio main state" "radio profile profile";
  align-items: center;
  gap: 4px var(--boba-space-2);
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--boba-border);
  border-radius: var(--boba-radius-control);
  color: var(--boba-text-secondary);
  background: var(--boba-surface);
  cursor: pointer;
}

.print-device-option:hover {
  border-color: var(--boba-border-strong);
}

.print-device-option.selected {
  border-color: var(--boba-brand);
  background: var(--boba-selected);
}

.print-device-option.offline {
  cursor: not-allowed;
  opacity: .64;
}

.print-device-option input {
  grid-area: radio;
  width: 18px;
  height: 18px;
  accent-color: var(--boba-brand);
}

.print-device-main {
  grid-area: main;
  min-width: 0;
}

.print-device-main strong,
.print-device-main small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.print-device-main strong {
  color: var(--boba-text);
  font-size: 15px;
  font-weight: 750;
}

.print-device-main small,
.print-device-profile,
.print-device-state,
.print-route-detail,
.print-route-error,
.print-device-empty {
  font-size: 14px;
}

.print-device-main small,
.print-device-profile,
.print-route-detail {
  color: var(--boba-text-tertiary);
}

.print-device-profile {
  grid-area: profile;
}

.print-device-state {
  grid-area: state;
  color: var(--boba-success);
  font-weight: 750;
}

.print-device-option.offline .print-device-state {
  color: var(--boba-danger);
}

.print-route-detail,
.print-route-error,
.print-device-empty {
  margin: var(--boba-space-2) 0 0;
  line-height: 1.45;
}

.print-route-error {
  padding: 9px 12px;
  border-radius: var(--boba-radius-control);
  color: var(--boba-danger);
  background: var(--boba-danger-soft);
  font-weight: 700;
}

.print-device-empty {
  padding: 12px;
  border-radius: var(--boba-radius-control);
  color: var(--boba-text-tertiary);
  background: var(--boba-control);
}

@media (max-width: 860px) {
  #comments-view .status-row,
  .print-route-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .print-device-field {
    grid-template-columns: 1fr;
    gap: var(--boba-space-2);
  }

  .print-device-list {
    grid-template-columns: 1fr;
  }

  .offline-device-list {
    grid-template-columns: 1fr;
  }

  .local-bridge-controls {
    align-items: stretch;
    flex-direction: column;
  }

  .local-printer-field {
    grid-template-columns: 1fr;
    gap: var(--boba-space-2);
  }

  .local-bridge-actions > button {
    flex: 1 1 0;
  }
}

@media (max-width: 560px) {
  .local-bridge-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .local-bridge-actions {
    align-items: stretch;
    flex-direction: column;
  }
}

.mobile-mode .local-bridge-panel {
  display: block;
}

.mobile-mode .local-bridge-printer-settings {
  display: none;
}

:root[data-theme="light"] {
  color-scheme: light;
  --boba-canvas: #f4f2ed;
  --boba-surface: #ffffff;
  --boba-surface-raised: #f8f6f1;
  --boba-control: #eeece7;
  --boba-text: #211f1c;
  --boba-text-secondary: #504b44;
  --boba-text-tertiary: #716b62;
  --boba-text-disabled: #9b958c;
  --boba-border: rgba(55, 47, 36, .13);
  --boba-border-strong: rgba(137, 92, 20, .34);
  --boba-brand: #966719;
  --boba-brand-strong: #70490e;
  --boba-brand-soft: rgba(150, 103, 25, .10);
  --boba-selected: #eee3ca;
  --boba-success: #28794b;
  --boba-success-soft: #e5f3e9;
  --boba-danger: #b64540;
  --boba-danger-soft: #f9e9e7;
  --boba-warning: #a85f16;
  --boba-warning-soft: #faeedf;
  --boba-info: #326d88;
}

html,
body,
.main-panel {
  color: var(--theme-text) !important;
  background: var(--theme-bg) !important;
}

.sidebar {
  border-right-color: var(--theme-line) !important;
  background: var(--theme-sidebar) !important;
}

.theme-toggle {
  position: absolute;
  top: 18px;
  right: 14px;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  padding: 0 !important;
  border: 1px solid var(--theme-line) !important;
  border-radius: 10px !important;
  color: var(--theme-gold-soft) !important;
  background: var(--theme-surface-2) !important;
  font-size: 18px;
}

.sidebar-top {
  position: relative;
}

.sidebar.collapsed .theme-toggle {
  display: none;
}

:root[data-theme="light"] .sidebar-brand h2,
:root[data-theme="light"] .sidebar-user-email,
:root[data-theme="light"] .nav-item,
:root[data-theme="light"] .view-panel h1,
:root[data-theme="light"] .view-panel h2,
:root[data-theme="light"] .view-panel h3,
:root[data-theme="light"] .view-panel h4,
:root[data-theme="light"] .customer-record-name,
:root[data-theme="light"] .product-category-main strong,
:root[data-theme="light"] .product-buyer-head strong {
  color: var(--theme-text) !important;
}

:root[data-theme="light"] .sidebar-kicker,
:root[data-theme="light"] .nav-group-label,
:root[data-theme="light"] .status-text,
:root[data-theme="light"] .customer-record-preview,
:root[data-theme="light"] .customer-record-sub,
:root[data-theme="light"] .customer-record-time,
:root[data-theme="light"] .product-category-main > span,
:root[data-theme="light"] .product-category-customers,
:root[data-theme="light"] .product-category-time,
:root[data-theme="light"] .product-buyer-head span,
:root[data-theme="light"] .product-buyer-meta span,
:root[data-theme="light"] .customer-summary-cell span,
:root[data-theme="light"] .field > span,
:root[data-theme="light"] .workbench-date-field,
:root[data-theme="light"] .section-kicker {
  color: var(--theme-muted) !important;
}

:root[data-theme="light"] .nav-item.active {
  border-color: #c5af82 !important;
  background: #ddd0b5 !important;
  color: #62440f !important;
}

:root[data-theme="light"] .content-card,
:root[data-theme="light"] .customer-summary-strip,
:root[data-theme="light"] .customer-detail-card,
:root[data-theme="light"] .product-detail-card,
:root[data-theme="light"] .trends-section,
:root[data-theme="light"] .lottery-card,
:root[data-theme="light"] .platform-connection-card,
:root[data-theme="light"] .platform-connection-note,
:root[data-theme="light"] .facebook-message-setting-block,
:root[data-theme="light"] .facebook-message-variables,
:root[data-theme="light"] .facebook-page-item,
:root[data-theme="light"] .qr-card,
:root[data-theme="light"] .login-card {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  box-shadow: 0 12px 32px var(--theme-shadow) !important;
}

:root[data-theme="light"] input,
:root[data-theme="light"] select,
:root[data-theme="light"] textarea,
:root[data-theme="light"] .customer-toolbar input,
:root[data-theme="light"] .customer-toolbar select,
:root[data-theme="light"] .facebook-message-template {
  border-color: var(--theme-line) !important;
  color: var(--theme-text) !important;
  background: var(--theme-input) !important;
}

:root[data-theme="light"] .ghost-btn,
:root[data-theme="light"] .icon-btn,
:root[data-theme="light"] .mini-action-btn,
:root[data-theme="light"] .customer-tab-btn,
:root[data-theme="light"] .contact-chip {
  border-color: var(--theme-line) !important;
  color: var(--theme-gold-soft) !important;
  background: var(--theme-surface-2) !important;
}

:root[data-theme="light"] .customer-tab-btn {
  background: transparent !important;
}

:root[data-theme="light"] .customer-tab-btn.active {
  border-bottom-color: var(--theme-gold) !important;
  color: var(--theme-gold-soft) !important;
}

:root[data-theme="light"] #customers-view .customer-summary-strip,
:root[data-theme="light"] #products-view .product-detail-stats,
:root[data-theme="light"] #customers-view .customer-reference-stats {
  background: #f8f6f1 !important;
}

:root[data-theme="light"] #customers-view .customer-record-item.active,
:root[data-theme="light"] #products-view .product-category-item.active {
  background: var(--theme-selected) !important;
}

:root[data-theme="light"] #customers-view .customer-record-item:hover,
:root[data-theme="light"] #products-view .product-category-item:hover,
:root[data-theme="light"] #products-view .product-buyer-item:hover {
  background: #f0ede6 !important;
}

:root[data-theme="light"] .customer-table-head,
:root[data-theme="light"] .product-table-head {
  color: var(--theme-muted) !important;
}

:root[data-theme="light"] .customer-detail-card,
:root[data-theme="light"] .product-detail-card {
  color: var(--theme-text-2) !important;
  background: var(--theme-surface) !important;
}

:root[data-theme="light"] .customer-status-pill {
  border-color: #91b99f !important;
  color: #287446 !important;
  background: #e5f2e9 !important;
}

:root[data-theme="light"] .sidebar-user-card {
  border-color: var(--theme-line) !important;
  color: var(--theme-text-2) !important;
  background: #f6f2e9 !important;
}

/* Compact list cluster: do not stretch columns across all unused space. */
#customers-view .customer-list-card,
#products-view .product-category-card {
  width: 100%;
  max-width: 860px;
}

#customers-view .customer-table-head,
#customers-view .customer-record-item {
  grid-template-columns: minmax(210px, 240px) 100px 128px 176px !important;
  gap: 10px !important;
}

#products-view .product-table-head,
#products-view .product-category-item {
  grid-template-columns: minmax(300px, 1fr) minmax(170px, 220px) 150px !important;
  gap: 12px !important;
}

#customers-view .customer-record-list,
#products-view .product-category-list {
  gap: 0 !important;
}

#customers-view .customer-record-item,
#products-view .product-category-item {
  min-height: 54px !important;
  padding-top: 6px !important;
  padding-bottom: 6px !important;
}

#customers-view .customer-layout.drawer-open,
#products-view .product-layout {
  grid-template-columns: minmax(650px, 860px) minmax(300px, 1fr) !important;
  gap: 18px !important;
}

@media (max-width: 1180px) {
  #customers-view .customer-layout.drawer-open,
  #products-view .product-layout {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #customers-view .customer-list-card,
  #products-view .product-category-card {
    max-width: none;
  }
}

@media (max-width: 760px) {
  .theme-toggle {
    display: none;
  }

  #customers-view .customer-record-item,
  #products-view .product-category-item {
    min-height: 64px !important;
  }

  #customers-view .customer-record-item {
    grid-template-columns: minmax(0, 1fr) auto !important;
    grid-template-areas:
      "customer side"
      "platform side"
      "orders side";
    gap: 4px 10px !important;
  }

  #customers-view .customer-record-main { grid-area: customer; }
  #customers-view .comment-source { grid-area: platform; justify-self: start; }
  #customers-view .customer-record-meta { grid-area: orders; }
  #customers-view .customer-record-side { grid-area: side; align-self: center; }

  #customers-view .customer-layout,
  #customers-view .customer-layout.drawer-open,
  #products-view .product-layout,
  #customers-view .customer-list-card,
  #products-view .product-category-card,
  #customers-view .customer-list-head,
  #products-view .customer-list-head,
  #customers-view .customer-record-list,
  #products-view .product-category-list,
  #customers-view .customer-record-item,
  #products-view .product-category-item {
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }
}

/* Membership renewal clarity in the canonical light theme. */
html[data-theme="light"] body #billing-view :is(.billing-plan-option, .billing-methods label, .billing-order) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
}

html[data-theme="light"] body #billing-view :is(.billing-plan-option, .billing-methods label):has(input:checked) {
  border-color: var(--boba-border-strong) !important;
  background: var(--boba-brand-soft) !important;
  box-shadow: 0 0 0 2px rgba(150, 103, 25, .1) !important;
}

html[data-theme="light"] body #billing-view .billing-methods input[type="radio"] {
  border-color: #777066 !important;
  background: var(--boba-surface) !important;
}

html[data-theme="light"] body #billing-view .billing-methods input[type="radio"]:checked {
  border-color: var(--boba-brand) !important;
  background: radial-gradient(circle, var(--boba-brand) 0 4px, transparent 5px) !important;
}

html[data-theme="light"] body #billing-view .billing-methods input[type="radio"]:focus-visible {
  outline-color: rgba(150, 103, 25, .32) !important;
}

html[data-theme="light"] body #billing-view .billing-order-status {
  color: var(--boba-text) !important;
}

html[data-theme="light"] body #billing-view .billing-order-amount {
  color: var(--boba-brand-strong) !important;
}

html[data-theme="light"] body #billing-view .billing-method-price,
html[data-theme="light"] body #billing-view .billing-price-summary > .billing-price-total b {
  color: var(--boba-brand-strong);
}

html[data-theme="light"] body #billing-view .billing-price-summary {
  border-color: rgba(166, 108, 8, 0.3);
  background: var(--boba-brand-soft);
}

html[data-theme="light"] body #billing-view .billing-price-summary b {
  color: var(--boba-text);
}

html[data-theme="light"] body #billing-view .billing-price-summary small,
html[data-theme="light"] body #billing-view .billing-plan-price-label,
html[data-theme="light"] body #billing-view .billing-order-fee {
  color: var(--boba-text-muted);
}

html[data-theme="light"] body #billing-view .billing-order-fee-warning {
  color: #9a5a00;
}

html[data-theme="light"] body #billing-view .billing-order-meta,
html[data-theme="light"] body #billing-view .billing-instruction-row span {
  color: var(--boba-text-tertiary) !important;
}

html[data-theme="light"] body #billing-view .billing-instructions {
  border-color: rgba(40, 121, 75, .22) !important;
  color: #235c3b !important;
  background: var(--boba-success-soft) !important;
}

html[data-theme="light"] body #billing-view .billing-instructions strong,
html[data-theme="light"] body #billing-view .billing-account-number,
html[data-theme="light"] body #billing-view .billing-auto-renew-note {
  color: #1f693f !important;
}

html[data-theme="light"] body #billing-view .billing-auto-renew-note {
  border-top-color: rgba(40, 121, 75, .2) !important;
}

html[data-theme="light"] body #app-shell .sidebar .sidebar-user.is-expiring {
  border-color: var(--boba-border-strong) !important;
  background: #fffaf0 !important;
}

html[data-theme="light"] body #app-shell .sidebar .sidebar-user.is-expired {
  border-color: rgba(182, 69, 64, .46) !important;
  background: #fff7f6 !important;
}

html[data-theme="light"] body #app-shell .sidebar .sidebar-renewal-alert {
  color: #70490e !important;
  background: var(--boba-warning-soft) !important;
}

html[data-theme="light"] body #app-shell .sidebar .sidebar-user.is-expired .sidebar-renewal-alert {
  color: #983a36 !important;
  background: var(--boba-danger-soft) !important;
}

html[data-theme="light"] body #app-shell .sidebar .sidebar-member-btn.is-renewal-urgent {
  border-color: var(--boba-brand-strong) !important;
  color: #fffaf1 !important;
  background: var(--boba-brand-strong) !important;
  box-shadow: 0 8px 20px rgba(112, 73, 14, .16) !important;
}

html[data-theme="light"] body #app-shell .sidebar .sidebar-member-btn.is-renewal-urgent:hover {
  color: #fffaf1 !important;
  background: #815711 !important;
}

/* Sidebar toggle v15: collapse and reopen stay at the same left-top anchor. */
body:not(.mobile-mode) #app-shell .sidebar-reopen-btn {
  position: fixed !important;
  top: 14px !important;
  right: auto !important;
  left: 13px !important;
  width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  border: 1px solid var(--boba-border-strong) !important;
  border-radius: var(--boba-radius-control) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-surface-raised) !important;
  background-image: none !important;
  box-shadow: none !important;
}

body:not(.mobile-mode) #app-shell .sidebar-reopen-btn:is(:hover, :focus-visible) {
  border-color: var(--boba-brand) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-brand-soft) !important;
}

html[data-theme="light"] body:not(.mobile-mode) #app-shell .sidebar-reopen-btn {
  border-color: var(--boba-border) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-surface) !important;
}

/* High-specificity light theme overrides for legacy ID-scoped dark rules. */
html[data-theme="light"] body,
html[data-theme="light"] body #app-shell,
html[data-theme="light"] body #app-shell .main-panel,
html[data-theme="light"] body #customers-view,
html[data-theme="light"] body #products-view,
html[data-theme="light"] body #comments-view,
html[data-theme="light"] body #trends-view,
html[data-theme="light"] body #lottery-view,
html[data-theme="light"] body #facebook-pages-view,
html[data-theme="light"] body #facebook-message-settings-view,
html[data-theme="light"] body #tiktok-settings-view {
  color: var(--theme-text) !important;
  background: var(--theme-bg) !important;
}

html[data-theme="light"] body #app-shell .sidebar {
  border-color: var(--theme-line) !important;
  color: var(--theme-text-2) !important;
  background: var(--theme-sidebar) !important;
}

html[data-theme="light"] body #app-shell .sidebar :is(h2, strong, .ui-label, .sidebar-user-email) {
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #app-shell .sidebar .nav-item.active :is(.ui-label, .ui-icon) {
  color: #f2d695 !important;
}

html[data-theme="light"] body #app-shell .sidebar :is(.sidebar-kicker, .nav-group-label, .sidebar-user-name, .sidebar-user-device) {
  color: var(--theme-muted) !important;
}

html[data-theme="light"] body #customers-view :is(.customer-detail-card, .customer-summary-strip),
html[data-theme="light"] body #products-view .product-detail-card,
html[data-theme="light"] body #trends-view .trends-section,
html[data-theme="light"] body #lottery-view .lottery-card,
html[data-theme="light"] body #facebook-pages-view .content-card,
html[data-theme="light"] body #facebook-message-settings-view .content-card,
html[data-theme="light"] body #tiktok-settings-view :is(.content-card, .platform-connection-note) {
  border-color: var(--theme-line) !important;
  color: var(--theme-text-2) !important;
  background: var(--theme-surface) !important;
  box-shadow: 0 12px 32px var(--theme-shadow) !important;
}

html[data-theme="light"] body #customers-view :is(input, select, button),
html[data-theme="light"] body #products-view :is(input, select, button),
html[data-theme="light"] body #app-shell .main-panel :is(input, select, textarea) {
  border-color: var(--theme-line) !important;
  color: var(--theme-text) !important;
  background-color: var(--theme-input) !important;
}

html[data-theme="light"] body #customers-view .customer-record-item,
html[data-theme="light"] body #products-view .product-category-item {
  color: var(--theme-text-2) !important;
  background: transparent !important;
}

html[data-theme="light"] body #customers-view .customer-record-item.active,
html[data-theme="light"] body #products-view .product-category-item.active {
  background: var(--theme-selected) !important;
}

html[data-theme="light"] body #customers-view :is(.customer-record-name, .customer-record-meta, .comment-source),
html[data-theme="light"] body #products-view :is(.product-category-main strong, .product-buyer-head strong, .product-buyer-meta strong) {
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #customers-view :is(.customer-record-preview, .customer-record-sub, .customer-record-time, .status-text, .customer-table-head),
html[data-theme="light"] body #products-view :is(.product-category-main span, .product-category-customers, .product-category-time, .status-text, .product-table-head, .product-buyer-head span, .product-buyer-meta span) {
  color: var(--theme-muted) !important;
}

html[data-theme="light"] body #customers-view :is(.customer-reference-stats, .customer-summary-strip),
html[data-theme="light"] body #products-view .product-detail-stats {
  background: var(--theme-surface-2) !important;
}

html[data-theme="light"] body #customers-view .customer-detail-card :is(h3, h4, strong, .detail-latest-message),
html[data-theme="light"] body #products-view .product-detail-card :is(h3, h4, strong) {
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #customers-view .customer-detail-card .customer-name-label,
html[data-theme="light"] body #products-view .product-detail-card .section-kicker {
  color: var(--theme-gold) !important;
}

html[data-theme="light"] body #customers-view .customer-detail-card,
html[data-theme="light"] body #products-view .product-detail-card {
  scrollbar-color: #b8ae9e transparent;
}

html[data-theme="light"] body #comments-view :is(.comments-list-card, .ingest-card, .comment-item),
html[data-theme="light"] body #trends-view :is(.trends-summary-item, .trends-table-wrap),
html[data-theme="light"] body #lottery-view :is(.lottery-stage, .lottery-list-panel) {
  border-color: var(--theme-line) !important;
  color: var(--theme-text-2) !important;
  background: var(--theme-surface) !important;
}

/* Additional density reduction after the typography increase. */
#customers-view .customer-record-item,
#products-view .product-category-item {
  min-height: 50px !important;
  padding-top: 4px !important;
  padding-bottom: 4px !important;
}

#customers-view .customer-record-main,
#products-view .product-category-main {
  gap: 0 !important;
}

#customers-view .customer-record-preview,
#customers-view .customer-record-sub,
#products-view .product-category-main > span {
  line-height: 1.2 !important;
}

/* Light theme: complete legacy dark-surface conversion and readable contrast. */
html[data-theme="light"] body #comments-view .comments-health-card,
html[data-theme="light"] body #comments-view .tools-header,
html[data-theme="light"] body #comments-view .ingest-key-card,
html[data-theme="light"] body #comments-view > .content-card {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  box-shadow: 0 8px 24px var(--theme-shadow) !important;
}

html[data-theme="light"] body #comments-view .comments-health-copy strong,
html[data-theme="light"] body #comments-view .ingest-key-card h2,
html[data-theme="light"] body #comments-view :is(.comment-user, .comment-text) {
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #comments-view :is(.comments-health-copy small, .comments-health-detail, .comment-time, .comment-meta, .status-text, .ingest-key-description) {
  color: var(--theme-muted) !important;
}

html[data-theme="light"] body #comments-view .comment-card {
  border-bottom-color: #e3ded5 !important;
  background: transparent !important;
}

html[data-theme="light"] body #comments-view .comment-card:hover {
  background: #faf8f4 !important;
}

html[data-theme="light"] body #comments-view :is(.platform-filter, .language-switcher) {
  border-color: var(--theme-line) !important;
  color: var(--theme-text-2) !important;
  background: var(--theme-surface-2) !important;
}

html[data-theme="light"] body #comments-view .platform-filter.active {
  border-color: #b58a3b !important;
  color: #fff !important;
  background: #9a6b1d !important;
}

html[data-theme="light"] body #comments-view .platform-filter-row {
  border-color: #e5dfd5 !important;
}

html[data-theme="light"] body #trends-view .trends-summary-band,
html[data-theme="light"] body #trends-view .trends-summary-item,
html[data-theme="light"] body #trends-view .trends-section,
html[data-theme="light"] body #trends-view .trends-table-wrap {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #trends-view :is(.trends-summary-item strong, .trends-section-head h3, .trends-table tbody td, .trends-table .order-id-cell) {
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #trends-view :is(.trends-summary-item span, .trends-section-head span, .trends-table thead th, .trends-table .order-message-cell, .trends-table .order-time-cell) {
  color: var(--theme-muted) !important;
}

html[data-theme="light"] body #trends-view .trends-table :is(th, td),
html[data-theme="light"] body #trends-view .trends-section-head {
  border-color: #e5dfd5 !important;
}

html[data-theme="light"] body #lottery-view :is(.lottery-card, .lottery-stage, .summary-card, .lottery-list-panel, .lottery-entry) {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #lottery-view .lottery-stage {
  background: radial-gradient(circle at 50% 10%, #f2e5c8, transparent 58%), #faf8f3 !important;
}

html[data-theme="light"] body #lottery-view :is(.lottery-marquee-name, .lottery-winner-display strong, .lottery-list-head h3, .lottery-entry-head strong, .lottery-entry p) {
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #lottery-view :is(.lottery-stage-label, .lottery-marquee-meta, .lottery-list-head, .lottery-entry-head span, .lottery-entry-meta, .status-text) {
  color: var(--theme-muted) !important;
}

html[data-theme="light"] body #lottery-view .check-pill {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-2) !important;
  color: var(--theme-text-2) !important;
}

html[data-theme="light"] body #lottery-view .lottery-entry.winner {
  border-color: #87c39f !important;
  background: linear-gradient(135deg, #e4f4e9, #fff 60%) !important;
}

html[data-theme="light"] body #facebook-pages-view .facebook-pages-toolbar {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
}

html[data-theme="light"] body #facebook-pages-view :is(.facebook-pages-summary, .facebook-page-row) {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-2) !important;
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #facebook-pages-view :is(.facebook-summary-metric strong, .facebook-page-name, .facebook-page-status) {
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #facebook-pages-view :is(.facebook-summary-metric span, .facebook-page-id, .facebook-page-meta, .facebook-page-tasks) {
  color: var(--theme-muted) !important;
}

html[data-theme="light"] body #facebook-pages-view .facebook-summary-metric + .facebook-summary-metric {
  border-color: var(--theme-line) !important;
}

html[data-theme="light"] body #facebook-pages-view .facebook-page-row.is-connected {
  border-color: #9ac5a8 !important;
  background: #f3faf5 !important;
}

html[data-theme="light"] body #facebook-pages-view .facebook-page-chip {
  border-color: #d8c59e !important;
  color: #71501a !important;
  background: #f7efdf !important;
}

html[data-theme="light"] body #facebook-message-settings-view {
  --message-surface: #ffffff;
  --message-input: #fbfaf7;
  --message-border: #d9d3c8;
  --message-border-strong: #bdb5a8;
  --message-text: #24221f;
  --message-muted: #68635c;
  --message-accent: #9a6b1d;
}

html[data-theme="light"] body #facebook-message-settings-view :is(.facebook-message-setting-block, .facebook-message-variables) {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #facebook-message-settings-view :is(.facebook-message-setting-heading h2, .facebook-message-variables h2, .facebook-message-template-label) {
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #facebook-message-settings-view :is(.facebook-message-settings-subtitle, .facebook-message-setting-heading p, .facebook-message-template-meta, .facebook-message-variable-list span, #facebook-message-settings-status) {
  color: var(--theme-muted) !important;
}

html[data-theme="light"] body #facebook-message-settings-view :is(.facebook-message-template, .facebook-message-variable-list code) {
  border-color: var(--theme-line) !important;
  background: #fbfaf7 !important;
  color: var(--theme-text) !important;
}

html[data-theme="light"] body #facebook-message-settings-view .facebook-message-toggle {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface-2) !important;
  color: var(--theme-text-2) !important;
}

html[data-theme="light"] body #tiktok-settings-view .platform-toggle {
  border-color: #b9d8e8 !important;
  background: #f1f8fb !important;
  color: #31576b !important;
}

html[data-theme="light"] body #tiktok-settings-view :is(.platform-connection-card p, .platform-connection-note p, .status-text) {
  color: var(--theme-text-2) !important;
}

html[data-theme="light"] body #app-shell .main-panel ::placeholder {
  color: #817b72 !important;
  opacity: 1 !important;
}

html[data-theme="light"] body #app-shell .sidebar .nav-item.active :is(.ui-label, .ui-icon) {
  color: #62440f !important;
}

html[data-theme="light"] body #app-shell .sidebar :is(.sidebar-user-card, .sidebar-account-card) {
  border-color: var(--theme-line) !important;
  background: var(--theme-surface) !important;
  color: var(--theme-text-2) !important;
}

html[data-theme="light"] body #comments-view .comment-source {
  border-color: #d8c59e !important;
  background: #f7efdf !important;
  color: #71501a !important;
}

html[data-theme="light"] body #comments-view .comment-side :is(time, .comment-time) {
  color: #69635b !important;
}

/* P0 interface-design pass: one live-print workbench across representative views. */
html {
  font-family: var(--boba-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body,
button,
input,
select,
textarea {
  font-family: var(--boba-font) !important;
}

body,
.main-panel,
.sidebar {
  background: var(--boba-canvas) !important;
}

.main-panel {
  color: var(--boba-text) !important;
}

.sidebar {
  border-right: 1px solid var(--boba-border) !important;
}

.view-panel > .page-header h1,
#comments-view .comments-page-intro h1 {
  color: var(--boba-text) !important;
  font-size: 30px !important;
  font-weight: 720 !important;
  line-height: 1.2 !important;
  letter-spacing: -.025em !important;
  text-wrap: balance;
}

.view-panel :is(p, .status-text, .facebook-message-settings-subtitle) {
  text-wrap: pretty;
}

.nav-group-label {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  letter-spacing: .08em !important;
}

.sidebar-nav .nav-item {
  min-height: var(--boba-control-height) !important;
  border: 1px solid transparent !important;
  border-radius: var(--boba-radius-control) !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  font-size: 15px !important;
  transition: background-color 140ms cubic-bezier(.23, 1, .32, 1), color 140ms cubic-bezier(.23, 1, .32, 1), border-color 140ms cubic-bezier(.23, 1, .32, 1);
}

.sidebar-nav .nav-item:hover {
  color: var(--boba-text) !important;
  background: var(--boba-surface) !important;
}

.sidebar-nav .nav-item.active {
  border-color: var(--boba-border-strong) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-brand-soft) !important;
  box-shadow: none !important;
}

.sidebar-nav .nav-item.disabled {
  color: var(--boba-text-disabled) !important;
  opacity: .72;
}

:is(button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--boba-brand) !important;
  outline-offset: 2px !important;
}

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

:is(.ghost-btn, .primary-btn, .danger-btn, .icon-btn) {
  min-height: var(--boba-control-height) !important;
  border-radius: var(--boba-radius-control) !important;
  font-size: 14px !important;
  font-weight: 650 !important;
  box-shadow: none !important;
  transition: background-color 140ms cubic-bezier(.23, 1, .32, 1), color 140ms cubic-bezier(.23, 1, .32, 1), border-color 140ms cubic-bezier(.23, 1, .32, 1), transform 100ms cubic-bezier(.23, 1, .32, 1);
}

.ghost-btn,
.icon-btn {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
}

.ghost-btn:hover,
.icon-btn:hover {
  border-color: var(--boba-border-strong) !important;
  color: var(--boba-text) !important;
  background: var(--boba-surface-raised) !important;
}

.primary-btn {
  border-color: var(--boba-brand) !important;
  color: #17120a !important;
  background: var(--boba-brand) !important;
}

.content-card,
.customer-summary-strip,
.customer-detail-card,
.product-detail-card,
.facebook-message-setting-block,
.facebook-message-variables {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

/* Live comments: the queue wins; system health becomes one compact rail. */
#comments-view .comments-page-intro {
  padding: 0 0 var(--boba-space-3) !important;
}

#comments-view .comments-health-strip {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0 !important;
  margin: 0 0 var(--boba-space-3) !important;
  overflow: hidden;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  background: var(--boba-surface) !important;
}

#comments-view .comments-health-card {
  grid-template-columns: 32px minmax(0, 1fr) auto !important;
  gap: var(--boba-space-2) !important;
  min-height: 56px !important;
  padding: var(--boba-space-2) var(--boba-space-3) !important;
  border: 0 !important;
  border-right: 1px solid var(--boba-border) !important;
  border-radius: 0 !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  box-shadow: none !important;
}

#comments-view .comments-health-card:last-child {
  border-right: 0 !important;
}

#comments-view .comments-health-icon {
  width: 32px !important;
  height: 32px !important;
  border-radius: var(--boba-radius-control) !important;
  font-size: 15px !important;
}

#comments-view .comments-health-copy small {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
  line-height: 1.2 !important;
}

#comments-view .comments-health-copy strong {
  color: var(--boba-text) !important;
  font-size: 14px !important;
  font-weight: 650 !important;
}

#comments-view .comments-health-detail,
#comments-view .status-text {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
}

#comments-view .comments-health-detail {
  white-space: nowrap;
}

#comments-view .tools-header {
  min-height: 0 !important;
  margin: 0 0 var(--boba-space-3) !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#comments-view .keyword-tools {
  display: grid !important;
  grid-template-columns: minmax(420px, 620px) minmax(0, 1fr) auto !important;
  align-items: center !important;
  gap: var(--boba-space-3) !important;
  min-height: 52px;
  padding: var(--boba-space-1) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  background: var(--boba-surface) !important;
}

#comments-view .keyword-primary-tools {
  display: flex !important;
  width: 100% !important;
  min-width: 0 !important;
  gap: var(--boba-space-2) !important;
}

#comments-view .keyword-primary-tools #keyword {
  flex: 1 1 auto !important;
  width: auto !important;
  min-width: 260px !important;
}

#comments-view .comment-utility-tools {
  display: flex !important;
  grid-column: 3 !important;
  justify-self: end !important;
  width: auto !important;
}

#comments-view :is(#keyword, #language-select) {
  min-height: var(--boba-control-height) !important;
  border-color: transparent !important;
  border-radius: var(--boba-radius-control) !important;
  color: var(--boba-text) !important;
  background: var(--boba-control) !important;
  font-size: 14px !important;
}

#comments-view .language-switcher {
  display: flex !important;
  align-items: center !important;
  gap: var(--boba-space-2) !important;
  min-height: var(--boba-control-height) !important;
  margin-left: 0 !important;
  padding: 0 0 0 var(--boba-space-2) !important;
  border: 0 !important;
  background: transparent !important;
}

#comments-view .language-switcher span {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
}

#comments-view .language-switcher #language-select {
  width: 168px !important;
  min-width: 168px !important;
  padding: 0 36px 0 var(--boba-space-3) !important;
}

#app-shell .sidebar .sidebar-user,
html[data-theme="light"] body #app-shell .sidebar .sidebar-user {
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

#app-shell .sidebar :is(.sidebar-user-label, .sidebar-user-device),
html[data-theme="light"] body #app-shell .sidebar :is(.sidebar-user-label, .sidebar-user-device) {
  color: var(--boba-text-tertiary) !important;
}

#app-shell .sidebar .sidebar-user-name,
html[data-theme="light"] body #app-shell .sidebar .sidebar-user-name {
  color: var(--boba-text) !important;
}

#app-shell .sidebar .sidebar-user-email,
html[data-theme="light"] body #app-shell .sidebar .sidebar-user-email {
  color: var(--boba-text-secondary) !important;
}

#app-shell .sidebar .sidebar-meta-chip,
html[data-theme="light"] body #app-shell .sidebar .sidebar-meta-chip {
  border-color: var(--boba-border-strong) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-brand-soft) !important;
}

#comments-view > .content-card {
  padding: var(--boba-space-3) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

#comments-view .platform-filter-row {
  min-height: 48px;
  border-bottom-color: var(--boba-border) !important;
}

#comments-view .platform-filter {
  min-height: 40px !important;
  border-color: var(--boba-border) !important;
  border-radius: var(--boba-radius-control) !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  font-size: 13px !important;
}

#comments-view .platform-filter:hover {
  color: var(--boba-text) !important;
  background: var(--boba-surface-raised) !important;
}

#comments-view .platform-filter.active {
  border-color: var(--boba-border-strong) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-brand-soft) !important;
}

#comments-view .comment-card {
  min-height: 68px !important;
  padding: var(--boba-space-3) var(--boba-space-2) !important;
  border-bottom: 1px solid var(--boba-border) !important;
  background: transparent !important;
}

#comments-view .comment-card:hover {
  background: var(--boba-surface-raised) !important;
}

#comments-view :is(.comment-user, .comment-text) {
  color: var(--boba-text) !important;
  font-size: 14px !important;
}

#comments-view :is(.comment-time, .comment-meta) {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
  font-variant-numeric: tabular-nums;
}

#comments-view .order-btn {
  min-width: 104px !important;
  min-height: var(--boba-control-height) !important;
  border: 1px solid color-mix(in srgb, var(--boba-success) 45%, transparent) !important;
  border-radius: var(--boba-radius-control) !important;
  color: #fff !important;
  background: var(--boba-success) !important;
  box-shadow: none !important;
  font-size: 14px !important;
}

#comments-view .order-btn.order-btn-completed {
  border-color: color-mix(in srgb, var(--boba-danger) 50%, transparent) !important;
  background: var(--boba-danger) !important;
}

#comments-view .order-btn.order-btn-reprint {
  border-color: color-mix(in srgb, var(--boba-warning) 50%, transparent) !important;
  color: #241507 !important;
  background: var(--boba-warning) !important;
}

#comments-view .ingest-key-card {
  margin-top: var(--boba-space-3) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  box-shadow: none !important;
}

#comments-view .ingest-key-summary {
  min-height: 52px !important;
  padding: var(--boba-space-2) var(--boba-space-3) !important;
}

/* Records: readable dense list with a quiet, stable detail rail. */
#customers-view .customer-toolbar,
#products-view .customer-toolbar {
  margin-bottom: var(--boba-space-4) !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#customers-view .customer-toolbar :is(input, select, button),
#products-view .customer-toolbar :is(input, select, button) {
  min-height: var(--boba-control-height) !important;
  height: var(--boba-control-height) !important;
  border-color: var(--boba-border) !important;
  border-radius: var(--boba-radius-control) !important;
  color: var(--boba-text) !important;
  background: var(--boba-control) !important;
  font-size: 13px !important;
}

#customers-view .customer-summary-strip {
  min-height: 92px !important;
  margin-bottom: var(--boba-space-5) !important;
  padding: var(--boba-space-3) var(--boba-space-2) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  background: var(--boba-surface) !important;
}

#customers-view .customer-summary-cell span {
  color: var(--boba-text-tertiary) !important;
  font-size: 13px !important;
}

#customers-view .customer-summary-cell strong {
  color: var(--boba-brand-strong) !important;
  font-size: 28px !important;
  font-variant-numeric: tabular-nums;
}

#customers-view .customer-layout.drawer-open,
#products-view .product-layout {
  gap: var(--boba-space-4) !important;
}

#customers-view .customer-table-head,
#products-view .product-table-head {
  min-height: 40px !important;
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
}

#customers-view .customer-record-item,
#products-view .product-category-item {
  min-height: 64px !important;
  padding: var(--boba-space-2) var(--boba-space-3) !important;
  border-radius: var(--boba-radius-control) !important;
  color: var(--boba-text-secondary) !important;
}

#customers-view .customer-record-item:hover,
#products-view .product-category-item:hover {
  background: var(--boba-surface) !important;
}

#customers-view .customer-record-item.active,
#products-view .product-category-item.active {
  background: var(--boba-selected) !important;
}

#customers-view .customer-record-name,
#products-view .product-category-main strong {
  color: var(--boba-text) !important;
  font-size: 14px !important;
  font-weight: 650 !important;
}

#customers-view :is(.customer-record-preview, .customer-record-sub, .customer-record-time, .comment-source, .customer-record-meta),
#products-view :is(.product-category-main > span, .product-category-customers, .product-category-time) {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

#customers-view .customer-record-time,
#products-view .product-category-time {
  font-variant-numeric: tabular-nums;
}

#customers-view .customer-detail-card,
#products-view .product-detail-card {
  padding: var(--boba-space-4) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

#customers-view .customer-tab-btn {
  min-height: 40px !important;
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
}

#customers-view .customer-tab-btn.active {
  border-bottom-color: var(--boba-brand) !important;
  color: var(--boba-brand-strong) !important;
}

#customers-view :is(.customer-detail-card, .customer-drawer-body, .customer-tab-panel),
#products-view :is(.product-detail-card, .product-category-detail) {
  font-size: 13px !important;
  line-height: 1.5 !important;
}

#customers-view :is(.customer-name-label, .customer-reference-stats span, .customer-reference-order),
#products-view :is(.section-kicker, .product-detail-code, .product-detail-alerts, .product-detail-stats .mini-stat span, .product-buyer-head span, .product-buyer-meta span) {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

#customers-view :is(.customer-name-row h3, .customer-reference-stats strong, .customer-reference-order strong),
#products-view :is(.product-detail-head h3, .product-detail-stats .mini-stat strong, .product-buyer-head strong, .product-buyer-meta strong) {
  color: var(--boba-text) !important;
}

#customers-view .customer-reference-order strong,
#products-view :is(.product-buyer-head strong, .product-buyer-meta strong) {
  font-size: 13px !important;
}

#customers-view .customer-status-pill {
  min-height: 32px !important;
  padding: 6px 10px !important;
  font-size: 12px !important;
}

#products-view .product-buyer-item {
  min-height: 52px !important;
  padding: var(--boba-space-2) !important;
}

#products-view .product-detail-head .ghost-btn,
#customers-view :is(.detail-inline-actions, .customer-link-row) .ghost-btn,
.view-panel .mini-action-btn {
  min-height: 40px !important;
  padding: 8px 12px !important;
  border-radius: var(--boba-radius-control) !important;
  font-size: 13px !important;
}

.view-panel :is(.field > span, .workbench-date-field, .facebook-message-template-label) {
  color: var(--boba-text-secondary) !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

.view-panel :is(.status-text, .empty-state) {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}

.view-panel :is(time, .comment-time, .customer-record-time, .product-category-time, .trends-table .order-time-cell) {
  font-variant-numeric: tabular-nums;
}

/* Facebook messages: editors and helper data share one surface language. */
#facebook-message-settings-view .facebook-message-settings-card {
  display: grid !important;
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  gap: var(--boba-space-4) !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#facebook-message-settings-view :is(.facebook-message-setting-block, .facebook-message-variables) {
  padding: var(--boba-space-5) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

#facebook-message-settings-view .facebook-message-variables,
#facebook-message-settings-view #facebook-message-settings-status {
  grid-column: 1 / -1;
}

#facebook-message-settings-view :is(.facebook-message-setting-heading h2, .facebook-message-variables h2, .facebook-message-template-label) {
  color: var(--boba-text) !important;
}

#facebook-message-settings-view .facebook-message-setting-heading h2 {
  font-size: 18px !important;
}

#facebook-message-settings-view :is(.facebook-message-setting-heading p, .facebook-message-template-meta, .facebook-message-variable-list span, .facebook-message-settings-subtitle) {
  color: var(--boba-text-tertiary) !important;
  font-size: 13px !important;
  line-height: 1.55 !important;
}

#facebook-message-settings-view .facebook-message-template {
  min-height: 164px !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-control) !important;
  color: var(--boba-text) !important;
  background: var(--boba-control) !important;
  font-size: 14px !important;
  line-height: 1.55 !important;
  box-shadow: none !important;
}

#facebook-message-settings-view .facebook-message-setting-block:nth-child(2) .facebook-message-template {
  min-height: 164px !important;
}

#facebook-message-settings-view .facebook-message-toggle {
  min-height: var(--boba-control-height) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: 999px !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface-raised) !important;
}

#facebook-message-settings-view .facebook-message-variable-list code {
  border-color: var(--boba-border) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-control) !important;
}

html[data-theme="light"] body :is(.content-card, .customer-summary-strip, .customer-detail-card, .product-detail-card, .facebook-message-setting-block, .facebook-message-variables),
html[data-theme="light"] body #comments-view :is(.comments-health-strip, .keyword-tools, .ingest-key-card) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #comments-view :is(.comment-user, .comment-text, .comments-health-copy strong),
html[data-theme="light"] body #facebook-message-settings-view :is(h1, h2, .facebook-message-template-label),
html[data-theme="light"] body #customers-view :is(h1, h3, .customer-record-name) {
  color: var(--boba-text) !important;
}

/* P1 all-view convergence: lottery, trends, Facebook pages and TikTok. */
#lottery-view,
#trends-view,
#facebook-pages-view,
#tiktok-settings-view {
  color: var(--boba-text-secondary) !important;
}

#lottery-view .lottery-card {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#lottery-view .lottery-stage {
  min-height: 176px !important;
  border: 1px solid var(--boba-border-strong) !important;
  border-radius: var(--boba-radius-panel) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface-raised) !important;
  box-shadow: none !important;
}

#lottery-view :is(.lottery-marquee-name, .lottery-winner-display strong) {
  color: var(--boba-brand-strong) !important;
  font-variant-numeric: tabular-nums;
}

#lottery-view :is(.lottery-stage-label, .lottery-marquee-meta, .lottery-winner-display small) {
  color: var(--boba-text-tertiary) !important;
  font-size: 13px !important;
}

#lottery-view .lottery-control-grid {
  gap: var(--boba-space-3) !important;
  margin-top: var(--boba-space-4) !important;
}

#lottery-view .lottery-control-grid :is(input, select),
#lottery-view .lottery-option-row :is(button, .check-pill) {
  min-height: var(--boba-control-height) !important;
  border-color: var(--boba-border) !important;
  border-radius: var(--boba-radius-control) !important;
  color: var(--boba-text) !important;
  background: var(--boba-control) !important;
  font-size: 14px !important;
}

#lottery-view .lottery-stat-grid {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0 !important;
  overflow: hidden;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  background: var(--boba-surface) !important;
}

#lottery-view .summary-card {
  min-height: 80px !important;
  border: 0 !important;
  border-right: 1px solid var(--boba-border) !important;
  border-radius: 0 !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  box-shadow: none !important;
}

#lottery-view .summary-card:last-child {
  border-right: 0 !important;
}

#lottery-view .summary-card strong {
  color: var(--boba-brand-strong) !important;
  font-variant-numeric: tabular-nums;
}

#lottery-view .lottery-layout {
  gap: var(--boba-space-4) !important;
}

#lottery-view .lottery-list-panel {
  overflow: hidden;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

#lottery-view .lottery-list-head {
  min-height: 52px !important;
  border-bottom-color: var(--boba-border) !important;
}

#lottery-view .lottery-entry {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  box-shadow: none !important;
}

#lottery-view .lottery-entry.winner {
  border-color: color-mix(in srgb, var(--boba-success) 35%, transparent) !important;
  background: var(--boba-success-soft) !important;
}

#trends-view .trends-summary-band {
  display: grid !important;
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 0 !important;
  overflow: hidden;
  margin-bottom: var(--boba-space-4) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  background: var(--boba-surface) !important;
}

#trends-view .trends-summary-item {
  min-height: 92px !important;
  padding: var(--boba-space-4) var(--boba-space-5) !important;
  border: 0 !important;
  border-right: 1px solid var(--boba-border) !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
}

#trends-view .trends-summary-item:last-child {
  border-right: 0 !important;
}

#trends-view .trends-summary-item span {
  color: var(--boba-text-tertiary) !important;
  font-size: 13px !important;
}

#trends-view .trends-summary-item strong {
  color: var(--boba-brand-strong) !important;
  font-size: 28px !important;
  font-variant-numeric: tabular-nums;
}

#trends-view .trends-section {
  margin-bottom: var(--boba-space-4) !important;
  padding: var(--boba-space-4) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

#trends-view .trends-section-head {
  min-height: 44px;
  margin-bottom: var(--boba-space-3) !important;
  border-bottom: 1px solid var(--boba-border) !important;
}

#trends-view .trends-section-head h3 {
  color: var(--boba-text) !important;
  font-size: 18px !important;
}

#trends-view .trends-section-head span {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
}

#trends-view .trends-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-control) !important;
  background: var(--boba-surface) !important;
}

#trends-view .trends-table th {
  height: 44px !important;
  color: var(--boba-text-tertiary) !important;
  background: var(--boba-surface-raised) !important;
  font-size: 12px !important;
}

#trends-view .trends-table td {
  min-height: 52px !important;
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  font-size: 13px !important;
}

#trends-view .trends-table :is(.order-id-cell, .order-customer-cell) {
  color: var(--boba-text) !important;
}

#facebook-pages-view .facebook-pages-toolbar {
  display: grid !important;
  grid-template-columns: minmax(240px, .8fr) minmax(360px, 1.2fr) !important;
  gap: var(--boba-space-4) !important;
  margin-bottom: var(--boba-space-3) !important;
  padding: var(--boba-space-3) var(--boba-space-4) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

#facebook-pages-view .facebook-pages-card {
  min-height: 320px !important;
  padding: var(--boba-space-4) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

#facebook-pages-view .facebook-pages-summary {
  overflow: hidden;
  margin-bottom: var(--boba-space-4) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-control) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface-raised) !important;
}

#facebook-pages-view .facebook-summary-metric + .facebook-summary-metric {
  border-color: var(--boba-border) !important;
}

#facebook-pages-view .facebook-summary-metric span,
#facebook-pages-view :is(.facebook-page-id, .facebook-page-meta, .facebook-page-tasks) {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
}

#facebook-pages-view :is(.facebook-summary-metric strong, .facebook-page-name, .facebook-page-status) {
  color: var(--boba-text) !important;
}

#facebook-pages-view :is(.facebook-page-item, .facebook-page-row) {
  min-height: 68px !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-control) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface-raised) !important;
  box-shadow: none !important;
}

#facebook-pages-view :is(.facebook-page-item, .facebook-page-row).is-connected {
  border-color: color-mix(in srgb, var(--boba-success) 35%, transparent) !important;
  background: var(--boba-success-soft) !important;
}

#tiktok-settings-view .platform-connection-grid-single,
#tiktok-settings-view .platform-connection-note {
  width: 100%;
  max-width: 920px !important;
}

#tiktok-settings-view :is(.platform-connection-card, .platform-connection-note) {
  padding: var(--boba-space-5) !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

#tiktok-settings-view .platform-connection-card :is(h2, h3) {
  color: var(--boba-text) !important;
}

#tiktok-settings-view .platform-connection-card p,
#tiktok-settings-view .platform-connection-note p {
  color: var(--boba-text-secondary) !important;
  font-size: 14px !important;
  line-height: 1.6 !important;
}

#tiktok-settings-view .platform-connection-card input:not([type]),
#tiktok-settings-view .platform-connection-card input[type="text"] {
  min-height: var(--boba-control-height) !important;
  border-color: var(--boba-border) !important;
  border-radius: var(--boba-radius-control) !important;
  color: var(--boba-text) !important;
  background: var(--boba-control) !important;
  font-size: 14px !important;
}

#tiktok-settings-view .platform-toggle {
  min-height: var(--boba-control-height) !important;
  border-color: var(--boba-border) !important;
  border-radius: var(--boba-radius-card) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface-raised) !important;
}

html[data-theme="light"] body #lottery-view :is(.lottery-stage, .summary-card, .lottery-list-panel, .lottery-entry),
html[data-theme="light"] body #trends-view :is(.trends-summary-band, .trends-summary-item, .trends-section, .trends-table-wrap),
html[data-theme="light"] body #facebook-pages-view :is(.facebook-pages-toolbar, .facebook-pages-card, .facebook-pages-summary, .facebook-page-item, .facebook-page-row),
html[data-theme="light"] body #tiktok-settings-view :is(.platform-connection-card, .platform-connection-note) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #lottery-view :is(.lottery-stage, .summary-card),
html[data-theme="light"] body #trends-view :is(.trends-summary-item, .trends-table th),
html[data-theme="light"] body #facebook-pages-view :is(.facebook-pages-summary, .facebook-page-item, .facebook-page-row),
html[data-theme="light"] body #tiktok-settings-view .platform-toggle {
  background: var(--boba-surface-raised) !important;
}

@media (max-width: 1100px) {
  #comments-view .comments-health-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  #comments-view .comments-health-card:first-child {
    grid-column: 1 / -1;
    border-right: 0 !important;
    border-bottom: 1px solid var(--boba-border) !important;
  }

  #facebook-message-settings-view .facebook-message-settings-card {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #facebook-message-settings-view :is(.facebook-message-variables, #facebook-message-settings-status) {
    grid-column: auto;
  }

  #comments-view .keyword-tools {
    grid-template-columns: minmax(360px, 1fr) auto !important;
  }

  #comments-view .comment-utility-tools {
    grid-column: 2 !important;
  }
}

@media (max-width: 760px) {
  #facebook-pages-view .facebook-pages-toolbar,
  #trends-view .trends-summary-band,
  #lottery-view .lottery-stat-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #trends-view .trends-summary-item,
  #lottery-view .summary-card {
    border-right: 0 !important;
    border-bottom: 1px solid var(--boba-border) !important;
  }

  #trends-view .trends-summary-item:last-child,
  #lottery-view .summary-card:last-child {
    border-bottom: 0 !important;
  }

  #trends-view .trends-table {
    min-width: 720px;
  }

  #tiktok-settings-view :is(.platform-connection-card, .platform-connection-note) {
    padding: var(--boba-space-4) !important;
  }

  #comments-view .comments-health-strip {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #comments-view .comments-health-card,
  #comments-view .comments-health-card:first-child {
    grid-column: auto;
    border-right: 0 !important;
    border-bottom: 1px solid var(--boba-border) !important;
  }

  #comments-view .comments-health-card:last-child {
    border-bottom: 0 !important;
  }

  #comments-view .keyword-tools,
  #comments-view .keyword-primary-tools,
  #comments-view .comment-utility-tools {
    width: 100% !important;
  }

  #comments-view .keyword-tools {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  #comments-view .comment-utility-tools {
    grid-column: 1 !important;
    justify-self: stretch !important;
  }

  #comments-view .language-switcher {
    width: 100% !important;
  }

  #comments-view .language-switcher #language-select {
    flex: 1 1 auto !important;
    width: auto !important;
  }

  #comments-view .comment-card {
    min-height: 76px !important;
  }

  #comments-view .order-btn {
    min-width: 96px !important;
  }

  #facebook-message-settings-view :is(.facebook-message-setting-block, .facebook-message-variables) {
    padding: var(--boba-space-4) !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/*
 * Light surface matrix (terminal override).
 * Legacy view styles contain ID-scoped dark !important declarations. Keep this
 * final and explicit so every work surface follows one light-mode hierarchy:
 * canvas -> paper card -> inset control. Semantic action colors stay intact.
 */
html[data-theme="light"] body #app-shell .main-panel,
html[data-theme="light"] body #app-shell .main-panel .view-panel {
  color: var(--boba-text-secondary) !important;
  background: var(--boba-canvas) !important;
}

html[data-theme="light"] body #app-shell .main-panel .view-panel :is(
  .content-card,
  .comments-health-strip,
  .customer-summary-strip,
  .customer-list-card,
  .customer-detail-card,
  .product-category-card,
  .product-detail-card,
  .trends-summary-band,
  .trends-section,
  .facebook-pages-toolbar,
  .facebook-pages-card,
  .facebook-message-setting-block,
  .facebook-message-variables,
  .platform-connection-card,
  .platform-connection-note,
  .lottery-list-panel
) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel .view-panel :is(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .language-switcher,
  .facebook-message-toggle,
  .platform-toggle,
  .customer-tab-btn,
  .check-pill
) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text) !important;
  background: var(--boba-control) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel .view-panel :is(
  h1,
  h2,
  h3,
  h4,
  .comment-user,
  .comment-text,
  .customer-record-name,
  .product-category-main strong,
  .product-buyer-head strong,
  .facebook-page-name,
  .facebook-page-status
) {
  color: var(--boba-text) !important;
}

html[data-theme="light"] body #app-shell .main-panel .view-panel :is(
  .status-text,
  .empty-state,
  .comment-time,
  .customer-record-preview,
  .customer-record-sub,
  .customer-record-time,
  .product-category-customers,
  .product-category-time,
  .product-buyer-meta,
  .facebook-page-id,
  .facebook-page-meta,
  .facebook-page-tasks,
  .trends-subtitle
) {
  color: var(--boba-text-tertiary) !important;
}

/* Live comments: white paper list, warm inset toolbar, no black utility cards. */
html[data-theme="light"] body #app-shell .main-panel #comments-view :is(
  .keyword-tools,
  .tools-header,
  .comments-list-card,
  .comment-list,
  .ingest-key-card,
  .ingest-key-panel
) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #comments-view :is(.comment-card, .comments-health-card) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #comments-view .comment-card:hover {
  background: var(--boba-surface-raised) !important;
}

/* Customer records: the drawer and all nested data blocks remain light. */
html[data-theme="light"] body #app-shell .main-panel #customers-view :is(
  .customer-toolbar,
  .customer-table-head,
  .customer-record-list,
  .customer-record-item,
  .customer-drawer-shell,
  .customer-drawer-head,
  .customer-drawer-body,
  .customer-tab-panel,
  .detail-block,
  .customer-reference-recent,
  .customer-reference-order,
  .record-timeline,
  .timeline-item
) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #customers-view :is(
  .customer-summary-strip,
  .customer-reference-stats,
  .mini-stat,
  .customer-note,
  .detail-latest-message
) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface-raised) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #customers-view .customer-record-item:is(:hover, .active) {
  background: var(--boba-selected) !important;
}

html[data-theme="light"] body #app-shell .main-panel #customers-view .customer-tab-btn.active {
  border-bottom-color: var(--boba-brand) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-brand-soft) !important;
}

/* Product picking: list stays flat; detail rail uses paper and inset stats. */
html[data-theme="light"] body #app-shell .main-panel #products-view :is(
  .customer-toolbar,
  .product-table-head,
  .product-category-list,
  .product-category-item,
  .product-category-detail,
  .product-summary-list,
  .product-summary-item,
  .product-buyer-list,
  .product-buyer-item,
  .product-buyer-orders,
  .product-buyer-order
) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #products-view :is(
  .product-detail-stats,
  .mini-stat,
  .product-detail-alerts
) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface-raised) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #products-view :is(.product-category-item, .product-buyer-item):is(:hover, .active) {
  background: var(--boba-selected) !important;
}

/* Trends: one white report surface, warm header row, readable body rows. */
html[data-theme="light"] body #app-shell .main-panel #trends-view :is(
  .trends-summary-band,
  .trends-section,
  .trends-chart,
  .trends-table-wrap,
  .trends-table,
  .trends-table td
) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #trends-view :is(.trends-summary-item, .trends-table th) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-tertiary) !important;
  background: var(--boba-surface-raised) !important;
  background-image: none !important;
}

/* Facebook pages: remove the legacy charcoal metrics and connection rows. */
html[data-theme="light"] body #app-shell .main-panel #facebook-pages-view :is(
  .facebook-pages-summary,
  .facebook-summary-metric,
  .facebook-page-item,
  .facebook-page-row
) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface-raised) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #facebook-pages-view :is(.facebook-page-item, .facebook-page-row).is-connected {
  border-color: color-mix(in srgb, var(--boba-success) 35%, transparent) !important;
  background: var(--boba-success-soft) !important;
}

/* Message and TikTok settings: light editors/cards with inset form controls. */
html[data-theme="light"] body #app-shell .main-panel #facebook-message-settings-view :is(
  .facebook-message-settings-card,
  .facebook-message-setting-block,
  .facebook-message-variables
),
html[data-theme="light"] body #app-shell .main-panel #tiktok-settings-view :is(
  .platform-connection-grid,
  .platform-connection-card,
  .platform-connection-note
) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #facebook-message-settings-view :is(
  .facebook-message-template,
  .facebook-message-toggle,
  .facebook-message-variable-list code
),
html[data-theme="light"] body #app-shell .main-panel #tiktok-settings-view :is(.platform-toggle, input[type="text"]) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text) !important;
  background: var(--boba-control) !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* Lottery: the stage is a raised paper area, never a black hero panel. */
html[data-theme="light"] body #app-shell .main-panel #lottery-view .lottery-card {
  border: 0 !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view :is(
  .lottery-stage,
  .lottery-stat-grid,
  .lottery-list-panel
) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view :is(.summary-card, .lottery-entry) {
  border-color: var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view .lottery-entry.winner {
  border-color: color-mix(in srgb, var(--boba-success) 35%, transparent) !important;
  background: var(--boba-success-soft) !important;
}

/* Screenshot remediation v12: restore desktop rhythm and remove final dark islands. */
html[data-theme="light"] body #app-shell .sidebar .sidebar-footer,
html[data-theme="light"] body #app-shell .sidebar .sidebar-member-actions {
  border-color: var(--boba-border) !important;
  background: var(--boba-canvas) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .sidebar .sidebar-footer {
  gap: var(--boba-space-2) !important;
  padding: var(--boba-space-2) !important;
}

html[data-theme="light"] body #app-shell .sidebar .sidebar-member-btn,
html[data-theme="light"] body #app-shell .main-panel .page-header .customer-actions .ghost-btn,
html[data-theme="light"] body #app-shell .main-panel #customers-view #customer-clear-filters-btn {
  border-color: var(--boba-border) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-surface) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .sidebar .sidebar-member-btn:is(:hover, :focus-visible),
html[data-theme="light"] body #app-shell .main-panel .page-header .customer-actions .ghost-btn:is(:hover, :focus-visible),
html[data-theme="light"] body #app-shell .main-panel #customers-view #customer-clear-filters-btn:is(:hover, :focus-visible) {
  border-color: var(--boba-border-strong) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-brand-soft) !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view .lottery-stage {
  border-color: var(--boba-border-strong) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface-raised) !important;
  background-color: var(--boba-surface-raised) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view :is(
  .lottery-marquee-name,
  .lottery-winner-display strong
) {
  color: var(--boba-brand-strong) !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view :is(
  .lottery-stage-label,
  .lottery-marquee-meta,
  .lottery-winner-display small
) {
  color: var(--boba-text-tertiary) !important;
}

/*
 * The legacy records stylesheet collapses both toolbars below 1350px. That
 * breakpoint ignored the available main-panel width and caused the screenshots'
 * vertical stacks. Desktop keeps one aligned control rail; tablet uses two rows.
 */
@media (min-width: 1181px) {
  #customers-view .customer-toolbar {
    display: grid !important;
    grid-template-columns: minmax(240px, 1fr) 116px 116px 128px 128px 104px !important;
    column-gap: var(--boba-space-2) !important;
    row-gap: var(--boba-space-2) !important;
    align-items: end !important;
  }

  #customers-view :is(.customer-search-row, .customer-date-row),
  #products-view :is(.product-search-row, .product-date-row) {
    display: contents !important;
  }

  #products-view .customer-toolbar {
    display: grid !important;
    grid-template-columns: minmax(280px, 1fr) 144px 144px !important;
    column-gap: var(--boba-space-2) !important;
    row-gap: var(--boba-space-2) !important;
    align-items: end !important;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  #customers-view .customer-toolbar {
    display: grid !important;
    grid-template-columns: minmax(260px, 1fr) 128px 128px !important;
    gap: var(--boba-space-2) !important;
    align-items: end !important;
  }

  #customers-view :is(.customer-search-row, .customer-date-row),
  #products-view :is(.product-search-row, .product-date-row) {
    display: contents !important;
  }

  #customers-view #customer-date-from,
  #customers-view #customer-date-to,
  #customers-view #customer-clear-filters-btn {
    grid-row: 2 !important;
  }

  #customers-view #customer-date-from { grid-column: 1 !important; }
  #customers-view #customer-date-to { grid-column: 2 !important; }
  #customers-view #customer-clear-filters-btn { grid-column: 3 !important; }

  #products-view .customer-toolbar {
    display: grid !important;
    grid-template-columns: minmax(260px, 1fr) 140px 140px !important;
    gap: var(--boba-space-2) !important;
    align-items: end !important;
  }
}

#products-view .workbench-date-field {
  display: grid !important;
  grid-template-rows: var(--boba-control-height) !important;
  gap: 0 !important;
  align-self: end !important;
}

#products-view .workbench-date-field > span {
  display: none !important;
}

/* Screenshot remediation v13: target the actual inner lottery panel and :has() nav rule. */
html[data-theme="light"] body #app-shell .sidebar .sidebar-nav .nav-item.active {
  border-color: var(--boba-border-strong) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-selected) !important;
  background-image: none !important;
  box-shadow: inset 3px 0 0 var(--boba-brand) !important;
}

html[data-theme="light"] body #app-shell .sidebar .sidebar-nav .nav-item.active :is(.ui-label, .ui-icon) {
  color: var(--boba-brand-strong) !important;
}

html[data-theme="light"] body #app-shell .sidebar .sidebar-nav .nav-item.active .ui-icon :is(
  path,
  circle,
  rect,
  line,
  polyline
) {
  stroke: var(--boba-brand) !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view .lottery-marquee {
  border: 1px solid var(--boba-border) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  background-color: var(--boba-surface) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view .lottery-marquee:is(.is-running, .is-winner) {
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  background-image: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view .lottery-winner-display {
  border: 1px solid color-mix(in srgb, var(--boba-success) 30%, transparent) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-success-soft) !important;
  background-color: var(--boba-success-soft) !important;
  background-image: none !important;
  box-shadow: none !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view .lottery-winner-display span {
  color: var(--boba-success) !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view :is(
  .lottery-marquee-name,
  .lottery-winner-display strong
) {
  color: var(--boba-brand-strong) !important;
}

html[data-theme="light"] body #app-shell .main-panel #lottery-view :is(
  .lottery-marquee-meta,
  .lottery-winner-display small
) {
  color: var(--boba-text-tertiary) !important;
}

/* UX remediation v14: state clarity, labeled dates, quiet tabs and print-history hierarchy. */
#comments-view .comments-health-card {
  grid-template-columns: 32px minmax(0, 1fr) auto !important;
}

#comments-view .comments-health-card:first-child {
  grid-template-columns: 32px minmax(0, 1fr) !important;
}

#comments-view .comments-health-copy {
  display: grid !important;
  gap: var(--boba-space-1) !important;
  min-width: 0 !important;
}

#comments-view :is(.bridge-indicator, #print-status) {
  justify-self: end !important;
  white-space: nowrap !important;
}

#customers-view .customer-date-field {
  position: relative !important;
  display: block !important;
  min-width: 0 !important;
  height: var(--boba-control-height) !important;
}

#customers-view .customer-date-field > span {
  position: absolute !important;
  top: 5px !important;
  left: var(--boba-space-3) !important;
  z-index: 1 !important;
  color: var(--boba-text-tertiary) !important;
  font-size: 10px !important;
  font-weight: 600 !important;
  line-height: 1 !important;
  pointer-events: none !important;
}

#customers-view .customer-date-field > input {
  height: var(--boba-control-height) !important;
  padding-top: 15px !important;
  padding-bottom: 3px !important;
}

#customers-view #customer-clear-filters-btn {
  color: var(--boba-text-tertiary) !important;
  font-weight: 600 !important;
}

/* Filter rail v16: use one labeled-date pattern across records and products. */
#customers-view .customer-date-field,
#products-view .workbench-date-field {
  position: static !important;
  display: grid !important;
  grid-template-rows: auto var(--boba-control-height) !important;
  gap: var(--boba-space-1) !important;
  align-self: end !important;
  min-width: 0 !important;
  height: auto !important;
  color: var(--boba-text-secondary) !important;
}

#customers-view .customer-date-field > span,
#products-view .workbench-date-field > span {
  position: static !important;
  display: block !important;
  color: var(--boba-text-tertiary) !important;
  font-size: 11px !important;
  font-weight: 600 !important;
  line-height: 1.2 !important;
  letter-spacing: 0 !important;
  pointer-events: none !important;
}

#customers-view .customer-date-field > input,
#products-view .workbench-date-field > input {
  width: 100% !important;
  height: var(--boba-control-height) !important;
  margin: 0 !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}

/* Filter rail v17: prevent legacy fixed widths from overflowing grid tracks. */
#customers-view .customer-toolbar :is(
  #customer-search,
  #customer-platform-filter,
  #customer-status-filter,
  #customer-date-from,
  #customer-date-to,
  #customer-clear-filters-btn
),
#products-view .customer-toolbar :is(
  #product-search,
  #product-date-from,
  #product-date-to
) {
  box-sizing: border-box !important;
  width: 100% !important;
  min-width: 0 !important;
  max-width: 100% !important;
  flex: none !important;
}

#customers-view .customer-date-field,
#products-view .workbench-date-field {
  box-sizing: border-box !important;
  width: 100% !important;
  max-width: 100% !important;
}

@media (min-width: 1181px) {
  #customers-view .customer-toolbar {
    grid-template-columns: minmax(240px, 1fr) 128px 128px 144px 144px 100px !important;
    column-gap: var(--boba-space-2) !important;
  }

  #products-view .customer-toolbar {
    grid-template-columns: minmax(280px, 1fr) 144px 144px !important;
    column-gap: var(--boba-space-2) !important;
  }
}

@media (min-width: 901px) and (max-width: 1180px) {
  #customers-view .customer-date-field:first-child {
    grid-column: 1 !important;
    grid-row: 2 !important;
  }

  #customers-view .customer-date-field:nth-child(2) {
    grid-column: 2 !important;
    grid-row: 2 !important;
  }
}

#customers-view .customer-detail-tabs {
  display: flex !important;
  align-items: stretch !important;
  gap: var(--boba-space-4) !important;
  min-height: 44px !important;
  margin: 0 0 var(--boba-space-4) !important;
  padding: 0 !important;
  border-bottom: 1px solid var(--boba-border) !important;
  background: transparent !important;
}

#customers-view .customer-tab-btn,
html[data-theme="light"] body #app-shell .main-panel #customers-view .customer-tab-btn {
  position: relative !important;
  min-width: 0 !important;
  min-height: 44px !important;
  padding: 0 var(--boba-space-1) !important;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--boba-text-tertiary) !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
  font-size: 13px !important;
  font-weight: 600 !important;
}

#customers-view .customer-tab-btn::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  border-radius: 2px 2px 0 0;
  background: transparent;
  content: "";
}

#customers-view .customer-tab-btn:is(:hover, :focus-visible) {
  color: var(--boba-text) !important;
}

#customers-view .customer-tab-btn.active,
html[data-theme="light"] body #app-shell .main-panel #customers-view .customer-tab-btn.active {
  border: 0 !important;
  color: var(--boba-brand-strong) !important;
  background: transparent !important;
  box-shadow: none !important;
}

#customers-view .customer-tab-btn.active::after {
  background: var(--boba-brand) !important;
}

/* Buyer history: white paper row, one gold selection rail, no duplicate time emphasis. */
#products-view .product-buyer-item,
html[data-theme="light"] body #app-shell .main-panel #products-view .product-buyer-item {
  min-height: 0 !important;
  padding: var(--boba-space-3) !important;
  border: 0 !important;
  border-bottom: 1px solid var(--boba-border) !important;
  border-radius: 0 !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

#products-view .product-buyer-item.active,
html[data-theme="light"] body #app-shell .main-panel #products-view .product-buyer-item.active {
  padding-left: var(--boba-space-4) !important;
  border-left: 3px solid var(--boba-brand) !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface) !important;
  background-image: none !important;
  box-shadow: none !important;
}

#products-view .product-buyer-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) auto !important;
  gap: var(--boba-space-3) !important;
  align-items: start !important;
}

#products-view .product-buyer-head > div:first-child {
  display: grid !important;
  gap: var(--boba-space-1) !important;
  min-width: 0 !important;
}

#products-view .product-buyer-head strong,
#products-view .product-buyer-meta strong {
  color: var(--boba-text) !important;
  font-size: 14px !important;
  font-weight: 700 !important;
}

#products-view .product-buyer-head span,
#products-view .product-buyer-meta span {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
  line-height: 1.4 !important;
}

#products-view .product-buyer-meta {
  display: grid !important;
  gap: var(--boba-space-1) !important;
  justify-items: end !important;
  text-align: right !important;
}

#products-view .product-buyer-item.active .product-buyer-meta span {
  display: none !important;
}

#products-view .product-buyer-orders {
  margin-top: var(--boba-space-3) !important;
  padding-top: var(--boba-space-3) !important;
  border-top: 1px dashed var(--boba-border) !important;
}

#products-view .product-buyer-order,
html[data-theme="light"] body #app-shell .main-panel #products-view .product-buyer-order {
  display: grid !important;
  gap: var(--boba-space-2) !important;
  padding: var(--boba-space-2) 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--boba-border) !important;
  border-radius: 0 !important;
  color: var(--boba-text-secondary) !important;
  background: transparent !important;
  box-shadow: none !important;
}

#products-view .product-buyer-order:last-child {
  border-bottom: 0 !important;
}

#products-view .product-buyer-order-top {
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: var(--boba-space-3) !important;
}

#products-view .product-buyer-order-top > span {
  color: var(--boba-text-tertiary) !important;
  font-size: 12px !important;
  font-variant-numeric: tabular-nums;
}

#products-view .product-buyer-order-text {
  color: var(--boba-text) !important;
  font-size: 14px !important;
  font-weight: 600 !important;
  line-height: 1.5 !important;
  overflow-wrap: anywhere !important;
}

#products-view .timeline-actions {
  display: flex !important;
  align-items: center !important;
  gap: var(--boba-space-2) !important;
}

#products-view .timeline-badge {
  min-height: 28px !important;
  padding: 5px 10px !important;
  border: 1px solid var(--boba-border) !important;
  border-radius: 999px !important;
  color: var(--boba-text-secondary) !important;
  background: var(--boba-surface-raised) !important;
  font-size: 12px !important;
  font-weight: 700 !important;
}

#products-view .timeline-badge:is(.printed, .completed, .print_completed) {
  border-color: color-mix(in srgb, var(--boba-success) 28%, transparent) !important;
  color: var(--boba-success) !important;
  background: var(--boba-success-soft) !important;
}

#products-view .mini-action-btn {
  min-height: 36px !important;
  padding: 7px 12px !important;
  border-color: var(--boba-border) !important;
  color: var(--boba-brand-strong) !important;
  background: var(--boba-surface) !important;
  font-size: 13px !important;
}

@media (max-width: 760px) {
  #comments-view :is(.bridge-indicator, #print-status) {
    justify-self: start !important;
  }

  #customers-view .customer-detail-tabs {
    gap: var(--boba-space-3) !important;
    overflow-x: auto !important;
  }

  #products-view .product-buyer-order-top {
    align-items: flex-start !important;
    flex-direction: column !important;
  }
}
