/* AppPilot automatic day/night theme.
   Dark remains the reference appearance. Light follows the operating-system
   preference unless the signed-in appearance control explicitly overrides it. */

:root {
  color-scheme: dark;
  --theme-bg: #0b0d0c;
  --theme-surface: #111412;
  --theme-raised: #171b18;
  --theme-soft: #1e231f;
  --theme-hover: #242a25;
  --theme-selected: #17220f;
  --theme-border: #2a302b;
  --theme-border-strong: #394039;
  --theme-text: #f4f7f2;
  --theme-secondary: #a8b0a8;
  --theme-muted: #737c74;
  --theme-disabled: #4d544e;
  --theme-accent: #b8f35a;
  --theme-accent-ink: #17220f;
  --theme-active-text: var(--theme-text);
  --theme-primary-icon-filter: brightness(0) saturate(100%);
  --theme-success: #77b82f;
  --theme-warning: #f1b84b;
  --theme-danger: #f07272;
  --theme-info: #77a9ff;
  --theme-header: rgb(9 11 10 / 92%);
  --theme-shadow: rgb(0 0 0 / 42%);
  --theme-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%23b7c0b9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  --theme-sidebar-text: #b7c0b9;
  --theme-sidebar-icon-filter: none;
  --theme-sidebar-icon-opacity: .76;
}

:root[data-theme="light"] {
  color-scheme: light;
  --theme-bg: #f7f8f6;
  --theme-surface: #ffffff;
  --theme-raised: #f6f8f4;
  --theme-soft: #f0f3ee;
  --theme-hover: #e9eee7;
  --theme-selected: #edf4e7;
  --theme-border: #dfe5dd;
  --theme-border-strong: #cbd4c9;
  --theme-text: #1d251f;
  --theme-secondary: #5f6961;
  --theme-muted: #69746c;
  --theme-disabled: #a6aea8;
  --theme-accent: #4d8127;
  --theme-accent-ink: #ffffff;
  --theme-active-text: #4d8127;
  --theme-primary-icon-filter: brightness(0) invert(1);
  --theme-success: #4d8127;
  --theme-warning: #b87316;
  --theme-danger: #cf4d45;
  --theme-info: #4c7fbd;
  --theme-header: rgb(255 255 255 / 94%);
  --theme-shadow: rgb(31 43 34 / 10%);
  --theme-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2338443d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
  --theme-sidebar-text: #445149;
  --theme-sidebar-icon-filter: brightness(.48) saturate(.65);
  --theme-sidebar-icon-opacity: .9;
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    color-scheme: light;
    --theme-bg: #f7f8f6;
    --theme-surface: #ffffff;
    --theme-raised: #f6f8f4;
    --theme-soft: #f0f3ee;
    --theme-hover: #e9eee7;
    --theme-selected: #edf4e7;
    --theme-border: #dfe5dd;
    --theme-border-strong: #cbd4c9;
    --theme-text: #1d251f;
    --theme-secondary: #5f6961;
    --theme-muted: #69746c;
    --theme-disabled: #a6aea8;
    --theme-accent: #4d8127;
    --theme-accent-ink: #ffffff;
    --theme-active-text: #4d8127;
    --theme-primary-icon-filter: brightness(0) invert(1);
    --theme-success: #4d8127;
    --theme-warning: #b87316;
    --theme-danger: #cf4d45;
    --theme-info: #4c7fbd;
    --theme-header: rgb(255 255 255 / 94%);
    --theme-shadow: rgb(31 43 34 / 10%);
    --theme-select-chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%2338443d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 8 4 4 4-4'/%3E%3C/svg%3E");
    --theme-sidebar-text: #445149;
    --theme-sidebar-icon-filter: brightness(.48) saturate(.65);
    --theme-sidebar-icon-opacity: .9;
  }
}

/* Theme compatibility layer.
   The approved Pen-alignment styles still contain literal dark fills. Keep
   those components semantic here so automatic light mode never mixes dark
   controls into a light surface. These rules intentionally apply to both
   themes: the variables preserve the dark reference while making light mode
   complete and predictable. */

