/* Light values for the shared Sol palette. Dark values live at the declaration sites. */
html[data-site-theme="day"] {
  --site-color-scheme: light;
  --site-page: #f3f6fc;
  --site-surface: #fff;
  --site-surface-start: #fbfcff;
  --site-surface-muted: #eaf0f9;
  --site-inset: #eaf0f9bb;
  --site-surface-glass: #fffffff0;
  --site-nav: #f9fbffef;
  --site-control: #f3f7fd;
  --site-hover: #e2edfc;
  --site-selected: #dceaff;
  --site-ink: #17253d;
  --site-ink-secondary: #334661;
  --site-muted: #475b75;
  --site-accent: #174eaa;
  --site-accent-secondary: #594695;
  --site-primary: #174eaa;
  --site-primary-hover: #103e8d;
  --site-on-primary: #fff;
  --site-line: #50668538;
  --site-control-line: #657b99;
  --site-accent-line: #245bb4;
  --site-accent-wash: #3575da18;
  --site-selection: #3575da35;
  --site-scroll-thumb: #7489a6;
  --site-success: #17573e;
  --site-success-bg: #e1f5ea;
  --site-success-line: #367e60;
  --site-danger: #92283c;
  --site-danger-bg: #fce9ed;
  --site-danger-hover: #f9dbe2;
  --site-danger-line: #ad5064;
  --site-backdrop: #15233cb3;
  --site-drawer-backdrop: #15233c91;
  --site-subtle-backdrop: #15233c29;
  --site-ambient: #3e78ce12;
  --site-ambient-secondary: #7057b411;
}

@layer sol-site {
  html[data-theme-changing] :is(button, .btn, [role="button"], [role="tab"], a, input, select, textarea) {
    transition-property: none !important;
  }

  /* Match the regular controls' cascade for their interactive states. */
  html[data-site-theme="day"][data-site-palette="sol"] :is(
    button, .btn, [role="button"], [role="tab"], .course-tab, .fc-tab, .sm-cover-tabs button,
    .vpn-plan-card, .mpm-moodle-model-toggle
  ):is(.selected, .active, .is-selected, [aria-pressed="true"], [aria-selected="true"]):not(:disabled) {
    color: var(--site-accent) !important;
    -webkit-text-fill-color: currentColor !important;
    background: var(--site-selected) !important;
    border-color: var(--site-accent-line) !important;
  }

  html[data-site-theme="day"][data-site-palette="sol"] :is(
    button, .btn, [role="button"], [role="tab"], .vpn-plan-card, .mpm-moodle-model-toggle
  ):is(.selected, .active, .is-selected, [aria-pressed="true"], [aria-selected="true"]):not(:disabled):hover {
    background: #cbdfff !important;
  }

  html[data-site-theme="day"][data-site-palette="sol"] :is(
    button.course-nav-backdrop, button.modal-backdrop, button.drawer-backdrop,
    button.history-backdrop, .desktop-workspace-learning-toggle, .desktop-workspace-learning-toggle .learning-chevron
  ) {
    box-shadow: none !important;
  }

  html[data-site-theme="day"][data-site-palette="sol"] button.course-nav-backdrop {
    background: var(--site-subtle-backdrop) !important;
  }

  html[data-site-theme="day"][data-site-palette="sol"] :is(
    .desktop-workspace-learning-toggle, .desktop-workspace-learning-toggle .learning-chevron,
    .chat-model-dropdown select, .composer
  ) {
    background: transparent !important;
  }

  html[data-site-theme="day"][data-site-palette="sol"] .desktop-workspace-learning-toggle:hover {
    background: var(--site-accent-wash) !important;
  }

  html[data-site-theme="day"][data-site-palette="sol"] :is(.sm-cover-tabs button, .mpm-moodle-model-toggle, .vpn-plan-card) :is(b, strong, small, svg) {
    color: inherit !important;
  }
}

