/* Bare-bones, readable, large touch targets. Colour is never the only carrier of meaning. */
:root { color-scheme: light dark; --bg: #fbf5ec; --fg: #2b1d14; --muted: #6a5444; --card: #fffaf3; --line: #c9b39d; --accent: #8a4b22; --focus: #1d5fd6;
  --top: calc(env(safe-area-inset-top) + 64px); --bottom: calc(env(safe-area-inset-bottom) + 76px);
  font-family: -apple-system, system-ui, "Segoe UI", sans-serif; font-size: 18px; line-height: 1.5; }
@media (prefers-color-scheme: dark) { :root { --bg: #1f1712; --fg: #f6ece0; --muted: #cbb7a4; --card: #2a2019; --line: #6d5646; --accent: #e3a46f; --focus: #8cb4ff; } }
* { box-sizing: border-box; }
body { margin: 0; background: var(--bg); color: var(--fg); }
main { max-width: 760px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 16px) 16px calc(env(safe-area-inset-bottom) + 24px); }
body.has-top main { padding-top: calc(var(--top) + 12px); }
body.has-bottom main { padding-bottom: calc(var(--bottom) + 24px); }
h1 { font-size: 1.6rem; line-height: 1.25; margin: .2em 0 .6em; }
h2 { font-size: 1.25rem; margin: 1.4em 0 .4em; }
p { margin: .5em 0; }
.muted { color: var(--muted); }
.result { background: var(--card); border-left: 4px solid var(--accent); padding: 10px 12px; }
button { font: inherit; color: var(--fg); background: var(--card); border: 2px solid var(--line); border-radius: 12px; padding: 12px 14px; min-height: 52px; cursor: pointer; touch-action: manipulation; }
button.primary { border-color: var(--accent); font-weight: 700; }
button:disabled { opacity: .45; }
button.nav { display: block; width: 100%; text-align: left; }
.menu { display: flex; flex-direction: column; gap: 8px; margin: 12px 0; }
.field { margin: 14px 0; }
.field label { display: block; font-weight: 600; margin-bottom: 4px; }
select, input[type=text], textarea { font: inherit; width: 100%; min-height: 50px; padding: 10px; border: 2px solid var(--line); border-radius: 10px; background: var(--card); color: var(--fg); }
textarea { min-height: 220px; }
input[type=file] { font: inherit; width: 100%; padding: 10px 0; }
.field.check { display: flex; gap: 12px; align-items: center; }
.field.check input { width: 30px; height: 30px; flex: none; }
.field.check label { margin: 0; font-weight: 400; }
main > button, .group > button { display: block; width: 100%; margin: 8px 0; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.fixed { position: fixed; z-index: 100; min-width: 92px; min-height: 52px; background: var(--card); }
.tl { top: calc(env(safe-area-inset-top) + 6px); left: 8px; }
.tc { top: calc(env(safe-area-inset-top) + 6px); left: 50%; transform: translateX(-50%); }
.tr { top: calc(env(safe-area-inset-top) + 6px); right: 8px; }
.bl { bottom: calc(env(safe-area-inset-bottom) + 8px); left: 8px; }
.br { bottom: calc(env(safe-area-inset-bottom) + 8px); right: 8px; }
body.has-top::before { content: ""; position: fixed; z-index: 90; top: 0; left: 0; right: 0; height: var(--top); background: var(--bg); border-bottom: 1px solid var(--line); }
body.has-bottom::after { content: ""; position: fixed; z-index: 90; bottom: 0; left: 0; right: 0; height: var(--bottom); background: var(--bg); border-top: 1px solid var(--line); }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.recipe-text p, .recipe-line { white-space: pre-wrap; }
.recipe-line { font-size: 1.25rem; background: var(--card); padding: 14px; border-radius: 10px; }
.science table { border-collapse: collapse; width: 100%; } .science td, .science th { border: 1px solid var(--line); padding: 6px; vertical-align: top; }
.log li { margin: 6px 0; }
details { margin: 14px 0; } summary { min-height: 44px; padding: 8px 0; }
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }
