/* Pheedr night mode: html[data-theme=dark], set by the theme script in the page head (Settings > Night mode).
   Every rule is scoped to it, so the light look stays exactly what the other stylesheets define. */
html[data-theme=dark]{color-scheme:dark;--ink:#e6ebe8;--paper:#1d2120;--line:#323835;--muted:#a1aba5;--soft:#252a28;--accent:#f0565b}
html[data-theme=dark] body.stream-mode,html[data-theme=dark] .stream-mode .wrap{background:#151817}
html[data-theme=dark] .appbar{background:#151817;border-bottom-color:#2a2f2d}

/* Shared controls from the base sheet that assume a light page */
html[data-theme=dark] .icon-button{background:#252a28;border-color:#323835}
html[data-theme=dark] .icon-button:hover{background:#2e3431}
html[data-theme=dark] .prompt .icon-button{background:var(--accent);color:#fff}
html[data-theme=dark] .prompt,html[data-theme=dark] .interest-add select,html[data-theme=dark] .field{background:#151817}
html[data-theme=dark] .chip[aria-pressed=true],html[data-theme=dark] .primary,html[data-theme=dark] #toast{color:#151817}
html[data-theme=dark] .primary:hover{background:#cdd4d0}
html[data-theme=dark] .source-error,html[data-theme=dark] #login-error{color:#ff8a80}

/* Story cards */
html[data-theme=dark] .stream-mode .story{border-bottom-color:#0a0c0b}
html[data-theme=dark] .stream-mode .story .media{background:#252a28}
html[data-theme=dark] .story-meta,html[data-theme=dark] .field-label{color:#9aa59f}
html[data-theme=dark] .stream-mode .story .description{color:#bcc4bf}
html[data-theme=dark] .story-actions .story-topic{background:#252a28;color:#cfd7d2}
html[data-theme=dark] .story-actions .icon-button{background:transparent;color:#b3bdb7}
html[data-theme=dark] .story-actions .icon-button:hover{background:#252a28}
html[data-theme=dark] .story.skeleton .story-body{background:linear-gradient(#252a28 0 0) 0 0/38% 12px no-repeat,linear-gradient(#252a28 0 0) 0 26px/100% 22px no-repeat,linear-gradient(#252a28 0 0) 0 56px/78% 22px no-repeat,linear-gradient(#1f2422 0 0) 0 96px/100% 14px no-repeat}

/* Tab bar, topic pill, and the Night mode control itself */
html[data-theme=dark] .tabbar{background:#151817;border-top-color:#2a2f2d;box-shadow:0 -6px 20px #0006}
html[data-theme=dark] .tab{color:#9aa59f}
html[data-theme=dark] .tab.active{color:var(--accent)}
html[data-theme=dark] #stream-focus{background:#2e3431;box-shadow:0 6px 22px #000a}
html[data-theme=dark] .segmented button[aria-pressed=true]{background:#3a413e;box-shadow:none}

/* Reader */
html[data-theme=dark] .reader-dialog{background:#151817;color:#e3e8e5;box-shadow:none}
html[data-theme=dark] .reader-dialog::backdrop{background:#0a0c0b}
html[data-theme=dark] .story-hero,html[data-theme=dark] .reader-body pre,html[data-theme=dark] .reader-image-missing{background:#222725}
html[data-theme=dark] .reader-branch{background:#222725;color:#d5dcd8}
html[data-theme=dark] .reader-dialog .reader-meta,html[data-theme=dark] .reader-dialog .reader-state,html[data-theme=dark] .reader-body figcaption,html[data-theme=dark] .reader-body caption,html[data-theme=dark] .reader-image-missing,html[data-theme=dark] .reader-dialog .reader-finish .story-topic-label{color:#9aa59f}
html[data-theme=dark] .reader-dialog .reader-notice{background:#2c2219;color:#f1cba6}
html[data-theme=dark] .reader-body{color:#dde3df}
html[data-theme=dark] .reader-body th,html[data-theme=dark] .reader-body td{border-color:#323835}
html[data-theme=dark] .reader-body hr,html[data-theme=dark] .reader-finish{border-top-color:#323835}
html[data-theme=dark] .reader-dialog .reader-finish p,html[data-theme=dark] .reader-original,html[data-theme=dark] .reader-dialog .reader-finish .reader-add-source{color:#a7b1ab}
html[data-theme=dark] .story-topic{background:#1d2120;border-color:#3a403d;color:#d5dcd8}
html[data-theme=dark] .story-topic:hover,html[data-theme=dark] .story-topic:focus-visible{border-color:#f0565b;color:#ff8f86}
html[data-theme=dark] .source-candidate{border-bottom-color:#2a2f2d;color:#e3e8e5}
html[data-theme=dark] .source-add{background:#1d2120;border-color:#3a403d;color:#ff8f86}
html[data-theme=dark] .source-add:disabled{color:#8f9a94}
html[data-theme=dark] .reader-bottom{background:#151817;border-top-color:#2a2f2d}
html[data-theme=dark] .reader-bottom button{color:#c3ccc7}
html[data-theme=dark] .reader-bottom button:hover{background:#222725}
html[data-theme=dark] .reader-bottom .reader-next{color:#ff7d72}
html[data-theme=dark] .reader-bottom .reader-save[aria-pressed=true]{color:var(--accent)}

/* Saved shelves, Save from anywhere, and the Save to Pheedr page */
html[data-theme=dark] .shelf-bar{border-bottom-color:#2a2f2d}
html[data-theme=dark] .shelf-count{background:#323835;color:#c3ccc7}
html[data-theme=dark] .shelf-bar button[aria-pressed=true] .shelf-count{background:var(--accent);color:#151817}
html[data-theme=dark] .story-actions .done[aria-pressed=true],html[data-theme=dark] .reader-bottom .reader-done[aria-pressed=true]{color:var(--accent)}
html[data-theme=dark] .save-tools-head{color:#9aa59f}
html[data-theme=dark] .share-note{background:#2c2219;color:#f1cba6}
html[data-theme=dark] .share-page .login-form input{background:#151817}
html[data-theme=dark] #share-login-error{color:#ff8a80}

/* Recipes */
html[data-theme=dark] .recipe-about,html[data-theme=dark] .recipe-dialog .recipe-section p,html[data-theme=dark] .recipe-ingredients label,html[data-theme=dark] .recipe-steps li{color:#dde3df}
html[data-theme=dark] .recipe-times,html[data-theme=dark] .recipe-group,html[data-theme=dark] .recipe-dialog .recipe-own .recipe-made-line,html[data-theme=dark] .recipe-links .text-button{color:#a7b1ab}
html[data-theme=dark] .recipe-links .recipe-remove{color:#ff8a80}
html[data-theme=dark] .recipe-scale,html[data-theme=dark] .recipe-links{border-color:#323835}
html[data-theme=dark] .recipe-ingredients li{border-bottom-color:#2a2f2d}
html[data-theme=dark] .recipe-ingredients li.checked span{color:#6f7a74}
html[data-theme=dark] .recipe-timer-chip,html[data-theme=dark] .recipe-pick-secondary{background:#1d2120;border-color:#3a403d;color:#ff8f86}
html[data-theme=dark] .recipe-pick-secondary{color:#e6ebe8}
html[data-theme=dark] .recipe-check{background:#6b5300;color:#fff3c4}
html[data-theme=dark] .recipe-unclear{background:#2b2512;border-left-color:#c79a00;color:#f1dfa6}
html[data-theme=dark] .recipe-thumb{background:#252a28;border-color:#3a403d}
html[data-theme=dark] .recipe-timer{background:#2e3431;box-shadow:0 6px 22px #000a}
html[data-theme=dark] .recipe-timer.ring{background:#d84522}

/* iPad and wider: raised cards on a darker page */
@media (min-width:700px){
 html[data-theme=dark] body.stream-mode{background:#0f1211}
 html[data-theme=dark] .stream-mode .wrap{background:transparent}
 html[data-theme=dark] .appbar,html[data-theme=dark] .pwa-tools{background:#151817}
 html[data-theme=dark] .stream-mode .story{background:#1d2120;box-shadow:0 1px 2px #0008}
}
@media (min-width:700px) and (hover:hover){html[data-theme=dark] .stream-mode .story:not(.skeleton):hover{box-shadow:0 2px 4px #000a,0 10px 26px #0008}}
