/*
 * 램사주 공통 스타일
 * 색은 태극 로고(app/assets/images/logo.webp, 원본 tmp/icon/logo_src.png)에서 가져왔다: 금박 바탕, 주홍(양), 청색(음).
 *   주홍 --red  : 주요 버튼, 결론 카드, 제목 (마스코트 램의 붉은 털과도 맞는다)
 *   청색 --blue : 클로바, 이미 본 질문, 완료 상태, 포커스 테두리
 *   금색 --gold : 바탕 빛, 반짝이, 가입 선물
 * 순수한 흰색·검정은 쓰지 않는다 (밝은 화면은 금빛이 도는 미색, 어두운 화면은 짙은 남색).
 */

/* ---------- 토큰 ---------- */
:root {
  --bg: #fff7e4;
  --surface: #fffcf4;
  --surface-2: #fdf0cd;
  --glow: rgba(245, 180, 0, .22);
  --ink: #1e2252;
  --ink-2: #2f3672;
  --muted: #857553;
  --line: #f1dfa8;
  --red: #e64500;
  --red-deep: #a83200;
  --red-soft: #ffe2cc;
  --blue: #1f3fd1;
  --blue-deep: #13278f;
  --blue-soft: #e3e8ff;
  --gold: #f5b400;
  --gold-deep: #9a6a00;
  --gold-soft: #fdeebf;
  --on-red: #fff8e8;
  --on-blue: #fff8e8;
  --scrim: rgba(20, 24, 60, .45);
  --shadow: 0 2px 0 rgba(154, 106, 0, .10), 0 10px 28px rgba(154, 106, 0, .10);
  --radius: 22px;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0e1230;
    --surface: #171c42;
    --surface-2: #20265a;
    --glow: rgba(245, 180, 0, .10);
    --ink: #fff1d2;
    --ink-2: #f3dca8;
    --muted: #a9a3c4;
    --line: #2d3470;
    --red: #ff6326;
    --red-deep: #ff9a6b;
    --red-soft: #3d2130;
    --blue: #7a93ff;
    --blue-deep: #adbcff;
    --blue-soft: #1d2a66;
    --gold: #ffc933;
    --gold-deep: #ffd666;
    --gold-soft: #3a3320;
    --on-red: #1a1030;
    --on-blue: #0e1230;
    --scrim: rgba(4, 6, 20, .6);
    --shadow: 0 2px 0 rgba(0, 0, 0, .3);
  }
}
:root[data-theme="dark"] {
  --bg: #0e1230;
  --surface: #171c42;
  --surface-2: #20265a;
  --glow: rgba(245, 180, 0, .10);
  --ink: #fff1d2;
  --ink-2: #f3dca8;
  --muted: #a9a3c4;
  --line: #2d3470;
  --red: #ff6326;
  --red-deep: #ff9a6b;
  --red-soft: #3d2130;
  --blue: #7a93ff;
  --blue-deep: #adbcff;
  --blue-soft: #1d2a66;
  --gold: #ffc933;
  --gold-deep: #ffd666;
  --gold-soft: #3a3320;
  --on-red: #1a1030;
  --on-blue: #0e1230;
  --scrim: rgba(4, 6, 20, .6);
  --shadow: 0 2px 0 rgba(0, 0, 0, .3);
}

/* ---------- 기본 ---------- */
:root { color-scheme: light dark; }
:root[data-theme="light"] { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
[hidden] { display: none !important; }

body {
  margin: 0;
  /* 로고의 금박처럼 위쪽에 금빛이 은은하게 번진다 */
  background: radial-gradient(1100px 520px at 50% -160px, var(--glow), transparent 72%) no-repeat, var(--bg);
  color: var(--ink);
  font: 15.5px/1.7 'Noto Sans KR', system-ui, sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
}
a { color: var(--red-deep); }
img { max-width: 100%; }
h1, h2, h3, .jua { font-family: 'Jua', 'Noto Sans KR', sans-serif; font-weight: 400; letter-spacing: -.01em; }
.muted { color: var(--muted); }
.hint { font-size: 12.5px; color: var(--muted); margin: 10px 0 0; line-height: 1.6; }
.hint:empty { display: none; }
.center { text-align: center; }
code { background: var(--surface-2); padding: 1px 5px; border-radius: 6px; font-size: .9em; }
select:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible, a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 2px;
}

