/* Site chrome and document UI only. Activity palettes, canvases, media and
   printable paper keep their authored colours. Legacy palette tokens stay intact. */
:root,
html[data-theme="light"] {
  color-scheme: light;
  --theme-bg: #fafaf7;
  --theme-surface: #ffffff;
  --theme-surface-alt: #f2f1f6;
  --theme-text: #252b3b;
  --theme-muted: #657080;
  --theme-border: #e1e2e9;
  --theme-accent: #7151b9;
  --theme-accent-soft: #eee8f6;
  --theme-success: #176f55;
  --theme-success-soft: #e8f6ef;
  --theme-warning: #926015;
  --theme-warning-soft: #fff4df;
  --theme-danger: #ac3542;
  --theme-danger-soft: #fff0f1;
}

@media screen {
html[data-theme="dark"] {
  color-scheme: dark;
  --theme-bg: #11151e;
  --theme-surface: #1b202c;
  --theme-surface-alt: #252c3a;
  --theme-text: #eef1f7;
  --theme-muted: #b3bdcf;
  --theme-border: #394255;
  --theme-accent: #c4adfa;
  --theme-accent-soft: #332b48;
  --theme-success: #9ae1bf;
  --theme-success-soft: #193c32;
  --theme-warning: #f4d195;
  --theme-warning-soft: #43351f;
  --theme-danger: #ffb3bb;
  --theme-danger-soft: #462a34;
  background: var(--theme-bg);
  scrollbar-color: #586478 var(--theme-bg);
}

/* A page background is changed only for identifiable content/catalogue shells.
   Deliberately absent: aquarium, solar system, game pages and drawing stages. */
html[data-theme="dark"] body:has(:is(
  .resource-page, .login-page, .register-page, .article-shell, .teacher-tools,
  .teacher-panel, .student-panel, .parent-panel, .games-catalog, .ebook-shell,
  .about-layout, .contact-layout, .new-shell, .subject-hero, .sp-grid,
  .ho-hero, .exam-hero, .app > .sidebar
)),
html[data-theme="dark"] body.home-platform,
html[data-theme="dark"] body.viewer-page,
html[data-theme="dark"] body.sinav-home-page {
  background: var(--theme-bg);
  color: var(--theme-text);
}

/* Shared public navigation, search and footer, including compact menus. */
html[data-theme="dark"] #kemalNavMount.platform-chrome {
  --platform-accent: var(--theme-accent);
  --platform-hover: #ddceff;
  --platform-ink: var(--theme-text);
  background: var(--theme-surface);
  border-color: var(--theme-border);
}
html[data-theme="dark"] :is(.site-account-bar, .platform-chrome .site-account-bar) {
  background: var(--theme-bg);
  border-color: var(--theme-border);
}
html[data-theme="dark"] #mainNav.navbar,
html[data-theme="dark"] #mainNav.platform-navbar,
html[data-theme="dark"] #mainNav :is(.nav-links, .dropdown-panel),
html[data-theme="dark"] #mainNav.platform-navbar.is-compact .nav-links,
html[data-theme="dark"] .site-search-panel {
  background: var(--theme-surface);
  color: var(--theme-text);
  border-color: var(--theme-border);
  box-shadow: 0 16px 42px #00000038;
}
html[data-theme="dark"] #mainNav :is(.nav-btn, .dd-item, .platform-nav-group h3),
html[data-theme="dark"] :is(.site-account-inner, .site-account-link, .site-search-head h2),
html[data-theme="dark"] #mainNav .platform-brand-copy strong {
  color: var(--theme-text);
}
html[data-theme="dark"] #mainNav :is(.nav-logo, .site-search-trigger),
html[data-theme="dark"] .site-account-link.strong,
html[data-theme="dark"] :is(.site-search-kicker, .site-search-box svg) {
  color: var(--theme-accent);
}
html[data-theme="dark"] #mainNav :is(.platform-brand-copy small, .dd-desc),
html[data-theme="dark"] :is(.site-account-sep, .site-search-status, .site-search-empty),
html[data-theme="dark"] .site-search-result-copy small {
  color: var(--theme-muted);
}
html[data-theme="dark"] #mainNav :is(.site-search-trigger, .hamburger),
html[data-theme="dark"] :is(.site-search-close, .site-search-box, .site-search-result) {
  background: var(--theme-surface-alt);
  border-color: var(--theme-border);
  color: var(--theme-text);
}
html[data-theme="dark"] #mainNav :is(.nav-logo:hover, .nav-btn:hover, .dd-item:hover),
html[data-theme="dark"] #mainNav .nav-item:is(.open, .is-active) > .nav-btn,
html[data-theme="dark"] #mainNav .dd-item[aria-current="page"],
html[data-theme="dark"] .site-search-result:hover {
  color: var(--theme-accent) !important;
  background: var(--theme-accent-soft);
  border-color: var(--theme-border);
}
html[data-theme="dark"] #mainNav.platform-navbar.is-compact .dropdown-panel {
  background: var(--theme-surface-alt);
}
html[data-theme="dark"] #mainNav .hamburger span { background: var(--theme-text); }
html[data-theme="dark"] #mainNav :is(.platform-nav-group h3, .dd-title),
html[data-theme="dark"] :is(.site-search-head, .site-search-box) { border-color: var(--theme-border); }
html[data-theme="dark"] .site-search-box input { color: var(--theme-text); background: transparent; }
html[data-theme="dark"] .site-search-result-copy strong { color: var(--theme-text); }
html[data-theme="dark"] .site-search-result-icon { background: var(--theme-accent-soft); }
html[data-theme="dark"] .site-search-overlay { background: #050911b8; }
html[data-theme="dark"] #kemalFooter.platform-footer,
html[data-theme="dark"] .site-footer {
  background: var(--theme-surface);
  color: var(--theme-muted);
  border-color: var(--theme-border);
}
html[data-theme="dark"] #kemalFooter :is(.platform-footer-brand, .footer-col h3, .footer-col h4),
html[data-theme="dark"] .site-footer .footer-brand h3 { color: var(--theme-text); }
html[data-theme="dark"] #kemalFooter :is(.platform-footer-brand small, .footer-brand p, .footer-links a, .platform-social-links a, .footer-bottom) {
  color: var(--theme-muted);
  border-color: var(--theme-border);
}
html[data-theme="dark"] #kemalFooter :is(.footer-links a:hover, .platform-social-links a:hover) { color: var(--theme-accent); }

