/* 오늘 뭐 먹지 — 프로토타입 스타일. 색은 시안에서 실측했다. */

:root {
  --bg: #FFF8E8;
  --surface: #FFFFFF;
  --line: #EFE4D0;
  --line-2: #E4D6BC;
  --ink: #3A2F29;
  --ink-2: #6F625A;
  --ink-3: #7E7065;

  --butter: #FFE9B8;
  --butter-ink: #85600F;
  --mint: #DEF0E6;
  --mint-ink: #3E7556;
  --pink: #FDD9D0;
  --pink-ink: #A23B30;
  --star: #B7790A;
  --lack: #F3EDE2;

  --r-hero: 24px;
  --r-card: 16px;
  --r-sm: 12px;
  --r-pill: 999px;

  --shadow: 0 1px 2px rgba(58, 47, 41, .04), 0 6px 20px rgba(58, 47, 41, .06);
  --shadow-pop: 0 10px 32px rgba(58, 47, 41, .16);

  --font: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: -0.01em;
  word-break: keep-all;
}

body.no-scroll { overflow: hidden; }

h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
/* display를 정한 클래스(.more-link 등)에 hidden 속성이 지지 않게 한다 */
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
img, svg { display: block; }
.ic { flex: none; }

:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.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;
}

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

main.container { padding-bottom: 56px; }

/* ---------- 헤더 ---------- */

.site-header {
  position: sticky; top: 0; z-index: 20;
  background: rgba(255, 248, 232, .92);
  backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex; align-items: center; gap: 28px;
  height: 68px;
}

.brand {
  display: flex; align-items: center; gap: 8px;
  text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -0.03em;
  flex: none;
}

.brand-mark {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--ink); color: var(--butter);
}

.gnb { display: flex; gap: 4px; flex: none; }

.gnb-link {
  padding: 8px 12px; border-radius: var(--r-pill);
  text-decoration: none; font-weight: 600; color: var(--ink-2);
}
.gnb-link:hover { color: var(--ink); background: rgba(58, 47, 41, .05); }
.gnb-link.is-active { color: var(--ink); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line); }

.search {
  flex: 1; min-width: 0;
  display: flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 16px;
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r-pill);
  color: var(--ink-3);
}
.search:focus-within { border-color: var(--ink); }
.search input {
  flex: 1; min-width: 0; height: 100%;
  border: 0; outline: 0; background: transparent; color: var(--ink);
}
.search input::placeholder { color: var(--ink-3); }

.header-actions { display: flex; align-items: center; gap: 6px; flex: none; }

.icon-btn {
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: transparent; color: var(--ink);
}
.icon-btn:hover { background: rgba(58, 47, 41, .06); }
.icon-btn-round { background: var(--butter); }
.icon-btn-round:hover { background: #FFE09A; }

/* ---------- 공통 요소 ---------- */

.card {
  background: var(--surface);
  border-radius: var(--r-card);
  box-shadow: var(--shadow);
}

.sec { margin-top: 40px; scroll-margin-top: 88px; }

.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 12px;
  margin-bottom: 16px;
}
.sec-title { font-size: 20px; font-weight: 800; letter-spacing: -0.03em; }
.sec-sub { margin-top: 2px; color: var(--ink-2); font-size: 14px; }

.link-btn {
  border: 0; background: none; padding: 4px 0;
  color: var(--ink-2); font-weight: 600; font-size: 14px;
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2);
}
.link-btn:hover { color: var(--ink); text-decoration-color: currentColor; }

