/* 밤월 bamwol.com — 브랜드 토큰은 BRAND.md 와 같은 값. 화면은 '밤(어두운 바탕)'과 '달빛 종이(밝은 대화면)' 두 구역. */
:root {
  /* ---- 원색 팔레트 ---- */
  --night-950: #0a0d1c;
  --night-900: #0e1226;
  --night-800: #171c38;
  --night-700: #262d52;
  --night-600: #3a4270;
  --moon-200: #f6e3b4;
  --moon-400: #e9c77b;
  --moon-600: #c99a45;
  --moon-700: #8a6420;
  --moon-tint: #f6ebd3;
  --moon-tint-line: #e2cb98;
  --paper: #f7f2e8;
  --paper-card: #fffdf8;
  --paper-2: #efe7d8;
  --paper-line: #e3d8c4;
  --ink-900: #1b1a2b;
  --ink-700: #4a4558;
  --ink-500: #6b6577;
  --on-night: #f4eee2;
  --on-night-2: #c9c3d6;
  --on-night-mute: #9c97b2;
  --rose-300: #f08ca0;
  --rose-700: #a3324a;
  --sky-300: #9fb4ff;
  --green-300: #5fd39b;
  --red-600: #b3261e;
  --red-300: #ff8a80;
  --cheong-50: #e4eef3;
  --cheong-300: #8eb4c6;
  --hong-50: #f6e6ea;
  --hong-300: #d99aaa;

  /* ---- 구역별 의미 토큰 (기본 = 밤 구역) ---- */
  --bg: var(--night-900);
  --page: var(--night-950);
  --surface: var(--night-800);
  --surface-2: var(--night-700);
  --ink: var(--on-night);
  --ink-2: var(--on-night-2);
  --mute: var(--on-night-mute);
  --line: rgba(244, 238, 226, 0.1);
  --line-strong: rgba(244, 238, 226, 0.18);
  --accent: var(--moon-400);
  --accent-tint: rgba(233, 199, 123, 0.14);
  --accent-line: rgba(233, 199, 123, 0.45);
  --on-accent: var(--night-900);
  --danger: var(--red-300);
  --grad: linear-gradient(
    135deg,
    var(--moon-200) 0%,
    var(--moon-400) 55%,
    var(--moon-600) 100%
  );
  --pink: var(--accent);
  --orange: var(--moon-600);
  --like: var(--moon-400);
  --nope: var(--rose-300);
  --rewind: var(--sky-300);
  --online: var(--green-300);
  --bubble: var(--paper-card);
  --bubble-text: var(--ink-900);
  --user: var(--night-700);
  --user-text: var(--on-night);
  --cheong: var(--cheong-50);
  --cheong-line: var(--cheong-300);
  --hong: var(--hong-50);
  --hong-line: var(--hong-300);

  /* ---- 글꼴 · 글자 크기 (BRAND v2: 본문 16px, 최소 12px) ---- */
  --font:
    "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo",
    "Pretendard", "Noto Sans CJK KR", "Malgun Gothic", "맑은 고딕", "Segoe UI",
    sans-serif;
  --font-display:
    "Noto Serif KR", "Noto Serif CJK KR", "AppleMyungjo", "Nanum Myeongjo",
    serif;
  --fs-label: 12px;
  --fs-caption: 13px;
  --fs-small: 14px;
  --fs-body: 16px;
  --fs-lead: 18px;
  --fs-h3: 18px;
  --fs-h2: 22px;
  --fs-h1: 28px;
  --fs-display: 36px;
  --lh-tight: 1.25;
  --lh-body: 1.6;
  --track-display: -0.01em;
  --track-body: 0;

  /* ---- 간격 (4px 단위) ---- */
  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-5: 20px;
  --space-6: 24px;
  --space-8: 32px;
  --space-10: 40px;

  /* ---- 모서리 · 그림자 ---- */
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius: 18px;
  --radius-xl: 24px;
  --radius-pill: 999px;
  --shadow-1: 0 2px 8px rgba(5, 7, 20, 0.16);
  --shadow: 0 12px 32px rgba(5, 7, 20, 0.36);
}

/* 달빛 종이 구역: 대화 본문·입력·시트. 같은 변수 이름을 밝은 값으로 다시 묶는다. */
.thread,
.composer,
.sheet,
.chat-widget,
.toast-paper {
  --surface: var(--paper-card);
  --surface-2: var(--paper-2);
  --ink: var(--ink-900);
  --ink-2: var(--ink-700);
  --mute: var(--ink-500);
  --line: var(--paper-line);
  --line-strong: var(--paper-line);
  --accent: var(--moon-700);
  --accent-tint: var(--moon-tint);
  --accent-line: var(--moon-tint-line);
  --danger: var(--red-600);
  color: var(--ink);
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}
html,
body {
  height: 100%;
}
html {
  background: var(--page);
}
body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--page);
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}
button,
select,
input {
  font-family: inherit;
  color: inherit;
}
button {
  cursor: pointer;
  border: 0;
  background: none;
}
img {
  display: block;
  max-width: 100%;
}
.hidden,
[hidden] {
  display: none !important;
}

.stage {
  min-height: 100%;
  height: 100%;
  display: grid;
  place-items: center;
}

.device {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 420px;
  max-height: 100%;
  background: var(--bg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

@media (min-width: 480px) {
  body {
    padding: 28px 16px;
    background: radial-gradient(
      120% 80% at 70% 0%,
      #1b2147 0%,
      var(--page) 60%
    );
  }
  .stage {
    height: 100%;
  }
  .device {
    width: 390px;
    height: min(844px, calc(100dvh - 56px));
    max-width: 420px;
    max-height: min(844px, calc(100dvh - 56px));
    border-radius: 40px;
    box-shadow:
      0 0 0 10px #05060e,
      0 0 0 11px var(--night-600);
  }
  .device::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 92px;
    height: 8px;
    border-radius: 8px;
    background: #05060e;
    z-index: 50;
    pointer-events: none;
  }
}

.screen {
  position: absolute;
  inset: 0 0 64px 0;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  min-height: 0;
}
.screen.chat {
  inset: 0;
}
.screen.hidden {
  display: none;
}
/* display:none이 풀릴 때마다 다시 재생 → 새로 보이는 화면만 페이드인 */
#app > .screen {
  animation: fadein 0.18s cubic-bezier(0.2, 0, 0, 1);
}

