/* Theme preferences and the dark reading palette. Loaded after the existing CSS. */
.site-header .nav-shell { gap: 12px; }
@media (min-width: 1101px) {
  .site-header .primary-nav { flex: 1 1 auto; min-width: 0; flex-wrap: wrap; padding-block: 8px; }
  .site-header .primary-nav > a, .site-header .primary-nav > .nav-library > summary { padding-inline: 8px; }
}
.translation-notice {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 20px;
  padding: 12px 18px;
  margin-top: 14px;
  font-size: 13px;
  color: var(--ink);
  background: var(--cool);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.translation-notice[hidden], .translation-notice button[hidden] { display: none; }
.translation-notice button { min-height: 44px; color: var(--ink); background: var(--white); border: 1px solid var(--line); border-radius: 4px; padding: 8px 12px; cursor: pointer; }
.translation-notice [data-translation-status]:focus-visible { outline: 2px solid var(--forest); outline-offset: 5px; border-radius: 2px; }
html[data-theme="dark"] .ta-page { color: var(--ink); }
html[data-theme="dark"] :is(.ta-card, .ta-topic-hero, .ta-empty, .ta-admin-note) {
  background: var(--white); color: var(--ink); border-color: var(--line);
}
html[data-theme="dark"] :is(.ta-section-heading > span, .ta-number, .ta-card .eyebrow, .ta-description, .ta-card-bottom > span, .ta-footnote, .ta-breadcrumb, .ta-topic-hero .ta-lead, .ta-empty p, .ta-access-note p, .ta-other-topics > span) { color: var(--muted); }
html[data-theme="dark"] :is(.ta-breadcrumb a, .ta-empty a, .ta-admin-note a, .ta-access-note > a, .ta-other-topics > a, .ta-steps span) { color: var(--forest); }
html[data-theme="dark"] :is(.ta-card-bottom, .ta-access-note, .ta-steps li) { border-color: var(--line); }
.site-preferences {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: .45rem;
  flex: 0 0 auto;
  min-width: 0;
}

.theme-toggle,
.language-control select {
  min-height: 44px;
  color: var(--forest);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 14px;
}

.theme-toggle {
  display: inline-grid;
  width: 44px;
  flex: 0 0 44px;
  place-items: center;
  padding: .35rem;
  cursor: pointer;
}

.theme-toggle:hover,
.theme-toggle:focus-visible,
.language-control select:hover {
  border-color: var(--forest-soft);
}

.theme-toggle [data-theme-icon] {
  line-height: 1;
}

.language-control {
  display: inline-flex;
  align-items: center;
  min-width: 0;
}

.language-control select {
  width: auto;
  max-width: 7.5rem;
  padding: .3rem .55rem;
  cursor: pointer;
}

html[data-theme="dark"] {
  color-scheme: dark;
  --paper: #101713;
  --paper-deep: #17231b;
  --ink: #e5eee7;
  --forest: #9bd6a5;
  --forest-soft: #86bb91;
  --lime: #d8f38d;
  --lime-deep: #b6d879;
  --line: #34473b;
  --muted: #a7b7ac;
  --warm: #43351f;
  --cool: #21383b;
  --danger: #f0a69c;
  --white: #1b2820;
  --shadow: 0 16px 42px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] body {
  background: var(--paper);
  color: var(--ink);
}

html[data-theme="dark"] ::selection {
  color: #101713;
  background: var(--lime);
}

html[data-theme="dark"] :focus-visible {
  outline: 3px solid var(--lime-deep);
  outline-offset: 3px;
}

/* Media keeps its source colors; dark mode changes the surrounding surface only. */
html[data-theme="dark"] img,
html[data-theme="dark"] video,
html[data-theme="dark"] iframe,
html[data-theme="dark"] canvas {
  filter: none;
}

html[data-theme="dark"] input,
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] option {
  color: var(--ink);
  background-color: var(--white);
}

html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder {
  color: #83958a;
  opacity: 1;
}

html[data-theme="dark"] .public-site {
  --muted: #a7b7ac;
  --line: #34473b;
  --surface-soft: #1a2a20;
  --accent-dark: #9bd6a5;
}

html[data-theme="dark"] .site-preferences {
  color: var(--ink);
}

