/* ============================================================
   조각모음 Design System v2.0
   - CSS 변수 중복 선언 제거 (5단계 → 1단계)
   - 최신 소셜앱 팔레트 (퍼플 그라디언트 시스템)
   - 성능: backdrop-filter 남용 제거
   - 접근성: focus-visible, reduced-motion
   ============================================================ */

/* ── 리셋 ──────────────────────────────────────────────────── */
*,
*::before,
*::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── 디자인 토큰 ───────────────────────────────────────────── */
:root {
  /* 색상 */
  --c-bg:       #f7f5fb;
  --c-card:     #ffffff;
  --c-text:     #14121f;
  --c-sub:      #6f667d;
  --c-line:     #e9e3f2;
  --c-accent:   #14121f;

  /* 브랜드 그라디언트 */
  --g-brand:    linear-gradient(135deg, #7c5cff, #ff6b8a);
  --g-dark:     linear-gradient(135deg, #17111f, #342450);
  --g-surface:  linear-gradient(135deg, rgba(255,255,255,.97), rgba(247,243,255,.96));
  --g-hero:     linear-gradient(180deg, rgba(39,30,72,.38), rgba(247,245,251,.98) 84%);

  /* 포인트 컬러 */
  --c-point:    #7c5cff;
  --c-point-2:  #ff6b8a;
  --c-mint:     #2dd4bf;
  --c-ok:       #14b8a6;
  --c-warn:     #ff6b57;
  --c-soft:     #f1edff;

  /* 그림자 */
  --s-xs:  0 4px 12px rgba(65,45,105,.06);
  --s-sm:  0 8px 22px rgba(65,45,105,.08);
  --s-md:  0 18px 48px rgba(65,45,105,.12);
  --s-lg:  0 28px 70px rgba(65,45,105,.18);

  /* 레이아웃 */
  --app-w: 414px;
  --nav-h: 74px;

  /* 트랜지션 */
  --t-fast: 140ms cubic-bezier(.4,0,.2,1);
  --t-mid:  240ms cubic-bezier(.4,0,.2,1);
}

/* ── 글로벌 ────────────────────────────────────────────────── */
html, body {
  min-width: 320px;
  height: 100%;
  background:
    radial-gradient(circle at 18% 0%, rgba(124,92,255,.12), transparent 30%),
    radial-gradient(circle at 82% 12%, rgba(255,107,138,.1), transparent 26%),
    #eceaf3;
  color: var(--c-text);
  font-family:
    "Pretendard Variable", Pretendard,
    "SUIT Variable", SUIT,
    "Noto Sans KR", "Apple SD Gothic Neo",
    ui-sans-serif, system-ui, -apple-system, sans-serif;
  word-break: keep-all;
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
}

#root {
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

button, input, select, textarea { font: inherit; }

button {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  border: 0;
  background: transparent;
}

/* 포커스 접근성 */
:focus-visible {
  outline: 2px solid var(--c-point);
  outline-offset: 2px;
  border-radius: 6px;
}

/* 모션 감소 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── 앱 셸 ─────────────────────────────────────────────────── */
.app-shell,
.auth-shell,
.splash-screen {
  width: min(100%, var(--app-w));
  min-height: 100dvh;
  margin: 0 auto;
  background: var(--g-surface), var(--c-bg);
  position: relative;
  overflow-x: hidden;
}

/* ── 스플래시 ───────────────────────────────────────────────── */
.splash-screen {
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(255,255,255,.08), rgba(247,247,248,.94)),
    url("https://jkmm.app/mai.png") center / cover no-repeat,
    #f7f7f8;
}

.splash-screen img {
  width: min(70%, 260px);
  max-height: 42vh;
  object-fit: contain;
  filter: drop-shadow(0 18px 40px rgba(15,23,42,.22));
}

/* ── 인증 히어로 ───────────────────────────────────────────── */
.auth-hero {
  position: relative;
  isolation: isolate;
  min-height: 360px;
  padding: 22px 18px 20px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  background: var(--g-hero),
    url("https://jkmm.app/mai.png") center 34% / cover no-repeat,
    var(--c-bg);
}

.auth-hero::before {
  content: "";
  position: absolute;
  inset: -22px;
  z-index: -2;
  background: url("https://jkmm.app/mai.png") center / cover no-repeat;
  filter: blur(26px) saturate(.72) brightness(.88);
  opacity: .7;
  transform: scale(1.1);
}

.auth-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(circle at 50% 18%, rgba(124,92,255,.14), transparent 28%),
    linear-gradient(180deg, rgba(20,16,36,.2), rgba(247,245,251,.98) 82%);
}

/* ── 브랜드 행 ─────────────────────────────────────────────── */
.brand-row {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: auto;
}

.brand-row span { color: rgba(255,255,255,.8); font-size: 12px; font-weight: 800; }

.brand-mark {
  padding: 9px 13px;
  border-radius: 999px;
  background: var(--g-dark);
  color: white;
  font-size: 13px;
  font-weight: 900;
  box-shadow: var(--s-sm);
}

/* ── 히어로 카드 ────────────────────────────────────────────── */
.eyebrow {
  color: var(--c-point);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .04em;
}

.hero-copy-card {
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,.72);
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(255,255,255,.94), rgba(246,241,255,.9));
  box-shadow: var(--s-md);
  padding: 18px;
}

.hero-kicker {
  display: inline-flex;
  border-radius: 999px;
  background: var(--g-brand);
  color: white;
  padding: 6px 10px;
  font-size: 10px;
  font-weight: 900;
}

.auth-hero h1 {
  margin-top: 12px;
  font-size: 30px;
  line-height: 1.12;
  font-weight: 900;
  color: #14121f;
}

.auth-hero h1::after {
  content: "";
  display: block;
  width: 48px;
  height: 4px;
  margin-top: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, #7c5cff, #ff6b8a, #2dd4bf);
}

.hero-copy {
  margin-top: 10px;
  max-width: 330px;
  color: #4c4660;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 700;
}