.more-link {
  display: inline-flex; align-items: center; gap: 2px;
  border: 0; background: none; padding: 4px 0;
  color: var(--ink-2); font-weight: 600; font-size: 14px; text-decoration: none;
}
.more-link:hover { color: var(--ink); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 46px; padding: 0 22px;
  border-radius: var(--r-pill); border: 1px solid transparent;
  font-weight: 700; text-decoration: none; white-space: nowrap;
}
.btn-sm { height: 36px; padding: 0 14px; font-size: 14px; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2A211C; }
.btn-ghost { background: transparent; border-color: var(--line-2); color: var(--ink); }
.btn-ghost:hover { background: rgba(58, 47, 41, .04); }
.btn-butter { background: var(--butter); color: var(--ink); }
.btn-butter:hover { background: #FFE09A; }
.btn-danger { background: var(--pink); color: var(--pink-ink); }
.btn-coupang { background: var(--ink); color: #fff; }
.btn-coupang:hover { background: #2A211C; }
.btn:disabled { opacity: .45; cursor: not-allowed; }
.btn-butter:disabled { background: var(--butter); }

/* D-day 뱃지: D≤1 핑크, D2–3 버터, D≥4 민트 */
.badge {
  display: inline-flex; align-items: center;
  height: 22px; padding: 0 8px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700; white-space: nowrap; font-variant-numeric: tabular-nums;
}
.badge-danger { background: var(--pink); color: var(--pink-ink); }
.badge-warn { background: var(--butter); color: var(--butter-ink); }
.badge-ok { background: var(--mint); color: var(--mint-ink); }
.badge-none { background: #F3EDE2; color: var(--ink-3); }
/* 직접 정한 소비기한: 같은 색 계열을 진하게 채우고 흰 글자로 AI 기본값과 구분 */
.badge-user { color: #fff; }
.badge-danger.badge-user { background: var(--pink-ink); }
.badge-warn.badge-user { background: var(--butter-ink); }
.badge-ok.badge-user { background: var(--mint-ink); }
.badge-none.badge-user { background: var(--ink-3); }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  height: 26px; padding: 0 10px; border-radius: var(--r-pill);
  background: #F6F0E4; color: var(--ink-2); font-size: 13px; font-weight: 600;
}
.tag-miss { background: var(--pink); color: var(--pink-ink); }
.tag-have { background: var(--mint); color: var(--mint-ink); }
/* 임박 재료는 부족 태그(핑크 채움)와 헷갈리지 않게 테두리와 점으로 표시 */
.tag-urgent { background: var(--surface); color: var(--pink-ink); box-shadow: inset 0 0 0 1px var(--pink-ink); }
.tag-urgent::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.tag-pending {
  height: 20px; padding: 0 7px; margin-left: 6px; vertical-align: 1px;
  background: transparent; border: 1px dashed var(--butter-ink);
  color: var(--butter-ink); font-size: 11px; font-weight: 700;
}

.chip-sm {
  display: inline-flex; align-items: center; gap: 4px;
  height: 30px; padding: 0 12px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line);
  font-size: 13px; font-weight: 600; color: var(--ink);
}
.chip-sm.is-pending { border-style: dashed; border-color: var(--butter-ink); color: var(--ink-2); }

/* ---------- 홈: 히어로 + 필터 ---------- */

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 24px;
  margin-top: 28px;
  align-items: start;
}

.hero {
  background: var(--butter);
  border-radius: var(--r-hero);
  padding: 32px;
}
.hero h1 { font-size: 32px; font-weight: 800; letter-spacing: -0.04em; line-height: 1.25; }
.hero-sub { margin-top: 6px; color: var(--ink-2); font-size: 16px; }

.filter-card { margin-top: 22px; padding: 24px; }

.f-row + .f-row { margin-top: 20px; }
.f-label { display: block; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.f-help { margin-top: 8px; color: var(--ink-3); font-size: 13px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }

/* 3상태 토글 칩: 미선택 → 포함 → 제외 → 미선택 */
.tchip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 38px; padding: 0 16px; border-radius: var(--r-pill);
  background: var(--surface); border: 1px solid var(--line-2);
  font-weight: 600; color: var(--ink);
  transition: background .15s, color .15s, border-color .15s;
}
.tchip:hover { border-color: var(--ink-3); }
.tchip .ic { display: none; }
.tchip[data-state="in"] { background: var(--ink); border-color: var(--ink); color: #fff; }
.tchip[data-state="in"] .ic-check { display: block; }
.tchip[data-state="out"] { background: var(--pink); border-color: var(--pink); color: var(--pink-ink); }
.tchip[data-state="out"] .ic-x { display: block; }
.tchip[data-state="out"] .tchip-text { text-decoration: line-through; text-decoration-thickness: 1.5px; }
/* 전체 선택: 3상태 칩과 구분되는 점선 버튼 */
.tchip-all { border-style: dashed; color: var(--ink-2); }
.tchip-all:hover { color: var(--ink); }
.f-note { margin-left: 6px; color: var(--ink-3); font-size: 12px; font-weight: 600; }

.ing-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

/* 태그 입력 */
.tagbox {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px;
  min-height: 46px; padding: 6px 8px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm);
  background: var(--surface);
}
.tagbox:focus-within { border-color: var(--ink); }
.tagbox input {
  flex: 1; min-width: 90px; height: 32px; padding: 0 6px;
  border: 0; outline: 0; background: transparent;
}
.tagbox input::placeholder { color: var(--ink-3); }
.ttag {
  display: inline-flex; align-items: center; gap: 2px;
  height: 30px; padding: 0 6px 0 12px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 700;
}
.ttag-req { background: var(--mint); color: var(--mint-ink); }
.ttag-exc { background: var(--pink); color: var(--pink-ink); }
.ttag button {
  display: grid; place-items: center; width: 22px; height: 22px;
  border: 0; border-radius: 50%; background: transparent; color: inherit;
}
.ttag button:hover { background: rgba(0, 0, 0, .06); }

/* 단일 선택 세그먼트 */
.conds { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 20px; }
.seg {
  display: flex; flex-wrap: wrap; gap: 4px;
  padding: 4px; border-radius: var(--r-pill);
  background: #F7F1E6;
  margin: 0; border: 0; min-width: 0;
}
.seg legend { padding: 0; }
.seg label { position: relative; flex: 1 1 auto; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg span {
  display: grid; place-items: center;
  height: 34px; padding: 0 10px; border-radius: var(--r-pill);
  font-size: 14px; font-weight: 600; color: var(--ink-2); white-space: nowrap;
  cursor: pointer;
}
.seg span:hover { color: var(--ink); }
.seg input:checked + span { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(58, 47, 41, .14); font-weight: 700; }
.seg input:focus-visible + span { outline: 2px solid var(--ink); outline-offset: 1px; }
/* 조리 시간 복수 선택: 네 구간이 반 칸 폭에 한 줄로 안 들어가 2×2로 고정한다 */
.seg-multi { display: grid; grid-template-columns: 1fr 1fr; border-radius: 21px; }

.f-actions { display: flex; align-items: center; gap: 16px; margin-top: 24px; }
.f-actions .btn-primary { min-width: 160px; }
.urgent-line { padding: 8px 14px; border-radius: var(--r-pill); background: #F9F4EA; }
.urgent-line:has(input:checked) { background: var(--pink); color: var(--pink-ink); }
.check-line.urgent-line input { accent-color: var(--pink-ink); }
/* display를 정하지 않는다: hidden 속성이 그대로 먹게 둔다 */
.mode-hint { margin-top: 12px; padding: 10px 14px; border-radius: var(--r-sm); background: #F9F4EA; color: var(--ink-2); font-size: 13px; }
.mode-hint span { display: block; }
.mode-hint span + span { margin-top: 2px; }
/* 출시 후(2차) 기능 시안 표시. 승인 대기 태그와 겹치지 않게 회색 점선 */
.phase-tag {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; margin-right: 6px; vertical-align: 1px;
  border: 1px dashed var(--ink-3); border-radius: var(--r-pill);
  color: var(--ink-3); font-size: 11px; font-weight: 700; font-style: normal;
}

/* ---------- 홈: 오른쪽 패널 ---------- */

.side { display: flex; flex-direction: column; gap: 16px; }
.side .card { padding: 20px; }
.side-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.side-title { font-size: 16px; font-weight: 800; }
.side-count { margin-left: 4px; color: var(--pink-ink); font-weight: 800; }

.urgent-list li {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 9px 0; border-top: 1px solid #F5EEE1;
}
.urgent-list li:first-child { border-top: 0; }
.urgent-name { font-weight: 600; }
.urgent-qty { color: var(--ink-3); font-size: 13px; margin-left: 4px; font-weight: 500; }

.side-links { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.side-links a { font-size: 14px; font-weight: 700; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.side-links a:hover { text-decoration: underline; }

.fridge-box + .fridge-box { margin-top: 14px; padding-top: 14px; border-top: 1px solid #F5EEE1; }
.fridge-box-head { display: flex; align-items: center; gap: 6px; font-weight: 700; font-size: 14px; margin-bottom: 8px; }
.fridge-box-head .num { margin-left: auto; color: var(--ink-3); font-weight: 700; }
.box-more { margin-left: 8px; color: var(--ink-2); font-size: 13px; font-weight: 600; text-underline-offset: 3px; text-decoration-color: var(--line-2); }
.box-more:hover { color: var(--ink); text-decoration-color: currentColor; }
.fridge-box .chips { gap: 6px; }

/* 메뉴추천 모달: 임박 재료를 많이 쓰는 순 */
.reco-list { margin-top: 14px; }
.reco-list li { display: flex; flex-direction: column; gap: 8px; padding: 14px 16px; border-radius: var(--r-sm); background: #F9F4EA; }
.reco-list li + li { margin-top: 8px; }
.reco-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.reco-name { font-size: 17px; font-weight: 800; text-decoration: none; }
.reco-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.reco-count { flex: none; color: var(--pink-ink); font-size: 13px; font-weight: 800; }
.reco-meta { color: var(--ink-2); font-size: 14px; }
.reco-meta .miss { color: var(--pink-ink); font-weight: 700; }

/* ---------- 홈: 추천 카드 ---------- */

.rgrid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }

/* 식사 추천 슬라이드: 한 화면에 3장, 최대 5장을 가로로 넘긴다 */
.slider { position: relative; }
.rslider {
  display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 32px) / 3); gap: 16px;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  /* 그림자 자리로 둔 여백만큼 스냅 기준도 안쪽으로. 없으면 첫 위치가 0이 아니라 4px로 맞춰진다 */
  padding: 4px 4px 12px; margin: -4px -4px -12px; scroll-padding-inline: 4px;
  scrollbar-width: thin;
}
.rslider > * { scroll-snap-align: start; }
.rslider:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; border-radius: var(--r-card); }
.rslider.is-empty { display: block; }
.slider-btn {
  position: absolute; top: 50%; z-index: 2; transform: translateY(-50%);
  display: none; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line); border-radius: 50%;
  background: var(--surface); color: var(--ink); box-shadow: var(--shadow-pop);
}
.slider-prev { left: -20px; }
.slider-next { right: -20px; }
.has-overflow .slider-btn { display: grid; }
.slider-btn:disabled { opacity: 0; pointer-events: none; }

.rcard {
  position: relative;
  display: flex; flex-direction: column;
  padding: 0; overflow: visible;
}
.rcard-link { display: flex; flex-direction: column; flex: 1; text-decoration: none; color: inherit; border-radius: var(--r-card); }
.rcard-thumb {
  display: grid; place-items: center;
  height: 120px; border-radius: var(--r-card) var(--r-card) 0 0;
  color: var(--ink);
}
.tone-ready { background: var(--mint); }
.tone-oneMore { background: var(--butter); }
.tone-world { background: var(--pink); }
.rcard-thumb .ic { opacity: .75; }
.rcard-body { display: flex; flex-direction: column; gap: 8px; padding: 16px 18px 18px; flex: 1; }
.tier { font-size: 13px; font-weight: 800; }
.tier-ready { color: var(--mint-ink); }
.tier-oneMore { color: var(--butter-ink); }
.tier-world { color: var(--pink-ink); }
.rcard-name { font-size: 18px; font-weight: 800; letter-spacing: -0.03em; }
.rcard-link:hover .rcard-name { text-decoration: underline; text-underline-offset: 3px; }
.rcard-meta { color: var(--ink-2); font-size: 14px; }
.rcard-meta .miss { color: var(--pink-ink); font-weight: 700; }
.rcard-meta .carb { color: var(--mint-ink); font-weight: 700; }
.drink-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 16px; }
.rcard-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.rcard-filter {
  margin-top: auto; padding-top: 10px; border-top: 1px dashed var(--line-2);
  color: var(--ink-3); font-size: 12px;
}

.empty {
  padding: 28px; text-align: center; color: var(--ink-2);
  background: var(--surface); border-radius: var(--r-card); border: 1px dashed var(--line-2);
}
.empty strong { display: block; color: var(--ink); margin-bottom: 4px; }

.more-list { margin-top: 16px; }
.more-list li {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; background: var(--surface); border-radius: var(--r-sm);
}
.more-list li + li { margin-top: 8px; }
.more-list a { font-weight: 700; text-decoration: none; }
.more-list a:hover { text-decoration: underline; }
.more-list .meta { color: var(--ink-3); font-size: 13px; margin-left: auto; text-align: right; }

/* 소스 팝오버 (감바스 카드) */
/* 메뉴 사진을 뺐으므로 겹칠 자리가 없다. 카드 아래쪽 흐름에 붙여 등급 라벨과 요리 이름을 가리지 않는다 */
.popover {
  position: relative;
  margin: 0 12px 12px;
  padding: 10px 12px; border-radius: var(--r-sm);
  background: var(--surface); box-shadow: var(--shadow-pop);
  border: 1px solid var(--line);
}
.popover p { font-weight: 700; font-size: 13px; padding-right: 24px; line-height: 1.4; }
.pop-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; }
.pop-row { flex-wrap: wrap; }
.popover .chips { gap: 4px; flex-wrap: wrap; min-width: 0; }
.popover .chip-sm { height: 24px; padding: 0 7px; font-size: 12px; flex: none; }
.popover .btn { flex: none; height: 30px; padding: 0 10px; font-size: 13px; }
.popover .icon-btn { position: absolute; top: 2px; right: 2px; width: 32px; height: 32px; }

/* ---------- 나의 키친 ---------- */

.page-head { margin-top: 32px; }
.page-title { font-size: 28px; font-weight: 800; letter-spacing: -0.04em; }
.page-sub { margin-top: 4px; color: var(--ink-2); }
.page-sub b { color: var(--ink); }
.page-sub .warn { color: var(--pink-ink); }

.quick { margin-top: 20px; padding: 20px; }
.quick-form { display: flex; gap: 8px; }
.quick-input {
  flex: 1; min-width: 0; height: 50px; padding: 0 18px;
  border: 1px solid var(--line-2); border-radius: var(--r-pill);
  background: var(--surface); outline: 0; font-size: 16px;
}
.quick-input:focus { border-color: var(--ink); }
.quick-input::placeholder { color: var(--ink-3); }
.quick-form .btn { height: 50px; }
.quick-help { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 10px; }
.quick-msg { color: var(--ink-3); font-size: 14px; }
.quick-msg.is-ok { color: var(--mint-ink); font-weight: 700; }
.quick-msg.is-ai { color: var(--butter-ink); font-weight: 700; }

.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.tile {
  display: flex; align-items: center; gap: 14px;
  min-height: 86px; padding: 16px 18px;
  border: 2px solid transparent; border-radius: var(--r-card);
  background: var(--surface); box-shadow: var(--shadow);
  text-align: left;
}
.tile:hover { border-color: var(--line-2); }
.tile[aria-expanded="true"] { border-color: var(--ink); }
.tile-icon {
  display: grid; place-items: center; flex: none;
  width: 48px; height: 48px; border-radius: 14px;
}
.tile-icon.tone-pink { background: var(--pink); }
.tile-icon.tone-butter { background: var(--butter); }
.tile-icon.tone-mint { background: var(--mint); }
.tile-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.tile-name { font-weight: 700; }
.tile-count { font-size: 22px; font-weight: 800; line-height: 1.1; font-variant-numeric: tabular-nums; }
.tile-count small { font-size: 14px; font-weight: 600; color: var(--ink-3); margin-left: 2px; }
.tile-warn { font-size: 12px; font-weight: 700; color: var(--pink-ink); }

.tile.is-flash { animation: flash 1.2s ease-out 2; }
@keyframes flash {
  0% { box-shadow: 0 0 0 0 rgba(255, 199, 77, .9); background: var(--butter); }
  100% { box-shadow: 0 0 0 14px rgba(255, 199, 77, 0); background: var(--surface); }
}

.cat-panel {
  margin-top: 12px; padding: 20px; scroll-margin-top: 88px;
  background: var(--butter); border-radius: var(--r-card);
}
.cat-panel-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.cat-panel-title { font-weight: 800; font-size: 17px; }
.cat-panel-name { display: flex; align-items: center; gap: 10px; }

/* 페이지 소개 줄의 개수 버튼: 누르면 아래 패널에 모아 보여 준다 */
.sub-link {
  border: 0; background: none; padding: 0;
  font: inherit; font-weight: 700; color: var(--ink);
  text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-2);
}
.sub-link:hover { text-decoration-color: currentColor; }
.sub-link.warn { color: var(--pink-ink); }
.sub-link[aria-pressed="true"] { text-decoration-color: currentColor; text-decoration-thickness: 2px; }

/* 소비기한 입력: 날짜, 미리보기 뱃지, AI 기본값 되돌리기 */
.exp-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; }
.exp-input {
  height: 40px; padding: 0 12px;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface);
  font-weight: 600;
}
.exp-input:focus { border-color: var(--ink); outline: 0; }

