/* Dark is the default palette; an explicit choice may use light. */
:root,
:root[data-theme="dark"] {
  color-scheme: dark;
  --paper: #080c15;
  --ink: #edf3ff;
  --muted: #a0aec4;
  --orange: #ff7950;
  --orange-dark: #ff8f6d;
  --forest: #0e1b26;
  --line: #ffffff17;
  --cyan: #75e2e8;
  --violet: #b6a0ff;
  --panel: #101725;
  --soft: #172235;
  --field: #0b1321;
  --theme-track: #162233;
  --theme-selected: #2b3a50;
  --theme-shadow: #00000040;
}
:root[data-theme="light"] {
  color-scheme: light;
  --paper: #ffffff;
  --ink: #1c293d;
  --muted: #5d6d83;
  --orange: #ff7950;
  --orange-dark: #e66c46;
  --forest: #edf7f8;
  --line: #dce4ef;
  --cyan: #167985;
  --violet: #7251b6;
  --panel: #ffffff;
  --soft: #f4f7fb;
  --field: #ffffff;
  --theme-track: #edf2f7;
  --theme-selected: #ffffff;
  --theme-shadow: #22344d17;
}
.header-tools, .nav-actions, .account-header-tools {
  display: flex; align-items: center; gap: 14px; flex-shrink: 0;
}
.theme-switch {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px;
  margin: 0; border: 1px solid var(--line); border-radius: 9px;
  background: var(--theme-track); flex-shrink: 0;
}
.theme-switch button {
  display: inline-flex; align-items: center; justify-content: center; gap: 5px;
  min-height: 32px; padding: 6px 8px; margin: 0;
  border: 1px solid transparent; border-radius: 6px;
  color: var(--muted); background: transparent; font: 500 11px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  white-space: nowrap; cursor: pointer; transition: background .15s, color .15s;
}
.theme-switch button:hover { color: var(--ink); }
.theme-switch svg { width: 13px; height: 13px; flex-shrink: 0; }
:root[data-theme-preference="light"] .theme-switch [data-theme-choice="light"],
:root[data-theme-preference="dark"] .theme-switch [data-theme-choice="dark"] {
  color: var(--ink); background: var(--theme-selected);
  box-shadow: 0 1px 5px var(--theme-shadow); border-color: var(--line);
}
.theme-switch button:focus-visible { outline: 2px solid var(--orange); outline-offset: 3px; }
.nova-page .nav .trial-label, .nova-page .nav .trial-label-compact, .nova-page .nav .trial-label-mobile { font: inherit; }
.trial-label-compact, .trial-label-mobile { display: none; }
.account-page { background: var(--paper); color: var(--ink); }
.account-page > header { gap: 16px; flex-wrap: wrap; }
.account-header-tools { margin-left: auto; }
.account-header-tools > span { color: var(--muted); font-size: 12px; }