.disclaimer {
  font-size: var(--fs-caption);
  color: var(--mute);
  text-align: center;
  line-height: 1.45;
  padding: 2px 18px 8px;
  flex-shrink: 0;
}

/* ===== Top wordmark ===== */
.app-top {
  flex-shrink: 0;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px 0;
  position: relative;
  z-index: 3;
}
.wordmark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--on-night);
}
.wordmark.tight {
  font-size: var(--fs-h3);
  color: var(--ink);
}
.mark-moon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
}

/* ===== Deck ===== */
.deck-wrap {
  flex: 1;
  position: relative;
  min-height: 0;
  margin: 4px 12px 0;
}
.deck-stage {
  position: absolute;
  inset: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}
.card {
  position: absolute;
  inset: 0;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--night-800);
  outline: 1px solid var(--line-strong);
  outline-offset: -1px;
  will-change: transform;
  transition:
    transform 0.38s cubic-bezier(0.2, 0, 0, 1),
    opacity 0.3s ease;
}
.card.is-back {
  pointer-events: none;
}
.card.is-dragging {
  transition: none;
}
.card.is-fly-right {
  transition:
    transform 0.32s ease-in,
    opacity 0.32s ease-in;
  opacity: 0;
}
.card.is-fly-left {
  transition:
    transform 0.32s ease-in,
    opacity 0.32s ease-in;
  opacity: 0;
}
/* 끝 값은 인라인 transform(scale 0.92)·opacity 1을 그대로 쓴다. fill forwards 없음: 드래그 중 인라인 변경을 막지 않게 */
.card.is-entering {
  animation: card-enter 0.2s cubic-bezier(0.2, 0, 0, 1) backwards;
}
@keyframes card-enter {
  from {
    transform: scale(0.88) translateY(18px);
    opacity: 0;
  }
}
/* 되돌리기: fly 끝 위치에서 제자리(인라인 transform 없음)로 */
.card.is-return-right {
  animation: card-return-right 0.3s cubic-bezier(0.2, 0, 0, 1);
}
.card.is-return-left {
  animation: card-return-left 0.3s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes card-return-right {
  from {
    transform: translate(640px, -40px) rotate(28deg);
    opacity: 0;
  }
}
@keyframes card-return-left {
  from {
    transform: translate(-640px, -40px) rotate(-28deg);
    opacity: 0;
  }
}

.card-photo {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: var(--night-800);
}
.card-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 20%;
  pointer-events: none;
  -webkit-user-drag: none;
  user-drag: none;
  transition: opacity 0.16s ease;
}
.card-photo img.is-switching {
  opacity: 0;
}

.segments {
  position: absolute;
  top: 8px;
  left: 10px;
  right: 10px;
  z-index: 4;
  display: flex;
  gap: 4px;
  pointer-events: none;
}
.segments span {
  flex: 1;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.38);
}
.segments span.on {
  background: #fff;
}

.badge-19 {
  position: absolute;
  top: 18px;
  right: 12px;
  z-index: 4;
  font-size: var(--fs-label);
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(20, 12, 14, 0.72);
  color: #ffb4b4;
  border: 1px solid rgba(255, 180, 180, 0.4);
  pointer-events: none;
}

.stamp {
  position: absolute;
  top: 40px;
  z-index: 5;
  padding: 4px 10px;
  border: 4px solid;
  border-radius: 10px;
  font-weight: 800;
  font-size: 28px;
  letter-spacing: var(--track-display);
  opacity: 0;
  pointer-events: none;
  line-height: 1.2;
}
.stamp-like {
  left: 16px;
  color: var(--like);
  border-color: var(--like);
  transform: rotate(-22deg);
}
.stamp-nope {
  right: 16px;
  color: var(--nope);
  border-color: var(--nope);
  transform: rotate(22deg);
}

.card-shade {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58%;
  background: linear-gradient(
    to top,
    rgba(10, 13, 28, 0.92) 0%,
    rgba(10, 13, 28, 0.5) 50%,
    transparent 100%
  );
  pointer-events: none;
  z-index: 2;
}

.card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  padding: 18px 16px 16px;
  color: #fff;
  pointer-events: none;
}
.name-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
}
.card-name {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  font-weight: 700;
  letter-spacing: var(--track-display);
  line-height: 1.1;
  text-shadow: 0 1px 8px rgba(0, 0, 0, 0.35);
}
.card-age {
  font-size: 22px;
  font-weight: 500;
  opacity: 0.95;
}
.profile-hint {
  position: absolute;
  right: 14px;
  bottom: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  color: rgba(255, 255, 255, 0.88);
  font-size: var(--fs-label);
  font-weight: 600;
  line-height: 1.2;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.5);
  pointer-events: none;
}
.profile-hint svg {
  width: 14px;
  height: 14px;
}
.one-liner {
  margin-top: 6px;
  font-size: 14px;
  line-height: 1.4;
  color: rgba(255, 255, 255, 0.92);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.photo-caption {
  margin-top: 6px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.88);
  text-shadow: 0 1px 6px rgba(0, 0, 0, 0.45);
}
.btn-primary[hidden],
.photo-caption[hidden] {
  display: none;
}
.specialty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 10px;
  max-width: 100%;
  padding-right: 76px;
}
.specialty .tag {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  line-height: 1.3;
  padding: 7px 13px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.42);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.28);
}
.specialty .tag.tag-19 {
  background: var(--rose-700);
  border-color: rgba(240, 140, 160, 0.6);
  color: #ffe3e3;
}
.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}
.tag {
  font-size: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
  color: #fff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.sheet .tag {
  background: var(--accent-tint);
  border-color: var(--accent-line);
  color: var(--accent);
  backdrop-filter: none;
}

.tap-zone {
  position: absolute;
  top: 0;
  bottom: 30%;
  z-index: 4;
}
.tap-left {
  left: 0;
  width: 40%;
}
.tap-right {
  right: 0;
  width: 60%;
}
.tap-info {
  top: auto;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  width: auto;
}

/* empty */
.empty-deck {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 24px;
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px dashed var(--line-strong);
}
.empty-deck h2 {
  font-size: 18px;
  margin: 12px 0 8px;
}
.empty-deck p {
  font-size: var(--fs-small);
  color: var(--mute);
  line-height: var(--lh-body);
  margin-bottom: 18px;
}
.empty-moon {
  width: 64px;
  height: 64px;
}

/* ===== Action buttons ===== */
.action-bar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 28px;
  padding: 10px 12px 4px;
  min-height: 94px;
}
.act {
  width: 54px;
  height: 54px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  transition:
    transform 0.15s ease,
    box-shadow 0.15s ease,
    opacity 0.2s;
}
.act svg {
  width: 24px;
  height: 24px;
}
.act:active {
  transform: scale(0.9);
}
.act:disabled {
  opacity: 0.35;
  pointer-events: none;
}
.act.like {
  width: 72px;
  height: 72px;
  box-shadow: inset 0 0 0 1px var(--accent-line);
}
.act.like svg {
  width: 32px;
  height: 32px;
}
.act.rewind {
  color: var(--rewind);
}
.act.nope {
  color: var(--nope);
}
.act.like {
  color: var(--like);
}

/* ===== Tab bar ===== */
.tabbar {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-around;
  padding: 0 8px env(safe-area-inset-bottom, 0);
  background: var(--night-950);
  border-top: 1px solid var(--line);
  z-index: 8;
}
.tabbar.is-hidden {
  display: none;
}
.tab {
  width: 56px;
  height: 48px;
  display: grid;
  place-items: center;
  color: #8d88a6;
  position: relative;
}
.tab svg {
  width: 28px;
  height: 28px;
}
.tab.on {
  color: var(--accent);
}
.tab .badge {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--pink);
  box-shadow: 0 0 0 2px var(--night-950);
}

/* ===== Pages: explore / matches / profile ===== */
.page-body {
  flex: 1;
  overflow-y: auto;
  padding: 8px 18px 12px;
  min-height: 0;
}
.page-lead {
  font-size: var(--fs-small);
  color: var(--ink-2);
  line-height: var(--lh-body);
  margin-bottom: 14px;
}
.explore-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}
.explore-tags .chip {
  background: var(--surface);
  border-color: var(--line-strong);
  color: var(--ink);
}
.explore-tags .chip.on {
  background: var(--grad);
  color: var(--on-accent);
  border: 0;
  font-weight: 700;
}
.explore-tags .chip-in {
  animation: chip-in 0.18s cubic-bezier(0.2, 0, 0, 1) both;
}
@keyframes chip-in {
  from {
    opacity: 0;
    transform: translateY(5px);
  }
}
.explore-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
.ex-card {
  border-radius: 14px;
  overflow: hidden;
  background: var(--night-800);
  position: relative;
  height: 168px;
  outline: 1px solid var(--line-strong);
  outline-offset: -1px;
  text-align: left;
  color: #fff;
}
.ex-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.ex-card .cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 24px 10px 10px;
  background: linear-gradient(to top, rgba(10, 13, 28, 0.85), transparent);
}
.ex-card .cap b {
  font-size: 15px;
  display: block;
}
.ex-card .cap span {
  font-size: 12px;
  font-weight: 600;
  opacity: 0.92;
}

/* matches */
.new-row-label,
.msg-row-label {
  font-size: 14px;
  font-weight: 800;
  margin: 6px 0 10px;
}
.new-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 14px;
  -webkit-overflow-scrolling: touch;
}
.new-row::-webkit-scrollbar {
  height: 0;
}
.new-match {
  flex: 0 0 auto;
  width: 72px;
  text-align: center;
  background: none;
}
.new-match .av {
  width: 68px;
  height: 68px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid transparent;
  background:
    linear-gradient(var(--surface), var(--surface)) padding-box,
    var(--grad) border-box;
  border: 2px solid transparent;
  margin: 0 auto 6px;
}
.new-match .av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: var(--face, scale(1.7));
}
.new-match .nm {
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 10px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
}
.conv .av {
  width: 58px;
  height: 58px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
}
.conv .av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: var(--face, scale(1.7));
}
.conv .meta {
  flex: 1;
  min-width: 0;
}
.conv .nm {
  font-weight: 700;
  font-size: 15px;
}
.conv .prev {
  margin-top: 3px;
  font-size: 13px;
  color: var(--mute);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.conv.unread .prev {
  color: var(--ink);
  font-weight: 600;
}
.unread-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--pink);
  flex-shrink: 0;
}
.matches-empty {
  text-align: center;
  color: var(--mute);
  padding: 48px 12px;
  font-size: 14px;
  line-height: 1.6;
}

/* 아바타 초점·확대는 app.js FACES가 img 인라인 스타일(--face)로 준다 */
.chat-avatar,
.mini-av {
  overflow: hidden;
}
.chat-avatar img,
.mini-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: var(--face, scale(1.7));
}

/* profile */
.profile-body {
  align-items: center;
  display: flex;
  flex-direction: column;
  text-align: center;
}
.me-avatar {
  width: 108px;
  height: 108px;
  border-radius: 50%;
  overflow: hidden;
  margin: 8px 0 12px;
  outline: 1px solid var(--line-strong);
  outline-offset: -1px;
}
.me-avatar svg {
  width: 100%;
  height: 100%;
}
.me-name {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  margin-bottom: 8px;
}
.profile-list {
  width: 100%;
  list-style: none;
  margin-top: 8px;
  border-top: 1px solid var(--line);
  text-align: left;
}
.profile-list li {
  display: flex;
  justify-content: space-between;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 15px;
}
.muted {
  color: var(--mute);
  font-size: 13px;
}

