/* FoodTrack Visual Kit: application tokens mapped to the approved palette. */
:root {
  --bg:#f5f8f4; --surface:#fff; --surface-muted:#eaf4ec; --ink:#183428;
  --muted:#536c5a; --border:#dce8de; --primary:#247b4c; --primary-dark:#18623b;
  --kit-protein:#b78154; --kit-fat:#5b9eac; --kit-carbs:#8c82c9; --kit-water:#4aa6b1;
  --shadow-subtle:0 2px 8px rgb(16 48 30 / 7%);
  --shadow-card:0 6px 18px rgb(16 48 30 / 9%);
  --shadow-floating:0 10px 28px rgb(16 48 30 / 13%);
  --radius-card:19px; --radius-control:14px;
}
:root[data-theme=dark] {
  --bg:#101c18; --surface:#1b2d25; --surface-muted:#263e31; --ink:#f0f6f0;
  --muted:#a7b9ae; --border:#354b3e; --primary:#60cb8d; --primary-dark:#7fe0a5;
  --kit-protein:#d9a77b; --kit-fat:#78c7d1; --kit-carbs:#aea6ef; --kit-water:#74c9d3;
  --shadow-subtle:0 2px 9px rgb(0 0 0 / 12%);
  --shadow-card:0 7px 20px rgb(0 0 0 / 20%);
  --shadow-floating:0 10px 28px rgb(0 0 0 / 28%);
}
.kit-icon {
  display:inline-block; width:22px; height:22px; flex:none; vertical-align:middle;
  background:currentColor;
  -webkit-mask:var(--icon) center / contain no-repeat;
  mask:var(--icon) center / contain no-repeat;
}
main > header {background:transparent; padding:8px 4px 10px}
#page-title {font-size:1.625rem; letter-spacing:-.035em}
main > :is(#diary,#photos,#profile), .statistics-card, .macro-card, #today .water {
  background:var(--surface); border:1px solid var(--border); box-shadow:var(--shadow-card);
  border-radius:var(--radius-card); padding:clamp(12px,4.6vw,18px);
}
body #today .energy {
  background:linear-gradient(145deg,#267b4d,#174b34); color:white;
  box-shadow:var(--shadow-floating); padding:18px; margin-bottom:13px;
}
#today .energy :is(small,#remaining) {color:#d5f0dd}
#today .energy progress {accent-color:#bdf0cb}
#today .energy progress::-webkit-progress-bar {background:#ffffff32;border-radius:99px}
#today .energy progress::-webkit-progress-value {background:#bdf0cb;border-radius:99px}
.macro-card {margin-bottom:13px}
.macro-card h2 {font-size:1rem}
.macro-row {display:grid;grid-template-columns:auto minmax(0,1fr);gap:10px;align-items:center;margin-top:11px}
.icon-tile {width:34px;height:34px;display:grid;place-items:center;border-radius:11px;background:var(--surface-muted);color:var(--primary)}
.macro-label {display:flex;justify-content:space-between;gap:6px;flex-wrap:wrap;font-size:.875rem}
.macro-row progress {height:6px}
.macro-row.protein progress {accent-color:var(--kit-protein)}
.macro-row.fat progress {accent-color:var(--kit-fat)}
.macro-row.carbs progress {accent-color:var(--kit-carbs)}
#today .water button.quiet,.water-actions button {background:var(--surface-muted);color:var(--ink)}
#water {color:var(--ink);font-size:1.125rem}
#today .meal-summary {border:1px solid var(--border);box-shadow:var(--shadow-subtle)}
.bottom-nav {box-shadow:var(--shadow-subtle)}
.bottom-nav button[aria-current] {color:var(--primary-dark)}
.bottom-nav .kit-icon {width:22px;height:22px}
dialog {box-shadow:var(--shadow-floating)}
#photo-empty {display:grid;justify-items:center;gap:8px;color:var(--muted)}
#photo-empty .kit-icon {width:34px;height:34px;color:var(--primary)}
.search-field {display:flex;gap:8px;align-items:center;padding:0 12px;background:var(--surface-muted);border-radius:14px;color:var(--primary-dark)}
.search-field input {min-width:0;width:100%;border:0;background:transparent}
#catalog-results article {border-color:var(--border)}
#catalog-results button[aria-pressed=true] {color:var(--primary-dark);background:var(--surface-muted)}
#catalog-results button:has(.kit-icon) {min-width:44px;padding-inline:8px}
input[type=range] {
  appearance:none; display:block; width:100%; min-height:44px; margin:0;
  padding:0; border:0; background:none; cursor:pointer;
}
input[type=range]::-webkit-slider-runnable-track {
  height:7px; border-radius:99px;
  background:linear-gradient(to right,var(--primary) var(--range-fill),var(--border) var(--range-fill));
}
input[type=range]::-webkit-slider-thumb {
  appearance:none; width:21px;height:21px;margin-top:-7px;border-radius:50%;
  border:2px solid var(--surface);background:var(--primary);box-shadow:var(--shadow-subtle);
}
input[type=range]::-moz-range-track {height:7px;border-radius:99px;background:var(--border)}
input[type=range]::-moz-range-progress {height:7px;border-radius:99px;background:var(--primary)}
input[type=range]::-moz-range-thumb {width:18px;height:18px;border-radius:50%;border:2px solid var(--surface);background:var(--primary)}
#water-form input[type=range],.profile-card input[type=range] {width:100%;grid-column:1/-1}
.portion-presets {display:flex;flex-wrap:wrap}
.portion-presets button {flex:1 0 auto;padding-inline:8px}
.chart-point span {background:var(--primary)}
.chart-point[data-color=blue] span {background:var(--kit-water)}
.chart-point[data-missing=true] span {background:transparent}
@media(max-width:380px) {
  #catalog-results article {grid-template-columns:minmax(0,1fr) auto}
  #catalog-results article button {grid-column:2}
  .bottom-nav button,.bottom-nav button:not([aria-current]) {overflow-wrap:anywhere;min-width:0}
}
[data-theme=dark] main > header {background:transparent}
#today .water {display:grid;gap:8px}
.water-actions {margin:0}
#water-form {padding-top:4px}
#water-form input[type=range] {flex-basis:100%}
#catalog-fields output {font-weight:700;color:var(--primary-dark)}
