/* Repigram — 따뜻한 베이지 바탕, 진초록·올리브·크림·크림슨 / 모바일 우선, 큼직하고 귀엽게 */
:root {
  color-scheme: light;  /* 휴대폰이 다크 모드여도 항상 밝은 베이지 */
  --bg: #fbf5ea;            /* 따뜻한 베이지 (밝게) */
  --bg-soft: #f4ebdb;
  --surface: #fffdf9;       /* 카드: 크림 화이트 */
  --cream: #fdf8ef;
  --text: #2e2a22;
  --text-2: #5a5346;
  --muted: #8a8172;
  --primary: #4f613b;       /* 진초록 */
  --primary-press: #3f4f2e;
  --primary-soft: #e4e8d3;
  --olive: #9a9c53;
  --olive-ink: #6b6d33;
  --olive-soft: #eeeed6;
  --accent: #d3163b;        /* 크림슨 */
  --accent-soft: #fbe2e6;
  --danger: #c0142f;
  --border: #ece1cd;
  --thumb: #f5ecdd;
  --shadow: 0 6px 22px rgba(79, 60, 30, 0.08);
  --shadow-lg: 0 14px 38px rgba(79, 60, 30, 0.14);
  --radius: 24px;
  --tabbar: 76px;
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Pretendard Variable", Pretendard, "Noto Sans KR", system-ui, sans-serif;
  font-size: 17px;
  background: var(--bg);
  color: var(--text);
  line-height: 1.65;
  letter-spacing: -0.01em;
  padding-bottom: env(safe-area-inset-bottom);
}
a { color: inherit; text-decoration: none; }
p a, .hint a, .consent a, .notice a, .empty a { color: var(--primary); font-weight: 700; }
img { display: block; max-width: 100%; }
code { background: var(--bg-soft); padding: 2px 6px; border-radius: 6px; }
.container { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--muted); }
:focus-visible { outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent); outline-offset: 2px; }

