/* ReaDream 웹앱 스타일
   브레이크포인트: 모바일 <768 · 태블릿 768–1023 · 데스크톱 ≥1024 (사이드바) */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--s0);
  color: var(--text-1);
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.6;
  word-break: keep-all;          /* 한글 어절 단위 줄바꿈 */
  overflow-wrap: anywhere;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button, textarea, input { font-family: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p { margin: 0; }
img { display: block; max-width: 100%; }
:focus-visible { outline: 2px solid var(--lavender-text); outline-offset: 2px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
[hidden] { display: none !important; }

/* ───────── 공통 아이콘 ───────── */
.icon { width: 22px; height: 22px; flex: none; fill: none; stroke: currentColor;
  stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }
.icon--20 { width: 20px; height: 20px; }
.icon--18 { width: 18px; height: 18px; }
.sparkle { flex: none; }

/* ───────── 앱 셸 ───────── */
.app { position: relative; min-height: 100vh; }
.main-wrap { position: relative; min-width: 0; }
#view { outline: none; }

.wordmark {
  font-family: var(--font-wordmark); font-weight: 700; font-size: 24px;
  letter-spacing: .01em; line-height: 1.2;
  background: var(--grad-wordmark); -webkit-background-clip: text; background-clip: text;
  color: transparent; align-self: flex-start;
}
.wordmark--lg { font-size: 26px; padding: 0 12px; }

.avatar {
  width: 44px; height: 44px; border-radius: 22px; flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(154,130,198,.25); background: var(--s1); color: var(--lavender-text);
  font-family: var(--font-number); font-weight: 700; font-size: 16px;
}
.avatar--sm { width: 36px; height: 36px; border: 0; background: var(--s2); font-size: 15px; }

/* 사이드바 (데스크톱 전용) */
.sidebar { display: none; }

/* 하단 탭 (모바일 · 태블릿) */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  height: calc(var(--tabbar-h) + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  display: flex; align-items: stretch;
  background: rgba(28,27,31,.94); border-top: 1px solid rgba(154,130,198,.16);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
}
.tab {
  flex: 1; min-height: 56px; display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 3px; color: var(--text-3); font-size: 12px;
}
.tab__pill { display: flex; align-items: center; justify-content: center; width: 56px; height: 30px; border-radius: 15px; }
.tab[aria-current="page"] { color: var(--lavender-text); }
.tab[aria-current="page"] .tab__pill { background: rgba(154,130,198,.18); }
body.no-tabbar .tabbar { display: none; }

/* 모바일 상단 헤더 */
.m-header {
  display: flex; align-items: center; justify-content: space-between;
  height: 56px; padding: 0 12px 0 var(--gutter);
}
.m-header--sub { padding: 0 8px; }
.m-header__title { font-size: 16px; font-weight: 600; }
.m-header__title--clip { flex: 1; min-width: 0; margin: 0 4px; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } /* 생성된 제목은 길 수 있다 */
.icon-btn {
  width: 44px; height: 44px; display: inline-flex; align-items: center; justify-content: center;
  border: 0; background: transparent; border-radius: 22px; color: var(--text-1);
}

/* 배경 장식 */
.glow {
  position: absolute; pointer-events: none; border-radius: 50%; z-index: 0;
  background: radial-gradient(circle, rgba(154,130,198,.20) 0%, rgba(154,130,198,0) 66%);
}
.deco-star { position: absolute; pointer-events: none; z-index: 0; }
.page { position: relative; overflow-x: clip; min-height: 100vh; }
.page__inner { position: relative; z-index: 1; padding: 0 var(--gutter); }
.page--tabbed .page__inner { padding-bottom: calc(var(--tabbar-h) + 32px + env(safe-area-inset-bottom)); }

/* ───────── 버튼 ───────── */
.btn-primary {
  height: 56px; border: 0; border-radius: 28px; padding: 0 24px;
  background: var(--grad-fill); color: var(--on-fill);
  font-size: 17px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  box-shadow: var(--cta-shadow); transition: transform .15s ease, filter .15s ease;
}
.btn-primary:hover { filter: brightness(1.05); }
.btn-primary:active { transform: translateY(1px); }
.btn-primary:disabled { background: var(--s3); color: var(--text-3); box-shadow: none; cursor: not-allowed; }
.btn-primary.is-loading { background: var(--grad-fill); color: var(--on-fill); opacity: .85; cursor: wait; }
.btn-primary.is-loading .sparkle { animation: rdSpin 2.4s linear infinite; }

.btn-secondary {
  height: 52px; padding: 0 24px; border-radius: 26px; border: 1.5px solid var(--lavender-text);
  background: rgba(154,130,198,.10); color: var(--lavender-strong); font-size: 16px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}

.action-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.action-tile {
  min-height: 68px; border-radius: 18px; border: 1px solid rgba(154,130,198,.20);
  background: var(--s1); color: var(--text-1); font-size: 13px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  transition: background .15s ease;
}
.action-tile .icon { stroke: var(--lavender-text); }
.action-tile:hover { background: var(--s2); }

.link-accent { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; color: var(--lavender-text); }

/* ───────── 칩 ───────── */
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  flex: none; height: 44px; padding: 0 16px; border-radius: 22px;
  border: 1px solid var(--line-2); background: var(--s1); color: var(--text-2);
  font-size: 14px; white-space: nowrap; display: inline-flex; align-items: center; gap: 6px;
  transition: background .15s ease, border-color .15s ease;
}
.chip:hover { background: var(--s2); }
.chip[aria-pressed="true"] {
  background: rgba(154,130,198,.22); border-color: var(--lavender-text);
  color: var(--lavender-on); font-weight: 600;
}
.chip .sparkle path { fill: #9A82C6; }
.chip[aria-pressed="true"] .sparkle path { fill: var(--lavender-strong); }
.chip--icon { width: 44px; padding: 0; justify-content: center; }

.tag {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 14px;
  border-radius: 18px; background: rgba(154,130,198,.14); border: 1px solid rgba(154,130,198,.26);
  color: var(--lavender-chip); font-size: 14px;
}

/* ───────── 카드 ───────── */
.card { background: var(--s1); border: 1px solid var(--line-1); border-radius: var(--r-card); }

/* ───────── 홈 ───────── */
.home-title { font-size: 28px; line-height: 38px; font-weight: 500; letter-spacing: -.02em; margin-top: 16px; }
.grad-word {
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text;
  color: transparent; font-weight: 700;
}
.home-lead { margin-top: 10px; font-size: 15px; line-height: 23px; color: var(--text-2); }
.home-lead .br-m { display: inline; }

.dream-input {
  margin-top: 20px; background: var(--s2); border: 1px solid var(--line-3); border-radius: var(--r-card);
  padding: 16px 16px 12px; display: flex; flex-direction: column; height: 168px;
  box-shadow: 0 0 0 4px rgba(154,130,198,.06); transition: border-color .15s ease, box-shadow .15s ease;
}
.dream-input:focus-within { border-color: rgba(154,130,198,.55); box-shadow: var(--focus-ring); }
.dream-input textarea {
  flex: 1; min-height: 0; resize: none; border: 0; background: transparent; color: var(--text-1);
  font-size: 16px; line-height: 26px; padding: 0; caret-color: var(--lavender-text); outline: none;
}
.dream-input textarea::placeholder { color: var(--text-3); }
.dream-input__count {
  display: flex; justify-content: flex-end; font-size: 13px; line-height: 18px;
  color: var(--text-3); font-family: var(--font-number);
}
.dream-input.is-error { border-color: var(--error); box-shadow: none; }
.dream-input.is-disabled { background: var(--s1); border: 1px dashed rgba(154,130,198,.20); box-shadow: none; }
.dream-input.is-disabled textarea { color: var(--text-disabled); }
.field-error { margin-top: 8px; font-size: 13px; line-height: 18px; color: var(--error); }

.hint { font-size: 13px; line-height: 18px; color: var(--text-3); }
.home-chips { margin-top: 16px; }
.home-chips .chip-row { margin-top: 10px; }
.home-chips .chip:nth-child(n+4) { display: none; }
.home-submit { margin-top: 20px; display: flex; flex-direction: column; }
.home-submit .btn-primary { width: 100%; }
.home-caption { margin-top: 10px; text-align: center; font-size: 12px; line-height: 18px; color: var(--text-3); }

.section-head { display: flex; align-items: center; justify-content: space-between; }
.section-head h2 { font-size: 16px; line-height: 24px; font-weight: 600; }
.home-recents { margin-top: 26px; }
.recent-list { display: flex; flex-direction: column; gap: 10px; }
.recent-item {
  display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 16px;
  border-radius: 18px; background: var(--s1); border: 1px solid var(--line-1); transition: background .15s ease;
}
.recent-item:hover { background: var(--s2); }
.recent-item__body { flex: 1; min-width: 0; }
.recent-item__title { font-size: 15px; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.recent-item__date { margin-top: 2px; font-size: 13px; line-height: 18px; color: var(--text-3); }

.score-mini { display: flex; align-items: center; gap: 5px; flex: none; }
.score-mini__num {
  font-family: var(--font-number); font-weight: 700; font-size: 17px;
  background: var(--grad-text-2); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.empty-note {
  padding: 20px; border-radius: 18px; background: var(--s1); border: 1px dashed var(--line-2);
  color: var(--text-3); font-size: 14px; line-height: 22px; text-align: center;
}

/* 로딩 카드 (꿈사전 탐색 → 의미 풀이 → 정리) */
.loading-card {
  margin-top: 16px; padding: 20px; border-radius: var(--r-card);
  background: var(--s1); border: 1px solid rgba(154,130,198,.14);
}
.loading-card__row { display: flex; align-items: center; gap: 14px; }
.loading-card__art { position: relative; width: 64px; height: 64px; flex: none; }
.loading-card__text { font-size: 15px; line-height: 22px; }
.loading-card__sub { font-size: 12px; line-height: 18px; color: var(--text-3); }
.steps { margin-top: 14px; display: flex; gap: 6px; }
.steps span { flex: 1; height: 4px; border-radius: 2px; background: var(--s3); transition: background .4s ease; }
.steps span.on { background: linear-gradient(90deg, #8E9AE8, #B29CE0); }
.steps-label { margin-top: 8px; font-size: 12px; line-height: 18px; color: var(--text-3); }

.twinkle { animation: rdTwinkle 2.4s ease-in-out infinite; }
.twinkle--2 { animation-delay: .8s; }
.twinkle--3 { animation-delay: 1.5s; }

/* ───────── 결과 ───────── */
.result-head { display: none; }
.result-grid { display: flex; flex-direction: column; margin-top: 8px; }
.result-col { display: contents; }
.result-grid .r-image { order: 1; }
.result-grid .r-score { order: 2; }
.result-grid .r-metrics { order: 2; }
.result-grid .r-dream { order: 3; display: none; }
.result-grid .r-interp { order: 4; }
.result-grid .r-refs { order: 5; }
.result-grid .r-actions { order: 6; }
.result-grid .r-note { order: 7; }

.image-frame {
  position: relative; aspect-ratio: 1 / 1; border-radius: var(--r-strong); overflow: hidden;
  border: 1px solid var(--line-3); box-shadow: var(--glow-strong); background: var(--s1);
}
.image-frame img { width: 100%; height: 100%; object-fit: cover; }
.image-tools { position: absolute; top: 12px; right: 12px; display: flex; gap: 8px; }
.glass-btn {
  width: 44px; height: 44px; border-radius: 22px; border: 1px solid rgba(238,232,222,.18);
  background: rgba(28,27,31,.66); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  color: var(--text-1); display: inline-flex; align-items: center; justify-content: center;
}
.glass-btn .icon { width: 20px; height: 20px; }
.image-zoom-btn { display: block; width: 100%; height: 100%; padding: 0; border: 0; background: none; cursor: zoom-in; }

/* ───────── 이미지 크게 보기 팝업 ───────── */
body.is-zoom-open { overflow: hidden; }
.zoom { position: fixed; inset: 0; z-index: 40; animation: rdFadeIn .18s ease-out; }
.zoom__backdrop {
  position: absolute; inset: 0; width: 100%; height: 100%; padding: 0; border: 0;
  background: rgba(12,11,14,.92); cursor: zoom-out;
}
.zoom__stage {
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; pointer-events: none; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom);
}
.zoom__img {
  /* 모바일은 화면 너비에 꽉 차게, 큰 화면은 세로 · 최대 폭에 맞춰 정사각형 유지 */
  width: min(100vw, calc(100dvh - 140px), 720px); aspect-ratio: 1 / 1; object-fit: cover; display: block;
  box-shadow: 0 0 80px rgba(154,130,198,.22); pointer-events: auto; animation: rdZoomIn .22s ease-out;
}
.zoom__close, .zoom__btn {
  pointer-events: auto; height: 44px; border-radius: 22px; border: 1px solid rgba(238,232,222,.20);
  background: rgba(37,35,41,.92); color: var(--text-1); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
}
.zoom__close { position: absolute; top: calc(8px + env(safe-area-inset-top)); right: 8px; width: 44px; }
.zoom__close .icon { width: 20px; height: 20px; }
.zoom__actions { display: flex; gap: 10px; }
.zoom__btn { padding: 0 18px; gap: 8px; font-size: 14px; }
.zoom__btn .icon { stroke: var(--lavender-text); }
.zoom__close:hover, .zoom__btn:hover { background: var(--s2); }
@keyframes rdFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rdZoomIn { from { opacity: 0; transform: scale(.96); } to { opacity: 1; transform: none; } }

.grad-border { padding: 1px; border-radius: var(--r-strong); background: var(--grad-border); }
.image-placeholder {
  position: relative; aspect-ratio: 1 / 1; border-radius: 27px; padding: 24px; text-align: center;
  background: radial-gradient(circle at 50% 34%, rgba(154,130,198,.26) 0%, rgba(154,130,198,0) 58%), var(--s1);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
}
.image-placeholder__badge {
  position: absolute; top: 16px; left: 16px; height: 22px; padding: 0 10px; display: inline-flex; align-items: center;
  border-radius: 11px; background: rgba(154,130,198,.16); color: var(--lavender-chip); font-size: 12px;
}
.image-placeholder h2 { margin-top: 16px; font-size: 20px; line-height: 28px; font-weight: 600; letter-spacing: -.01em; }
.image-placeholder p { margin-top: 6px; font-size: 14px; line-height: 22px; color: var(--text-2); }
.image-placeholder .btn-primary { margin-top: 20px; width: 236px; font-size: 16px; }
.moon-art { position: relative; width: 96px; height: 84px; }
.moon-art--lg { width: 120px; height: 100px; }
.bar { margin-top: 20px; width: 200px; height: 4px; border-radius: 2px; background: var(--s3); overflow: hidden; }
.bar > div {
  width: 40%; height: 100%; border-radius: 2px;
  background: linear-gradient(90deg, #8E9AE8, #B29CE0, #E3BFD2); animation: rdBar 1.8s ease-in-out infinite;
}

.score-card {
  position: relative; z-index: 2; margin-top: 12px; padding: 16px 20px; border-radius: 24px;
  background: rgba(37,35,41,.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(154,130,198,.26);
  box-shadow: 0 14px 40px rgba(0,0,0,.45), 0 0 40px rgba(154,130,198,.14);
  display: flex; align-items: center; gap: 16px;
}
.score-card__num { flex: none; display: flex; align-items: baseline; gap: 3px; }
.score-card__num b {
  font-family: var(--font-number); font-weight: 700; font-size: 56px; line-height: 60px;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.score-card__num span { font-family: var(--font-number); font-weight: 600; font-size: 15px; color: var(--text-3); }
.score-card__body { flex: 1; min-width: 0; }
.score-card__label { font-size: 12px; line-height: 16px; letter-spacing: .06em; color: var(--lavender-text); font-weight: 500; }
.score-card__comment { margin-top: 6px; font-size: 14px; line-height: 20px; font-weight: 500; }

/* 꿈 지표 다각형 (Claude Design 캔버스의 Metrics 아트보드) — 길흉이 아니라 꿈의 성격이라 라벤더 한 가지 톤만 쓴다 */
.metrics {
  box-sizing: border-box; width: 100%; margin-top: 12px; padding: 18px 16px 16px; border-radius: 24px;
  background: var(--s1); border: 1px solid var(--line-1); color: var(--text-1);
}
.metrics__head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 0 4px; }
.metrics__head h2 { font-size: 15px; line-height: 22px; font-weight: 600; letter-spacing: -.005em; }
.metrics__head p { margin-top: 2px; font-size: 13px; line-height: 20px; color: var(--text-3); text-wrap: pretty; }
.metrics__head svg { flex: none; margin-top: 2px; }
.metrics__plot { position: relative; width: 100%; max-width: 340px; margin: 8px auto 0; aspect-ratio: 340 / 280; }
.metrics__plot svg { position: absolute; inset: 0; width: 100%; height: 100%; overflow: visible; }
.metrics__label { position: absolute; font-size: 12px; line-height: 16px; white-space: nowrap; color: var(--text-2); }
.metrics__label.is-sel { color: var(--lavender-strong); font-weight: 600; }
.metrics__tiles { list-style: none; margin: 8px 0 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.metrics__tiles li { min-width: 0; }
.metrics__tiles li.is-wide { grid-column: span 2; }
.metrics__tile {
  position: relative; box-sizing: border-box; width: 100%; min-height: 48px; padding: 0 14px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px; text-align: left;
  border-radius: 14px; background: rgba(238,232,222,.04); border: 1px solid rgba(238,232,222,.10);
}
.metrics__tile.is-sel { background: rgba(154,130,198,.16); border-color: rgba(183,163,220,.60); }
.metrics__tile:focus-visible { outline: 2px solid var(--lavender-text); outline-offset: 2px; }
.metrics__tile-name { min-width: 0; font-size: 14px; line-height: 20px; font-weight: 500; }
.metrics__tile.is-sel .metrics__tile-name { font-weight: 600; color: var(--lavender-strong); }
.metrics__tile-val, .metrics__detail-val { flex: none; font-family: var(--font-number); font-weight: 700; font-size: 17px; line-height: 20px; color: var(--lavender-strong); }
.metrics__tile.is-sel .metrics__tile-val { color: var(--lavender-on); }
.metrics__tile-val span, .metrics__detail-val span { font-weight: 600; font-size: 12px; color: var(--text-3); }
.metrics__detail { margin-top: 10px; padding: 14px 16px 16px; border-radius: 16px; background: rgba(154,130,198,.10); border: 1px solid rgba(154,130,198,.24); }
.metrics__detail-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.metrics__detail-name { min-width: 0; font-size: 15px; line-height: 22px; font-weight: 600; color: var(--lavender-strong); }
.metrics__detail-name span { margin-left: 8px; font-size: 12px; font-weight: 500; color: var(--text-3); }
.metrics__detail-val { line-height: 22px; }
.metrics__detail-desc { margin-top: 6px; font-size: 14px; line-height: 22px; color: var(--text-2); text-wrap: pretty; }
.metrics__scale { margin-top: 12px; display: flex; align-items: center; gap: 10px; }
.metrics__scale > span { flex: none; max-width: 84px; font-size: 12px; line-height: 16px; color: var(--text-3); }
.metrics__scale-hi { text-align: right; }
.metrics__pips { flex: 1; display: flex; align-items: center; justify-content: space-between; padding: 0 4px; }
.metrics__pips i { width: 10px; height: 10px; border-radius: 5px; background: rgba(238,232,222,.16); }
.metrics__pips i.is-on { background: var(--lavender-text); }

.stars { margin-top: 4px; display: flex; gap: 5px; filter: drop-shadow(0 0 6px rgba(178,156,224,.45)); }
/* 네 갈래 별 · 0.5점 단위 채움: --fill(0%/50%/100%)까지 --c 색, 나머지는 빈 별 색 */
.star {
  width: 24px; height: 24px;
  background: linear-gradient(90deg, var(--c) var(--fill, 0%), #46414F var(--fill, 0%));
  clip-path: polygon(100% 50%,98% 51%,92% 56%,83% 64%,73% 73%,64% 83%,56% 92%,51% 98%,50% 100%,49% 98%,44% 92%,36% 83%,27% 73%,17% 64%,8% 56%,2% 51%,0% 50%,2% 49%,8% 44%,17% 36%,27% 27%,36% 17%,44% 8%,49% 2%,50% 0%,51% 2%,56% 8%,64% 17%,73% 27%,83% 36%,92% 44%,98% 49%);
}

.interp { margin-top: 20px; padding: 24px 20px; border-radius: 24px; background: var(--s1); border: 1px solid var(--line-1); }
.eyebrow { font-size: 13px; line-height: 18px; color: var(--lavender-text); font-weight: 500; letter-spacing: .04em; }
.interp__headline { margin-top: 8px; font-size: 19px; line-height: 29px; font-weight: 600; letter-spacing: -.01em; text-wrap: pretty; }
.divider { height: 1px; margin: 20px 0; background: rgba(154,130,198,.16); }
.interp__details { display: flex; flex-direction: column; gap: 20px; }
.interp__head { font-size: 14px; line-height: 20px; font-weight: 600; color: var(--lavender-text); margin-bottom: 6px; }
.interp__body { font-size: 15px; line-height: 26px; color: var(--text-2); text-wrap: pretty; white-space: pre-line; } /* 해몽 문단 사이 빈 줄을 살린다 */

.refs { margin-top: 28px; }
.refs .section-head { align-items: baseline; }
.refs__count { font-size: 13px; color: var(--text-3); }
.refs .chip-row { margin-top: 12px; }
.accordion { margin-top: 14px; display: flex; flex-direction: column; gap: 8px; }
.acc { border-radius: 18px; background: var(--s1); border: 1px solid var(--line-1); overflow: hidden; }
.acc__btn {
  width: 100%; min-height: 56px; padding: 0 18px; display: flex; align-items: center; justify-content: space-between;
  gap: 12px; border: 0; background: transparent; color: var(--text-1); font-size: 15px; font-weight: 500; text-align: left;
}
.acc__btn .icon { stroke: var(--text-3); width: 20px; height: 20px; transition: transform .2s ease; }
.acc__btn[aria-expanded="true"] .icon { transform: rotate(180deg); }
.acc__panel { padding: 0 18px 16px; font-size: 14px; line-height: 22px; color: var(--text-2); white-space: pre-line; }

.r-actions { margin-top: 28px; }
.disclaimer { margin-top: 24px; text-align: center; font-size: 12px; line-height: 19px; color: var(--text-3); text-wrap: pretty; padding-bottom: 36px; }

.my-dream {
  display: flex; align-items: center; gap: 14px; min-height: 64px; padding: 12px 20px;
  border-radius: 18px; background: var(--s1); border: 1px solid var(--line-1);
}
.my-dream__label { font-size: 12px; line-height: 16px; color: var(--text-3); }
.my-dream__text { font-size: 15px; line-height: 22px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.my-dream.is-open .my-dream__text { white-space: normal; }
.my-dream button { all: unset; cursor: pointer; flex: 1; min-width: 0; }

/* ───────── 기록 ───────── */
.history-title { margin-top: 12px; font-size: 26px; line-height: 36px; font-weight: 600; letter-spacing: -.02em; }
.history-lead { margin-top: 4px; font-size: 14px; line-height: 22px; color: var(--text-2); }
.history-lead b { color: var(--lavender-strong); font-weight: 600; }
.filters { margin-top: 20px; display: flex; flex-direction: column; gap: 8px; }
.date-chip-input { position: absolute; opacity: 0; pointer-events: none; width: 1px; height: 1px; }
.chip__label-d { display: none; }

.history-groups { margin-top: 20px; display: flex; flex-direction: column; gap: 22px; }
.group-label { margin: 0 0 10px; font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-3); letter-spacing: .02em; }
.group-items { display: flex; flex-direction: column; gap: 10px; }
.h-row { display: flex; align-items: center; gap: 20px; }
.h-date { display: none; }
.h-item {
  flex: 1; min-width: 0; display: flex; align-items: center; gap: 14px; min-height: 76px;
  padding: 12px 16px 12px 12px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line-1);
  transition: background .15s ease;
}
.h-item:hover { background: var(--s2); }
.h-item.no-thumb { padding-left: 16px; }
.thumb { position: relative; flex: none; width: 64px; height: 64px; border-radius: 14px; overflow: hidden; background: var(--s2); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.h-item__body { flex: 1; min-width: 0; }
.h-item__title {
  font-size: 15px; line-height: 22px; font-weight: 500;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.h-item__sum { display: block; margin-top: 1px; font-size: 13px; line-height: 20px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.h-item__time { margin-top: 2px; font-size: 12px; line-height: 18px; color: var(--text-3); }
.h-item .chev { display: none; }

/* ───────── 설정 ───────── */
.settings-list { margin-top: 24px; display: flex; flex-direction: column; gap: 10px; }
.settings-item { padding: 18px 20px; }
.settings-item h2 { font-size: 15px; line-height: 22px; font-weight: 600; }
.settings-item p { margin-top: 4px; font-size: 13px; line-height: 20px; color: var(--text-3); }
.btn-danger {
  margin-top: 12px; height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid rgba(236,156,156,.30);
  background: rgba(236,156,156,.10); color: var(--error); font-size: 14px;
}

/* ───────── 토스트 ───────── */
.toast-region {
  position: fixed; left: 0; right: 0; z-index: 50; pointer-events: none;
  bottom: calc(var(--tabbar-h) + 16px + env(safe-area-inset-bottom));
  display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 var(--gutter);
}
body.no-tabbar .toast-region { bottom: calc(24px + env(safe-area-inset-bottom)); }
.toast {
  display: flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 16px; border-radius: 16px;
  font-size: 14px; backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  animation: rdToastIn .2s ease-out;
}
.toast--success { background: rgba(37,46,41,.94); border: 1px solid rgba(146,205,168,.30); color: var(--success); }
.toast--error { background: rgba(48,35,37,.94); border: 1px solid rgba(236,156,156,.30); color: var(--error); }
.toast .icon { width: 18px; height: 18px; stroke-width: 2; }

/* ───────── 애니메이션 ───────── */
@keyframes rdTwinkle { 0%,100% { opacity: .3; transform: scale(.75); } 50% { opacity: 1; transform: scale(1.15); } }
@keyframes rdBar { 0% { transform: translateX(-100%); } 100% { transform: translateX(250%); } }
@keyframes rdSpin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rdToastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ═════════ 태블릿 768–1023 ═════════ */
@media (min-width: 768px) {
  .page__inner { max-width: 640px; margin: 0 auto; }
  .home-chips .chip:nth-child(n+4) { display: inline-flex; }
  .group-items { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
}

/* ═════════ 데스크톱 ≥1024 ═════════ */
@media (min-width: 1024px) {
  .tabbar, .m-only { display: none !important; }
  .toast-region, body.no-tabbar .toast-region { bottom: 32px; left: var(--sidebar-w); }

  .app { display: flex; }
  .sidebar {
    position: sticky; top: 0; height: 100vh; flex: none; width: var(--sidebar-w);
    padding: 28px 16px 24px; display: flex; flex-direction: column;
    border-right: 1px solid rgba(154,130,198,.14); background: var(--s0);
  }
  .side-nav { margin-top: 36px; display: flex; flex-direction: column; gap: 6px; }
  .side-link {
    display: flex; align-items: center; gap: 12px; height: 48px; padding: 0 14px; border-radius: 14px;
    color: var(--text-2); font-size: 15px; transition: background .15s ease;
  }
  .side-link:hover { background: rgba(154,130,198,.08); }
  .side-link[aria-current="page"] { background: rgba(154,130,198,.16); color: var(--lavender-strong); font-weight: 600; }
  .side-spacer { flex: 1; min-height: 40px; }
  .side-account {
    display: flex; align-items: center; gap: 12px; min-height: 56px; padding: 8px 12px; border-radius: 16px;
    background: var(--s1); border: 1px solid var(--line-1); font-size: 14px;
  }
  .main-wrap { flex: 1; }
  .page { min-height: 100vh; }
  .page__inner, .page--tabbed .page__inner { max-width: 760px; padding: 72px 40px 64px; }

  /* 홈 */
  .home-title { margin-top: 0; font-size: 40px; line-height: 54px; letter-spacing: -.025em; }
  .home-title br { display: none; }
  .home-lead { font-size: 17px; line-height: 27px; }
  .home-lead br { display: none; }
  .dream-input { margin-top: 32px; height: 244px; border-radius: 24px; padding: 24px 24px 16px; box-shadow: 0 0 0 5px rgba(154,130,198,.06); }
  .dream-input textarea { font-size: 18px; line-height: 30px; }
  .home-row { margin-top: 20px; display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 16px 24px; }
  .home-chips { margin-top: 0; flex: 1 1 360px; min-width: 0; }
  .home-submit { margin-top: 0; flex: none; }
  .home-submit .btn-primary { width: 220px; }
  .home-caption { display: none; }
  .home-recents { margin-top: 56px; }
  .home-recents .section-head h2 { font-size: 18px; line-height: 26px; }
  .recent-list { margin-top: 4px; display: grid; grid-template-columns: repeat(auto-fit, minmax(min(200px, 100%), 1fr)); gap: 12px; }
  .recent-item { flex-direction: column; align-items: stretch; justify-content: space-between; gap: 16px; min-height: 136px; padding: 18px; border-radius: var(--r-card); }
  .recent-item__date { order: -1; margin: 0 0 4px; font-size: 12px; }
  .recent-item__title { font-size: 15px; line-height: 23px; font-weight: 500; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .recent-item__body { display: flex; flex-direction: column; }
  .recent-item .score-mini__num { font-size: 18px; }

  /* 결과 */
  .page--result .page__inner { max-width: 1180px; padding: 32px 40px 56px; }
  .result-head { display: block; }
  .back-link { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: var(--text-2); font-size: 14px; }
  .result-head h1 { margin-top: 4px; font-size: 32px; line-height: 44px; font-weight: 600; letter-spacing: -.02em; }
  .result-head__date { margin-top: 2px; font-size: 14px; line-height: 22px; color: var(--text-3); }
  .result-grid { margin-top: 28px; flex-direction: row; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
  .result-col { display: flex; flex-direction: column; min-width: 0; }
  .result-col--left { flex: 1 1 400px; max-width: 560px; }
  .result-col--right { flex: 999 1 440px; }
  .result-grid .r-dream { display: flex; }
  .image-placeholder h2 { font-size: 24px; line-height: 34px; }
  .image-placeholder p { font-size: 15px; line-height: 24px; }
  .image-placeholder .btn-primary { width: 260px; height: 60px; font-size: 17px; }
  .score-card { margin-top: 16px; padding: 20px 28px; border-radius: var(--r-strong); gap: 24px; }
  .score-card__num b { font-size: 68px; line-height: 72px; }
  .score-card__num span { font-size: 18px; }
  .score-card__comment { margin-top: 8px; font-size: 15px; line-height: 22px; }
  .stars { margin-top: 6px; gap: 6px; filter: drop-shadow(0 0 8px rgba(178,156,224,.45)); }
  .star { width: 30px; height: 30px; }
  .interp { margin-top: 16px; padding: 28px; }
  .interp__headline { font-size: 22px; line-height: 34px; letter-spacing: -.015em; }
  .divider { margin: 22px 0; }
  .interp__details { gap: 22px; }
  .interp__body { line-height: 27px; }
  .refs { margin-top: 32px; }
  .refs .section-head h2 { font-size: 18px; line-height: 26px; }
  .acc__btn { padding: 0 20px; }
  .acc__panel { padding: 0 20px 18px; line-height: 23px; }
  .disclaimer { margin-top: 32px; text-align: left; padding-bottom: 0; }
  .disclaimer br { display: none; }

  /* 기록 */
  .page--history .page__inner { max-width: 1040px; padding: 56px 40px; }
  .history-title { margin-top: 0; font-size: 32px; line-height: 44px; }
  .history-lead { margin-top: 2px; font-size: 15px; line-height: 24px; }
  .filters { margin-top: 28px; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 32px; }
  .chip--icon { width: auto; padding: 0 16px 0 14px; }
  .chip__label-d { display: inline; }
  .history-groups { margin-top: 28px; gap: 12px; }
  .group-label { display: none; }
  .group-items { display: flex; flex-direction: column; gap: 12px; }
  .h-date { display: block; flex: none; width: 64px; text-align: center; }
  .h-date__mon, .h-date__dow { font-size: 12px; line-height: 16px; color: var(--text-3); }
  .h-date__day { font-family: var(--font-number); font-weight: 700; font-size: 28px; line-height: 34px; }
  .h-row + .h-row .h-date { visibility: hidden; }
  .h-item { gap: 20px; min-height: 104px; padding: 12px 24px 12px 12px; border-radius: 24px; }
  .h-item.no-thumb { padding-left: 20px; }
  .thumb { width: 80px; height: 80px; border-radius: 16px; }
  .h-item__title { font-size: 16px; line-height: 24px; display: block; white-space: nowrap; text-overflow: ellipsis; }
  .h-item__sum { display: block; margin-top: 2px; font-size: 14px; line-height: 22px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .h-item .score-mini { gap: 6px; }
  .h-item .score-mini__num { font-size: 24px; }
  .h-item .chev { display: block; stroke: var(--text-3); width: 20px; height: 20px; }

  .page--settings .page__inner { padding-top: 56px; }
}

/* ───────── 2단계 시안 추가 컴포넌트 (언어 · 사전 · 게시판) ─────────
   app.css 뒤에 붙는다. 같은 토큰(tokens.css)만 쓴다. */

/* 하단 탭 5개: 라벨을 조금 줄인다 */
.tab { font-size: 11px; gap: 2px; }
.tab__pill { width: 52px; }

.page-title { margin-top: 12px; font-size: 26px; line-height: 36px; font-weight: 600; letter-spacing: -.02em; }
.page-lead { margin-top: 4px; font-size: 14px; line-height: 22px; color: var(--text-2); }
.page-lead b { color: var(--lavender-strong); font-weight: 600; font-family: var(--font-number); }

.btn-ghost {
  height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid var(--line-3);
  background: var(--s1); color: var(--text-1); font-size: 14px;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.btn-ghost .icon { stroke: var(--lavender-text); }
.btn-ghost--danger { border-color: rgba(236,156,156,.30); background: rgba(236,156,156,.08); color: var(--error); }
.btn-ghost--wide { width: 100%; }

/* 배지 */
.lang-badge {
  display: inline-flex; align-items: center; height: 20px; padding: 0 7px; border-radius: 6px;
  border: 1px solid var(--line-3); color: var(--lavender-chip);
  font-family: var(--font-number); font-weight: 700; font-size: 11px; letter-spacing: .06em;
}
.draft-badge {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 9px; border-radius: 11px;
  background: rgba(228,196,142,.12); border: 1px dashed rgba(228,196,142,.45); color: var(--warning);
  font-size: 12px; white-space: nowrap; vertical-align: middle;
}
.mine-badge {
  display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px;
  background: rgba(154,130,198,.18); color: var(--lavender-on); font-size: 12px;
}

/* ───────── 홈 · 게시판 공개 ───────── */
.publish-opt {
  margin-top: 12px; padding: 4px 16px 14px; border-radius: 18px;
  background: rgba(154,130,198,.08); border: 1px solid var(--line-2);
}
.switch-row { display: flex; align-items: center; gap: 12px; min-height: 48px; cursor: pointer; }
.switch-row__label { font-size: 15px; font-weight: 600; flex: 1; }
.switch-input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.switch {
  position: relative; flex: none; width: 46px; height: 28px; border-radius: 14px;
  background: var(--s3); border: 1px solid var(--line-2); transition: background .15s ease;
}
.switch::after {
  content: ''; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%;
  background: var(--text-2); transition: transform .15s ease, background .15s ease;
}
.switch-input:checked + .switch { background: var(--grad-fill); border-color: transparent; }
.switch-input:checked + .switch::after { transform: translateX(18px); background: var(--on-fill); }
.switch-input:focus-visible + .switch { outline: 2px solid var(--lavender-text); outline-offset: 2px; }
.publish-opt__note { display: flex; gap: 8px; font-size: 13px; line-height: 20px; color: var(--text-2); }
.publish-opt__note .icon { margin-top: 1px; stroke: var(--lavender-text); }
.publish-opt__note b { color: var(--text-1); font-weight: 600; }

/* ───────── 경로 (breadcrumb) ───────── */
.crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 4px; font-size: 13px; line-height: 20px; color: var(--text-3); }
.crumbs a { display: inline-flex; align-items: center; min-height: 32px; color: var(--lavender-text); }
.crumbs .sep { color: var(--text-disabled); }
.crumbs [aria-current] { color: var(--text-2); }

/* ───────── 사전 첫 화면 ───────── */
.dict-stats { margin-top: 16px; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.dict-stat { padding: 12px; border-radius: 16px; background: var(--s1); border: 1px solid var(--line-1); text-align: center; }
.dict-stat b { display: block; font-family: var(--font-number); font-size: 22px; line-height: 28px; font-weight: 700;
  background: var(--grad-text); -webkit-background-clip: text; background-clip: text; color: transparent; }
.dict-stat span { font-size: 12px; color: var(--text-3); }

.cat-jump { margin: 20px calc(var(--gutter) * -1) 0; padding: 0 var(--gutter); display: flex; flex-wrap: wrap; gap: 8px; }

.dict-cats { margin-top: 20px; display: flex; flex-direction: column; gap: 10px; }
.dict-cat { border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line-1); overflow: hidden; }
.dict-cat__head {
  width: 100%; min-height: 64px; padding: 12px 18px; border: 0; background: transparent; text-align: left;
  display: flex; align-items: center; gap: 12px;
}
.dict-cat__name { flex: 1; min-width: 0; font-size: 16px; line-height: 24px; font-weight: 600; }
.dict-cat__meta { font-size: 12px; color: var(--text-3); font-family: var(--font-number); white-space: nowrap; }
.dict-cat__head .icon { stroke: var(--text-3); width: 20px; height: 20px; }
.dict-cat__head[aria-expanded="true"] .icon { transform: rotate(180deg); }
.dict-cat__body { padding: 0 12px 14px; }

.topic-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.topic-link {
  display: flex; align-items: center; gap: 10px; min-height: 44px; padding: 0 8px 0 10px; border-radius: 12px;
  font-size: 15px; color: var(--text-1);
}
.topic-link:hover { background: var(--s2); }
.topic-link__name { flex: 1; min-width: 0; }
.topic-link__count { font-family: var(--font-number); font-size: 13px; color: var(--text-3); }
.topic-link .chev { stroke: var(--text-disabled); width: 18px; height: 18px; }
.topic-sub { list-style: none; margin: 0 0 4px 16px; padding: 0 0 0 10px; border-left: 1px solid var(--line-2); }
.topic-sub .topic-link { min-height: 40px; font-size: 14px; color: var(--text-2); }

/* ───────── 주제 화면 ───────── */
.topic-head { margin-top: 4px; }
.subtopics { margin-top: 16px; }
.subtopics .hint { margin-bottom: 8px; }
.entry-list { margin-top: 18px; display: flex; flex-direction: column; gap: 8px; }
.entry-row {
  display: flex; align-items: center; gap: 12px; min-height: 72px; padding: 12px 14px 12px 16px;
  border-radius: 18px; background: var(--s1); border: 1px solid var(--line-1);
}
.entry-row:hover { background: var(--s2); }
.entry-row__body { flex: 1; min-width: 0; }
.entry-row__title { font-size: 15px; line-height: 22px; font-weight: 500; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.entry-row__preview {
  margin-top: 2px; font-size: 13px; line-height: 20px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.entry-row .chev { stroke: var(--text-disabled); width: 18px; height: 18px; flex: none; }
.entry-row__mark { color: var(--warning); display: inline-flex; }
.entry-row__mark .icon { width: 16px; height: 16px; }
.list-foot { margin-top: 16px; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.list-foot__count { font-size: 12px; color: var(--text-3); font-family: var(--font-number); }

/* ───────── 항목 화면 ───────── */
.entry-article { margin-top: 12px; padding: 24px 20px; border-radius: 24px; background: var(--s1); border: 1px solid var(--line-1); }
.entry-article h1 { font-size: 22px; line-height: 32px; font-weight: 600; letter-spacing: -.015em; text-wrap: pretty; }
.entry-article__badges { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 6px; }
.entry-article__body { margin-top: 16px; font-size: 16px; line-height: 28px; color: var(--text-1); white-space: pre-line; text-wrap: pretty; }
.caveat {
  margin-top: 18px; display: flex; gap: 10px; padding: 14px 16px; border-radius: 16px;
  background: rgba(228,196,142,.10); border: 1px solid rgba(228,196,142,.35); color: var(--warning);
  font-size: 14px; line-height: 22px;
}
.caveat .icon { flex: none; margin-top: 2px; width: 18px; height: 18px; }
.caveat b { display: block; font-weight: 600; }
.caveat span { color: #EFD9B2; }
.entry-topics { margin-top: 24px; }
.entry-topics h2 { font-size: 13px; line-height: 18px; font-weight: 500; color: var(--text-3); letter-spacing: .02em; }
.entry-topics .chip-row { margin-top: 10px; }
.chip--link { color: var(--text-1); }
.chip--primary { border-color: var(--lavender-text); color: var(--lavender-on); }
.draft-note { margin-top: 14px; font-size: 12px; line-height: 19px; color: var(--text-3); }

/* ───────── 해몽 결과 · 참고 항목 링크 ───────── */
.tag--link { color: var(--lavender-on); }
.tag--link .icon { width: 14px; height: 14px; stroke: var(--lavender-text); }
.acc__link { margin-top: 10px; display: inline-flex; align-items: center; gap: 6px; min-height: 40px; color: var(--lavender-text); font-size: 14px; }

/* ───────── 게시판 목록 ───────── */
.board-bar { margin-top: 20px; display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.board-bar__note { font-size: 12px; color: var(--text-3); }
.post-list { margin-top: 16px; display: flex; flex-direction: column; gap: 10px; }
.post-card {
  display: flex; gap: 14px; padding: 12px; border-radius: var(--r-card);
  background: var(--s1); border: 1px solid var(--line-1);
}
.post-card:hover { background: var(--s2); }
.post-card__media { position: relative; flex: none; width: 88px; height: 88px; border-radius: 14px; overflow: hidden; background: var(--s2); }
.post-card__media img { width: 100%; height: 100%; object-fit: cover; }
.post-card__media--empty {
  display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 50% 40%, rgba(154,130,198,.22) 0%, rgba(154,130,198,0) 70%), var(--s2);
}
.post-card__body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.post-card__top { display: flex; align-items: center; gap: 8px; }
.post-card__title { flex: 1; min-width: 0; font-size: 15px; line-height: 22px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.post-card__dream {
  margin-top: 4px; font-size: 13px; line-height: 20px; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.post-card__interp { display: none; }
.post-card__meta { margin-top: auto; padding-top: 6px; display: flex; align-items: center; gap: 10px; font-size: 12px; color: var(--text-3); }
.post-card__meta .score-mini__num { font-size: 15px; }
.likes { display: inline-flex; align-items: center; gap: 4px; font-family: var(--font-number); }
.likes .icon { width: 14px; height: 14px; stroke: var(--dusty-pink); }
.likes.is-on .icon { fill: var(--dusty-pink); }
.dot { width: 3px; height: 3px; border-radius: 50%; background: var(--text-disabled); }

/* ───────── 게시글 상세 ───────── */
.post-meta { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-3); }
.like-btn {
  height: 52px; padding: 0 22px; border-radius: 26px; border: 1.5px solid rgba(201,168,184,.45);
  background: rgba(201,168,184,.08); color: var(--text-1); font-size: 15px; font-weight: 600;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
}
.like-btn .icon { stroke: var(--dusty-pink); }
.like-btn[aria-pressed="true"] { background: rgba(201,168,184,.20); border-color: var(--dusty-pink); }
.like-btn[aria-pressed="true"] .icon { fill: var(--dusty-pink); }
.like-btn__count { font-family: var(--font-number); color: var(--dusty-pink); }
.post-actions { margin-top: 16px; display: flex; gap: 10px; }
.post-actions .like-btn { flex: 1; }
.post-dream { margin-top: 20px; padding: 18px 20px; border-radius: 18px; background: var(--s1); border: 1px solid var(--line-1); }
.post-dream__label { font-size: 12px; line-height: 16px; color: var(--text-3); }
.post-dream__text { margin-top: 6px; font-size: 15px; line-height: 25px; color: var(--text-2); }
.orig-note { margin-top: 14px; display: flex; gap: 6px; font-size: 12px; line-height: 18px; color: var(--text-3); }
.orig-note .icon { width: 16px; height: 16px; flex: none; margin-top: 1px; }

/* ───────── 공개 상태 (결과 · 기록) ───────── */
.pub-card {
  margin-top: 16px; padding: 14px 16px; border-radius: 18px;
  background: rgba(154,130,198,.08); border: 1px solid var(--line-2);
}
.pub-card__text { display: flex; gap: 8px; font-size: 13px; line-height: 20px; color: var(--text-2); }
.pub-card__text .icon { stroke: var(--lavender-text); margin-top: 1px; }
.pub-card__actions { margin-top: 10px; display: flex; gap: 8px; flex-wrap: wrap; }
.h-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 6px; }
.h-pub { display: flex; align-items: center; gap: 4px; padding-left: 12px; font-size: 12px; color: var(--text-3); flex-wrap: wrap; }
.h-pub__state { display: inline-flex; align-items: center; gap: 6px; margin-right: auto; color: var(--lavender-text); }
.h-pub__state .icon { width: 16px; height: 16px; }
.h-pub a, .h-pub button {
  min-height: 44px; padding: 0 12px; border: 0; background: none; font-size: 13px;
  display: inline-flex; align-items: center; color: var(--text-2);
}
.h-pub .danger { color: var(--error); }

/* ───────── 설정 · 언어 ───────── */
.lang-options { margin-top: 12px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.lang-option {
  position: relative; display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 64px;
  padding: 10px 14px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--s2); cursor: pointer;
}
.lang-option input { position: absolute; opacity: 0; }
.lang-option b { font-size: 15px; font-weight: 600; }
.lang-option span { font-size: 12px; color: var(--text-3); font-family: var(--font-slogan); }
.lang-option.is-on { border-color: var(--lavender-text); background: rgba(154,130,198,.16); }
.lang-option.is-on::after {
  content: ''; position: absolute; top: 12px; right: 12px; width: 18px; height: 18px; border-radius: 50%;
  background: var(--grad-fill);
}

/* ───────── 설정 › 앱 설치 방법 ───────── */
.settings-link { display: flex; align-items: center; justify-content: space-between; gap: 12px; color: inherit; }
.settings-link .icon { flex: none; stroke: var(--lavender-text); }
.settings-link:hover { background: var(--s2); }
.install-back { display: none; }
.install-cta { margin-top: 20px; padding: 18px 20px; }
.install-cta h2 { display: flex; align-items: center; gap: 8px; font-size: 15px; line-height: 22px; font-weight: 600; }
.install-cta h2 .icon { stroke: var(--success); }
.install-cta p { margin-top: 4px; font-size: 13px; line-height: 20px; color: var(--text-3); }
.install-cta .btn-primary { margin-top: 14px; width: 100%; }
.install-tabs { margin-top: 24px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.install-tabs button {
  min-height: 48px; border-radius: 16px; border: 1px solid var(--line-2); background: var(--s2);
  color: var(--text-2); font-size: 15px; font-weight: 600;
}
.install-tabs button.is-on { border-color: var(--lavender-text); background: rgba(154,130,198,.16); color: var(--lavender-strong); }
.install-note { margin-top: 12px; font-size: 13px; line-height: 20px; color: var(--text-3); }
.install-steps { margin-top: 16px; display: flex; flex-direction: column; gap: 12px; list-style: none; padding: 0; }
.install-step { display: flex; align-items: center; gap: 16px; padding: 14px 16px; background: var(--s1); border: 1px solid var(--line-1); border-radius: var(--r-card); }
.install-step__art { flex: none; width: 96px; margin: 0; }
.install-step__art .step-art { display: block; width: 100%; height: auto; }
.install-step__text { min-width: 0; }
.install-step__n {
  display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; margin-bottom: 6px;
  border-radius: 50%; background: var(--grad-fill); color: var(--on-fill); font: 700 13px var(--font-number);
}
.install-step h3 { font-size: 15px; line-height: 22px; font-weight: 600; }
.install-step p { margin-top: 2px; font-size: 13px; line-height: 20px; color: var(--text-2); }
.install-foot { margin-top: 20px; font-size: 12px; line-height: 18px; color: var(--text-3); }
@media (min-width: 1024px) {
  .install-back { display: inline-flex; }
  .install-step__art { width: 120px; }
}

/* ═════════ 데스크톱 ≥1024 ═════════ */
@media (min-width: 1024px) {
  .tab { font-size: 12px; }
  .page-title { margin-top: 0; font-size: 32px; line-height: 44px; }
  .page-lead { margin-top: 2px; font-size: 15px; line-height: 24px; }
  .page--dict .page__inner, .page--board .page__inner, .page--topic .page__inner { max-width: 1120px; padding: 56px 40px; }
  .page--entry .page__inner { max-width: 760px; padding: 48px 40px; }
  .dict-stats { max-width: 520px; }
  .dict-cats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
  .cat-jump { margin: 24px 0 0; padding: 0; }
  .topic-layout { margin-top: 28px; display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 40px; align-items: start; }
  .topic-side { position: sticky; top: 24px; padding: 18px; border-radius: var(--r-card); background: var(--s1); border: 1px solid var(--line-1); }
  .topic-side h2 { font-size: 13px; color: var(--text-3); font-weight: 500; margin-bottom: 8px; }
  .entry-list { margin-top: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .entry-row { align-items: flex-start; min-height: 96px; }
  .entry-article { padding: 36px 40px; border-radius: var(--r-strong); }
  .entry-article h1 { font-size: 28px; line-height: 40px; }
  .entry-article__body { font-size: 17px; line-height: 30px; }

  .post-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
  .post-card { flex-direction: column; padding: 0; overflow: hidden; border-radius: 24px; }
  .post-card__media { width: 100%; height: auto; aspect-ratio: 1 / 1; border-radius: 0; }
  .post-card__body { padding: 14px 18px 18px; }
  .post-card__title { font-size: 16px; }
  .post-card__interp {
    display: -webkit-box; margin-top: 8px; font-size: 13px; line-height: 20px; color: var(--text-3);
    -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  }
  .post-card__meta { padding-top: 12px; }
}

/* ───────── 구현 보완 ───────── */
.topic-side { display: none; }
.topic-layout.no-side { display: block; }
.board-more { margin-top: 20px; display: flex; justify-content: center; }
.state-note { margin-top: 28px; text-align: center; color: var(--text-2); font-size: 14px; line-height: 22px; }
.entry-nav { margin-top: 28px; }
.entry-nav__pos { font-size: 12px; line-height: 18px; color: var(--text-3); font-family: var(--font-number); }
.entry-nav__grid { margin-top: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.entry-nav__card {
  display: flex; flex-direction: column; gap: 6px; min-height: 88px; padding: 14px 16px; box-sizing: border-box;
  border-radius: 18px; background: var(--s1); border: 1px solid var(--line-1); min-width: 0;
}
.entry-nav__card--next { text-align: right; }
.entry-nav__dir { display: flex; align-items: center; gap: 4px; font-size: 12px; line-height: 16px; color: var(--lavender-text); }
.entry-nav__card--next .entry-nav__dir { justify-content: flex-end; }
.entry-nav__dir .icon { width: 16px; height: 16px; }
.entry-nav__title {
  font-size: 14px; line-height: 21px; color: var(--text-1);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.entry-note { margin: 32px 0 0; font-size: 12px; line-height: 19px; color: var(--text-3); text-wrap: pretty; }
.score-mini .sparkle { flex: none; }
@media (min-width: 1024px) {
  .subtopics { display: none; }
  .topic-layout.no-side + .subtopics { display: none; }
}
/* 게시판 공개 상태 카드는 화면 크기와 상관없이 맨 아래 (면책 문구 다음) */
.result-grid .pub-card { order: 8; }
/* 게시글: 꿈 내용 → 해몽 → 참고 항목 순서 (모바일 단일 열) */
.page--post .result-grid .r-interp { order: 6; }
.page--post .result-grid .r-refs { order: 7; }

/* ───────── 사이트 하단 링크 (소개 · 개인정보처리방침) ───────── */
.site-foot { display: flex; flex-wrap: wrap; gap: 6px 18px; justify-content: center; padding: 8px var(--gutter) calc(var(--tabbar-h) + 28px + env(safe-area-inset-bottom)); font-size: 12px; color: var(--text-3); }
.site-foot a { color: var(--text-3); text-decoration: underline; text-underline-offset: 3px; }
.site-foot a:hover { color: var(--text-2); }
body.no-tabbar .site-foot { padding-bottom: 28px; }
@media (min-width: 1024px) { .site-foot { padding-bottom: 28px; } }

/* ───────── 광고 칸 (js/ads.js) ─────────
   콘텐츠가 모두 끝난 자리에만 둔다. 앞 요소(공개 설정 버튼 등)에서 48px 이상 띄워 실수 클릭을 막는다.
   칸 높이는 미리 잡아 두어 광고가 늦게 떠도 화면이 밀리지 않게 한다. */
.ad { margin: 48px 0 0; }
.ad__label { display: block; margin-bottom: 6px; font-size: 12px; line-height: 16px; color: var(--text-3); }
.ad__box { min-height: 280px; overflow: hidden; border-radius: 16px; }
.ad--C { margin: 12px 0; }
.ad--C .ad__box { min-height: 96px; }
@media (min-width: 1024px) { .ad--A .ad__box, .ad--B .ad__box { min-height: 120px; } }

/* 오른쪽 세로 배너(E): 사전 항목 본문 오른쪽 바깥에 두고 스크롤을 따라오되 본문을 가리지 않는다. 너비가 모자라면 아예 없다. */
.ad-rail { display: none; }
@media (min-width: 1360px) {
  .page--entry .ad-rail { display: block; position: absolute; top: 48px; bottom: 0; left: calc(100% - 16px); width: 160px; }
  .ad-rail .ad { position: sticky; top: 24px; margin: 0; }
  .ad-rail .ad__box { min-height: 600px; }
}
@media (min-width: 1620px) { .page--entry .ad-rail { width: 300px; } }

/* ───────── 계정 · 로그인 ───────── */
.btn-google {
  height: 44px; padding: 0 18px; border-radius: 22px; border: 1px solid #8E918F; background: #131314; color: #E3E3E3;
  font-size: 14px; font-weight: 500; display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  transition: background .15s ease;
}
.btn-google:hover { background: #1F1F20; }
.acct .btn-google { margin-top: 14px; }
.acct-row { margin-top: 12px; display: flex; align-items: center; gap: 12px; min-width: 0; }
.acct-email { min-width: 0; font-size: 14px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acct-actions { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.side-account span:last-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.login-banner { margin-top: 16px; padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; border-color: var(--line-3); }
.login-banner__text { display: flex; flex-direction: column; gap: 2px; font-size: 13px; line-height: 20px; color: var(--text-2); }
.login-banner__text b { font-size: 14px; font-weight: 600; color: var(--text-1); }
.login-banner__row { display: flex; align-items: center; gap: 8px; }
.login-banner__x {
  margin-left: auto; width: 44px; height: 44px; flex: none; border: 0; border-radius: 22px; background: none; color: var(--text-3);
  display: inline-flex; align-items: center; justify-content: center;
}
.login-banner__x .icon { width: 18px; height: 18px; }
.login-banner__x:hover { background: var(--s2); }

/* 가운데 안내 창 (인앱 브라우저 안내) */
body.is-dialog-open { overflow: hidden; }
.dialog { position: fixed; inset: 0; z-index: 45; display: flex; align-items: center; justify-content: center; padding: 20px; animation: rdFadeIn .18s ease-out; }
.dialog__backdrop { position: absolute; inset: 0; border: 0; background: rgba(12,11,14,.78); }
.dialog__card {
  position: relative; width: min(100%, 400px); max-height: calc(100vh - 40px); overflow: auto; padding: 22px 20px 12px;
  border-radius: var(--r-card); background: var(--s2); border: 1px solid var(--line-3);
}
.dialog__card h2 { font-size: 17px; line-height: 26px; font-weight: 600; }
.dialog__card p { margin-top: 8px; font-size: 14px; line-height: 22px; color: var(--text-2); }
.dialog__note { padding: 10px 12px; border-radius: 12px; background: rgba(154,130,198,.10); }
.dialog__actions { margin-top: 16px; display: flex; flex-direction: column; gap: 8px; }
.dialog__actions .btn-primary { height: 48px; font-size: 15px; }
.dialog__actions .btn-ghost { height: 46px; }
.dialog__link { display: block; width: 100%; min-height: 44px; margin-top: 4px; border: 0; background: none; color: var(--text-3); font-size: 13px; }
.dialog__link[data-try] { text-decoration: underline; }
.settings-item .acct-sync { color: var(--lavender-text); }
.settings-item .acct-sync--error { color: var(--error); }