html[data-theme="dark"] .theme-toggle,
html[data-theme="dark"] .language-control select {
  color: var(--ink);
  background: #18251d;
  border-color: #3a5142;
}

html[data-theme="dark"] .theme-toggle:hover,
html[data-theme="dark"] .theme-toggle:focus-visible,
html[data-theme="dark"] .language-control select:hover {
  color: var(--lime);
  background: #203328;
  border-color: var(--forest-soft);
}

html[data-theme="dark"] .site-header {
  --nav-paper: #152219;
  --nav-forest: #9bd6a5;
  --nav-ink: #e5eee7;
  --nav-lime: #d8f38d;
  --nav-line: #34473b;
  --nav-muted: #a7b7ac;
  background: rgba(16, 23, 19, .96);
  border-color: var(--line);
}

html[data-theme="dark"] .primary-nav > a:hover,
html[data-theme="dark"] .primary-nav > a:focus-visible,
html[data-theme="dark"] .primary-nav > a.is-active,
html[data-theme="dark"] .primary-nav > a[aria-current="page"],
html[data-theme="dark"] .nav-logout button:hover,
html[data-theme="dark"] .nav-logout button:focus-visible,
html[data-theme="dark"] .primary-nav > .nav-library > summary:hover,
html[data-theme="dark"] .primary-nav > .nav-library > summary:focus-visible,
html[data-theme="dark"] .primary-nav > .nav-library > summary.is-active,
html[data-theme="dark"] .nav-library-menu a:hover,
html[data-theme="dark"] .nav-library-menu a:focus-visible,
html[data-theme="dark"] .nav-library-menu a.is-active {
  color: var(--forest);
  background: #21352a;
  border-color: #3b5744;
}

html[data-theme="dark"] .primary-nav > a.button.button-lime,
html[data-theme="dark"] .primary-nav > a.nav-register {
  color: #132018;
  background: var(--lime);
  border-color: var(--lime);
}

html[data-theme="dark"] .primary-nav > a.button.button-lime:hover,
html[data-theme="dark"] .primary-nav > a.button.button-lime:focus-visible,
html[data-theme="dark"] .primary-nav > a.nav-register:hover,
html[data-theme="dark"] .primary-nav > a.nav-register:focus-visible {
  color: #0e1812;
  background: #e5f9a6;
  border-color: #e5f9a6;
}

html[data-theme="dark"] .nav-library-menu {
  background: var(--nav-paper);
  border-color: var(--nav-line);
  box-shadow: 0 14px 28px rgba(0, 0, 0, .34);
}

html[data-theme="dark"] .library-subnav a:hover,
html[data-theme="dark"] .library-subnav a:focus-visible,
html[data-theme="dark"] .admin-subnav a:hover,
html[data-theme="dark"] .admin-subnav a:focus-visible,
html[data-theme="dark"] .admin-subnav a.is-active {
  color: var(--forest);
  background: #203128;
  border-color: var(--line);
}

html[data-theme="dark"] .library-subnav a.is-active {
  color: #132018;
  background: var(--lime);
  border-color: var(--lime);
}

html[data-theme="dark"] .menu-toggle {
  color: var(--forest);
  background: transparent;
  border-color: var(--line);
}

html[data-theme="dark"] .site-footer {
  color: #b2c0b6;
  background: #0a100c;
  border-top-color: #26372d;
}

html[data-theme="dark"] .site-footer .brand-footer .brand-copy strong,
html[data-theme="dark"] .site-footer .footer-heading {
  color: #e5eee7;
}

html[data-theme="dark"] .site-footer .brand-footer .brand-copy small,
html[data-theme="dark"] .site-footer .footer-note,
html[data-theme="dark"] .site-footer .footer-links a,
html[data-theme="dark"] .site-footer .footer-bottom,
html[data-theme="dark"] .site-footer a,
html[data-theme="dark"] .site-footer small {
  color: #9baa9f;
}

html[data-theme="dark"] .site-footer .footer-links a:hover,
html[data-theme="dark"] .site-footer .footer-links a:focus-visible {
  color: var(--lime);
  border-bottom-color: var(--lime);
}

html[data-theme="dark"] .skip-link {
  color: #101713;
  background: var(--lime);
}

html[data-theme="dark"] .button-dark {
  color: #eaf4eb;
  background: #214b36;
  border-color: #214b36;
}

