/* MBTIGRAM — 단일 뮤트 액센트(라일락 #BF94E4), 다크 · 화이트 두 모드 */

:root {
  /* 다크 모드가 기본값 */
  --bg: #0a0a0a;
  --surface: #101010;
  --surface-2: #161616;
  --surface-3: #1d1d1d;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --text: #ededed;
  --dim: #8b8b8b;
  --dimmer: #5f5f5f;
  --topbar: rgba(10, 10, 10, 0.86);
  --veil: rgba(0, 0, 0, 0.62);

  /* 아이콘·숫자·강조 텍스트용 (모드마다 명암을 맞춘다) */
  --accent: #bf94e4;
  --accent-hi: #cfaced;
  /* 버튼·링 같은 채움용 — 두 모드에서 같은 라일락을 유지한다 */
  --accent-fill: #bf94e4;
  --on-accent: #221430;
  --accent-soft: rgba(191, 148, 228, 0.15);
  --accent-edge: rgba(191, 148, 228, 0.45);
  --accent-ring: rgba(191, 148, 228, 0.35);
  --danger: #c4696b;
  --danger-edge: rgba(196, 105, 107, 0.4);

  --av-text: #1a1220;
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
  --r-lg: 2rem;
  --r-in: calc(2rem - 0.375rem);
  --r-md: 1.125rem;
  --safe-b: env(safe-area-inset-bottom, 0px);
}

:root[data-theme="light"] {
  --bg: #fdfbf7;
  --surface: #ffffff;
  --surface-2: #f7f4ef;
  --surface-3: #ece7e0;
  --line: rgba(28, 22, 34, 0.1);
  --line-strong: rgba(28, 22, 34, 0.17);
  --text: #1c1a1f;
  --dim: #6b6670;
  --dimmer: #9a949f;
  --topbar: rgba(253, 251, 247, 0.88);
  --veil: rgba(28, 22, 34, 0.34);

  --accent: #7f52b3;
  --accent-hi: #6c4299;
  --accent-fill: #bf94e4;
  --on-accent: #211331;
  --accent-soft: rgba(127, 82, 179, 0.12);
  --accent-edge: rgba(127, 82, 179, 0.34);
  --accent-ring: rgba(127, 82, 179, 0.3);
  --danger: #a8474b;
  --danger-edge: rgba(168, 71, 75, 0.35);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Pretendard, "Pretendard Variable", system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  word-break: keep-all;
  overscroll-behavior-y: none;
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease);
}

body { font-size: 15px; line-height: 1.55; }

button, input, textarea, select {
  font-family: inherit;
  font-size: inherit;
  color: inherit;
}

::-webkit-scrollbar { width: 0; height: 0; }

.app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  background: var(--bg);
}

/* ── 공통 ─────────────────────────────────────────────── */
.muted { color: var(--dim); }
.tiny { font-size: 12px; }
.small { font-size: 13px; }
.center { text-align: center; }
.row { display: flex; align-items: center; gap: 10px; }
.row.between { justify-content: space-between; }
.col { display: flex; flex-direction: column; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hr { height: 1px; background: var(--line); margin: 18px 0; }

.page { padding: 18px 18px calc(96px + var(--safe-b)); }
.page.flush { padding-bottom: var(--safe-b); }

h1, h2, h3 { margin: 0; font-weight: 700; letter-spacing: -0.02em; }
h1 { font-size: 26px; line-height: 1.25; }
h2 { font-size: 19px; }
h3 { font-size: 16px; }

.eyebrow {
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dimmer);
  font-weight: 600;
}

/* ── 카드: 더블 베젤 ──────────────────────────────────── */
.card {
  border-radius: var(--r-lg);
  padding: 6px;
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px var(--line);
}
.card > .inner {
  border-radius: var(--r-in);
  background: var(--surface);
  padding: 18px;
}
.tile {
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  padding: 14px 16px;
}

