@font-face { font-family: 'Pretendard'; src: url(../fonts/PretendardVariable.woff2) format('woff2'); font-weight: 45 920; font-display: swap; }
:root {
  --bg: #F4FAF6; --ink: #2D4A3E; --sub: #5E7268; --line: #EEF5F0;
  --g: #218A4A; --g-soft: #DCFCE7; --g-pale: #F0FDF4; --g-dark: #166534;
  --carb: #F59E0B; --carb-bg: #FEF3C7; --carb-ink: #92400E;
  --prot: #EC4899; --prot-bg: #FCE7F3; --prot-ink: #9D174D;
  --fat: #3B82F6; --fat-bg: #DBEAFE; --fat-ink: #1E40AF;
  --warn: #F97316; --warn-bg: #FFEDD5; --warn-ink: #9A3412;
  --shadow: 0 6px 20px rgba(33,138,74,0.08);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: #E7EFEA; }
body { font-family: 'Pretendard', system-ui, sans-serif; color: var(--ink); font-size: 15px; word-break: keep-all; overflow-wrap: anywhere; }
button, input, textarea, select { font-family: inherit; color: inherit; }
a { color: var(--g); text-decoration: none; }
#app { position: relative; max-width: 480px; min-height: 100%; margin: 0 auto; background: var(--bg); display: flex; flex-direction: column; }
.page { flex: 1; display: flex; flex-direction: column; gap: 12px; padding: 18px 20px 24px; }
.page.with-nav { padding-bottom: 96px; }
.row { display: flex; align-items: center; gap: 10px; }
.between { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 8px; }
.grow { flex: 1; min-width: 0; }
.sub { color: var(--sub); font-size: 13px; }
.small { font-size: 12px; }
h1 { margin: 0; font-size: 24px; font-weight: 700; line-height: 1.35; }
h2 { margin: 0; font-size: 17px; font-weight: 700; }
.card { background: #fff; border-radius: 24px; box-shadow: var(--shadow); padding: 16px; display: flex; flex-direction: column; gap: 10px; }
.chip { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--g-pale); color: var(--g-dark); white-space: nowrap; }
.chip.warn { background: var(--warn-bg); color: var(--warn-ink); }
.btn { height: 56px; border: 0; border-radius: 999px; background: var(--g); color: #fff; font-size: 17px; font-weight: 600; display: flex; align-items: center; justify-content: center; width: 100%; box-shadow: 0 8px 18px rgba(33,138,74,0.25); cursor: pointer; flex-shrink: 0; }
.btn:disabled { background: #D1D5DB; box-shadow: none; }
.btn.light { background: #fff; color: var(--g-dark); box-shadow: var(--shadow); }
.btn.sm { height: 44px; font-size: 15px; }
.link { background: none; border: 0; color: var(--g); font-weight: 600; font-size: 14px; padding: 8px; cursor: pointer; }
.icon-btn { width: 44px; height: 44px; border-radius: 16px; border: 0; background: #fff; box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; cursor: pointer; flex-shrink: 0; }
.seg { display: flex; gap: 2px; padding: 3px; border-radius: 999px; background: var(--g-pale); }
.seg button { flex: 1; height: 32px; padding: 0 12px; border: 0; border-radius: 999px; background: transparent; color: var(--sub); font-size: 13px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.seg button.on { background: var(--g); color: #fff; }
.pills { display: flex; gap: 6px; flex-wrap: wrap; }
.pill { height: 34px; padding: 0 14px; border: 0; border-radius: 999px; background: var(--g-pale); color: var(--g-dark); font-size: 13px; font-weight: 600; cursor: pointer; }
.pill.on { background: var(--g); color: #fff; }
.input { height: 48px; border: 2px solid #BBF7D0; border-radius: 14px; padding: 0 14px; font-size: 16px; font-weight: 600; background: #F9FAFB; outline: none; width: 100%; }
.input:focus { border-color: var(--g); }
.num { text-align: right; }
.bar { height: 8px; border-radius: 4px; overflow: hidden; }
.bar > div { height: 100%; border-radius: 4px; }
.stack { display: flex; height: 14px; border-radius: 7px; overflow: hidden; background: #F3F4F6; }
.choice { text-align: left; width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 2.5px solid transparent; border-radius: 22px; background: #fff; box-shadow: 0 4px 14px rgba(33,138,74,0.06); cursor: pointer; }
.choice.on { border-color: var(--g); }
.list-row { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); font-size: 15px; background: none; border-left: 0; border-right: 0; border-bottom: 0; width: 100%; text-align: left; cursor: pointer; color: var(--ink); }
.list-row:first-child { border-top: 0; }
.toggle { width: 48px; height: 28px; border: 0; border-radius: 14px; background: #D1D5DB; padding: 3px; display: flex; cursor: pointer; flex-shrink: 0; }
.toggle span { width: 22px; height: 22px; border-radius: 11px; background: #fff; }
.toggle.on { background: #4ADE80; justify-content: flex-end; }
nav.tabs { position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px; height: 76px; display: grid; grid-template-columns: repeat(5, 1fr); align-items: center; background: #fff; border-radius: 28px 28px 0 0; box-shadow: 0 -6px 20px rgba(33,138,74,0.08); z-index: 10; padding-bottom: env(safe-area-inset-bottom); }
nav.tabs a { display: flex; flex-direction: column; align-items: center; gap: 3px; color: var(--sub); font-size: 11px; }
nav.tabs a.on { color: var(--g); font-weight: 600; }
.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: rgba(45,74,62,0.94); color: #fff; padding: 12px 18px; border-radius: 16px; font-size: 14px; z-index: 50; max-width: 340px; text-align: center; line-height: 1.45; }
.sheet-bg { position: fixed; inset: 0; background: rgba(45,74,62,0.45); z-index: 40; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; background: var(--bg); border-radius: 30px 30px 0 0; padding: 20px 20px 28px; display: flex; flex-direction: column; gap: 12px; }
.meal-card { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 20px; background: #fff; box-shadow: 0 4px 14px rgba(33,138,74,0.06); cursor: pointer; border: 0; width: 100%; text-align: left; }
.meal-icon { width: 54px; height: 54px; border-radius: 17px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; flex-shrink: 0; font-size: 11px; font-weight: 700; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; font-size: 14px; line-height: 1.4; }
.dashed { height: 52px; border-radius: 20px; border: 2px dashed #86EFAC; display: flex; align-items: center; justify-content: center; gap: 6px; color: var(--g-dark); font-size: 15px; font-weight: 600; background: none; width: 100%; cursor: pointer; }
.week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; padding: 8px; border-radius: 22px; background: #fff; box-shadow: var(--shadow); }
.week button { border: 0; background: none; display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; padding: 0; }
.week .d { width: 34px; height: 34px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 14px; }
.week .sel .d { background: var(--g); color: #fff; font-weight: 600; }
.dot { width: 5px; height: 5px; border-radius: 3px; }
.cal { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal button { height: 40px; border: 0; border-radius: 12px; background: none; font-size: 13px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; cursor: pointer; color: var(--ink); }
.cal button.sel { background: var(--g-soft); font-weight: 700; }
.bars { display: grid; grid-template-columns: repeat(7, 1fr); gap: 10px; align-items: end; height: 120px; position: relative; }
.bars > div { display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.bars .b { border-radius: 999px; min-height: 6px; }
.tag { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.qty { width: 72px; height: 40px; border: 2px solid #BBF7D0; border-radius: 12px; outline: none; text-align: right; padding: 0 10px; font-size: 16px; font-weight: 700; background: #F9FAFB; }
select.unit { height: 40px; border: 0; border-radius: 12px; background: var(--g-pale); color: var(--g-dark); font-size: 14px; font-weight: 600; padding: 0 8px; }
.tablist { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 5px; border-radius: 18px; background: #fff; box-shadow: 0 4px 14px rgba(33,138,74,0.06); }
.tablist a { height: 40px; border-radius: 14px; display: flex; align-items: center; justify-content: center; color: var(--sub); font-size: 14px; }
.tablist a.on { background: var(--g-soft); color: var(--g-dark); font-weight: 600; }
.splash { position: fixed; inset: 0; background: var(--bg); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; z-index: 100; }
.test-badge { position: fixed; bottom: 82px; left: 8px; z-index: 5; font-size: 10px; padding: 2px 7px; border-radius: 6px; background: var(--warn-bg); color: var(--warn-ink); font-weight: 700; }