/* ---------- 상단 바 ---------- */
.topbar { position: sticky; top: 0; z-index: 20; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
/* 맨 위 띠: 태극처럼 주홍과 청색이 반씩 */
.topbar::before { content: ""; display: block; height: 3px; background: linear-gradient(90deg, var(--red) 50%, var(--blue) 50%); }
.topbar-inner { max-width: 960px; margin: 0 auto; padding: 8px 16px; display: flex; align-items: center; gap: 12px; }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); }
.brand img { width: 30px; height: 30px; border-radius: 50%; box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--gold); transition: transform .7s cubic-bezier(.3, 1.4, .5, 1); }
.brand:hover img { transform: rotate(180deg); }
.brand b { font: 400 22px/1 'Jua', sans-serif; }
@media (prefers-reduced-motion: reduce) { .brand img { transition: none; } }
.nav { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.nav a:not(.btn) { padding: 6px 12px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 500; font-size: 14.5px; }
.nav a[aria-current="page"]:not(.btn) { background: var(--red-soft); color: var(--red-deep); }
.theme-toggle { width: 36px; height: 36px; border-radius: 50%; border: 0; background: transparent; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
}

/* 휴대폰: 상단 메뉴 대신 하단 탭 */
.tabbar { display: none; }
@media (max-width: 720px) {
  .nav .wide { display: none; }
  body.has-tabbar { padding-bottom: calc(68px + env(safe-area-inset-bottom)); }
  .tabbar {
    display: grid; grid-template-columns: repeat(4, 1fr);
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 30;
    background: var(--surface); border-top: 1px solid var(--line);
    padding-bottom: env(safe-area-inset-bottom);
  }
  .tabbar a { text-align: center; padding: 7px 0 6px; font-size: 12px; text-decoration: none; color: var(--muted); font-weight: 500; }
  .tabbar a .ti { display: block; font-size: 21px; line-height: 1.25; filter: grayscale(.6); opacity: .75; }
  .tabbar a[aria-current="page"] { color: var(--red); }
  .tabbar a[aria-current="page"] .ti { filter: none; opacity: 1; transform: scale(1.08); }
}

/* ---------- 알림 ---------- */
.flash { max-width: 640px; margin: 14px auto 0; padding: 0 16px; }
.flash p { margin: 0 0 6px; padding: 11px 16px; border-radius: 16px; background: var(--blue-soft); color: var(--ink); font-size: 14px; font-weight: 500; }
.flash p.alert { background: var(--red-soft); }
.notice-box { padding: 12px 14px; border-radius: 14px; background: var(--gold-soft); font-size: 13.5px; margin: 0 0 12px; }
.warn { padding: 12px 14px; border-radius: 14px; background: var(--red-soft); font-size: 13.5px; }
.errors { padding: 12px 16px; border-radius: 14px; background: var(--red-soft); margin-bottom: 16px; font-size: 14px; }
.errors ul { margin: 0; padding-left: 18px; }

/* ---------- 레이아웃 ---------- */
main { min-height: 60vh; }
.page { max-width: 960px; margin: 0 auto; padding: 22px 16px 40px; }
.page.narrow { max-width: 560px; }
.stack { display: flex; flex-direction: column; gap: 16px; }
.page-title { font-size: 28px; margin: 6px 0 0; color: var(--ink); }
.group-title { font-size: 20px; margin: 0 0 12px; color: var(--ink-2); }
.card { background: var(--surface); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); border: 1px solid var(--line); }
.card-title { font-size: 19px; margin: 0 0 10px; color: var(--red); }
.card > :last-child { margin-bottom: 0; }