/* ---------- 헤더 ---------- */
.site-header {
  position: sticky; top: 0; z-index: 10;
  background: color-mix(in srgb, var(--bg) 90%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding-top: env(safe-area-inset-top);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.logo { display: flex; align-items: center; gap: 8px; font-size: 1.45rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.logo .mascot { width: 44px; height: 44px; object-fit: contain; }
.logo em { font-style: normal; color: var(--accent); }
/* 마스코트: 흰 배경을 베이지에 섞고, 항상 살짝 위아래로 */
.logo .mascot, .hero-logo { mix-blend-mode: multiply; }
.logo .mascot { animation: bob-small 3s ease-in-out infinite; }
@keyframes bob-small { 50% { transform: translateY(-3px) rotate(-3deg); } }

/* 움직이는 워드마크: 바탕 위에 당근·달걀·국자 조각을 겹침 */
.wm { position: relative; display: inline-block; height: 34px; aspect-ratio: 921 / 240; flex-shrink: 0; }
.wm img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; }
.wm-carrot { transform-origin: 43.2% 75%; }
.wm-carrot.hop { animation: carrot-hop .7s cubic-bezier(.3, .7, .4, 1); }
.wm-carrot.hop2 { animation: carrot-hop .55s cubic-bezier(.3, .7, .4, 1) 2; }
@keyframes carrot-hop {
  0% { transform: translateY(0) scale(1, 1); }
  15% { transform: translateY(0) scale(1.08, .9); }
  45% { transform: translateY(-22%) scale(.95, 1.06) rotate(-6deg); }
  75% { transform: translateY(0) scale(1.06, .93); }
  100% { transform: translateY(0) scale(1, 1); }
}
.wm-egg { transform-origin: 33.4% 45.2%; animation: egg-sizzle 2.6s ease-in-out infinite; }
@keyframes egg-sizzle {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  25% { transform: translate(.5%, -1%) rotate(5deg); }
  50% { transform: translate(-.3%, .6%) rotate(-3deg); }
  75% { transform: translate(.2%, -.4%) rotate(3deg) scale(1.02); }
}
.wm-stick { transform-origin: 57.6% 23.4%; animation: stir 2.2s ease-in-out infinite alternate; }
@keyframes stir { from { transform: rotate(-14deg); } to { transform: rotate(10deg); } }
.hero-wordmark { display: block; height: clamp(56px, 16vw, 84px); margin: 12px auto 0; }
@media (prefers-reduced-motion: reduce) {
  .logo .mascot, .wm-egg, .wm-stick, .wm-carrot.hop, .wm-carrot.hop2 { animation: none; }
}
/* 유튜브·인스타그램 작은 로고 */
.inline-icon { display: inline-block; height: 1.05em; width: auto; vertical-align: -0.17em; margin-right: 4px; }
.btn-icon { height: 1.1em; width: auto; flex-shrink: 0; }
.src { display: inline-flex; align-items: center; margin-right: 10px; }
.src .inline-icon { height: 1em; }
.nav { display: flex; gap: 4px; }
.nav a { display: flex; align-items: center; gap: 4px; padding: 8px 14px; border-radius: 999px; color: var(--text-2); font-weight: 700; white-space: nowrap; }
.nav a.active, .nav a:hover { background: var(--primary-soft); color: var(--primary); }
.signed-out .nav { display: none; }

/* ---------- 휴대폰: 앱처럼 하단 탭 바 (5칸, 가운데 추가 버튼 강조) ---------- */
@media (max-width: 720px) {
  .site-header { backdrop-filter: none; background: var(--bg); }  /* blur가 있으면 고정 탭 바가 헤더에 갇힘 */
  .header-inner { justify-content: center; height: 60px; }
  .nav {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
    display: grid; grid-template-columns: repeat(5, 1fr); gap: 0;
    padding: 6px 6px calc(6px + env(safe-area-inset-bottom));
    background: color-mix(in srgb, var(--surface) 96%, transparent);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 20px rgba(79, 60, 30, 0.07);
  }
  .nav a {
    flex-direction: column; justify-content: center; gap: 2px;
    min-height: 58px; padding: 4px 2px; border-radius: 16px; font-size: .74rem;
  }
  .nav a:hover, .nav a.active { background: transparent; }
  .nav a.active { color: var(--primary); }
  .nav-icon { font-size: 1.4rem; line-height: 1; filter: grayscale(1); opacity: .5; }
  .nav a.active .nav-icon { filter: none; opacity: 1; }
  .nav a.nav-add .nav-icon {
    display: grid; place-items: center; width: 46px; height: 46px; margin-top: -18px;
    border-radius: 50%; background: var(--primary); color: #fff; font-size: 1.7rem; font-weight: 700;
    filter: none; opacity: 1; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 40%, transparent);
    border: 4px solid var(--surface);
  }
  body:not(.signed-out) { padding-bottom: calc(var(--tabbar) + env(safe-area-inset-bottom)); }
  body:not(.signed-out) .toast { bottom: calc(var(--tabbar) + 14px + env(safe-area-inset-bottom)); }
}
@media (min-width: 721px) { .nav a.nav-add { background: var(--primary); color: #fff; } }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 10px 22px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text);
  font: inherit; font-weight: 700; white-space: nowrap; text-align: center;
  transition: transform .1s ease, background .15s ease, border-color .15s ease;
}
.btn:hover { border-color: var(--primary); }
.btn:active { transform: scale(0.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 6px 16px color-mix(in srgb, var(--primary) 28%, transparent); }
.btn.primary:hover { background: var(--primary-press); }
.btn.ai { background: var(--olive); border-color: var(--olive); color: #fff; }
.btn.google { background: var(--surface); border-color: var(--border); box-shadow: var(--shadow); }
.btn.danger { color: var(--danger); }
.btn.big { min-height: 58px; padding: 14px 32px; font-size: 1.1rem; }
.btn.small { min-height: 44px; padding: 8px 14px; font-size: .92rem; }
.btn.full { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; box-shadow: none; }
.icon-btn {
  display: grid; place-items: center; flex-shrink: 0; width: 44px; height: 44px;
  border: none; border-radius: 50%; background: transparent; color: var(--muted);
  font: inherit; font-size: 1.05rem; cursor: pointer;
}
.icon-btn:hover { background: var(--bg-soft); color: var(--text); }
.icon-btn.big { font-size: 1.8rem; background: var(--surface); box-shadow: var(--shadow); color: var(--primary); }
.link-btn { border: none; background: none; color: var(--primary); font: inherit; font-weight: 700; cursor: pointer; padding: 4px 8px; min-height: 44px; }

/* ---------- 첫 화면 / 로그인 ---------- */
.welcome { text-align: center; padding: 36px 0 64px; }
.hero-logo { width: 190px; height: 190px; margin: 0 auto 6px; object-fit: contain; animation: bob 3s ease-in-out infinite; }
@keyframes bob { 50% { transform: translateY(-8px) rotate(-2deg); } }
@media (prefers-reduced-motion: reduce) { .hero-logo { animation: none; } }
.welcome-emoji { font-size: 56px; letter-spacing: 8px; }
.bubble {
  position: relative; display: inline-block; margin-bottom: 18px;
  padding: 8px 18px; border-radius: 12px; background: var(--accent); color: #fff;
  font-weight: 700; font-size: .95rem; box-shadow: 0 6px 14px color-mix(in srgb, var(--accent) 28%, transparent);
}
.bubble::after {
  content: ""; position: absolute; left: 50%; bottom: -7px; transform: translateX(-50%);
  border: 8px solid transparent; border-bottom: 0; border-top-color: var(--accent);
}
.welcome .eyebrow { margin: 0; color: var(--text-2); font-size: clamp(1.1rem, 3.5vw, 1.4rem); font-weight: 700; }
.welcome h1 { font-size: clamp(1.9rem, 7vw, 2.8rem); font-weight: 800; letter-spacing: -0.03em; line-height: 1.25; margin: 4px 0 18px; }
.welcome h2 { font-size: 1.3rem; margin: 8px 0; }
.welcome p { color: var(--muted); margin: 0 0 24px; }
.welcome-actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.small-welcome { padding: 32px 0; }
.features {
  list-style: none; padding: 0; margin: 0 auto 28px; max-width: 520px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px; text-align: left;
}
.features li {
  background: var(--surface); border-radius: 20px; padding: 16px 18px; box-shadow: var(--shadow);
  font-weight: 600; font-size: .95rem; line-height: 1.45;
}
.features li b { display: flex; align-items: center; height: 34px; margin-bottom: 4px; }
.brand-icon { height: 28px; width: auto; flex-shrink: 0; }
@media (max-width: 420px) { .features { gap: 10px; } .features li { padding: 14px; font-size: .88rem; } }
.consent { font-size: .88rem; margin-top: 18px !important; }

/* ---------- 링크 가져오기 상자 ---------- */
.import-box {
  display: flex; align-items: center; gap: 6px; margin: 20px auto 4px; max-width: 640px;
  padding: 6px 6px 6px 16px; border-radius: 999px; background: var(--surface);
  border: 2px solid var(--border); box-shadow: var(--shadow);
}
.import-box:focus-within { border-color: var(--primary); }
.import-icon { display: inline-flex; gap: 3px; }
.import-icon .inline-icon { height: 20px; margin: 0; }
.import-box input { flex: 1; min-width: 0; border: none; outline: none; background: none; color: var(--text); font: inherit; font-size: 16px; min-height: 44px; }
@media (max-width: 420px) { #paste-btn { display: none; } }
.share-banner { margin: 0 0 14px; padding: 14px 18px; border-radius: 18px; background: var(--primary-soft); color: var(--primary); font-weight: 600; }

/* ---------- 목록 ---------- */
.toolbar { display: flex; gap: 10px; padding: 14px 0 12px; }
#search {
  flex: 1; min-width: 0; min-height: 54px;
  padding: 12px 22px; font: inherit; font-size: 1.02rem;
  border: 2px solid var(--border); border-radius: 999px;
  background: var(--surface); color: var(--text); outline: none;
}
#search:focus { border-color: var(--primary); }
.chips, .day-scroll { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 8px; margin-bottom: 4px; scrollbar-width: none; }
.chips::-webkit-scrollbar, .day-scroll::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; min-height: 44px; padding: 8px 18px; border-radius: 999px; cursor: pointer;
  border: 1.5px solid var(--border); background: var(--surface); color: var(--text-2);
  font: inherit; font-size: .96rem; font-weight: 700;
}
.chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.count { color: var(--muted); font-size: .92rem; margin: 4px 0 14px; font-weight: 600; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 20px; padding-bottom: 40px; }
@media (max-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; } }
.grid-slot { grid-column: 1 / -1; }
.card {
  position: relative; background: var(--surface); border-radius: var(--radius);
  box-shadow: var(--shadow); overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-link { display: block; }
.card-thumb { aspect-ratio: 1 / 1; background: var(--thumb); display: grid; place-items: center; overflow: hidden; }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-emoji { font-size: 60px; }
.card-body { padding: 12px 14px 16px; }
.card-body h3 { margin: 8px 0 2px; font-size: 1.08rem; font-weight: 800; line-height: 1.35; overflow-wrap: anywhere; }
.tag {
  display: inline-block; padding: 3px 12px; border-radius: 999px;
  background: var(--primary-soft); color: var(--primary); font-size: .8rem; font-weight: 800;
}
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px; vertical-align: middle;
  background: var(--olive-soft); color: var(--olive-ink); font-size: .78rem; font-weight: 800;
}
.meta { color: var(--muted); font-size: .88rem; font-weight: 500; }
.sources { font-size: .8rem; }

.fav {
  border: none; background: var(--surface); color: var(--accent);
  width: 44px; height: 44px; border-radius: 50%; font-size: 1.25rem; cursor: pointer;
  box-shadow: var(--shadow); flex-shrink: 0;
}
.card .fav { position: absolute; top: 10px; right: 10px; }
.detail .fav { vertical-align: middle; margin-left: 6px; }

/* ---------- 상세 ---------- */
.back { display: inline-flex; align-items: center; min-height: 44px; margin: 12px 0 4px; color: var(--muted); font-weight: 600; }
.back:hover { color: var(--primary); }
.page-title { font-size: clamp(1.6rem, 5vw, 2.1rem); font-weight: 800; letter-spacing: -0.03em; margin: 24px 0 16px; }
.back + .page-title { margin-top: 0; }
.detail { background: var(--surface); border-radius: 28px; overflow: hidden; margin-bottom: 40px; box-shadow: var(--shadow); }
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: var(--thumb); }
.gallery img { flex: 0 0 100%; max-height: 480px; object-fit: contain; scroll-snap-align: center; }
.detail-head { padding: 26px 28px 0; }
.detail-head h1 { margin: 10px 0 4px; font-size: clamp(1.6rem, 5vw, 2.2rem); font-weight: 800; letter-spacing: -0.03em; overflow-wrap: anywhere; }
.detail h2 { font-size: 1.18rem; font-weight: 800; margin: 0 0 12px; color: var(--primary); }
.detail-actions-top { display: grid; gap: 10px; padding: 20px 28px 0; }
.action-pair { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.action-pair .btn { padding: 10px 8px; }
.sources-box { padding: 24px 28px 0; }
.video { position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: #000; margin-bottom: 12px; }
.video iframe, .video-poster, .video-poster img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-poster { padding: 0; cursor: pointer; background: #000; }
.video-poster img { object-fit: cover; opacity: .85; }
.play {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 68px; height: 68px; border-radius: 50%; display: grid; place-items: center;
  background: rgba(255, 255, 255, .92); color: var(--accent); font-size: 1.6rem; padding-left: 4px;
}
.source-links { display: flex; gap: 10px; flex-wrap: wrap; }
.source { display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 8px 18px 8px 12px; border: 1.5px solid var(--border); border-radius: 999px; font-weight: 700; }
.source .brand-icon { height: 22px; }
.source:hover { border-color: var(--primary); }
.detail-body { display: grid; grid-template-columns: 1fr 1.6fr; gap: 36px; padding: 26px 28px; }
.section-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 4px; }
.section-head h2 { margin: 0; }
.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 4px; border-radius: 999px; background: var(--bg-soft); }
.stepper button {
  width: 40px; height: 40px; border-radius: 50%; border: none; background: var(--surface);
  color: var(--primary); font: inherit; font-size: 1.3rem; font-weight: 800; cursor: pointer; box-shadow: var(--shadow);
}
.stepper button:disabled { opacity: .4; cursor: not-allowed; }
.stepper b { min-width: 58px; text-align: center; }
.ingredients { list-style: none; padding: 0; margin: 8px 0 0; }
.ingredients li { padding: 8px 0; border-bottom: 1.5px dashed var(--border); }
.ingredients label { cursor: pointer; display: flex; gap: 12px; align-items: center; min-height: 32px; }
.ingredients input, .sheet-list input, .shop-list input, .cook-ingredients input { width: 24px; height: 24px; accent-color: var(--primary); flex-shrink: 0; }
.ingredients input:checked + span { color: var(--muted); text-decoration: line-through; }
.steps { padding-left: 0; margin: 0; list-style: none; counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding: 4px 0 22px 50px; }
.steps li::before {
  content: counter(step); position: absolute; left: 0; top: 0;
  width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center;
  background: var(--primary); color: #fff; font-weight: 800; font-size: 1rem;
}
.time-chip {
  display: inline-flex; align-items: center; gap: 4px; margin-left: 4px; padding: 2px 10px; min-height: 30px;
  border: none; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  font: inherit; font-size: .82rem; font-weight: 800; cursor: pointer; vertical-align: middle;
}
.memo { margin: 0 28px; padding: 18px 22px; background: var(--olive-soft); border-radius: 20px; }
.memo h2 { color: var(--olive-ink); }
.memo p { margin: 0; white-space: pre-wrap; }
.notice { color: var(--muted); font-size: .86rem; margin: 10px 0 0; line-height: 1.55; }
.ai-notice { margin: 20px 28px 0; padding: 12px 16px; background: var(--olive-soft); border-radius: 14px; color: var(--text-2); }
.detail-actions { display: flex; gap: 10px; justify-content: flex-end; padding: 26px 28px; }

/* ---------- 폼 ---------- */
.form { display: grid; gap: 18px; padding-bottom: 40px; }
.panel { background: var(--surface); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); }
#app > .panel { margin-bottom: 16px; }
.panel h2 { font-size: 1.22rem; font-weight: 800; margin: 0 0 12px; }
.panel h3.sub { font-size: 1.06rem; font-weight: 800; margin: 22px 0 6px; }
.hint { color: var(--muted); font-size: .94rem; margin: 0 0 12px; }
.form label:not(.btn) { display: block; font-weight: 700; margin-bottom: 16px; }
.form small { color: var(--muted); font-weight: 500; }
.req { color: var(--accent); }
.form input:not([type=file]), .form textarea, .add-row input, .sheet-search {
  display: block; width: 100%; margin-top: 8px; min-height: 52px;
  padding: 12px 16px; font: inherit; font-size: 16px; font-weight: 500;
  border: 1.5px solid var(--border); border-radius: 16px;
  background: var(--cream); color: var(--text); outline: none; resize: vertical;
}
.form input:focus, .form textarea:focus, .add-row input:focus, .sheet-search:focus { border-color: var(--primary); background: var(--surface); }
.row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr 1fr; } .row label:first-child { grid-column: 1 / -1; } }
.photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)); gap: 10px; margin-bottom: 14px; }
.photo-grid:empty { display: none; }
.photo { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--thumb); }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photo button {
  position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%;
  border: none; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; font-size: .85rem;
}
.ai-box { margin-top: 22px; padding: 20px; border-radius: 20px; background: var(--olive-soft); }
.ai-box h3 { margin: 0 0 6px; font-size: 1.1rem; font-weight: 800; color: var(--olive-ink); }
.ai-box textarea { margin: 0 0 12px !important; background: var(--surface) !important; }
.ai-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.ai-actions .hint { margin: 0; font-size: .86rem; }
@media (max-width: 560px) { .ai-actions .btn { width: 100%; } }
#ai-status { font-weight: 700; color: var(--olive-ink); margin: 6px 0 0; }
#ai-status:empty { display: none; }
.form-actions { display: flex; justify-content: center; }
.form-actions .btn { width: 100%; max-width: 420px; }

