/* CV Builder integration with the canonical public Light/Dark shell. */
:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) {
  background: var(--tcv-bg);
  color: var(--tcv-ink);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) .cv-public-intro {
  background: linear-gradient(135deg, var(--tcv-surface), var(--tcv-soft));
  border-color: var(--tcv-line);
  box-shadow: 0 18px 45px rgb(0 0 0 / 18%);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) .cv-public-intro p {
  color: var(--tcv-muted);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) :is(.cv-builder, .cv-manager) {
  --cv-ink: var(--tcv-ink);
  --cv-muted: var(--tcv-muted);
  --cv-border: var(--tcv-line);
  --cv-surface: var(--tcv-surface);
  --cv-soft: var(--tcv-soft);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) :is(
  .cv-editor-card,
  .cv-builder-toolbar,
  .cv-template-picker button,
  .cv-section-editor,
  .cv-item-editor,
  .cv-field input,
  .cv-field textarea,
  .cv-secondary-button,
  .cv-manager-head,
  .cv-resume-card,
  .cv-resume-actions a,
  .cv-resume-actions button,
  .cv-modal,
  .cv-mobile-tabs
) {
  background: var(--tcv-surface);
  color: var(--tcv-ink);
  border-color: var(--tcv-line);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) .cv-builder-toolbar {
  background: rgb(16 27 45 / 94%);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) :is(.cv-card-title, .cv-item-editor > header) {
  border-color: var(--tcv-line);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) :is(.cv-section-editor > summary, .cv-empty-state) {
  background: var(--tcv-soft);
  border-color: var(--tcv-line);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) .cv-preview-stage {
  background: linear-gradient(135deg, #08111f, #111f32);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) .cv-field > span {
  color: var(--tcv-ink);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) :is(.cv-template-picker button.active, .cv-add-button) {
  background: #0b302f;
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) .cv-add-button {
  color: var(--tcv-ink);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) .cv-manager-head {
  background: linear-gradient(135deg, var(--tcv-surface), #0b302f);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) .cv-import-banner {
  background: #0b302f;
  border-color: #155e75;
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) .cv-import-banner p {
  color: var(--tcv-muted);
}

:is(html[data-theme="dark"] body.cv-public-page, body.cv-public-page[data-theme="dark"]) .cv-alert.error {
  background: #3a1518;
  color: #fecaca;
  border-color: #7f1d1d;
}

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