/* 사전에 없는 재료 확인 */
.confirm-msg { font-size: 17px; font-weight: 800; }
.confirm-name {
  display: inline-flex; align-items: center; height: 32px; margin: 12px 0 4px; padding: 0 14px;
  border-radius: var(--r-pill); background: var(--butter); font-weight: 700;
}

.tabs { display: flex; gap: 4px; padding: 4px; border-radius: var(--r-pill); background: rgba(255, 255, 255, .55); }
.tab {
  height: 32px; padding: 0 14px; border: 0; border-radius: var(--r-pill);
  background: transparent; font-weight: 600; font-size: 14px; color: var(--ink-2);
}
.tab[aria-selected="true"] { background: var(--surface); color: var(--ink); font-weight: 700; box-shadow: 0 1px 3px rgba(58, 47, 41, .12); }

.items { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  min-height: 52px; padding: 10px 14px;
  border: 0; border-radius: var(--r-sm); background: var(--surface);
  text-align: left;
}
.item:hover { box-shadow: inset 0 0 0 1px var(--line-2); }
.item-name { font-weight: 700; }
.item-qty { color: var(--ink-3); font-size: 13px; margin-left: 4px; font-weight: 500; }
.item-store { color: var(--ink-3); font-size: 12px; display: block; font-weight: 500; }
.item.is-new { animation: flash 1.2s ease-out 2; }