/* ===== Chat ===== */
#screen-chat {
  background: var(--paper);
}
.chat-top {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 8px 10px;
  border-bottom: 1px solid var(--line);
  background: var(--night-900);
}
.icon-btn {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: var(--ink);
}
.icon-btn:active {
  background: var(--surface-2);
}
.icon-btn.ghost {
  color: var(--mute);
}
.chat-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
}
.chat-who {
  flex: 1;
  min-width: 0;
}
.chat-who .nm {
  font-size: 15px;
  font-weight: 800;
}
.chat-who .st {
  margin-top: 1px;
  font-size: var(--fs-label);
  color: var(--online);
  display: flex;
  align-items: center;
  gap: 5px;
}
.chat-who .st i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--online);
  display: inline-block;
}

.thread {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: var(--paper);
  min-height: 0;
}
.thread::-webkit-scrollbar {
  width: 0;
}

.row {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 86%;
  animation: pop 0.28s ease;
}
@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}
.row.me {
  align-self: flex-end;
  flex-direction: row-reverse;
}
.mini-av {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--surface-2);
}
.bubble-wrap {
  display: flex;
  flex-direction: column;
  gap: 3px;
  max-width: 100%;
}
.spk {
  font-size: var(--fs-label);
  color: var(--mute);
  padding-left: 4px;
}
.bubble {
  border-radius: 18px 18px 18px 6px;
  padding: 9px 12px;
  background: var(--bubble);
  color: var(--bubble-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  letter-spacing: var(--track-body);
  white-space: pre-wrap;
  word-break: keep-all;
  overflow-wrap: anywhere;
  box-shadow: 0 1px 0 var(--paper-line);
}
.row.me .bubble {
  border-radius: 18px 18px 6px 18px;
  background: var(--user);
  color: var(--user-text);
  font-weight: 500;
  box-shadow: none;
}
.bubble.cheong {
  background: var(--cheong);
  border: 1px solid var(--cheong-line);
}
.bubble.hong {
  background: var(--hong);
  border: 1px solid var(--hong-line);
}
.bubble.lock {
  border: 1px solid var(--moon-tint-line);
  background: linear-gradient(180deg, var(--moon-tint), var(--paper-card));
}

.typing {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  max-width: 70%;
}
.typing .dots3 {
  background: var(--bubble);
  border-radius: 16px 16px 16px 6px;
  padding: 10px 14px;
  display: flex;
  gap: 5px;
  align-items: center;
  min-height: 36px;
}
.typing .dots3 span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--ink-500);
  animation: typ 1.1s ease-in-out infinite;
}
.typing .dots3 span:nth-child(2) {
  animation-delay: 0.15s;
}
.typing .dots3 span:nth-child(3) {
  animation-delay: 0.3s;
}
@keyframes typ {
  0%,
  80%,
  100% {
    opacity: 0.25;
    transform: translateY(0);
  }
  40% {
    opacity: 1;
    transform: translateY(-3px);
  }
}
/* 스크린리더 전용 새 메시지 알림 영역 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.composer {
  flex-shrink: 0;
  padding: 8px 12px 6px;
  border-top: 1px solid var(--line);
  background: var(--paper-card);
  min-height: 58px;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.chip {
  padding: 9px 13px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--ink);
  font-size: 14px;
  line-height: 1.35;
  min-height: 40px;
  word-break: keep-all;
}
.chip:active,
.chip.is-on {
  background: var(--accent-tint);
  border-color: var(--accent-line);
}
.chip:focus-visible,
.btn-primary:focus-visible,
.act:focus-visible,
.tab:focus-visible,
.icon-btn:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.chip.ghost {
  color: var(--ink-2);
  background: var(--surface);
}
.chip.gold {
  background: var(--grad);
  color: var(--on-accent);
  border: 0;
  font-weight: 700;
}
.composer.busy .chip {
  pointer-events: none;
  opacity: 0.45;
}

.datebox {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 0.8fr;
  gap: 6px;
  margin-bottom: 8px;
}
.datebox select {
  appearance: none;
  -webkit-appearance: none;
  background: var(--surface-2)
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'><path fill='%238a8a92' d='M0 0l5 6 5-6z'/></svg>")
    no-repeat right 10px center;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 10px 26px 10px 10px;
  font-size: 16px;
  color: var(--ink);
  outline: none;
}
.datebox select:focus {
  border-color: var(--accent);
}
.date-actions {
  display: flex;
  gap: 8px;
}
.date-actions .chip {
  flex: 1;
  text-align: center;
}

/* ===== Buttons shared ===== */
.btn-primary {
  width: 100%;
  height: 50px;
  border-radius: 999px;
  background: var(--grad);
  color: var(--on-accent);
  font-weight: 700;
  font-size: var(--fs-body);
  letter-spacing: var(--track-body);
}
.btn-primary:active {
  transform: translateY(1px);
}
.btn-text {
  background: none;
  color: var(--on-night-2);
  font-size: var(--fs-body);
  font-weight: 600;
  padding: 8px;
}

/* ===== Match overlay ===== */
.overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(10, 13, 28, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px;
  text-align: center;
  transition: opacity 0.24s cubic-bezier(0.2, 0, 0, 1);
}
/* 열기·닫기는 transition: 도중에 방향이 바뀌어도 지금 보이는 값에서 이어진다 */
@starting-style {
  .overlay {
    opacity: 0;
  }
}
.overlay.closing {
  opacity: 0;
  transition-duration: 0.18s;
  pointer-events: none;
}
@keyframes fadein {
  from {
    opacity: 0;
  }
}
.match-title {
  font-family: var(--font-display);
  font-size: var(--fs-display);
  font-weight: 700;
  letter-spacing: var(--track-display);
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
  animation: pop 0.45s cubic-bezier(0.2, 0, 0, 1);
}
.match-sub {
  margin-top: 8px;
  color: var(--on-night-2);
  font-size: 14px;
  line-height: var(--lh-body);
  position: relative;
}
.match-faces {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 36px 0 32px;
  position: relative;
}
.face {
  width: 118px;
  height: 118px;
  border-radius: 50%;
  overflow: hidden;
  border: 3px solid var(--moon-200);
  background: var(--night-700);
}
.face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: var(--face, scale(1.7));
}
.face.me {
  margin-right: -14px;
  z-index: 1;
  --face-from: -12px;
}
.face.them {
  margin-left: -14px;
  z-index: 2;
  --face-from: 12px;
}
.overlay .face {
  animation: facein 0.36s cubic-bezier(0.2, 0, 0, 1);
}
@keyframes facein {
  from {
    opacity: 0;
    transform: translateX(var(--face-from));
  }
}
.match-actions {
  width: 100%;
  max-width: 280px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  animation: fadein 0.24s 0.08s cubic-bezier(0.2, 0, 0, 1) both;
}

