/* 한글 가독성이 좋은 Pretendard. 못 받아오면 아래 시스템 폰트로 떨어진다. */
@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/variable/pretendardvariable-dynamic-subset.css');

* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  /* 배경 — 아래로 갈수록 깊어진다 */
  --bg-0: #070b11;
  --bg-1: #0d141d;

  /* 표면 */
  --surface: rgba(255, 255, 255, 0.05);
  --surface-2: rgba(255, 255, 255, 0.08);
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);

  /* 강조색 */
  --accent: #4ade80;
  --accent-2: #22d3ee;
  --accent-soft: rgba(74, 222, 128, 0.18);
  --grad-accent: linear-gradient(115deg, #4ade80 0%, #34d399 52%, #22d3ee 100%);
  --on-accent: #04240f;

  --danger: #fb7185;

  /* 글자 */
  --text: #eef4f8;
  --text-dim: #93a7b5;
  --text-mute: #6b8090;

  /* 그림자 */
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.45);
  --shadow-lg: 0 26px 64px rgba(0, 0, 0, 0.55);
  --glow: 0 8px 24px rgba(74, 222, 128, 0.22);

  --radius: 16px;
}

html { height: 100%; }

/* 배경 그라데이션은 화면에 고정된 레이어로 깐다.
   background-attachment: fixed 는 긴 페이지를 스크롤할 때
   일부 환경에서 제대로 그려지지 않아 이 방식을 쓴다. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-color: var(--bg-0);
  background-image:
    radial-gradient(68% 52% at 10% -6%, rgba(74, 222, 128, 0.14), transparent 62%),
    radial-gradient(58% 46% at 94% 6%, rgba(34, 211, 238, 0.11), transparent 64%),
    radial-gradient(96% 60% at 50% 108%, rgba(52, 211, 153, 0.07), transparent 62%),
    linear-gradient(180deg, var(--bg-1) 0%, var(--bg-0) 72%);
}

body {
  min-height: 100%;
  background-color: var(--bg-0);
  color: var(--text);
  font-family: 'Pretendard Variable', Pretendard, -apple-system, BlinkMacSystemFont,
    system-ui, 'Apple SD Gothic Neo', 'Noto Sans KR', 'Malgun Gothic', sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  letter-spacing: -0.01em;
}

/* 카운터 화면(index.html)만 창에 딱 맞추고 스크롤을 없앤다.
   소개·개인정보처리방침 같은 글 페이지는 평범하게 스크롤된다. */
body.app {
  height: 100%;
  overflow: hidden;
  user-select: none;
  display: flex;
  flex-direction: column;
}

/* 브라우저로 열었을 때는 카운터 아래에 소개 글이 이어진다.
   앱으로 설치해 연 창에서는 .web 이 붙지 않아 위 규칙 그대로 동작한다. */
body.app.web {
  height: auto;
  overflow: visible;
  user-select: auto;
}

body.app.web .widget { min-height: min(78vh, 620px); }

.home-content { display: none; }

body.app.web .home-content {
  display: block;
  margin-top: 8px;
  padding-top: 34px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}

.home-content h2 { margin-top: 42px; }
.home-content h2:first-child { margin-top: 0; }

/* 사용법 3단계 */
.home-steps { display: grid; gap: 12px; margin: 18px 0 8px; }

.home-step {
  display: flex;
  gap: 14px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.015));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.home-step-num {
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--grad-accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}

.home-step strong {
  display: block;
  font-size: 15px;
  color: var(--text);
  letter-spacing: -0.02em;
  margin-bottom: 5px;
}

.home-step p { margin: 0; font-size: 14px; }

#confetti {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 50;
}

/* ===== 위젯 본체 ===== */
.widget {
  flex: 1;
  min-height: 0;
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  padding: 16px 22px 10px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: filter 1s ease, opacity 1s ease;
}

/* 자동 실행 안내 배너 — 앱으로 설치되지 않은 상태에서만 보인다 */
.install-banner {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: 460px;
  margin: 10px auto 0;
  border: 1px solid rgba(74, 222, 128, 0.4);
  background: linear-gradient(100deg, rgba(74, 222, 128, 0.16), rgba(74, 222, 128, 0.07));
  border-radius: 12px;
  overflow: hidden;
}