.recent { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 10px; }
.recent a {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  padding: 14px 8px; text-align: center; text-decoration: none;
  background: var(--surface); border-radius: var(--r-card); box-shadow: var(--shadow);
}
.recent a:hover .recent-name { text-decoration: underline; }
.recent-thumb { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; }
.recent-name { font-weight: 700; font-size: 14px; line-height: 1.3; }
.recent-when { color: var(--ink-3); font-size: 12px; }

.country {
  position: relative;
  display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 24px;
  padding: 28px 60px 28px 28px; border-radius: var(--r-hero); background: var(--mint);
}
.country-msg { font-size: 22px; font-weight: 800; letter-spacing: -0.03em; line-height: 1.35; padding-right: 24px; }
.country-dishes { margin-top: 14px; }
.country-others { margin-top: 20px; }
.country-others .f-label { color: var(--ink-2); font-weight: 600; }
.cchip {
  height: 32px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid rgba(58, 47, 41, .18); background: rgba(255, 255, 255, .6);
  font-size: 14px; font-weight: 600;
}
.cchip[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.sauce-card { padding: 20px; display: flex; flex-direction: column; gap: 10px; }
.sauce-card .jar {
  display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--butter);
}
.sauce-name { font-size: 18px; font-weight: 800; }
.sauce-desc { color: var(--ink-2); font-size: 14px; }
.country .close { position: absolute; top: 12px; right: 12px; }