/* Shared controls and feedback. */
button.secondary,
.secondary,
.ghost:not(.button-primary),
.filter-row button,
.filter-row label,
.form-card input:not([type="checkbox"]):not([type="radio"]),
.form-card select,
.checkout-form input,
.checkout-form select,
.period,
.auth-field input,
.auth-field select,
.password-strength > span {
  background: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

.period:has(input:checked),
.tone-options input:checked + span,
.status-tabs button.active,
.sample-nav nav button.active,
.sample-item.selected,
.queue-item.selected {
  background: var(--theme-selected);
  border-color: color-mix(in srgb, var(--theme-accent) 45%, var(--theme-border));
  color: var(--theme-text);
}

.auth-message.error:not(:empty),
.security-delete-card {
  background: var(--ui-danger-soft, color-mix(in srgb, var(--theme-danger) 10%, var(--theme-surface)));
  border-color: color-mix(in srgb, var(--theme-danger) 42%, var(--theme-border));
}

.verification-result-mark,
.invite-result-mark,
.subscribe-icon,
.result-mark,
.status-pill,
.summary-card > p,
.mobile-approval-row > span,
.statement-side .commitment,
.changelog-date span,
.error-page .error-code {
  background: var(--theme-selected);
  color: var(--theme-success);
}

/* Marketing, authentication and public product pages. */
.preview-rail,
.pricing-section,
html:has(body.pricing-page),
body.pricing-page,
.pricing-page .pricing-section,
.auth-card,
.auth-panel,
.invite-workspace-card,
.choice-card,
.instructions-card,
.form-card,
.summary-card,
.result-card,
.order-card,
.change-card,
.status-card,
.incident-impact,
.subscribe-components {
  background: var(--theme-surface);
}

.site-header,
.setup-header,
.flow-nav,
.auth-header {
  border-color: var(--theme-border);
}

.apppilot-locale-switcher select,
.marketing-page .apppilot-locale-switcher select,
.auth-page .apppilot-locale-switcher select {
  background: var(--theme-surface);
  border-color: var(--theme-border-strong);
  color: var(--theme-text);
}

.apppilot-locale-switcher select:focus-visible {
  outline-color: var(--theme-accent);
}

body:has(.setup-screen) {
  background: radial-gradient(
      circle at 50% 0,
      color-mix(in srgb, var(--theme-accent) 5%, var(--theme-bg)) 0,
      transparent 35%
    ),
    var(--theme-bg);
}

.choice-icon.outline,
.summary-source-card,
.mobile-connection-card,
.result-safety,
.plan-line,
.preview-card,
.preview-pane {
  background: var(--theme-raised);
}

.sample-main :is(.mobile-module, .mobile-avatar),
.sample-app :is(.mobile-module, .mobile-avatar) {
  background: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

.sample-main .mobile-workspace > span,
.sample-app .mobile-workspace > span,
.sample-composer .approval-note {
  background: var(--theme-selected);
  color: var(--theme-success);
}

.sample-composer .composer-heading > span {
  align-self: flex-start;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--theme-selected);
  color: var(--theme-success);
  white-space: nowrap;
}

.sample-composer .tone-field button,
.sample-composer .draft-tools button {
  background: var(--theme-raised);
  color: var(--theme-secondary);
}

.sample-app .publish-button {
  background: var(--theme-accent);
  color: var(--theme-accent-ink);
}

.sample-app .publish-button img,
body.app-shell .app :is(.detail-send-btn, .workspace-poll-btn, button.primary) img {
  filter: var(--theme-primary-icon-filter);
}

.status-summary,
.switch-control[aria-checked="true"] {
  background: color-mix(in srgb, var(--theme-success) 9%, var(--theme-surface));
}

/* Signed-in application: navigation and selection. */
body.app-shell .app #sidebar,
body.app-shell .app .workspace-topbar,
body.app-shell .app #tabs.workspace-tabs,
body.app-shell .app .mobile-menu,
body.app-shell .app .mobile-module-switcher,
body.app-shell .app .mobile-app-switcher {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}

body.app-shell[data-module="reply"] .app :is(.mobile-reply-app-icon, .mobile-reply-avatar) {
  background: var(--theme-selected);
  border: 1px solid color-mix(in srgb, var(--theme-accent) 28%, var(--theme-border));
  color: var(--theme-active-text);
}

body.app-shell[data-module="reply"] .app .mobile-reply-avatar:hover {
  background: color-mix(in srgb, var(--theme-accent) 14%, var(--theme-surface));
  color: var(--theme-active-text);
}

body[data-module="reply"] .app #tabs.workspace-tabs .tab.active,
body[data-module="reply"] .app #tabs.workspace-tabs .tab[aria-selected="true"],
body.app-shell .app #toolsettings-tabs .stab.active,
body.app-shell .app #toolsettings-tabs .stab[aria-selected="true"],
body.app-shell .app .ranking-keyword-tab[aria-selected="true"],
body.app-shell .app .template-master-item.active,
body.app-shell .app #sidebar .active {
  background: var(--theme-selected);
  color: var(--theme-active-text);
}