@layer sol-site {
  html body > button.site-theme-toggle {
    position: fixed;
    inset-inline-end: max(12px, env(safe-area-inset-right));
    inset-block-end: max(16px, env(safe-area-inset-bottom));
    z-index: 1040;
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--site-control-line, #c4a47780) !important;
    border-radius: 12px !important;
    color: var(--site-accent, #edc780) !important;
    background: color-mix(in srgb, var(--site-surface, #171728) 92%, transparent) !important;
    box-shadow: 0 3px 12px #121c3826 !important;
    backdrop-filter: blur(12px);
    cursor: pointer;
  }

  html body > button.site-theme-toggle:hover {
    background: color-mix(in srgb, var(--site-hover, #2b253b) 95%, transparent) !important;
  }

  html body > button.site-theme-toggle:focus-visible {
    outline: 2px solid var(--site-accent, #edc780) !important;
    outline-offset: 3px;
  }

  .site-theme-toggle svg { width: 19px; height: 19px; }
  .site-theme-toggle .site-theme-moon,
  .site-theme-toggle[aria-pressed="true"] .site-theme-sun { display: none; }
  .site-theme-toggle[aria-pressed="true"] .site-theme-moon { display: block; }

  @media (max-width: 979px) {
    html body:has(.bottom-nav) > button.site-theme-toggle {
      inset-block-end: calc(72px + env(safe-area-inset-bottom));
    }
  }

  html body:has(.composer) > button.site-theme-toggle {
    inset-block-start: 68px;
    inset-block-end: auto;
  }
}

/* Standalone shells, transitions, and browser-native controls. */
html[data-site-theme="day"]:not([data-theme-embedded]) {
  background: var(--site-page);
  scrollbar-color: var(--site-scroll-thumb) var(--site-surface-muted);
}

html[data-site-theme="day"] :is(.startup-loader, .app-loader, .navigation-loader, .ft-mobile-body) {
  background: var(--site-page) !important;
  color: var(--site-ink) !important;
}

html[data-site-theme="day"] :is(.startup-loader, .app-loader, .navigation-loader) :is(strong, small, span:not([class])) {
  color: var(--site-ink) !important;
}

html[data-site-theme="day"][data-theme-embedded] :is(body, #scroller, #message) {
  background: var(--site-page);
  color: var(--site-ink);
}

html[data-site-theme="day"][data-site-palette="sol"] :is(a, button, summary, input, select, textarea, [tabindex]):focus-visible {
  outline-color: var(--site-accent) !important;
}

html[data-site-theme="day"][data-site-palette="sol"] :is(.muted, .hint, .empty-state, .app-empty, .description) {
  color: var(--site-muted);
}

/* Navigation panels and menus use translucent surfaces with readable foregrounds. */
html[data-site-theme="day"] :is(
  .history-panel, .history-panel-head, .chat-tools-panel, .chat-model-dropdown,
  .sm-file-tools, .sm-section-tools, .ps-card-downloads, .progress-menu
) {
  background: var(--site-nav) !important;
  border-color: var(--site-line) !important;
  color: var(--site-ink) !important;
}

html[data-site-theme="day"] .history-panel
  :is(a, .sidebar-menu-row, .desktop-workspace-history-empty) {
  color: var(--site-ink) !important;
}

html[data-site-theme="day"] .history-panel
  :is(a, .sidebar-menu-row):hover {
  background-color: var(--site-accent-wash) !important;
  color: var(--site-accent) !important;
}

html[data-site-theme="day"] :is(
  .mpm-bulk-backdrop, .mpm-result-backdrop, .sm-modal-backdrop, .vpn-modal-backdrop, .pv-build-backdrop,
  .ps-wizard-backdrop, .auth-backdrop, .app-modal-backdrop
) {
  background-color: var(--site-drawer-backdrop) !important;
}

/* Feature surfaces whose styles are loaded after the shared layout. */
html[data-site-theme="day"] :is(
  .admin-main, .welcome-page, .welcome-step, .welcome-promo, .welcome-start,
  .sol-experience, .me-page, .vpn-page, .sm-page, .presentation-page, .ecg-page, .ea-page, .tests-root,
  .learning-page, .max-page, .vk-page, .clinical-page, .clinical-document-page
) {
  background: var(--site-page) !important;
  color: var(--site-ink) !important;
}

html[data-site-theme="day"] :is(
  .clinical-search-card, .clinical-table-wrap, .clinical-doc-header, .clinical-toc, .clinical-reader-tools,
  .clinical-reader, .clinical-section, .clinical-content-card, .chat-history-dialog,
  .admin-stat-card, .admin-table, .ps-library-card, .ps-export-card, .ps-empty, .pv-toolbar, .pv-build-dialog,
  .presentation-wizard, .presentation-cost-item, .sm-subject, .sm-unit, .sm-dialog, .sm-cover-dialog,
  .sm-download-dialog, .sm-upload-dialog, .sm-upload-item, .sm-empty, .sm-office-fallback,
  .vpn-page .vpn-network, .vpn-page .vpn-hero, .vpn-page .vpn-card, .vpn-dialog, .vpn-trial-dialog,
  .vpn-wait-dialog, .vpn-network-server, .mpm-moodle-panel, .mpm-bulk-modal, .mpm-result-modal,
  .max-card, .vk-card, .ft-card, .ft-dropzone, .ft-file, .ea-result, .ea-drop, .me-card, .package-card,
  .help-answer, .randomizer, .legal-content, .container > .card, .example, .example-row, .ai-chart-card, .ai-chart-canvas-wrap
) {
  background: var(--site-surface-glass) !important;
  border-color: var(--site-line) !important;
  color: var(--site-ink) !important;
}

html[data-site-theme="day"] :is(.vpn-page .vpn-trial, .vpn-plan-card, .sm-unit-head, .sm-viewer-bar, .sm-editor-bar, .sm-upload-footer,
  .presentation-wizard-progress, .ps-progress, .mpm-moodle-panel-body, .admin-tabs) {
  background: var(--site-nav) !important;
  border-color: var(--site-control-line) !important;
  color: var(--site-ink) !important;
}

html[data-site-theme="day"] :is(
  .sm-file-name, .sm-viewer-title, .sm-upload-item-head, .sm-upload-section-label, .sm-title,
  .ps-library-heading, .ps-heading, .ps-result-heading, .pv-heading, .vpn-page .vpn-network-heading h2,
  .vpn-page .vpn-network-server h3, .vpn-page .vpn-card-heading, .vpn-hero-tagline,
  .admin-sidebar a, .admin-sidebar summary, .admin-header strong, .clinical-title a, .clinical-toc a
) {
  color: var(--site-ink) !important;
}

html[data-site-theme="day"] :is(
  .welcome-content > p, .welcome-caption, .clinical-source, .clinical-doc-meta, .clinical-doc-header p,
  .clinical-hero p, .sm-viewer-meta, .sm-upload-item-meta, .sm-upload-section-hint, .sm-dialog-meta,
  .sm-viewer-loading, .sm-download-loading, .sm-unit-count, .ps-card-status, .ps-template-loading,
  .vpn-network-heading p, .vpn-network-server > p, .vpn-network-state, .vpn-network-footer, .vpn-network-caption,
  .vpn-network-index, .mpm-moodle-model-label, .mpm-practice-status, .mpm-bulk-modal-legend,
  .ft-brand span, .ft-send-title p, .ft-send-footer, .ft-dropzone span, .ea-hint
) {
  color: var(--site-muted) !important;
}

html[data-site-theme="day"] :is(.welcome-content h1 span, .welcome-brand-text, .home-brand-med, .home-brand-rest,
  .vpn-hero-title, .sol-reveal h1 span) {
  background-image: linear-gradient(105deg, var(--site-ink), var(--site-accent), var(--site-accent-secondary)) !important;
}

html[data-site-theme="day"] :is(.sm-upload-error, .sm-form-error, .pv-loading-error, .checkout-error, .mpm-bulk-modal-message.is-error) {
  color: var(--site-danger) !important;
  border-color: var(--site-danger-line) !important;
}

html[data-site-theme="day"] :is(.sm-upload-track, .presentation-wizard-progress, .mpm-bulk-progress-track, .pdf-loader-track) {
  background-color: var(--site-selected) !important;
}

html[data-site-theme="day"] :is(.presentation-wizard-progress-fill, .mpm-bulk-progress-fill, .pdf-loader-fill) {
  background: var(--site-primary) !important;
}

html[data-site-theme="day"] :is(.startup-spinner, .sm-viewer-spinner, .ps-card-spinner) {
  border-color: var(--site-accent-wash);
  border-top-color: var(--site-accent);
}

/* Surrounding ECG UI. Paper, trace, grid, labels, and rendering code are independent. */
html[data-site-theme="day"] :is(.ecg-controls, .bailey-card, .ecg-sheet-card, .ecg-mode-guide,
  .ecg-guide-card, .ecg-guide-check, .ea-upload-list) {
  background: var(--site-surface-glass) !important;
  color: var(--site-ink) !important;
  border-color: var(--site-line) !important;
}

html[data-site-theme="day"] :is(.ecg-heading p, .ecg-note, .ecg-guide-subtitle, .ecg-guide-card p, .ecg-guide-leads-label) {
  color: var(--site-muted) !important;
}

html[data-site-theme="day"] :is(.ecg-guide-title, .ecg-guide-card-head, .ecg-guide-card b, .ecg-guide-check b,
  .ecg-guide-num, .ecg-guide-badge, .ecg-guide-lead) {
  color: var(--site-accent) !important;
}

html[data-site-theme="day"] :is(.ecg-guide-num, .ecg-guide-badge, .ecg-guide-lead) {
  background: var(--site-accent-wash) !important;
  border-color: var(--site-line) !important;
}

html[data-site-theme="day"] .admin-shell {
  background: transparent !important;
  border-color: var(--site-line) !important;
}

html[data-site-theme="day"] :is(.admin-sidebar, .chat-background-upload) {
  background: var(--site-nav) !important;
  color: var(--site-ink) !important;
  border-color: var(--site-line) !important;
}

html[data-site-theme="day"] .chat-background-upload small { color: var(--site-muted); }
html[data-site-theme="day"] .chat-background-upload.failed small { color: var(--site-danger); }
html[data-site-theme="day"] .chat-upload-ring {
  background: conic-gradient(var(--site-primary) var(--upload-progress), var(--site-selected) 0);
}
html[data-site-theme="day"] .chat-upload-ring::after { background: var(--site-surface); }

html[data-site-theme="day"] .trainer-theme-toggle[aria-pressed="true"] {
  background: var(--site-selected);
  border-color: var(--site-accent-line);
  color: var(--site-accent);
}
html[data-site-theme="day"] .trainer-theme-toggle[aria-pressed="true"]:hover { background: #cbdfff; }

html[data-site-theme="day"] body[data-moodle-connect-entry] {
  background: var(--site-page);
  color: var(--site-ink);
}
html[data-site-theme="day"] body[data-moodle-connect-entry] a { color: var(--site-accent); }
html[data-site-theme="day"] .moodle-connect {
  background: var(--site-surface-glass);
  color: var(--site-ink);
  border-color: var(--site-line);
}
html[data-site-theme="day"] .moodle-connect :is(p, small, .moodle-connect-status) {
  color: var(--site-muted);
}

html[data-site-theme="day"] .welcome-page {
  --welcome-bg: var(--site-page);
  --welcome-bg-soft: var(--site-surface-muted);
  --welcome-surface: #ffffffc2;
  --welcome-surface-solid: var(--site-surface);
  --welcome-card: var(--site-surface);
  --welcome-line: var(--site-line);
  --welcome-text: var(--site-ink);
  --welcome-muted: var(--site-muted);
  --welcome-blue: var(--site-accent);
  --welcome-green: var(--site-success);
  --welcome-violet: var(--site-accent-secondary);
}
html[data-site-theme="day"] .welcome-header.is-scrolled {
  background: #f9fbffc7;
  border-color: var(--site-line);
}
html[data-site-theme="day"] .welcome-header-button {
  background: var(--site-accent-wash);
  border-color: var(--site-accent-line);
  color: var(--site-accent);
}
html[data-site-theme="day"] .welcome-header-button:hover { background: var(--site-selected); }

html[data-site-theme="day"] :is(.buy-package, .ft-send-shell .ft-send-button, .vpn-network-refresh, .help-suggestions button) {
  background: var(--site-control) !important;
  color: var(--site-accent) !important;
  border-color: var(--site-control-line) !important;
}
html[data-site-theme="day"] :is(.buy-package, .ft-send-shell .ft-send-button, .vpn-network-refresh, .help-suggestions button):hover {
  background: var(--site-hover) !important;
  color: var(--site-accent) !important;
}

html[data-site-theme="day"] :is(.ma-eyebrow, .ma-count span, .ma-drop small, .payments-summary .metric span, .admin-header p) {
  color: var(--site-muted) !important;
}
html[data-site-theme="day"] :is(.ma-drop, .payments-filters .filter b, .payment-status-badge) {
  background: var(--site-control) !important;
  color: var(--site-ink) !important;
  border-color: var(--site-line) !important;
}
html[data-site-theme="day"] .payment-status-badge.paid {
  background: var(--site-success-bg) !important;
  color: var(--site-success) !important;
}
html[data-site-theme="day"] .payment-status-badge:is(.failed, .cancelled) {
  background: var(--site-danger-bg) !important;
  color: var(--site-danger) !important;
}

/* Desktop workspace: the same palette covers the fixed panel, rail and injected rows. */
@layer sol-site {
  html[data-site-theme="day"] #desktop-workspace-navigation {
    background: linear-gradient(180deg, var(--site-surface), var(--site-page)) !important;
    color: var(--site-ink) !important;
    border-color: var(--site-line) !important;
  }

  html[data-site-theme="day"].desktop-workspace-navigation-collapsed #desktop-workspace-rail {
    background: var(--site-page) !important;
    border-color: var(--site-line) !important;
  }

  html[data-site-theme="day"] #desktop-workspace-navigation :is(
    .desktop-workspace-brand, .desktop-workspace-links a, .desktop-workspace-learning-toggle,
    .desktop-workspace-history-chat, .desktop-workspace-footer a, .desktop-workspace-promo
  ) {
    color: var(--site-ink) !important;
  }

  html[data-site-theme="day"] #desktop-workspace-navigation :is(
    .desktop-workspace-brand small, .desktop-workspace-links p, .desktop-workspace-history > p,
    .desktop-workspace-history-empty, .desktop-workspace-history.is-guest > span,
    .desktop-workspace-footer span, .desktop-workspace-promo small
  ) {
    color: var(--site-muted) !important;
  }

  html[data-site-theme="day"] #desktop-workspace-navigation :is(
    .desktop-workspace-topbar, .desktop-workspace-history, .desktop-workspace-footer, .desktop-workspace-learning-menu
  ) {
    border-color: var(--site-line) !important;
  }

  html[data-site-theme="day"] #desktop-workspace-navigation :is(
    .desktop-workspace-links svg, .desktop-workspace-history svg, .desktop-workspace-promo i
  ) {
    color: var(--site-accent) !important;
  }

  html[data-site-theme="day"] #desktop-workspace-navigation :is(
    .desktop-workspace-learning-toggle svg, .desktop-workspace-learning-menu svg, .desktop-workspace-promo svg
  ) {
    stroke: var(--site-accent) !important;
  }

  html[data-site-theme="day"] #desktop-workspace-navigation :is(
    .desktop-workspace-login, .desktop-workspace-footer a, .desktop-workspace-promo
  ) {
    background: var(--site-accent-wash) !important;
    color: var(--site-accent) !important;
    border-color: var(--site-line) !important;
  }

  html[data-site-theme="day"] #desktop-workspace-navigation :is(
    .desktop-workspace-login, .desktop-workspace-footer a, .desktop-workspace-promo, .desktop-workspace-links a
  ):hover,
  html[data-site-theme="day"] #desktop-workspace-navigation .desktop-workspace-history-row:is(:hover, :focus-within) {
    background: var(--site-accent-wash) !important;
    color: var(--site-accent) !important;
    border-color: var(--site-accent-line) !important;
  }

  html[data-site-theme="day"] #desktop-workspace-navigation .desktop-workspace-links a:is(.active, [aria-current="page"]) {
    background: var(--site-selected) !important;
    color: var(--site-accent) !important;
    border-color: var(--site-accent-line) !important;
  }

  html[data-site-theme="day"] #desktop-workspace-navigation .desktop-workspace-history-action::after {
    background: var(--site-surface) !important;
    border-color: var(--site-line) !important;
    color: var(--site-ink) !important;
  }
}

