/* Theme controls and logo variants share one stable footprint. */
:root{color-scheme:light;--footer-bg:#eaece4;background:var(--footer-bg)}
body{background:var(--footer-bg)}
.site-content{display:flow-root;background:var(--paper)}
footer{background:var(--footer-bg)}
.theme-toggle{display:inline-flex;align-items:center;justify-content:center;flex:0 0 48px;width:48px;height:48px;padding:0;border:1px solid #bfcabc;border-radius:50%;background:transparent;color:var(--ink);cursor:pointer}
.theme-toggle:hover{background:#e9eee3;border-color:#667b68}
.theme-toggle .ui-icon{display:block;width:20px;height:20px}
.theme-toggle .theme-icon-sun{display:none}
.header .rss-link{display:inline-flex;align-items:center;min-height:48px;padding:10px 16px;line-height:20px}
.header .rss-link>span{line-height:20px}
.theme-logo{display:inline-block;vertical-align:middle}
.theme-logo>img{display:block;width:100%;height:100%;object-fit:contain}
.theme-logo>.logo-dark{display:none}
.footer-logo{width:180px;height:54px}
.footer-brand>.theme-logo{margin:0}
.developer-credit .theme-logo{width:150px;height:45px}
.article-end>.article-end-logo{display:block}
@media(max-width:700px){.developer-credit .theme-logo{width:128px;height:39px}}

:root[data-theme="dark"]{color-scheme:dark;--ink:#e6ece7;--muted:#afc0b7;--paper:#101b20;--footer-bg:#15252a;--line:#3a4d50;--white:#19292f;--surface:#19292f;--field:#14242a;--control-border:#6c847a;--accent-text:#c4d7b7;--gold:#e2c58d}
:root[data-theme="dark"] .theme-logo>.logo-light{display:none}
:root[data-theme="dark"] .theme-logo>.logo-dark{display:block}
:root[data-theme="dark"] .theme-icon-moon{display:none}
:root[data-theme="dark"] .theme-toggle .theme-icon-sun{display:block}
:root[data-theme="dark"] a:hover{color:#efd2a0}
:root[data-theme="dark"] .skip{background:#c4d7b7;color:#14242a}
:root[data-theme="dark"] .intro h1 em{color:#afcbaa}
:root[data-theme="dark"] .featured,:root[data-theme="dark"] .card,:root[data-theme="dark"] .project-card{background:var(--surface);border-color:var(--line)}
:root[data-theme="dark"] .feed-box,:root[data-theme="dark"] .service-cta{background:#1d3640;color:#eff4ef}
:root[data-theme="dark"] .button,:root[data-theme="dark"] .search-input button{background:var(--gold);color:#172f36}
:root[data-theme="dark"] .button:hover,:root[data-theme="dark"] .search-input button:hover{background:#efd3a2;color:#172f36}
:root[data-theme="dark"] .category,:root[data-theme="dark"] .featured-body>.eyebrow,:root[data-theme="dark"] .section-head .eyebrow,:root[data-theme="dark"] .about .eyebrow,:root[data-theme="dark"] .project-card .eyebrow,:root[data-theme="dark"] .takeaway .eyebrow{color:var(--accent-text)}
:root[data-theme="dark"] .count{background:#2d433b;color:var(--ink)}
:root[data-theme="dark"] footer{background:var(--footer-bg)}
:root[data-theme="dark"] .prose{color:#dbe5de}
:root[data-theme="dark"] .prose a{color:#ddd399}
:root[data-theme="dark"] .prose a:hover{color:#f2dfa2}
:root[data-theme="dark"] .practice li::marker{color:#c4d7b7}
:root[data-theme="dark"] .topics a{background:var(--surface);border-color:var(--line)}
:root[data-theme="dark"] .topics a:hover{border-color:var(--control-border)}
:root[data-theme="dark"] .topics a[aria-current],:root[data-theme="dark"] .pagination [aria-current]{background:#c4d7b7;border-color:#c4d7b7;color:#14242a}
:root[data-theme="dark"] .pagination [aria-disabled="true"]{background:#203238;color:var(--muted);border-color:var(--line)}
:root[data-theme="dark"] .saved-description,:root[data-theme="dark"] .saved-row p,:root[data-theme="dark"] .saved-empty p,:root[data-theme="dark"] [data-saved-total],:root[data-theme="dark"] .not-found-description,:root[data-theme="dark"] .save-status,:root[data-theme="dark"] .action-status,:root[data-theme="dark"] .search-examples,:root[data-theme="dark"] .rss-dialog p,:root[data-theme="dark"] .rss-dialog ol,:root[data-theme="dark"] .article-correction p,:root[data-theme="dark"] .pagination-label,:root[data-theme="dark"] .pagination-gap{color:var(--muted)}
:root[data-theme="dark"] .search-input,:root[data-theme="dark"] .search-form select,:root[data-theme="dark"] .saved-filters input,:root[data-theme="dark"] .saved-filters select,:root[data-theme="dark"] .rss-dialog input,:root[data-theme="dark"] .copy-field input{background-color:var(--field);color:var(--ink);border-color:var(--control-border)}
:root[data-theme="dark"] .search-input input{color:var(--ink)}
:root[data-theme="dark"] input::placeholder{color:#a9bcb2;opacity:1}
:root[data-theme="dark"] .theme-toggle,:root[data-theme="dark"] .rss-link,:root[data-theme="dark"] .rss-close,:root[data-theme="dark"] .back-to-top{border-color:var(--control-border)}
:root[data-theme="dark"] .save-article,:root[data-theme="dark"] .save-undo,:root[data-theme="dark"] .search-reset,:root[data-theme="dark"] .search-empty button,:root[data-theme="dark"] .rss-close,:root[data-theme="dark"] .action-buttons button,:root[data-theme="dark"] .action-buttons a,:root[data-theme="dark"] .feedback-options button,:root[data-theme="dark"] .reader-panel .feedback-options button,:root[data-theme="dark"] .reader-panel .article-toolbar>:is(button,a){background:#1c3036;color:var(--ink);border-color:var(--control-border)}
:root[data-theme="dark"] .theme-toggle:hover,:root[data-theme="dark"] .save-article:hover,:root[data-theme="dark"] .save-undo:hover,:root[data-theme="dark"] .search-reset:hover,:root[data-theme="dark"] .search-empty button:hover,:root[data-theme="dark"] .rss-close:hover,:root[data-theme="dark"] .back-to-top:hover,:root[data-theme="dark"] .action-buttons button:hover,:root[data-theme="dark"] .action-buttons a:hover,:root[data-theme="dark"] .feedback-options button:hover,:root[data-theme="dark"] .reader-panel .article-toolbar>:is(button,a):hover{background:#2a453d;color:var(--ink);border-color:#b3cfa5}
:root[data-theme="dark"] .save-article[aria-pressed="true"],:root[data-theme="dark"] .reader-panel .article-toolbar .save-article[aria-pressed="true"]{background:#2a4537;color:#edf4e9;border-color:#b3cfa5}
:root[data-theme="dark"] .feedback-options button[aria-pressed="true"]{background:#c4d7b7;color:#14242a;border-color:#c4d7b7}
:root[data-theme="dark"] .takeaway,:root[data-theme="dark"] .share-panel,:root[data-theme="dark"] .search-hint,:root[data-theme="dark"] .saved-page>.save-feedback:has(.save-status:not(:empty)){background:#22372f;border-color:#647f6e}
:root[data-theme="dark"] .takeaway{border-left-color:#afcbaa}
:root[data-theme="dark"] .card:focus-within,:root[data-theme="dark"] .featured:focus-within,:root[data-theme="dark"] .saved-row:focus-within{outline-color:#abc69f;box-shadow:0 0 0 3px #30483d}
:root[data-theme="dark"] :is(a,button,input,select):focus-visible{outline-color:#edca83}
:root[data-theme="dark"] .saved-row h2 a:visited,:root[data-theme="dark"] .card h3 a:visited,:root[data-theme="dark"] .featured h2 a:visited,:root[data-theme="dark"] .search-result-title a:visited{color:#cdbce6}
:root[data-theme="dark"] .card h3 a:hover,:root[data-theme="dark"] .featured h2 a:hover,:root[data-theme="dark"] .search-result-title a:hover{color:#efd2a0}
:root[data-theme="dark"] .card mark,:root[data-theme="dark"] .saved-row mark{background:#5b4c24;color:#fff2bf}
:root[data-theme="dark"] .rss-dialog::backdrop{background:#03090ecc}
:root[data-theme="dark"] .back-to-top{box-shadow:0 3px 15px #0006}
:root[data-theme="dark"] .search-form select,:root[data-theme="dark"] .saved-filters select{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e6ece7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E")}
:root[data-theme="dark"] input[type="search"]::-webkit-search-cancel-button{background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23afc0b7' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='m6 6 12 12M18 6 6 18'/%3E%3C/svg%3E")}
@media(forced-colors:active){
  :root[data-theme="dark"] .search-form select,:root[data-theme="dark"] .saved-filters select{appearance:auto;background-image:none}
  :root[data-theme="dark"] input[type="search"]::-webkit-search-cancel-button{appearance:auto;-webkit-appearance:auto;background:none}
}

.theme-toggle[hidden]{display:inline-flex!important;visibility:hidden}
:root[data-theme="dark"] .saved-empty{border-color:var(--control-border)}

/* Safari can derive browser-panel tint from the body or fixed controls. */
@media(max-width:700px){:root[data-theme] .back-to-top,:root[data-theme] .back-to-top:hover{background:var(--footer-bg)}}
