:root {
  color-scheme: light dark;
  --paper: light-dark(#f7f4e8, #1b241e);
  --ink: light-dark(#233a2a, #edf4e8);
  --leaf: light-dark(#286344, #a5dfa8);
  --soft: light-dark(#e7efdb, #344a39);
  --tile: light-dark(#fffdf7, #253329);
  --border: light-dark(#d8d9c7, #526658);
  font: 17px/1.45 system-ui, sans-serif;
  background: var(--paper);
  color: var(--ink);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; }
main { max-width: 1100px; margin: auto; padding: clamp(16px, 4vw, 38px); }
header, nav, .actions, #add-profile, #add-variant, .filters {
  display: flex; align-items: end; flex-wrap: wrap; gap: 10px;
}
header { justify-content: space-between; margin-bottom: 20px; }
h1, h2, h3, p { margin-top: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.12; margin-bottom: 0; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; margin: 18px 0 6px; }
.eyebrow { font-size: .75rem; letter-spacing: .1em; color: var(--leaf); font-weight: 750; margin-bottom: 6px; }
button, select, input {
  min-height: 44px; padding: 8px 12px; border-radius: 12px;
  font: inherit; background: var(--tile); color: var(--ink); border: 1px solid var(--border);
}
button { cursor: pointer; }
button:disabled { opacity: .55; cursor: default; }
button[aria-pressed="true"] { background: var(--soft); border-color: var(--leaf); }
:focus-visible { outline: 3px solid var(--leaf); outline-offset: 2px; }
label { display: grid; gap: 4px; font-size: .88rem; font-weight: 650; min-width: 0; }
label input, label select { width: 100%; }
.panel { background: var(--soft); border-radius: 22px; padding: clamp(15px, 3vw, 25px); }
.summary { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
#person { margin: 4px 0 12px; }
#score { font-size: clamp(1.3rem, 4vw, 2rem); }
progress { display: block; width: 100%; height: 14px; accent-color: var(--leaf); margin-top: 5px; }
#ranking { margin: 0; padding: 0; list-style: none; }
#ranking li { display: flex; justify-content: space-between; gap: 8px; padding: 4px 0; overflow-wrap: anywhere; }
#ranking .active { font-weight: 750; }
.catalog { margin-top: 22px; }
.filters { margin-bottom: 12px; }
.filters label:first-child { flex: 1 1 220px; }
#foods { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(125px, 100%), 1fr)); gap: 9px; }
.food { min-height: 100px; overflow-wrap: anywhere; hyphens: auto; line-height: 1.2; }
.food .picture { display: flex; align-items: center; justify-content: center; height: 2.6rem; font-size: 1.9rem; line-height: 1; margin-bottom: 6px; }
.food .picture img { width: 2.6rem; height: 2.6rem; }
.food small { display: block; margin-top: 3px; }
footer { font-size: .82rem; margin-top: 22px; }
a { color: var(--leaf); }
dialog { width: min(580px, calc(100% - 28px)); max-height: 85dvh; padding: 18px; border: 1px solid var(--border); border-radius: 18px; background: var(--tile); color: var(--ink); }
dialog::backdrop { background: #101a13a0; }
.close { display: flex; justify-content: end; margin-bottom: 8px; }
#add-variant { margin-top: 16px; }
#profiles { padding-left: 23px; }
#profiles button { margin: 3px 0 3px 8px; }
#notice:empty, #settings-status:empty { margin: 0; }
@media (max-width: 480px) { .summary { grid-template-columns: 1fr; } }