/* ---------- 하단 시트 ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 60; }
.sheet-backdrop { position: absolute; inset: 0; background: rgba(30, 24, 14, .45); opacity: 0; transition: opacity .2s ease; }
.sheet {
  position: absolute; left: 0; right: 0; bottom: 0; max-height: 86vh; overflow-y: auto;
  margin: 0 auto; max-width: 640px; padding: 8px 20px calc(20px + env(safe-area-inset-bottom));
  background: var(--surface); border-radius: 28px 28px 0 0; box-shadow: var(--shadow-lg);
  transform: translateY(100%); transition: transform .22s ease;
}
.sheet-wrap.open .sheet-backdrop { opacity: 1; }
.sheet-wrap.open .sheet { transform: translateY(0); }
.sheet-handle { width: 44px; height: 5px; border-radius: 999px; background: var(--border); margin: 6px auto 14px; cursor: pointer; }
.sheet h2 { font-size: 1.25rem; font-weight: 800; margin: 0 0 6px; }
.sheet-list, .picker { list-style: none; margin: 8px 0 16px; padding: 0; }
.sheet-list li { border-bottom: 1px dashed var(--border); }
.sheet-list label { display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; }
.segmented { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; padding: 4px; margin: 10px 0 16px; border-radius: 16px; background: var(--bg-soft); }
.segmented button { min-height: 44px; border: none; border-radius: 12px; background: transparent; color: var(--text-2); font: inherit; font-weight: 700; cursor: pointer; }
.segmented button.active { background: var(--surface); color: var(--primary); box-shadow: var(--shadow); }
.picker li button {
  display: flex; align-items: center; gap: 12px; width: 100%; min-height: 60px; padding: 6px;
  border: none; border-radius: 16px; background: none; color: var(--text); font: inherit; font-weight: 700; text-align: left; cursor: pointer;
}
.picker li button:hover { background: var(--bg-soft); }
.picker-thumb { width: 48px; height: 48px; border-radius: 12px; overflow: hidden; background: var(--thumb); display: grid; place-items: center; flex-shrink: 0; }
.picker-thumb img { width: 100%; height: 100%; object-fit: cover; }
.picker-thumb .thumb-emoji { font-size: 24px; }

/* ---------- 장보기 ---------- */
.add-row { display: flex; gap: 8px; margin-bottom: 16px; }
.add-row input { margin-top: 0; flex: 1; min-width: 0; }
.shop-group { margin-bottom: 14px; padding: 18px 20px; }
.shop-group h2 { font-size: 1.05rem; color: var(--primary); margin-bottom: 6px; }
.shop-list { list-style: none; margin: 0; padding: 0; }
.shop-item { display: flex; align-items: center; gap: 6px; border-bottom: 1px dashed var(--border); }
.shop-item:last-child { border-bottom: none; }
.shop-item label { flex: 1; display: flex; align-items: center; gap: 12px; min-height: 52px; cursor: pointer; }
.shop-item.done span { color: var(--muted); text-decoration: line-through; }
.done-group { opacity: .8; }
.buy-links { display: flex; gap: 4px; }
.buy-chip { padding: 2px 8px; border-radius: 999px; border: 1.5px solid var(--brand); color: var(--brand); font-size: .74rem; font-weight: 800; }
.shop-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 6px 0 24px; }
.shop-actions .btn:first-child { grid-column: 1 / -1; }