body.app-shell .app :is(
  button.primary,
  .detail-send-btn,
  .workspace-poll-btn,
  .settings-card button.primary,
  .onboarding-step button.primary
) {
  background: var(--theme-accent);
  border-color: var(--theme-accent);
  color: var(--theme-accent-ink);
}

body[data-module="reply"] .app #tabs.workspace-tabs .tab.active .badge,
body[data-module="reply"] .app #tabs.workspace-tabs .tab[aria-selected="true"] .badge {
  background: color-mix(in srgb, var(--theme-accent) 13%, var(--theme-surface));
  color: var(--theme-secondary);
}

/* Signed-in application: cards, editors and form surfaces. */
body.app-shell .app :is(
  .list-pane,
  .review-detail-pane,
  .reply-editor-pane,
  .settings-card,
  .settings-panel .security-item,
  .source-row,
  .source-capability-grid article,
  .source-setup-detail,
  .insight-metrics article,
  .insight-panel,
  .rankings-panel,
  .ranking-card,
  .profile-settings-card,
  .approval-setting
) {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}

body.app-shell .app :is(
  input:not([type="checkbox"]):not([type="radio"]),
  select,
  textarea,
  .filter-select-trigger,
  .filter-search,
  .template-search,
  .template-meta-grid input,
  .template-meta-grid select,
  .template-detail-editor textarea,
  .template-preview-note,
  .locale-card,
  .draft-tool-btn
) {
  background-color: var(--theme-raised);
  border-color: var(--theme-border);
  color: var(--theme-text);
}

body.app-shell .app .template-master-list,
body.app-shell .app .template-detail-editor {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}

body.app-shell .app :is(.mini-item.active, .mini-item[aria-selected="true"]) {
  background: var(--theme-selected);
  color: var(--theme-text);
}

body.app-shell .app :is(.mobile-review-body > p, .original-review, .review-original) {
  background: var(--theme-raised);
  color: var(--theme-text);
}

body.app-shell .app :is(.translation-block, .mobile-review-translation, .review-translation, .insight-signal) {
  background: color-mix(in srgb, var(--theme-info) 8%, var(--theme-surface));
  border-color: color-mix(in srgb, var(--theme-info) 32%, var(--theme-border));
}

body.app-shell .app :is(.translation-block, .mobile-review-translation, .review-translation) p {
  color: var(--theme-text);
}

body.app-shell .app .insight-bar-row i {
  background: var(--theme-soft);
}

body.app-shell .app .source-status,
body.app-shell .app .draft-ready-badge,
body.app-shell .app .template-preview-note b {
  background: color-mix(in srgb, var(--theme-success) 10%, var(--theme-surface));
  color: var(--theme-success);
}

body.app-shell .app :is(.settings-boundary, .review-signal-note) {
  background: color-mix(in srgb, var(--theme-warning) 9%, var(--theme-surface));
  border-color: color-mix(in srgb, var(--theme-warning) 38%, var(--theme-border));
  color: var(--theme-warning);
}