/* ── 버튼 ─────────────────────────────────────────────── */
.btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 13px 20px;
  background: var(--surface-3);
  color: var(--text);
  font-weight: 600;
  cursor: pointer;
  transition: transform 0.4s var(--ease), opacity 0.4s var(--ease),
    background-color 0.4s var(--ease);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  line-height: 1.2;
}
.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); }
.btn.primary:hover:not(:disabled) { filter: brightness(1.07); }
.btn.ghost { background: transparent; box-shadow: inset 0 0 0 1px var(--line-strong); }
.btn.soft { background: var(--accent-soft); color: var(--accent); }
.btn.danger { background: transparent; color: var(--danger); box-shadow: inset 0 0 0 1px var(--danger-edge); }
.btn.block { width: 100%; }
.btn.sm { padding: 8px 14px; font-size: 13px; }
.btn.xs { padding: 6px 11px; font-size: 12px; border-radius: 999px; }

.iconbtn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  padding: 8px;
  border-radius: 12px;
  cursor: pointer;
  display: inline-flex;
  transition: color 0.4s var(--ease), transform 0.4s var(--ease);
}
.iconbtn:active { transform: scale(0.92); }
.iconbtn.bell { position: relative; }
.bell-badge {
  position: absolute;
  top: 1px;
  right: 0;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--danger);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  box-shadow: 0 0 0 2px var(--topbar);
}
.listitem.noti.unread { background: var(--accent-soft); }
.noti-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-fill);
  flex: none;
}
.iconbtn:hover { color: var(--text); }

/* ── 입력 ─────────────────────────────────────────────── */
.field { margin-bottom: 14px; }
.field > label {
  display: block;
  font-size: 12.5px;
  color: var(--dim);
  margin-bottom: 7px;
  font-weight: 600;
}
.input, .textarea, .select {
  width: 100%;
  background: var(--surface-2);
  border: 0;
  box-shadow: inset 0 0 0 1px var(--line);
  border-radius: 14px;
  padding: 13px 15px;
  outline: none;
  transition: box-shadow 0.4s var(--ease);
}
.input:focus, .textarea:focus, .select:focus {
  box-shadow: inset 0 0 0 1px var(--accent);
}
.textarea { resize: none; min-height: 96px; line-height: 1.5; }
.input::placeholder, .textarea::placeholder { color: var(--dimmer); }

/* ── 포커스 ───────────────────────────────────────────
   브라우저 기본 포커스 링(크롬의 자동 링, 파이어폭스의 점선, OS 강조색 링)을
   전부 끄고 아래에서 직접 정의한다. 접근성을 위해 키보드 이동(Tab)일 때만
   테두리 밖에 은은한 링을 남긴다. 마우스·터치에는 아무것도 뜨지 않는다. */
a:focus, button:focus, input:focus, textarea:focus, select:focus,
[tabindex]:focus, [contenteditable]:focus {
  outline: none;
}
/* 파이어폭스가 버튼 안쪽에 그리는 점선 테두리 */
::-moz-focus-inner { border: 0; padding: 0; }
/* 크롬 날짜·숫자 입력의 내부 위젯에 따로 붙는 링 */
input::-webkit-calendar-picker-indicator:focus,
input::-webkit-inner-spin-button:focus,
input::-webkit-datetime-edit:focus,
input::-webkit-datetime-edit-fields-wrapper:focus {
  outline: none;
}
/* 모바일에서 탭하는 순간 번쩍이는 사각형 */
a, button, input, textarea, select, label,
.listitem, .qopt, .chip, .story-pill, .mbti-grid button {
  -webkit-tap-highlight-color: transparent;
}

.input:focus-visible, .textarea:focus-visible, .select:focus-visible {
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px var(--accent-soft);
}
button:focus-visible, a:focus-visible, [tabindex]:focus-visible {
  outline: 2px solid var(--accent-edge);
  outline-offset: 2px;
}
.err { color: var(--danger); font-size: 12.5px; margin-top: 7px; }
.hint { color: var(--dimmer); font-size: 12px; margin-top: 7px; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  appearance: none;
  border: 0;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--dim);
  border-radius: 999px;
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.4s var(--ease);
}
.chip:active { transform: scale(0.96); }
.chip.on {
  background: var(--accent-soft);
  color: var(--accent);
  box-shadow: inset 0 0 0 1px var(--accent-edge);
}