/* ---------- 식단 ---------- */
.week-nav { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 16px; text-align: center; }
.week-nav b { font-size: 1.05rem; }
.week { display: grid; gap: 12px; margin-bottom: 18px; }
@media (min-width: 900px) { .week { grid-template-columns: repeat(7, 1fr); } }
.day { background: var(--surface); border-radius: 20px; padding: 12px 12px 12px 18px; box-shadow: var(--shadow); border: 2px solid transparent; }
.day.today { border-color: var(--olive); }
.day header { display: flex; align-items: center; justify-content: space-between; }
.today-dot { display: inline-block; margin-left: 4px; padding: 1px 8px; border-radius: 999px; background: var(--accent); color: #fff; font-size: .72rem; vertical-align: middle; }
.day-empty { display: none; }
.day:not(:has(.plan-list)) { padding-top: 4px; padding-bottom: 4px; box-shadow: none; background: color-mix(in srgb, var(--surface) 60%, transparent); }
.day:not(:has(.plan-list)) header b { font-weight: 600; color: var(--text-2); }
.week { gap: 8px; }
.plan-list { list-style: none; margin: 4px 0 0; padding: 0; }
.plan-list li { display: flex; align-items: center; gap: 8px; min-height: 48px; }
.plan-list a { flex: 1; font-weight: 700; overflow-wrap: anywhere; }
.meal-tag { flex-shrink: 0; padding: 2px 10px; border-radius: 999px; background: var(--olive-soft); color: var(--olive-ink); font-size: .78rem; font-weight: 800; }

/* ---------- 요리 모드 ---------- */
.cook-open { overflow: hidden; }
.cook {
  position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column;
  background: var(--bg); padding-top: env(safe-area-inset-top);
}
.cook-top { display: flex; align-items: center; gap: 10px; padding: 10px 14px; }
.cook-top strong { flex: 1; text-align: center; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cook-close { width: 48px; height: 48px; border: none; border-radius: 50%; background: var(--surface); color: var(--text); font-size: 1.2rem; cursor: pointer; box-shadow: var(--shadow); }
.cook-awake { width: 48px; text-align: center; font-size: 1.2rem; }
.cook-progress { height: 6px; margin: 0 16px; border-radius: 999px; background: var(--bg-soft); overflow: hidden; }
.cook-progress span { display: block; height: 100%; background: var(--primary); transition: width .25s ease; }
.cook-timer-slot { padding: 10px 16px 0; }
.cook-timer-slot:empty { display: none; }
.cook-timer {
  width: 100%; min-height: 56px; border: none; border-radius: 18px; background: var(--olive); color: #fff;
  font: inherit; font-size: 1.4rem; font-weight: 800; cursor: pointer; font-variant-numeric: tabular-nums;
}
.cook-timer small { font-size: .8rem; font-weight: 600; opacity: .85; margin-left: 6px; }
.cook-timer.ring { background: var(--accent); animation: ring .6s ease-in-out infinite alternate; }
@keyframes ring { to { transform: scale(1.02); } }
.cook-body { flex: 1; overflow-y: auto; padding: 24px 22px; max-width: 760px; width: 100%; margin: 0 auto; }
.cook-kicker { margin: 0 0 8px; color: var(--olive-ink); font-weight: 800; }
.cook-body h2 { font-size: 1.6rem; margin: 0 0 14px; }
.cook-step { font-size: clamp(1.5rem, 6vw, 2.2rem); font-weight: 700; line-height: 1.5; margin: 0 0 24px; letter-spacing: -0.02em; }
.cook-tools { display: grid; gap: 10px; }
.cook-ingredients { list-style: none; padding: 0; margin: 0; }
.cook-ingredients li { border-bottom: 1px dashed var(--border); }
.cook-ingredients label { display: flex; align-items: center; gap: 14px; min-height: 56px; font-size: 1.2rem; cursor: pointer; }
.cook-ingredients input:checked + span { color: var(--muted); text-decoration: line-through; }
.cook-done { text-align: center; padding: 40px 0 24px; }
.cook-done-emoji { font-size: 80px; }
.cook-done h2 { font-size: 2rem; }
.cook-nav { display: grid; grid-template-columns: 1fr 1.6fr; gap: 10px; padding: 12px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--border); background: var(--surface); }

/* ---------- 제휴·광고 자리 (비어 있으면 hidden) ---------- */
.slot.sponsor { position: relative; margin: 16px 0; border-radius: 20px; background: var(--cream); border: 1px solid var(--border); overflow: hidden; }
.slot.sponsor a { display: flex; gap: 14px; align-items: center; padding: 14px 16px; }
.slot.sponsor img { width: 72px; height: 72px; border-radius: 14px; object-fit: cover; flex-shrink: 0; }
.slot.sponsor p { margin: 2px 0 0; color: var(--muted); font-size: .88rem; }
.ad-label { position: absolute; top: 8px; right: 10px; font-size: .7rem; color: var(--muted); font-weight: 700; }
.slot.commerce { margin: 16px 0; padding: 16px; border-radius: 20px; background: var(--cream); }
.slot.commerce h3 { margin: 0 0 10px; font-size: 1rem; }
.commerce-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(90px, 1fr)); gap: 8px; }
.commerce-btn { border-color: var(--brand); color: var(--brand); }
.ad-disclosure { margin: 8px 0 0; font-size: .74rem; color: var(--muted); }

