/* K-TourTalk chat — extends app.css (same tokens, mobile-first) */
.chat-page #app-container { height: 100vh; height: 100dvh; }
.chat-page .site-biz-footer { display: none; }
.brand-box { text-decoration: none; color: inherit; }
.header-home-btn { min-height: 36px; padding: 6px 10px; text-decoration: none; }

.member-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; font-size: 0.74rem; font-weight: 800; color: var(--muted); }
.member-status { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-status .pass-on { color: var(--primary-dark); }
.member-status .pass-off { color: var(--orange-dark); }
.member-actions { display: flex; gap: 6px; flex-shrink: 0; }
.chip-btn { border: 1.5px solid var(--border); background: #fff; color: var(--text); font-weight: 800; font-size: 0.72rem; border-radius: 999px; padding: 6px 11px; cursor: pointer; box-shadow: 0 2px 0 var(--border); white-space: nowrap; }
.chip-btn:active { transform: translateY(1px); box-shadow: none; }
.chip-btn.ghost { box-shadow: none; color: var(--muted); }
.chip-btn.danger { color: var(--danger-dark); border-color: #FECACA; }

.chat-tabs { margin: 8px 12px 0; display: flex; background: #F1F5F9; border-radius: 12px; padding: 4px; gap: 4px; }
.chat-tabs .badge { display: inline-block; min-width: 16px; padding: 1px 5px; border-radius: 999px; background: var(--danger); color: #fff; font-size: 0.62rem; }

.chat-panel { flex: 1; position: relative; overflow: hidden; display: flex; flex-direction: column; }
.chat-intro { margin: 10px 12px 0; padding: 10px 12px; border-radius: 12px; background: #FFF7ED; border: 1.5px solid #FED7AA; color: #9A3412; font-size: 0.76rem; font-weight: 700; line-height: 1.45; }
.chat-intro.demo { background: #FEF9C3; border-color: #FDE047; color: #854D0E; }
.chat-log { flex: 1; overflow-y: auto; padding: 12px 12px 16px; display: flex; flex-direction: column; gap: 8px; -webkit-overflow-scrolling: touch; }
.msg { display: flex; gap: 8px; align-items: flex-end; max-width: 88%; }
.msg .avatar { width: 30px; height: 30px; border-radius: 50%; flex-shrink: 0; background: #FFF7ED; display: flex; align-items: center; justify-content: center; font-size: 0.9rem; overflow: hidden; }
.msg .avatar img { width: 100%; height: 100%; object-fit: cover; }
.msg .bubble { background: #fff; border: 1.5px solid var(--border); border-radius: 16px 16px 16px 4px; padding: 8px 11px; font-size: 0.9rem; line-height: 1.45; white-space: pre-wrap; word-break: break-word; box-shadow: var(--shadow); }
.msg .meta { font-size: 0.64rem; color: var(--muted); font-weight: 700; margin: 0 4px 2px; display: flex; gap: 6px; align-items: center; }
.msg .meta button { border: none; background: none; color: var(--muted); font-size: 0.64rem; font-weight: 800; cursor: pointer; padding: 0; }
.msg .meta button:hover { color: var(--danger-dark); }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg.me .bubble { background: var(--primary); color: #fff; border-color: var(--primary-dark); border-radius: 16px 16px 4px 16px; }
.msg.me .meta { justify-content: flex-end; }
.msg.tutor .bubble { background: #EFF6FF; border-color: #BFDBFE; }
.msg.demo .bubble { background: #FFFBEB; border-color: #FDE68A; }
.msg.pending .bubble { opacity: 0.6; }
.sys-note { align-self: center; font-size: 0.7rem; font-weight: 800; color: var(--muted); background: #F1F5F9; padding: 4px 10px; border-radius: 999px; }
.typing .bubble::after { content: "···"; letter-spacing: 2px; animation: blinkAnim 1s infinite; }

.composer { background: #fff; border-top: 2px solid var(--border); padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); }
.composer[hidden] { display: none; }
.composer-scene { display: flex; gap: 6px; margin-bottom: 6px; }
.composer-scene[hidden] { display: none; }
.scene-select { flex: 1; min-width: 0; padding: 6px 8px; border-radius: 10px; border: 1.5px solid var(--border); font-size: 0.75rem; font-weight: 800; background: #fff; }
.composer-row { display: flex; gap: 8px; align-items: flex-end; }
.composer textarea { flex: 1; resize: none; border: 1.5px solid var(--border); border-radius: 14px; padding: 10px 12px; font-size: 16px; line-height: 1.35; max-height: 120px; outline: none; background: var(--bg); }
.composer textarea:focus { border-color: var(--sky); background: #fff; }
.send-btn { width: 44px; height: 44px; border-radius: 50%; border: none; background: var(--primary); color: #fff; font-size: 1.1rem; font-weight: 900; box-shadow: 0 3px 0 var(--primary-dark); cursor: pointer; flex-shrink: 0; }
.send-btn:disabled { background: #CBD5E1; box-shadow: none; }
.composer-meta { display: flex; justify-content: space-between; font-size: 0.64rem; font-weight: 700; color: var(--muted); margin-top: 4px; min-height: 12px; }
.composer-meta .over { color: var(--danger); }

/* Gate (non-members) */
.gate { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: flex-end; }
.gate[hidden] { display: none; }
.gate-preview { position: absolute; inset: 0; padding: 12px; display: flex; flex-direction: column; gap: 8px; filter: blur(2.5px); opacity: 0.75; pointer-events: none; overflow: hidden; }
.gate-card { position: relative; margin: 12px; background: #fff; border: 2px solid #FED7AA; border-radius: 20px; padding: 16px; box-shadow: 0 10px 30px rgba(15,23,42,0.15); text-align: center; }
.gate-card h3 { font-size: 1.02rem; font-weight: 900; margin-bottom: 6px; }
.gate-card p { font-size: 0.8rem; color: var(--muted); font-weight: 700; line-height: 1.45; margin-bottom: 12px; }
.gate-card ul { list-style: none; text-align: left; font-size: 0.78rem; font-weight: 700; margin: 0 0 12px; display: grid; gap: 4px; }
.plan-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 10px; }
.plan-btn { border: 2px solid var(--border); border-radius: 14px; padding: 10px 6px; background: #fff; cursor: pointer; font-weight: 900; font-size: 0.85rem; box-shadow: 0 3px 0 var(--border); }
.plan-btn small { display: block; color: var(--orange-dark); font-size: 0.8rem; margin-top: 2px; }
.plan-btn.best { border-color: var(--primary); box-shadow: 0 3px 0 var(--primary-dark); }
.demo-pay-note { font-size: 0.68rem !important; color: #92400E !important; background: #FEF3C7; border-radius: 8px; padding: 6px 8px; margin: 0 !important; }

/* Auth modal */
.auth-sub { font-size: 0.8rem; color: var(--muted); font-weight: 700; margin-bottom: 12px; }
.social-col { display: grid; gap: 8px; margin-bottom: 10px; }
.social-btn { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 12px; border-radius: 12px; font-weight: 900; font-size: 0.92rem; cursor: pointer; border: 1.5px solid var(--border); background: #fff; color: #1F2937; }
.social-btn.kakao { background: #FEE500; border-color: #FEE500; color: #191600; }
.social-btn .sicon { font-weight: 900; font-size: 1rem; width: 22px; }
.social-btn.google .sicon { color: #4285F4; }
.social-btn .tag { font-size: 0.62rem; font-weight: 800; background: #F1F5F9; color: var(--muted); border-radius: 999px; padding: 2px 6px; }
.demo-box { background: #FEF9C3; border: 1.5px solid #FDE047; border-radius: 12px; padding: 10px; margin-bottom: 10px; }
.demo-note { font-size: 0.72rem; font-weight: 700; color: #854D0E; margin-bottom: 8px; }
.demo-box .row { display: flex; gap: 6px; }
.demo-box input, .email-form input { flex: 1; min-width: 0; border: 1.5px solid var(--border); border-radius: 10px; padding: 10px; font-size: 16px; }
.or-line { text-align: center; font-size: 0.7rem; color: var(--muted); font-weight: 800; margin: 6px 0 10px; position: relative; }
.or-line::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px solid var(--border); }
.or-line span { position: relative; background: #fff; padding: 0 8px; }
.email-form { display: grid; gap: 8px; }
.email-form[hidden], .or-line[hidden] { display: none; }
.seg { display: grid; grid-template-columns: 1fr 1fr; background: #F1F5F9; border-radius: 10px; padding: 3px; }
.seg-btn { border: none; background: transparent; padding: 7px; border-radius: 8px; font-weight: 800; font-size: 0.8rem; color: var(--muted); cursor: pointer; }
.seg-btn.active { background: #fff; color: var(--text); box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.form-err { color: var(--danger-dark); font-size: 0.76rem; font-weight: 800; min-height: 1em; }

/* Admin */
.admin-wrap { flex: 1; overflow-y: auto; padding: 12px; }
.admin-list { display: grid; gap: 8px; }
.admin-item { background: #fff; border: 1.5px solid var(--border); border-radius: 12px; padding: 10px; font-size: 0.8rem; cursor: pointer; }
.admin-item .top { display: flex; justify-content: space-between; gap: 6px; font-weight: 900; }
.admin-item .sub { color: var(--muted); font-weight: 700; margin-top: 3px; word-break: break-word; }
.admin-item.hidden-msg { opacity: 0.55; }
.admin-item .acts { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.admin-search { display: flex; gap: 6px; margin-bottom: 10px; }
.admin-search input { flex: 1; border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 10px; font-size: 16px; }

@media (min-width: 520px) { .msg { max-width: 78%; } }
[dir="rtl"] .msg.me { flex-direction: row; }
.chat-tabs .badge[hidden], .badge[hidden] { display: none; }
.chat-intro[hidden] { display: none; }
.chat-page .game-toast { bottom: auto; top: 128px; }