html[data-theme="dark"] .button-dark:hover {
  color: #f4fff4;
  background: #2d6548;
  border-color: #2d6548;
}

html[data-theme="dark"] .button-lime {
  color: #122017;
  background: var(--lime);
  border-color: var(--lime);
}

html[data-theme="dark"] .button-lime:hover {
  color: #0d1711;
  background: #e5f9a6;
  border-color: #e5f9a6;
}

html[data-theme="dark"] .button-outline {
  color: var(--forest);
  border-color: var(--forest);
}

html[data-theme="dark"] .button-outline:hover {
  color: #112018;
  background: var(--forest);
}

html[data-theme="dark"] .button-quiet:hover {
  color: var(--ink);
  background: var(--paper-deep);
}

html[data-theme="dark"] .text-link,
html[data-theme="dark"] .text-link:hover,
html[data-theme="dark"] .results-line a,
html[data-theme="dark"] .pagination a {
  color: var(--forest);
}

html[data-theme="dark"] .flash-success {
  color: #b0e0ba;
  background: #173425;
  border-color: #356348;
}

html[data-theme="dark"] .flash-error,
html[data-theme="dark"] .form-error {
  color: #ffb7ac;
  background: #3a211f;
  border-color: #75433b;
}

html[data-theme="dark"] .flash-info,
html[data-theme="dark"] .notice-cool {
  color: #a9d8dc;
  background: #1d3538;
  border-color: #3c6264;
}

html[data-theme="dark"] .preview-notice,
html[data-theme="dark"] .notice-warm,
html[data-theme="dark"] .status-pending,
html[data-theme="dark"] .status-draft {
  color: #f0d18b;
  background: #43351f;
  border-color: #80643a;
}

html[data-theme="dark"] .preview-notice a {
  color: #f5d998;
}

html[data-theme="dark"] .status-approved,
html[data-theme="dark"] .status-published,
html[data-theme="dark"] .status-sent {
  color: #b0e0ba;
  background: #173425;
}

html[data-theme="dark"] .status-rejected,
html[data-theme="dark"] .status-failed {
  color: #ffb7ac;
  background: #3a211f;
}

html[data-theme="dark"] .status-preview {
  color: #a9d8dc;
  background: #1d3538;
}

html[data-theme="dark"] .featured-layout,
html[data-theme="dark"] .filter-bar,
html[data-theme="dark"] .admin-filter,
html[data-theme="dark"] .article-card,
html[data-theme="dark"] .panel,
html[data-theme="dark"] .auth-card,
html[data-theme="dark"] .editor-panel,
html[data-theme="dark"] .table-scroll,
html[data-theme="dark"] .meme-card,
html[data-theme="dark"] .meme-form-panel,
html[data-theme="dark"] .meme-mine-row,
html[data-theme="dark"] .meme-detail-card,
html[data-theme="dark"] .meme-admin-tabs a,
html[data-theme="dark"] .podcast-card,
html[data-theme="dark"] .podcast-player-panel,
html[data-theme="dark"] .podcast-editor-panel,
html[data-theme="dark"] .tweet-card,
html[data-theme="dark"] .tweet-editor-preview,
html[data-theme="dark"] .library-lock,
html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .external-embed {
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
}

html[data-theme="dark"] .article-card:hover,
html[data-theme="dark"] .meme-card:hover {
  box-shadow: var(--shadow);
}

html[data-theme="dark"] .article-card-cover,
html[data-theme="dark"] .featured-cover,
html[data-theme="dark"] .hero-art,
html[data-theme="dark"] .cover-preview,
html[data-theme="dark"] .meme-card-media,
html[data-theme="dark"] .meme-mine-thumb,
html[data-theme="dark"] .meme-admin-thumb,
html[data-theme="dark"] .meme-dialog-image-link,
html[data-theme="dark"] .meme-detail-image-link,
html[data-theme="dark"] .external-embed-frame,
html[data-theme="dark"] .article-cover {
  background: var(--paper-deep);
}

