:root {
    --bg: #ffffff;
    --bg-soft: #f8fafc;
    --card: #ffffff;
    --accent: #cc785c;
    --accent-2: #a3604a;
    --accent-soft: #fbf1ec;
    --ink: #1e293b;
    --muted: #64748b;
    --line: #e2e8f0;
    --grad: linear-gradient(90deg, #dea795 0%, #cc785c 100%);
    --radius: 6px;
    --radius-lg: 10px;
    --shadow-sm: 0 2px 12px rgba(43, 34, 64, 0.05);
    --shadow-md: 0 12px 32px rgba(43, 34, 64, 0.09);
    --shadow-glow: 0 4px 16px rgba(204, 120, 92, 0.20);
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: system-ui, -apple-system, "Apple SD Gothic Neo", "Segoe UI", sans-serif;
    background: var(--bg);
    color: var(--ink);
    line-height: 1.65;
    -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
::selection { background: var(--accent-soft); color: var(--accent); }

/* 진입 애니메이션 */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes floatBlob { 0%,100% { transform: translate(0,0) scale(1); } 50% { transform: translate(0,-18px) scale(1.05); } }
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ── 네비게이션 ── */
.nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.1rem 2rem;
    max-width: 1080px;
    margin: 0 auto;
}
.brand { font-size: 1.4rem; font-weight: 800; }
.nav-links { display: flex; align-items: center; gap: 1.5rem; }
.nav-links a { color: var(--muted); font-weight: 600; transition: color 0.2s; }
.nav-links a:hover { color: var(--accent); }
/* 회원가입 상단 우측 '건너뛰기' — 눈에 띄되 보조 액션으로 */
.nav-links a.skip-link { color: var(--accent); }
/* 폼 라벨의 '선택' 표시 배지 */
.auth-form .opt { font-style: normal; font-size: 0.72rem; font-weight: 600; color: var(--muted);
    background: rgba(148,163,184,0.16); padding: 1px 6px; border-radius: 999px; margin-left: 4px; vertical-align: middle; }

/* 약관·개인정보·고객센터 상단 우측 KO/EN 언어 전환 버튼 */
.lang-switch { display: inline-flex; gap: 0; border: 1px solid var(--line); border-radius: 999px; overflow: hidden; }
.lang-switch a.lang-btn {
    padding: 0.25rem 0.7rem; font-size: 0.82rem; font-weight: 700;
    color: var(--muted); background: transparent; transition: background 0.15s, color 0.15s;
}
.lang-switch a.lang-btn:hover { color: var(--accent); }
.lang-switch a.lang-btn.active { background: var(--accent); color: #fff; }

/* 예쁜 드롭다운(국적 등) — 네이티브 화살표 제거 + 커스텀 셰브론 */
.pretty-select {
    appearance: none; -webkit-appearance: none; -moz-appearance: none;
    width: 100%;
    padding: 0.7rem 2.4rem 0.7rem 0.9rem;
    border: 1px solid var(--line);
    border-radius: 8px;
    background-color: var(--card);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23667085' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.9rem center;
    font-size: 0.95rem; line-height: 1.3; color: var(--ink); cursor: pointer;
    transition: border-color 0.15s, box-shadow 0.15s, background-color 0.15s;
}
.pretty-select:hover { border-color: var(--accent); background-color: #fbfcff; }
.pretty-select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.13); }
.pretty-select option { padding: 0.5rem; font-size: 0.95rem; color: var(--ink); }
.pretty-select option[value=""] { color: var(--muted); }

/* ── 히어로 ── */
.hero {
    position: relative;
    text-align: center;
    padding: 5.5rem 2rem 4rem;
    max-width: 800px;
    margin: 0 auto;
    overflow: visible;
}
.hero::before {
    content: "";
    position: absolute;
    top: -60px; left: 50%; transform: translateX(-50%);
    width: 460px; height: 460px; max-width: 92vw;
    /* 배경 번짐도 브랜드 주황(#CC785C·#DEA795) 계열로 — 예전 파란 번짐은 강조색과 안 맞았다 */
    background: radial-gradient(circle at 35% 35%, rgba(204,120,92,0.16), rgba(204,120,92,0) 62%),
                radial-gradient(circle at 70% 60%, rgba(222,167,149,0.20), rgba(222,167,149,0) 60%);
    filter: blur(8px);
    z-index: -1;
    animation: floatBlob 9s ease-in-out infinite;
}
.hero > * { animation: fadeUp 0.7s cubic-bezier(.2,.7,.3,1) both; }
.hero h1 { animation-delay: 0.06s; }
.hero .subtitle { animation-delay: 0.12s; }
.hero .cta { animation-delay: 0.18s; }
.badge {
    display: inline-flex; align-items: center; gap: 0.45rem;
    background: rgba(255,255,255,0.8);
    backdrop-filter: blur(6px);
    border: 1px solid var(--accent-soft);
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
    border-radius: 8px;
    margin-bottom: 1.4rem;
    box-shadow: var(--shadow-sm);
}
/* 뱃지 안 아이콘(🎬 대신 선 아이콘) — 글자색(강조색)을 그대로 물려받는다 */
.badge-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; }
.badge-ico svg {
    width: 15px; height: 15px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
}
.hero h1 { font-size: 3.2rem; font-weight: 800; line-height: 1.22; letter-spacing: -0.02em; }
.accent {
    background: var(--grad);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}
.subtitle { font-size: 1.18rem; color: var(--muted); margin: 1.3rem 0 2.4rem; }
.cta { display: flex; gap: 0.9rem; justify-content: center; flex-wrap: wrap; }

.btn {
    padding: 0.85rem 1.8rem;
    border-radius: 6px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    border: none;
    transition: transform 0.18s, box-shadow 0.18s, filter 0.18s;
    display: inline-block;
}
.btn:focus-visible { outline: 3px solid rgba(204,120,92,0.45); outline-offset: 2px; }
.btn-primary {
    background: var(--grad);
    color: #fff;
    box-shadow: var(--shadow-glow);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 16px 34px rgba(204, 120, 92, 0.30); filter: brightness(1.05) saturate(1.05); }
.btn-primary:active { transform: translateY(0); }
.btn-ghost { background: rgba(255,255,255,0.85); border: 1.5px solid var(--line); color: var(--ink); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); transform: translateY(-2px); box-shadow: var(--shadow-sm); }

/* ── 특징 카드 ── */
.features {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 1.25rem;
    max-width: 980px;
    margin: 1.5rem auto 3.5rem;
    padding: 0 2rem;
}
.card {
    position: relative;
    background: var(--card);
    padding: 2rem 1.9rem;
    border-radius: var(--radius-lg);
    border: 1px solid var(--line);
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    animation: fadeUp 0.7s cubic-bezier(.2,.7,.3,1) both;
}
.card:nth-child(2) { animation-delay: 0.08s; }
.card:nth-child(3) { animation-delay: 0.16s; }
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--accent-soft); }
/* 아이콘 칸 — 컬러 이모지·파란 그라데이션을 뺐다.
   투명한 화이트(다크) / 아주 옅은 브랜드톤(라이트) 배경 위에 선 아이콘만 올린다. */
.card .icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 54px; height: 54px; border-radius: 10px;
    background: rgba(30, 41, 59, 0.04);
    border: 1px solid var(--line);
    color: var(--ink);
    margin-bottom: 0.9rem;
}
.card .icon svg {
    width: 26px; height: 26px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.6;
    stroke-linecap: round; stroke-linejoin: round;
}
.card:hover .icon { color: var(--accent); }
.card h3 { margin-bottom: 0.4rem; font-size: 1.12rem; letter-spacing: -0.01em; }
.card p { color: var(--muted); }