body.app-shell .app .security-delete-card input {
  background: var(--theme-surface);
  border-color: color-mix(in srgb, var(--theme-danger) 42%, var(--theme-border));
}

body.app-shell .app .workspace-autosave-toast {
  border-color: var(--theme-border);
}

/* Keep the review score legible in both themes. The base console layer maps
   stars to body text, which makes the rating look washed out in light mode. */
body.app-shell .app .detail-stars {
  color: var(--theme-warning);
  font-weight: 700;
}

body.app-shell .app .detail-stars .off {
  color: color-mix(in srgb, var(--theme-secondary) 72%, var(--theme-surface));
}

/* Shared public-page tokens. */
:root {
  --bg: var(--theme-bg);
  --surface: var(--theme-surface);
  --panel: var(--theme-surface);
  --surface-raised: var(--theme-raised);
  --raised: var(--theme-raised);
  --panel2: var(--theme-raised);
  --surface-soft: var(--theme-soft);
  --soft: var(--theme-soft);
  --border: var(--theme-border);
  --line: var(--theme-border);
  --border-strong: var(--theme-border-strong);
  --text: var(--theme-text);
  --text-secondary: var(--theme-secondary);
  --secondary: var(--theme-secondary);
  --muted: var(--theme-muted);
  --accent: var(--theme-accent);
  --lime: var(--theme-accent);
  --accent-dark: var(--theme-accent-ink);
  --lime-dark: var(--theme-accent-ink);
  --lime-ink: var(--theme-accent-ink);
  --warning: var(--theme-warning);
  --amber: var(--theme-warning);
  --danger: var(--theme-danger);
  --red: var(--theme-danger);
  --blue: color-mix(in srgb, var(--theme-info) 10%, var(--theme-surface));

  --trust-bg: var(--theme-bg);
  --trust-surface: var(--theme-surface);
  --trust-surface-strong: var(--theme-raised);
  --trust-border: var(--theme-border);
  --trust-text: var(--theme-text);
  --trust-muted: var(--theme-secondary);
  --trust-accent: var(--theme-accent);
  --trust-warning: var(--theme-warning);
  --trust-danger: var(--theme-danger);
}

html,
body {
  background-color: var(--theme-bg);
}

body,
button,
input,
select,
textarea,
dialog {
  color-scheme: inherit;
}

/* Native selects use one crisp, consistently inset chevron everywhere. */
select:not([multiple]) {
  appearance: none;
  -webkit-appearance: none;
  padding-inline-end: 38px !important;
  background-image: var(--theme-select-chevron) !important;
  background-repeat: no-repeat !important;
  background-position: calc(100% - 12px) 50% !important;
  background-size: 16px 16px !important;
}

body.app-shell .app :is(.filter-select-chevron, .app-select-chev) {
  width: 15px;
  height: 15px;
  flex-basis: 15px;
  margin-inline-start: auto;
  color: var(--theme-sidebar-text);
}

.site-header,
.setup-header {
  background: var(--theme-header);
}

.workspace-preview,
.site-nav,
.sample-dialog,
.toast,
.sample-toast,
.save-notice,
.workspace-autosave-toast {
  box-shadow: 0 24px 60px var(--theme-shadow);
}

/* Signed-in app tokens override the dark-only Pen alignment layer. */
body.app-shell,
body.app-shell .app.app {
  background: var(--theme-bg);
}

:root[data-theme="light"] body.app-shell,
:root[data-theme="dark"] body.app-shell {
  background: var(--theme-bg);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) body.app-shell {
    background: var(--theme-bg);
  }
}

