
/* ═══════════════════════════════════════════════
   components.css — 핵심 컴포넌트·레이아웃 (style.css A 구간)
   style.css 를 3분할한 A 구간. 원래 style.css 앞에 있던 내용이므로
   순서를 보존하기 위해 utilities(폴리필)·features 보다 먼저 온다.
   ═══════════════════════════════════════════════ */

/* ─── § 1. Design Tokens ───────────────────────
   토큰 정의부는 tokens.css 로 이동했다(2026-10-22, 092 §4).
   여기서 값을 직접 쓰지 말고 var(--token) 으로 참조한다. */

/* ─── § 8. Accessibility & Utilities ─────────── */
/* ── 8-1. 전역 키보드 포커스 표시기 ────────────────────────────────
   - 마우스 클릭에는 나타나지 않고 키보드 조작 시에만 보인다(:focus-visible).
   - 브라우저 기본 focus ring 을 우리 액센트 토큰(--action-primary)으로 통일한다.
   - 요소별 규칙이 outline 을 직접 지정하지 않으면 이 규칙이 그대로 적용되므로,
     요소가 자체 포커스 표시(테두리 색·ring)를 갖고 있어도 outline 이 함께 그려진다.
   - !important 는 쓰지 않는다(우선순위 강제는 cascading 을 방해한다).        */
:focus-visible {
  outline: 2px solid var(--action-primary);
  outline-offset: 2px;
}

/* 상호작용 요소 기본값 — 브라우저·스킨마다 focus ring 모양이 제각각이라
   명시적으로 통일한다. 요소 자체의 포커스 표시는 그대로 두고 outline 만 보강한다. */
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
button:focus-visible,
a:focus-visible,
summary:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--action-primary);
  outline-offset: 2px;
}

/* ── 8-2. 모션 감소 설정 (prefers-reduced-motion) ─────────────────
   1) 전역 초기화 — 애니메이션/전환 지속시간과 스크롤 이동을 즉시 수렴시킨다.
   2) 무한 반복 데코레이션 — 한 번 실행된 뒤 멈춰 각도·위치가 남지 않도록 제거한다.
      (결과를 보여주는 동전처럼 "상태"를 담는 애니메이션은 건드리지 않는다)
   3) 페이드 인 — 최종 상태(보임)만 유지하고 이동/투명도 변화를 없앤다.
   4) 반복 모션(흔들림·두근거림·떠오름) — 정적 상태로 고정한다.
   5) 변환 기반 전환 — 즉시 최종 위치로 이동한다.
   !important 는 뒤따르는 animation/transition 단축 속성 선언을 확실히 덮기 위해 쓴다. */
@media (prefers-reduced-motion: reduce) {
  *, ::before, ::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .spinner, .spinner-sm {
    animation: none !important;
    border-top-color: var(--action-primary) !important;
  }
  .animate-spin-slow,
  .animate-shuffle-left,
  .animate-shuffle-right {
    animation: none !important;
  }
  .animate-fade-in,
  .service-root {
    animation: none !important;
  }
  .couple-score-heart,
  .couple-jamo-result,
  .psy-loading > div,
  .simon-stage.celebrating,
  .simon-stage-animal,
  .simon-choice.wrong,
  .simon-status.level-up {
    animation: none !important;
  }
  .wheel-stage canvas,
  .coin,
  .submenu-indicator,
  .welcome-btn-arrow,
  .psy-axis-track i,
  .triple-stage-bar i,
  .triple-tile,
  .triple-stage {
    transition-duration: 0.01ms !important;
  }
}

/* Radius Utilities */
.r-xs   { border-radius: var(--radius-xs); }
.r-sm   { border-radius: var(--radius-sm); }
.r-md   { border-radius: var(--radius-md); }
.r-lg   { border-radius: var(--radius-lg); }
.r-xl   { border-radius: var(--radius-xl); }
.r-2xl  { border-radius: var(--radius-2xl); }
.r-pill { border-radius: var(--radius-pill); }

/* Spacing Utilities (Tailwind space-y-* 대체) */
.flow-space-sm { display: grid; gap: 12px; }
.flow-space-md { display: grid; gap: 24px; }
.flow-space-lg { display: grid; gap: 32px; }

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 0.9375rem/1.5 'SUIT Variable','SUIT',-apple-system,sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  word-break: keep-all;
  font-weight: 400;
}
button { font: inherit; cursor: pointer; }
a { color: var(--lavender); text-decoration: none; }
h1, h2, h3, h4 { font-weight: 500; }
b, strong { font-weight: 500; }

/* ═══════════════════════════════════════════════
   § 2. Reset & Typography (완료)
   ═══════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════
   § 3. App Layout (.app, .rail, .topbar, .content, .footer)
   ═══════════════════════════════════════════════ */
/* ─── App Layout ─────────────────────────────── */
.app { min-height: 100vh; }

/* Brand */
.brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 10px 28px;
  text-decoration: none; color: var(--ink);
}
.brand .mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: linear-gradient(145deg, #8a76ef, #6049cb);
  color: #fff; font-size: var(--fs-20); font-weight: 700;
}
.dark .brand .mark {
  background: linear-gradient(145deg, var(--brand-primary), var(--action-primary));
}
.brand b { font-size: var(--fs-20); letter-spacing: -.8px; font-weight: 500; }
.dark .brand b { color: var(--ink); }
.brand small { display: block; margin-top: -2px; color: var(--muted); font-size: var(--fs-xs); }