/* ===== Modals / sheets ===== */
.modal {
  position: absolute;
  inset: 0;
  z-index: 30;
  background: rgba(10, 13, 28, 0.6);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  transition: opacity 0.2s cubic-bezier(0.2, 0, 0, 1);
}
.modal.hidden {
  display: none;
}
.sheet {
  width: 100%;
  background: var(--paper);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: 10px 18px 20px;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.18);
  transition:
    transform 0.32s cubic-bezier(0.2, 0, 0, 1),
    opacity 0.32s cubic-bezier(0.2, 0, 0, 1);
  max-height: 88%;
  overflow: auto;
}
@starting-style {
  .sheet {
    transform: translateY(30px);
    opacity: 0;
  }
}
.modal.closing {
  opacity: 0;
  pointer-events: none;
}
.modal.closing .sheet {
  transform: translateY(30px);
  opacity: 0;
  transition-duration: 0.2s;
}
.sheet-handle {
  width: 40px;
  height: 4px;
  border-radius: 4px;
  background: var(--paper-line);
  margin: 4px auto 12px;
}
.sheet h2 {
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}
.sheet p {
  font-size: 14px;
  color: var(--ink-2);
  line-height: var(--lh-body);
  word-break: keep-all;
  margin-bottom: 12px;
}
.sheet .warn {
  color: var(--danger);
  font-size: 12.5px;
  min-height: 1.4em;
  margin: 4px 0 10px;
}
.sheet-actions {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.sheet-actions .chip {
  flex: 1;
  text-align: center;
  height: 44px;
}

.info-sheet {
  padding: 10px 0 16px;
}
.info-strip {
  display: flex;
  gap: 6px;
  padding: 2px 18px 4px;
  margin: 0 0 12px;
  overflow-x: auto;
}
.info-thumb {
  flex: 1 1 0;
  min-width: 0;
  padding: 0;
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  background: var(--night-800);
  aspect-ratio: 3 / 4;
  max-height: 168px;
  box-shadow: 0 0 0 2px transparent;
}
.info-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 18%;
  transform: var(--thumb, none);
}
.info-thumb.on {
  box-shadow: 0 0 0 2px var(--moon-600);
}
.info-body {
  padding: 0 18px;
}
.info-body h2 {
  font-size: var(--fs-h2);
}
.info-specialty {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin: 8px 0 14px;
}
.info-specialty .tag {
  display: inline-block;
  font-size: 15px;
  font-weight: 800;
  color: var(--accent);
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  border-radius: 999px;
  padding: 6px 12px;
  line-height: 1.3;
  backdrop-filter: none;
}
.info-specialty .tag.tag-19 {
  background: var(--rose-700);
  border-color: var(--rose-700);
  color: #ffffff;
}
.info-block {
  margin-bottom: 14px;
}
.info-block h3 {
  font-size: var(--fs-label);
  color: var(--mute);
  margin-bottom: 4px;
}
.info-place {
  color: var(--mute) !important;
  font-size: 12.5px !important;
}
.quote {
  font-family: var(--font-display);
  color: var(--accent) !important;
}
.info-sheet .sheet-actions {
  padding: 0 18px;
}

/* share card */
.share-wrap {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.share-card {
  width: 100%;
  max-width: 320px;
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, var(--night-700), var(--night-950));
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.25);
}
.share-photo {
  height: 200px;
  overflow: hidden;
  position: relative;
}
.share-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.share-photo::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 70px;
  background: linear-gradient(to bottom, transparent, var(--night-800));
}
.share-body {
  padding: 4px 18px 18px;
  text-align: center;
}
.share-brand {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 8px;
  color: var(--moon-400);
}
.share-quote {
  font-family: var(--font-display);
  font-size: 16px;
  line-height: 1.7;
  color: var(--on-night);
  word-break: keep-all;
}
.share-by {
  margin-top: 12px;
  font-size: var(--fs-caption);
  color: var(--on-night-2);
}
.share-note {
  margin-top: 10px;
  font-size: var(--fs-caption);
  color: var(--on-night-mute);
}

.toast {
  position: absolute;
  left: 50%;
  bottom: 120px;
  transform: translateX(-50%);
  z-index: 45;
  background: var(--night-700);
  color: var(--on-night);
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 12.5px;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--line-strong);
  animation: pop 0.25s ease;
}
.toast.hidden {
  display: none;
}

.deck-stage,
.card {
  user-select: none;
  -webkit-user-select: none;
}

.ex-card img,
.share-card img,
.face.them img,
.new-match .av img,
.conv .av img {
  object-position: 50% 18%;
}

@media (min-width: 480px) {
  .app-top {
    padding-top: 28px;
    height: 72px;
  }
  .chat-top {
    padding-top: 28px;
  }
}

