/* Shared website themes; system preference also works without JavaScript. */
:root {
color-scheme: light;
--bg-primary:#f5f8fc; --bg-secondary:#ffffff; --bg-card:#ffffff;
--text-primary:#19304d; --text-secondary:#53657b;
--accent:#175cd3; --accent-hover:#1047a6; --accent-ink:#ffffff;
--accent-secondary:#0b7164; --accent-soft:#e4f3ee; --border:#d9e3ef;
--input-border:#8090a4; --panel:#edf3fa; --cover:#193552; --cover-accent:#91e4cf;
--focus:#175cd3; --error:#a72820; --shadow:0 18px 50px rgba(25,48,77,.09);
--bg:var(--bg-primary); --card:var(--bg-card); --text:var(--text-primary); --muted:var(--text-secondary); color:var(--text-primary); background:var(--bg-primary);
}
:root[data-theme="dark"] {
color-scheme: dark;
--bg-primary:#0d1728; --bg-secondary:#111f33; --bg-card:#192a40;
--text-primary:#eff5ff; --text-secondary:#b2c0d3;
--accent:#55d8e5; --accent-hover:#8be8ee; --accent-ink:#10253a;
--accent-secondary:#92e4cf; --accent-soft:#173b3a; --border:#35485e;
--input-border:#7b90aa; --panel:#17273c; --cover:#1a3552; --cover-accent:#91e4cf;
--focus:#55d8e5; --error:#ffc4b6; --shadow:0 18px 50px rgba(0,0,0,.16);
}
@media (prefers-color-scheme:dark) { :root:not([data-theme]) {
color-scheme: dark;
--bg-primary:#0d1728; --bg-secondary:#111f33; --bg-card:#192a40;
--text-primary:#eff5ff; --text-secondary:#b2c0d3;
--accent:#55d8e5; --accent-hover:#8be8ee; --accent-ink:#10253a;
--accent-secondary:#92e4cf; --accent-soft:#173b3a; --border:#35485e;
--input-border:#7b90aa; --panel:#17273c; --cover:#1a3552; --cover-accent:#91e4cf;
--focus:#55d8e5; --error:#ffc4b6; --shadow:0 18px 50px rgba(0,0,0,.16);
} }

.theme-toggle { display:inline-flex; align-items:center; justify-content:center; gap:.5rem; flex-shrink:0; min-height:44px; min-width:44px; padding:.55rem .75rem; border:1px solid var(--input-border); border-radius:6px; background:var(--bg-card); color:var(--text-primary); font:600 .8rem/1.4 'Segoe UI',system-ui,sans-serif; cursor:pointer; touch-action:manipulation; }
.theme-toggle[hidden] { display:none !important; }
.theme-toggle svg { flex-shrink:0; }
.theme-toggle:hover { background:var(--panel); }
.theme-toggle[aria-pressed="true"] { border-color:var(--accent-secondary); color:var(--accent-secondary); background:var(--accent-soft); }
.theme-toggle:focus-visible { outline:3px solid var(--focus); outline-offset:4px; }
.theme-toolbar { display:flex; justify-content:flex-end; margin-bottom:1rem; }
body.reading-page, body.delivery-page { background:var(--bg-primary); color:var(--text-primary); }
.reading-page .page, .delivery-page main, .delivery-page .card { background:var(--bg-card); border-color:var(--border); }
.reading-page a, .delivery-page a, .delivery-page a.quiet { color:var(--accent); }
.reading-page a:focus-visible, .reading-page input:focus-visible, .delivery-page a:focus-visible { outline-color:var(--focus); }
.reading-page .brand, .reading-page .intro, .reading-page .note, .reading-page footer, .delivery-page p, .delivery-page .note { color:var(--text-secondary); }
.reading-page header { border-color:var(--accent-secondary); }
.reading-page .choice, .reading-page .week, .reading-page footer { border-color:var(--border); }
.reading-page .week h3 { color:var(--accent-secondary); }
.reading-page .week strong { color:var(--text-primary); }
.reading-page input { accent-color:var(--accent-secondary); }
.reading-page code, .reading-page .worksheet { background:var(--panel); color:var(--text-primary); }
.reading-page .worksheet { border-color:var(--accent-secondary); }
.delivery-page main { border-top-color:var(--accent-secondary); }
.delivery-page .brand { color:var(--text-primary); }
.delivery-page .label { color:var(--accent-secondary); }
.delivery-page a.btn, .delivery-page a.button { color:var(--accent-ink); background:var(--accent); }
.delivery-page a.btn:hover, .delivery-page a.button:hover { background:var(--accent-hover); }
@media (max-width:1000px) { .site-header nav { gap:1rem; } }
@media (max-width:600px) { .theme-toggle-label { display:none; } .theme-toggle { padding:.55rem; } }
@media (max-width:450px) {
  .site-header nav { display:grid; grid-template-columns:minmax(0,1fr) auto auto; gap:.5rem; }
  .site-header .nav-logo { min-width:0; margin-right:0; }
  .site-header .nav-logo span { max-width:84px; }
  .site-header .nav-cta { font-size:.7rem; padding-inline:.5rem; }
  body.delivery-page:has(.card) { padding:1rem; }
  .delivery-page .card { padding:1.5rem 1.25rem; min-width:0; }
}
@media print {
 .theme-toggle, .theme-toolbar { display:none !important; }
 :root, :root[data-theme="dark"], :root:not([data-theme]) {
color-scheme: light;
--bg-primary:#f5f8fc; --bg-secondary:#ffffff; --bg-card:#ffffff;
--text-primary:#19304d; --text-secondary:#53657b;
--accent:#175cd3; --accent-hover:#1047a6; --accent-ink:#ffffff;
--accent-secondary:#0b7164; --accent-soft:#e4f3ee; --border:#d9e3ef;
--input-border:#8090a4; --panel:#edf3fa; --cover:#193552; --cover-accent:#91e4cf;
--focus:#175cd3; --error:#a72820; --shadow:0 18px 50px rgba(25,48,77,.09);
 }
 body.reading-page, .reading-page .page { background:#fff; color:#19304d; }
}
