/* shell.css — 공통 앱 셸(상단바/드로어/하단탭바) + 진입퍼널(봇체크/로그인) + 충전
 * 파스텔 따뜻한 톤(main.css 변수 무드 유지). 모바일 우선.
 * main.css 의 :root 변수를 그대로 쓰되, 셸 단독 로드 시를 위한 폴백을 둔다.
 */

/* hidden 속성이 display 지정(flex/grid/inline-flex)에 덮이지 않도록 보장 */
[hidden] { display: none !important; }

/* ===================== 문의하기 (1:1) ===================== */
.inq-band {
  background: linear-gradient(135deg, var(--peach), var(--peach-deep));
  color: #7a4a14;
  font-weight: 800;
  text-align: center;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 6px 0 12px;
  font-size: 0.95rem;
  line-height: 1.5;
}
.inq-band-pink {
  background: linear-gradient(135deg, var(--pink), var(--pink-deep));
  color: #fff;
  margin-top: 24px;
}
.inq-intro { color: var(--text-soft); font-size: 0.92rem; margin: -2px 0 16px; }
.inq-sec-title { font-size: 1.02rem; font-weight: 800; margin: 26px 0 4px; }
.inq-cats { display: flex; flex-direction: column; gap: 10px; }
.inq-cat {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 16px 16px 14px;
  background: var(--bg-card);
  border: 1px solid #f0e2d4;
  border-radius: 16px;
  cursor: pointer;
  text-align: left;
  box-shadow: var(--shadow);
}
.inq-cat:active { transform: scale(0.99); }
.inq-cat-ico {
  flex: 0 0 auto;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: #fff1e6;
  color: var(--accent-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.inq-cat-ico svg { width: 24px; height: 24px; }
.inq-cat-txt { flex: 1 1 auto; display: flex; flex-direction: column; gap: 2px; }
.inq-cat-txt b { font-size: 1rem; font-weight: 800; color: var(--text); }
.inq-cat-txt small { font-size: 0.82rem; color: var(--text-soft); }
.inq-cat-arrow { color: var(--text-soft); font-size: 1.4rem; }

.inq-list-hint { text-align: center; color: var(--text-soft); font-size: 0.84rem; margin: 0 0 12px; }
.inq-empty { text-align: center; color: var(--text-soft); padding: 18px; font-size: 0.9rem; }
.inq-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; padding: 14px; margin-bottom: 8px;
  background: var(--bg-card); border: 1px solid #f0e2d4; border-radius: 12px;
  cursor: pointer; text-align: left;
}
.inq-row-main { min-width: 0; flex: 1 1 auto; }
.inq-row-type { font-size: 0.78rem; font-weight: 800; color: var(--accent-deep); }
.inq-row-body {
  display: block; margin-top: 3px; font-size: 0.9rem; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.inq-row-meta { flex: 0 0 auto; text-align: right; }
.inq-row-date { display: block; margin-top: 4px; font-size: 0.72rem; color: var(--text-soft); }
.inq-badge { font-size: 0.7rem; font-weight: 800; padding: 2px 8px; border-radius: 999px; }
.inq-badge.wait { background: #fff3d6; color: #9a6a14; }
.inq-badge.done { background: #d9f3e6; color: #2f9e6f; }

.inq-subhead {
  display: flex; align-items: center; gap: 6px;
  font-size: 1.1rem; font-weight: 800; margin: 4px 0 16px;
}
.inq-back {
  border: none; background: transparent; font-size: 1.6rem; line-height: 1;
  color: var(--text); cursor: pointer; padding: 0 6px 0 0;
}
.inq-label { display: block; font-weight: 700; font-size: 0.92rem; margin: 14px 0 6px; }
.inq-opt { color: var(--text-soft); font-weight: 600; font-size: 0.82rem; }
.inq-req { color: var(--pink-deep); font-weight: 700; font-size: 0.82rem; }
.inq-select, .inq-input, .inq-textarea {
  width: 100%; padding: 12px 14px; border: 1.5px solid #f0e2d4; border-radius: 12px;
  background: #fffdfb; font-size: 0.95rem; color: var(--text); outline: none;
}
.inq-textarea { min-height: 120px; resize: vertical; line-height: 1.6; }
.inq-count { text-align: right; font-size: 0.76rem; color: var(--text-soft); margin-top: 4px; }
.inq-submit {
  width: 100%; margin-top: 18px; padding: 14px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; font-size: 1.02rem; font-weight: 800; cursor: pointer;
}
.inq-submit:active { transform: scale(0.99); }

.inq-stars { display: flex; justify-content: center; gap: 6px; font-size: 2rem; margin: 8px 0 4px; }
.inq-stars button { border: none; background: transparent; color: #e3d5c6; cursor: pointer; line-height: 1; padding: 0; }
.inq-stars button.on { color: #ffc24d; }
.inq-star-score { text-align: center; color: var(--text-soft); font-weight: 700; font-size: 0.88rem; }
.inq-check { display: block; margin-top: 12px; font-size: 0.86rem; color: var(--text); line-height: 1.5; }
.inq-check small { color: var(--text-soft); }

.inq-rules {
  background: linear-gradient(135deg, #fff4dd, #ffe9c7);
  border-radius: 14px; padding: 14px 16px 14px 32px; margin: 0 0 8px;
  font-size: 0.88rem; color: #7a4a14; line-height: 1.9;
}
.inq-rules b { font-weight: 800; }
.inq-radios { display: flex; flex-direction: column; gap: 8px; }
.inq-radios label { display: flex; align-items: center; gap: 8px; font-size: 0.95rem; }

.inq-detail-type { font-size: 1rem; font-weight: 800; margin-bottom: 8px; display: flex; align-items: center; gap: 8px; }
.inq-detail-stars { color: #ffc24d; font-size: 1.2rem; margin-bottom: 8px; }
.inq-detail-q {
  background: var(--bg-card); border: 1px solid #f0e2d4; border-radius: 12px;
  padding: 14px; font-size: 0.95rem; line-height: 1.7; white-space: pre-wrap;
}
.inq-detail-date { font-size: 0.76rem; color: var(--text-soft); margin: 6px 2px 18px; }
.inq-detail-a-label { font-weight: 800; font-size: 0.9rem; margin-bottom: 6px; color: var(--accent-deep); }
.inq-detail-a {
  background: #fff7ef; border-radius: 12px; padding: 14px;
  font-size: 0.94rem; line-height: 1.7; color: var(--text); white-space: pre-wrap;
}

/* ===================== 충전: 환불 고지 박스 ===================== */
.charge-notice {
  margin: 16px 0 12px;
  padding: 14px 16px;
  background: #fff7ec;
  border: 1px solid #f3e2c8;
  border-radius: 14px;
  font-size: 0.85rem;
  color: var(--text);
  line-height: 1.6;
}
.charge-notice b { font-weight: 800; }
.charge-notice ul { margin: 8px 0 8px; padding-left: 18px; }
.charge-notice li { margin-bottom: 4px; color: var(--text); }
.charge-notice a { display: inline-block; margin-top: 4px; color: var(--accent-deep); font-weight: 700; text-decoration: none; }

/* ===================== 관리자: 대시보드 ===================== */
.dash-engine {
  display: inline-block;
  margin: 0 0 12px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 700;
}
.dash-engine.lite { background: #eef4ff; color: #3a63b0; }
.dash-engine.ora { background: #e7f6ec; color: #2f8f57; }

.dash-cards {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-bottom: 8px;
}
.dash-card {
  background: var(--bg-card);
  border: 1px solid #f0e2d4;
  border-radius: 14px;
  padding: 14px;
  box-shadow: var(--shadow);
}
.dash-card.warn { border-color: var(--pink-deep); background: #fff5f7; }
.dash-card-t { font-size: 0.8rem; color: var(--text-soft); font-weight: 700; }
.dash-card-v { font-size: 1.3rem; font-weight: 800; margin: 4px 0 2px; color: var(--accent-deep); }
.dash-card-sub { font-size: 0.76rem; color: var(--text-soft); }
.dash-bars { display: flex; flex-direction: column; gap: 7px; margin-bottom: 6px; }
.dash-bar-row { display: flex; align-items: center; gap: 8px; font-size: 0.85rem; }
.dash-bar-label { flex: 0 0 84px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dash-bar-track { flex: 1 1 auto; height: 14px; background: #f3ece3; border-radius: 999px; overflow: hidden; }
.dash-bar-fill { display: block; height: 100%; border-radius: 999px; background: linear-gradient(90deg, var(--peach-deep), var(--accent)); }
.dash-bar-val { flex: 0 0 auto; color: var(--text-soft); font-weight: 700; font-size: 0.8rem; min-width: 28px; text-align: right; }
.dash-empty { color: var(--text-soft); font-size: 0.88rem; padding: 8px 2px; }

/* 원가·마진 표 (관리자 전용) */
.dash-margins { overflow-x: auto; margin-bottom: 10px; }
.dash-mtable { width: 100%; border-collapse: collapse; font-size: 0.82rem; }
.dash-mtable th, .dash-mtable td {
  padding: 7px 8px; text-align: right; white-space: nowrap;
  border-bottom: 1px solid #f1e9df;
}
.dash-mtable th { color: var(--text-soft); font-weight: 700; font-size: 0.76rem; }
.dash-mtable th:first-child, .dash-mtable td:first-child { text-align: left; }
.dash-mtable tbody tr:last-child td { border-bottom: none; }
.dash-mtable td b { color: var(--accent-deep); }

/* ===================== 관리자: 문의 관리 ===================== */
.adm-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.adm-tab {
  padding: 8px 16px; min-height: 40px;
  border: 1.5px solid #f0e2d4; background: var(--bg-card);
  color: var(--text-soft); font-weight: 700; border-radius: 999px; cursor: pointer;
}
.adm-tab.is-active {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff; border-color: transparent;
}
.adm-card {
  background: var(--bg-card); border: 1px solid #f0e2d4; border-radius: 14px;
  padding: 14px; margin-bottom: 12px; box-shadow: var(--shadow);
}
.adm-card-head { display: flex; align-items: center; justify-content: space-between; }
.adm-who { font-size: 0.78rem; color: var(--text-soft); margin: 4px 0; }
.adm-stars { color: #ffc24d; font-size: 1rem; margin: 2px 0; }
.adm-body { font-size: 0.95rem; line-height: 1.6; margin: 8px 0 10px; white-space: pre-wrap; }
.adm-card .inq-textarea { min-height: 80px; }
.adm-send { margin-top: 8px; padding: 11px; font-size: 0.95rem; }
.adm-answer-done {
  background: #fff7ef; border-radius: 12px; padding: 12px; font-size: 0.92rem; line-height: 1.6;
}
.adm-answer-done b { color: var(--accent-deep); display: block; margin-bottom: 4px; }
.adm-refund {
  background: #fff7ec; border: 1px solid #f3e2c8; border-radius: 12px;
  padding: 12px; margin-bottom: 10px;
}
.adm-refund b { color: #9a6a14; display: block; margin-bottom: 6px; }
.adm-refund-row { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; }
.adm-refund-input { width: 70px; padding: 7px 10px; border: 1.5px solid #e8d8c4; border-radius: 10px; font-size: 0.95rem; }
.adm-refund-hint { font-size: 0.74rem; color: var(--text-soft); margin: 6px 0 8px; }
.adm-refund-btn { background: linear-gradient(135deg, #ffb877, #f2683a); }

/* ===================== 사업자정보 푸터 ===================== */
.site-footer {
  margin-top: 28px;
  padding: 20px 16px calc(24px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #f0e2d4;
  background: #fffaf4;
  font-size: 0.78rem;
  color: var(--text-soft);
  line-height: 1.7;
}
.foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  margin-bottom: 12px;
}
.foot-links a { color: var(--text); text-decoration: none; font-weight: 700; }
.foot-links a:hover { color: var(--accent-deep); }
.foot-biz b { color: var(--text); font-weight: 700; }
.foot-copy { margin-top: 10px; font-size: 0.72rem; opacity: 0.85; }

/* ===================== 법적 고지 페이지 ===================== */
.legal-page { max-width: 720px; }
.legal-page h2 {
  font-size: 1.02rem;
  margin: 22px 0 8px;
}
.legal-page p, .legal-page li { font-size: 0.92rem; line-height: 1.75; color: var(--text); }
.legal-page ul { padding-left: 20px; }
.legal-page li { margin-bottom: 5px; }
.legal-page a { color: var(--accent-deep); font-weight: 700; }
.legal-draft {
  background: #fff3d6;
  color: #9a6a14;
  border-radius: 12px;
  padding: 10px 14px;
  font-size: 0.86rem !important;
  font-weight: 600;
}
.legal-updated { margin-top: 24px; color: var(--text-soft); font-size: 0.82rem !important; }

:root {
  --bg: #fff8f1;
  --bg-card: #ffffff;
  --peach: #ffd9b3;
  --peach-deep: #ffb877;
  --pink: #ffc2cf;
  --pink-deep: #ff9bb0;
  --lilac: #d9c8ff;
  --mint: #bfe9d6;
  --text: #4a4039;
  --text-soft: #8a7d72;
  --accent: #ff8a5c;
  --accent-deep: #f2683a;
  --shadow: 0 6px 18px rgba(255, 160, 110, 0.18);
  --radius: 18px;

  /* 돈 관련 1차 CTA = 노란색 대형 버튼(레퍼런스 일치) */
  --yellow: #ffe14d;
  --yellow-deep: #ffd400;
  --yellow-ink: #5a4b00;

  --topbar-h: 56px;
  --tabbar-h: 60px;
  --drawer-w: 320px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  line-height: 1.6;
}
body {
  background-image:
    radial-gradient(circle at 12% 8%, rgba(255, 217, 179, 0.55), transparent 38%),
    radial-gradient(circle at 88% 4%, rgba(217, 200, 255, 0.5), transparent 40%);
  background-attachment: fixed;
  min-height: 100vh;
}

/* 셸이 적용된 화면: 상하단 바 만큼 본문 패딩 */
.app-shell {
  padding-top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  min-height: 100vh;
}

/* 공용 버튼 (main.css 미로드 폴백 포함) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: transform 0.12s ease, opacity 0.12s;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; box-shadow: none; }
.btn-soft {
  background: #fff;
  color: var(--accent-deep);
  border: 2px solid var(--peach-deep);
}

/* 노란 대형 돈 버튼 */
.btn-yellow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 16px 22px;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--yellow-ink);
  background: linear-gradient(135deg, var(--yellow), var(--yellow-deep));
  box-shadow: 0 6px 18px rgba(255, 212, 0, 0.4);
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s ease;
}
.btn-yellow:active { transform: scale(0.98); }
.btn-yellow:disabled { opacity: 0.5; cursor: not-allowed; }

/* ===================== 상단바 ===================== */
.topbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  padding-top: env(safe-area-inset-top, 0px);
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  padding-right: 12px;
  background: rgba(255, 248, 241, 0.92);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 10px rgba(255, 160, 110, 0.12);
  z-index: 80;
}
.topbar-btn {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  border: none;
  background: transparent;
  font-size: 1.4rem;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.topbar-btn svg { width: 24px; height: 24px; }
.topbar-brand {
  flex: 1;
  text-align: center;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--accent-deep);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 별가루 잔액 칩 */
.balance-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 36px;
  padding: 6px 13px;
  border-radius: 999px;
  background: linear-gradient(135deg, #fff3d6, #ffe7a8);
  color: #8a6a14;
  font-weight: 800;
  font-size: 0.95rem;
  text-decoration: none;
  border: 1.5px solid #ffe07a;
  cursor: pointer;
}
.balance-chip .chip-spark { font-size: 1rem; }

/* PC 상단 네비 (모바일 숨김) */
.topbar-nav { display: none; }

/* ===================== 하단 탭바 ===================== */
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom, 0px));
  padding-bottom: env(safe-area-inset-bottom, 0px);
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 -3px 14px rgba(255, 160, 110, 0.16);
  z-index: 70;
}
.tabbar-item {
  flex: 1;
  border: none;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-soft);
  cursor: pointer;
  text-decoration: none;
  padding: 6px 0;
}
.tabbar-item .tab-ico { font-size: 1.3rem; line-height: 1; display: inline-flex; }
.tabbar-item .tab-ico svg { width: 23px; height: 23px; }
.tabbar-item.is-active { color: var(--accent-deep); }

/* ===================== 드로어 ===================== */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(74, 64, 57, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  z-index: 90;
}
.drawer {
  position: fixed;
  top: 0;
  left: 0;            /* 햄버거(☰)가 좌상단 → 드로어도 왼쪽에서 슬라이드 */
  right: auto;
  height: 100%;
  width: min(var(--drawer-w), 86vw);
  background: var(--bg);
  box-shadow: 8px 0 30px rgba(74, 64, 57, 0.2);
  transform: translateX(-100%);
  transition: transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1);
  z-index: 95;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
body.drawer-open .drawer { transform: translateX(0); }
body.drawer-open .drawer-backdrop { opacity: 1; visibility: visible; }

.drawer-head {
  position: relative;
  background: linear-gradient(135deg, #fff0e6, #ffe3d1);
  padding: 20px 18px 18px;
}
.drawer-close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.7);
  font-size: 1.1rem;
  cursor: pointer;
}
.drawer-login {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}
.drawer-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--lilac), #c4b0ff);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
  flex-shrink: 0;
}
.drawer-login-text { min-width: 0; }
.drawer-login-status { font-weight: 800; font-size: 0.98rem; }
.drawer-login-email {
  font-size: 0.82rem;
  color: var(--text-soft);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 별가루 잔액 + 충전 CTA */
.drawer-balance-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: #fff;
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}
.drawer-balance-label { font-size: 0.82rem; color: var(--text-soft); font-weight: 700; }
.drawer-balance-amount { font-size: 1.3rem; font-weight: 800; color: #8a6a14; }
.drawer-charge-btn { margin: 0; }

.drawer-nav { padding: 8px 10px 18px; display: flex; flex-direction: column; gap: 2px; }
.drawer-link {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 12px;
  border-radius: 12px;
  color: var(--text);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.98rem;
  border: none;
  background: transparent;
  width: 100%;
  text-align: left;
  cursor: pointer;
  font-family: inherit;
}
.drawer-link:active { background: #fff1e6; }
.drawer-link .dl-ico { font-size: 1.15rem; width: 24px; text-align: center; }
.drawer-link.is-disabled { color: var(--text-soft); opacity: 0.7; cursor: default; }
.drawer-link .dl-soon {
  margin-left: auto;
  font-size: 0.7rem;
  font-weight: 700;
  color: var(--text-soft);
  background: #f0e6da;
  padding: 2px 8px;
  border-radius: 999px;
}
.drawer-divider { height: 1px; background: #f0e2d4; margin: 8px 12px; }
.drawer-link.danger { color: var(--pink-deep); }

/* ===================== 공통 콘텐츠 래퍼 ===================== */
.page {
  max-width: 560px;
  margin: 0 auto;
  padding: 18px 16px 28px;
}
.page-title { font-size: 1.35rem; font-weight: 800; margin: 6px 0 16px; }
.section-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 18px 16px;
  box-shadow: var(--shadow);
  margin-bottom: 14px;
}
.muted { color: var(--text-soft); }

/* ===================== 랜딩(/welcome) ===================== */
.landing {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px 22px calc(28px + env(safe-area-inset-bottom, 0px));
}
.landing-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border-radius: 24px;
  padding: 30px 24px 28px;
  box-shadow: 0 12px 36px rgba(255, 160, 110, 0.22);
  text-align: center;
}
.landing-logo { font-size: 2.6rem; line-height: 1; }
.landing-brand { font-size: 1.5rem; font-weight: 800; color: var(--accent-deep); margin: 12px 0 4px; }
.landing-sub { color: var(--text-soft); font-size: 0.95rem; margin: 0 0 18px; }

/* 봇체크 카드 */
.botcheck-mascot { font-size: 3rem; line-height: 1; margin-bottom: 8px; }
.botcheck-heading { font-size: 1.2rem; font-weight: 800; margin: 6px 0; }
.botcheck-desc { color: var(--text-soft); font-size: 0.92rem; margin: 0 0 18px; }
.botcheck-spinner {
  width: 40px; height: 40px;
  margin: 4px auto 14px;
  border: 5px solid var(--peach);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: shell-spin 0.9s linear infinite;
}
@keyframes shell-spin { to { transform: rotate(360deg); } }
.cf-turnstile { display: flex; justify-content: center; margin: 12px 0; min-height: 10px; }
.botcheck-terms { font-size: 0.74rem; color: var(--text-soft); margin-top: 14px; }
.botcheck-terms a { color: var(--text-soft); }

/* 로그인 게이트 */
.login-hero { font-size: 3.2rem; line-height: 1; margin-bottom: 6px; }
.login-hero-sub { color: var(--text-soft); font-size: 0.95rem; margin: 0 0 20px; }
.btn-kakao {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border: none;
  border-radius: 14px;
  padding: 16px;
  font-size: 1.08rem;
  font-weight: 800;
  color: #3c1e1e;
  background: #fee500;
  box-shadow: 0 6px 16px rgba(254, 229, 0, 0.4);
  cursor: pointer;
  text-decoration: none;
}
.btn-kakao:active { transform: scale(0.98); }
.login-more-toggle {
  margin-top: 14px;
  background: none;
  border: none;
  color: var(--text-soft);
  font-weight: 700;
  font-size: 0.92rem;
  cursor: pointer;
}
.login-more {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 12px;
}
.login-more.is-open { display: flex; }
.btn-provider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  border-radius: 14px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  border: 1.5px solid #e6ddd2;
}
.btn-google { background: #fff; color: #3c4043; }
.btn-naver { background: #03c75a; color: #fff; border-color: #03c75a; }
.btn-dev {
  margin-top: 18px;
  background: none;
  border: 1px dashed #c9bdb0;
  border-radius: 12px;
  padding: 10px 14px;
  color: var(--text-soft);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

/* 랜딩 단계 전환 */
.step { display: none; }
.step.is-active { display: block; }

/* ===================== 홈 ===================== */
.free-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #fff0e6, #ffe3d1);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
  text-decoration: none;
  color: var(--text);
  box-shadow: var(--shadow);
}
.free-banner-emoji { font-size: 1.8rem; }
.free-banner-title { font-weight: 800; }
.free-banner-sub { font-size: 0.85rem; color: var(--text-soft); }
.free-banner.is-hidden { display: none; }

.create-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 8px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 28px 20px;
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--text);
  margin-bottom: 22px;
  border: 2px dashed var(--peach-deep);
}
.create-card-emoji { font-size: 2.4rem; }
.create-card-title { font-size: 1.2rem; font-weight: 800; color: var(--accent-deep); }
.create-card-sub { font-size: 0.88rem; color: var(--text-soft); }

.home-section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 4px 4px 10px;
}
.home-section-head h2 { font-size: 1.05rem; margin: 0; }
.home-section-head a { font-size: 0.85rem; color: var(--accent-deep); text-decoration: none; font-weight: 700; }

.story-scroller {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 4px 4px 10px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.story-scroller::-webkit-scrollbar { display: none; }
.story-thumb {
  flex: 0 0 132px;
  width: 132px;
  text-decoration: none;
  color: var(--text);
}
.story-thumb-img {
  width: 132px;
  height: 132px;
  border-radius: 14px;
  object-fit: cover;
  background: linear-gradient(135deg, #ffe9d6, #e8def9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
}
.story-thumb-title {
  font-size: 0.85rem;
  font-weight: 700;
  margin-top: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.empty-hint {
  text-align: center;
  color: var(--text-soft);
  font-size: 0.9rem;
  padding: 18px;
}

/* ===================== 홈 대시보드 ===================== */
.home-greeting {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--text);
  margin: 6px 2px 14px;
}
.home-sec-title {
  font-size: 1.05rem;
  margin: 18px 0 10px;
}
.home-sec-count { font-size: 0.85rem; color: var(--text-soft); font-weight: 700; }

/* 이어서 듣기 (최근 1편 강조) */
.home-resume {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
  border-radius: 16px;
  padding: 10px;
  box-shadow: var(--shadow);
}
.home-resume-cover {
  position: relative;
  flex: 0 0 auto;
  width: 84px;
  height: 84px;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(135deg, #ffe9d6, #e8def9);
}
.home-resume-cover img { width: 100%; height: 100%; object-fit: cover; }
.home-resume-ph { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; font-size: 1.8rem; }
.home-resume-play {
  position: absolute;
  right: 6px;
  bottom: 6px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-size: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(242, 104, 58, 0.45);
}
.home-resume-body { min-width: 0; }
.home-resume-title {
  font-size: 1rem;
  font-weight: 800;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.home-resume-meta { font-size: 0.8rem; color: var(--text-soft); margin-top: 3px; }
.home-resume-progress { font-size: 0.78rem; font-weight: 700; color: var(--accent-deep); margin-top: 4px; }

/* ===================== 보관함 필터/정렬 바 ===================== */
.lib-filter-bar {
  position: sticky;
  top: calc(var(--topbar-h) + env(safe-area-inset-top, 0px));
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 -16px 14px;        /* 페이지 좌우 패딩 상쇄 → 풀블리드 */
  padding: 8px 16px;
  background: var(--bg);       /* 스크롤 시 카드 비침 방지 */
}
/* 컨트롤 버튼 (테마 필터 / 정렬) */
.lib-ctrl-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
  padding: 8px 14px;
  font-size: 0.86rem;
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}
.lib-ctrl-filter {
  border: none;
  background: #f3ebff;
  color: var(--accent-deep);
}
.lib-ctrl-sort {
  border: 1.5px solid #f0e2d4;
  background: var(--bg-card);
  color: var(--accent-deep);
}
.lib-caret { font-size: 0.8rem; opacity: 0.7; }
.lib-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
}

/* 적용된 테마 요약 칩 줄 */
.lib-applied {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: -4px 0 14px;
}
.lib-applied-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  font-size: 0.78rem;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  cursor: pointer;
}
.lib-applied-clear {
  border: none;
  background: transparent;
  color: var(--text-soft);
  font-size: 0.78rem;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
.lib-empty-filter {
  text-align: center;
  color: var(--text-soft);
  padding: 40px 16px;
  font-size: 0.92rem;
}

/* ===================== 바텀시트 (테마/정렬) ===================== */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(74, 64, 57, 0.42);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.22s ease, visibility 0.22s ease;
  z-index: 95;
}
.sheet-backdrop.is-open { opacity: 1; visibility: visible; }
.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-width: 560px;
  margin: 0 auto;
  background: var(--bg-card);
  border-radius: 20px 20px 0 0;
  box-shadow: 0 -8px 30px rgba(74, 64, 57, 0.22);
  transform: translateY(100%);
  visibility: hidden;
  transition: transform 0.26s cubic-bezier(0.22, 0.61, 0.36, 1), visibility 0.26s;
  z-index: 96;
  max-height: 76vh;
  display: flex;
  flex-direction: column;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.sheet.is-open { transform: translateY(0); visibility: visible; }
.sheet-handle {
  width: 40px; height: 4px;
  background: #e6d8c8;
  border-radius: 999px;
  margin: 10px auto 4px;
}
.sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 18px 10px;
}
.sheet-title { font-size: 1.02rem; font-weight: 800; }
.sheet-close {
  border: none; background: transparent;
  font-size: 1.1rem; color: var(--text-soft); cursor: pointer;
  width: 36px; height: 36px; border-radius: 50%;
}
.sheet-body { overflow-y: auto; padding: 0 10px 8px; }
.sheet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 0 12px;
  border: none;
  background: transparent;
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
  border-radius: 12px;
  text-align: left;
}
.sheet-row:active { background: #fff1e6; }
.sheet-row-all { border-bottom: 1px solid #f4ece2; margin-bottom: 4px; border-radius: 0; }
.sheet-row-label { flex: 1 1 auto; }
.sheet-check {
  width: 22px; height: 22px;
  border: 2px solid #e0d3c4;
  border-radius: 7px;
  flex: 0 0 auto;
}
.sheet-row.is-checked .sheet-check {
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  border-color: var(--accent-deep);
  position: relative;
}
.sheet-row.is-checked .sheet-check::after {
  content: "✓"; color: #fff; font-size: 0.8rem; font-weight: 900;
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
}
.sheet-radio {
  width: 22px; height: 22px;
  border: 2px solid #e0d3c4;
  border-radius: 50%;
  flex: 0 0 auto;
}
.sheet-row.sheet-row-radio.is-checked .sheet-radio {
  border-color: var(--accent-deep);
  background:
    radial-gradient(circle at center, var(--accent-deep) 0 5px, transparent 6px);
}
.sheet-row.sheet-row-radio.is-checked { color: var(--accent-deep); font-weight: 800; }
.sheet-foot {
  display: flex;
  gap: 10px;
  padding: 10px 18px 16px;
  border-top: 1px solid #f0e2d4;
}
.sheet-reset {
  flex: 0 0 auto;
  padding: 12px 18px;
  border: 1.5px solid #f0e2d4;
  background: var(--bg-card);
  color: var(--text-soft);
  font-weight: 700;
  border-radius: 999px;
  cursor: pointer;
}
.sheet-done {
  flex: 1 1 auto;
  padding: 12px;
  border: none;
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-weight: 800;
  border-radius: 999px;
  cursor: pointer;
}
@media (prefers-reduced-motion: reduce) {
  .sheet, .sheet-backdrop { transition: none; }
}

/* ===================== 보관함 그리드 ===================== */
.library-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}
.library-card {
  text-decoration: none;
  color: var(--text);
  background: var(--bg-card);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow);
}
.library-card-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: linear-gradient(135deg, #ffe9d6, #e8def9);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2rem;
}
.library-card-img-wrap { position: relative; }  /* 언어 뱃지/상태 오버레이 기준 */
.library-card-status {     /* 생성중/실패 표지 오버레이 */
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(74, 64, 57, 0.42);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 700;
}
.library-card-body { padding: 8px 10px 10px; }
.library-card-title {
  font-size: 0.88rem;
  font-weight: 700;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.library-card-meta {       /* 주인공 · 나이 (식별 1순위) */
  font-size: 0.76rem;
  color: var(--text-soft);
  margin-top: 3px;
}
.library-card-theme {      /* 테마(교훈) 칩 */
  display: inline-block;
  margin-top: 6px;
  padding: 2px 9px;
  font-size: 0.7rem;
  font-weight: 700;
  border-radius: 999px;
  background: #f3ebff;
  color: var(--accent-deep);
}

/* ===================== 결제내역 리스트 ===================== */
.list-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 4px;
  border-bottom: 1px solid #f0e2d4;
}
.list-row:last-child { border-bottom: none; }
.list-row-main { font-weight: 700; }
.list-row-sub { font-size: 0.8rem; color: var(--text-soft); }
.list-row-amount { font-weight: 800; }
.badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--mint);
  color: #2f7a58;
}
.badge.pending { background: #fff3d6; color: #9a6a14; }

/* ===================== 계정 정보 ===================== */
.info-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px solid #f0e2d4;
}
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--text-soft); font-weight: 700; }
.info-value { font-weight: 700; text-align: right; word-break: break-all; }

/* ===================== 문의 폼 ===================== */
.form-field { margin-bottom: 16px; }
.form-field label { display: block; font-weight: 700; margin-bottom: 6px; font-size: 0.95rem; }
.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid #f0e2d4;
  border-radius: 12px;
  background: #fffdfb;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
}
.form-field textarea { min-height: 120px; resize: vertical; }
.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
  outline: none;
  border-color: var(--peach-deep);
}

/* ===================== 준비중 플레이스홀더 ===================== */
.soon-wrap {
  text-align: center;
  padding: 48px 20px;
}
.soon-emoji { font-size: 3rem; }
.soon-title { font-size: 1.2rem; font-weight: 800; margin: 10px 0 6px; }
.soon-desc { color: var(--text-soft); }

/* ===================== 충전 화면 ===================== */
.charge-balance {
  text-align: center;
  background: linear-gradient(135deg, #fff3d6, #ffe7a8);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 18px;
}
.charge-balance-label { font-size: 0.85rem; color: #8a6a14; font-weight: 700; }
.charge-balance-amount { font-size: 2rem; font-weight: 800; color: #8a6a14; }

.pkg-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}
.pkg-card {
  position: relative;
  background: var(--bg-card);
  border: 2px solid #f0e2d4;
  border-radius: 16px;
  padding: 18px 14px 16px;
  cursor: pointer;
  text-align: center;
  transition: border-color 0.15s, transform 0.12s;
}
.pkg-card:active { transform: scale(0.98); }
.pkg-card.is-selected {
  border-color: var(--accent);
  background: linear-gradient(135deg, #fffaf5, #fff1e6);
}
.pkg-card.featured { border-color: var(--peach-deep); }
.pkg-best {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  background: linear-gradient(135deg, var(--accent), var(--accent-deep));
  color: #fff;
  font-size: 0.7rem;
  font-weight: 800;
  padding: 3px 12px;
  border-radius: 999px;
  white-space: nowrap;
}
.pkg-amount { font-size: 1.35rem; font-weight: 800; }
.pkg-amount .spark { color: #f0a500; }
.pkg-price { font-size: 1.05rem; font-weight: 700; margin-top: 4px; }
.pkg-unit { font-size: 0.76rem; color: var(--text-soft); margin-top: 4px; }
.pkg-bonus {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #2f7a58;
  background: var(--mint);
  padding: 2px 8px;
  border-radius: 999px;
}
/* 보너스 모델 — 반짝이 보너스/첫구매 뱃지, 잔액 구분 */
.pkg-bonus2 {
  margin-top: 4px;
  font-size: 0.82rem;
  font-weight: 800;
  color: #c47b00;
}
.pkg-firstbonus {
  display: inline-block;
  margin-top: 6px;
  font-size: 0.72rem;
  font-weight: 800;
  color: #b23a6b;
  background: var(--pink, #ffe1ec);
  padding: 2px 8px;
  border-radius: 999px;
}
.charge-balance-amount .spark { color: #f0a500; }
.bal-dot { color: var(--text-soft); margin: 0 4px; }

.charge-foot {
  text-align: center;
  font-size: 0.78rem;
  color: var(--text-soft);
  margin-top: 14px;
}
.charge-foot a { color: var(--text-soft); margin: 0 6px; }

/* 토스트 */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom, 0px));
  transform: translateX(-50%) translateY(20px);
  background: var(--text);
  color: #fff;
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.2s, transform 0.2s, visibility 0.2s;
  z-index: 200;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ===================== PC (>=768px) ===================== */
@media (min-width: 768px) {
  .tabbar { display: none; }
  .app-shell { padding-bottom: 24px; }
  .topbar-nav {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-right: 8px;
  }
  .topbar-nav a {
    padding: 8px 14px;
    border-radius: 999px;
    color: var(--text-soft);
    text-decoration: none;
    font-weight: 700;
    font-size: 0.95rem;
  }
  .topbar-nav a.is-active { color: var(--accent-deep); background: #fff1e6; }
  .library-grid { grid-template-columns: repeat(3, 1fr); }
  .page { max-width: 720px; }
}
