:root {
  color-scheme: light;
  --green-900: #075f34;
  --green-700: #0c8d48;
  --green-500: #22b160;
  --green-100: #e9f8e9;
  --mint: #d9f5df;
  --yellow: #ffc83d;
  --orange: #ff8667;
  --blue: #4a9cf7;
  --purple: #ae7df6;
  --ink: #111815;
  --muted: #6d756f;
  --line: #e9eee9;
  --paper: #ffffff;
  --page: #f5f7f2;
  --shadow: 0 18px 50px rgba(12, 40, 22, 0.16);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 10% 0%, rgba(164, 224, 112, 0.18), transparent 26%),
    linear-gradient(135deg, #fbfcf8 0%, #eef7ed 50%, #fff8e8 100%);
  color: var(--ink);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 3px solid rgba(34, 177, 96, 0.28);
  outline-offset: 2px;
}

.stage {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.phone {
  width: min(100%, 414px);
  height: min(900px, calc(100vh - 56px));
  min-height: 740px;
  overflow: hidden;
  position: relative;
  border-radius: 34px;
  background: var(--paper);
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.78);
  display: flex;
  flex-direction: column;
}

.status-bar {
  height: 36px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  padding: 0 28px 8px;
  font-size: 13px;
  font-weight: 800;
}

.status-icons {
  font-size: 10px;
  letter-spacing: 0;
}

.app-top {
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  background: #ffffff;
}

.brand {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--green-700);
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.3px;
}

.brand-mark {
  width: 56px;
  height: 56px;
  border-radius: 12px;
  object-fit: contain;
  background: transparent;
  box-shadow: none;
}

.top-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button,
.avatar-button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  background: #f2f4f2;
  display: grid;
  place-items: center;
  color: #5e6b62;
  position: relative;
}

.icon-button.has-dot::after {
  content: "";
  position: absolute;
  top: 7px;
  right: 8px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #3fa64a;
  border: 2px solid #f2f4f2;
}

.icon-button svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}

.icon-button.is-favorite {
  color: #ff5c6c;
  background: #fff0f2;
}

.icon-button.is-favorite svg {
  fill: currentColor;
}