/* Public home. Glass panels retain their translucency on the day background. */
html[data-site-theme="day"] .welcome-page :is(.welcome-extension, .welcome-openai, .welcome-visual),
html[data-site-theme="day"] .home-sol-link {
  background: linear-gradient(135deg, #ffffffee, #eaf0f9dc) !important;
  border-color: var(--site-line) !important;
  color: var(--site-ink) !important;
  box-shadow: 0 16px 40px #263e641c !important;
}

html[data-site-theme="day"] .home-sol-link:hover { border-color: var(--site-accent-line) !important; }
html[data-site-theme="day"] :is(.home-sol-copy > small, .home-sol-copy b, .home-sol-arrow) {
  color: var(--site-accent) !important;
}
html[data-site-theme="day"] .home-sol-copy > span { color: var(--site-muted) !important; }

html[data-site-theme="day"] .welcome-metric:nth-child(1) { --metric-day: #5b4197; }
html[data-site-theme="day"] .welcome-metric:nth-child(2) { --metric-day: #056276; }
html[data-site-theme="day"] .welcome-metric:nth-child(3) { --metric-day: #19644d; }
html[data-site-theme="day"] .welcome-metric:nth-child(4) { --metric-day: #805400; }
html[data-site-theme="day"] .welcome-metric:nth-child(5) { --metric-day: #992c67; }
html[data-site-theme="day"] .welcome-metric:nth-child(6) { --metric-day: #2457a4; }
html[data-site-theme="day"] .welcome-metric :is(dd, .welcome-metric-icon) { color: var(--metric-day); }
html[data-site-theme="day"] .welcome-metric-line {
  background: var(--metric-day);
  box-shadow: none;
}

html[data-site-theme="day"] .welcome-page :is(
  .welcome-chips > span, .welcome-openai-status, .visual-message-user, .visual-message-ai, .visual-tools > span, .visual-input
) {
  background: var(--site-accent-wash) !important;
  color: var(--site-ink-secondary) !important;
  border-color: var(--site-line) !important;
}
html[data-site-theme="day"] .welcome-page :is(
  .visual-top b, .visual-message-ai p, .visual-message-ai p b, .welcome-openai-status span, .welcome-openai-status b
) { color: var(--site-ink-secondary) !important; }
html[data-site-theme="day"] .welcome-page :is(.visual-message-ai .mini-brand, .visual-input b) {
  background: var(--site-primary);
  color: var(--site-on-primary);
}
html[data-site-theme="day"] .welcome-openai-logo { background: var(--site-accent-wash); }
html[data-site-theme="day"] .openai-logo-night { display: none !important; }
html[data-site-theme="day"] .welcome-openai-logo .openai-logo-day { display: block !important; }
html[data-site-theme="day"] .welcome-extension-install {
  background: var(--site-primary);
  border-color: var(--site-accent-line);
  color: var(--site-on-primary) !important;
}
html[data-site-theme="day"] .welcome-extension-install:hover { background: var(--site-primary-hover); }
html[data-site-theme="day"] .welcome-extension-install small { color: var(--site-on-primary); }

/* Presentation library, including cards rendered after the library request. */
html[data-site-theme="day"] .ps-studio {
  --ps-border: var(--site-line);
  --ps-soft: var(--site-accent-wash);
}
html[data-site-theme="day"] .ps-hero {
  background: linear-gradient(135deg, #ffffffee, #e2edfcda) !important;
  border-color: var(--site-line) !important;
}
html[data-site-theme="day"] .ps-hero h2 { background: none !important; }
html[data-site-theme="day"] :is(.ps-eyebrow, .ps-library-heading a, #ps-library-count, .ps-pill, .ps-enlarge) {
  color: var(--site-accent) !important;
}
html[data-site-theme="day"] :is(.ps-pill, #ps-library-count) { background: var(--site-accent-wash); }
html[data-site-theme="day"] .ps-library-link .ps-file-copy h3 { color: var(--site-ink) !important; }
html[data-site-theme="day"] .ps-library-link .ps-file-copy small { color: var(--site-muted); }
html[data-site-theme="day"] .ps-create-button {
  background: var(--site-primary) !important;
  color: var(--site-on-primary) !important;
}
html[data-site-theme="day"] .ps-create-button:hover {
  background: var(--site-primary-hover) !important;
  color: var(--site-on-primary) !important;
}

/* Course dashboard, opened outline and lesson blocks share the same surfaces. */
html[data-site-theme="day"] .courses-root {
  --course-accent: var(--site-accent);
  --course-card: var(--site-surface);
  --course-soft: var(--site-accent-wash);
}

html[data-site-theme="day"] .courses-root :is(
  .course-card-progress-visual, .course-module-orbit, .course-module-orbit-more, .course-public-meta,
  .published-course-search, .courses-orbit-card, .courses-hero-metrics span,
  .course-nav-overview, .course-nav-overview .course-search, .course-nav .nav-module,
  .course-dashboard .metric-grid article, .dashboard-panels article,
  .lesson-settings-popover, .lesson-block-popover, .course-element-tutor, .element-tutor-message.assistant,
  .element-tutor-message.user
) {
  background: var(--site-inset) !important;
  color: var(--site-ink) !important;
  border-color: var(--site-line) !important;
  box-shadow: none !important;
}

html[data-site-theme="day"] .courses-root :is(
  .courses-hero-v2 h1 span, .course-nav-kicker, .course-nav-label,
  .orbit-label, .progress-orbit small, .course-level, .course-card-footer a, .course-type-label, .element-tutor-message small
) { color: var(--site-accent) !important; }

html[data-site-theme="day"] .courses-root :is(
  .courses-hero-copy > p, .course-card-v2 > p, .course-card-progress-copy > small,
  .course-card-progress-copy > span, .course-public-meta b, .course-card-footer > span, .metric-grid article > small,
  .course-element-tutor header > div > p:last-child, .element-tutor-controls small
) { color: var(--site-muted) !important; }

html[data-site-theme="day"] .courses-root :is(
  .courses-hero-metrics b, .progress-orbit b, .course-overall-orbit b, .course-card-v2 .course-card-top > b,
  .course-card-progress-copy > b, .course-module-orbit b, .course-public-meta > span,
  .metric-grid .metric-date, .course-nav-overview .course-progress b, .element-tutor-message-content
) { color: var(--site-ink) !important; }
html[data-site-theme="day"] .courses-root :is(.course-public-label, .course-complete-pill) {
  color: var(--site-success) !important;
}
html[data-site-theme="day"] .courses-root .course-overall-orbit small { color: var(--site-accent) !important; }

html[data-site-theme="day"] .courses-root .courses-aurora i:nth-child(-n + 2) {
  background: radial-gradient(circle, var(--site-selected), transparent 67%);
}
html[data-site-theme="day"] .courses-root .progress-orbit {
  background: conic-gradient(var(--site-primary) calc(var(--progress) * 1%), var(--site-selected) 0) !important;
}
html[data-site-theme="day"] .courses-root .course-overall-orbit {
  background: conic-gradient(var(--site-primary) calc(var(--course-progress) * 1%), var(--site-selected) 0) !important;
}
html[data-site-theme="day"] .courses-root .course-module-orbit-ring {
  background: conic-gradient(var(--site-primary) calc(var(--module-progress) * 1%), var(--site-selected) 0) !important;
}
html[data-site-theme="day"] .courses-root .course-overall-orbit::before,
html[data-site-theme="day"] .courses-root :is(.progress-orbit > div, .course-module-orbit-ring i) {
  background: var(--site-surface) !important;
  color: var(--site-accent) !important;
  box-shadow: none !important;
}
html[data-site-theme="day"] .courses-root .course-player > .course-player-toolbar {
  background: var(--site-nav) !important;
  color: var(--site-ink) !important;
  border-color: var(--site-line) !important;
}
html[data-site-theme="day"] .courses-root .course-home-button {
  background: var(--site-accent-wash) !important;
  border-color: var(--site-control-line) !important;
  color: var(--site-accent) !important;
}
html[data-site-theme="day"] .courses-root .course-home-button:hover { background: var(--site-hover) !important; }
html[data-site-theme="day"] .courses-root .course-home-button span { color: inherit; }

html[data-site-theme="day"] .courses-root :is(.course-type-icon, .course-type-done, .course-type-badge) {
  background: var(--site-accent-wash) !important;
  color: var(--site-accent) !important;
}

html[data-site-theme="day"] .courses-root .course-nav-overview .course-progress b::after {
  color: var(--site-accent);
}

/* ECG interface controls only. No rules target the sheet, mini traces or their labels. */
html[data-site-theme="day"] .ecg-page :is(.ecg-mode-copy small, .ecg-mode-note, .ecg-rhythm-explain,
  .speed-title small, .hr-scale, .angle-scale) {
  color: var(--site-muted) !important;
}
html[data-site-theme="day"] .ecg-page :is(.control-kicker, .ecg-mode-kicker, .hr-title, .speed-title, .ecg-rhythm-field > span) {
  color: var(--site-accent) !important;
}
html[data-site-theme="day"] .ecg-page .hr-title strong { color: var(--site-ink) !important; }
html[data-site-theme="day"] .ecg-page :is(.hr-panel, .speed-panel) { border-color: var(--site-line); }
html[data-site-theme="day"] .ecg-page :is(.ecg-rhythm-options, .sheet-header .sheet-chip, .ecg-mode-button .ecg-mode-state) {
  background: var(--site-accent-wash) !important;
  color: var(--site-accent) !important;
  border-color: var(--site-line) !important;
}
html[data-site-theme="day"] .ecg-page .ecg-mode-button .ecg-mode-dot { background: var(--site-accent) !important; }
html[data-site-theme="day"] .ecg-page .ecg-mode-button.active .ecg-mode-state {
  background: #e1f5eabf !important;
  color: var(--site-success) !important;
}
html[data-site-theme="day"] .ecg-page .ecg-own-cta {
  background: var(--site-surface-glass) !important;
  border-color: var(--site-line) !important;
  color: var(--site-ink) !important;
}
html[data-site-theme="day"] .ecg-page .ecg-own-cta :is(p, small) { color: var(--site-muted) !important; }

html[data-site-theme="day"] .ecg-page :is(.ecg-controls, .bailey-card, .ecg-sheet-card) {
  box-shadow: 0 16px 42px #263e641c !important;
}

html[data-site-theme="day"] .ecg-page .ecg-back {
  background: var(--site-accent-wash) !important;
  border-color: var(--site-control-line) !important;
  color: var(--site-accent) !important;
}
html[data-site-theme="day"] .ecg-page .ecg-back:hover {
  background: var(--site-hover) !important;
}

/* Welcome page: use a flat canvas and a single accent for the hero copy. */
@layer sol-site {
  html[data-site-theme="day"][data-site-palette="sol"]:has(.welcome-page),
  html[data-site-theme="day"][data-site-palette="sol"] body:has(.welcome-page),
  html[data-site-theme="day"][data-site-palette="sol"] .welcome-page {
    background: var(--site-page) !important;
  }

  html[data-site-theme="day"][data-site-palette="sol"] .welcome-button.welcome-button-secondary {
    background: var(--site-surface-glass) !important;
    color: var(--site-accent) !important;
    border-color: var(--site-control-line) !important;
    box-shadow: none !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] .welcome-button.welcome-button-secondary:hover {
    background: var(--site-hover) !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] .sol-promo-activate {
    background: var(--site-primary) !important;
    color: var(--site-on-primary) !important;
    -webkit-text-fill-color: var(--site-on-primary) !important;
    border-color: var(--site-accent-line) !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] .sol-promo-activate:hover {
    background: var(--site-primary-hover) !important;
  }
}

html[data-site-theme="day"] .welcome-page :is(.welcome-hero h1 em, .welcome-final h2 em) {
  color: var(--site-accent);
  -webkit-text-fill-color: currentColor;
  background: none;
}
html[data-site-theme="day"] .welcome-page :is(.welcome-orb, .welcome-final-glow, .welcome-bonus)::after {
  background: none;
}
html[data-site-theme="day"] .welcome-page :is(.welcome-orb, .welcome-final-glow) { background: none; }
html[data-site-theme="day"] .welcome-page :is(.welcome-med-tool, .study-card, .welcome-bonus, .sol-promo-card) {
  background: var(--site-surface-glass);
  color: var(--site-ink);
  border-color: var(--site-line);
  box-shadow: 0 14px 36px #253e6414;
}
html[data-site-theme="day"] .welcome-page :is(.welcome-med-tool, .welcome-visual)::before { background: none; }

html[data-site-theme="day"] .welcome-page :is(
  .hero-node, .study-score, .welcome-feature-list > div, .med-tool-tags span,
  .med-ecg-icon, .med-guides-stack > div, .med-accr-progress, .course-line, .course-mentor,
  .patient-dialog, .patient-actions span, .browser-bar, .browser-bar span, .browser-option, .browser-answer,
  .bonus-mark
) {
  background: var(--site-inset);
  color: var(--site-ink);
  border-color: var(--site-line);
  box-shadow: none;
}

html[data-site-theme="day"] .welcome-page :is(
  .welcome-proof, .study-card-front > span, .study-score span, .med-tool-label > i,
  .med-guides-stack span, .med-accr-progress li, .med-accr-progress > div span,
  .course-head small, .course-line span, .course-mentor small, .patient-head span,
  .patient-progress, .browser-bar span, .browser-answer p, .sol-promo-copy p, .welcome-footer, .welcome-footer a
) { color: var(--site-muted); }

html[data-site-theme="day"] .welcome-page :is(
  .hero-node, .study-card small, .med-tool-source, .course-line > i, .patient-dialog span,
  .browser-body small, .welcome-inline-link, .welcome-promo small, .sol-promo-eyebrow
) { color: var(--site-accent); }
html[data-site-theme="day"] .welcome-page :is(
  .study-score b, .med-accr-progress li.done, .course-head > strong, .course-line > i.done,
  .patient-head > strong, .browser-answer b, .promo-status
) { color: var(--site-success); }
html[data-site-theme="day"] .welcome-page :is(.patient-dialog p, .patient-progress b) { color: var(--site-ink); }
html[data-site-theme="day"] .welcome-page :is(.mini-brand, .patient-avatar, .course-mentor > span) {
  background: var(--site-primary);
  color: var(--site-on-primary);
}
html[data-site-theme="day"] .welcome-page :is(.study-progress, .patient-progress div, .med-guides-stack i) {
  background: var(--site-selected);
}
html[data-site-theme="day"] .welcome-page :is(.patient-progress i, .browser-bar i, .visual-top i) {
  background: var(--site-primary);
}
html[data-site-theme="day"] .welcome-page .med-accr-progress > div {
  border-color: var(--site-selected);
  border-top-color: var(--site-accent);
  border-right-color: var(--site-accent);
}

/* Calculator catalog, input, results, interpretation and history. */
html[data-site-theme="day"] .medical-page { color: var(--site-ink); }
html[data-site-theme="day"] .medical-page :is(
  .medical-card, .medical-input-card, .medical-result-card, .medical-ai-card, .medical-clinical-meaning,
  .medical-history-item, .medical-external, .medical-search-box, .medical-empty
) {
  background: var(--site-surface-glass);
  color: var(--site-ink);
  border-color: var(--site-line);
  box-shadow: 0 10px 30px #263e6410;
}
html[data-site-theme="day"] .medical-page :is(
  .medical-check, .medical-result-notes, .medical-result-placeholder, .medical-ai-price, .medical-ai-message,
  .medical-data-grid > div, .medical-card-icon, .medical-patient-note, .medical-history-count
) {
  background: var(--site-inset);
  color: var(--site-ink);
  border-color: var(--site-line);
}
html[data-site-theme="day"] .medical-page .medical-card:hover {
  background: var(--site-surface-muted);
  border-color: var(--site-accent-line);
}
html[data-site-theme="day"] .medical-page :is(
  .medical-header p, .medical-card p, .medical-tag, .medical-breadcrumb, .medical-catalog-tools > p,
  .medical-formula-description, .medical-field small, .medical-field-help, .medical-check small,
  .medical-result-card p, .medical-history-date, .medical-history-title small, .medical-history-value small,
  .medical-section-heading p, .medical-history-body p, .medical-ai-message > small, .medical-external p
) { color: var(--site-muted); }
html[data-site-theme="day"] .medical-page :is(
  .medical-breadcrumb a, .medical-eyebrow, .medical-search-box > span, .medical-card-bottom,
  .medical-card-bottom b, .medical-card-icon, .medical-sources a, .medical-sources summary,
  .medical-history-actions a, .medical-clinical-meaning dt, .medical-result-value, .medical-history-value
) { color: var(--site-accent); }
html[data-site-theme="day"] .medical-page :is(
  .medical-field > span, .medical-patient-note > span, .medical-clinical-meaning dd, .medical-ai-toggle b,
  .medical-ai-body label, .medical-ai-message strong, .medical-ai-message > div, .medical-data-grid dd,
  .medical-history-title strong, .medical-external h2, .medical-result-value > span
) { color: var(--site-ink) !important; }
html[data-site-theme="day"] .medical-page :is(.medical-free, .medical-data-grid dt, .medical-ai-toggle small) {
  color: var(--site-success) !important;
}
html[data-site-theme="day"] .medical-page .medical-free {
  background: var(--site-success-bg);
  border-color: var(--site-success-line);
}
html[data-site-theme="day"] .medical-page :is(.medical-error, .medical-ai-error) { color: var(--site-danger); }
@layer sol-site {
  html[data-site-theme="day"] .medical-page .medical-search-box input {
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
  }
  html[data-site-theme="day"] .medical-page .medical-ai-card :is(.medical-ai-toggle, .medical-secondary) {
    background: var(--site-control) !important;
    color: var(--site-ink) !important;
    border-color: var(--site-control-line) !important;
  }
  html[data-site-theme="day"] .medical-page .medical-ai-card :is(.medical-ai-toggle, .medical-secondary):hover {
    background: var(--site-hover) !important;
  }
}

/* Public landing pages and information panels. */
html[data-site-theme="day"] body:has(.top [data-launch]) {
  --bg: var(--site-page);
  --panel: var(--site-surface);
  --text: var(--site-ink);
  --muted: var(--site-muted);
  --accent: var(--site-accent);
  --line: var(--site-line);
}
html[data-site-theme="day"] body:has(.top [data-launch]) :is(.top, .example, .cards article, .steps li, .scope, .closing, .faq details),
html[data-site-theme="day"] :is(
  .help-page header, #help-form, .release-content, .release-feature, .release-guide, .release-steps > li,
  .moodle-extension-page, .me-release-note, .me-browser, .me-browser-top, .me-browser-body, .me-model-select,
  .me-ai-answer, .me-feature, .me-privacy-card, .me-shield, .me-final-orb,
  .sol-landing, .duo-model, .duo-detail, .duo-detail > article, #luna-details, #terra-details, #sol-details,
  .legal-content .permission, .legal-content .note, .legal-content code, .center-card
) {
  background: var(--site-surface-glass) !important;
  color: var(--site-ink) !important;
  border-color: var(--site-line) !important;
}
html[data-site-theme="day"] :is(.release-content, .moodle-extension-page, .sol-landing) {
  box-shadow: 0 12px 38px #263e6414;
}
html[data-site-theme="day"] .release-content .release-sky { opacity: .12; }
html[data-site-theme="day"] :is(.release-content, .moodle-extension-page, .sol-landing) :is(
  p, small, summary, .release-label, .release-headline, .release-vpn-benefits span, .me-model-badge, .duo-note, .sol-kicker
) { color: var(--site-muted) !important; }
html[data-site-theme="day"] :is(.release-content, .moodle-extension-page, .sol-landing) :is(
  .release-vpn-benefits span, .release-step-title span, .me-model-badge
) {
  background: var(--site-accent-wash) !important;
  color: var(--site-accent) !important;
}
html[data-site-theme="day"] :is(.release-page-nav span, .help-page footer, .legal-content small,
  .clinical-sync-note, .clinical-meta, .clinical-pagination, #clinical-total, #clinical-page-number) {
  color: var(--site-muted) !important;
}
html[data-site-theme="day"] :is(.release-page-nav a, .help-home, .help-page footer a, .legal-content a, .clinical-back) {
  color: var(--site-accent) !important;
}
html[data-site-theme="day"] .help-page :is(label, header p) { color: var(--site-muted); }
html[data-site-theme="day"] :is(.release-header h1, .vpn-hero h1, .vpn-hero h1 span, .vpn-trial-copy h2 em, .vpn-price) {
  background: none !important;
  color: var(--site-ink) !important;
  -webkit-text-fill-color: currentColor !important;
}

/* File and learning tools, service connections and account pages. */
html[data-site-theme="day"] :is(
  .my-files-page, .my-files-content, .my-files-empty, .sm-search, .sm-subject, .chat-sol-welcome,
  .roulette-card, .roulette-stage, .max-panel, .vk-panel, #max-status-card, #vk-status-card, .test-card,
  .wallet-topup-offers, .wallet-topup-offer-tier, .app-wrap:has(.model-card) .page-head,
  .accr-root, .element-tutor-history, .element-tutor-model-inline
) {
  background: var(--site-surface-glass) !important;
  color: var(--site-ink) !important;
  border-color: var(--site-line) !important;
}
html[data-site-theme="day"] .randomizer .roulette-shade {
  background: linear-gradient(var(--site-surface-glass), transparent 30% 70%, var(--site-surface-glass));
}
html[data-site-theme="day"] :is(.ft-page, .ft-send-shell) {
  --ft-ink: var(--site-ink);
  --ft-muted: var(--site-muted);
  --ft-gold: var(--site-accent);
  --ft-line: var(--site-line);
}
html[data-site-theme="day"] :is(.ft-dropzone, .ft-qr-card, .ft-inbox) :is(p, small),
html[data-site-theme="day"] :is(
  .learning-page p, .learning-muted, .randomizer header p, .max-footer, .vk-footer, .test-muted,
  .sm-section-label, .app-wrap:has(.model-card) .page-head p, .model-card p, .model-api-id,
  .subscription-explainer p
) { color: var(--site-muted) !important; }
html[data-site-theme="day"] :is(
  .ft-eyebrow, .ft-text-button, .ft-header a, .learning-eyebrow, .learning-go, .learning-new, .randomizer header a,
  .randomizer header span, .max-back, .vk-back, .test-brand, .support-link, .subscription-eyebrow,
  .subscription-explainer a, .sol-model-link, .moodle-connect-label, .ecg-guide-kicker,
  .course-public-topic, .course-published-badge
) { color: var(--site-accent) !important; }
html[data-site-theme="day"] :is(.ft-live, .course-published-badge) { color: var(--site-success) !important; }
html[data-site-theme="day"] .ft-status.is-error { color: var(--site-danger) !important; }
html[data-site-theme="day"] :is(.roulette-card label, .balance-value, #topup-total, .test-btn.ghost) {
  color: var(--site-ink) !important;
}
html[data-site-theme="day"] :is(.wallet-topup-offer-tier small, .wallet-topup-offer-tier span, #topup-form label span, .sheet-note) {
  color: var(--site-muted) !important;
}

/* VPN cards include UI rendered from subscription and server data. */
html[data-site-theme="day"] .vpn-page :is(
  .vpn-back, .vpn-eyebrow, .vpn-new-label, .vpn-wallet, .vpn-empty-link, .vpn-traffic-price,
  .vpn-plan-days, #vpn-selected-days, #vpn-selected-price
) { color: var(--site-accent) !important; }
html[data-site-theme="day"] .vpn-page :is(
  .vpn-card p, .vpn-card dt, .vpn-card small, .vpn-hero p, .vpn-hero-benefits span, .vpn-trial p, .vpn-trial small,
  .vpn-muted, .vpn-plan-discount, .vpn-offer-intro
) { color: var(--site-muted) !important; }
html[data-site-theme="day"] .vpn-page :is(
  .vpn-plan-cost, .vpn-card-heading strong, .vpn-hero-benefits strong, .vpn-trial-copy span, .vpn-card dd
) { color: var(--site-ink) !important; }
html[data-site-theme="day"] .vpn-page :is(.vpn-status, .vpn-plan-discount) {
  background: var(--site-success-bg) !important;
  color: var(--site-success) !important;
}

/* Admin pages have independent cards, imports, activity panels and preview panes. */
html[data-site-theme="day"] .admin-body :is(
  .create-user-hero, .create-user-section, .analytics-intro, .analytics-notice, .analytics-empty-card,
  .chat-admin-stat, .community-admin-note, .moodle-request-wrap, .ma-count,
  .s3-panel, #s3-file-audit, .trainer-admin-card, .vpn-admin-stat, .vpn-admin-panel,
  #accr-import-monitor, #accr-mini-log, .accr-admin-note, #ambient-preview, .ambient-switch,
  .post-channel, .post-file-picker, .post-check, .post-button-item, .post-app-url, .telegram-preview,
  .telegram-preview-button, .post-info, .ps-batch, #ps-batch, .ps-catalog-toolbar, .ps-catalog-toolbar .scroll
) {
  background: var(--site-surface-glass) !important;
  color: var(--site-ink) !important;
  border-color: var(--site-line) !important;
}
html[data-site-theme="day"] .admin-body :is(
  .admin-hub-bar a, .admin-back, .admin-main > a, .s3-refresh, .s3-eyebrow, .vpn-admin-eyebrow, .moodle-badge
) { color: var(--site-accent) !important; }
html[data-site-theme="day"] .admin-body :is(
  .panel small, .metric span, .ma-header p, .ma-drop span, .ma-upload-footer span,
  .s3-footnote, .s3-status.is-off, .vpn-admin-sub, .post-files-help, .post-button-help,
  .analytics-quick-title, .moodle-empty, .chat-pagination-info, .sub-note, .trainer-model-note,
  .create-user-section small, .ambient-note, .post-send-note
) { color: var(--site-muted) !important; }
html[data-site-theme="day"] .admin-body :is(
  .chat-admin-stat strong, .chat-count, .trainer-money, .trainer-admin-card strong, .ma-drop strong,
  .ma-count strong, .post-file-picker strong, .post-info strong, .ambient-switch strong
) { color: var(--site-ink) !important; }

/* Existing night-theme contrast defects. */
html[data-site-theme="night"] .post-send-note { color: var(--sol-muted, #b8adbf); }
html[data-site-theme="night"] .vpn-page #vpn-page-title,
html[data-site-theme="night"] .release-header h1 {
  -webkit-text-fill-color: transparent;
}
html[data-site-theme="night"] body:has(.top [data-launch]) .button:not(.small):not(:hover) {
  color: #211928;
}
html[data-site-theme="night"] .ft-page button.ft-primary {
  color: #f7f1e8 !important;
  -webkit-text-fill-color: #f7f1e8 !important;
}

/* Fit headlines to the column left after the desktop sidebar is mounted. */
@media (min-width: 980px) and (max-width: 1450px) {
  html.desktop-workspace-navigation-ready .welcome-hero,
  html.desktop-workspace-navigation-ready .welcome-section {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(28px, 3.5vw, 54px);
  }
  html.desktop-workspace-navigation-ready .welcome-hero-mark { width: min(100%, 410px); }
  html.desktop-workspace-navigation-ready .welcome-hero h1 { font-size: clamp(40px, 4.4vw, 64px); }
  html.desktop-workspace-navigation-ready .welcome-section h2 { font-size: clamp(36px, 3.7vw, 54px); }
}
.welcome-page {
  -webkit-hyphens: none;
  hyphens: none;
}
.welcome-page :is(.welcome-hero h1, .welcome-section h2, .welcome-final h2) {
  overflow-wrap: normal;
  word-break: normal;
  -webkit-hyphens: none;
  hyphens: none;
}

html[data-site-theme="day"] .welcome-page .hero-mark-core {
  background: var(--site-surface-glass);
  border-color: var(--site-line);
  box-shadow: 0 12px 34px #263e641c;
}

html[data-site-theme="day"] .courses-root :is(
  .course-library-preview, .course-plan-module, .lesson-editor-card, .quiz-question, .quiz-summary,
  .creation-logs, .creation-orbit, .creation-progress-track, .course-file-attachment,
  .element-tutor-controls, .element-tutor-message-content pre,
  .course-roster-table-wrap, .course-nav .course-progress i
) {
  background: var(--site-inset) !important;
  border-color: var(--site-line) !important;
  color: var(--site-ink) !important;
}

html[data-site-theme="day"] :is(.courses-root, .course-dialog) :is(
  .course-roster-count, .course-roster-search, .course-roster-page header > p, .course-roster-empty,
  .course-roster-table td small, .course-plan-review > p, .course-plan-module > p,
  .course-plan-element-copy small, .creation-log, .creation-lock-note, .quiz-source small, .quiz-meta
) { color: var(--site-muted) !important; }

html[data-site-theme="day"] :is(.courses-root, .course-dialog) :is(
  .course-roster-percent, .course-plan-count, .creation-progress-head strong, .creation-orbit b,
  .course-roster-pagination, .quiz-source a, .quiz-question legend span, .element-tutor-controls label
) { color: var(--site-accent) !important; }

html[data-site-theme="day"] .course-dialog :is(.creation-logs, .creation-orbit, .creation-progress-track, .course-plan-module) {
  background: var(--site-inset);
  border-color: var(--site-line);
}
html[data-site-theme="day"] .course-dialog .creation-progress-track span { background: var(--site-primary); }
html[data-site-theme="day"] .course-dialog .creation-progress-head { color: var(--site-ink); }
html[data-site-theme="day"] .course-dialog .creation-log.done { color: var(--site-success) !important; }
html[data-site-theme="day"] .course-dialog :is(.creation-log.failed, .course-plan-error) { color: var(--site-danger) !important; }

html[data-site-theme="day"][data-site-palette="sol"] .sm-page .sm-subject {
  background: var(--site-surface-glass) !important;
  border-color: var(--site-line) !important;
  color: var(--site-ink) !important;
}
html[data-site-theme="day"] .sm-page :is(.sm-section-tools button, .sm-section-tools span, .sm-subject strong) {
  color: var(--site-ink) !important;
}
html[data-site-theme="day"] :is(.my-files-page, .learning-shell, .learning-card, .max-panel, .vk-panel) p,
html[data-site-theme="day"] :is(.my-files-summary small, .my-files-summary span, .test-muted, .accr-empty,
  .max-intro, .vk-intro, #max-state, #vk-state, .max-footer, .vk-footer, .medical-empty,
  #roulette-status, .roulette-history > span, .chat-sol-welcome-description, .chat-sol-welcome-lead
) { color: var(--site-muted) !important; }
html[data-site-theme="day"] :is(
  .my-files-kicker, .my-files-empty a, .models-page-kicker, .chat-sol-welcome-kicker, .chat-sol-welcome-link,
  .release-kicker, .help-page header span, .learning-shell a:not(.primary, .learning-primary), .wallet-topup-offers a
) { color: var(--site-accent) !important; }
html[data-site-theme="day"] :is(
  .my-files-summary > div, .my-file-card, .my-files-selection, .max-panel .max-icon, .vk-panel .vk-icon,
  #create-set, .roulette-stage #roulette-strip > *, .wallet-topup-offer-tier > span
) {
  background: var(--site-inset) !important;
  border-color: var(--site-line) !important;
  color: var(--site-ink) !important;
}
html[data-site-theme="day"] :is(.my-files-summary strong, .wallet-topup-offer-tier strong, .chat-sol-welcome-lead strong,
  .vpn-hero strong, .vpn-instructions strong, .roulette-stage span) { color: var(--site-ink) !important; }
html[data-site-theme="day"] .chat-sol-welcome-kicker span { color: inherit !important; }

html[data-site-theme="day"] :is(.sol-landing, .sol-update-dialog) {
  --sol-bg: var(--site-page);
  --sol-panel: var(--site-surface);
  --sol-gold: var(--site-accent);
  --sol-muted: var(--site-muted);
  --sol-text: var(--site-ink);
  --sol-line: var(--site-line);
  --sol-card: var(--site-inset);
  --sol-purple: var(--site-accent-secondary);
  color-scheme: light;
}
html[data-site-theme="day"] :is(.sol-landing, .sol-update-dialog) :is(
  .sol-promo-card, .duo-table, .duo-story-card, .duo-feature
) {
  background: var(--site-surface-glass);
  border-color: var(--site-line);
  color: var(--site-ink);
}
html[data-site-theme="day"] .sol-promo-nebula { opacity: .1; }
html[data-site-theme="day"] :is(.sol-landing, .sol-update-dialog) :is(
  .sol-topbar a, .duo-label, .story-kicker, .story-number, .sol-promo-eyebrow
) { color: var(--site-accent); }
html[data-site-theme="day"] :is(.sol-landing, .sol-update-dialog) :is(
  .sol-promo-copy p, .duo-model span, .duo-story small, .duo-note
) { color: var(--site-muted); }

html[data-site-theme="day"] .moodle-extension-page {
  --me-bg: var(--site-page);
  --me-panel: var(--site-surface);
  --me-panel-2: var(--site-surface-muted);
  --me-line: var(--site-line);
  --me-text: var(--site-ink);
  --me-muted: var(--site-muted);
  --me-blue: var(--site-accent);
  --me-cyan: var(--site-accent);
  --me-mint: var(--site-success);
  --me-green: var(--site-success);
  --me-shadow: 0 16px 42px #263e6419;
}
html[data-site-theme="day"] .moodle-extension-page :is(
  .me-home-link, .me-store-kicker, .me-store-action, .me-section-kicker, .me-question-number, .me-progress
) { color: var(--site-accent) !important; }
html[data-site-theme="day"] .moodle-extension-page :is(
  .me-release-note strong, .me-hero h1 em, .me-hero h1 span
) {
  background: none;
  color: var(--site-ink) !important;
  -webkit-text-fill-color: currentColor;
}
html[data-site-theme="day"] .moodle-extension-page :is(
  .me-feature span, .me-ai-answer span, .me-model-card span, .me-model-note
) { color: var(--site-muted) !important; }
html[data-site-theme="day"] .moodle-extension-page .is-correct {
  background: var(--site-success-bg) !important;
  color: var(--site-success) !important;
}
html[data-site-theme="day"] .moodle-extension-page .is-correct b { color: inherit; }

html[data-site-theme="day"] body:has(.top [data-launch]) .example-row p { color: var(--site-muted); }
html[data-site-theme="day"] body:has(.top [data-launch]) :is(.steps li > span, .example-row > span) {
  background: var(--site-accent-wash);
  color: var(--site-accent);
}
html[data-site-theme="day"] body:has(.top [data-launch]) .button:not(.small) {
  background: var(--site-primary);
  color: var(--site-on-primary);
}
html[data-site-theme="day"] body:has(.top [data-launch]) .button:not(.small):hover { background: var(--site-primary-hover); }
html[data-site-theme="day"] body:has(.top [data-launch]) .button.small {
  background: transparent;
  border-color: var(--site-control-line);
  color: var(--site-accent);
}
html[data-site-theme="day"] body:has(.top [data-launch]) .button.small:hover {
  background: var(--site-accent-wash);
  border-color: var(--site-accent-line);
}

html[data-site-theme="night"] body:has(.top [data-launch]) .button span {
  color: inherit;
}
html[data-site-theme="night"] body:has(.top [data-launch]) .breadcrumb { color: #b8adbf; }

html[data-site-theme="day"] .release-content .release-action {
  background: var(--site-primary);
  color: var(--site-on-primary);
}
html[data-site-theme="day"] .release-content .release-action:hover { background: var(--site-primary-hover); }

html[data-site-theme="day"] .admin-body :is(
  .chat-status-tab, .chat-bulk-btn.cleanup-empty, .chat-bulk-btn.danger-all, .community-admin-note,
  .analytics-notice, .ma-count
) {
  background: var(--site-inset) !important;
  border-color: var(--site-line) !important;
  color: var(--site-ink) !important;
}
html[data-site-theme="day"] .admin-body :is(
  #accr-progress-step, #ambient-count, #preview-text, #preview-silent, .community-admin-empty,
  .chat-bulk-count, .chat-admin-stat small, .analytics-intro p, .create-user-hero p
) { color: var(--site-muted) !important; }
html[data-site-theme="day"] .admin-body :is(#accr-progress-percent, #post-file-count, .ma-drop .ma-upload-icon) {
  color: var(--site-accent) !important;
}

/* Standalone pages use the same palette as the workspace. */
html[data-site-theme="day"] :is(.s3-admin, .ps-admin) :is(
  .s3-metrics > article, .s3-panel, .s3-config > div, .s3-files-summary > *,
  .ps-batch, .ps-catalog-toolbar, .ps-catalog-toolbar .scroll
),
html[data-site-theme="day"] :is(.legal-content .chrome, .community-admin-summary > div, .ambient-preview-content > div,
  .analytics-empty-card, .max-steps li > span, .vk-steps li > span) {
  background: var(--site-inset) !important;
  border-color: var(--site-line) !important;
  color: var(--site-ink) !important;
}
html[data-site-theme="day"] :is(.s3-admin, .ps-admin) :is(p, small, label, code, .s3-status.is-off, #s3-live-indicator),
html[data-site-theme="day"] :is(.max-panel .max-steps p, .vk-panel .vk-steps p,
  .legal-content .permission strong, .course-field-optional, .community-admin-summary small, .analytics-empty-card span) {
  color: var(--site-muted) !important;
}
html[data-site-theme="day"] :is(.s3-admin, .ps-admin) :is(a, .s3-eyebrow, .s3-header h1 span),
html[data-site-theme="day"] :is(.max-brand > span, .vk-brand > span, .randomizer a, .create-user-section label span,
  .analytics-empty-card b, .chat-sol-welcome-title span, .vpn-hero-balance span, .vpn-selection > span, .vpn-instructions a span) {
  color: var(--site-accent) !important;
}
html[data-site-theme="day"] .ca-publish-state.on { color: var(--site-success) !important; }
html[data-site-theme="day"] .vpn-page {
  --vpn-gold: var(--site-accent);
  --vpn-soft: var(--site-muted);
}
html[data-site-theme="day"] .moodle-extension-page :is(.me-nav a, .me-status, .me-kicker span, .me-steps b, .me-privacy-copy > a) {
  color: var(--site-accent) !important;
}
html[data-site-theme="day"] .moodle-extension-page :is(.me-privacy-points span, .me-footer a) {
  color: var(--site-muted) !important;
}
html[data-site-theme="day"] .me-final h2 em {
  background: none;
  color: var(--site-accent);
  -webkit-text-fill-color: currentColor;
}
html[data-site-theme="day"] .sol-landing :is(.story-features span, .story-budget strong, .duo-model strong,
  .duo-features span, .duo-detail span) { color: var(--site-accent) !important; }

@layer sol-site {
  html[data-site-theme="day"][data-site-palette="sol"] #study-materials .sm-subject {
    background: var(--site-surface-glass) !important;
    border-color: var(--site-line) !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] #study-materials :is(.sm-shortcuts button, .sm-section-tools button, .sm-section-tools span),
  html[data-site-theme="day"][data-site-palette="sol"] .test-muted,
  html[data-site-theme="day"][data-site-palette="sol"] .admin-body :is(#accr-progress-percent, #accr-progress-step, .chat-bulk-count, .post-check strong) {
    color: var(--site-ink-secondary) !important;
    -webkit-text-fill-color: currentColor !important;
  }
}

html[data-site-theme="day"] .moodle-extension-page .me-final-store-cta {
  background: var(--site-primary) !important;
  color: var(--site-on-primary) !important;
  border-color: var(--site-accent-line) !important;
  box-shadow: 0 12px 28px #263e6424 !important;
}
html[data-site-theme="day"] .moodle-extension-page .me-final-store-cta:hover {
  background: var(--site-primary-hover) !important;
}
html[data-site-theme="day"] :is(
  .me-kicker b, .me-chip-row span, .me-model-card span, .me-compat-grid span,
  .legal-content .chrome strong, .vpn-balance > span, .vpn-guide-apps > span, .vpn-network-loading,
  .ambient-preview-content span, .admin-user-note, .s3-metrics article span, .s3-nav span,
  .ps-catalog-toolbar span, .analytics-panel label span, .medical-page .medical-sources p
) { color: var(--site-muted) !important; }
html[data-site-theme="day"] :is(
  .sol-landing .duo-shared span, .chat-sol-welcome h2 span, .s3-metrics article strong,
  .ps-admin .ps-batch > summary, .section-title a[href="/app/history"]
) {
  color: var(--site-accent) !important;
  -webkit-text-fill-color: currentColor !important;
}
html[data-site-theme="day"] :is(
  .wallet-topup-offers-title > span, .vpn-guide-apps > span, .ps-admin .scroll,
  .community-verify-actions a
) {
  background: var(--site-inset) !important;
  border-color: var(--site-line) !important;
}
html[data-site-theme="day"] :is(.community-verify-head p, .wallet-topup-offers-title strong) {
  color: var(--site-ink) !important;
}

@layer sol-site {
  html[data-site-theme="day"][data-site-palette="sol"] :is(
    #study-materials .sm-courses button, #study-materials .sm-subject small,
    .max-steps li p, .vk-steps li p, .wallet-topup-offers-title small, .topup-option small,
    .admin-body .chat-table-panel :is(strong, td span), .admin-body .post-channel span,
    .admin-body .trainer-admin-card small, .admin-body .vpn-admin-panel :is(p, small, em),
    .admin-body .vpn-admin-btn:not(.primary), .admin-body .vpn-admin-stat small
  ) {
    color: var(--site-ink-secondary) !important;
    -webkit-text-fill-color: currentColor !important;
  }
}

html[data-site-theme="day"] .community-verify-alert {
  color: var(--site-danger);
  background: var(--site-danger-bg);
  border-color: var(--site-danger-line);
}
html[data-site-theme="day"] .community-verify-actions a {
  color: var(--site-accent) !important;
  border-color: var(--site-control-line) !important;
}
html[data-site-theme="day"] .community-verify-actions a:hover {
  background: var(--site-hover) !important;
}
html[data-site-theme="day"] .wallet-compact #topup-form .topup-option > span {
  background: var(--site-control) !important;
  border-color: var(--site-control-line) !important;
  color: var(--site-ink) !important;
}
html[data-site-theme="day"] .wallet-compact #topup-form .topup-option:hover > span {
  background: var(--site-hover) !important;
  border-color: var(--site-accent-line) !important;
}
html[data-site-theme="day"] .wallet-compact #topup-form .topup-option:has(input:checked) > span {
  background: var(--site-selected) !important;
  border-color: var(--site-accent-line) !important;
  box-shadow: none !important;
}
html[data-site-theme="day"] .wallet-compact #topup-form .topup-option:has(input:focus-visible) > span {
  outline-color: var(--site-accent);
}
html[data-site-theme="day"] .moodle-extension-page .me-options > div:not(.is-correct) {
  color: var(--site-ink) !important;
  background: var(--site-inset);
  border-color: var(--site-line);
}

/* Lesson content and its editor render the same blocks, including nested lists. */
html[data-site-theme="day"] :is(.courses-root, .course-dialog) {
  --course-text: var(--site-ink);
  --course-muted: var(--site-muted);
  --course-cyan: var(--site-accent);
  --course-blue: var(--site-accent);
  --course-accent: var(--site-accent);
  --course-line: var(--site-line);
  --course-card: var(--site-surface);
  --course-danger: var(--site-danger);
}

html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson :is(
  .course-paragraph, .course-list-intro, .course-list-label, .course-callout li,
  .course-timeline li, .course-accordion details, .course-task, .course-source,
  .course-formula, .course-video, .course-slideshow, .course-slideshow figcaption
) { color: var(--site-ink); }

html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson .course-sublist > li {
  background: none;
  box-shadow: none;
  color: var(--site-ink);
}

html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson :is(
  .course-algorithm > li, .course-timeline > li, .course-accordion details,
  .course-callout, .course-checkpoint, .course-checkpoint > :is(summary, p),
  .course-task, .course-formula, .course-formula code, .course-source, .course-video,
  .course-table-wrap, .course-table-wrap table, .course-table-wrap td, .course-slideshow,
  .comparison-card, .comparison-row > *,
  .quiz-view, .quiz-meta, .quiz-question label
) {
  background: var(--site-inset) !important;
  border-color: var(--site-line);
  color: var(--site-ink) !important;
}

html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson :is(
  .course-table-wrap th, .comparison-head > *, .quiz-question legend span
) {
  background: var(--site-selected) !important;
  color: var(--site-accent) !important;
}

html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson .course-algorithm > li::before {
  background: var(--site-selected);
  color: var(--site-accent);
  box-shadow: none;
}
html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson .course-callout :is(b, p) {
  color: var(--site-ink);
}
html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson .course-callout b::before {
  color: var(--site-accent);
}
html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson .course-callout:is(.warning, .red_flags) {
  background: #fce9edbf !important;
  border-left-color: var(--site-danger-line);
}
html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson .course-callout.warning b::before {
  color: var(--site-on-primary);
  background: var(--site-danger);
}
html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson .course-callout.clinical_pearl {
  background: #e1f5eabf !important;
  border-left-color: var(--site-success-line);
}
html[data-site-theme="day"] .lesson .quiz-question label:hover,
html[data-site-theme="day"] .lesson .quiz-question label:has(input:checked) {
  background: var(--site-selected) !important;
  border-color: var(--site-accent-line);
}
html[data-site-theme="day"] .lesson .quiz-question label:has(input:checked) {
  box-shadow: inset 3px 0 var(--site-accent);
}
html[data-site-theme="day"] .lesson :is(.course-table-wrap tr:hover td, .course-accordion summary:hover, .course-checkpoint summary:hover) {
  background: var(--site-hover) !important;
}
html[data-site-theme="day"] :is(.courses-root, .course-dialog) :is(.lesson-block-popover, .lesson-settings-popover) {
  background: var(--site-surface) !important;
  border-color: var(--site-line);
}
html[data-site-theme="day"] .lesson-block-popover .lesson-menu-close:hover {
  background: var(--site-hover) !important;
  color: var(--site-accent) !important;
}

/* Accreditation dashboard, attempts, explanations and question bank. */
html[data-site-theme="day"] :is(.accr-root, .accr-modal, .accr-toast) {
  --accr-gold: var(--site-accent);
  --accr-muted: var(--site-muted);
  --accr-line: var(--site-line);
  color: var(--site-ink);
}
html[data-site-theme="day"] .accr-root { background: var(--site-page) !important; }
html[data-site-theme="day"] :is(.accr-root, .accr-modal) :is(
  .accr-card, .accr-session-head, .accr-modal-card, .accr-stat,
  .accr-answer-loading, .accr-ai-loading, .accr-feedback, .accr-review-answer,
  .accr-subscription-icon
),
html[data-site-theme="day"] .accr-toast {
  background: var(--site-surface-glass) !important;
  color: var(--site-ink) !important;
  border-color: var(--site-line);
}
html[data-site-theme="day"] .accr-modal { background: var(--site-backdrop); }
html[data-site-theme="day"] .accr-root .accr-top { border-color: var(--accr-line); }
html[data-site-theme="day"] :is(.accr-root, .accr-modal) :is(
  .accr-ring-caption strong, .accr-section-title, .accr-section-head > span
) { color: var(--site-ink); }
html[data-site-theme="day"] :is(.accr-root, .accr-modal) :is(
  .accr-stat span, .accr-explain-price, .accr-session-meta, .accr-feedback small, .accr-finish p,
  .accr-variant-score small, .accr-loader, .accr-ai-meta, .accr-bank-picker label,
  .accr-bank-select-row span, .accr-progress-row span, .accr-lock-label
) { color: var(--site-muted) !important; }
html[data-site-theme="day"] .accr-root :is(.accr-mode b, .accr-mode-hint, .accr-question-number) {
  color: var(--site-accent);
}
html[data-site-theme="day"] .accr-root .accr-mode b { background: var(--site-accent-wash); }
html[data-site-theme="day"] .accr-ring-track { stroke: var(--site-selection); }
html[data-site-theme="day"] .accr-root :is(.accr-progress-bar, .accr-session-progress) { background: var(--site-selection); }
html[data-site-theme="day"] .accr-root :is(.accr-progress-bar, .accr-session-progress) i { background: var(--site-accent); }
html[data-site-theme="day"] .accr-metric-list > div { border-color: var(--accr-line); }
html[data-site-theme="day"] .accr-question-actions > span { color: var(--site-accent) !important; }
html[data-site-theme="day"] .accr-error strong { color: var(--site-danger); }
html[data-site-theme="day"] .accr-variant-score strong { color: var(--site-success); }

@layer sol-site {
  html[data-site-theme="day"][data-site-palette="sol"] :is(.accr-root, .accr-modal) :is(
    .accr-back, .accr-mode, .accr-option, .accr-favorite, .accr-history-button,
    .accr-modal-close, .accr-button.secondary
  ) {
    background: var(--site-control) !important;
    color: var(--site-ink) !important;
    border-color: var(--site-control-line) !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] :is(.accr-root, .accr-modal) :is(
    .accr-back, .accr-mode, .accr-option, .accr-favorite, .accr-history-button,
    .accr-modal-close, .accr-button.secondary
  ):hover:not(:disabled) {
    background: var(--site-hover) !important;
    border-color: var(--site-accent-line) !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] .accr-root :is(.accr-mode.featured, .accr-favorite.active, .accr-option.selected) {
    background: var(--site-selected) !important;
    color: var(--site-accent) !important;
    border-color: var(--site-accent-line) !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] .accr-root .accr-question {
    background: var(--site-surface-glass) !important;
    border-color: var(--site-line) !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] .accr-root .accr-question :is(.accr-option, .accr-favorite) {
    -webkit-text-fill-color: currentColor !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] .accr-root .accr-question .accr-option:disabled {
    opacity: 1 !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] .accr-root .accr-button:not(.secondary, .danger) {
    background: var(--site-primary) !important;
    color: var(--site-on-primary) !important;
    -webkit-text-fill-color: currentColor !important;
    border-color: var(--site-primary) !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] .accr-root .accr-button:not(.secondary, .danger):hover:not(:disabled) {
    background: var(--site-primary-hover) !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] .accr-root .accr-dashboard-link {
    background: transparent !important;
    color: var(--site-accent) !important;
    box-shadow: none !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] .accr-root .accr-dashboard-link:hover {
    background: var(--site-accent-wash) !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] :is(.accr-root, .accr-modal) :is(
    .accr-option.correct, .accr-review-answer.correct, .accr-feedback.good
  ) {
    background: var(--site-success-bg) !important;
    color: var(--site-success) !important;
    border-color: var(--site-success-line) !important;
  }
  html[data-site-theme="day"][data-site-palette="sol"] :is(.accr-root, .accr-modal) :is(
    .accr-option.wrong, .accr-review-answer.wrong, .accr-feedback.bad, .accr-button.danger
  ) {
    background: var(--site-danger-bg) !important;
    color: var(--site-danger) !important;
    border-color: var(--site-danger-line) !important;
  }
}

/* Filled chats, Markdown and dialogs that are mounted on demand. */
html[data-site-theme="day"] :is(
  .chat-model-dialog, .chat-notice, .chat-upload-dialog, .chat-balance-required,
  .shared-chat-status, .chat-page .active-template, .chat-generated-image-link,
  .chat-media-image a, .chat-page .generated-file
) {
  background: var(--site-surface-glass) !important;
  color: var(--site-ink);
  border-color: var(--site-line);
}
html[data-site-theme="day"] :is(.chat-share-dialog, .chat-upload-dialog)::backdrop,
html[data-site-theme="day"] .chat-model-modal { background: var(--site-backdrop); }
html[data-site-theme="day"] :is(
  .chat-share-dialog p, .chat-share-dialog label, .chat-upload-row span,
  .chat-generated-image-meta, .chat-balance-required__body p, .chat-page .message-time, .chat-page .cost
) { color: var(--site-muted) !important; }
html[data-site-theme="day"] .chat-share-copy-status { color: var(--site-success); }
html[data-site-theme="day"] :is(
  .chat-model-card span, .chat-model-more, .chat-share-dialog .chat-share-close,
  .chat-tools-panel .chat-tool svg, .chat-page .generated-file strong
) { color: var(--site-accent); }
html[data-site-theme="day"] :is(.chat-share-link button, .shared-chat-login, .chat-balance-required__action) {
  background: var(--site-primary);
  color: var(--site-on-primary);
}
html[data-site-theme="day"] :is(.shared-chat-login, .chat-balance-required__action):hover {
  background: var(--site-primary-hover);
  color: var(--site-on-primary);
}
html[data-site-theme="day"] .chat-page #messages ::selection {
  background: var(--site-selection);
  color: var(--site-ink);
}
html[data-site-theme="day"] :is(.chat-page #messages, .accr-ai-content) :is(
  pre, blockquote, code:not(pre code), .md-code-block, .md-code-head
) {
  background: var(--site-inset);
  color: var(--site-ink);
  border-color: var(--site-line);
}
html[data-site-theme="day"] :is(.chat-page #messages, .accr-ai-content) :is(
  .markdown-enhanced strong, .md-code-block code, pre code
) { color: var(--site-ink); }
html[data-site-theme="day"] :is(.chat-page #messages, .accr-ai-content) :is(
  .md-copy-code, .markdown-enhanced a, .markdown-enhanced .md-action-button
) { color: var(--site-accent); }
html[data-site-theme="day"] :is(.chat-page #messages, .accr-ai-content) .md-copy-code:hover {
  background: var(--site-hover);
  color: var(--site-accent);
}
html[data-site-theme="day"] .chat-page #messages .bubble.assistant th {
  background: var(--site-selected);
  color: var(--site-ink);
}
html[data-site-theme="day"] .chat-page #messages .bubble.assistant tbody tr:nth-child(even) {
  background: var(--site-inset);
}

html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson a.course-secondary {
  background: var(--site-control);
  color: var(--site-ink);
  border-color: var(--site-control-line);
}
html[data-site-theme="day"] :is(.courses-root, .course-dialog) .lesson a.course-secondary:hover {
  background: var(--site-hover);
  border-color: var(--site-accent-line);
}
html[data-site-theme="day"] .chat-balance-required :is(.chat-balance-required__icon, strong) {
  color: var(--site-danger);
}
html[data-site-theme="day"] .chat-balance-required .chat-balance-required__action {
  color: var(--site-on-primary) !important;
  border-color: var(--site-accent-line);
}

html[data-site-theme="day"] .chat-page .bubble.user :is(.message-content, .plain-message, .user-message-text) {
  color: var(--site-ink) !important;
  -webkit-text-fill-color: currentColor !important;
}
html[data-site-theme="day"] main.chat-page #messages .bubble.assistant .table-scroll {
  background: var(--site-surface);
  border-color: var(--site-line);
}
html[data-site-theme="day"] .lesson :is(.course-video-player, .course-video-frame) {
  background: var(--site-surface-muted);
}
html[data-site-theme="night"] .accr-root .accr-section-head > span {
  color: var(--accr-muted);
}

@layer sol-site {
  html[data-site-theme="night"][data-site-palette="sol"] .accr-root .accr-question [data-accr-next] {
    background: #edc780 !important;
    color: #27202a !important;
    -webkit-text-fill-color: currentColor !important;
    border-color: #edc780 !important;
  }
  html[data-site-theme="night"][data-site-palette="sol"] .accr-root .accr-question [data-accr-next]:hover {
    background: #f7dba9 !important;
  }
}

html[data-site-theme="day"] main.chat-page .chat-top-panel {
  background: var(--site-nav);
  border-color: var(--site-line);
  color: var(--site-ink);
}
html[data-site-theme="day"] .chat-top-panel :is(.chat-mobile-heading h1, .chat-balance-chip strong) {
  color: var(--site-ink);
}
html[data-site-theme="day"] .chat-top-panel .chat-mobile-heading {
  border-color: var(--site-line);
}
html[data-site-theme="day"] .chat-top-panel .chat-balance-label {
  color: var(--site-muted);
}


/* Presentation templates & live editor: daylight-only loading states.
   Keep actual slide/template images unchanged in both themes. */
html[data-site-theme="day"] .ps-studio .ps-template-cover:not(.is-loaded) {
  background: #edf3fb !important;
  border: 1px solid #ccdaeb;
}
html[data-site-theme="day"] .ps-studio .ps-template-cover:not(.is-loaded) .ps-template-loading {
  color: #245184 !important;
  -webkit-text-fill-color: currentColor !important;
}
html[data-site-theme="day"] .ps-studio .ps-template-orbit {
  background: #e4eefb;
  box-shadow: 0 0 0 1px #bed0e6, 0 3px 12px #1d4b8615;
}
html[data-site-theme="day"] .ps-studio .ps-template-orbit::before,
html[data-site-theme="day"] .ps-studio .ps-template-orbit::after {
  border-color: #bfcee1;
  border-top-color: #2765b3;
  border-right-color: #4d88d0;
}
html[data-site-theme="day"] .ps-studio .ps-template-percent {
  color: #174b85 !important;
  -webkit-text-fill-color: currentColor !important;
}
html[data-site-theme="day"] .ps-studio .ps-template-track {
  background: #cddbed;
}
html[data-site-theme="day"] .ps-studio .ps-template-track i {
  background: linear-gradient(90deg,#83b2e7,#245aa8);
}
html[data-site-theme="day"] .ps-studio .ps-template-cover.is-error .ps-template-loading {
  color: #9a2743 !important;
}
html[data-site-theme="day"] .ps-studio .ps-visual .pv-open:has(#pv-placeholder:not([hidden])),
html[data-site-theme="day"] .ps-studio .ps-visual .pv-loading-scene,
html[data-site-theme="day"] .ps-studio .ps-visual .pv-thumb-wait {
  background: #f1f6fd !important;
  background-image: radial-gradient(ellipse at 50% 35%,#dfecfc,transparent 70%) !important;
  border-color: #cbd9e9 !important;
  color: #27415f !important;
}
html[data-site-theme="day"] .ps-studio .pv-loading-scene > strong,
html[data-site-theme="day"] .ps-studio .pv-loading-scene .pv-loading-title,
html[data-site-theme="day"] .ps-studio .pv-plan-empty > strong {
  color: #173d72 !important;
  -webkit-text-fill-color: currentColor !important;
}
html[data-site-theme="day"] .ps-studio .pv-loading-scene > small,
html[data-site-theme="day"] .ps-studio .pv-loading-kicker,
html[data-site-theme="day"] .ps-studio .pv-thumb-number,
html[data-site-theme="day"] .ps-studio .pv-plan-log small,
html[data-site-theme="day"] .ps-studio .pv-plan-log p,
html[data-site-theme="day"] .ps-studio .pv-plan-empty p,
html[data-site-theme="day"] .ps-studio :is(#pv-stage, #pv-save-state) {
  color: #526984 !important;
  -webkit-text-fill-color: currentColor !important;
}
html[data-site-theme="day"] .ps-studio .pv-orbit {
  color: #2263b4;
}
html[data-site-theme="day"] .ps-studio .pv-orbit::before,
html[data-site-theme="day"] .ps-studio .pv-orbit::after {
  border-color: #b8cde6;
  border-top-color: #2564b4;
  border-right-color: #7baddd;
}
html[data-site-theme="day"] .ps-studio .pv-orbit > b {
  background: radial-gradient(circle,#b9d8fc 0,#447dca 28%,#e0ecfc30 72%);
  box-shadow: 0 0 19px #487ec954;
}
html[data-site-theme="day"] .ps-studio .pv-orbit > i {
  background: #4179c1;
  box-shadow: 0 0 6px #4d82c790;
}
html[data-site-theme="day"] .ps-studio .pv-plan-pages > i {
  background: repeating-linear-gradient(0deg,transparent 0 14px,#b6d2f3 14px 17px,transparent 17px 22px),#ffffff;
  border-color: #a9c4e3;
  box-shadow: 0 8px 22px #315c8b24;
}
html[data-site-theme="day"] .ps-studio .pv-planning-steps > i {
  background: #e8f2ff;
  color: #245184;
  border-color: #bdd2eb;
}
html[data-site-theme="day"] .ps-studio .pv-thumb-wait[data-phase="planning"]::before {
  background: linear-gradient(110deg,#d9e6f7 20%,#a7c8ee 50%,#d9e6f7 80%);
  background-size: 220% 100%;
}
html[data-site-theme="day"] .ps-studio .pv-thumb,
html[data-site-theme="day"] .ps-studio .pv-sidebar {
  color: #223b5c !important;
  border-color: #cad8e9 !important;
}
html[data-site-theme="day"] .ps-studio .pv-thumb {
  background: #f7faff !important;
}
html[data-site-theme="day"] .ps-studio .pv-thumb.selected {
  background: #e5f0ff !important;
  border-color: #376fc0 !important;
  box-shadow: 0 0 0 2px #376fc026 !important;
}
html[data-site-theme="day"] .ps-studio .pv-plan-log {
  background: #f6f9fe !important;
  background-image: radial-gradient(ellipse at top right,#e5f0fc,transparent 60%) !important;
  border-color: #c9d9e9 !important;
  color: #1c3552 !important;
}
html[data-site-theme="day"] .ps-studio .pv-plan-log header {
  background: #f6f9feeF !important;
  border-bottom-color: #d1deec !important;
  color: #193d70 !important;
}
html[data-site-theme="day"] .ps-studio .pv-plan-log h3,
html[data-site-theme="day"] .ps-studio .pv-plan-log h4 {
  color: #193d70 !important;
}
html[data-site-theme="day"] .ps-studio .pv-plan-log article {
  background: #ffffff !important;
  background-image: none !important;
  border-color: #d1deec !important;
  color: #1d3553 !important;
  box-shadow: 0 6px 20px #284e7912;
}
html[data-site-theme="day"] .ps-studio .pv-plan-number {
  background: #e7f1ff !important;
  color: #22579c !important;
}
html[data-site-theme="day"] .ps-studio .pv-plan-track {
  background: #cfdfee !important;
}
html[data-site-theme="day"] .ps-studio .pv-plan-track i {
  background: linear-gradient(90deg,transparent,#3c77ca,#8aaee2,transparent) !important;
}
html[data-site-theme="day"] .ps-studio .pv-plan-skeleton {
  background: linear-gradient(90deg,#dbe8f7,#adcbea,#dbe8f7) !important;
  background-size: 200% 100% !important;
}
html[data-site-theme="day"] .ps-studio .pv-journey li {
  color: #526b88 !important;
}
html[data-site-theme="day"] .ps-studio .pv-journey li > span {
  background: #e6effc !important;
  border-color: #c9d9ec !important;
  color: #26568c !important;
}
html[data-site-theme="day"] .ps-studio .pv-journey li:is(.done,.running) {
  color: #174782 !important;
}
html[data-site-theme="day"] .ps-studio .pv-toolbar,
html[data-site-theme="day"] .ps-studio .pv-footer {
  background: #ffffff !important;
  color: #233951 !important;
  border-color: #cedbeb !important;
}
html[data-site-theme="day"] .ps-studio .pv-toolbar button:not(:disabled),
html[data-site-theme="day"] .ps-studio .pv-move-tools button:not(:disabled) {
  color: #214f8c;
  border-color: #aec5e1;
}
html[data-site-theme="day"] .ps-studio .pv-toolbar button:hover:not(:disabled),
html[data-site-theme="day"] .ps-studio .pv-move-tools button:hover:not(:disabled) {
  background: #e6f0ff !important;
  color: #194782 !important;
}
html[data-site-theme="day"] .ps-studio :is(.pv-heading, .pv-sidebar-title, .pv-caption, .pv-footer, .pv-versions) {
  color: #304a67 !important;
}
html[data-site-theme="day"] .ps-studio .pv-build-dialog,
html[data-site-theme="day"] .pv-build-dialog {
  background: #ffffff !important;
  background-image: radial-gradient(ellipse at 50% 0,#e9f2ff,transparent 65%) !important;
  border-color: #cad8e9 !important;
  color: #213952 !important;
}
html[data-site-theme="day"] .pv-build-dialog :is(h2, .pv-build-note, p) {
  color: #304d70 !important;
}
html[data-site-theme="day"] .pv-build-dialog .pv-build-art span {
  background: #e8f0fc !important;
  border-color: #bad0e8 !important;
}
html[data-site-theme="day"] .pv-build-dialog .pv-build-track {
  background: #d0dfed !important;
}
html[data-site-theme="day"] .pv-build-dialog .pv-build-track i {
  background: linear-gradient(90deg,#83afe7,#255fae) !important;
}


/* Daytime admin dashboard and logs: explicit foregrounds on light surfaces. */
html[data-site-theme="day"] .admin-body .admin-main {
  color: #213852 !important;
}
html[data-site-theme="day"] .admin-body .admin-hub-bar a {
  color: #2059a0 !important;
}
html[data-site-theme="day"] .admin-body .admin-header :is(h1,.eyebrow) {
  color: #193657 !important;
}
html[data-site-theme="day"] .admin-body :is(.admin-tile,.admin-stat-card,.panel) {
  background: #fff !important;
  background-image: none !important;
  color: #213852 !important;
  border-color: #d1deec !important;
}
html[data-site-theme="day"] .admin-body .admin-tile:hover {
  background: #f0f6ff !important;
  border-color: #8fb1db !important;
}
html[data-site-theme="day"] .admin-body .admin-tile strong,
html[data-site-theme="day"] .admin-body :is(.admin-stat-card,.panel) :is(h2,h3,strong) {
  color: #193657 !important;
  -webkit-text-fill-color: currentColor !important;
}
html[data-site-theme="day"] .admin-body .admin-tile small,
html[data-site-theme="day"] .admin-body :is(.admin-stat-card,.panel) :is(small,.muted) {
  color: #526a83 !important;
}
html[data-site-theme="day"] .admin-body .admin-tile > span {
  color: #275fa4 !important;
}
html[data-site-theme="day"] .admin-body .admin-main:has(#liveLogs) .panel {
  background: #fff !important;
  background-image: none !important;
  border-color: #d1deec !important;
}
html[data-site-theme="day"] .admin-body .admin-main:has(#liveLogs) .panel-title {
  border-color: #d7e3ef !important;
}
html[data-site-theme="day"] .admin-body .admin-main:has(#liveLogs) .panel-title small {
  color: #526b85 !important;
}
html[data-site-theme="day"] .admin-body .logs-toolbar {
  background: #f5f8fd !important;
  color: #253e59 !important;
  border-color: #d1dfef !important;
}
html[data-site-theme="day"] .admin-body .logs-toolbar :is(select,.btn),
html[data-site-theme="day"] .admin-body .log-archive-bar :is(button,input) {
  color-scheme: light;
  color: #234568 !important;
  background: #fff !important;
  border-color: #b9cde4 !important;
}
html[data-site-theme="day"] .admin-body .logs-toolbar :is(select,.btn):hover:not(:disabled),
html[data-site-theme="day"] .admin-body .log-archive-bar button:hover:not(:disabled) {
  background: #e7f0ff !important;
  color: #174b89 !important;
  border-color: #7ea5d3 !important;
}
html[data-site-theme="day"] .admin-body :is(.logs-toolbar select,.log-archive-bar input):focus-visible {
  outline: 2px solid #276bc0 !important;
  outline-offset: 2px;
}

html[data-site-theme="day"] .admin-body .status-badges span {
  color: #285781 !important;
  background: #ebf3fd !important;
  border: 1px solid #c1d4e9 !important;
  box-shadow: none !important;
}
html[data-site-theme="day"] .admin-body .status-badges span:hover {
  background: #dceaff !important;
}
html[data-site-theme="day"] .admin-body .admin-tile:focus-visible {
  outline: 2px solid #2668b9 !important;
  outline-offset: 2px;
}


/* Mobile home: harmonize dynamically injected home-greeting components with
   the real daylight palette. Scoped to the app home and mobile viewport only. */
@media (max-width: 640px) {
  html[data-site-theme="day"] .app-root:has(.home-main-actions) {
    --home-mobile-ink: #1b2b42;
    --home-mobile-muted: #526882;
    --home-mobile-line: #c8d5e5;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .chats-start-area {
    padding-top: clamp(72px, 11dvh, 105px) !important;
    padding-bottom: 26px !important;
    width: min(calc(100% - 24px), 600px) !important;
    box-sizing: border-box;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-greeting {
    margin-bottom: 18px !important;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-greeting-title,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-brand-med,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-brand-rest {
    color: #17467c;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-brand-med,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-brand-rest {
    background-image: linear-gradient(105deg,#18385d 0%,#205c9e 45%,#3c79b8 66%,#18385d 100%) !important;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-main-actions {
    gap: 12px;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-new-chat-button {
    position: relative;
    top: auto;
    z-index: 2;
    min-height: 66px;
    border: 1px solid #aebfd5;
    background: linear-gradient(145deg,#fff,#f2f6fc);
    color: #1c3553 !important;
    box-shadow: 0 5px 20px rgba(38,68,111,.08), inset 0 1px 0 #fff;
    backdrop-filter: none;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-new-chat-button:hover,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-new-chat-button:focus-visible {
    border-color: #3979bf;
    background: #eef5ff;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-new-chat-icon,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-new-chat-send {
    background: #e8f0fb;
    color: #215c9c;
    border-color: #c5d6eb;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-new-chat-placeholder {
    color: #375d86 !important;
    -webkit-text-fill-color: #375d86 !important;
    font-weight: 600;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-new-chat-caret {
    background: #3a78b9;
    box-shadow: none;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-new-chat-button::after {
    background: radial-gradient(circle,rgba(91,151,217,.09),transparent 72%);
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-nav-grid {
    gap: 9px;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-nav-card {
    min-height: 91px;
    padding: 12px 5px;
    background: linear-gradient(150deg,#fff,#f8faff);
    border-color: #d1dbea;
    color: var(--home-mobile-ink) !important;
    box-shadow: 0 5px 16px rgba(35,66,109,.08);
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-nav-card:hover,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-nav-card:focus-visible {
    background: #edf5ff;
    color: #123e70 !important;
    border-color: #7ea8d6;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-nav-card strong {
    color: inherit !important;
    -webkit-text-fill-color: currentColor !important;
    font-size: clamp(11px,3.2vw,13px);
    line-height: 1.27;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-nav-icon {
    background: #edf3fa;
    border-color: #cfdae9;
    color: #3c76ac;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-nav-profile .home-nav-icon {
    color: #35658e;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-sol-link {
    border-color: #bed0e7 !important;
    background: linear-gradient(140deg,#fff,#edf4ff) !important;
    color: #19395f !important;
    box-shadow: 0 8px 24px rgba(41,84,143,.09) !important;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-sol-copy > strong {
    color: #173658 !important;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-sol-copy > small,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-sol-copy b,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-sol-arrow {
    color: #245fa5 !important;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-sol-copy > span {
    color: #5a6d84 !important;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history {
    margin-top: 8px;
    background: #fff !important;
    border-color: #cbd8e8 !important;
    box-shadow: 0 8px 26px rgba(36,66,105,.09) !important;
    color: var(--home-mobile-ink);
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history-head {
    border-color: #e0e8f2;
    background: #f7faff;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history-title h2,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history-copy strong,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history-item {
    color: var(--home-mobile-ink) !important;
    -webkit-text-fill-color: currentColor !important;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history-copy small,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history-item time,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history-state {
    color: var(--home-mobile-muted) !important;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history-chat-icon,
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history-title-icon {
    color: #2e69a7;
    background: #eaf2fc;
    border-color: #d4e2f2;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history-item:hover {
    background: #f0f6ff;
    border-color: #d5e4f5;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-history-clear {
    background: #f0f5fc;
    border-color: #c8d7e8;
    color: #23527e !important;
    -webkit-text-fill-color: currentColor !important;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-visits-panel {
    background: #fff !important;
    border-color: #d0dceb !important;
    color: #486788 !important;
    box-shadow: 0 5px 18px rgba(39,74,119,.07);
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-visits-panel strong {
    color: #1d4c81 !important;
  }
  /* No floating wallet button over the composer, history or section cards. */
  html[data-site-theme="day"] .app-root:has(.home-main-actions) {
    position: relative;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-account-chips {
    position: absolute !important;
    top: calc(var(--app-content-safe-top,0px) + 8px) !important;
    right: max(12px,env(safe-area-inset-right)) !important;
    z-index: 8;
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-balance-chip {
    color: #214c7b !important;
    background: #fff !important;
    border-color: #c4d5e7 !important;
    box-shadow: 0 4px 14px rgba(40,75,119,.11);
  }
  html[data-site-theme="day"] .app-root:has(.home-main-actions) .home-balance-chip strong {
    color: #1b426e !important;
  }
}
