:root {
  --bg: #f6f4ec; --card: #ffffff; --ink: #1d2a1d; --muted: #5b6b5b; --line: #d9dccd;
  --brand: #2f6b2f; --brand-ink: #ffffff; --on: #e3f1d8; --warn-bg: #fff6dc; --err: #a32020; --err-bg: #fde8e8;
}
@media (prefers-color-scheme: dark) {
  :root { --bg: #141a14; --card: #1d251d; --ink: #e9efe4; --muted: #a6b4a0; --line: #334033;
    --brand: #5fae4f; --brand-ink: #0f170f; --on: #26401f; --warn-bg: #3a3218; --err: #ff9b9b; --err-bg: #3d1d1d; }
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 18px/1.45 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; }
.top { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 10px 16px; background: var(--brand); color: var(--brand-ink); }
.brand { font-weight: 700; font-size: 20px; }
.lang { display: flex; gap: 4px; }
.lang button { min-height: 40px; min-width: 48px; border: 2px solid var(--brand-ink); border-radius: 10px; background: transparent;
  color: var(--brand-ink); font: inherit; font-size: 15px; font-weight: 600; }
.lang button[aria-pressed="true"] { background: var(--brand-ink); color: var(--brand); }
main { max-width: 720px; margin: 0 auto; padding: 8px 16px 24px; }
.tagline { color: var(--muted); margin: 8px 0 4px; }
section { background: var(--card); border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin: 14px 0; }
h2 { font-size: 20px; margin: 0 0 10px; }
.kinds { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.kind { display: flex; flex-direction: column; align-items: center; gap: 2px; min-height: 116px; padding: 10px 4px;
  border: 2px solid var(--line); border-radius: 14px; background: var(--bg); color: var(--ink); font: inherit; font-size: 15px; font-weight: 600; }
.kind small { color: var(--muted); font-weight: 400; }
.kind .big { font-size: 40px; line-height: 1.1; }
.kind[aria-pressed="true"] { border-color: var(--brand); background: var(--on); }
.fields { display: grid; gap: 10px; margin-top: 12px; }
.fields label { display: grid; gap: 4px; font-size: 16px; color: var(--muted); }
input { width: 100%; min-height: 52px; padding: 10px 12px; border: 2px solid var(--line); border-radius: 12px;
  background: var(--bg); color: var(--ink); font: inherit; font-size: 20px; }
input:focus-visible, button:focus-visible, a:focus-visible { outline: 3px solid var(--brand); outline-offset: 2px; }
.hint { margin: 0 0 8px; color: var(--muted); font-size: 16px; }
.search-row { display: flex; gap: 8px; align-items: center; }
.count { white-space: nowrap; color: var(--muted); font-size: 15px; }
.feeds { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 6px; }
.feed { display: grid; grid-template-columns: 1fr 120px; gap: 6px; align-items: center; }
.feed-toggle { display: flex; align-items: center; gap: 8px; min-height: 52px; padding: 6px 10px; text-align: left;
  border: 2px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font: inherit; font-size: 16px; }
.feed-toggle .icon { font-size: 24px; }
.feed.on .feed-toggle { border-color: var(--brand); background: var(--on); font-weight: 600; }
.feed.on .feed-toggle::after { content: "✓"; margin-left: auto; color: var(--brand); font-size: 22px; }
.price { font-size: 18px; min-height: 52px; }
.calc-bar { position: sticky; bottom: 0; padding: 10px 0; background: linear-gradient(transparent, var(--bg) 30%); }
.calc { width: 100%; min-height: 60px; border: 0; border-radius: 14px; background: var(--brand); color: var(--brand-ink);
  font: inherit; font-size: 22px; font-weight: 700; }
.error { background: var(--err-bg); color: var(--err); border-radius: 12px; padding: 12px; font-weight: 600; }
.totals { display: grid; gap: 8px; }
.totals div { display: grid; padding: 10px 12px; border-radius: 12px; background: var(--on); }
.totals small { color: var(--muted); font-size: 15px; }
.totals strong { font-size: 26px; }
.ration { width: 100%; border-collapse: collapse; margin-top: 12px; font-size: 16px; }
.ration caption { text-align: left; color: var(--muted); font-size: 15px; padding-bottom: 4px; }
.ration th, .ration td { padding: 8px 4px; border-bottom: 1px solid var(--line); text-align: right; }
.ration th[scope="row"], .ration thead th:first-child { text-align: left; font-weight: 500; }
.nutr { color: var(--muted); font-size: 14px; }
.warn { background: var(--warn-bg); border-radius: 12px; padding: 10px 12px; font-size: 15px; }
.share { display: grid; gap: 8px; }
.tg, .copy { display: flex; align-items: center; justify-content: center; min-height: 56px; border-radius: 14px; font: inherit;
  font-size: 18px; font-weight: 700; text-decoration: none; }
.tg { background: #229ed9; color: #fff; }
.copy { border: 2px solid var(--brand); background: transparent; color: var(--ink); }
footer { text-align: center; color: var(--muted); font-size: 14px; padding: 0 16px 24px; }
@media (min-width: 560px) { .totals { grid-template-columns: repeat(3, 1fr); } .share { grid-template-columns: 1fr 1fr; } }
@media (max-width: 360px) { .feed { grid-template-columns: 1fr 100px; } .kind { font-size: 13px; } }