.install-banner.hidden { display: none; }

.install-banner-link {
  flex: 1;
  min-width: 0;
  padding: 10px 4px 10px 14px;
  text-decoration: none;
  display: block;
}

.install-banner-title {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  letter-spacing: -0.01em;
}

.install-banner-sub {
  display: block;
  margin-top: 2px;
  font-size: 11px;
  color: #9fb6c2;
}

.install-banner-link:hover .install-banner-sub { color: var(--text); }

.install-banner-close {
  flex: 0 0 auto;
  width: 34px;
  border: none;
  background: none;
  color: #7d95a3;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.install-banner-close:hover { color: var(--text); }

/* 배너가 떠 있을 때는 링을 줄여 400x600 창에 그대로 들어가게 한다 */
body.has-banner .ring-wrap { width: 118px; height: 118px; }
body.has-banner .day-num { font-size: 40px; }
body.has-banner .counter { gap: 8px; }

/* 카운터 화면 아래의 사이트 메뉴 */
.sitenav {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 10px;
  padding: 8px 12px;
  padding-bottom: calc(8px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sitenav a {
  font-size: 11px;
  color: #6d818f;
  text-decoration: none;
}

.sitenav a:hover { color: var(--text); text-decoration: underline; }

/* 실패 연출 중에는 본체가 색을 잃는다 */
.widget.grieving {
  filter: grayscale(1) brightness(0.6);
}

.top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 12px;
  color: var(--text-dim);
  letter-spacing: 0.02em;
}

.top-right { display: flex; align-items: center; gap: 8px; }

/* 금연 / 금주 탭 */
.tabs {
  display: flex;
  gap: 3px;
  padding: 3px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.tabs button {
  padding: 4px 13px;
  border: none;
  border-radius: 999px;
  background: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
}

.tabs button:hover { color: var(--text); }

.tabs button.active {
  background: var(--grad-accent);
  color: var(--on-accent);
  box-shadow: 0 3px 12px rgba(74, 222, 128, 0.28);
}

/* 모드에 해당하는 입력만 보인다 */
body[data-mode="smoke"] .only-drink,
body[data-mode="drink"] .only-smoke { display: none; }

.icon-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  padding: 3px 9px;
  cursor: pointer;
}

.icon-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.28); }

/* ===== 카운터 ===== */
.counter {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.ring-wrap {
  position: relative;
  width: 140px;
  height: 140px;
}

.ring { width: 100%; height: 100%; transform: rotate(-90deg); }

.ring-bg {
  fill: none;
  stroke: rgba(255, 255, 255, 0.06);
  stroke-width: 11;
}

.ring-fg {
  fill: none;
  stroke: url(#ringGrad);
  stroke-width: 11;
  stroke-linecap: round;
  filter: drop-shadow(0 0 10px rgba(74, 222, 128, 0.45));
  transition: stroke-dashoffset 1.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.ring-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
}

.day-num {
  font-size: 48px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.045em;
  background: linear-gradient(165deg, #ffffff 20%, #a7f3d0 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.day-unit { font-size: 13px; color: var(--text-mute); letter-spacing: 0; }

.next-goal {
  font-size: 13px;
  color: var(--text-dim);
  text-align: center;
}

.next-goal strong { color: var(--text); font-weight: 600; }

/* ===== 통계 ===== */
.stats { display: flex; gap: 10px; }

.stat {
  flex: 1;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.075), rgba(255, 255, 255, 0.02));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 10px;
  text-align: center;
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.stat-label { font-size: 11px; color: var(--text-mute); margin-bottom: 4px; }
.stat-value { font-size: 18px; font-weight: 700; letter-spacing: -0.03em; }

/* ===== 인사이트 (평균 비교 / 기대수명) ===== */
/* ===== 이대로 가면 얼마가 모이는지 ===== */
.snowball { display: grid; gap: 5px; }

.snowball.hidden { display: none; }

.snow-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 4px; }

.snow-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  padding: 5px 2px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.012));
  min-width: 0;
}

.snow-label {
  font-size: 10px;
  color: var(--text-dim);
  letter-spacing: -0.01em;
}

.snow-amount {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.03em;
  font-variant-numeric: tabular-nums;
}

.snow-left {
  font-size: 9.5px;
  color: #5f7280;
  font-variant-numeric: tabular-nums;
}