/* White mode retains the same grid, straight artwork and two product colors. */
:root[data-theme="light"] body.ai-theme {
  background: radial-gradient(ellipse at 8% 14%, #dff4f73b, transparent 38%),
    radial-gradient(ellipse at 94% 25%, #ebe5fb38, transparent 34%), #fff;
}
:root[data-theme="light"] body.ai-theme::before {
  background-image: linear-gradient(#567fa008 1px, transparent 1px), linear-gradient(90deg, #567fa008 1px, transparent 1px);
}
:root[data-theme="light"] ::selection { background: #ddd3f4; color: #31234f; }
:root[data-theme="light"] .brand-page .site-header,
:root[data-theme="light"] .nova-page .header { background: #ffffffed; border-color: var(--line); }
:root[data-theme="light"] :is(.header-inner nav, .nova-page .nav nav) { color: #5e6f87; }
:root[data-theme="light"] :is(.header-inner nav a:hover, .header-inner nav .active, .product-title h2, .section-lead h2, .partner-copy h2, .workspace-top h3, .preview-copy h4) { color: var(--ink); }
:root[data-theme="light"] .brand-page .brand-logo small { color: #6b7b90; }
:root[data-theme="light"] :is(.intro-top .eyebrow, .intro-copy, .section-lead>p, .product-title p, .studio-lead) { color: #576b84; }
:root[data-theme="light"] :is(.edition, .product-grid-note, .footer-bottom, .sidebar-caption) { color: #6c7f98; }
:root[data-theme="light"] .brand-page .intro h1 span {
  background-image: linear-gradient(100deg, #177e89, #7654b7 82%); color: #386d8e;
}
:root[data-theme="light"] .studio-page .studio-intro h1>span { background-image: linear-gradient(110deg, #7653b9, #25808d); color: #7653b9; }
:root[data-theme="light"] .circuit-track { stroke: #477f9c; opacity: .28; }
:root[data-theme="light"] .circuit-pulse, :root[data-theme="light"] .circuit-node { stroke: #198491; }
:root[data-theme="light"] .circuit-node { fill: #198491; }
:root[data-theme="light"] .intro-atmosphere rect { stroke: #6e9caf; }
:root[data-theme="light"] .intro-atmosphere rect[fill] { fill: #edf7fa; }
:root[data-theme="light"] .intro-atmosphere svg>path:last-of-type { stroke: #37778c; }
:root[data-theme="light"] .brand-page .product-card {
  background: linear-gradient(145deg, #eff9fb, #ffffff 62%); border-color: #bcdde3;
  box-shadow: inset 0 1px #fff, 0 18px 45px -32px #23627525;
}
:root[data-theme="light"] .brand-page .studio-card {
  background: linear-gradient(145deg, #f7f2ff, #fff 62%); border-color: #d8caed;
  box-shadow: inset 0 1px #fff, 0 18px 45px -32px #6b3fa82b;
}
:root[data-theme="light"] .brand-page .product-card:hover { border-color: #74b7c2; box-shadow: 0 20px 45px -32px #23627533; }
:root[data-theme="light"] .brand-page .studio-card:hover { border-color: #b79bde; box-shadow: 0 20px 45px -32px #6b3fa833; }
:root[data-theme="light"] .brand-page .product-pill { color: #337683; background: #e6f3f6; border-color: #c3dfe5; }
:root[data-theme="light"] .brand-page .studio-card .product-pill { color: #76569b; background: #f1eafa; border-color: #ddccef; }
:root[data-theme="light"] .brand-page :is(.nova-scene, .studio-scene) {
  border-color: #dce5ef;
  background: linear-gradient(#5c89aa0a 1px, transparent 1px), linear-gradient(90deg, #5c89aa0a 1px, transparent 1px), #f3f7fb;
  background-size: 20px 20px, 20px 20px, auto;
}
:root[data-theme="light"] .brand-page .nova-chat { background: #fff; color: #253c52; border-color: #cad9e6; box-shadow: 0 10px 25px #263e5710; }
:root[data-theme="light"] .brand-page :is(.chat-bar, .chat-bottom) { border-color: #dfe7ef; }
:root[data-theme="light"] .brand-page .nova-avatar { background: #e3f2f4; color: #275962; border-color: #c5e1e5; }
:root[data-theme="light"] :is(.chat-bar small, .chat-bottom, .scene-caption, .ai-processing) { color: #647b91; }
:root[data-theme="light"] .brand-page .incoming { background: #eef3f9; color: #31465e; border-color: #e3eaf1; }
:root[data-theme="light"] .brand-page .outgoing { background: #e0f3ef; color: #275d59; border-color: #c4e4de; }
:root[data-theme="light"] :is(.studio-canvas-label, .studio-canvas-label span:last-child) { color: #736487; }
:root[data-theme="light"] .brand-page .poster-card { border-color: #cfdee4; box-shadow: 0 8px 22px #31445f17; }
:root[data-theme="light"] .brand-page .copy-paper { background: #fff; color: #3c3156; border-color: #d9cce9; box-shadow: 0 12px 30px #49326e1b; }
:root[data-theme="light"] .brand-page :is(.paper-top, .paper-foot) { color: #7a698b; border-color: #e5ddec; }
:root[data-theme="light"] .brand-page .paper-line { background: #e5deef; }
:root[data-theme="light"] .brand-page .video-chip { background: #f1eafa; color: #503d70; border-color: #d7c6ec; box-shadow: 0 8px 20px #49326e17; }
:root[data-theme="light"] .brand-page :is(.video-chip svg, .video-chip small) { color: #7d63a4; }
:root[data-theme="light"] .brand-page .inline-features { color: #536d81; }
:root[data-theme="light"] .brand-page .inline-features li { background: #ffffff70; border-color: #cfdee8; }
:root[data-theme="light"] .brand-page .studio-card .inline-features { color: #77618c; }
:root[data-theme="light"] .brand-page .studio-card .inline-features li { background: #ffffff70; border-color: #ddd0eb; }
:root[data-theme="light"] .brand-page .product-link { color: #213a50; border-color: #cbdde6; }
:root[data-theme="light"] .brand-page .studio-card .product-link { border-color: #dfd2eb; }
:root[data-theme="light"] .brand-page .section-lead .eyebrow { color: #3b8190; }
:root[data-theme="light"] .brand-page :is(.journeys article, .journeys article+article) { background: #f8fafde6; border-color: #dce5ef; }
:root[data-theme="light"] .brand-page .journeys h3 { color: #26364d; }
:root[data-theme="light"] .brand-page :is(.journeys p, .partner-copy>p:last-child) { color: #5c6f85; }
:root[data-theme="light"] .brand-page .journey-flow { color: #697f97; }
:root[data-theme="light"] .brand-page .journey-flow i { color: #8a9cb1; }
:root[data-theme="light"] .brand-page .underlined-link { color: #287d89; border-color: #82b4bd; }
:root[data-theme="light"] .brand-page .journeys article+article .underlined-link { color: #7955ad; border-color: #b8a1d5; }
:root[data-theme="light"] .brand-page .partner-section { background: radial-gradient(ellipse at 100% 0, #e9def958, transparent 60%), #f5f8fc; border-color: #d9e1ed; }
:root[data-theme="light"] :is(.partner-copy .eyebrow, .partner-actions>p, .closing-line, .footer-nav) { color: #63768e; }
:root[data-theme="light"] .brand-page .partner-mark { color: #5c7396; }
:root[data-theme="light"] .brand-page .button-dark { background: #21394e; border-color: #21394e; color: #fff; }
:root[data-theme="light"] .brand-page .button-dark:hover { background: #31536d; }
:root[data-theme="light"] .brand-page .closing-line>a { color: #395f7b; }
:root[data-theme="light"] .studio-page :is(.studio-intro .eyebrow, .workspace-top .eyebrow, .preview-copy .eyebrow) { color: #80629d; }
:root[data-theme="light"] .studio-page .studio-availability { color: #6a7a91; }
:root[data-theme="light"] .studio-page .studio-hero-art { border-color: #d8c6e9; box-shadow: 0 0 0 8px #b493e005, 0 20px 55px -38px #8b62bb55; }
:root[data-theme="light"] .studio-page .workspace-shell { background: #fff; border-color: #d7dfee; box-shadow: 0 15px 50px #31445f0b; }
:root[data-theme="light"] .studio-page .workspace-sidebar { background: #f4f6fb; border-color: #dfe4ef; }
:root[data-theme="light"] .studio-page .workspace-brand { color: #3b2e52; }
:root[data-theme="light"] .studio-page .scene-tabs button { color: #66738a; }
:root[data-theme="light"] .studio-page .scene-tabs button>span { color: #8a6ab5; }
:root[data-theme="light"] .studio-page .scene-tabs button[aria-selected=true] { background: #ece5f8; color: #68449c; border-color: #d6c4ec; box-shadow: inset 2px 0 #8a68ba; }
:root[data-theme="light"] .studio-page .scene-tabs button:hover { color: #674294; background: #f0ebf8; }
:root[data-theme="light"] .studio-page .sidebar-note { color: #718097; border-color: #dbe2ed; }
:root[data-theme="light"] .studio-page .workspace-top { border-color: #e0e5ef; }
:root[data-theme="light"] .studio-page .workspace-status { color: #83649f; background: #f6f1fb; border-color: #e5d9f0; }
:root[data-theme="light"] .studio-page :is(.brief-layout form>label, .brief-fields label) { color: #596b83; }
:root[data-theme="light"] .studio-page :is(.brief-layout input, .brief-layout textarea, .brief-layout select) { background: #fff; border-color: #ccd6e3; color: #304157; }
:root[data-theme="light"] .studio-page :is(.brief-layout input:hover, .brief-layout textarea:hover, .brief-layout select:hover) { border-color: #b49acf; }
:root[data-theme="light"] .studio-page .brief-layout input::placeholder,
:root[data-theme="light"] .studio-page .brief-layout textarea::placeholder { color: #718198; }
:root[data-theme="light"] .studio-page .brief-layout form>.button { background: #7652b4; border-color: #7652b4; color: #fff; }
:root[data-theme="light"] .studio-page .brief-layout form>.button:hover { background: #65429e; }
:root[data-theme="light"] .studio-page .brief-privacy { color: #6e7f94; }
:root[data-theme="light"] .studio-page .brief-preview { background: #f7f8fc; border-color: #dfe3ed; }
:root[data-theme="light"] .studio-page .preview-copy>p:last-child { color: #64738b; }
:root[data-theme="light"] .studio-page .brief-result { border-color: #dfd7ec; }
:root[data-theme="light"] .studio-page .result-header .eyebrow { color: #8a729e; }
:root[data-theme="light"] .studio-page .result-header>button { color: #76529d; background: #f5effc; border-color: #d9c6ed; }
:root[data-theme="light"] .studio-page #brief-output { background: #f6f8fc; color: #4d607b; border-color: #dfe5ef; }
:root[data-theme="light"] .studio-page #brief-message { color: #347d70; }
:root[data-theme="light"] .studio-page .studio-notes>div>.eyebrow { color: #866d9f; }
:root[data-theme="light"] .studio-page .studio-notes article p { color: #62718a; }

/* Nova's existing conversations and photos retain their original colors. */
:root[data-theme="light"] .nova-page .review-ribbon { background: #edf4f8; color: #5f7990; border-color: #dbe5ee; }
:root[data-theme="light"] .nova-page .button.dark { background: #233d53; color: #fff; border-color: #233d53; }
:root[data-theme="light"] .nova-page .button.dark:hover { background: #335773; }
:root[data-theme="light"] .nova-page .button.outline { color: #39556d; background: #ffffff70; border-color: #c4d3df; }
:root[data-theme="light"] .nova-page .button.outline:hover { background: #edf4f9; }
:root[data-theme="light"] .nova-page :is(.eyebrow, .hero .eyebrow) { color: #51798c; }
:root[data-theme="light"] .nova-page :is(.hero-lead, .section-heading>p, .scenario-copy p, .principles-intro>p, .principle-grid p, .process-list p, .faq-list p) { color: #5d7187; }
:root[data-theme="light"] .nova-page :is(.micro, .hero-note, .chat-zoom-hint, .footer p, .footer-links) { color: #687f95; }
:root[data-theme="light"] .nova-page .hero-demo-link { color: #3e7b8b; }
:root[data-theme="light"] .nova-page .hero-tags { color: #648095; }
:root[data-theme="light"] .nova-page .chat-preview { border-color: #cddae6; box-shadow: 0 15px 35px -30px #3f7d9440; }
:root[data-theme="light"] .nova-page .audience-band { background: #f7fafc; }
:root[data-theme="light"] .nova-page .audience-content { color: #658095; }
:root[data-theme="light"] .nova-page .audience-content>div { color: #55748a; }
:root[data-theme="light"] .nova-page .audience-content>div span+span::before { color: #a9becd; }
:root[data-theme="light"] .nova-page .pill-row span { color: #5e7f92; background: #f6fafc; border-color: #d2e1e8; }
:root[data-theme="light"] .nova-page .demo-section { background: linear-gradient(135deg, #f0f8fc, #f5f3fb); }
:root[data-theme="light"] .nova-page .demo-controls>button { background: #ffffff50; border-color: #e1e7ef; }
:root[data-theme="light"] .nova-page .demo-controls>button[aria-selected=true] { background: #fff; border-color: #aad4db; box-shadow: inset 2px 0 #3c9da7; }
:root[data-theme="light"] .nova-page .demo-controls>button:hover { background: #e9f3f7; }
:root[data-theme="light"] .nova-page .demo-controls>button>span { color: #4e8d9c; }
:root[data-theme="light"] .nova-page :is(.demo-controls small, .demo-footnote, .demo-panel-footer) { color: #688297; }
:root[data-theme="light"] .nova-page .demo-panel { background: #fff; border-color: #d1e0eb; }
:root[data-theme="light"] .nova-page .chat-demo-panel { background: transparent; border: 0; }
:root[data-theme="light"] .nova-page .demo-panel-footer { border-color: #dce5ed; }
:root[data-theme="light"] .nova-page .pricing-section { background: linear-gradient(125deg, #f1f8fb, #f5f3fb); }
:root[data-theme="light"] .nova-page .price-card { background: #fff; border-color: #d4dfea; }
:root[data-theme="light"] .nova-page .price-card.recommended { background: #fff; border-color: #86bdc8; box-shadow: 0 15px 40px -32px #37778e50; }
:root[data-theme="light"] .nova-page :is(.price-top, .price-subtitle, .price>span, .price-caption, .price-card ul) { color: #638095; }
:root[data-theme="light"] .nova-page .recommend-badge { color: #387e88; background: #e7f4f4; border-color: #cbe4e7; }
:root[data-theme="light"] .nova-page .plain-badge { color: #6a8093; background: #f1f5f8; }
:root[data-theme="light"] .nova-page .pricing-note { color: #6e8295; }
:root[data-theme="light"] .nova-page .note-icon { color: #698da1; border-color: #91afbf; }
:root[data-theme="light"] .nova-page .compare-button { color: #3c8290; }
:root[data-theme="light"] .nova-page .process-list li { border-color: #cedee8; }
:root[data-theme="light"] .nova-page .faq-list summary>span { color: #7f99af; }
:root[data-theme="light"] .nova-page .closing-inner { color: var(--ink); background: linear-gradient(120deg, #edf8fa, #f2edfb); border-color: #cce1ea; }
:root[data-theme="light"] .nova-page .closing .eyebrow { color: #4a8c99; }
:root[data-theme="light"] .nova-page .closing p { color: #647d94; }
:root[data-theme="light"] .nova-page .footer-bottom { color: #71869b; }
:root[data-theme="light"] .nova-page .nova-studio-cross { background: linear-gradient(110deg, #f0f6fc, #f7f1ff); border-color: #ded1ee; }
:root[data-theme="light"] .nova-page .nova-studio-cross>div>span { color: #8b6eaa; }
:root[data-theme="light"] .nova-page .nova-studio-cross p { color: #67798f; }
:root[data-theme="light"] .nova-page .nova-studio-cross>a { color: #7954a5; }
:root[data-theme="light"] .nova-page .channel-steps li { background: #fff; border-color: #d3dfe9; }
:root[data-theme="light"] .nova-page :is(.channel-steps p, .channel-access p) { color: #647a90; }
:root[data-theme="light"] .nova-page .channel-access { background: #f1f7fb; border-color: #d2e2eb; }
:root[data-theme="light"] .nova-page dialog { background: #fff; color: var(--ink); border-color: #cfddea; box-shadow: 0 25px 80px #1e385a35; }
:root[data-theme="light"] .nova-page dialog::backdrop { background: #17304e80; }
:root[data-theme="light"] .nova-page .dialog-close { background: #edf3f8; color: #526f88; }
:root[data-theme="light"] .nova-page .dialog-eyebrow { color: #7192a8; }
:root[data-theme="light"] .nova-page :is(.dialog-intro, .form-note, .service-copy p, .trial-options summary, #trial-result>p) { color: #657d94; }
:root[data-theme="light"] .nova-page :is(form label, legend, .checkbox-grid label) { color: #557087; }
:root[data-theme="light"] .nova-page :is(input:not([type=checkbox]), select, textarea) { background: #fff; color: #324d65; border-color: #c7d6e2; }
:root[data-theme="light"] .nova-page input::placeholder,
:root[data-theme="light"] .nova-page textarea::placeholder,
:root[data-theme="light"] .nova-page :is(legend span, .optional) { color: #778c9e; }
:root[data-theme="light"] .nova-page #trial-error { color: #ad3926; }
:root[data-theme="light"] .nova-page thead th { background: #edf4f8; color: #3b5e75; }
:root[data-theme="light"] .nova-page :is(th, td) { border-color: #d2e0e9; }
:root[data-theme="light"] .nova-page :is(tbody th, td) { color: #5d7a90; }
:root[data-theme="light"] .nova-page :is(.demo-qr-details p, .demo-qr-error p, .qr-status) { color: #627e94; }
:root[data-theme="light"] .nova-page .demo-trial-note { border-color: #d0e0e9; }

/* Existing account screens share the preference without changing account behavior. */
.account-page > header { border-color: var(--line); }
.account-page :is(.stats article, .application, dialog) { background: var(--panel); border-color: var(--line); }
.account-page :is(input, select, textarea, button) { background-color: var(--field); border-color: var(--line); color: var(--ink); }
.account-page :is(.notice, .badge) { background: var(--soft); }
.account-page :is(.meta, .tabs, .audit) { border-color: var(--line); }
.account-page .empty { border-color: var(--line); }
.account-page .theme-switch { background: var(--theme-track); }
.account-page .theme-switch button { background: transparent; border-color: transparent; color: var(--muted); }
.account-page :is(button.primary, #refresh, .tabs button[aria-pressed=true]) { background: #253d54; color: #fff; border-color: #253d54; }
:root[data-theme="dark"] .account-page .badge.success { background: #153d35; color: #a1e7cb; }
:root[data-theme="dark"] .account-page :is([role=status], #admin-message) { color: #ffad96; }
:root[data-theme="dark"] .account-page dialog::backdrop { background: #030711bf; }
:root[data-theme="dark"] .account-page .dialog-head button { background: transparent; }

@media (max-width: 1080px) {
  .theme-switch svg { display: none; }
  .brand-page .header-tools { gap: 10px; }
  .nova-page .nav { gap: 12px; }
  .nova-page .nav nav { gap: 10px; }
  .nova-page .nav-actions { gap: 8px; }
  .nova-page .nav .trial-label { display: none; }
  .nova-page .nav .trial-label-compact { display: inline; }
  .nova-page .nav .button.small { padding-inline: 12px; gap: 9px; }
}
@media (max-width: 800px) {
  .brand-page .header-tools .header-cta { display: none; }
}
@media (max-width: 620px) {
  .theme-switch button { min-height: 32px; padding: 5px 7px; font-size: 10px; gap: 4px; }
  .theme-switch svg { width: 12px; height: 12px; }
  .brand-page .header-inner { gap: 12px; }
  .nova-page .nav { gap: 8px; }
  .nova-page .nav-actions { gap: 8px; }
  .nova-page .nav .trial-label-compact { display: none; }
  .nova-page .nav .trial-label-mobile { display: inline; }
  .nova-page .nav .button.small { min-height: 38px; padding-inline: 9px; font-size: 11px; gap: 6px; }
  .nova-page .nav .trial-arrow { font-size: 14px; }
  .account-header-tools { gap: 10px; }
  .account-header-tools > span { display: none; }
  :root[data-theme="light"] .brand-page .header-inner nav.is-open { background: #fff; border-color: #d6dfeb; box-shadow: 0 15px 35px #2f415c18; }
  :root[data-theme="light"] .brand-page .mobile-product-links a { color: #32667c; background: #edf7f9; border-color: #c7e0e7; }
  :root[data-theme="light"] .brand-page .mobile-product-links a+a { color: #765294; background: #f4edfb; border-color: #dfcfee; }
  :root[data-theme="light"] .studio-page .scene-tabs button[aria-selected=true] { box-shadow: inset 0 -2px #8a68ba; }
}
@media (max-width: 380px) {
  .theme-switch svg { display: none; }
  .theme-switch button { min-width: 32px; padding-inline: 5px; }
  .brand-page .header-inner { gap: 5px; }
  .brand-page .menu-toggle { padding-inline: 5px; }
  .nova-page .nav .trial-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) { .theme-switch button { transition: none; } }
@media (forced-colors: active) { .theme-switch [aria-pressed="true"] { outline: 1px solid Highlight; } }