.hero-pills {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.hero-pills span {
  border-radius: 999px;
  background: rgba(255,255,255,.88);
  color: #14121f;
  padding: 8px 12px;
  font-size: 13px;
  font-weight: 850;
  box-shadow: var(--s-xs);
}

/* ── 인증 패널 ─────────────────────────────────────────────── */
.auth-panel,
.page-pad {
  padding: 16px 14px calc(var(--nav-h) + 28px);
}

/* ── 세그먼트 ───────────────────────────────────────────────── */
.segment {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  padding: 4px;
  border-radius: 10px;
  background: #e9e3f2;
}

.segment button {
  min-height: 42px;
  border-radius: 8px;
  color: var(--c-sub);
  font-size: 14px;
  font-weight: 850;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.segment .on {
  background: white;
  color: var(--c-text);
  box-shadow: var(--s-xs);
}

/* ── 인증 선택 ─────────────────────────────────────────────── */
.auth-choice,
.verify-options,
.two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.auth-choice { margin-top: 12px; }

.auth-choice button,
.verify-options button {
  min-height: 48px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: white;
  color: var(--c-text);
  font-size: 14px;
  font-weight: 850;
  transition: border-color var(--t-fast), background var(--t-fast), color var(--t-fast);
}

.auth-choice .selected {
  border-color: var(--c-point);
  background: var(--c-soft);
  color: var(--c-point);
}

/* ── 소셜 로그인 ────────────────────────────────────────────── */
.social-login {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 12px;
}

.social-login button {
  min-height: 44px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  color: var(--c-text);
  font-size: 13px;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}

.social-login button:active { transform: scale(.98); }
.social-login button:hover { box-shadow: var(--s-sm); }

.social-login button span {
  width: 22px; height: 22px;
  border-radius: 999px;
  display: grid; place-items: center;
  font-size: 13px; line-height: 1; font-weight: 950;
}

.social-login .social-kakao { border-color: #f6df49; background: #fee500; color: #191600; }
.social-login .social-kakao span { background: #191600; color: #fee500; }
.social-login .social-google { border-color: #dfe3ea; background: white; color: #202124; }
.social-login .social-google span {
  border: 1px solid #dfe3ea;
  background: conic-gradient(from 45deg, #4285f4, #34a853, #fbbc05, #ea4335, #4285f4);
  color: white;
}

/* ── 약관 박스 ─────────────────────────────────────────────── */
.terms-box {
  display: grid;
  gap: 7px;
  margin-top: 12px;
  border: 1px solid var(--c-line);
  border-radius: 12px;
  background: rgba(255,255,255,.72);
  padding: 10px;
}

.terms-box label {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 8px;
}

.terms-box .terms-master { background: #f1edff; }
.terms-box input { width: 18px; min-height: 18px; }
.terms-box b { font-size: 12px; line-height: 1.25; }
.terms-box em { margin-top: 2px; color: var(--c-sub); font-size: 10px; font-style: normal; line-height: 1.35; display: block; }
.terms-box a { border-radius: 999px; background: white; color: var(--c-point); padding: 5px 7px; font-size: 10px; font-weight: 900; text-decoration: none; }

/* ── 기억하기 행 ────────────────────────────────────────────── */
.remember-row {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
}

.remember-row input { width: 18px; min-height: 18px; }
.remember-row span { color: #4b5563; font-size: 13px; font-weight: 850; }

.auth-help-row {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 6px;
}

.auth-help-row button {
  min-height: 32px;
  color: #667085;
  font-size: 12px;
  font-weight: 850;
  transition: color var(--t-fast);
}

.auth-help-row button:hover { color: var(--c-text); }

.auth-help-row button + button::before {
  content: "";
  display: inline-block;
  width: 1px; height: 10px;
  margin: 0 9px 0 1px;
  background: #d6dbe3;
  vertical-align: -1px;
}

/* ── 이메일 인증 ────────────────────────────────────────────── */
.email-verify-box {
  display: grid;
  grid-template-columns: 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  margin-top: 8px;
  padding: 10px;
  border: 1px solid var(--c-line);
  border-radius: 10px;
  background: #f8fafc;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.email-verify-box button {
  min-height: 42px;
  border-radius: 8px;
  background: var(--c-accent);
  color: white;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
}

.email-verify-box input { min-height: 42px; }

.email-verify-box small {
  grid-column: 1 / -1;
  color: var(--c-sub);
  font-size: 11px;
  font-weight: 800;
}

.email-verify-box.verified {
  border-color: #73d6bb;
  background: #effdf8;
}

.auth-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 9px;
}

/* ── 폼 요소 ───────────────────────────────────────────────── */
label {
  display: block;
  margin-top: 12px;
}

label span {
  display: block;
  margin-bottom: 6px;
  color: var(--c-sub);
  font-size: 12px;
  font-weight: 850;
}

input, select, textarea {
  width: 100%;
  border: 1px solid #dfe3ea;
  border-radius: 10px;
  background: white;
  color: var(--c-text);
  outline: none;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
  box-shadow: inset 0 1px 0 rgba(16,17,22,.02);
}

input, select { min-height: 48px; padding: 0 14px; }

textarea {
  min-height: 104px;
  padding: 13px 14px;
  resize: vertical;
  line-height: 1.5;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(124,92,255,.72);
  box-shadow: 0 0 0 4px rgba(124,92,255,.13);
}

/* ── 버튼 공통 ─────────────────────────────────────────────── */
.primary-btn,
.studio-cta,
.join-btn,
.profile-save {
  width: 100%;
  min-height: 50px;
  border-radius: 12px;
  background: var(--g-dark);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  font-size: 15px;
  font-weight: 850;
  box-shadow: 0 10px 24px rgba(65,45,105,.14);
  transition: transform var(--t-fast), box-shadow var(--t-fast), filter var(--t-fast);
}

.primary-btn { margin-top: 16px; }
.primary-btn:hover, .join-btn:hover { filter: brightness(1.08); box-shadow: var(--s-md); }
.primary-btn:active, .join-btn:active { transform: scale(.98); }

.join-btn.joined { background: linear-gradient(135deg, #14b8a6, #059669); }

.ghost-btn {
  min-height: 50px;
  border-radius: 12px;
  background: #f1eef8;
  color: var(--c-text);
  padding: 0 14px;
  font-weight: 850;
  transition: background var(--t-fast);
}

.ghost-btn:hover { background: #e8e3f4; }

.mini-btn {
  min-height: 36px;
  border-radius: 999px;
  background: var(--g-dark);
  color: white;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 850;
}

.auth-note,
.safety-strip { margin-top: 12px; color: var(--c-sub); font-size: 12px; line-height: 1.5; }

.safety-strip {
  border: 1px solid #caeee5;
  border-radius: 12px;
  background: #edfbf7;
  color: #007a63;
  padding: 13px;
}

/* ── 신고 버튼 ──────────────────────────────────────────────── */
.report-btn {
  width: 32px; height: 32px;
  border-radius: 999px;
  background: #f6f3fc;
  color: var(--c-sub);
  font-size: 16px;
  display: grid; place-items: center;
  flex-shrink: 0;
  transition: background var(--t-fast), color var(--t-fast);
}
.report-btn:hover { background: #fff0f4; color: #d63d63; }
.filter-toggle-btn {
  flex-shrink: 0;
  min-height: 34px;
  border-radius: 999px;
  background: var(--g-dark);
  color: white;
  padding: 0 14px;
  font-size: 13px;
  font-weight: 900;
  transition: transform var(--t-fast);
}
.filter-toggle-btn:active { transform: scale(.95); }

.filter-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.filter-pill {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  background: #f1eef8;
  color: var(--c-text);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 850;
  border: 1px solid rgba(124,92,255,.15);
}

.filter-expanded {
  margin-top: 14px;
  animation: fade-in 180ms ease both;
}

.filter-section-label {
  margin: 14px 0 8px;
  color: var(--c-sub);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .05em;
}

@keyframes fade-in {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* ── 전체 검색 시트 ─────────────────────────────────────────── */
.search-sheet {
  width: min(100%, var(--app-w));
  max-height: 92dvh;
  border-radius: 20px 20px 0 0;
  background: var(--c-bg);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  animation: sheet-up var(--t-mid) both;
}

.search-sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 10px;
  background: white;
  border-bottom: 1px solid var(--c-line);
  flex-shrink: 0;
}

.search-input-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 12px;
  background: #f1eef8;
  padding: 0 12px;
  border: 1.5px solid transparent;
  transition: border-color var(--t-fast), background var(--t-fast);
}

.search-input-wrap:focus-within {
  border-color: rgba(124,92,255,.5);
  background: white;
}

.search-icon { color: var(--c-sub); font-size: 16px; flex-shrink: 0; }

.search-input-wrap input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 15px;
  outline: none;
  box-shadow: none;
  min-height: 44px;
  padding: 0;
  color: var(--c-text);
}

.search-clear {
  width: 22px; height: 22px;
  border-radius: 999px;
  background: #c4bcd4;
  color: white;
  font-size: 14px;
  font-weight: 900;
  display: grid; place-items: center;
  flex-shrink: 0;
}

.search-cancel {
  flex-shrink: 0;
  min-height: 38px;
  padding: 0 4px;
  color: var(--c-point);
  font-size: 14px;
  font-weight: 900;
}

/* ── 전체 검색 오버레이 ──────────────────────────────────────── */
.search-sheet-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(16,12,30,.38);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding-top: env(safe-area-inset-top, 0px);
}

.search-sheet-container {
  width: min(100%, var(--app-w));
  display: flex;
  flex-direction: column;
  max-height: 92dvh;
}

.search-sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px 8px;
  background: white;
  border-radius: 0 0 0 0;
}

/* 검색 결과 시트 */
.search-sheet {
  flex: 1;
  overflow-y: auto;
  background: var(--c-bg);
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.search-sheet::-webkit-scrollbar { display: none; }

/* 조각 하이라이트 */
.piece-card.highlighted {
  border: 2px solid var(--c-point);
  box-shadow: 0 0 0 4px rgba(124,92,255,.15), var(--s-md);
  animation: highlight-pulse 1.2s ease both;
}

@keyframes highlight-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(124,92,255,.4), var(--s-sm); }
  50%  { box-shadow: 0 0 0 8px rgba(124,92,255,.1), var(--s-md); }
  100% { box-shadow: 0 0 0 4px rgba(124,92,255,.15), var(--s-md); }
}

.search-section {
  padding: 16px 14px 4px;
}

.search-label {
  color: var(--c-sub);
  font-size: 12px;
  font-weight: 900;
  margin: 0 0 10px;
  letter-spacing: .04em;
}

/* 카테고리 그리드 */
.search-cat-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  padding-bottom: 4px;
}

.search-cat-btn {
  min-height: 52px;
  border-radius: 12px;
  background: white;
  color: var(--activity-color, var(--c-text));
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: 11px;
  font-weight: 900;
  box-shadow: var(--s-xs);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.search-cat-btn span { font-size: 20px; line-height: 1; }
.search-cat-btn:active { transform: scale(.94); }

/* 조각 결과 행 */
.search-piece-list { display: flex; flex-direction: column; gap: 6px; padding-bottom: 12px; }

.search-piece-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  background: white;
  padding: 11px 12px;
  box-shadow: var(--s-xs);
  text-align: left;
  transition: background var(--t-fast), transform var(--t-fast);
}
.search-piece-row:active { background: #f5f2fc; transform: scale(.99); }

.search-piece-icon {
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--activity-soft, #f1eef8);
  color: var(--activity-color, var(--c-point));
  font-size: 20px;
  display: grid; place-items: center;
}

.search-piece-row b { display: block; font-size: 14px; font-weight: 900; }
.search-piece-row span { display: block; margin-top: 2px; color: var(--c-sub); font-size: 12px; }
.search-piece-row em {
  border-radius: 999px;
  background: var(--c-soft);
  color: var(--c-point);
  padding: 5px 8px;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  white-space: nowrap;
}

/* 유저 결과 행 */
.search-user-list { display: flex; flex-direction: column; gap: 6px; padding-bottom: 20px; }

.search-user-row {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  background: white;
  padding: 11px 12px;
  box-shadow: var(--s-xs);
  text-align: left;
  transition: background var(--t-fast);
}
.search-user-row:active { background: #f5f2fc; }

.search-user-avatar {
  width: 40px; height: 40px;
  border-radius: 999px;
  background: var(--g-brand);
  color: white;
  font-size: 16px;
  font-weight: 900;
  display: grid; place-items: center;
}

.search-user-row b { display: block; font-size: 14px; font-weight: 900; }
.search-user-row span { display: block; margin-top: 2px; color: var(--c-sub); font-size: 12px; }

/* 검색 결과 없음 */
.search-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 48px 24px;
  text-align: center;
}

.search-empty span { font-size: 36px; }
.search-empty b { font-size: 16px; color: var(--c-text); }
.search-empty p { color: var(--c-sub); font-size: 14px; }

/* ── 메뉴 바텀시트 ──────────────────────────────────────────── */
.menu-sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  background: rgba(16,12,30,.48);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.menu-sheet {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, var(--app-w));
  z-index: 301;
  border-radius: 22px 22px 0 0;
  background: rgba(255,255,255,.98);
  padding: 10px 16px calc(28px + env(safe-area-inset-bottom, 0px));
  display: flex;
  flex-direction: column;
  gap: 4px;
  animation: sheet-up 220ms cubic-bezier(.34,1.2,.64,1) both;
}

.menu-sheet-handle {
  width: 36px; height: 4px;
  border-radius: 999px;
  background: #ddd8e8;
  margin: 0 auto 14px;
}

.menu-profile-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #f8f5ff, #fff0f8);
  border: 1px solid rgba(124,92,255,.12);
  cursor: pointer;
  margin-bottom: 6px;
  transition: background var(--t-fast);
}
.menu-profile-card:active { background: #ede8ff; }

.menu-avatar {
  width: 46px; height: 46px;
  border-radius: 13px;
  background: var(--g-brand);
  color: white;
  font-size: 18px;
  font-weight: 900;
  display: grid; place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}
.menu-avatar img { width: 100%; height: 100%; object-fit: cover; }

.menu-profile-info { flex: 1; min-width: 0; }
.menu-profile-info b { display: block; font-size: 16px; font-weight: 900; }
.menu-profile-info span { display: flex; align-items: center; gap: 5px; margin-top: 3px; color: var(--c-sub); font-size: 12px; }

.tier-chip {
  display: inline-flex;
  border-radius: 999px;
  padding: 2px 7px;
  font-size: 10px;
  font-weight: 900;
  font-style: normal;
}
.tier-chip.base   { background: #f3f4f6; color: #4b5563; }
.tier-chip.green  { background: #e9fbf6; color: #007a63; }
.tier-chip.blue   { background: var(--c-soft); color: #3f57d7; }
.tier-chip.gold   { background: #fff7d6; color: #9a6400; }
.tier-chip.legend { background: #14121f; color: white; }

.menu-arrow { color: #c4bcd4; font-size: 20px; font-weight: 300; }

.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 4px;
}

.menu-grid-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 76px;
  border-radius: 14px;
  background: #f6f3fc;
  border: 1.5px solid transparent;
  color: var(--c-sub);
  font-size: 13px;
  font-weight: 850;
  transition: background var(--t-fast), color var(--t-fast), transform var(--t-fast);
}
.menu-grid-item:active { transform: scale(.96); }
.menu-grid-item.active {
  background: var(--g-dark);
  color: white;
  box-shadow: 0 8px 20px rgba(65,45,105,.18);
}
.menu-grid-icon { font-size: 24px; line-height: 1; }

.menu-divider { height: 1px; background: #f0ecf8; margin: 6px 0; }

.menu-actions { display: flex; flex-direction: column; gap: 2px; }

.menu-action-row {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 52px;
  border-radius: 12px;
  padding: 0 12px;
  color: var(--c-text);
  font-size: 14px;
  font-weight: 850;
  text-align: left;
  transition: background var(--t-fast);
}
.menu-action-row:hover { background: #f6f3fc; }
.menu-action-row:active { background: #ede8ff; }

.menu-action-icon {
  width: 34px; height: 34px;
  border-radius: 10px;
  color: white;
  font-size: 15px;
  display: grid; place-items: center;
  flex-shrink: 0;
}
.menu-action-arrow { margin-left: auto; color: #c4bcd4; font-size: 18px; }

.menu-logout-row {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  border-radius: 12px;
  background: #fff5f7;
  color: #d63d63;
  font-size: 14px;
  font-weight: 900;
  margin-top: 2px;
  transition: background var(--t-fast);
}
.menu-logout-row:active { background: #ffe0e8; }

/* ── 탑바 ───────────────────────────────────────────────────── */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px 10px;
  background: rgba(250,248,255,.95);
  border-bottom: 1px solid rgba(233,227,242,.8);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.topbar-brand .eyebrow { color: var(--c-point); }
.topbar-brand h2 { margin-top: 2px; font-size: 20px; line-height: 1.24; }

.top-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

/* 아바타 — 버튼으로 처리 */
.avatar {
  width: 38px; height: 38px;
  border-radius: 11px;
  background: var(--g-dark);
  color: white;
  font-weight: 900;
  font-size: 15px;
  display: grid; place-items: center;
  overflow: hidden;
  border: none;
  cursor: pointer;
  transition: box-shadow var(--t-fast), transform var(--t-fast);
  flex-shrink: 0;
}
.avatar:hover { box-shadow: var(--s-sm); }
.avatar:active { transform: scale(.94); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* 햄버거 버튼 */
.menu-dot-btn {
  width: 38px; height: 38px;
  border-radius: 11px;
  border: 1px solid var(--c-line);
  background: white;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: background var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
  flex-shrink: 0;
}

.menu-dot-btn span {
  display: block;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: #3d3552;
}

.menu-dot-btn:hover { background: var(--c-soft); box-shadow: var(--s-xs); }
.menu-dot-btn:active { transform: scale(.93); }

/* ── 브랜드 배너 ────────────────────────────────────────────── */
.brand-banner {
  position: sticky;
  top: 65px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 10px;
  padding: 10px 16px;
  border-radius: 0 0 10px 10px;
  background: linear-gradient(135deg, rgba(25,18,38,.96), rgba(63,46,102,.96));
  color: white;
  box-shadow: var(--s-sm);
}

.brand-banner div { min-width: 0; }
.brand-banner b { display: block; font-size: 14px; line-height: 1.2; }
.brand-banner span { display: block; margin-top: 2px; color: rgba(255,255,255,.68); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.brand-banner em { flex: 0 0 auto; border-radius: 999px; background: var(--g-brand); color: white; padding: 6px 9px; font-size: 11px; font-style: normal; font-weight: 900; }

/* ── 수익 배너 ─────────────────────────────────────────────── */
.revenue-banners {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px 12px 0;
}

.revenue-card {
  min-height: 106px;
  border-radius: 12px;
  padding: 13px;
  text-align: left;
  box-shadow: var(--s-sm);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
  cursor: pointer;
}

.revenue-card:hover { transform: translateY(-2px); box-shadow: var(--s-md); }
.revenue-card:active { transform: scale(.98); }

.revenue-card.premium { background: linear-gradient(135deg, #211634, #6f4dff); color: white; }
.revenue-card.venue { background: linear-gradient(135deg, #fff3f6, #effffc); border: 1px solid #ffd9e2; color: #14121f; }

.revenue-card span, .revenue-card em { display: inline-flex; border-radius: 999px; padding: 5px 8px; font-size: 10px; font-weight: 900; }
.revenue-card span { background: rgba(255,255,255,.18); }
.revenue-card.venue span { background: #14121f; color: white; }
.revenue-card b { display: block; margin-top: 10px; font-size: 15px; line-height: 1.25; }
.revenue-card p { margin: 5px 0 8px; opacity: .72; font-size: 12px; line-height: 1.4; }
.revenue-card em { background: rgba(255,255,255,.82); color: var(--c-point); font-style: normal; }

/* ── 섹션 헤더 ─────────────────────────────────────────────── */
.section-head {
  padding: 22px 16px 10px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px;
}

.section-head.no-pad { padding: 0 0 14px; }
.section-head h2 { margin-top: 3px; font-size: 21px; line-height: 1.24; }

/* ── 매치 스튜디오 ──────────────────────────────────────────── */
.studio {
  margin: 12px 12px 0;
  padding: 18px;
  border-radius: 12px;
  border: 1px solid rgba(233,227,242,.96);
  background: var(--g-surface);
  box-shadow: var(--s-sm);
}

.studio-head { display: flex; justify-content: space-between; gap: 16px; }

.studio .eyebrow { color: var(--c-point); }

.studio h1 { margin: 6px 0 0; font-size: 27px; line-height: 1.18; font-weight: 900; }

.spark {
  width: 42px; height: 42px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--g-brand);
  color: white;
  font-size: 24px;
  font-weight: 900;
  flex-shrink: 0;
}

.quick-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-top: 18px;
}

.quick-grid button {
  min-height: 48px;
  border-radius: 10px;
  background: #f1eef8;
  color: var(--c-text);
  font-size: 14px;
  font-weight: 850;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.quick-grid button:hover { background: #e8e3f4; }
.quick-grid .hot { background: var(--g-dark); color: white; box-shadow: var(--s-xs); }

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.icon-pill {
  min-height: 40px;
  border-radius: 10px;
  background: white;
  color: var(--activity-color, var(--c-text));
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  gap: 6px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: var(--s-xs);
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast), transform var(--t-fast);
}

.icon-pill:hover { transform: translateY(-1px); box-shadow: var(--s-sm); }

.icon-pill span { font-size: 14px; line-height: 1; }

.icon-pill.active {
  background: var(--activity-color, var(--c-point));
  color: white;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--activity-color, var(--c-point)) 28%, transparent);
}

.mood-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.mood-cloud button {
  min-height: 34px;
  border-radius: 999px;
  background: #f1eef8;
  color: var(--c-sub);
  padding: 0 12px;
  font-size: 13px;
  font-weight: 800;
  transition: background var(--t-fast), color var(--t-fast);
}

.mood-cloud .selected { background: var(--g-dark); color: white; }

.studio-cta { margin-top: 14px; }

/* ── 피드 ───────────────────────────────────────────────────── */
.feed,
.thread-list {
  display: grid;
  gap: 12px;
  padding: 0 12px calc(var(--nav-h) + 28px);
}

.message-section .thread-list { padding: 0; }

/* ── 피스 카드 ─────────────────────────────────────────────── */
.piece-card,
.meeting-card {
  border-radius: 12px;
  background: white;
  padding: 16px;
  box-shadow: var(--s-sm);
  transition: transform var(--t-mid), box-shadow var(--t-mid);
}

.piece-card:hover { transform: translateY(-2px); box-shadow: var(--s-md); }

.card-top { display: flex; align-items: center; justify-content: space-between; }

.activity-orb,
.verify-icon,
.thread-icon {
  border-radius: 10px;
  background: var(--activity-soft, var(--c-soft));
  color: var(--activity-color, var(--c-point));
  display: grid;
  place-items: center;
  font-weight: 900;
}

.activity-orb { width: 42px; height: 42px; font-size: 21px; }

.card-status { display: flex; gap: 6px; }

.card-status span,
.tag-row span,
.rule-badge {
  border-radius: 999px;
  background: #f1eef8;
  color: #475467;
  padding: 6px 9px;
  font-size: 12px;
  font-weight: 800;
}

.piece-card h3 { margin: 13px 0 0; font-size: 20px; line-height: 1.28; font-weight: 900; }
.piece-card p { margin: 7px 0 0; color: var(--c-sub); font-size: 14px; line-height: 1.55; }

.meta-list { display: grid; gap: 5px; margin-top: 12px; color: var(--c-text); font-size: 13px; font-weight: 850; }

.signal-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.signal-row span { border-radius: 999px; background: var(--g-brand); color: white; padding: 7px 9px; font-size: 12px; font-weight: 900; }

.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag-row .verified, .rule-badge.same { background: #e9fbf7; color: #0f766e; }

.rule-badge { display: inline-flex; margin-top: 9px; }
.rule-badge.mixed { background: #fff0f4; color: #d63d63; }

.card-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; }
.join-btn { flex: 1; }

.empty {
  min-height: 150px;
  border-radius: 12px;
  background: white;
  box-shadow: var(--s-xs);
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--c-sub);
  padding: 24px;
}

.empty b { color: var(--c-text); }

/* ── 유저 카드 ─────────────────────────────────────────────── */
.user-search-card,
.message-section {
  margin-top: 14px;
  border-radius: 12px;
  background: white;
  padding: 14px;
  box-shadow: var(--s-xs);
}

.user-search-card p { margin: 8px 0 0; color: var(--c-sub); font-size: 12px; line-height: 1.5; }
.message-section h3 { margin: 0 0 10px; font-size: 16px; }
.user-card-list { display: grid; gap: 9px; }

.user-mini-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 9px;
  align-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(255,255,255,.98), rgba(250,248,255,.96));
  border: 1px solid rgba(233,227,242,.9);
  padding: 10px;
  box-shadow: var(--s-xs);
  transition: box-shadow var(--t-fast), transform var(--t-fast);
}

.user-mini-card:hover { transform: translateY(-1px); box-shadow: var(--s-sm); }

.user-main {
  display: grid;
  grid-template-columns: 46px 1fr;
  gap: 10px;
  align-items: center;
  min-width: 0;
  text-align: left;
  border-radius: 8px;
}

.user-avatar {
  width: 46px; height: 46px;
  border-radius: 10px;
  background: var(--g-brand);
  overflow: hidden;
  display: grid;
  place-items: center;
  color: white;
  font-weight: 950;
  flex-shrink: 0;
}

.user-avatar.big { width: 72px; height: 72px; border-radius: 14px; font-size: 24px; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }

.user-mini-card b { display: block; color: var(--c-text); font-size: 14px; }

.user-mini-card b em {
  display: inline-block;
  margin-left: 4px;
  border-radius: 999px;
  background: #e9fbf7;
  color: #0f766e;
  padding: 3px 7px;
  font-size: 10px;
  font-style: normal;
}

.user-mini-card p,
.user-mini-card small { display: block; margin: 3px 0 0; color: var(--c-sub); font-size: 11px; line-height: 1.35; }

.dm-btn {
  min-height: 38px;
  border-radius: 999px;
  background: var(--g-brand);
  color: white;
  padding: 0 12px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(124,92,255,.18);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.dm-btn:hover { transform: scale(1.04); }
.dm-btn:active { transform: scale(.97); }

/* ── 채팅 — 인스타 DM 스타일 ──────────────────────────────── */

.chat-shell {
  width: min(100%, var(--app-w));
  height: 100dvh;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  background: #faf8ff;
  overflow: hidden;
}

/* 채팅 안 광고 — flex 고정 높이, 채팅 영역 안 밀게 */
.chat-shell .page-ad-banner {
  flex: 0 0 auto;
  margin: 0;
  border-radius: 0;
  min-height: 50px;
  max-height: 50px;
  overflow: hidden;
}

/* 헤더 */
.room-head {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(233,227,242,.8);
}

.room-back {
  width: 38px; height: 38px;
  border-radius: 999px;
  background: #f1edff;
  color: #6d4cff;
  font-size: 18px;
  font-weight: 900;
  display: grid; place-items: center;
  transition: transform var(--t-fast);
}
.room-back:active { transform: scale(.93); }

.room-head-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.room-avatar {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--g-brand);
  color: white;
  font-size: 14px;
  font-weight: 900;
  display: grid; place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.room-head b {
  display: block;
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-head span {
  display: block;
  margin-top: 1px;
  color: var(--c-sub);
  font-size: 11px;
  font-weight: 700;
}

.room-leave {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff0f4;
  color: #d63d63;
  font-size: 11px;
  font-weight: 900;
}

/* 메시지 리스트 — 남은 공간 전부 차지 + 스크롤 */
.chat-list {
  flex: 1 1 0;
  min-height: 0;          /* ← 핵심: flex child가 줄어들 수 있게 */
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 14px 8px;
  background: #faf8ff;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chat-list::-webkit-scrollbar { display: none; }

/* 말풍선 밀어내기 — 메시지 적을 때 아래 붙게 */
.chat-list::before {
  content: "";
  flex: 1;
}

.chat-date-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 6px;
  color: var(--c-sub);
  font-size: 11px;
  font-weight: 700;
}
.chat-date-divider::before,
.chat-date-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-line);
}

/* 말풍선 행 */
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.chat-row.mine { flex-direction: row-reverse; }

.bubble-avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--g-brand);
  color: white;
  font-size: 11px;
  font-weight: 900;
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-bottom: 2px;
  overflow: hidden;
}
.chat-row.mine .bubble-avatar { display: none; }

.bubble-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 72%;
}
.chat-row.mine .bubble-group { align-items: flex-end; }

.chat-bubble {
  width: fit-content;
  max-width: 100%;
  border-radius: 18px;
  padding: 9px 13px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  background: white;
  color: var(--c-text);
  box-shadow: 0 2px 8px rgba(65,45,105,.08);
  border-bottom-left-radius: 5px;
  animation: bubble-in 180ms cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes bubble-in {
  from { opacity: 0; transform: scale(.9) translateY(4px); }
  to   { opacity: 1; transform: none; }
}

.chat-row.mine .chat-bubble {
  background: var(--g-brand);
  color: white;
  box-shadow: 0 4px 14px rgba(124,92,255,.28);
  border-bottom-left-radius: 18px;
  border-bottom-right-radius: 5px;
}

.bubble-time {
  font-size: 10px;
  color: var(--c-sub);
  font-weight: 700;
  padding: 0 4px 2px;
}
.chat-row.mine .bubble-time { text-align: right; }

.chat-system {
  text-align: center;
  color: var(--c-sub);
  font-size: 11px;
  font-weight: 700;
  margin: 8px 0 4px;
}

/* 입력창 — flex 고정 하단 */
.chat-compose {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  padding-bottom: calc(10px + env(safe-area-inset-bottom, 0px));
  background: white;
  border-top: 1px solid rgba(233,227,242,.7);
}

.chat-input-wrap {
  flex: 1;
  min-height: 44px;
  border-radius: 22px;
  border: 1.5px solid var(--c-line);
  background: #f5f2fc;
  display: flex;
  align-items: center;
  padding: 0 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.chat-input-wrap:focus-within {
  border-color: rgba(124,92,255,.6);
  box-shadow: 0 0 0 3px rgba(124,92,255,.1);
  background: white;
}

#message-input {
  flex: 1;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--c-text);
  font-size: 14px;
  outline: none;
  padding: 0;
  box-shadow: none;
  border-radius: 0;
}

.chat-send-btn {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--g-brand);
  color: white;
  font-size: 20px;
  font-weight: 900;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(124,92,255,.3);
  transition: transform var(--t-fast), opacity var(--t-fast);
}
.chat-send-btn:active { transform: scale(.92); }

/* 쪽지 목록 스레드 */
.thread {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  background: white;
  border: 1px solid rgba(233,227,242,.9);
  padding: 12px;
  box-shadow: var(--s-xs);
  text-align: left;
  transition: background var(--t-fast), transform var(--t-fast);
}
.thread:active { background: #f5f2fc; transform: scale(.99); }

.thread-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--g-brand);
  color: white;
  font-size: 11px;
  font-weight: 900;
  display: grid; place-items: center;
}

.thread > div { min-width: 0; }
.thread b { display: block; font-size: 14px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread span { display: block; margin-top: 2px; color: var(--c-sub); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread p { margin: 3px 0 0; color: var(--c-sub); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thread em {
  flex-shrink: 0;
  min-width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--g-brand);
  color: white;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  display: grid; place-items: center;
  align-self: start;
  margin-top: 2px;
}

/* 헤더 */
.room-head {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 44px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 10px 14px;
  background: rgba(255,255,255,.96);
  border-bottom: 1px solid rgba(233,227,242,.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 2;
}

.room-back {
  width: 38px; height: 38px;
  border-radius: 999px;
  background: #f1edff;
  color: #6d4cff;
  font-size: 18px;
  font-weight: 900;
  display: grid; place-items: center;
  transition: background var(--t-fast), transform var(--t-fast);
}
.room-back:active { transform: scale(.93); }

/* 헤더 아바타 + 이름 */
.room-head-info {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.room-avatar {
  width: 36px; height: 36px;
  border-radius: 999px;
  background: var(--g-brand);
  color: white;
  font-size: 14px;
  font-weight: 900;
  display: grid; place-items: center;
  flex-shrink: 0;
  overflow: hidden;
}

.room-head b {
  display: block;
  font-size: 15px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-head span {
  display: block;
  margin-top: 1px;
  color: var(--c-sub);
  font-size: 11px;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.room-leave {
  flex-shrink: 0;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 999px;
  background: #fff0f4;
  color: #d63d63;
  font-size: 11px;
  font-weight: 900;
  transition: background var(--t-fast);
}
.room-leave:active { background: #ffdde6; }

/* 메시지 리스트: 남은 공간 꽉 채우고 아래부터 쌓임 */
.chat-list {
  flex: 1 1 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 16px 14px 8px;
  background: #faf8ff;
  /* 스크롤바 숨기기 */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.chat-list::-webkit-scrollbar { display: none; }

/* 날짜 구분선 */
.chat-date-divider {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 10px 0 6px;
  color: var(--c-sub);
  font-size: 11px;
  font-weight: 700;
}
.chat-date-divider::before,
.chat-date-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--c-line);
}

/* 말풍선 행 */
.chat-row {
  display: flex;
  align-items: flex-end;
  gap: 6px;
}
.chat-row.mine { flex-direction: row-reverse; }

/* 상대방 아바타 (작은 원) */
.bubble-avatar {
  width: 28px; height: 28px;
  border-radius: 999px;
  background: var(--g-brand);
  color: white;
  font-size: 11px;
  font-weight: 900;
  display: grid; place-items: center;
  flex-shrink: 0;
  margin-bottom: 2px;
  overflow: hidden;
}
.chat-row.mine .bubble-avatar { display: none; }

/* 말풍선 묶음 */
.bubble-group {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-width: 72%;
}
.chat-row.mine .bubble-group { align-items: flex-end; }

/* 말풍선 */
.chat-bubble {
  width: fit-content;
  max-width: 100%;
  border-radius: 18px;
  padding: 9px 13px;
  font-size: 14px;
  line-height: 1.45;
  word-break: break-word;
  animation: bubble-in 180ms cubic-bezier(.34,1.56,.64,1) both;
}

@keyframes bubble-in {
  from { opacity: 0; transform: scale(.9) translateY(4px); }
  to   { opacity: 1; transform: none; }
}

/* 상대방 말풍선 */
.chat-bubble {
  background: white;
  color: var(--c-text);
  box-shadow: 0 2px 8px rgba(65,45,105,.08);
  border-bottom-left-radius: 5px;
}

/* 내 말풍선 */
.chat-row.mine .chat-bubble {
  background: var(--g-brand);
  color: white;
  box-shadow: 0 4px 14px rgba(124,92,255,.28);
  border-bottom-right-radius: 5px;
}

/* 연속 말풍선 모서리 조정 */
.chat-row:not(.mine) .bubble-group .chat-bubble:not(:last-child) { border-bottom-left-radius: 5px; }
.chat-row.mine .bubble-group .chat-bubble:not(:last-child) { border-bottom-right-radius: 5px; }

/* 시간 표시 */
.bubble-time {
  font-size: 10px;
  color: var(--c-sub);
  font-weight: 700;
  padding: 0 4px 2px;
}
.chat-row.mine .bubble-time { text-align: right; }

/* 시스템 메시지 */
.chat-system {
  text-align: center;
  color: var(--c-sub);
  font-size: 11px;
  font-weight: 700;
  margin: 8px 0 4px;
}

/* 입력창 — 화면 하단 고정 */
.chat-compose {
  flex: 0 0 auto;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid rgba(233,227,242,.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

.chat-input-wrap {
  flex: 1;
  min-height: 44px;
  max-height: 120px;
  border-radius: 22px;
  border: 1.5px solid var(--c-line);
  background: #f5f2fc;
  display: flex;
  align-items: center;
  padding: 0 14px;
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}

.chat-input-wrap:focus-within {
  border-color: rgba(124,92,255,.6);
  box-shadow: 0 0 0 3px rgba(124,92,255,.1);
  background: white;
}

#message-input {
  flex: 1;
  min-height: 44px;
  border: none;
  background: transparent;
  color: var(--c-text);
  font-size: 14px;
  outline: none;
  padding: 0;
  box-shadow: none;
}

.chat-send-btn {
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--g-brand);
  color: white;
  font-size: 18px;
  font-weight: 900;
  display: grid; place-items: center;
  flex-shrink: 0;
  box-shadow: 0 6px 18px rgba(124,92,255,.3);
  transition: transform var(--t-fast), box-shadow var(--t-fast), opacity var(--t-fast);
}
.chat-send-btn:active { transform: scale(.92); }
.chat-send-btn:disabled { opacity: .4; box-shadow: none; }

/* 쪽지 목록 스레드 아이템 — 카카오톡 스타일 */
.thread {
  display: grid;
  grid-template-columns: 46px 1fr auto;
  gap: 10px;
  align-items: center;
  border-radius: 12px;
  background: white;
  border: 1px solid rgba(233,227,242,.9);
  padding: 12px;
  box-shadow: var(--s-xs);
  text-align: left;
  transition: background var(--t-fast), transform var(--t-fast);
}
.thread:active { background: #f5f2fc; transform: scale(.99); }

.thread-icon {
  width: 46px; height: 46px;
  border-radius: 14px;
  background: var(--g-brand);
  color: white;
  font-size: 11px;
  font-weight: 900;
  display: grid; place-items: center;
}

.thread > div { min-width: 0; }
.thread b { display: block; font-size: 14px; font-weight: 900; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread span { display: block; margin-top: 2px; color: var(--c-sub); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.thread p { margin: 3px 0 0; color: var(--c-sub); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.thread em {
  flex-shrink: 0;
  min-width: 20px; height: 20px;
  border-radius: 999px;
  background: var(--g-brand);
  color: white;
  font-size: 11px;
  font-style: normal;
  font-weight: 900;
  display: grid; place-items: center;
  align-self: start;
  margin-top: 2px;
}

/* ── 프로필 모달 ────────────────────────────────────────────── */
.profile-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16,17,22,.42);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.public-profile-modal {
  position: relative;
  width: min(100%, 380px);
  border-radius: 16px;
  background: white;
  padding: 18px;
  box-shadow: var(--s-lg);
  animation: modal-in var(--t-mid) both;
}

@keyframes modal-in {
  from { opacity: 0; transform: scale(.94) translateY(8px); }
  to   { opacity: 1; transform: none; }
}

.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 34px; height: 34px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #111;
  font-size: 18px;
  font-weight: 900;
  display: grid; place-items: center;
}

.public-profile-head { display: grid; grid-template-columns: 72px 1fr; gap: 13px; align-items: center; }
.public-profile-head h3 { margin: 2px 0 4px; font-size: 24px; }
.public-profile-head span, .public-intro { color: var(--c-sub); font-size: 13px; line-height: 1.55; }
.public-intro { margin: 14px 0; border-radius: 10px; background: #f8f6fc; padding: 12px; }
.public-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.public-stats div { border: 1px solid var(--c-line); border-radius: 10px; padding: 10px; text-align: center; }
.public-stats b, .public-stats span { display: block; }
.public-stats span { margin-top: 2px; color: var(--c-sub); font-size: 11px; font-weight: 850; }

/* ── 광고 슬롯 ─────────────────────────────────────────────── */
.ad-slot {
  border: 1px dashed #cfd5df;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff, #f7f8fb);
  padding: 14px;
  color: var(--c-sub);
}

.ad-slot span { display: inline-flex; border-radius: 999px; background: var(--c-soft); color: var(--c-point); padding: 5px 8px; font-size: 10px; font-weight: 900; }
.ad-slot b { display: block; margin-top: 8px; color: var(--c-text); font-size: 15px; }
.ad-slot p { margin: 5px 0 0; font-size: 12px; line-height: 1.4; }

.global-ad-rail { margin: 18px 0 2px; }
.auth-panel .global-ad-rail { margin: 14px 0 0; }
.global-ad-rail .ad-slot { min-height: 92px; }

.page-ad-banner {
  position: relative;
  min-height: 56px;
  margin: 10px 14px;
  border-radius: 10px;
  background: linear-gradient(135deg, rgba(34,24,55,.96), rgba(79,55,123,.96));
  color: white;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px 10px 16px;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(65,45,105,.16);
}

.page-ad-banner.bottom { margin-top: 14px; margin-bottom: 18px; }
.page-ad-banner div { min-width: 0; position: relative; z-index: 1; }
.page-ad-banner b { display: block; font-size: 14px; line-height: 1.15; }
.page-ad-banner span { display: block; margin-top: 3px; color: rgba(255,255,255,.72); font-size: 12px; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.page-ad-banner em { position: relative; z-index: 1; flex: 0 0 auto; border-radius: 999px; background: white; color: var(--c-point); padding: 8px 11px; font-size: 11px; font-style: normal; font-weight: 950; }
.page-ad-banner .adsbygoogle { display: none; }
.page-ad-banner.live { min-height: 56px; padding: 0; background: white; border: 1px solid rgba(233,227,242,.96); box-shadow: var(--s-xs); }
.page-ad-banner.live .adsbygoogle { display: block; width: 100%; min-height: 56px; }
.auth-panel > .page-ad-banner:first-child,
.page-pad > .page-ad-banner:first-child,
.chat-page > .page-ad-banner:first-child { margin-top: 0; }

/* ── 라이브 보드 ────────────────────────────────────────────── */
.meeting-list { display: grid; gap: 10px; padding-bottom: 14px; }

.live-board {
  margin-bottom: 12px;
  border-radius: 12px;
  background: #14121f;
  color: white;
  padding: 15px;
  box-shadow: var(--s-md);
}

.live-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.live-head .eyebrow { color: #a7f3d0; }
.live-head h3 { margin: 3px 0 0; font-size: 20px; }
.live-head > span { border-radius: 999px; background: #22c55e; color: #062411; padding: 6px 9px; font-size: 11px; font-weight: 900; }
.live-feed { display: grid; gap: 7px; margin-top: 13px; }

.live-item { border-radius: 8px; background: rgba(255,255,255,.09); padding: 11px; }
.live-item b { display: block; font-size: 14px; }
.live-item p { margin: 4px 0 0; color: rgba(255,255,255,.68); font-size: 12px; line-height: 1.4; }
.live-item.stamp { border-left: 3px solid #22c55e; }
.live-item.unlock { border-left: 3px solid #60a5fa; }
.live-item.review { border-left: 3px solid #facc15; }

/* ── 미팅 카드 ─────────────────────────────────────────────── */
.meeting-top { display: grid; grid-template-columns: 42px 1fr auto; gap: 11px; align-items: center; }
.meeting-top h3 { margin: 3px 0 0; font-size: 18px; line-height: 1.25; }

.meeting-status,
.excellent-badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #fff0ed;
  color: #d64025;
  padding: 6px 9px;
  font-size: 11px;
  font-weight: 900;
  white-space: nowrap;
}

.excellent-badge { margin-left: 5px; vertical-align: middle; }
.excellent-badge.base, .tier-card.base { background: #f3f4f6; color: #4b5563; }
.excellent-badge.green, .tier-card.green { background: #e9fbf6; color: #007a63; }
.excellent-badge.blue, .tier-card.blue { background: var(--c-soft); color: #3f57d7; }
.excellent-badge.gold, .tier-card.gold { background: #fff7d6; color: #9a6400; }
.excellent-badge.legend, .tier-card.legend { background: #14121f; color: white; }

.meeting-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.ops-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 8px; }
.ops-grid div { border-radius: 8px; background: #f4f6ff; color: #28338f; padding: 12px 8px; text-align: center; }
.ops-grid span { display: block; color: var(--c-sub); font-size: 11px; font-weight: 850; }
.ops-grid b { display: block; margin-top: 5px; font-size: 14px; }

.chemistry-card { margin-top: 8px; border-radius: 10px; background: #14121f; color: white; padding: 13px; }
.chemistry-card span { display: block; color: rgba(255,255,255,.62); font-size: 12px; font-weight: 850; }
.chemistry-card b { display: block; margin-top: 5px; font-size: 14px; line-height: 1.4; }

.meeting-detail div { border: 1px solid var(--c-line); border-radius: 8px; padding: 12px; }
.meeting-detail span { color: var(--c-sub); font-size: 12px; font-weight: 800; }
.meeting-detail b { display: block; margin-top: 5px; font-size: 14px; }

.stamp-panel, .review-panel { margin-top: 12px; border-radius: 10px; background: var(--c-bg); padding: 13px; }
.stamp-head { display: flex; align-items: center; justify-content: space-between; }
.stamp-head span { color: var(--c-sub); font-size: 12px; font-weight: 800; }
.stamp-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

.stamp { border-radius: 999px; padding: 7px 10px; font-size: 12px; font-weight: 900; }
.stamp.done { background: #e9fbf6; color: #007a63; }
.stamp.wait { background: white; color: var(--c-sub); }

.stamp-btn { width: 100%; min-height: 44px; margin-top: 10px; border-radius: 8px; background: var(--c-accent); color: white; font-weight: 900; }
.stamp-btn:disabled { background: #d9dde5; color: #6b7280; cursor: not-allowed; }

.review-panel { display: grid; gap: 10px; }
.review-panel b { display: block; }
.review-panel p { margin: 5px 0 0; color: var(--c-sub); font-size: 12px; font-weight: 800; line-height: 1.45; }

.star-row { display: grid; grid-template-columns: repeat(5, 1fr); gap: 6px; }
.star-row button { min-height: 42px; border: 1px solid #f0d98a; border-radius: 8px; background: #fff7d6; color: #c58b00; font-size: 20px; transition: transform var(--t-fast); }
.star-row button:hover { transform: scale(1.1); }
.star-row button:disabled { border-color: var(--c-line); background: white; color: #c7ccd4; cursor: not-allowed; }

.compliment-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.compliment-grid button { min-height: 38px; border: 1px solid var(--c-line); border-radius: 8px; background: white; color: var(--c-text); font-size: 12px; font-weight: 850; transition: background var(--t-fast); }
.compliment-grid button:hover { background: var(--c-soft); }
.compliment-grid button:disabled { color: #b8bec8; cursor: not-allowed; }

.review-done { color: #007a63; font-size: 13px; font-weight: 900; }

/* ── 인증 화면 ─────────────────────────────────────────────── */
.verify-card,
.profile-card {
  border-radius: 12px;
  background: white;
  padding: 16px;
  box-shadow: var(--s-sm);
}

.verify-icon { width: 56px; height: 56px; margin-bottom: 14px; font-size: 13px; }
.verify-card p, .profile-card p { color: var(--c-sub); line-height: 1.55; }
.verify-options { margin-top: 16px; }

.policy-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 10px; }
.policy-grid div { border: 1px solid var(--c-line); border-radius: 10px; background: white; box-shadow: var(--s-xs); padding: 14px; }
.policy-grid b, .policy-grid span { display: block; }
.policy-grid span { margin-top: 4px; color: var(--c-sub); font-size: 12px; line-height: 1.4; }

/* ── 프로필 화면 ────────────────────────────────────────────── */
.profile-hero { display: flex; align-items: center; gap: 14px; }
.editable-profile label { margin-top: 0; }

.photo-picker {
  width: 92px; height: 112px;
  border-radius: 12px;
  background: var(--g-dark);
  color: white;
  position: relative;
  overflow: hidden;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  cursor: pointer;
}

.photo-picker img { width: 100%; height: 100%; object-fit: cover; }
.photo-picker span { color: white; font-size: 32px; font-weight: 900; }
.photo-picker input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.photo-picker em { position: absolute; left: 8px; right: 8px; bottom: 8px; border-radius: 999px; background: rgba(255,255,255,.92); color: var(--c-text); padding: 5px 0; text-align: center; font-size: 11px; font-style: normal; font-weight: 900; }

.profile-title { min-width: 0; }
.profile-title h2 { font-size: 28px; }
.profile-title p { margin: 5px 0 0; font-size: 13px; }

.edit-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 9px; margin-top: 16px; }
.wide-field { display: block; margin-top: 12px; }

.profile-info, .profile-summary { display: grid; gap: 8px; margin-top: 12px; }
.profile-info { grid-template-columns: repeat(2, 1fr); }
.profile-summary { grid-template-columns: repeat(3, 1fr); }

.profile-info div, .profile-summary div { border: 1px solid var(--c-line); border-radius: 8px; padding: 12px; background: white; }
.profile-info label { display: block; }

.readonly-field { min-height: 74px; border: 1px solid var(--c-line); border-radius: 10px; background: #f1eef8; padding: 12px; }
.readonly-field span { display: block; color: var(--c-sub); font-size: 12px; font-weight: 850; }
.readonly-field b { display: block; margin-top: 10px; color: #4b5563; font-size: 15px; }

.profile-info span, .profile-summary span { display: block; color: var(--c-sub); font-size: 12px; font-weight: 800; }
.profile-info b, .profile-summary b { display: block; margin-top: 4px; font-size: 15px; }
.profile-summary { text-align: center; }

.benefit-box { margin-top: 12px; border-radius: 10px; background: #fff7d6; color: #7a5200; padding: 13px; }
.benefit-box b { display: block; }
.benefit-box p { margin: 5px 0 0; color: #7a5200; font-size: 12px; line-height: 1.45; }

.profile-section { margin-top: 16px; }
.profile-section h3 { font-size: 15px; }
.profile-section p { margin: 8px 0 0; font-size: 14px; }
.profile-section input { margin-top: 8px; }
.tag-input { font-size: 13px; }

.badge-showcase { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }
.badge-showcase span,
.badge-showcase .tier-card {
  min-height: 34px;
  border: 1px solid rgba(233,227,242,.95);
  border-radius: 999px;
  background: white;
  color: var(--c-text);
  padding: 8px 10px;
  font-size: 12px;
  font-weight: 900;
  box-shadow: var(--s-xs);
  display: inline-flex;
  align-items: center;
}

.badge-showcase .tier-card { border-color: rgba(124,92,255,.22); background: var(--c-soft); color: #5b3df4; }
.badge-showcase b { margin-left: 3px; color: var(--c-point); }
.tier-card { display: inline-flex; }

.profile-save { margin-top: 18px; }

.logout-btn { width: 100%; min-height: 46px; margin-top: 10px; border: 1px solid #fecaca; border-radius: 12px; background: #fff7f7; color: #b91c1c; font-weight: 900; }

.profile-tags { margin-top: 9px; }

/* ── 바텀 내비 ─────────────────────────────────────────────── */
.bottom-nav {
  position: fixed;
  left: 50%;
  bottom: 10px;
  z-index: 100;
  width: min(calc(100% - 20px), 394px);
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
  padding: 7px;
  border: 1px solid rgba(233,227,242,.98);
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 16px 46px rgba(65,45,105,.14);
}

.bottom-nav button {
  min-height: 48px;
  border-radius: 12px;
  color: var(--c-sub);
  display: grid;
  place-items: center;
  gap: 2px;
  font-size: 11px;
  font-weight: 900;
  transition: background var(--t-fast), color var(--t-fast), box-shadow var(--t-fast);
}

.bottom-nav button span:first-child { font-size: 18px; line-height: 1; }
.bottom-nav button span:last-child { font-size: 11px; }

.bottom-nav .nav-icon {
  position: relative;
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  min-height: 20px;
}

.bottom-nav .nav-badge {
  position: absolute;
  top: -8px;
  right: -13px;
  min-width: 17px;
  height: 17px;
  padding: 0 5px;
  border: 2px solid rgba(255,255,255,.96);
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  box-shadow: 0 5px 12px rgba(239,68,68,.28);
}

.bottom-nav .active {
  background: var(--g-dark);
  color: white;
  box-shadow: 0 8px 20px rgba(124,92,255,.22);
}

.float-search {
  position: fixed;
  right: max(18px, calc(50% - 188px));
  bottom: 94px;
  z-index: 90;
  width: 50px; height: 50px;
  border-radius: 14px;
  background: var(--g-brand);
  color: white;
  font-size: 20px;
  font-weight: 900;
  display: grid; place-items: center;
  box-shadow: 0 10px 28px rgba(124,92,255,.28);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}

.float-search:hover { transform: scale(1.06); box-shadow: 0 14px 36px rgba(124,92,255,.36); }

/* ── 토스트 ─────────────────────────────────────────────────── */
.toast-backdrop {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(16,17,22,.28);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}

.toast-modal {
  width: min(100%, 340px);
  display: grid;
  justify-items: center;
  gap: 8px;
  border-radius: 16px;
  background: rgba(255,255,255,.98);
  color: var(--c-text);
  padding: 22px;
  box-shadow: var(--s-lg);
  text-align: center;
  animation: modal-in var(--t-mid) both;
}

.toast-icon { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 999px; background: var(--g-brand); color: white; font-size: 20px; font-weight: 900; }
.toast-modal.error .toast-icon { background: linear-gradient(135deg, #ff6b57, #d64025); }
.toast-modal b { font-size: 18px; line-height: 1.2; }
.toast-modal span { color: var(--c-sub); font-size: 14px; line-height: 1.55; }
.toast-modal button { width: 100%; min-height: 44px; margin-top: 8px; border-radius: 10px; background: var(--g-dark); color: white; font-weight: 900; }

/* ── 시트 ───────────────────────────────────────────────────── */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  z-index: 150;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(17,24,39,.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.sheet {
  width: min(100%, var(--app-w));
  border-radius: 18px 18px 0 0;
  background: var(--c-bg);
  padding: 16px 14px 20px;
  display: grid;
  gap: 9px;
  animation: sheet-up var(--t-mid) both;
}

@keyframes sheet-up {
  from { transform: translateY(100%); }
  to   { transform: none; }
}

.sheet-head { display: flex; align-items: center; justify-content: space-between; }
.sheet-head h2 { margin: 0; }

.sheet-head button { width: 38px; height: 38px; border-radius: 10px; background: #e8ebf0; color: var(--c-text); font-size: 22px; display: grid; place-items: center; }

.helper-copy { border-radius: 8px; background: var(--c-soft); color: var(--c-point); padding: 11px; font-size: 12px; font-weight: 800; line-height: 1.45; }

.boost-option { display: flex; align-items: center; gap: 12px; border: 1px solid #c7d2fe; border-radius: 12px; background: #fff7f4; border-color: #ffe0d8; padding: 13px; }
.boost-option input { width: 20px; min-height: 20px; }
.boost-option b { display: block; font-size: 14px; }
.boost-option em { display: block; margin-top: 3px; color: var(--c-point); font-size: 12px; font-style: normal; font-weight: 900; }

/* ── 관리자 ─────────────────────────────────────────────────── */
.admin-gate {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(135deg, rgba(124,92,255,.12), transparent 32%),
    linear-gradient(315deg, rgba(45,212,191,.12), transparent 35%),
    #f7f5fb;
}

.admin-gate-card {
  width: min(100%, 390px);
  border: 1px solid var(--c-line);
  border-radius: 16px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--s-lg);
  padding: 24px;
}

.admin-gate-card h1 { margin: 4px 0 8px; font-size: 30px; }
.admin-gate-card p { margin: 0 0 18px; color: var(--c-sub); line-height: 1.55; }
.admin-gate-card small { display: block; margin-top: 12px; color: var(--c-sub); text-align: center; font-size: 12px; }

.admin-error { margin: 10px 0; border-radius: 8px; background: #fff1f0; color: #d64025; padding: 11px 12px; font-size: 13px; font-weight: 850; }

.admin-logout { min-height: 38px; border: 1px solid var(--c-line); border-radius: 10px; background: #14121f; color: white; padding: 0 14px; font-weight: 900; }

.admin-card { border: 1px solid var(--c-line); border-radius: 10px; background: white; padding: 16px; margin-bottom: 10px; }
.admin-card h3 { margin: 0 0 12px; font-size: 16px; }

.admin-status-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }

.readiness-meter { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 10px; margin-bottom: 12px; }
.readiness-meter div { height: 10px; border-radius: 999px; overflow: hidden; background: #eef2f7; }
.readiness-meter span { display: block; height: 100%; border-radius: inherit; background: var(--g-brand); }
.readiness-meter b { font-size: 13px; }

.admin-status-grid div { border-radius: 8px; background: var(--c-bg); padding: 12px; }
.admin-status-grid b { display: block; }
.status-on { display: block; margin-top: 6px; font-size: 12px; font-weight: 900; color: #007a63; }
.status-off { display: block; margin-top: 6px; font-size: 12px; font-weight: 900; color: #d64025; }

.admin-toggle-row { display: grid; gap: 8px; margin-top: 12px; }
.admin-toggle-row label { display: flex; align-items: center; gap: 8px; border-radius: 8px; background: var(--c-bg); padding: 11px; color: var(--c-text); font-size: 13px; font-weight: 850; }
.admin-toggle-row input { width: 18px; min-height: 18px; }

.admin-note { margin: 8px 0 0; color: var(--c-sub); font-size: 12px; line-height: 1.45; }

.admin-metric-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.admin-metric-grid div, .admin-piece-list div, .admin-user-row { border: 1px solid var(--c-line); border-radius: 10px; background: var(--c-bg); padding: 10px; }
.admin-metric-grid b { display: block; font-size: 18px; }
.admin-metric-grid span, .admin-piece-list span, .admin-user-row span, .admin-user-row em { display: block; margin-top: 3px; color: var(--c-sub); font-size: 11px; line-height: 1.35; }

.admin-chart-tabs { display: grid; gap: 10px; margin-top: 14px; }
.admin-chart-tabs section { border: 1px solid var(--c-line); border-radius: 10px; background: white; padding: 10px; }

.mini-chart { display: grid; grid-template-columns: repeat(7, 1fr); align-items: end; gap: 5px; height: 118px; margin-top: 8px; }
.chart-bar { height: 100%; display: grid; align-items: end; text-align: center; }
.chart-bar span { display: block; width: 100%; border-radius: 999px 999px 4px 4px; background: var(--g-brand); }
.chart-bar b, .chart-bar em { display: block; margin-top: 3px; color: var(--c-sub); font-size: 9px; font-style: normal; }

.admin-user-list, .admin-piece-list { display: grid; gap: 8px; margin-top: 10px; }
.admin-user-row { display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 7px; }
.admin-user-row b { display: block; }
.admin-user-row button { min-height: 34px; border-radius: 9px; background: #14121f; color: white; padding: 0 9px; font-size: 11px; font-weight: 900; }

.callback-list { display: grid; gap: 8px; margin-top: 12px; }
.callback-list div { border-radius: 10px; background: var(--c-bg); padding: 10px 12px; }
.callback-list b { display: block; font-size: 12px; }
.callback-list span { margin-top: 4px; color: var(--c-point); font-size: 12px; font-weight: 850; overflow-wrap: anywhere; display: block; }

.admin-reset { width: 100%; min-height: 46px; margin-top: 8px; border: 1px solid var(--c-line); border-radius: 12px; background: white; color: #d64025; font-weight: 900; }

/* ── 반응형 ─────────────────────────────────────────────────── */
@media (max-width: 380px) {
  .revenue-banners { grid-template-columns: 1fr; }
  .auth-hero h1, .studio h1 { font-size: 25px; }
  .category-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .profile-summary, .quick-grid { grid-template-columns: 1fr 1fr; }
  .admin-metric-grid { grid-template-columns: repeat(2, 1fr); }
}