/* Dark glass uses the same rail geometry and accessible solid fallbacks. */
html[data-theme="dark"] #shortcutDock.shortcut-dock {
 --dock-surface:rgba(27,32,46,.52); --dock-solid:#202635;
 --dock-ink:#d3d7e4; --dock-purple:#c4adfa; --dock-border:rgba(224,225,255,.24);
 --dock-tile:rgba(217,211,245,.10); --dock-highlight:rgba(255,255,255,.18); --dock-shadow:rgba(0,0,0,.30);
}

/* Homepage semantic palette and its editable UI surfaces. */
html[data-theme="dark"] .home-platform {
  --home-ink: var(--theme-text);
  --home-muted: var(--theme-muted);
  --home-purple: var(--theme-accent);
  --home-line: var(--theme-border);
  --home-paper: var(--theme-bg);
}
html[data-theme="dark"] .home-platform :is(
  .home-search, .home-area, .home-resource, .home-tool, .home-showcase-panel,
  .home-live-panel, .home-showcase-controls, .home-showcase-copy,
  .home-grades, .home-grade-links a, .home-grade-filter select, .home-demo
) {
  background: var(--theme-surface);
  border-color: var(--theme-border);
  color: var(--theme-text);
  box-shadow: none;
}
html[data-theme="dark"] .home-platform :is(.home-audience, .home-tools-section, .home-aquarium-feature-inner, .home-mini-learning) {
  background: var(--theme-surface-alt);
  border-color: var(--theme-border);
}
html[data-theme="dark"] .home-platform :is(
  .home-eyebrow, .home-search-hints, .home-audience h2, .home-audience-grid p,
  .home-library-status, .home-grade-filter, .home-resource-meta, .home-more-tools,
  .home-panel-caption, .home-showcase-count, .home-showcase-desc, .home-showcase-copy > p,
  .home-showcase-pause, .home-live-meta, .home-live-state, .home-demo-copy p,
  .home-demo-top, .home-fraction-note
) { color: var(--theme-muted); }
html[data-theme="dark"] .home-platform :is(
  .home-card-link, .home-text-link, .home-search-hints button, .home-more-tools a,
  .home-resource-type, .home-showcase-kind, .home-showcase-cta, .home-showcase-desc a,
  .home-live-all, .home-live-state a, .home-demo-link, .home-audience-grid a > .home-icon
) { color: var(--theme-accent); }
html[data-theme="dark"] .home-platform :is(.home-search input, .home-live-name, .home-fraction-value, .home-demo-copy h2) { color: var(--theme-text); }
html[data-theme="dark"] .home-platform :is(
  .home-panel-head, .home-showcase-controls, .home-live-item, .home-live-all,
  .home-audience-grid a + a, .home-library-toolbar, .home-demo-top, .home-demo-link
) { border-color: var(--theme-border); }
html[data-theme="dark"] .home-platform :is(.home-library-tabs button, .home-fraction-controls button) { color: var(--theme-muted); }
html[data-theme="dark"] .home-platform :is(
  .home-library-tabs button[aria-pressed="true"], .home-library-empty button,
  .home-fraction-controls button[aria-pressed="true"]
) { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-border); }
html[data-theme="dark"] .home-platform :is(.home-showcase-step, .home-fraction-controls button) {
  background: var(--theme-surface-alt); border-color: var(--theme-border); color: var(--theme-accent);
}
html[data-theme="dark"] .home-platform .home-showcase-step:hover,
html[data-theme="dark"] .home-platform .home-live-all:hover { background: var(--theme-accent-soft); }
html[data-theme="dark"] .home-platform :is(.home-showcase-media, .home-showcase-media.is-contain, .home-showcase-media.is-editorial, .home-showcase-placeholder) {
  background: var(--theme-surface-alt);
  color: var(--theme-accent);
}
html[data-theme="dark"] .home-platform :is(.home-resource-art, .home-live-icon, .home-tone-purple) { background: #322b46; color: #c4a9ef; }
html[data-theme="dark"] .home-platform :is(.home-art-document, .home-art-video, .home-live-icon.is-document, .home-live-icon.is-video, .home-tone-green) { background: #213c35; color: #a1d4bd; }
html[data-theme="dark"] .home-platform :is(.home-art-game, .home-live-icon.is-game, .home-tone-yellow) { background: #403821; color: #dfcc8f; }
html[data-theme="dark"] .home-platform :is(.home-art-exam, .home-live-icon.is-exam, .home-tone-peach) { background: #422f2d; color: #e1b9aa; }
html[data-theme="dark"] .home-platform .home-aquarium-feature h2 { color: var(--theme-success); }
html[data-theme="dark"] .home-platform .home-aquarium-feature-copy > p:last-child { color: var(--theme-muted); }
html[data-theme="dark"] .home-platform .home-aquarium-try { background: #213c35; color: #c7edd9; border-color: #426756; }
html[data-theme="dark"] .home-platform .home-aquarium-try:hover { background: #2a4a3e; border-color: #6b9b84; }
html[data-theme="dark"] .home-platform .home-aquarium-open { color: var(--theme-success); }
html[data-theme="dark"] .home-platform .home-library-empty { border-color: var(--theme-border); }
html[data-theme="dark"] .home-platform .home-search button { background: #7151b9; color: #fff; }
html[data-theme="dark"] .home-platform .home-search button:hover { background: #60409f; }
html[data-theme="dark"] .home-platform :is(.home-fraction-value, .home-demo-subject) { background: var(--theme-surface-alt); border-color: var(--theme-border); }

/* Resource discovery, class pages, article/about/contact and auth. The lesson
   preview art and downloaded document cover remain original. */
html[data-theme="dark"] .page-header { background: var(--theme-surface-alt); border-color: var(--theme-border); }
html[data-theme="dark"] .page-header-title { color: var(--theme-text); }
html[data-theme="dark"] .page-header-title span { color: var(--theme-accent); }
html[data-theme="dark"] .page-header-sub { color: var(--theme-muted); }
html[data-theme="dark"] :is(.login-page, .register-page) { background: var(--theme-bg); }
html[data-theme="dark"] :is(
  .login-card, .register-intro, .register-card, .contact-form-card, .about-card,
  .about-section, .resource-controls, .resource-card, .subject-tile,
  .subject-note-card, .subject-empty, .subject-doc-card, .subject-doc-state,
  .new-toolbar, .new-item, .article-hero, .article-content, .article-state,
  .grade-card, .qcard, .sp-card, .giris-card
) {
  background: var(--theme-surface);
  color: var(--theme-text);
  border-color: var(--theme-border);
  box-shadow: 0 8px 24px #00000012;
}
html[data-theme="dark"] :is(.resource-page, .new-shell, .article-shell) .empty-state,
html[data-theme="dark"] :is(.ast, .verify-upload, .giris-metin-info, .new-summary, .resource-page .status-pill) {
  background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] :is(
  .sec-title, .gc-label, .qcard-title, .sp-card-title, .about-name,
  .about-section h2, .about-section h3, .ast strong, .val-title,
  .contact-form-card h3, .login-card h1, .register-intro h1, .register-card h2,
  .register-step strong, .role-tab strong, .form-label, .form-field label,
  .resource-card h3, .subject-tile strong, .subject-note-card h3,
  .subject-doc-title, .new-title, .new-toolbar-head h2,
  .article-hero h1, .article-content, .mc-title, .giris-card h2
) { color: var(--theme-text); }
html[data-theme="dark"] :is(
  .sec-sub, .gc-sub, .qcard-desc, .sp-card-sub, .about-title,
  .about-section p, .ast span, .val-desc, .login-card p, .login-links,
  .register-intro p, .register-card p, .register-step p, .role-tab span,
  .form-field small, .form-hint, .resource-card p, .resource-meta,
  .subject-note-card p, .subject-note-card li, .subject-doc-desc, .new-date,
  .new-desc, .new-path, .new-toolbar-head p, .article-summary,
  .article-meta, .mc-meta, .mc-desc, .giris-metin-info
) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.subj-link, .role-tab, .login-alt-btn, .np-btn, .mp-btn) {
  background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] :is(.subj-link:hover, .subject-tile.active, .role-tab.active, .register-kicker, .article-kicker, .val-em) {
  background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-border);
}
html[data-theme="dark"] :is(.new-pill.subject, .new-pill.type, .new-meta span, .resource-page .badge, .subject-doc-badge, .subject-doc-pages, .subject-doc-meta span) {
  background: var(--theme-surface-alt); color: var(--theme-muted);
}
html[data-theme="dark"] :is(.article-content a, .login-links a, .login-help-row a, .login-help-row button) { color: var(--theme-accent); }
html[data-theme="dark"] .article-media { background: var(--theme-surface-alt); }
html[data-theme="dark"] :is(.login-page, .register-page, .contact-form-card, .resource-page) :is(label, .form-label, .field-label, .filter-label) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.login-box, .login-card) :is(.login-title, h1, h2, h3) { color: var(--theme-text); }
html[data-theme="dark"] :is(.login-box, .login-card) :is(label, .login-help, .login-sub, .login-subtitle) { color: var(--theme-muted); }

/* Form fields are scoped to actual UI containers. Colour pickers, ranges,
   answer boxes on paper and exercise controls are intentionally excluded. */
html[data-theme="dark"] :is(
  .login-form, .register-card, .contact-form-card, .resource-controls,
  .new-toolbar, .giris-card, .metin-filter-panel, .teacher-panel,
  .student-panel, .parent-panel, .teacher-tools, .library-toolbar,
  .reader-form, .exam-filter-panel, .modal-box, .viewer-toolbar,
  .viewer-pager, .shortcut-panel, .site-search-panel
) :is(input:not([type="checkbox"]):not([type="radio"]):not([type="range"]):not([type="color"]):not([type="button"]):not([type="submit"]), select, textarea) {
  background: var(--theme-surface-alt);
  border-color: var(--theme-border);
  color: var(--theme-text);
  caret-color: var(--theme-accent);
}
html[data-theme="dark"] :is(.login-form, .register-card, .contact-form-card, .resource-controls, .new-toolbar, .teacher-panel, .student-panel, .parent-panel, .teacher-tools, .modal-box) :is(input, textarea)::placeholder {
  color: #9ca9bf; opacity: 1;
}
html[data-theme="dark"] :is(.login-form, .register-card, .contact-form-card, .resource-controls, .new-toolbar, .teacher-panel, .student-panel, .parent-panel, .teacher-tools, .modal-box) :is(input, select, textarea):focus-visible {
  outline-color: var(--theme-accent); border-color: var(--theme-accent);
}
html[data-theme="dark"] :is(.login-message.err, .register-message.err, .success-msg.error, .err-msg, .neg-warn) {
  background: var(--theme-danger-soft); color: var(--theme-danger); border-color: #754052;
}
html[data-theme="dark"] :is(.login-message.ok, .register-message.ok, .success-msg:not(.error)) {
  background: var(--theme-success-soft); color: var(--theme-success); border-color: #356551;
}

/* Teacher tools hub is a catalogue; the launched tools are separate pages. */
html[data-theme="dark"] .teacher-tools :is(.command-bar, .quick-start, .quick-action, .focus-panel, .side-panel, .tool-browser, .flow-panel, .metric-tile, .mini-launch, .workflow-step, .brief-item, .tool-card, .flow-card) {
  background: var(--theme-surface); border-color: var(--theme-border); color: var(--theme-text);
}
html[data-theme="dark"] .teacher-tools :is(.focus-stack, .timezone, .status-pill, .page-chip, .section-eyebrow, .tool-tag, .tool-visual, .mini-icon, .brief-icon, .quick-action i) {
  background: var(--theme-surface-alt); border-color: var(--theme-border); color: var(--theme-accent);
}
html[data-theme="dark"] .teacher-tools :is(h1, h2, h3, .tool-title, .quick-title, .metric-value, .flow-title, .mini-launch strong) { color: var(--theme-text); }
html[data-theme="dark"] .teacher-tools :is(p, .tool-desc, .metric-label, .tool-meta, .flow-copy, .mini-launch small, .brief-item span) { color: var(--theme-muted); }
html[data-theme="dark"] .teacher-tools :is(.filter-btn, .fav-btn, .action-btn.secondary) { background: var(--theme-surface-alt); border-color: var(--theme-border); color: var(--theme-muted); }
html[data-theme="dark"] .teacher-tools :is(.filter-btn.active, .fav-btn.active) { background: var(--theme-accent-soft); color: var(--theme-accent); }

/* Profiles and account panels. Their colourful module launch tiles survive. */
html[data-theme="dark"] :is(.teacher-panel, .student-panel, .parent-panel) { background: var(--theme-bg); color: var(--theme-text); }
html[data-theme="dark"] :is(.teacher-panel, .student-panel, .parent-panel) :is(
  .teacher-hero, .student-hero, .parent-hero, .teacher-stat, .student-stat,
  .parent-stat, .teacher-panel-card, .student-card, .parent-card, .merit-card,
  .teacher-row, .student-row, .parent-row, .teacher-content-card,
  .teacher-action-card, .student-table-row, .student-saved-group
) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.teacher-panel, .student-panel, .parent-panel) :is(
  h1, h2, .teacher-row-title, .student-row-title, .parent-row-title,
  .teacher-stat strong, .student-stat strong, .parent-stat strong,
  .teacher-content-card h3, .teacher-action-card strong, .teacher-status-line strong
) { color: var(--theme-text); }
html[data-theme="dark"] :is(.teacher-panel, .student-panel, .parent-panel) :is(
  .teacher-hero p, .student-hero p, .parent-hero p,
  .teacher-stat span, .student-stat span, .parent-stat span,
  .teacher-panel-card p, .student-card p, .parent-card p,
  .teacher-row-sub, .student-row-sub, .parent-row-sub, .teacher-content-meta,
  .teacher-action-card span, .teacher-field label, .student-field label,
  .parent-field label, .teacher-table th, .teacher-table td, .teacher-status-line div
) { color: var(--theme-muted); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.teacher-panel, .student-panel, .parent-panel) :is(
  .teacher-note, .teacher-empty, .student-empty, .parent-empty,
  .teacher-message-detail, .student-message-detail, .parent-message-detail,
  .teacher-assignment-detail, .teacher-assignment-group, .student-assignment-preview,
  .teacher-embed-preview, .teacher-pill, .student-pill, .parent-pill,
  .teacher-table td, .teacher-mini-btn, .teacher-btn.secondary, .teacher-link.secondary,
  .student-btn.secondary, .student-link.secondary, .parent-btn.secondary, .parent-link.secondary,
  .content-tab, .teacher-message-tab, .student-message-tab, .parent-message-tab,
  .parent-report-tab, .student-saved-head
) { background: var(--theme-surface-alt); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="dark"] :is(.teacher-panel, .student-panel, .parent-panel) :is(.teacher-tabs, .student-tabs, .parent-sidebar) {
  background: linear-gradient(180deg, #18263e, #1d3546);
}
html[data-theme="dark"] :is(.teacher-sidebar-brand, .student-sidebar-brand, .parent-sidebar-brand) span,
html[data-theme="dark"] :is(.teacher-badge, .student-badge, .parent-badge) { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.teacher-mini-btn.primary, .content-tab.active, .teacher-message-tab.active, .student-message-tab.active, .parent-message-tab.active, .parent-report-tab.active) { background: var(--theme-accent-soft); color: var(--theme-accent); }
html[data-theme="dark"] :is(.teacher-danger-zone, .student-danger-zone, .teacher-mini-btn.danger) { background: var(--theme-danger-soft); border-color: #754052; color: var(--theme-danger); }
html[data-theme="dark"] :is(.teacher-danger-zone, .student-danger-zone) :is(h3, p) { color: var(--theme-danger); }
html[data-theme="dark"] :is(.teacher-approval-notice, .teacher-assignment-warning) { background: var(--theme-warning-soft); border-color: #6d5430; color: var(--theme-warning); }
html[data-theme="dark"] .teacher-approval-notice :is(h2, p) { color: var(--theme-warning); }
html[data-theme="dark"] :is(.teacher-pill.ok, .student-pill.ok, .parent-pill.ok) { background: var(--theme-success-soft); color: var(--theme-success); }
html[data-theme="dark"] :is(.teacher-pill.warn, .student-pill.warn, .parent-pill.warn) { background: var(--theme-warning-soft); color: var(--theme-warning); }

/* Game catalogue only: never .game-card or .filter-btn on a running game. */
html[data-theme="dark"] :is(.games-hero, .popular-games, .games-catalog) {
  --game-ink: var(--theme-text); --game-violet: var(--theme-accent); --game-muted: var(--theme-muted);
}
html[data-theme="dark"] :is(.games-hero-note, .popular-games-shell, .popular-game-card, .popular-caption),
html[data-theme="dark"] .games-catalog :is(.game-card, .catalog-search, .catalog-sort select, .filter-btn, .page-btn, .empty-filter) {
  background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] :is(.popular-copy, .popular-game-meta),
html[data-theme="dark"] .games-catalog :is(.catalog-count, .catalog-sort, .gc-subtitle, .gc-play-count) { color: var(--theme-muted); }
html[data-theme="dark"] .games-catalog :is(.catalog-search input, .gc-title) { color: var(--theme-text); }
html[data-theme="dark"] .games-catalog :is(.filter-btn.active, .page-btn.active, .filter-btn:hover:not(.active)) { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-border); }
html[data-theme="dark"] .games-catalog :is(.gc-play, .gc-play-arrow) { color: var(--theme-accent); border-color: var(--theme-border); }
html[data-theme="dark"] .games-catalog .gc-play-arrow { background: var(--theme-accent-soft); }

/* Reading catalogue and exam selection UI; reading pages and exam drawings
   have their own visual systems and are not recoloured here. */
html[data-theme="dark"] :is(.metin-filter-panel, .metin-card, .mc-body, .exam-filter-panel, .exam-tools-summary, .exam-journey-card, .exam-grade-panel, .exam-hero-stat, .exam-hint-chip, .ec, .ec-head, .ec-body) {
  background: var(--theme-surface); border-color: var(--theme-border); color: var(--theme-text);
}
html[data-theme="dark"] #step2 { background: var(--theme-bg); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.mc-no, .mc-chip, .badge-tam, .badge-kw, .exam-summary-badge, .exam-journey-pill, .exam-tool-input, .exam-tool-reset, .sf-btn, .pg) {
  background: var(--theme-surface-alt); border-color: var(--theme-border); color: var(--theme-text);
}
html[data-theme="dark"] :is(.exam-hero h1, .exam-journey-card h2, .ec-title, .ec-name, .mc-title) { color: var(--theme-text); }
html[data-theme="dark"] :is(.exam-hero p, .exam-hero-stat span, .ec-desc, .ec-meta, .exam-tool-label, .metin-filter-panel label, .mc-body p) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.sf-btn.active, .pg.active, .np-btn.active, .mp-btn.active) { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-border); }

/* Modals and reader/viewer controls, but never their paper/canvas descendants. */
html[data-theme="dark"] :is(.modal-box, .magnify-panel, .shortcut-panel, .viewer-confirm-dialog, .reader-loading-inner, .reader-error-inner) {
  background: var(--theme-surface); border-color: var(--theme-border); color: var(--theme-text);
}
html[data-theme="dark"] :is(.modal-header, .modal-box .btn-row, .modal-helper-pill, .modal-close, .exam-info-box, .eib-item, .fi, .fs) {
  background: var(--theme-surface-alt); border-color: var(--theme-border); color: var(--theme-text);
}
html[data-theme="dark"] :is(.modal-box h2, .modal-box h3, .modal-title, .shortcut-card strong, .reader-title strong) { color: var(--theme-text); }
html[data-theme="dark"] :is(.modal-box label, .modal-box .hint, .modal-box .modal-sub, .viewer-status, .reader-title span) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.viewer-toolbar, .book-frame .viewer-toolbar, .viewer-pager, .reader-topbar, .ebook-sitebar, .reader-controls, .shortcut-card) {
  background: var(--theme-surface); border-color: var(--theme-border); color: var(--theme-text);
}
html[data-theme="dark"] .viewer-toolbar :is(.toolbar-header, .doc-color-grid, .advanced-tools, .toolbar-compact-pages, .shape-panel, .doc-stamp-settings, .doc-tool-group-tabs, .doc-tool-panel-head button),
html[data-theme="dark"] :is(.pager-btn, .pager-chip, .view-mode-btn, .shortcut-key, .reader-timer, .reader-arrow) {
  background: var(--theme-surface-alt); border-color: var(--theme-border); color: var(--theme-text);
}
html[data-theme="dark"] .viewer-toolbar :is(.toolbar-btn, .toolbar-brand, .toolbar-label, .toolbar-section-title, .toggle-collapse-btn) { color: var(--theme-text); }
html[data-theme="dark"] .viewer-toolbar :is(.toolbar-btn:hover, .doc-tool-group-tabs button[aria-pressed="true"]),
html[data-theme="dark"] :is(.pager-btn:hover:not(:disabled), .view-mode-btn.active) { background: var(--theme-accent-soft); color: var(--theme-accent); }
html[data-theme="dark"] .ebook-shell :is(.ebook-card, .ebook-empty, .ebook-loading) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .ebook-shell :is(.ebook-card h2, .grade-tab, .library-search input) { color: var(--theme-text); }
html[data-theme="dark"] .ebook-shell :is(.ebook-card-author, .ebook-card-description, .ebook-card-meta) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.ebook-sitebar, .ebook-shell) :is(.ebook-link, .ebook-button:not(.primary):not(.coral), .grade-tab, .library-search input) { background: var(--theme-surface-alt); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="dark"] .ebook-shell :is(.ebook-pill, .grade-tab.active) { background: var(--theme-accent-soft); color: var(--theme-accent); }

/* Agenda workspace only. Printable reports and official paper are excluded. */
html[data-theme="dark"] body:has(.app > .sidebar) > .app { color: var(--theme-text); }
html[data-theme="dark"] .app:has(> .sidebar) :is(.sidebar, .topbar, .side-card, .dashboard-settings, .dashboard-command, .dashboard-brief-item, .dashboard-empty, .stat-tile, .table-wrap, .class-manager-row, .calendar-grid, .calendar-day, .calendar-weekday, .schedule-board, .schedule-cell, dialog) {
  background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] .app:has(> .sidebar) .panel:not(.printable):not(:has(.report-card, .official-report, .class-list-card)) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .app:has(> .sidebar) :is(.brand, .topbar, .dashboard-command, .dashboard-settings, .stat-tile, .class-manager-row, .calendar-day, .side-card) :is(h1, h2, h3, strong, label) { color: var(--theme-text); }
html[data-theme="dark"] .app:has(> .sidebar) :is(.topbar p, .dashboard-command p, .dashboard-brief-item, .calendar-day.muted, .stat-tile p, .side-card p) { color: var(--theme-muted); }
html[data-theme="dark"] .app:has(> .sidebar) :is(.sidebar button:not(.primary-btn):not(.danger-btn), .icon-btn, .ghost-btn, .top-clock, .class-manager-row.active, .calendar-day.selected) {
  background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] .app:has(> .sidebar) :is(.sidebar .nav button.active, .calendar-day.selected) { background: var(--theme-accent-soft); color: var(--theme-accent); }

/* The admin shell publishes !important surface rules; these narrowly scoped
   counterparts need the same priority. Paper/Quill/preview contents are absent. */
html[data-theme="dark"] body.admin-shell-body { background: var(--theme-bg) !important; color: var(--theme-text); }
html[data-theme="dark"] :is(.admin-shell-app, .admin-shell-layout, .admin-shell-main, .login-screen, .login-bg) { background: var(--theme-bg); color: var(--theme-text); }
html[data-theme="dark"] :is(.login-box, .admin-shell-topbar, .admin-shell-quick-panel, .admin-shell-quick-card, .admin-shell-utility-link) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .admin-nav-sidebar { background: linear-gradient(180deg, #18263e, #1d3546); }
html[data-theme="dark"] .admin-nav-brand-copy span { background: var(--theme-accent-soft); color: var(--theme-accent); }
html[data-theme="dark"] .admin-shell-main :is(
  .card, .panel, .kart, .doc-card, .oyun-kart, .metin-kart, .help-card,
  .empty-state, .empty-box, .pdf-controls, .pdf-dropzone, .modal-box,
  .admin-help-box, .showcase-card, .filter-card, .workflow-card, .state-card,
  .analytics-card, .stat-card, .admin-user-card, .question-card, .q-item
) {
  background: var(--theme-surface) !important;
  border-color: var(--theme-border) !important;
  color: var(--theme-text);
  box-shadow: 0 8px 24px #0000001a !important;
}
html[data-theme="dark"] .admin-shell-main .hero { background: var(--theme-surface) !important; color: var(--theme-text) !important; border-color: var(--theme-border) !important; }
html[data-theme="dark"] .admin-shell-main :is(.hero h1, .hero-pill, label, .form-label) { color: var(--theme-text) !important; }
html[data-theme="dark"] .admin-shell-main :is(.hero p, .picker-meta) { color: var(--theme-muted) !important; }
html[data-theme="dark"] .admin-shell-main :is(.page-title, .list-title, .edit-title, .panel-title, .card-title, .doc-title, .showcase-card-title, .topbar-title, .admin-shell-heading, .admin-shell-title) { color: var(--theme-text); }
html[data-theme="dark"] .admin-shell-main :is(.panel, .card, .kart, .help-card) > :is(h1, h2, h3) { color: var(--theme-text); }
html[data-theme="dark"] .admin-shell-main :is(.status-line, .hint, .list-sub, .card-desc, .doc-meta, .showcase-card-desc, .admin-form-note, .filter-label) { color: var(--theme-muted); }
html[data-theme="dark"] .admin-shell-main :is(input[type="text"], input[type="url"], input[type="date"], input[type="number"], input[type="password"], input[type="email"], input[type="search"], input[type="file"], select, textarea, .form-input, .form-select) {
  background: var(--theme-surface-alt) !important;
  color: var(--theme-text) !important;
  border-color: var(--theme-border) !important;
}
html[data-theme="dark"] :is(.login-box, .login-card) .login-input { background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .admin-shell-main :is(.btn-secondary, .btn-ghost, .btn-outline, .secondary-btn, .topbar-link, .t-link, .back-btn) { background: var(--theme-surface-alt) !important; color: var(--theme-text) !important; border-color: var(--theme-border) !important; }
html[data-theme="dark"] .admin-shell-main :is(.logout-btn, .btn-danger, .danger-btn, .btn-delete, .mk-btn-del) { background: var(--theme-danger-soft) !important; color: var(--theme-danger) !important; border-color: #754052 !important; }
html[data-theme="dark"] .admin-shell-main :is(.badge, .doc-badge, .mk-sinif-badge, .badge-nav, .section-tag, .pill, .target-chip, .hero-pill, .picker-card) { background: var(--theme-accent-soft) !important; color: var(--theme-accent) !important; border-color: var(--theme-border) !important; }
html[data-theme="dark"] .admin-shell-main :is(.doc-meta span, .analytics-empty, .helper-box, .file-box, .switch-row, .source-btn, .content-kind-btn, .sel-card, .f-btn, .f-sinif-btn, .tip-btn) { background: var(--theme-surface-alt) !important; color: var(--theme-muted); border-color: var(--theme-border) !important; }
html[data-theme="dark"] .admin-shell-main :is(.source-btn.active, .content-kind-btn.active, .sel-card.selected, .f-btn.active, .f-sinif-btn.active, .tip-btn.active) { background: var(--theme-accent-soft) !important; color: var(--theme-accent) !important; border-color: var(--theme-accent) !important; }
html[data-theme="dark"] .admin-shell-main table th { background: var(--theme-surface-alt) !important; color: var(--theme-muted) !important; border-color: var(--theme-border) !important; }
html[data-theme="dark"] .admin-shell-main table td { color: var(--theme-text); border-color: var(--theme-border) !important; }
html[data-theme="dark"] .admin-shell-main :is(.ql-toolbar, .toolbar-row) { background: var(--theme-surface-alt); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme="dark"] .admin-shell-main .ql-toolbar .ql-stroke { stroke: var(--theme-text); }
html[data-theme="dark"] .admin-shell-main .ql-toolbar .ql-fill { fill: var(--theme-text); }
html[data-theme="dark"] .admin-shell-main .ql-toolbar .ql-picker { color: var(--theme-text); }
html[data-theme="dark"] .admin-shell-main :is(.rich-editor, .ql-editor) { background: #fff; color: #1a1040; color-scheme: light; }

/* Standalone reader chrome and readable HTML text. Book images and exported
   report cards retain their original white paper. */
html[data-theme="dark"] body.reader-body,
html[data-theme="dark"] :is(.reader-intro, .reader-loading, .reader-error, .reader-quiz, .reader-report, .reader-book-panel, #tamMetinEkran) { background: var(--theme-bg); }
html[data-theme="dark"] :is(.reader-intro-card, .quiz-card, .quiz-option, .okuma-topbar, .kitap-metin, .okuma-visual-caption, .save-status-card) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.intro-copy h1, .reader-form-heading strong, .quiz-question, .okuma-topbar h1, .okuma-topbar h2, .okuma-metin-title, .kitap-metin p, .save-status-title) { color: var(--theme-text); }
html[data-theme="dark"] :is(.intro-author, .intro-description, .reader-form-heading small, .reader-form label, .okuma-topbar p, .okuma-meta, .save-status-copy, .save-status-card p) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.intro-metric, .quiz-option-key, .reader-form-heading > span, .sayac-display) { background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .quiz-option.selected { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-accent); }
html[data-theme="dark"] .reader-app .ebook-link { background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border); }

/* Classroom workbench controls, explicitly excluding boards and colour swatches. */
html[data-theme="dark"] .tools-page :is(.glass, .hero-card, .tool-card-btn, .mode-tabs, .float-panel, .shortcut-popover, .teacher-wheel-card, .wheel-help-card, .student-list-card, .class-stat-card, .selected-student-panel, .pro-toolbar) {
  background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] .tools-page :is(.hero-card h1, .hero-card h2, .section-title, .tool-card-title, .shortcut-popover-title, .class-stat-card strong, .student-list-name) { color: var(--theme-text); }
html[data-theme="dark"] .tools-page :is(.hero-card p, .tool-card-desc, .section-desc, .field label, .class-stat-card span, .student-list-meta, .toolbar-sub) { color: var(--theme-muted); }
html[data-theme="dark"] .tools-page :is(.btn-secondary, .mode-tab, .step-btn, .field, .toolbar-btn, .float-close-btn, .shortcut-help-btn, .shortcut-key, .class-tab, .sand-mini-btn) { background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .tools-page :is(.mode-tab.active, .class-tab.is-active, .toolbar-btn.is-active) { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-border); }
html[data-theme="dark"] body:has(.tools-page) { background: var(--theme-bg); color: var(--theme-text); }
html[data-theme="dark"] body:has(.tools-page) > .sub-back,
html[data-theme="dark"] :is(.board-toolbar.pro-toolbar, .pro-toolbar .float-panel, .pro-toolbar .toolbar-sub, .pro-toolbar .toolbar-compact-pages) {
  background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] body:has(.tools-page) > .sub-back :is(a, .sub-back-title),
html[data-theme="dark"] .tools-page :is(.time-bar-clock, .time-bar-label, .panel-head h2),
html[data-theme="dark"] #boardToolbar :is(.toolbar-brand, .toolbar-label, .toolbar-header, .toolbar-section-title, .float-panel-title) { color: var(--theme-text); }
html[data-theme="dark"] .tools-page :is(.time-bar-date, .time-bar-tz) { color: var(--theme-muted); }
html[data-theme="dark"] .tools-page :is(.time-bar-label, .time-bar-tz, .zoom-value),
html[data-theme="dark"] #boardToolbar :is(.toolbar-btn, .float-close-btn, select, input[type="text"], input[type="number"]) {
  background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] #boardToolbar .toolbar-btn.is-active { background: #7151b9; color: #fff; border-color: #7151b9; }
html[data-theme="dark"] :is(.math-studio-page .math-sidebar, .math-studio-page .math-workbench, .math-studio-page .math-workbench-head, .math-studio-page .shortcut-popover) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .math-studio-page :is(.math-workbench h2, .shortcut-popover-title) { color: var(--theme-text); }
html[data-theme="dark"] .math-studio-page .math-workbench-copy > p { color: var(--theme-muted); }
html[data-theme="dark"] body.math-studio-page { background: var(--theme-bg); color: var(--theme-text); }
html[data-theme="dark"] .math-studio-page :is(.sub-back, .math-library, .math-library-trigger, .math-workbench, .math-workbench > .panel-head, .rng-card, .wheel-wrapper, .fraction-wrapper, .nl-wrapper, .converter-card) {
  background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] .math-studio-page :is(.math-library-search, .math-library-heading small, .math-nav-icon, .math-nav-item kbd, .math-active-icon, .math-library-empty, .math-example-chips button, .calc-wrapper, .calc-btn, .wheel-settings, .frac-box, .frac-shape-toggle, .measure-rule-card, .converter-input, .converter-select, .converter-result, .ladder-note) {
  background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] .math-studio-page :is(.math-page-intro h1, .math-library-heading, .math-nav-copy strong, .math-library-search input, .math-workbench h2, .sub-back-title, .time-bar-clock, .frac-val) { color: var(--theme-text); }
html[data-theme="dark"] .math-studio-page :is(.math-tool-tab, .math-nav-item) { color: var(--theme-text); }
html[data-theme="dark"] .math-studio-page :is(.math-nav-item:hover, .math-nav-item.active, .math-tool-tab.active, .math-nav-item.active .math-nav-icon, .frac-shape-btn.is-active) { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-border); }
html[data-theme="dark"] .math-studio-page .math-nav-item.active .math-nav-copy strong { color: var(--theme-accent); }
html[data-theme="dark"] .math-studio-page :is(.math-nav-copy small, .math-library-group-label, .math-page-intro > p:last-child, .math-page-intro .math-eyebrow, .time-bar-label, .time-bar-date, .sub-back a, .math-calculator-notes, .math-calculator-notes li, .math-note-eyebrow, .math-example-label, .frac-box > span, .fraction-status, .measure-intro-card p, .measure-rule-card span, .converter-title span, .converter-field label, .converter-hint, .ladder-note) { color: var(--theme-muted); }
html[data-theme="dark"] .math-studio-page .math-view-body h3,
html[data-theme="dark"] .math-studio-page .math-view-body .math-calculator-notes h3 { color: var(--theme-text) !important; }
html[data-theme="dark"] .math-studio-page :is(.math-library-group + .math-library-group, .math-workbench > .panel-head, .time-bar-clock) { border-color: var(--theme-border); }
html[data-theme="dark"] .math-studio-page .calc-btn.op { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-border); }
html[data-theme="dark"] .math-studio-page .calc-btn.clear { background: var(--theme-danger-soft); color: var(--theme-danger); border-color: #754052; }
html[data-theme="dark"] .math-studio-page .calc-btn.eq { background: #3778d6; color: #fff; border-color: #3778d6; }
/* These models previously sat on white cards. Keep that effective canvas
   backdrop as their surrounding settings adopt the dark UI palette. */
html[data-theme="dark"] .math-studio-page .fraction-canvas { background: #fff; border-radius: 10px; color-scheme: light; }

/* Movable geometry toolbox shared by 3D, nets, cubes and symmetry. The WebGL,
   SVG projection previews, main scene, colour buttons and grid stay untouched. */
html[data-theme="dark"] :is(.geometry-toolbox, .builder-panel, .geo-panel, .cube-panel, .projection-menu, .symmetry-controls, .symmetry-breadcrumb, .symmetry-board-toolbar, .symmetry-board-footer) {
  background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] :is(.geometry-toolbox, .builder-panel, .geo-panel, .cube-panel, .symmetry-controls) :is(.panel-title, .geo-panel-title, .cube-panel-title, .panel-head, .geo-panel-head, .cube-panel-head, .geometry-toolbox-drag, .symmetry-panel-head, .selected > b) { color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.geometry-toolbox, .builder-panel, .geo-panel, .cube-panel, .symmetry-controls) :is(p, .panel-sub, .geo-panel-sub, .cube-panel-sub, .group-title, .symmetry-label, .symmetry-muted, .symmetry-range-label, .symmetry-check, .proj-title, section > b) { color: var(--theme-muted); }
html[data-theme="dark"] :is(.geometry-toolbox, .builder-panel, .geo-panel, .cube-panel, .symmetry-controls, .projection-menu) button:not(.color):not(.color-btn):not(.symmetry-colors button) {
  background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border);
}
html[data-theme="dark"] :is(.geometry-toolbox, .builder-panel, .geo-panel, .cube-panel, .symmetry-controls) :is(button.active, button.is-active, button.primary):not(.color):not(.color-btn):not(.symmetry-colors button) { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-accent); }
html[data-theme="dark"] :is(.geometry-toolbox-tabs, .geometry-toolbox .shape-edit, .geometry-toolbox .task, .geometry-toolbox .selected, .geometry-toolbox-counter) { background: var(--theme-surface-alt); border-color: var(--theme-border); }
html[data-theme="dark"] :is(.geometry-toolbox, .builder-panel, .geo-panel, .cube-panel, .symmetry-controls) :is(select, input[type="text"], input[type="number"]) { background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] body.symmetry-studio-page { background: var(--theme-bg); color: var(--theme-text); }
html[data-theme="dark"] .symmetry-page-head h1 { color: var(--theme-text); }
html[data-theme="dark"] :is(.symmetry-page-head > div > p:last-child, .symmetry-board-footer, .symmetry-legend, #symmetryStatus) { color: var(--theme-muted); }
html[data-theme="dark"] .symmetry-grade { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-border); }

/* Certificate studio UI. Neither #documentCanvas nor .studio-item is styled. */
html[data-theme="dark"] body:has(.studio-app),
html[data-theme="dark"] .studio-app .studio-stage { background: var(--theme-bg); }
html[data-theme="dark"] .studio-app :is(.studio-topbar, .studio-sidebar, .template-card, .template-upload, .quote-card, .layer-row) { background: var(--theme-surface); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .studio-app :is(.studio-brand strong, .section-head h2, .template-card strong) { color: var(--theme-text); }
html[data-theme="dark"] .studio-app :is(.studio-brand small, .section-head span, .field span, .zoom-label, .template-card > span, .template-upload span) { color: var(--theme-muted); }
html[data-theme="dark"] .studio-app :is(.tool-btn, .icon-btn, .mini-btn, .field input[type="text"], .field input[type="number"], .field select, .field textarea) { background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .studio-app :is(.quick-card, .stage-strip, .empty-inspector, .segmented) { background: var(--theme-surface-alt); color: var(--theme-text); border-color: var(--theme-border); }
html[data-theme="dark"] .studio-app :is(.quick-card strong, .layer-name) { color: var(--theme-text); }
html[data-theme="dark"] .studio-app :is(.quick-card span, .template-card span, .empty-inspector, .stage-strip) { color: var(--theme-muted); }
html[data-theme="dark"] .studio-app :is(.layer-row.active, .layer-move button, .segmented button.active) { background: var(--theme-accent-soft); color: var(--theme-accent); border-color: var(--theme-accent); }
html[data-theme="dark"] .studio-app .stage-strip strong { color: var(--theme-accent); }
html[data-theme="dark"] .studio-app .segmented button { color: var(--theme-muted); }

/* The Android download landing page has no activity scene; both modes can use
   the same semantic colours while retaining its app icon and screenshots. */
html[data-theme] body:has(main > .install) { background: var(--theme-bg); color: var(--theme-text); }
html[data-theme] body:has(main > .install) :is(.hero, .features article, .install, .details) { background: var(--theme-surface); border-color: var(--theme-border); color: var(--theme-text); }
html[data-theme] body:has(main > .install) :is(p, ol, .meta, .back, .note, code, footer) { color: var(--theme-muted); }
html[data-theme] body:has(main > .install) :is(.kicker, header strong, .ios) { color: var(--theme-accent); }
html[data-theme] body:has(main > .install) .button.secondary { color: var(--theme-text); border-color: var(--theme-border); }
}

@media print {
  html { color-scheme: light !important; }
}