/* ---------- 재료 피커 (3탭) ---------- */

.steps-ind { display: flex; gap: 6px; margin-bottom: 16px; }
.steps-ind li {
  flex: 1; display: flex; flex-direction: column; gap: 6px;
  font-size: 12px; font-weight: 700; color: var(--ink-3);
}
.steps-ind li::before { content: ''; height: 4px; border-radius: 2px; background: var(--line); }
.steps-ind li.is-done::before, .steps-ind li.is-current::before { background: var(--ink); }
.steps-ind li.is-current { color: var(--ink); }

.pick-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.pick-cat {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 8px; border: 1px solid var(--line); border-radius: var(--r-sm);
  background: var(--surface); font-weight: 700; font-size: 14px;
}
.pick-cat:hover { border-color: var(--ink); }

.pick-sub + .pick-sub { margin-top: 14px; }
.pick-sub h3 { font-size: 13px; color: var(--ink-3); font-weight: 700; margin-bottom: 8px; }
.pick-ing {
  height: 36px; padding: 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); background: var(--surface); font-weight: 600;
}
.pick-ing:hover { border-color: var(--ink); }
.pick-ing.is-owned::after { content: ' · 보유'; color: var(--mint-ink); font-size: 12px; }

.pick-summary { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: var(--r-sm); background: #F9F4EA; }
.pick-summary .tile-icon { width: 44px; height: 44px; }
.pick-summary b { display: block; font-size: 17px; }
.pick-summary span { color: var(--ink-3); font-size: 13px; }

.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  display: grid; place-items: center; width: 40px; height: 40px;
  border: 1px solid var(--line-2); border-radius: 50%; background: var(--surface);
}
.stepper input {
  width: 80px; height: 40px; text-align: center;
  border: 1px solid var(--line-2); border-radius: var(--r-sm); background: var(--surface);
  font-weight: 700; font-size: 16px;
}
.stepper .unit { color: var(--ink-2); font-weight: 600; }

