/* ---------- 4) 카카오톡 화면 (가상 대화 — 실제 카카오톡 서버와 연결되지 않음) ---------- */
.chat { position: fixed; left: 0; right: 0; top: 0; height: 100%; z-index: 4; display: none; flex-direction: column; background: #fff; color: #191919;
  padding-top: max(env(safe-area-inset-top), 6px); font-size: 15px; }
body.chat-open .chat { display: flex; animation: appIn .32s cubic-bezier(.22,.8,.2,1); }
body.chat-open .home { visibility: hidden; }
.chat > .status { flex: none; }
.chat .status-left { padding-left: 14px; font-variant-numeric: tabular-nums; }
.chat[data-view="room"] { background: #b2c7da; }
.kk-view { display: none; flex: 1; min-height: 0; flex-direction: column; }
.chat[data-view="list"] .kk-list, .chat[data-view="room"] .kk-room { display: flex; }
.kk-head { display: flex; align-items: center; height: 50px; padding: 0 8px 0 10px; flex: none; }
.kk-head h1 { margin: 0; font-size: 22px; font-weight: 700; flex: 1; letter-spacing: -.3px; }
.kk-ico { appearance: none; border: 0; background: none; color: inherit; width: 40px; height: 40px; display: grid; place-items: center; cursor: pointer; border-radius: 50%; }
.kk-ico:active { background: rgba(0,0,0,.06); }
.kk-ico svg { width: 23px; height: 23px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kk-sbar { display: none; align-items: center; gap: 7px; margin: 0 14px 8px; padding: 0 12px; height: 36px; border-radius: 10px; background: #f2f2f2; flex: none; }
.chat.searching .kk-sbar { display: flex; }
.kk-sbar input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 16px; }
.kk-sbar svg { width: 15px; height: 15px; stroke: #999; fill: none; stroke-width: 2.2; stroke-linecap: round; }
.kk-scroll { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; }
.kk-pane { display: none; }
.chat[data-tab="friends"] .kk-pane-friends, .chat[data-tab="chats"] .kk-pane-chats, .chat[data-tab="more"] .kk-pane-more { display: block; }
.kk-row { appearance: none; border: 0; background: none; font: inherit; color: inherit; width: 100%; display: flex; align-items: center; gap: 12px; padding: 8px 16px; text-align: left; cursor: pointer; }
.kk-row:active { background: #f5f5f5; }
.kk-av { width: 48px; height: 48px; border-radius: 38%; flex: none; display: grid; place-items: center; color: #fff; font-weight: 700; font-size: 18px; background-size: cover; background-position: center; }
.kk-av.sm { width: 38px; height: 38px; font-size: 14px; }
.kk-av.lg { width: 58px; height: 58px; font-size: 22px; }
.kk-main { flex: 1; min-width: 0; }
.kk-name { font-size: 15.5px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.kk-name small { font-size: 13px; color: #aaa; font-weight: 500; }
.kk-prev { display: block; font-size: 13.5px; color: #888; margin-top: 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kk-side { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; font-size: 11.5px; color: #aaa; flex: none; }
.kk-badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #ff5b3a; color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.kk-badge:empty { display: none; }
.kk-sec { font-size: 12px; color: #999; padding: 12px 16px 4px; }
.kk-more-btn { appearance: none; border: 0; background: none; font: inherit; color: inherit; width: 100%; text-align: left; padding: 14px 18px; border-bottom: .5px solid #eee; cursor: pointer; font-size: 15.5px; }
.kk-more-btn.warn { color: #e0352b; }
.kk-foot { font-size: 11px; color: #c4c4c4; text-align: center; padding: 16px; }
.kk-tabs { flex: none; display: flex; justify-content: space-around; border-top: .5px solid #e8e8e8; padding: 6px 0 0; background: #fff; }
.kk-tab { appearance: none; border: 0; background: none; color: #c2c2c2; padding: 6px 18px; cursor: pointer; position: relative; }
.kk-tab.on { color: #191919; }
.kk-tab svg { width: 27px; height: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kk-tab.on svg { fill: currentColor; }
.kk-tab .kk-badge { position: absolute; top: 1px; right: 8px; }
.chat .app-homebar { color: #000; }
.kk-room .app-homebar { background: #fff; }

.kk-rhead { display: flex; align-items: center; height: 48px; padding: 0 4px; flex: none; }
.kk-rname { flex: 1; font-size: 16.5px; font-weight: 600; margin-left: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kk-rname small { font-size: 13px; color: #556; font-weight: 500; margin-left: 4px; }
.kk-rsearch { display: none; align-items: center; gap: 7px; margin: 0 10px 6px; padding: 0 12px; height: 34px; border-radius: 10px; background: rgba(255,255,255,.85); flex: none; }
.kk-room.searching .kk-rsearch { display: flex; }
.kk-rsearch input { flex: 1; min-width: 0; border: 0; outline: none; background: none; font: inherit; font-size: 16px; }
.kk-rsearch span { font-size: 12px; color: #667; white-space: nowrap; }
.kk-msgs { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain; touch-action: pan-y; padding: 2px 10px 12px; user-select: text; -webkit-user-select: text; }
.kk-day { text-align: center; margin: 14px 0 10px; }
.kk-day span { display: inline-block; padding: 4px 12px; border-radius: 12px; font-size: 11.5px; background: rgba(0,0,0,.13); color: #fff; }
.kk-msg { display: flex; gap: 8px; margin-top: 4px; }
.kk-msg.first { margin-top: 12px; }
.kk-msg.me { justify-content: flex-end; }
.kk-msg .kk-av { align-self: flex-start; }
.kk-msg .kk-av.ghost { visibility: hidden; }
.kk-col { display: flex; flex-direction: column; max-width: 70%; min-width: 0; }
.kk-from { font-size: 12.5px; color: #3b4a5a; margin: 1px 0 5px 1px; }
.kk-line { display: flex; align-items: flex-end; gap: 5px; }
.kk-msg.me .kk-line { flex-direction: row-reverse; }
.kk-bub { padding: 7px 10px; border-radius: 13px; font-size: 14.5px; line-height: 1.42; background: #fff; word-break: break-word; white-space: pre-wrap; }
.kk-msg.me .kk-bub { background: #fee500; }
.kk-msg.first.them .kk-bub { border-top-left-radius: 4px; }
.kk-msg.first.me .kk-bub { border-top-right-radius: 4px; }
.kk-bub.img { padding: 0; overflow: hidden; background: none; }
.kk-bub.img img { display: block; width: 190px; max-width: 100%; border-radius: 13px; }
.kk-bub mark { background: #ffd54f; color: inherit; border-radius: 2px; }
.kk-meta { display: flex; flex-direction: column; align-items: flex-end; font-size: 10px; color: #4c5a68; white-space: nowrap; flex: none; }
.kk-msg.them .kk-meta { align-items: flex-start; }
.kk-one { color: #f2c300; font-weight: 700; font-size: 10.5px; }
.kk-typing .kk-bub { display: flex; gap: 4px; padding: 11px 12px; }
.kk-typing i { width: 6px; height: 6px; border-radius: 50%; background: #9aa; animation: dot 1s infinite; }
.kk-typing i:nth-child(2) { animation-delay: .15s; } .kk-typing i:nth-child(3) { animation-delay: .3s; }
@keyframes dot { 0%, 60%, 100% { opacity: .3; transform: none; } 30% { opacity: 1; transform: translateY(-3px); } }
.kk-comp { flex: none; display: flex; align-items: flex-end; gap: 4px; padding: 7px 6px 7px; background: #fff; }
.kk-comp .kk-ico { width: 36px; height: 36px; color: #555; }
.kk-comp textarea { flex: 1; resize: none; max-height: 96px; min-height: 36px; padding: 8px 12px; border: 0; border-radius: 18px; outline: none;
  font: inherit; font-size: 16px; line-height: 1.3; color: #191919; background: #f4f4f4; touch-action: manipulation; user-select: text; -webkit-user-select: text; }
.kk-send { appearance: none; border: 0; flex: none; width: 36px; height: 36px; border-radius: 50%; background: #fee500; display: none; place-items: center; cursor: pointer; }
.kk-send svg { width: 18px; height: 18px; fill: #191919; }
.kk-comp.has-text .kk-send { display: grid; }
.kk-comp.has-text #kkEmojiBtn { display: none; }
.kk-panel { display: none; flex: none; background: #fff; border-top: .5px solid #eee; padding: 10px 12px 4px; }
.kk-room[data-panel="emoji"] .kk-emoji, .kk-room[data-panel="plus"] .kk-plus { display: grid; }
.kk-emoji { grid-template-columns: repeat(8, 1fr); gap: 4px; }
.kk-emoji button { appearance: none; border: 0; background: none; font-size: 26px; padding: 4px 0; cursor: pointer; border-radius: 8px; }
.kk-emoji button:active { background: #f2f2f2; }
.kk-plus { grid-template-columns: repeat(4, 1fr); gap: 10px; }
.kk-plus button { appearance: none; border: 0; background: none; font: inherit; font-size: 12px; color: #555; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.kk-plus button span { width: 52px; height: 52px; border-radius: 18px; display: grid; place-items: center; }
.kk-plus svg { width: 24px; height: 24px; fill: none; stroke: #fff; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.kk-sheet { position: absolute; left: 0; right: 0; bottom: 0; z-index: 5; background: #fff; border-radius: 16px 16px 0 0; padding: 8px 0 calc(max(env(safe-area-inset-bottom), 8px) + 8px); box-shadow: 0 -4px 20px rgba(0,0,0,.15); display: none; }
.kk-room.menu-open .kk-sheet { display: block; }
.kk-room { position: relative; }

/* 내 프로필 · 상단 고정 · 여러 줄 메시지 */
.kk-me { cursor: default; padding: 12px 16px 14px; border-bottom: .5px solid #eee; }
.kk-me:active { background: none; }
.kk-me .kk-name { font-size: 17px; font-weight: 700; }
.kk-pin { font-style: normal; font-size: 11px; opacity: .8; }
.kk-bub { white-space: pre-line; }
/* 친구 프로필 화면 */
.kk-profile { position: absolute; inset: 0; z-index: 20; display: none; flex-direction: column; color: #fff; background: #444 center / cover no-repeat; }
.kk-profile.show { display: flex; animation: appIn .28s ease; }
.kk-profile .signal i, .kk-profile .batt-fill { background: #fff; }
.kk-pf-close { appearance: none; border: 0; background: none; color: #fff; width: 44px; height: 44px; margin: 0 6px; display: grid; place-items: center; cursor: pointer; }
.kk-pf-close svg { width: 24px; height: 24px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; filter: drop-shadow(0 1px 2px rgba(0,0,0,.4)); }
.kk-pf-info { margin-top: auto; display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 0 24px 22px; text-align: center; text-shadow: 0 1px 4px rgba(0,0,0,.45); }
.kk-pf-av { width: 96px; height: 96px; border-radius: 38%; display: grid; place-items: center; font-size: 34px; font-weight: 700; margin-bottom: 8px; box-shadow: 0 2px 10px rgba(0,0,0,.3); }
.kk-pf-info b { font-size: 20px; }
.kk-pf-info span:last-child { font-size: 14px; opacity: .9; min-height: 1em; }
.kk-pf-acts { display: flex; justify-content: center; gap: 40px; padding: 18px 0 calc(max(env(safe-area-inset-bottom), 10px) + 24px); border-top: .5px solid rgba(255,255,255,.3); }
.kk-pf-acts button { appearance: none; border: 0; background: none; color: #fff; font: inherit; font-size: 13px; display: flex; flex-direction: column; align-items: center; gap: 6px; cursor: pointer; }
.kk-pf-acts svg { width: 28px; height: 28px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linejoin: round; }
.kk-me { width: 100%; }
.kk-profile .batt-num { color: #000; }
/* ===== 목록 화면 새 디자인 (큰 제목 · 칩 · 섹션 · 5탭) ===== */
.kk-list .kk-head { height: 58px; padding: 0 10px 0 18px; gap: 2px; }
.kk-list .kk-head h1 { font-size: 26px; font-weight: 500; letter-spacing: -.5px; }
.kk-list .kk-head h1:empty { flex: 0; }
.kk-head-me { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.kk-head-me:empty { display: none; }
.kk-head-me .kk-av { width: 38px; height: 38px; }
.kk-head-me b { font-size: 21px; font-weight: 500; }
.kk-list .kk-ico svg { width: 25px; height: 25px; stroke-width: 1.9; }
.kk-chips { display: flex; gap: 8px; padding: 4px 18px 12px; flex: none; }
.kk-chip { appearance: none; border: 0; border-radius: 22px; padding: 9px 18px; font: inherit; font-size: 15.5px; background: #f2f2f2; color: #8a8a8a; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.kk-chip.on { background: #191919; color: #fff; }
.kk-chip i { font-style: normal; min-width: 22px; padding: 0 6px; height: 19px; border-radius: 10px; background: #ff5b3a; color: #fff; font-size: 11.5px; display: grid; place-items: center; }
.kk-chip-ic { padding: 7px 12px; color: #555; } .kk-chip-ic svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; }
.kk-ad { appearance: none; border: 0; width: calc(100% - 36px); margin: 2px 18px 10px; border-radius: 16px; padding: 14px 16px; background: linear-gradient(120deg, #f4f4f4 55%, #ffe9cf); text-align: left; font: inherit; color: #191919; position: relative; display: block; cursor: pointer; }
.kk-ad small { display: block; font-size: 11px; font-weight: 800; color: #111; letter-spacing: .5px; }
.kk-ad b { display: block; font-size: 17px; margin: 3px 0 2px; }
.kk-ad span { font-size: 13px; color: #555; }
.kk-ad .kk-ad-tag { position: absolute; top: 10px; right: 12px; font-size: 10.5px; font-weight: 700; color: #999; border: 1px solid #ccc; border-radius: 9px; padding: 1px 6px; }
.kk-room-row { padding: 9px 18px; gap: 13px; }
.kk-list .kk-av { width: 52px; height: 52px; border-radius: 40%; font-size: 19px; }
.kk-list .kk-name { font-size: 16.5px; font-weight: 500; }
.kk-nm { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kk-list .kk-name small { font-size: 15px; color: #a5a5a5; font-weight: 400; }
.kk-list .kk-prev { font-size: 14.5px; color: #8a8a8a; white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; line-height: 1.35; }
.kk-list .kk-side { font-size: 12.5px; color: #a5a5a5; align-self: flex-start; padding-top: 4px; }
.kk-list .kk-side .kk-badge { min-width: 22px; height: 22px; border-radius: 11px; font-size: 12px; }
.kk-pin, .kk-mute { display: inline-grid; color: #9a9a9a; }
.kk-pin svg, .kk-mute svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linejoin: round; stroke-linecap: round; }
.kk-pin svg { fill: currentColor; }
.kk-gav { display: grid !important; grid-template-columns: 1fr 1fr; gap: 2px; background: none !important; border-radius: 0 !important; }
.kk-gav .kk-av { width: 100% !important; height: 100% !important; border-radius: 38% !important; font-size: 10px; }
.kk-shead { appearance: none; border: 0; background: none; width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 16px 18px 8px; font: inherit; font-size: 15px; color: #444; cursor: pointer; }
.kk-shead svg { width: 22px; height: 22px; fill: none; stroke: #888; stroke-width: 1.8; stroke-linecap: round; transition: transform .2s; }
.kk-shead.fold svg { transform: rotate(180deg); }
.kk-ustrip { display: flex; gap: 14px; overflow-x: auto; padding: 4px 18px 8px; scrollbar-width: none; }
.kk-ustrip::-webkit-scrollbar { display: none; }
.kk-upd { appearance: none; border: 0; background: none; padding: 0; font: inherit; display: flex; flex-direction: column; align-items: center; gap: 6px; width: 64px; flex: none; cursor: pointer; color: #333; }
.kk-upd .kk-av { width: 60px !important; height: 60px !important; position: relative; overflow: visible; }
.kk-upd small { font-size: 12.5px; width: 100%; text-align: center; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.kk-dot { position: absolute; top: -1px; right: -1px; width: 7px; height: 7px; border-radius: 50%; background: #ff5b3a; }
.kk-pane-friends .kk-row { padding: 8px 18px; gap: 13px; }
.kk-gift { flex: none; appearance: none; border: 0; border-radius: 18px; padding: 8px 14px; font: inherit; font-size: 14px; background: #f2f2f2; color: #555; cursor: pointer; }
.kk-pay { margin: 4px 18px 14px; border-radius: 18px; background: #fee500; display: flex; align-items: center; padding: 16px 18px; }
.kk-pay-l { appearance: none; border: 0; background: none; font: inherit; font-size: 17px; color: #191919; cursor: pointer; padding: 0; }
.kk-pay-l b { font-weight: 800; margin-right: 6px; }
.kk-pay-r { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.kk-pay-r button { appearance: none; border: 0; background: none; font: inherit; font-size: 15px; color: #3a3a3a; cursor: pointer; padding: 0; }
.kk-pay-r i { width: 1px; height: 14px; background: rgba(0,0,0,.18); }
.kk-grid { margin: 0 18px 8px; border-radius: 18px; background: #fff; box-shadow: 0 0 0 .5px #ececec; display: grid; grid-template-columns: repeat(4, 1fr); padding: 18px 6px 8px; }
.kk-grid button { appearance: none; border: 0; background: none; font: inherit; font-size: 13px; color: #333; display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 0 0 18px; cursor: pointer; }
.kk-grid svg { width: 30px; height: 30px; fill: none; stroke: #222; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.kk-empty { padding: 60px 20px; text-align: center; color: #aaa; font-size: 14px; }
.chat[data-tab="open"] .kk-pane-open, .chat[data-tab="shop"] .kk-pane-shop { display: block; }
.kk-list .kk-tabs { border-top: 0; padding-top: 8px; }
.kk-list .kk-tab { padding: 6px 14px; color: #b8b8b8; }
.kk-list .kk-tab.on { color: #191919; }
.kk-list .kk-tab .kk-badge { top: -2px; right: -2px; min-width: 26px; height: 20px; border-radius: 10px; font-size: 12px; }
.kk-list .kk-head-me .kk-av { width: 38px; height: 38px; font-size: 15px; }
#kkHome { display: none; }
/* 대본 대화: 답장 말풍선 고르기 */
.kk-choices { display: none; flex: none; flex-direction: column; align-items: flex-end; gap: 7px; padding: 10px 12px 12px; background: rgba(255,255,255,.55); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border-top: .5px solid rgba(0,0,0,.06); }
.kk-room.choosing .kk-choices { display: flex; animation: chIn .25s ease; }
@keyframes chIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.kk-ch-t { align-self: center; font-size: 11.5px; color: #667; margin-bottom: 1px; }
.kk-ch { appearance: none; border: 0; max-width: 82%; padding: 10px 14px; border-radius: 16px 16px 4px 16px; background: #fee500; color: #191919; font: inherit; font-size: 15px; text-align: left; box-shadow: 0 1px 3px rgba(0,0,0,.12); cursor: pointer; }
.kk-ch:active { transform: scale(.97); }