body.app-shell .app.app {
  --ui-canvas: var(--theme-bg);
  --ui-surface: var(--theme-surface);
  --ui-surface-subtle: var(--theme-raised);
  --ui-surface-hover: var(--theme-hover);
  --ui-surface-pressed: var(--theme-soft);
  --ui-surface-selected: var(--theme-selected);
  --ui-text: var(--theme-text);
  --ui-text-secondary: var(--theme-secondary);
  --ui-text-muted: var(--theme-muted);
  --ui-text-disabled: var(--theme-disabled);
  --ui-border-subtle: var(--theme-border);
  --ui-border: var(--theme-border-strong);
  --ui-border-strong: color-mix(in srgb, var(--theme-text) 38%, var(--theme-border));
  --ui-focus: var(--theme-accent);
  --ui-success: var(--theme-success);
  --ui-success-soft: color-mix(in srgb, var(--theme-success) 10%, var(--theme-surface));
  --ui-warning: var(--theme-warning);
  --ui-warning-soft: color-mix(in srgb, var(--theme-warning) 11%, var(--theme-surface));
  --ui-danger: var(--theme-danger);
  --ui-danger-soft: color-mix(in srgb, var(--theme-danger) 10%, var(--theme-surface));
  --ui-info: var(--theme-info);
  --ui-info-soft: color-mix(in srgb, var(--theme-info) 10%, var(--theme-surface));
  --ui-brand-filter: none;
  color-scheme: inherit;
}

body.app-shell .app #sidebar,
body.app-shell .app .mobile-menu,
body.app-shell .app .mobile-module-switcher,
body.app-shell .app .mobile-app-switcher {
  background: var(--theme-surface);
}

/* Settings has a higher-specificity desktop shell in app-polish.css. Keep that
   shell semantic so switching modules cannot reintroduce a dark sidebar. */
body.app-shell[data-module="toolsettings"][data-tool-panel] .app #sidebar {
  background: var(--theme-surface);
  border-color: var(--theme-border);
}

/* Settings' internal navigation has legacy panel-specific dark fills with
   higher specificity. Keep every selected panel readable in both themes. */
body.app-shell[data-module="toolsettings"][data-tool-panel] .app #toolsettings-tabs .stab.active,
body.app-shell[data-module="toolsettings"][data-tool-panel] .app #toolsettings-tabs .stab[aria-selected="true"] {
  background: var(--theme-selected);
  color: var(--theme-active-text);
  font-weight: 600;
}

body.app-shell[data-module="toolsettings"] .app :is(.team-plan-note, .billing-proposal-note) {
  background: color-mix(in srgb, var(--theme-warning) 8%, var(--theme-surface)) !important;
  border-color: color-mix(in srgb, var(--theme-warning) 38%, var(--theme-border)) !important;
  color: var(--theme-secondary);
}

body.app-shell[data-module="toolsettings"] .app :is(.team-plan-note, .billing-proposal-note) strong {
  color: var(--theme-text) !important;
}

body.app-shell[data-module="toolsettings"] .app .security-delete-card {
  background: color-mix(in srgb, var(--theme-danger) 5%, var(--theme-surface));
  border-color: color-mix(in srgb, var(--theme-danger) 38%, var(--theme-border));
}

body.app-shell[data-module="toolsettings"] .app .security-delete-card input {
  background: var(--theme-surface);
  border-color: color-mix(in srgb, var(--theme-danger) 38%, var(--theme-border));
  color: var(--theme-text);
}

/* The light sidebar should remain calm without becoming washed out. */
body.app-shell .app #sidebar :is(
  .module-switch-btn:not(.active),
  .module-link-btn:not(.active),
  .scope-config-btn,
  .nav-label,
  .nav-label-row
) {
  color: var(--theme-sidebar-text);
}

body.app-shell .app #sidebar .module-nav-icon {
  opacity: var(--theme-sidebar-icon-opacity);
}

body.app-shell .app #sidebar img.module-nav-icon {
  filter: var(--theme-sidebar-icon-filter);
}

body.app-shell .app #sidebar .module-switch-btn.active .module-nav-icon,
body.app-shell .app #sidebar .module-link-btn.active .module-nav-icon {
  opacity: 1;
  filter: none;
}

.sample-nav nav button:not(.active) {
  color: var(--theme-sidebar-text);
}

.sample-nav nav button:not(.active) img {
  opacity: var(--theme-sidebar-icon-opacity);
  filter: var(--theme-sidebar-icon-filter);
}

/* First paint: replace the empty workbench shell with a stable skeleton. */
body.app-shell .app .app-boot-state {
  display: none;
}

body.app-status-loading.app-shell .app main > :is(.workspace-tabs, .tab-page) {
  display: none !important;
}