.form-row + .form-row { margin-top: 18px; }
.modal-actions { display: flex; gap: 8px; margin-top: 24px; }
.modal-actions .btn { flex: 1; }
.back-btn {
  display: inline-flex; align-items: center; gap: 4px;
  border: 0; background: none; padding: 4px 0; margin-bottom: 10px;
  color: var(--ink-2); font-weight: 600; font-size: 14px;
}

/* ---------- 레시피 상세 ---------- */

.back-link { display: inline-flex; align-items: center; gap: 4px; margin-top: 24px; color: var(--ink-2); font-weight: 600; text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--ink); }

.r-hero {
  display: grid; grid-template-columns: 180px minmax(0, 1fr); gap: 28px; align-items: center;
  margin-top: 12px; padding: 28px; border-radius: var(--r-hero);
}
.r-hero.tone-ready { background: var(--mint); }
.r-hero.tone-oneMore { background: var(--butter); }
.r-hero.tone-world { background: var(--pink); }
.r-thumb {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: 50%;
  background: rgba(255, 255, 255, .65);
}
.r-title { font-size: 30px; font-weight: 800; letter-spacing: -0.04em; margin-top: 4px; }
.r-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.r-meta .chip-sm { background: rgba(255, 255, 255, .7); border-color: transparent; }
.r-filter { margin-top: 12px; color: var(--ink-2); font-size: 13px; }
.r-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.r-sauce { display: flex; align-items: center; gap: 16px; padding: 20px; }
.r-sauce .jar { display: grid; place-items: center; width: 56px; height: 56px; border-radius: 16px; background: var(--butter); flex: none; }
.r-sauce-text { flex: 1; min-width: 0; }
.r-sauce-text b { display: block; font-size: 17px; }
.r-sauce-text span { color: var(--ink-2); font-size: 14px; }
.r-sauce .is-owned { color: var(--mint-ink); font-weight: 800; display: inline-flex; align-items: center; gap: 4px; }

.r-cols { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 24px; align-items: start; }
.r-box { padding: 22px; }
.r-box-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 14px; }
.r-box-title { font-size: 17px; font-weight: 800; }

.ing-list li {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 0; border-top: 1px solid #F5EEE1;
}
.ing-list li:first-child { border-top: 0; }
.ing-name { font-weight: 700; }
.ing-amt { margin-left: auto; font-weight: 700; font-variant-numeric: tabular-nums; text-align: right; }
.ing-amt small { display: block; font-size: 11px; font-weight: 700; }
.method-table { color: var(--mint-ink); }
.method-broth { color: var(--butter-ink); }
.ing-note { margin-top: 14px; padding: 12px 14px; border-radius: var(--r-sm); background: #F9F4EA; color: var(--ink-2); font-size: 13px; }
.ing-note p + p { margin-top: 4px; }

.step-list { counter-reset: step; }
.step-list li {
  display: flex; gap: 14px; padding: 12px 0; border-top: 1px solid #F5EEE1;
}
.step-list li:first-child { border-top: 0; padding-top: 0; }
.step-list li::before {
  counter-increment: step; content: counter(step);
  display: grid; place-items: center; flex: none;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--ink); color: #fff; font-weight: 800; font-size: 14px;
}

.set-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.set-card { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; padding: 18px; }
.set-card b { font-size: 16px; margin-top: 4px; }
.set-card .set-desc { color: var(--ink-2); font-size: 14px; flex: 1; }
.set-card .btn, .set-card .tag { margin-top: 8px; }
.set-card .btn { align-self: stretch; }

