/* V1.5 monochrome tokens. Illustration and personal photos retain original colour. */
:root,:root[data-theme=light],:root[data-theme=system]{color-scheme:light;--bg:#F7F7F6;--surface:#FFFFFF;--text:#181818;--muted:#737373;--line:#E3E3E1;--accent:#181818;--accent-hover:#333333;--tint:#F0F0EF;--trend:#737373;--gold:#181818;--card:#FFFFFF;--on-primary:#FFFFFF;--day0:#F0F0EF;--day1:#E3E3E1;--day2:#B8B8B6;--day3:#636363;--day4:#181818;--day-ink:#181818;--day-high:#FFFFFF}
:root[data-theme=dark]{color-scheme:dark;--bg:#121212;--surface:#1D1D1D;--text:#F5F5F5;--muted:#B0B0B0;--line:#3A3A3A;--accent:#F5F5F5;--accent-hover:#D8D8D8;--tint:#272727;--trend:#B0B0B0;--gold:#F5F5F5;--card:#1D1D1D;--on-primary:#181818;--day0:#272727;--day1:#404040;--day2:#6B6B6B;--day3:#AFAFAF;--day4:#F5F5F5;--day-ink:#FFFFFF;--day-high:#181818}
@media(prefers-color-scheme:dark){:root:not([data-theme=light]){color-scheme:dark;--bg:#121212;--surface:#1D1D1D;--text:#F5F5F5;--muted:#B0B0B0;--line:#3A3A3A;--accent:#F5F5F5;--accent-hover:#D8D8D8;--tint:#272727;--trend:#B0B0B0;--gold:#F5F5F5;--card:#1D1D1D;--on-primary:#181818;--day0:#272727;--day1:#404040;--day2:#6B6B6B;--day3:#AFAFAF;--day4:#F5F5F5;--day-ink:#FFFFFF;--day-high:#181818}}
html .primary,html .habit-check.done{background:var(--accent);color:var(--on-primary)}
html .primary:hover{background:var(--accent-hover)}
html .secondary{background:var(--tint)}
html dialog:not(.health-celebration){background:var(--surface)}
html .field input,html .field textarea,html .field select{background:var(--tint)}
html .record-button,html .record-button:hover,html .record-button.is-recorded{background:#181818;color:#FFF;box-shadow:none;animation:none}
html .record-subtitle{color:#FFF;opacity:.85}
html .record-button.is-recorded{color:#FFF!important;outline-color:var(--tint)}
html .weight-line,html .chart-dot{stroke:var(--accent)}html .legend-line{border-color:var(--accent)}
html .habit-symbol.done,html .habit-row:has(.habit-check.done) .habit-reward{color:var(--accent)}
html .record-button::before,html .record-button::after{display:none}
html .day-tile.level-0{background:var(--day0);color:var(--muted)}
html .day-tile.level-1{background:var(--day1);color:var(--day-ink)}
html .day-tile.level-2{background:var(--day2);color:var(--day-ink)}
html .day-tile.level-3{background:var(--day3);color:var(--day-high)}
html .day-tile.level-4{background:var(--day4);color:var(--day-high)}
html .day-tile.active{border-color:var(--text)}
.week-strip{grid-template-columns:repeat(7,minmax(44px,1fr));gap:4px;overflow-x:auto;padding:4px;scrollbar-width:none}
html .average-line{stroke:var(--muted)}html .legend-line.dashed{border-color:var(--muted)}
html .habit-overview>span{color:var(--muted)}
html .danger,html .ledger-delta.negative{color:var(--text)!important}
html .message-error{background:var(--tint);color:var(--text);border:1px solid var(--line);font-size:1rem}
html .health-card{background:var(--surface);color:var(--text);border-color:var(--line);box-shadow:0 12px 60px #0002}
html .health-celebration::backdrop,dialog::backdrop{background:#0006}
html :focus-visible{outline:2px solid var(--text);outline-offset:3px}
html input,html textarea,html select{accent-color:var(--accent)}
.meal-ai-actions{display:flex;gap:.5rem;flex-wrap:wrap;margin:.5rem 0 1rem}
.meal-ai-actions button,.meal-ai-login{min-height:44px;font-size:1rem}
.meal-ai-preview{max-height:180px;max-width:100%;object-fit:contain;display:block;margin:0 auto 1rem;border-radius:10px}
.meal-ai-disclosure{font-size:.9375rem;line-height:1.6;color:var(--muted)}
.meal-ai-review{margin:1rem 0;min-width:0}.meal-ai-review legend{font-size:1rem}
.food-editor{border:0;border-bottom:1px solid var(--line);padding:.75rem 0;margin:0;min-width:0}
.food-editor .food-numbers{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:.5rem}
.food-editor input{width:100%;min-width:0}.food-editor .field{margin-bottom:.5rem}
.food-editor .field>span{font-size:.8125rem}.food-editor .text-button{min-height:44px}
.meal-ai-status{line-height:1.6;overflow-wrap:anywhere;font-size:.9375rem}
.test-mode{font-size:.9375rem;border:1px dashed var(--muted);padding:.5rem;margin:.5rem 0}
@media(max-width:350px){.food-editor .food-numbers{grid-template-columns:1fr}.meal-ai-actions .secondary{flex:1;padding:.5rem}}
.nutrition-source,.nutrition-live,.meal-nutrition-total,.meal-nutrition-day{font-size:.9375rem;line-height:1.7;overflow-wrap:anywhere}
.nutrition-source{color:var(--muted)}.nutrition-source a{text-decoration:underline;min-height:44px;display:inline-flex;align-items:center}
.nutrition-basis summary,.food-editor details>summary{min-height:44px;display:flex;align-items:center;cursor:pointer;font-size:1rem}
.nutrition-live,.meal-nutrition-total{font-weight:550}.nutrition-candidate{display:block;min-height:56px;text-align:left;width:100%;border-bottom:1px solid var(--line);padding:.75rem 0;font-size:1rem;line-height:1.6}
.nutrition-candidate small{display:block;color:var(--muted);font-size:.875rem}.meal-row>span{white-space:normal;overflow-wrap:anywhere}.meal-row .meal-row-nutrition{display:block;text-align:left;color:var(--muted);font-size:.875rem;line-height:1.6;margin-top:.25rem}
.meal-nutrition-day{border-top:1px solid var(--line);padding-top:.75rem;color:var(--muted)}.meal-nutrition-day small{display:block;font-size:.875rem}
.food-editor legend{font-size:1rem;font-weight:550}.food-editor input,.food-editor select{min-height:44px}.food-editor{margin-bottom:1rem}.food-editor .food-numbers{grid-template-columns:repeat(2,minmax(0,1fr))}
@media(max-width:350px){.food-editor .food-numbers{grid-template-columns:1fr}}
