/* Shared DataMoney color mode. Original images, charts and layout stay intact. */
:root {
  /* The blog list and tools shell use the same page backdrop. */
  --dm-shell-page-background: radial-gradient(circle at top left, rgba(37,99,235,.08), transparent 18%), linear-gradient(180deg, #f8fbff 0%, #eef4fb 100%);
  --dm-dark-bg: #101824;
  --dm-dark-surface: #1b2738;
  --dm-dark-raised: #243348;
  --dm-dark-border: #40516a;
  --dm-dark-text: #e7edf7;
  --dm-dark-muted: #b6c4d7;
  --dm-dark-link: #a9c9ff;
}

.dm-theme-control { position: relative; display: inline-flex; flex: none; align-items: center; margin-left: 2px; font-family: "Pretendard", "Malgun Gothic", sans-serif; line-height: 1.4; }
.dm-theme-toggle { display: grid; place-items: center; width: 42px; height: 42px; padding: 0; border: 1px solid #6b87b2; border-radius: 12px; background: #eaf2ff; color: #173563; cursor: pointer; }
.dm-site-header .dm-theme-toggle { background: #fff; }
.dm-theme-toggle:hover { border-color: #3e68a5; background: #dceaff; }
.dm-theme-toggle svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.dm-theme-menu { position: absolute; z-index: 300; top: calc(100% + 8px); right: 0; box-sizing: border-box; width: 164px; padding: 8px; border: 1px solid #dce5f0; border-radius: 13px; background: #fff; color: #233750; box-shadow: 0 12px 32px rgba(15, 23, 42, .16); }
.dm-theme-menu[hidden] { display: none !important; }
.dm-theme-heading { display: block; padding: 6px 9px 7px; color: #64748b; font-size: 12px; font-weight: 700; }
.dm-theme-menu button { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 38px; padding: 7px 9px; border: 0; border-radius: 8px; background: transparent; color: #34455e; font: inherit; font-size: 14px; text-align: left; cursor: pointer; }
.dm-theme-menu button:hover { background: #edf4ff; }
.dm-theme-menu button[aria-pressed="true"] { background: #e9f1ff; color: #174ba6; font-weight: 700; }
.dm-theme-menu button[aria-pressed="true"]::after { content: "✓"; font-weight: 700; }
.dm-theme-control :is(button):focus-visible { outline: 3px solid #5b8df7; outline-offset: 2px; }
html.dm-embedded .dm-theme-control { display: none !important; }
html.dm-embedded[data-dm-page="calculator"] body { background:transparent !important; }
html.dm-embedded[data-dm-page="calculator"] body > :is(header, footer) { display:none !important; }
html.dm-embedded[data-dm-page="calculator"] .container { max-width:720px; padding:0 0 28px; }
html.dm-embedded[data-dm-page="calculator"] .container > h1 { display:none; }
header > .dm-theme-control { order: 2; margin-left: auto; }
html[data-dm-page="investor"] .shell > header { gap: 8px; }
html[data-dm-page="investor"] .shell > header > a:last-child { margin-left: auto; white-space: nowrap; }
html[data-dm-page="investor"] .shell > header > .dm-theme-control { margin-left: 0; }
html[data-dm-page="calculator"] body > header { gap: 10px; }
html[data-dm-page="calculator"] body > header > .logo { flex: none; }
html[data-dm-page="calculator"] body > header > .logo span { color: #9fc3ff; }
html[data-dm-page="calculator"] body > header > span { flex: 1 1 auto; min-width: 0; overflow: hidden; color: #b6c4d7 !important; text-align: right; text-overflow: ellipsis; white-space: nowrap; }
html[data-dm-page="calculator"] body > header > .dm-theme-control { margin-left: 0; }
html[data-dm-page="home"] .topbar .nav a { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border-color: #6b87b2; background: #eaf2ff; color: #173563; font-weight: 700; }
html[data-dm-page="home"] .topbar .nav a:hover { border-color: #3e68a5; background: #dceaff; }
html[data-dm-page="home"] .topbar .nav a:focus-visible { outline: 3px solid #2563eb; outline-offset: 3px; }

@media (max-width: 380px) {
  .dm-site-header .dm-site-nav { gap: 3px; }
  .dm-site-header .dm-site-nav a { padding-inline: 6px; font-size: 13px; }
  .dm-site-header .dm-brand { font-size: 18px; gap: 4px; }
  .dm-site-header .dm-brand-icon { width: 24px; height: 24px; }
  .dm-site-header .dm-theme-toggle { width: 34px; height: 34px; border-radius: 10px; }
}

/* Match the mobile color-mode control to the adjacent search icon. */
@media (max-width: 760px) {
  .dm-site-header[data-dm-mobile-search-ready] > .dm-theme-control .dm-theme-toggle {
    width: 100%; height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: #173563;
  }
  .dm-site-header[data-dm-mobile-search-ready] > .dm-theme-control .dm-theme-toggle:hover { background: transparent; }
  .dm-site-header[data-dm-mobile-search-ready] > .dm-theme-control .dm-theme-toggle svg { width: 22px; height: 22px; stroke-width: 2; }
  .dm-site-header[data-dm-mobile-search-ready] > .dm-theme-control .dm-theme-toggle:focus-visible { outline: 2px solid #2563eb; outline-offset: 1px; }
  html[data-dm-theme="dark"] .dm-site-header[data-dm-mobile-search-ready] > .dm-theme-control .dm-theme-toggle,
  html[data-dm-theme="dark"] .dm-site-header[data-dm-mobile-search-ready] > .dm-theme-control .dm-theme-toggle:hover { background: transparent; color: #f2f6fd; }
}

@media screen {
  html[data-dm-theme="dark"] { color-scheme: dark; }
  html[data-dm-theme="dark"][data-dm-page="article"] { --dm-dark-bg: var(--dm-dark-surface); }
  html[data-dm-theme="dark"] body { background: var(--dm-dark-bg) !important; color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"].dm-embedded body { background: transparent !important; }

  html[data-dm-theme="dark"] .dm-theme-toggle { border-color: #8da6c9; background: #293b55; color: #f2f6fd; }
  html[data-dm-theme="dark"] .dm-theme-toggle:hover { border-color: #b6cbee; background: #3b5372; }
  html[data-dm-theme="dark"] .dm-theme-menu { border-color: var(--dm-dark-border); background: #1b2738; color: var(--dm-dark-text); box-shadow: 0 12px 32px rgba(0,0,0,.32); }
  html[data-dm-theme="dark"] .dm-theme-heading { color: var(--dm-dark-muted); }
  html[data-dm-theme="dark"] .dm-theme-menu button { color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-theme-menu button:hover { background: #293c55; }
  html[data-dm-theme="dark"] .dm-theme-menu button[aria-pressed="true"] { background: #304668; color: #d9e8ff; }

  /* Shared masthead, search, navigation and site footer. */
  html[data-dm-theme="dark"] .dm-site-header { background-color: var(--dm-dark-bg) !important; }
  html[data-dm-theme="dark"] .dm-site-header .dm-brand,
  html[data-dm-theme="dark"] .dm-site-header .dm-brand-text { color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] .dm-site-header .dm-brand-text > span { color: #9fc3ff !important; }
  html[data-dm-theme="dark"] .dm-site-header .dm-header-search { background: var(--dm-dark-surface); border-color: var(--dm-dark-border); }
  html[data-dm-theme="dark"] .dm-site-header .dm-header-search :is(input, button) { color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-site-header .dm-header-search input::placeholder { color: #b6c4d7; }
  html[data-dm-theme="dark"] .dm-site-header .dm-site-nav a { border-color: var(--dm-dark-border); background: var(--dm-dark-raised) !important; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-site-header .dm-site-nav a:hover { border-color: #7893b8; background: #304660 !important; }
  html[data-dm-theme="dark"] .dm-site-header .dm-theme-toggle { border-color: var(--dm-dark-border); background: var(--dm-dark-raised); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-site-header .dm-theme-toggle:hover { border-color: #7893b8; background: #304660; }
  @media (max-width: 760px) {
    html[data-dm-theme="dark"] .dm-site-header:not([data-dm-mobile-search-ready]) .dm-site-nav a { border-color: transparent; background: transparent !important; }
  }
  html[data-dm-theme="dark"][data-dm-page="home"] .topbar .nav a { border-color: #8da6c9; background: #293b55; color: #f2f6fd; }
  html[data-dm-theme="dark"][data-dm-page="home"] .topbar .nav a:hover { border-color: #b6cbee; background: #3b5372; }
  html[data-dm-theme="dark"] :is(.dm-site-footer, .dm-site-footer .dm-footer-links a, .dm-article-note) { color: var(--dm-dark-muted); border-color: var(--dm-dark-border); }
  html[data-dm-theme="dark"] [data-site-info-links] { color: var(--dm-dark-muted) !important; }
  html[data-dm-theme="dark"] .dm-back-to-top { background: var(--dm-dark-raised); color: #c9ddff; border-color: var(--dm-dark-border); }
  html[data-dm-theme="light"] body.dm-dark-theme { background: #f2f5fa !important; color: #172033; }
  html[data-dm-theme="light"] body.dm-dark-theme .dm-site-header .dm-brand { color: #0f172a; }

  /* Blog list, article paper, sidebar, and embedded investment test. */
  html[data-dm-theme="dark"] :is(.latest-column, .post-card, .topic-card, .search-card,
    .article-shell > .article, .dm-heading-layout > .paper, .dm-sidebar-shell > .dm-article-page,
    .dm-sidebar-shell > article, article.dm-post, main.dm-article-page,
    .dm-shared-sidebar .home-card, .dm-investor-embed) {
    background: var(--dm-dark-surface) !important; border-color: var(--dm-dark-border) !important;
    color: var(--dm-dark-text) !important; box-shadow: 0 12px 32px rgba(0,0,0,.16);
  }
  html[data-dm-theme="dark"] :is(.article-shell > .article, .dm-heading-layout > .paper,
    .dm-sidebar-shell > .dm-article-page, .dm-sidebar-shell > article, article.dm-post, main.dm-article-page) {
    background: var(--dm-dark-bg) !important;
  }
  html[data-dm-theme="dark"] .latest-posts .post-card { background: transparent !important; box-shadow: none; }
  html[data-dm-theme="dark"] .latest-posts .post-card:hover { background: #25364b !important; }
  html[data-dm-theme="dark"][data-dm-page="blog"] { --panel: var(--dm-dark-surface); --text: var(--dm-dark-text); --sub: var(--dm-dark-muted); --line: #40516a; }
  html[data-dm-theme="dark"] :is(.latest-heading, .latest-posts .post-card, .post-pagination) { border-color: var(--dm-dark-border) !important; }
  html[data-dm-theme="dark"] :is(.latest-heading h1, .post-copy h3, .topic-card strong, .search-card h1, .search-results a, .search-results h2) { color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] :is(.post-copy p, .post-copy .meta, .search-status, .search-results p) { color: var(--dm-dark-muted) !important; }
  html[data-dm-theme="dark"] :is(.category-bar a, .post-pagination a, .post-pagination span, .dm-investor-embed-top button) { background: var(--dm-dark-raised); border-color: var(--dm-dark-border); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] :is(.category-bar a[aria-current="page"], .post-pagination a[aria-current="page"]) { background: #315caa; border-color: #7198d4; color: #fff; }
  html[data-dm-theme="dark"] .search-results li { border-color: var(--dm-dark-border); }

  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page)
    :is(h1, h2, h3, h4, p, li, dt, dd, td) { color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] body :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page)
    h2:not(.dm-original-sidebar h2, .dm-comments h2) { color: #f0f5fd !important; }
  html[data-dm-theme="dark"] .dm-article-heading :is(h1, h1 *) { color: #f2f6fc !important; }
  html[data-dm-theme="dark"] :is(.dm-article-byline, .dm-article-byline span, .dm-article-byline span + span::before) { color: var(--dm-dark-muted) !important; }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page) a:not(.button, .button-primary, .dm-yt-link, .dm-end-action, .dm-end-inquiry) { color: var(--dm-dark-link); }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page) :is(.lead, .note, .source, .source-citation, .dm-article-note, figcaption) { color: var(--dm-dark-muted) !important; }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page) :is(table, th, td) { border-color: var(--dm-dark-border) !important; }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page) table th { background: #24364d !important; color: #eff5ff !important; }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page) table td { background: #1b2738 !important; color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page) table tr:nth-child(even) td { background: #223044 !important; }
  html[data-dm-theme="dark"] :is(td.good, .positive, .pos) { color: #8de0ba !important; }
  html[data-dm-theme="dark"] :is(td.bad, .negative, .neg) { color: #ffabb0 !important; }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page)
    :is(.highlight, .info-box, .calc-box, .good-box, .box, .tax-box, .verdict-box, .callout, .punchline, .stat-box, .check-table, .toc, .dm-affiliate-box, .source-figure, .dm-author-note, .sources-box, .aside-card, .mini-list a, .aside-card .toc a, .step-list li, .formula .tile, .dm-original-sidebar .related, div.good, div.bad, .video-box:not(:has(iframe, video))) {
    background: #24364b !important; border-color: #48617f !important; color: var(--dm-dark-text) !important;
  }
  html[data-dm-theme="dark"] body :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page)
    .dm-author-note.dm-about-message { border-color: #405b7b !important; }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page)
    :is(.warn, .warn-box, .warnbox) { background: #413036 !important; border-color: #80535b !important; color: #ffe1e3 !important; }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page)
    :is(.cta-box, .research-excerpt, blockquote:not(.dm-shared-sidebar blockquote)) { background: #1a293c !important; border-color: #526c8d !important; color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] :is(.warn, .warn-box) strong { color: #ffbfc3 !important; }
  html[data-dm-theme="dark"] :is(.punchline, .stat-box, .toc, .cta-box, .highlight, .sources-box, .formula .tile, .dm-original-sidebar .callout) :is(strong, .punchline-text, .num, .lbl, b, span) { color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] :is(.punchline-num, .dm-original-sidebar summary) { color: var(--dm-dark-link) !important; }
  html[data-dm-theme="dark"] .dm-heading-layout > .paper .article p strong { color: #c8dcff !important; }
  html[data-dm-theme="dark"] :is(.source-figure, .dm-author-note) :is(p, strong, h3, .excerpt-label) { color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] :is(.source-figure figcaption, .dm-references p, .dm-references h3) { color: var(--dm-dark-muted) !important; }
  html[data-dm-theme="dark"] :is(.dm-market-chart img, .source-view img, .source-scroll img) { background: #fff; }
  html[data-dm-theme="dark"] :is(.dm-post, .article) span[style*="#dc2626" i] { color: #ffb0b3 !important; }
  html[data-dm-theme="dark"] :is(.dm-post, .article) span[style*="background:" i] { background: #2b4059 !important; border-color: #526c8d !important; color: var(--dm-dark-text) !important; }

  html[data-dm-theme="dark"] .dm-shared-sidebar { color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-shared-sidebar :is(.home-card h2, .popular-title, .quote-card blockquote, .quote-meta) { color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] .dm-shared-sidebar .popular-list li::before { color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] .dm-shared-sidebar :is(.card-note, .popular-empty, .popular-date, .quote-original, .quote-review-note, .quote-translation-source, .ai-traffic-period, .ai-traffic-info, .tag-count, .dm-channel-arrow) { color: var(--dm-dark-muted) !important; }
  html[data-dm-theme="dark"] .dm-shared-sidebar :is(.tag-chip, .quote-heading button, .dm-channel-links a, .dm-channel-links button) { background: var(--dm-dark-raised); border-color: var(--dm-dark-border); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-shared-sidebar .tool-links a { border-color: var(--dm-dark-border); background: transparent; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-shared-sidebar :is(.all-tools, .tool-links a:hover) { color: var(--dm-dark-link); }
  html[data-dm-theme="dark"] .dm-shared-sidebar :is(.dm-channel-threads, .dm-channel-x, .dm-channel-tiktok) { color: #f1f5fb; }
  html[data-dm-theme="dark"] .dm-shared-sidebar :is(.popular-list li, .dm-original-sidebar) { border-color: var(--dm-dark-border); }
  html[data-dm-theme="dark"] .dm-shared-sidebar :is(.ai-traffic-number, .ai-traffic-number span, .quote-mark) { color: var(--dm-dark-link); }

  /* Article actions, comments and voice reader. */
  html[data-dm-theme="dark"] :is(.dm-article-actions, .dm-end-actions, .dm-comments, .dm-comment-item) { border-color: var(--dm-dark-border) !important; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-comments h2 { color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] :is(.dm-action, .dm-comment-controls button, .dm-comment-delete, .dm-comment-cancel, .dm-speech-info, .dm-speech-settings) { color: var(--dm-dark-muted); }
  html[data-dm-theme="dark"] .dm-font-icon strong { color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] :is(.dm-speech-start, .dm-comments-count, .dm-comment-score, .dm-comment-meta strong) { color: var(--dm-dark-link) !important; }
  html[data-dm-theme="dark"] :is(.dm-speech-menu, .dm-font-menu, .dm-speech-player, .dm-actions-status, .dm-comment-form, .dm-feedback) { background: #213047; border-color: var(--dm-dark-border); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] :is(.dm-end-action, .dm-font-options button, .dm-speech-player button, .dm-feedback-choices button, .dm-comment-more, .dm-comment-retry) { background: #2a3d57; border-color: #526b8a; color: #e6efff; }
  html[data-dm-theme="dark"] :is(.dm-end-action[aria-pressed="true"], .dm-font-options button[aria-pressed="true"], .dm-feedback-choices button[aria-pressed="true"]) { background: #345684; border-color: #85a8df; color: #fff; }
  html[data-dm-theme="dark"] :is(.dm-speech-speeds legend, .dm-speech-speeds label, .dm-speech-follow, .dm-speech-heading button, .dm-font-menu p, .dm-feedback-form label, .dm-feedback #dm-feedback-title, .dm-comment-form label) { color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] :is(.dm-player-time, .dm-player-text span, .dm-comment-meta, .dm-comment-guidance, .dm-comment-policy, .dm-comment-notice, .dm-comment-verification-notice, .dm-feedback-form-footer span, .dm-feedback-form label span) { color: var(--dm-dark-muted) !important; }
  html[data-dm-theme="dark"] :is(.dm-comment-form input:not([type="checkbox"]), .dm-comment-form textarea, .dm-feedback-form textarea) { background: #142135; border-color: #5c718d; color: #f2f6fc; }
  html[data-dm-theme="dark"] :is(.dm-comment-form input, .dm-comment-form textarea, .dm-feedback-form textarea)::placeholder { color: #b4c2d6; }
  html[data-dm-theme="dark"] .dm-comment-avatar { background: #304768; color: #c6dcff; }
  html[data-dm-theme="dark"] ::highlight(dm-speech-reading) { background-color: #756125; color: #fff9df; }
  html[data-dm-theme="dark"] mark.dm-speech-reading { background-color: #756125; color: #fff9df; }

  /* Investor test and saved-result pages retain their original illustrations. */
  html[data-dm-theme="dark"][data-dm-page="investor"] { --ink: #e7edf7; --sub: #b6c4d7; --line: #40516a; --paper: #101824; --white: #1b2738; --story-ink: #e7edf7; }
  html[data-dm-theme="dark"][data-dm-page="investor"] :is(.panel, .mood-panel, .result-details > div, .email-panel, .comparison-panel, .consent-box) { background: var(--dm-dark-surface); border-color: var(--dm-dark-border); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"][data-dm-page="investor"] :is(.result-hero, .index-story, .mood-grid div) { background: #243b57; border-color: #4a6382; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"][data-dm-page="investor"] :is(.hero h1, .result-hero h2, .panel h2, .index-story strong, .result-details h3, .mood-panel h3, .share-area > p:first-child, .email-panel h3, .comparison-panel h3) { color: #f0f5fd; }
  html[data-dm-theme="dark"][data-dm-page="investor"] :is(.lead, .hint, .question-hint, .result-hero p, .result-details p, .mood-panel > p, .mood-grid span, .email-lead, .email-consents small, .email-privacy, .comparison-date, .comparison-panel > p:last-child, .disclaimer, .index-story p, .index-story small) { color: var(--dm-dark-muted); }
  html[data-dm-theme="dark"][data-dm-page="investor"] :is(.eyebrow, .tagline, .index-story span, .mood-grid strong, #result-email-status, .email-privacy a) { color: #a9c9ff; }
  html[data-dm-theme="dark"][data-dm-page="investor"] :is(.choice, .secondary, #result-email) { background: #26364c; border-color: #526b88; color: #edf4ff; }
  html[data-dm-theme="dark"][data-dm-page="investor"] :is(.choice:hover, .choice:focus-visible) { background: #314a6a; color: #fff; }
  html[data-dm-theme="dark"][data-dm-page="investor"] #result-email::placeholder { color: #b6c4d7; }
  html[data-dm-theme="dark"][data-dm-page="investor"] .hero-art::before { background: #243b57; }
  html[data-dm-theme="dark"][data-dm-page="investor"] footer :is(a, .investor-copyright) { color: var(--dm-dark-muted); }
  html[data-dm-theme="dark"][data-dm-page="account"] :is(.card, .mood p) { background: var(--dm-dark-surface); border-color: var(--dm-dark-border); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"][data-dm-page="account"] :is(.card h1, .card h2, .mood strong) { color: var(--dm-dark-text); }
  html[data-dm-theme="dark"][data-dm-page="account"] :is(.muted, .mood p, footer) { color: var(--dm-dark-muted); }
  html[data-dm-theme="dark"][data-dm-page="account"] :is(.tag, .eyebrow, .link-button) { color: var(--dm-dark-link); }
  html[data-dm-theme="dark"][data-dm-page="account"] .secondary { background: var(--dm-dark-raised); color: var(--dm-dark-text); }

  /* Calculators keep their existing dark result charts and controls. */
  html[data-dm-theme="dark"][data-dm-page="calculator"] { --bg: #101824; --card: #1b2738; --sub: #b6c4d7; }
  html[data-dm-theme="dark"][data-dm-page="calculator"] :is(.container > h1, .card h2, .card, label) { color: var(--dm-dark-text); }
  html[data-dm-theme="dark"][data-dm-page="calculator"] .card { background: var(--dm-dark-surface); border: 1px solid var(--dm-dark-border); }
  html[data-dm-theme="dark"][data-dm-page="calculator"] :is(input:not([type="checkbox"]):not([type="radio"]), select) { background: #142135; border-color: #5c718d; color: #f2f6fc; }
  html[data-dm-theme="dark"][data-dm-page="calculator"] #calcError { color:#ffabb0 !important; }
  html[data-dm-theme="dark"][data-dm-page="calculator"] .result-card { background: #172538; }

  html[data-dm-theme="dark"][data-dm-page="tools"] { --card: #1b2738; --navy: #e7edf7; --sub: #b6c4d7; --line: #40516a; }
  html[data-dm-theme="dark"][data-dm-page="tools"] .tools-content { background:var(--dm-dark-surface); border-color:var(--dm-dark-border); }
  html[data-dm-theme="dark"][data-dm-page="tools"] :is(.logo, .link-chip, .card h2, .meta) { color: var(--dm-dark-text); }
  html[data-dm-theme="dark"][data-dm-page="tools"] .card strong { background: #2c4364; color: #c9ddff; }
  html[data-dm-theme="dark"][data-dm-page="tools"] footer { color: var(--dm-dark-muted); }
  html[data-dm-theme="dark"][data-dm-page="info"] { background: var(--dm-dark-bg); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"][data-dm-page="info"] :is(main, .site-header) { color: var(--dm-dark-text); }
  html[data-dm-theme="dark"][data-dm-page="info"] main { background: var(--dm-dark-surface); border-color: var(--dm-dark-border); }
  html[data-dm-theme="dark"][data-dm-page="info"] :is(.site-brand, h1, h2) { color: var(--dm-dark-text); }
  html[data-dm-theme="dark"][data-dm-page="info"] :is(a, .lead, .updated, .site-footer) { color: var(--dm-dark-link); }
  html[data-dm-theme="dark"][data-dm-page="admin"] :is(main, input, button:not(.primary)) { background: var(--dm-dark-surface); color: var(--dm-dark-text); border-color: var(--dm-dark-border); }
  html[data-dm-theme="dark"][data-dm-page="admin"] :is(header a, .intro, .status, .comment-header, .comment-header a) { color: var(--dm-dark-muted); }

  /* The original landing page was designed dark; supply a matching light mode. */
  html[data-dm-theme="light"][data-dm-page="home"] body { --panel: #fff; --line: #d8e2ef; --text: #172033; --sub: #526581; --mist: #334155; --cyan: #245fca; --gold: #8b5a00; background: #f2f5fa; color: #172033; }
  html[data-dm-theme="light"][data-dm-page="home"] body::before { display: none; }
  html[data-dm-theme="light"][data-dm-page="home"] :is(.topbar, .hero-copy, .hero-side, .section, .tool-card, .blog-card, .footer, .mini-post) { background: #fff; }
  html[data-dm-theme="light"][data-dm-page="home"] :is(.metric, .metric-num, .eyebrow, .tool-icon) { background: #eef4ff; }
  html[data-dm-theme="light"][data-dm-page="home"] .mini-cta { color: #174ba6; }
}

/* Match the hall link to the shared mobile sidebar sections. */
@media screen and (max-width: 560px) {
  .dm-shared-sidebar .dm-hall-side-card {
    position: relative;
    min-height: 176px;
    overflow: visible;
    padding: 12px 0;
    border: 0;
    border-radius: 0;
    background: #fff;
    box-shadow: none;
  }
  .dm-shared-sidebar .dm-hall-side-card::before {
    content: "";
    position: absolute;
    top: -12px;
    left: 50%;
    width: 100vw;
    height: 8px;
    transform: translateX(-50%);
    background: var(--dm-mobile-section-divider, #edf0f4);
    pointer-events: none;
  }
  .dm-shared-sidebar .dm-hall-side-copy { padding: 0 12px 0 0; }
}
@media screen and (max-width: 760px) {
  html[data-dm-theme="dark"] .dm-shared-sidebar .dm-hall-side-card { border-color: var(--dm-dark-border); background: var(--dm-dark-surface); }
  html[data-dm-theme="dark"] .dm-shared-sidebar :is(.dm-hall-side-label, .dm-hall-side-beta) { color: var(--dm-dark-muted); }
  html[data-dm-theme="dark"] .dm-shared-sidebar .dm-hall-side-copy strong { color: var(--dm-dark-text); }
}

/* Black theme: neutral surfaces like the reference, while retaining the
   existing brand, media, data colors and dark-mode behavior. */
@media screen {
  html[data-dm-theme="dark"] {
    --dm-dark-bg: #0d0d0d;
    --dm-dark-surface: #212121;
    --dm-dark-raised: #2d2d2d;
    --dm-dark-border: #424242;
    --dm-dark-text: #ededed;
    --dm-dark-muted: #b9b9b9;
    --dm-dark-link: #bbd3f8;
    --dm-mobile-section-divider: #303030;
  }
  html[data-dm-theme="dark"][data-dm-page="article"] { --dm-dark-bg: #171717; }
  html[data-dm-theme="dark"][data-dm-page="blog"] { --line: var(--dm-dark-border); }
  html[data-dm-theme="dark"][data-dm-page="tools"] { --card: var(--dm-dark-surface); --navy: var(--dm-dark-text); --sub: var(--dm-dark-muted); --line: var(--dm-dark-border); }
  html[data-dm-theme="dark"][data-dm-page="calculator"],
  html[data-dm-theme="dark"]:is(.dm-embedded, [data-dm-page="investor"]) {
    --ink: var(--dm-dark-text); --sub: var(--dm-dark-muted); --line: var(--dm-dark-border);
    --paper: var(--dm-dark-surface); --white: var(--dm-dark-surface); --bg: var(--dm-dark-bg);
    --card: var(--dm-dark-surface); --story-ink: var(--dm-dark-text);
  }

  html[data-dm-theme="dark"] .dm-theme-toggle,
  html[data-dm-theme="dark"] .dm-site-header .dm-theme-toggle { background: var(--dm-dark-raised); border-color: var(--dm-dark-border); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-theme-toggle:hover,
  html[data-dm-theme="dark"] .dm-site-header .dm-theme-toggle:hover { background: #3b3b3b; border-color: #666; }
  html[data-dm-theme="dark"] body .dm-site-header .dm-site-nav .dm-theme-toggle:hover { background: #3b3b3b; }
  html[data-dm-theme="dark"] .dm-theme-menu { background: var(--dm-dark-surface); }
  html[data-dm-theme="dark"] .dm-theme-menu button:hover { background: #303030; }
  html[data-dm-theme="dark"] .dm-theme-menu button[aria-pressed="true"] { background: #3a3a3a; color: #fff; }
  html[data-dm-theme="dark"] .dm-site-header .dm-site-nav a:hover { background: #3a3a3a !important; border-color: #666; }

  html[data-dm-theme="dark"][data-dm-page="home"] body {
    --panel: #212121; --line: #424242; --text: #ededed; --sub: #b9b9b9; --mist: #c6c6c6;
  }
  html[data-dm-theme="dark"][data-dm-page="home"] body::before,
  html[data-dm-theme="dark"][data-dm-page="home"] .hero-copy::after { display: none; }
  html[data-dm-theme="dark"][data-dm-page="home"] :is(.topbar, .hero-copy, .hero-side, .section, .tool-card, .blog-card, .footer, .mini-post) { background: var(--dm-dark-surface); border-color: var(--dm-dark-border); }
  html[data-dm-theme="dark"][data-dm-page="home"] :is(.metric, .metric-num, .eyebrow, .tool-icon) { background: var(--dm-dark-raised); }
  html[data-dm-theme="dark"][data-dm-page="home"] .topbar .nav a { background: var(--dm-dark-raised); border-color: var(--dm-dark-border); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"][data-dm-page="home"] :is(.topbar .nav a:hover, .tool-card:hover, .mini-post:hover) { background: #333; border-color: #666; }

  html[data-dm-theme="dark"] .latest-posts .post-card:hover { background: #2d2d2d !important; }
  html[data-dm-theme="dark"] .latest-column .category-bar a { background: #303030; border-color: transparent; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .latest-column .category-bar a:hover { background: #414141; }
  html[data-dm-theme="dark"] .latest-column .category-bar a[aria-current="page"],
  html[data-dm-theme="dark"] .post-pagination a[aria-current="page"] { background: #f0f0f0; border-color: #f0f0f0; color: #171717; }
  html[data-dm-theme="dark"] .dm-shared-sidebar :is(.dm-hall-side-card, .newsletter-form input[type="email"]) { background: var(--dm-dark-surface); border-color: var(--dm-dark-border); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-shared-sidebar :is(.dm-hall-side-label, .dm-hall-side-beta) { color: var(--dm-dark-muted); }
  html[data-dm-theme="dark"] .dm-shared-sidebar .dm-hall-side-copy strong { color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-shared-sidebar .tools-card .tool-links a:hover { background: #303030; }

  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page) table th { background: #303030 !important; color: var(--dm-dark-text) !important; }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page) table td { background: #212121 !important; }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page) table tr:nth-child(even) td { background: #292929 !important; }
  html[data-dm-theme="dark"] :is(article.dm-post, .article-shell > .article, .dm-heading-layout > .paper, main.dm-article-page, .dm-sidebar-shell > article, .dm-sidebar-shell > .dm-article-page)
    :is(.highlight, .info-box, .calc-box, .good-box, .box, .tax-box, .verdict-box, .callout, .punchline, .stat-box, .check-table, .toc, .dm-affiliate-box, .source-figure, .dm-author-note, .sources-box, .aside-card, .mini-list a, .aside-card .toc a, .step-list li, .formula .tile, .dm-original-sidebar .related, div.good, div.bad, .video-box:not(:has(iframe, video)), .cta-box, .research-excerpt, blockquote:not(.dm-shared-sidebar blockquote)) { background: #272727 !important; border-color: #505050 !important; }
  html[data-dm-theme="dark"] :is(.dm-post, .article) span[style*="background:" i] { background: #303030 !important; border-color: #505050 !important; }
  html[data-dm-theme="dark"] :is(.dm-speech-menu, .dm-font-menu, .dm-speech-player, .dm-actions-status, .dm-comment-form, .dm-feedback, .dm-highlight-tooltip, .dm-lab-invite) { background: #262626; border-color: var(--dm-dark-border); }
  html[data-dm-theme="dark"] :is(.dm-end-action, .dm-font-options button, .dm-speech-player button, .dm-feedback-choices button, .dm-comment-more, .dm-comment-retry) { background: #333; border-color: #555; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] :is(.dm-end-action[aria-pressed="true"], .dm-font-options button[aria-pressed="true"], .dm-feedback-choices button[aria-pressed="true"]) { background: #4a4a4a; border-color: #aaa; color: #fff; }
  html[data-dm-theme="dark"] :is(.dm-comment-form input:not([type="checkbox"]), .dm-comment-form textarea, .dm-feedback-form textarea) { background: #171717; border-color: #666; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-post .dm-finance-tool { background: #262626; border-color: #505050; }
  html[data-dm-theme="dark"] :is(.dm-finance-input, .dm-finance-input input, .dm-finance-field select, .dm-finance-results, .dm-finance-actions button:not([type="submit"])) { background: #191919; border-color: #606060; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-finance-input > span { color: var(--dm-dark-muted); }
  html[data-dm-theme="dark"] :is(.article, article.dm-post:has(> .dm-article-heading), main.dm-article-page) .dm-faq--accordion details > p.dm-faq-answer { background: #2a2a2a; color: var(--dm-dark-text); }

  /* The lab and inquiry forms have their own dark rules and dialogs. */
  html[data-dm-theme="dark"] :is(.lab-content, .lab-confirm, #write-dialog, #notify-dialog, #admin-dialog) { background: var(--dm-dark-surface); border-color: var(--dm-dark-border); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .lab-confirm :is(h1, p) { color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .lab-content :is(.idea, .no-results, .road-card, .admin-panel, .metric) { background: #292929; border-color: var(--dm-dark-border); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .lab-content :is(.search, .vote, .btn-plain, .demo-note, .board-guidance, .idea-count, .sort.active, .road-column, .detail-progress, .similar-suggestions, .status-filter:not(.active)) { background: #303030; border-color: #505050; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .lab-content :is(.no-results, .idea-desc, .idea-meta, .idea-action, .board-guidance, .road-heading p) { color: var(--dm-dark-muted); }
  html[data-dm-theme="dark"] :is(#write-dialog, #notify-dialog, #admin-dialog) :is(.input, .close, .similar-suggestions) { background: #303030; border-color: #606060; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] :is(#write-dialog, #notify-dialog, #admin-dialog, .dm-inquiry-dialog)::backdrop { background: rgba(0,0,0,.65); }
  html[data-dm-theme="dark"] :is(.dm-inquiry-dialog, .dm-inquiry-standalone) { background: var(--dm-dark-surface); border-color: var(--dm-dark-border); color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-inquiry :is(textarea, input[type="email"], .dm-inquiry-types span, .dm-inquiry-close) { background: #303030; border-color: #606060; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"] .dm-inquiry-types input:checked + span { background: #484848; border-color: #b3b3b3; color: #fff; }

  html[data-dm-theme="dark"][data-dm-page="tools"] .card { background: #292929; border-color: var(--dm-dark-border); }
  html[data-dm-theme="dark"][data-dm-page="tools"] .card:hover { background: #353535; border-color: #666; }
  html[data-dm-theme="dark"][data-dm-page="tools"] .card strong { background: #3b3b3b; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"][data-dm-page="investor"] :is(.result-hero, .index-story, .mood-grid div, .choice, .secondary, #result-email) { background: #2b2b2b; border-color: #525252; }
  html[data-dm-theme="dark"][data-dm-page="investor"] .hero-art::before { background: #2b2b2b; }
  html[data-dm-theme="dark"][data-dm-page="investor"] :is(.choice:hover, .choice:focus-visible) { background: #3a3a3a; }
  html[data-dm-theme="dark"][data-dm-page="calculator"] :is(input:not([type="checkbox"]):not([type="radio"]), select, .result-card) { background: #171717; border-color: #666; color: var(--dm-dark-text); }
  html[data-dm-theme="dark"].dm-tools-embedded :is(input, select, .secondary) { border-color: #666; }
  html[data-dm-theme="dark"].dm-tools-embedded .result { background: #171717; }

  @media (max-width: 760px) {
    html[data-dm-theme="dark"] .dm-site-header[data-dm-mobile-search-ready] > .dm-theme-control .dm-theme-toggle,
    html[data-dm-theme="dark"] .dm-site-header[data-dm-mobile-search-ready] > .dm-theme-control .dm-theme-toggle:hover { background: transparent; }
    html[data-dm-theme="dark"] .dm-site-header:not([data-dm-mobile-search-ready]) .dm-site-nav a { background: transparent !important; }
  }
}

@media print {
  html { color-scheme: light !important; }
  .dm-theme-control { display: none !important; }
}

/* Primary blue actions become light neutral buttons in dark mode. */
@media screen {
  html[data-dm-theme="dark"] :is(
    .dm-shared-sidebar .all-tools,
    .dm-shared-sidebar .newsletter-disclosure > summary,
    .dm-shared-sidebar .newsletter-form button,
    .dm-shared-sidebar .dm-hall-side-action,
    .dm-comment-submit,
    .dm-feedback-form button,
    .dm-speech-play,
    .dm-finance-actions button[type="submit"],
    .dm-inquiry-submit,
    .lab-content .btn-primary,
    .lab-confirm .btn-primary,
    #write-dialog .btn-primary,
    #notify-dialog .btn-primary,
    #admin-dialog .btn-primary,
    .dm-admin-quiz button[data-quiz-reveal],
    .dm-daily-routine button[data-routine-save],
    .btn-calc
  ),
  html[data-dm-theme="dark"][data-dm-page="investor"] :is(button.primary, a.primary),
  html[data-dm-theme="dark"] #dm-income-2026 button.dm-primary {
    background: #ededed;
    border-color: #ededed;
    color: #171717;
  }
  html[data-dm-theme="dark"] :is(
    .dm-shared-sidebar .all-tools:hover,
    .dm-shared-sidebar .newsletter-disclosure > summary:hover,
    .dm-shared-sidebar .newsletter-form button:hover,
    .dm-shared-sidebar .dm-hall-side-card:hover .dm-hall-side-action,
    .dm-comment-submit:hover,
    .dm-feedback-form button:hover,
    .dm-speech-play:hover,
    .dm-finance-actions button[type="submit"]:hover,
    .dm-inquiry-submit:hover,
    .lab-content .btn-primary:hover,
    .lab-confirm .btn-primary:hover,
    #write-dialog .btn-primary:hover,
    #notify-dialog .btn-primary:hover,
    #admin-dialog .btn-primary:hover,
    .dm-admin-quiz button[data-quiz-reveal]:hover,
    .dm-daily-routine button[data-routine-save]:hover,
    .btn-calc:hover
  ),
  html[data-dm-theme="dark"][data-dm-page="investor"] :is(button.primary:hover, a.primary:hover),
  html[data-dm-theme="dark"] #dm-income-2026 button.dm-primary:hover {
    background: #d7d7d7;
    border-color: #d7d7d7;
    color: #171717;
  }
  html[data-dm-theme="dark"] .dm-shared-sidebar .tools-card-heading .all-tools,
  html[data-dm-theme="dark"] .dm-shared-sidebar .tools-card-heading .all-tools:hover {
    background: transparent !important;
    color: #ededed !important;
  }
}

@media screen and (max-width: 760px) {
  html[data-dm-theme="dark"]:not(.dm-embedded) {
    --dm-dark-bg: var(--dm-dark-surface);
  }
}