/* ─── § 4. Navigation (.menu, .sub-menu, .mobile-nav) ─── */
/* Menu */
.menu { display: grid; gap: 3px; }
.menu a {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px; border-radius: 10px;
  color: #55545f; text-decoration: none; font-weight: 400;
  transition: .18s;
}
.dark .menu a { color: #94a3b8; }
.menu a:hover { background: var(--lavender-soft); color: var(--plum); }
.dark .menu a:hover { background: rgb(var(--brand-rgb) / 0.1); color: var(--lavender); }
.menu a.active { background: var(--lavender-soft); color: var(--lavender); font-weight: 500; }
.dark .menu a.active { background: rgb(var(--brand-rgb) / 0.15); }
.menu .icon {
  width: 18px; height: 18px; flex: 0 0 18px;
  position: relative; display: inline-block;
  color: currentColor; opacity: .66;
}
.menu .icon::before, .menu .icon::after { content: ''; position: absolute; box-sizing: border-box; }
.menu .icon-home::before { inset: 5px 3px 2px; border: 1.4px solid currentColor; border-radius: 2px; }
.menu .icon-home::after { width: 10px; height: 10px; left: 4px; top: 1px; border-left: 1.4px solid currentColor; border-top: 1.4px solid currentColor; transform: rotate(45deg); }
.menu .icon-fortune::before { width: 12px; height: 12px; left: 3px; top: 3px; border: 1.4px solid currentColor; border-radius: 50%; }
.menu .icon-fortune::after { width: 7px; height: 7px; left: 8px; top: 0; background: var(--paper); border-radius: 50%; }
.menu .icon-psychology::before { width: 12px; height: 12px; left: 3px; top: 3px; border: 1.4px solid currentColor; border-radius: 50%; }
.menu .icon-psychology::after { width: 3px; height: 3px; left: 7.5px; top: 7.5px; background: currentColor; border-radius: 50%; }
.menu .icon-games::before { inset: 3px; border: 1.4px solid currentColor; border-radius: 4px; }
.menu .icon-games::after { width: 2px; height: 8px; left: 8px; top: 5px; background: currentColor; border-radius: 2px; }
.menu .icon-life::before { width: 12px; height: 12px; left: 3px; top: 3px; border: 1.4px solid currentColor; border-radius: 50%; }
.menu .icon-life::after { width: 1px; height: 18px; left: 8.5px; top: 0; background: currentColor; transform: rotate(45deg); opacity: .75; }
.menu .icon-lounge::before { width: 14px; height: 11px; left: 2px; top: 3px; border: 1.4px solid currentColor; border-radius: 4px; }
.menu .icon-lounge::after { width: 5px; height: 5px; left: 4px; top: 11px; border-left: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor; transform: skewY(-30deg); }
.menu .icon-my::before { width: 7px; height: 7px; left: 5.5px; top: 1px; border: 1.4px solid currentColor; border-radius: 50%; }
.menu .icon-my::after { width: 13px; height: 8px; left: 2.5px; bottom: 1px; border: 1.4px solid currentColor; border-radius: 8px 8px 3px 3px; }
.submenu-indicator { margin-left: auto; color: #aaa7b4; font-size: var(--fs-xl); font-weight: 300; line-height: 1; transition: transform .18s, color .18s; }
.menu a:hover .submenu-indicator, .menu a.active .submenu-indicator { color: currentColor; }
.submenu-indicator.open { transform: rotate(90deg); }
.menu a:hover .submenu-indicator:not(.open) { transform: translateX(2px); }

/* Rail account and legal links */
.rail-footer { margin-top: auto; }
.profile {
  display: flex; align-items: center; gap: 8px;
  margin-top: auto;
  padding: 12px 10px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: var(--fs-sm);
  text-decoration: none; transition: .18s;
}
.profile:hover { color: var(--lavender); }
.profile b { display: block; font-size: var(--fs-base); color: var(--ink); font-weight: 400; }
.dark .profile b { color: var(--ink); }
.profile-signed-in { align-items: flex-start; justify-content: space-between; cursor: default; }
.profile-signed-in a { color: inherit; text-decoration: none; }
.profile-signed-in a:hover b { color: var(--lavender); }
.rail-logout {
  padding: 3px 0; border: 0; background: none; color: var(--muted);
  font: inherit; font-size: var(--fs-xs); cursor: pointer;
}
.rail-logout:hover { color: var(--lavender); }
.rail-legal {
  display: flex; flex-wrap: wrap; gap: 5px 10px;
  padding: 11px 10px 2px; color: var(--muted); font-size: var(--fs-xs);
}
.rail-legal a { color: inherit; text-decoration: none; }
.rail-legal a:hover { color: var(--lavender); }

/* ─── Top Bar ─────────────────────────────────── */
.topbar {
  height: 74px;
  display: flex; align-items: center; justify-content: space-between;
  max-width: var(--content-max); margin: 0 auto;
  padding: 0 48px;
  border-bottom: 1px solid var(--line);
  background: rgba(247,246,250,.82);
  backdrop-filter: blur(12px);
}
.dark .topbar { background: rgba(15,23,42,.82); }
.brand-mark {
  display: inline-flex; align-items: center; gap: 8px;
  text-decoration: none; padding: 6px 10px 6px 6px;
  border-radius: 10px;
  transition: background .15s;
}
.brand-mark:hover { background: rgba(0,0,0,.05); }
.dark .brand-mark:hover { background: rgba(255,255,255,.08); }
.brand-icon {
  display: grid; place-items: center;
  width: 28px; height: 28px;
  background: linear-gradient(135deg, #6549d4, #9b7ff2);
  color: #fff; font-size: var(--fs-md); border-radius: var(--radius-sm);
}
.brand-name {
  font-weight: 600; font-size: var(--fs-2xl); line-height: 28px; letter-spacing: -.7px;
  color: var(--ink);
}
.dark .brand-name { color: var(--ink); }
.top-actions { display: flex; align-items: center; gap: 11px; }

/* ─── Content ─────────────────────────────────── */
main { min-width: 0; }
.content {
  max-width: var(--content-max); margin: 0 auto;
  padding: 0 48px 48px;
}
/* 상단 대메뉴(메인·심리/운세·게임·지역·커뮤니티) */
.main-menu { display: flex; flex-wrap: wrap; gap: 4px; margin-bottom: 18px; }
.main-menu a {
  padding: 6px 14px; font-size: var(--fs-md); font-weight: 600; white-space: nowrap;
  color: var(--muted); text-decoration: none; border-radius: 10px; transition: .15s;
}
.main-menu a:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.dark .main-menu a:hover { background: rgba(255,255,255,.06); }
.main-menu a.active { background: rgb(var(--brand-rgb) / .12); color: var(--lavender); }
@media (max-width: 880px) {
  /* min-width:0 — nowrap 자식의 min-content 만큼 커져 모바일에서 가로 오버플로가 났다.
     flex 아이템의 자동 최소 크기를 풀어 컨테이너 폭에 맞춘 뒤 내부 스크롤로 넘긴다. */
  .main-menu { flex-wrap: nowrap; overflow-x: auto; margin-bottom: var(--sp-3); min-width: 0; }
}
/* 운세/심리 7:3 그리드에서는 대메뉴가 전체 폭 한 줄을 차지한다 */
/* align-self:stretch — 컨테이너가 align-items:start 라서 대메뉴가 내용 폭(nowrap 합)만큼
   커져 모바일 가로 오버플로가 났다. 컨테이너 폭에 맞춘 뒤 내부 스크롤로 넘긴다. */
.content.fortune-content-layout > .main-menu { grid-column: 1 / -1; margin-bottom: 0; align-self: stretch; }

/* 심리/운세 허브(7:3): 왼쪽 운세 → 심리 테스트, 오른쪽 바로가기 */
.hub-split { display: grid; grid-template-columns: 7fr 3fr; gap: 20px; align-items: start; }
@media (max-width: 1024px) { .hub-split { grid-template-columns: 1fr; } }
.hub-main { min-width: 0; }
.hub-section { margin-bottom: 26px; }
.hub-section > h2 { font-size: var(--fs-xl); margin: 0 0 12px; }
.hub-side { position: sticky; top: 16px; }
@media (max-width: 1024px) { .hub-side { position: static; } }
/* 7:3 우측 바로가기 목록(게임·커뮤니티 등) */
.side-links { display: flex; flex-direction: column; gap: 2px; }
.side-links a {
  display: flex; align-items: center; gap: 9px; padding: 9px 10px;
  border-radius: 10px; color: var(--ink); text-decoration: none; font-size: var(--fs-base);
  transition: background .15s;
}
.side-links a:hover { background: rgba(0,0,0,.04); }
.dark .side-links a:hover { background: rgba(255,255,255,.06); }
.side-links a.active { background: rgb(var(--brand-rgb) / .1); color: var(--lavender); }
.side-links .side-icon { width: 20px; text-align: center; flex: none; }

/* 카드 본문 안의 바로가기 탭은 카드 모양과 겹치지 않게 납작하게 */
.card-body .fortune-tabbar a { box-shadow: none; border-color: transparent; padding: 10px; border-radius: 10px; }
.card-body .fortune-tabbar a:hover { background: rgba(0,0,0,.04); border-color: transparent; }
.dark .card-body .fortune-tabbar a:hover { background: rgba(255,255,255,.06); }
.card-body .fortune-tabbar a.active { background: rgb(var(--brand-rgb) / .1); border-color: transparent; }
.reading-page { width: min(100%, var(--reading-max)); margin: 0 auto; }

/* ═══════════════════════════════════════════════
   § 5. Core Components (.button, .btn-*, .ghost, .card, .badge, .choice-grid)
   ═══════════════════════════════════════════════ */
/* ─── Head ────────────────────────────────────── */
.head { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
h1 { margin: 0 0 7px; font-size: clamp(1.75rem, 3vw, 2.375rem); letter-spacing: -1.8px; line-height: 1.18; }
.lead { margin: 0; color: var(--muted); }
/* 허브(/fortune·/game·/board) 상단 타이틀 — /locality(동네) 타이틀 크기와 통일 (2026-09-28) */
.head.hub-head h1 { font-size: var(--fs-2xl); margin: 0 0 6px; }

/* ─── Chip ────────────────────────────────────── */
.chip {
  padding: 8px 11px; border: 1px solid var(--line); border-radius: var(--radius-pill);
  color: var(--muted); background: var(--paper);
  font-size: var(--fs-sm); white-space: nowrap; display: inline-flex; align-items: center;
}

/* ─── Card ─────────────────────────────────────── */
.card {
  border: 1px solid var(--line); border-radius: 17px;
  background: var(--paper); box-shadow: var(--shadow);
}
.card.soft-purple { background: linear-gradient(135deg, #f3f0ff, #fff 67%); border-color: #e4ddff; }
.card.soft-mint { background: linear-gradient(135deg, #eefaf7, #fff 67%); border-color: #d9f0e8; }
.card.soft-gold { background: linear-gradient(135deg, #fff6e9, #fff 67%); border-color: #f9e8ca; }

/* ─── 게시판 그룹 요약 카드 (/board) ─────────────── */
.board-groups { display: flex; flex-direction: column; gap: 22px; }
.board-group-title {
  font-size: var(--fs-15); font-weight: 700; color: var(--ink);
  margin: 0 0 10px; display: flex; align-items: center; gap: 8px;
}
.board-group-title::after {
  content: ""; flex: 1; height: 1px; background: var(--line);
}
.board-group-grid {
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.mini-board {
  display: flex; flex-wrap: wrap; align-items: center; gap: 3px 7px;
  padding: 11px 13px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--paper); text-decoration: none;
  transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease;
}
.mini-board:hover {
  transform: translateY(-2px);
  border-color: var(--brand-primary);
  box-shadow: 0 6px 16px rgb(var(--brand-rgb) / 0.12);
}
.mini-board-icon { font-size: var(--fs-17); line-height: 1; }
.mini-board-name {
  flex: 1; min-width: 0;
  font-size: var(--fs-md); font-weight: 700; color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.mini-board-count { width: 100%; font-size: var(--fs-sm); color: var(--muted); }
.mini-board-count b { color: var(--brand-primary); font-weight: 700; }
.board-side-col .board-group-grid {
  grid-template-columns: 1fr;
}
.board-side-col .mini-board-name {
  font-size: var(--fs-base);
}
.dark .card.soft-purple { background: linear-gradient(135deg, rgb(var(--brand-rgb) / 0.08), var(--paper) 67%); border-color: rgb(var(--brand-rgb) / 0.2); }
.dark .card.soft-mint { background: linear-gradient(135deg, rgba(94,234,212,0.08), var(--paper) 67%); border-color: rgba(94,234,212,0.2); }
.dark .card.soft-gold { background: linear-gradient(135deg, rgba(252,211,77,0.08), var(--paper) 67%); border-color: rgba(252,211,77,0.2); }

/* ─── Menu Cards (메인과 같은 카드 헤드/본문 분리형) ───────────── */
.fortune-menu-grid > .card,
.service-menu-grid > .card {
  display: flex; flex-direction: column; overflow: hidden;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.fortune-menu-grid > .card:hover { transform: translateY(-3px); border-color: var(--lavender); box-shadow: var(--shadow-hover); }
.card-body { padding: 16px 20px; display: flex; flex-direction: column; gap: 10px; flex: 1; }
.card-body p { margin: 0; color: var(--muted); font-size: var(--fs-base); line-height: 1.55; }
.card-body .button { margin-top: auto; align-self: flex-start; }

/* Root service pages */
.service-root { animation: fadeIn .35s ease-out; }
.service-menu-grid h2, .service-guide h2, .lounge-post h2, .lounge-side h2 { margin: 0 0 8px; font-size: var(--fs-xl); letter-spacing: -.7px; }
.service-menu-grid p, .service-guide p, .lounge-post p, .lounge-side p { margin: 0; color: var(--muted); font-size: var(--fs-base); line-height: 1.6; }
.service-guide { margin-top: 22px; overflow: hidden; }
.lounge-tabs { display: flex; gap: 7px; margin: 0 0 16px; }
.lounge-tabs a { padding: 8px 12px; color: var(--muted); text-decoration: none; font-size: var(--fs-base); border-radius: var(--radius-pill); }
.lounge-tabs a.on, .lounge-tabs a:hover { background: var(--lavender-soft); color: var(--lavender); }
.lounge-grid { align-items: start; }
.lounge-posts { display: grid; gap: 15px; }
.lounge-post { padding: 22px; border: 1px solid var(--line); border-radius: 17px; background: var(--paper); box-shadow: var(--shadow); cursor: pointer; }
.lounge-post:hover { border-color: var(--lavender); }
.lounge-post small { display: block; margin-bottom: var(--sp-2); color: var(--muted); font-size: var(--fs-xs); }
.lounge-post .button { margin-top: 15px; }
.lounge-side { display: grid; gap: 15px; }
.lounge-side .card { padding: 22px; }
.lounge-side .button { margin-top: var(--sp-3); }
.lounge-empty { padding: 34px 22px; border: 1px dashed var(--line); border-radius: 17px; color: var(--muted); text-align: center; font-size: var(--fs-base); }
@media (max-width: 880px) { .service-menu-grid > .card { min-height: 0; } }

/* /board 인덱스 게시글 목록 카드: 카드-목록 사이 패딩 제거, 좌측 카드에만 적용 (2026-09-28) */
.board-list-card { overflow: hidden; }
.board-list-card .card-head { padding: 9px; }
.board-list-card .card-body { padding: 0; }
.board-list-card .board-table-wrap {
  border: 0; border-radius: 0; box-shadow: none; background: transparent;
}
/* 목록 행 높이 축소: 셀 상하 패딩을 기존의 1/3 수준으로 (13/14px → 4/5px) */
.board-list-card .board-table thead th { padding: 4px 16px; }
.board-list-card .board-table tbody td { padding: 5px 16px; }

/* ─── Board Feed Table ───────────────────────── */
.board-table-wrap {
  border: 1px solid var(--line); border-radius: 17px;
  background: var(--paper); box-shadow: var(--shadow);
  overflow: hidden; overflow-x: auto;
}
/* `.board-table` 은 두 곳에서 서로 다른 요소에 쓰인다.
     - table.board-table  : 게시판/구독 표 (가로 스크롤이 필요해 min-width 를 준다)
     - div.board-table    : 게시판 목록 카드 (features.css) — min-width 가 있으면 모바일에서 넘친다
   그래서 최소 폭은 실제 표에만 적용한다(리뷰 134 §2.5). */
table.board-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); min-width: 620px; }
.board-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.board-table thead th {
  text-align: left; padding: 13px 16px;
  font-size: var(--fs-sm); font-weight: 500; color: var(--muted);
  background: var(--canvas); border-bottom: 1px solid var(--line);
  white-space: nowrap;
}
.board-table tbody td {
  padding: 14px 16px; border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.board-table tbody tr:last-child td { border-bottom: 0; }
.board-table tbody tr { cursor: pointer; transition: background .15s; }
.board-table tbody tr:hover { background: var(--canvas); }
.board-table .t-col-title { width: 42%; }
.board-table .t-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink); font-weight: 500;
}
.board-table .t-title-cell { min-width: 0; }
.board-table .t-title-cell .tag { margin: 0 7px 0 0; padding: 2px 7px; vertical-align: 1px; }
.board-table .t-board {
  color: var(--muted); font-size: var(--fs-sm); white-space: nowrap;
  display: inline-flex; align-items: center;
}
.board-table .t-meta { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
.board-table .t-date { color: var(--muted); font-size: var(--fs-sm); white-space: nowrap; }
@media (max-width: 880px) {
  .board-table .t-board-col, .board-table .t-meta { display: none; }
}

/* Psychology test flows */
.psy-flow { width: 100%; }
.psy-heading { margin: 0 0 24px; text-align: center; }
.psy-heading h1 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -1.6px; }
.psy-heading p { max-width: 560px; margin: 9px auto 0; color: var(--muted); font-size: var(--fs-md); line-height: 1.6; }
.psy-test-card {
    position: relative;
    min-height: 310px;
    padding: clamp(24px, 5vw, 42px);
    border: 1px solid var(--line);
    border-radius: 22px;
    background: radial-gradient(120% 90% at 50% -10%, var(--lavender-soft) 0%, transparent 55%), var(--paper);
    box-shadow: var(--shadow);
    overflow: hidden;
}
.psy-test-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--brand-primary), transparent);
    opacity: .55;
}
.psy-intro, .psy-loading { display: grid; place-items: center; gap: 14px; min-height: 250px; text-align: center; }
.psy-intro h2, .psy-question h2, .psy-loading h2, .psy-result h2 { margin: 0; font-size: clamp(1.25rem, 2.4vw, 1.625rem); letter-spacing: -.9px; }
.psy-intro p { max-width: 440px; margin: 0; color: var(--muted); font-size: var(--fs-md); line-height: 1.6; }
.psy-intro .big-emoji {
    display: grid;
    place-items: center;
    width: 84px;
    height: 84px;
    font-size: 2.5rem;
    border: 1px solid var(--line);
    border-radius: 50%;
    background: radial-gradient(circle at 50% 35%, var(--lavender-soft), var(--canvas));
    box-shadow: 0 12px 26px rgb(var(--brand-rgb) / .14);
}
.psy-intro-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.psy-intro-meta span { padding: 5px 12px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: var(--paper); color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.psy-intro .form-submit { width: min(100%, 330px); }
.psy-progress { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: var(--fs-15); }
.psy-progress span { margin-right: auto; }
.psy-progress b { color: var(--action-primary); font-weight: 800; }
.psy-progress .ghost { padding: 7px 10px; font-size: var(--fs-15); }
.psy-progress-track { display: flex; gap: 3px; margin: 16px 0 28px; }
.psy-progress-track i { flex: 1; height: 4px; border-radius: var(--radius-pill); background: var(--canvas); transition: background .25s, box-shadow .25s; }
.psy-progress-track i.done { background: linear-gradient(90deg, var(--brand-primary), #9d8bff); box-shadow: 0 0 6px rgb(var(--brand-rgb) / .35); }
.psy-options { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; margin-top: 22px; }
@media (max-width: 640px) { .psy-options { grid-template-columns: 1fr; } }
.psy-options .btn-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 96px;
    padding: 16px 12px;
    text-align: center;
    font-size: var(--fs-15);
    font-weight: 600;
    background: var(--canvas);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    color: var(--ink);
    word-break: keep-all;
    line-height: 1.4;
    transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease, background .16s ease;
}
.psy-options .btn-option:hover { border-color: var(--lavender); background: var(--lavender-soft); color: var(--ink); transform: translateY(-2px); box-shadow: 0 10px 22px rgb(var(--brand-rgb) / .14); }
.psy-options .btn-option:active { transform: translateY(0) scale(.985); }
.psy-option-index { display: grid; place-items: center; width: 26px; height: 26px; border: 1px solid var(--line); border-radius: 50%; background: var(--paper); color: var(--action-primary); font-size: var(--fs-sm); font-weight: 800; }
.psy-options .btn-option:hover .psy-option-index { border-color: var(--lavender); }
.psy-loading > div { font-size: 2.875rem; animation: float 1.4s ease-in-out infinite; }
.psy-result > p { margin: 18px 0 0; color: var(--muted); line-height: 1.75; }
.psy-result .tag { border-color: transparent; background: linear-gradient(135deg, var(--brand-primary), #8f7bff); color: var(--on-brand); }
.psy-result-summary { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-left: 3px solid var(--brand-primary); border-radius: 13px; background: linear-gradient(135deg, var(--lavender-soft), var(--paper)); color: var(--ink); font-weight: 500; line-height: 1.65; }
.psy-result-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; margin-top: var(--sp-4); }
.psy-result-grid > div { padding: 15px; border: 1px solid var(--line); border-radius: 13px; background: var(--canvas); font-size: var(--fs-base); }
.psy-result-grid b { color: var(--lavender); font-size: var(--fs-sm); }
.psy-result-grid p { margin: 7px 0 0; color: var(--muted); line-height: 1.55; }
.psy-result-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 22px; }

/* Psy personalization (2차: 답변 근거) */
.psy-personal { margin-top: 18px; padding: 16px 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--canvas); text-align: left; }
.psy-personal > b { display: block; margin-bottom: var(--sp-3); font-size: var(--fs-base); color: var(--ink); }
.psy-axis-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: var(--sp-3); }
.psy-axis-chip { display: grid; gap: 5px; min-width: 104px; padding: 9px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); font-size: var(--fs-xs); color: var(--muted); }
.psy-axis-chip b { font-size: var(--fs-sm); color: var(--ink); }
.psy-axis-chip em { font-style: normal; font-size: var(--fs-base); font-weight: 800; color: var(--action-primary); }
.psy-axis-track { display: block; height: 5px; border-radius: var(--radius-pill); background: var(--canvas); overflow: hidden; }
.psy-axis-track i { display: block; height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--brand-primary), #9d8bff); transition: width .5s cubic-bezier(.16, 1, .3, 1); }
.psy-personal-item { display: grid; gap: 3px; margin-top: var(--sp-2); padding: 10px 12px; border: 1px solid var(--line); border-left: 3px solid var(--brand-primary); border-radius: var(--radius-md); background: var(--paper); }
.psy-personal-item span { font-size: var(--fs-sm); color: var(--muted); }
.psy-personal-item em { font-style: normal; font-size: var(--fs-base); font-weight: 700; color: var(--ink); }
.psy-personal-stat { font-style: normal; font-size: var(--fs-xs); font-weight: 700; color: var(--action-primary); margin-top: 2px; }
.psy-fallback-note { margin-top: var(--sp-3); padding: 10px 14px; border: 1px solid rgba(232, 171, 76, .4); border-radius: var(--radius-md); background: rgba(232, 171, 76, .12); color: #8a5a12; font-size: var(--fs-sm); line-height: 1.6; }
.dark .psy-fallback-note { color: #fcd34d; }

/* Psy type guide (소개 화면 유형 안내) */
.psy-type-guide { width: 100%; max-width: 640px; margin-top: 6px; text-align: left; }
.psy-type-guide > b { display: block; margin-bottom: 10px; font-size: var(--fs-base); color: var(--ink); }
.psy-type-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@media (max-width: 640px) { .psy-type-grid { grid-template-columns: 1fr; } }
.psy-type-item { padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--paper); }
.psy-type-item b { display: block; font-size: var(--fs-base); color: var(--ink); }
.psy-type-item span { display: block; margin-top: 3px; font-size: var(--fs-sm); color: var(--muted); line-height: 1.5; }

/* 오늘의 운세 결과 요약(해볼 일/조심할 일) */
.summary-tips { display: grid; gap: 10px; }
.summary-tip { display: flex; gap: 12px; align-items: flex-start; padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--brand-primary); border-radius: 13px; background: var(--canvas); }
.summary-tip.caution { border-left-color: var(--gold); }
.summary-tip-icon { font-size: var(--fs-20); line-height: 1.2; }
.summary-tip b { display: block; margin-bottom: 3px; font-size: var(--fs-base); color: var(--ink); }
.summary-tip p { margin: 0; color: var(--muted); font-size: var(--fs-md); line-height: 1.6; }

/* Psy compare page (4차) */
.psy-compare-head { display: grid; justify-items: center; gap: 8px; text-align: center; }
.psy-compare-score { display: inline-flex; align-items: baseline; gap: 4px; padding: 10px 22px; border: 1px solid var(--line); border-radius: var(--radius-pill); background: linear-gradient(135deg, var(--lavender-soft), var(--paper)); }
.psy-compare-score b { font-size: 2.125rem; font-weight: 900; color: var(--action-primary); line-height: 1; }
.psy-compare-score span { font-size: var(--fs-md); font-weight: 800; color: var(--muted); }
.psy-compare-summary { margin: 0; color: var(--muted); font-size: var(--fs-base); }
.psy-compare-axes { display: grid; gap: 6px; margin-top: 18px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 13px; background: var(--canvas); }
.psy-compare-axes > b { margin-bottom: var(--sp-1); font-size: var(--fs-base); color: var(--ink); }
.psy-compare-axis { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 7px 0; border-top: 1px dashed var(--line); font-size: var(--fs-base); }
.psy-compare-axis:first-of-type { border-top: 0; }
.psy-compare-axis span { color: var(--ink); font-weight: 700; }
.psy-compare-axis em { font-style: normal; color: var(--muted); font-size: var(--fs-sm); }
.psy-compare-question { padding: 12px 0; border-top: 1px dashed var(--line); }
.psy-compare-question:first-of-type { border-top: 0; }
.psy-compare-question p { margin: 0 0 8px; font-size: var(--fs-base); font-weight: 700; color: var(--ink); }
.psy-compare-question > div { display: grid; gap: 6px; }
.psy-compare-question span { display: block; padding: 8px 12px; border-radius: 10px; background: var(--canvas); color: var(--muted); font-size: var(--fs-sm); }
.psy-compare-question span b { color: var(--ink); font-weight: 700; }
.psy-compare-question.is-same span { background: var(--action-primary-soft); }
.psy-note { margin-top: var(--sp-4); padding: 18px 21px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--canvas); }
.psy-note h2 { margin: 0 0 6px; font-size: var(--fs-15); }
.psy-note p { margin: 0; color: var(--muted); font-size: var(--fs-base); line-height: 1.6; }
@keyframes float { 50% { transform: translateY(-6px); } }
@media (max-width: 640px) { .psy-test-card { padding: 22px; } .psy-result-grid { grid-template-columns: 1fr; } }

/* Current mini-game interface */
.game-page { width: 100%; }
.game-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: var(--sp-6); }
.game-heading h1 { margin: 0; font-size: clamp(1.75rem, 3vw, 2.25rem); letter-spacing: -1.6px; }
.game-heading p { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-md); }
.game-surface { padding: clamp(22px, 4vw, 38px); border: 1px solid var(--line); border-radius: var(--radius-xl); background: var(--paper); box-shadow: var(--shadow); }
.game-toolbar { display: flex; justify-content: space-between; gap: 14px; margin-bottom: var(--sp-6); }
.game-board-choice, .coin-choice { display: flex; gap: 7px; flex-wrap: wrap; }
.game-board-choice button, .coin-choice button { min-height: 38px; padding: 0 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); color: var(--muted); font: inherit; font-size: var(--fs-sm); cursor: pointer; }
.game-board-choice button.on, .coin-choice button.on { border-color: var(--lavender); background: var(--lavender-soft); color: var(--lavender); font-weight: 600; }
.game-memory-grid { display: grid; gap: 9px; max-width: 680px; margin: 0 auto; }
.game-memory-card { aspect-ratio: 1; position: relative; border: 1px solid transparent; border-radius: 14px; background: linear-gradient(145deg,#43347b,#6549d4); color: #fff; cursor: pointer; box-shadow: 0 6px 12px rgba(67,52,123,.18); }
.game-memory-card i { font-style: normal; font-size: var(--fs-20); opacity: .75; }
.game-memory-card span { font-size: clamp(1.5rem, 5vw, 3rem); }
/* 뒤집힌 카드는 배경이 --canvas(연회색)로 바뀐다. 글자색을 그대로 두면
   (앞면 그라데이션용 흰색) 별자리 기호(♈ 같은 문자 글리프)가 배경에 묻힌다.
   이모지는 자체 색이라 무관하지만, 문자 글리프는 color 를 따른다.
   → 라이트 모드 대비 1.08:1 (인터랙션 감사 2026-10-23) */
.game-memory-card.is-open { border-color: var(--line); background: var(--canvas); color: var(--ink); box-shadow: none; }
.game-stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 10px; margin-top: 22px; }
.game-stats div { padding: 13px; border-radius: 13px; background: var(--canvas); text-align: center; }
.game-stats span { display: block; color: var(--muted); font-size: var(--fs-xs); }
.game-stats b { display: block; margin-top: var(--sp-1); color: var(--lavender); font-size: var(--fs-xl); }
.game-success { display: grid; gap: 4px; margin-top: var(--sp-4); padding: 15px; border-radius: 13px; background: #eaf8f2; color: #16805b; text-align: center; }
.game-success span { font-size: var(--fs-base); }
.coin-game, .wheel-game { display: grid; justify-items: center; }
.coin-container { padding: 16px 0 22px; perspective: 1000px; }
.coin { width: 150px; height: 150px; position: relative; transform-style: preserve-3d; transition: transform 1s ease-out; }
.coin-face { position: absolute; inset: 0; display: grid; place-content: center; gap: 5px; border-radius: 50%; backface-visibility: hidden; text-align: center; box-shadow: inset 0 0 17px rgba(0,0,0,.22),0 10px 23px rgba(38,28,75,.18); }
.coin-face b { font-size: 2.625rem; }.coin-face span { font-size: var(--fs-xs); letter-spacing: .12em; font-weight: 700; }
.coin-face.front { background: linear-gradient(135deg,#f7c95e,#fff0a6); color: #7a4b08; border: 5px solid #ebaf35; }.coin-face.back { background: linear-gradient(135deg,#748096,#d7dce4); color: #243040; border: 5px solid #7b8797; transform: rotateY(180deg); }
@keyframes coinFlip { 50% { transform: rotateY(900deg) translateY(-80px); } 100% { transform: rotateY(1800deg); } }.coin.flipping { animation: coinFlip 2s ease-out forwards; }.coin.heads { transform: rotateY(0); }.coin.tails { transform: rotateY(180deg); }
.coin-result, .wheel-result { display: grid; gap: 4px; min-height: 42px; text-align: center; }.coin-result b, .wheel-result b { font-size: var(--fs-xl); }.coin-result span, .wheel-result span { color: var(--muted); font-size: var(--fs-sm); }.coin-result.win { color: #16805b; }.coin-result.lose { color: #c55b71; }.coin-wait { min-height: 42px; color: var(--muted); font-size: var(--fs-base); }
.coin-controls { display: grid; grid-template-columns: repeat(2,1fr); gap: 18px; width: min(100%,560px); margin: 20px 0; }.coin-controls label,.control-label { display: grid; gap: 8px; color: var(--muted); font-size: var(--fs-sm); }.amount-stepper { display: grid; grid-template-columns: 42px 1fr 42px; border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; }.amount-stepper button,.amount-stepper input { min-height: 44px; border: 0; background: var(--canvas); color: var(--ink); text-align: center; font: inherit; }.amount-stepper button { cursor: pointer; font-size: var(--fs-20); }.coin-game .form-submit,.wheel-game .form-submit { width: min(100%,560px); }
.wheel-stage { position: relative; display: grid; place-items: center; margin: 8px 0 22px; }.wheel-stage canvas { width: min(70vw,300px); height: min(70vw,300px); border-radius: 50%; box-shadow: 0 14px 28px rgba(40,32,77,.18); transition: transform 4s cubic-bezier(.1,.8,.1,1); }.wheel-pointer { position: absolute; z-index: 2; top: -10px; width: 0; height: 0; border-left: 16px solid transparent; border-right: 16px solid transparent; border-top: 29px solid #e67d9b; }.wheel-center { position:absolute; display:grid; place-items:center; width:60px;height:60px;border:4px solid var(--paper);border-radius:50%;background:var(--ink);color:var(--ink-invert);font-size: var(--fs-xs);font-weight:700; }.wheel-meta { display:flex;gap:22px;margin:0 0 15px;color:var(--muted);font-size: var(--fs-sm); }.wheel-meta b { color:var(--lavender); }.wheel-legend { display:grid;grid-template-columns:repeat(3,1fr);gap:8px;width:min(100%,560px);margin-bottom: var(--sp-5); }.wheel-legend span { display:flex;align-items:center;gap:5px;padding: var(--sp-2);border:1px solid var(--line);border-radius:10px;font-size: var(--fs-xs); }.wheel-legend i { width:7px;height:7px;border-radius:50%; }.wheel-legend em { margin-left:auto;color:var(--muted);font-style:normal; }
.reaction-target { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; padding: 10px 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--canvas); }
.reaction-target-label { color: var(--muted); font-size: var(--fs-sm); font-weight: 700; letter-spacing: -.2px; }
.reaction-target-face { font-size: var(--fs-30); line-height: 1; }
.reaction-target-name { color: var(--ink); font-size: var(--fs-md); font-style: normal; font-weight: 700; }
.reaction-target.idle { border-style: dashed; }
.reaction-target.idle .reaction-target-face, .reaction-target.idle .reaction-target-name { color: var(--muted); }
.reaction-target.ready { border-color: #34d399; background: rgba(52,211,153,.12); }
.reaction-pad { display: grid; place-content: center; gap: 10px; width: 100%; min-height: 320px; border: 0; border-radius: 18px; background: linear-gradient(145deg,#43347b,#6549d4); color: #fff; cursor: pointer; font: inherit; text-align: center; transition: background .12s; }
.reaction-pad b { font-size: clamp(1.75rem, 5vw, 2.5rem); letter-spacing: -1.2px; }
.reaction-pad .reaction-symbol { font-size: clamp(4rem, 12vw, 7.5rem); line-height: 1; letter-spacing: 0; }
.reaction-pad.ready .reaction-symbol { animation: reaction-pop .18s ease-out; }
.reaction-pad span { font-size: var(--fs-base); opacity: .85; }
@keyframes reaction-pop { from { transform: scale(.55); } }
.reaction-pad.arming { background: linear-gradient(145deg,#a33b52,#d0627a); }
.reaction-pad.ready { background: linear-gradient(145deg,#0e9f6e,#34d399); }
.reaction-pad.result { background: linear-gradient(145deg,#2f2a45,#4b4370); }
.reaction-pad.tooSoon { background: linear-gradient(145deg,#8a5a1a,#c98a2e); }
.reaction-pad:active { filter: brightness(.96); }
.simon-status { min-height: 21px; margin: 0 0 16px; text-align: center; color: var(--muted); font-size: var(--fs-md); }
.simon-stage { display: grid; place-content: center; width: min(100%, 420px); min-height: 200px; margin: 0 auto 16px; border: 1px solid var(--line); border-radius: 18px; background: var(--canvas); text-align: center; }
.simon-stage.showing { border-color: #7c3aed; box-shadow: 0 0 0 4px rgba(124,58,237,.14); }
.simon-stage.celebrating { animation: simon-pop .5s ease; border-color: #34d399; }
.simon-stage-animal { display: grid; justify-items: center; gap: 6px; animation: simon-pop .35s ease; }
.simon-stage-animal b { font-size: clamp(3.5rem, 14vw, 5.5rem); line-height: 1; }
.simon-stage-animal span { color: var(--ink); font-size: var(--fs-15); font-weight: 700; }
.simon-stage-hint { color: var(--muted); font-size: var(--fs-base); }
.simon-choices { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; width: min(100%, 420px); margin: 0 auto; }
.simon-choice { display: grid; justify-items: center; gap: 4px; padding: 14px 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); cursor: pointer; font: inherit; transition: transform .08s, box-shadow .12s; }
.simon-choice b { font-size: clamp(1.75rem, 7vw, 2.5rem); line-height: 1; }
.simon-choice span { font-size: var(--fs-sm); color: var(--muted); }
.simon-choice.pressed { transform: scale(.93); box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / .4); }
.simon-choice.wrong { box-shadow: 0 0 0 3px rgba(227,93,106,.55); animation: simon-shake .35s ease; }
.simon-choice:disabled { cursor: default; opacity: .72; }
.simon-review { display: grid; gap: 10px; width: min(100%, 420px); margin: 0 auto 16px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--canvas); }
.simon-review-row { display: grid; grid-template-columns: 52px 1fr; align-items: center; gap: 10px; }
.simon-review-label { color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.simon-review-cells { display: flex; flex-wrap: wrap; gap: 6px; }
.simon-review-cell { display: grid; place-items: center; min-width: 34px; height: 34px; padding: 0 4px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); font-size: var(--fs-xl); }
.simon-review-cell.answer { border-color: #34d399; box-shadow: 0 0 0 2px rgba(52,211,153,.35); }
.simon-review-cell.ok { border-color: rgba(52,211,153,.55); }
.simon-review-cell.wrong { border-color: #e35d6a; box-shadow: 0 0 0 2px rgba(227,93,106,.4); }
.simon-review-cell.empty { color: var(--muted); opacity: .45; }
.simon-review-hint { margin: 2px 0 0; color: var(--muted); font-size: var(--fs-sm); }
.simon-start { display: block; width: min(100%, 420px); margin: 20px auto 0; }
.simon-status.level-up { color: #0e9f6e; font-weight: 700; animation: simon-pop .4s ease; }
@keyframes simon-pop { 50% { transform: scale(1.025); } }
@keyframes simon-shake { 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
@media (max-width:640px) { .simon-stage { min-height: 170px; } .simon-choices { gap: 8px; } .simon-choice b { font-size: var(--fs-3xl); } .simon-review-cell { min-width: 30px; height: 30px; font-size: var(--fs-lg); } }

/* ─── 동물 모아모아 (트리플 타일) ──────────────── */
.triple-status { min-height: 21px; margin: 0 0 14px; text-align: center; color: var(--muted); font-size: var(--fs-md); }
.triple-start { display: grid; gap: 14px; justify-items: center; }
.triple-start-lead { margin: 0; color: var(--muted); font-size: var(--fs-base); text-align: center; }
.triple-stage-panel { display: grid; gap: 10px; width: min(100%, 560px); padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--canvas); }
.triple-stage-head { display: flex; align-items: baseline; gap: 8px; }
.triple-stage-head b { font-size: var(--fs-xl); color: var(--ink); }
.triple-stage-head span { font-size: var(--fs-base); color: var(--muted); }
.triple-stage-head em { margin-left: auto; font-size: var(--fs-xs); font-style: normal; font-weight: 700; color: var(--lavender); }
.triple-stage-bar { height: 8px; border-radius: var(--radius-pill); background: var(--paper); overflow: hidden; }
.triple-stage-bar i { display: block; height: 100%; border-radius: var(--radius-pill); background: linear-gradient(90deg, var(--lavender), #a78bfa); transition: width .2s; }
.triple-stages { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; width: min(100%, 560px); }
.triple-stage { display: grid; gap: 4px; justify-items: center; padding: 14px 8px; border: 1px solid var(--line); border-radius: 14px; background: var(--paper); color: var(--ink); cursor: pointer; font: inherit; transition: transform .08s, box-shadow .12s; }
.triple-stage b { font-size: var(--fs-15); }
.triple-stage span { color: var(--ink); font-size: var(--fs-sm); }
.triple-stage em { color: var(--muted); font-size: var(--fs-xs); font-style: normal; }
.triple-stage:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 6px 12px rgba(40,32,77,.16); }
.triple-stage.locked { cursor: default; opacity: .55; background: var(--canvas); }
.triple-meta { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin: 0 0 10px; color: var(--muted); font-size: var(--fs-sm); }
.triple-meta b { color: var(--ink); }
.triple-board-wrap { display: grid; place-items: center; overflow: hidden; padding: 12px 0; container-type: inline-size; }
.triple-board { position: relative; width: calc(var(--cols) * var(--tile)); height: calc(var(--rows) * var(--tile) + 26px); --tile: clamp(28px, calc((min(100vw, 760px) - 96px) / var(--cols)), 52px); }
/* 타일 크기는 보드 컨테이너(cqw) 폭에서 캔버스 여백을 뺀 값 — 어떤 화면에서도 보드가 가로로 넘치지 않는다(위 100vw 식은 cqw 미지원 폴백). */
@supports (width: 1cqw) { .triple-board { --tile: clamp(26px, calc((100cqw - 24px) / var(--cols)), 52px); } }
/* 보드 캔버스: 타일이 놓이는 공간에 은은한 색과 반 칸 격자 점을 깔아 빈 칸·구멍을 보이게 한다. */
.triple-board::before { content: ''; position: absolute; inset: -12px; z-index: 0; border-radius: var(--radius-xl); border: 1px solid rgb(var(--brand-rgb) / .18); background-color: rgb(var(--brand-rgb) / .07); background-image: radial-gradient(rgb(var(--brand-rgb) / .22) 1px, transparent 1.5px); background-size: calc(var(--tile) / 2) calc(var(--tile) / 2); pointer-events: none; }
.triple-tile { position: absolute; display: grid; place-items: center; width: var(--tile); height: var(--tile); padding: 0; border: 1px solid rgba(60,45,110,.22); border-radius: 10px; background: var(--paper); box-shadow: 0 2px 4px rgba(40,32,77,.18); cursor: pointer; font: inherit; transition: transform .08s, box-shadow .12s, opacity .12s; }
.triple-tile span { font-size: calc(var(--tile) * .58); line-height: 1; }
.triple-tile .triple-tile-back { font-size: calc(var(--tile) * .42); line-height: 1; opacity: .3; }
.triple-tile.covered { box-shadow: none; filter: brightness(.82) saturate(.7); cursor: default; }
.triple-tile.selectable { outline: 2px solid rgba(124,58,237,.45); outline-offset: -2px; }
.triple-tile.selectable:hover { box-shadow: 0 6px 10px rgba(40,32,77,.24); }
.triple-tray { display: flex; gap: 6px; justify-content: center; margin: 14px 0 12px; }
.triple-tray-slot { display: grid; place-items: center; width: 40px; height: 40px; border: 1px dashed var(--line); border-radius: 10px; background: var(--canvas); font-size: var(--fs-20); }
.triple-tray-slot.filled { border-style: solid; background: var(--paper); }
.triple-actions { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.triple-action { padding: 8px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); color: var(--ink); cursor: pointer; font: inherit; font-size: var(--fs-base); }
.triple-action.primary { border-color: var(--lavender); background: var(--lavender); color: var(--on-brand); font-weight: 700; }
.triple-action.primary:hover { filter: brightness(.96); }
.triple-action:disabled { cursor: default; opacity: .5; }
.triple-confirm, .triple-result { margin: 12px auto 0; width: min(100%, 460px); padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--canvas); text-align: center; }
.triple-confirm p { margin: 0 0 10px; font-size: var(--fs-base); }
.triple-confirm-actions { display: flex; gap: 8px; justify-content: center; }
.triple-result { display: grid; gap: 4px; }
.triple-result b { font-size: var(--fs-15); }
.triple-result span { color: var(--muted); font-size: var(--fs-sm); }
.triple-error { margin: 12px 0 0; text-align: center; color: #c55b71; font-size: var(--fs-base); }
/* 휴대폰: 플레이 영역을 좌우로 넓히고(블리드) 캔버스 여백을 줄여 타일을 키운다. */
@media (max-width:640px) {
  .game-surface.triple-surface { margin-inline: -16px; padding: 12px 8px; border-radius: 18px; }
  .triple-board-wrap { padding: 8px 0; }
  .triple-board::before { inset: -8px; }
  .triple-stages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .triple-tray-slot { width: 34px; height: 34px; font-size: var(--fs-17); }
}
@supports (width: 1cqw) {
  @media (max-width:640px) { .triple-board { --tile: clamp(26px, calc((100cqw - 16px) / var(--cols)), 52px); } }
}
@media (max-width:640px) { .game-heading{align-items:start;flex-direction:column}.game-surface{padding: var(--sp-5)}.coin-controls{grid-template-columns:1fr}.wheel-legend{grid-template-columns:repeat(2,1fr)}.reaction-pad{min-height:240px} }

/* ─── Game Split (7:3 like board) ──────────────── */
.game-split { display: grid; grid-template-columns: 7fr 3fr; gap: 20px; align-items: start; }
.game-main-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.game-side-col { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 880px) { .game-split { grid-template-columns: 1fr; } }
.game-nav-card { padding: 16px 14px; }
.game-nav-title { margin: 0 0 10px; font-size: var(--fs-base); font-weight: 700; color: var(--ink); letter-spacing: -.4px; }
.game-nav-list { display: flex; flex-direction: column; gap: 8px; }
.game-nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--canvas); text-decoration: none;
  transition: border-color .15s, transform .15s, background .15s;
}
.game-nav-link:hover { border-color: var(--lavender); transform: translateY(-1px); }
.game-nav-link.active { border-color: var(--lavender); background: var(--lavender-soft); }
.dark .game-nav-link { background: rgba(255,255,255,.04); }
.game-nav-icon { font-size: var(--fs-2xl); line-height: 1; flex-shrink: 0; }
.game-nav-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.game-nav-body b { font-size: var(--fs-md); font-weight: 700; color: var(--ink); }
.dark .game-nav-body b { color: var(--ink); }
.game-nav-body em { font-size: var(--fs-sm); font-style: normal; color: var(--muted); }
.game-nav-all { display: inline-block; margin-top: var(--sp-3); font-size: var(--fs-base); font-weight: 600; color: var(--lavender); text-decoration: none; }

/* ─── Game Ranking Panel ───────────────────────── */
.game-ranking-card { padding: 16px 14px; margin-top: var(--sp-4); }
.game-ranking-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 10px; }
.game-ranking-title { margin: 0; font-size: var(--fs-base); font-weight: 700; color: var(--ink); letter-spacing: -.4px; }
.game-ranking-note { color: var(--muted); font-size: var(--fs-xs); }
.game-ranking-controls { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; margin-bottom: var(--sp-3); }
.game-ranking-controls label { display: grid; gap: 4px; color: var(--muted); font-size: var(--fs-xs); font-weight: 700; }
.game-ranking-controls select { width: 100%; min-height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 9px; background: var(--paper); color: var(--ink); font: inherit; font-size: var(--fs-sm); }
.game-ranking-list { display: grid; gap: 4px; margin: 0; padding: 0; list-style: none; }
.game-ranking-row { display: flex; align-items: center; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); border-radius: 10px; background: var(--canvas); font-size: var(--fs-base); }
.game-ranking-row.me { border-color: var(--lavender); background: var(--lavender-soft); }
.game-ranking-rank { flex: 0 0 22px; color: var(--muted); font-size: var(--fs-sm); text-align: center; }
.game-ranking-name { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--ink); }
.game-ranking-value { color: var(--lavender); font-size: var(--fs-base); }
.game-ranking-state { margin: 6px 0 0; color: var(--muted); font-size: var(--fs-sm); text-align: center; }
.game-ranking-state.error { color: #c55b71; }
.game-ranking-me { display: flex; align-items: center; gap: 8px; margin-top: var(--sp-2); padding: 8px 10px; border: 1px dashed var(--line); border-radius: 10px; color: var(--muted); font-size: var(--fs-sm); }
.game-ranking-me b { color: var(--ink); }
.game-ranking-me .game-ranking-value { margin-left: auto; color: var(--lavender); }

/* Living information page shells */
.life-page { width: 100%; }
.life-page-head { position: relative; margin-bottom: var(--sp-6); }.life-page-head h1 { margin: 0; font-size: clamp(1.8125rem,3.5vw,2.375rem); letter-spacing: -1.7px; }.life-page-head p { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-md); }.life-page-head select { position:absolute; right:0; bottom:0; min-height:42px; padding:0 12px; border:1px solid var(--line); border-radius:11px; background:var(--paper); color:var(--ink); }
.life-search { position:relative; display:flex; gap:8px; margin-bottom:22px; }.life-search > span { position:absolute; left:16px; top:14px; color:var(--muted); font-size: var(--fs-20); }.life-search input { width:100%; min-width:0; height:52px; box-sizing:border-box; padding:0 16px 0 45px; border:1px solid var(--line); border-radius:14px; background:var(--paper); color:var(--ink); font:inherit; box-shadow:var(--shadow); }.life-search input:focus { border-color:var(--lavender); box-shadow:0 0 0 3px rgb(var(--brand-rgb) / .12); }.life-search button { flex:0 0 auto; height:52px; box-sizing:border-box; border:1px solid rgb(var(--brand-rgb) / .16); border-radius:14px; padding:0 17px; background:var(--lavender-soft); color:var(--lavender); font:inherit; font-size: var(--fs-base); font-weight:700; cursor:pointer; }.life-search button:hover { background:var(--lavender); color:var(--on-brand); }
.life-placeholder,.life-empty { display:grid; place-items:center; gap:8px; min-height:230px; padding: var(--sp-6); border:1px solid var(--line); border-radius: var(--radius-xl); background:var(--paper); color:var(--muted); text-align:center; box-shadow:var(--shadow); }.life-placeholder > div{font-size: 2.625rem}.life-placeholder h2,.life-empty b{margin:0;color:var(--ink);font-size: var(--fs-xl)}.life-placeholder p,.life-empty span{margin:0;font-size: var(--fs-base)}
.life-result-list{display:grid;gap:10px}.life-result-count{margin:0 0 2px;color:var(--muted);font-size: var(--fs-sm)}.life-result-card{display:flex;align-items:center;gap:15px;padding:17px;border:1px solid var(--line);border-radius: var(--radius-lg);background:var(--paper);color:inherit;text-decoration:none;box-shadow:var(--shadow)}.life-result-card:hover{border-color:var(--lavender)}.life-result-card h2,.life-detail h2{margin:5px 0 3px;font-size: var(--fs-xl)}.life-result-card p,.life-muted{margin:0;color:var(--muted);font-size: var(--fs-base)}.life-result-card strong{margin-left:auto;color:var(--lavender);font-size: var(--fs-15)}.tour-result-card img{width:92px;height:70px;border-radius:10px;object-fit:cover}.life-detail{padding: var(--sp-6);border:1px solid var(--line);border-radius: var(--radius-xl);background:var(--paper);box-shadow:var(--shadow)}.life-detail .back-link{display:inline-block;margin-bottom:18px;color:var(--muted);font-size: var(--fs-base);text-decoration:none}.life-detail .back-link:hover{color:var(--lavender)}.life-detail-note{margin:20px 0 0;color:var(--muted);font-size: var(--fs-md);line-height:1.7}.tour-detail img{display:block;width:100%;max-height:310px;margin:0 0 20px;border-radius:14px;object-fit:cover}
/* ─── Weather Page (풀스크인) ──────────────────── */
.weather-header {
  display: flex; justify-content: space-between; align-items: center;
  margin-bottom: var(--sp-6);
}
.weather-header h1 { margin: 0; font-size: var(--fs-3xl); letter-spacing: -1px; }
.area-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
}
.area-tab {
  padding: 6px 14px; border-radius: var(--radius-sm);
  font-size: var(--fs-base); color: var(--muted); text-decoration: none;
  background: var(--paper); border: 1px solid var(--line); transition: .15s;
}
.area-tab:hover { color: var(--ink); border-color: var(--lavender); }
.area-tab.active { background: var(--lavender); color: var(--on-brand); border-color: var(--lavender); }
.dark .area-tab { background: rgba(255,255,255,.06); }
.dark .area-tab.active { background: var(--lavender); }

/* 기상 속보 */
.weather-warnings { margin-bottom: var(--sp-6); }
.weather-warnings h2 { font-size: var(--fs-lg); margin: 0 0 12px; }
.warning-card {
  padding: 8px 16px; border-radius: var(--radius-md);
  background: rgba(255,82,82,.04); border: 1px solid rgba(255,82,82,.12);
}
.dark .warning-card { background: rgba(255,82,82,.08); }
.warning-row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0;
}
.warning-row + .warning-row { border-top: 1px solid rgba(255,82,82,.1); }
.warning-level {
  padding: 2px 8px; border-radius: 4px;
  font-size: var(--fs-2xs); font-weight: 600; color: var(--ink-invert);
  background: var(--coral); flex-shrink: 0;
}
.warning-level.WARNING { background: #e53935; }
.warning-level.ADVISORY { background: #ff9800; }
.warning-title { font-size: var(--fs-base); }
.warning-empty {
  padding: var(--sp-4); text-align: center; border-radius: var(--radius-md);
  background: rgba(0,0,0,.02); border: 1px dashed var(--line);
  color: var(--muted); font-size: var(--fs-base);
}
.dark .warning-empty { background: rgba(255,255,255,.03); }

/* 추천 카드 */
.weather-recommend { margin-bottom: var(--sp-6); }
.weather-recommend h2 { font-size: var(--fs-lg); margin: 0 0 12px; }
.recommend-cards {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
@media (max-width: 640px) { .recommend-cards { grid-template-columns: 1fr; } }
.rec-card {
  border-radius: var(--radius-md); overflow: hidden;
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: var(--shadow); text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.rec-card:hover { border-color: var(--lavender); transform: translateY(-2px); }
.rec-image {
  height: 120px; background-size: cover; background-position: center;
  background-color: var(--canvas); position: relative;
}
.rec-category {
  position: absolute; top: 8px; left: 8px;
  padding: 3px 8px; border-radius: var(--radius-xs);
  background: rgba(0,0,0,.6); color: #fff; font-size: var(--fs-2xs);
}
.rec-info { padding: 10px 12px; }
.rec-info b { display: block; font-size: var(--fs-base); font-weight: 500; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dark .rec-info b { color: var(--ink); }
.rec-info span { display: block; font-size: var(--fs-xs); color: var(--muted);
  margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 상세 예보 */
.weather-forecast { margin-bottom: var(--sp-6); }
.weather-forecast h2 { font-size: var(--fs-lg); margin: 0 0 12px; }
.forecast-scroll { overflow-x: auto; margin: 0 -4px; padding: 0 4px; }
.forecast-grid {
  display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 8px;
  min-width: 100%;
}
.forecast-item {
  display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 12px 6px; border-radius: var(--radius-md);
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.fc-datetime { font-size: var(--fs-xs); color: var(--muted); }
.fc-icon { font-size: var(--fs-26); line-height: 1; }
.fc-temp { font-size: var(--fs-15); font-weight: 600; }
.fc-detail { font-size: var(--fs-2xs); }
.fc-pop { color: #42a5f5; }
.fc-reh { color: #66bb6a; }

/* 통계 */
.weather-stats {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
  margin-bottom: var(--sp-6);
}
/* 예보와 한 블록으로 묶인 통계는 아래 예보 카드와 간격을 줄인다 */
.weather-forecast .weather-stats { margin-bottom: var(--sp-3); }
@media (max-width: 640px) { .weather-stats { grid-template-columns: repeat(2, 1fr); } }
.stat-item {
  padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.stat-label { display: block; font-size: var(--fs-xs); color: var(--muted); }
.stat-value { display: block; margin-top: var(--sp-1); font-size: var(--fs-17); font-weight: 600; }

/* 대기질 */
.air-quality { margin-bottom: var(--sp-6); }
.air-quality-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: var(--sp-3); }
.air-quality-head h2 { font-size: var(--fs-lg); margin: 0; }
.air-quality-head-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; flex-wrap: wrap; }
.air-quality-station { font-size: var(--fs-base); color: var(--muted); }
.air-map-toggle {
  font-size: var(--fs-sm); font-weight: 600; padding: 6px 10px; border-radius: var(--radius-sm);
  border: 1px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer;
}
.air-map-toggle:disabled { opacity: .5; cursor: not-allowed; }
.air-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
@media (max-width: 1024px) { .air-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 640px) { .air-grid { grid-template-columns: 1fr; } }
.air-item {
  display: flex; flex-direction: column; gap: 8px;
  padding: 14px 16px; border-radius: var(--radius-md);
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.air-item-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.air-name { font-size: var(--fs-base); color: var(--muted); }
.air-code { font-size: var(--fs-xs); font-weight: 600; color: var(--muted); opacity: .7; letter-spacing: .04em; }
.air-item-value { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.air-value { font-size: var(--fs-26); font-weight: 700; color: var(--ink); }
.air-unit { font-size: var(--fs-sm); color: var(--muted); flex: 1; }
.air-item-bottom { margin-top: auto; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.air-grade {
  font-size: var(--fs-xs); font-weight: 600; padding: 2px 8px; border-radius: var(--radius-pill);
  background: rgba(0,0,0,.05); color: var(--muted);
}
.air-grade.grade-1 { background: rgba(66,165,245,.14); color: #1e88e5; }
.air-grade.grade-2 { background: rgba(102,187,106,.16); color: #2e7d32; }
.air-grade.grade-3 { background: rgba(255,167,38,.18); color: #ef6c00; }
.air-grade.grade-4 { background: rgba(229,57,53,.16); color: #c62828; }
.air-grade.grade-none { background: rgba(0,0,0,.05); color: var(--muted); }
.dark .air-grade { background: rgba(255,255,255,.08); color: var(--muted); }
.dark .air-grade.grade-1 { color: #90caf9; }
.dark .air-grade.grade-2 { color: #a5d6a7; }
.dark .air-grade.grade-3 { color: #ffcc80; }
.dark .air-grade.grade-4 { color: #ef9a9a; }
.air-flag {
  font-size: var(--fs-2xs); font-weight: 600; padding: 2px 6px; border-radius: 4px;
  color: #c62828; background: rgba(229,57,53,.1);
}
.dark .air-flag { color: #ef9a9a; background: rgba(229,57,53,.18); }
.air-item.khai { border-color: rgba(121, 85, 72, .45); }
.dark .air-item.khai { border-color: rgba(215, 204, 200, .35); }
.air-median-tag {
  flex: none; font-size: var(--fs-xs); font-weight: 600; letter-spacing: .02em;
  padding: 2px 7px; border-radius: var(--radius-pill);
  color: var(--muted); background: rgba(0,0,0,.05);
}
.dark .air-median-tag { background: rgba(255,255,255,.08); }
.air-extremes {
  display: flex; flex-direction: column; gap: 4px; width: 100%;
  font-size: var(--fs-sm); color: var(--muted);
}
.air-extreme { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.air-extreme b { color: var(--ink); font-weight: 600; }
.air-extreme-station { opacity: .85; text-align: right; }
.air-sample { font-size: var(--fs-xs); color: var(--muted); opacity: .8; }
.air-quality-empty-sub { margin-left: 6px; font-size: var(--fs-sm); opacity: .8; }
.air-map-wrap { margin-top: var(--sp-3); border: 1px solid var(--line); border-radius: var(--radius-md); overflow: hidden; background: var(--paper); }
.air-map { width: 100%; height: 360px; }
@media (max-width: 640px) { .air-map { height: 280px; } }
.air-map-note { margin: 0; padding: 8px 12px; font-size: var(--fs-xs); color: var(--muted); border-top: 1px solid var(--line); }
.air-map-info { padding: 6px 10px; font-size: var(--fs-sm); color: #111; line-height: 1.5; }
.air-map-fail { margin: 0; padding: 24px 12px; text-align: center; font-size: var(--fs-sm); color: var(--muted); }

/* 지역 허브(/locality) */
.locality-page { margin-bottom: 28px; }
.locality-head { margin-bottom: var(--sp-4); }
.locality-head h1 { font-size: var(--fs-2xl); margin: 0 0 6px; }
.locality-sub { margin: 0; font-size: var(--fs-base); color: var(--muted); display: flex; flex-wrap: wrap; gap: 8px; align-items: baseline; }
.locality-split { display: grid; grid-template-columns: 7fr 3fr; gap: 16px; align-items: start; }
@media (max-width: 1024px) { .locality-split { grid-template-columns: 1fr; } }
.locality-main { min-width: 0; }
.locality-side { position: sticky; top: 16px; }
@media (max-width: 1024px) { .locality-side { position: static; } }
.locality-side .card + .card, .hub-side .card + .card { margin-top: var(--sp-3); }
/* 지역 목록 — 홈 '띠별/별자리' 탭과 같은 크기의 텍스트 버튼 */
.locality-region-grid { display: flex; flex-wrap: wrap; gap: 4px; }
.locality-region-item {
  display: inline-flex; align-items: center; padding: 4px 12px;
  font-size: var(--fs-base); font-weight: 500; white-space: nowrap;
  color: var(--muted); background: none; border: none; border-radius: var(--radius-sm);
  text-decoration: none; transition: .15s;
}
.locality-region-item:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.dark .locality-region-item:hover { background: rgba(255,255,255,.06); }
.locality-region-item.is-current { background: rgb(var(--brand-rgb) / .1); color: var(--lavender); }
.locality-region-item.is-disabled { opacity: .55; pointer-events: none; }
/* 게시판 주제별 바로가기(우측 카드) — 주제는 왼쪽 그룹과 같이 진하게 + 줄 */
.board-side-group + .board-side-group { margin-top: var(--sp-4); }
.board-side-title { font-size: var(--fs-base); margin: 0 0 8px; }
/* /board 인덱스: 카드 제목("게시판")·그룹명 필터 링크 */
.board-side-select { color: inherit; text-decoration: none; transition: .15s; }
.board-side-select:hover { color: var(--lavender); }
.board-side-select.is-current { color: var(--lavender); }
.locality-section { margin-bottom: 22px; }
.locality-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.locality-section > h2 { font-size: var(--fs-lg); margin: 0 0 10px; }
.locality-section-head h2 { font-size: var(--fs-lg); margin: 0; }
.locality-section-head h3 { font-size: var(--fs-md); margin: 0; }
.locality-section-head h3 a { color: var(--ink); text-decoration: none; }
.locality-more { font-size: var(--fs-sm); color: var(--muted); text-decoration: none; }
.locality-count { font-size: var(--fs-sm); color: var(--muted); font-weight: 500; }
.locality-weather { margin: 0; font-size: var(--fs-15); font-weight: 600; }
.locality-empty {
  margin: 0; padding: 18px 16px; border-radius: var(--radius-md);
  border: 1px dashed var(--line); color: var(--muted); font-size: var(--fs-base); text-align: center;
}
.locality-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.locality-list li {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--paper); font-size: var(--fs-base);
}
.locality-list a { color: var(--ink); text-decoration: none; }
.locality-post-time { font-size: var(--fs-xs); color: var(--muted); flex: none; }
.locality-board { margin-bottom: 14px; }
.air-quality-empty {
  margin: 0; padding: 18px 16px; border-radius: var(--radius-md);
  border: 1px dashed var(--line); color: var(--muted);
  font-size: var(--fs-base); text-align: center;
}
.air-quality-meta {
  display: flex; flex-wrap: wrap; gap: 10px;
  margin-top: 10px; font-size: var(--fs-xs); color: var(--muted);
}
.air-stale { color: #ef6c00; font-weight: 600; }
.dark .air-stale { color: #ffb74d; }

/* 생활지수 */
.weather-indices { margin-bottom: var(--sp-6); }
.weather-indices h2 { font-size: var(--fs-lg); margin: 0 0 12px; }
.index-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (max-width: 640px) { .index-grid { grid-template-columns: repeat(2, 1fr); } }
.index-item {
  padding: 14px; border-radius: var(--radius-md);
  background: var(--paper); border: 1px solid var(--line);
  box-shadow: var(--shadow); text-align: center;
}
.idx-name { display: block; font-size: var(--fs-xs); color: var(--muted); }
.idx-value { display: block; margin: 5px 0; font-size: var(--fs-20); font-weight: 600; }
.idx-grade { font-size: var(--fs-sm); color: var(--lavender); font-style: normal; }

/* ─── Fortune input flows ────────────────────── */
/* Shared user-form components. Individual screens opt in with these classes. */
.form-panel {
  padding: clamp(24px, 4vw, 38px);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow);
}
.form-label {
  display: block;
  margin: 0 0 7px;
  color: var(--muted);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .04em;
}
.form-row { display: grid; gap: 14px; }
.fortune-flow > .text-center {
  padding: 10px 18px 4px;
}
.fortune-flow > .text-center h1 {
  font-size: clamp(1.6875rem, 3vw, 2.25rem);
  letter-spacing: -1.5px;
  color: var(--ink);
}
.fortune-flow > .text-center p {
  max-width: 560px;
  margin: 8px auto 0;
  color: var(--muted);
}

/* ─── § 9. Feature: Fortune Flows (표준 컴포넌트) ── */
.fortune-hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.625rem, 4vw, 2.25rem);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -1.2px;
  text-align: center;
}
.fortune-hero-desc {
  margin: 0 auto 24px;
  max-width: 520px;
  font-size: var(--fs-md);
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}
.fortune-form-panel {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: clamp(20px, 4vw, 36px);
  box-shadow: var(--shadow);
}
.fortune-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
.fortune-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
@media (max-width: 640px) {
  .fortune-grid-2 { grid-template-columns: 1fr; }
}
.fortune-select, .fortune-input {
  width: 100%;
  box-sizing: border-box;
  background: var(--canvas);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  padding: 12px 14px;
  font-size: var(--fs-md);
  color: var(--ink);
  font-family: inherit;
}
.dark .fortune-select,
.dark .fortune-input { background: rgba(255,255,255,.05); border-color: var(--line); color: var(--ink); }

/* Fortune Hero */
/* 운세 종류 퀵 메뉴 (메인과 같은 7:3 컬럼, 모바일에서는 본문 상단) */
.content.fortune-content-layout {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 20px;
  align-items: start;
}
.fortune-content-layout > main,
.fortune-content-layout > main > .fortune-flow,
.fortune-content-layout > main > .animate-fade-in,
.fortune-content-layout > main > .animate-fade-in > .fortune-flow { display: contents; }
.fortune-content-layout > main > .fortune-flow > .fortune-hero,
.fortune-content-layout > main > .animate-fade-in > .fortune-flow > .fortune-hero {
  grid-column: 1 / -1;
  grid-row: 1;
}
.fortune-content-layout > main > .fortune-flow > :not(.fortune-hero),
.fortune-content-layout > main > .animate-fade-in > .fortune-flow > :not(.fortune-hero) {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}
.fortune-content-layout > main > :not(aside) {
  grid-column: 1;
  grid-row: 2;
  min-width: 0;
}
.fortune-content-layout > main > .psy-flow { display: contents; }
.fortune-content-layout > main > .psy-flow > .psy-heading { grid-column: 1 / -1; grid-row: 1; }
.fortune-content-layout > main > .psy-flow > .psy-test-card { grid-column: 1; grid-row: 2; min-width: 0; }
.fortune-content-layout > main > .psy-flow > .psy-note { grid-column: 1; }
.fortune-content-layout > .fortune-quick-nav { grid-column: 2; grid-row: 2; }
.fortune-tabbar {
  display: flex; flex-direction: column; gap: 10px;
}
.fortune-tabbar a {
  display: flex; align-items: center; gap: 11px;
  padding: 14px; border-radius: var(--radius-lg); text-decoration: none;
  color: var(--ink); background: var(--paper); border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transition: transform .15s, border-color .15s, background .15s;
}
.fortune-tabbar a:hover { transform: translateY(-1px); border-color: var(--lavender); }
.fortune-tabbar a.active {
  border-color: var(--lavender); background: var(--action-primary-soft);
}
.fortune-tab-icon {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 10px; background: var(--canvas); font-size: var(--fs-lg);
}
.fortune-tab-copy { min-width: 0; }
.fortune-tab-copy b, .fortune-tab-copy small { display: block; }
.fortune-tab-copy b { font-size: var(--fs-md); font-weight: 700; }
.fortune-tab-copy small { margin-top: 3px; color: var(--muted); font-size: var(--fs-xs); line-height: 1.35; }
.fortune-tabbar a.active .fortune-tab-icon { background: var(--lavender); color: var(--on-brand); }
.dark .fortune-tabbar a { background: rgba(255,255,255,.04); }
.dark .fortune-tabbar a.active { background: rgba(125, 106, 224, .18); }
.post-tabs { display: flex; gap: 6px; }
.post-tabs button {
  padding: 4px 12px; border-radius: var(--radius-pill); border: 1px solid var(--line);
  background: var(--paper); color: var(--muted); font-size: var(--fs-sm); font-weight: 600;
  cursor: pointer; transition: all .15s;
}
.post-tabs button:hover { border-color: var(--lavender); color: var(--ink); }
.post-tabs button.active { background: var(--lavender); border-color: var(--lavender); color: var(--on-brand); }
@media (max-width: 880px) {
  .content.fortune-content-layout { display: flex; flex-direction: column; gap: 12px; }
  .fortune-content-layout > .fortune-quick-nav { width: 100%; }
  .fortune-tabbar {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
    margin: 0 0 8px;
  }
  .fortune-tabbar a {
    flex: 1 1 calc(50% - 8px);
    padding: 10px 12px;
    border-radius: var(--radius-md);
    box-shadow: none;
  }
  .fortune-tab-icon { width: 28px; height: 28px; flex-basis: 28px; font-size: var(--fs-md); }
  .fortune-tab-copy small { display: none; }
}

.fortune-hero { text-align: center; margin-bottom: var(--sp-1); }.fortune-hero-title {
  margin: 0 0 8px;
  font-size: clamp(1.625rem, 4vw, 2.25rem);
  font-weight: 500;
  color: var(--ink);
  letter-spacing: -1.2px;
  text-align: center;
}
.fortune-hero-desc {
  margin: 0 auto 24px;
  max-width: 520px;
  font-size: var(--fs-md);
  color: var(--muted);
  line-height: 1.6;
  text-align: center;
}

/* Fortune info/explanation card */
.fortune-info-card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 28px;
  box-shadow: var(--shadow);
}
.dark .fortune-info-card { background: var(--paper); border-color: var(--line); }
.fortune-info-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.fortune-info-icon {
  width: 36px; height: 36px; flex: 0 0 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--radius-md);
  background: var(--action-primary-soft);
  font-size: var(--fs-17);
}
.fortune-info-title { margin: 0; font-size: var(--fs-15); font-weight: 600; color: var(--ink); }
.fortune-info-text { margin: 0 0 10px; color: var(--muted); font-size: var(--fs-base); line-height: 1.75; }
.fortune-info-text:last-child { margin-bottom: 0; }
.fortune-info-text strong { color: var(--ink); font-weight: 600; }

.fortune-tag-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .fortune-tag-grid { grid-template-columns: repeat(3, 1fr); } }
.fortune-tag-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: var(--sp-3); background: var(--canvas); border-radius: var(--radius-md);
}
.fortune-tag-item .fortune-tag-emoji { font-size: var(--fs-15); line-height: 1.4; flex: 0 0 auto; }
.fortune-tag-item b { display: block; font-size: var(--fs-sm); font-weight: 600; color: var(--ink); }
.fortune-tag-item span { display: block; margin-top: 2px; font-size: var(--fs-xs); color: var(--muted); line-height: 1.6; }

.fortune-step-list { display: grid; gap: 12px; }
.fortune-step-item { display: flex; align-items: flex-start; gap: 12px; }
.fortune-step-num {
  width: 20px; height: 20px; flex: 0 0 20px; margin-top: 2px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: var(--action-primary-soft); color: var(--action-primary);
  font-size: var(--fs-xs); font-weight: 800;
}
/* 다크에서는 action-primary(#a78bfa) 가 배경과 붙어 4.4:1 로 떨어진다 → 밝은 보라(--plum) */
.dark .fortune-step-num { background: rgb(var(--brand-rgb) / .18); color: var(--plum); }
.fortune-step-item p { margin: 0; color: var(--muted); font-size: var(--fs-base); line-height: 1.7; }
.fortune-step-item strong { color: var(--ink); font-weight: 600; }

.fortune-faq { border-top: 1px solid var(--line); }
.fortune-faq-item { padding: 14px 0; border-bottom: 1px solid var(--line); }
.fortune-faq-item summary {
  cursor: pointer;
  font-size: var(--fs-base);
  font-weight: 600;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.fortune-faq-item summary::-webkit-details-marker { display: none; }
.fortune-faq-item summary::after {
  content: '＋';
  flex: none;
  color: var(--muted);
  font-weight: 400;
}
.fortune-faq-item[open] summary { margin-bottom: 6px; }
.fortune-faq-item[open] summary::after { content: '−'; }
.fortune-faq-item p { margin: 0; color: var(--muted); font-size: var(--fs-base); line-height: 1.7; }

/* 오늘의 운세 입력 편의: 시각 모름 버튼·상황 칩·저장 안내 */
.time-unknown-toggle { margin-top: var(--sp-2); }
.situation-group .form-hint { margin-bottom: 10px; }
.situation-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 10px; }
.situation-chips .chip {
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--paper);
  color: var(--muted);
  font: inherit;
  font-size: var(--fs-sm);
  font-weight: 700;
  cursor: pointer;
  transition: border-color .15s ease, background .15s ease, color .15s ease;
}
.situation-chips .chip:hover,
.situation-chips .chip:focus-visible { border-color: var(--lavender); background: var(--lavender-soft); color: var(--ink); }
.situation-group .fortune-input + .fortune-input { margin-top: var(--sp-2); }

/* 음력 변환: 윤달 체크·결과 변환 안내 */
.lunar-leap-row { display: flex; align-items: center; gap: 6px; margin-top: var(--sp-2); cursor: pointer; }
.lunar-leap-row input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--lavender); }
.saju-calendar-note { margin-top: var(--sp-1); font-size: var(--fs-sm); color: var(--muted); }

/* Fortune choice grid (zodiac / horoscope) */
.fortune-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
@media (min-width: 640px) { .fortune-choice-grid { grid-template-columns: repeat(4, 1fr); } }
@media (min-width: 880px) { .fortune-choice-grid { grid-template-columns: repeat(6, 1fr); } }
.fortune-choice-card {
  padding: 20px 12px; text-align: center;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  /* <button> 은 UA 기본 글자색(검정)을 쓴다 → 다크 카드 위에서 글자가 사라진다.
     (2026-10-23 다크 대비 감사: 띠별·별자리 24건) */
  color: var(--ink);
  box-shadow: var(--shadow);
  cursor: pointer;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.fortune-choice-card:hover { transform: translateY(-3px); border-color: var(--action-primary); box-shadow: var(--shadow-hover); }
.fortune-choice-card.sel { border-color: var(--action-primary); background: var(--action-primary-soft); }
.dark .fortune-choice-card { background: var(--paper); border-color: var(--line); }
.dark .fortune-choice-card.sel { background: var(--action-primary-soft); border-color: var(--action-primary); }
.fortune-choice-emoji { font-size: 2.25rem; line-height: 1; margin-bottom: 6px; }
.fortune-choice-name { font-size: var(--fs-base); font-weight: 700; color: var(--ink); }
.fortune-choice-meta { margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--muted); font-weight: 600; }

/* Fortune report loading overlay (report-container 내부) */
.fortune-report-loading {
  position: absolute; inset: 0; z-index: 20;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(255,255,255,.8);
  border-radius: var(--radius-xl);
}
.dark .fortune-report-loading { background: rgba(15,23,42,.8); }
.fortune-report-loading .spinner,
.fortune-report-loading .spinner-lg { margin-bottom: 0; }
.fortune-report-loading span { font-size: var(--fs-base); font-weight: 700; color: var(--action-primary); }
.dark .fortune-report-loading span { color: var(--gold); }

/* Tarot card back */
.tarot-card-back {
  background: linear-gradient(145deg, #382c67 0%, #6049cb 58%, #8a76ef 100%);
  border: 1px solid rgba(255, 255, 255, .28);
  box-shadow: 0 12px 24px rgba(56, 44, 103, .26);
}
.dark .tarot-card-back {
  background: linear-gradient(145deg, #5b458a 0%, #8a76ef 58%, #f5d17a 100%);
}
.tarot-card-back svg { color: rgba(255, 255, 255, .58); }
.tarot-card-back:hover {
  background: linear-gradient(145deg, #4b368f 0%, #6549d4 58%, #9b8cf2 100%);
}
.dark .tarot-card-back:hover {
  background: linear-gradient(145deg, #5b458a 0%, #8a76ef 58%, #f5d17a 100%);
}

/* Fortune form error message */
.fortune-error {
  margin: 12px 0 0; text-align: center;
  font-size: var(--fs-base); font-weight: 700;
  color: var(--coral, #f1786b);
}
.fortune-error[role="alert"] { color: #dc2626; }

/* Fortune error panel (전체 화면 오류 안내) */
.fortune-error-panel {
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  padding: 40px 20px; text-align: center;
  background: var(--paper); border: 1px dashed var(--line);
  border-radius: var(--radius-xl);
}
.fortune-error-panel .fortune-error { margin: 0; font-size: var(--fs-15); }


/* Fortune form hint (incomplete fields) */
.form-hint {
  margin: 8px 0 0; text-align: center;
  font-size: var(--fs-sm); font-weight: 500;
  /* 하드코딩 slate-400 은 흰 배경에서 2.56:1 이다(라이트 대비 감사 2026-10-23). */
  color: var(--muted);
}
.form-hint span { margin: 0 2px; }
.form-hint span:not(:last-child) { color: var(--muted); }

/* Fortune field helper (select chevron, toggle rows) */
.fortune-field { position: relative; }
.fortune-select-chevron {
  position: absolute; right: 14px; top: 50%;
  transform: translateY(-50%);
  pointer-events: none;
  color: var(--muted);
}
.fortune-toggle-row { display: flex; gap: 8px; }

/* Fortune report wrapper (report-container 내부 오버레이용) */
.fortune-report-wrap { position: relative; overflow: hidden; min-height: 160px; }

/* Couple result enter animation */
.couple-result-enter { animation: fadeUpIn 1.2s cubic-bezier(0.16, 1, 0.3, 1) both; }
@keyframes fadeUpIn {
  from { opacity: 0; transform: translateY(28px) scale(0.97); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}

/* Couple flow (이름 궁합) */
.couple-name-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 16px;
  align-items: end;
}
@media (max-width: 880px) { .couple-name-row { grid-template-columns: 1fr; } }
.couple-name-row label { display: block; margin-bottom: 6px; font-size: var(--fs-15); font-weight: 800; }
.couple-name-first { color: #ec4899; }
.couple-name-second { color: #f43f5e; }
.couple-heart-divider { display: flex; align-items: center; justify-content: center; gap: 12px; }
.couple-divider-line { height: 1px; flex: 1; background: var(--line); }
@media (min-width: 880px) { .couple-divider-line { display: none; } }
.couple-heart-badge {
  width: 40px; height: 40px; flex: 0 0 40px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  background: #fdf2f8; border: 1px solid #fce7f3; font-size: var(--fs-20);
}
.dark .couple-heart-badge { background: rgba(190,24,93,0.3); border-color: rgba(190,24,93,0.4); }
.couple-submit {
  background: linear-gradient(135deg, #ec4899, #f43f5e) !important;
  box-shadow: 0 8px 30px rgba(219,39,119,.3);
}
.couple-submit:hover { background: linear-gradient(135deg, #db2777, #e11d48) !important; }
.couple-flow .fortune-input {
  padding: 16px 20px;
  font-size: var(--fs-17);
  font-weight: 700;
  background: var(--canvas);
  border: 2px solid var(--line);
}
.couple-flow .fortune-input:focus { border-color: #ec4899; }
.couple-calc-panel {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-2xl); box-shadow: var(--shadow);
  padding: var(--sp-6);
}
.couple-calc-message { text-align: center; }
.couple-calc-message p { margin: 0 0 6px; font-weight: 800; color: #ec4899; }
.dark .couple-calc-message p { color: #f472b6; }
.couple-jamo-row { display: flex; justify-content: center; gap: 6px; margin: 6px 0; }
.couple-jamo {
  width: 32px; height: 32px; flex: 0 0 32px;
  display: flex; align-items: center; justify-content: center;
  font-size: var(--fs-sm); font-weight: 800;
  border-radius: var(--radius-md);
}
.couple-jamo-first { color: #db2777; background: #fdf2f8; border: 1px solid rgba(244,114,182,.6); }
.dark .couple-jamo-first { color: #f9a8d4; background: rgba(190,24,93,.4); border-color: rgba(190,24,93,.6); }
.couple-jamo-second { color: #e11d48; background: #fff1f2; border: 1px solid rgba(251,113,133,.6); }
.dark .couple-jamo-second { color: #fda4af; background: rgba(159,18,57,.4); border-color: rgba(159,18,57,.6); }
.couple-jamo-result { color: #db2777; background: #fce7f3; border: 1px solid rgba(244,114,182,.5); transform: scale(1.1); animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite; }
.dark .couple-jamo-result { color: #f9a8d4; background: rgba(190,24,93,.4); }
.couple-jamo-placeholder { color: var(--muted); background: var(--canvas); }
.couple-divider { height: 1px; max-width: 320px; margin: 6px auto; background: linear-gradient(to right, transparent, rgba(244,114,182,.4), transparent); }
.couple-calc-scroll { overflow-x: auto; }
.couple-calc-inner { display: flex; flex-direction: column; align-items: center; gap: 6px; min-width: max-content; margin: 0 auto; padding: 16px 8px; }

/* Couple score badge (결과 헤더) */
.couple-score-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 10px 20px;
  border: 1px solid rgba(244, 114, 182, .3);
  border-radius: var(--radius-pill);
  background: linear-gradient(135deg, #fdf2f8, #fff1f2);
  box-shadow: 0 10px 26px rgba(219, 39, 119, .14);
  overflow: hidden;
  animation: coupleScorePop .7s cubic-bezier(.16, 1, .3, 1) both;
}
.couple-score-badge::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(110deg, transparent 25%, rgba(255, 255, 255, .75) 45%, transparent 65%);
  transform: translateX(-130%);
  animation: coupleScoreShine 1.5s ease .4s 1 both;
  pointer-events: none;
}
.couple-score-heart { font-size: var(--fs-lg); animation: coupleHeartBeat 1.6s ease-in-out .6s infinite; }
.couple-score-label { font-size: var(--fs-md); font-weight: 800; color: #9d174d; letter-spacing: -.3px; }
.couple-score-value {
  min-width: 1.5em;
  font-size: var(--fs-30);
  font-weight: 900;
  line-height: 1;
  text-align: center;
  font-variant-numeric: tabular-nums;
  background: linear-gradient(135deg, #ec4899, #f43f5e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.couple-score-unit { font-size: var(--fs-md); font-weight: 800; color: #9d174d; }
.dark .couple-score-badge {
  border-color: rgba(244, 114, 182, .35);
  background: linear-gradient(135deg, rgba(190, 24, 93, .35), rgba(159, 18, 57, .3));
  box-shadow: 0 10px 26px rgba(0, 0, 0, .25);
}
.dark .couple-score-label, .dark .couple-score-unit { color: #f9a8d4; }
@keyframes coupleScorePop {
  from { opacity: 0; transform: translateY(10px) scale(.9); }
  to   { opacity: 1; transform: translateY(0)   scale(1); }
}
@keyframes coupleScoreShine { to { transform: translateX(130%); } }
@keyframes coupleHeartBeat {
  0%, 100% { transform: scale(1); }
  14% { transform: scale(1.3); }
  28% { transform: scale(1); }
  42% { transform: scale(1.18); }
  56% { transform: scale(1); }
}

/* Tarot sizing */
.tarot-deck {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: var(--radius-2xl); box-shadow: var(--shadow);
  padding: var(--sp-10);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  min-height: 450px; position: relative; overflow: hidden;
}
.tarot-deck-inner { position: relative; width: 192px; height: 128px; margin: 0 auto 24px; }
.tarot-deck-card {
  position: absolute; width: 80px; height: 128px;
  border-radius: var(--radius-md); padding: var(--sp-1); overflow: hidden;
}
.tarot-deck-card svg { width: 100%; height: 100%; opacity: .45; }
.tarot-deck-left { left: 24px; transform: rotate(-15deg); }
.tarot-deck-middle { left: 56px; z-index: 10; }
.tarot-deck-right { right: 24px; transform: rotate(15deg); }
.tarot-shuffle-title { margin: 0 0 4px; font-size: var(--fs-20); font-weight: 700; color: var(--ink); }
.tarot-shuffle-desc { margin: 0 0 20px; color: var(--muted); font-size: var(--fs-base); }
.tarot-shuffle-btn { width: 100%; }
.tarot-select-title { text-align: center; font-size: var(--fs-17); font-weight: 700; color: var(--action-primary); }
.dark .tarot-select-title { color: var(--gold); }
.tarot-card-grid { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 12px; padding: 24px 0; max-width: 896px; margin: 0 auto; }
.tarot-card {
  width: 80px; height: 128px;
  border-radius: var(--radius-xl);
  position: relative; display: flex; align-items: center; justify-content: center;
  cursor: pointer; overflow: hidden;
  transition: transform .2s, box-shadow .2s;
}
.tarot-card:hover { transform: translateY(-10px); box-shadow: var(--shadow-2xl); }
@media (min-width: 880px) { .tarot-card { width: 96px; height: 160px; } }
.tarot-card-inner { position: absolute; inset: 6px; border: 1px solid rgba(255,255,255,.1); border-radius: var(--radius-md); display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tarot-card svg { width: 100%; height: 100%; padding: var(--sp-2); opacity: .35; color: rgba(255,255,255,.4); }
.dark .tarot-card svg { color: rgba(252,211,77,.4); }
.tarot-card:hover svg { opacity: .85; color: rgba(255,255,255,.8); }
.dark .tarot-card:hover svg { color: rgba(252,211,77,.8); }
.form-panel input,
.form-panel select,
.form-field {
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--line) !important;
  border-radius: 12px !important;
  background: var(--canvas) !important;
  /* 템플릿이 같은 요소에 `text-*` 유틸리티를 함께 붙이므로 !important 가 필요하다.
     제거하면 다크에서 색이 덮인다(스냅샷으로 확인). */
  color: var(--ink) !important;
  box-shadow: none !important;
}
.form-panel input:focus,
.form-panel select:focus,
.form-field:focus {
  border-color: var(--lavender) !important;
  box-shadow: 0 0 0 3px rgb(var(--brand-rgb) / .12) !important;
}
.today-saju-flow [x-show="step === 'landing'"] > div,
.couple-flow [data-fortune-input-panel] {
  padding: clamp(24px, 4vw, 38px) !important;
  border: 1px solid var(--line) !important;
  border-radius: 20px !important;
  background: var(--paper) !important;
  box-shadow: var(--shadow);
}
.today-saju-flow label,
.couple-flow label {
  color: var(--muted);
  font-size: var(--fs-xs) !important;
  font-weight: 600 !important;
  letter-spacing: .04em;
}
.form-submit {
  min-height: 48px;
  border-radius: var(--radius-md);
  background: var(--lavender) !important;
  /* 위와 같은 이유로 !important 필수 — 제거하면 다크에서 흰 글자가 된다(2.7:1). */
  color: var(--on-brand) !important;
  box-shadow: 0 9px 18px rgb(var(--brand-rgb) / .18);
}
.form-submit:hover { background: #6049cb !important; }
/* 다크에서 --on-brand 는 어두운 글자다. 짙은 보라(#6049cb)로 호버하면 대비가 무너지므로
   브랜드색의 다크 hover(--action-primary-hover = #c4b5fd)를 쓴다. */
.dark .form-submit:hover { background: var(--action-primary-hover) !important; }
.form-toggle {
  min-height: 46px;
  border-color: var(--line);
  background: var(--canvas);
  color: var(--muted);
}
.form-toggle.on {
  border-color: var(--lavender);
  background: var(--lavender-soft);
  color: var(--lavender);
}
.choice-grid {
  gap: 12px;
}
.choice-grid > button {
  min-height: 136px;
  padding: 16px 10px;
  border: 1px solid var(--line) !important;
  border-radius: 16px !important;
  background: var(--paper) !important;
  color: var(--ink);
  box-shadow: 0 4px 14px rgba(40, 32, 77, .04);
  transition: transform .18s, border-color .18s, box-shadow .18s;
}
.choice-grid > button:hover {
  transform: translateY(-3px);
  border-color: var(--lavender) !important;
  box-shadow: var(--shadow-hover) !important;
}
.choice-grid > button.sel {
  border-color: var(--lavender) !important;
  background: var(--lavender-soft) !important;
}
.zodiac-flow .fortune-choice-grid > button,
.horoscope-flow .fortune-choice-grid > button {
  border-color: transparent !important;
  box-shadow: none;
}
.zodiac-flow .fortune-choice-grid > button:hover,
.horoscope-flow .fortune-choice-grid > button:hover {
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(40, 32, 77, .08);
}
.zodiac-flow .fortune-choice-grid > button.sel,
.horoscope-flow .fortune-choice-grid > button.sel {
  /* 다크에서 `.dark .fortune-choice-grid > button { background: var(--paper) !important }` 가
     이 규칙을 이겨 **선택 하이라이트가 사라진다**(74개 스냅샷으로 확인). !important 필수. */
  border-color: transparent !important;
  background: var(--lavender-soft) !important;
}
.fortune-choice-stage {
  padding: 18px 0 6px;
}
.couple-flow [data-fortune-input-panel] > div:first-child {
  gap: 18px;
}
.couple-flow [data-fortune-input-panel] input {
  padding: 12px 16px !important;
}
.dark .form-panel input,
.dark .form-panel select,
.dark .form-field { background: rgba(255,255,255,.05) !important; }
.dark .today-saju-flow [x-show="step === 'landing'"] > div,
.dark .couple-flow [data-fortune-input-panel],
.dark .fortune-choice-grid > button { background: var(--paper) !important; }
@media (max-width: 640px) {
  .today-saju-flow [x-show="step === 'landing'"] > div,
  .couple-flow [data-fortune-input-panel] { padding: 20px !important; }
  .choice-grid > button { min-height: 112px; }
}

/* ─── Authentication ─────────────────────────── */
.auth-page {
  display: grid;
  place-items: center;
  min-height: min(680px, calc(100vh - 210px));
  padding: 28px 0 48px;
}
.auth-shell { width: min(100%, var(--auth-max)); }
.auth-heading { margin: 0 0 22px; text-align: center; }
.auth-heading h1 { margin: 0; font-size: var(--fs-30); letter-spacing: -1.4px; }
.auth-heading p { margin: 9px 0 0; color: var(--muted); font-size: var(--fs-base); line-height: 1.6; }
.auth-card.form-panel { display: grid; gap: 16px; padding: 26px; border-radius: 18px; }
.auth-card .form-field,
.auth-card .form-submit { width: 100%; box-sizing: border-box; }
.auth-card input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--lavender); }
.auth-fields { display: grid; gap: 11px; }
.auth-fields .form-field,
.auth-fields .form-submit { width: 100%; box-sizing: border-box; }
.auth-code-field { text-align: center; font-size: var(--fs-20); letter-spacing: .28em; }
.auth-reset-button {
  border: 0; background: none; padding: var(--sp-1); color: var(--muted);
  font: inherit; font-size: var(--fs-sm); cursor: pointer;
}
.auth-reset-button:hover { color: var(--lavender); }
.auth-message { margin: 14px 0 0; text-align: center; font-size: var(--fs-sm); }
.auth-message.is-error { color: #dc2626; }
.auth-message.is-success { color: #15803d; }
.auth-switch { margin: 16px 0 0; color: var(--muted); text-align: center; font-size: var(--fs-sm); }
.auth-switch a, .auth-signup-prompt a { color: var(--lavender); font-weight: 600; text-decoration: none; }
.auth-switch a:hover, .auth-signup-prompt a:hover { text-decoration: underline; }
.auth-signup-prompt {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 11px 12px; border-radius: 10px; background: var(--lavender-soft);
  color: var(--muted); font-size: var(--fs-sm);
}
.consent-intro {
  padding: 14px; border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--canvas); color: var(--muted); font-size: var(--fs-sm); line-height: 1.55;
}
.consent-intro p { margin: 0 0 10px; }
.consent-policy-links { display: grid; gap: 7px; }
.consent-policy-links a {
  display: flex; align-items: center; justify-content: space-between;
  color: var(--ink); text-decoration: none; font-size: var(--fs-sm); font-weight: 600;
}
.consent-policy-links a:hover { color: var(--lavender); }
.consent-required-list { display: grid; gap: 10px; }
.consent-document-item { display: flex; align-items: flex-start; gap: 10px; }
.consent-document-item input { flex: 0 0 auto; margin-top: 2px; }
.consent-document-label { color: var(--ink); font-size: var(--fs-base); line-height: 1.5; }
.consent-document-label a { color: var(--lavender); font-weight: 600; }
.dark .consent-intro { background: rgba(255,255,255,.04); }
.dark .consent-document-label { color: var(--ink); }
.social-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 12px; color: var(--muted); font-size: var(--fs-xs); font-weight: 600; }
.social-divider::before, .social-divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.social-help { margin: 0 0 15px; color: var(--muted); text-align: center; font-size: var(--fs-xs); line-height: 1.65; }
.social-login-list { display: grid; gap: 9px; }
.social-login {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 48px; box-sizing: border-box; border-radius: var(--radius-md);
  font-size: var(--fs-md); font-weight: 600; text-decoration: none;
  transition: transform .16s, box-shadow .16s, background .16s;
}
.social-login:hover { transform: translateY(-1px); box-shadow: 0 7px 15px rgba(40,32,77,.12); }
.social-login.kakao { background: #fee500; color: #191919; }
.social-login.kakao:hover { background: #f6dc00; }
.social-login.naver { background: #03c75a; color: #fff; }
.social-login.naver:hover { background: #02b351; }
.social-login.google { border: 1px solid var(--line); background: var(--paper); color: var(--ink); }
.social-login.google:hover { background: var(--canvas); }
.dark .social-login.google { background: rgba(255,255,255,.05); }
@media (max-width: 640px) {
  .auth-page { min-height: auto; padding: 12px 0 24px; }
  .auth-shell { width: 100%; }
  .auth-card.form-panel { padding: var(--sp-5); }
}

/* ─── Welcome ─────────────────────────────────── */
.welcome-page {
  display: grid;
  place-items: center;
  min-height: min(680px, calc(100vh - 210px));
  padding: 32px 16px 56px;
}
.welcome-shell { width: min(100%, 460px); }
.welcome-card {
  position: relative;
  overflow: hidden;
  padding: 40px 32px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-2xl);
  background: var(--paper);
  box-shadow: var(--shadow);
  text-align: center;
}
.welcome-card::before {
  content: '';
  position: absolute;
  top: -140px; left: 50%;
  width: 340px; height: 340px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--lavender-soft) 0%, transparent 70%);
  pointer-events: none;
}
.welcome-emblem {
  position: relative;
  display: grid; place-items: center;
  width: 72px; height: 72px; margin: 0 auto 22px;
  border-radius: 50%;
  font-size: var(--fs-30); color: var(--on-brand);
  background: linear-gradient(135deg, var(--brand-primary), #a78bfa);
  box-shadow: 0 12px 26px rgb(var(--brand-rgb) / .35);
  animation: float 3.2s ease-in-out infinite;
}
.welcome-heading { position: relative; }
.welcome-eyebrow {
  margin: 0 0 10px;
  font-size: var(--fs-xs); font-weight: 700; letter-spacing: .18em;
  text-transform: uppercase; color: var(--lavender);
}
.welcome-heading h1 {
  margin: 0;
  font-size: var(--fs-26); line-height: 1.3; letter-spacing: -1px;
  color: var(--ink);
}
.welcome-name { color: var(--lavender); }
.welcome-sub {
  margin: 10px 0 0;
  color: var(--muted); font-size: var(--fs-base); line-height: 1.6;
}
.welcome-meta {
  position: relative;
  display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
  margin-top: var(--sp-5);
}
.welcome-meta-item {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  background: var(--canvas);
  color: var(--muted); font-size: var(--fs-xs);
}
.welcome-meta-item b { color: var(--ink); font-weight: 600; }
.dark .welcome-meta-item { background: rgba(255,255,255,.05); }
.welcome-notices {
  position: relative;
  margin-top: var(--sp-6); padding: var(--sp-4);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--canvas); text-align: left;
}
.dark .welcome-notices { background: rgba(255,255,255,.03); }
.welcome-notices-title {
  margin: 0 0 10px;
  font-size: var(--fs-sm); font-weight: 700; color: var(--ink);
}
.welcome-notices-title span { color: var(--coral); }
.welcome-notice-list { display: grid; gap: 8px; }
.welcome-notice {
  display: flex; align-items: center; gap: 9px;
  padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--paper);
  font-size: var(--fs-sm); color: var(--ink);
}
.welcome-notice.is-high {
  border-color: rgba(241, 120, 107, .4);
  background: rgba(241, 120, 107, .08);
}
.welcome-notice-dot {
  flex: 0 0 auto;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--lavender);
}
.welcome-notice.is-high .welcome-notice-dot { background: var(--coral); }
.welcome-notice-title {
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600;
}
.welcome-actions { position: relative; margin-top: 28px; }
.welcome-btn-primary {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 52px;
  border: 0; border-radius: var(--radius-lg);
  background: var(--action-primary); color: var(--on-brand);
  font: inherit; font-size: var(--fs-15); font-weight: 700;
  cursor: pointer;
  box-shadow: 0 10px 22px rgba(124, 58, 237, .3);
  transition: transform .18s, box-shadow .18s, background .18s;
}
.welcome-btn-primary:hover {
  background: var(--action-primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(124, 58, 237, .36);
}
.welcome-btn-primary:active { transform: translateY(0); }
.welcome-btn-arrow { transition: transform .18s; }
.welcome-btn-primary:hover .welcome-btn-arrow { transform: translateX(3px); }
.welcome-countdown { position: relative; margin-top: 22px; }
.welcome-countdown-track {
  height: 4px; border-radius: var(--radius-pill);
  background: var(--line); overflow: hidden;
}
.welcome-countdown-fill {
  height: 100%; border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--brand-primary), #a78bfa);
  transition: width 1s linear;
}
.welcome-countdown-text {
  margin: 10px 0 0;
  color: var(--muted); font-size: var(--fs-xs);
}
.welcome-countdown-text span { color: var(--lavender); font-weight: 700; }
@media (max-width: 640px) {
  .welcome-page { min-height: auto; padding: 20px 0 32px; }
  .welcome-card { padding: 32px 22px 26px; border-radius: var(--radius-xl); }
  .welcome-emblem { width: 64px; height: 64px; font-size: var(--fs-26); }
  .welcome-heading h1 { font-size: var(--fs-2xl); }
}

/* ─── Grid ─────────────────────────────────────── */
.grid { display: grid; gap: 15px; }
.grid.three { grid-template-columns: repeat(3, 1fr); }
.grid.two { grid-template-columns: repeat(2, 1fr); }
@media (max-width: 880px) {
  .grid.three, .grid.two { grid-template-columns: 1fr; }
}

/* ─── Button ───────────────────────────────────── */
.button, .ghost {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 14px; border-radius: 10px;
  font-size: var(--fs-base); font-weight: 500; text-decoration: none;
  border: 1px solid var(--line); background: var(--paper);
  color: #6b6877; cursor: pointer;
  transition: .18s;
}
.dark .button, .dark .ghost { color: #94a3b8; background: rgba(255,255,255,0.05); }
.button { border: 0; background: var(--lavender); color: var(--on-brand); }
.dark .button { background: var(--lavender); color: var(--on-brand); }
.button:hover { opacity: .9; transform: translateY(-1px); }
.ghost:hover { border-color: var(--lavender); color: var(--lavender); }

/* ─── Round Icon Button ───────────────────────── */
.round {
  width: 36px; height: 36px; border-radius: 50%;
  display: grid; place-items: center;
  border: 1px solid var(--line); background: var(--paper);
  color: #6b6877; cursor: pointer; transition: .18s;
}
.round:hover { border-color: var(--lavender); color: var(--lavender); }

/* ─── Tag ──────────────────────────────────────── */
.tag {
  display: inline-block;
  padding: 3px 9px; border-radius: var(--radius-pill);
  background: var(--lavender-soft); color: var(--lavender);
  font-size: var(--fs-xs); font-weight: 500; margin-bottom: var(--sp-2);
}

/* ─── Big Emoji ───────────────────────────────── */
.big-emoji { font-size: 2.3125rem; line-height: 1.1; }

/* ─── Score / Actions Row ─────────────────────── */
.score {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-top: 14px; flex-wrap: wrap;
}
.score span { color: var(--muted); font-size: var(--fs-sm); }

/* ─── List / Item ─────────────────────────────── */
.list { display: grid; gap: 1px; }
.list .item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 0; gap: 12px;
}
.list .item + .item { border-top: 1px solid var(--line); }
.list .item b { display: block; font-size: var(--fs-md); font-weight: 400; }
.list .item span { color: var(--muted); font-size: var(--fs-sm); }

/* ─── Feed ─────────────────────────────────────── */
.feed { padding: 8px 22px; }
.feed-item {
  display: grid; grid-template-columns: 34px 1fr auto; gap: 12px;
  align-items: start; padding: 18px 0;
  border-bottom: 1px solid #f0eff4;
}
.dark .feed-item { border-color: rgba(255,255,255,0.05); }
.feed-item:last-child { border-bottom: 0; }
.feed-icon {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 10px; font-size: var(--fs-17);
}
.feed-icon.purple { background: #f0edff; }
.dark .feed-icon.purple { background: rgb(var(--brand-rgb) / 0.15); }
.feed-icon.yellow { background: #fff4dc; }
.dark .feed-icon.yellow { background: rgba(252,211,77,0.15); }
.feed-icon.green { background: #e9f8f2; }
.dark .feed-icon.green { background: rgba(94,234,212,0.15); }
.feed-item b { display: block; margin-bottom: 3px; font-size: var(--fs-md); font-weight: 400; }
.dark .feed-item b { color: var(--ink); }
.feed-item p { margin: 0; color: var(--muted); font-size: var(--fs-base); }
.feed-time { color: #b2afbb; font-size: var(--fs-xs); white-space: nowrap; }

/* ─── Quick Card ──────────────────────────────── */
.quick {
  position: relative; overflow: hidden;
  min-height: 154px; padding: 22px;
  border: 1px solid var(--line); border-radius: 17px;
  background: var(--paper); box-shadow: var(--shadow);
  text-decoration: none; color: var(--ink); display: block;
  transition: .2s;
}
.quick:hover { transform: translateY(-2px); box-shadow: var(--shadow-hover); }
.quick .eyebrow { color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.quick h2 { margin: 7px 0 5px; font-size: var(--fs-20); letter-spacing: -.8px; }
.quick p { max-width: 210px; margin: 0; color: var(--muted); font-size: var(--fs-base); }
.quick .bubble {
  position: absolute; right: -14px; bottom: -26px;
  width: 118px; height: 118px; border-radius: 50%; opacity: .95;
}
.quick .emoji { position: absolute; right: 23px; bottom: 14px; font-size: 2.3125rem; transform: rotate(-8deg); }
.quick.fortune { background: linear-gradient(135deg, #f3f0ff, #fff 67%); border-color: #e4ddff; }
.quick.fortune .bubble { background: #d6ccff; } .quick.fortune .emoji { color: var(--lavender); }
.quick.test { background: linear-gradient(135deg, #eefaf7, #fff 67%); border-color: #d9f0e8; }
.quick.test .bubble { background: #c8ecdf; } .quick.test .emoji { color: var(--mint); }
.quick.game { background: linear-gradient(135deg, #fff6e9, #fff 67%); border-color: #f9e8ca; }
.quick.game .bubble { background: #ffe0aa; } .quick.game .emoji { color: var(--gold); }
.dark .quick.fortune { background: linear-gradient(135deg, rgb(var(--brand-rgb) / 0.08), var(--paper) 67%); border-color: rgb(var(--brand-rgb) / 0.2); }
.dark .quick.fortune .bubble { background: rgb(var(--brand-rgb) / 0.2); }
.dark .quick.test { background: linear-gradient(135deg, rgba(94,234,212,0.08), var(--paper) 67%); border-color: rgba(94,234,212,0.2); }
.dark .quick.test .bubble { background: rgba(94,234,212,0.2); }
.dark .quick.game { background: linear-gradient(135deg, rgba(252,211,77,0.08), var(--paper) 67%); border-color: rgba(252,211,77,0.2); }
.dark .quick.game .bubble { background: rgba(252,211,77,0.2); }

/* ─── Side Stack ──────────────────────────────── */
.side-stack { display: grid; gap: 16px; }
.continue { padding: 19px; }
.continue-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 17px; }
.continue-top b { font-size: var(--fs-15); font-weight: 400; }
.continue-top span { color: var(--muted); font-size: var(--fs-sm); }
.result-row { display: flex; gap: 11px; align-items: center; padding: 11px; border-radius: var(--radius-md); background: #faf9fc; }
.dark .result-row { background: rgba(255,255,255,0.03); }
.result-row + .result-row { margin-top: var(--sp-2); }
.mini { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 10px; background: white; font-size: var(--fs-xl); }
.dark .mini { background: rgba(255,255,255,0.05); }
.result-row b { display: block; font-size: var(--fs-sm); font-weight: 400; }
.result-row span { color: var(--muted); font-size: var(--fs-xs); }

/* ─── Notice ──────────────────────────────────── */
.notice { padding: 19px; }
.notice .notice-title { display: flex; align-items: center; gap: 8px; margin-bottom: 11px; font-size: var(--fs-md); font-weight: 500; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--coral); display: inline-block; }
.notice p { margin: 0; color: var(--muted); font-size: var(--fs-sm); line-height: 1.75; }
.notice a { display: inline-block; margin-top: 10px; color: var(--lavender); font-size: var(--fs-sm); font-weight: 500; text-decoration: none; }

/* ─── Section Head ────────────────────────────── */
.section-head { display: flex; justify-content: space-between; align-items: center; margin: 0 0 16px; }
.section-head h2 { margin: 0; font-size: var(--fs-xl); letter-spacing: -.6px; }
.section-head a { color: var(--lavender); font-size: var(--fs-base); font-weight: 500; text-decoration: none; }

/* ─── Home (풀스크인) ─────────────────────────── */
.home-hero { text-align: center; padding: 0 0 28px; }
.home-hero h1 { font-size: var(--fs-30); letter-spacing: -1px; margin: 0 0 10px; }
.home-hero .lead { color: var(--muted); font-size: var(--fs-15); margin: 0; line-height: 1.6; }

@media (max-width: 880px) {
  .home-hero { padding: 0 0 20px; }
  .home-hero h1 { font-size: var(--fs-24); }
  .home-hero .lead { font-size: var(--fs-md); }
}

/* ─── Home Split (7:3) ────────────────────────── */
.home-split {
  display: grid; grid-template-columns: 7fr 3fr; gap: 20px; align-items: start;
}
.home-main-col { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 880px) {
  .home-split { grid-template-columns: 1fr; }
}

/* ─── Tour Detail Split ────────────────────────── */
.tour-split {
  display: grid; grid-template-columns: 7fr 3fr; gap: 20px; align-items: start;
}
.tour-main-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
.tour-side-col { display: flex; flex-direction: column; gap: 16px; min-width: 0; }
@media (max-width: 880px) {
  /* minmax(0,1fr) — 1fr 의 자동 최소 크기가 자식의 min-content 만큼 커져 모바일 가로 오버플로가 났다 */
  .tour-split { grid-template-columns: minmax(0, 1fr); }
}

/* ─── Board Page Split (7:3 like home) ──────── */
.board-split {
  display: grid; grid-template-columns: 7fr 3fr; gap: 20px; align-items: start;
}
.board-side-col { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 880px) {
  .board-split { grid-template-columns: 1fr; }
}

/* ─── My Page Split (7:3 like home) ───────────── */
.my-split {
  display: grid; grid-template-columns: 7fr 3fr; gap: 20px; align-items: start;
}
.my-main-col { display: flex; flex-direction: column; gap: 16px; }
.my-side-col { display: flex; flex-direction: column; gap: 16px; }
@media (max-width: 880px) {
  .my-split { grid-template-columns: 1fr; }
}
.my-card[id] { scroll-margin-top: 90px; }
.my-state {
  padding: 40px 24px; text-align: center;
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--paper); box-shadow: var(--shadow);
}
.my-state h2 { margin: 0; font-size: var(--fs-17); }
.my-state p { margin: 8px 0 0; color: var(--muted); font-size: var(--fs-base); }
.my-head-actions { display: flex; align-items: center; gap: 8px; }
.my-btn-ghost, .my-btn-primary {
  padding: 7px 14px; border-radius: var(--radius-sm);
  font: inherit; font-size: var(--fs-base); font-weight: 600;
  cursor: pointer; transition: background .15s, border-color .15s, color .15s;
}
.my-btn-ghost { border: 1px solid var(--line); background: var(--paper); color: var(--muted); }
.my-btn-ghost:hover { border-color: var(--lavender); color: var(--lavender); }
.my-btn-primary { border: 0; background: var(--action-primary); color: var(--on-brand); }
.my-btn-primary:hover { background: var(--action-primary-hover); }
.my-profile-body { padding: var(--sp-5); }
.my-profile-value { margin: 8px 0 0; font-size: var(--fs-15); font-weight: 600; color: var(--ink); }
.my-form { display: grid; gap: 10px; }
.my-form label { font-size: var(--fs-base); font-weight: 700; color: var(--ink); }
.my-form input {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px;
  border: 1px solid var(--line); border-radius: var(--radius-md);
  background: var(--canvas); color: var(--ink);
  font: inherit; font-size: var(--fs-md);
}
.dark .my-form input { background: rgba(255,255,255,.05); }
.my-form input:focus { border-color: var(--lavender); box-shadow: 0 0 0 3px var(--lavender-soft); }
.my-hint { margin: 0; color: var(--muted); font-size: var(--fs-sm); }
.my-cta {
  justify-self: start;
  display: inline-flex; align-items: center; gap: 6px;
  margin-top: var(--sp-2); padding: 11px 22px;
  border: 0; border-radius: var(--radius-md);
  background: var(--action-primary); color: var(--on-brand);
  font: inherit; font-size: var(--fs-md); font-weight: 700;
  text-decoration: none; cursor: pointer;
  transition: background .18s, transform .18s;
}
.my-cta:hover { background: var(--action-primary-hover); transform: translateY(-1px); }
.my-message { margin: 2px 0 0; font-size: var(--fs-base); font-weight: 600; }
.my-message.is-success { color: var(--lavender); }
.my-message.is-error { color: #dc2626; }
.my-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; padding: var(--sp-5); }
@media (max-width: 640px) { .my-info-grid { grid-template-columns: 1fr; } }
.my-info { padding: var(--sp-4); border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--canvas); }
.dark .my-info { background: rgba(255,255,255,.04); }
.my-info-label { margin: 0; color: var(--muted); font-size: var(--fs-sm); font-weight: 700; }
.my-info-value { margin: 8px 0 0; font-size: var(--fs-md); font-weight: 600; color: var(--ink); word-break: break-all; }
.my-info-value.is-coin { font-size: var(--fs-2xl); font-weight: 800; color: var(--action-primary); }
.dark .my-info-value.is-coin { color: var(--gold); }
.my-method-body { padding: var(--sp-5); display: grid; gap: 12px; }
.my-method-list { display: grid; gap: 10px; }
.my-method-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius-md); background: var(--canvas);
}
.dark .my-method-row { background: rgba(255,255,255,.04); }
.my-method-info { min-width: 0; }
.my-method-info .my-info-value { margin: 0; }
.my-method-info .my-info-label { margin-top: var(--sp-1); word-break: break-all; }
.my-btn-ghost:disabled { opacity: .45; cursor: not-allowed; }
.my-nav-list { display: flex; flex-direction: column; gap: 2px; padding: var(--sp-2); }
.my-nav-link {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 10px; box-sizing: border-box;
  border: 0; border-radius: var(--radius-sm); background: none;
  color: var(--ink); font: inherit; font-size: var(--fs-base); font-weight: 500;
  text-decoration: none; text-align: left; cursor: pointer;
  transition: background .15s, color .15s;
}
.my-nav-link::after { content: '›'; color: var(--muted); font-size: var(--fs-15); }
.my-nav-link:hover { background: var(--lavender-soft); color: var(--lavender); }
.my-nav-link:hover::after { color: var(--lavender); }
.my-nav-link.is-active { background: var(--lavender-soft); color: var(--lavender); font-weight: 700; }
.my-page-head {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin-bottom: var(--sp-4);
}
.my-page-head h1 { margin: 0; font-size: var(--fs-20); font-weight: 800; color: var(--ink); }
.my-history-body { padding: var(--sp-5); display: grid; gap: 14px; }
.my-history-table-wrap { overflow-x: auto; }
.my-history-table { width: 100%; border-collapse: collapse; font-size: var(--fs-base); }
.my-history-table th {
  padding: 10px 8px; border-bottom: 1px solid var(--line);
  color: var(--muted); font-size: var(--fs-sm); font-weight: 700; text-align: left; white-space: nowrap;
}
.my-history-table td {
  padding: 12px 8px; border-bottom: 1px solid var(--line);
  color: var(--ink); white-space: nowrap;
}
.my-history-table tr:last-child td { border-bottom: 0; }
.my-history-current {
  margin-left: 6px; padding: 2px 8px; border-radius: var(--radius-pill);
  background: var(--lavender-soft); color: var(--lavender); font-size: var(--fs-xs); font-weight: 700;
}
.my-history-badge {
  display: inline-block; padding: 3px 9px; border-radius: var(--radius-pill);
  border: 1px solid var(--line); background: var(--canvas); color: var(--muted);
  font-size: var(--fs-xs); font-weight: 700;
}
.my-history-badge.is-active { border-color: transparent; background: var(--lavender-soft); color: var(--lavender); }
.my-history-badge.is-logged_out { color: var(--ink); }
.my-history-badge.is-idle_timeout,
.my-history-badge.is-expired,
.my-history-badge.is-revoked { color: var(--muted); }
.my-history-empty { padding: 28px 12px; text-align: center; color: var(--muted); }
.my-history-pager { display: flex; align-items: center; justify-content: center; gap: 12px; }
.my-history-page { color: var(--muted); font-size: var(--fs-base); font-weight: 600; }
.my-withdraw-body { padding: var(--sp-5); display: grid; gap: 16px; }
.my-withdraw-list { margin: 0; padding-left: 18px; color: var(--muted); font-size: var(--fs-base); line-height: 1.8; }
.my-radio { display: flex; align-items: flex-start; gap: 8px; font-size: var(--fs-base); color: var(--ink); cursor: pointer; }
.my-radio input { width: auto; padding: 0; margin: 2px 0 0; flex: 0 0 auto; }
.my-code-row { display: flex; gap: 8px; }
.my-code-row input { flex: 1; min-width: 0; }
.my-danger {
  padding: 12px 18px; border: 0; border-radius: var(--radius-md);
  background: #dc2626; color: #fff; font: inherit; font-size: var(--fs-md); font-weight: 700; cursor: pointer;
  transition: background .15s;
}
.my-danger:hover { background: #b91c1c; }
.my-danger:disabled { opacity: .5; cursor: not-allowed; }
@media (max-width: 640px) {
  .my-history-table th:nth-child(3), .my-history-table td:nth-child(3) { display: none; }
}

.tour-detail-card { padding: var(--sp-6); position: relative; }
.list-btn {
  position: absolute; top: 16px; right: 16px;
  padding: 6px 14px; font-size: var(--fs-sm); font-weight: 500;
  color: var(--muted); text-decoration: none;
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: var(--paper); transition: .15s;
}
.list-btn:hover { color: var(--lavender); border-color: var(--lavender); }
.tour-detail-image { border-radius: var(--radius-md); overflow: hidden; margin-bottom: var(--sp-5); }
.tour-detail-image img { width: 100%; max-height: 400px; object-fit: contain; }
.tour-detail-image.empty {
  height: 200px; background: #e2e8f0;
  display: grid; place-items: center;
}
.tour-detail-image.empty span { font-size: 3.75rem; }
.tour-detail-info h1 { margin: 8px 0 12px; font-size: var(--fs-24); }
.tour-addr { color: var(--muted); font-size: var(--fs-md); margin: 0 0 16px; }
.tour-overview { font-size: var(--fs-md); line-height: 1.7; color: var(--ink); margin: 0 0 16px; }
.tour-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.tour-meta span {
  padding: 4px 12px; font-size: var(--fs-sm); font-weight: 500;
  color: var(--lavender); background: rgb(var(--brand-rgb) / .1); border-radius: var(--radius-sm);
}
.tour-search-form { display: flex; gap: 8px; padding: var(--sp-4); }
.tour-search-form input {
  flex: 1; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: var(--fs-md); background: var(--paper); color: var(--ink);
}
.tour-search-form input:focus { border-color: var(--lavender); }
.tour-search-form button {
  padding: 10px 18px; border: none; border-radius: 10px;
  background: var(--lavender); color: var(--on-brand); font-size: var(--fs-md); font-weight: 500;
  cursor: pointer; white-space: nowrap;
}
.tour-recommend-list { padding: var(--sp-2); }
.tour-recommend-item {
  display: flex; gap: 12px; align-items: center;
  padding: var(--sp-2); border-radius: 10px; text-decoration: none;
  transition: background .15s;
}
.tour-recommend-item:hover { background: rgba(0,0,0,.02); }
.dark .tour-recommend-item:hover { background: rgba(255,255,255,.03); }
.tour-recommend-img {
  width: 64px; height: 64px; border-radius: var(--radius-sm); overflow: hidden; flex-shrink: 0;
}
.tour-recommend-img img { width: 100%; height: 100%; object-fit: cover; }
.tour-recommend-img.empty {
  background: #e2e8f0; display: grid; place-items: center;
}
.tour-recommend-img.empty span { font-size: var(--fs-24); }
.tour-recommend-info { min-width: 0; flex: 1; }
.tour-recommend-info b {
  display: block; font-size: var(--fs-base); font-weight: 600;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dark .tour-recommend-info b { color: var(--ink); }
.tour-recommend-info span {
  display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: 2px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tour-empty {
  text-align: center; padding: 40px 20px;
}
.tour-empty span { font-size: 2.25rem; display: block; margin-bottom: var(--sp-3); }
.tour-empty p { font-size: var(--fs-md); color: var(--muted); margin: 0; }
.tour-filter-card { padding: var(--sp-4); }
.tour-filter-form { display: flex; gap: 8px; }
.tour-filter-form select {
  padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: var(--fs-md); background: var(--paper); color: var(--ink);
  min-width: 120px;
}
.tour-filter-form input {
  flex: 1; min-width: 0; padding: 10px 14px; border: 1px solid var(--line);
  border-radius: 10px; font-size: var(--fs-md); background: var(--paper); color: var(--ink);
}
.tour-filter-form input:focus, .tour-filter-form select:focus {
  border-color: var(--lavender);
}
.tour-filter-form button {
  padding: 10px 18px; border: none; border-radius: 10px;
  background: var(--lavender); color: var(--on-brand); font-size: var(--fs-md); font-weight: 500;
  cursor: pointer; white-space: nowrap;
}
.tour-grid-card { padding: var(--sp-4); }
.tour-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
}
@media (max-width: 880px) {
  .tour-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .tour-grid { grid-template-columns: 1fr; }
}
.tour-grid-item {
  display: block; text-decoration: none;
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .15s, box-shadow .15s;
}
.tour-grid-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.tour-grid-img {
  height: 140px; background-size: cover; background-position: center;
  background-color: var(--line);
}
.tour-grid-img img { width: 100%; height: 100%; object-fit: cover; }
.tour-grid-img.empty {
  display: grid; place-items: center;
}
.tour-grid-img.empty span { font-size: 2.5rem; color: var(--muted); }
.tour-grid-info { padding: var(--sp-3); }
.tour-grid-info b {
  display: block; font-size: var(--fs-md); font-weight: 600;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dark .tour-grid-info b { color: var(--ink); }
.tour-grid-info span {
  display: block; font-size: var(--fs-xs); color: var(--muted); margin-top: var(--sp-1);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tour-pagination {
  display: flex; justify-content: center; align-items: center; gap: 4px;
  padding: var(--sp-4);
}
.page-btn {
  min-width: 36px; height: 36px; display: grid; place-items: center;
  font-size: var(--fs-base); font-weight: 500; color: var(--ink);
  text-decoration: none; border: 1px solid var(--line);
  border-radius: var(--radius-sm); transition: .15s;
}
.page-btn:hover { color: var(--lavender); border-color: var(--lavender); }
.page-btn.active { background: var(--lavender); color: var(--on-brand); border-color: var(--lavender); }
.tour-gallery-card { padding: 0; }
.tour-gallery {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: var(--sp-4);
}
@media (max-width: 640px) {
  .tour-gallery { grid-template-columns: repeat(2, 1fr); }
}
.tour-gallery-item {
  aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--line); cursor: pointer;
}
.tour-gallery-item img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .2s;
}
.tour-gallery-item:hover img { transform: scale(1.05); }
.tour-gallery-hint { font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.lightbox { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.lightbox-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.88); }
.lightbox-stage { position: relative; z-index: 1; display: flex; align-items: center; gap: 8px; max-width: 100vw; max-height: 100vh; padding: var(--sp-4); }
.lightbox-close {
  position: absolute; top: 16px; right: 16px; z-index: 2;
  width: 40px; height: 40px; border-radius: 50%; border: none;
  background: rgba(255,255,255,.15); color: #fff; font-size: var(--fs-xl); cursor: pointer;
}
.lightbox-close:hover { background: rgba(255,255,255,.3); }
.lightbox-nav {
  width: 44px; height: 44px; border-radius: 50%; border: none; flex-shrink: 0;
  background: rgba(255,255,255,.15); color: #fff; font-size: var(--fs-26); line-height: 1; cursor: pointer;
}
.lightbox-nav:hover:not(:disabled) { background: rgba(255,255,255,.3); }
.lightbox-nav:disabled { opacity: .3; cursor: default; }
.lightbox-figure { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lightbox-figure img {
  max-width: min(88vw, 1000px); max-height: 78vh; object-fit: contain;
  border-radius: var(--radius-sm); cursor: zoom-out;
}
.lightbox-figure figcaption { color: #fff; font-size: var(--fs-base); }
.tour-extra-card { padding: 0; }
.tour-extra-info { padding: 4px 0; }
.tour-extra-row {
  display: flex; align-items: center; gap: 16px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
}
.tour-extra-row:last-child { border-bottom: none; }
.tour-extra-label {
  width: 80px; flex-shrink: 0;
  font-size: var(--fs-base); font-weight: 500; color: var(--muted);
}
.tour-extra-value {
  font-size: var(--fs-base); color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dark .tour-extra-value { color: var(--ink); }
.tour-extra-value.link { color: var(--lavender); text-decoration: none; }
.tour-extra-value.link:hover { text-decoration: underline; }
.tour-visit-card { padding: 0; }
.tour-visit-info { padding: 4px 0; }
.tour-visit-row {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 12px 20px; border-bottom: 1px solid var(--line);
}
.tour-visit-row:last-child { border-bottom: none; }
.tour-visit-label {
  width: 110px; flex-shrink: 0;
  font-size: var(--fs-base); font-weight: 500; color: var(--muted);
}
.tour-visit-value {
  font-size: var(--fs-base); color: var(--ink);
  word-break: break-word; white-space: pre-wrap;
}
.dark .tour-visit-value { color: var(--ink); }
.tour-ref-card { padding: 0 0 8px; }
.tour-ref-hint { font-size: var(--fs-xs); font-weight: 400; color: var(--muted); }
.tour-ref-tabs {
  display: flex; flex-wrap: wrap; gap: 6px;
  padding: 0 20px 12px; border-bottom: 1px solid var(--line);
}
.tour-ref-tab {
  padding: 6px 12px; border-radius: var(--radius-pill); cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; color: var(--muted);
  background: var(--canvas); border: 1px solid var(--line);
  transition: background .15s, color .15s, border-color .15s;
}
.tour-ref-tab:hover { color: var(--ink); }
.tour-ref-tab.is-active {
  color: var(--ink-invert); background: var(--brown); border-color: var(--brown);
}
.dark .tour-ref-tab.is-active { color: #1a1a1a; }
.tour-ref-body { padding: 12px 20px 4px; }
.tour-ref-query { margin: 0 0 10px; font-size: var(--fs-sm); color: var(--muted); }
.tour-ref-query b { color: var(--ink); font-weight: 600; }
.dark .tour-ref-query b { color: var(--ink); }
.tour-ref-list { list-style: none; margin: 0; padding: 0; }
.tour-ref-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.tour-ref-item:last-child { border-bottom: none; }
.tour-ref-link { min-width: 0; flex: 1; text-decoration: none; }
.tour-ref-title {
  display: block; font-size: var(--fs-base); color: var(--ink);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tour-ref-link:hover .tour-ref-title { text-decoration: underline; }
.dark .tour-ref-title { color: var(--ink); }
.tour-ref-desc {
  margin: 4px 0 0; font-size: var(--fs-sm); color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.tour-ref-meta { display: flex; gap: 8px; margin-top: var(--sp-1); font-size: var(--fs-xs); color: var(--muted); }
.tour-ref-origin {
  flex-shrink: 0; margin-top: 2px;
  font-size: var(--fs-xs); font-weight: 600; color: #7c3aed;
  text-decoration: none; white-space: nowrap;
}
.tour-ref-origin:hover { text-decoration: underline; }
.tour-ref-empty, .tour-ref-progress, .tour-ref-expired, .tour-ref-error {
  margin: 0; padding: 12px 0; font-size: var(--fs-base); color: var(--muted);
}
.tour-ref-expired { color: #b45309; }
.tour-ref-error { color: #dc2626; }
.tour-ref-retry {
  margin-left: 6px; padding: 4px 10px; border-radius: var(--radius-sm); cursor: pointer;
  font-size: var(--fs-sm); font-weight: 600; color: var(--ink-invert);
  background: var(--brown); border: none;
}
.tour-ref-note { margin: 8px 0 0; font-size: var(--fs-xs); color: var(--muted); }
.tour-map-card { padding: 0; overflow: hidden; }
.tour-coords {
  font-size: var(--fs-xs); color: var(--muted); font-weight: 400;
}
.tour-coords.empty { color: #f59e0b; }
.tour-map { width: 100%; height: 500px; }
.tour-map-links {
  display: flex; gap: 8px; padding: 0 16px 16px;
}
.tour-map-btn {
  flex: 1; text-align: center;
  padding: 10px 16px; font-size: var(--fs-base); font-weight: 500;
  color: var(--ink); text-decoration: none;
  border: 1px solid var(--line); border-radius: 10px;
  transition: .15s;
}
.tour-map-btn:hover {
  color: var(--lavender); border-color: var(--lavender);
}
.tour-map-empty {
  text-align: center; padding: 40px 20px;
  background: #f8fafc;
}
.tour-map-empty span { font-size: var(--fs-3xl); display: block; margin-bottom: var(--sp-2); }
.tour-map-empty p { font-size: var(--fs-base); color: var(--muted); margin: 0; }

/* ─── Card Head ────────────────────────────────── */
.card-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 16px 20px; border-bottom: 1px solid var(--line);
}
.card-head h2 { margin: 0; font-size: var(--fs-lg); font-weight: 600; }
.card-more { font-size: var(--fs-sm); color: var(--muted); text-decoration: none; }
.card-more:hover { color: var(--lavender); }
.card-tabs { display: flex; gap: 4px; }
.card-tabs button {
  padding: 4px 12px; font-size: var(--fs-base); font-weight: 500;
  color: var(--muted); background: none; border: none;
  border-radius: var(--radius-sm); cursor: pointer; transition: .15s;
}
.card-tabs button:hover { background: rgba(0,0,0,.05); color: var(--ink); }
.dark .card-tabs button:hover { background: rgba(255,255,255,.06); }
.card-tabs button.active { background: rgb(var(--brand-rgb) / .1); color: var(--lavender); }

/* ─── Post Split (latest + popular) ────────────── */
.post-split {
  display: grid; grid-template-columns: 1fr 1fr; gap: 16px;
}
/* ─── Post Tabs Mobile ─────────────────────────── */
.post-tabs-mobile { display: none; }
@media (max-width: 880px) {
  .post-split { display: none; }
  .post-tabs-mobile { display: block; }
}

/* ─── Post List ────────────────────────────────── */
.post-list { padding: 4px 0; min-height: 420px; }
.post-empty { padding: 24px 16px; color: var(--muted); font-size: var(--fs-base); text-align: center; }
.post-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 20px; text-decoration: none;
  border-bottom: 1px solid var(--line);
  transition: background .15s;
  min-width: 0;
}
.post-item:last-child { border-bottom: none; }
.post-item:hover { background: rgba(0,0,0,.02); }
.dark .post-item:hover { background: rgba(255,255,255,.03); }
.post-rank {
  width: 22px; height: 22px; display: grid; place-items: center;
  font-size: var(--fs-sm); font-weight: 600; color: var(--lavender);
  background: rgb(var(--brand-rgb) / .1); border-radius: var(--radius-xs);
  flex-shrink: 0;
}
.post-info { min-width: 0; flex: 1; }
.post-info b {
  display: block; font-size: var(--fs-base); font-weight: 500;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dark .post-info b { color: var(--ink); }
.post-info .meta { font-size: var(--fs-xs); color: var(--muted); }

/* ─── Tour Recommend ───────────────────────────── */
.tour-recommend { margin: 0; }
.tour-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px;
  padding: var(--sp-4);
}
@media (max-width: 880px) {
  .tour-grid { grid-template-columns: 1fr; }
}
.tour-card {
  display: block; text-decoration: none;
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--line);
  transition: transform .15s, box-shadow .15s;
}
.tour-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.tour-image {
  height: 140px; background-size: cover; background-position: center;
  background-color: #e2e8f0;
  display: grid; place-items: center;
}
.tour-no-image { font-size: 2.5rem; }
.tour-info { padding: var(--sp-3); }
.tour-info b {
  display: block; font-size: var(--fs-md); font-weight: 600;
  color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dark .tour-info b { color: var(--ink); }
.tour-info .tour-addr {
  display: block; font-size: var(--fs-xs); color: var(--muted);
  margin-top: var(--sp-1); margin-bottom: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ─── Home Mini Game ───────────────────────────── */
.home-game-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
  padding: var(--sp-4);
}
@media (max-width: 880px) {
  .home-game-grid { grid-template-columns: 1fr; }
}
.home-game-item {
  display: flex; align-items: center; gap: 12px;
  padding: var(--sp-4); border-radius: var(--radius-md);
  border: 1px solid var(--line); background: var(--canvas);
  text-decoration: none;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.home-game-item:hover {
  transform: translateY(-2px);
  border-color: var(--lavender);
  box-shadow: 0 6px 16px rgb(var(--brand-rgb) / .12);
}
.dark .home-game-item { background: rgba(255,255,255,.04); }
.home-game-icon { font-size: var(--fs-3xl); line-height: 1; flex-shrink: 0; }
.home-game-body { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.home-game-body b {
  font-size: var(--fs-md); font-weight: 700; color: var(--ink);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.dark .home-game-body b { color: var(--ink); }
.home-game-body span { font-size: var(--fs-sm); color: var(--muted); }

/* ─── Fortune Grid (6×2) ───────────────────────── */
.fortune-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px;
  padding: 14px;
}
.fortune-item {
  display: grid; place-items: center;
  aspect-ratio: 1; font-size: var(--fs-24); border-radius: 10px;
  text-decoration: none; transition: background .15s, transform .15s;
}
.fortune-item:hover {
  background: rgba(0,0,0,.04); transform: scale(1.1);
}
.dark .fortune-item:hover { background: rgba(255,255,255,.06); }

/* ─── Today Fortune Card ────────────────────────── */
.today-fortune-card { margin-top: var(--sp-4); }
.today-fortune-menu {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
  padding: 14px;
}
.today-fortune-entry {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 14px 6px; border-radius: 10px; text-decoration: none;
  background: rgb(var(--brand-rgb) / .06); transition: background .15s, transform .15s;
}
.today-fortune-entry:hover { background: rgb(var(--brand-rgb) / .12); transform: translateY(-1px); }
.tf-icon { font-size: var(--fs-24); line-height: 1; }
.tf-label { font-size: var(--fs-sm); font-weight: 500; color: var(--ink); }
.dark .tf-label { color: var(--ink); }

/* ─── Psy Test Card ─────────────────────────────── */
.psy-card { margin-top: var(--sp-4); }
.psy-menu {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  padding: 14px;
}


/* ─── Weather Card ─────────────────────────────── */
.weather-card { margin-bottom: var(--sp-4); }
.weather-title { font-size: var(--fs-base); font-weight: 500; color: var(--ink); }
.dark .weather-title { color: var(--ink); }

.weather-slots {
  display: grid; grid-template-columns: repeat(3, 1fr);
  padding: 16px 12px; gap: 8px;
}
.weather-slot {
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 8px; border-radius: var(--radius-md);
  background: rgba(0,0,0,.02);
}
.dark .weather-slot { background: rgba(255,255,255,.04); }
.weather-slot.now { background: rgb(var(--brand-rgb) / .06); }
.dark .weather-slot.now { background: rgb(var(--brand-rgb) / .12); }
.slot-label { font-size: var(--fs-xs); color: var(--muted); font-weight: 500; }
.slot-icon { font-size: 2rem; line-height: 1; }
.slot-temp { font-size: var(--fs-xl); font-weight: 600; }
.weather-slot.now .slot-temp { color: var(--lavender); }
/* 다크에서 `--lavender`(#a78bfa)는 지금 슬롯의 브랜드 틴트 위에서 4.42:1 로 **0.08 부족**했다.
   (틴트를 `--brand-rgb` 로 모으면서 배경이 조금 밝아졌다.) `--plum`(#c4b5fd)으로 올린다. */
.dark .weather-slot.now .slot-temp { color: var(--plum); }

/* ─── Mobile ──────────────────────────────────── */
.mobile-nav { display: none; }
.mobile-drawer { display: none; }
@media (max-width: 880px) {
  .app { grid-template-columns: 1fr; padding-bottom: 66px; }
  .rail { display: none; }
  .topbar { height: 62px; padding: 0 20px; max-width: none; }
  .content { padding: 0 20px 40px; }
  .welcome-row { flex-direction: column; align-items: flex-start; gap: 10px; }
  .welcome-row .chip { align-self: flex-end; }

  .mobile-nav {
    position: fixed; z-index: 20; bottom: 0; left: 0; right: 0;
    display: grid; grid-template-columns: repeat(5, 1fr);
    padding: 7px 5px 9px;
    border-top: 1px solid var(--line);
    background: rgba(255,255,255,.96);
    backdrop-filter: blur(14px);
  }
  .dark .mobile-nav { background: rgba(15,23,42,.96); }
  .mobile-nav a {
    display: grid; gap: 2px; place-items: center;
    color: #8e8a98; font-size: var(--fs-2xs); text-decoration: none; transition: .18s;
  }
  .dark .mobile-nav a { color: #64748b; }
  .mobile-nav a.active,
  .mobile-nav button.active { color: var(--lavender); font-weight: 500; }
  .mobile-nav button {
    display: grid; gap: 2px; place-items: center;
    color: #8e8a98; font-size: var(--fs-2xs); text-decoration: none;
    background: none; border: none; padding: 0; cursor: pointer;
  }
  .dark .mobile-nav button { color: #64748b; }
  .mobile-nav .icon { width: 18px; height: 18px; position: relative; display: inline-block; color: currentColor; opacity: .72; }
  .mobile-nav .icon::before, .mobile-nav .icon::after { content: ''; position: absolute; box-sizing: border-box; }
  .mobile-nav .icon-home::before { inset: 5px 3px 2px; border: 1.4px solid currentColor; border-radius: 2px; }
  .mobile-nav .icon-home::after { width: 10px; height: 10px; left: 4px; top: 1px; border-left: 1.4px solid currentColor; border-top: 1.4px solid currentColor; transform: rotate(45deg); }
  .mobile-nav .icon-fortune::before { width: 12px; height: 12px; left: 3px; top: 3px; border: 1.4px solid currentColor; border-radius: 50%; }
  .mobile-nav .icon-fortune::after { width: 7px; height: 7px; left: 8px; top: 0; background: var(--paper); border-radius: 50%; }
  .mobile-nav .icon-psychology::before { width: 12px; height: 12px; left: 3px; top: 3px; border: 1.4px solid currentColor; border-radius: 50%; }
  .mobile-nav .icon-psychology::after { width: 3px; height: 3px; left: 7.5px; top: 7.5px; background: currentColor; border-radius: 50%; }
  .mobile-nav .icon-games::before { inset: 3px; border: 1.4px solid currentColor; border-radius: 4px; }
  .mobile-nav .icon-games::after { width: 2px; height: 8px; left: 8px; top: 5px; background: currentColor; border-radius: 2px; }
  .mobile-nav .icon-lounge::before { width: 14px; height: 11px; left: 2px; top: 3px; border: 1.4px solid currentColor; border-radius: 4px; }
  .mobile-nav .icon-lounge::after { width: 5px; height: 5px; left: 4px; top: 11px; border-left: 1.4px solid currentColor; border-bottom: 1.4px solid currentColor; transform: skewY(-30deg); }

  .mobile-drawer {
    display: block;
    position: fixed; inset: 0; z-index: 30;
  }
  .mobile-drawer .backdrop {
    position: absolute; inset: 0;
    background: rgba(0,0,0,.3); backdrop-filter: blur(4px);
  }
  .mobile-drawer .drawer {
    position: absolute; left: 0; top: 0; bottom: 0; width: 280px;
    background: var(--paper); box-shadow: 4px 0 24px rgba(0,0,0,.1);
    padding: 24px 16px;
    overflow-y: auto;
  }
  .mobile-drawer .rail-footer { margin-top: var(--sp-6); }
}

/* ─── § 6. State UI ──────────────────────────── */
.spinner {
  width: 24px; height: 24px;
  border: 3px solid var(--action-primary-ring);
  border-top-color: var(--action-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
}
.spinner-sm {
  display: inline-block;
  width: 16px; height: 16px;
  border: 2px solid var(--action-primary-ring);
  border-top-color: var(--action-primary);
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  vertical-align: middle;
  margin-right: 6px;
}
.spinner-lg { width: 48px; height: 48px; border-width: 4px; }
.dark .spinner,
.dark .spinner-sm { border-color: var(--action-primary-ring); border-top-color: var(--action-primary); }
@keyframes spin { to { transform: rotate(360deg); } }

.loading-overlay {
  display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 12px; padding: 48px 24px;
  text-align: center; min-height: 200px;
}
.loading-overlay h4 { margin: 0; font-size: var(--fs-17); font-weight: 700; color: var(--ink); }
.loading-overlay p { margin: 0; color: var(--muted); font-size: var(--fs-base); line-height: 1.7; }

.error-card {
  padding: var(--sp-6); background: #fff5f5; border: 1px solid #fecaca;
  border-radius: var(--radius-lg); text-align: center; max-width: 400px; margin: 0 auto;
}
.dark .error-card { background: rgba(239,68,68,0.08); border-color: rgba(239,68,68,0.2); }
.error-card .error-icon { font-size: 2rem; margin-bottom: var(--sp-2); }
.error-card .error-title { font-size: var(--fs-md); font-weight: 800; color: #dc2626; margin-bottom: var(--sp-1); }
.dark .error-card .error-title { color: #f87171; }
.error-card .error-desc { font-size: var(--fs-sm); color: #92400e; line-height: 1.6; }
.dark .error-card .error-desc { color: #fca5a5; }
.error-card .error-actions { display: flex; justify-content: center; gap: 9px; margin-top: 14px; flex-wrap: wrap; }
.error-card .btn-fill { min-height: 40px; padding: 0 18px; font-size: var(--fs-sm); }
.error-card .btn-outline { min-height: 40px; padding: 0 16px; font-size: var(--fs-sm); }

/* ─── § 5. Core Components ───────────────────── */
.btn-fill {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 24px; border-radius: var(--radius-md);
  font-size: var(--fs-base); font-weight: 800;
  background: var(--action-primary); color: var(--on-brand); border: none;
  cursor: pointer; transition: background 0.18s, transform 0.12s;
}
.btn-fill:hover { background: var(--action-primary-hover); transform: translateY(-1px); }
.dark .btn-fill { background: var(--gold); color: #0a0a0c; }
.dark .btn-fill:hover { background: #fcefc4; }

.btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 44px; padding: 0 20px; border-radius: var(--radius-md);
  font-size: var(--fs-sm); font-weight: 700;
  background: transparent; color: #64748b;
  border: 1.5px solid #e4e7ec; cursor: pointer;
  transition: .18s;
}
.btn-outline:hover { border-color: var(--action-primary); color: var(--action-primary); }
.dark .btn-outline { color: rgba(255,255,255,0.4); border-color: rgba(255,255,255,0.1); }
.dark .btn-outline:hover { border-color: var(--gold); color: var(--gold); }

.btn-toggle {
  flex: 1; height: 36px; display: flex; align-items: center;
  justify-content: center; border-radius: var(--radius-sm); font-size: var(--fs-2xs); font-weight: 700;
  /* 하드코딩 slate-400 은 흰 배경에서 2.56:1 이다(라이트 대비 감사 2026-10-23). */
  border: 1px solid #e4e7ec; background: #fff; color: var(--muted); cursor: pointer;
  transition: all 0.15s;
}
.btn-toggle.on { background: var(--action-primary); color: var(--on-brand); border-color: var(--action-primary); }
.dark .btn-toggle { background: transparent; border-color: rgba(255,255,255,0.1); color: var(--muted); }
.dark .btn-toggle.on { background: var(--gold); color: #0a0a0c; border-color: var(--gold); }

.btn-option {
  width: 100%; padding: 10px 12px; background: #f8f9fb;
  border: 1px solid #e4e7ec; border-radius: var(--radius-md);
  font-size: var(--fs-xs); font-weight: 600; color: #64748b; cursor: pointer; text-align: left;
  transition: all 0.15s;
}
.btn-option:hover { border-color: var(--action-primary); color: var(--action-primary); }
.dark .btn-option { background: rgba(255,255,255,0.03); border-color: rgba(255,255,255,0.08); color: rgba(255,255,255,0.6); }
.dark .btn-option:hover { border-color: var(--gold); color: var(--gold); }
.btn-option.sel { border-color: var(--action-primary); color: var(--action-primary); background: var(--action-primary-soft); }
.dark .btn-option.sel { border-color: var(--gold); color: var(--gold); }

/* ─── Sub Menu (rail) ────────────────────────── */
.sub-menu {
  display: grid; gap: 1px;
  margin: 3px 0 3px 32px;
  padding-left: 10px;
  border-left: 2px solid var(--lavender-soft);
}
.sub-menu a.sub {
  display: block; padding: 7px 12px; border-radius: var(--radius-sm);
  font-size: var(--fs-base); color: var(--muted); text-decoration: none; transition: .18s;
}
.sub-menu a.sub:hover { background: var(--lavender-soft); color: var(--plum); }
.dark .sub-menu a.sub:hover { background: rgb(var(--brand-rgb) / 0.08); }
.sub-menu a.sub.active { color: var(--lavender); font-weight: 500; }

/* ─── Mobile Sub Tabs ────────────────────────── */
.mobile-tabs {
  display: none;
  width: 100%; box-sizing: border-box;
  padding: 10px 20px 4px; gap: 8px;
  overflow-x: scroll; overflow-y: hidden;
  overscroll-behavior-x: contain;
  -webkit-overflow-scrolling: touch;
  touch-action: pan-x;
  scrollbar-width: none;
}
.mobile-tabs::-webkit-scrollbar { display: none; }
.mobile-tabs.is-dragging { cursor: grabbing; user-select: none; }
.mobile-tabs { cursor: grab; }
.mobile-tabs a {
  flex: 0 0 auto;
  padding: 7px 14px; border-radius: var(--radius-pill);
  font-size: var(--fs-sm); font-weight: 500; white-space: nowrap;
  text-decoration: none; color: var(--muted);
  background: var(--paper); border: 1px solid var(--line); transition: .18s;
}
.mobile-tabs a.active { background: var(--lavender); color: var(--on-brand); border-color: var(--lavender); }
.mobile-tabs a:hover { border-color: var(--lavender); color: var(--lavender); }
@media (max-width: 880px) { .mobile-tabs { display: flex; } }

/* ─── Mobile Spacer ──────────────────────────── */
.mobile-spacer { display: none; }
@media (max-width: 880px) { .mobile-spacer { display: block; height: 66px; } }
.app.no-sidebar .mobile-spacer { display: none; }

/* ═══════════════════════════════════════════════
   § 7. Animations & Motion (@keyframes, .animate-*, prefers-reduced-motion)
   ═══════════════════════════════════════════════ */
/* ─── Utility ─────────────────────────────────── */
.custom-scrollbar::-webkit-scrollbar { width: 6px; }
.custom-scrollbar::-webkit-scrollbar-track { background: rgba(0,0,0,0.02); }
.dark .custom-scrollbar::-webkit-scrollbar-track { background: rgba(255,255,255,0.02); }
.custom-scrollbar::-webkit-scrollbar-thumb { background: var(--action-primary-ring); border-radius: 3px; }
.custom-scrollbar::-webkit-scrollbar-thumb:hover { background: var(--action-primary); }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-fade-in { animation: fadeIn 0.4s ease-out forwards; }

@keyframes spinSlow { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
.animate-spin-slow { animation: spinSlow 20s linear infinite; }

@keyframes shuffle-left {
  0%, 100% { transform: translateX(0) rotate(-15deg); }
  50% { transform: translateX(-60px) rotate(-30deg); z-index: 20; }
}
@keyframes shuffle-right {
  0%, 100% { transform: translateX(0) rotate(15deg); }
  50% { transform: translateX(60px) rotate(30deg); z-index: 20; }
}
.animate-shuffle-left { animation: shuffle-left 0.6s ease-in-out infinite; }
.animate-shuffle-right { animation: shuffle-right 0.6s ease-in-out infinite; }

/* ═══════════════════════════════════════════════════════════════════
   components.css — 공개 화면 공용 컴포넌트
   ───────────────────────────────────────────────────────────────────
   4파일 체계(tokens → utilities → components → features)의 3번째 파일.
   · 색상·radius·shadow 는 디자인 토큰으로만 표현한다(토큰 없는 색상값 금지).
   · 간격은 rem, 테두리 두께는 가장 얇은 두 단계(1/2 단위)만 사용한다.
   · 우선순위를 강제하는 important 선언은 쓰지 않는다.
   ═══════════════════════════════════════════════════════════════════ */


/* ─── 약관·정책 문서 본문 (prose) ───────────────────────────────────
   policy/document.html · terms · privacy 의 법적 문서 본문.
   블록(섹션) 사이 간격은 템플릿의 `space-y-*` 유틸리티가 담당하고,
   여기서는 요소 자체의 리셋과 색상·자간만 담당한다.              */
.prose {
  color: var(--ink);
  font-size: var(--fs-md);
  line-height: 1.85;
  word-break: keep-all;
}

/* 제목 크기는 템플릿의 text-* 유틸리티가 덮어쓸 수 있도록 우선순위를 낮춘다 */
:where(.prose) :where(h2) { font-size: var(--fs-20); }
:where(.prose) :where(h3) { font-size: var(--fs-17); }
:where(.prose) :where(h4) { font-size: var(--fs-15); }
:where(.prose) :where(h5),
:where(.prose) :where(h6) { font-size: var(--fs-md); }

.prose h1, .prose h2, .prose h3, .prose h4, .prose h5, .prose h6 {
  margin: 1.25rem 0 0.5rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink);
}
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 0.75rem; }
.prose ul, .prose ol { margin: 0 0 0.75rem; padding-left: 1.25rem; }
.prose ul { list-style: disc; }
.prose ol { list-style: decimal; }
.prose li { margin: 0 0 0.25rem; }
.prose dl { margin: 0 0 0.75rem; }
.prose dd { margin: 0 0 0.25rem; }
.prose dt { font-weight: 700; color: var(--ink); }
.prose a {
  color: var(--action-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}
.prose a:hover { color: var(--action-primary-hover); }
.prose strong, .prose b { font-weight: 700; color: var(--ink); }
.prose em, .prose i { font-style: italic; }
.prose hr {
  height: 0;
  margin: 1.25rem 0;
  border: 0;
  border-top: 1px solid var(--line);
}
.prose blockquote {
  margin: 0 0 0.75rem;
  padding: 0.5rem 0.875rem;
  border-left: 2px solid var(--lavender);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--canvas);
  color: var(--muted);
}
.prose code {
  padding: 0.125rem 0.375rem;
  border-radius: var(--radius-xs);
  background: var(--canvas);
  color: var(--plum);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: var(--fs-base);
}
.prose pre {
  margin: 0 0 0.75rem;
  padding: 0.75rem 0.875rem;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--canvas);
  color: var(--ink);
}
.prose pre code { padding: 0; background: none; color: inherit; }
.prose table {
  width: 100%;
  margin: 0 0 0.75rem;
  border-collapse: collapse;
  font-size: var(--fs-base);
}
.prose th, .prose td {
  padding: 0.5rem 0.625rem;
  border: 1px solid var(--line);
  text-align: left;
}
.prose th { background: var(--canvas); font-weight: 700; color: var(--ink); }

/* 라이트 표면 variant — 본문은 보조색, 제목·강조는 본문색 */
.prose-slate { color: var(--muted); }
.prose-slate h1, .prose-slate h2, .prose-slate h3, .prose-slate h4 { color: var(--ink); }
.prose-slate strong, .prose-slate b { color: var(--ink); }
.prose-slate a { color: var(--action-primary); }
.prose-slate th { background: var(--canvas); }

/* 다크 표면 variant — 템플릿은 `dark:prose-invert` 토큰을 쓰는데 콜론이 든
   토큰은 일반 클래스 선택자로는 잡히지 않으므로 속성 선택자까지 함께 준다. */
.prose-invert { color: var(--muted); }
.prose-invert h1, .prose-invert h2, .prose-invert h3, .prose-invert h4 { color: var(--ink); }
.prose-invert strong, .prose-invert b { color: var(--ink); }
.prose-invert a { color: var(--lavender); }
.prose-invert th { background: var(--canvas); }
.dark .prose-invert a { color: var(--lavender); }
.dark [class~="dark:prose-invert"] { color: var(--muted); }
.dark [class~="dark:prose-invert"] h1,
.dark [class~="dark:prose-invert"] h2,
.dark [class~="dark:prose-invert"] h3,
.dark [class~="dark:prose-invert"] h4 { color: var(--ink); }
.dark [class~="dark:prose-invert"] strong,
.dark [class~="dark:prose-invert"] b { color: var(--ink); }
.dark [class~="dark:prose-invert"] a { color: var(--lavender); }


/* ─── AI 어시스턴트 채팅 ───────────────────────────────────────────
   web/assistant/index.html 의 채팅 UI(말풍선·입력창·로그인 게이트).
   템플릿 안의 인라인 <style> 과 겹치는 속성은 페이지 루트 스코프로
   확실히 덮어쓴다.                                            */
.assistant-page {
  max-width: 46rem;
  margin: 0 auto;
}
.assistant-chat-wrap {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-top: 1.5rem;
}
.assistant-chat {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  min-height: 20rem;
  max-height: 60vh;
  overflow-y: auto;
  padding: 1.25rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface, var(--paper));
}
.chat-row { display: flex; }
.chat-row.user { justify-content: flex-end; }
.chat-text { margin: 0; white-space: pre-wrap; word-break: break-word; }
.chat-typing { margin: 0; color: var(--muted); font-size: var(--fs-md); }
.chat-error {
  margin: 0;
  color: var(--danger, var(--coral));
  font-size: var(--fs-md);
  font-weight: 600;
}

/* 어시스턴트 말풍선(역할 클래스) */
.assistant {
  max-width: 82%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-xs);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--fs-md);
  line-height: 1.6;
}
.assistant-page .chat-row.assistant .bubble {
  max-width: 82%;
  padding: 0.7rem 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  border-bottom-left-radius: var(--radius-xs);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--fs-md);
  line-height: 1.6;
}
/* 사용자 말풍선 — 템플릿 인라인 스타일이 정의되지 않은 토큰을 참조해
   배경이 비어 보이므로 페이지 루트 스코프로 색을 확실히 지정한다. */
.assistant-page .chat-row.user .bubble {
  max-width: 82%;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-lg);
  border-bottom-right-radius: var(--radius-xs);
  background: var(--action-primary);
  color: var(--ink-invert, var(--paper));
  font-size: var(--fs-md);
  line-height: 1.6;
}
.assistant-login-gate {
  margin-top: 1.5rem;
  padding: 3rem 1.5rem;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--surface, var(--paper));
}
.assistant-login-gate > div { margin-bottom: 0.75rem; font-size: 2rem; }
.assistant-login-gate h2 { margin: 0 0 0.5rem; font-size: var(--fs-17); color: var(--ink); }
.assistant-login-gate p { margin: 0 0 1.25rem; color: var(--muted); font-size: var(--fs-md); }
.assistant-login-btn {
  display: inline-block;
  padding: 0.7rem 1.6rem;
  border-radius: var(--radius-md);
  background: var(--action-primary);
  color: var(--ink-invert, var(--paper));
  font-size: var(--fs-md);
  font-weight: 700;
  text-decoration: none;
  transition: background 0.15s, transform 0.12s;
}
.assistant-login-btn:hover {
  background: var(--action-primary-hover);
  transform: translateY(-1px);
}
.assistant-input {
  display: flex;
  gap: 0.6rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--surface, var(--paper));
}
.assistant-input textarea {
  flex: 1;
  min-width: 0;
  resize: none;
  border: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-md);
  line-height: 1.5;
}
.assistant-input button {
  flex: none;
  align-self: flex-end;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--action-primary);
  color: var(--ink-invert, var(--paper));
  cursor: pointer;
}
.assistant-input button:disabled { opacity: 0.45; cursor: not-allowed; }


/* ─── 관광지 스팟 카드 ─────────────────────────────────────────────
   어시스턴트 추천 결과에 붙는 관광지 카드. 목록형 그리드 카드와
   같은 표면·테두리·hover 규칙을 쓴다.                          */
.spot-cards {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  margin-top: 0.75rem;
}
.spot-card {
  display: flex;
  gap: 0.8rem;
  padding: 0.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface, var(--paper));
  color: inherit;
  text-align: left;
  text-decoration: none;
  transition: border-color 0.15s, box-shadow 0.15s, transform 0.12s;
}
.spot-card:hover {
  border-color: var(--lavender);
  box-shadow: var(--shadow-hover);
  transform: translateY(-1px);
}
.spot-card img {
  width: 4.5rem;
  height: 4.5rem;
  flex: none;
  object-fit: cover;
  border-radius: var(--radius-sm);
  background: var(--canvas);
}
.spot-card-body { min-width: 0; }
.spot-card-body b {
  display: block;
  margin-bottom: 0.15rem;
  font-size: var(--fs-md);
  color: var(--ink);
}
.spot-card-body span {
  display: block;
  margin-bottom: 0.3rem;
  font-size: var(--fs-sm);
  color: var(--muted);
}
.spot-card-body p {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
  font-size: var(--fs-sm);
  color: var(--muted);
}


/* ─── 구독 비교 블록 (cmpr) ───────────────────────────────────────
   /compare/subscriptions 하위 화면의 후보 카드·정상가 카드·우측 서비스 메뉴. */
.cmpr-candidate {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transition: transform 0.18s, border-color 0.18s, box-shadow 0.18s;
}
.cmpr-candidate:hover {
  transform: translateY(-2px);
  border-color: var(--lavender);
  box-shadow: var(--shadow-hover);
}
.cmpr-candidate .card-head h3 { font-size: var(--fs-md); }
.cmpr-candidate .card-body { gap: 0.75rem; }
.cmpr-offers {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cmpr-offers .card-body { gap: 0.75rem; }
.cmpr-offers .card-head h2 { font-size: var(--fs-15); }
.cmpr-nav-services { overflow: hidden; }
.cmpr-nav-services .card-body { gap: 0.625rem; }
.cmpr-nav-services .side-links a { font-size: var(--fs-base); }


/* ─── 날씨 페이지 루트 ─────────────────────────────────────────────
   /life/weather 의 최상위 섹션. `.life-page` 형제 페이지 루트로
   폭과 오버플로만 정의한다.                                    */
.weather-page {
  width: 100%;
  min-width: 0;
}


/* ─── 관광 지역 선택 ───────────────────────────────────────────────
   /tour 목록 상단 필터의 지역 select.                            */
.tour-select {
  max-width: 100%;
  color: var(--ink);
  cursor: pointer;
}


/* ─── 목록 페이지당 개수 선택 ─────────────────────────────────────
   공용 페이저(fragments/pager.html)의 크기 선택 select.            */
.pager-size-select {
  min-height: 2rem;
  color: var(--ink);
  cursor: pointer;
}
.pager-size-select:focus {
  border-color: var(--lavender);
}


/* ─── 지역 소개 본문 ─────────────────────────────────────────────
   /region 상세의 소개 본문(지리·역사문화·볼거리 섹션).            */
.region-intro-body {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}
.region-intro-body section { display: grid; gap: 0.25rem; }
.region-intro-body section h4 {
  margin: 0;
  font-size: var(--fs-base);
  font-weight: 700;
  color: var(--muted);
}
.region-intro-body section p {
  margin: 0;
  font-size: var(--fs-md);
  line-height: 1.7;
  color: var(--ink);
  white-space: pre-wrap;
}


/* ─── 게시판 글쓰기 (board post-form) ───────────────────────────────
   web/board/post-form.html 의 글쓰기 화면.
   제목·본문 편집기·편집 도구·안내 문구를 담는 작성 카드(writer-*)와
   거기에 쓰이는 버튼·입력 필드·본문 영역의 스타일.
   표면·경계·둥근 모서리는 게시판 카드(.card/.comment-form)와 같은
   토큰(--paper/--line/--radius-*)을 쓰고, 상태색은 --danger 계열만 쓴다. */
.writer-back {
  display: inline-block;
  margin: var(--sp-3) 0;
  color: var(--muted);
  font-size: var(--fs-base);
  text-decoration: none;
  transition: color 0.15s;
}
.writer-back:hover { color: var(--lavender); }

.writer-heading { margin: var(--sp-3) 0 var(--sp-6); }
.writer-heading > span {
  display: inline-block;
  padding: 2px var(--sp-2);
  border-radius: var(--radius-pill);
  background: var(--lavender-soft);
  color: var(--lavender);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.writer-heading h1 {
  margin: var(--sp-2) 0;
  color: var(--ink);
  font-size: var(--fs-3xl);
  font-weight: 700;
  letter-spacing: -1px;
}
.writer-heading p {
  margin: 0;
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: 1.6;
}

/* 작성 폼을 감싸는 카드 — .card/.comment-form 과 같은 표면·경계·그림자 */
.write-card {
  padding: var(--sp-6);
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  background: var(--paper);
  box-shadow: var(--shadow);
}

/* 필드 라벨 — 필드 이름과 보조 카운터(제목 0 / 200)를 한 줄에 붙인다 */
.writer-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--sp-2);
  margin: var(--sp-3) 0 var(--sp-2);
  color: var(--ink);
  font-size: var(--fs-base);
  font-weight: 700;
}
.writer-label span {
  color: var(--muted);
  font-size: var(--fs-sm);
  font-weight: 500;
}

/* 제목 입력 — .form-field 와 같은 테두리·배경·포커스 링 */
.form-input-styled {
  width: 100%;
  box-sizing: border-box;
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--canvas);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-lg);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-input-styled:focus {
  border-color: var(--lavender);
  box-shadow: 0 0 0 2px var(--action-primary-ring);
}

/* 본문 편집기(Quill) 테두리 */
.editor-wrapper {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--paper);
}

/* 편집 도구(실행 취소·다시 실행·미리보기)와 하단 상태 줄 */
.writer-tools,
.writer-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--sp-2);
  margin: var(--sp-3) 0;
  color: var(--muted);
  font-size: var(--fs-sm);
}
.writer-status { justify-content: space-between; }
.writer-tools button {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.writer-tools button:hover { border-color: var(--lavender); color: var(--lavender); }
.writer-tools button[aria-pressed="true"] {
  border-color: var(--lavender);
  background: var(--lavender-soft);
  color: var(--lavender);
}

/* 안내 패널(임시저장 복원·이미지 편집) */
.writer-notice {
  margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--canvas);
}
.writer-notice p {
  margin: 0 0 var(--sp-2);
  color: var(--muted);
  font-size: var(--fs-base);
  line-height: 1.6;
}
.writer-notice p:last-child { margin-bottom: 0; }
.writer-notice label {
  display: block;
  margin: var(--sp-2) 0;
  color: var(--ink);
  font-size: var(--fs-sm);
  font-weight: 600;
}
.writer-notice select,
.writer-notice input {
  box-sizing: border-box;
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-family: inherit;
  font-size: var(--fs-sm);
}
.writer-notice input { width: 100%; }
.writer-notice button {
  padding: var(--sp-2) var(--sp-3);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  color: var(--ink);
  font-size: var(--fs-sm);
  cursor: pointer;
  transition: border-color 0.15s, color 0.15s;
}
.writer-notice button:hover { border-color: var(--lavender); color: var(--lavender); }

/* 본문 아래에 붙는 소형 안내 문구 — 조용히 물러나 있어야 한다 */
.writer-help {
  margin: var(--sp-1) 0;
  color: var(--muted);
  font-size: var(--fs-sm);
  line-height: 1.6;
}

/* 저장 실패 등 오류 배너 */
.writer-error {
  margin-bottom: var(--sp-4);
  padding: var(--sp-3) var(--sp-4);
  border: 1px solid var(--danger-line);
  border-radius: var(--radius-md);
  background: var(--danger-soft);
  color: var(--danger);
  font-size: var(--fs-base);
  line-height: 1.6;
  white-space: pre-wrap;
}

/* 하단 액션 행(취소·저장) */
.writer-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--sp-2);
  padding-top: var(--sp-4);
}

/* 작성 화면 버튼 — .button/.ghost 와 같은 크기·hover 규칙 */
.btn-primary-styled,
.btn-ghost-styled {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-1);
  padding: var(--sp-3) var(--sp-5);
  border-radius: var(--radius-md);
  font-size: var(--fs-base);
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s, transform 0.12s;
}
.btn-ghost-styled {
  border: 1px solid var(--line);
  background: var(--paper);
  color: var(--ink);
}
.btn-ghost-styled:hover { border-color: var(--lavender); color: var(--lavender); }
.btn-primary-styled {
  border: 1px solid transparent;
  background: var(--action-primary);
  color: var(--ink-invert);
}
.btn-primary-styled:hover:not(:disabled) {
  background: var(--action-primary-hover);
  transform: translateY(-1px);
}
.btn-primary-styled:disabled,
.btn-ghost-styled:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

@media (max-width: 640px) {
  .write-card { padding: var(--sp-4); border-radius: var(--radius-lg); }
  .writer-heading h1 { font-size: var(--fs-2xl); }
  .writer-actions .btn-primary-styled,
  .writer-actions .btn-ghost-styled { width: 100%; }
}
