:root {
  color-scheme: dark;
  --nova-app-bg: #080b12;
  --nova-app-surface: rgba(19, 25, 39, .94);
  --nova-app-surface-secondary: #111827;
  --nova-app-surface-raised: #171f30;
  --nova-app-text: #edf2fb;
  --nova-app-text-muted: #a3aec3;
  --nova-app-border: rgba(160, 174, 202, .17);
  --nova-app-border-strong: rgba(160, 174, 202, .3);
  --nova-app-input: #111827;
  --nova-app-hover: rgba(114, 89, 219, .18);
  --nova-app-overlay: rgba(5, 8, 15, .82);
  --nova-app-code: #080d16;
  --nova-page-bg: #080b12;
  --nova-page-surface: rgba(19, 25, 39, .94);
  --nova-page-surface-raised: #171f30;
  --nova-page-line: rgba(160, 174, 202, .17);
  --nova-page-line-strong: rgba(160, 174, 202, .3);
  --nova-page-text: #edf2fb;
  --nova-page-muted: #a3aec3;
  --nova-page-accent: #7259db;
  --nova-page-accent-soft: rgba(114, 89, 219, .13);
  --nova-page-success: #13825c;
  --nova-page-danger: #c73d50;
}

:root[data-theme="light"] {
  color-scheme: light;
  --nova-app-bg: #f4f6fb;
  --nova-app-surface: rgba(255, 255, 255, .96);
  --nova-app-surface-secondary: #f7f8fc;
  --nova-app-surface-raised: #ffffff;
  --nova-app-text: #182033;
  --nova-app-text-muted: #59657a;
  --nova-app-border: rgba(37, 48, 69, .14);
  --nova-app-border-strong: rgba(37, 48, 69, .24);
  --nova-app-input: #ffffff;
  --nova-app-hover: rgba(87, 64, 184, .09);
  --nova-app-overlay: rgba(20, 27, 42, .42);
  --nova-app-code: #111827;
  --bg: #f4f6fb;
  --bg-elevated: #ffffff;
  --panel: #ffffff;
  --panel-2: #f7f8fc;
  --panel-3: #edf0f7;
  --text: #182033;
  --muted: #5e687d;
  --line: rgba(37, 48, 69, .14);
  --line-strong: rgba(37, 48, 69, .24);
  --nova-page-bg: #f4f6fb;
  --nova-page-surface: rgba(255, 255, 255, .96);
  --nova-page-surface-raised: #ffffff;
  --nova-page-line: rgba(37, 48, 69, .14);
  --nova-page-line-strong: rgba(37, 48, 69, .24);
  --nova-page-text: #182033;
  --nova-page-muted: #59657a;
  --nova-page-accent: #5740b8;
  --nova-page-accent-soft: rgba(87, 64, 184, .1);
  --nova-page-success: #08734e;
  --nova-page-danger: #b42338;
  --border: rgba(37, 48, 69, .14);
  --border2: rgba(37, 48, 69, .22);
  --card: rgba(255, 255, 255, .82);
  --card2: rgba(246, 248, 252, .96);
  --shadow: 0 18px 50px rgba(28, 39, 65, .12);
  --shadow2: 0 10px 26px rgba(28, 39, 65, .1);
}

html[data-theme="light"],
html[data-theme="light"] body {
  background-color: var(--nova-app-bg) !important;
  color: var(--nova-app-text) !important;
}

html[data-theme="light"] body {
  background-image: radial-gradient(circle at 14% 0%, rgba(110, 91, 196, .06), transparent 42%) !important;
}

html[data-theme="light"] :is(
  .shell, .app-shell, .left-sidebar, #sidebar, .sidebar, .panel, .chat-panel,
  .chat-top, #chat, #desktopProjectWorkspace, .workspace-section,
  .nova-desktop-projects, .project-workspace-card, .project-panel-card,
  #desktopProjectWorkspace #desktopProjectPhaseList,
  #desktopProjectWorkspace #desktopProjectTaskList,
  .nova-project-product-summary, .nova-project-execution-tree,
  .composer, .composer-wrap, .composer-box, .memory-panel, .memory-card,
  .main-topbar, .session-item, #sessionsList, .session-list-shell,
  .desktop-session-list, .nova-menu-panel, .menu-panel, .dropdown-menu,
  .drawer, .mobile-drawer, .modal, .modal-content, [role="dialog"],
  #nova-mobile-tools-panel, #nova-mobile-projects-panel, .mobile-header,
  .mobile-composer, .nova-mobile-project-card, .nova-mobile-project-details,
  .nova-mobile-project-next-move
) {
  background-color: var(--nova-app-surface) !important;
  color: var(--nova-app-text) !important;
  border-color: var(--nova-app-border) !important;
}

html[data-theme="light"] :is(
  .message-bubble.assistant, .chat-message.assistant, .message.assistant,
  .msg.assistant, .msg.assistant .bubble, .message.assistant .bubble,
  .nova-mobile-message.assistant, .nova-mobile-project-next-move,
  .nova-mobile-project-card, .tool-call-card, .approval-card, .artifact-card,
  .error-card, .execution-state-card, .loading-state, .execution-status-card
) {
  background-color: var(--nova-app-surface-raised) !important;
  color: var(--nova-app-text) !important;
  border-color: var(--nova-app-border) !important;
}

