:root {
  --bg: #f6f1ea;
  --paper: #fffdf9;
  --ink: #3d3430;
  --muted: #6b605a;
  --sage: #7d9a86;
  --sage-ink: #4f6b58;
  --blush: #e7cfc6;
  --line: #eadfd4;
  --safe: #2f6a45;
  --safe-bg: #e5f0e8;
  --caution: #7a5b16;
  --caution-bg: #f8f0dc;
  --avoid: #8d3d36;
  --avoid-bg: #f8e6e3;
  --gift-bg: #f5e7df;
  color: var(--ink);
  background: var(--bg);
  font-family: "Avenir Next", "Segoe UI", "Nunito Sans", system-ui, sans-serif;
  font-size: 17px;
  line-height: 1.55;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
}

button, input, select { font: inherit; color: inherit; }

button { cursor: pointer; }

a { color: var(--sage-ink); }

:focus-visible {
  outline: 2px solid var(--sage-ink);
  outline-offset: 2px;
}

.wrap {
  max-width: 720px;
  margin: 0 auto;
  padding: 28px max(20px, env(safe-area-inset-right)) 32px max(20px, env(safe-area-inset-left));
}

.top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 12px;
}

h1 {
  margin: 0;
  font-size: 1.7rem;
  font-weight: 650;
  letter-spacing: -0.03em;
}

.langs {
  display: flex;
  flex-wrap: wrap;
}

.langs button {
  min-width: 44px;
  min-height: 44px;
  padding: 0 4px;
  border: 0;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 650;
  letter-spacing: 0.04em;
}

.langs button[aria-pressed="true"] {
  color: var(--sage-ink);
  border-bottom-color: var(--sage);
}

h2 {
  margin: 0 0 6px;
  font-size: 1.45rem;
  font-weight: 650;
  letter-spacing: -0.02em;
}

h3 {
  margin: 18px 0 4px;
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--sage-ink);
}

p { margin: 0 0 10px; }

.tagline {
  margin: 6px 0 18px;
  color: var(--muted);
}

.banner {
  margin: 0 0 16px;
  padding: 12px 14px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 16px;
  color: var(--muted);
  font-size: 0.92rem;
}

.urgent {
  border-color: #b94a48;
  background: #fff3f1;
  color: var(--ink);
}

.urgent h2 {
  color: #8f302e;
  font-size: 1.15rem;
}

.disclaimer { padding: 4px 14px; }
.disclaimer summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
}
.disclaimer summary::-webkit-details-marker { display: none; }
.disclaimer summary::after {
  content: "+";
  flex: none;
  font-size: 1.2rem;
  line-height: 1;
  color: var(--sage-ink);
}
.disclaimer[open] summary::after { content: "−"; }
.disclaimer p { margin: 0 0 10px; }

.card {
  margin: 16px 0;
  padding: 18px 18px 8px;
  background: var(--paper);
  border-radius: 18px;
}

.card details {
  margin: 16px 0 10px;
}

.card summary {
  min-height: 44px;
  cursor: pointer;
  font-weight: 650;
}

.warning-list {
  padding: 12px 14px;
  border: 1px solid #d7aaa5;
  border-radius: 14px;
  background: #fff8f6;
}

.warning-list li {
  margin-bottom: 8px;
}

.fine { color: var(--muted); font-size: 0.92rem; }

.stage-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.stage-row .stepper { flex: 1 1 240px; }

.due-line {
  margin: 0;
  flex: 1 1 160px;
  font-size: 1.15rem;
  font-weight: 650;
  color: var(--ink);
}

.size { font-size: 1.15rem; }

.measures { display: flex; flex-wrap: wrap; gap: 2px 14px; }
.measures span { white-space: nowrap; }

.seg {
  display: flex;
  gap: 4px;
  margin: 0 0 8px;
  padding: 4px;
  background: #efe7de;
  border-radius: 999px;
}

.seg button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}