/* ---------- 설정 ---------- */
.key-row { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.usage { margin: 0 0 14px; padding-left: 20px; color: var(--text-2); }

.empty { text-align: center; color: var(--muted); padding: 48px 0; font-weight: 600; }

/* ---------- 토스트 ---------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 90;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none;
  background: var(--text); color: var(--bg); padding: 12px 22px; border-radius: 999px;
  font-weight: 600; transition: all .2s ease; max-width: calc(100% - 32px); text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- 푸터 ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 24px 0 32px; color: var(--muted); font-size: .86rem; text-align: center; }
.footer-links { display: flex; gap: 6px 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 8px; font-weight: 600; }
.footer-links a { min-height: 32px; display: inline-flex; align-items: center; }
.footer-links a:hover { color: var(--primary); }

/* ---------- 약관 페이지 ---------- */
.legal { max-width: 760px; margin: 0 auto; padding: 28px 0 56px; }
.legal h1 { font-size: clamp(1.6rem, 5vw, 2.1rem); font-weight: 800; margin: 0 0 6px; }
.legal .updated { color: var(--muted); margin: 0 0 24px; }
.legal section { background: var(--surface); border-radius: 20px; padding: 22px 24px; margin-bottom: 14px; box-shadow: var(--shadow); }
.legal h2 { font-size: 1.1rem; font-weight: 800; margin: 0 0 10px; color: var(--primary); }
.legal p, .legal li { color: var(--text-2); font-size: .98rem; }
.legal ol, .legal ul { padding-left: 22px; margin: 8px 0; }
.legal table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.legal th, .legal td { border: 1px solid var(--border); padding: 8px 10px; text-align: left; vertical-align: top; }
.legal th { background: var(--bg-soft); }
.legal .placeholder { background: #fff0b3; color: #6e5400; padding: 0 4px; border-radius: 4px; }
.table-wrap { overflow-x: auto; }

@media (max-width: 720px) {
  .detail { border-radius: 24px; }
  .detail-head, .sources-box, .detail-actions-top { padding-left: 18px; padding-right: 18px; }
  .detail-body { grid-template-columns: 1fr; padding: 22px 18px; gap: 26px; }
  .memo { margin: 0 18px; }
  .ai-notice { margin: 20px 18px 0; }
  .detail-actions { padding: 22px 18px; }
  .panel { padding: 20px 16px; }
  .legal section { padding: 18px; }
}
@media (max-width: 400px) {
  .logo img.mascot { width: 38px; height: 38px; }
  .logo .wm { height: 28px; }
}