html[data-theme="light"] :is(.message.user .bubble, .msg.user .bubble, .message-bubble.user, .nova-mobile-message.user) {
  background-color: #e7eaff !important;
  color: var(--nova-app-text) !important;
  border-color: var(--nova-app-border) !important;
}

html[data-theme="light"] :is(
  .session-item:hover, #sessionsList > *:hover, .desktop-session-item:hover,
  .session-item.active, .desktop-session-item.is-active,
  .session-item[aria-current="true"], #sessionsList > [aria-selected="true"],
  .nova-menu-panel button:hover, .dropdown-menu button:hover
) {
  background-color: var(--nova-app-hover) !important;
  color: var(--nova-app-text) !important;
}

html[data-theme="light"] :is(
  input:not([type="checkbox"]):not([type="radio"]), textarea, select,
  button, .btn, .sidebar-btn, .composer-btn, .mobile-header-btn
) {
  color: var(--nova-page-text);
  border-color: var(--nova-app-border-strong);
}

html[data-theme="light"] :is(input:not([type="checkbox"]):not([type="radio"]), textarea, select) {
  background-color: var(--nova-app-input) !important;
}

html[data-theme="light"] :is(button, .btn, .sidebar-btn, .composer-btn, .mobile-header-btn) {
  background-color: var(--nova-app-surface-secondary) !important;
}

html[data-theme="light"] :is(.composer textarea, #input, #composerInput, #nova-mobile-input)::placeholder {
  color: var(--nova-app-text-muted) !important;
}

html[data-theme="light"] :is(a, .message-content a, .nova-mobile-message a) {
  color: #4b36a8;
}

html[data-theme="light"] :is(
  .muted, .text-muted, .message-role, .setting-copy p,
  .nova-mobile-projects-eyebrow, .nova-mobile-project-message
) {
  color: var(--nova-page-muted) !important;
}

html[data-theme="light"] :is(button, a, input, textarea, select, [tabindex]):focus-visible {
  outline-color: #5740b8 !important;
}

html[data-theme="light"] :is(pre, code, .code-block, .markdown-code) {
  color-scheme: dark;
  background-color: var(--nova-app-code);
}

html[data-theme="light"] :is(img, video, .image-container, .video-container) {
  background-color: transparent !important;
}

html[data-theme="light"] .settings-status[data-state="error"] {
  color: var(--nova-page-danger) !important;
}

/* Theme the actual desktop and mobile app surfaces after their legacy styles. */
html[data-theme="light"] :is(
  .messages, .chat-messages, .mobile-chat-container, #mobileChatMessages,
  .nova-mobile-messages, .nova-mobile-project-list,
  .nova-project-task-card, .nova-project-file-card, .nova-project-note-card,
  .nova-project-activity-item, .nova-mobile-project-overview,
  .nova-mobile-project-current, .nova-mobile-project-coming-up,
  .nova-mobile-project-completed, .nova-mobile-project-mission-control,
  .nova-mobile-project-section, .nova-mobile-project-notes-list,
  .nova-mobile-project-activity-list, .nova-mobile-project-task-card,
  .nova-mobile-project-file, .nova-mobile-project-note
) {
  color: var(--nova-app-text) !important;
  border-color: var(--nova-app-border) !important;
}

html[data-theme="light"] :is(
  .session-item, .desktop-session-item, #sessionsList > *, #desktopSessionList > *,
  .session-placeholder, .primary-side-button, #newSessionBtn, #newProjectBtn,
  #sendBtn, #attachBtn, .nova-menu-button, .nova-project-task-actions button,
  .nova-project-tree-controls button, .nova-mobile-project-actions button,
  .nova-mobile-project-create button, .nova-mobile-project-retry,
  .nova-mobile-project-back, .nova-mobile-project-close
) {
  color: var(--nova-app-text) !important;
  border-color: var(--nova-app-border-strong) !important;
}

html[data-theme="light"] :is(
  .nova-menu-panel, .nova-menu-panel button, #newProjectModal .nova-project-modal-dialog,
  #newProjectModal .nova-project-modal-header, #newProjectModal .nova-project-modal-body,
  #newProjectModal .nova-project-modal-footer
) {
  background-color: var(--nova-app-surface) !important;
  color: var(--nova-app-text) !important;
  border-color: var(--nova-app-border) !important;
}

html[data-theme="light"] .nova-menu-panel button:hover {
  background-color: var(--nova-app-hover) !important;
}

html[data-theme="light"] #newProjectModal .nova-project-modal-backdrop,
html[data-theme="light"] #nova-mobile-tools-backdrop {
  background-color: var(--nova-app-overlay) !important;
}

html[data-theme="light"] #nova-mobile-tools-panel {
  background-color: var(--nova-app-surface) !important;
  color: var(--nova-app-text) !important;
  border-color: var(--nova-app-border) !important;
}

html[data-theme="light"] #nova-mobile-tools-panel :is(button, a) {
  background-color: var(--nova-app-surface-secondary) !important;
  color: var(--nova-app-text) !important;
  border-color: var(--nova-app-border) !important;
}

html[data-theme="light"] #nova-mobile-tools-panel :is(.nova-mobile-menu-eyebrow, .nova-mobile-menu-group > p) {
  color: var(--nova-app-text-muted) !important;
}

html[data-theme="light"] #nova-mobile-tools-panel .nova-mobile-menu-logout {
  background-color: rgba(180, 35, 56, .08) !important;
  color: var(--nova-page-danger) !important;
}