html[data-theme="dark"] .article-card h2,
html[data-theme="dark"] .article-card h3,
html[data-theme="dark"] .featured-copy h3,
html[data-theme="dark"] .page-intro h1,
html[data-theme="dark"] .section-heading h2,
html[data-theme="dark"] .section-heading h3,
html[data-theme="dark"] .article-header h1,
html[data-theme="dark"] .auth-intro h1,
html[data-theme="dark"] .account-intro h1,
html[data-theme="dark"] .admin-heading h2,
html[data-theme="dark"] .admin-sidebar-title h1,
html[data-theme="dark"] .editor-heading h1,
html[data-theme="dark"] .error-page h1,
html[data-theme="dark"] .meme-page-heading h1,
html[data-theme="dark"] .meme-form-heading h1,
html[data-theme="dark"] .meme-card h3,
html[data-theme="dark"] .meme-mine-copy h2,
html[data-theme="dark"] .meme-detail-copy h1,
html[data-theme="dark"] .podcast-detail-heading h1,
html[data-theme="dark"] .podcast-card h2,
html[data-theme="dark"] .tweets-heading h1,
html[data-theme="dark"] .tweets-section-heading h2,
html[data-theme="dark"] .library-heading h1,
html[data-theme="dark"] .library-card h2 {
  color: var(--forest);
}

html[data-theme="dark"] .prose,
html[data-theme="dark"] .public-site .article-prose,
html[data-theme="dark"] .mail-body {
  color: var(--ink);
}

html[data-theme="dark"] .prose a,
html[data-theme="dark"] .public-site .article-prose a,
html[data-theme="dark"] .public-site .article-toc a,
html[data-theme="dark"] .meme-source a,
html[data-theme="dark"] .tweet-source-link,
html[data-theme="dark"] .tweet-admin-source {
  color: var(--forest);
}

html[data-theme="dark"] .prose blockquote,
html[data-theme="dark"] .public-site .article-prose blockquote,
html[data-theme="dark"] .prose code,
html[data-theme="dark"] .public-site .article-prose th,
html[data-theme="dark"] .admin-table th,
html[data-theme="dark"] .download-selection .check-field,
html[data-theme="dark"] .admin-content code,
html[data-theme="dark"] .browse-link.is-active,
html[data-theme="dark"] .browse-all,
html[data-theme="dark"] .browse-shortcuts a {
  background: var(--paper-deep);
}

html[data-theme="dark"] .prose blockquote,
html[data-theme="dark"] .public-site .article-prose blockquote {
  color: var(--forest-soft);
  border-left-color: var(--lime-deep);
}

html[data-theme="dark"] .prose pre,
html[data-theme="dark"] .public-site .article-prose pre,
html[data-theme="dark"] .markdown-editor,
html[data-theme="dark"] .mail-body {
  color: #dce9df;
  background: #111b15;
  border-color: var(--line);
}

html[data-theme="dark"] .public-site .article-prose pre code {
  color: #dce9df;
}

html[data-theme="dark"] .field input,
html[data-theme="dark"] .field select,
html[data-theme="dark"] .field textarea,
html[data-theme="dark"] .review-form textarea,
html[data-theme="dark"] .membership-actions input,
html[data-theme="dark"] .public-site .field input,
html[data-theme="dark"] .public-site .field select,
html[data-theme="dark"] .markdown-editor,
html[data-theme="dark"] .upload-alt-label input,
html[data-theme="dark"] .meme-tag-edit-form input[type="text"] {
  color: var(--ink);
  background: #141f18;
  border-color: #405447;
}

html[data-theme="dark"] .field input:focus,
html[data-theme="dark"] .field select:focus,
html[data-theme="dark"] .field textarea:focus,
html[data-theme="dark"] .review-form textarea:focus,
html[data-theme="dark"] .membership-actions input:focus,
html[data-theme="dark"] .markdown-editor:focus,
html[data-theme="dark"] .meme-tag-edit-form input[type="text"]:focus {
  border-color: var(--forest);
  box-shadow: 0 0 0 3px rgba(155, 214, 165, .2);
}

html[data-theme="dark"] .empty-state,
html[data-theme="dark"] .empty-state-admin {
  border-color: #52685a;
}

html[data-theme="dark"] .empty-icon,
html[data-theme="dark"] .file-icon {
  color: var(--forest);
  border-color: var(--forest);
}

html[data-theme="dark"] .access-members {
  color: #eaf4eb;
  background: #214b36;
}

html[data-theme="dark"] .access-partial {
  color: #241b0f;
  background: #e4b66e;
}

html[data-theme="dark"] .access-public,
html[data-theme="dark"] .access-badge,
html[data-theme="dark"] .admin-mode,
html[data-theme="dark"] .stat-card-lime,
html[data-theme="dark"] .meme-filter-link.is-active,
html[data-theme="dark"] .meme-admin-tabs a.is-active,
html[data-theme="dark"] .podcasts-editor-page .library-subnav a.is-active {
  color: #132018;
  background: var(--lime);
  border-color: var(--lime);
}

html[data-theme="dark"] .category-item:hover,
html[data-theme="dark"] .home-entry:hover,
html[data-theme="dark"] .home-topic:hover,
html[data-theme="dark"] .meme-filter-link:hover,
html[data-theme="dark"] .podcasts-editor-page .library-subnav a:hover,
html[data-theme="dark"] .browse-link:hover,
html[data-theme="dark"] .browse-shortcuts a:hover,
html[data-theme="dark"] .browse-shortcuts a[aria-current] {
  color: var(--forest);
  background: var(--paper-deep);
}

html[data-theme="dark"] .member-callout,
html[data-theme="dark"] .locked-content,
html[data-theme="dark"] .hero-art,
html[data-theme="dark"] .home-member,
html[data-theme="dark"] .hub-hero,
html[data-theme="dark"] .hub-member {
  color: #e8f2e9;
  background: #142b21;
}

html[data-theme="dark"] .member-callout h2,
html[data-theme="dark"] .locked-content h2,
html[data-theme="dark"] .home-member h2,
html[data-theme="dark"] .home-hero h1,
html[data-theme="dark"] .hub-hero h1,
html[data-theme="dark"] .hub-member h2 {
  color: #e8f2e9;
}

html[data-theme="dark"] .hero-coin {
  color: #132018;
  border-color: rgba(229, 242, 231, .9);
}

html[data-theme="dark"] .member-callout p:not(.eyebrow),
html[data-theme="dark"] .locked-content p,
html[data-theme="dark"] .home-member p:not(.eyebrow),
html[data-theme="dark"] .home-hero-copy > p:not(.eyebrow),
html[data-theme="dark"] .hub-lede,
html[data-theme="dark"] .hub-member p {
  color: #b8cdbd;
}

html[data-theme="dark"] .home-hero .text-link {
  color: #dceadd;
}