/* ===== proto3: 대화 속 입력 위젯 · 명식 카드 ===== */
.chat-input-hint {
  display: block;
  padding: 10px 4px;
  color: var(--mute);
  font-size: 12px;
  text-align: center;
}
.composer {
  min-height: 40px;
}
.row.widget-row,
.row.chart-row {
  max-width: 100%;
  width: 100%;
}
.row.widget-row {
  justify-content: flex-end;
}
.chat-widget {
  width: min(100%, 340px);
  margin-left: auto;
  padding: 11px;
  border: 1px solid var(--moon-tint-line);
  border-radius: 18px 18px 6px 18px;
  background: var(--paper-card);
  box-shadow: 0 6px 18px rgba(138, 100, 32, 0.1);
}
.widget-eyebrow {
  margin: 0 0 8px;
  color: var(--moon-700);
  font-size: var(--fs-label);
  font-weight: 700;
}
.chat-widget small,
.widget-label {
  display: block;
  margin-top: 7px;
  color: var(--mute);
  font-size: var(--fs-caption);
  line-height: 1.5;
}
.chat-widget input {
  width: 100%;
  margin-top: 5px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: var(--surface-2);
  padding: 10px 11px;
  color: var(--ink);
  font: inherit;
  font-size: 16px;
  outline: none;
}
.chat-widget input:focus {
  border-color: var(--accent);
  background: var(--paper-card);
}
.chat-widget .chips {
  margin-top: 8px;
}
.chat-widget .chip {
  padding: 8px 11px;
}
.paywall p {
  margin: 8px 0 0;
  font-size: 14px;
  line-height: 1.5;
}
.paywall .pw-head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin: 0;
}
.paywall .pw-off {
  color: var(--danger);
}
.paywall .pw-check,
.sheet .age-check {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  font-size: 14px;
}
.paywall .pw-check input,
.sheet .age-check input {
  width: 20px;
  height: 20px;
  margin: 0;
  accent-color: var(--accent);
}
.paywall .pw-pay {
  width: 100%;
  margin-top: 10px;
}
.paywall .pw-pay:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}
.paywall .pw-links a {
  color: var(--accent);
  text-underline-offset: 3px;
}
.paywall .pw-hint {
  color: var(--ink-2);
}
.cities-korea {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px !important;
}
.cities-korea .chip {
  padding: 8px 4px;
  text-align: center;
}
.cities-korea .chip.gold,
.cities-korea .chip:last-child {
  grid-column: span 2;
}
.timebox {
  grid-template-columns: 1fr 1fr;
}
.widget-error {
  min-height: 0;
  margin: 6px 0 0;
  color: var(--danger);
  font-size: 12px;
}
.widget-error:empty {
  display: none;
}
.city-results {
  display: grid;
  gap: 4px;
  max-height: 236px;
  margin-top: 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.city-results button {
  display: grid;
  grid-template-columns: auto 1fr;
  column-gap: 7px;
  align-items: baseline;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--paper);
  text-align: left;
  color: var(--ink);
}
.city-results b {
  font-size: 14px;
}
.city-results span {
  overflow: hidden;
  color: var(--ink-2);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.city-results small {
  grid-column: 1 / -1;
  margin: 1px 0 0;
  font-size: var(--fs-caption);
}
.city-results p {
  margin: 0;
  padding: 8px;
  color: var(--mute);
  font-size: 12px;
}
.zi-choices {
  display: grid;
  gap: 6px;
}
.zi-choices .chip {
  border-radius: 12px;
  text-align: left;
}
.bubble.caution {
  border: 1px solid var(--moon-tint-line);
  background: var(--moon-tint);
}
.bubble.chart-bubble {
  padding: 0;
  overflow: hidden;
  background: transparent;
  white-space: normal;
}
.mscard {
  width: min(310px, calc(100vw - 72px));
  border: 1px solid var(--paper-line);
  border-radius: 16px;
  background: var(--paper-card);
  color: var(--ink);
}
.ms-head {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 10px 12px 8px;
  background: linear-gradient(135deg, var(--night-800), var(--night-700));
  color: var(--on-night);
}
.ms-head span {
  color: var(--on-night-2) !important;
}
.ms-head b {
  font-size: 14px;
}
.ms-head span {
  color: var(--ink-2);
  font-size: var(--fs-label);
}
.ms-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  padding: 10px;
}
.ms-col {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 7px 2px;
  border-radius: 12px;
  background: var(--paper);
}
.ms-col.me {
  outline: 2px solid var(--moon-600);
  background: var(--moon-tint);
}
.ms-col.none {
  border: 1px dashed var(--ink-500);
  padding: 6px 1px;
}
.ms-pos,
.ms-col small {
  color: var(--mute);
  font-size: var(--fs-caption);
}
.ms-ch {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-display);
  font-size: 22px;
  line-height: 1;
}
.ms-col.none .ms-ch {
  background: transparent;
  color: var(--ink-700);
}
.el-wood {
  background: #2f7d57;
}
.el-fire {
  background: #c2443f;
}
.el-earth {
  background: #9c7424;
}
.el-metal {
  background: #67707f;
}
.el-water {
  background: #2a62a0;
}
.ms-foot {
  padding: 0 12px 10px;
  color: var(--ink-2);
  font-size: var(--fs-caption);
  line-height: 1.55;
}

/* ===== 밤월 브랜드 레이어: 인트로 · 데스크톱 소개 · 마감 정리 ===== */
body {
  word-break: keep-all;
  overflow-wrap: break-word;
}
#screen-chat .disclaimer {
  background: var(--paper-card);
  color: var(--ink-500);
  padding-top: 4px;
}
.deck-wrap,
.page-body,
.tabbar,
.action-bar {
  background: transparent;
}
#screen-deck,
#screen-explore,
#screen-matches,
#screen-profile {
  background: var(--bg);
}
.wordmark-btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  color: var(--on-night);
}
.wordmark-btn img {
  height: 26px;
  width: auto;
}
.mark-moon {
  width: 26px;
  height: 26px;
}