body.app-status-loading.app-shell .app .app-boot-state {
  display: grid;
  gap: 16px;
  padding: 26px 0 28px;
}

body.app-shell .app .app-boot-toolbar {
  display: flex;
  gap: 10px;
}

body.app-shell .app .app-boot-toolbar span,
body.app-shell .app .app-boot-pane i {
  display: block;
  border-radius: 7px;
  background: linear-gradient(90deg, var(--theme-soft) 18%, var(--theme-hover) 48%, var(--theme-soft) 78%);
  background-size: 240% 100%;
  animation: app-boot-shimmer 1.35s ease-in-out infinite;
}

body.app-shell .app .app-boot-toolbar span {
  width: 112px;
  height: 34px;
}

body.app-shell .app .app-boot-toolbar span:last-child {
  width: 190px;
  margin-inline-start: auto;
}

body.app-shell .app .app-boot-grid {
  display: grid;
  grid-template-columns: minmax(250px, .82fr) minmax(360px, 1.35fr) minmax(300px, .95fr);
  gap: 14px;
  min-height: calc(100dvh - 190px);
}

body.app-shell .app .app-boot-pane {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--theme-border);
  border-radius: 12px;
  background: var(--theme-surface);
}

body.app-shell .app .app-boot-pane i { height: 12px; }
body.app-shell .app .app-boot-pane i:nth-child(1) { width: 42%; height: 18px; }
body.app-shell .app .app-boot-pane i:nth-child(2) { width: 88%; margin-top: 18px; }
body.app-shell .app .app-boot-pane i:nth-child(3) { width: 72%; }
body.app-shell .app .app-boot-pane i:nth-child(4) { width: 56%; }
body.app-shell .app .app-boot-list i { height: 58px; width: 100% !important; margin-top: 0 !important; }

@keyframes app-boot-shimmer {
  from { background-position: 100% 0; }
  to { background-position: -100% 0; }
}

@media (max-width: 720px) {
  body.app-status-loading.app-shell .app .app-boot-state {
    padding: 18px 16px 24px;
  }

  body.app-shell .app .app-boot-toolbar span {
    width: 82px;
  }

  body.app-shell .app .app-boot-toolbar span:nth-child(n + 3) {
    display: none;
  }

  body.app-shell .app .app-boot-grid {
    grid-template-columns: minmax(0, 1fr);
    min-height: 58dvh;
  }

  body.app-shell .app .app-boot-grid .app-boot-pane:not(:first-child) {
    display: none;
  }
}

body.app-shell .app .workspace-autosave-toast,
body.app-shell .app .draft-autosave-toast {
  background: var(--theme-raised);
  color: var(--theme-text);
  box-shadow: 0 12px 34px var(--theme-shadow);
}

/* Light-specific repair for places whose Pen layer uses literal dark colors. */
:root[data-theme="light"] .preview-rail,
:root[data-theme="light"] .sample-nav,
:root[data-theme="light"] .review-original,
:root[data-theme="light"] .sample-composer textarea,
:root[data-theme="light"] .checkout-form input,
:root[data-theme="light"] .checkout-form select,
:root[data-theme="light"] .period,
:root[data-theme="light"] .secondary,
:root[data-theme="light"] .form-card input,
:root[data-theme="light"] .form-card select,
:root[data-theme="light"] body.app-shell .app .settings-card,
:root[data-theme="light"] body.app-shell .app .panel {
  background: var(--theme-surface);
}

:root[data-theme="light"] .queue-item.selected,
:root[data-theme="light"] .sample-item.selected,
:root[data-theme="light"] .status-tabs button.active,
:root[data-theme="light"] .tone-field button,
:root[data-theme="light"] .language-field button,
:root[data-theme="light"] .draft-tools button,
:root[data-theme="light"] .choice-icon.outline,
:root[data-theme="light"] .tone-options input:checked + span,
:root[data-theme="light"] body.app-shell .app #sidebar .active {
  background: var(--theme-selected);
}