html[data-theme="dark"] .home-lead { box-shadow: inset 0 0 0 1px #385347; }

html[data-theme="dark"] .member-callout .button-lime,
html[data-theme="dark"] .home-member .button-lime {
  color: #132018;
}

html[data-theme="dark"] .identity-badge.is-member {
  background: #26391f;
  border-color: var(--lime-deep);
}

html[data-theme="dark"] .identity-badge.is-member .status-dot {
  background: var(--lime);
}

html[data-theme="dark"] .stat-card-lime span,
html[data-theme="dark"] .stat-card-lime strong,
html[data-theme="dark"] .stat-card-lime a {
  color: #132018;
}

html[data-theme="dark"] .status-label {
  color: var(--forest);
  background: var(--paper-deep);
}

html[data-theme="dark"] .meme-preview-dialog {
  color: var(--ink);
  background: var(--paper);
  border-color: var(--line);
  box-shadow: 0 24px 70px rgba(0, 0, 0, .5);
}

html[data-theme="dark"] .meme-preview-dialog::backdrop {
  background: rgba(0, 0, 0, .78);
}

html[data-theme="dark"] .meme-review-note,
html[data-theme="dark"] .meme-detail-review {
  color: #f0d18b;
  background: #43351f;
  border-left-color: #b88945;
}

html[data-theme="dark"] .meme-review-note strong {
  color: #f0d18b;
}

html[data-theme="dark"] .meme-copy-status.is-success,
html[data-theme="dark"] .meme-upload-status.is-success,
html[data-theme="dark"] .upload-status.is-success {
  color: #b0e0ba;
}

html[data-theme="dark"] .podcast-audio-block,
html[data-theme="dark"] .tweet-embed-panel {
  background: #141f18;
  border-color: var(--line);
}

html[data-theme="dark"] .latest-list a:hover h3,
html[data-theme="dark"] .feature-story h3 a:hover {
  color: var(--forest);
}

html[data-theme="dark"] .home-step-number,
html[data-theme="dark"] .public-site .article-prose li::marker {
  color: var(--forest-soft);
}

html[data-theme="dark"] .tweet-form-error,
html[data-theme="dark"] .editor-validation-summary {
  color: #ffb7ac;
  background: #3a211f;
  border-color: #75433b;
}

html[data-theme="dark"] .browse-sidebar {
  scrollbar-color: #50675a transparent;
}

html[data-theme="dark"] .browse-link.is-active {
  background: #294337;
  box-shadow: inset 3px 0 var(--forest);
}

html[data-theme="dark"] .browse-shortcuts a,
html[data-theme="dark"] .browse-all,
html[data-theme="dark"] .browse-toggle {
  color: var(--forest);
  background: #1a2a20;
}

html[data-theme="dark"] .browse-arrow {
  color: #91aa98;
}

html[data-theme="dark"] .library-reader {
  --reader-paper: #1b2820;
  --reader-paper-deep: #17231b;
  --reader-ink: #e5eee7;
  --reader-forest: #9bd6a5;
  --reader-muted: #a7b7ac;
  --reader-line: #34473b;
  --reader-shadow: 0 14px 42px rgba(0, 0, 0, .42);
}

html[data-theme="dark"] .library-reader__toolbar {
  background: #203128;
}

html[data-theme="dark"] .library-reader__page-input,
html[data-theme="dark"] .library-reader__button {
  color: var(--reader-ink);
  background: #1b2820;
  border-color: var(--reader-line);
}

html[data-theme="dark"] .library-reader__button:hover:not(:disabled) {
  background: #294337;
  border-color: #587460;
}

html[data-theme="dark"] .library-reader__button:focus-visible,
html[data-theme="dark"] .library-reader__page-input:focus,
html[data-theme="dark"] .library-reader__password-form input:focus {
  outline-color: var(--lime-deep);
}

html[data-theme="dark"] .library-reader__button--dark {
  color: #eaf4eb;
  background: #214b36;
  border-color: #214b36;
}

html[data-theme="dark"] .library-reader__button--dark:hover:not(:disabled) {
  color: #fff;
  background: #2d6548;
  border-color: #2d6548;
}

html[data-theme="dark"] .library-reader__sidebar {
  background: #142019;
}

html[data-theme="dark"] .library-reader__outline details > ol {
  border-left-color: #405747;
}

html[data-theme="dark"] .library-reader__outline a:hover,
html[data-theme="dark"] .library-reader__outline button:hover:not(:disabled) {
  background: #294337;
}

html[data-theme="dark"] .library-reader__outline .is-current {
  background: #34533d;
}

html[data-theme="dark"] .library-reader__main {
  background: #101a14;
}

html[data-theme="dark"] .library-reader__page-stack,
html[data-theme="dark"] .library-reader__page-stack canvas {
  background: #fff;
  filter: none;
}

html[data-theme="dark"] .library-reader__error,
html[data-theme="dark"] .library-reader__password {
  background: #1b2820;
  border-color: #80643a;
}

html[data-theme="dark"] .library-reader__error {
  color: #f0d18b;
  background: #43351f;
}

html[data-theme="dark"] .library-reader__error strong {
  color: #ffb7ac;
}

html[data-theme="dark"] .library-reader__password {
  border-color: var(--reader-line);
}

html[data-theme="dark"] .library-reader__password-form input {
  color: var(--reader-ink);
  background: #141f18;
  border-color: var(--reader-line);
}

html[data-theme="dark"] .hub-entries > a,
html[data-theme="dark"] .hub-start,
html[data-theme="dark"] .hub-topic,
html[data-theme="dark"] .reader-paper,
html[data-theme="dark"] .reader-aside .aside-card,
html[data-theme="dark"] .reader-platforms,
html[data-theme="dark"] .editor-workflow-bar,
html[data-theme="dark"] .rich-surface,
html[data-theme="dark"] .editor-panel {
  color: var(--ink);
  background: var(--white);
  border-color: var(--line);
}

html[data-theme="dark"] .hub-entry-highlight,
html[data-theme="dark"] .hub-topic-icon,
html[data-theme="dark"] .hub-lessons,
html[data-theme="dark"] .workflow-recovery,
html[data-theme="dark"] .revision-comparison summary,
html[data-theme="dark"] .editor-required-guide,
html[data-theme="dark"] .rich-surface .upload-marker,
html[data-theme="dark"] .rich-mode button[aria-pressed="true"],
html[data-theme="dark"] .markdown-toolbar button.is-active {
  color: var(--ink);
  background: #24372a;
}

html[data-theme="dark"] .hub-entry-icon,
html[data-theme="dark"] .rich-mode button,
html[data-theme="dark"] .markdown-toolbar button,
html[data-theme="dark"] .rich-surface pre {
  color: var(--ink);
  background: #18261d;
  border-color: var(--line);
}

html[data-theme="dark"] .hub-entries small,
html[data-theme="dark"] .hub-start b,
html[data-theme="dark"] .hub-course li a > span:first-child {
  color: var(--forest-soft);
}

html[data-theme="dark"] .rich-surface blockquote {
  color: var(--forest-soft);
  border-left-color: var(--lime-deep);
}

html[data-theme="dark"] .rich-surface a {
  color: var(--forest);
}

html[data-theme="dark"] .rich-format-warning {
  color: #f0d18b;
  background: #43351f;
  border-color: #80643a;
}

html[data-theme="dark"] .editor-field-error,
html[data-theme="dark"] .field-required,
html[data-theme="dark"] .editor-form .field .field-required,
html[data-theme="dark"] .editor-workflow-bar .is-error {
  color: #ffb7ac;
}

html[data-theme="dark"] .platform-link {
  color: #e5eee7;
  background: #294337;
  border-bottom-color: #405747;
}

html[data-theme="dark"] .platform-1 {
  color: #e5eee7;
  background: #18261d;
}

html[data-theme="dark"] .platform-2,
html[data-theme="dark"] .platform-3,
html[data-theme="dark"] .platform-4,
html[data-theme="dark"] .platform-5 {
  color: #e5eee7;
  background: #26382d;
}

html[data-theme="dark"] .public-site .reader-platforms,
html[data-theme="dark"] .mobile-toc {
  background: #18261d;
  border-color: var(--line);
}

html[data-theme="dark"] .public-site .locked-content {
  color: #e5eee7;
  background: #203b2b;
  border-color: #3b6648;
}

html[data-theme="dark"] .public-site .locked-content h2,
html[data-theme="dark"] .public-site .mobile-toc summary {
  color: #e5eee7;
}

html[data-theme="dark"] .public-site .locked-content p {
  color: #b8cdbd;
}

html[data-theme="dark"] .public-site .article-prose .table-scroll {
  border-color: var(--line);
}

html[data-theme="dark"] .public-site .article-prose th {
  color: var(--forest);
  background: #24372a;
}

html[data-theme="dark"] .public-site .article-prose .tag,
html[data-theme="dark"] .tag {
  color: var(--forest-soft);
  background: var(--paper-deep);
  border-color: var(--line);
}

html[data-theme="dark"] .public-site .article-prose .tag-row a.tag {
  border-color: var(--line);
}

html[data-theme="dark"] .public-site .article-prose .article-excerpt {
  border-left-color: var(--lime-deep);
}

html[data-theme="dark"] .public-site .field input,
html[data-theme="dark"] .public-site .field select {
  background: #141f18;
}

html[data-theme="dark"] .member-library-note {
  color: var(--ink);
  background: #24372a;
}

html[data-theme="dark"] .library-count,
html[data-theme="dark"] .topic-tabs a,
html[data-theme="dark"] .public-site .filter-bar,
html[data-theme="dark"] .public-site .empty-state,
html[data-theme="dark"] .public-site .auth-card,
html[data-theme="dark"] .public-site .account-page .panel {
  background: var(--white);
  border-color: var(--line);
}

html[data-theme="dark"] .topic-tabs a[aria-current="page"] {
  color: #eaf4eb;
  background: #214b36;
  border-color: #214b36;
}

html[data-theme="dark"] .public-site .article-card:hover {
  border-color: #587460;
  box-shadow: var(--shadow);
}

@media (max-width: 1100px) {
  .site-preferences {
    width: 100%;
    gap: 12px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid var(--line);
  }

  .language-control select {
    width: 144px;
    max-width: 100%;
  }
}
