:root {
  --ink: #16342f;
  --muted: #64736f;
  --paper: #f7faf6;
  --panel: #ffffff;
  --line: #d9e5df;
  --brand: #123d37;
  --brand-2: #2c6b60;
  --mint: #ddf2e9;
  --sky: #dceefa;
  --sun: #ffd166;
  --orange: #ff795b;
  --soft-orange: #ffe7df;
  --shadow: 0 18px 50px rgba(18, 61, 55, .10);
  --radius: 22px;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: Pretendard, "Apple SD Gothic Neo", "Noto Sans KR", system-ui, sans-serif; font-size: 16px; line-height: 1.55; }
button { font: inherit; color: inherit; }
a { color: inherit; }
.shell { width: min(1220px, calc(100% - 40px)); margin-inline: auto; }
.site-header { position: sticky; top: 0; z-index: 50; border-bottom: 1px solid rgba(217,229,223,.9); background: rgba(247,250,246,.91); backdrop-filter: blur(16px); }
.topbar { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 11px; font-size: 1.22rem; font-weight: 900; letter-spacing: -.04em; text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: grid; place-items: center; border-radius: 12px; background: var(--brand); color: var(--sun); box-shadow: 0 7px 18px rgba(18,61,55,.22); }
.brand-mark svg { width: 23px; }
.update { display: flex; align-items: center; gap: 9px; color: var(--muted); font-size: .86rem; }
.update-dot { width: 8px; height: 8px; border-radius: 50%; background: #28a778; box-shadow: 0 0 0 4px rgba(40,167,120,.11); }
.intro { padding: 28px 0 22px; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(320px, .75fr); gap: 24px; }
.intro-copy { min-height: 222px; display: flex; flex-direction: column; justify-content: center; padding: clamp(22px, 4vw, 38px); border-radius: var(--radius); color: #fff; background: var(--brand); position: relative; overflow: hidden; }
.intro-copy::after { content: ""; position: absolute; width: 260px; height: 260px; border-radius: 50%; right: -100px; top: -150px; border: 50px solid rgba(255,209,102,.14); }
.eyebrow { margin: 0 0 8px; color: #bde1d7; font-weight: 800; font-size: .78rem; letter-spacing: .09em; text-transform: uppercase; }
h1 { margin: 0; font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.1; letter-spacing: -.06em; position: relative; z-index: 1; }
.intro-copy p:last-child { margin: 13px 0 0; max-width: 650px; color: #d7e8e3; position: relative; z-index: 1; }
.hero-photo { margin: 0; min-height: 222px; border-radius: var(--radius); overflow: hidden; position: relative; box-shadow: var(--shadow); background: #0f453e; }
.hero-photo img { display: block; width: 100%; height: 100%; min-height: 222px; object-fit: cover; }
.hero-photo figcaption { position: absolute; left: 14px; bottom: 14px; padding: 7px 10px; border-radius: 999px; background: rgba(255,255,255,.88); backdrop-filter: blur(8px); color: var(--brand); font-size: .74rem; font-weight: 800; }
.stage-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 9px; padding: 9px; background: #eaf0ec; border-radius: 18px; }
.stage-tab { min-height: 62px; border: 0; border-radius: 13px; background: transparent; cursor: pointer; text-align: left; padding: 10px 14px; transition: background .18s ease, color .18s ease, box-shadow .18s ease; }
.stage-tab:hover { background: rgba(255,255,255,.55); }
.stage-tab[aria-selected="true"] { color: #fff; background: var(--brand); box-shadow: 0 8px 22px rgba(18,61,55,.18); }
.stage-tab strong { display: block; font-size: .98rem; }
.stage-tab span { display: block; margin-top: 2px; color: var(--muted); font-size: .74rem; }
.stage-tab[aria-selected="true"] span { color: #cce0da; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 20px 0 13px; }
.period-control { display: flex; align-items: center; gap: 7px; }
.icon-btn { border: 1px solid var(--line); background: var(--panel); width: 42px; height: 42px; border-radius: 12px; cursor: pointer; display: grid; place-items: center; }
.icon-btn:hover:not(:disabled) { border-color: #a8c3ba; background: var(--mint); }
.icon-btn:disabled { cursor: not-allowed; color: #a7b0ad; background: #edf1ef; }
.period-label { min-width: 166px; text-align: center; }
.period-label strong { display: block; line-height: 1.25; letter-spacing: -.025em; }
.period-label span { color: var(--muted); font-size: .76rem; }
.view-toggle { display: inline-flex; gap: 4px; padding: 4px; border: 1px solid var(--line); border-radius: 13px; background: var(--panel); }
.view-btn { min-height: 34px; padding: 0 14px; border: 0; border-radius: 9px; background: transparent; color: var(--muted); cursor: pointer; font-size: .84rem; font-weight: 800; }
.view-btn[aria-pressed="true"] { background: var(--brand); color: #fff; }
.schedule-frame { background: var(--panel); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; margin-bottom: 24px; }
.schedule-head { min-height: 64px; padding: 14px 18px; display: flex; align-items: center; justify-content: space-between; gap: 14px; border-bottom: 1px solid var(--line); }
.schedule-title { display: flex; align-items: center; gap: 10px; min-width: 0; }
.stage-pill { border-radius: 999px; padding: 5px 9px; font-size: .72rem; font-weight: 900; color: #195547; background: var(--mint); }
.schedule-title strong { letter-spacing: -.02em; }
.exclude-trigger { display: inline-flex; align-items: center; gap: 7px; min-height: 34px; padding: 6px 11px 6px 7px; border: 1px solid #f2cf72; border-radius: 999px; background: #fff8e5; color: #6e5110; font-size: .73rem; font-weight: 900; white-space: nowrap; cursor: pointer; }
.exclude-trigger:hover { border-color: #d8a830; background: #fff3cf; }
.exclude-trigger > span:first-child { width: 20px; height: 20px; border-radius: 50%; display: grid; place-items: center; color: #fff; background: #d59a16; font-size: 1rem; line-height: 1; }
.exclude-trigger.active { border-color: #4e9d86; color: #164f42; background: var(--mint); }
.exclude-trigger.active > span:first-child { background: var(--brand-2); }
.week-scroll { overflow-x: auto; overscroll-behavior-inline: contain; }
.week-grid { min-width: 1050px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.day-card { min-height: 150px; padding: 16px 14px; border-right: 1px solid var(--line); position: relative; }
.day-card:last-child { border-right: 0; }
.day-card.today { background: linear-gradient(180deg, #f0faf6 0%, #fff 55%); }
.day-card.today::before { content: "오늘"; position: absolute; top: 15px; right: 12px; font-size: .68rem; font-weight: 900; color: #fff; background: var(--orange); padding: 3px 7px; border-radius: 999px; }
.day-date { display: flex; align-items: baseline; gap: 6px; margin-bottom: 20px; }
.day-date strong { font-size: 1.5rem; line-height: 1; letter-spacing: -.05em; }
.day-date span { color: var(--muted); font-size: .76rem; }
.meal-list { display: grid; gap: 9px; }
.meal { border-top: 1px solid #edf1ef; padding-top: 10px; }
.meal:first-child { border-top: 0; padding-top: 0; }
.meal-name { margin: 0; font-size: .87rem; font-weight: 800; line-height: 1.42; letter-spacing: -.018em; overflow-wrap: anywhere; }
.meal-meta { margin-top: 5px; display: flex; align-items: center; gap: 6px; }
.swap-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 6px; color: #195d4e; background: var(--mint); font-size: .61rem; font-weight: 900; }
.month-view { display: none; }
.month-view.active { display: block; }
.week-view.hidden { display: none; }
.month-weekdays, .month-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.month-weekdays { border-bottom: 1px solid var(--line); background: #f5f8f6; }
.month-weekdays div { padding: 9px; text-align: center; color: var(--muted); font-size: .73rem; font-weight: 800; }
.month-cell { min-height: 142px; padding: 10px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.month-cell:nth-child(7n) { border-right: 0; }
.month-cell.empty-cell { background: #fafcf9; }
.month-cell.today { background: #f1faf6; box-shadow: inset 0 0 0 2px #46a387; }
.month-date { width: 28px; height: 28px; display: grid; place-items: center; border-radius: 9px; font-size: .79rem; font-weight: 900; margin-bottom: 7px; }
.month-cell.today .month-date { color: #fff; background: var(--brand-2); }
.month-meal { margin: 0 0 5px; padding-left: 8px; border-left: 3px solid #cae6dc; font-size: .72rem; line-height: 1.35; }
.month-meal span:first-child { overflow-wrap: anywhere; }
.month-meal .swap-tag { margin-left: 5px; vertical-align: 1px; }
.safety-note { margin: 0 0 70px; border: 1px solid var(--line); border-radius: 18px; background: var(--panel); padding: 18px; }
.safety-note h2 { margin: 0 0 7px; font-size: 1rem; letter-spacing: -.02em; }
.safety-note p { margin: 0 0 8px; color: var(--muted); font-size: .82rem; }
.safety-note p:last-child { margin-bottom: 0; }
.exclude-dialog { width: min(540px, calc(100% - 28px)); max-height: min(720px, calc(100dvh - 32px)); overflow: auto; border: 0; border-radius: 24px; padding: 24px; color: var(--ink); background: var(--panel); box-shadow: 0 28px 90px rgba(11, 42, 36, .3); }
.exclude-dialog::backdrop { background: rgba(12, 35, 31, .52); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.dialog-head h2 { margin: 0; font-size: 1.35rem; letter-spacing: -.035em; }
.dialog-eyebrow { margin: 0 0 3px; color: var(--brand-2); font-size: .71rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.dialog-close { width: 36px; height: 36px; flex: 0 0 auto; border: 1px solid var(--line); border-radius: 11px; background: var(--paper); color: var(--muted); cursor: pointer; font-size: 1.4rem; line-height: 1; }
.dialog-description { margin: 15px 0 16px; color: var(--muted); font-size: .87rem; }
.quick-ingredients { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-ingredients button { border: 1px solid var(--line); border-radius: 999px; padding: 7px 11px; background: var(--paper); color: #52635e; cursor: pointer; font-size: .8rem; font-weight: 800; }
.quick-ingredients button:hover { border-color: #86b8aa; }
.quick-ingredients button[aria-pressed="true"] { border-color: var(--brand-2); background: var(--mint); color: #164f42; }
.ingredient-field { display: block; margin-top: 18px; }
.ingredient-field > span { display: block; margin-bottom: 7px; font-size: .82rem; font-weight: 900; }
.ingredient-field input { width: 100%; min-height: 46px; border: 1px solid var(--line); border-radius: 12px; padding: 0 13px; outline: 0; background: #fff; }
.ingredient-field input:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(44, 107, 96, .12); }
.ingredient-field small { display: block; margin-top: 5px; color: #82908c; font-size: .7rem; }
.replacement-preview { min-height: 24px; margin: 13px 0 0; color: var(--brand-2); font-size: .78rem; font-weight: 800; }
.dialog-caution { display: grid; gap: 3px; margin-top: 14px; border-radius: 14px; padding: 12px 13px; background: #fff8e5; }
.dialog-caution strong { color: #715311; font-size: .79rem; }
.dialog-caution span { color: #796a47; font-size: .73rem; }
.dialog-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
.dialog-actions button { min-height: 42px; border-radius: 12px; padding: 0 15px; cursor: pointer; font-size: .83rem; font-weight: 900; }
.secondary-action { border: 1px solid var(--line); background: var(--panel); color: var(--muted); }
.primary-action { border: 1px solid var(--brand); background: var(--brand); color: #fff; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

@media (max-width: 820px) {
  .intro { grid-template-columns: 1fr; padding-block: 18px 14px; }
  .intro-copy { min-height: 158px; padding-block: 22px; }
  .intro-copy h1 { font-size: 2.2rem; }
  .hero-photo { display: none; }
  .month-weekdays { display: none; }
  .month-grid { display: block; padding: 8px 12px; }
  .month-cell { min-height: auto; padding: 12px 2px; border-right: 0; display: grid; grid-template-columns: 42px 1fr; gap: 8px; }
  .month-cell.empty-cell { display: none; }
  .month-cell.today { padding-inline: 9px; border-radius: 12px; box-shadow: inset 0 0 0 2px #46a387; }
  .month-date { margin: 0; }
  .month-meals { display: grid; gap: 5px; }
  .month-meal { font-size: .79rem; }
}

@media (max-width: 620px) {
  .shell { width: min(100% - 24px, 1220px); }
  .intro { padding-top: 18px; gap: 12px; }
  .intro-copy { padding: 24px 20px; }
  h1 { font-size: 2.2rem; }
  .stage-tabs { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stage-tab { min-height: 58px; padding: 9px 11px; }
  .toolbar { align-items: flex-end; }
  .period-label { min-width: 128px; }
  .view-btn { padding-inline: 10px; }
  .schedule-head { align-items: flex-start; }
  .schedule-title { align-items: flex-start; flex-direction: column; gap: 5px; }
  .exclude-trigger { font-size: .68rem; }
  .exclude-dialog { padding: 20px; border-radius: 20px; }
}

/* ─── 헤더 액션 ──────────────────────────────────────────────── */
.header-actions { display: flex; align-items: center; gap: 8px; }
.ghost-btn { display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: var(--panel); cursor: pointer; font-size: .82rem; font-weight: 800; }
.ghost-btn:hover { border-color: #a8c3ba; background: var(--mint); }


/* ─── 메뉴 카드 ──────────────────────────────────────────────── */
.meal-ingredients { margin: 3px 0 0; color: #7d8a86; font-size: .7rem; line-height: 1.4; overflow-wrap: anywhere; }
.meal-meta { flex-wrap: wrap; }
.warn-tag { display: inline-flex; align-items: center; border-radius: 999px; padding: 2px 6px; color: #7a5a12; background: #fff1cd; font-size: .61rem; font-weight: 900; }
.empty-note { margin: 0; color: #92a09c; font-size: .76rem; }

/* ─── 제외 모달 추가 요소 ────────────────────────────────────── */
.field-label { margin: 18px 0 8px; font-size: .82rem; font-weight: 900; }
.substitute-picker { display: grid; gap: 10px; }
.sub-row { border: 1px solid var(--line); border-radius: 14px; padding: 11px 12px; background: var(--paper); }
.sub-head { display: flex; align-items: baseline; gap: 7px; margin-bottom: 8px; }
.sub-head strong { font-size: .86rem; }
.sub-head span { color: var(--muted); font-size: .72rem; }
.sub-options { display: flex; flex-wrap: wrap; gap: 7px; }
.sub-option { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--line); border-radius: 11px; padding: 7px 11px; background: var(--panel); cursor: pointer; font-size: .81rem; font-weight: 800; }
.sub-option:hover { border-color: #86b8aa; }
.sub-option[aria-pressed="true"] { border-color: var(--brand-2); background: var(--mint); color: #164f42; }
.sub-label { border-radius: 999px; padding: 2px 6px; background: #e7ece9; color: #60706b; font-size: .62rem; font-weight: 900; }
.sub-option[aria-pressed="true"] .sub-label { background: var(--brand-2); color: #fff; }
.sub-none { margin: 0; color: #8a5f26; font-size: .76rem; }

/* ─── 넓은 모달 (보관함 · 장보기) ───────────────────────────── */
.wide-dialog { width: min(860px, calc(100% - 28px)); max-height: min(760px, calc(100dvh - 32px)); overflow: auto; border: 0; border-radius: 24px; padding: 24px; color: var(--ink); background: var(--panel); box-shadow: 0 28px 90px rgba(11, 42, 36, .3); }
.wide-dialog::backdrop { background: rgba(12, 35, 31, .52); backdrop-filter: blur(3px); }

.plan-allergy[hidden] { display: none; }

/* ─── 나만의 식단표 ─────────────────────────────────────────── */
.plan-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 7px; }
.plan-day { display: grid; gap: 6px; align-content: start; }
.plan-day-head { display: flex; align-items: baseline; justify-content: center; gap: 4px; padding-bottom: 3px; }
.plan-day-head strong { font-size: .92rem; }
.plan-day-head span { color: var(--muted); font-size: .7rem; }
.plan-slot { position: relative; min-height: 58px; display: grid; place-items: center; padding: 7px 18px 7px 7px; border: 1px dashed #c6d6d0; border-radius: 12px; background: var(--paper); text-align: center; font-size: .71rem; line-height: 1.35; overflow-wrap: anywhere; cursor: pointer; }
.plan-slot.filled { border-style: solid; border-color: var(--brand-2); background: var(--mint); font-weight: 800; }
.slot-hint { color: #a3b0ac; }
.slot-clear { position: absolute; top: 3px; right: 3px; width: 17px; height: 17px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(0, 0, 0, .09); cursor: pointer; font-size: .7rem; line-height: 1; }
.plan-allergy { display: grid; gap: 4px; margin-top: 14px; border-radius: 14px; padding: 12px 14px; font-size: .78rem; }
.plan-allergy strong { font-size: .82rem; }
.plan-allergy.safe { background: var(--mint); color: #1a5546; }
.plan-allergy.caution { background: #fff8e5; color: #715311; }
.plan-allergy.danger { background: var(--soft-orange); color: #8c3418; }

/* ─── 장보기 체크리스트 ─────────────────────────────────────── */
.shop-guide { margin: 0 0 14px; color: var(--muted); font-size: .77rem; }
.shop-groups { display: grid; gap: 14px; }
.shop-group { border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; }
.shop-group h3 { margin: 0 0 9px; font-size: .84rem; letter-spacing: -.02em; }
.shop-group ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 5px; }
.shop-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; border-radius: 10px; padding: 5px 6px; }
.shop-item:hover { background: var(--paper); }
.shop-item label { display: flex; align-items: center; gap: 9px; cursor: pointer; font-size: .84rem; }
.shop-item input { width: 17px; height: 17px; accent-color: var(--brand-2); }
.shop-item input:not(:checked) + span { color: #a3b0ac; text-decoration: line-through; }
.search-btn { width: 32px; height: 32px; flex: 0 0 auto; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 10px; background: var(--panel); text-decoration: none; font-size: .86rem; }
.search-btn:hover { border-color: #86b8aa; background: var(--mint); }

/* ─── 공정위 대가성 공시 문구 (PRD 2.4) ─────────────────────── */
.affiliate-notice { margin: 16px 0 0; border-radius: 12px; padding: 10px 12px; background: #f0f3f1; color: #6b7873; font-size: .73rem; line-height: 1.5; }

/* ─── 푸터 ──────────────────────────────────────────────────── */
.site-footer { margin-top: 60px; border-top: 1px solid var(--line); padding: 28px 0 40px; background: var(--panel); }
.site-footer p { margin: 0 0 8px; color: var(--muted); font-size: .79rem; max-width: 720px; }
.footer-brand { font-size: 1rem; font-weight: 900; color: var(--ink) !important; letter-spacing: -.04em; }

@media (max-width: 820px) {
  .plan-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 620px) {
  .header-actions .ghost-btn { padding: 0 10px; font-size: .76rem; }
  .plan-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
  .wide-dialog { padding: 20px; border-radius: 20px; }
}

/* ─── 끌어다 놓을 수 있는 메뉴 카드 ─────────────────────────── */
.meal[data-recipe] { border-radius: 10px; margin: -4px -6px; padding: 10px 6px 4px; cursor: grab; transition: background .15s ease, box-shadow .15s ease; }
.meal[data-recipe]:first-child { padding-top: 4px; }
.meal[data-recipe]:hover { background: #f3f8f5; }
.meal[data-recipe]:focus-visible { outline: 2px solid var(--brand-2); outline-offset: 1px; }
.meal[data-recipe].picked { background: var(--mint); box-shadow: inset 0 0 0 2px var(--brand-2); }
.meal[data-recipe].dragging { opacity: .4; }
.month-meal[data-recipe] { cursor: grab; border-radius: 0 6px 6px 0; padding-block: 2px; }
.month-meal[data-recipe]:hover { background: #f1f7f4; }
.month-meal[data-recipe].picked { background: var(--mint); border-left-color: var(--brand-2); }

/* ─── 나만의 식단표 (홈) ────────────────────────────────────── */
.my-plan { margin: 0 0 26px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); box-shadow: var(--shadow); padding: 18px; }
.my-plan-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.my-plan-head h2 { margin: 0; font-size: 1.2rem; letter-spacing: -.035em; }
.eyebrow-dark { margin: 0 0 3px; color: var(--brand-2); font-size: .71rem; font-weight: 900; letter-spacing: .08em; text-transform: uppercase; }
.my-plan-actions { display: flex; gap: 7px; flex-wrap: wrap; }
.plan-hint { margin: 11px 0 14px; color: var(--muted); font-size: .77rem; }
.plan-slot.over { border-style: solid; border-color: var(--brand-2); background: var(--mint); }

@media (max-width: 620px) {
  .my-plan { padding: 16px 14px; }
  .my-plan-actions .ghost-btn { font-size: .74rem; padding: 0 9px; }
}

/* ─── 먹었어요 버튼 (나만의 식단표) ─────────────────────────── */
.plan-slot.filled { padding-bottom: 28px; }
.ate-btn { position: absolute; left: 6px; right: 6px; bottom: 5px; min-height: 20px; border: 1px solid var(--line); border-radius: 999px; background: var(--panel); color: #63726d; cursor: pointer; font-size: .63rem; font-weight: 900; }
.ate-btn:hover { border-color: #86b8aa; }
.ate-btn.on { border-color: var(--brand-2); background: var(--brand-2); color: #fff; }
.plan-slot.ate { border-color: var(--brand-2); background: #e4f3ec; }

/* ─── 먹어본 재료 도감 ──────────────────────────────────────── */
.track-guide { margin: 0 0 16px; border-radius: 12px; padding: 11px 13px; background: var(--paper); color: #5d6b66; font-size: .78rem; line-height: 1.5; }
.track-groups { display: grid; gap: 14px; }
.track-group { border: 1px solid var(--line); border-radius: 16px; padding: 13px 14px; }
.track-group h3 { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin: 0 0 10px; font-size: .84rem; letter-spacing: -.02em; }
.track-group h3 span { color: var(--muted); font-size: .74rem; font-weight: 800; }
.track-items { display: grid; gap: 6px; }
.track-item { border: 1px solid transparent; border-radius: 12px; }
.track-item.open { border-color: var(--line); background: var(--paper); }
.track-head { display: flex; align-items: baseline; gap: 8px; width: 100%; padding: 7px 9px; border: 0; border-radius: 12px; background: transparent; cursor: pointer; text-align: left; }
.track-head:hover { background: #f2f7f4; }
.track-name { font-size: .84rem; font-weight: 800; color: #a3b0ac; flex: 0 0 auto; }
.track-item.tasted .track-name { color: var(--ink); }
.track-item.reacted .track-name { color: #b14a29; }
.track-meta { color: var(--muted); font-size: .71rem; overflow-wrap: anywhere; }
.track-flag { margin-left: auto; flex: 0 0 auto; border-radius: 999px; padding: 2px 7px; background: var(--soft-orange); color: #8c3418; font-size: .63rem; font-weight: 900; }
.track-form { padding: 4px 10px 12px; display: grid; gap: 9px; }
.track-form-title { margin: 0; font-size: .82rem; font-weight: 800; }
.symptom-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.symptom-tags button { border: 1px solid var(--line); border-radius: 999px; padding: 5px 10px; background: var(--panel); color: #52635e; cursor: pointer; font-size: .76rem; font-weight: 800; }
.symptom-tags button[aria-pressed="true"] { border-color: #d97a55; background: var(--soft-orange); color: #8c3418; }
.track-note { width: 100%; min-height: 40px; border: 1px solid var(--line); border-radius: 11px; padding: 0 12px; outline: 0; background: #fff; font: inherit; font-size: .82rem; }
.track-note:focus { border-color: var(--brand-2); box-shadow: 0 0 0 3px rgba(44, 107, 96, .12); }
.track-warn { margin: 0; color: #8c3418; font-size: .73rem; }
.track-form-actions { display: flex; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.track-form-actions button { min-height: 38px; border-radius: 11px; padding: 0 13px; cursor: pointer; font-size: .79rem; font-weight: 900; }
.track-privacy { margin: 16px 0 0; border-radius: 12px; padding: 10px 12px; background: #f0f3f1; color: #6b7873; font-size: .73rem; line-height: 1.5; }

/* ─── 이상 반응으로 자동 제외된 재료 ───────────────────────── */
.auto-list { display: flex; flex-wrap: wrap; gap: 7px; }
.auto-chip { display: inline-flex; align-items: baseline; gap: 6px; border: 1px solid #f0c6b3; border-radius: 999px; padding: 6px 11px; background: var(--soft-orange); color: #8c3418; font-size: .79rem; font-weight: 800; }
.auto-chip small { font-weight: 700; opacity: .8; font-size: .69rem; }
#autoExcluded .empty-note { margin-top: 7px; }

/* ─── 기록 내보내기 / 불러오기 ──────────────────────────────── */
.backup { margin-top: 18px; border: 1px solid var(--line); border-radius: 16px; padding: 14px; background: var(--paper); }
.backup h3 { margin: 0 0 8px; font-size: .88rem; letter-spacing: -.02em; }
.backup .track-privacy { margin: 0 0 12px; background: transparent; padding: 0; }
.backup-row { display: flex; flex-wrap: wrap; gap: 8px; }
.file-btn { display: inline-flex; align-items: center; cursor: pointer; }
.backup-note { margin: 10px 0 0; color: var(--muted); font-size: .75rem; }
.backup-error { margin: 12px 0 0; border-radius: 12px; padding: 10px 12px; background: var(--soft-orange); color: #8c3418; font-size: .78rem; }
.backup-confirm { margin-top: 12px; border: 1px solid #f0c6b3; border-radius: 14px; padding: 12px 13px; background: #fff; }
.backup-confirm p { margin: 0 0 7px; font-size: .79rem; color: var(--ink); }
.backup-warn { color: #8c3418 !important; }
.backup-actions { display: flex; justify-content: flex-end; gap: 7px; margin-top: 4px; }
.backup-actions button { min-height: 36px; border-radius: 11px; padding: 0 13px; cursor: pointer; font-size: .78rem; font-weight: 900; }
.backup-note code { border-radius: 5px; padding: 1px 5px; background: #e7ece9; font-size: .92em; }

/* ─── 나만의 식단표 접기 ────────────────────────────────────── */
/* 접으면 제목과 펼치기 단추만 남는다. */
.my-plan.collapsed { padding-bottom: 16px; }
.my-plan.collapsed .my-plan-actions > :not(#planToggle),
.my-plan.collapsed .plan-hint,
.my-plan.collapsed .plan-grid,
.my-plan.collapsed .plan-allergy,
.my-plan.collapsed .share-note { display: none; }
.plan-hidden { margin: 10px 0 0; color: var(--muted); font-size: .75rem; }
.plan-hidden:empty { display: none; }

/* ─── 손가락으로 쓰는 기기 ──────────────────────────────────────
 * 마우스 포인터가 없는 기기에서는 누를 것들을 키운다.
 * 먹었어요(20px)와 비우기(17px)는 손가락으로 겨냥하기에 너무 작아,
 * 옆의 비우기를 잘못 눌러 짜 둔 것을 날리기 쉬웠다. */
@media (pointer: coarse) {
  .plan-slot { min-height: 74px; }
  .plan-slot.filled { padding: 9px 34px 42px 9px; }
  .ate-btn { min-height: 36px; border-radius: 10px; font-size: .74rem; }
  .slot-clear { top: 5px; right: 5px; width: 28px; height: 28px; font-size: .95rem; }
  .ghost-btn { min-height: 42px; }
  .track-head { padding: 11px 10px; }
  .symptom-tags button { min-height: 38px; padding: 0 13px; }
  .quick-ingredients button { min-height: 38px; padding: 0 13px; }
  .sub-option { min-height: 40px; }
  .shop-item { padding: 9px 6px; }
  .shop-item input { width: 20px; height: 20px; }
  .search-btn { width: 40px; height: 40px; }
  .dialog-close { width: 42px; height: 42px; }
}


/* ─── 이미지 저장 / 인쇄 ────────────────────────────────────── */
.share-note { margin: 10px 0 0; color: var(--brand-2); font-size: .76rem; font-weight: 800; }
.share-note:empty { display: none; }
.print-only { display: none; }

/* 인쇄할 때는 나만의 식단표만 남긴다. 부모가 뽑아 냉장고에 붙이는 것이 목적이다. */
@media print {
  @page { margin: 12mm; }
  body { background: #fff; }
  .site-header, .intro, .stage-tabs, .toolbar, .schedule-frame,
  .safety-note, .site-footer, .my-plan-actions, .plan-hint, .plan-hidden,
  dialog { display: none !important; }
  .shell { width: 100%; }
  .my-plan { margin: 0; border: 0; box-shadow: none; padding: 0; }
  .my-plan-head { display: block; margin-bottom: 4px; }
  .eyebrow-dark { display: none; }
  .my-plan-head h2 { font-size: 20pt; }
  .print-only { display: block; margin: 2px 0 14px; color: #555; font-size: 11pt; }
  .plan-grid, .plan-grid.collapsed { grid-template-columns: repeat(7, minmax(0, 1fr)); max-width: none; gap: 5px; }
  .plan-slot { min-height: 74px; border: 1px solid #bbb !important; background: #fff !important; padding: 6px; }
  .plan-slot.ate { background: #eef7f2 !important; }
  /* 종이에서는 빈 칸을 손으로 채우게 두는 편이 낫다. '놓기'는 화면에서만 뜻이 있다. */
  .slot-clear, .ate-btn, .slot-hint { display: none !important; }
  .plan-day-head { padding-bottom: 2px; }
  .plan-allergy { border: 1px solid #ccc; background: #fff !important; color: #333 !important; margin-top: 10px; }
  .share-note { display: none; }
}

/* ─── 볼 수 있는 기간 밖의 날 ───────────────────────────────── */
/* 오늘 기준 지난 1주 ~ 앞으로 3주 밖은 날짜만 남긴다. 비었다는 것이 보여야 한다. */
.day-card.outside, .month-cell.outside { background: #fbfcfb; }
.day-card.outside .day-date, .month-cell.outside .month-date { opacity: .38; }

/* ─── 먹어본 재료 도감 — 영양군 토글 ────────────────────────── */
.track-group { padding: 0; overflow: hidden; }
.track-group-head { display: flex; align-items: center; gap: 9px; width: 100%; padding: 13px 14px; border: 0; background: transparent; cursor: pointer; text-align: left; }
.track-group-head:hover { background: var(--paper); }
.track-group-head strong { font-size: .88rem; letter-spacing: -.02em; }
.track-caret { color: var(--muted); font-size: .75rem; transition: transform .15s ease; }
.track-group.open .track-caret { transform: rotate(90deg); }
.track-count { margin-left: auto; color: var(--muted); font-size: .76rem; font-weight: 800; }
.track-group .track-items { padding: 0 8px 10px; }

/* ─── 같은 날 상극 조합 경고 ────────────────────────────────── */
.plan-conflict { display: grid; gap: 5px; margin-top: 10px; border-radius: 14px; padding: 12px 14px; background: #fff8e5; color: #715311; font-size: .78rem; }
.plan-conflict[hidden] { display: none; }
.plan-conflict strong { font-size: .82rem; }
.plan-conflict span { line-height: 1.5; }
.plan-conflict em { margin-left: 5px; border-radius: 999px; padding: 1px 7px; background: #f6e3b4; color: #6b4e0f; font-size: .72rem; font-style: normal; font-weight: 800; white-space: nowrap; }
.my-plan.collapsed .plan-conflict { display: none; }