/* 이미 지난 구간 */
.snow-cell.done {
  border-color: rgba(74, 222, 128, 0.32);
  background: linear-gradient(165deg, rgba(74, 222, 128, 0.12), rgba(74, 222, 128, 0.03));
}

.snow-cell.done .snow-amount { color: var(--accent); }
.snow-cell.done .snow-left { color: var(--accent); }

.snow-next {
  font-size: 10.5px;
  line-height: 1.35;
  color: var(--text-dim);
  text-align: center;
  letter-spacing: -0.01em;
}

.snow-next strong { color: var(--accent-2); font-weight: 600; }

.insight {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 9px 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.insight.hidden, .insight-line.hidden, .insight-source.hidden { display: none; }

.insight-line {
  font-size: 12px;
  line-height: 1.5;
  color: #b3c3ce;
}

.insight-line + .insight-line { margin-top: 5px; }

.insight-line strong { color: var(--accent); font-weight: 600; }

.insight-source {
  margin-top: 7px;
  font-size: 10px;
  line-height: 1.4;
  color: #5f7280;
}

/* 통계 아래에 붙는 안내 배너 두 장 (통계 두 칸과 같은 폭) */
.promo-stack { display: grid; gap: 7px; }

.test-promo {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 9px 13px;
  border: 1px solid rgba(34, 211, 238, 0.32);
  border-radius: 14px;
  background: linear-gradient(150deg, rgba(34, 211, 238, 0.13), rgba(74, 222, 128, 0.05));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  text-decoration: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.test-promo.hidden { display: none; }

.test-promo:hover { border-color: rgba(34, 211, 238, 0.6); transform: translateY(-1px); }

.test-promo-emoji { font-size: 22px; line-height: 1; flex: 0 0 auto; }

.test-promo-text { flex: 1; min-width: 0; display: block; }

.test-promo-text strong {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.02em;
}

.test-promo-text em {
  display: block;
  margin-top: 1px;
  font-style: normal;
  font-size: 11px;
  color: var(--text-dim);
}

.test-promo-go { flex: 0 0 auto; font-size: 15px; color: var(--accent-2); }

/* 미니 도구 배너는 심리테스트와 구분되게 초록 계열로 */
.promo-tools {
  border-color: rgba(74, 222, 128, 0.3);
  background: linear-gradient(150deg, rgba(74, 222, 128, 0.12), rgba(34, 211, 238, 0.04));
}

.promo-tools:hover { border-color: rgba(74, 222, 128, 0.6); }

.promo-tools .test-promo-go { color: var(--accent); }

/* 테스트 결과 아래에서 다른 테스트로 넘어가는 배너 */
.test-cross { margin: 26px 0 0; padding: 14px 16px; }

.test-cross .test-promo-text strong { font-size: 14px; }

.test-cross .test-promo-emoji { font-size: 24px; }

/* ===== 하단 ===== */
.bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11px;
  color: var(--text-dim);
}

.bottom-btns { display: flex; gap: 6px; }

.bottom button {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  padding: 4px 10px;
  cursor: pointer;
}

.bottom button:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.28); }

.bottom button.danger { color: rgba(248, 113, 113, 0.75); border-color: rgba(248, 113, 113, 0.28); }
.bottom button.danger:hover { color: var(--danger); border-color: rgba(248, 113, 113, 0.6); }

/* 링크지만 버튼처럼 보이는 것 (데스크탑에 설치) */
.ghost-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 11px;
  padding: 4px 10px;
  text-decoration: none;
  white-space: nowrap;
}

.ghost-btn:hover { color: var(--text); border-color: rgba(255, 255, 255, 0.28); }

