/* Match the supplied midnight/navy reference; retain food photography. */
html[data-theme=dark]{color-scheme:dark;--paper:#191e2e;--surface:#232a3f;--ink:#f1f4ff;--muted:#b6c2df;--soft:#2e3a60;--line:#3c455e;--control-line:#647394;--accent:#a7b8ff;--accent-hover:#2444c6;--mango:#ffbe45;--mango-soft:#493c24;--green:var(--accent);--orange:var(--accent)}
.theme-toggle{display:grid;place-items:center;width:44px;height:44px;flex:0 0 44px;padding:0;border:1px solid var(--line);border-radius:10px;color:var(--ink);background:var(--surface)}
.theme-toggle:hover{background:var(--soft)}
.theme-toggle .theme-sun{display:none}html[data-theme=dark] .theme-toggle .theme-moon{display:none}html[data-theme=dark] .theme-toggle .theme-sun{display:block}
.login-theme-toggle{position:absolute;right:16px;top:16px}
html[data-theme=dark] :is(input:not([type=checkbox]):not([type=radio]),select,textarea){background-color:var(--surface);color:var(--ink);border-color:var(--control-line)}
html[data-theme=dark] :is(input,textarea)::placeholder{color:#9daac5;opacity:1}
html[data-theme=dark] input[readonly]{background:var(--soft)}
html[data-theme=dark] :is(button.primary,a.primary,.recipe-actions #cooked,.diary-page .day-heading #add-meal,#toast,.back-top){background:#3155e7;color:white}
html[data-theme=dark] :is(button.primary,a.primary,.recipe-actions #cooked):hover{background:#2444c6}
html[data-theme=dark] :is(.recipe-page .nutrition-bar,.diary-page .daily-totals){background:#293e92;color:white}
html[data-theme=dark] .recipe-page .nutrition-bar select{background:#293e92;color:white}
html[data-theme=dark] #site-header .nav-link{color:var(--ink)}
html[data-theme=dark] #site-header .nav-link[aria-current=page]{color:var(--accent);background:var(--soft)}
html[data-theme=dark] .ingredients-page .default-toggle[aria-pressed=true]{color:var(--mango)}
html[data-theme=dark] :is(.danger,#form-error,#product-error,#new-product-error,.login-error){color:#ffaba3}
html[data-theme=dark] :is(.profile-success,.meal-eaten-status){color:#9be1b3}
html[data-theme=dark] .recipe-page #eat-today{color:#202b40}
html[data-theme=dark] dialog{background:var(--surface);color:var(--ink);box-shadow:0 20px 80px #0007}
html[data-theme=dark] dialog::backdrop{background:#070c18aa}
html[data-theme=dark] :is(.account-menu-panel,.recipe-management-panel,.reset-options){box-shadow:0 12px 36px #0005}
html[data-theme=dark] .search input{background:transparent}
html[data-theme=dark] :is(.login-card,.profile-card){background:var(--surface)}
html[data-theme=dark] :is(.day-state-panel,.composition-picker,.macro-filter-grid fieldset,.entry-group-label,.diary-section-label button,.diary-action-menu[open] summary,.entry-grip,.entry-grip:hover,.drop-active){background:var(--soft);color:var(--ink);border-color:var(--line)}
html[data-theme=dark] .dish-group{background:var(--paper)}
html[data-theme=dark] :is(.meal-section.meal-eaten,.profile-success,.status-green,.calendar .status-green){background:#233b33;border-color:#486756;color:#b7e9ca}
html[data-theme=dark] .meal-section.meal-eaten :is(.meal-section-heading h4,.meal-eaten-toggle){color:#b7e9ca}
html[data-theme=dark] :is(.status-yellow,.calendar .status-yellow){background:#453b23;color:#ffe0a0}
html[data-theme=dark] :is(.status-red,.calendar .status-red){background:#492c35;color:#ffbbb3}
html[data-theme=dark] .calendar button.status-unknown{background:var(--soft);color:var(--muted)}
html[data-theme=dark] .batch-card .remove-batch:hover{background:#492c35;color:#ffbbb3}
html[data-theme=dark] :is(.gallery-categories button[aria-pressed=true],.goal-options button[aria-pressed=true],.chip.active){background:#3155e7;color:white;border-color:#3155e7}
html[data-theme=dark] .meal-eaten-toggle{color:var(--muted)}
html[data-theme=dark] .meal-section :is(.entry-grams,.entry-grip){color:var(--muted)}
html[data-theme=dark] .meal-section .diary-entry-shell{border-color:var(--line)}
html[data-theme=dark] :is(.meal-move-error,.delete-dish,#filter-error){color:#ffaba3}
@media(max-width:374px){#site-header .account-menu summary>span:first-child{max-width:70px}#site-header .site-actions{gap:6px}}