.avatar-button {
  background:
    radial-gradient(circle at 50% 38%, #fff 0 15%, transparent 16%),
    radial-gradient(circle at 50% 80%, #fff 0 22%, transparent 23%),
    #d8ddd9;
}

.view {
  flex: 1;
  overflow-y: auto;
  padding: 8px 18px 96px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

.view::-webkit-scrollbar {
  display: none;
}

.bottom-nav {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 72px;
  padding: 6px 12px 10px;
  border-top: 1px solid #f0f2ef;
  background: rgba(255, 255, 255, 0.98);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 2px;
}

/* PWA 설치 배너 — 하단 네비 바로 위에 떠 있는 카드 */
.install-banner {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 82px;
  z-index: 30;
  background: linear-gradient(180deg, #ffffff 0%, #f6fbef 100%);
  border: 1px solid #cee5b2;
  border-radius: 14px;
  box-shadow: 0 8px 22px rgba(20, 60, 20, 0.15);
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  animation: install-banner-pop 220ms ease-out;
}
@keyframes install-banner-pop {
  from { transform: translateY(8px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}
.install-banner-icon img {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: block;
}
.install-banner-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.install-banner-body strong {
  font-size: 14px;
  font-weight: 900;
  color: #1f6b2f;
  letter-spacing: -0.2px;
}
.install-banner-body small {
  font-size: 11.5px;
  color: #5a675a;
  line-height: 1.3;
}
.install-banner-cta {
  border: 0;
  background: linear-gradient(180deg, #20b861, #079247);
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  padding: 8px 14px;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.install-banner-close {
  border: 0;
  background: transparent;
  color: #7c8378;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.install-banner-close:hover {
  background: rgba(0, 0, 0, 0.05);
}
.install-banner-close svg { width: 16px; height: 16px; }

.nav-item {
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: #98a09a;
  display: grid;
  place-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 700;
  min-width: 0;
  padding: 6px 4px;
  position: relative;
}

.nav-item svg {
  width: 21px;
  height: 21px;
  stroke-width: 1.8;
}

.nav-item.is-active {
  color: var(--green-700);
  font-weight: 800;
}

.nav-item.is-active svg {
  stroke-width: 2.2;
}

/* nav-item active 받침 제거 — 아이콘+텍스트 볼드 색상만으로 active 표시 */
.nav-item.is-active::before { display: none; }

/* 상단 헤더(시간/배터리 + 브랜드/알림/프로필) 전체 숨김 — 모든 페이지 */
.status-bar,
.app-top { display: none !important; }

.hero {
  min-height: 178px;
  border-radius: 8px;
  padding: 20px;
  background:
    linear-gradient(95deg, rgba(235, 249, 227, 0.95) 0%, rgba(236, 247, 217, 0.85) 56%, rgba(255, 255, 255, 0.25) 100%),
    url("https://images.unsplash.com/photo-1543362906-acfc16c67564?auto=format&fit=crop&w=900&q=80") center right / cover;
  position: relative;
  overflow: hidden;
}

/* Home hero — 단일 배너 이미지 + CTA 버튼 오버레이.
   이미지 자체에 카피·캐릭터·데코가 모두 들어있으므로 추가 합성 없이 그대로 사용. */
.home-hero {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  margin: 10px 0 18px;
  line-height: 0;
  box-shadow: 0 4px 14px rgba(60, 90, 40, 0.08);
}
.hero-bg {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}
.hero-cta {
  position: absolute;
  /* 배너 좌측 텍스트 블록 아래에 자연스럽게 정렬 */
  left: 7%;
  bottom: 10%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  border: 0;
  border-radius: 999px;
  padding: 11px 22px;
  background: #3fa950;
  color: #fff;
  font-weight: 800;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 3px 8px rgba(46, 125, 50, 0.22);
  z-index: 2;
}
.hero-cta:hover { background: #379545; }
.hero-cta:active { transform: translateY(1px); }
.hero-cta svg { width: 14px; height: 14px; }

@media (max-width: 360px) {
  .hero-cta { padding: 9px 16px; font-size: 12px; bottom: 9%; left: 6%; }
  .hero-cta svg { width: 12px; height: 12px; }
}

/* Tip card */
.tip-card {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  text-align: left;
  background: linear-gradient(180deg, #f4faf0 0%, #ecf6e3 100%);
  border: 1px solid #d8ecca;
  border-radius: 16px;
  padding: 12px 14px;
  margin: 18px 0 6px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.tip-card .tip-mascot {
  width: 52px;
  height: 52px;
  object-fit: contain;
  flex-shrink: 0;
  background: transparent;
  /* fade edges into the card */
  -webkit-mask-image: radial-gradient(closest-side, #000 65%, transparent 100%);
          mask-image: radial-gradient(closest-side, #000 65%, transparent 100%);
}
.tip-card .tip-body {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.tip-card .tip-body strong {
  font-size: 13px;
  color: #2c6a30;
  font-weight: 800;
}
.tip-card .tip-body span {
  font-size: 12px;
  color: #5a6b5e;
  line-height: 1.4;
}
.tip-card > svg {
  width: 18px;
  height: 18px;
  color: #8aa593;
  flex-shrink: 0;
}

/* Recipe card improvements */
.recipe-card .recipe-photo {
  position: relative;
  overflow: hidden;
  border-radius: 14px 14px 0 0;
}
.recipe-card .recipe-photo img {
  width: 100%;
  height: 130px;
  object-fit: cover;
  display: block;
}
.recipe-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: #2f7d32;
  color: #fff;
  font-size: 11px;
  font-weight: 800;
  padding: 4px 9px;
  border-radius: 999px;
}
.recipe-badge svg { width: 12px; height: 12px; }
.heart-btn {
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #b8c0bb;
  padding: 2px;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.heart-btn svg { width: 16px; height: 16px; }
.recipe-card .meta-row svg {
  width: 12px;
  height: 12px;
  vertical-align: -2px;
  margin-right: 2px;
}

/* D-pill on mini cards */
.mini-card .d-pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  background: #e6f3dc;
  color: #2f7d32;
  font-size: 11px;
  font-weight: 800;
}

.hero small {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--green-700);
  margin-bottom: 8px;
}

.hero h1,
.section-title h2,
.screen-title h1 {
  margin: 0;
  letter-spacing: 0;
}

.hero h1 {
  width: 58%;
  font-size: 28px;
  line-height: 1.18;
}

.hero p {
  width: 56%;
  margin: 10px 0 0;
  color: #4d5a50;
  font-size: 13px;
  line-height: 1.5;
  font-weight: 650;
}

.mascot {
  position: absolute;
  right: 24px;
  bottom: 16px;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: #f7fff4;
  border: 2px solid rgba(34, 177, 96, 0.28);
  box-shadow: 0 10px 22px rgba(8, 89, 42, 0.12);
  display: grid;
  place-items: center;
  font-size: 34px;
}

.section-title,
.screen-title,
.row-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-title {
  margin: 24px 0 12px;
}

.section-title h2 {
  font-size: 17px;
}

.section-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.icon-refresh {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: #f0f4ef;
  color: #5d7064;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.icon-refresh svg { width: 15px; height: 15px; stroke-width: 2.2; }
.icon-refresh:active svg { transform: rotate(180deg); transition: transform 220ms; }

.cook-done-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #ff8a3d 0%, #f1670b 100%);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: -0.2px;
  margin-top: 8px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(241, 103, 11, 0.28);
  transition: transform 80ms ease, box-shadow 120ms ease, filter 120ms ease;
}
.cook-done-button:hover { filter: brightness(1.04); }
.cook-done-button:active { transform: translateY(1px); box-shadow: 0 2px 8px rgba(241,103,11,0.32); }
.cook-done-button svg { width: 18px; height: 18px; stroke-width: 2.2; }

/* 메뉴 사진 우상단 작은 '사진 다시 만들기' 새로고침 아이콘 */
.image-regen-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: grid;
  place-items: center;
  cursor: pointer;
  color: #2c2f2c;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
  transition: transform 120ms ease, background 120ms ease;
  z-index: 3;
}
.image-regen-btn:hover { background: #fff; }
.image-regen-btn:active svg { transform: rotate(180deg); transition: transform 220ms ease; }
.image-regen-btn[disabled] { opacity: 0.6; cursor: progress; }
.image-regen-btn svg { width: 16px; height: 16px; stroke-width: 2.2; }

.heart-btn.is-on {
  color: #ff5c6c;
}
.heart-btn.is-on svg { fill: currentColor; }

.meta-row .meta-cell {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

.muted-link {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  padding: 0;
}

.urgent-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mini-card {
  border: 1px solid #ecf0eb;
  border-radius: 14px;
  min-height: 116px;
  padding: 14px 8px 12px;
  display: grid;
  place-items: center;
  text-align: center;
  background: var(--paper);
  gap: 6px;
  position: relative;
}

.mini-card .emoji {
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: transparent;
  font-size: 36px;
}

.mini-card .mini-photo {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 50%;
  background: #fafdf6;
  padding: 2px;
}

.ingredient-photo {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

.mini-card strong {
  width: 100%;
  font-size: 12.5px;
  font-weight: 700;
  color: #2c2f2c;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px;
}

.mini-card span:last-child {
  font-size: 12px;
  color: var(--green-700);
  font-weight: 900;
}

.recipe-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.recipe-card,
.inventory-card,
.list-card,
.insight-card,
.settings-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.recipe-card {
  overflow: hidden;
  cursor: pointer;
}

.recipe-card img {
  width: 100%;
  aspect-ratio: 1.35;
  object-fit: cover;
  display: block;
  background: #eef4ee;
}

.recipe-body {
  padding: 10px;
}

.recipe-body strong,
.inventory-card strong,
.list-card strong {
  display: block;
  font-size: 13px;
  line-height: 1.28;
}

.meta-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 750;
}

.eff {
  color: var(--green-700);
}

.quick-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 20px;
}

.action-tile {
  min-height: 86px;
  border: 0;
  border-radius: 8px;
  display: grid;
  place-items: center;
  gap: 7px;
  color: #fff;
  font-weight: 900;
  box-shadow: 0 10px 20px rgba(20, 42, 25, 0.12);
}

.action-tile svg {
  width: 26px;
  height: 26px;
}

.action-tile.green {
  background: linear-gradient(180deg, #87d96a, #32b764);
}

.action-tile.yellow {
  background: linear-gradient(180deg, #ffe174, #ffbf35);
  color: #6b4a00;
}

.action-tile.coral {
  background: linear-gradient(180deg, #ffa279, #ff715f);
}

.screen-title {
  height: 44px;
  justify-content: center;
  position: relative;
}

.screen-title h1 {
  font-size: 18px;
}

.screen-title .ghost-left,
.screen-title .ghost-right {
  position: absolute;
  top: 5px;
}

.screen-title .ghost-left {
  left: 0;
}

.screen-title .ghost-right {
  right: 0;
}

.segmented,
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.segmented {
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  margin: 8px 0 14px;
  background: #fbfbfa;
}

.segmented button,
.chip {
  border: 0;
  border-radius: 999px;
  white-space: nowrap;
  font-weight: 850;
}

.segmented button {
  flex: 1;
  min-height: 38px;
  background: transparent;
  color: var(--muted);
}

.segmented button.is-active,
.chip.is-active {
  background: linear-gradient(180deg, #22b160, #098b45);
  color: #fff;
}

.chip {
  padding: 9px 13px;
  background: #f4f6f4;
  color: var(--muted);
  font-size: 12px;
}

.search-row {
  display: grid;
  grid-template-columns: 1fr 46px;
  gap: 8px;
  margin-bottom: 12px;
}

.search-row input,
.add-form input,
.add-form select,
.prompt-bar input {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  height: 46px;
  background: #fbfbfb;
  outline: none;
}

.search-row input:focus,
.add-form input:focus,
.add-form select:focus,
.prompt-bar input:focus {
  border-color: rgba(12, 141, 72, 0.55);
}

.icon-square {
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: #fff;
  display: grid;
  place-items: center;
}

.inventory-list,
.simple-list,
.plan-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.inventory-card {
  min-height: 96px;
  padding: 16px 14px;
  display: grid;
  grid-template-columns: 58px 1fr auto auto;
  align-items: center;
  gap: 14px;
  border-radius: 14px;
}

.inventory-card .delete-btn {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #b8c1bb;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.inventory-card .delete-btn:hover { color: #e15a5a; }
.inventory-card .delete-btn svg { width: 16px; height: 16px; }

.food-icon {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #f2f8ee;
  font-size: 34px;
}

.food-icon.small {
  width: 46px;
  height: 46px;
  font-size: 22px;
}

/* 이미지 준비중 — placeholder 이모지 위에 작은 라벨 */
.food-icon-pending {
  position: relative;
  background: #fff7e6;
  border: 1px dashed #f0c674;
  overflow: hidden;
}
.food-icon-pending .food-icon-emoji {
  font-size: 28px;
  opacity: 0.55;
  filter: saturate(0.6);
}
.image-pending-label {
  position: absolute;
  top: 2px; left: 2px; right: 2px;
  font-size: 8.5px;
  font-weight: 700;
  color: #b45309;
  background: rgba(255, 247, 230, 0.92);
  text-align: center;
  line-height: 1.2;
  padding: 1px 2px;
  border-radius: 4px;
  letter-spacing: -0.3px;
  pointer-events: none;
}

.badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-top: 7px;
  flex-wrap: wrap;
}

.badge {
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  line-height: 1;
  font-weight: 900;
  background: var(--green-100);
  color: var(--green-700);
}

.badge.warn {
  background: #fff1e9;
  color: #ff663f;
}

.badge.blue {
  background: #e9f3ff;
  color: #317bd6;
}

.d-day {
  font-size: 14px;
  color: var(--green-700);
  font-weight: 950;
}

/* 유통기한 입력한 재료만 노출되는 표시 전용 칩 (클릭 동작 없음) */
.d-day-display {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 48px;
  padding: 6px 8px;
  background: var(--green-100, #e6f3df);
  border-radius: 14px;
  pointer-events: none;
}

.d-day-display .d-day {
  font-size: 13px;
  line-height: 1;
}

.d-day-display .d-day-date {
  font-size: 10px;
  color: #6B7280;
  font-weight: 600;
  white-space: nowrap;
}

.add-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  margin-top: 12px;
}

.add-form .primary-button {
  grid-column: 1 / -1;
}

.add-form-row {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 8px;
  align-items: end;
}

.add-form-row .form-cell {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.add-form-row .cell-label {
  font-size: 11px;
  color: #6B7280;
  font-weight: 700;
  padding-left: 12px;
  letter-spacing: -0.2px;
}

.add-form-row select,
.add-form-row input[type="date"] {
  width: 100%;
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid #E5E7EB;
  border-radius: 999px;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  color: #1F2937;
  box-sizing: border-box;
}

.add-form-row input[type="date"]::-webkit-datetime-edit {
  color: #1F2937;
}

.add-form-row input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.6;
}

.primary-button {
  min-height: 46px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(180deg, #20b861, #079247);
  color: #fff;
  font-weight: 950;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.primary-button svg {
  width: 18px;
  height: 18px;
}

.secondary-button {
  min-height: 42px;
  border: 1px solid #dce9dc;
  border-radius: 999px;
  background: #fff;
  color: var(--green-700);
  font-weight: 950;
}

.feature-card {
  margin-top: 14px;
  border: 1px solid #ffd36b;
  border-radius: 8px;
  overflow: hidden;
  background: #fff9e7;
}

.feature-photo {
  position: relative;
  min-height: 210px;
  background: #fff3cb;
}

.feature-photo img {
  width: 100%;
  height: 210px;
  object-fit: cover;
  display: block;
  animation: imageFade 220ms ease-out;
}

.image-credit {
  position: absolute;
  right: 10px;
  bottom: 8px;
  z-index: 3;
  max-width: 62%;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.76);
  color: #4f5b53;
  font-size: 10px;
  font-weight: 800;
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.feature-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(255, 248, 221, 0.84), rgba(255, 248, 221, 0.02) 48%, rgba(255, 248, 221, 0.95));
  padding: 18px;
  display: flex;
  flex-direction: column;
}

.recommend-mark {
  align-self: flex-start;
  border-radius: 999px;
  background: var(--yellow);
  color: #8b5f00;
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 950;
}

.feature-overlay h2 {
  margin: 12px 0 5px;
  font-size: 24px;
  line-height: 1.18;
  width: 78%;
}

.feature-overlay p {
  width: 68%;
  margin: 0;
  color: #6f5b24;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
}

.score-bubble {
  margin-top: auto;
  width: 82px;
  height: 82px;
  border: 2px solid var(--yellow);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: grid;
  place-items: center;
  text-align: center;
  color: #ef8b00;
  font-size: 24px;
  font-weight: 950;
  line-height: 1.05;
}

.score-bubble small {
  display: block;
  color: #5c4a21;
  font-size: 11px;
}

.feature-detail {
  padding: 14px 16px 16px;
  display: grid;
  gap: 13px;
}

.feature-detail h3 {
  margin: 0;
  font-size: 14px;
}

.feature-detail p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  font-weight: 700;
}

.ingredient-strip {
  display: flex;
  gap: 9px;
  overflow-x: auto;
}

.ingredient-pill {
  min-width: 54px;
  display: grid;
  justify-items: center;
  gap: 5px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ingredient-pill .food-icon {
  width: 42px;
  height: 42px;
  font-size: 24px;
}

.cook-info {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.info-cell {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #3f4741;
  font-size: 13px;
  font-weight: 850;
}

.info-cell svg {
  width: 19px;
  height: 19px;
  color: var(--green-700);
}

.simple-list {
  margin-top: 12px;
}

.list-card {
  min-height: 74px;
  display: grid;
  grid-template-columns: 66px 1fr 24px;
  align-items: center;
  gap: 10px;
  padding: 9px;
}

.thumb {
  width: 66px;
  height: 54px;
  object-fit: cover;
  border-radius: 8px;
  background: #eef4ee;
}

.prompt-bar {
  margin-top: 12px;
  display: grid;
  grid-template-columns: 34px 1fr 34px;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.prompt-bar input {
  height: 36px;
  border: 0;
  background: transparent;
  padding: 0;
}

.prompt-bar svg {
  width: 20px;
  height: 20px;
  color: var(--green-700);
}

.plan-header {
  margin: 8px 0 12px;
  min-height: 50px;
  display: grid;
  grid-template-columns: 40px 1fr 40px;
  align-items: center;
  text-align: center;
}

.plan-range strong {
  display: block;
  font-size: 15px;
}

.plan-range span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
  margin-top: 3px;
}

.plan-row {
  display: grid;
  grid-template-columns: 45px 1fr;
  gap: 10px;
  align-items: stretch;
}

.day-cell {
  display: grid;
  place-items: center;
  text-align: center;
  color: #555f58;
  font-size: 12px;
  font-weight: 900;
}

.meal-pair {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: #fff;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

.meal-cell {
  min-height: 80px;
  padding: 10px;
  border: 0;
  background: #fff;
  color: inherit;
  text-align: left;
  display: flex;
  align-items: center;
  gap: 8px;
}

.meal-cell + .meal-cell {
  border-left: 1px solid var(--line);
}

.meal-cell .meal-text {
  flex: 1;
  min-width: 0;
}

.meal-cell small {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  margin-bottom: 4px;
}

.meal-cell strong {
  font-size: 13px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: keep-all;
}

.plan-meal-thumb {
  width: 48px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #f5f6f3;
}

/* 식단 > 목록 보기 카드 */
.plan-list-card {
  grid-template-columns: 64px 1fr 20px;
  padding: 12px;
  min-height: 80px;
}
.plan-list-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  background: #f5f6f3;
  display: block;
}
.plan-list-thumb.fallback {
  display: grid;
  place-items: center;
  background: #f1f8ec;
  font-size: 28px;
}
.plan-list-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.plan-list-caption {
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: -0.1px;
}
.plan-list-title {
  font-size: 14.5px;
  font-weight: 850;
  color: #2c2f2c;
  line-height: 1.3;
  word-break: keep-all;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.plan-list-card .meta-row {
  margin-top: 2px;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
}
.plan-list-card .meta-cell svg {
  width: 13px;
  height: 13px;
}
.plan-list-card .eff {
  color: var(--green-700);
  font-weight: 850;
}
.plan-list-chevron {
  color: #b9beb6;
  width: 18px;
  height: 18px;
}

.meal-cell:hover,
.meal-cell:focus-visible {
  background: #f7fbf5;
}

.insights {
  margin-top: 18px;
  padding: 14px;
  border-radius: 8px;
  background: #eef9ea;
  border: 1px solid #d5ead0;
}

.insights h2 {
  margin: 0 0 12px;
  color: var(--green-700);
  font-size: 15px;
}

.insight-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.insight-card {
  min-height: 96px;
  padding: 10px 8px;
  text-align: center;
}

.insight-card strong {
  display: block;
  color: var(--green-700);
  font-size: 13px;
  line-height: 1.35;
}

.insight-card span {
  display: block;
  color: var(--muted);
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 750;
}

.settings-card {
  padding: 16px;
  display: grid;
  gap: 12px;
}

.settings-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  font-weight: 700;
}

.ai-card {
  margin-top: 12px;
  border: 1px solid #d9ead4;
  border-radius: 8px;
  padding: 14px;
  background: #f5fbf1;
}

.ai-card strong {
  color: var(--green-700);
  font-size: 14px;
}

.ai-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.ai-card p {
  margin: 8px 0 0;
  color: #445047;
  font-size: 12px;
  line-height: 1.55;
  font-weight: 750;
}

.ai-answer p {
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(12, 141, 72, 0.1);
}

.ai-answer p:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  z-index: 70;
  display: grid;
  align-items: end;
  padding: 18px;
  background: rgba(18, 28, 22, 0.34);
}

.modal-sheet {
  width: 100%;
  max-height: min(76vh, 660px);
  overflow-y: auto;
  padding: 10px 16px 18px;
  border-radius: 24px 24px 18px 18px;
  background: #fff;
  box-shadow: 0 22px 54px rgba(17, 24, 20, 0.25);
}

.modal-handle {
  width: 42px;
  height: 4px;
  margin: 2px auto 14px;
  border-radius: 999px;
  background: #dce4dc;
}

.modal-sheet strong {
  font-size: 17px;
  line-height: 1.35;
}

.modal-sheet p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
  font-weight: 750;
}

.modal-sheet h3 {
  margin: 18px 0 6px;
  font-size: 14px;
}

.steps {
  margin: 8px 0 18px;
  padding-left: 20px;
  color: #3f4741;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 750;
}

.steps li + li {
  margin-top: 6px;
}

.slot-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.slot-button {
  min-height: 44px;
  border: 1px solid #dce9dc;
  border-radius: 999px;
  background: #f8fbf7;
  color: #2d3a31;
  font-size: 13px;
  font-weight: 900;
}

.slot-button:hover,
.slot-button:focus-visible {
  border-color: rgba(12, 141, 72, 0.45);
  background: var(--green-100);
  color: var(--green-700);
}

.danger-button {
  min-height: 44px;
  border: 1px solid #ffded6;
  background: #fff6f3;
  color: #de5537;
  border-radius: 999px;
  font-weight: 950;
}

.toast {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 88px;
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(15, 23, 19, 0.9);
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  transform: translateY(20px);
  opacity: 0;
  pointer-events: none;
  transition: 180ms ease;
}

.toast.is-visible {
  transform: translateY(0);
  opacity: 1;
  pointer-events: auto;
}

.toast-message {
  flex: 1;
  text-align: center;
}

.toast-action {
  flex-shrink: 0;
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #B6F8C8;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  letter-spacing: -0.2px;
}

.toast-action:hover { background: rgba(255, 255, 255, 0.28); }
.toast-action:active { background: rgba(255, 255, 255, 0.36); }

@keyframes imageFade {
  from {
    filter: blur(5px);
    opacity: 0.7;
  }

  to {
    filter: blur(0);
    opacity: 1;
  }
}

@media (max-width: 768px) {
  body {
    min-height: 100dvh;
    background: var(--paper);
    overflow: hidden;
  }

  .stage {
    min-height: 100dvh;
    padding: 0;
    display: block;
  }

  .phone {
    width: 100%;
    height: 100dvh;
    min-height: 100dvh;
    border-radius: 0;
    border: 0;
    box-shadow: none;
  }

  .view {
    padding: 8px 18px calc(148px + env(safe-area-inset-bottom, 0px));
  }

  .bottom-nav {
    position: fixed;
    left: calc(14px + env(safe-area-inset-left, 0px));
    right: calc(14px + env(safe-area-inset-right, 0px));
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    height: 68px;
    padding: 7px 10px;
    border: 1px solid rgba(219, 230, 218, 0.9);
    border-radius: 24px;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 16px 34px rgba(24, 39, 28, 0.18);
    backdrop-filter: blur(18px);
    z-index: 30;
  }

  .nav-item {
    border-radius: 18px;
  }

  .nav-item.is-active {
    background: var(--green-100);
  }

  .toast {
    position: fixed;
    bottom: calc(96px + env(safe-area-inset-bottom, 0px));
    z-index: 40;
  }

  .modal-backdrop {
    position: fixed;
    padding: 14px 14px calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 80;
  }

  .modal-sheet {
    max-height: min(74vh, 620px);
    border-radius: 24px 24px 0 0;
  }
}

/* === v2 추가: list-card 액션, slot picker 강화, 유튜브 버튼 === */
.list-card {
  grid-template-columns: 76px 1fr;
  align-items: stretch;
}

.list-card .thumb {
  width: 76px;
  height: 100%;
  min-height: 80px;
}

.list-card-body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 4px 4px 4px 0;
}

.list-card-actions {
  display: flex;
  gap: 6px;
  margin-top: 4px;
  flex-wrap: wrap;
}

.chip-button {
  flex: 1;
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--line, #d8e2d8);
  background: #fff;
  color: #2d3a31;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: 120ms ease;
}

.chip-button:hover,
.chip-button:focus-visible {
  border-color: rgba(12, 141, 72, 0.4);
  background: var(--green-100, #eafbf1);
  color: var(--green-700, #0c8d48);
}

.chip-button.primary {
  background: var(--green-700, #0c8d48);
  border-color: var(--green-700, #0c8d48);
  color: #fff;
}

.chip-button.primary:hover,
.chip-button.primary:focus-visible {
  background: #0a7a3e;
  border-color: #0a7a3e;
  color: #fff;
}

/* Slot picker */
.slot-modal {
  max-height: 82vh;
}

.slot-prompt {
  margin: 2px 0 10px;
  font-size: 13px;
  color: #4a5650;
}

.slot-prompt b {
  color: #0c8d48;
  font-weight: 900;
}

.slot-table {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

.slot-row {
  display: grid;
  grid-template-columns: 78px 1fr 1fr;
  gap: 6px;
  align-items: stretch;
}

.slot-row.header {
  font-size: 11px;
  font-weight: 900;
  color: #6b7770;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.slot-row.header > div {
  padding: 4px 6px;
}

.slot-row.is-today .slot-day-cell {
  background: #fff7df;
  color: #b9871a;
}

.slot-day-cell {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 10px 8px;
  border-radius: 10px;
  background: #f4f7f1;
  font-size: 13px;
  font-weight: 900;
  color: #314138;
}

.today-badge {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 999px;
  background: #f66f52;
  color: #fff;
  font-weight: 900;
}

.slot-cell {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 4px;
  min-height: 56px;
  padding: 8px 10px;
  border: 1px solid #dce9dc;
  border-radius: 10px;
  background: #fcfefb;
  color: #2d3a31;
  font-size: 12px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
  transition: 120ms ease;
}

.slot-cell:hover,
.slot-cell:focus-visible {
  border-color: var(--green-700, #0c8d48);
  background: var(--green-100, #eafbf1);
}

.slot-cell .existing {
  color: #4a5650;
  font-size: 11px;
  font-weight: 700;
  line-height: 1.3;
  word-break: keep-all;
}

.slot-cell .empty {
  color: #a8b0a8;
  font-size: 11px;
  font-weight: 700;
}

.slot-cell .slot-action {
  font-size: 11px;
  font-weight: 900;
  color: var(--green-700, #0c8d48);
}

/* Modal actions */
.modal-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}

.youtube-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 999px;
  background: #ff0000;
  color: #fff;
  font-weight: 900;
  font-size: 14px;
  text-decoration: none;
  transition: 120ms ease;
}

.youtube-button:hover,
.youtube-button:focus-visible {
  background: #cc0000;
  color: #fff;
}

.youtube-button svg {
  width: 18px;
  height: 18px;
}

/* 작은 유튜브 칩 (list-card 안) */
.chip-button.youtube {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  background: #ff0000;
  border-color: #ff0000;
  color: #fff;
  text-decoration: none;
  flex: 0 1 auto;
  padding: 6px 12px;
}

.chip-button.youtube:hover,
.chip-button.youtube:focus-visible {
  background: #cc0000;
  border-color: #cc0000;
  color: #fff;
}

.chip-button.youtube svg {
  width: 14px;
  height: 14px;
}

/* feature card 안의 유튜브 버튼 간격 */
.feature-detail .youtube-button {
  margin-top: 4px;
}

/* === Splash screen (앱 로딩 풀커버) === */
.splash {
  position: absolute;
  inset: 0;
  z-index: 9999;
  background: #e8f2cb;
  transition: opacity 320ms ease, visibility 320ms ease;
  border-radius: inherit;
  overflow: hidden;
}
/* 모바일(폰 프레임이 화면 전체) 에서는 fixed 로 전체화면 커버 */
@media (max-width: 480px) {
  .splash { position: fixed; }
}

.splash.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.splash-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

/* === Login screen === */
.login-screen {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  text-align: center;
  padding: 40px 24px;
  gap: 18px;
}
.login-mascot {
  width: 140px;
  height: 140px;
  object-fit: contain;
  margin-bottom: 6px;
}
.login-screen h1 {
  font-size: 26px;
  font-weight: 950;
  color: var(--green-700);
  letter-spacing: -0.5px;
  margin: 0;
}
.login-sub {
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--muted);
  margin: 0 0 14px;
}
.google-signin-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: #fff;
  color: #1f1f1f;
  border: 1px solid #dadce0;
  border-radius: 999px;
  padding: 12px 24px;
  font-weight: 700;
  text-decoration: none;
  font-size: 15px;
  transition: box-shadow 120ms ease, transform 80ms ease;
}
.google-signin-btn:hover {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}
.google-signin-btn:active { transform: translateY(1px); }

/* ===== Admin page ===== */
.admin-entry .primary-button { display: inline-flex; align-items: center; gap: 6px; }
.admin-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.admin-stat-card {
  background: #f6faf3;
  border: 1px solid #e0eedb;
  border-radius: 12px;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.admin-stat-card .label { color: #5a6f5b; font-size: 12px; }
.admin-stat-card strong { font-size: 20px; color: var(--green-900); }
.rank-list {
  list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-direction: column; gap: 6px;
}
.rank-list li {
  display: grid;
  grid-template-columns: 22px 1.4fr 2fr auto;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.rank-list .rank-no { color: #889; font-weight: 600; }
.rank-list .rank-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-list .rank-bar { background: #e9f3e1; height: 8px; border-radius: 999px; overflow: hidden; }
.rank-list .rank-bar-fill { display: block; height: 100%; background: var(--green-500); border-radius: 999px; }
.rank-list .rank-count { color: var(--green-700); font-weight: 600; }
.admin-user-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.admin-user-card {
  display: grid;
  grid-template-columns: 44px 1fr 16px;
  align-items: center;
  gap: 10px;
  padding: 10px;
  border: 1px solid #ececec;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  text-align: left;
}
.admin-user-card:hover { border-color: var(--green-500); }
.admin-avatar {
  width: 44px; height: 44px; border-radius: 50%; object-fit: cover;
  background: #eef2ee; display: flex; align-items: center; justify-content: center;
  font-weight: 700; color: var(--green-700);
}
.admin-avatar.fallback { border: 1px solid #dde3dd; }
.admin-user-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.admin-user-head { display: flex; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.admin-user-head strong { font-size: 14px; }
.admin-user-meta { display: flex; gap: 12px; flex-wrap: wrap; font-size: 12px; color: #5a6f5b; }
.admin-detail-modal {
  max-width: 480px; max-height: 80vh; overflow-y: auto;
  padding: 16px; background: #fff; border-radius: 16px;
  display: flex; flex-direction: column; gap: 10px;
}
.admin-detail-modal .modal-head { display: flex; justify-content: space-between; align-items: center; }
.admin-detail-modal details { background: #f9fbf8; border-radius: 10px; padding: 8px 10px; }
.admin-detail-modal summary { cursor: pointer; padding: 4px 0; }
.admin-mini-list { list-style: none; padding: 0; margin: 6px 0 0; display: flex; flex-direction: column; gap: 4px; font-size: 13px; }
.admin-mini-list li { padding: 4px 6px; border-radius: 6px; }
.admin-mini-list li:nth-child(odd) { background: #fff; }
.muted { color: #889; font-size: 12px; }

/* ===== Share / invite ===== */
.share-card .share-status { margin: 8px 0; display: flex; flex-direction: column; gap: 8px; }
.share-card .share-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.share-card .primary-button, .share-card .ghost-button { display: inline-flex; align-items: center; gap: 6px; }
.share-token-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  grid-template-rows: auto auto;
  gap: 6px 8px;
  padding: 10px;
  background: #f6faf3;
  border: 1px solid #e0eedb;
  border-radius: 12px;
  align-items: center;
}
.share-token-row input[data-share-link] {
  grid-column: 1 / 2;
  font-size: 12px;
  padding: 8px 10px;
  border: 1px solid #d8e2d1;
  border-radius: 8px;
  background: #fff;
  width: 100%;
  min-width: 0;
}
.share-token-row .primary-button.small,
.share-token-row .ghost-button.small {
  padding: 6px 10px;
  font-size: 12px;
}
.share-token-meta { grid-column: 1 / -1; font-size: 11px; }
.ghost-button {
  background: transparent;
  border: 1px solid #d3dcd3;
  color: #495b48;
  border-radius: 999px;
  padding: 8px 14px;
  cursor: pointer;
  font-weight: 500;
}
.ghost-button:hover { border-color: var(--green-500); color: var(--green-700); }
#profile-button.guest-badge {
  display: flex; align-items: center; justify-content: center;
  background: var(--green-500); color: #fff;
  font-size: 11px; font-weight: 700;
}
body.is-share-guest::before {
  content: "공유 게스트 모드";
  position: fixed; top: 0; left: 0; right: 0;
  background: #fff3cd; color: #6b5400;
  padding: 4px 8px; text-align: center;
  font-size: 12px; font-weight: 600;
  z-index: 9999; pointer-events: none;
}
body.is-share-guest { padding-top: 22px; }

/* ===== Screen title actions (multi-button right group) ===== */
.screen-title-actions { display: flex; align-items: center; gap: 6px; }
.screen-title-actions .icon-button { width: 36px; height: 36px; }

/* ===== AI prompt bar (top of recommend screen) ===== */
.ai-prompt-bar {
  display: grid;
  grid-template-columns: 22px 1fr 44px;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  margin: 12px 0 6px;
  background: #fff;
  border: 1.5px solid #d8e2d1;
  border-radius: 18px;
  box-shadow: 0 1px 2px rgba(15, 80, 30, 0.04);
}
.ai-prompt-bar > i[data-lucide] { color: var(--green-500); width: 22px; height: 22px; }
.ai-prompt-bar input {
  border: 0;
  outline: none;
  background: transparent;
  font-size: 15px;
  color: #1a3a1f;
  font-weight: 600;
  width: 100%;
  min-width: 0;
}
.ai-prompt-bar input::placeholder { color: #1a3a1f; opacity: 0.85; font-weight: 600; }
.ai-prompt-submit {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 0;
  background: var(--green-500);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.ai-prompt-submit:hover { background: var(--green-700); }
.ai-prompt-help {
  display: flex; align-items: center; gap: 6px;
  justify-content: center;
  font-size: 12px;
  color: #5a6f5b;
  margin: 0 0 14px;
}
.ai-prompt-help i[data-lucide] { width: 13px; height: 13px; color: var(--green-500); }

.admin-model-card { background: #ffffff; border: 1.5px solid #e0eedb; border-radius: 18px; padding: 16px 16px 14px; margin: 0 0 14px; }
.admin-model-list { display: flex; flex-direction: column; gap: 8px; margin-top: 8px; }
.admin-model-row {
  display: flex; align-items: center; gap: 12px;
  background: #f9fcf6;
  border: 1.5px solid #e0eedb;
  border-radius: 14px;
  padding: 12px 14px;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease;
}
.admin-model-row.is-active { border-color: var(--green-500); background: #eef8e2; }
.admin-model-row input[type="radio"] { width: 18px; height: 18px; accent-color: var(--green-500); flex-shrink: 0; cursor: pointer; }
.admin-model-info { flex: 1; display: flex; flex-direction: column; gap: 3px; }
.admin-model-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.admin-model-label { font-weight: 700; color: #1d3a1f; font-size: 14px; }
.admin-model-price { font-size: 12px; color: var(--green-700); font-weight: 600; }
.admin-model-note { font-size: 12px; color: #6a7d6c; }
.admin-model-help { margin: 10px 0 0; font-size: 12px; color: #6a7d6c; }

.category-rec-btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%;
  background: var(--green-500);
  color: #ffffff;
  border: none;
  border-radius: 16px;
  padding: 16px 18px;
  font-size: 15px; font-weight: 700;
  cursor: pointer;
  /* 위쪽: 카테고리 칩과 충분히 떨어트림. 아래쪽: 다음 섹션과 분리. */
  margin: 18px 0 22px;
  box-shadow: 0 4px 12px rgba(46, 142, 70, 0.18);
  transition: background 150ms ease, transform 100ms ease;
}
.category-rec-btn:hover:not(:disabled) { background: var(--green-700); }
.category-rec-btn:active:not(:disabled) { transform: scale(0.99); }
.category-rec-btn:disabled { background: #9bc8a4; cursor: wait; box-shadow: none; }
.category-rec-btn i[data-lucide] { width: 18px; height: 18px; }
.category-rec-btn i[data-lucide="loader-2"] { animation: quick-chip-spin 0.9s linear infinite; }

/* ===== Quick-list (2-step recommend flow) ===== */
.quick-loading-card {
  display: flex; align-items: center; gap: 12px;
  background: #f3f9ee;
  border: 1.5px dashed #c2dcb1;
  border-radius: 18px;
  padding: 14px 18px;
  margin: 0 0 14px;
}
.quick-loading-spinner {
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  background: #ffffff;
  border-radius: 50%;
  color: var(--green-500);
  animation: quick-spinner-pulse 1.4s ease-in-out infinite;
}
.quick-loading-spinner i[data-lucide] { width: 20px; height: 20px; }
@keyframes quick-spinner-pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.08); opacity: 0.75; }
}
.quick-loading-text { display: flex; flex-direction: column; gap: 2px; }
.quick-loading-text strong { font-size: 14px; color: #1d3a1f; }
.quick-loading-text span { font-size: 12px; color: #5a6f5b; }

.quick-list-section {
  background: #ffffff;
  border: 1.5px solid #e0eedb;
  border-radius: 22px;
  padding: 16px 16px 18px;
  margin: 0 0 14px;
}
.quick-list-head { display: flex; flex-direction: column; gap: 2px; margin-bottom: 10px; padding: 0 2px; }
.quick-list-head strong { font-size: 14px; color: #1d3a1f; }
.quick-list-head span { font-size: 12px; color: #6a7d6c; }
.quick-list-chips { display: flex; flex-direction: column; gap: 8px; }
.quick-chip {
  display: flex; flex-direction: column; gap: 4px;
  background: #f6fbf1;
  border: 1.5px solid #e0eedb;
  border-radius: 14px;
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: border-color 150ms ease, background 150ms ease, transform 100ms ease;
}
.quick-chip:hover { border-color: var(--green-500); background: #eef8e2; }
.quick-chip:active { transform: scale(0.99); }
.quick-chip.is-loading { border-color: var(--green-500); background: #eef8e2; }
.quick-chip.is-disabled { opacity: 0.45; cursor: not-allowed; }
.quick-chip-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.quick-chip-name { font-size: 15px; font-weight: 700; color: #1d3a1f; }
.quick-chip-top i[data-lucide] { width: 18px; height: 18px; color: var(--green-500); flex-shrink: 0; }
.quick-chip-spinner { animation: quick-chip-spin 0.9s linear infinite; }
@keyframes quick-chip-spin {
  to { transform: rotate(360deg); }
}
.quick-chip-meta { font-size: 12px; color: #5a6f5b; }
.quick-chip-reason { font-size: 12px; color: #6a7d6c; line-height: 1.45; }

/* ===== AI loading card ===== */
.ai-loading-card {
  background: #ffffff;
  border: 1.5px solid #e0eedb;
  border-radius: 22px;
  padding: 26px 20px 22px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  box-shadow: 0 2px 10px rgba(15, 80, 30, 0.05);
  position: relative;
  overflow: hidden;
}
.ai-loading-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 0%, rgba(34, 177, 96, 0.06), transparent 60%),
              radial-gradient(circle at 80% 100%, rgba(34, 177, 96, 0.06), transparent 60%);
  pointer-events: none;
}
.ai-loading-spark { color: var(--green-500); }
.ai-loading-spark i[data-lucide] { width: 26px; height: 26px; }
.ai-loading-card strong { font-size: 17px; color: #1a3a1f; z-index: 1; }
.ai-loading-sub { color: var(--green-700); font-weight: 600; font-size: 14px; z-index: 1; }
.ai-loading-dots { display: flex; gap: 6px; margin: 6px 0 2px; z-index: 1; }
.ai-loading-dots span {
  width: 9px; height: 9px; border-radius: 50%; background: var(--green-500);
  animation: ai-loading-bounce 1.3s infinite ease-in-out;
}
.ai-loading-dots span:nth-child(2) { animation-delay: 0.18s; }
.ai-loading-dots span:nth-child(3) { animation-delay: 0.36s; }
@keyframes ai-loading-bounce {
  0%, 70%, 100% { transform: scale(0.6); opacity: 0.55; }
  35% { transform: scale(1); opacity: 1; }
}
.ai-loading-help { color: #889; font-size: 12px; margin: 4px 0 0; z-index: 1; }

/* ===== Detail modal photo ===== */
.modal-sheet .detail-photo {
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 14px;
  overflow: hidden;
  background: #f6faf3;
  margin: 6px 0 10px;
}
.modal-sheet .detail-photo img {
  width: 100%; height: 100%; object-fit: cover; display: block;
}

/* ───── Vision: 사진으로 재료 추가 FAB & 모달 ───── */
.scan-fab-wrap {
  position: fixed;
  right: max(20px, env(safe-area-inset-right));
  bottom: calc(108px + env(safe-area-inset-bottom));
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 8px;
  pointer-events: none;
}
.scan-fab-wrap > * { pointer-events: auto; }

.scan-fab-bubble {
  background: #fff;
  color: #1f6f33;
  font-size: 12px;
  font-weight: 600;
  padding: 7px 12px;
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(17, 24, 20, 0.14), 0 1px 3px rgba(0,0,0,0.06);
  border: 1px solid #d6ead5;
  white-space: nowrap;
  position: relative;
  animation: scan-bubble-pop 2.4s ease-in-out infinite;
}
.scan-fab-bubble::after {
  content: "";
  position: absolute;
  right: -6px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-left-color: #fff;
  filter: drop-shadow(1px 0 0 #d6ead5);
}
@keyframes scan-bubble-pop {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-3px); }
}

.scan-fab {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #2e8e46 0%, #1f6f33 100%);
  color: #fff;
  box-shadow: 0 8px 24px rgba(31, 111, 51, 0.35), 0 2px 6px rgba(0,0,0,0.12);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.scan-fab:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(31, 111, 51, 0.4); }
.scan-fab:active { transform: translateY(0); }
.scan-fab svg { width: 26px; height: 26px; stroke-width: 2.2; }

@media (min-width: 768px) {
  /* 데스크탑: phone frame 안쪽 우하단 */
  .scan-fab-wrap { right: max(20px, calc((100vw - 480px) / 2 + 20px)); }
}
@media (max-width: 360px) {
  /* 좁은 폰: 말풍선 숨김 (공간 부족) */
  .scan-fab-bubble { display: none; }
}

.scan-sheet,
.scan-mode-sheet {
  max-width: 460px;
  margin: 0 auto;
}
.scan-mode-help {
  margin: 2px 4px 14px;
  color: #6b7c70;
  font-size: 13px;
  line-height: 1.5;
}
.scan-mode-list {
  display: flex; flex-direction: column; gap: 10px;
  padding-bottom: 6px;
}
.scan-mode-card {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 16px;
  border: 1.5px solid #e4efe1;
  border-radius: 16px;
  background: #fafdf8;
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, transform 0.1s, background 0.15s;
}
.scan-mode-card:hover { border-color: #2e8e46; background: #f4faef; }
.scan-mode-card:active { transform: scale(0.99); }
.scan-mode-icon {
  width: 44px; height: 44px;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.scan-mode-icon.photo { background: #d7efb2; color: #1f6f33; }
.scan-mode-icon.receipt { background: #fde8c4; color: #b76b1d; }
.scan-mode-icon svg { width: 22px; height: 22px; stroke-width: 2.1; }
.scan-mode-text {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.scan-mode-text strong {
  font-size: 15px; color: #1a2e1f; font-weight: 600;
}
.scan-mode-text span {
  font-size: 12px; color: #6b7c70;
}
.scan-mode-arrow {
  width: 18px; height: 18px;
  color: #b6c4b8;
  flex-shrink: 0;
}
.scan-sheet-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 4px 10px;
}
.scan-sheet-header strong {
  font-size: 17px;
  color: #1a2e1f;
}
.scan-modal-body {
  padding: 4px 4px 6px;
  max-height: 60vh;
  overflow-y: auto;
}
.scan-loading {
  display: flex; flex-direction: column; align-items: center; gap: 14px;
  padding: 32px 16px;
  text-align: center;
}
.scan-loading h3 { margin: 0; font-size: 17px; color: #1a2e1f; }
.scan-loading p { margin: 0; color: #6b7c70; font-size: 14px; }
.scan-spinner {
  width: 40px; height: 40px;
  border: 4px solid #e4efe1;
  border-top-color: #2e8e46;
  border-radius: 50%;
  animation: scan-spin 0.9s linear infinite;
}
@keyframes scan-spin { to { transform: rotate(360deg); } }

.scan-error {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  padding: 24px 16px;
  text-align: center;
}
.scan-error svg { width: 40px; height: 40px; color: #c87a47; }
.scan-error h3 { margin: 0; font-size: 17px; color: #1a2e1f; }
.scan-error p { margin: 0; color: #6b7c70; font-size: 14px; line-height: 1.5; }
.scan-error .primary-button { margin-top: 6px; }

.scan-summary {
  margin: 4px 4px 12px;
  color: #4a6651;
  font-size: 13px;
  line-height: 1.5;
}
.scan-list {
  display: flex; flex-direction: column; gap: 8px;
  margin-bottom: 14px;
}
.scan-row {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid #e4efe1;
  border-radius: 14px;
  background: #fafdf8;
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.scan-row.is-checked {
  border-color: #2e8e46;
  background: #eaf6e6;
}
.scan-row input[type="checkbox"] {
  width: 20px; height: 20px;
  accent-color: #2e8e46;
  cursor: pointer;
}
.scan-row-main {
  flex: 1; display: flex; flex-direction: column; gap: 2px;
  min-width: 0;
}
.scan-row-main strong {
  font-size: 15px; color: #1a2e1f; font-weight: 600;
}
.scan-row-meta {
  font-size: 12px; color: #6b7c70;
}
.scan-row-conf {
  font-size: 12px; color: #4a6651;
  font-weight: 600;
  background: #fff;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid #e4efe1;
}
.scan-actions {
  display: flex; gap: 10px;
  margin-top: 4px;
}
.scan-actions .primary-button,
.scan-actions .secondary-button {
  flex: 1;
}
.scan-actions button[disabled] { opacity: 0.6; cursor: wait; }

/* ── 어드민 라이브러리 ──────────────────────────────────────────────────── */
.admin-library-entry-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.admin-library-actions {
  display: flex; gap: 8px; margin: 12px 0 16px;
}
.admin-library-tabs {
  display: flex; gap: 8px; margin: 16px 0 8px;
}
.tab-chip {
  border: 1px solid #E5E7EB; background: #fff; color: #374151;
  border-radius: 18px; padding: 6px 14px; font-size: 13px; font-weight: 600; cursor: pointer;
}
.tab-chip.is-active {
  background: #2F7D52; color: #fff; border-color: #2F7D52;
}
.admin-library-search {
  display: flex; gap: 6px; margin-bottom: 12px;
}
.admin-library-search input {
  flex: 1; border: 1px solid #E5E7EB; border-radius: 12px; padding: 8px 12px; font-size: 14px;
}
.lib-table {
  display: flex; flex-direction: column; gap: 8px;
}
.lib-row {
  display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center;
  background: #fff; border: 1px solid #E5E7EB; border-radius: 12px; padding: 10px;
}
.lib-thumb {
  width: 64px; height: 64px; border-radius: 8px; object-fit: cover;
  background: #F3F4F6;
}
.lib-thumb.empty {
  display: flex; align-items: center; justify-content: center;
  color: #9CA3AF; font-size: 22px; background: #F1EFE9;
}
.lib-row-body { min-width: 0; }
.lib-row-body strong { display: block; font-size: 14px; color: #1F2937; }
.lib-row-meta {
  display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap;
}
.chip-mini {
  background: #F1EFE9; color: #4B5563; border-radius: 8px;
  padding: 2px 8px; font-size: 11px; font-weight: 600;
}
.lib-row-aliases {
  margin-top: 4px; font-size: 11px; color: #6B7280;
}
.lib-row-actions {
  display: flex; gap: 4px; flex-shrink: 0;
}
.lib-row-actions .icon-button {
  width: 32px; height: 32px; padding: 0; display: flex; align-items: center; justify-content: center;
  background: #F9FAFB; border: 1px solid #E5E7EB; border-radius: 8px;
}
.lib-row-actions .icon-button:hover { background: #2F7D52; color: #fff; border-color: #2F7D52; }
.lib-row-actions .icon-button svg { width: 16px; height: 16px; }

.primary-button.compact, .secondary-button.compact {
  padding: 6px 12px; font-size: 13px;
}
.muted.small { font-size: 11px; }

/* ── 등급 뱃지 + 내 등급 모달 ───────────────────────────────────────────── */
.tier-badge {
  position: absolute;
  right: -4px; bottom: -4px;
  width: 18px; height: 18px;
  border-radius: 50%;
  border: 2px solid #fff;
  color: #fff;
  font-size: 10px; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  z-index: 2;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
  padding: 0;
}
.tier-badge:hover { transform: scale(1.08); }

/* avatar wrapper needs relative for badge */
.profile-wrap, .topbar-right { position: relative; }

.tier-modal-card {
  width: min(440px, 100%);
  max-height: min(88vh, 820px);
  max-height: min(88dvh, 820px);
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  border-radius: 24px 24px 18px 18px;
  padding: 0;
  background: #fff;
  display: flex;
  flex-direction: column;
}
.modal-backdrop.tier-modal-backdrop {
  align-items: end;
}
@media (min-width: 720px) {
  .modal-backdrop.tier-modal-backdrop {
    align-items: center;
  }
  .tier-modal-card {
    border-radius: 22px;
  }
}
.tier-modal-summary {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 4px 16px;
}
.tier-modal-summary-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1;
  min-width: 0;
}
.tier-modal-emoji {
  width: 116px;
  height: 116px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 56px;
}
.tier-modal-emoji:not(.has-image) {
  /* 이모지 폴백 (이미지 없는 경우만 흰 배경 + 컬러 링) */
  border-radius: 50%;
  background: #fff;
  border: 3px solid #2F7D52;
  overflow: hidden;
}
.tier-modal-lv {
  font-size: 13px;
  font-weight: 700;
  color: #2F7D52;
  letter-spacing: 0.02em;
}
.tier-modal-summary-text strong {
  font-size: 26px;
  font-weight: 800;
  color: #1F2937;
  line-height: 1.15;
  margin-bottom: 6px;
}
.tier-modal-body {
  padding: 22px 22px 16px;
  display: flex;
  flex-direction: column;
}
.tier-xp-row {
  display: flex;
  justify-content: flex-start;
  align-items: baseline;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
}
.tier-xp-current {
  font-size: 17px;
  font-weight: 800;
  color: #2F7D52;
}
.tier-xp-next {
  font-size: 12px;
  color: #6B7280;
}
.tier-modal-close-btn {
  position: sticky;
  bottom: 0;
  width: 100%;
  padding: 18px 0 calc(18px + env(safe-area-inset-bottom, 0px));
  background: #fff;
  border: 0;
  border-top: 1px solid #F1EFE9;
  font-size: 16px;
  font-weight: 700;
  color: #1F2937;
  cursor: pointer;
  z-index: 5;
}
.tier-modal-close-btn:hover { background: #FAFAF7; }
.tier-xp-bar {
  height: 10px; background: #F1EFE9; border-radius: 5px; overflow: hidden;
}
.tier-xp-bar-fill {
  height: 100%; border-radius: 5px;
  transition: width 0.4s ease;
}
.tier-stats-row {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 18px 0;
}
.tier-stat {
  background: #F9FAFB; border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 2px;
}
.tier-stat .label { font-size: 11px; color: #6B7280; }
.tier-stat strong { font-size: 18px; color: #1F2937; }
.tier-quota {
  background: #F1EFE9; border-radius: 12px; padding: 12px;
  display: flex; flex-direction: column; gap: 6px;
  margin-bottom: 16px;
}
.tier-quota-row {
  display: flex; justify-content: space-between;
  font-size: 13px;
}
.tier-quota-row strong { color: #2F7D52; }
.tier-tips {
  background: #FFF; border: 1px solid #E5E7EB; border-radius: 12px; padding: 12px 14px;
}
.tier-tips strong { display: block; font-size: 13px; margin-bottom: 6px; color: #1F2937; }
.tier-tips ul { margin: 0; padding-left: 16px; }
.tier-tips li { font-size: 12px; color: #6B7280; line-height: 1.6; }

/* ── 미매칭 연결 모달 ──────────────────────────────────────────────────── */
.lib-row-actions-wide { flex-wrap: wrap; gap: 4px; justify-content: flex-end; }
.lib-thumb.tiny { width: 36px; height: 36px; border-radius: 6px; font-size: 16px; }
.link-modal-card {
  width: min(440px, 92vw); max-height: 80vh; overflow: hidden;
  display: flex; flex-direction: column; padding: 20px;
  position: relative;
}
.link-modal-card h3 { margin: 0 0 4px; font-size: 16px; color: #1F2937; }
.link-search-input {
  width: 100%; padding: 8px 12px; border: 1px solid #E5E7EB;
  border-radius: 10px; font-size: 13px; margin-top: 12px;
}
.link-list {
  flex: 1; overflow-y: auto; margin-top: 12px;
  display: flex; flex-direction: column; gap: 6px;
}
.link-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; background: #fff; border: 1px solid #E5E7EB;
  border-radius: 10px; text-align: left; cursor: pointer; width: 100%;
}
.link-row:hover { background: #F1EFE9; border-color: #2F7D52; }
.link-row-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1; }
.link-row-body strong { font-size: 13px; color: #1F2937; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ── 라이브러리 편집 모달 ────────────────────────────────────────────── */
.edit-modal-card {
  width: min(440px, 92vw); max-height: 90vh; overflow-y: auto;
  padding: 20px; position: relative;
}
.edit-modal-card h3 { margin: 0 0 12px; font-size: 16px; color: #1F2937; }
.edit-modal-card .lib-thumb { width: 80px; height: 80px; margin: 0 auto 14px; display: block; }
.edit-field {
  display: flex; flex-direction: column; gap: 4px;
  margin-bottom: 10px;
}
.edit-field span { font-size: 12px; color: #6B7280; font-weight: 600; }
.edit-field input,
.edit-field select {
  border: 1px solid #E5E7EB; border-radius: 8px; padding: 8px 10px;
  font-size: 13px; font-family: inherit;
}
.edit-field input:focus,
.edit-field select:focus { outline: none; border-color: #2F7D52; }
.edit-field.checkbox {
  flex-direction: row; align-items: center; gap: 8px;
  margin-top: 4px;
}
.edit-field.checkbox input { width: auto; }
.edit-field.checkbox span { font-size: 13px; color: #1F2937; }
.edit-actions {
  display: flex; gap: 8px; justify-content: flex-end; margin-top: 16px;
}
.edit-actions button { padding: 8px 16px; font-size: 13px; }

/* ── 매칭 분포 차트 ──────────────────────────────────────────────────── */
.match-breakdown { margin: 12px 0; }
.match-bucket {
  margin: 12px 0;
  padding: 10px 12px;
  background: #F9FAFB;
  border-radius: 10px;
}
.match-bucket > strong { display: block; font-size: 13px; margin-bottom: 8px; color: #1F2937; }
.match-bucket-empty {
  margin: 8px 0; padding: 8px; font-size: 12px; color: #9CA3AF;
  background: #F9FAFB; border-radius: 8px;
}
.match-rows { display: flex; flex-direction: column; gap: 4px; }
.match-row {
  display: grid; grid-template-columns: 130px 1fr 80px; gap: 8px;
  align-items: center; font-size: 11px;
}
.match-src { font-family: SFMono-Regular, Menlo, monospace; color: #4B5563; }
.match-row.hit .match-src { color: #2F7D52; font-weight: 700; }
.match-row.miss .match-src { color: #DC2626; }
.match-bar {
  height: 6px; background: #E5E7EB; border-radius: 3px; overflow: hidden;
}
.match-row.hit .match-bar-fill { background: #2F7D52; }
.match-row.miss .match-bar-fill { background: #DC2626; }
.match-bar-fill { height: 100%; border-radius: 3px; transition: width 0.3s ease; }
.match-cnt { text-align: right; color: #6B7280; }

/* ── XP UI ─────────────────────────────────────────────────────────── */
/* 버튼 옆 정적 +XP 칩 */
.xp-chip {
  display: inline-flex; align-items: center;
  background: rgba(255, 255, 255, 0.22);
  color: inherit;
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 10px; font-weight: 800;
  margin-left: 6px;
  letter-spacing: 0.3px;
  white-space: nowrap;
  vertical-align: middle;
}
.primary-button .xp-chip,
.hero-cta .xp-chip,
.category-rec-btn .xp-chip,
.cook-done-button .xp-chip {
  background: rgba(255, 255, 255, 0.25);
  color: rgba(255, 255, 255, 0.95);
}

/* floating +XP — 화면 가운데에서 위로 떠오르며 사라짐 */
.xp-floater {
  position: fixed;
  left: 50%;
  top: 45%;
  transform: translate(-50%, -50%) scale(0.7);
  background: linear-gradient(135deg, #2F7D52, #1E5631);
  color: #fff;
  font-size: 28px;
  font-weight: 900;
  padding: 12px 24px;
  border-radius: 999px;
  box-shadow: 0 8px 28px rgba(31, 125, 82, 0.45);
  pointer-events: none;
  opacity: 0;
  z-index: 9999;
  transition: transform 1.4s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 1.4s ease;
  letter-spacing: 1px;
}
.xp-floater.is-flying {
  transform: translate(-50%, -160%) scale(1.05);
  opacity: 1;
}
.xp-floater.is-flying::after {
  content: "";
  position: absolute; inset: -6px;
  border-radius: 999px;
  background: radial-gradient(circle, rgba(134, 193, 102, 0.4), transparent 70%);
  z-index: -1;
}

/* ── 하단 플로팅 XP 게이지바 (게임 풍 실시간 진척도) ─────────────────────── */
.xp-bar-float {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 86px;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 18px 16px;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 14px 38px rgba(17, 24, 20, 0.26), 0 2px 8px rgba(17, 24, 20, 0.1);
  border: 1px solid rgba(47, 125, 82, 0.14);
  transform: translateY(140%);
  opacity: 0;
  transition: transform 0.42s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.32s ease;
  pointer-events: none;
}
.xp-bar-float.is-visible {
  transform: translateY(0);
  opacity: 1;
}
.xp-bar-float-icon {
  width: 76px;
  height: 76px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: xp-icon-bounce 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes xp-icon-bounce {
  0% { transform: scale(0.4) rotate(-8deg); opacity: 0; }
  60% { transform: scale(1.12) rotate(3deg); opacity: 1; }
  100% { transform: scale(1) rotate(0); opacity: 1; }
}
.xp-bar-float-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.xp-bar-float-body {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.xp-bar-float-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
}
.xp-bar-float-lv {
  font-size: 13px;
  font-weight: 700;
  color: #1F2937;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.xp-bar-float-gain {
  font-size: 16px;
  font-weight: 900;
  color: #2F7D52;
  white-space: nowrap;
  letter-spacing: -0.01em;
  animation: xp-gain-pop 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes xp-gain-pop {
  0% { transform: scale(0.5) translateY(6px); opacity: 0; }
  55% { transform: scale(1.2) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.xp-bar-float-track {
  height: 14px;
  background: #F1EFE9;
  border-radius: 7px;
  overflow: hidden;
  position: relative;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.08);
}
.xp-bar-float-fill {
  height: 100%;
  width: 0%;
  border-radius: 7px;
  background: #2F7D52;
  position: relative;
  overflow: hidden;
  box-shadow: 0 0 8px rgba(47, 125, 82, 0.35);
}
/* 게이지 안의 미세 stripe (게임 progress bar 느낌) */
.xp-bar-float-fill::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(
    45deg,
    rgba(255,255,255,0.16) 25%, transparent 25%,
    transparent 50%, rgba(255,255,255,0.16) 50%,
    rgba(255,255,255,0.16) 75%, transparent 75%, transparent
  );
  background-size: 14px 14px;
  animation: xp-bar-stripes 1.2s linear infinite;
  opacity: 0.6;
}
@keyframes xp-bar-stripes {
  from { background-position: 0 0; }
  to { background-position: 14px 0; }
}
/* 게이지 채워질 때 shine 효과 */
.xp-bar-float-fill::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  width: 50%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.75), transparent);
  transform: translateX(-110%);
  animation: xp-bar-shine 1.8s ease-out 0.25s 1;
}
@keyframes xp-bar-shine {
  to { transform: translateX(240%); }
}
.xp-bar-float-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  font-size: 12px;
  color: #4B5563;
  letter-spacing: 0.01em;
  font-weight: 600;
}
.xp-bar-float-meta-xp { font-variant-numeric: tabular-nums; }
.xp-bar-float-meta-xp .xp-cur { font-weight: 800; color: #1F2937; }
.xp-bar-float-meta-xp .xp-max { color: #6B7280; }
.xp-bar-float-meta-next { color: #6B7280; font-weight: 500; }
/* 레벨업 연출 */
.xp-bar-float.is-levelup {
  box-shadow: 0 0 0 2px rgba(255, 200, 50, 0.55), 0 14px 36px rgba(255, 180, 0, 0.35);
  animation: xp-levelup-pulse 0.6s ease-in-out 2;
}
@keyframes xp-levelup-pulse {
  0%, 100% { transform: translateY(0) scale(1); }
  50% { transform: translateY(-4px) scale(1.015); }
}
.xp-bar-float.is-levelup .xp-bar-float-gain::before {
  content: "🎉 LEVEL UP! ";
  font-size: 11px;
  color: #B45309;
  margin-right: 2px;
}

/* 모바일에서 안전영역 + bottom-nav 위치 보정 */
@media (max-width: 720px) {
  .xp-bar-float {
    position: fixed;
    bottom: calc(90px + env(safe-area-inset-bottom, 0px));
    z-index: 60;
  }
}

/* 설정 화면 등급 카드 */
.tier-summary-card {
  cursor: pointer;
  transition: transform 0.15s ease;
}
.tier-summary-card:hover { transform: translateY(-1px); }
.tier-summary-row { display: flex; align-items: center; gap: 12px; }
.tier-summary-emoji {
  width: 48px; height: 48px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0;
}
.tier-summary-body { flex: 1; min-width: 0; }
.tier-summary-top {
  display: flex; align-items: baseline; gap: 8px; margin-bottom: 4px;
}
.tier-summary-top strong { font-size: 15px; color: #1F2937; }
.tier-summary-bar {
  height: 6px; background: #F1EFE9; border-radius: 3px; overflow: hidden; margin-bottom: 4px;
}
.tier-summary-bar-fill { height: 100%; border-radius: 3px; transition: width 0.4s ease; }

/* ── Fire / Freeze 카드 보강 ─────────────────────────────────────────── */
.tier-stat.fire-stat,
.tier-stat.freeze-stat {
  display: flex; flex-direction: column; gap: 4px;
  padding: 14px;
}
.tier-stat strong { font-size: 16px; }
.tier-stat-bonus {
  display: flex; flex-direction: column; gap: 2px;
  margin-top: 6px; padding-top: 6px;
  border-top: 1px dashed #E5E7EB;
}
.tier-stat-bonus span {
  font-size: 10.5px; color: #6B7280;
}
.tier-stat-bonus span.achieved {
  color: #2F7D52; font-weight: 700;
}
.tier-stat-bonus span.achieved::before {
  content: "✓ "; color: #2F7D52;
}

/* Fire / Freeze 설명 박스 */
.tier-explain {
  background: #FFFCEF;
  border: 1px solid #FDE68A;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
  display: flex; flex-direction: column; gap: 8px;
}
.tier-explain-row {
  display: flex; gap: 10px; align-items: flex-start;
  font-size: 12px; line-height: 1.55; color: #4B5563;
}
.tier-explain-emoji {
  font-size: 18px; flex-shrink: 0; line-height: 1;
}
.tier-explain strong { color: #1F2937; }

/* tier-tips 안의 b 강조 */
.tier-tips li b { color: #2F7D52; font-weight: 800; }

/* ── 다음 등급 보상 미리보기 ─────────────────────────────────────────── */
.next-tier-perks {
  background: linear-gradient(135deg, #FFF7E6, #FFEDD5);
  border: 1px solid #FED7AA;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 12px 0;
}
.next-tier-perks > strong {
  display: block; margin-bottom: 6px;
  font-size: 13px; color: #C2410C;
}
.next-tier-perks ul {
  margin: 0; padding-left: 18px;
}
.next-tier-perks li {
  font-size: 12px; line-height: 1.6; color: #7C2D12;
}
.tier-quota-row.muted strong { color: #6B7280; font-weight: 600; }

/* ── 등급 마스코트 아이콘 (lv1.png ~ lv6.png) ──────────────────────── */
/* 헤더 뱃지 — 작은 원형 (이미지에 컬러 링 포함 → wrapper 는 투명) */
.tier-badge-image {
  width: 26px; height: 26px;
  background: transparent !important;
  border: 0 !important;
  padding: 0;
  overflow: visible;
  box-shadow: none !important;
}
.tier-badge-image img {
  width: 100%; height: 100%;
  object-fit: contain; display: block;
}

/* 내 등급 모달 — 큰 마스코트 (이미지에 컬러 링 포함 → wrapper 는 투명) */
.tier-modal-emoji.has-image {
  background: transparent;
  border: 0;
  padding: 0;
  overflow: visible;
}
.tier-modal-emoji.has-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* 설정 화면 등급 카드 마스코트 (이미지에 컬러 링 포함 → wrapper 투명) */
.tier-summary-emoji.has-image {
  background: transparent !important;
  padding: 0;
  overflow: visible;
  border-radius: 0;
}
.tier-summary-emoji.has-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