/* 인트로(첫 화면) */
.screen.intro {
  inset: 0;
  overflow-y: auto;
  background: var(--night-900);
}
.intro-sky {
  position: relative;
  flex-shrink: 0;
  padding: 56px var(--space-6) var(--space-6);
  background: linear-gradient(180deg, #151b3e 0%, var(--night-900) 100%);
  overflow: hidden;
}
.intro-sky .stars {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}
.intro-logo {
  position: relative;
  width: 168px;
  height: auto;
  display: block;
}
.intro-title {
  position: relative;
  margin-top: var(--space-2);
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: 1.35;
  font-weight: 700;
  letter-spacing: var(--track-display);
  color: var(--on-night);
}
.intro-lead {
  position: relative;
  margin-top: var(--space-3);
  color: var(--on-night-2);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
}
.intro-body {
  padding: var(--space-2) var(--space-6) var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-5);
}
.intro-steps {
  list-style: none;
  display: grid;
  gap: var(--space-3);
  counter-reset: s;
}
.intro-steps li {
  display: grid;
  grid-template-columns: 32px 1fr;
  gap: var(--space-3);
  align-items: start;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(23, 28, 56, 0.7);
}
.intro-steps li::before {
  counter-increment: s;
  content: counter(s);
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent-tint);
  border: 1px solid var(--accent-line);
  color: var(--moon-400);
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 15px;
}
.intro-steps b {
  display: block;
  font-size: var(--fs-body);
  color: var(--on-night);
  font-weight: 700;
}
.intro-steps span {
  display: block;
  margin-top: 2px;
  font-size: var(--fs-small);
  line-height: 1.55;
  color: var(--on-night-2);
}
.intro-faces {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.intro-faces .stack {
  display: flex;
}
.intro-faces .stack img {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 18%;
  border: 2px solid var(--night-900);
  margin-left: -10px;
  background: var(--night-700);
}
.intro-faces .stack img:first-child {
  margin-left: 0;
}
.intro-faces p {
  font-size: var(--fs-small);
  color: var(--on-night-2);
  line-height: 1.5;
}
.intro-cta {
  display: grid;
  gap: var(--space-2);
}
.intro-note {
  font-size: var(--fs-caption);
  line-height: 1.6;
  color: var(--on-night-mute);
  text-align: center;
}
.intro-foot {
  margin-top: auto;
  padding: var(--space-4) var(--space-6) var(--space-5);
  border-top: 1px solid var(--line);
  font-size: var(--fs-caption);
  color: var(--on-night-mute);
  display: flex;
  justify-content: space-between;
}

/* 데스크톱: 기기 옆 소개 칼럼 */
.brand-aside {
  display: none;
}
@media (min-width: 1024px) {
  .stage {
    grid-template-columns: minmax(320px, 440px) 390px;
    gap: 72px;
    justify-content: center;
    align-items: center;
  }
  .brand-aside {
    display: block;
    color: var(--on-night);
  }
  .brand-aside .aside-logo {
    width: 220px;
    height: auto;
    display: block;
  }
  .brand-aside h1 {
    margin-top: var(--space-8);
    font-family: var(--font-display);
    font-size: 40px;
    line-height: 1.3;
    font-weight: 700;
    letter-spacing: var(--track-display);
  }
  .brand-aside .aside-lead {
    margin-top: var(--space-4);
    font-size: var(--fs-lead);
    line-height: 1.7;
    color: var(--on-night-2);
    max-width: 30em;
  }
  .brand-aside ul {
    list-style: none;
    margin-top: var(--space-6);
    display: grid;
    gap: var(--space-3);
  }
  .brand-aside li {
    display: flex;
    gap: var(--space-3);
    font-size: var(--fs-body);
    line-height: 1.6;
    color: var(--on-night-2);
  }
  .brand-aside li::before {
    content: "";
    flex: 0 0 8px;
    height: 8px;
    margin-top: 9px;
    border-radius: 50%;
    background: var(--moon-400);
  }
  .brand-aside .aside-cta {
    margin-top: var(--space-8);
    display: flex;
    align-items: center;
    gap: var(--space-6);
  }
  .brand-aside .aside-cta .btn-primary {
    width: auto;
    padding: 0 var(--space-8);
  }
  .brand-aside .aside-daily {
    color: var(--moon-400);
    font-size: var(--fs-body);
    font-weight: 500;
    text-underline-offset: 4px;
  }
  .brand-aside .aside-note {
    margin-top: var(--space-6);
    font-size: var(--fs-small);
    color: var(--on-night-mute);
    line-height: 1.6;
  }
  .brand-aside .aside-domain {
    color: var(--moon-400);
    font-weight: 700;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .intro-sky .twinkle circle,
  .explore-tags .chip-in {
    animation: none !important;
  }
  .match-actions,
  .daily-thread .bubble,
  .daily-choices {
    animation-delay: 0s !important;
  }
}

/* ===== 밤월: 타이포 마감 · 히어로 · 시스템 문구 ===== */
h1,
h2,
h3,
.intro-title,
.match-title,
.brand-aside h1 {
  text-wrap: balance;
}
p,
.bubble,
.intro-steps span {
  text-wrap: pretty;
}
.intro-lead,
.page-lead,
.sheet p {
  max-width: 34em;
}
.intro-sky {
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-top: 40px;
  padding-bottom: var(--space-8);
}
.intro-logo {
  position: absolute;
  top: 40px;
  left: var(--space-6);
  width: 132px;
}
.intro-title {
  font-size: 34px;
  line-height: 1.3;
}
.intro-sky .twinkle circle {
  animation: twinkle 4.8s ease-in-out infinite;
}
.intro-sky .twinkle circle:nth-child(2n) {
  animation-delay: 1.6s;
}
.intro-sky .twinkle circle:nth-child(3n) {
  animation-delay: 3.1s;
}
@keyframes twinkle {
  0%,
  100% {
    opacity: 0.25;
  }
  50% {
    opacity: 0.85;
  }
}
.intro-steps li {
  background: var(--night-800);
}
/* 폰 화면(폰 틀 없음): 버튼을 하늘 바로 아래로 올려 첫 화면 안에 둔다 */
@media (max-width: 479px) {
  .intro-cta {
    order: -1;
  }
}
.widget-error .chip.retry {
  display: inline-flex;
  align-items: center;
  margin-top: var(--space-2);
  min-height: 36px;
  padding: 6px 12px;
  color: var(--ink);
  background: var(--paper-card);
  border-color: var(--moon-tint-line);
  font-weight: 600;
}
.widget-error {
  line-height: 1.55;
}
.matches-empty p {
  margin-bottom: var(--space-4);
  color: var(--mute);
}
.btn-compact {
  width: auto;
  height: 44px;
  padding: 0 var(--space-6);
  font-size: var(--fs-body);
}
.empty-deck h2 {
  font-family: var(--font-display);
  font-size: var(--fs-h3);
  color: var(--ink);
}
.widget-error .chip.retry {
  display: flex;
  width: fit-content;
}

/* ===== 서버 렌더 공개 페이지 (랜딩·안내·404) ===== */
@media (min-width: 1024px) {
  .stage.solo {
    grid-template-columns: 390px;
  }
}
.page a {
  color: var(--moon-400);
}
.page a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}
.btn-link {
  display: grid;
  place-items: center;
  text-decoration: none;
}
.page a.btn-primary {
  color: var(--on-accent);
}
.page a.btn-text {
  display: block;
  text-align: center;
  color: var(--on-night-2);
}
.doc-top {
  padding: 32px var(--space-6) 0;
}
.doc-top img {
  width: 100px;
  height: auto;
}
.doc {
  padding: var(--space-6);
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.doc-center {
  flex: 1;
  justify-content: center;
}
.doc-title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: 1.35;
  letter-spacing: var(--track-display);
  color: var(--on-night);
}
.doc-lead,
.doc p:not(.bubble),
.doc li {
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--on-night-2);
}
.site-foot {
  margin-top: auto;
  padding: var(--space-5) var(--space-6) var(--space-6);
  border-top: 1px solid var(--line);
  font-size: var(--fs-small);
  line-height: 1.6;
  color: var(--on-night-mute);
  display: grid;
  gap: var(--space-2);
}
.site-foot ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1) var(--space-4);
}
.site-foot a {
  display: inline-block;
  padding: 4px 0;
  color: var(--on-night-2);
}
.doc-sub {
  margin-top: var(--space-2);
  font-size: var(--fs-h3);
  color: var(--on-night);
}
.price-list {
  list-style: none;
  display: grid;
  gap: var(--space-2);
}
.doc .price-list li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--night-800);
}
.price-list b {
  display: block;
  color: var(--on-night);
}
.price-list span {
  display: block;
  font-size: var(--fs-small);
  color: var(--on-night-mute);
}
.price-list strong {
  flex-shrink: 0;
  color: var(--moon-400);
}
.doc .doc-note {
  font-size: var(--fs-small);
  color: var(--on-night-mute);
}
.doc .doc-banner {
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--accent-line);
  border-radius: var(--radius-md);
  background: var(--accent-tint);
  color: var(--on-night);
  font-weight: 600;
}
.doc .doc-todo {
  color: var(--on-night-mute);
  font-size: var(--fs-small);
}
/* ===== /daily ===== */
.daily-host {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-3);
}
.daily-host-av {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  border-radius: 50%;
  overflow: hidden;
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
}
.daily-host-av img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* seoha.jpg 얼굴 중심 50% 32%, 1.8배 확대 후 가운데로(app.js faceStyle과 같은 계산) */
  object-position: 50% 32%;
  transform: translate(0%, 18%) scale(1.8);
  transform-origin: 50% 32%;
}
.daily-host-text {
  display: grid;
  gap: 2px;
}
.daily-host-name {
  font-size: var(--fs-lead);
  font-weight: 600;
  color: var(--on-night);
}
.daily-host-role {
  font-size: var(--fs-small);
  color: var(--on-night-2);
}
.daily-form {
  display: grid;
  gap: var(--space-3);
}
.daily-cal {
  border: 0;
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  color: var(--on-night-2);
}
.daily-cal legend {
  margin-bottom: var(--space-2);
  font-size: var(--fs-small);
  color: var(--on-night-mute);
}
.daily-cal label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 44px;
}
.daily-cal input:focus-visible,
.datebox select:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.daily-thread {
  display: grid;
  gap: var(--space-2);
  justify-items: start;
}
.daily-thread .bubble,
.daily-choices {
  animation: pop 0.28s cubic-bezier(0.2, 0, 0, 1) both;
  animation-delay: calc(var(--i, 0) * 120ms);
}
.daily-thread .bubble.me {
  justify-self: end;
  border-radius: 18px 18px 6px 18px;
  background: var(--user);
  color: var(--user-text);
  font-weight: 500;
  box-shadow: none;
}
.daily-choices {
  margin-top: var(--space-2);
}