/* ---------- 푸터 ---------- */

.site-footer { border-top: 1px solid var(--line); padding: 20px 0 32px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.disclosure { color: var(--ink-3); font-size: 13px; }
.footer-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; }

/* 관리자 쪽지함 (데모): 재료명별로 묶는다 */
.note-list { margin-top: 14px; }
.note-item { padding: 12px 14px; border-radius: var(--r-sm); background: #F9F4EA; }
.note-item + .note-item { margin-top: 8px; }
.note-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.note-count { color: var(--butter-ink); font-size: 13px; font-weight: 800; }
.note-meta { margin-top: 4px; color: var(--ink-3); font-size: 13px; }

/* ---------- 토스트 ---------- */

.toast {
  position: fixed; left: 50%; bottom: 28px; z-index: 60;
  max-width: calc(100% - 32px);
  padding: 12px 20px; border-radius: var(--r-pill);
  background: var(--ink); color: #fff; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-pop);
  transform: translate(-50%, 16px); opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: var(--butter); font-weight: 800; }

/* ---------- 모달 ---------- */

.modal-wrap { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; padding: 16px; }
.modal-dim { position: absolute; inset: 0; background: rgba(58, 47, 41, .42); }
.modal {
  position: relative; width: 100%; max-width: 480px; max-height: calc(100vh - 32px); overflow: auto;
  background: var(--surface); border-radius: 20px; box-shadow: var(--shadow-pop);
}
.modal-head {
  position: sticky; top: 0; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 16px 8px 24px; background: var(--surface);
}
.modal-head h2 { font-size: 18px; font-weight: 800; }
.modal-body { padding: 8px 24px 24px; }

/* ---------- 레시피 목록·마이·상세 공통: 부족 톤, 저장, 별점 ---------- */

/* 부족 재료 2개 이상. 홈 추천에는 나오지 않고 목록·상세·마이에서만 보인다 */
.tone-lack, .r-hero.tone-lack { background: var(--lack); }
.tier-lack { color: var(--ink-2); }
.rcard-thumb-sm { height: 100px; }

.save-btn {
  position: absolute; top: 10px; right: 10px;
  display: grid; place-items: center;
  width: 40px; height: 40px; border-radius: 50%;
  border: 0; background: rgba(255, 255, 255, .92); color: var(--ink-2);
  box-shadow: 0 1px 4px rgba(58, 47, 41, .14);
}
.save-btn:hover { color: var(--pink-ink); }
[data-save][aria-pressed="true"] .ic { color: var(--pink-ink); fill: currentColor; }

.tag-star { background: var(--butter); color: var(--butter-ink); }
.tag-star .ic { fill: currentColor; }

.rate { display: inline-flex; align-items: center; gap: 6px; flex: none; }
.stars { display: inline-flex; }
.star {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 8px;
  color: var(--ink-3); cursor: pointer;
}
.star .ic { transition: transform .1s; }
.star:hover .ic { transform: scale(1.12); }
.star.is-on { color: var(--star); }
.star.is-on .ic { fill: currentColor; }
.star:has(input:focus-visible) { outline: 2px solid var(--ink); outline-offset: -2px; }
.rate-num { min-width: 62px; color: var(--ink-2); font-size: 13px; font-weight: 700; }

.r-rate { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; margin-top: 14px; }
.r-rate-label { font-weight: 700; font-size: 14px; }

/* ---------- 레시피 목록 ---------- */

.list-tools { display: flex; flex-direction: column; gap: 14px; margin-top: 22px; padding: 18px 20px; }
.list-bar {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 14px; border-top: 1px solid var(--line);
}
.check-line { display: inline-flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.check-line input { width: 18px; height: 18px; margin: 0; accent-color: var(--ink); }
.check-line .ic { color: var(--pink-ink); }
.select-line { display: inline-flex; align-items: center; gap: 8px; color: var(--ink-2); font-size: 14px; font-weight: 600; }
.select-line select {
  height: 38px; padding: 0 36px 0 14px; border-radius: var(--r-pill);
  border: 1px solid var(--line-2); color: var(--ink); font-weight: 700;
  appearance: none; -webkit-appearance: none;
  background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233A2F29' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9.5 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center / 14px;
}
.list-count { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 10px; margin: 22px 0 12px; color: var(--ink-2); font-size: 14px; }
.list-count b { color: var(--ink); }
.empty-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: 14px; }

/* ---------- 마이 ---------- */

.profile { display: flex; align-items: center; gap: 18px; margin-top: 32px; padding: 24px; }
.avatar { display: grid; place-items: center; flex: none; width: 64px; height: 64px; border-radius: 50%; background: var(--butter); }
.profile-text { flex: 1; min-width: 0; }
.profile .page-sub { font-size: 14px; }

.stats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 16px; }
.stat {
  display: grid; grid-template-columns: auto minmax(0, 1fr); column-gap: 12px; align-items: center;
  padding: 16px 18px; text-decoration: none;
}
.stat-icon { grid-row: span 2; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 12px; background: var(--bg); }
.stat-num { font-size: 22px; font-weight: 800; line-height: 1.15; font-variant-numeric: tabular-nums; }
.stat-label { color: var(--ink-2); font-size: 13px; }
.stat:hover .stat-label { color: var(--ink); text-decoration: underline; }