footer.site { max-width: 640px; margin: 0 auto; padding: 24px 16px 32px; text-align: center; font-size: 12px; color: var(--muted); line-height: 1.7; }
footer.site nav { display: flex; justify-content: center; gap: 16px; margin-bottom: 8px; }
footer.site a { color: var(--muted); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 44px; padding: 0 18px; border-radius: 999px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  font: 700 15px 'Noto Sans KR', sans-serif; text-decoration: none; cursor: pointer;
  transition: transform .08s ease, filter .15s ease;
}
.btn:active { transform: translateY(2px); }
.btn:disabled { opacity: .5; cursor: default; }
.btn-primary { background: var(--red); border-color: var(--red); color: var(--on-red); box-shadow: 0 4px 0 var(--red-deep); }
.btn-primary:active { box-shadow: 0 2px 0 var(--red-deep); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-lg { min-height: 54px; font-size: 16.5px; padding: 0 24px; }
.btn-sm { min-height: 34px; padding: 0 14px; font-size: 13.5px; }
.btn-block { display: flex; width: 100%; }
.btn-danger { border-color: var(--red); color: var(--red-deep); }
.btn-kakao { background: #fee500; border-color: #fee500; color: #3a1d1d; }
.link-btn { background: none; border: 0; padding: 6px; color: var(--muted); font: inherit; font-size: 13px; text-decoration: underline; cursor: pointer; display: inline-block; }
form.inline { display: inline; }
.actions { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- 입력 ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 18px; }
.label { font-weight: 700; font-size: 14px; color: var(--ink-2); }
input[type="text"], select {
  width: 100%; min-height: 46px; padding: 0 14px; border-radius: 14px;
  border: 2px solid var(--line); background: var(--surface); color: var(--ink);
  font: 500 15px 'Noto Sans KR', sans-serif;
}
input[type="text"]:focus, select:focus { border-color: var(--red); outline: none; }
.row { display: grid; grid-template-columns: repeat(auto-fit, minmax(80px, 1fr)); gap: 8px; }
.seg { display: flex; gap: 6px; background: var(--surface-2); padding: 4px; border-radius: 16px; }
.seg label { position: relative; flex: 1; }
.seg input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.seg span { display: block; text-align: center; padding: 9px 0; border-radius: 12px; cursor: pointer; user-select: none; font-weight: 500; color: var(--muted); }
.seg input:checked + span { background: var(--red); color: var(--on-red); font-weight: 700; box-shadow: 0 2px 0 var(--red-deep); }
.seg input:focus-visible + span { outline: 3px solid var(--blue); }
.check { display: inline-flex; gap: 8px; align-items: center; cursor: pointer; user-select: none; font-size: 14px; margin: 4px 0; }
.check input { width: 18px; height: 18px; accent-color: var(--red); margin: 0; }
details.options { margin: 0 0 18px; padding: 12px 14px; border-radius: 16px; background: var(--surface-2); }
details.options summary { cursor: pointer; font-size: 13.5px; color: var(--muted); font-weight: 500; }
details.options[open] summary { margin-bottom: 14px; }
details.options .field:last-child { margin-bottom: 0; }

/* ---------- 램 ---------- */
.mongle { position: relative; display: block; flex: 0 0 auto; }
.mongle img { display: block; width: 100%; height: auto; filter: drop-shadow(0 6px 6px rgba(168, 35, 42, .18)); user-select: none; -webkit-user-drag: none; }
.mongle.bounce { animation: mongle-bounce 2.4s ease-in-out infinite; transform-origin: 50% 100%; }
.mongle-happy img { animation: mongle-wave 1.8s ease-in-out infinite; transform-origin: 50% 90%; }
.mongle-sad img { transform: rotate(-8deg) translateY(4px); filter: saturate(.75) drop-shadow(0 4px 4px rgba(30, 34, 82, .2)); }
.mongle .sparkle { position: absolute; color: var(--gold); font-size: 22px; line-height: 1; animation: mongle-twinkle 1.6s ease-in-out infinite; }
.mongle .sparkle.s1 { top: 2%; right: -6%; }
.mongle .sparkle.s2 { top: 30%; left: -10%; font-size: 15px; animation-delay: .5s; }
.mongle .sparkle.s3 { top: 52%; right: -12%; font-size: 13px; animation-delay: 1s; }
@keyframes mongle-bounce { 0%, 100% { transform: translateY(0) scale(1, 1); } 45% { transform: translateY(-7px) scale(.98, 1.02); } 55% { transform: translateY(-7px); } 90% { transform: translateY(0) scale(1.03, .97); } }
@keyframes mongle-wave { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes mongle-twinkle { 0%, 100% { opacity: .2; transform: scale(.6); } 50% { opacity: 1; transform: scale(1.1); } }
@media (prefers-reduced-motion: reduce) {
  .mongle, .mongle * { animation: none !important; }
}

/* 말풍선 */
.bubble, .hero-bubble {
  position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: 18px;
  padding: 10px 14px; font: 400 16px/1.4 'Jua', sans-serif; color: var(--ink-2); box-shadow: var(--shadow);
}

/* ---------- 소개 화면 ---------- */
/* 세 덩어리로 간격을 맞춘다: 말풍선+램 / 제목+안내문 / 선물+가입 버튼. 덩어리 사이 28px, 덩어리 안은 좁게 */
.hero { text-align: center; padding: 28px 16px 4px; display: flex; flex-direction: column; align-items: center; }
.hero-bubble { margin-bottom: 18px; } /* 꼬리(9px) 아래로 램이 튀어 올라도(7px) 닿지 않게 */
.hero-bubble::after { content: ""; position: absolute; left: 50%; bottom: -9px; width: 14px; height: 14px; background: var(--surface); border-right: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translateX(-50%) rotate(45deg); }
.hero h1 { font-size: 44px; line-height: 1.15; color: var(--red); margin: 16px 0 8px; }
.hero-lead { font-size: 17px; line-height: 1.65; margin: 0 0 28px; color: var(--ink-2); }
.hero .gift-banner { margin: 0 auto 14px; }
.hero .hint { margin-top: 12px; }
.hero-lead b { color: var(--red); }
.hero-actions .btn { min-width: 240px; }
.how { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 10px 0 30px; }
.how > div { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 10px; text-align: center; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.how-no { width: 26px; height: 26px; border-radius: 50%; background: var(--red); color: var(--on-red); font: 400 15px/26px 'Jua', sans-serif; margin-bottom: 4px; }
/* 세 단계 번호를 로고의 세 색으로 */
.how > div:nth-child(2) .how-no { background: var(--blue); color: var(--on-blue); }
.how > div:nth-child(3) .how-no { background: var(--gold); color: var(--ink); }
.how b { font-size: 14.5px; }
.how small { font-size: 12px; color: var(--muted); line-height: 1.4; }

/* ---------- 질문 카드 ---------- */
.q-group { margin-bottom: 26px; }
.q-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
/* 질문 묶음은 6개씩: 휴대폰 2열×3줄, PC 3열×2줄로 빈칸 없이 채운다. 좁은 화면(답변·질문 화면 아래 추천 4개)은 2열 */
.q-grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (max-width: 640px) { .q-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; } }
.q-card {
  position: relative; display: flex; flex-direction: column; gap: 4px;
  background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius);
  padding: 16px 14px 14px; text-decoration: none; color: var(--ink);
  box-shadow: var(--shadow); transition: transform .12s ease, border-color .12s ease;
  min-height: 132px;
}
.q-card:hover { transform: translateY(-3px); border-color: var(--red); }
.q-card:active { transform: translateY(0); }
.q-emoji { font-size: 30px; line-height: 1.1; }
.q-title { font: 400 18px/1.35 'Jua', sans-serif; color: var(--ink); }
.q-teaser { font-size: 12.5px; color: var(--muted); line-height: 1.45; flex: 1; }
.q-head { display: flex; align-items: center; justify-content: space-between; gap: 6px; margin-bottom: 2px; }
/* 이모지와 같은 줄 오른쪽. 클로바 그림은 글리프 좌우 여백이 있어 글자 쪽 간격(gap)과 안쪽 여백으로 맞춘다 */
.q-price { display: inline-flex; align-items: center; gap: 3px; padding: 3px 10px; border-radius: 999px; background: var(--red-soft); color: var(--red-deep); font-weight: 700; font-size: 13px; line-height: 1.4; white-space: nowrap; }
.q-clover { font-size: 12px; line-height: 1; margin-left: -3px; } /* 🍀 글리프 왼쪽 여백(약 3px)만큼 당겨 좌우를 맞춘다 */
.q-love .q-emoji { filter: drop-shadow(0 2px 0 var(--red-soft)); }
/* 묶음의 인기 1위 (매일 00시 계산해 맨 앞에 둔다) */
.q-card.popular { border-color: var(--gold); }
.q-hot { position: absolute; top: -10px; left: 12px; padding: 1px 9px; border-radius: 999px; background: var(--gold); color: var(--ink); font-size: 11.5px; font-weight: 700; line-height: 1.6; box-shadow: 0 2px 0 var(--gold-deep); }
.q-card.done { border-color: var(--blue); background: linear-gradient(var(--blue-soft), var(--surface) 60%); }
.q-card.done .q-price { background: var(--blue); color: var(--on-blue); }

/* ---------- 홈 인사 ---------- */
.greet { display: flex; align-items: center; gap: 14px; margin: 4px 0 24px; }
.greet .mongle { flex: 0 0 auto; }
.speech { position: relative; background: var(--surface); border: 2px solid var(--line); border-radius: 20px; padding: 12px 16px; box-shadow: var(--shadow); }
.speech::before { content: ""; position: absolute; left: -9px; top: 50%; width: 14px; height: 14px; background: var(--surface); border-left: 2px solid var(--line); border-bottom: 2px solid var(--line); transform: translateY(-50%) rotate(45deg); }
.speech b { display: block; font: 400 20px/1.35 'Jua', sans-serif; color: var(--ink); }
.speech small { display: block; margin-top: 4px; font-size: 12.5px; color: var(--muted); }
.speech small a { color: var(--muted); }

/* ---------- 질문 소개 ---------- */
.ask { text-align: center; padding: 10px 0 0; }
.ask-emoji { font-size: 46px; display: block; }
.ask h1 { font-size: 30px; margin: 4px 0 2px; color: var(--red); }
.ask .muted { margin: 0; }
.ask-mongle { display: flex; align-items: flex-end; justify-content: center; gap: 4px; margin-top: 14px; }
.ask-mongle .bubble { margin-bottom: 70px; text-align: left; font-size: 15px; }
.check-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.check-list li { display: flex; gap: 10px; align-items: center; font-weight: 500; }
.check-list li::before { content: "✓"; flex: 0 0 24px; height: 24px; border-radius: 50%; background: var(--blue-soft); color: var(--blue-deep); font-weight: 700; text-align: center; line-height: 24px; font-size: 13px; }
.pay-box { display: flex; flex-direction: column; gap: 12px; }
.pay-box .hint { margin: 0; }
.price-row { display: flex; justify-content: space-between; align-items: baseline; }
.price-row .price { font: 400 30px/1 'Jua', sans-serif; color: var(--red); }
#payment-methods:empty, #payment-agreement:empty { display: none; }

/* ---------- 답변 ---------- */
.verdict {
  background: var(--red); color: var(--on-red); border-radius: 26px; padding: 20px 20px 18px;
  box-shadow: 0 6px 0 var(--red-deep);
}
.verdict-q { font-size: 14px; font-weight: 700; opacity: .9; }
.verdict-row { display: flex; align-items: center; gap: 12px; margin: 10px 0 6px; }
.verdict-row .mongle { flex: 0 0 auto; background: var(--surface); border-radius: 50%; padding: 6px; }
.verdict-a { margin: 0; font: 400 25px/1.35 'Jua', sans-serif; }
.verdict-body { font-size: 15px; }
.verdict-body p { margin: 8px 0 0; }
.verdict-body strong { color: inherit; text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 3px; }
.answer-card .headline { font: 400 18px/1.45 'Jua', sans-serif; margin: 0 0 8px; color: var(--ink); }
.rd-body p { margin: 0 0 10px; }
.rd-body ul { margin: 0 0 10px; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 8px; }
.rd-body li { position: relative; padding: 10px 12px 10px 34px; background: var(--surface-2); border-radius: 14px; }
.rd-body li::before { content: "🐾"; position: absolute; left: 10px; top: 10px; font-size: 14px; }
.rd-body strong { color: var(--red-deep); }
.rd-body > :last-child { margin-bottom: 0; }
.answer-card.yin .card-title, .answer-card.yin .rd-body strong { color: var(--blue); }
.answer-card.yin .rd-body li { background: var(--blue-soft); }

/* 작성 중·빈 화면 */
.waiting { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 26px 16px; background: var(--surface); border-radius: var(--radius); border: 1px solid var(--line); box-shadow: var(--shadow); }
.waiting > b { font: 400 21px/1.4 'Jua', sans-serif; color: var(--ink); }
.waiting p { margin: 0; }
.waiting .verdict-q { color: var(--muted); }
.dots::after { content: ""; display: inline-block; width: 1.2em; text-align: left; animation: dots 1.4s steps(4) infinite; }
@keyframes dots { 0% { content: ""; } 25% { content: "."; } 50% { content: ".."; } 75% { content: "..."; } }
.rd-progress { width: min(260px, 80%); height: 12px; border-radius: 999px; background: var(--surface-2); overflow: hidden; }
.rd-progress span { display: block; height: 100%; border-radius: 999px; background: var(--red); transition: width .4s ease; }
.rd-progress span.indeterminate { width: 40%; animation: slide 1.3s ease-in-out infinite; }
@keyframes slide { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }

/* 공유 */
.share-box input { margin-bottom: 10px; font-size: 13px; }
.share-box .actions .btn { flex: 1 1 auto; }

/* 내 답변 목록 */
.answer-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.answer-list a { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 2px solid var(--line); border-radius: 20px; text-decoration: none; color: var(--ink); box-shadow: var(--shadow); }
.answer-list a:hover { border-color: var(--red); }
.answer-list .q-emoji { font-size: 28px; }
.answer-list .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.answer-list .title { font: 400 17px/1.35 'Jua', sans-serif; }
.answer-list .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.answer-list .date { font-size: 12px; color: var(--muted); }

/* 공유받은 화면의 권유 */
.cta { text-align: center; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.cta > b { font: 400 22px/1.3 'Jua', sans-serif; }
.cta p { margin: 0 0 6px; }

/* ---------- 로그인 ---------- */
.login-box { text-align: center; display: flex; flex-direction: column; align-items: center; }
.login-box h1 { font-size: 30px; margin: 6px 0 0; color: var(--red); }
.login-box > .muted { margin: 2px 0 20px; }
.login-box form { width: 100%; }
.login-btn { display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; height: 52px; border-radius: 16px; border: 0; font: 700 15.5px 'Noto Sans KR', sans-serif; cursor: pointer; margin-bottom: 10px; }
.login-btn.kakao { background: #fee500; color: #3a1d1d; }
.login-btn.naver { background: #03c75a; color: #fff; }
.login-btn.apple { background: #1d1d1f; color: #fff; }
.login-btn.google_oauth2 { background: #fff; border: 1px solid #dadce0; color: #1f1f1f; }
.login-btn .logo { font-weight: 900; width: 20px; text-align: center; }
.dev-login { display: flex; flex-direction: column; gap: 10px; text-align: left; }

/* ---------- 내 정보 ---------- */
dl.info { margin: 0 0 14px; display: flex; flex-direction: column; gap: 6px; }
dl.info > div { display: flex; gap: 12px; }
dl.info dt { flex: 0 0 64px; color: var(--muted); font-size: 14px; }
dl.info dd { margin: 0; font-weight: 500; }
.dot-list { margin: 0 0 16px; padding-left: 20px; line-height: 1.8; }
details.more summary { cursor: pointer; font-weight: 700; color: var(--ink-2); }
details.more[open] summary { margin-bottom: 12px; }
.ledger { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.ledger th { text-align: left; color: var(--muted); font-weight: 500; padding: 6px 4px; border-bottom: 1px solid var(--line); }
.ledger td { padding: 8px 4px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.ledger .num { text-align: right; white-space: nowrap; }

/* ---------- 약관 ---------- */
.article h1 { font-size: 26px; margin: 0 0 12px; color: var(--red); }
.article h2 { font-size: 18px; margin: 22px 0 8px; }
.article ul { padding-left: 20px; }
.article table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.article td, .article th { border: 1px solid var(--line); padding: 6px 8px; text-align: left; }

/* ---------- 관리 ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.stats > div { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; }
.stats small { color: var(--muted); }
.stats b { font: 400 24px/1.3 'Jua', sans-serif; }
.stats b.sm { font: 700 13px/1.5 'Noto Sans KR', sans-serif; }
.stats span { font-size: 12.5px; color: var(--muted); }
/* 관리 화면: 메뉴, 기간, 지표, 차트 */
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.admin-nav { display: flex; gap: 4px; background: var(--surface-2); padding: 4px; border-radius: 999px; }
.admin-nav a { padding: 6px 14px; border-radius: 999px; text-decoration: none; color: var(--ink-2); font-weight: 700; font-size: 14px; }
.admin-nav a[aria-current="page"] { background: var(--surface); color: var(--red-deep); box-shadow: var(--shadow); }
.admin-nav .count { display: inline-block; min-width: 18px; padding: 0 5px; border-radius: 999px; background: var(--red); color: var(--on-red); font-size: 11.5px; line-height: 18px; text-align: center; }
.admin-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.admin-toolbar .btn { margin-left: auto; }
.period { display: flex; gap: 6px; }
.period a { padding: 5px 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); color: var(--ink-2); text-decoration: none; font-weight: 700; font-size: 13px; }
.period a[aria-current="page"] { border-color: var(--blue); background: var(--blue); color: var(--on-blue); }
.admin .card .stats { margin-bottom: 16px; }
.admin .stats > div, .admin .stats .stat-link { gap: 1px; }
.delta { font-size: 12px; font-weight: 700; }
.delta em { font-style: normal; font-weight: 400; color: var(--muted); }
.delta.good { color: var(--blue); }
.delta.bad { color: var(--red-deep); }
.delta.flat { color: var(--muted); }
.sub-title { font: 700 15px/1.4 'Noto Sans KR', sans-serif; margin: 0 0 6px; color: var(--ink-2); }
.admin-cols { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; margin-top: 18px; }
.admin-search { display: flex; gap: 8px; }
.admin-search input { flex: 1; }
.admin-grant { display: flex; gap: 8px; flex-wrap: wrap; }
.admin-grant select { width: auto; }
.admin-grant input { flex: 1; min-width: 180px; }

/* 날짜별 막대 차트: 막대 ≤ 24px, 위쪽만 4px 둥글게, 막대 사이 2px, 가는 기준선. 칸 전체가 마우스·키보드 대상 */
.chart { margin: 0; }
.chart figcaption { display: flex; justify-content: space-between; align-items: baseline; font-size: 13.5px; margin-bottom: 6px; }
.chart-plot { position: relative; height: 150px; padding-top: 18px; }
.chart-max { position: absolute; top: 0; left: 0; font-size: 11px; color: var(--muted); }
.chart-bars { display: flex; align-items: flex-end; gap: 2px; height: 100%; border-bottom: 1px solid var(--line); background: linear-gradient(var(--line), var(--line)) top / 100% 1px no-repeat; }
.chart-col { position: relative; flex: 1 1 0; height: 100%; display: flex; align-items: flex-end; justify-content: center; outline: none; cursor: default; }
.chart-fill { display: block; width: 100%; max-width: 24px; min-height: 0; border-radius: 4px 4px 0 0; background: var(--chart); transition: filter .1s; }
.chart-blue { --chart: var(--blue); }
.chart-red { --chart: var(--red); }
.chart-col:hover .chart-fill, .chart-col:focus-visible .chart-fill { filter: brightness(1.15); }
.chart-col:hover::after, .chart-col:focus-visible::after {
  content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%); z-index: 2;
  padding: 4px 9px; border-radius: 8px; background: var(--ink); color: var(--bg); font-size: 12px; white-space: nowrap; pointer-events: none;
}
.chart-col.end:hover::after, .chart-col.end:focus-visible::after { left: auto; right: 0; transform: none; }
.chart-col:hover::before, .chart-col:focus-visible::before { content: ""; position: absolute; inset: 0; background: color-mix(in srgb, var(--chart) 8%, transparent); border-radius: 4px; }
.chart-x { display: flex; justify-content: space-between; font-size: 11px; color: var(--muted); margin-top: 4px; }
.chart-table { margin-top: 6px; font-size: 13px; }
.chart-table summary { cursor: pointer; color: var(--muted); font-size: 12.5px; }
.chart-table table { margin-top: 6px; max-height: 260px; display: block; overflow: auto; }

/* 가입부터 첫 결제까지 */
.funnel { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.funnel li { display: grid; grid-template-columns: 9.5em 1fr auto; align-items: center; gap: 10px; font-size: 13.5px; }
.funnel-bar { height: 10px; border-radius: 999px; background: var(--blue-soft); overflow: hidden; }
.funnel-bar span { display: block; height: 100%; border-radius: 999px; background: var(--blue); }
.funnel-num { text-align: right; font-weight: 700; white-space: nowrap; }
.funnel-num small { color: var(--muted); font-weight: 400; margin-left: 2px; }
@media (max-width: 520px) { .funnel li { grid-template-columns: 1fr auto; } .funnel-bar { grid-column: 1 / -1; grid-row: 2; } }

/* 인기 질문 */
.rank-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 18px; margin-top: 10px; }
.rank-table td:first-child { white-space: nowrap; }
.rank-table tr.lead td { background: var(--gold-soft); font-weight: 700; }

pre.json { font-size: 12px; overflow: auto; max-height: 480px; background: var(--surface-2); padding: 12px; border-radius: 12px; }

/* ---------- 확인 창 (confirm_dialog.js) ---------- */
.confirm-dialog { width: min(360px, calc(100vw - 32px)); padding: 22px 20px 18px; border: 0; border-radius: 22px; background: var(--surface); color: var(--ink); box-shadow: 0 12px 40px var(--scrim); }
.confirm-dialog::backdrop { background: var(--scrim); }
.confirm-dialog p { margin: 0 0 18px; font-size: 15px; line-height: 1.6; }
.confirm-dialog .actions { display: flex; justify-content: flex-end; gap: 8px; }
.confirm-dialog .btn-primary { min-height: 40px; padding: 0 18px; border-radius: 999px; border: 0; font-weight: 700; }
.confirm-dialog .btn { min-height: 40px; }

/* 결론 카드 안의 목록 */
.verdict-body ul { margin: 10px 0 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 6px; }
.verdict-body li { padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--on-red) 16%, transparent); }

/* ---------- 궁합 ---------- */
.group-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.group-link { font-size: 13px; font-weight: 700; color: var(--red-deep); text-decoration: none; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { display: inline-flex; flex-direction: column; align-items: flex-start; padding: 8px 14px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; line-height: 1.3; }
.chip b { font-size: 15px; }
.chip small { font-size: 11.5px; color: var(--muted); }
.chip[aria-current="true"] { border-color: var(--red); background: var(--red-soft); }
.chip[aria-current="true"] b { color: var(--red-deep); }
.chip-add { border-style: dashed; color: var(--muted); }
.chip-radio { position: relative; }
.chip-radio input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip-radio span { display: block; padding: 7px 14px; border-radius: 999px; border: 2px solid var(--line); background: var(--surface); font-size: 14px; font-weight: 500; cursor: pointer; }
.chip-radio input:checked + span { border-color: var(--red); background: var(--red); color: var(--on-red); font-weight: 700; }
.chip-radio input:focus-visible + span { outline: 3px solid var(--blue); }
.pair-names { margin: 14px 0 0; text-align: center; font: 400 20px/1.3 'Jua', sans-serif; }
.pair-names span { margin: 0 6px; }
.verdict-pair { display: flex; align-items: center; justify-content: center; gap: 8px; margin: 12px 0 2px; font: 400 20px/1.2 'Jua', sans-serif; }
.verdict-pair .score { margin-left: 8px; padding: 4px 12px; border-radius: 999px; background: var(--surface); color: var(--red); font-size: 26px; }
.verdict-pair .score small { font-size: 14px; margin-left: 1px; }
.partner-list .row-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: var(--surface); border: 2px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.partner-list .tag { font: 500 11.5px 'Noto Sans KR', sans-serif; color: var(--red-deep); background: var(--red-soft); padding: 1px 8px; border-radius: 999px; margin-left: 4px; vertical-align: 2px; }
.partner-list .sub { white-space: normal; }
.mini-actions { display: flex; flex-direction: column; gap: 6px; }
form.center { text-align: center; }

/* ---------- 건의하기 ---------- */
textarea {
  width: 100%; padding: 12px 14px; border-radius: 14px; border: 2px solid var(--line);
  background: var(--surface); color: var(--ink); font: 500 15px/1.6 'Noto Sans KR', sans-serif; resize: vertical;
}
textarea:focus { border-color: var(--red); outline: none; }
.suggestion-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.suggestion-head .tag { font-size: 12.5px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--surface-2); }
.suggestion-head .date { margin-left: auto; font-size: 12px; color: var(--muted); }
.status { font-size: 12px; font-weight: 700; padding: 2px 10px; border-radius: 999px; background: var(--gold-soft); color: var(--ink-2); }
.status-done { background: var(--blue-soft); color: var(--blue-deep); }
.suggestion-body { margin: 0 0 10px; white-space: normal; }
.reply { padding: 12px 14px; border-radius: 16px; background: var(--red-soft); }
.reply p { margin: 4px 0 0; }
.stats .stat-link { text-decoration: none; color: inherit; background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 14px 16px; display: flex; flex-direction: column; }
.stats .stat-link:hover { border-color: var(--red); }

/* ---------- 클로바 ---------- */
.clover-chip { display: inline-flex; align-items: center; gap: 4px; padding: 5px 11px !important; border-radius: 999px; background: var(--blue-soft); color: var(--blue-deep) !important; font-size: 14px; text-decoration: none; font-weight: 700; }
.clover-chip b { font-family: 'Jua', sans-serif; font-weight: 400; font-size: 16px; }
.clover-line { color: var(--blue-deep); text-decoration: none; }
.clover-hero { display: flex; align-items: center; justify-content: center; gap: 14px; padding: 18px; border-radius: var(--radius); background: var(--blue-soft); }
.clover-big { font-size: 46px; line-height: 1; }
.clover-hero small { display: block; color: var(--blue-deep); font-size: 13px; }
.clover-hero b { font-family: 'Jua', sans-serif; font-weight: 400; font-size: 32px; color: var(--blue-deep); }
.package-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; margin-bottom: 14px; }
@media (max-width: 420px) { .package-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
.package { position: relative; display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 14px 6px 10px; border-radius: 16px; border: 2px solid var(--line); background: var(--surface); color: var(--ink); text-decoration: none; }
.package b { font-family: 'Jua', sans-serif; font-weight: 400; font-size: 20px; }
.package small { color: var(--muted); font-size: 12.5px; }
.package[aria-current="true"] { border-color: var(--blue); background: var(--blue-soft); }
.package[aria-current="true"] b { color: var(--blue-deep); }
.package-badge { position: absolute; top: -9px; left: 50%; transform: translateX(-50%); padding: 1px 8px; border-radius: 999px; background: var(--red); color: var(--on-red); font-size: 11px; font-weight: 700; white-space: nowrap; }
.clover-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.clover-row b { font-family: 'Jua', sans-serif; font-weight: 400; font-size: 24px; color: var(--blue-deep); }
.clover-mini { list-style: none; margin: 12px 0 4px; padding: 0; font-size: 13.5px; }
.clover-mini li { display: flex; justify-content: space-between; padding: 6px 0; border-top: 1px dashed var(--line); }
.plus { color: var(--blue-deep); font-weight: 700; }
.minus { color: var(--muted); font-weight: 700; }
.ledger .tag { font-size: 11.5px; font-weight: 700; padding: 1px 8px; border-radius: 999px; background: var(--surface-2); margin-right: 2px; }

/* 가입 선물 홍보 (첫 화면·공유 화면·질문 화면) */
.gift-banner { display: flex; align-items: center; gap: 12px; margin: 16px auto 4px; max-width: 360px; padding: 12px 16px; border-radius: 18px; border: 2px dashed var(--gold); background: var(--gold-soft); text-align: left; }
.gift-banner p { margin: 0; font-size: 14px; line-height: 1.55; color: var(--ink); }
.gift-banner b { color: var(--gold-deep); }
.gift-icon { font-size: 30px; line-height: 1; animation: gift-wiggle 2.4s ease-in-out infinite; }
@keyframes gift-wiggle { 0%, 80%, 100% { transform: rotate(0); } 85% { transform: rotate(-12deg); } 90% { transform: rotate(10deg); } 95% { transform: rotate(-6deg); } }
@media (prefers-reduced-motion: reduce) { .gift-icon { animation: none; } }
.gift-strip { display: block; text-align: center; padding: 10px 14px; border-radius: 14px; background: var(--gold-soft); color: var(--gold-deep); font-size: 14px; text-decoration: none; }
.gift-note { margin: 10px 0 0; font-size: 13px; color: var(--gold-deep); text-align: center; }
