/* Appearance overrides: preserve the chart's geometry and market semantics. */
header.topbar .topbar-actions{margin-left:auto;display:flex;align-items:center;justify-content:flex-end;gap:4px}
header.topbar .account-status{width:auto;max-width:12em;overflow:hidden;text-overflow:ellipsis;text-align:right}
header.topbar .header-round-button{position:relative;flex:0 0 33px;width:33px;height:33px;padding:0;border:0;display:grid;place-items:center;background:transparent;color:#344b5c;text-decoration:none;cursor:pointer;-webkit-tap-highlight-color:transparent}
.header-icon-circle{box-sizing:border-box;width:33px;height:33px;display:grid;place-items:center;border:1px solid #b4bec6;border-radius:50%;background:#edf1f4}
.header-icon-circle svg{display:block;width:16.5px;height:16.5px}
.header-round-button:hover .header-icon-circle{background:#dce5ec}
.header-round-button:focus-visible{outline:2px solid var(--blue,#498ce8);outline-offset:2px;border-radius:50%}
html[data-theme="dark"] .header-round-button{color:#e2edf6}
html[data-theme="dark"] .header-icon-circle{background:#293b49;border-color:#6e8799}
html[data-theme="dark"] .header-round-button:hover .header-icon-circle{background:#3b5263}
@media(pointer:coarse){header.topbar .header-round-button{flex-basis:33px;width:33px;height:33px}}
.theme-options { display: flex; flex-wrap: wrap; gap: 8px; }
.theme-options button { min-height: 42px; padding: 8px 13px; border: 1px solid #92999d; background: var(--panel); color: var(--text); cursor: pointer; font-weight: 750; }
.theme-options button[aria-pressed="true"] { border-color: var(--blue); box-shadow: inset 0 0 0 1px var(--blue); }
.theme-options button:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

html[data-theme="dark"] {
  --page: #111820;
  --panel: #1d2732;
  --soft: #263440;
  --line: #788a9b;
  --line-soft: #435565;
  --text: #f1f5f9;
  --muted: #b6c4d1;
  --blue: #81acff;
  --market-up: #73bbff;
  --market-down: #ff7780;
  background: var(--page);
}
html[data-theme="dark"] body,
html[data-theme="dark"] body:has(#testPage) .dashboard-sticky {
  background-color: var(--page);
  background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,.075) .7px, transparent .8px);
  background-size: 4px 4px;
}
html[data-theme="dark"] .site-name { color: var(--text); }
html[data-theme="dark"] .dashboard-tabs { border-bottom-color: #697987; }
html[data-theme="dark"] .dashboard-tab { background: #2b3945; color: #c6d3df; border-color: #627586; }
html[data-theme="dark"] .dashboard-tab.active { background: #263d50; color: #fff; border-color: #8eb9d9; }
html[data-theme="dark"] .dashboard-tab-add { background: #243d56; color: #b6dbff; }
html[data-theme="dark"] .dashboard-tab-overflow { color: #d4e4f0; }
html[data-theme="dark"] .market-card { border-color: #708191; box-shadow: 2px 3px 0 #0a1016, 4px 6px 9px #090e14; }
html[data-theme="dark"] :is(.market-card.skeleton,.initial-loading-card) { background: #1d2732; border-color: #708191; }
html[data-theme="dark"] .card-titlebar { border-bottom-color: #708191; background: linear-gradient(#415363, #2a3947 55%, #24313e); box-shadow: inset 0 1px 0 #657789; }
html[data-theme="dark"] .chart-wrap { background: #17212c; border-color: #566778; }
html[data-theme="dark"] .chart-grid { stroke: #43515f; }
html[data-theme="dark"] .chart-percent-line { stroke: #4caabe; }
html[data-theme="dark"] .chart-percent-label { fill: #a8e5f0; stroke: #17212c; }
html[data-theme="dark"] .chart-baseline { stroke: #ff777f; }
html[data-theme="dark"] .chart-extreme-high .chart-extreme-tag { fill: #25516b; }
html[data-theme="dark"] .chart-extreme-high text { fill: #d7f0ff; }
html[data-theme="dark"] .chart-extreme-low .chart-extreme-tag { fill: #66353d; }
html[data-theme="dark"] .chart-extreme-low text { fill: #ffe2e2; }
html[data-theme="dark"] .chart-current-marker { border-color: #f7fbff; background: #17212c; box-shadow: inset 0 0 0 2px #17212c; }
html[data-theme="dark"] .chart-current-marker::after { background: #f7fbff; }
html[data-theme="dark"] .axis-labels { color: #c9d6e2; }
html[data-theme="dark"] .market-status.live { color: #8ee6ac; }
html[data-theme="dark"] .market-status.delayed { color: #ffd078; }
html[data-theme="dark"] .empty-chart.history-unavailable { color: #ffa1a1; }
html[data-theme="dark"] .chart stop[stop-color="#ccecf4"] { stop-color: #5b849e; }
html[data-theme="dark"] .chart stop[stop-color="#ffffff"] { stop-color: #17212c; }
html[data-theme="dark"] .add-chart-card { background: #1d2b37; color: #cddae5; border-color: #8294a3; }
html[data-theme="dark"] .add-chart-card:hover,
html[data-theme="dark"] .add-chart-card:focus-visible { background: #28435b; color: #fff; }

html[data-theme="dark"] :is(.settings-panel,.market-article,.market-journal-card,.recommendation-list,.recommendation-added-list,.chart-picker,.tab-reorder-dialog,.tab-reorder-item,.dashboard-tab-menu,.privacy-card,.guide-section,.install-platform-card,.info-card,.contact-card,.sync-choice) { background-color: var(--panel); color: var(--text); border-color: #64788a; }
html[data-theme="dark"] :is(.palette-card,.settings-button,.picker-close,.picker-category,.picker-symbol,.recommendation-vote,.tab-reorder-step,.tab-reorder-handle,.tab-reorder-actions button,.dashboard-tab-menu button,.article-bottom-nav a,.vote-button,.language-options a) { background: #273847; color: var(--text); border-color: #8294a5; }
html[data-theme="dark"] :is(.palette-card.selected,.picker-category.active,.account-tab.active) { background: #31536b; border-color: #9dcaf0; color: #fff; }
html[data-theme="dark"] :is(.recommendation-row,.recommendation-added-row,.market-article-closes li) { border-color: #455767; }
html[data-theme="dark"] :is(.recommendation-category,.recommendation-feedback,.market-journal-card-action,.market-journal-archive-link,.recommendation-archive-link,.article-index-back,.article-breadcrumb a,.article-bottom-nav a,.market-article-body a,.market-article-meta,.market-journal-kicker) { color: #a9d7ff; }
html[data-theme="dark"] :is(.market-article-header,.market-article-closes,.tab-reorder-actions) { border-color: #516272; }
html[data-theme="dark"] :is(.privacy-card p,.guide-swipe,.install-platform-card strong) { color: var(--text); }
html[data-theme="dark"] :is(.article-up,.vote-button.buy) { color: #d6e65d; }
html[data-theme="dark"] :is(.article-down,.vote-button.sell) { color: #ff858d; }
html[data-theme="dark"] :is(.recommendation-vote:disabled,.tab-reorder-step:disabled) { color: #adbbc8; background: #26313b; border-color: #5d6d7b; }
html[data-theme="dark"] .recommendation-form-link { background: #234e69; color: #fff; border-color: #8ab8d7; }
html[data-theme="dark"] .latest-news-list { background: rgba(255,255,255,.045); border-color: #536475; scrollbar-color: #8195a5 #23303c; }
html[data-theme="dark"] .language-suggestion { background: #243d50; color: var(--text); border-color: #6888a1; }
html[data-theme="dark"] .language-suggestion a { color: #a9d7ff; }
html[data-theme="dark"] :is(input,textarea,select) { background: #1c2a36; color: var(--text); border-color: #8195a5; }
html[data-theme="dark"] .settings-panel-heading p,
html[data-theme="dark"] .settings-hint { color: var(--muted); }
html[data-theme="dark"] .palette-preview { background: #17212c; border-color: #536575; }
html[data-theme="dark"] .chart-size-options button { background: #273847; color: var(--text); border-color: #8294a5; }
html[data-theme="dark"] .chart-size-options button[aria-pressed="true"] { background: #31536b; color: #fff; }
html[data-theme="dark"] .palette-check { color: #d7e9f8; }
html[data-theme="dark"] :is(.detail-description,.detail-actions) { background: var(--panel); color: var(--text); border-color: #64788a; }
html[data-theme="dark"] .detail-description p { color: var(--text); }
html[data-theme="dark"] .detail-action { background: #273847; color: var(--text); border-color: #8294a5; box-shadow: 1px 2px 3px rgba(0,0,0,.3); }
html[data-theme="dark"] .detail-action.primary { background: #31536b; color: #fff; border-color: #9dcaf0; }
html[data-theme="dark"] .detail-action.danger { color: #ff858d; }
html[data-theme="dark"] .detail-action:not(:disabled):hover { background: #35516a; border-color: #a9d7ff; }

/* Information pages: keep explanatory screenshots intact, but theme their surrounding UI. */
html[data-theme="dark"] .about-card { background: var(--panel); color: var(--text); border-color: #64788a; }
html[data-theme="dark"] .contact-form-link { background: #273847; color: var(--text); border-color: #8294a5; }
html[data-theme="dark"] .contact-form-link:hover,
html[data-theme="dark"] .contact-form-link:focus-visible { background: #35516a; border-color: #a9d7ff; }
html[data-theme="dark"] .install-platform-card li::before { background: #31536b; color: #fff; }
html[data-theme="dark"] .install-platform-card h2 { border-bottom-color: #64788a; }
html[data-theme="dark"] .guide-hero { background: linear-gradient(145deg, #263847, #20303e); border-bottom-color: #64788a; }
html[data-theme="dark"] .guide-number { background: #31536b; color: #fff; border-color: #9dcaf0; }
html[data-theme="dark"] .guide-shot { background: #17212c; border-color: #64788a; }
html[data-theme="dark"] .guide-shot figcaption { background: #273847; color: var(--text); }
html[data-theme="dark"] .guide-shot figcaption span { background: #31536b; color: #fff; }
html[data-theme="dark"] :is(.guide-detail-demo,.guide-short-steps li,.guide-drag-arrow,.guide-tabs-demo,.guide-data-note) { background: #263440; color: var(--text); border-color: #64788a; }
html[data-theme="dark"] .guide-mini-chart { background: #17212c; color: var(--text); border-color: #64788a; }
html[data-theme="dark"] .guide-mini-line { background: linear-gradient(160deg, transparent 0 12%, #81acff 13% 21%, transparent 22% 27%, #81acff 28% 55%, transparent 56% 63%, #81acff 64% 100%); }
html[data-theme="dark"] .guide-detail-demo button { background: #273847; color: var(--text); border-color: #8294a5; }
html[data-theme="dark"] .guide-detail-demo button.dark { background: #121b24; }
html[data-theme="dark"] .guide-detail-demo button.danger { color: #ff858d; }
html[data-theme="dark"] .guide-tab-row span { background: #344657; color: var(--text); border-color: #64788a; }
html[data-theme="dark"] .guide-tab-row span.active { background: #31536b; color: #fff; border-color: #9dcaf0; }
html[data-theme="dark"] .guide-tab-row span.plus { background: #234e69; color: #b6dbff; }
html[data-theme="dark"] .guide-tab-menu-demo span { background: #273847; color: var(--text); border-color: #8294a5; }