/* 100일 단위 특별 축하 */
.overlay.special .card {
  background: linear-gradient(160deg, #3a3018, #1c1a10);
  border-color: rgba(250, 204, 21, 0.55);
  box-shadow: 0 18px 60px rgba(250, 204, 21, 0.12), 0 18px 50px rgba(0, 0, 0, 0.5);
}

.overlay.special .cele-badge {
  background: linear-gradient(100deg, #facc15, #fbbf24);
  color: #2a1f05;
}

.overlay.special .card h1 {
  background: linear-gradient(100deg, #fde68a, #facc15);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.overlay.special .card button.primary { background: #facc15; color: #2a1f05; }

/* ===== 오버레이 공통 ===== */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(8, 14, 20, 0.82);
  backdrop-filter: blur(3px);
  animation: fadeIn 0.4s ease both;
}

.overlay.hidden { display: none; }

.card {
  width: calc(100% - 44px);
  max-width: 420px;
  max-height: calc(100% - 32px);
  overflow-y: auto;
  padding: 26px 22px 20px;
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(32, 48, 64, 0.97), rgba(12, 19, 27, 0.98));
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  text-align: center;
  animation: popIn 0.55s cubic-bezier(0.18, 1.3, 0.4, 1) both;
}

.card h1 { font-size: 26px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 10px; }
.card h2 { font-size: 19px; font-weight: 700; letter-spacing: -0.02em; margin-bottom: 12px; }
.card p { font-size: 14px; color: #c6d6df; line-height: 1.55; }
.card .sub { margin-top: 10px; font-size: 12px; color: var(--text-dim); }

.cele-badge {
  display: inline-block;
  font-size: 13px;
  font-weight: 700;
  color: #0f1720;
  background: var(--accent);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 14px;
}

/* 오버레이 버튼 */
.card button {
  padding: 11px 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.card button:hover { background: rgba(255, 255, 255, 0.1); }

.card button.primary {
  margin-top: 18px;
  width: 100%;
  border: none;
  background: var(--grad-accent);
  color: var(--on-accent);
  font-weight: 700;
  box-shadow: var(--glow);
}

.card button.danger-solid { border: none; background: var(--danger); color: #2a0d0d; font-weight: 700; }
.card button.primary:hover, .card button.danger-solid:hover { filter: brightness(1.08); }

.btn-row { display: flex; gap: 8px; margin-top: 18px; }
.btn-row button { flex: 1; margin-top: 0; }

/* 입력 필드 */
.field {
  display: block;
  margin-top: 13px;
  text-align: left;
}

.field span {
  display: block;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  color-scheme: dark;
}

.field input:focus { outline: none; border-color: var(--accent); }

.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }
.field-row .field input { padding: 10px 8px; font-size: 14px; }

.field span em {
  font-style: normal;
  font-size: 10px;
  color: #5f7280;
  margin-left: 4px;
}

.field-note {
  margin-top: 6px;
  font-size: 11px;
  line-height: 1.45;
  color: #6d818f;
  text-align: left;
}

/* 성별 선택 (세그먼트 버튼) */
.seg { display: flex; gap: 6px; }

.seg button {
  flex: 1;
  padding: 9px 4px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.25);
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.seg button:hover { color: var(--text); }

.seg button.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ===== 실패(슬픈) 연출 ===== */
.overlay.sad { background: rgba(6, 9, 12, 0.9); }

.sad-card {
  background: linear-gradient(160deg, #232a30, #14181c);
  border-color: rgba(255, 255, 255, 0.12);
  animation: sink 0.9s cubic-bezier(0.25, 0.9, 0.3, 1) both;
}

.sad-card h1 { color: #d3dbe0; }

.sad-mark {
  font-size: 56px;
  font-weight: 700;
  line-height: 1;
  color: #4a5761;
  margin-bottom: 10px;
  animation: fall 1.1s cubic-bezier(0.3, 0.7, 0.4, 1) both;
}

.restart-field { margin-top: 20px; }

/* ===== 글 페이지 (소개 / 개인정보처리방침 / 문의) ===== */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding: 26px 22px 70px;
}

.page-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 16px;
  padding-bottom: 16px;
  margin-bottom: 26px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.page-head .brand {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.035em;
  text-decoration: none;
  background: var(--grad-accent);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.page-head nav { display: flex; flex-wrap: wrap; gap: 4px; }

.page-head nav a {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dim);
  text-decoration: none;
  padding: 5px 10px;
  border-radius: 999px;
  transition: color 0.15s ease, background 0.15s ease;
}

.page-head nav a:hover { color: var(--text); background: var(--surface); }

.page-head nav a[aria-current="page"] {
  color: var(--accent);
  background: rgba(74, 222, 128, 0.12);
  font-weight: 700;
}

.page h1 {
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 1.3;
  margin-bottom: 10px;
}

.page .updated { font-size: 12px; color: var(--text-mute); margin-bottom: 30px; }

.page h2 {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.035em;
  margin: 36px 0 12px;
  padding-top: 4px;
}

.page h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.025em;
  margin: 22px 0 7px;
  color: #d7e5ee;
}

.page p, .page li {
  font-size: 15px;
  line-height: 1.85;
  color: #b9cad6;
}

.page p { margin-bottom: 12px; }

.page ul, .page ol { margin: 0 0 14px 20px; }
.page li { margin-bottom: 6px; }

.page a { color: var(--accent); }

.page strong { color: var(--text); font-weight: 600; }

.page table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 16px;
  font-size: 13px;
}

.page table {
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.page th, .page td {
  border-bottom: 1px solid var(--line);
  padding: 11px 13px;
  text-align: left;
  color: #b9cad6;
  line-height: 1.65;
}

.page tr:last-child td { border-bottom: none; }

.page th {
  background: rgba(255, 255, 255, 0.055);
  color: var(--text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.page .table-scroll { overflow-x: auto; }

.notice {
  border: 1px solid rgba(74, 222, 128, 0.26);
  background: linear-gradient(150deg, rgba(74, 222, 128, 0.1), rgba(34, 211, 238, 0.04));
  border-radius: 14px;
  padding: 16px 18px;
  margin: 20px 0;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.notice p:last-child { margin-bottom: 0; }

/* 설치 버튼 박스 */
.install-box {
  margin: 26px 0 34px;
  padding: 22px 20px;
  border: 1px solid rgba(74, 222, 128, 0.32);
  background: rgba(74, 222, 128, 0.06);
  border-radius: 14px;
  text-align: center;
}

.install-btn {
  width: 100%;
  max-width: 320px;
  padding: 15px 18px;
  border: none;
  border-radius: 12px;
  background: var(--grad-accent);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.install-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(74, 222, 128, 0.3);
}

.install-btn:disabled {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-dim);
  cursor: default;
}

.install-state {
  margin: 12px 0 0;
  font-size: 12px;
  color: var(--text-dim);
}

.page ol { margin: 0 0 14px 20px; }
.page ol li { margin-bottom: 6px; }

/* 글 목록 카드 */
.card-list {
  display: grid;
  gap: 12px;
  margin: 24px 0 34px;
}

.post-card {
  display: block;
  padding: 20px 22px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.015));
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 255, 255, 0.05);
  text-decoration: none;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.post-card:hover {
  border-color: rgba(74, 222, 128, 0.45);
  background: linear-gradient(165deg, rgba(74, 222, 128, 0.1), rgba(34, 211, 238, 0.03));
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.post-card h2 {
  margin: 0 0 7px;
  padding-top: 0;
  font-size: 17px;
  color: var(--text);
}

.post-card p { margin: 0; font-size: 13.5px; line-height: 1.65; }

.post-more {
  display: inline-block;
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.contact-mail {
  font-size: 17px;
  font-weight: 600;
  padding: 12px 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.03);
  word-break: break-all;
}

.page-foot {
  margin-top: 44px;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 12px;
  color: var(--text-dim);
}

.page-foot a { color: var(--text-dim); }

/* ===== 심리테스트 ===== */
.test-screen.hidden, .q-back.hidden, .shared-note.hidden { display: none; }

/* 시작 화면 */
.test-hero { text-align: center; padding: 8px 0 4px; }

.test-hero-emoji { font-size: 48px; line-height: 1; margin-bottom: 14px; }

.test-hero h1 {
  font-size: 26px;
  line-height: 1.4;
  margin-bottom: 10px;
}

.test-lead {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 16px;
}

.test-hero p { text-align: left; }

.test-cta {
  width: 100%;
  margin-top: 24px;
  padding: 17px 18px;
  border: none;
  border-radius: 14px;
  background: var(--grad-accent);
  color: var(--on-accent);
  font-family: inherit;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.02em;
  cursor: pointer;
  box-shadow: var(--glow);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.test-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(74, 222, 128, 0.3);
}

.test-cta.ghost {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: var(--text);
}

.test-cta.ghost:hover { background: rgba(255, 255, 255, 0.06); filter: none; }

.test-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.test-preview span {
  font-size: 13px;
  color: #bfced8;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  padding: 7px 13px;
}

/* 진행 화면 */
.q-progress { margin: 6px 0 20px; }

.q-progress-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
}

.q-back {
  background: none;
  border: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 12px;
  cursor: pointer;
  padding: 2px 4px;
}

.q-back:hover { color: var(--text); }

.q-progress-bar {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.q-progress-fill {
  height: 100%;
  width: 10%;
  border-radius: 999px;
  background: var(--accent);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.q-card {
  padding: 28px 24px;
  border: 1px solid var(--line-strong);
  border-radius: 20px;
  background: linear-gradient(165deg, rgba(32, 48, 64, 0.95), rgba(12, 19, 27, 0.97));
  box-shadow: var(--shadow-md), inset 0 1px 0 rgba(255, 255, 255, 0.07);
}

.card-in { animation: cardIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both; }

@keyframes cardIn {
  from { opacity: 0; transform: translateX(26px); }
  to { opacity: 1; transform: translateX(0); }
}

.q-number {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  color: #0f1720;
  background: var(--accent);
  border-radius: 999px;
  padding: 3px 11px;
  margin-bottom: 14px;
}

.q-text {
  font-size: 19px;
  line-height: 1.5;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 22px;
  padding: 0;
}

.q-answers { display: grid; gap: 10px; }

.q-answer {
  width: 100%;
  padding: 16px 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  line-height: 1.5;
  text-align: left;
  cursor: pointer;
  transition: border-color 0.15s ease, background 0.15s ease, transform 0.1s ease;
}

.q-answer:hover {
  border-color: var(--accent);
  background: rgba(74, 222, 128, 0.09);
}

.q-answer:active { transform: scale(0.985); }

/* 결과 화면 */
.shared-note {
  text-align: center;
  font-size: 12px;
  color: var(--text-dim);
  margin-bottom: 14px;
}

.result-card {
  position: relative;
  overflow: hidden;
  padding: 32px 24px 28px;
  border: 1px solid rgba(74, 222, 128, 0.38);
  border-radius: 22px;
  background:
    radial-gradient(80% 70% at 50% -10%, rgba(74, 222, 128, 0.22), transparent 70%),
    linear-gradient(165deg, rgba(34, 211, 238, 0.08), rgba(14, 22, 30, 0.96));
  box-shadow: var(--shadow-lg), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  text-align: center;
}

.result-label { font-size: 12px; color: var(--text-dim); margin-bottom: 10px; }

.result-emoji { font-size: 56px; line-height: 1; margin-bottom: 10px; }

.result-name {
  font-size: 29px;
  font-weight: 800;
  letter-spacing: -0.05em;
  line-height: 1.28;
  background: linear-gradient(160deg, #ffffff 25%, #a7f3d0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.result-tags {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 7px;
  margin-top: 18px;
}

.test-tag {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: rgba(74, 222, 128, 0.12);
  border-radius: 999px;
  padding: 5px 11px;
}

.result-desc-card {
  margin-top: 14px;
  padding: 20px 20px 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.03);
}

.result-desc-card h2 { margin: 0 0 12px; padding: 0; font-size: 15px; }
.result-desc-card p { margin: 0; font-size: 14.5px; line-height: 1.85; }

/* 결과 설명은 '평소 성격'과 '술자리·흡연 스타일' 두 단락으로 나뉜다 */
.result-part + .result-part {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

/* 설명이 길어 문장 두 개씩 문단으로 끊어 넣는다.
   keep-all 로 한글 단어가 줄 끝에서 쪼개지지 않게 한다. */
.result-body p {
  line-height: 1.9;
  word-break: keep-all;
  overflow-wrap: break-word;
}

.result-body p + p { margin-top: 11px; }

.result-actions { display: grid; gap: 10px; margin-top: 20px; }
.result-actions .test-cta { margin-top: 0; }

/* 복사 알림 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 16px);
  padding: 12px 20px;
  border-radius: 999px;
  background: rgba(15, 23, 32, 0.96);
  border: 1px solid rgba(74, 222, 128, 0.4);
  color: var(--text);
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  z-index: 80;
}

.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 640px) {
  .result-actions { grid-template-columns: 1fr 1fr; }
}

/* ===== 미니 도구 페이지 ===== */
.tool-panel.hidden, .breath-result.hidden, #ageResult.hidden, #breathStop.hidden, #breathStart.hidden { display: none; }

.tool-tabs {
  display: flex;
  gap: 6px;
  margin: 24px 0 30px;
  padding: 5px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.3);
  border: 1px solid var(--line);
}

.tool-tabs button {
  flex: 1;
  padding: 11px 6px;
  border: none;
  border-radius: 10px;
  background: none;
  color: var(--text-dim);
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  letter-spacing: -0.02em;
  cursor: pointer;
  white-space: nowrap;
}

.tool-tabs button:hover { color: var(--text); }

.tool-tabs button.active {
  background: var(--grad-accent);
  color: var(--on-accent);
  font-weight: 700;
  box-shadow: 0 3px 12px rgba(74, 222, 128, 0.25);
}

.notice-warn {
  border-color: rgba(251, 113, 133, 0.4);
  background: linear-gradient(150deg, rgba(251, 113, 133, 0.12), rgba(251, 113, 133, 0.03));
}

.notice-warn ul { margin: 10px 0 0 20px; }
.notice-warn li { font-size: 14px; margin-bottom: 5px; }

/* 숨참기 */
.breath-stage { text-align: center; margin: 26px 0 10px; }

.breath-ring-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto;
}

.breath-ring { width: 100%; height: 100%; transform: rotate(-90deg); }
.breath-ring-bg { fill: none; stroke: rgba(255, 255, 255, 0.07); stroke-width: 12; }

.breath-ring-fg {
  fill: none;
  stroke: url(#breathGrad);
  stroke-width: 12;
  stroke-linecap: round;
  stroke-dasharray: 540;
  stroke-dashoffset: 540;
  filter: drop-shadow(0 0 10px rgba(74, 222, 128, 0.4));
  transition: stroke-dashoffset 0.1s linear;
}

.breath-center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}

.breath-time {
  font-size: 52px;
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.05em;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(165deg, #ffffff 20%, #a7f3d0 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.breath-unit { font-size: 13px; color: var(--text-mute); margin-top: 4px; }

.breath-hint { margin: 18px 0 0; font-size: 14px; color: var(--text-dim); }
.breath-hint strong { color: var(--accent); }

.breath-actions { margin-top: 6px; }
.breath-result { margin-top: 24px; }
.breath-result-msg { margin-top: 14px; font-size: 14px; line-height: 1.7; color: #c6d6df; }
.breath-result .test-cta { margin-top: 12px; }

/* 추정 신체 나이 */
.seg-wrap { flex-wrap: wrap; }
.seg-wrap button { flex: 1 1 calc(50% - 3px); min-width: 0; }

.age-result-card { margin-top: 22px; }

.age-pair { display: flex; gap: 10px; margin-top: 16px; }

.age-box {
  flex: 1;
  padding: 16px 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.25);
  border: 1px solid var(--line);
}

.age-box-label { display: block; font-size: 11.5px; color: var(--text-dim); margin-bottom: 6px; }

.age-box-value {
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  background: linear-gradient(165deg, #ffffff 20%, #a7f3d0 95%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.age-box-unit { font-size: 13px; color: var(--text-mute); margin-left: 2px; }

.dday-list { display: grid; gap: 8px; margin-top: 16px; }

.dday-row {
  display: grid;
  grid-template-columns: 74px 116px 1fr;
  align-items: baseline;
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.dday-when { font-size: 13px; font-weight: 700; color: var(--accent); }
.dday-date { font-size: 12px; color: var(--text-mute); font-variant-numeric: tabular-nums; }
.dday-text { font-size: 13.5px; line-height: 1.6; color: #b9cad6; }

@media (max-width: 560px) {
  .tool-tabs button { font-size: 12.5px; padding: 10px 4px; }
  .money-bar-row { grid-template-columns: 68px 1fr auto; }
  .dday-row { grid-template-columns: 1fr; gap: 3px; }
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

@keyframes popIn {
  from { opacity: 0; transform: scale(0.82) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}

@keyframes sink {
  from { opacity: 0; transform: translateY(-26px) scale(1.04); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes fall {
  0% { opacity: 0; transform: translateY(-30px); }
  60% { opacity: 1; transform: translateY(4px); }
  100% { opacity: 1; transform: translateY(0); }
}