.cooked-list { padding: 4px 20px; }
.cooked-list li { display: flex; align-items: center; gap: 14px; padding: 12px 0; border-top: 1px solid #F5EEE1; }
.cooked-list li:first-child { border-top: 0; }
.cooked-list .recent-thumb { flex: none; width: 44px; height: 44px; }
.cooked-text { display: flex; flex-direction: column; flex: 1; min-width: 0; }
.cooked-text a { font-weight: 700; text-decoration: none; }
.cooked-text a:hover { text-decoration: underline; }
.cooked-text span { color: var(--ink-3); font-size: 13px; }

.prefs { display: grid; grid-template-columns: 1fr 1fr; column-gap: 32px; margin: 0; padding: 6px 20px; }
.prefs div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-top: 1px solid #F5EEE1; }
.prefs div:nth-child(-n+2) { border-top: 0; }
.prefs dt { flex: none; color: var(--ink-2); font-size: 14px; }
.prefs dd { margin: 0; font-weight: 700; text-align: right; }

.soon-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.soon-list li { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 14px; align-items: start; padding: 18px; }
.soon-list b { display: block; }
.soon-list li > div span { display: block; color: var(--ink-2); font-size: 13px; }
.soon-list .tag { grid-column: 2; justify-self: start; }

/* ---------- 반응형 ---------- */

@media (max-width: 900px) {
  .home-grid { grid-template-columns: 1fr; }
  .side { display: grid; grid-template-columns: 1fr 1fr; }
  .rgrid { grid-template-columns: 1fr 1fr; }
  .rslider { grid-auto-columns: calc((100% - 16px) / 2); }
  .tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .items { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .recent { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .country { grid-template-columns: 1fr; }
  .r-cols { grid-template-columns: 1fr; }
  .header-inner { gap: 16px; }
  .soon-list { grid-template-columns: 1fr; }
}

@media (max-width: 640px) {
  .container { padding: 0 16px; }
  .header-inner { flex-wrap: wrap; height: auto; padding: 10px 0; gap: 8px 12px; }
  .brand { order: 1; }
  .header-actions { order: 2; margin-left: auto; }
  .gnb { order: 3; width: 100%; overflow-x: auto; }
  .search { order: 4; flex-basis: 100%; }
  .hero { padding: 22px 16px; }
  .hero h1 { font-size: 26px; }
  .filter-card { padding: 18px 16px; }
  .ing-grid, .conds { grid-template-columns: 1fr; }
  .side { grid-template-columns: 1fr; }
  .rgrid { grid-template-columns: 1fr; }
  /* 다음 카드가 살짝 보이게 해서 넘길 수 있다는 걸 알린다. 화살표 대신 손가락으로 넘긴다 */
  .rslider { grid-auto-columns: calc(100% - 48px); gap: 12px; }
  .has-overflow .slider-btn { display: none; }
  .f-actions { flex-wrap: wrap; }
  .f-actions .btn-primary { flex: 1; }
  .r-hero { grid-template-columns: 1fr; padding: 22px 16px; }
  .r-thumb { width: 120px; }
  .r-title { font-size: 24px; }
  .set-grid { grid-template-columns: 1fr; }
  .country { padding: 52px 16px 22px; }
  .country-msg { font-size: 19px; }
  .quick-form { flex-wrap: wrap; }
  .quick-form input { flex: 1 1 100%; }
  .quick-form .btn { flex: 1 1 100%; }
  .quick-help { flex-direction: column; align-items: flex-start; }

  .modal-wrap { place-items: end center; padding: 0; }
  .modal { max-width: none; border-radius: 20px 20px 0 0; max-height: 88vh; }

  .list-tools { padding: 16px; }
  .profile { flex-wrap: wrap; padding: 20px 16px; }
  .profile .btn { width: 100%; }
  .stats { grid-template-columns: 1fr 1fr; }
  .prefs { grid-template-columns: 1fr; padding: 4px 16px; }
  .prefs div:nth-child(2) { border-top: 1px solid #F5EEE1; }
  .cooked-list { padding: 4px 16px; }
}

@media (max-width: 560px) {
  .tiles { grid-template-columns: 1fr; }
  .tile { min-height: 72px; }
  .items { grid-template-columns: 1fr; }
  .recent { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .pick-cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  /* 별점 위젯은 이름 아래 줄로 내리고 썸네일 폭만큼 들여 쓴다 */
  .cooked-list li { flex-wrap: wrap; row-gap: 4px; }
  .cooked-list .rate { width: 100%; padding-left: 58px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