:root[data-theme="light"] .review-translation,
:root[data-theme="light"] .sensitive-note,
:root[data-theme="light"] .isolation-banner {
  background: color-mix(in srgb, var(--theme-info) 8%, var(--theme-surface));
  border-color: color-mix(in srgb, var(--theme-info) 32%, var(--theme-border));
  color: var(--theme-secondary);
}

:root[data-theme="light"] .local-note,
:root[data-theme="light"] .impact,
:root[data-theme="light"] .result-help,
:root[data-theme="light"] .review-insight,
:root[data-theme="light"] .composer-alert,
:root[data-theme="light"] .trust-notice {
  background: color-mix(in srgb, var(--theme-warning) 9%, var(--theme-surface));
  color: color-mix(in srgb, var(--theme-warning) 78%, #2b210d);
}

:root[data-theme="light"] .hero .eyebrow,
:root[data-theme="light"] .result-mark,
:root[data-theme="light"] .status-pill,
:root[data-theme="light"] .summary-card > p,
:root[data-theme="light"] .approval-note,
:root[data-theme="light"] .mobile-workspace > span,
:root[data-theme="light"] .sample-user > span,
:root[data-theme="light"] .review-avatar {
  background: var(--theme-selected);
}

@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .preview-rail,
  :root:not([data-theme="dark"]) .sample-nav,
  :root:not([data-theme="dark"]) .review-original,
  :root:not([data-theme="dark"]) .sample-composer textarea,
  :root:not([data-theme="dark"]) .checkout-form input,
  :root:not([data-theme="dark"]) .checkout-form select,
  :root:not([data-theme="dark"]) .period,
  :root:not([data-theme="dark"]) .secondary,
  :root:not([data-theme="dark"]) .form-card input,
  :root:not([data-theme="dark"]) .form-card select,
  :root:not([data-theme="dark"]) body.app-shell .app .settings-card,
  :root:not([data-theme="dark"]) body.app-shell .app .panel {
    background: var(--theme-surface);
  }

  :root:not([data-theme="dark"]) .queue-item.selected,
  :root:not([data-theme="dark"]) .sample-item.selected,
  :root:not([data-theme="dark"]) .status-tabs button.active,
  :root:not([data-theme="dark"]) .tone-field button,
  :root:not([data-theme="dark"]) .language-field button,
  :root:not([data-theme="dark"]) .draft-tools button,
  :root:not([data-theme="dark"]) .choice-icon.outline,
  :root:not([data-theme="dark"]) .tone-options input:checked + span,
  :root:not([data-theme="dark"]) body.app-shell .app #sidebar .active {
    background: var(--theme-selected);
  }

  :root:not([data-theme="dark"]) .review-translation,
  :root:not([data-theme="dark"]) .sensitive-note,
  :root:not([data-theme="dark"]) .isolation-banner {
    background: color-mix(in srgb, var(--theme-info) 8%, var(--theme-surface));
    border-color: color-mix(in srgb, var(--theme-info) 32%, var(--theme-border));
    color: var(--theme-secondary);
  }

  :root:not([data-theme="dark"]) .local-note,
  :root:not([data-theme="dark"]) .impact,
  :root:not([data-theme="dark"]) .result-help,
  :root:not([data-theme="dark"]) .review-insight,
  :root:not([data-theme="dark"]) .composer-alert,
  :root:not([data-theme="dark"]) .trust-notice {
    background: color-mix(in srgb, var(--theme-warning) 9%, var(--theme-surface));
    color: color-mix(in srgb, var(--theme-warning) 78%, #2b210d);
  }

  :root:not([data-theme="dark"]) .hero .eyebrow,
  :root:not([data-theme="dark"]) .result-mark,
  :root:not([data-theme="dark"]) .status-pill,
  :root:not([data-theme="dark"]) .summary-card > p,
  :root:not([data-theme="dark"]) .approval-note,
  :root:not([data-theme="dark"]) .mobile-workspace > span,
  :root:not([data-theme="dark"]) .sample-user > span,
  :root:not([data-theme="dark"]) .review-avatar {
    background: var(--theme-selected);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition-duration: .01ms !important;
  }
}
