/* SP NEWS v6.02.54 — public-facing theme engine. Scoped to native frontend only. */
.spnews-header-main{position:relative}
.spnews-theme-control{position:absolute;left:4px;top:50%;transform:translateY(-50%);z-index:1100;direction:rtl;font:inherit}
.spnews-theme-trigger{display:flex;align-items:center;justify-content:center;gap:3px;min-width:40px;min-height:40px;padding:7px;border:1px solid var(--spn-line);border-radius:12px;background:var(--spn-card);color:var(--spn-ink);cursor:pointer}
.spnews-theme-trigger:hover,.spnews-theme-trigger:focus-visible{outline:2px solid var(--spn-red);outline-offset:2px}
.spnews-theme-chevron{font-size:13px;line-height:1}
.spnews-theme-options{position:absolute;top:calc(100% + 8px);left:0;min-width:215px;max-width:calc(100vw - 24px);padding:6px;border:1px solid var(--spn-line);border-radius:13px;background:var(--spn-card);color:var(--spn-ink);box-shadow:0 12px 35px rgba(0,0,0,.2);z-index:1200}
.spnews-theme-options[hidden]{display:none!important}
.spnews-theme-options button{display:flex;align-items:center;gap:10px;width:100%;padding:11px;border:0;border-radius:8px;background:transparent;color:inherit;text-align:right;cursor:pointer;font:inherit;font-size:13px}
.spnews-theme-options button:hover,.spnews-theme-options button:focus-visible{background:var(--spn-bg);outline:2px solid var(--spn-red);outline-offset:-2px}
.spnews-theme-check{margin-right:auto;visibility:hidden;color:var(--spn-red)}
.spnews-theme-options button[aria-pressed="true"] .spnews-theme-check{visibility:visible}
@media(max-width:760px){.spnews-theme-control{left:56px}.spnews-theme-trigger{min-width:38px;min-height:38px}.spnews-theme-options{left:-50px}}
/* Keep the brand and original color identity untouched; remap surfaces and typography. */
html[data-spnews-theme="dark"]{--spn-ink:#edf2fa;--spn-muted:#b2bed1;--spn-line:#364357;--spn-bg:#182233;--spn-card:#222e40;--spn-dark:#101827;--spn-shadow:0 14px 40px rgba(0,0,0,.24);background:#101827;color-scheme:dark}
html[data-spnews-theme="dark"] body.spnews-native-frontend{background:#101827!important;color:var(--spn-ink)}
html[data-spnews-theme="dark"] .spnews-site-shell{background:#101827;color:var(--spn-ink)}
html[data-spnews-theme="dark"] .spnews-site-header{background:#151f2e!important;border-color:var(--spn-line)!important}
html[data-spnews-theme="dark"] .spnews-header-main{background:#151f2e!important}
html[data-spnews-theme="dark"] .spnews-header-main.is-spnews-sticky::before{background:#151f2e!important}
html[data-spnews-theme="dark"] .spnews-menu-toggle{background:var(--spn-card)!important;color:var(--spn-ink)!important;border-color:var(--spn-line)!important}
html[data-spnews-theme="dark"] :is(.spnews-story-main,.spnews-search-main,.spnews-search-hero,.spnews-section,.spnews-archive-main,.spnews-category-main,.spnews-knowledge-page,.spnews-knowledge-entity-page,.spnews-legal-main){background-color:#101827;color:var(--spn-ink)}
html[data-spnews-theme="dark"] :is(.spnews-section-tinted,.spnews-hero-section,.spnews-knowledge-section,.spnews-top-ten-section){background-color:#182233!important}
html[data-spnews-theme="dark"] :is(.spnews-card,.spnews-search-card,.spnews-aside-card,.spnews-depth-gateway-card,.spnews-knowledge-card,.spnews-knowledge-gateway-card,.spnews-discover-card,.spnews-empty,.spnews-story-article,.spnews-archive-card,.spnews-topic-links a,.spnews-search-query){background-color:var(--spn-card)!important;color:var(--spn-ink)!important;border-color:var(--spn-line)!important}
html[data-spnews-theme="dark"] :is(h1,h2,h3,h4,h5,h6,.spnews-brand-copy strong,.spnews-nav a,.spnews-card h3 a,.spnews-story-content,.spnews-story-title,.spnews-section-head h2){color:var(--spn-ink)}
html[data-spnews-theme="dark"] :is(p,.spnews-card p,.spnews-story-deck,.spnews-section-intro,.spnews-card-meta){color:var(--spn-muted)}
html[data-spnews-theme="dark"] :is(input,select,textarea){background:#222e40;color:#edf2fa;border-color:#364357}
html[data-spnews-theme="dark"] .spnews-nav{background:#151f2e;color:var(--spn-ink)}
html[data-spnews-theme="dark"] .spnews-theme-control .spnews-theme-options button{color:var(--spn-ink)!important}
html[data-spnews-theme="dark"] .spnews-theme-control .spnews-theme-trigger{background:#222e40!important;color:#edf2fa!important}
html[data-spnews-theme="dark"] .spnews-theme-control .spnews-theme-options{background:#222e40!important;color:#edf2fa!important}
html[data-spnews-theme="dark"] a:focus-visible,html[data-spnews-theme="dark"] button:focus-visible{outline-color:#ff6173}

/* v6.02.54: The control owns a real grid cell; never overlay the brand or nav. */
.spnews-header-main .spnews-theme-control{position:relative!important;inset:auto!important;transform:none!important;grid-area:theme!important;align-self:center!important;justify-self:center!important;z-index:1250!important;min-width:44px;flex:none}
.spnews-header-main .spnews-theme-trigger{width:44px;min-width:44px;height:44px;min-height:44px;padding:0}
.spnews-header-main .spnews-theme-options{position:absolute;left:0;right:auto;top:calc(100% + 7px);min-width:140px;max-width:min(200px,calc(100vw - 24px));z-index:1300}
@media(min-width:761px){
 .spnews-header-main{grid-template-columns:minmax(0,1fr) minmax(0,auto) 44px!important;grid-template-areas:"brand nav theme"!important;gap:12px!important}
 .spnews-header-main .spnews-brand{grid-area:brand!important;min-width:0!important}
 .spnews-header-main .spnews-nav{grid-area:nav!important;min-width:0!important;gap:clamp(7px,1vw,22px)!important}
 .spnews-header-main .spnews-theme-control{grid-area:theme!important}
}
@media(max-width:760px){
 .spnews-header-main,.spnews-header-main.is-spnews-sticky{grid-template-columns:52px 44px minmax(0,1fr) 54px!important;grid-template-areas:"menu theme identity logo" "tagline tagline tagline tagline" "slogan slogan slogan slogan"!important;column-gap:6px!important}
 .spnews-header-main .spnews-menu-toggle{grid-area:menu!important;justify-self:start!important}
 .spnews-header-main .spnews-theme-control{grid-area:theme!important;grid-column:2!important;grid-row:1!important;justify-self:center!important;align-self:center!important}
 .spnews-header-main .spnews-theme-options{left:0!important;right:auto!important;transform:none!important}
 .spnews-header-main .spnews-nav{grid-column:1/-1!important;grid-row:4!important}
 .spnews-header-main.is-spnews-sticky{grid-template-areas:"menu theme identity logo"!important;grid-template-rows:1fr!important}
 .spnews-header-main.is-spnews-sticky .spnews-theme-trigger{width:42px!important;height:42px!important;min-width:42px!important;min-height:42px!important}
}
@media(max-width:390px){
 .spnews-header-main,.spnews-header-main.is-spnews-sticky{grid-template-columns:44px 40px minmax(0,1fr) 48px!important;column-gap:4px!important}
 .spnews-header-main .spnews-theme-trigger{width:40px!important;min-width:40px!important;height:40px!important;min-height:40px!important}
}
/* v6.02.53: Maintain contrast on light legacy surfaces while preserving dark image overlays. */
html[data-spnews-theme="dark"] .spnews-top-card--compact .spnews-top-card-copy{background:#222e40!important;color:#edf2fa!important}
html[data-spnews-theme="dark"] .spnews-top-card--compact .spnews-top-card-copy :is(strong,a,span,time){color:#edf2fa!important}
html[data-spnews-theme="dark"] .spnews-top-card--compact .spnews-top-meta{color:#b2bed1!important}
html[data-spnews-theme="dark"] .spnews-native-post-header{background:#222e40!important;color:#edf2fa!important}
html[data-spnews-theme="dark"] .spnews-native-post-header :is(h1,h2,p,span,time,small){color:#edf2fa!important}
html[data-spnews-theme="dark"] .spnews-native-post-header :is(.spnews-card-meta,.spnews-story-deck,.spnews-publication-date){color:#b2bed1!important}
html[data-spnews-theme="dark"] .spnews-native-post-header a{color:#9dc5ef!important}
html[data-spnews-theme="dark"] .spnews-native-post-article{background:#222e40!important;color:#edf2fa!important}
html[data-spnews-theme="dark"] .spnews-native-post-article :is(h1,h2,h3,p){color:#edf2fa}
html[data-spnews-theme="dark"] .spnews-top-card--primary .spnews-top-card-copy,html[data-spnews-theme="dark"] .spnews-top-card--secondary .spnews-top-card-copy{background:transparent!important}

/* v6.02.54: Correct the actual white article container, not only its nested header. */
html[data-spnews-theme="dark"] body.spnews-native-article .spnews-native-post{background:#222e40!important;color:#edf2fa!important;border-color:#364357!important}
html[data-spnews-theme="dark"] body.spnews-native-article .spnews-native-post :is(.spnews-native-post-header h1,.spnews-native-content,.spnews-native-content h2,.spnews-native-content h3){color:#edf2fa!important}
html[data-spnews-theme="dark"] body.spnews-native-article .spnews-native-post :is(.spnews-native-deck,.spnews-native-meta,.spnews-article-breadcrumb,.spnews-native-content p){color:#c4cfde!important}
html[data-spnews-theme="dark"] body.spnews-native-article .spnews-native-post :is(.spnews-native-categories a,.spnews-article-breadcrumb a){color:#a8d4ff!important}
html[data-spnews-theme="dark"] body.spnews-native-article .spnews-native-post .spnews-native-categories a{background:#30425b!important}
html[data-spnews-theme="dark"] body.spnews-native-article .spnews-native-share{border-color:#364357!important}
html[data-spnews-theme="dark"] body.spnews-native-article .spnews-native-related{background:#182233!important}
html[data-spnews-theme="dark"] .spnews-header-main.is-spnews-sticky .spnews-nav{background:#222e40!important;color:#edf2fa!important;border-color:#364357!important}

/* v6.02.55 — scoped component surfaces and accessible foregrounds. */
html[data-spnews-theme="dark"] .spnews-social-follow__title{color:#edf2fa!important}
html[data-spnews-theme="dark"] .spnews-social-follow__title bdi{color:#ef4055!important}
html[data-spnews-theme="dark"] :is(.spnews-native-share,.spnews-share-block){color:#edf2fa!important;border-color:#364357!important}
html[data-spnews-theme="dark"] :is(.spnews-share-btn,.spnews-native-share a,.spnews-native-share button){background:#30425b!important;color:#edf2fa!important;border-color:#62738b!important}
html[data-spnews-theme="dark"] :is(.spnews-share-btn,.spnews-native-share a,.spnews-native-share button) svg{color:inherit!important;stroke:currentColor}
html[data-spnews-theme="dark"] :is(.spnews-card-meta,.spnews-card-meta a,.spnews-card-meta time,.spnews-source-label,.spnews-grid-category time,.spnews-card-compact time){color:#c4cfde!important}
html[data-spnews-theme="dark"] :is(.spnews-chip,.spnews-category-subnav a){background:#344258!important;color:#f1f5fa!important;border-color:#62738b!important}
html[data-spnews-theme="dark"] :is(.spnews-archive-hero,.spnews-legal-hero){background:#182233!important;color:#edf2fa!important;border-color:#364357!important}
html[data-spnews-theme="dark"] :is(.spnews-archive-heading,.spnews-archive-heading h1,.spnews-legal-hero h1,.spnews-legal-hero p){color:#edf2fa!important}
html[data-spnews-theme="dark"] :is(.spnews-legal-card,.spnews-smart-archive--v2,.spnews-smart-archive--v3:not(.is-compact),.spnews-archive-modebar,.spnews-archive-dialog__panel){background:#222e40!important;color:#edf2fa!important;border-color:#364357!important}
html[data-spnews-theme="dark"] .spnews-legal-card :is(h1,h2,h3,h4,h5,h6,strong){color:#f0f4fb!important}
html[data-spnews-theme="dark"] .spnews-legal-card :is(p,li,small,span){color:#c4cfde!important}
html[data-spnews-theme="dark"] .spnews-legal-card a{color:#9fd1ff!important}
html[data-spnews-theme="dark"] :is(.spnews-smart-archive__head h2,.spnews-smart-archive__head p,.spnews-smart-archive__current span,.spnews-smart-archive__current small,.spnews-archive-modebar small,.spnews-archive-dialog__header h3,.spnews-archive-month-group h4){color:#edf2fa!important}
html[data-spnews-theme="dark"] :is(.spnews-smart-archive__chip,.spnews-smart-archive__open,.spnews-archive-change,.spnews-archive-modebar__actions a,.spnews-archive-year,.spnews-archive-month-group a){background:#30425b!important;color:#edf2fa!important;border-color:#52627a!important}
html[data-spnews-theme="dark"] :is(.spnews-smart-archive__chip.is-active,.spnews-archive-year.is-active,.spnews-archive-month-group a.is-current){background:#472a3c!important;color:#ff9aa8!important;border-color:#b94a60!important}
html[data-spnews-theme="dark"] :is(.spnews-archive-dialog__header,.spnews-archive-years,.spnews-archive-month-group a,.spnews-smart-archive__current){border-color:#52627a!important}
html[data-spnews-theme="dark"] .spnews-archive-dialog__close{background:#30425b!important;color:#edf2fa!important;border-color:#52627a!important}
html[data-spnews-theme="dark"] .spnews-pagination :is(a,span):not(.current){background:#30425b!important;color:#edf2fa!important;border-color:#52627a!important}
html[data-spnews-theme="dark"] .spnews-pagination .current{background:var(--spn-red)!important;color:#fff!important;border-color:var(--spn-red)!important}
html[data-spnews-theme="dark"] :is(.spnews-legal-main,.spnews-category-main) :is(.spnews-section-head,.spnews-section-intro){color:#c4cfde!important}
html[data-spnews-theme="dark"] :is(.spnews-archive-browse-after-results .spnews-smart-archive__open){background:#30425b!important;color:#ff9aa8!important;border-color:#52627a!important}