/* ── 스위치 ───────────────────────────────────────────── */
.switch {
  appearance: none;
  border: 0;
  width: 46px;
  height: 28px;
  border-radius: 999px;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line);
  position: relative;
  cursor: pointer;
  flex: none;
  transition: background-color 0.45s var(--ease);
}
.switch > i {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--dim);
  transition: transform 0.45s var(--ease), background-color 0.45s var(--ease);
}
.switch.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-edge); }
.switch.on > i { transform: translateX(18px); background: var(--accent-fill); }

/* ── 아바타 ───────────────────────────────────────────── */
.av {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: -0.02em;
  flex: none;
  color: var(--av-text);
}
.av { overflow: hidden; }
.av-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.av.lg { width: 60px; height: 60px; border-radius: 20px; font-size: 16px; }
.av.sm { width: 32px; height: 32px; border-radius: 11px; font-size: 11px; }
.av-clay { background: linear-gradient(150deg, #bf94e4, #7d55a8); }
.av-ink { background: linear-gradient(150deg, #7d8aa5, #454f66); }
.av-moss { background: linear-gradient(150deg, #8a9a76, #4e5a41); }
.av-dusk { background: linear-gradient(150deg, #b98292, #6d4a55); }
.av-sand { background: linear-gradient(150deg, #c2ab84, #7e6c4f); }
.av-slate { background: linear-gradient(150deg, #8f8f95, #4f4f55); }
.photo-pick {
  position: relative;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  flex: none;
  line-height: 0;
}
.photo-pick-badge {
  position: absolute;
  right: -3px;
  bottom: -3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--accent-fill);
  display: grid;
  place-items: center;
  box-shadow: 0 0 0 2px var(--surface);
}
.av-anon { background: linear-gradient(150deg, #4a4a4a, #2a2a2a); color: #a5a5a5; }

.badge {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  padding: 3px 8px;
  border-radius: 7px;
  background: var(--surface-3);
  color: var(--dim);
}
.badge.accent { background: var(--accent-soft); color: var(--accent); }
/* MBTI 뱃지는 성별로 색을 나눈다 */
.badge.mbti.g-male { background: rgba(90, 145, 214, 0.16); color: #6fa4e0; }
.badge.mbti.g-female { background: rgba(224, 122, 168, 0.16); color: #e589b4; }
:root[data-theme="light"] .badge.mbti.g-male { background: rgba(42, 98, 168, 0.11); color: #2a62a8; }
:root[data-theme="light"] .badge.mbti.g-female { background: rgba(184, 62, 118, 0.11); color: #b83e76; }

/* ── 상단바 ───────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--topbar);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
}
.topbar .title { font-weight: 700; font-size: 16px; letter-spacing: -0.02em; }

/* ── 탭바 ─────────────────────────────────────────────── */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  z-index: 30;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  background: var(--topbar);
  backdrop-filter: blur(18px);
  border-top: 1px solid var(--line);
  padding: 8px 4px calc(8px + var(--safe-b));
}
.tabbar button {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dimmer);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  font-size: 10.5px;
  font-weight: 600;
  padding: 5px 0;
  cursor: pointer;
  transition: color 0.4s var(--ease);
  position: relative;
}
.tabbar button.on { color: var(--accent); }
.tabbar .dot {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-fill);
}

/* ── 리스트 ───────────────────────────────────────────── */
.list { display: flex; flex-direction: column; gap: 8px; }
.listitem {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  cursor: pointer;
  transition: transform 0.4s var(--ease), background-color 0.4s var(--ease);
  text-align: left;
  border: 0;
  color: inherit;
  width: 100%;
}
.listitem:active { transform: scale(0.985); }

/* ── 매칭 ─────────────────────────────────────────────── */
.pulse-wrap { position: relative; display: grid; place-items: center; padding: 26px 0; }
.pulse {
  width: 148px;
  height: 148px;
  border-radius: 50%;
  background: var(--accent-soft);
  display: grid;
  place-items: center;
  position: relative;
}
.pulse::before, .pulse::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 50%;
  box-shadow: 0 0 0 1px var(--accent-ring);
  animation: ripple 2.6s var(--ease) infinite;
}
.pulse::after { animation-delay: 1.3s; }
@keyframes ripple {
  from { transform: scale(1); opacity: 0.9; }
  to { transform: scale(1.75); opacity: 0; }
}
.score-ring { position: relative; width: 128px; height: 128px; }
.score-ring svg { transform: rotate(-90deg); }
.score-ring .num {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

/* ── 채팅 ─────────────────────────────────────────────── */
.chat-scroll {
  padding: 16px 14px 8px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  overflow-y: auto;
}
.bubble {
  max-width: 78%;
  padding: 10px 14px;
  border-radius: 18px;
  line-height: 1.5;
  white-space: pre-wrap;
  word-break: break-word;
}
.bubble.them { align-self: flex-start; background: var(--surface-2); }
.bubble.me {
  align-self: flex-end;
  background: var(--accent-fill);
  color: var(--on-accent);
}
/* 같은 사람이 연달아 보낸 말풍선끼리만 맞닿는 쪽 모서리를 줄인다.
   한 개짜리 말풍선은 네 모서리가 모두 같아서 튀어나오는 점이 생기지 않는다. */
.bubble.them.pinch-top { border-top-left-radius: 7px; }
.bubble.them.pinch-bottom { border-bottom-left-radius: 7px; }
.bubble.me.pinch-top { border-top-right-radius: 7px; }
.bubble.me.pinch-bottom { border-bottom-right-radius: 7px; }
.bubble-meta { font-size: 10.5px; color: var(--dimmer); padding: 0 4px 6px; }
.bubble-meta.me { align-self: flex-end; }
.sys {
  align-self: center;
  font-size: 12px;
  color: var(--dim);
  background: var(--surface-2);
  padding: 6px 14px;
  border-radius: 999px;
  margin: 8px 0;
  text-align: center;
}
.composer {
  position: sticky;
  bottom: 0;
  display: flex;
  flex-wrap: wrap;      /* 답글 안내줄이 한 줄 위에 붙는다 */
  align-items: center;
  gap: 8px;
  padding: 10px 12px calc(10px + var(--safe-b));
  background: var(--topbar);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.composer .input { border-radius: 999px; }

/* ── 스토리 ───────────────────────────────────────────── */
.story-rail {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding: 4px 2px 14px;
}
.story-pill { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; width: 64px; cursor: pointer; }
.story-ring {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  padding: 2px;
  background: var(--surface-3);
  display: grid;
  place-items: center;
  transition: transform 0.4s var(--ease);
}
.story-pill:active .story-ring { transform: scale(0.94); }
.story-ring.unseen { background: linear-gradient(150deg, #bf94e4, #6f4796); }
.story-ring .av { width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 2px var(--bg); }
.story-name { font-size: 10.5px; color: var(--dim); max-width: 64px; text-align: center; }

.story-view {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: #000;
  color: #fff;
  display: flex;
  flex-direction: column;
}
.story-view .iconbtn { color: rgba(255, 255, 255, 0.85); }
.story-view .btn.ghost { color: #fff; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.3); }
.story-body {
  flex: 1;
  display: grid;
  place-items: center;
  padding: 40px 26px;
  text-align: center;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.5;
}
.story-body img { max-width: 100%; max-height: 100%; border-radius: 20px; }
/* 규격(1080x1920)에 맞춰 올린 사진은 여백 없이 화면을 채운다 */
.story-body.has-image { padding: 0; }
.story-body.has-image img {
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  object-fit: cover;
  border-radius: 0;
}
.bg-clay { background: linear-gradient(160deg, #7d55a8, #241733); }
.bg-ink { background: linear-gradient(160deg, #454f66, #141922); }
.bg-moss { background: linear-gradient(160deg, #4e5a41, #161c12); }
.bg-dusk { background: linear-gradient(160deg, #6d4a55, #1f151a); }
.bg-sand { background: linear-gradient(160deg, #7e6c4f, #241d13); }
.bg-slate { background: linear-gradient(160deg, #4f4f55, #151517); }
.story-progress { display: flex; gap: 4px; padding: 12px 12px 0; }
.story-progress i {
  flex: 1;
  height: 2.5px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.25);
  overflow: hidden;
}
.story-progress i.done { background: rgba(255, 255, 255, 0.85); }
/* 지금 보고 있는 장의 진행 정도. 폭은 스크립트가 매 프레임 직접 넣는다. */
.story-progress i > b { display: block; height: 100%; width: 0; background: #fff; }

/* 사람이나 장이 바뀔 때 넘어온 방향으로 살짝 밀려 들어온다 */
.story-stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 0;
  touch-action: pan-y;
  animation: storyin 0.42s var(--ease);
}
@keyframes storyin {
  from { opacity: 0; transform: translateX(var(--story-from, 26px)) scale(0.99); }
  to { opacity: 1; transform: none; }
}
.story-foot {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px calc(18px + var(--safe-b));
  min-height: 44px;
}

/* 스토리 미리보기는 항상 어두운 배경이라 흰 글씨를 강제한다 */
.story-preview {
  color: #fff;
  border-radius: 20px;
  margin-bottom: 14px;
  padding: 20px;
  display: grid;
  place-items: center;
  text-align: center;
  font-weight: 600;
  font-size: 18px;
  /* 실제 스토리 화면과 같은 세로 비율 */
  aspect-ratio: 9 / 16;
  max-height: 320px;
  margin-inline: auto;
  overflow: hidden;
}
.story-preview.has-image { padding: 0; }
.story-preview.has-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ── 시트 / 모달 ──────────────────────────────────────── */
.scrim {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: var(--veil);
  backdrop-filter: blur(3px);
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: fade 0.35s var(--ease);
}
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
.sheet {
  width: 100%;
  max-width: 520px;
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  box-shadow: inset 0 1px 0 var(--line-strong);
  padding: 10px 18px calc(22px + var(--safe-b));
  max-height: 86dvh;
  overflow-y: auto;
  animation: rise 0.45s var(--ease);
}
@keyframes rise { from { transform: translateY(22px); opacity: 0; } to { transform: none; opacity: 1; } }
/* 투표 팝업은 화면 가운데에 뜨고 바깥을 눌러도 닫히지 않는다 */
.vote-sheet {
  border-radius: 26px;
  margin: 0 14px;
  max-width: 420px;
  padding: 22px 20px;
  animation: rise 0.45s var(--ease);
}

/* ── 캡쳐 방어 ────────────────────────────────────────── */
/* 앱이 뒤로 갔을 때 덮는 막. 앱 전환 화면 미리보기에 내용이 남지 않는다. */
.capture-guard {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
  place-items: center;
  background: var(--bg);
}
body.is-hidden-app .capture-guard { display: grid; }
/* 막이 늦게 그려지는 브라우저를 대비해 본문도 함께 흐린다 */
body.is-hidden-app .app { filter: blur(22px); }
.capture-guard-msg { color: var(--dim); font-size: 14px; font-weight: 600; }

/* 사진은 길게 눌러 저장하거나 끌어다 놓을 수 없게 한다 */
img {
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  user-select: none;
}

/* 친구 사진 위에 보는 사람 표시 — 유출되면 누가 흘렸는지 남는다 */
.photo-cell .wm {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
  font-size: 11px;
  font-weight: 700;
  color: rgba(255, 255, 255, 0.42);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  transform: rotate(-24deg);
  letter-spacing: 0.02em;
}

/* 프로필 사진첩 — 친구만 보는 사진 격자 */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.photo-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 14px;
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  display: block;
}
.photo-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.photo-add {
  appearance: none;
  border: 0;
  cursor: pointer;
  display: grid;
  place-items: center;
}
.photo-add:active { transform: scale(0.97); }
.photo-del {
  position: absolute;
  top: 4px;
  right: 4px;
  appearance: none;
  border: 0;
  padding: 0;
  line-height: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
}

/* 대댓글 — 원댓글 아래 한 단계만 들여쓴다 */
.reply-wrap {
  margin-left: 26px;
  padding-left: 12px;
  border-left: 2px solid var(--line);
}
.reply-btn {
  appearance: none;
  border: 0;
  background: transparent;
  color: var(--dim);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 0 0;
  cursor: pointer;
}
.reply-btn:active { color: var(--accent); }
.reply-bar {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 100%;
  order: -1;
  margin-bottom: 8px;
  padding: 7px 10px;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 12.5px;
}

/* 댓글 프로필 사진을 누르면 뜨는 작은 메뉴 */
.avatarbtn {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
  display: block;
  border-radius: 999px;
  transition: transform 0.3s var(--ease);
}
.avatarbtn:active { transform: scale(0.94); }
.popmenu-scrim { position: fixed; inset: 0; z-index: 40; }
.popmenu {
  position: absolute;
  top: 44px;
  left: 10px;
  z-index: 41;
  min-width: 152px;
  padding: 6px;
  background: var(--surface-2);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px var(--line-strong), 0 14px 30px var(--veil);
  animation: rise 0.25s var(--ease);
}
.popmenu button {
  appearance: none;
  border: 0;
  background: transparent;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 10px;
  border-radius: 10px;
  font-size: 14px;
  text-align: left;
  cursor: pointer;
  transition: background 0.3s var(--ease);
}
.popmenu button:active { background: var(--accent-soft); }

.grabber { width: 38px; height: 4px; border-radius: 2px; background: var(--line-strong); margin: 4px auto 16px; }

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(92px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 80;
  background: var(--surface-3);
  box-shadow: inset 0 0 0 1px var(--line-strong);
  color: var(--text);
  padding: 11px 18px;
  border-radius: 999px;
  font-size: 13.5px;
  font-weight: 600;
  max-width: 88vw;
  text-align: center;
  animation: rise 0.4s var(--ease);
}

/* ── 온보딩 ───────────────────────────────────────────── */
.onb { min-height: 100dvh; display: flex; flex-direction: column; padding: 22px 20px calc(22px + var(--safe-b)); }
.steps { display: flex; gap: 4px; margin-bottom: 22px; }
.steps i { flex: 1; height: 3px; border-radius: 2px; background: var(--surface-3); transition: background-color 0.5s var(--ease); }
.steps i.on { background: var(--accent-fill); }

.qcard { margin-bottom: 10px; }
.qopt {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--text);
  border-radius: 16px;
  padding: 15px 17px;
  margin-bottom: 8px;
  cursor: pointer;
  transition: all 0.45s var(--ease);
  line-height: 1.45;
}
.qopt:active { transform: scale(0.985); }
.qopt.on { background: var(--accent-soft); box-shadow: inset 0 0 0 1px var(--accent-edge); }

.mbti-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.mbti-grid button {
  appearance: none;
  border: 0;
  background: var(--surface-2);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--dim);
  border-radius: 13px;
  padding: 12px 0;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: all 0.4s var(--ease);
}
.mbti-grid button.on { background: var(--accent-soft); color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent-edge); }

.bar { height: 5px; border-radius: 3px; background: var(--surface-3); overflow: hidden; }
.bar > i { display: block; height: 100%; background: var(--accent-fill); border-radius: 3px; transition: width 0.6s var(--ease); }

.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }

.empty { padding: 46px 20px; text-align: center; color: var(--dimmer); }
/* 리스트 안에 들어가는 빈 상태는 여백을 줄인다 */
.empty.tight { padding: 18px 14px; }
.spin { animation: spin 1s linear infinite; display: inline-flex; }
@keyframes spin { to { transform: rotate(360deg); } }