/* 청소년유해매체물 유해로고: 적색 테두리 원 안에 백색 바탕, 흑색 19 (고시 「청소년 유해매체물의 표시방법」) */
.mark-19 {
  display: inline-flex;
  flex: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  width: 2em;
  height: 2em;
  border: 0.2em solid #e60012;
  border-radius: 50%;
  background: #fff;
  color: #000;
  font-family: "Noto Sans KR", system-ui, sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.03em;
  vertical-align: middle;
}
.price-list .mark-19 {
  margin-right: 6px;
}

.badge-19 {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 9px 4px 4px;
  color: #fff;
  font-weight: 700;
}
.badge-19 .mark-19 {
  font-size: 13px;
}
.adult-view {
  position: absolute;
  left: 50%;
  top: 38%;
  z-index: 6;
  transform: translate(-50%, -50%);
  padding: 12px 18px;
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 999px;
  background: rgba(14, 18, 38, 0.82);
  color: #fff;
  font: inherit;
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}
.adult-view.hidden {
  display: none;
}
.explore-adult-notice {
  position: absolute;
  top: 8px;
  left: 8px;
  right: 8px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.8);
}
.explore-adult-notice .mark-19 {
  font-size: 11px;
}
.info-adult-notice {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 18px 10px;
  font-size: 15px;
}
.info-adult-notice.hidden {
  display: none;
}
.info-preview-wrap {
  position: relative;
}
.age-official-notice {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin: 4px 0 14px;
  padding: 16px 14px;
  border-radius: 14px;
  background: #fff;
  color: #000;
  text-align: center;
}
.age-official-notice .mark-19 {
  font-size: 34px;
}
.age-official-notice h2 {
  margin: 0;
  color: #000;
}
.age-official-notice p {
  margin: 0;
  color: #000;
  font-size: 14px;
  line-height: 1.55;
  word-break: keep-all;
}
