/* =====================================================================
   글꼴: 네이버 나눔스퀘어 네오 (네이버 나눔글꼴 라이선스, fonts/LICENSE.txt)
   - 앱 안에 글꼴 파일을 넣어 두어 외부 사이트 없이 쓰고, 한 번 받으면 휴대폰에 저장돼요
   - 글꼴을 받는 동안에는 기본 글꼴로 먼저 보여 줘요(font-display: swap)
   ===================================================================== */
@font-face {
  font-family: 'NanumSquare Neo';
  src: url('../fonts/NanumSquareNeo-Regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NanumSquare Neo';
  src: url('../fonts/NanumSquareNeo-Bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'NanumSquare Neo';
  src: url('../fonts/NanumSquareNeo-ExtraBold.woff2') format('woff2');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* =====================================================================
   도란톡 디자인
   - 기본 글씨 18px, 버튼 높이 56px 이상 (부모님도 읽고 누르기 쉽게)
   - 색은 모두 아래 변수로 정하고, 테마마다 값만 바꿔요
     --fill   : 입력칸 · 보조 버튼 같은 옅은 회색 면
     --line   : 얇은 구분선
     --elev-* : 카드 · 창의 그림자
   ===================================================================== */

:root {
  /* 기본(베이지와 같은 따뜻한 색) — 테마별 값은 아래 [data-theme] 에서 */
  --bg: #fff1dd;
  --bg-gradient: none;
  --surface: #ffffff;
  --fill: #f7efe7;
  --fill-press: #efe3d7;
  --line: #f0e4d8;
  --text: #2a1f17;
  --muted: #7a6656;
  --placeholder: #a08f82;

  --primary: #e35d1b;          /* 버튼 · 강조 (흰 글자는 굵고 큰 글씨로만) */
  --primary-press: #c94f17;
  --primary-soft: #fff0e5;     /* 옅은 강조 배경 */
  --primary-soft-press: #ffe1cc;
  --accent-text: #b8470f;      /* 글자로 쓰는 강조색 (링크, 선택된 탭) — 흰 바탕에서 읽기 좋은 진한 색 */
  --accent-strong: #a53f0c;    /* 옅은 강조 배경 위의 글자 */
  --on-primary: #ffffff;
  --focus-ring: rgba(227, 93, 27, 0.45);

  --ok: #1f8a4c;
  --ok-soft: #e3f5ea;
  --warn: #9a5b00;
  --warn-soft: #fff3d9;
  --danger: #d0312d;
  --danger-press: #b3261e;
  --danger-soft: #fdecea;
  --like: #f0443a;
  --unread: #e35d1b;
  --badge: #f04438;

  --bar-bg: rgba(255, 247, 238, 0.82);
  --tabbar-bg: rgba(255, 255, 255, 0.9);
  --toast-bg: rgba(33, 26, 22, 0.92);
  --overlay: rgba(20, 14, 10, 0.45);
  --bubble-mine: #c94f17;      /* 내 말풍선 (흰 글자와 대비 4.5 이상) */
  --bubble-mine-text: #ffffff;
  --bubble-theirs: #ffffff;
  --chip-bg: rgba(90, 50, 20, 0.08);
  --highlight-bg: #fff6ef;
  --highlight-border: #ffd2b3;
  --warn-border: #f2c66d;
  --skeleton: #f2e8de;
  --skeleton-shine: #faf4ee;

  --elev-1: 0 1px 2px rgba(80, 40, 10, 0.04), 0 4px 16px rgba(80, 40, 10, 0.06);
  --elev-2: 0 12px 40px rgba(40, 20, 5, 0.18);
  --pill-shadow: 0 6px 18px rgba(227, 93, 27, 0.35);

  --radius: 22px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --tap: 56px;
  --tabbar-h: 66px;
  --max-width: 640px;
  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);

  --font: 'NanumSquare Neo', -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic",
    "Noto Sans KR", "Segoe UI", Roboto, sans-serif;

  /* 예전 이름 (다른 파일에서 쓰는 곳이 있어 그대로 이어 줘요) */
  --border: var(--line);
  --surface-soft: var(--fill);
  --input-bg: var(--fill);
  --shadow: var(--elev-1);
}

/* =====================================================================
   배경 테마: 화이트 · 블랙 · 베이지(주황→노랑) · 블루(파랑→보라)
   <html data-theme="..."> 로 고르고, js/theme.js 가 휴대폰에 기억해요.
   ===================================================================== */
:root[data-theme='beige'] {
  --bg: #fff1dd;
  --bg-gradient: linear-gradient(170deg, #ffd6b3 0%, #ffe6b8 45%, #fff3d6 100%);
}

:root[data-theme='white'] {
  --bg: #f2f4f6;
  --fill: #f2f4f6;
  --fill-press: #e5e8eb;
  --line: #eaecef;
  --text: #191f28;
  --muted: #6b7684;
  --placeholder: #8b95a1;
  --bar-bg: rgba(242, 244, 246, 0.85);
  --tabbar-bg: rgba(255, 255, 255, 0.92);
  --toast-bg: rgba(25, 31, 40, 0.92);
  --overlay: rgba(0, 0, 0, 0.4);
  --chip-bg: rgba(0, 0, 0, 0.06);
  --highlight-bg: #fff7f1;
  --skeleton: #eceef1;
  --skeleton-shine: #f6f7f9;
  --elev-1: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 14px rgba(0, 0, 0, 0.04);
  --elev-2: 0 12px 40px rgba(0, 0, 0, 0.16);
}

:root[data-theme='black'] {
  color-scheme: dark;
  --bg: #0f0f11;
  --surface: #1c1c1f;
  --fill: #2a2a2f;
  --fill-press: #35353b;
  --line: #2c2c31;
  --text: #f4f4f5;
  --muted: #a1a1aa;
  --placeholder: #7c7c85;
  --primary-soft: #3a2316;
  --primary-soft-press: #4a2c1b;
  --accent-text: #ff9a5c;
  --accent-strong: #ffb07f;
  --focus-ring: rgba(255, 154, 92, 0.55);
  --ok: #4cc38a;
  --ok-soft: #15301f;
  --warn: #ffb84d;
  --warn-soft: #3a2c12;
  --danger: #ff6b63;
  --danger-press: #ff8a83;
  --danger-soft: #3d1a17;
  --like: #ff6b6b;
  --unread: #ff9a5c;
  --bar-bg: rgba(15, 15, 17, 0.82);
  --tabbar-bg: rgba(28, 28, 31, 0.92);
  --toast-bg: rgba(60, 60, 66, 0.96);
  --overlay: rgba(0, 0, 0, 0.6);
  --bubble-theirs: #26262b;
  --chip-bg: rgba(255, 255, 255, 0.08);
  --highlight-bg: #261a13;
  --highlight-border: #5a3420;
  --warn-border: #6b5420;
  --skeleton: #26262b;
  --skeleton-shine: #303036;
  --elev-1: 0 0 0 1px rgba(255, 255, 255, 0.04);
  --elev-2: 0 12px 40px rgba(0, 0, 0, 0.6);
  --pill-shadow: 0 6px 18px rgba(0, 0, 0, 0.5);
}

:root[data-theme='blue'] {
  --bg: #e6e4ff;
  --bg-gradient: linear-gradient(170deg, #cfdcff 0%, #dcd8ff 45%, #efe2ff 100%);
  --fill: #f1f2fb;
  --fill-press: #e4e6f7;
  --line: #e7e8f5;
  --text: #1e1f3a;
  --muted: #5d6080;
  --placeholder: #8a8ca8;
  --primary: #4f46e5;
  --primary-press: #4338ca;
  --primary-soft: #eef0ff;
  --primary-soft-press: #dfe3ff;
  --accent-text: #4338ca;
  --accent-strong: #3730a3;
  --focus-ring: rgba(79, 70, 229, 0.45);
  --unread: #4f46e5;
  --bar-bg: rgba(236, 236, 255, 0.82);
  --toast-bg: rgba(30, 31, 58, 0.92);
  --overlay: rgba(20, 20, 50, 0.45);
  --bubble-mine: #4f46e5;
  --chip-bg: rgba(40, 40, 120, 0.08);
  --highlight-bg: #f5f6ff;
  --highlight-border: #c7cdfb;
  --skeleton: #eceefb;
  --skeleton-shine: #f6f7ff;
  --elev-1: 0 1px 2px rgba(40, 40, 120, 0.04), 0 4px 16px rgba(40, 40, 120, 0.07);
  --pill-shadow: 0 6px 18px rgba(79, 70, 229, 0.35);
}

/* 그라데이션 배경은 화면에 고정 (스크롤해도 그대로) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg-gradient);
  pointer-events: none;
}

/* =====================================================================
   기본
   ===================================================================== */
* { box-sizing: border-box; }

/* hidden 속성이 붙은 요소는 항상 숨김 (버튼 등의 display 설정보다 우선) */
[hidden] { display: none !important; }

html {
  font-size: 18px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.6;
  word-break: keep-all;
  overflow-wrap: anywhere;
  -webkit-tap-highlight-color: transparent;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

h1, h2, h3 { line-height: 1.35; margin: 0 0 0.5em; letter-spacing: -0.02em; }
h1 { font-size: 1.55rem; font-weight: 800; }
h2 { font-size: 1.2rem; font-weight: 800; }
h3 { font-size: 1.05rem; font-weight: 800; }
p { margin: 0 0 0.8em; }
strong { font-weight: 800; }

a { color: var(--accent-text); text-underline-offset: 3px; }

.icon { flex: none; display: block; }

.muted { color: var(--muted); }
.small { font-size: 0.9rem; }
.center { text-align: center; }
.stack > * + * { margin-top: 12px; }
.no-scroll { overflow: hidden; }

/* ---------- 화면 틀 ---------- */
.page {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 16px 16px calc(32px + env(safe-area-inset-bottom));
}
/* 화면이 바뀔 때 살짝 떠오르며 나타나기 */
#app > .page { animation: page-in 0.24s var(--ease) both; }
@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 로고 ---------- */
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 4px 24px;
}
.brand-logo {
  width: 52px;
  height: 52px;
  border-radius: 15px;
  flex: none;
  box-shadow: 0 4px 12px rgba(201, 79, 23, 0.25);
}
img.brand-logo { object-fit: cover; }
.brand-name { font-size: 1.5rem; font-weight: 800; margin: 0; letter-spacing: -0.02em; line-height: 1.25; }
.brand-sub { color: var(--muted); margin: 0; font-size: 0.95rem; }

.hero { text-align: center; padding: 28px 0 22px; }
.hero-logo {
  width: 76px;
  height: 76px;
  margin: 0 auto 16px;
  border-radius: 22px;
  box-shadow: 0 10px 28px rgba(201, 79, 23, 0.3);
}
.hero-title { font-size: 1.9rem; margin: 0 0 4px; }
.hero-sub { color: var(--muted); margin: 0; font-size: 1rem; }

.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding-left: 8px;
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  white-space: nowrap;
}
.brand-mark img { border-radius: 9px; }

/* ---------- 카드 ---------- */
.card {
  background: var(--surface);
  border: 0;
  border-radius: var(--radius);
  box-shadow: var(--elev-1);
  padding: 22px 20px;
  margin-bottom: 14px;
}
.card > h2:first-child { margin-bottom: 14px; }

.section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.05rem;
  font-weight: 800;
  margin: 22px 6px 10px;
}
.section-title .count { color: var(--accent-text); }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: var(--tap);
  padding: 12px 22px;
  border: 0;
  border-radius: var(--radius-md);
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
  cursor: pointer;
  text-decoration: none;
  touch-action: manipulation;
  transition: transform 0.12s var(--ease), background-color 0.15s ease, opacity 0.15s ease;
}
.btn:hover { background: var(--primary-press); }
.btn:active { transform: scale(0.97); background: var(--primary-press); }
.btn:disabled { opacity: 0.5; cursor: default; transform: none; }
.btn:focus-visible,
.input:focus-visible,
.list-row:focus-visible,
.sheet-item:focus-visible,
.action:focus-visible,
.tab:focus-visible { outline: 3px solid var(--focus-ring); outline-offset: 2px; }
.btn-block { display: flex; width: 100%; }
/* 보조 버튼: 회색 면 + 진한 글자 */
.btn-secondary { background: var(--fill); color: var(--text); }
.btn-secondary:hover, .btn-secondary:active { background: var(--fill-press); }
/* 옅은 강조 버튼 */
.btn-tonal { background: var(--primary-soft); color: var(--accent-strong); }
.btn-tonal:hover, .btn-tonal:active { background: var(--primary-soft-press); }
.btn-ghost { background: transparent; color: var(--accent-text); }
.btn-ghost:hover, .btn-ghost:active { background: var(--fill); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-danger:hover, .btn-danger:active { background: var(--danger-press); }
.btn-danger-text { color: var(--danger); }
.btn-danger-text:hover, .btn-danger-text:active { background: var(--danger-soft); }
.btn-small {
  min-height: 48px;
  padding: 8px 14px;
  font-size: 1.05rem;
  border-radius: var(--radius-sm);
}
.btn-back { gap: 2px; padding-left: 4px; padding-right: 10px; font-weight: 700; }
.btn-row { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.btn-row > .btn:last-child { white-space: nowrap; min-width: 96px; }

.link-strong { font-weight: 800; display: inline-block; padding: 10px 4px; }
.link-btn {
  min-height: 40px;
  padding: 4px 10px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
}
.link-btn:hover { background: var(--fill); }
.link-btn.danger { color: var(--danger); }

/* ---------- 입력칸 ---------- */
.field { margin-bottom: 18px; }
.label { display: block; font-weight: 800; margin: 0 2px 8px; font-size: 1rem; }
.input {
  width: 100%;
  min-height: var(--tap);
  padding: 13px 16px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  background: var(--fill);
  color: var(--text);
  font: inherit;
  font-size: 1.05rem; /* 16px 이상이어야 아이폰에서 화면이 확대되지 않음 */
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.input::placeholder { color: var(--placeholder); opacity: 1; }
.input:focus { outline: none; border-color: var(--primary); background: var(--surface); }
.hint { color: var(--muted); font-size: 0.9rem; margin: 6px 2px 0; }
.textarea { min-height: 0; resize: vertical; line-height: 1.6; display: block; }

/* 비밀번호 칸 + 보기 버튼 */
.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 92px; }
.pw-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  bottom: 6px;
  min-width: 72px;
  border: 0;
  border-radius: 11px;
  background: var(--surface);
  color: var(--text);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* 폼 안내/오류 상자 */
.form-msg {
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
  font-weight: 700;
  font-size: 0.98rem;
}
.form-msg.error { background: var(--danger-soft); color: var(--danger); }
.form-msg.success { background: var(--ok-soft); color: var(--ok); }
.form-msg.info { background: var(--fill); color: var(--muted); }
/* 접었다 펴는 도움말 (예: 알림 팝업 켜는 법, 다른 기기에 설치하기)
   안쪽 여백(padding)으로 띄워서, 안에 든 제목 · 버튼이 자기 여백 규칙과 상관없이 상자 가장자리에 붙지 않아요 */
.tip-box { margin: 14px 0 0; padding: 0 14px; border-radius: var(--radius-sm); background: var(--fill); }
.tip-box[open] { padding-bottom: 14px; }
.tip-box summary { cursor: pointer; list-style: none; margin: 0 -14px; padding: 12px 40px 12px 14px; font-weight: 800; position: relative; }
.tip-box summary::-webkit-details-marker { display: none; }
.tip-box summary::after { content: '+'; position: absolute; right: 14px; top: 50%; transform: translateY(-50%); font-size: 1.3rem; color: var(--accent-text); }
.tip-box[open] summary::after { content: '−'; }
.tip-box > :last-child { margin-bottom: 0; }
.tip-box h3 { margin-top: 12px; }
.note-box { margin: 12px 0; padding: 12px 14px; border-radius: var(--radius-sm); background: var(--fill); color: var(--muted); font-size: 0.95rem; }

.nick-status { margin: 8px 2px 0; font-weight: 800; font-size: 0.95rem; min-height: 0; }
.nick-status:empty { display: none; }
.nick-status.good { color: var(--ok); }
.nick-status.bad { color: var(--danger); }

/* ---------- 위쪽 막대 ---------- */
.appbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bar-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 var(--line);
  padding-top: env(safe-area-inset-top);
}
.appbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  min-height: 60px;
  padding: 0 8px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 8px;
}
.appbar-title {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 52vw;
}
.appbar-side { display: flex; align-items: center; min-width: 0; }
.appbar-right { justify-content: flex-end; }
.me-btn { gap: 8px; color: var(--text); font-weight: 800; padding-right: 8px; padding-left: 6px; border-radius: 999px; }

/* ---------- 아이콘 타일 · 목록 줄 ---------- */
.icon-tile {
  flex: none;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--accent-text);
}
.icon-tile.tone-gray { background: var(--fill); color: var(--muted); }
.icon-tile.tone-blue { background: #e8f1ff; color: #2563eb; }
.icon-tile.tone-green { background: #e3f5ea; color: #1f8a4c; }
.icon-tile.tone-violet { background: #f0ebff; color: #6d28d9; }
.icon-tile.tone-danger { background: var(--danger-soft); color: var(--danger); }
:root[data-theme='black'] .icon-tile.tone-blue { background: #1a2740; color: #7fb0ff; }
:root[data-theme='black'] .icon-tile.tone-green { background: #15301f; color: #4cc38a; }
:root[data-theme='black'] .icon-tile.tone-violet { background: #2a2140; color: #b9a0ff; }

.list-card { padding: 6px 8px; }
.list-row {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease;
}
.list-row:hover, .list-row:active { background: var(--fill); }
.list-row + .list-row { margin-top: 2px; }
.list-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.list-label { font-weight: 800; font-size: 1.05rem; }
.list-sub { color: var(--muted); font-size: 0.88rem; }
.list-chevron { color: var(--placeholder); }
.list-row.danger .list-label { color: var(--danger); }

/* ---------- 프로필 동그라미 (닉네임마다 다른 색) ---------- */
.avatar {
  flex: none;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--av1), var(--av2));
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
  --av1: #ffa26b;
  --av2: #e8590c;
  position: relative;
  overflow: hidden;
}
/* 프로필 사진 (다 받아지기 전에는 아래의 색 동그라미 + 첫 글자가 보여요) */
.avatar img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  opacity: 0;
}
.avatar.has-photo img { opacity: 1; }
.av-0 { --av1: #ffa26b; --av2: #e8590c; }
.av-1 { --av1: #ff8fab; --av2: #e03e74; }
.av-2 { --av1: #b197fc; --av2: #7048e8; }
.av-3 { --av1: #74c0fc; --av2: #1c7ed6; }
.av-4 { --av1: #63e6be; --av2: #0c9a6c; }
.av-5 { --av1: #8ce99a; --av2: #2b8a3e; }
.av-6 { --av1: #ffd43b; --av2: #e67700; }
.av-7 { --av1: #91a7ff; --av2: #3b5bdb; }
.avatar-sm { width: 34px; height: 34px; font-size: 0.9rem; }
.avatar-lg { width: 68px; height: 68px; font-size: 1.7rem; }
.avatar-xl { width: 96px; height: 96px; font-size: 2.4rem; }

.welcome { display: flex; align-items: center; gap: 16px; }
.welcome-hello { font-size: 1.3rem; font-weight: 800; margin: 0; letter-spacing: -0.02em; }

/* ---------- 불러오는 중 ---------- */
.spinner {
  width: 22px;
  height: 22px;
  border: 3px solid currentColor;
  border-right-color: transparent;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.spinner-brand { width: 34px; height: 34px; border-width: 3.5px; color: var(--primary); }
.spinner-sm { width: 18px; height: 18px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 화면에는 안 보이고 화면 읽기 프로그램 · 검색 도구만 읽는 글 */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.splash {
  min-height: 60vh;
  display: grid;
  place-items: center;
  color: var(--muted);
}

.skeleton-list { display: flex; flex-direction: column; }
.skeleton-card { display: flex; flex-direction: column; gap: 12px; }
.skeleton-card.sk-row { flex-direction: row; }
.sk-row { display: flex; align-items: center; gap: 14px; }
.sk-col { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.sk {
  display: block;
  border-radius: 8px;
  background: linear-gradient(90deg, var(--skeleton) 0%, var(--skeleton-shine) 50%, var(--skeleton) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s ease-in-out infinite;
}
.sk-circle { width: 44px; height: 44px; border-radius: 50%; flex: none; }
.sk-square { width: 52px; height: 52px; border-radius: 16px; flex: none; }
.sk-line { height: 14px; }
.sk-block { height: 180px; border-radius: 16px; }
.w25 { width: 25%; } .w40 { width: 40%; } .w50 { width: 50%; } .w70 { width: 70%; } .w90 { width: 90%; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* ---------- 알림 토스트 ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(24px + env(safe-area-inset-bottom));
  transform: translateX(-50%);
  width: max-content;
  max-width: calc(100% - 32px);
  text-align: center;
  background: var(--toast-bg);
  color: #fff;
  padding: 14px 22px;
  border-radius: 999px;
  font-size: 1rem;
  font-weight: 700;
  z-index: 1000;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: toast-in 0.28s var(--ease) both;
}
.toast.leaving { animation: toast-out 0.2s ease both; }
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 16px); } to { opacity: 1; transform: translate(-50%, 0); } }
@keyframes toast-out { to { opacity: 0; transform: translate(-50%, 8px); } }
/* 두 줄이 넘는 긴 안내는 둥근 네모로 */
@media (max-width: 420px) { .toast { border-radius: 18px; } }

/* ---------- 확인 창 · 아래 메뉴 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  background: var(--overlay);
  display: flex;
  animation: fade-in 0.18s ease both;
}
.overlay.closing { animation: fade-out 0.18s ease both; }
.overlay-center { align-items: center; justify-content: center; padding: 24px 20px; }
.overlay-bottom { align-items: flex-end; justify-content: center; }
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fade-out { to { opacity: 0; } }

.dialog {
  width: 100%;
  max-width: 400px;
  background: var(--surface);
  border-radius: 24px;
  padding: 26px 22px 20px;
  box-shadow: var(--elev-2);
  animation: dialog-in 0.24s var(--ease) both;
}
.overlay.closing .dialog { animation: dialog-out 0.18s ease both; }
.dialog-title { font-size: 1.25rem; margin: 0 0 8px; }
.dialog-msg { color: var(--muted); white-space: pre-line; margin: 0 0 4px; }
.dialog-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 22px; }
@keyframes dialog-in { from { opacity: 0; transform: scale(0.94); } to { opacity: 1; transform: none; } }
@keyframes dialog-out { to { opacity: 0; transform: scale(0.97); } }

.sheet {
  width: 100%;
  max-width: var(--max-width);
  background: var(--surface);
  border-radius: 26px 26px 0 0;
  padding: 10px 16px calc(16px + env(safe-area-inset-bottom));
  box-shadow: var(--elev-2);
  animation: sheet-in 0.28s var(--ease) both;
}
.overlay.closing .sheet { animation: sheet-out 0.2s ease both; }
.sheet-handle { display: block; width: 40px; height: 5px; border-radius: 3px; background: var(--fill-press); margin: 0 auto 12px; }
.sheet-title { color: var(--muted); font-size: 0.9rem; font-weight: 800; margin: 0 8px 6px; }
.sheet-items { display: flex; flex-direction: column; margin-bottom: 12px; }
.sheet-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 60px;
  padding: 10px 12px;
  border: 0;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  font: inherit;
  font-size: 1.1rem;
  font-weight: 800;
  text-align: left;
  cursor: pointer;
}
.sheet-item:hover, .sheet-item:active { background: var(--fill); }
.sheet-item.danger { color: var(--danger); }
@keyframes sheet-in { from { transform: translateY(100%); } to { transform: none; } }
@keyframes sheet-out { to { transform: translateY(100%); } }

/* ---------- 점검 목록 (연결 확인 화면) ---------- */
.checklist { list-style: none; margin: 0; padding: 0; }
.check {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.check:first-child { border-top: 0; padding-top: 0; }
.check-icon {
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.2rem;
  font-weight: 800;
  background: var(--fill);
  color: var(--muted);
}
.check.ok .check-icon { background: var(--ok-soft); color: var(--ok); }
.check.fail .check-icon { background: var(--danger-soft); color: var(--danger); }
.check.warn .check-icon { background: var(--warn-soft); color: var(--warn); }
.check-title { font-weight: 800; margin: 0; }
.check-detail { margin: 2px 0 0; color: var(--muted); font-size: 0.95rem; }
.check.fail .check-detail { color: var(--danger); }

.banner {
  border-radius: var(--radius);
  padding: 18px 20px;
  font-weight: 800;
  font-size: 1.1rem;
  margin-bottom: 14px;
}
.banner.ok { background: var(--ok-soft); color: var(--ok); }
.banner.fail { background: var(--danger-soft); color: var(--danger); }
.banner.wait { background: var(--surface); color: var(--muted); box-shadow: var(--elev-1); }

/* =====================================================================
   홈 · 초대 · 그룹
   ===================================================================== */
.invite-card {
  background: var(--surface);
  box-shadow: var(--elev-1), inset 0 0 0 2px var(--highlight-border);
}
.invite-head { display: flex; align-items: center; gap: 14px; margin-bottom: 14px; }
.invite-from { color: var(--muted); margin: 0; font-size: 0.92rem; }
.invite-group { font-size: 1.3rem; font-weight: 800; margin: 0; letter-spacing: -0.02em; line-height: 1.3; }

.group-list { list-style: none; margin: 0 0 14px; padding: 0; }
.group-list li + li { margin-top: 10px; }
.group-item {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 84px;
  padding: 16px 14px 16px 16px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--elev-1);
  color: var(--text);
  text-decoration: none;
  transition: transform 0.12s var(--ease);
}
.group-item:active { transform: scale(0.985); }
.group-icon {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 17px;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 1.4rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--av1, #ffa26b), var(--av2, #e8590c));
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
}
.group-text { flex: 1; min-width: 0; }
.group-name {
  margin: 0;
  font-size: 1.15rem;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.01em;
}
.group-sub { margin: 0; color: var(--muted); font-size: 0.92rem; }
.chevron { color: var(--placeholder); }

.unread-badge, .tab-badge {
  min-width: 26px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--badge);
  color: #fff;
  font-size: 0.85rem;
  font-weight: 800;
  line-height: 1.45;
  text-align: center;
}
.unread-badge { flex: none; font-size: 0.95rem; padding: 3px 10px; }

.empty { text-align: center; padding: 10px 0 6px; }
.empty-icon {
  width: 76px;
  height: 76px;
  margin: 0 auto 14px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--primary-soft);
  color: var(--accent-text);
}
.empty-title { font-size: 1.15rem; font-weight: 800; margin-bottom: 6px; }
.empty .muted { margin-bottom: 4px; }

.my-nick {
  background: var(--fill);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  margin: 16px 0;
  text-align: center;
}
.my-nick-value { font-size: 1.5rem; font-weight: 800; color: var(--accent-strong); margin: 4px 0 0; }

/* 아래쪽 탭 (소식 · 채팅 · 가족) */
.page-with-tabs { padding-bottom: calc(var(--tabbar-h) + 44px + env(safe-area-inset-bottom)); }
.tabbar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  background: var(--tabbar-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 -1px 0 var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
}
.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: var(--tabbar-h);
  color: var(--placeholder);
  text-decoration: none;
  font-weight: 800;
  font-size: 0.85rem;
  position: relative;
  transition: color 0.15s ease;
}
.tab .icon { width: 27px; height: 27px; }
.tab.active { color: var(--accent-text); }
.tab.active .icon { stroke-width: 2.4; }
.tab:active .icon { transform: scale(0.9); }
.tab-badge { position: absolute; top: 5px; left: calc(50% + 6px); font-size: 0.78rem; min-width: 22px; padding: 1px 6px; }

/* 사람 목록 */
.people { list-style: none; margin: 0; padding: 0; }
.person {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.person:first-child { border-top: 0; padding-top: 0; }
.person:last-child { padding-bottom: 0; }
.person-text { flex: 1; min-width: 0; }
.person-name { margin: 0; font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.person-handle { font-weight: 600; font-size: 0.9rem; color: var(--muted); overflow-wrap: anywhere; }
.badge {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 1px 9px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--muted);
}
.badge-owner { background: var(--primary-soft); color: var(--accent-strong); }

.card-head { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.card-head .muted { margin: 0; font-size: 0.92rem; }

.share-hint { margin-top: 20px; padding-top: 18px; border-top: 1px solid var(--line); }
.share-hint p { margin-bottom: 10px; }

/* 아래쪽 탭이 있는 화면에서는 알림 문구를 탭 위로 */
body:has(.tabbar) .toast { bottom: calc(var(--tabbar-h) + 18px + env(safe-area-inset-bottom)); }

/* =====================================================================
   소식(피드)
   ===================================================================== */
.compose-prompt {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px 14px 16px;
  text-decoration: none;
  color: var(--muted);
  transition: transform 0.12s var(--ease);
}
.compose-prompt:active { transform: scale(0.985); }
.compose-fake-input {
  flex: 1;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  min-height: 50px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--fill);
  color: var(--placeholder);
  font-size: 1rem;
  font-weight: 700;
  line-height: 50px;
  display: block;
}
.compose-photo { flex: none; }

.new-pill {
  position: sticky;
  top: calc(72px + env(safe-area-inset-top));
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 auto 12px;
  padding: 12px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--primary);
  color: var(--on-primary);
  font: inherit;
  font-weight: 800;
  box-shadow: var(--pill-shadow);
  cursor: pointer;
  animation: toast-in-plain 0.28s var(--ease) both;
}
@keyframes toast-in-plain { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.post { padding: 18px 18px 6px; }
.post-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.post-meta { flex: 1; min-width: 0; }
.post-author { margin: 0; font-weight: 800; line-height: 1.35; }
.post-time { margin: 0; color: var(--muted); font-size: 0.88rem; }
.more-btn {
  flex: none;
  width: 48px;
  height: 48px;
  margin-right: -8px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.more-btn:hover, .more-btn:active { background: var(--fill); }

.post-text { white-space: pre-wrap; font-size: 1.05rem; margin: 0 0 14px; }
.post-text.clamp {
  display: -webkit-box;
  -webkit-line-clamp: 8;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.read-more { display: inline-block; font-weight: 800; margin: -8px 0 12px; padding: 6px 0; }

/* 사진 묶음 (카드 안에 둥글게) */
.photos {
  display: grid;
  gap: 4px;
  margin: 0 0 6px;
  border-radius: 16px;
  overflow: hidden;
}
.photos-1 { grid-template-columns: 1fr; }
.photos-2, .photos-3, .photos-4 { grid-template-columns: 1fr 1fr; }
.photos-3 .photo:first-child { grid-column: 1 / -1; }
.photo {
  position: relative;
  display: block;
  padding: 0;
  border: 0;
  background: var(--fill);
  cursor: zoom-in;
  aspect-ratio: 1 / 1;
  overflow: hidden;
}
.photos-1 .photo { aspect-ratio: auto; max-height: 75vh; }
.photos-3 .photo:first-child { aspect-ratio: 16 / 9; }
.photo img { width: 100%; height: 100%; object-fit: cover; }
.photos-1 .photo img { height: auto; max-height: 75vh; object-fit: contain; margin: 0 auto; }
.photo-more {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  font-size: 1.8rem;
  font-weight: 800;
}
.photo-missing {
  display: grid;
  place-items: center;
  height: 100%;
  min-height: 120px;
  color: var(--muted);
  font-size: 0.9rem;
}
.photos-stacked { grid-template-columns: 1fr; gap: 8px; border-radius: 0; }
.photos-stacked .photo { aspect-ratio: auto; border-radius: 16px; }
.photos-stacked .photo img { height: auto; object-fit: contain; }

.post-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  border-top: 1px solid var(--line);
  margin: 10px -8px 0;
  padding: 6px 0;
}
.post-actions:has(> :only-child) { grid-template-columns: 1fr; }
.action {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
.action:hover, .action:active { background: var(--fill); }
.action.liked { color: var(--like); }
.like-icon { display: grid; place-items: center; }
.action.liked .like-icon { animation: pop 0.35s var(--ease); }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.likers { display: flex; align-items: center; gap: 6px; margin: 0; padding: 4px 4px 12px; color: var(--muted); font-size: 0.95rem; }
.likers .icon { color: var(--like); }
.likers:empty { display: none; }

/* 댓글 */
.comment-list { list-style: none; margin: 0; padding: 0; }
.comment { display: flex; gap: 10px; padding: 14px 0; border-top: 1px solid var(--line); }
.comment:first-child { border-top: 0; padding-top: 4px; }
.comment-body { flex: 1; min-width: 0; }
.comment-meta { margin: 0; color: var(--muted); font-size: 0.88rem; }
.comment-meta strong { color: var(--text); font-size: 1rem; margin-right: 2px; }
.comment-text { margin: 2px 0 0; white-space: pre-wrap; }
.comment-tools { display: flex; gap: 4px; margin: 4px 0 0 -10px; }
.comment-body .textarea { margin-top: 6px; }

/* 아래쪽 고정 입력칸 (댓글, 채팅) */
.page-with-composer { padding-bottom: calc(110px + env(safe-area-inset-bottom)); }
.composer {
  position: fixed;
  left: 0;
  right: 0;
  bottom: var(--kb, 0px); /* 키보드 높이(--kb)만큼 위로 */
  z-index: 60;
  background: var(--tabbar-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 -1px 0 var(--line);
  padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
}
.composer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
}
.composer-input {
  flex: 1;
  resize: none;
  max-height: 160px;
  min-height: 52px;
  padding: 12px 18px;
  border-radius: 26px;
}
.composer-send { flex: none; min-width: 80px; min-height: 52px; padding: 10px 18px; border-radius: 26px; }
body:has(.composer) .toast { bottom: calc(96px + env(safe-area-inset-bottom)); }

/* 글쓰기 */
.write-head { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.write-head p { margin: 0; font-weight: 800; }
.write-card .textarea { background: transparent; padding: 4px 2px; border: 0; border-radius: 0; font-size: 1.1rem; }
.write-card .textarea:focus { background: transparent; }
.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
  margin: 12px 0;
}
.thumbs:empty { display: none; }
.thumb { position: relative; aspect-ratio: 1 / 1; border-radius: 14px; overflow: hidden; background: var(--fill); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-remove {
  position: absolute;
  top: 5px;
  right: 5px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
}
.add-photo { border: 2px dashed var(--fill-press); background: transparent; color: var(--text); }
.add-photo:hover, .add-photo:active { background: var(--fill); }

/* 사진 크게 보기
   - 사진 전체가 항상 화면 안에 들어오게 (가로·세로 사진 모두, 잘리지 않게)
   - 휴대폰: 위쪽 막대 아래를 가로로 꽉 채우고, 넘기기 버튼은 사진 위에 작게
   - 컴퓨터: 사진 둘레에 여백을 두고, 넘기기 버튼은 사진 바깥 양옆에 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  display: flex;
  flex-direction: column;
  animation: fade-in 0.18s ease both;
  touch-action: pan-y pinch-zoom;
}
.lb-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: env(safe-area-inset-top) 10px 0 18px;
  min-height: calc(64px + env(safe-area-inset-top));
}
.lb-counter { color: #fff; font-weight: 800; font-size: 1.05rem; }
.lb-close {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 48px;
  padding: 8px 18px 8px 14px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.lb-close:hover, .lb-close:active { background: rgba(255, 255, 255, 0.26); }
.lb-close:focus-visible, .lb-nav:focus-visible { outline: 3px solid rgba(255, 255, 255, 0.75); outline-offset: 2px; }
/* 사진이 놓이는 칸: 위쪽 막대를 뺀 나머지 화면 전부 */
.lb-stage {
  position: relative;
  flex: 1;
  min-height: 0;
}
.lb-img {
  position: absolute;
  inset: 0 0 env(safe-area-inset-bottom);
  margin: auto;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: calc(100% - env(safe-area-inset-bottom));
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}
.lb-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  color: #fff;
  display: grid;
  place-items: center;
  cursor: pointer;
  z-index: 1;
}
.lb-nav:hover, .lb-nav:active { background: rgba(0, 0, 0, 0.65); }
.lb-prev { left: 8px; }
.lb-next { right: 8px; }

/* 컴퓨터 · 태블릿: 사진 둘레에 여백, 화살표는 사진 바깥 */
@media (min-width: 768px) {
  .lb-top { padding: 0 20px 0 28px; min-height: 72px; }
  .lb-img {
    inset: 8px 96px 32px;
    max-width: calc(100% - 192px);
    max-height: calc(100% - 40px);
    border-radius: 6px;
  }
  .lb-nav { width: 60px; height: 60px; background: rgba(255, 255, 255, 0.14); }
  .lb-nav:hover { background: rgba(255, 255, 255, 0.26); }
  .lb-prev { left: 20px; }
  .lb-next { right: 20px; }
}

/* 아주 작은 휴대폰(폭 360px 이하): 글쓰기 칸을 넓게 */
@media (max-width: 360px) {
  .compose-photo { display: none; }
  .compose-fake-input { padding: 0 14px; }
}

/* =====================================================================
   채팅
   ===================================================================== */
.page-chat { padding-top: 12px; padding-bottom: calc(var(--tabbar-h) + 100px + env(safe-area-inset-bottom)); }
.chat-composer { bottom: calc(var(--tabbar-h) + env(safe-area-inset-bottom) + var(--kb, 0px)); box-shadow: none; }
/* 글자를 입력하는 동안에는 아래쪽 탭을 숨기고 입력칸을 맨 아래로 */
body.typing .tabbar { display: none; }
body.typing .chat-composer { bottom: var(--kb, 0px); box-shadow: 0 -1px 0 var(--line); }
body.typing .page-chat { padding-bottom: calc(100px + env(safe-area-inset-bottom)); }

.composer-photo {
  flex: none;
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  background: var(--fill);
  color: var(--muted);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.composer-photo:hover, .composer-photo:active { background: var(--fill-press); }

.chat-list { display: flex; flex-direction: column; gap: 5px; }
.chat-empty { margin-top: 8px; }
.chat-day { text-align: center; margin: 16px 0 10px; }
.chat-day span {
  display: inline-block;
  padding: 5px 14px;
  border-radius: 999px;
  background: var(--chip-bg);
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 700;
}

.chat-row { display: flex; align-items: flex-start; gap: 8px; max-width: 100%; }
.chat-row.theirs:not(.continued) { margin-top: 10px; }
.chat-row.mine:not(.continued) { margin-top: 6px; }
.chat-row.mine { justify-content: flex-end; }
.chat-avatar-space { width: 34px; flex: none; }
.chat-col { min-width: 0; max-width: 86%; display: flex; flex-direction: column; }
.chat-row.mine .chat-col { align-items: flex-end; }
.chat-name { margin: 0 0 4px 2px; font-size: 0.9rem; font-weight: 800; color: var(--muted); }
.chat-line { display: flex; align-items: flex-end; gap: 6px; max-width: 100%; }
.chat-row.mine .chat-line { flex-direction: row-reverse; }

.chat-bubble {
  padding: 11px 15px;
  border-radius: 20px;
  background: var(--bubble-theirs);
  color: var(--text);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  font-size: 1.05rem;
  line-height: 1.5;
  min-width: 0;
}
.chat-row.theirs:not(.continued) .chat-bubble { border-top-left-radius: 6px; }
.chat-row.mine .chat-bubble { background: var(--bubble-mine); color: var(--bubble-mine-text); box-shadow: none; }
.chat-row.mine:not(.continued) .chat-bubble { border-top-right-radius: 6px; }
.chat-row.mine .chat-bubble a { color: inherit; }

.chat-photo {
  display: block;
  padding: 0;
  border: 0;
  border-radius: 18px;
  overflow: hidden;
  background: var(--fill);
  cursor: zoom-in;
  max-width: 240px;
}
.chat-photo img { display: block; max-width: 100%; max-height: 320px; object-fit: cover; }
.chat-photo .photo-missing { display: block; padding: 24px 16px; min-height: 0; }
.chat-photo.pending img { opacity: 0.6; }

.chat-meta {
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  font-size: 0.8rem;
  line-height: 1.25;
  color: var(--muted);
  padding-bottom: 2px;
}
.chat-row.mine .chat-meta { align-items: flex-end; }
.chat-unread { color: var(--unread); font-weight: 800; font-size: 0.88rem; }
.chat-unread:empty { display: none; }
.chat-status { color: var(--muted); display: flex; flex-direction: column; align-items: flex-end; gap: 2px; }
.chat-failed { color: var(--danger); font-weight: 800; }
.chat-row.pending .chat-bubble { opacity: 0.7; }

.chat-new-pill {
  position: fixed;
  top: auto;
  bottom: calc(var(--tabbar-h) + 84px + env(safe-area-inset-bottom) + var(--kb, 0px));
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  margin: 0;
  animation: none;
}

/* =====================================================================
   안내 상자 · 사용 방법
   ===================================================================== */
.notice {
  border-radius: var(--radius);
  padding: 18px 18px 16px;
  margin-bottom: 14px;
  background: var(--surface);
  box-shadow: var(--elev-1);
}
.notice p { margin: 0 0 12px; }
.notice-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.notice-head .notice-title { margin: 0; }
.notice-title { font-weight: 800; font-size: 1.08rem; }
.notice-warn { background: var(--warn-soft); box-shadow: inset 0 0 0 2px var(--warn-border); }
.notice-install { box-shadow: var(--elev-1), inset 0 0 0 2px var(--highlight-border); }

.help h2 { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.help h3 { margin: 18px 0 8px; font-size: 1.05rem; color: var(--accent-strong); }
.help h3:first-of-type { margin-top: 8px; }
.steps { margin: 0 0 8px; padding-left: 1.4em; }
.steps li { margin-bottom: 8px; padding-left: 4px; }
.steps li::marker { color: var(--accent-text); font-weight: 800; }
.bullets { margin: 0; padding-left: 1.2em; }
.bullets li { margin-bottom: 10px; }
.bullets li::marker { color: var(--accent-text); }

/* ---------- 배경 테마 고르기 ---------- */
.theme-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.theme-option {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 10px 10px 12px;
  border: 2px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  font: inherit;
  text-align: left;
  cursor: pointer;
  min-height: var(--tap);
  transition: border-color 0.15s ease, transform 0.12s var(--ease);
}
.theme-option:active { transform: scale(0.98); }
.theme-option.selected { border-color: var(--primary); box-shadow: 0 0 0 2px var(--primary) inset; }
.theme-swatch {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 10;
  border-radius: 10px;
  background: var(--swatch-bg);
  border: 1px solid rgba(0, 0, 0, 0.08);
  margin-bottom: 8px;
}
.theme-swatch-card {
  width: 62%;
  padding: 8px;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.theme-dark .theme-swatch-card { background: #1c1c1f; box-shadow: none; border: 1px solid #3a3a3f; }
.theme-swatch-line { height: 6px; width: 80%; border-radius: 3px; background: rgba(0, 0, 0, 0.15); }
.theme-dark .theme-swatch-line { background: rgba(255, 255, 255, 0.3); }
.theme-swatch-btn { height: 10px; width: 50%; border-radius: 4px; background: var(--swatch-accent); }
.theme-name { font-weight: 800; font-size: 1.05rem; }
.theme-desc { color: var(--muted); font-size: 0.85rem; }
.theme-check {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: none;
  place-items: center;
  background: var(--primary);
  color: var(--on-primary);
}
.theme-option.selected .theme-check { display: grid; }

/* ---------- 내 정보 ---------- */
.profile-card { display: flex; align-items: center; gap: 16px; }
.profile-card .muted { margin: 0; font-size: 0.95rem; }
.app-version { color: var(--muted); font-size: 0.85rem; text-align: center; margin: 18px 0 4px; }
.my-handle { margin: 2px 0 0; font-weight: 700; color: var(--accent-text); overflow-wrap: anywhere; }
.request-card { display: flex; align-items: center; gap: 14px; color: inherit; text-decoration: none; }
.request-text { flex: 1; min-width: 0; }
.request-text p { margin: 0; }
.request-title { font-weight: 800; font-size: 1.08rem; }
/* ---------- 동영상 (첫 장면 + 재생 표시) ---------- */
.video-thumb { position: relative; display: block; width: 100%; height: 100%; background: #1f1a17; }
.video-thumb video { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.video-play {
  position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px;
  border-radius: 50%; display: grid; place-items: center; color: #fff;
  background: rgba(0, 0, 0, 0.45); box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.85);
}
.video-play .icon { margin-left: 3px; }
.chat-video { width: 220px; aspect-ratio: 4 / 3; cursor: pointer; }
.chat-photo.pending .video-thumb { opacity: 0.6; }
.lb-video { background: #000; }

/* ---------- 안부 인사 ---------- */
.greet-card { padding-bottom: 14px; }
.greet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; flex-wrap: wrap; margin-bottom: 10px; }
.greet-head h2 { margin: 0; }
.greet-chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 6px; margin: 0 -4px; scroll-snap-type: x proximity; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.greet-chips::-webkit-scrollbar { display: none; }
.greet-chip {
  flex: none; scroll-snap-align: start; min-height: var(--tap); padding: 10px 18px; border: 0; border-radius: 999px;
  background: var(--primary-soft); color: var(--accent-strong); font: inherit; font-weight: 800; font-size: 1.02rem; cursor: pointer; white-space: nowrap;
}
.greet-chip:active { transform: scale(0.96); }
.greet-chip:disabled { opacity: 0.6; }
.greet-today { margin: 8px 0 0; }
.chat-bubble.chat-greeting { font-size: 1.25rem; font-weight: 800; padding: 12px 18px; }

/* ---------- 가족 달력 ---------- */
.cal-card { padding-bottom: 14px; }
.cal-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.cal-head h2 { margin: 0; font-size: 1.25rem; }
.cal-head .btn { width: auto; padding-inline: 10px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }
.cal-week span { text-align: center; font-weight: 800; font-size: 0.85rem; color: var(--muted); padding: 4px 0; }
.cal-week .sun, .cal-cell.sun .cal-num { color: #e03131; }
.cal-week .sat, .cal-cell.sat .cal-num { color: #1c7ed6; }
.cal-cell {
  position: relative; aspect-ratio: 1 / 1.05; min-width: 0; padding: 4px 0 0; border: 0; border-radius: 12px;
  background: none; color: var(--text); font: inherit; cursor: pointer;
  display: flex; flex-direction: column; align-items: center; gap: 1px;
}
.cal-cell.empty { cursor: default; }
.cal-num { font-weight: 700; font-size: 0.98rem; line-height: 1.6; width: 1.9em; border-radius: 50%; }
.cal-cell.today .cal-num { background: var(--primary); color: var(--on-primary) !important; }
.cal-cell.selected { background: var(--fill); box-shadow: inset 0 0 0 2px var(--primary); }
.cal-emoji { font-size: 0.8rem; line-height: 1; letter-spacing: -2px; }
.cal-day { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--line); }
.cal-day-title { margin: 0 0 6px; font-weight: 800; }
.event-list { list-style: none; margin: 0; padding: 0; }
.event-list li + li { border-top: 1px solid var(--line); }
.event-row {
  width: 100%; display: flex; align-items: center; gap: 12px; padding: 10px 2px; border: 0; background: none;
  color: inherit; font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.event-emoji { flex: none; width: 44px; height: 44px; border-radius: 14px; display: grid; place-items: center; font-size: 1.4rem; background: var(--fill); }
.event-text { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.event-text b { font-weight: 800; overflow-wrap: anywhere; }
.dday { flex: none; padding: 4px 10px; border-radius: 999px; background: var(--fill); color: var(--muted); font-weight: 800; font-size: 0.88rem; }
.dday.now { background: var(--primary); color: var(--on-primary); }
details.add-event > summary {
  list-style: none; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--tap); font-weight: 800; color: var(--accent-text);
}
details.add-event > summary::-webkit-details-marker { display: none; }
details.add-event[open] > summary { margin-bottom: 14px; }
.field-label { margin: 0 0 6px; font-weight: 800; }
.seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.seg.seg-4 { grid-template-columns: repeat(2, 1fr); }
@media (min-width: 420px) { .seg.seg-4 { grid-template-columns: repeat(4, 1fr); } }
.seg-item {
  min-height: 46px; padding: 8px 6px; border: 2px solid var(--line); border-radius: 14px; background: var(--surface);
  color: var(--text); font: inherit; font-weight: 800; cursor: pointer; white-space: nowrap;
}
.seg-item.on { border-color: var(--primary); background: var(--primary-soft); color: var(--accent-strong); }
.date-row { display: flex; gap: 6px; margin-top: 8px; }
.date-row .input { flex: 1; min-width: 0; }
.date-row .input[hidden] { display: none; }
.check-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-weight: 700; }
.check-row[hidden] { display: none; }
.check-row input { width: 22px; height: 22px; }
.event-preview { margin: 0; padding: 10px 14px; border-radius: 12px; background: var(--fill); font-weight: 700; }

/* ---------- 사진 탭 (달마다 모아 보기) ---------- */
.album-intro { margin: 0 0 12px; font-size: 0.92rem; }
.album-month { padding-bottom: 14px; }
.album-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 10px; margin-bottom: 12px; }
.album-head h2 { margin: 0; display: flex; align-items: baseline; gap: 8px; white-space: nowrap; }
.album-count { font-size: 0.92rem; font-weight: 700; color: var(--muted); }
.album-download { flex: none; white-space: nowrap; margin-left: auto; padding-inline: 10px; }
.album-download.locked { color: var(--muted); }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; margin: 0 -6px; }
.album-cell { position: relative; aspect-ratio: 1; padding: 0; border: 0; border-radius: 8px; overflow: hidden; background: var(--fill); cursor: pointer; }
.album-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-cell img:not([src]), .album-cell img.missing { visibility: hidden; }
@media (min-width: 520px) { .album-grid { grid-template-columns: repeat(4, 1fr); } }

/* ---------- 가족 프리미엄 ---------- */
.premium-card .card-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.badge-premium { background: #f0ebff; color: #6d28d9; }
:root[data-theme='black'] .badge-premium { background: #2a2140; color: #b9a0ff; }
.premium-perks { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.premium-perks li { display: flex; align-items: flex-start; gap: 12px; }
.premium-perks b { display: block; font-weight: 800; }
.premium-perks p { margin: 2px 0 0; }
.premium-perk-icon { flex: none; width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; background: var(--fill); color: var(--muted); }
.premium-perk-icon.on { background: #e3f5ea; color: #1f8a4c; }
.premium-free { margin: 12px 0 0; }
.coupon-form { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--line); }
.coupon-label { display: block; font-weight: 800; margin-bottom: 8px; }
.coupon-row { display: flex; gap: 8px; }
.coupon-row .input { flex: 1; min-width: 0; font-family: ui-monospace, monospace; letter-spacing: 0.04em; text-transform: uppercase; }
.coupon-row .btn { flex: none; width: auto; white-space: nowrap; }
.premium-interest { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line); }
.premium-interest p { margin: 0 0 8px; }
.coupon-make-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.coupon-made { margin-top: 12px; }
.coupon-code-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 6px 0; }
.coupon-code-row code, .stat-row code { font-family: ui-monospace, monospace; font-weight: 800; letter-spacing: 0.03em; overflow-wrap: anywhere; }

/* ---------- 운영자: 광고 성과 ---------- */
.stat-intro { margin: 0 0 12px; font-size: 0.92rem; }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.stat-tile {
  padding: 14px 16px;
  border-radius: var(--radius-md);
  background: var(--surface);
  box-shadow: var(--elev-1);
  min-width: 0;
}
.stat-tile p { margin: 0; }
.stat-label { color: var(--muted); font-weight: 700; font-size: 0.9rem; }
.stat-value { font-size: 1.6rem; font-weight: 800; margin-top: 2px !important; }
.stat-sub { color: var(--muted); font-size: 0.82rem; margin-top: 2px !important; overflow-wrap: anywhere; }
.stat-list { list-style: none; margin: 0; padding: 0; }
.stat-row { display: flex; align-items: center; gap: 12px; padding: 10px 0; }
.stat-row + .stat-row { border-top: 1px solid var(--line); }
.stat-row.compact { padding: 7px 0; }
.stat-row p { margin: 0; }
.stat-row-text { flex: 1; min-width: 0; }
.stat-row-name { flex: 1; min-width: 0; font-weight: 800; display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.stat-row-sub { color: var(--muted); font-size: 0.85rem; margin-top: 2px !important; }
.stat-row-num { flex: none; font-weight: 800; font-size: 1.1rem; font-variant-numeric: tabular-nums; }
.stat-row-num.zero { color: var(--placeholder); font-weight: 700; }
.stat-code { font-weight: 600; font-size: 0.8rem; color: var(--muted); background: var(--fill); padding: 0 8px; border-radius: 999px; }
.stat-note { margin: 12px 0 0; }

.age-badge { margin-top: 8px; font-size: 0.85rem; padding: 2px 10px; }
.age-badge.age-child { background: var(--primary-soft); color: var(--accent-strong); }

/* 내 정보: 큰 동그라미를 누르면 프로필 사진 칸으로 */
.avatar-button {
  position: relative;
  flex: none;
  padding: 0;
  border: 0;
  background: none;
  border-radius: 50%;
  cursor: pointer;
}
.avatar-button:active { transform: scale(0.97); }
.avatar-camera {
  position: absolute;
  right: -2px;
  bottom: -2px;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--surface);
  color: var(--text);
  border: 2px solid var(--line);
}

/* 프로필 사진 · 동그라미 색 고르기 */
.avatar-edit { display: flex; align-items: center; gap: 18px; }
.avatar-edit-buttons { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; min-width: 0; }
.avatar-edit-buttons .btn { width: auto; white-space: nowrap; }
@media (max-width: 360px) {
  .avatar-edit { gap: 12px; }
  .avatar-edit .avatar-xl { width: 72px; height: 72px; font-size: 1.8rem; }
  .avatar-edit-buttons .btn { padding-inline: 14px; }
}
.color-title { margin: 20px 0 10px; font-size: 1.02rem; }
.color-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.color-option {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: var(--tap);
  min-height: var(--tap);
  padding: 4px;
  border: 2px solid transparent;
  border-radius: 999px;
  background: none;
  color: var(--text);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}
.color-option.color-auto { padding-right: 14px; background: var(--fill); }
.color-option.selected { border-color: var(--primary); }
.color-option:disabled { opacity: 0.6; }
.color-dot {
  width: 36px;
  height: 36px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(135deg, var(--av1), var(--av2)); /* 색은 av-0 ~ av-7 */
}
.color-dot svg { display: none; filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.3)); }
.color-option.selected .color-dot svg { display: block; }
.color-hint { margin: 10px 0 0; }

/* ---------- 자녀 계정 (만 14세 미만 · 보호자 동의) ---------- */
.child-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 6px;
}
.child-row + .child-row { border-top: 1px solid var(--line); }
.child-info { flex: 1; min-width: 0; }
.child-info p { margin: 0; }
.child-name { font-weight: 800; font-size: 1.08rem; overflow-wrap: anywhere; }
.child-actions { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.child-row > .btn, .child-actions .btn { flex: none; }
.child-empty { margin: 10px 8px; }
.link-input { font-size: 0.95rem; text-align: center; }
.guardian-ok { display: flex; align-items: center; gap: 14px; }
.guardian-ok p { margin: 0; }
.guardian-ok-title { font-weight: 800; font-size: 1.1rem; margin-bottom: 2px !important; }
.consent-hint {
  margin: 10px 0 0; padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: var(--fill); color: var(--muted); font-size: 0.92rem;
}
.consent-hint strong { color: var(--text); }
@media (max-width: 360px) {
  .child-row { flex-wrap: wrap; }
  .child-actions { width: 100%; justify-content: stretch; }
  .child-actions .btn { flex: 1; }
}

/* =====================================================================
   약관 · 개인정보처리방침
   ===================================================================== */
.legal h1 { font-size: 1.4rem; }
.legal-article { margin-top: 24px; }
.legal-article h2 { font-size: 1.1rem; margin-bottom: 8px; color: var(--accent-strong); }
.legal-article p { margin-bottom: 8px; }
.legal-date { margin-top: 24px; }
.legal-table-wrap { margin: 8px 0 12px; }
.legal-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.legal-table th, .legal-table td {
  border: 1px solid var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}
.legal-table th { background: var(--fill); font-weight: 800; }
/* 휴대폰: 표를 옆으로 밀지 않아도 되게 한 줄씩 카드로 */
@media (max-width: 600px) {
  .legal-table thead { display: none; }
  .legal-table, .legal-table tbody, .legal-table tr, .legal-table td { display: block; width: 100%; }
  .legal-table tr {
    background: var(--fill);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 10px;
  }
  .legal-table td { border: 0; padding: 2px 0; }
  .legal-table td::before {
    content: attr(data-label);
    display: block;
    font-size: 0.85rem;
    font-weight: 800;
    color: var(--muted);
  }
  .legal-table td + td { margin-top: 6px; }
}
.legal-links { margin-top: 4px; }
.legal-privacy-link { font-weight: 800; color: var(--text); }

/* ---------- 동의 체크 ---------- */
.consent-title { font-size: 1.1rem; margin: 22px 2px 10px; }
.consent {
  background: var(--fill);
  border-radius: var(--radius-md);
  padding: 4px 14px;
  margin-bottom: 16px;
}
.consent-row { border-top: 1px solid var(--line); padding: 6px 0; display: flex; flex-wrap: wrap; align-items: center; }
.consent-label {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 48px;
  flex: 1;
  cursor: pointer;
  font-weight: 700;
}
.consent-all { font-weight: 800; font-size: 1.05rem; }
.consent-view { padding: 8px 4px 8px 12px; font-weight: 800; font-size: 0.95rem; }
.consent-summary {
  width: 100%;
  margin: 0 0 6px;
  padding: 10px 12px 10px 28px;
  border-radius: 12px;
  background: var(--surface);
  color: var(--muted);
  font-size: 0.88rem;
}
.check-input {
  flex: none;
  width: 26px;
  height: 26px;
  margin: 0;
  accent-color: var(--primary);
  cursor: pointer;
}
.danger-list li::marker { color: var(--danger); }

/* =====================================================================
   움직임을 줄이도록 설정한 휴대폰에서는 애니메이션을 끔
   ===================================================================== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .spinner { animation-duration: 2s !important; animation-iteration-count: infinite !important; }
}

/* ---------- 알림 ---------- */
.key-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 0 2px 8px; }
.key-value { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.85rem; word-break: break-all; }
.push-card .form-msg { margin-bottom: 12px; }

/* =====================================================================
   소개 화면 (welcome.html) — 광고 · 홍보 링크로 처음 온 사람이 보는 화면
   ===================================================================== */
body.landing { line-height: 1.65; }
.lp-wrap { width: 100%; max-width: 1080px; margin: 0 auto; padding: 0 20px; }
.lp-narrow { max-width: 720px; }
.lp-center { text-align: center; }

.lp-top {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--bar-bg);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  box-shadow: 0 1px 0 var(--line);
  padding-top: env(safe-area-inset-top);
}
.lp-top-inner { display: flex; align-items: center; justify-content: space-between; min-height: 60px; }
.lp-logo { display: inline-flex; align-items: center; gap: 8px; color: var(--text); text-decoration: none; font-weight: 800; font-size: 1.2rem; letter-spacing: -0.02em; }
.lp-logo img { border-radius: 10px; }
.lp-top-login { font-weight: 800; text-decoration: none; padding: 10px 16px; border-radius: 999px; background: var(--surface); color: var(--text); box-shadow: var(--elev-1); }

.lp-hero { padding: 32px 0 24px; overflow: hidden; }
.lp-hero-grid { display: grid; gap: 28px; align-items: center; }
.lp-chip {
  display: inline-block;
  margin: 0 0 14px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface);
  color: var(--accent-text);
  font-weight: 800;
  font-size: 0.9rem;
  box-shadow: var(--elev-1);
}
.lp-title { font-size: 2.3rem; line-height: 1.22; margin: 0 0 14px; letter-spacing: -0.03em; }
.lp-accent { color: var(--accent-text); }
.lp-lead { font-size: 1.1rem; color: var(--muted); margin: 0 0 22px; }
.lp-cta-row { display: flex; flex-direction: column; gap: 8px; max-width: 420px; }
.lp-cta { min-height: 60px; font-size: 1.2rem; box-shadow: var(--pill-shadow); }
.lp-sub-link { display: inline-block; padding: 10px 4px; font-weight: 800; text-align: center; }
.lp-badges { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 18px 0 0; }
.lp-badges li { padding: 4px 12px; border-radius: 999px; background: var(--chip-bg); color: var(--muted); font-weight: 700; font-size: 0.88rem; }

/* 휴대폰 모양 틀 */
.lp-phone {
  position: relative;
  width: 240px;
  padding: 9px;
  border-radius: 40px;
  background: #18181b;
  box-shadow: 0 30px 60px rgba(70, 35, 10, 0.25), inset 0 0 0 2px #2f2f35;
}
.lp-phone::before {
  content: '';
  position: absolute;
  top: 15px;
  left: 50%;
  width: 66px;
  height: 18px;
  transform: translateX(-50%);
  border-radius: 12px;
  background: #18181b;
  z-index: 2;
}
/* 화면 맨 위 상태 표시줄 자리 (노치가 앱 제목을 가리지 않게) */
.lp-phone::after {
  content: '';
  position: absolute;
  top: 9px;
  left: 9px;
  right: 9px;
  height: 28px;
  border-radius: 31px 31px 0 0;
  background: #fff3e6;
  z-index: 1;
}
.lp-phone img { display: block; width: 100%; height: auto; aspect-ratio: 390 / 844; margin-top: 28px; border-radius: 0 0 31px 31px; background: var(--fill); }

.lp-phones { position: relative; height: 470px; max-width: 420px; width: 100%; margin: 0 auto; }
.lp-phone-front { position: absolute; right: 6%; top: 0; z-index: 2; }
.lp-phone-back { position: absolute; left: 4%; top: 46px; transform: rotate(-7deg) scale(0.9); opacity: 0.95; }
.lp-notify {
  position: absolute;
  z-index: 3;
  left: 0;
  top: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 250px;
  padding: 10px 14px 10px 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  box-shadow: 0 12px 30px rgba(70, 35, 10, 0.22);
  color: #2a1f17;
  animation: lp-pop 0.6s 0.4s var(--ease) both;
}
.lp-notify img { border-radius: 9px; flex: none; }
.lp-notify p { margin: 0; line-height: 1.35; }
.lp-notify-title { font-weight: 800; font-size: 0.82rem; }
.lp-notify-body { font-size: 0.9rem; }
@keyframes lp-pop { from { opacity: 0; transform: translateY(-10px) scale(0.96); } to { opacity: 1; transform: none; } }

.lp-section { padding: 52px 0; }
.lp-h2 { font-size: 1.65rem; line-height: 1.3; margin: 0 0 20px; letter-spacing: -0.03em; }
.lp-kicker { margin: 0 0 6px; color: var(--accent-text); font-weight: 800; }
.lp-cards { display: grid; gap: 14px; }
.lp-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--elev-1); padding: 22px 20px; }
.lp-card p { margin: 0; color: var(--muted); }
.lp-card .lp-card-title, .lp-steps .lp-card-title { color: var(--text); font-weight: 800; font-size: 1.1rem; margin: 0 0 6px; }
.lp-ico { display: inline-grid; place-items: center; width: 48px; height: 48px; margin-bottom: 12px; border-radius: 15px; background: var(--primary-soft); color: var(--accent-text); }

.lp-feature-grid { display: grid; gap: 28px; align-items: center; justify-items: center; }
.lp-feature-grid > div:last-child { width: 100%; max-width: 460px; }
.lp-phone-solo { width: 230px; }
.lp-list { list-style: none; padding: 0; margin: 0; }
.lp-list li { position: relative; padding: 0 0 12px 34px; font-size: 1.05rem; }
.lp-list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--primary-soft) center / 14px no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8470f' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
}

.lp-steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 14px; }
.lp-steps li { display: flex; gap: 16px; align-items: flex-start; background: var(--surface); border-radius: var(--radius); box-shadow: var(--elev-1); padding: 20px; }
.lp-steps p { margin: 0; color: var(--muted); }
.lp-step-num { flex: none; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: var(--on-primary); font-weight: 800; font-size: 1.15rem; }

.lp-faq details { background: var(--surface); border-radius: var(--radius-md); box-shadow: var(--elev-1); margin-bottom: 10px; }
.lp-faq summary { cursor: pointer; list-style: none; padding: 18px 48px 18px 20px; font-weight: 800; font-size: 1.05rem; position: relative; }
.lp-faq summary::-webkit-details-marker { display: none; }
.lp-faq summary::after { content: '+'; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); font-size: 1.5rem; color: var(--accent-text); }
.lp-faq details[open] summary::after { content: '−'; }
.lp-faq details p { margin: 0; padding: 0 20px 18px; color: var(--muted); }

.lp-final { padding: 48px 0 56px; }
.lp-final .lp-cta { max-width: 420px; margin: 0 auto 6px; }
.lp-footer { padding: 28px 0 calc(28px + env(safe-area-inset-bottom)); text-align: center; box-shadow: 0 -1px 0 var(--line); }
.lp-footer p { margin: 0 0 6px; }

@media (min-width: 900px) {
  .lp-hero { padding: 64px 0 40px; }
  .lp-hero-grid { grid-template-columns: 1.05fr 1fr; gap: 40px; }
  .lp-title { font-size: 3.3rem; }
  .lp-lead { font-size: 1.25rem; }
  .lp-phones { height: 600px; max-width: 480px; }
  .lp-phone { width: 290px; }
  .lp-notify { top: 40px; }
  .lp-section { padding: 72px 0; }
  .lp-h2 { font-size: 2.1rem; }
  .lp-cards { grid-template-columns: repeat(3, 1fr); }
  .lp-cards-4 { grid-template-columns: repeat(4, 1fr); }
  .lp-steps { grid-template-columns: repeat(3, 1fr); }
  .lp-steps li { flex-direction: column; }
  .lp-feature-grid { grid-template-columns: 1fr 1fr; gap: 56px; }
  .lp-feature-rev .lp-phone-solo { order: 2; }
  .lp-phone-solo { width: 270px; }
}
@media (min-width: 600px) and (max-width: 899px) {
  .lp-cards-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 360px) {
  .lp-title { font-size: 2rem; }
  .lp-phone { width: 210px; }
  .lp-phones { height: 420px; }
  .lp-notify { max-width: 220px; }
}