.seg button[aria-pressed="true"] {
  background: var(--paper);
  color: var(--sage-ink);
  font-weight: 650;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.92rem;
}

input, select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: 16px;
}

button.primary, button.quiet, button.danger {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: transparent;
}

button.primary {
  width: 100%;
  margin: 14px 0 8px;
  background: var(--sage-ink);
  color: #fff;
}

button.quiet { color: var(--sage-ink); padding: 0 4px; text-align: left; }

button.danger { color: var(--avoid); padding: 0; }

button:disabled { opacity: 0.4; cursor: default; }

.suggests button:disabled { opacity: 0.65; color: var(--muted); }

.section-gap { margin-top: 24px; }

.row {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
}

.stepper {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 8px;
  align-items: center;
}

.stepper button { min-width: 44px; font-size: 1.4rem; text-align: center; background: var(--paper); border: 1px solid var(--line); }

.food h2 { font-size: 1.15rem; }

.status {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 650;
  white-space: nowrap;
}

.status.safe { background: var(--safe-bg); color: var(--safe); }
.status.caution { background: var(--caution-bg); color: var(--caution); }
.status.avoid { background: var(--avoid-bg); color: var(--avoid); }

.names { margin: 0 0 12px; padding-left: 1.2rem; }

.offer {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.offer a { color: var(--sage-ink); }

.kicker { color: var(--muted); font-size: 0.88rem; }

.gift {
  margin: 20px 0;
  padding: 16px 18px;
  border: 1px solid var(--blush);
  border-radius: 18px;
  background: var(--gift-bg);
  color: var(--ink);
}

.gift .gift-title {
  margin: 0 0 6px;
  font-size: 1rem;
  font-weight: 650;
  letter-spacing: 0;
  color: var(--ink);
}

.gift p {
  margin: 0 0 12px;
  font-size: 0.95rem;
  color: var(--ink);
}

.gift-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.gift-button {
  display: inline-flex;
  align-items: center;
  gap: 0.35em;
  min-height: 48px;
  padding: 0 18px;
  border-radius: 12px;
  background: var(--sage-ink);
  color: #fff;
  font-weight: 650;
  text-decoration: none;
}

.help-now h3 {
  margin: 12px 0 2px;
  font-size: 0.92rem;
  color: #8f302e;
}

.help-now ul {
  margin: 0;
  padding-left: 1.2rem;
}

.help-now li { margin: 2px 0; overflow-wrap: anywhere; }

.help-now .help-lead { margin: 4px 0 0; }

.help-now .help-tail { margin: 12px 0 0; }

.help-today {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #e3b9b4;
}

.help-today p { margin: 0 0 6px; }

.warning-list > summary {
  min-height: 44px;
  cursor: pointer;
  font-weight: 650;
}

.fold > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 48px;
  margin-bottom: 10px;
  list-style: none;
}

.fold > summary::-webkit-details-marker { display: none; }

.fold > summary::after {
  content: "+";
  flex: none;
  font-size: 1.3rem;
  line-height: 1;
  color: var(--sage-ink);
}

.fold[open] > summary::after { content: "−"; }

.fold > summary h2 { margin: 0; }

.suggests { display: flex; flex-direction: column; align-items: flex-start; gap: 2px; }

.tabs {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  background: var(--paper);
  border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}

.tabs {
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

.tabs button {
  flex: 1 1 0;
  min-width: 0;
  min-height: 56px;
  padding: 8px 2px;
  border: 0;
  border-top: 3px solid transparent;
  background: transparent;
  color: var(--muted);
  font-size: 0.8rem;
  line-height: 1.15;
  overflow-wrap: anywhere;
  hyphens: auto;
}

.tabs button[aria-current="page"] {
  color: var(--sage-ink);
  font-weight: 650;
  border-top-color: var(--sage);
}

body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

@media (min-width: 720px) {
  .tabs button { font-size: 0.85rem; }
}
