:root {
  --ink: #26332c;
  --muted: #68746c;
  --line: #e7e3d9;
  --paper: #f7f5ef;
  --card: #fffefa;
  --leaf: #2f6c4f;
  --leaf-soft: #e3eee5;
  --coral: #d96b50;
  --sun: #f5c95a;
  font-family: ui-rounded, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: var(--paper);
}

* { box-sizing: border-box; }
body { margin: 0; min-width: 320px; background: radial-gradient(circle at 90% 0%, #fce7ba 0, transparent 24rem), var(--paper); }
button, input, select, textarea { font: inherit; }
button { color: inherit; cursor: pointer; }
.app-shell { width: min(100%, 680px); margin: 0 auto; padding: max(28px, env(safe-area-inset-top)) 20px 104px; }
.topbar, .section-heading, .sheet-heading, .dialog-topline { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
h1, h2, p { margin: 0; }
h1 { margin-top: 2px; font-size: clamp(28px, 8vw, 38px); letter-spacing: -.06em; }
h2 { font-size: 22px; letter-spacing: -.04em; }
.eyebrow { color: var(--leaf); font-size: 10px; font-weight: 800; letter-spacing: .15em; }
.icon-button, .date-arrow { border: 0; background: #fffdf7; border-radius: 50%; width: 40px; height: 40px; font-size: 27px; line-height: 1; box-shadow: 0 3px 14px #634b2420; }
.install-button { min-height: 36px; padding: 0 12px; border: 1px solid #c9d9cc; border-radius: 999px; background: #fffdf7; color: var(--leaf); font-size: 13px; font-weight: 800; white-space: nowrap; }
.date-switcher { margin-top: 29px; display: grid; grid-template-columns: 40px 1fr 40px; gap: 10px; align-items: center; }
.date-switcher input { width: 100%; border: 0; background: transparent; text-align: center; color: var(--ink); font-size: 17px; font-weight: 700; }
.date-caption { margin: 5px 0 28px; text-align: center; color: var(--muted); font-size: 13px; }
.section-heading { align-items: end; margin-bottom: 16px; }
.selection-count { color: var(--muted); font-size: 13px; }
.today-list { display: grid; gap: 12px; }
.choose-dishes { width: 100%; margin-top: 12px; }
.today-dish { min-height: 74px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 17px; background: var(--card); display: flex; align-items: center; gap: 12px; }
.today-dish .dish-copy { flex: 1; }
.meal-card { min-height: 122px; padding: 16px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); display: grid; grid-template-columns: 57px 1fr auto; gap: 13px; align-items: center; box-shadow: 0 4px 20px #362d1c08; }
.meal-icon { width: 52px; height: 52px; display: grid; place-items: center; border-radius: 17px; background: var(--leaf-soft); font-size: 25px; }
.meal-meta { min-width: 0; }
.meal-label { color: var(--muted); font-size: 12px; font-weight: 700; }
.meal-title { margin-top: 3px; font-size: 19px; font-weight: 750; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.meal-detail { margin-top: 4px; color: var(--muted); font-size: 12px; }
.add-to-meal, .remove-meal { border: 0; border-radius: 13px; padding: 10px 12px; font-weight: 700; white-space: nowrap; }
.add-to-meal { background: var(--leaf); color: white; }
.remove-meal { background: #f5f1e9; color: var(--muted); font-size: 17px; }
.meal-actions { display: flex; align-items: center; gap: 6px; }
.shopping-cta { width: 100%; margin-top: 20px; padding: 16px 18px; display: grid; grid-template-columns: 28px 1fr auto; text-align: left; align-items: center; gap: 8px; border: 0; border-radius: 16px; background: var(--sun); font-weight: 800; }
.bottom-nav { position: fixed; z-index: 2; bottom: 0; left: 0; width: 100%; display: flex; justify-content: center; gap: min(14vw, 90px); padding: 10px 30px calc(10px + env(safe-area-inset-bottom)); background: #fffefbf2; border-top: 1px solid var(--line); backdrop-filter: blur(12px); }
.nav-item { display: grid; justify-items: center; gap: 2px; border: 0; color: var(--muted); background: transparent; font-size: 12px; }
.nav-item span { font-size: 20px; line-height: 1; }
.nav-item.active { color: var(--leaf); font-weight: 800; }
.text-button { color: var(--leaf); border: 0; background: transparent; padding: 6px 0; font-size: 14px; font-weight: 800; }
.search-box { height: 44px; display: flex; align-items: center; gap: 8px; padding: 0 12px; border: 1px solid var(--line); border-radius: 13px; background: white; color: var(--muted); }
.search-box input { min-width: 0; width: 100%; border: 0; outline: 0; background: transparent; }
.library-tools { display: grid; gap: 12px; }
.filter-row { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0; scrollbar-width: none; }
.filter-row::-webkit-scrollbar { display: none; }
.filter { border: 1px solid var(--line); border-radius: 999px; background: white; padding: 7px 12px; color: var(--muted); font-size: 13px; white-space: nowrap; }
.filter.active { border-color: var(--leaf); background: var(--leaf); color: white; }
.dish-list { display: grid; gap: 10px; margin-top: 16px; }
.dish-row { display: flex; align-items: center; gap: 12px; padding: 12px; background: var(--card); border: 1px solid var(--line); border-radius: 15px; }
.dish-emoji { width: 40px; height: 40px; display: grid; place-items: center; flex: none; border-radius: 12px; background: #f8efe2; font-size: 20px; }
.dish-image { width: 40px; height: 40px; flex: none; border-radius: 12px; object-fit: cover; background: #f8efe2; }
.dish-copy { min-width: 0; flex: 1; }
.dish-name { font-weight: 800; }
.dish-info { margin-top: 3px; color: var(--muted); font-size: 12px; }
.dish-action { flex: none; border: 0; border-radius: 10px; background: var(--leaf-soft); color: var(--leaf); padding: 8px 10px; font-size: 13px; font-weight: 800; }
.dish-action:disabled { background: #f1efe8; color: #9aa19b; cursor: default; }
.dish-actions { display: flex; align-items: center; gap: 6px; }
.edit-dish { border: 0; border-radius: 10px; padding: 8px 5px; background: transparent; color: var(--muted); font-size: 13px; font-weight: 700; }
.dish-empty { padding: 34px 15px; text-align: center; color: var(--muted); border: 1px dashed var(--line); border-radius: 16px; }
.shopping-note { margin: -6px 0 16px; color: var(--muted); font-size: 13px; }
.shopping-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.shopping-list li { display: flex; align-items: center; gap: 12px; padding: 13px; border-bottom: 1px solid var(--line); font-size: 16px; }
.shopping-list input { width: 19px; height: 19px; accent-color: var(--leaf); }
.shopping-list li:has(input:checked) { color: var(--muted); text-decoration: line-through; }
dialog { color: var(--ink); border: 0; }
dialog::backdrop { background: #20352a55; backdrop-filter: blur(2px); }
.sheet-dialog { width: min(100%, 680px); max-height: 82vh; margin: auto auto 0; padding: 12px 20px calc(22px + env(safe-area-inset-bottom)); border-radius: 25px 25px 0 0; background: #fffcf5; box-shadow: 0 -10px 35px #17332430; }
.sheet-handle { width: 38px; height: 4px; margin: 0 auto 15px; border-radius: 10px; background: #d8d3c6; }
.picker-search { margin: 18px 0 10px; }
.picker-list { max-height: 46vh; overflow-y: auto; padding-bottom: 3px; }
.outline-button { width: 100%; margin-top: 15px; padding: 13px; border: 1px dashed var(--leaf); border-radius: 12px; background: transparent; color: var(--leaf); font-weight: 700; }
.form-dialog { width: min(calc(100% - 32px), 480px); max-height: 90vh; overflow-y: auto; padding: 22px; border-radius: 22px; background: #fffcf5; box-shadow: 0 18px 50px #17332440; }
.form-dialog form { display: grid; gap: 14px; margin-top: 22px; }
.form-dialog label { display: grid; gap: 7px; font-size: 13px; font-weight: 750; }
.form-dialog input, .form-dialog select, .form-dialog textarea { width: 100%; border: 1px solid var(--line); border-radius: 11px; padding: 11px; outline-color: var(--leaf); background: white; color: var(--ink); font-weight: 400; }
.image-preview { height: 156px; display: grid; place-items: center; overflow: hidden; border: 1px dashed var(--line); border-radius: 13px; background: #faf8f2; color: var(--muted); font-size: 13px; }
.image-preview img { width: 100%; height: 100%; object-fit: cover; }
.remove-image-button { justify-self: start; margin-top: -8px; }
.install-guide-dialog[open] { display: grid; gap: 18px; }
.install-steps { display: grid; gap: 11px; margin: 0; padding-left: 24px; line-height: 1.55; }
.install-note { padding: 12px; border-radius: 12px; background: var(--leaf-soft); color: var(--muted); font-size: 13px; line-height: 1.55; }
.primary-button { min-height: 45px; border: 0; border-radius: 12px; background: var(--leaf); color: white; font-weight: 800; }
.toast { position: fixed; z-index: 4; left: 50%; bottom: 88px; transform: translate(-50%, 18px); opacity: 0; pointer-events: none; border-radius: 999px; padding: 10px 16px; background: #26332c; color: white; font-size: 14px; transition: .2s; white-space: nowrap; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
@media (min-width: 720px) { .app-shell { padding-top: 42px; } .bottom-nav { width: min(680px, 100%); left: 50%; transform: translateX(-50%); border-radius: 18px 18px 0 0; border-inline: 1px solid var(--line); } }
