/* Official Signal V2 palette, applied last to the existing working interface. */
@font-face{font-family:Manrope;src:url('/signal-v2/Manrope-600.ttf') format('truetype');font-weight:600;font-display:swap}
@font-face{font-family:Manrope;src:url('/signal-v2/Manrope-800.ttf') format('truetype');font-weight:800;font-display:swap}
@font-face{font-family:'DM Sans';src:url('/signal-v2/DMSans-400.ttf') format('truetype');font-weight:400;font-display:swap}
@font-face{font-family:'DM Sans';src:url('/signal-v2/DMSans-500.ttf') format('truetype');font-weight:500;font-display:swap}
@font-face{font-family:'DM Sans';src:url('/signal-v2/DMSans-600.ttf') format('truetype');font-weight:600;font-display:swap}
@font-face{font-family:'DM Sans';src:url('/signal-v2/DMSans-700.ttf') format('truetype');font-weight:700;font-display:swap}
:root{--signal-lime:#C7F36B;--bg:#F7F9F2;--ink:#101610;--muted:#52604E;--line:#D8DFD1;--surface:#fff;--surface-soft:#EEF2E6;--control-line:#77826D;--selected:#101610;--selected-ink:#F2F5EB;--accent:#C7F36B;--accent-ink:#101610;--action:#C7F36B;--action-hover:#b6e454;--focus:#101610;--heading-font:Manrope,sans-serif;--green:#C7F36B;--on-action:#101610;color-scheme:light}
html:root[data-theme=dark]{--bg:#101610;--ink:#F2F5EB;--muted:#BAC3B4;--line:#354134;--surface:#181E18;--surface-soft:#232C23;--control-line:#778970;--selected:#C7F36B;--selected-ink:#141D2C;--accent:#C7F36B;--accent-ink:#C7F36B;--action:#C7F36B;--action-hover:#d7ff89;--focus:#C7F36B;--on-action:#101610;color-scheme:dark}
html:root body{background:var(--bg);color:var(--ink);font-family:'DM Sans',system-ui,sans-serif}
html:root :is(h1,h2,h3){font-family:var(--heading-font);font-weight:600;color:var(--ink)}
html:root[lang=ru] main h1{font-family:var(--heading-font);font-weight:600}
html:root :is(.intro h1,.page-intro h1){font-size:45px;line-height:1.18;letter-spacing:-.035em}
html:root :is(a,a:visited){color:var(--ink)}
html:root a:hover{color:var(--ink);text-decoration:underline;text-underline-offset:4px}
html:root .signal-highlight{color:#101610;font-style:normal;box-shadow:inset 0 -.36em 0 var(--signal-lime);box-decoration-break:clone;-webkit-box-decoration-break:clone}
html:root[data-theme=dark] .signal-highlight{color:var(--signal-lime);box-shadow:none}
/* Same header grid, order, language control and mobile navigation as before. */
html:root .topbar{background:var(--bg);border-bottom:1px solid var(--line);box-shadow:none}
html:root .topbar :is(.site-nav,.site-nav a){background:transparent;color:var(--ink);border-color:transparent}
html:root .topbar .site-nav a:is(:hover,[aria-current=page]){color:var(--ink);border-bottom-color:transparent;text-decoration:underline;text-underline-offset:4px}
html:root .topbar .brand{display:inline-flex;align-items:center;flex-shrink:1;max-width:100%;padding:4px 0;color:var(--ink)}
.signal-logo{display:block;width:208px;height:auto;max-width:100%}
.signal-logo-dark{display:none}
html[data-theme=dark] .signal-logo-light{display:none}
html[data-theme=dark] .signal-logo-dark{display:block}
.signal-brand-text{position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap}
html:root .topbar :is(.theme-toggle,.locale-menu>summary,.mobile-menu-toggle,.personal-shortcut){background:var(--surface);border-color:var(--control-line);color:var(--ink);border-radius:7px;min-height:44px;min-width:44px}
html:root .topbar .personal-shortcut:is(:hover,[aria-current=page]){background:var(--selected);color:var(--selected-ink);border-color:var(--selected)}
html:root .topbar .locale-menu>:is(#interface-language,.locale-switch){background:var(--surface);border-color:var(--control-line)}
html:root .topbar .locale-menu>:is(#interface-language,.locale-switch)>a{background:var(--surface);color:var(--ink)}
html:root .topbar .locale-menu>:is(#interface-language,.locale-switch)>a:is(:hover,[aria-current=true]){background:var(--selected);color:var(--selected-ink)}
html:root .topbar .companion-open{color:var(--ink)!important}
html:root .topbar .desktop-about>summary{color:var(--ink)}
html:root .topbar .desktop-about[open]>summary,html:root .topbar .desktop-about>summary:hover{color:var(--ink);border-color:var(--selected)}
html:root .topbar .desktop-about-links{background:var(--surface);border-color:var(--control-line)}
html:root .topbar .desktop-about-links a{color:var(--ink);background:transparent}
html:root .topbar .desktop-about-links a:hover{background:var(--surface-soft)}
html:root .topbar .site-nav,html:root .has-mobile-menu .topbar #mobile-site-nav{border-top-color:var(--line)}
/* Explicit component boundaries override historical blue/gold fixed colours. */
html:root :is(.book,.guide-card,.mood-card,.subscription-panel,.empty,.seo-discovery,.spotlight-panel,.future-languages,.access-provider,.platform-guide,.quick-view-dialog,.quick-view-panel){background:var(--surface);color:var(--ink);border-color:var(--line);box-shadow:none}
html:root :is(.settings-platform,.access-methods,.shelf-editor,.language,.mood-panel,.library-panel,.library-offer,.notification-form,.page-intro,.contact-pending,.access-libraries,.book-facts){background:var(--surface-soft);color:var(--ink);border-color:var(--line)}
html:root :is(.author,.platforms,.edition-title,.edition-note,.verification,.subscription-summary,.source-note,.notification-privacy,.mood-fit,.mood-access,.mood-why,.mood-note,.guide-step,.eyebrow,.select-field label,.mood-panel>summary small){color:var(--muted)}
html:root :is(.book summary,.book details[open] summary,.book summary:hover){background:var(--surface-soft);color:var(--ink);border-color:var(--line)}
html:root :is(.settings-platform a,.platform-check a,.library-offer strong,.library-offer .loan-access,.source-note .network-label,.subscription-panel>summary){color:var(--ink)}
html:root :is(input,select,textarea,.search-field,.select-field,.save,.shelf-remove,.collection-buttons button){background:var(--surface);color:var(--ink);border-color:var(--control-line);border-radius:7px;accent-color:var(--selected)}
html:root :is(input,textarea)::placeholder{color:var(--muted);opacity:1}
html:root :is(.search-field input,.select-field select){background:transparent;color:var(--ink)}
html:root :is(.primary,.storytel-link,.shelf-primary,.mood-compare,.show-more,.page-cta,.companion-open),html:root a:is(.primary,.storytel-link,.page-cta):visited{background:var(--action);border-color:var(--action);color:var(--on-action);border-radius:7px;font-weight:700}
html:root :is(.primary,.storytel-link,.shelf-primary,.mood-compare,.show-more,.page-cta,.companion-open):hover{background:var(--action-hover);color:var(--on-action);border-color:var(--action-hover)}
html:root :is(.primary,.storytel-link,.shelf-primary,.mood-compare,.show-more,.page-cta):active{background:var(--action-hover);color:var(--on-action)}
html:root body a:is(.primary,.storytel-link,.page-cta,.shelf-primary,.mood-compare,.show-more),html:root body a:is(.primary,.storytel-link,.page-cta,.shelf-primary,.mood-compare,.show-more):visited{color:var(--on-action)}
html:root :is(.save,.shelf-remove,.collection-buttons button,.mood-refresh,.reset,.tabs button){color:var(--ink)}
html:root :is(.save,.shelf-remove,.collection-buttons button,.mood-refresh):hover{background:var(--surface-soft);color:var(--ink);border-color:var(--control-line)}
html:root :is(.save[aria-pressed=true],.library-offer .save[aria-pressed=true],.collection-buttons button[aria-pressed=true]){background:var(--selected);color:var(--selected-ink);border-color:var(--selected)}
html:root .tabs button[aria-selected=true]{color:var(--ink);border-color:var(--selected)}
html:root .tabs button[aria-selected=true] span:not([id$="-label"]){background:var(--selected);color:var(--selected-ink)}
html:root .explorer-page .catalogue-discovery>summary,html:root[lang=ru] .ru-language-help>summary{color:var(--ink)}
html:root .explorer-page .catalogue-discovery-links>a,html:root .explorer-page .catalogue-discovery-links>a:visited{color:var(--ink)}
html:root .explorer-page #books .book{background:var(--surface);border-color:var(--line)}
html:root #books .book h2{font-family:var(--heading-font);font-weight:600;font-size:18px}
html:root #books .book h2 a{color:var(--ink)}
html:root #catalogue{background:var(--surface-soft);border-color:var(--line)}
html:root #books .book-main{border-top:3px solid var(--accent)}
html:root .explorer-page #books .cover-wrap{background:var(--surface-soft)}
html:root .explorer-page #books>.book>details>summary{background:var(--surface-soft);color:var(--ink)}
html:root .explorer-page #filters .search-field{background:var(--surface);border-color:var(--control-line)}
html:root .explorer-page #filters .search-field #search{background:transparent;color:var(--ink)}
html:root .explorer-page #criteria-panel :is(summary,.filter-controls){background:var(--surface);color:var(--ink);border-color:var(--control-line)}
html:root .explorer-page #criteria-panel select{background:var(--surface);color:var(--ink);border-color:var(--control-line)}
html:root .explorer-page #discovery-tools :is(#subscriptions,#mood-panel){background:var(--surface-soft);color:var(--ink);border-color:var(--line)}
html:root .explorer-page #subscriptions .settings-platform :is(h3,a),html:root #clear-preferences{color:var(--ink)}
html:root .explorer-page #mood-panel .mood-controls .mood-refresh{background:var(--surface-soft);color:var(--ink);border-color:var(--control-line)}
html:root .content-page :is(.guide-card,.detail-offers article){background:var(--surface);border-color:var(--line);border-top-color:var(--accent)}
html:root :is(.site-footer,.companion-dialog,.companion-dialog .companion-teaser,.companion-dialog .dialog-toolbar){background:#101610;color:#F2F5EB;border-color:#354134}
html:root .site-footer :is(h2,a,a:visited,.footer-brand,.footer-brand:visited){color:#F2F5EB}
html:root .site-footer :is(.footer-brand span,nav h2){color:#C7F36B}
html:root .site-footer :is(p,.footer-intro p,.footer-bottom p){color:#BAC3B4}
html:root .site-footer .footer-bottom{border-color:#354134}
html:root .companion-dialog :is(.companion-features article,.notification-form,.companion-lead blockquote){background:#232C23;color:#F2F5EB;border-color:#778970}
html:root .companion-dialog :is(p,.notification-privacy,.companion-status,.companion-features p){color:#BAC3B4}
html:root .companion-dialog :is(input,select,.companion-close){background:#181E18;color:#F2F5EB;border-color:#778970}
html:root .companion-dialog .notification-form .primary{background:#C7F36B;color:#101610}
html:root .toast{background:var(--selected);color:var(--selected-ink)}
html:root :is(.quick-book,.quick-book-top,.quick-book-footer){background:var(--surface);color:var(--ink);border-color:var(--line)}
html:root .quick-book :is(.quick-book-close,.quick-book-clear,.quick-book-retry,.quick-book-stars button){background:var(--surface-soft);color:var(--ink);border-color:var(--control-line)}
html:root .quick-book .quick-book-stars button[data-filled=true]{background:var(--selected);color:var(--selected-ink);border-color:var(--selected)}
html:root .quick-book .quick-book-full,html:root .quick-book .quick-book-full:visited{background:var(--action);color:var(--on-action)!important;border-color:var(--action)}
/* Legacy UX components inverted text with --bg; lime needs a fixed dark ink. */
html:root body .content-page.ux-books :is(.book-action,.book-edition-actions>a){color:var(--on-action)!important}
html:root body .content-page.ux-books .book-action-secondary{color:var(--ink)!important;border-color:var(--control-line)}
html:root body .content-page.ux-books .book-action:disabled{color:var(--muted)!important}
html:root body :is(.ux-action,.catalogue-provider-action,.voice-follow,.listening-stars button[data-filled=true],.personal-tabs button[aria-selected=true]){color:var(--on-action)}
html:root body .ux-lot1 :is(a,button).ux-action,html:root body .ux-lot1 :is(a,button).ux-action:is(:hover,:visited),html:root body .ux-lot1 a.catalogue-provider-action,html:root body .ux-lot1 a.catalogue-provider-action:is(:hover,:visited){color:var(--on-action)}
html:root body .ux-lot1 .ux-filters button[aria-pressed=true]{background:var(--selected);color:var(--selected-ink);border-color:var(--selected)}
html:root body a.personal-empty-action,html:root body a.personal-empty-action:visited{color:var(--on-action)!important}
html:root body>main.content-page.guide-action-page a.guide-primary{color:var(--on-action)}
html:root .tabs span:not([id$="-label"]){background:var(--surface-soft);color:var(--ink)}
html:root .tabs button[aria-selected=true] span:not([id$="-label"]){background:var(--selected);color:var(--selected-ink)}
html:root .welcome-dialog{background:var(--surface);color:var(--ink);border-color:var(--control-line)}
html:root .welcome-dialog li::marker{color:var(--ink)}
html:root .welcome-dialog .welcome-start{background:var(--action);color:var(--on-action);border-color:var(--action);border-radius:7px}
html:root .welcome-dialog .welcome-close:hover{background:var(--surface-soft)}
html:root .analytics-panel{background:var(--surface);color:var(--ink);border-color:var(--control-line)}
html:root .analytics-actions button,html:root .analytics-actions button:hover{background:var(--surface-soft);color:var(--ink);border-color:var(--control-line)}
html:root :is(button,a,input,select,textarea,summary):focus-visible{outline:3px solid var(--focus);outline-offset:3px}
html:root :is(.site-footer,.companion-dialog) :focus-visible{outline-color:#C7F36B}
html:root :is(button,input,select):disabled{background:var(--surface-soft)!important;color:var(--muted)!important;border-color:var(--control-line)!important;opacity:1}
@media(max-width:650px){
 html:root :is(.intro h1,.page-intro h1){font-size:31px}
 html:root #books .book h2{font-size:16px}
 .signal-logo{width:170px}
 html:root :is(input,select,textarea){font-size:16px}
 html:root .topbar .brand{min-width:0}
}
@media(max-width:380px){.signal-logo{width:145px}}
@media(forced-colors:active){html:root .signal-highlight{box-shadow:none;color:CanvasText}.signal-brand-text{position:static;width:auto;height:auto;clip-path:none}.signal-logo{display:none!important}}