/* ── 데모 채팅 ── */
.demo {
    max-width: 640px;
    margin: 0 auto;
    padding: 2rem 2rem 4.5rem;
    text-align: center;
}
.demo h2 { font-size: 1.8rem; margin-bottom: 1.5rem; letter-spacing: -0.01em; }
.chat {
    background: var(--bg-soft);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 1.4rem;
    min-height: 220px;
    max-height: 360px;
    overflow-y: auto;
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    box-shadow: var(--shadow-md);
}
.msg {
    padding: 0.65rem 1rem;
    border-radius: 6px;
    max-width: 80%;
    white-space: pre-wrap;
    word-break: break-word;
}
.msg.bot { background: #f3f0ff; color: var(--ink); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg.user { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.msg.tip { background: #fff7e6; color: #8a6d00; align-self: flex-start; font-size: 0.9rem; }

/* 캐릭터 답변: [썸네일] [말풍선] [음성 재생 버튼] 한 줄 배치 */
.msg-row { display: flex; align-items: flex-end; gap: 0.45rem; align-self: flex-start; max-width: 90%; }
.msg-row .msg.bot { align-self: auto; max-width: 100%; }
.msg-avatar {
    width: 34px; height: 34px; border-radius: 50%;
    object-fit: cover; flex: 0 0 auto; background: #ece7ff;
}
.msg-avatar-ph { display: flex; align-items: center; justify-content: center; font-size: 1.1rem; }
/* 아바타를 감싼 링크 — 누르면 캐릭터 상세페이지. 밑줄 없이 사진 그대로 보이게. */
.msg-avatar-link { flex: 0 0 auto; display: block; line-height: 0; text-decoration: none; color: inherit; }
.msg-avatar-link:hover { filter: brightness(1.08); }
.msg-tts {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 50%;
    border: 1px solid var(--line); background: #fff; color: var(--accent);
    cursor: pointer; font-size: 0.7rem; line-height: 1; padding: 0;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s, color 0.15s;
}
.msg-tts:hover { background: var(--accent); color: #fff; }
.msg-tts.playing { background: var(--accent); color: #fff; }
.msg-tts.loading { color: var(--muted); cursor: default; }
.msg-tts:disabled { cursor: default; }

.chat-form { display: flex; gap: 0.6rem; margin-top: 1rem; }
.chat-form input {
    flex: 1;
    padding: 0.85rem 1.1rem;
    border: 1.5px solid var(--line);
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.chat-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

/* 사진 첨부 버튼(📷) — 입력창 왼쪽 */
.chat-attach {
    flex: 0 0 auto;
    width: 46px;
    border: 1.5px solid var(--line);
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
    font-size: 1.25rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.chat-attach:hover { border-color: var(--accent); background: #f3f0ff; }
.chat-attach:active { transform: translateY(1px); }

/* 추천 답변 버튼(💡) — 보내기 버튼 왼쪽 */
.chat-suggest {
    flex: 0 0 auto;
    width: 46px;
    border: 1.5px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.chat-suggest:hover { border-color: var(--accent); background: var(--accent-soft); }
.chat-suggest:active { transform: translateY(1px); }
.chat-suggest:disabled { opacity: 0.55; cursor: default; }
.chat-suggest.loading { pointer-events: none; }
/* 자동 추천 모드 켜짐 — 버튼 강조 */
.chat-suggest.on { border-color: var(--accent); background: var(--accent); color: #fff; }

/* 음성 입력 버튼(🎤) — 보내기 버튼 왼쪽. 녹음 중에는 빨갛게 깜빡인다. */
.chat-mic {
    flex: 0 0 auto;
    width: 46px;
    border: 1.5px solid var(--line);
    border-radius: 6px;
    background: var(--card);
    color: var(--ink);
    cursor: pointer;
    font-size: 1.2rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.15s, background 0.15s;
}
.chat-mic:hover { border-color: var(--accent); background: var(--accent-soft); }
.chat-mic:active { transform: translateY(1px); }
.chat-mic:disabled { opacity: 0.55; cursor: default; }
.chat-mic.recording {
    border-color: #dc2626;
    background: #fee2e2;
    animation: mic-pulse 1s ease-in-out infinite;
}
@keyframes mic-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0.45); }
    50%      { box-shadow: 0 0 0 5px rgba(220, 38, 38, 0); }
}

/* 추천 답변 목록 — 입력창 위에 리스트로 표시 */
.suggest-panel {
    margin: 0.7rem 0 0.1rem;
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    animation: suggest-in 0.18s ease;
}
@keyframes suggest-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.suggest-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--muted);
    padding: 0 0.15rem 0.1rem;
}
.suggest-head button {
    border: none;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 0.95rem;
    line-height: 1;
    padding: 0.15rem;
}
.suggest-item {
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    text-align: left;
    padding: 0.7rem 0.9rem;
    border: 1.5px solid var(--line);
    border-radius: 10px;
    background: var(--card);
    color: var(--ink);
    font-size: 0.97rem;
    line-height: 1.45;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, transform 0.1s;
}
.suggest-item:hover { border-color: var(--accent); background: var(--accent-soft); }
.suggest-item:active { transform: translateY(1px); }
.suggest-item .num {
    display: inline-block;
    min-width: 1.3em;
    font-weight: 700;
    color: var(--accent);
}
/* 추천 문장 발음(음차) — 문장 바로 아래 작은 글씨(번호 폭만큼 들여쓰기) */
.suggest-pron {
    padding-left: 1.3em;
    font-size: 0.85rem;
    color: var(--accent);
    line-height: 1.4;
}
/* 내 언어 번역 — 문장 아래 작은 회색 글씨(번호 폭만큼 들여쓰기) */
.suggest-trans {
    padding-left: 1.3em;
    font-size: 0.86rem;
    color: var(--muted);
    line-height: 1.4;
}
.suggest-empty { padding: 0.5rem 0.15rem; font-size: 0.9rem; color: var(--muted); }

/* 전송 대기 중인 첨부 사진 미리보기 */
.chat-photo-preview {
    position: relative;
    align-self: flex-end;
    margin: 0.6rem 0 0.1rem;
    max-width: 160px;
}
.chat-photo-preview img {
    display: block;
    max-width: 160px;
    max-height: 160px;
    border-radius: 8px;
    border: 1px solid var(--line);
    object-fit: cover;
}
.chat-photo-preview #photo-remove {
    position: absolute;
    top: -8px; right: -8px;
    width: 24px; height: 24px;
    border-radius: 50%;
    border: none;
    background: rgba(0,0,0,0.65);
    color: #fff;
    cursor: pointer;
    font-size: 0.8rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.chat-photo-preview #photo-remove:hover { background: #000; }

/* 채팅 말풍선 안에 표시되는 첨부 사진 */
.msg.user.has-photo { padding: 0.35rem; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.msg-photo {
    display: block;
    max-width: 240px;
    max-height: 280px;
    width: auto;
    border-radius: 6px;
    object-fit: cover;
}
.msg-photo-caption { margin-top: 0.4rem; padding: 0 0.35rem 0.2rem; color: #fff; white-space: pre-wrap; word-break: break-word; }

/* ── 푸터 ── */
.footer {
    text-align: center;
    padding: 2.4rem 2rem;
    color: var(--muted);
    font-size: 0.9rem;
    border-top: 1px solid var(--line);
    /* 예전엔 rgba(255,255,255,0.5) 로 고정돼 있어서, 다크 화면에서 페이지 맨 아래만
       밝은 회색 띠로 떠 보였다. 화면 모드(라이트/다크) 배경을 그대로 따라가게 한다. */
    background: var(--bg);
}
.footer p { margin: 0.15rem 0; }
/* 사업자 정보 — 본문보다 한 톤 작게, 여러 줄이라 줄간격만 살짝 좁힌다 */
.footer .biz { font-size: 0.82rem; line-height: 1.6; opacity: 0.85; }
.footer .biz + :not(.biz) { margin-top: 0.7rem; }
.footer a { transition: color 0.15s; }
.footer a:hover { color: var(--accent); }

@media (max-width: 600px) {
    .hero { padding: 4rem 1.4rem 3rem; }
    .hero h1 { font-size: 2.25rem; }
    .subtitle { font-size: 1.05rem; }
    .cta .btn { width: 100%; }
}

/* ── 회원가입(auth) 페이지 ── */
.auth-wrap {
    display: flex;
    justify-content: center;
    padding: 3rem 1.5rem 4rem;
}
.auth-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(43, 34, 64, 0.06);
    padding: 2.5rem;
    width: 100%;
    max-width: 420px;
}
.auth-card h1 { font-size: 1.8rem; margin-bottom: 0.3rem; word-break: keep-all; }
.auth-sub { color: var(--muted); margin-bottom: 1.75rem; }
.auth-form { display: flex; flex-direction: column; gap: 1rem; }
.auth-form label, .auth-form .auth-field { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.92rem; }
.auth-form input {
    padding: 0.8rem 1rem;
    border: 1.5px solid var(--line);
    border-radius: 6px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.15s;
}
.auth-form input:focus { border-color: var(--accent); }
.auth-form .btn { margin-top: 0.5rem; width: 100%; }

.field-hint { display: block; margin-top: 0.35rem; color: var(--muted); font-size: 0.8rem; line-height: 1.35; }
.avatar-edit { display: flex; align-items: center; gap: 1rem; margin-bottom: 0.5rem; }
.avatar-preview { width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center;
    font-size: 2rem; background: rgba(128,128,128,.16); overflow: hidden; border: 1px solid var(--line, rgba(128,128,128,.25)); }
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.avatar-actions { display: flex; flex-direction: column; align-items: flex-start; gap: 0.4rem; }
.avatar-actions .btn { padding: 0.4rem 0.8rem; font-size: 0.88rem; }
.form-msg { margin: 1rem 0 0; font-size: 0.93rem; min-height: 1.2em; text-align: center; }
.form-msg.info { color: var(--muted); }
.form-msg.success { color: #1a8f4c; }
.form-msg.error { color: var(--accent); }

.auth-foot { margin-top: 1.5rem; text-align: center; color: var(--muted); font-size: 0.92rem; }
.auth-foot a, .brand a { color: var(--accent); font-weight: 700; }
/* 로그인 하단 약관 동의 — 자동 가입 안내에 붙는 기본 체크 문구 */
.auth-agree {
    display: flex; align-items: flex-start; justify-content: center; gap: 0.4rem;
    margin-top: 0.6rem; color: var(--muted); font-size: 0.82rem; line-height: 1.45;
    text-align: left; cursor: pointer;
}
.auth-agree input { margin-top: 0.15em; accent-color: var(--accent); flex-shrink: 0; }
.auth-agree a { color: var(--accent); font-weight: 600; }

/* ── 캐릭터 선택 페이지 ── */
.chars-wrap { max-width: 920px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; text-align: center; }
.chars-wrap h1 { font-size: 1.9rem; margin-bottom: 0.4rem; }
.chars-sub { color: var(--muted); margin-bottom: 2rem; }
/* 우측 상단 '언어' 필터(모국어 선택) */
.chars-topbar { display: flex; align-items: center; justify-content: flex-end; gap: 0.5rem; margin-bottom: 0.5rem; }
.chars-create-btn { text-decoration: none; white-space: nowrap; }
.chars-lang { position: relative; }
.lang-menu-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    padding: 0.45rem 0.9rem; border: 1.5px solid var(--line); border-radius: 999px;
    background: var(--card); color: var(--ink); font-size: 0.9rem; font-weight: 700; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.lang-menu-btn:hover { border-color: var(--accent); }
.lang-menu-btn .caret { color: var(--muted); font-size: 0.8rem; }
.lang-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
    min-width: 170px; padding: 0.35rem; text-align: left;
    background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.lang-menu-item {
    display: block; width: 100%; text-align: left;
    padding: 0.55rem 0.7rem; border: 0; border-radius: 8px;
    background: transparent; color: var(--ink); font-size: 0.92rem; font-weight: 600; cursor: pointer;
}
.lang-menu-item:hover { background: var(--accent-soft); }
.lang-menu-item.is-active { background: var(--accent); color: #fff; }
/* 캐릭터 검색창 */
.char-search { display: flex; gap: 0.5rem; max-width: 520px; margin: 0 auto 1.6rem; }
.char-search input { flex: 1; min-width: 0; padding: 0.65rem 0.9rem; border: 1.5px solid var(--line); border-radius: 8px; font-size: 0.95rem; background: var(--card); color: var(--ink); }
.char-search input:focus { border-color: var(--accent); outline: none; }
.char-search button { flex-shrink: 0; white-space: nowrap; }
.char-sort { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; margin: 0 auto 1.6rem; }
.sort-btn {
    padding: 0.45rem 1rem; border: 1.5px solid var(--line); border-radius: 999px;
    background: var(--card); color: var(--muted); font-size: 0.9rem; font-weight: 700;
    cursor: pointer; transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.sort-btn:hover { border-color: var(--accent-soft); color: var(--ink); }
.sort-btn.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
.chars-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.1rem;
}
.loading { grid-column: 1 / -1; color: var(--muted); }
/* 캐릭터 카드 — 위 절반은 이미지, 아래 절반은 설명글 */
.char-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius-lg);
    padding: 0;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
    text-align: center;
    height: 320px;
}
.char-card:hover { transform: translateY(-6px); border-color: var(--accent-soft); box-shadow: var(--shadow-md); }
/* 이미지 영역: 카드 높이의 50% */
.char-media {
    position: relative; flex: 0 0 50%; height: 50%;
    display: flex; align-items: center; justify-content: center;
    background: var(--bg-soft); overflow: hidden;
}
.char-photo { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 설명글 영역 */
.char-body {
    flex: 1 1 auto; min-height: 0; overflow: hidden;
    padding: 0.85rem 0.9rem 1rem;
    display: flex; flex-direction: column; gap: 0.15rem;
}
.char-emoji { font-size: 2.6rem; }
.char-name { font-weight: 800; font-size: 1.08rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-job { color: var(--accent-2); font-weight: 600; font-size: 0.88rem; margin: 0.1rem 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.char-tagline { color: var(--muted); font-size: 0.85rem; line-height: 1.35;
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
/* 채팅 횟수 — 이미지 좌측 상단 배지 */
.char-rooms {
    position: absolute; top: 8px; left: 8px; z-index: 3;
    background: rgba(0,0,0,0.58); color: #fff; font-size: 0.75rem; font-weight: 700;
    padding: 0.16rem 0.45rem; border-radius: 999px; backdrop-filter: blur(2px); white-space: nowrap;
}

@media (max-width: 560px) {
    .chars-grid { grid-template-columns: repeat(2, 1fr); gap: 0.8rem; }
    .char-card { height: 260px; }
    .char-name { font-size: 0.98rem; }
    .char-job, .char-tagline { font-size: 0.8rem; }
    .char-tagline { -webkit-line-clamp: 2; }
    .char-body { padding: 0.6rem 0.6rem 0.7rem; }
}

/* ── 채팅방 페이지 ── */
.room-title { color: var(--ink); font-weight: 700; font-size: 0.98rem; }
/* 채팅방 헤더 전용 — 좁은 화면에서 긴 제목이 줄바꿈으로 헤더를 밀어내지 않게 말줄임하고,
   오른쪽 버튼(음성 대화·더보기)은 찌그러지지 않도록 고정한다. */
.room-nav { flex: 1; min-width: 0; justify-content: flex-end; gap: 0.6rem; }
.room-nav .room-title { flex: 1 1 auto; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; }
.room-nav .voice-link, .room-nav .room-temp, .room-nav .cd-more { flex-shrink: 0; white-space: nowrap; }
/* 폭이 좁으면 음성 대화는 아이콘만 — 캐릭터 이름(제목)에 자리를 내준다 */
@media (max-width: 560px) {
    .room-nav .voice-label { display: none; }
}
/* 친밀도 온도 배지 — 캐릭터 기분에 따라 오르내리는 관계 온도 */
.room-temp { display: inline-flex; align-items: center; gap: .1rem; font-weight: 800; font-size: 1.02rem; line-height: 1; padding: .28rem .6rem; border-radius: 999px; background: var(--bg-soft); border: 1.5px solid var(--line); color: #10b981; white-space: nowrap; transition: color .4s ease; }
.room-temp-ico { font-size: .95rem; margin-right: .12rem; filter: saturate(1.1); }
.room-temp b { font-variant-numeric: tabular-nums; }
.room-temp-deg { margin-left: .02rem; opacity: .85; }
.room-temp-delta { margin-left: .3rem; font-size: .74rem; font-weight: 800; opacity: 0; transform: translateY(2px); transition: opacity .25s, transform .25s; }
.room-temp-delta.show { opacity: 1; transform: translateY(0); }
.room-temp-delta.up { color: #e11d48; }
.room-temp-delta.down { color: #3b82f6; }
/* 데스크톱: 좌(캐릭터) · 우(채팅창 세로 전체) 2단 배치 */
.room-wrap { max-width: 1200px; margin: 0 auto; padding: 1.5rem 1rem 2rem; display: flex; flex-direction: row; align-items: stretch; gap: 1.4rem; height: calc(100vh - 70px); }
/* 우측 채팅 컬럼 — 남은 폭을 모두 차지하고 세로로 꽉 채운다 */
.room-main { flex: 1 1 auto; min-width: 0; display: flex; flex-direction: column; }
.room-chat { flex: 1; max-height: none; margin-bottom: 0.5rem; }

/* 좌측 캐릭터 이미지 — 채팅 높이에 맞춰 세로로 크게(1024² 이미지를 세로 컬럼에 cover) */
.room-hero {
    position: relative; flex: 0 0 38%; max-width: 460px; min-width: 220px;
    align-self: stretch; height: auto; margin: 0;
    border-radius: 18px; overflow: hidden; border: 1px solid var(--line);
    box-shadow: 0 8px 24px rgba(43,34,64,0.16); background: var(--bg-soft);
}
.hero-img {
    width: 100%; height: 100%; object-fit: cover; display: block;
    transition: opacity 0.2s ease, transform 0.2s ease;
}
.hero-img.swapping { opacity: 0; transform: scale(1.03); }
/* 좁은 화면: 다시 위(캐릭터) · 아래(채팅) 세로 배치 */
@media (max-width: 860px) {
    .room-wrap { flex-direction: column; align-items: stretch; gap: 0; }
    .room-hero {
        flex: 0 0 auto; align-self: center; height: auto;
        width: min(100%, 44vh); max-width: none; aspect-ratio: 1 / 1;
        margin: 0 auto 0.6rem;
    }
    .room-main { flex: 1 1 auto; }
}

/* 대화 배경 — 감지된 기분에 맞는 캐릭터 이미지를 화면 전체 배경으로(가독성 위해 어둡게+블러) */
.room-bg {
    position: fixed; inset: 0; z-index: 0; pointer-events: none;
    background-position: center; background-size: cover; background-repeat: no-repeat;
    filter: blur(3px) brightness(0.45); transform: scale(1.06);
    opacity: 0; transition: opacity 0.6s ease;
}
.room-bg.show { opacity: 1; }
/* 대화 페이지(채팅방·음성통화)에서 콘텐츠는 배경 위에 표시 */
body[data-character-id] .nav { position: relative; z-index: 2; }
body[data-character-id] .room-wrap,
body[data-character-id] .voice-wrap { position: relative; z-index: 1; }

/* ── API 문서 페이지 ── */
.copy-btn { padding: 0.5rem 1rem; font-size: 0.9rem; }
.api-doc { max-width: 860px; margin: 0 auto; padding: 1.5rem 1.25rem 4rem; }
.api-hero { text-align: center; padding: 1.5rem 0 2rem; }
.api-hero h1 { font-size: 2rem; }
.api-desc { color: var(--muted); margin: 0.4rem 0 1.1rem; }
.api-meta { display: flex; gap: 0.5rem; justify-content: center; flex-wrap: wrap; }
.pill {
    background: #eff6ff; color: var(--accent); font-weight: 700;
    font-size: 0.82rem; padding: 0.32rem 0.8rem; border-radius: 8px;
}
.pill-url { background: #e7eeff; color: var(--accent-2); font-family: ui-monospace, monospace; }

.api-section-title { margin: 1.8rem 0 0.9rem; font-size: 1.3rem; }
.api-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 6px;
    padding: 1.3rem 1.4rem; margin-bottom: 1rem;
    box-shadow: 0 6px 18px rgba(43, 34, 64, 0.04);
}
.api-card h2 { font-size: 1.1rem; margin-bottom: 0.5rem; }
.api-auth code, .ep-path, .doc-links code { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.muted { color: var(--muted); font-size: 0.92rem; }

.endpoint { padding: 1.1rem 1.3rem; }
.ep-head { display: flex; align-items: center; gap: 0.7rem; flex-wrap: wrap; }
.method {
    font-weight: 800; font-size: 0.78rem; letter-spacing: 0.03em;
    padding: 0.28rem 0.6rem; border-radius: 7px; color: #fff;
}
.m-get { background: #1a8f4c; }
.m-post { background: var(--accent-2); }
.m-delete { background: #e03131; }
.m-put, .m-patch { background: #f08c00; }
.ep-path { font-size: 1rem; font-weight: 600; color: var(--ink); }
.lock { font-size: 0.8rem; color: #b07a00; background: #fff7e6; padding: 0.2rem 0.5rem; border-radius: 6px; }
.ep-summary { color: var(--muted); margin: 0.55rem 0 0.2rem; }
.ep-detail { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.7rem; }
.ep-label { display: inline-block; font-size: 0.78rem; font-weight: 700; color: var(--muted); margin-bottom: 0.25rem; text-transform: uppercase; letter-spacing: 0.04em; }
.ep-block pre, .api-doc pre {
    background: #0f1730; color: #d7e0f5; border-radius: 10px;
    padding: 0.85rem 1rem; overflow-x: auto; font-size: 0.86rem; line-height: 1.5;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin: 0;
}
.doc-links { list-style: none; display: flex; flex-direction: column; gap: 0.4rem; }
.doc-links a { color: var(--accent); font-weight: 600; }

/* 복사 토스트 */
.toast {
    position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%) translateY(20px);
    background: #1a8f4c; color: #fff; padding: 0.8rem 1.3rem; border-radius: 6px;
    font-weight: 700; box-shadow: 0 10px 30px rgba(0,0,0,0.18);
    opacity: 0; pointer-events: none; transition: opacity 0.2s, transform 0.2s; z-index: 50;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.toast-err { background: #e03131; }

/* 인앱 알림 배너 — 앱이 켜져 있을 때 OS 푸시 대신 화면 위에 직접 띄운다(inapp_notify.js) */
.inapp-notif-wrap {
    position: fixed; top: calc(env(safe-area-inset-top, 0px) + 10px); left: 50%;
    transform: translateX(-50%); width: min(420px, calc(100vw - 20px));
    display: flex; flex-direction: column; gap: 8px; z-index: 9999; pointer-events: none;
}
.inapp-notif {
    display: flex; align-items: flex-start; gap: 10px;
    background: var(--card); color: var(--ink);
    border: 1px solid var(--line); border-radius: 14px;
    padding: 0.7rem 0.8rem; box-shadow: var(--shadow-md);
    opacity: 0; transform: translateY(-14px); transition: opacity 0.22s, transform 0.22s;
    pointer-events: auto;
}
.inapp-notif.show { opacity: 1; transform: translateY(0); }
.inapp-notif.clickable { cursor: pointer; }
.inapp-notif-body { flex: 1; min-width: 0; }
.inapp-notif-title { font-weight: 700; font-size: 0.94rem; }
.inapp-notif-text {
    color: var(--muted); font-size: 0.86rem; margin-top: 2px;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.inapp-notif-x {
    background: none; border: 0; color: var(--muted); font-size: 0.9rem;
    cursor: pointer; padding: 2px 4px; line-height: 1;
}

/* ── 실시간 음성 대화 페이지 ── */
.voice-link, .room-settings-link { padding: 0.5rem 1rem; font-size: 0.9rem; }
.voice-wrap {
    max-width: 560px; margin: 0 auto; padding: 1.5rem 1.25rem 3rem;
    display: flex; flex-direction: column; align-items: center; text-align: center;
}
/* 좌: 캐릭터 사진·영상 / 우: 대화 내용. 넓은 화면(≥900px)에선 좌우 2컬럼. */
.voice-media { width: min(560px, 92vw); }
/* 아바타(사진)가 없는 캐릭터는 좌측 컬럼을 접어 대화 내용이 가운데 오도록 */
.voice-media:not(:has(.voice-avatar.show)) { display: none; }
.voice-side {
    display: flex; flex-direction: column; align-items: center;
    text-align: center; width: 100%;
}
@media (min-width: 900px) {
    .voice-wrap {
        max-width: 1120px; flex-direction: row; align-items: flex-start;
        justify-content: center; gap: 2rem;
    }
    .voice-media {
        width: min(480px, 45vw); flex: 0 0 auto; position: sticky; top: 1.5rem;
    }
    .voice-side { flex: 1 1 0; max-width: 560px; min-width: 0; }
}
/* 통화 상대 아바타 — 800×800 기준, 좁은 화면에선 화면 폭에 맞춰 축소.
   이미지 위에 idle/talking 무음 루프 영상을 겹쳐 캐릭터가 말할 때 talking 을 보여준다. */
.voice-avatar {
    display: none; position: relative; overflow: hidden;
    width: 100%; max-width: none; aspect-ratio: 1 / 1;
    border-radius: 20px; margin: 0.5rem 0 1rem;
    border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0, 0, 0, 0.25);
}
.voice-avatar.show { display: block; }
.voice-profile { width: 100%; height: 100%; object-fit: cover; display: block; }
.voice-video {
    position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover;
    opacity: 0; transition: opacity 0.3s ease;
}
.voice-video.on { opacity: 1; }
.voice-video-live { z-index: 2; }  /* 립싱크 스트림은 루프 영상 위에 겹침 */
.voice-emoji { font-size: 3rem; margin: 0.5rem 0 1rem; transition: transform 0.3s; }
.voice-emoji.live { transform: scale(1.1); }

.orb {
    width: 150px; height: 150px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    background: radial-gradient(circle at 50% 40%, #ffd9e1, #ffe7ec);
    margin: 0.5rem 0 1.2rem; transition: background 0.3s;
}
.orb-core {
    width: 96px; height: 96px; border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 30px rgba(37, 99, 235, 0.25);
}
.orb-connect .orb-core { animation: pulse 1.2s ease-in-out infinite; opacity: 0.6; }
.orb-listen { background: radial-gradient(circle at 50% 40%, #d9f2e3, #e9f8ef); }
.orb-listen .orb-core { background: linear-gradient(135deg, #34d399, #4d7cff); animation: breathe 2s ease-in-out infinite; }
.orb-speak .orb-core { animation: pulse 0.6s ease-in-out infinite; }

@keyframes pulse { 0%,100% { transform: scale(1); } 50% { transform: scale(1.12); } }
@keyframes breathe { 0%,100% { transform: scale(1); opacity: 0.9; } 50% { transform: scale(1.06); opacity: 1; } }

.voice-status { font-size: 1.1rem; font-weight: 600; color: var(--ink); min-height: 1.5em; margin-bottom: 1rem; }
.voice-transcript {
    width: 100%; background: var(--bg-soft); border: 1px solid var(--line);
    border-radius: 6px; padding: 1rem; min-height: 120px; max-height: 60vh;
    overflow-y: auto; display: flex; flex-direction: column; gap: 0.5rem;
    text-align: left; margin-bottom: 1.2rem;
}
.voice-transcript:empty { display: none; }
/* 지난 대화 ↔ 이번 통화 자막 구분선 */
.voice-history-sep {
    align-self: center; margin: 0.4rem 0; padding: 0.15rem 0.7rem;
    font-size: 0.72rem; font-weight: 700; color: var(--muted);
    background: var(--card); border: 1px solid var(--line); border-radius: 999px;
}
.voice-controls { display: flex; gap: 0.7rem; }
.voice-btn { padding: 0.85rem 1.8rem; }
.voice-hint { color: var(--muted); font-size: 0.85rem; margin-top: 1rem; }

/* ── 탐색(릴스) 페이지 ── 유저 피드 사진·동영상을 세로로 넘겨보는 피드 */
.explore-page { padding: 0; margin: 0; }
.explore-feed {
    height: 100vh; height: 100dvh;
    overflow-y: auto; scroll-snap-type: y mandatory;
    background: #000; scrollbar-width: none; -ms-overflow-style: none;
}
.explore-feed::-webkit-scrollbar { display: none; }
.explore-loading { color: #eee; text-align: center; padding: 40vh 1rem; }
/* 뒤로가기 — 피드 위 고정 오버레이. 좌상단 햄버거(.sb-toggle)와 겹치지 않게 우상단. */
.ex-back {
    /* 우측 상단은 검색·더보기 버튼이 쓰므로 뒤로가기는 좌측 */
    position: fixed; top: 0.9rem; left: 0.9rem; z-index: 46;
    width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(0,0,0,0.45); color: #fff; font-size: 1.9rem; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    padding-bottom: 3px; backdrop-filter: blur(4px);
}
.ex-back:hover { background: rgba(0,0,0,0.65); }
/* 탐색 우측 상단 — 검색 / 더보기 */
.ex-top { position: fixed; top: 0.9rem; right: 0.9rem; z-index: 46; display: flex; gap: 8px; }
.ex-top-btn {
    width: 42px; height: 42px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(0,0,0,0.45); color: #fff; font-size: 1.15rem; line-height: 1;
    display: flex; align-items: center; justify-content: center; backdrop-filter: blur(4px);
}
.ex-top-btn:hover { background: rgba(0,0,0,0.65); }
.ex-menu {
    position: absolute; top: 50px; right: 0; min-width: 150px; padding: 6px;
    background: var(--card, #1b1b1f); border: 1px solid rgba(255,255,255,0.12);
    border-radius: 12px; box-shadow: 0 10px 30px rgba(0,0,0,.45);
}
.ex-menu-item {
    width: 100%; padding: 10px 12px; border: 0; border-radius: 8px; cursor: pointer;
    background: transparent; color: inherit; font-size: 0.92rem; text-align: left; white-space: nowrap;
}
.ex-menu-item:hover { background: rgba(255,255,255,0.08); }
/* 관리자 전용 항목(노출금지) — 위험한 조치라 빨간 글씨로 구분 */
.ex-menu-danger { color: #ff8a8a; }
/* 검색바 */
.ex-search {
    position: fixed; top: 0.9rem; left: 50%; transform: translateX(-50%); z-index: 47;
    display: flex; gap: 6px; align-items: center; width: min(92vw, 440px);
    background: rgba(0,0,0,0.6); backdrop-filter: blur(6px);
    border: 1px solid rgba(255,255,255,0.15); border-radius: 999px; padding: 5px 6px 5px 14px;
}
.ex-search[hidden] { display: none; }
/* 검색바가 열리면 상단 버튼(뒤로가기·검색·더보기)은 자리를 비켜 준다 */
body.ex-searching .ex-top, body.ex-searching .ex-back { display: none; }   /* display 지정이 hidden 속성을 이기므로 명시 */
.ex-search input {
    flex: 1; min-width: 0; border: 0; background: transparent; color: #fff; font-size: 0.95rem; outline: none;
}
.ex-search button {
    border: 0; border-radius: 999px; padding: 7px 12px; cursor: pointer;
    background: rgba(255,255,255,0.16); color: #fff; font-size: 0.85rem; font-weight: 700;
}
.ex-search button:hover { background: rgba(255,255,255,0.26); }
/* 신고 모달 */
.ex-modal { position: fixed; inset: 0; z-index: 120; display: flex; align-items: center; justify-content: center; padding: 20px; }
.ex-modal[hidden] { display: none; }
.ex-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.65); }
.ex-modal-box {
    position: relative; width: min(94vw, 440px); max-height: 88vh; overflow-y: auto;
    background: var(--card, #17171b); color: inherit; border-radius: 18px; padding: 20px;
}
.ex-modal-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.ex-modal-head h2 { margin: 0; font-size: 1.05rem; }
.ex-modal-close { border: 0; background: transparent; color: inherit; font-size: 1.2rem; cursor: pointer; }
.ex-modal-sub { font-size: 0.85rem; color: var(--muted, #9ca3af); margin: 6px 0 14px; line-height: 1.5; }
.ex-reasons { display: flex; flex-direction: column; gap: 8px; margin-bottom: 12px; }
.ex-reason { display: flex; align-items: center; gap: 9px; font-size: 0.92rem; cursor: pointer; }
.ex-modal-box textarea {
    width: 100%; box-sizing: border-box; padding: 10px 12px; border-radius: 12px; font-family: inherit;
    border: 1px solid rgba(255,255,255,0.15); background: rgba(255,255,255,0.06); color: inherit;
}
.ex-modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 14px; }
.ex-card {
    height: 100vh; height: 100dvh;
    scroll-snap-align: start; scroll-snap-stop: always;
    display: flex; align-items: center; justify-content: center; background: #000;
}
.ex-frame {
    position: relative; width: 100%; height: 100%; max-width: 480px;
    overflow: hidden; background: #0a0a0a;
}
.ex-video, .ex-image, .ex-shade { position: absolute; inset: 0; width: 100%; height: 100%; }
.ex-video { object-fit: cover; background: #0a0a0a; }
.ex-image { object-fit: contain; background: #0a0a0a; }
.ex-card.no-video .ex-video { display: none; }
/* 아래쪽 정보/버튼 가독성을 위한 어두운 그라데이션 */
.ex-shade {
    background: linear-gradient(to top, rgba(0,0,0,0.82) 0%, rgba(0,0,0,0.35) 30%, rgba(0,0,0,0) 55%);
    pointer-events: none;
}
.ex-info {
    position: absolute; left: 0; right: 0; bottom: 0;
    padding: 1.2rem 1.3rem 1.6rem; color: #fff; text-align: left;
    display: flex; flex-direction: column; gap: 0.25rem;
}
/* 작성자 줄 — 아바타 + 이름 + 날짜. 아바타·이름은 그 유저의 피드(/u/{id})로 가는 링크 */
.ex-author { display: flex; align-items: center; gap: 0.55rem; }
.ex-author-link { display: flex; align-items: center; gap: 0.55rem; color: inherit; text-decoration: none; }
.ex-author-link:hover .ex-author-name { text-decoration: underline; }
.ex-avatar {
    width: 34px; height: 34px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: rgba(255,255,255,0.22); color: #fff; font-weight: 800; font-size: 0.95rem;
    display: flex; align-items: center; justify-content: center;
}
.ex-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-author-name { font-size: 1.05rem; font-weight: 800; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.ex-date { font-size: 0.8rem; opacity: 0.75; text-shadow: 0 1px 6px rgba(0,0,0,0.6); }
.ex-caption { font-size: 0.92rem; opacity: 0.92; margin-top: 0.3rem; text-shadow: 0 1px 6px rgba(0,0,0,0.6);
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    white-space: pre-wrap; }
/* 게시물 태그(#태그) — 영상 위에 얹히므로 반투명 배경으로 가독성 확보 */
.ex-tags { display: flex; flex-wrap: wrap; gap: 0.3rem; margin-top: 0.4rem; }
.ex-tags:empty { display: none; }
.ex-tags span { font-size: 0.8rem; padding: 0.1rem 0.55rem; border-radius: 999px;
    background: rgba(255,255,255,0.18); border: 1px solid rgba(255,255,255,0.32); }
/* 우측 세로 액션 바 — 좋아요·댓글(릴스식). '다음' 버튼 위에 쌓인다. */
.ex-actions {
    position: absolute; right: 0.9rem; bottom: 10rem; z-index: 2;
    display: flex; flex-direction: column; gap: 1.1rem; align-items: center;
}
.ex-act {
    border: 0; background: transparent; cursor: pointer; padding: 0;
    display: flex; flex-direction: column; align-items: center; gap: 0.15rem;
    color: #fff; font-size: 0.78rem; font-weight: 700;
    text-shadow: 0 1px 6px rgba(0,0,0,0.7);
}
.ex-act-icon { font-size: 1.9rem; line-height: 1; filter: drop-shadow(0 1px 4px rgba(0,0,0,0.5)); }
/* '✨ AI 생성'은 숫자가 아니라 글자라 줄바꿈되지 않게 */
.ex-ai .ex-act-count { white-space: nowrap; }
.ex-act:active .ex-act-icon { transform: scale(0.88); }
.ex-like.on .ex-act-icon { animation: exLikePop 0.35s ease; }
@keyframes exLikePop { 0% { transform: scale(1); } 45% { transform: scale(1.35); } 100% { transform: scale(1); } }
/* 더블클릭 좋아요 — 가운데 큰 하트가 잠깐 떴다 사라진다 */
.ex-heart {
    position: absolute; top: 50%; left: 50%; z-index: 3;
    transform: translate(-50%, -50%) scale(0.3);
    font-size: 6rem; opacity: 0; pointer-events: none;
}
.ex-heart.pop { animation: exHeart 0.9s ease-out; }
@keyframes exHeart {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.3); }
    25% { opacity: 1; transform: translate(-50%, -50%) scale(1.15); }
    50% { transform: translate(-50%, -50%) scale(0.95); }
    100% { opacity: 0; transform: translate(-50%, -60%) scale(1); }
}
/* 한 번 눌러 멈춘 영상 — 가운데에 재생(▶) 표시가 뜬다 */
.ex-play {
    position: absolute; top: 50%; left: 50%; z-index: 3;
    transform: translate(-50%, -50%) scale(0.85);
    font-size: 4rem; line-height: 1; color: rgba(255,255,255,0.9);
    text-shadow: 0 2px 14px rgba(0,0,0,0.65);
    opacity: 0; pointer-events: none;
    transition: opacity 0.15s ease, transform 0.15s ease;
}
.ex-card.paused .ex-play { opacity: 1; transform: translate(-50%, -50%) scale(1); }
/* 댓글 시트 — 아래에서 올라오는 패널 */
.ex-sheet { position: fixed; inset: 0; z-index: 60; display: none; }
.ex-sheet.open { display: block; }
.ex-sheet-back { position: absolute; inset: 0; background: rgba(0,0,0,0.5); }
.ex-sheet-panel {
    position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 100%; max-width: 480px; height: 62dvh;
    background: var(--card, #16181c); color: var(--text, #eee);
    border-radius: 18px 18px 0 0; border: 1px solid var(--line, #2a2d33); border-bottom: 0;
    display: flex; flex-direction: column; animation: exSheetUp 0.22s ease-out;
}
@keyframes exSheetUp { from { transform: translate(-50%, 100%); } to { transform: translate(-50%, 0); } }
.ex-sheet-head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line, #2a2d33);
}
.ex-sheet-title { font-weight: 800; }
.ex-sheet-close {
    border: 0; background: transparent; color: inherit; font-size: 1.1rem; cursor: pointer;
}
.ex-sheet-list { flex: 1; overflow-y: auto; padding: 0.8rem 1.1rem; display: flex;
    flex-direction: column; gap: 0.9rem; }
.ex-sheet-empty { color: var(--muted, #9aa0a6); text-align: center; padding: 2rem 0; font-size: 0.9rem; }
.ex-cmt { display: flex; gap: 0.6rem; align-items: flex-start; }
.ex-cmt-avatar {
    width: 32px; height: 32px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: var(--bg-soft, #22252a); color: var(--text, #eee);
    display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem;
}
.ex-cmt-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ex-cmt-body { flex: 1; min-width: 0; }
.ex-cmt-top { display: flex; align-items: baseline; gap: 0.45rem; }
.ex-cmt-name { font-size: 0.88rem; }
.ex-cmt-date { font-size: 0.72rem; color: var(--muted, #9aa0a6); }
.ex-cmt-text { font-size: 0.92rem; white-space: pre-wrap; word-break: break-word; margin-top: 0.15rem; }
.ex-cmt-del {
    border: 0; background: transparent; color: var(--muted, #9aa0a6);
    font-size: 0.75rem; cursor: pointer; flex-shrink: 0; padding: 0.1rem 0.2rem;
}
.ex-sheet-form {
    display: flex; gap: 0.5rem; padding: 0.8rem 1.1rem;
    padding-bottom: calc(0.8rem + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--line, #2a2d33);
}
.ex-sheet-input {
    flex: 1; min-width: 0; padding: 0.6rem 0.8rem; border-radius: 999px;
    border: 1px solid var(--line, #2a2d33); background: var(--bg-soft, #22252a); color: inherit;
}
.ex-sheet-send {
    border: 0; border-radius: 999px; padding: 0.6rem 1.1rem; cursor: pointer;
    background: var(--accent, #3b82f6); color: #fff; font-weight: 700;
}
.ex-sheet-send:disabled { opacity: 0.5; cursor: default; }
/* '다음 게시물' 버튼 — 우측 하단 원형, 아래로 넘기라는 힌트 */
.ex-next {
    position: absolute; right: 0.9rem; bottom: 6.5rem;
    width: 46px; height: 46px; border-radius: 50%; border: 0; cursor: pointer;
    background: rgba(255,255,255,0.16); color: #fff; font-size: 1.6rem; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    backdrop-filter: blur(4px); animation: exBounce 1.8s ease-in-out infinite;
}
.ex-next:hover { background: rgba(255,255,255,0.3); }
@keyframes exBounce { 0%,100% { transform: translateY(0); } 50% { transform: translateY(5px); } }
/* 데스크톱: 폰 형태 컬럼으로 가운데 정렬 + 둥근 모서리 */
@media (min-width: 700px) {
    .ex-frame {
        height: calc(100dvh - 32px); margin: 16px auto; border-radius: 20px;
        box-shadow: 0 10px 40px rgba(0,0,0,0.5);
    }
}

/* 통화 전 설정(대화 모드·언어) */
.voice-setup {
    width: 100%; max-width: 420px; margin: 0 auto 1.4rem;
    display: flex; flex-direction: column; gap: 0.7rem;
    background: var(--bg-soft); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 1rem 1.1rem;
}
.voice-setup-row { display: flex; align-items: center; justify-content: space-between; gap: 0.8rem; }
.voice-setup-label { font-size: 0.92rem; font-weight: 700; color: var(--ink); flex-shrink: 0; }
.voice-setup .pretty-select { width: auto; min-width: 130px; }
.voice-setup-hint { color: var(--muted); font-size: 0.8rem; text-align: left; margin: 0; }
.seg { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--card); }
.seg-btn {
    padding: 0.45rem 0.85rem; border: 0; background: transparent;
    color: var(--muted); font-size: 0.88rem; font-weight: 700; cursor: pointer;
    white-space: nowrap; transition: background 0.15s, color 0.15s;
}
.seg-btn + .seg-btn { border-left: 1.5px solid var(--line); }
.seg-btn.is-active { background: var(--accent); color: #fff; }

/* ── 게스트 로그인 ── */
.auth-divider { display: flex; align-items: center; gap: 0.75rem; margin: 1.2rem 0 0.9rem; color: var(--muted); font-size: 0.85rem; }
.auth-divider::before, .auth-divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.auth-guest { width: 100%; }

/* ── 핸드폰 번호 로그인 ── */
.phone-row { display: flex; gap: 0.5rem; }
.phone-row input[type="tel"] { flex: 1; min-width: 0; }
.cc-select { position: relative; flex-shrink: 0; }
.cc-btn {
    display: flex; align-items: center; gap: 0.35rem; height: 100%;
    padding: 0.8rem 0.7rem; border: 1.5px solid var(--line); border-radius: 6px;
    background: var(--card); color: var(--ink); font-size: 1rem; font-weight: 600;
    cursor: pointer; transition: border-color 0.15s;
}
.cc-btn:hover, .cc-btn[aria-expanded="true"] { border-color: var(--accent); }
.cc-caret { color: var(--muted); font-size: 0.75rem; }
.cc-panel {
    position: absolute; top: calc(100% + 6px); left: 0; z-index: 30;
    width: 300px; max-width: 82vw; background: var(--card);
    border: 1px solid var(--line); border-radius: 8px;
    box-shadow: 0 12px 32px rgba(43, 34, 64, 0.18); padding: 0.6rem;
}
.cc-search {
    width: 100%; padding: 0.55rem 0.75rem; border: 1.5px solid var(--line);
    border-radius: 6px; font-size: 0.95rem; outline: none; background: var(--bg); color: var(--ink);
}
.cc-search:focus { border-color: var(--accent); }
.cc-list {
    list-style: none; margin: 0.5rem 0 0; padding: 0;
    max-height: 260px; overflow-y: auto;
}
.cc-list li {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.5rem 0.6rem; border-radius: 6px; cursor: pointer; font-size: 0.95rem;
}
.cc-list li:hover, .cc-list li.is-selected { background: var(--accent-soft); }
.cc-item-flag { font-size: 1.15rem; }
.cc-item-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cc-item-dial { color: var(--muted); font-weight: 600; }
.cc-empty { color: var(--muted); cursor: default; }
.cc-empty:hover { background: transparent; }
.phone-step { display: flex; flex-direction: column; gap: 1rem; }
.phone-step[hidden] { display: none; }
.phone-sent { display: flex; align-items: center; justify-content: space-between; gap: 0.6rem;
    color: var(--muted); font-size: 0.92rem; }
.link-btn { border: 0; background: transparent; color: var(--accent); font-weight: 700;
    font-size: 0.9rem; cursor: pointer; padding: 0.2rem 0; white-space: nowrap; }
.link-btn:hover { text-decoration: underline; }
.btn-ghost { background: var(--card); color: var(--ink); border: 1.5px solid var(--line);
    padding: 0.8rem 1rem; border-radius: 6px; font-weight: 700; font-size: 0.98rem; cursor: pointer;
    transition: border-color 0.15s; }
.btn-ghost:hover:not(:disabled) { border-color: var(--accent); }
.btn-ghost:disabled { opacity: 0.55; cursor: default; }
.code-row { display: flex; align-items: center; gap: 0.6rem; }
.code-row input { flex: 1; min-width: 0; letter-spacing: 0.25em; }
.code-timer { color: var(--accent); font-weight: 700; font-size: 0.95rem; min-width: 3.2em; text-align: right; }
.sms-demo {
    background: var(--accent-soft); color: var(--accent); border-radius: 6px;
    padding: 0.65rem 0.85rem; font-size: 0.88rem; font-weight: 600;
}
.social-btn.phone { background: var(--card); color: var(--ink); }
.social-btn.phone .social-ico { background: var(--accent-soft); }

/* ── 더보기 페이지 ── */
.more-wrap { max-width: 480px; margin: 0 auto; padding: 2rem 1.25rem 3rem; }
.more-wrap h1 { font-size: 1.7rem; margin-bottom: 1.25rem; }
.more-user {
    display: flex; align-items: center; gap: 1rem; background: var(--card);
    border: 1px solid var(--line); border-radius: 6px; padding: 1.1rem 1.2rem; margin-bottom: 1.25rem;
}
.more-avatar {
    width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center;
    justify-content: center; font-size: 1.7rem; background: #eff6ff; flex-shrink: 0;
}
.more-name { font-weight: 800; font-size: 1.1rem; }
.more-email { color: var(--muted); font-size: 0.88rem; }
.more-list { display: flex; flex-direction: column; gap: 0.6rem; }
.more-item {
    display: flex; align-items: center; justify-content: space-between;
    background: var(--card); border: 1px solid var(--line); border-radius: 6px;
    padding: 1rem 1.2rem; font-size: 1rem; font-weight: 600; color: var(--ink);
    cursor: pointer; width: 100%; text-align: left; transition: border-color 0.15s, transform 0.15s;
}
.more-item:hover { border-color: var(--accent); transform: translateX(2px); }
.more-item .chev { color: var(--muted); font-size: 1.2rem; }
.more-item .more-right { display: flex; align-items: center; gap: 0.5rem; }
.more-item .more-badge {
    display: inline-flex; align-items: center; justify-content: center; min-width: 18px; height: 18px;
    padding: 0 5px; border-radius: 999px; background: #e8453c; color: #fff;
    font-size: 0.7rem; font-weight: 800; line-height: 1;
}
/* inline-flex 가 UA 의 [hidden]{display:none} 을 이기지 못하게 (사이드바 뱃지와 같은 이유) */
.more-item .more-badge[hidden] { display: none; }
.more-item.danger { color: #e03131; }
.more-item.danger:hover { border-color: #e03131; }

/* ── 더보기(/more) 전용 — 심플 버전 ──
   줄마다 카드(테두리+배경)를 두면 화면이 무거워서, 얇은 구분선만 있는 납작한 목록으로 둔다.
   `.simple` 을 붙인 목록에만 적용된다 — .more-item 은 친구설정·실험실 등 다른 페이지도 쓴다. */
.more-wrap .more-user {
    background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
    padding: 0.1rem 0.15rem 1.1rem; margin-bottom: 0.2rem; gap: 0.8rem;
}
.more-wrap .more-avatar { width: 42px; height: 42px; font-size: 1.35rem; background: var(--bg-soft); }
.more-wrap .more-name { font-size: 1rem; font-weight: 700; }
.more-list.simple { gap: 0; }
.more-list.simple .more-item {
    gap: 0.85rem; justify-content: flex-start;
    background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
    padding: 0.95rem 0.15rem; font-size: 0.95rem; font-weight: 500;
    transition: color 0.15s;
}
.more-list.simple .more-item:last-child { border-bottom: 0; }
.more-list.simple .more-item:hover { color: var(--accent); transform: none; }
.more-list.simple .more-label { flex: 1; }
.more-list.simple .more-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 1.4rem; }
.more-list.simple .more-ico svg {
    width: 19px; height: 19px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
    opacity: 0.8;  /* 글자보다 옅게 — 이모지처럼 튀지 않게 */
}
.more-list.simple .more-item:hover .more-ico svg { opacity: 1; }
.more-list.simple .more-item .chev { font-size: 0.95rem; font-weight: 500; }

/* 회원탈퇴 — 버튼 모양 없이 맨 아래 작은 글씨(되돌릴 수 없는 동작이라 눈에 덜 띄게) */
.more-quit { margin: 1.6rem 0 0; text-align: center; }
.more-quit-link {
    background: none; border: 0; padding: 0.2rem; cursor: pointer;
    color: var(--muted); font-size: 0.8rem; text-decoration: underline;
    text-underline-offset: 3px;
}
.more-quit-link:hover { color: #e03131; }

/* ── 실험실(lab) ── */
.lab-desc { color: var(--muted); font-size: 0.9rem; margin: 0.2rem 0 1rem; }
.lab-hint { color: var(--muted); font-size: 0.85rem; margin: 0.8rem 0 0; }
.lab-tag {
    display: inline-block; margin-left: 0.35rem; padding: 1px 7px; border-radius: 999px;
    font-size: 0.68rem; font-weight: 700; vertical-align: middle;
    background: color-mix(in srgb, var(--accent) 18%, transparent); color: var(--accent);
}

/* ── 3명 통화(그룹통화) ── */
.gc-wrap { text-align: center; }
.gc-members { display: flex; gap: 1.4rem; justify-content: center; margin: 0.5rem 0 1rem; }
.gc-member { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.4rem; }
.gc-member figcaption { font-weight: 700; font-size: 0.95rem; color: var(--ink); }
.gc-avatar {
    width: 120px; height: 120px; border-radius: 50%; overflow: hidden;
    background: var(--card); border: 3px solid var(--line);
    display: flex; align-items: center; justify-content: center; transition: border-color 0.2s, box-shadow 0.2s;
}
.gc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.gc-avatar .gc-emoji { font-size: 3rem; }
.gc-member.speaking .gc-avatar { border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 25%, transparent); }
.gc-mode { color: var(--muted); font-size: 0.9rem; margin: 0.3rem 0; min-height: 1.2em; }
.gc-viz {
    display: block; width: 100%; max-width: 480px; height: 72px;
    margin: 0.2rem auto 0.6rem; border-radius: 12px;
    background: color-mix(in srgb, var(--accent) 6%, transparent);
}
.gc-controls { display: flex; gap: 0.6rem; justify-content: center; margin: 1rem 0 0.5rem; }
.gc-credit { color: var(--muted); font-size: 0.8rem; }
.gc-line { text-align: left; margin: 0.35rem 0; font-size: 0.95rem; line-height: 1.4; }
.gc-line-user { color: var(--muted); }
.gc-line b { color: var(--accent); margin-right: 0.3rem; }
.gc-empty { margin-top: 2rem; color: var(--muted); }

/* ── 더보기 — 섹션 제목 ── */
.more-section-title {
    font-size: 0.8rem; font-weight: 700; letter-spacing: 0.08em;
    color: var(--muted); text-transform: uppercase; margin: 1.25rem 0 0.4rem 0.2rem;
}

/* ── 토글 스위치 ── */
.toggle-switch {
    position: relative; display: inline-block; width: 46px; height: 26px; flex-shrink: 0;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-track {
    position: absolute; cursor: pointer; inset: 0;
    background: var(--line); border-radius: 8px; transition: background 0.2s;
}
.toggle-track::after {
    content: ""; position: absolute; left: 3px; top: 3px;
    width: 20px; height: 20px; border-radius: 50%; background: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.18); transition: transform 0.2s;
}
.toggle-switch input:checked + .toggle-track { background: var(--accent); }
.toggle-switch input:checked + .toggle-track::after { transform: translateX(20px); }

/* ── 채팅방 — 번역/발음 어노테이션 ── */
.msg-annotation {
    margin-top: 0.4rem; padding: 0.45rem 0.75rem;
    border-radius: 10px; font-size: 0.82rem; line-height: 1.45;
}
.msg-translation {
    background: #f0f4ff; color: #3a5ccc; border-left: 3px solid #4d7cff;
}
.msg-pronunciation {
    background: #eff6ff; color: #b02a52; border-left: 3px solid var(--accent);
    font-style: italic;
}
.msg-annotation-loading { color: var(--muted); font-size: 0.8rem; margin-top: 0.3rem; }

/* ── 내 정보 성별 선택 ── */
.gender-field { display: flex; flex-direction: column; gap: 0.5rem; }
.gender-label { font-weight: 600; font-size: 0.92rem; }
.gender-options { display: flex; gap: 0.5rem; }
.gender-chip { flex: 1; }
.gender-chip input { position: absolute; opacity: 0; pointer-events: none; }
.gender-chip span {
    display: block; text-align: center; padding: 0.7rem 0.5rem; border: 1.5px solid var(--line);
    border-radius: 6px; font-weight: 600; font-size: 0.95rem; cursor: pointer; transition: all 0.15s;
}
.gender-chip input:checked + span {
    border-color: var(--accent); background: #eff6ff; color: var(--accent);
}
/* 성별 '기타' 드롭다운(트랜스젠더·게이·레즈비언 등) — 칩과 같은 높이로 인라인 배치 */
.gender-other-select {
    flex: 1; min-width: 0; padding: 0.7rem 0.5rem; border: 1.5px solid var(--line);
    border-radius: 6px; font-weight: 600; font-size: 0.95rem; background: var(--bg); color: var(--ink); cursor: pointer;
}
.gender-other-select:focus { border-color: var(--accent); outline: none; }

/* ── 소셜 로그인 버튼 ── */
.social-login { display: flex; flex-direction: column; gap: 0.6rem; margin-bottom: 0.9rem; }
.social-btn {
    display: flex; align-items: center; justify-content: center; gap: 0.6rem;
    padding: 0.8rem 1rem; border-radius: 6px; font-weight: 700; font-size: 0.98rem;
    border: 1.5px solid var(--line); transition: transform 0.15s, box-shadow 0.15s; cursor: pointer;
}
.social-btn:hover { transform: translateY(-1px); box-shadow: 0 6px 16px rgba(43,34,64,0.1); }
.social-ico {
    width: 22px; height: 22px; border-radius: 50%; display: inline-flex;
    align-items: center; justify-content: center; font-weight: 800; font-size: 0.85rem;
}
/* 구글 공식 로그인 버튼 — Google Identity 브랜딩 가이드라인(라이트 테마) 그대로.
   흰 배경 #FFFFFF / 테두리 #747775 / 글자 #1F1F1F, Roboto Medium. 기본 스펙(40px)을
   다른 소셜 버튼(이메일 등)과 같은 높이가 되게 비율 그대로 키웠다(가이드라인이 허용하는
   스케일 조정). 색·문구·로고를 임의로 바꾸면 가이드라인 위반이자 사칭 신호가 되므로
   건드리지 말 것. */
.social-btn.google.gsi-btn {
    background: #fff; color: #1f1f1f; border: 1px solid #747775; border-radius: 4px;
    min-height: 48px; padding: 0 14px; gap: 11px;
    font-family: "Roboto", -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans KR", sans-serif;
    font-size: 16px; font-weight: 500; letter-spacing: 0.25px;
}
.social-btn.google.gsi-btn:hover {
    background: #f7f8f8; border-color: #747775;
    transform: none; box-shadow: 0 1px 2px rgba(60,64,67,0.30), 0 1px 3px 1px rgba(60,64,67,0.15);
}
.social-btn.google.gsi-btn:active { background: #f1f3f4; }
.gsi-icon { display: inline-flex; align-items: center; justify-content: center; width: 20px; height: 20px; flex: none; }
.gsi-icon svg { display: block; width: 100%; height: 100%; }
.gsi-text { white-space: nowrap; }
.social-btn.apple { background: #000; color: #fff; border-color: #000; }
.social-btn.apple .social-ico::before { content: "\F8FF"; font-size: 1.1rem; }
.social-btn.kakao { background: #fee500; color: #191600; border-color: #fee500; }
.social-btn.kakao .social-ico { background: #191600; color: #fee500; }
.social-btn.facebook { background: #1877f2; color: #fff; border-color: #1877f2; }
.social-btn.facebook .social-ico { background: #fff; color: #1877f2; font-family: Georgia, "Times New Roman", serif; }
/* display:flex 가 UA 의 [hidden]{display:none} 을 이겨서, 회원가입 첫 화면에서
   가입폼이 처음부터 보이던 문제(사이드바 뱃지와 같은 이유). hidden 을 존중하게 명시한다. */
.social-login[hidden], .auth-form[hidden] { display: none; }
/* 회원가입 첫 화면의 '이메일로 회원가입' — 구글 버튼과 같은 크기의 담백한 버튼(브랜드색 테두리) */
.social-btn.email { background: none; color: var(--ink); border-color: var(--accent); }
.social-btn.email .social-ico { background: var(--accent-soft); color: var(--accent); font-size: 0.95rem; }
.skip-foot { margin-top: 0.4rem; }
.skip-foot .skip-link { color: var(--muted); font-weight: 600; }

/* ── 다른 방법으로 로그인(접기/펼치기) ── */
.more-login { margin-top: 1rem; text-align: center; }
.more-login-toggle {
    background: none; border: 0; padding: 0.35rem 0.2rem; cursor: pointer;
    color: var(--muted); font-size: 0.9rem; font-weight: 600; text-decoration: underline;
    text-underline-offset: 3px;
}
.more-login-toggle:hover { color: var(--ink); }
.more-login-toggle::after { content: " ▾"; text-decoration: none; }
.more-login-toggle.open::after { content: " ▴"; }
.more-login-panel { margin-top: 0.8rem; margin-bottom: 0; text-align: left; }
/* .social-login 의 display:flex 가 UA 의 [hidden] 보다 우선하므로 명시적으로 숨긴다 */
.more-login-panel[hidden] { display: none; }

/* ── api.md 렌더링 본문 ── */
.md-body { line-height: 1.7; }
.md-body h1 { font-size: 1.9rem; margin: 0.5rem 0 1rem; }
.md-body h2 { font-size: 1.35rem; margin: 1.8rem 0 0.7rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--line); }
.md-body h3 { font-size: 1.1rem; margin: 1.3rem 0 0.5rem; color: var(--accent); }
.md-body p { margin: 0.5rem 0; }
.md-body ul { margin: 0.5rem 0 0.5rem 1.3rem; }
.md-body li { margin: 0.25rem 0; }
.md-body hr { border: none; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.md-body a { color: var(--accent); font-weight: 600; }
.md-body code { background: #f3eef0; color: #c2255c; padding: 0.12rem 0.4rem; border-radius: 6px; font-size: 0.9em; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.md-body pre { background: #0f1730; border-radius: 10px; padding: 0.9rem 1.1rem; overflow-x: auto; margin: 0.6rem 0; }
.md-body pre code { background: none; color: #d7e0f5; padding: 0; font-size: 0.86rem; line-height: 1.5; }
.md-body blockquote { border-left: 3px solid var(--accent); background: var(--bg-soft); padding: 0.5rem 1rem; margin: 0.6rem 0; color: var(--muted); border-radius: 0 8px 8px 0; }

/* ── 상단 바(_topbar.html) — 화면 맨 위 가로 메뉴 ──
   sticky 라서 스크롤해도 위에 남는다. z-index 는 사이드바(40)보다 낮게 둬서
   모바일에서 사이드바 드로어가 상단 바를 덮도록 한다. */
.topbar {
    position: sticky; top: 0; z-index: 35;
    display: flex; align-items: center;
    height: 56px; padding: 0 1.1rem;
    background: rgba(255,255,255,0.9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line);
}
.tb-nav { display: flex; align-items: center; gap: 0.15rem; min-width: 0; overflow-x: auto; }
.tb-nav a {
    display: inline-flex; align-items: center; gap: 0.45rem; white-space: nowrap;
    padding: 0.5rem 0.85rem; border-radius: 8px;
    color: var(--ink); font-weight: 700; font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}
.tb-nav a:hover, .tb-nav a.active { background: var(--accent-soft); color: var(--accent); }
/* 아이콘은 사이드바와 같은 스프라이트를 쓰고, 색은 글자색을 물려받는다 */
.tb-ico { flex: none; display: inline-flex; align-items: center; justify-content: center; }
.tb-ico svg {
    width: 18px; height: 18px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.7;
}
/* 다크 배경은 아래 '하드코딩 표면 보정' 절의 html[data-theme="dark"] .topbar 규칙이 맡는다. */

/* 맨 우측 로그인 영역 — 비로그인: 로그인·회원가입 / 로그인: 닉네임(없으면 이메일) */
.tb-right { margin-left: auto; display: flex; align-items: center; gap: 0.15rem; flex: none; }
.tb-guest { display: flex; align-items: center; gap: 0.15rem; }
.tb-auth {
    padding: 0.45rem 0.75rem; border-radius: 8px; white-space: nowrap;
    color: var(--muted); font-weight: 700; font-size: 0.9rem;
    transition: background 0.15s, color 0.15s;
}
.tb-auth:hover { color: var(--accent); background: var(--accent-soft); }
.tb-signup { color: var(--accent); }
.tb-me {
    display: inline-flex; align-items: center; gap: 0.4rem;
    max-width: 15rem; padding: 0.4rem 0.8rem;
    border: 1px solid var(--line); border-radius: 999px;
    color: var(--ink); font-weight: 700; font-size: 0.88rem;
    transition: border-color 0.15s, color 0.15s;
}
.tb-me:hover { border-color: var(--accent); color: var(--accent); }
.tb-me-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* display 를 지정해 놨으니 hidden 속성이 먹도록 따로 눌러준다 —
   안 그러면 로그인 전에 빈 이름칸이, 로그인 후엔 '로그인'이 같이 보인다. */
.tb-guest[hidden], .tb-me[hidden] { display: none; }

/* 알림 종(🔔) — 닉네임 오른쪽. 안 읽은 수는 빨간 뱃지(.tb-badge)로 겹쳐 표시 */
.tb-bell {
    position: relative; flex: none; display: inline-flex; align-items: center; justify-content: center;
    padding: 0.4rem; margin-left: 0.2rem;
    border: 1px solid var(--line); border-radius: 999px;
    color: var(--ink); transition: border-color 0.15s, color 0.15s;
}
.tb-bell:hover { border-color: var(--accent); color: var(--accent); }
.tb-bell[hidden] { display: none; }
.tb-bell .tb-badge {
    position: absolute; top: -5px; right: -5px;
    display: inline-flex; align-items: center; justify-content: center;
    min-width: 16px; height: 16px; padding: 0 4px; border-radius: 999px;
    background: #e8453c; color: #fff; font-size: 0.65rem; font-weight: 800; line-height: 1;
}
.tb-bell .tb-badge[hidden] { display: none; }
@media (max-width: 860px) {
    /* 좌상단 햄버거(.sb-toggle)와 겹치지 않게 메뉴를 오른쪽으로 밀어준다 */
    .topbar { padding-left: 4rem; padding-right: 0.5rem; }
    .tb-nav a { padding: 0.5rem 0.6rem; font-size: 0.9rem; }
}
@media (max-width: 560px) {
    /* 좁은 화면(햄버거 + 메뉴 3개 + 로그인 영역)에선 폭이 빠듯하다:
       '회원가입'은 접고(로그인 화면에 가입 링크가 있다), 메뉴 아이콘도 빼서
       메뉴 3개와 이름칸이 잘리지 않고 한 줄에 들어가게 한다. */
    .tb-signup { display: none; }
    .tb-nav a { padding: 0.45rem 0.45rem; font-size: 0.85rem; gap: 0; }
    .tb-nav a .tb-ico { display: none; }
    .tb-me { max-width: 6.5rem; padding: 0.35rem 0.55rem; font-size: 0.82rem; }
    .tb-auth { padding: 0.4rem 0.5rem; font-size: 0.85rem; }
}

/* ── 좌측 사이드바 ── */
.sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: 240px; z-index: 40;
    background: rgba(255,255,255,0.82); backdrop-filter: blur(10px);
    border-right: 1px solid var(--line);
    display: flex; flex-direction: column; padding: 1.2rem 0.9rem;
    overflow-y: auto;  /* 메뉴가 많으면 사이드바 전체 스크롤 */
}
/* nav 안으로 옮긴 로그아웃 — 위 구분선 + 호버 시 빨강 */
.sb-nav .sb-account { margin-top: 0.5rem; padding: 0.5rem 0.7rem 0; border-top: 1px solid var(--line); font-size: 0.75rem; color: var(--muted, #888); word-break: break-all; line-height: 1.35; }
.sb-nav .sb-account + .sb-logout { margin-top: 0.35rem; border-top: none; padding-top: 0; }
.sb-nav .sb-logout { margin-top: 0.35rem; border-top: 1px solid var(--line); padding-top: 0.6rem; cursor: pointer; }
.sb-nav .sb-logout:hover { color: #e03131; }
.sb-brand { font-size: 1.35rem; font-weight: 800; padding: 0.3rem 0.6rem 1rem; letter-spacing: -0.01em; }
.sb-brand a { background: var(--grad); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent; }
.sb-user {
    display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.6rem;
    background: linear-gradient(150deg, #eff6ff, #eef2ff);
    border: 1px solid var(--line); border-radius: 6px; margin-bottom: 1rem;
}
.sb-avatar {
    width: 40px; height: 40px; border-radius: 50%; background: #fff; border: 1px solid var(--line); flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.sb-name { font-weight: 700; font-size: 0.95rem; }
.sb-sub { color: var(--muted); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px; }
.sb-nav { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-height: 0; overflow-y: auto; }
.sb-nav a {
    display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.8rem; border-radius: 6px;
    color: var(--ink); font-weight: 600; font-size: 0.95rem; transition: background 0.15s, color 0.15s;
}
.sb-nav a span { width: 1.3rem; text-align: center; }
/* 선 아이콘(_sidebar.html 의 <symbol> 스프라이트) — 색을 칠하지 않고 글자색을 물려받아
   다크는 흰색, 라이트는 회색, hover·active 는 강조색으로 함께 바뀐다. */
.sb-sprite { display: none; }
.sb-nav a .sb-ico {
    width: 1.3rem; flex: none; display: inline-flex; align-items: center; justify-content: center;
}
.sb-nav a .sb-ico svg {
    width: 19px; height: 19px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.7;
    stroke-linecap: round; stroke-linejoin: round;
    opacity: 0.85;  /* 글자보다 살짝 옅게 — 이모지처럼 튀지 않게 */
}
.sb-nav a:hover .sb-ico svg, .sb-nav a.active .sb-ico svg { opacity: 1; }
/* 브랜드(💬 크론)의 이모지도 같은 선 아이콘으로 — 글자 크기에 맞춰 조금 크게. */
.sb-brand a { display: inline-flex; align-items: center; gap: 0.45rem; }
.sb-brand .sb-brand-ico svg {
    width: 22px; height: 22px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.8;
    stroke-linecap: round; stroke-linejoin: round;
}
.sb-nav a:hover { background: var(--bg-soft); color: var(--accent); }
.sb-nav a.active { background: var(--accent-soft); color: var(--accent); box-shadow: inset 3px 0 0 var(--accent); }
.sb-bottom { display: flex; flex-direction: column; gap: 0.2rem; border-top: 1px solid var(--line); padding-top: 0.6rem; }
.sb-bottom button {
    display: flex; align-items: center; gap: 0.7rem; padding: 0.7rem 0.8rem; border-radius: 6px;
    background: none; border: none; cursor: pointer; color: var(--ink); font-weight: 600; font-size: 0.95rem; text-align: left;
}
.sb-bottom button[hidden] { display: none; }  /* 비로그인 시 로그아웃·회원탈퇴 숨김(display:flex가 [hidden] 덮어쓰던 문제) */
.sb-bottom button span { width: 1.3rem; text-align: center; }
.sb-bottom button:hover { background: var(--bg-soft); }
.sb-bottom button.danger { color: #e03131; }

/* ── 캐릭터 공개/비공개 토글 ── */
.cc-visibility { display: flex; flex-direction: column; gap: 0.5rem; }
.cc-visibility .gender-label { font-size: 1rem; font-weight: 800; color: var(--ink); }
.cc-vis-toggle { display: flex; gap: 0.5rem; }
.cc-vis-btn {
    flex: 1; display: flex; flex-direction: column; align-items: flex-start; gap: 0.15rem;
    padding: 0.8rem 0.9rem; border: 1.5px solid var(--line); border-radius: 6px;
    background: var(--card); cursor: pointer; text-align: left; transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}
.cc-vis-btn:hover { border-color: var(--accent); }
.cc-vis-btn.active {
    border-color: var(--accent); background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.cc-vis-title { font-weight: 800; font-size: 0.95rem; color: var(--ink); }
.cc-vis-btn.active .cc-vis-title { color: var(--accent); }
.cc-vis-desc { font-size: 0.78rem; color: var(--muted); }

/* ── 채팅방 설정: 섹션 구분 ── */
.cs-section { margin-top: 0.2rem; }
.cs-section-title {
    font-size: 0.78rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
    color: var(--muted); margin-bottom: 0.6rem;
}
.cs-divider { border: none; border-top: 1px solid var(--line); margin: 1.5rem 0; }
.cs-toggle-list { display: flex; flex-direction: column; gap: 0.8rem; margin-top: 0.5rem; }
.cs-pron-style { margin-top: 1rem; padding-top: 0.9rem; border-top: 1px dashed var(--line); }
.cs-substep-title { font-size: 0.92rem; font-weight: 700; color: var(--muted); margin: 0 0 0.5rem; }
.cs-scope { background: var(--accent-soft); color: var(--accent); border-radius: 8px; padding: 0.5rem 0.7rem; font-weight: 600; }

/* ── 캐릭터 사진첩(앨범) ── */
.album-wrap { max-width: 760px; margin: 0 auto; padding: 1.6rem 1.2rem 4rem; }
.album-head { text-align: center; margin-bottom: 1.4rem; }
.album-head h1 { font-size: 1.5rem; margin: 0 0 0.4rem; }
.album-count { color: var(--muted); font-weight: 600; margin: 0 0 0.6rem; }
.album-count b { color: var(--accent); font-size: 1.15em; }
.album-progress { height: 8px; background: var(--line); border-radius: 999px; overflow: hidden; max-width: 360px; margin: 0 auto; }
.album-progress-bar { height: 100%; width: 0; background: var(--accent); border-radius: 999px; transition: width 0.4s ease; }
.album-hint { color: var(--muted); font-size: 0.85rem; margin: 0.7rem 0 0; }
.album-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; }
.album-cell {
    position: relative; aspect-ratio: 3 / 4; border-radius: 12px; overflow: hidden;
    background: var(--card); border: 1.5px solid var(--line); cursor: pointer;
}
.album-cell img,
.album-cell video { width: 100%; height: 100%; object-fit: cover; display: block; }
.album-cell.locked { cursor: default; }
.album-cell.locked img,
.album-cell.locked video { filter: blur(8px) brightness(0.8); transform: scale(1.06); }
.album-lock {
    position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
    font-size: 1.8rem; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,0.5);
}
/* 영상 셀 재생(▶) 배지 — 클릭하면 확대 재생됨을 알림 */
.album-play {
    position: absolute; top: 0.45rem; right: 0.5rem; width: 1.7rem; height: 1.7rem;
    display: flex; align-items: center; justify-content: center; pointer-events: none;
    font-size: 0.8rem; color: #fff; background: rgba(0,0,0,0.5); border-radius: 50%;
}
.album-cap {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 0.35rem 0.5rem;
    font-size: 0.78rem; font-weight: 700; color: #fff; text-align: center;
    background: linear-gradient(to top, rgba(0,0,0,0.6), rgba(0,0,0,0));
}
/* 라이트박스 */
.album-lightbox {
    position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center;
    background: rgba(0,0,0,0.85); padding: 1.5rem;
}
.album-lightbox[hidden] { display: none; }  /* hidden 속성 존중(오버레이가 항상 떠 화면을 가리던 버그 수정) */
.album-lightbox img,
.album-lightbox video { max-width: 100%; max-height: 90vh; border-radius: 12px; }
.album-lightbox img[hidden],
.album-lightbox video[hidden] { display: none; }
.album-lightbox-close {
    position: absolute; top: 1rem; right: 1.2rem; font-size: 1.6rem; color: #fff;
    background: none; border: 0; cursor: pointer;
}
.cs-toggle-item {
    display: flex; align-items: center; justify-content: space-between;
    gap: 1rem; padding: 0.9rem 1rem; background: var(--card);
    border: 1px solid var(--line); border-radius: var(--radius); transition: border-color 0.15s;
}
.cs-toggle-item:has(input:checked) { border-color: var(--accent); background: #f0f9ff; }
.cs-toggle-label { display: flex; align-items: center; gap: 0.75rem; flex: 1; min-width: 0; }
.cs-toggle-icon { font-size: 1.4rem; flex-shrink: 0; }
.cs-toggle-name { font-weight: 700; font-size: 0.98rem; color: var(--ink); }
.cs-toggle-desc { font-size: 0.82rem; color: var(--muted); margin-top: 0.1rem; }

/* ── 채팅방 설정: 답변 길이 선택 ── */
.reply-options { display: flex; flex-direction: column; gap: 0.7rem; margin-top: 0.5rem; }
.reply-opt {
    display: flex; flex-direction: column; align-items: flex-start; gap: 0.2rem;
    width: 100%; padding: 1rem 1.1rem; border: 1.5px solid var(--line); border-radius: var(--radius);
    background: var(--card); cursor: pointer; text-align: left;
    transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.12s;
}
.reply-opt:hover { border-color: var(--accent); transform: translateY(-1px); }
.reply-opt.selected {
    border-color: var(--accent); background: var(--accent-soft);
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 15%, transparent);
}
.reply-opt:disabled { opacity: 0.6; cursor: progress; }
.reply-opt-title { font-weight: 800; font-size: 1rem; color: var(--ink); }
.reply-opt.selected .reply-opt-title { color: var(--accent); }
.reply-opt-desc { font-size: 0.84rem; color: var(--muted); }

/* 디자인 설정(/design) — 카테고리 제목 + 색감 테마 스와치 */
.design-cat { font-size: 0.95rem; font-weight: 800; color: var(--muted); margin: 1.5rem 0 0.1rem; }
.design-cat:first-of-type { margin-top: 0.6rem; }
.accent-options { flex-direction: row; }
.accent-options .reply-opt { align-items: center; text-align: center; flex: 1; gap: 0.35rem; padding: 1rem 0.6rem; }
.accent-swatch { width: 40px; height: 40px; border-radius: 50%; display: block; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }

/* ── 언어설정 탭 (나의 언어 / 배우고 싶은 언어) ── */
.lang-tabs {
    display: flex; gap: 0.4rem; margin: 0.6rem 0 1rem;
    border-bottom: 1.5px solid var(--line);
}
.lang-tab {
    flex: 1; padding: 0.7rem 0.5rem; border: 0; background: transparent;
    font-size: 0.95rem; font-weight: 700; color: var(--muted); cursor: pointer;
    border-bottom: 2.5px solid transparent; margin-bottom: -1.5px;
    transition: color 0.15s, border-color 0.15s;
}
.lang-tab:hover { color: var(--ink); }
.lang-tab.active { color: var(--accent); border-bottom-color: var(--accent); }

/* ── 공개 캐릭터 심사 안내/배지 ── */
.cc-vis-note { text-align: left; margin-top: 0.2rem; line-height: 1.5; }
.review-badge {
    display: inline-block; font-size: 0.72rem; font-weight: 800; padding: 0.05rem 0.4rem;
    border-radius: 8px; vertical-align: middle; margin-left: 0.2rem;
}
.review-badge.pending { background: #fff3d6; color: #9a6b00; }
.review-badge.rejected { background: #ffe1e1; color: #c92a2a; }
.review-badge.approved { background: #dff5e3; color: #1d7a3a; }
.review-badge.hidden { background: #e9ecef; color: #495057; }

/* 심사 페이지 상단 카테고리 탭(심사중·전체·숨김) */
.review-tabs { margin: 0 0 0.7rem; }

/* ── 관리자 크레딧 설정 페이지 ── */
.credit-setting {
    max-width: 880px; background: var(--card); border: 1px solid var(--line);
    border-radius: var(--radius-lg); padding: 1.3rem 1.4rem; box-shadow: var(--shadow-sm);
}
.credit-setting > label, .credit-col label { font-weight: 800; font-size: 0.95rem; display: block; margin-bottom: 0.6rem; }
/* 좌(비구독자)·우(구독자) 2열 */
.credit-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; }
.credit-col { border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem 1.1rem; background: var(--bg-soft); }
.credit-col-free { border-color: rgba(37,99,235,0.25); }
.credit-col-sub { border-color: rgba(217,119,6,0.3); background: linear-gradient(160deg, var(--card), #fffbeb); }
.credit-col-title { font-size: 1.02rem; font-weight: 800; margin: 0 0 0.9rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--line); }
.credit-col-sub .credit-col-title { color: #b45309; }
.credit-divider { border: none; border-top: 1px solid var(--line); margin: 1.4rem 0 1.1rem; }
@media (max-width: 720px) { .credit-cols { grid-template-columns: 1fr; } }
.credit-setting-row { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.credit-setting-row input {
    width: 120px; padding: 0.7rem 0.9rem; border: 1.5px solid #e2e8f0; border-radius: 6px;
    font-size: 1.05rem; font-weight: 700; outline: none; background: #fff; color: var(--ink);
}
.credit-setting-row input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.credit-unit { color: var(--muted); font-size: 0.9rem; }
.credit-setting-row .btn { margin-left: auto; padding: 0.65rem 1.3rem; }
.credit-hint { color: var(--muted); font-size: 0.84rem; line-height: 1.5; margin-top: 0.8rem; }

/* ── 관리자 알림 보내기 페이지 ── */
.notify-compose {
    display: flex; flex-direction: column; gap: 0.6rem; max-width: 720px;
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); margin-bottom: 1.4rem;
}
.notify-compose input, .notify-compose textarea {
    width: 100%; padding: 0.75rem 0.95rem; border: 1.5px solid #e2e8f0; border-radius: 6px;
    font-size: 0.97rem; font-family: inherit; outline: none; background: #fff; color: var(--ink);
}
.notify-compose input:focus, .notify-compose textarea:focus {
    border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}
.notify-compose-foot { display: flex; align-items: center; gap: 0.8rem; }
.notify-compose-foot .btn { background: #fff; border: 1.5px solid var(--line); color: var(--ink); padding: 0.6rem 1rem; font-weight: 700; }
.notify-compose-foot .btn:hover { border-color: var(--accent); color: var(--accent); }
.notify-status { font-size: 0.85rem; color: var(--muted); }
.notify-status.err { color: #c92a2a; }
.notify-users { display: flex; flex-direction: column; gap: 0.5rem; max-width: 720px; }
.notify-row {
    display: flex; align-items: center; gap: 0.9rem; padding: 0.75rem 1rem;
    background: var(--card); border: 1px solid var(--line); border-radius: 6px;
}
.notify-user { flex: 1; min-width: 0; }
.notify-uname { font-weight: 700; font-size: 0.95rem; }
.notify-uemail { color: var(--muted); font-size: 0.8rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.notify-result { font-size: 0.82rem; color: var(--muted); flex-shrink: 0; min-width: 0; }
.notify-send { padding: 0.5rem 1rem; font-weight: 700; font-size: 0.88rem; flex-shrink: 0; }
.notify-send:disabled { opacity: 0.45; cursor: not-allowed; }
.fcm-badge { font-size: 0.72rem; font-weight: 800; padding: 0.05rem 0.45rem; border-radius: 8px; margin-left: 0.3rem; white-space: nowrap; }
.fcm-badge.on { background: #e3f7e8; color: #1a7f37; }
.fcm-badge.off { background: #f0eef2; color: var(--muted); }

/* ── 관리자 캐릭터 심사 페이지 ── */
.review-list { display: flex; flex-direction: column; gap: 1rem; max-width: 720px; }
.review-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); transition: opacity 0.3s;
}
.review-card.done { opacity: 0.5; }
.review-head { display: flex; align-items: center; gap: 0.9rem; }
.review-av {
    width: 56px; height: 56px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
    background: #eff6ff; display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.review-name { font-weight: 800; font-size: 1.1rem; }
.review-job { color: var(--accent-2); font-weight: 600; font-size: 0.9rem; }
.review-owner { color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }
.review-reqtime { color: var(--muted); font-size: 0.8rem; margin-top: 0.15rem; }
.review-row { font-size: 0.9rem; margin-top: 0.6rem; line-height: 1.5; }
.review-row b { color: var(--muted); font-size: 0.78rem; margin-right: 0.3rem; }
.review-sys { white-space: pre-wrap; color: var(--ink); }
.review-actions { display: flex; gap: 0.5rem; margin-top: 0.9rem; }
.review-actions .btn { flex: 1; padding: 0.7rem; font-weight: 700; }
.review-actions .rv-reject { background: #fff; border: 1.5px solid var(--line); color: #c92a2a; }
.review-actions .rv-reject:hover { border-color: #c92a2a; }
.review-actions .btn:disabled { opacity: 0.6; cursor: progress; }
/* 숨김 — 심사(통과/거절)와 다른 축의 동작이라 회색 톤으로 구분 */
.review-actions .rv-hide { background: #fff; border: 1.5px solid var(--line); color: #495057; }
.review-actions .rv-hide:hover { border-color: #495057; }
.review-actions .rv-hide.btn-primary { background: #6b7280; border-color: #6b7280; color: #fff; }
/* 숨긴 캐릭터 카드 — 심사 대기 목록에 남지만 숨김 상태임을 한눈에 */
.review-card.hidden-char { border-color: #6b7280; background: rgba(107,114,128,.06); }
.review-msg { font-size: 0.84rem; color: var(--muted); margin-top: 0.5rem; min-height: 1em; }

/* ── 채팅(대화) 리스트 페이지 ── */
.chats-page { max-width: 640px; margin: 0 auto; padding: 1.4rem 1rem 3rem; }
.chats-page h1 { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.3rem; }
.chats-page .chats-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.2rem; }
.chats-list { display: flex; flex-direction: column; gap: 0.5rem; }
.chat-row {
    display: flex; align-items: center; gap: 0.9rem; padding: 0.8rem 0.9rem; border-radius: 6px;
    background: var(--card); border: 1px solid var(--line); color: var(--ink);
    transition: background 0.15s, box-shadow 0.15s, transform 0.12s; min-width: 0;
}
.chat-row:hover { background: var(--bg-soft); box-shadow: 0 6px 18px rgba(43,34,64,0.07); transform: translateY(-1px); }
.chat-av {
    width: 52px; height: 52px; border-radius: 50%; flex-shrink: 0; object-fit: cover;
    background: #eff6ff; display: flex; align-items: center; justify-content: center; font-size: 1.6rem;
}
.chat-body { display: flex; flex-direction: column; min-width: 0; flex: 1; gap: 0.15rem; }
.chat-top { display: flex; align-items: baseline; justify-content: space-between; gap: 0.6rem; }
.chat-name { font-weight: 700; font-size: 1rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-time { color: var(--muted); font-size: 0.74rem; flex-shrink: 0; }
.chat-last { color: var(--muted); font-size: 0.86rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-chev { color: var(--muted); font-size: 1.2rem; flex-shrink: 0; }
.chat-unread { display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0;
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: #e8453c; color: #fff;
    font-size: 0.72rem; font-weight: 800; line-height: 1; }
.chats-empty {
    text-align: center; color: var(--muted); padding: 3rem 1rem; line-height: 1.6;
}
.chats-empty a { color: var(--accent); font-weight: 700; }

/* ── 알림 페이지 ── */
.notif-page { max-width: 640px; margin: 0 auto; padding: 1.4rem 1rem 3rem; }
.notif-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.notif-page h1 { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.3rem; }
.notif-page .chats-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.2rem; }
.notif-readall {
    flex-shrink: 0; padding: 0.4rem 0.85rem; border-radius: 999px; font-size: 0.8rem; font-weight: 700;
    background: var(--card); border: 1.5px solid var(--line); color: var(--accent); cursor: pointer;
}
.notif-readall:hover { border-color: var(--accent); }
.notif-list { display: flex; flex-direction: column; gap: 0.5rem; }
.notif-row {
    display: flex; align-items: flex-start; gap: 0.7rem; padding: 0.85rem 0.9rem; border-radius: 8px;
    background: var(--card); border: 1px solid var(--line);
    color: inherit; text-decoration: none;  /* 링크 행(data.link)일 때도 본문색 유지 */
}
.notif-row.unread { background: var(--bg-soft); border-color: var(--accent-soft); }
.notif-dot {
    width: 8px; height: 8px; border-radius: 50%; margin-top: 0.45rem; flex-shrink: 0; background: transparent;
}
.notif-row.unread .notif-dot { background: var(--accent); }
.notif-body { min-width: 0; flex: 1; }
.notif-title { font-weight: 700; font-size: 0.98rem; color: var(--ink); }
.notif-text { color: var(--muted); font-size: 0.88rem; margin-top: 0.15rem; white-space: pre-wrap; word-break: break-word; }
.notif-time { color: var(--muted); font-size: 0.74rem; margin-top: 0.35rem; }

/* 사이드바 알림 뱃지 */
.sb-nav a .sb-badge {
    display: inline-flex; align-items: center; justify-content: center; width: auto; min-width: 18px; height: 18px;
    padding: 0 5px; margin-left: auto; border-radius: 999px; background: #e8453c; color: #fff;
    font-size: 0.7rem; font-weight: 800; line-height: 1;
}
/* display:inline-flex 가 UA 의 [hidden]{display:none} 을 이겨서, 0건일 때도 빨간 '0'이
   계속 떠 있던 문제(친구·채팅·알림 뱃지 전부). hidden 속성을 존중하게 명시한다. */
.sb-nav a .sb-badge[hidden] { display: none; }

/* ── 통화 페이지 ── */
.calls-page { max-width: 880px; margin: 0 auto; padding: 1.4rem 1rem 3rem; }
.calls-page h1 { font-size: 1.5rem; font-weight: 800; margin: 0 0 0.3rem; }
.calls-page .chats-sub { color: var(--muted); font-size: 0.9rem; margin: 0 0 1.4rem; }
.calls-section { margin-bottom: 2rem; }
.calls-heading { font-size: 1.05rem; font-weight: 800; margin: 0 0 0.8rem; color: var(--ink); }
.calls-heading-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 0.8rem; flex-wrap: wrap; margin-bottom: 0.8rem;
}
.calls-heading-row .calls-heading { margin: 0; }
.call-lang-tabs { display: flex; gap: 0.35rem; flex-wrap: wrap; }
.call-lang-tab {
    padding: 0.35rem 0.8rem; border: 1.5px solid var(--line); border-radius: 999px;
    background: transparent; color: var(--muted); font-size: 0.85rem; font-weight: 700;
    cursor: pointer; transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.call-lang-tab:hover { color: var(--ink); border-color: var(--accent); }
.call-lang-tab.is-active { color: #fff; background: var(--accent); border-color: var(--accent); }
.calls-page .chats-list { max-width: 640px; }
.call-btn {
    margin-left: auto; flex-shrink: 0; padding: 0.45rem 0.9rem; border-radius: 999px;
    background: var(--accent); color: #fff; font-size: 0.82rem; font-weight: 700;
    display: inline-flex; align-items: center; gap: 0.3rem; white-space: nowrap;
}
.chat-row:hover .call-btn { background: var(--accent-2, var(--accent)); }

.sb-toggle {
    display: none; position: fixed; top: 12px; left: 12px; z-index: 45;
    width: 42px; height: 42px; border-radius: 6px; border: 1px solid var(--line);
    background: var(--card); font-size: 1.3rem; cursor: pointer; box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}
.sb-overlay {
    display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.35); z-index: 39;
    opacity: 0; transition: opacity 0.2s;
}

/* 데스크톱: 본문을 사이드바만큼 밀기 */
@media (min-width: 861px) {
    body.has-sidebar { padding-left: 240px; }
}
/* 모바일: 드로어 */
@media (max-width: 860px) {
    .sidebar { transform: translateX(-100%); transition: transform 0.25s; box-shadow: 2px 0 20px rgba(0,0,0,0.12); }
    .sidebar.open { transform: translateX(0); }
    .sb-toggle { display: flex; align-items: center; justify-content: center; }
    .sb-overlay.show { display: block; opacity: 1; }
    body.has-sidebar .chars-wrap, body.has-sidebar .auth-wrap, body.has-sidebar .mychar-wrap { padding-top: 4rem; }
    /* 더보기: 헤더를 없애고 사이드바로 바꿨으니, 좌상단 햄버거가 h1 '더보기'를 덮지 않게 내린다 */
    body.has-sidebar .more-wrap { padding-top: 4rem; }
    /* 채팅방(1:1·단톡): 좌상단 햄버거(.sb-toggle)가 헤더 뒤로가기 버튼과 겹치지 않게 헤더를 우측으로 */
    body.has-sidebar[data-character-id] .nav { padding-left: 3.7rem; }
    body.group-room.has-sidebar .g-head { padding-left: 3.5rem; }
}

/* ── 캐릭터 만들기 ── */
.create-card { max-width: 480px; }
.auth-form textarea {
    padding: 0.8rem 1rem; border: 1.5px solid var(--line); border-radius: 6px;
    font-size: 1rem; outline: none; font-family: inherit; resize: vertical;
}
.auth-form textarea:focus { border-color: var(--accent); }
.cc-avatar-row { display: flex; gap: 1rem; align-items: center; }
.cc-avatar {
    position: relative; width: 84px; height: 84px; border-radius: 50%; flex-shrink: 0;
    background: #eff6ff; display: flex; align-items: center; justify-content: center;
    font-size: 2.4rem; cursor: pointer; overflow: hidden; border: 2px solid var(--line);
}
.cc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cc-avatar-edit {
    position: absolute; right: -2px; bottom: -2px; width: 28px; height: 28px; border-radius: 50%;
    background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center;
    font-size: 0.85rem; border: 2px solid #fff;
}
.cc-emoji-field { flex: 1; }

/* 커스텀 캐릭터 카드 */
.char-card { position: relative; }
.char-link { display: flex; flex-direction: column; height: 100%; color: inherit; }
.char-avatar {
    width: 64px; height: 64px; border-radius: 50%; margin: 0 auto; overflow: hidden;
    border: 2px solid var(--line);
}
.char-avatar img { width: 100%; height: 100%; object-fit: cover; }
/* 2인(pair) 캐릭터 카드 — 두 멤버 아바타를 살짝 겹쳐 표시 */
.char-avatar.pair-avatars {
    width: 92px; height: 64px; border: none; border-radius: 0; overflow: visible;
    position: relative; background: none;
}
.pair-avatars .pair-av {
    position: absolute; top: 2px; width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
    border: 2px solid var(--card); box-shadow: var(--shadow-sm); background: var(--bg-soft);
    display: flex; align-items: center; justify-content: center;
}
.pair-avatars .pair-av img { width: 100%; height: 100%; object-fit: cover; }
.pair-avatars .pair-av-ph { font-size: 1.6rem; }
.pair-avatars .pair-av-1 { left: 0; z-index: 1; }
.pair-avatars .pair-av-2 { right: 0; z-index: 2; }
.pair-badge {
    font-size: 0.68rem; background: rgba(124,58,237,.12); color: #7c3aed; font-weight: 800;
    padding: 0.1rem 0.4rem; border-radius: 6px; vertical-align: middle;
}
html[data-theme="dark"] .pair-badge { background: rgba(124,58,237,.25); color: #c4b5fd; }
.char-create { display: flex; flex-direction: column; justify-content: center; border-style: dashed; padding: 1.7rem 1.2rem; }
.mine-badge {
    font-size: 0.68rem; background: #eff6ff; color: var(--accent); font-weight: 700;
    padding: 0.1rem 0.4rem; border-radius: 6px; vertical-align: middle;
}
.char-del {
    position: absolute; top: 8px; right: 8px; width: 30px; height: 30px; border-radius: 8px;
    background: rgba(255,255,255,0.9); border: 1px solid var(--line); cursor: pointer; font-size: 0.9rem;
}
.char-del:hover { border-color: #e03131; background: #fff0f0; }

/* ── API 문서 상단바(사이드바와 함께) ── */
.api-topbar { display: flex; align-items: center; justify-content: flex-end; gap: 0.8rem; margin-bottom: 0.8rem; }
.api-swagger { color: var(--muted); font-weight: 600; }
.api-swagger:hover { color: var(--accent); }
@media (max-width: 860px) {
    body.has-sidebar .api-doc { padding-top: 3.8rem; }
}

/* ── 캐릭터 만들기: 만화 아바타 갤러리 ── */
.cc-avatar-top { display: flex; justify-content: center; margin-bottom: 0.5rem; }
.cc-avatar-big {
    width: 96px; height: 96px; border-radius: 50%; overflow: hidden;
    border: 3px solid var(--accent); background: var(--bg-soft);
}
.cc-avatar-big img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-gallery-field { display: flex; flex-direction: column; gap: 0.5rem; }
/* 랜덤 프로필 생성 — 좌(리셋)·우(직업 기반) 버튼 */
.cc-genprofile-btns { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cc-genprofile-btns .btn { flex: 1; min-width: 150px; white-space: nowrap; }
.cc-group-title { font-size: 0.85rem; font-weight: 600; color: var(--muted); margin: 0.3rem 0 0.3rem; }
.cc-gallery { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.cc-avatar-pick {
    width: 52px; height: 52px; border-radius: 50%; overflow: hidden; cursor: pointer;
    border: 2px solid var(--line); transition: transform 0.12s, border-color 0.12s;
}
.cc-avatar-pick img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-avatar-pick:hover { transform: scale(1.06); }
.cc-avatar-pick.selected { border-color: var(--accent); box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.20); }

/* ── 직접 이미지 업로드: 원형 아이콘 ── */
.cc-upload-circle {
    width: 52px; height: 52px; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    border: 2px dashed var(--accent-2); background: var(--bg-soft);
    color: var(--accent-2); transition: transform 0.12s, background 0.15s, border-color 0.15s;
    overflow: hidden;
}
.cc-upload-circle:hover { transform: scale(1.06); background: #eef3ff; border-color: var(--accent); color: var(--accent); }
.cc-upload-ico { font-size: 1.5rem; font-weight: 700; line-height: 1; }
.cc-upload-circle.has-img { border-style: solid; border-color: var(--accent); }
.cc-upload-circle.has-img .cc-upload-ico { display: none; }
.cc-upload-circle img { width: 100%; height: 100%; object-fit: cover; }
/* 큰 업로드 박스(관리자 캐릭터 생성) — 만화 갤러리 제거 후 직접 업로드를 크게 */
.cc-upload-circle.cc-upload-lg {
    width: 100%; max-width: 360px; height: 220px; border-radius: var(--radius-lg);
    flex-direction: column; gap: 0.5rem; margin: 0 auto;
}
.cc-upload-lg:hover { transform: none; }
.cc-upload-lg .cc-upload-ico { font-size: 2.6rem; }
.cc-upload-text { font-size: 0.92rem; font-weight: 600; }
.cc-upload-lg.has-img .cc-upload-text { display: none; }

/* ── 관리자 대시보드 ── */
.admin-tag { font-size: 0.65rem; background: var(--accent); color: #fff; padding: 0.1rem 0.4rem; border-radius: 6px; vertical-align: middle; font-weight: 700; }
.admin-main { max-width: 980px; margin: 0 auto; padding: 2rem 1.5rem 4rem; }
.admin-title { font-size: 1.8rem; margin-bottom: 0.3rem; }
.admin-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.5rem; }
.admin-h2 { font-size: 1.2rem; margin: 1.8rem 0 0.9rem; }
.admin-h2 .est { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.admin-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 1rem; }
.admin-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 1.3rem 1.4rem;
    box-shadow: 0 6px 18px rgba(43,34,64,0.04);
}
.admin-card.highlight { border-color: rgba(37,99,235,0.2); background: linear-gradient(160deg, #fff, #eff6ff); }
/* 이미지 생성 비용 카드 — 텍스트 사용요금과 구분(보라 톤) */
.admin-card.img-card.highlight { border-color: rgba(139,92,246,0.25); background: linear-gradient(160deg, #fff, #f5f3ff); }
.admin-card.img-card .ac-cost { color: #7c3aed; }
.admin-card.img-card .ac-usd { color: #8b5cf6; }
/* 음성통화 사용 요금 카드 — 텍스트/이미지와 구분(청록 톤) */
.admin-card.voice-card.highlight { border-color: rgba(13,148,136,0.25); background: linear-gradient(160deg, #fff, #f0fdfa); }
.admin-card.voice-card .ac-cost { color: #0d9488; }
.admin-card.voice-card .ac-usd { color: #14b8a6; }
/* Veo 영상 생성 비용 카드 — 앰버 톤(이미지·음성과 구분) */
.admin-card.vid-card.highlight { border-color: rgba(217,119,6,0.28); background: linear-gradient(160deg, #fff, #fffbeb); }
.admin-card.vid-card .ac-cost { color: #d97706; }
.admin-card.vid-card .ac-usd { color: #f59e0b; }
/* INWORLD 음성 비용 카드 — 로즈 톤(음성통화와 구분) */
.admin-card.inw-card.highlight { border-color: rgba(219,39,119,0.25); background: linear-gradient(160deg, #fff, #fdf2f8); }
.admin-card.inw-card .ac-cost { color: #db2777; }
.admin-card.inw-card .ac-usd { color: #ec4899; }
/* 실제 결제 매출 카드 — 매출 강조(초록 톤) + 원화 크게 */
.admin-card.pay-card.highlight { border-color: rgba(22,163,74,0.30); background: linear-gradient(160deg, #fff, #f0fdf4); }
.admin-card.pay-card .ac-cost { color: #15803d; font-size: 2.15rem; }
.admin-card.pay-card .ac-usd { color: #16a34a; }
.ac-label { color: var(--muted); font-size: 0.85rem; font-weight: 600; margin-bottom: 0.4rem; }
.ac-cost { font-size: 1.9rem; font-weight: 800; color: var(--accent); line-height: 1.1; }
.ac-usd { color: var(--accent-2); font-weight: 600; font-size: 0.95rem; margin-top: 0.2rem; }
.ac-meta { color: var(--muted); font-size: 0.8rem; margin-top: 0.6rem; }
.ac-num { font-size: 1.8rem; font-weight: 800; color: var(--ink); }

/* 서비스 통계 — 이번주/지난주/전체 표 */
.stats-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.stats-table { width: 100%; border-collapse: collapse; min-width: 360px; }
.stats-table thead th {
    text-align: right; font-size: 0.82rem; font-weight: 700; color: var(--muted);
    padding: 0.7rem 1rem; border-bottom: 1.5px solid var(--line); background: var(--bg-soft);
}
.stats-table thead th:first-child { text-align: left; }
.stats-table tbody th {
    text-align: left; font-weight: 600; color: var(--ink); font-size: 0.9rem;
    padding: 0.7rem 1rem; border-bottom: 1px solid var(--line);
}
.stats-table tbody td {
    text-align: right; font-size: 1rem; font-weight: 700; color: var(--ink);
    padding: 0.7rem 1rem; border-bottom: 1px solid var(--line); font-variant-numeric: tabular-nums;
}
.stats-table tbody tr:last-child th, .stats-table tbody tr:last-child td { border-bottom: none; }
.stats-table .st-total { color: var(--accent); font-weight: 800; }
.admin-note { margin-top: 1.6rem; color: var(--muted); font-size: 0.82rem; line-height: 1.6; background: var(--bg-soft); padding: 0.9rem 1.1rem; border-radius: 6px; border: 1px solid var(--line); }

/* ── 공식 캐릭터 배지 ── */
.official-badge {
    font-size: 0.68rem; background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #fff; font-weight: 700; padding: 0.1rem 0.45rem; border-radius: 6px; vertical-align: middle;
}
h1 .official-badge { font-size: 0.55em; }

/* ── AI 이미지 생성 섹션 (다듬은 디자인) ── */
.cc-aigen {
    background: linear-gradient(150deg, #f8fafc 0%, #f4f1ff 100%);
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    padding: 1.25rem 1.2rem 1.1rem;
    display: flex; flex-direction: column; gap: 0.85rem;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.06);
}
.cc-aigen > .gender-label {
    font-size: 1rem; font-weight: 800; color: var(--ink);
}

/* 세그먼트 토글 (실제인물 / 만화캐릭터) */
.cc-style-toggle {
    display: flex; gap: 0.3rem; background: #fff; padding: 0.3rem;
    border-radius: 6px; border: 1px solid var(--line);
    box-shadow: inset 0 1px 3px rgba(43,34,64,0.04);
}
.cc-style-btn {
    flex: 1; padding: 0.62rem 0.5rem; border: none; background: transparent;
    border-radius: 6px; font-weight: 700; font-size: 0.93rem; cursor: pointer;
    color: var(--muted); transition: color 0.18s, background 0.18s, box-shadow 0.18s, transform 0.12s;
}
.cc-style-btn:hover { color: var(--accent); }
.cc-style-btn.active {
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    color: #fff; box-shadow: 0 5px 14px rgba(37, 99, 235, 0.20);
}

/* AI 이미지 생성 외모 옵션 (성별·출생연도·국적) */
.cc-appearance {
    display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: flex-end;
}
.cc-ap-field { display: flex; flex-direction: column; gap: 0.2rem; flex: 1; min-width: 6rem; }
.cc-ap-field > span { font-size: 0.74rem; font-weight: 700; color: var(--muted); }
.cc-ap-field select, .cc-ap-field input {
    width: 100%; box-sizing: border-box; padding: 0.5rem 0.55rem;
    border: 1px solid var(--line); border-radius: 6px; background: #fff;
    color: var(--ink); font-size: 0.9rem; font-weight: 600;
}
.cc-ap-field select:focus, .cc-ap-field input:focus {
    outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* 입력창 */
.cc-aigen textarea {
    width: 100%; padding: 0.95rem 1.05rem; border: 1.5px solid #e2e8f0; border-radius: 6px;
    font-size: 1rem; font-family: inherit; line-height: 1.55; outline: none; resize: vertical;
    min-height: 96px; background: #fff; color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cc-aigen textarea::placeholder { color: #bcb2c6; }
.cc-aigen textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }

/* 생성 버튼 */
.cc-aigen-btn {
    width: 100%; padding: 0.9rem 1rem; border: none; border-radius: 6px; cursor: pointer;
    font-weight: 800; font-size: 1.02rem; color: #fff; letter-spacing: 0.01em;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.20);
    transition: transform 0.15s, box-shadow 0.15s, opacity 0.15s;
    display: flex; align-items: center; justify-content: center; gap: 0.45rem;
}
.cc-aigen-btn:hover { transform: translateY(-2px); box-shadow: 0 13px 28px rgba(37, 99, 235, 0.25); }
.cc-aigen-btn:active { transform: translateY(0); }
.cc-aigen-btn:disabled { opacity: 0.65; cursor: progress; transform: none; box-shadow: none; }
.cc-aigen-hint { color: var(--muted); font-size: 0.83rem; text-align: center; margin-top: -0.1rem; }

/* ── 캐릭터 디테일 이미지 (단일 입력 → 추가, 최대 5개 갤러리) ── */
.cc-detail-field {
    display: flex; flex-direction: column; gap: 0.7rem;
    background: linear-gradient(150deg, #f8fafc 0%, #f4f1ff 100%);
    border: 1px solid #e2e8f0; border-radius: 8px; padding: 1.25rem 1.2rem 1.1rem;
    box-shadow: 0 8px 24px rgba(37, 99, 235, 0.06);
}
.cc-detail-field .gender-label { font-size: 1rem; font-weight: 800; color: var(--ink); }
.cc-detail-field #detail-count { color: var(--muted); font-weight: 700; font-size: 0.88rem; }
.cc-detail-field code {
    background: #fff; color: var(--accent); padding: 0.05rem 0.32rem;
    border-radius: 6px; font-size: 0.85em;
}
.cc-detail-gallery {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 0.6rem;
}
.cc-detail-gallery:empty { display: none; }
.cc-detail-cell {
    position: relative; aspect-ratio: 1 / 1; border-radius: 6px; overflow: hidden;
    border: 1.5px solid #e2e8f0; background: #fff;
}
.cc-detail-cell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-detail-x {
    position: absolute; top: 4px; right: 4px; width: 24px; height: 24px; border: none;
    border-radius: 50%; background: rgba(43,34,64,0.62); color: #fff; cursor: pointer;
    font-size: 0.8rem; line-height: 1; display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.cc-detail-x:hover { background: var(--accent); }
.cc-detail-field textarea {
    width: 100%; padding: 0.8rem 0.95rem; border: 1.5px solid #e2e8f0; border-radius: 6px;
    font-size: 0.97rem; font-family: inherit; line-height: 1.5; outline: none; resize: vertical;
    min-height: 64px; background: #fff; color: var(--ink);
    transition: border-color 0.15s, box-shadow 0.15s;
}
.cc-detail-field textarea::placeholder { color: #bcb2c6; }
.cc-detail-field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.cc-detail-field textarea:disabled { background: #f6f2f8; cursor: not-allowed; }

/* ── 캐릭터 이미지 미리보기: 크게 + 작은(목록) 미리보기 ── */
.cc-avatar-top { align-items: center; gap: 1.4rem; }
.cc-avatar-big { width: 140px; height: 140px; }
.cc-avatar-mini-wrap { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; }
.cc-avatar-mini {
    width: 56px; height: 56px; border-radius: 50%; overflow: hidden;
    border: 2px solid var(--line); background: var(--bg-soft);
}
.cc-avatar-mini img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cc-avatar-mini-label { font-size: 0.72rem; color: var(--muted); font-weight: 600; }

/* ── 관리자 캐릭터/유저 리스트 ── */
.char-list, .user-list { display: flex; flex-direction: column; gap: 0.65rem; }
.char-row, .user-row {
    display: flex; align-items: center; gap: 1rem; background: var(--card);
    border: 1px solid var(--line); border-radius: 6px; padding: 0.8rem 1rem;
}
.user-row-link { cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; }
.user-row-link:hover { border-color: var(--accent); box-shadow: 0 6px 18px rgba(43,34,64,0.08); transform: translateY(-1px); }
.cl-avatar {
    width: 52px; height: 52px; border-radius: 50%; overflow: hidden; flex-shrink: 0;
    background: #eff6ff; display: flex; align-items: center; justify-content: center;
}
.cl-avatar img { width: 100%; height: 100%; object-fit: cover; }
.cl-emoji { font-size: 1.6rem; }
.cl-info { flex: 1; min-width: 0; }
.cl-name { font-weight: 800; }
.cl-job { color: var(--muted); font-size: 0.88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cl-badge { font-size: 0.68rem; padding: 0.1rem 0.45rem; border-radius: 6px; font-weight: 700; vertical-align: middle; }
.t-builtin { background: #e7eeff; color: #4d7cff; }
.t-official { background: linear-gradient(90deg, var(--accent), var(--accent-2)); color: #fff; }
.t-user { background: #e9f8ef; color: #1a8f4c; }
.cl-actions { display: flex; gap: 0.4rem; flex-shrink: 0; flex-wrap: wrap; align-items: center; justify-content: flex-end; max-width: 260px; }
.cl-btn { padding: 0.5rem 0.85rem; font-size: 0.85rem; }
.cl-genmood:disabled { opacity: 0.6; cursor: progress; }
.cl-genstatus { font-size: 0.78rem; color: var(--muted); width: 100%; text-align: right; }
.char-type-badge { font-size: 0.55em; background: #e7eeff; color: #4d7cff; padding: 0.15rem 0.5rem; border-radius: 8px; vertical-align: middle; }

/* 유저 리스트 */
.user-avatar {
    width: 44px; height: 44px; border-radius: 50%; background: #eff6ff; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center; font-size: 1.3rem;
}
.user-email { color: var(--muted); font-size: 0.85rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.user-meta { color: var(--muted); font-size: 0.78rem; flex-shrink: 0; text-align: right; white-space: nowrap; }
.um-when { color: var(--accent); font-weight: 700; }
.prov-badge { font-size: 0.66rem; padding: 0.08rem 0.4rem; border-radius: 5px; font-weight: 700; background: var(--bg-soft); border: 1px solid var(--line); color: var(--muted); }
/* 구독 배지/라인 (월·연 구독, 만료일) */
.sub-badge { font-size: 0.66rem; padding: 0.08rem 0.45rem; border-radius: 5px; font-weight: 800; margin-left: 0.3rem;
    background: #fff7e0; border: 1px solid #f0c84a; color: #a86b00; }
.sub-line { color: #a86b00 !important; font-weight: 600; }
.sub-line-off { color: var(--muted) !important; }
/* 신규 가입자 배지/행 강조 (최근 7일·실제 디바이스 로그인) */
.new-badge { font-size: 0.66rem; padding: 0.08rem 0.45rem; border-radius: 5px; font-weight: 800; margin-left: 0.3rem;
    background: #e5f8ec; border: 1px solid #37c26a; color: #12864a; }
.user-row.is-new { border-color: #37c26a; box-shadow: inset 3px 0 0 #37c26a; }
html[data-theme="dark"] .new-badge { background: rgba(55,194,106,0.16); border-color: #37c26a; color: #64e39a; }
/* PC 신규 — 집계엔 안 잡히는 신규라 초록 대신 회색으로 구분 */
.new-badge.pc-badge { background: var(--bg-soft); border-color: var(--line); color: var(--muted); }
html[data-theme="dark"] .new-badge.pc-badge { background: rgba(148,163,184,0.14); border-color: #475569; color: #cbd5e1; }
html[data-theme="dark"] .user-row.is-new { border-color: #2f9e58; box-shadow: inset 3px 0 0 #37c26a; }

/* ── 유저 리스트: 채팅횟수/사용금액 ── */
.user-stats { flex-shrink: 0; text-align: right; min-width: 90px; }
.us-chat { font-size: 0.85rem; color: var(--ink); font-weight: 600; }
.us-cost { font-size: 0.9rem; color: var(--accent); font-weight: 800; margin-top: 0.1rem; }
.us-est { font-size: 0.62rem; color: var(--muted); font-weight: 600; background: var(--bg-soft); padding: 0.05rem 0.3rem; border-radius: 5px; vertical-align: middle; }
.us-credit { font-size: 0.85rem; color: #1a8f4c; font-weight: 700; }
.us-used { font-size: 0.85rem; color: #d9480f; font-weight: 700; }
.um-access { color: #1a8f4c; font-weight: 700; }
.um-chat { color: #7048e8; font-weight: 700; }
/* 홈 리전 배지(유저 목록 우측) — 가입일 위에 한 줄 */
.um-region { font-weight: 700; color: var(--ink); margin-bottom: 4px; }
.um-region-pref { font-weight: 600; color: var(--muted); font-size: 0.72rem; }
.fcm-on { color: #1a73e8 !important; font-weight: 600; }
.fcm-off { color: var(--muted) !important; }

/* 유저 목록 탭 (최근 접속 / 전체) */
.user-tabs { display: flex; gap: 0.5rem; margin: 0 0 0.9rem; flex-wrap: wrap; }
.utab {
    padding: 0.45rem 1rem; border: 1.5px solid var(--line); border-radius: 999px;
    background: var(--card); color: var(--muted); font-size: 0.88rem; font-weight: 700; cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.utab:hover { border-color: var(--accent-soft); color: var(--ink); }
.utab.is-active { background: var(--accent); border-color: var(--accent); color: #fff; }
/* 유저 목록 삭제 버튼 — char-del 의 절대배치를 풀어 행의 일반 플렉스 자식으로 */
.user-del { position: static; top: auto; right: auto; flex-shrink: 0; width: 34px; height: 34px; }
.user-del:hover { color: #e03131; }
@media (max-width: 520px) { .user-meta { display: none; } }

/* ── 음성통화 기록 모니터링 ── */
.vl-head { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.vl-head .admin-title { margin: 0; }
.vl-auto { margin-left: auto; font-size: 0.88rem; color: var(--muted); display: flex; align-items: center; gap: 0.35rem; cursor: pointer; }
.vl-refresh { padding: 0.45rem 0.9rem; font-size: 0.88rem; }
.vl-errors { display: flex; flex-direction: column; gap: 0.3rem; max-height: 240px; overflow-y: auto; }
.vl-err-line {
    background: #2b1416; color: #ffb3b3; border-radius: 8px; padding: 0.5rem 0.8rem;
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 0.8rem; line-height: 1.45; word-break: break-all;
}
.vl-empty { color: var(--muted); padding: 0.8rem; background: var(--bg-soft); border-radius: 10px; font-size: 0.9rem; }
.vl-sessions { display: flex; flex-direction: column; gap: 0.6rem; }
.vl-sess { background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 0.85rem 1rem; }
.vl-sess-top { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; }
.vl-status { font-size: 0.7rem; font-weight: 800; padding: 0.12rem 0.5rem; border-radius: 6px; }
.st-ok { background: #e9f8ef; color: #1a8f4c; }
.st-warn { background: #fff7e6; color: #b07a00; }
.st-err { background: #ffe3e3; color: #e03131; }
.vl-char { font-weight: 800; }
.vl-time { color: var(--muted); font-size: 0.82rem; margin-left: auto; }
.vl-sess-meta { display: flex; gap: 0.8rem; flex-wrap: wrap; color: var(--muted); font-size: 0.8rem; margin-top: 0.3rem; }
.vl-sid { font-family: ui-monospace, monospace; }
.vl-usage { display: flex; gap: 0.9rem; flex-wrap: wrap; font-size: 0.82rem; margin-top: 0.4rem;
    padding-top: 0.4rem; border-top: 1px dashed var(--line); color: var(--ink); }
.vl-usage small { color: var(--muted); }
.vl-summary { margin-top: 0.45rem; font-size: 0.83rem; color: var(--ink); background: var(--bg-soft); border-radius: 8px; padding: 0.4rem 0.7rem; }
.vl-ongoing { color: #b07a00; }

/* ── API 문서 마지막 업데이트 표시 ── */
.doc-updated {
    margin-right: auto; color: var(--muted); font-size: 0.82rem; font-weight: 600;
    background: var(--bg-soft); border: 1px solid var(--line); padding: 0.3rem 0.7rem; border-radius: 8px;
}
@media (max-width: 520px) { .doc-updated { font-size: 0.72rem; } }

/* ── 정책 문서 페이지 (CSAE / 개인정보) ── */
.policy-wrap { max-width: 760px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }
.policy-wrap h1 { font-size: 1.9rem; margin-bottom: 0.4rem; }
.policy-updated { color: var(--muted); font-size: 0.85rem; margin-bottom: 1.8rem; }
.policy-wrap h2 { font-size: 1.2rem; margin: 1.8rem 0 0.6rem; padding-bottom: 0.3rem; border-bottom: 2px solid var(--line); }
.policy-wrap h3 { font-size: 1.02rem; margin: 1.1rem 0 0.4rem; }
.policy-wrap p { margin: 0.5rem 0; color: var(--ink); }
.policy-wrap ul { margin: 0.5rem 0 0.8rem 1.3rem; }
.policy-wrap li { margin: 0.3rem 0; }
.policy-wrap a { color: var(--accent); font-weight: 600; }
.policy-wrap .lead { font-size: 1.05rem; color: var(--muted); margin-bottom: 1.2rem; }
.policy-callout {
    background: #eff6ff; border: 1px solid #f3d6e0; border-left: 4px solid var(--accent);
    border-radius: 0 12px 12px 0; padding: 1rem 1.2rem; margin: 1.2rem 0;
}
.policy-callout strong { color: var(--accent); }
.policy-table { width: 100%; border-collapse: collapse; margin: 0.8rem 0; font-size: 0.92rem; }
.policy-table th, .policy-table td { border: 1px solid var(--line); padding: 0.6rem 0.8rem; text-align: left; vertical-align: top; }
.policy-table th { background: var(--bg-soft); font-weight: 700; }
.policy-foot { margin-top: 2rem; padding-top: 1rem; border-top: 1px solid var(--line); color: var(--muted); font-size: 0.85rem; }

/* 정책 페이지(개인정보 등) 모바일 — 테이블을 카드형으로 스택 */
@media (max-width: 600px) {
    .policy-wrap { padding: 1.6rem 1.05rem 3rem; }
    .policy-wrap h1 { font-size: 1.5rem; }
    .policy-wrap h2 { font-size: 1.08rem; }
    .policy-wrap .lead { font-size: 0.96rem; }
    .policy-table { font-size: 0.9rem; margin: 0.7rem 0; }
    /* 표 행을 카드로: 첫 칸(구분/수탁자)은 굵은 헤더, 나머지는 아래로 쌓임 */
    .policy-table, .policy-table tbody, .policy-table tr, .policy-table td { display: block; width: 100%; }
    .policy-table tr:first-child { display: none; } /* 열 제목(th) 행 숨김 */
    .policy-table tr { border: 1px solid var(--line); border-radius: 10px; margin-bottom: 0.7rem; overflow: hidden; background: var(--card); }
    .policy-table td { border: none; border-top: 1px solid var(--line); padding: 0.6rem 0.85rem; text-align: left; word-break: break-word; }
    .policy-table td:first-child { border-top: none; background: var(--bg-soft); font-weight: 700; }
}

/* ── 고객센터 (FAQ + 문의) ── */
.faq { display: flex; flex-direction: column; gap: 0.55rem; }
.faq-item {
    background: var(--card); border: 1px solid var(--line); border-radius: 6px; padding: 0 0.2rem;
}
.faq-item summary {
    cursor: pointer; padding: 0.9rem 1rem; font-weight: 700; list-style: none;
    display: flex; justify-content: space-between; align-items: center; gap: 0.5rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: "＋"; color: var(--accent); font-size: 1.2rem; flex-shrink: 0; }
.faq-item[open] summary::after { content: "－"; }
.faq-item p { padding: 0 1rem 1rem; color: var(--muted); margin: 0; }
.faq-item p a { color: var(--accent); }
.support-form select {
    padding: 0.8rem 1rem; border: 1.5px solid var(--line); border-radius: 6px;
    font-size: 1rem; outline: none; background: #fff; font-family: inherit;
}
.support-form select:focus { border-color: var(--accent); }
.support-form textarea {
    padding: 0.8rem 1rem; border: 1.5px solid var(--line); border-radius: 6px;
    font-size: 1rem; outline: none; font-family: inherit; resize: vertical;
}
.support-form textarea:focus { border-color: var(--accent); }
.support-form .btn { width: 100%; margin-top: 0.3rem; }

/* ── 포인트 충전(credits) 페이지 ── */
.credits-wrap { width: 100%; max-width: 560px; display: flex; flex-direction: column; gap: 1.25rem; }
.credit-balance-card {
    background: linear-gradient(110deg, var(--accent), var(--accent-2));
    color: #fff; border-radius: 8px; padding: 1.75rem 2rem;
    box-shadow: 0 12px 30px rgba(37, 99, 235, 0.20);
}
.credit-balance-label { font-weight: 700; font-size: 0.95rem; opacity: 0.92; }
.credit-balance-label em { font-style: normal; opacity: 0.7; font-size: 0.85rem; }
.credit-balance { font-size: 2.4rem; font-weight: 800; line-height: 1.2; margin-top: 0.25rem; }
.credit-balance strong { font-weight: 800; }
.credit-card {
    background: var(--card); border: 1px solid var(--line); border-radius: 8px;
    box-shadow: 0 10px 30px rgba(43, 34, 64, 0.06); padding: 1.75rem;
}
.credit-card h2 { font-size: 1.25rem; margin-bottom: 0.3rem; }
.credit-card h2 em { font-style: normal; color: var(--muted); font-size: 0.85rem; font-weight: 600; }
.credit-amounts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0.6rem; margin: 0.5rem 0 1rem; }
/* 금액 버튼 — 예전엔 background:#fff 로 고정돼 있어서 다크 모드에서 '흰 배경 + 흰 글자'가
   되어 금액이 아예 안 보였다(글자색은 var(--ink) = 다크에선 밝은색). 선택 상태의 #eff6ff
   도 라이트 전용이었다. 둘 다 테마 변수로 바꿔 다크/라이트 모두 읽히게 한다. */
.credit-amount {
    padding: 0.8rem 0.4rem; border: 1.5px solid var(--line); border-radius: 6px;
    background: var(--bg-soft); color: var(--ink); font-weight: 700; font-size: 0.95rem; cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.credit-amount:hover { border-color: var(--accent); color: var(--accent); }
.credit-amount.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.credit-custom { display: flex; flex-direction: column; gap: 0.35rem; font-weight: 600; font-size: 0.92rem; margin-bottom: 1rem; }
.credit-custom input {
    padding: 0.8rem 1rem; border: 1.5px solid var(--line); border-radius: 6px; font-size: 1rem; outline: none;
}
.credit-custom input:focus { border-color: var(--accent); }
.credit-card .btn { width: 100%; }
.credit-history { list-style: none; margin: 0.5rem 0 0; padding: 0; display: flex; flex-direction: column; }
.credit-empty { color: var(--muted); text-align: center; padding: 1.5rem 0; }
.credit-row {
    display: flex; justify-content: space-between; align-items: center; gap: 0.75rem;
    padding: 0.85rem 0; border-top: 1px solid var(--line);
}
.credit-row:first-child { border-top: none; }
.credit-row-main { display: flex; align-items: center; gap: 0.6rem; min-width: 0; }
.credit-tag {
    flex-shrink: 0; font-size: 0.78rem; font-weight: 700; padding: 0.2rem 0.6rem; border-radius: 8px;
}
.credit-row.is-charge .credit-tag { background: #e3f4ea; color: #1a8f4c; }
.credit-row.is-use .credit-tag { background: #eff6ff; color: var(--accent); }
.credit-memo { color: var(--ink); font-size: 0.92rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.credit-row-side { text-align: right; flex-shrink: 0; }
.credit-delta { display: block; font-weight: 800; }
.credit-row.is-charge .credit-delta { color: #1a8f4c; }
.credit-row.is-use .credit-delta { color: var(--accent); }
.credit-when { display: block; color: var(--muted); font-size: 0.78rem; }
@media (max-width: 480px) {
    .credit-amounts { grid-template-columns: repeat(2, 1fr); }
}

/* ── 구독자 리스트 ─────────────────────────────────────────────────────── */
.sub-filter-bar { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
/* 금액 버튼(.credit-amount)과 똑같이 #fff·#eff6ff 가 박혀 있어 다크에서 흐릿했다 — 같이 고침 */
.sub-filter {
    padding: 0.4rem 1rem; border: 1.5px solid var(--line); border-radius: 8px;
    background: var(--bg-soft); color: var(--muted); font-size: 0.85rem; font-weight: 600; cursor: pointer;
    transition: border-color 0.15s, color 0.15s, background 0.15s;
}
.sub-filter:hover { border-color: var(--accent); color: var(--accent); }
.sub-filter.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.sub-status-badge {
    display: inline-block; font-size: 0.78rem; font-weight: 700;
    padding: 0.2rem 0.65rem; border-radius: 8px;
}
.status-active { background: #e3f4ea; color: #1a8f4c; }
.status-cancelled { background: #fff3cd; color: #856404; }
.status-expired { background: #f5f5f5; color: #888; }
.status-grace { background: #fff0e3; color: #c07000; }
.status-paused { background: #e3eaf4; color: #3456a8; }
.sub-expires { font-size: 0.82rem; color: var(--muted); }

/* ═══════════════════════════════════════════════════════════════════════
   관리자 페이지 전용 디자인 재정의 — body.has-sidebar 스코프
   사용자 페이지(랜딩·채팅)에는 영향 없음
   ═══════════════════════════════════════════════════════════════════════ */
body.has-sidebar {
    --accent: #cc785c;
    --accent-soft: #fbf1ec;
    --accent-2: #a3604a;
    --bg: #f8fafc;
    --bg-soft: #f1f5f9;
    --line: #e2e8f0;
    --radius: 4px;
    --radius-lg: 6px;
    --shadow-glow: 0 4px 12px rgba(204, 120, 92, 0.18);
    --grad: linear-gradient(90deg, #dea795 0%, #cc785c 100%);
    background: #f8fafc;
}

/* 사이드바 */
body.has-sidebar .sidebar {
    background: #ffffff;
    border-right: 1px solid #e2e8f0;
    backdrop-filter: none;
}
body.has-sidebar .sb-brand a {
    background: none;
    -webkit-background-clip: unset;
    background-clip: unset;
    -webkit-text-fill-color: unset;
    color: #1e293b;
    font-weight: 800;
}
body.has-sidebar .sb-user {
    background: #eff6ff;
    border: 1px solid #dbeafe;
    border-radius: 4px;
}
body.has-sidebar .sb-nav a {
    border-radius: 4px;
    font-weight: 600;
    color: #374151;
}
body.has-sidebar .sb-nav a:hover {
    background: #eff6ff;
    color: #2563eb;
}
body.has-sidebar .sb-nav a.active {
    background: #eff6ff;
    color: #2563eb;
    box-shadow: inset 3px 0 0 #2563eb;
}
body.has-sidebar .sb-bottom button:hover {
    background: #f1f5f9;
}

/* 버튼 */
body.has-sidebar .btn-primary {
    background: #2563eb;
    box-shadow: none;
    border-radius: 4px;
}
body.has-sidebar .btn-primary:hover {
    background: #1d4ed8;
    box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
    transform: none;
    filter: none;
}
/* 로그인·회원가입 카드는 브랜드색(주황 그라데이션)을 유지한다.
   위 파란 버튼은 관리자 화면용인데, 두 페이지에 사이드바를 넣으면서 같이 딸려왔었다. */
body.has-sidebar .auth-card .btn-primary,
body.has-sidebar .credit-card .btn-primary { background: var(--grad); box-shadow: var(--shadow-glow); }
body.has-sidebar .auth-card .btn-primary:hover,
body.has-sidebar .credit-card .btn-primary:hover {
    background: var(--grad); box-shadow: 0 16px 34px rgba(204, 120, 92, 0.30); filter: brightness(1.05) saturate(1.05);
}
body.has-sidebar .btn-ghost {
    border-radius: 4px;
}
body.has-sidebar .btn-ghost:hover {
    border-color: #2563eb;
    color: #2563eb;
    transform: none;
    box-shadow: none;
}

/* 랜딩(/) — 위 파란색은 관리자 화면용이다. 랜딩은 브랜드 주황(--grad)으로 되돌려
   히어로 번짐·뱃지·아이콘과 색감을 맞춘다. body class="has-sidebar landing" */
body.landing .btn-primary {
    background: var(--grad);
    box-shadow: var(--shadow-glow);
    border-radius: var(--radius);
}
body.landing .btn-primary:hover {
    background: var(--grad);
    box-shadow: 0 12px 28px rgba(204, 120, 92, 0.28);
    transform: translateY(-2px);
    filter: brightness(1.04);
}
body.landing .btn-ghost:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* 어드민 카드 */
body.has-sidebar .admin-card {
    border-radius: 6px;
    border: 1px solid #e2e8f0;
    box-shadow: none;
}
body.has-sidebar .admin-card.highlight {
    border-color: #bfdbfe;
    background: #eff6ff;
}
body.has-sidebar .admin-note {
    border-radius: 4px;
}

/* 어드민 태그/배지 */
body.has-sidebar .admin-tag {
    background: #2563eb;
    border-radius: 4px;
}
body.has-sidebar .official-badge {
    background: #2563eb;
}

/* 캐릭터/유저 리스트 행 */
body.has-sidebar .char-row,
body.has-sidebar .user-row {
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}
body.has-sidebar .cl-avatar {
    background: #eff6ff;
    border-radius: 4px;
}
body.has-sidebar .user-avatar {
    background: #eff6ff;
    border-radius: 4px;
}

/* 입력 필드 */
body.has-sidebar input,
body.has-sidebar textarea,
body.has-sidebar select {
    border-radius: 4px !important;
}
body.has-sidebar input:focus,
body.has-sidebar textarea:focus {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12) !important;
}
/* 로그인·회원가입 입력칸은 브랜드색 포커스로 — 위 파란색은 관리자 화면용이다. */
body.has-sidebar .auth-card input:focus,
body.has-sidebar .auth-card textarea:focus,
body.has-sidebar .auth-card select:focus {
    border-color: var(--accent) !important;
    box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 18%, transparent) !important;
}

/* 구독자 필터 */
body.has-sidebar .sub-filter {
    border-radius: 4px;
}
body.has-sidebar .sub-filter:hover {
    border-color: #2563eb;
    color: #2563eb;
}
body.has-sidebar .sub-filter.active {
    border-color: #2563eb;
    background: #eff6ff;
    color: #2563eb;
}

/* 크레딧 설정 */
body.has-sidebar .credit-setting {
    border-radius: 6px;
}

/* 음성로그 */
body.has-sidebar .vl-sess {
    border-radius: 4px;
    border: 1px solid #e2e8f0;
}

/* 언어 테이블 */
.lang-table-wrap {
    margin-top: 1rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    overflow: hidden;
}
.lang-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}
.lang-table th {
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    padding: 0.65rem 0.9rem;
    text-align: left;
    font-weight: 700;
    color: #374151;
    font-size: 0.83rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}
.lang-table td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}
.lang-table tr:last-child td {
    border-bottom: none;
}
.lang-table tr:hover td {
    background: #f8fafc;
}

/* ============================================================
   다크 모드 (디자인 설정)
   <html data-theme="dark"> 일 때 핵심 색상 변수를 재정의하고,
   하드코딩된 밝은 표면만 별도로 보정한다. 기본값은 다크 모드.
   ============================================================ */
html[data-theme="dark"] {
    --bg: #0e1116;
    --bg-soft: #161b22;
    --card: #1a212b;
    --accent: #dea795;
    --accent-2: #cc785c;
    --accent-soft: #3a241c;
    --ink: #e6edf3;
    --muted: #9aa4b2;
    --line: #2b323d;
    --grad: linear-gradient(90deg, #dea795 0%, #cc785c 100%);
    --shadow-sm: 0 2px 12px rgba(0, 0, 0, 0.45);
    --shadow-md: 0 12px 32px rgba(0, 0, 0, 0.55);
    --shadow-glow: 0 4px 16px rgba(222, 167, 149, 0.25);
    color-scheme: dark;
}

/* ============================================================
   색감 테마 (디자인 설정 /design)
   강조색은 브랜드 주황(#CC785C) 하나뿐이다 — 파란색·보라색 테마는 삭제했다.
   `data-accent` 값은 무엇이 오든(옛 쿠키의 blue·purple 포함) 이 값으로 흡수한다.
   화면 모드(light/dark)와 독립이며, 다크는 배경이 어두워 더 밝은 톤을 쓴다.
   ============================================================ */
/* — 라이트 모드 — */
html[data-accent] {
    --accent: #cc785c; --accent-2: #a3604a; --accent-soft: #fbf1ec;
    --grad: linear-gradient(90deg, #dea795 0%, #cc785c 100%);
    --shadow-glow: 0 4px 16px rgba(204, 120, 92, 0.22);
}
/* — 다크 모드 (배경이 어두워 더 밝은 톤) — */
html[data-theme="dark"][data-accent] {
    --accent: #dea795; --accent-2: #cc785c; --accent-soft: #3a241c;
    --grad: linear-gradient(90deg, #dea795 0%, #cc785c 100%);
    --shadow-glow: 0 4px 16px rgba(222, 167, 149, 0.25);
}

/* 입력 요소 — 하드코딩된 흰 배경을 카드색으로 보정 */
html[data-theme="dark"] input,
html[data-theme="dark"] textarea,
html[data-theme="dark"] select,
html[data-theme="dark"] .pretty-select {
    background: var(--card) !important;
    color: var(--ink);
}
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: var(--muted); }

/* 사이드바 / 더보기 / 메시지 등 하드코딩 표면 보정 */
html[data-theme="dark"] .sidebar { background: rgba(16, 20, 27, 0.92); }
html[data-theme="dark"] .sb-user { background: linear-gradient(150deg, #18263d, #1a212b); }
html[data-theme="dark"] .sb-avatar { background: var(--card); }
html[data-theme="dark"] .more-avatar { background: var(--accent-soft); }
html[data-theme="dark"] .msg.bot { background: #232b38; color: var(--ink); }
html[data-theme="dark"] .btn-ghost { background: var(--card); }
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .room-top { background: rgba(16, 20, 27, 0.9); }
/* 랜딩 카드 아이콘 — 다크에선 '투명 화이트'(색 없이 반투명 흰 선). 컬러 이모지 대체분. */
html[data-theme="dark"] .card .icon {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.13);
    color: rgba(255, 255, 255, 0.9);
}
html[data-theme="dark"] .card:hover .icon {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.2);
    color: #fff;
}
/* 히어로 뱃지 — 다크에서 흰 알약처럼 뜨던 배경을 브랜드톤 반투명으로 */
html[data-theme="dark"] .badge {
    background: rgba(222, 167, 149, 0.10);
    border-color: rgba(222, 167, 149, 0.26);
    box-shadow: none;
}
/* 앱 설치 팝업 아이콘도 선 아이콘으로 바뀌었다 */
html[data-theme="dark"] .app-install-icon { color: rgba(255, 255, 255, 0.9); }
html[data-theme="dark"] .cs-toggle-item:has(input:checked) { background: var(--accent-soft); }
html[data-theme="dark"] .char-del { background: var(--card); }
html[data-theme="dark"] .char-del:hover { background: #3a1f1f; }
html[data-theme="dark"] .reply-opt.selected { background: var(--accent-soft); }

/* 카드/박스 류 — 변수를 쓰지 않는 옅은 배경 그라데이션 보정 */
html[data-theme="dark"] .feature,
html[data-theme="dark"] .demo-card { background: linear-gradient(150deg, #18263d, #161b22); }

/* ── has-sidebar 페이지 보정 ──
   body.has-sidebar 블록이 사이드바 페이지(언어/디자인/프로필 등)의 변수를
   밝은 값으로 재정의하므로, 다크일 때 같은 위치(body)에서 다시 덮어쓴다.
   data-theme 속성이 없는 관리자 페이지는 영향받지 않는다. */
html[data-theme="dark"] body.has-sidebar {
    --bg: #0e1116;
    --bg-soft: #161b22;
    --accent: #dea795;
    --accent-2: #cc785c;
    --accent-soft: #3a241c;
    --line: #2b323d;
    --grad: linear-gradient(90deg, #dea795 0%, #cc785c 100%);
    --shadow-glow: 0 4px 16px rgba(222, 167, 149, 0.25);
    background: #0e1116;
}
html[data-theme="dark"] body.has-sidebar .sidebar { background: #12161d; border-right-color: var(--line); }
html[data-theme="dark"] body.has-sidebar .sb-brand a { color: var(--ink); }
html[data-theme="dark"] body.has-sidebar .sb-user { background: var(--accent-soft); border-color: var(--line); }
html[data-theme="dark"] body.has-sidebar .sb-nav a { color: var(--muted); }
html[data-theme="dark"] body.has-sidebar .sb-nav a:hover,
html[data-theme="dark"] body.has-sidebar .sb-nav a.active { background: var(--accent-soft); color: var(--accent); }
html[data-theme="dark"] body.has-sidebar .sb-nav a.active { box-shadow: inset 3px 0 0 var(--accent); }
html[data-theme="dark"] body.has-sidebar .sb-bottom button:hover { background: var(--bg-soft); }
html[data-theme="dark"] body.has-sidebar .admin-card.highlight { border-color: var(--accent); background: var(--accent-soft); }
html[data-theme="dark"] body.has-sidebar .char-row,
html[data-theme="dark"] body.has-sidebar .user-row,
html[data-theme="dark"] body.has-sidebar .vl-sess { border-color: var(--line); }
html[data-theme="dark"] body.has-sidebar .cl-avatar,
html[data-theme="dark"] body.has-sidebar .user-avatar { background: var(--accent-soft); }
html[data-theme="dark"] body.has-sidebar .sub-filter.active { background: var(--accent-soft); color: var(--accent); }

/* ── 관리자 FCM 등록 테스트 페이지 ── */
.fcm-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius-lg);
    padding: 1.1rem 1.2rem; box-shadow: var(--shadow-sm); margin-bottom: 1.2rem; max-width: 860px;
}
.fcm-h2 { font-size: 1rem; font-weight: 800; margin: 0 0 0.7rem; color: var(--ink); }
.fcm-status-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 0.6rem; }
.fcm-stat { display: flex; flex-direction: column; gap: 0.15rem; background: #f8fafc; border: 1px solid var(--line); border-radius: 8px; padding: 0.6rem 0.8rem; }
.fcm-stat-k { font-size: 0.72rem; color: var(--muted); font-weight: 700; }
.fcm-stat-v { font-size: 0.9rem; font-weight: 700; color: var(--ink); word-break: break-all; }
.fcm-label { display: block; font-size: 0.8rem; font-weight: 700; color: var(--muted); margin-bottom: 0.35rem; }
.fcm-form textarea, .fcm-input {
    width: 100%; padding: 0.7rem 0.9rem; border: 1.5px solid #e2e8f0; border-radius: 6px;
    font-size: 0.95rem; font-family: inherit; outline: none; background: #fff; color: var(--ink);
}
.fcm-form textarea { resize: vertical; word-break: break-all; }
.fcm-form textarea:focus, .fcm-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12); }
.fcm-row { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; margin-top: 0.6rem; }
.fcm-row .fcm-input { flex: 1; min-width: 150px; width: auto; }
.fcm-check { display: flex; align-items: center; gap: 0.35rem; font-size: 0.85rem; color: var(--muted); white-space: nowrap; }
.fcm-actions { display: flex; align-items: center; gap: 0.7rem; margin-top: 0.9rem; flex-wrap: wrap; }
.fcm-actions .btn { padding: 0.6rem 1.1rem; font-weight: 700; }
.btn-sm { padding: 0.35rem 0.8rem !important; font-size: 0.82rem; font-weight: 700; }
.fcm-step { border-left: 3px solid var(--line); padding: 0.45rem 0.7rem; margin-bottom: 0.5rem; background: #f8fafc; border-radius: 0 6px 6px 0; }
.fcm-step-head { font-size: 0.9rem; }
.fcm-step-detail { font-size: 0.82rem; color: var(--muted); margin-top: 0.2rem; word-break: break-all; }
.fcm-step-ok { border-left-color: #1a7f37; }
.fcm-step-fail { border-left-color: #c92a2a; }
.fcm-step-warn { border-left-color: #d9822b; }
.fcm-step-skip { border-left-color: #94a3b8; }
.fcm-badge-ok, .fcm-badge-fail, .fcm-badge-warn, .fcm-badge-skip { font-size: 0.72rem; font-weight: 800; padding: 0.05rem 0.4rem; border-radius: 6px; }
.fcm-badge-ok { background: #e3f7e8; color: #1a7f37; }
.fcm-badge-fail { background: #fde8e8; color: #c92a2a; }
.fcm-badge-warn { background: #fdf0e1; color: #b4600f; }
.fcm-badge-skip { background: #eef1f5; color: #64748b; }
.fcm-logs-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.6rem; }
.fcm-logs-head .fcm-h2 { margin: 0; }
.fcm-logrow { display: flex; flex-wrap: wrap; align-items: center; gap: 0.5rem; padding: 0.4rem 0.6rem; border-bottom: 1px solid #eef1f5; font-size: 0.82rem; border-left: 3px solid var(--line); }
.fcm-logtime { color: var(--muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.fcm-logevent { font-weight: 700; color: var(--ink); }
.fcm-logdetail { color: var(--muted); flex: 1; min-width: 120px; word-break: break-all; }
.fcm-logtoken { font-family: monospace; font-size: 0.75rem; background: #f0eef2; padding: 0.05rem 0.35rem; border-radius: 4px; color: #64748b; }
.fcm-logactor { font-size: 0.72rem; color: #94a3b8; }
.fcm-empty { color: var(--muted); font-size: 0.88rem; padding: 0.5rem 0; }

/* ───────── 관리자 고객센터(문의·신고) ───────── */
.support-list { display: flex; flex-direction: column; gap: 0.85rem; margin-top: 1rem; }
.support-card {
    border: 1px solid var(--line); border-radius: var(--radius-lg);
    background: var(--bg); padding: 0.9rem 1.05rem;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.support-card.is-report { border-color: #fecaca; background: #fef6f6; }
.support-card.is-resolved { opacity: 0.62; }
.sp-head { display: flex; align-items: center; gap: 0.45rem; flex-wrap: wrap; margin-bottom: 0.5rem; }
.sp-badge { font-size: 0.74rem; font-weight: 700; padding: 0.12rem 0.5rem; border-radius: 999px; }
.sp-report { background: #fee2e2; color: #b91c1c; }
.sp-cat { background: var(--accent-soft); color: var(--accent); }
.sp-open { background: #dbeafe; color: #1d4ed8; }
.sp-done { background: #dcfce7; color: #15803d; }
.sp-when { margin-left: auto; font-size: 0.76rem; color: var(--muted); }
.sp-subject { font-weight: 700; font-size: 1.02rem; color: var(--ink); margin-bottom: 0.3rem; }
.sp-message { font-size: 0.9rem; color: #334155; white-space: pre-wrap; line-height: 1.5; word-break: break-word; }
.sp-meta { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.6rem; font-size: 0.8rem; }
.sp-email { color: var(--accent); font-weight: 600; text-decoration: none; }
.sp-email:hover { text-decoration: underline; }
.sp-user { color: var(--muted); }
.sp-guest { color: #94a3b8; }
.sp-actions { display: flex; gap: 0.4rem; margin-top: 0.75rem; }
.sp-btn { font-size: 0.78rem; padding: 0.32rem 0.7rem; border-radius: var(--radius); cursor: pointer; border: 1px solid var(--line); }
.sp-resolve { background: #16a34a; color: #fff; border-color: #16a34a; }
.sp-reopen { background: #fff; color: var(--muted); }
.sp-del { background: #fff; color: #dc2626; border-color: #fecaca; }
.sp-del:hover { background: #fef2f2; }

/* ── 캐릭터 상세페이지 ── */
.cd-mem-btn {
    display: inline-flex; align-items: center; gap: 0.3rem;
    height: 40px; padding: 0 0.9rem; line-height: 1;
    border: 1.5px solid var(--line); border-radius: 999px;
    background: var(--card); color: var(--ink); font-size: 0.9rem; font-weight: 700;
    white-space: nowrap; transition: border-color 0.15s, color 0.15s;
}
.cd-mem-btn:hover { border-color: var(--accent); color: var(--accent); }
.cd-more { position: relative; }
.cd-more-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0; line-height: 1;
    border: 1.5px solid var(--line); border-radius: 999px;
    background: var(--card); color: var(--ink); font-size: 1.4rem; font-weight: 800; cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.cd-more-btn:hover { border-color: var(--accent); }
.cd-icon-btn {
    display: inline-flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; padding: 0; margin-right: 0.4rem;
    border: 1.5px solid var(--line); border-radius: 999px;
    background: var(--card); color: var(--ink); cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
}
.cd-icon-btn:hover { border-color: var(--accent); }
.cd-icon-btn.is-added { background: var(--accent); border-color: var(--accent); color: #fff; }
.cd-more-menu {
    position: absolute; top: calc(100% + 6px); right: 0; z-index: 30;
    min-width: 160px; padding: 0.35rem; text-align: left;
    background: var(--card); border: 1.5px solid var(--line); border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.18);
}
.cd-more-item {
    display: block; width: 100%; text-align: left; text-decoration: none;
    padding: 0.6rem 0.75rem; border: 0; border-radius: 8px;
    background: transparent; color: var(--ink); font-size: 0.95rem; font-weight: 600; cursor: pointer;
}
.cd-more-item:hover { background: var(--accent-soft); }
/* hidden 이 위 display:block 에 덮이지 않도록(운영진 전용 항목 숨김) */
.cd-more-item[hidden] { display: none; }
/* 채팅방 헤더 안의 더보기 메뉴 — .nav-links a 의 muted 색을 덮어 본문색으로 */
.nav-links .cd-more-item { color: var(--ink); }
.nav-links .cd-more-item.is-danger { color: #dc2626; }
.nav-links .cd-more-item:hover { color: var(--ink); background: var(--accent-soft); }
.nav-links .cd-more-item.is-danger:hover { color: #dc2626; }
.cd-more-item.is-danger { color: #dc2626; }
.cd-more-item.is-danger:hover { background: #fef2f2; }

.cd-wrap { max-width: 560px; margin: 0 auto; padding: 1rem 1.25rem 3rem; }
.cd-card {
    display: flex; flex-direction: column; align-items: center; text-align: center;
    padding: 2rem 1.5rem; background: var(--card);
    border: 1.5px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
}
.cd-avatar { width: 140px; height: 140px; border-radius: 50%; overflow: hidden; margin-bottom: 1.1rem; box-shadow: var(--shadow-md); }
.cd-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cd-avatar-emoji { display: flex; align-items: center; justify-content: center; font-size: 4rem; background: var(--accent-soft); }
.cd-name { font-size: 1.6rem; font-weight: 800; margin-bottom: 0.35rem; display: flex; align-items: center; gap: 0.4rem; flex-wrap: wrap; justify-content: center; }
.cd-job { color: var(--muted); font-weight: 600; margin-bottom: 0.6rem; }
.cd-meta { display: flex; gap: 0.4rem; flex-wrap: wrap; justify-content: center; margin-bottom: 0.6rem; }
.cd-chip { font-size: 0.8rem; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 0.2rem 0.65rem; border-radius: 999px; }
.cd-tagline { font-size: 1.02rem; margin-bottom: 0.9rem; }
.cd-greeting { font-style: italic; color: var(--muted); border-left: 3px solid var(--accent); padding: 0.4rem 0.9rem; margin: 0 0 1rem; text-align: left; max-width: 420px; }
.cd-stat { color: var(--muted); font-size: 0.9rem; margin-bottom: 1.4rem; }
.cd-chat-btn { width: 100%; max-width: 320px; padding: 0.8rem; font-size: 1.05rem; }
/* 2인(pair) 상세 — 멤버 2명 표시 */
.cd-pair-members { display: flex; align-items: center; justify-content: center; gap: 1rem; margin: 1.2rem 0 1.4rem; flex-wrap: wrap; }
.cd-pair-member { display: flex; flex-direction: column; align-items: center; gap: 0.35rem; width: 130px; }
.cd-pair-av { width: 100px; height: 100px; border-radius: 50%; overflow: hidden; box-shadow: var(--shadow-md); background: var(--accent-soft); display: flex; align-items: center; justify-content: center; font-size: 2.4rem; }
.cd-pair-av img { width: 100%; height: 100%; object-fit: cover; }
.cd-pair-name { font-weight: 800; font-size: 1.02rem; }
.cd-pair-job { font-size: 0.85rem; color: var(--muted); }
.cd-pair-amp { font-size: 1.3rem; font-weight: 800; color: var(--muted); }
.cd-pair-note { font-size: 0.9rem; color: var(--muted); background: var(--bg-soft); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 0.8rem 1rem; max-width: 460px; line-height: 1.55; }

/* 신고 모달 */
.cd-modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.cd-modal[hidden] { display: none; }
.cd-modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(2px); }
.cd-modal-box {
    position: relative; z-index: 1; width: 100%; max-width: 440px;
    background: var(--card); border-radius: var(--radius-lg); box-shadow: var(--shadow-md);
    padding: 1.4rem 1.4rem 1.2rem; max-height: 90vh; overflow-y: auto;
}
.cd-modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 0.4rem; }
.cd-modal-head h2 { font-size: 1.2rem; font-weight: 800; }
.cd-modal-close { border: 0; background: transparent; color: var(--muted); font-size: 1.1rem; cursor: pointer; padding: 0.2rem 0.4rem; }
.cd-modal-sub { color: var(--muted); font-size: 0.9rem; margin-bottom: 1rem; }
.cd-reasons { display: flex; flex-direction: column; gap: 0.5rem; margin-bottom: 0.9rem; }
.cd-reason { display: flex; align-items: center; gap: 0.6rem; padding: 0.65rem 0.8rem; border: 1.5px solid var(--line); border-radius: 8px; cursor: pointer; font-weight: 600; transition: border-color 0.15s, background 0.15s; }
.cd-reason:hover { border-color: var(--accent); }
.cd-reason input { accent-color: var(--accent); width: 1.05rem; height: 1.05rem; flex-shrink: 0; }
.cd-reason:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }
.cd-report-detail { width: 100%; padding: 0.7rem 0.85rem; border: 1.5px solid var(--line); border-radius: 8px; font: inherit; font-size: 0.95rem; background: var(--card); color: var(--ink); resize: vertical; margin-bottom: 1rem; }
.cd-report-detail:focus { border-color: var(--accent); outline: none; }
.cd-modal-actions { display: flex; justify-content: flex-end; gap: 0.6rem; }

/* ── 관리자: 전체 채팅방 ───────────────────────────────── */
.room-search {
    width: 100%; max-width: 520px; padding: 0.65rem 0.9rem; margin: 0.2rem 0 0.8rem;
    border: 1.5px solid var(--line); border-radius: 8px; font: inherit; font-size: 0.95rem;
    background: var(--card); color: var(--ink);
}
.room-search:focus { border-color: var(--accent); outline: none; }
.rooms-filter-bar { display: flex; gap: 0.6rem; margin: 0.2rem 0 0.7rem; flex-wrap: wrap; }
.rooms-filter-bar a {
    display: inline-block; padding: 0.4rem 0.8rem; border: 1.5px solid var(--line);
    border-radius: 999px; background: var(--card); color: var(--ink);
    text-decoration: none; font-size: 0.88rem; font-weight: 600;
}
.rooms-filter-bar a:hover { border-color: var(--accent); color: var(--accent); }
.room-list { display: flex; flex-direction: column; gap: 0.55rem; }
.room-list .chat-row { cursor: pointer; }
.chat-av-ph { }
.rm-arrow { color: var(--muted); font-weight: 400; margin: 0 0.15rem; }
.rm-sub { color: var(--muted); font-size: 0.78rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rm-arrow { color: var(--accent); }

.room-back {
    background: none; border: none; color: var(--accent); font: inherit; font-weight: 600;
    cursor: pointer; padding: 0.3rem 0; margin-bottom: 0.6rem;
}
.room-back:hover { text-decoration: underline; }
.chat-head { border-bottom: 1.5px solid var(--line); padding-bottom: 0.7rem; margin-bottom: 1rem; }
.ch-title { font-size: 1.15rem; font-weight: 700; color: var(--ink); }
.ch-meta { color: var(--muted); font-size: 0.85rem; margin-top: 0.2rem; }
.chat-log { display: flex; flex-direction: column; gap: 0.5rem; padding-bottom: 1rem; }
.cl-msg { display: flex; flex-direction: column; max-width: 80%; }
.cl-msg.cl-left { align-self: flex-start; align-items: flex-start; }
.cl-msg.cl-right { align-self: flex-end; align-items: flex-end; }
.cl-msg .msg { max-width: 100%; }
.cl-stamp { color: var(--muted); font-size: 0.68rem; margin-top: 0.15rem; padding: 0 0.2rem; }
.chat-daysep {
    align-self: center; color: var(--muted); font-size: 0.75rem; background: var(--bg-soft);
    padding: 0.2rem 0.7rem; border-radius: 999px; margin: 0.6rem 0 0.2rem;
}

/* 모바일 앱 설치 유도 팝업 */
.app-install-overlay {
    position: fixed; inset: 0; z-index: 3000;
    display: flex; align-items: center; justify-content: center;
    padding: 1.2rem;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(2px);
}
.app-install-overlay[hidden] { display: none; }
body.app-install-open { overflow: hidden; }
.app-install-modal {
    position: relative;
    width: 100%; max-width: 340px;
    background: var(--bg); color: var(--ink);
    border: 1px solid var(--line); border-radius: 18px;
    padding: 1.8rem 1.4rem 1.4rem;
    text-align: center;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}
/* 이모지 📱 대신 선 아이콘을 넣었다 — 색은 글자색을 물려받는다(다크: 반투명 화이트) */
.app-install-icon { display: flex; justify-content: center; margin-bottom: 0.6rem; color: var(--ink); }
.app-install-icon svg {
    width: 40px; height: 40px; display: block;
    fill: none; stroke: currentColor; stroke-width: 1.6;
    stroke-linecap: round; stroke-linejoin: round;
}
.app-install-modal h3 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.app-install-modal p { margin: 0 0 1.2rem; color: var(--muted); font-size: 0.9rem; }
.app-install-go { display: block; width: 100%; text-align: center; }
.app-install-later {
    display: block; width: 100%; margin-top: 0.7rem;
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 0.85rem; font-weight: 600;
}
.app-install-later:hover { color: var(--ink); }
.app-install-close {
    position: absolute; top: 0.6rem; right: 0.7rem;
    background: none; border: none; cursor: pointer;
    color: var(--muted); font-size: 1.1rem; line-height: 1; padding: 0.3rem;
}
.app-install-close:hover { color: var(--ink); }


/* ============================================================
   관리자 API 문서(/admin/api) — '전체복사' 플로팅 버튼
   목록이 길어 스크롤 위치와 무관하게 우측 하단에 떠 있게 한다.
   색은 기존 토큰(--grad/--shadow-glow)만 쓰므로 다크모드·강조색을 자동으로 따라간다.
   ============================================================ */
.fab-copy {
    position: fixed;
    right: clamp(16px, 3vw, 28px);
    bottom: calc(env(safe-area-inset-bottom, 0px) + clamp(16px, 3vw, 28px));
    z-index: 45;                      /* 사이드바(40) 위, 토스트(50)·모달(100) 아래 */

    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 13px 20px;
    border: 0;
    border-radius: 999px;

    background: var(--grad);
    color: #fff;
    font: inherit;
    font-size: 0.95rem;
    font-weight: 600;
    white-space: nowrap;
    cursor: pointer;

    box-shadow: var(--shadow-md), var(--shadow-glow);
    animation: fabBob 3.4s ease-in-out infinite;
    transition: transform 0.18s ease, filter 0.18s ease, opacity 0.18s ease;
}

@keyframes fabBob {
    0%, 100% { transform: translateY(0); }
    50%      { transform: translateY(-7px); }
}

.fab-copy:hover {
    animation-play-state: paused;     /* 누르려는 순간엔 흔들리지 않게 */
    transform: translateY(-7px) scale(1.04);
    filter: brightness(1.06);
}
.fab-copy:active { transform: translateY(-2px) scale(0.97); }
.fab-copy:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* 떠 있는 버튼이 문서 마지막 줄을 가리지 않도록 하단 여백 확보 */
.api-doc { padding-bottom: 6.5rem; }

/* 모바일에서 사이드바가 열려 있을 때는 잠시 비켜 준다 */
body:has(#sidebar.open) .fab-copy { opacity: 0; pointer-events: none; }

@media (max-width: 480px) {
    .fab-copy { padding: 12px 16px; font-size: 0.9rem; }
}

/* 애니메이션 최소화를 켠 사용자에게는 흔들지 않는다 */
@media (prefers-reduced-motion: reduce) {
    .fab-copy { animation: none; }
    .fab-copy:hover { transform: none; }
}
