@font-face { font-family: "Do Hyeon"; src: url("https://cdn.jsdelivr.net/gh/google/fonts@main/ofl/dohyeon/DoHyeon-Regular.ttf"); font-display: swap; }
:root { --bg: #FBF8F1; --side: #F1EDE2; --card: #FFFFFF; --line: #E4DED0; --ink: #2F2A22; --text: #3A342A; --muted: #8A8273; --accent: #C9822E; --input: #EFEADF; --font: "Do Hyeon", -apple-system, "Apple SD Gothic Neo", sans-serif; }
@media (prefers-color-scheme: dark) { :root:not([data-theme]) { --bg: #1C1D20; --side: #141517; --card: #26282C; --line: #33353A; --ink: #ECE7DD; --text: #DCD6CA; --muted: #9B958A; --accent: #F2B544; --input: #2A2C31; } }
/* 테마(패치 77.9): 내 프로필 › 🎨 테마. 자동(기기 따라 밝게/어둡게)은 data-theme 없음 */
:root[data-theme="cream"] { --bg: #FBF8F1; --side: #F1EDE2; --card: #FFFFFF; --line: #E4DED0; --ink: #2F2A22; --text: #3A342A; --muted: #8A8273; --accent: #C9822E; --input: #EFEADF; }
:root[data-theme="dark"] { --bg: #1C1D20; --side: #141517; --card: #26282C; --line: #33353A; --ink: #ECE7DD; --text: #DCD6CA; --muted: #9B958A; --accent: #F2B544; --input: #2A2C31; }
:root[data-theme="autumn"] { --bg: #FBF3EA; --side: #F3E3D0; --card: #FFFDF9; --line: #E8D3BC; --ink: #3B2618; --text: #4A3323; --muted: #9A7B62; --accent: #C0582B; --input: #F1E2D2; }
:root[data-theme="winter"] { --bg: #F3F7FB; --side: #E4EDF6; --card: #FFFFFF; --line: #D3E0EC; --ink: #1E2E3E; --text: #2B3B4C; --muted: #7A8B9C; --accent: #3D7FB8; --input: #E6EEF6; }
:root[data-theme="xmas"] { --bg: #FBF7F2; --side: #F1E8DD; --card: #FFFFFF; --line: #E6D8C8; --ink: #2C2A25; --text: #3A342C; --muted: #8B8072; --accent: #B8323A; --input: #EFE6DA; }
:root[data-theme="lavender"] { --bg: #F8F6FC; --side: #ECE7F6; --card: #FFFFFF; --line: #DDD5EE; --ink: #2D2640; --text: #3A3150; --muted: #8A80A0; --accent: #7A5CC7; --input: #EEE9F7; }
:root[data-theme="mint"] { --bg: #F3FAF7; --side: #E2F1EA; --card: #FFFFFF; --line: #CFE6DB; --ink: #1F3A30; --text: #2A4A3E; --muted: #6F8F82; --accent: #2E9E77; --input: #E3F2EB; }
:root[data-theme="night"] { --bg: #141A26; --side: #0F141E; --card: #1C2433; --line: #2A3447; --ink: #E8ECF4; --text: #D2D8E4; --muted: #8E99AD; --accent: #7FB2FF; --input: #222B3B; }
.themes { width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.themes button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 4px; border-radius: 12px; border: 2px solid var(--line); background: var(--card); color: var(--text); font-size: 13px; }
.themes button.on { border-color: var(--accent); }
.themes .sw { width: 34px; height: 34px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .1); }
.prof h4 { align-self: flex-start; margin: 10px 0 0; font-weight: normal; color: var(--muted); font-size: 14px; }
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 17px; }
body { overscroll-behavior: none; }
#app { height: 100dvh; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); }
button { font: inherit; color: inherit; cursor: pointer; }
.grow { flex: 1; }
.pri { background: var(--accent); color: #fff; border: none; border-radius: 12px; padding: 13px; font-size: 18px; }
.link { background: none; border: none; color: var(--muted); padding: 6px; }
.ic { background: none; border: none; width: 40px; height: 40px; border-radius: 50%; font-size: 20px; display: inline-flex; align-items: center; justify-content: center; padding: 0; }
.av { flex: none; width: 42px; height: 42px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; color: #fff; font-size: 18px; background-size: cover; background-position: center; }
.av.sm { width: 30px; height: 30px; font-size: 14px; }
.av.hash { background: var(--side); color: var(--muted); font-size: 22px; }
.av.photo { font-size: 0; }

/* 로그인 */
.gate { margin: auto; width: min(360px, calc(100% - 40px)); display: flex; flex-direction: column; gap: 12px; text-align: center; }
.gate img { width: 76px; height: 76px; border-radius: 18px; margin: 0 auto; }
.gate h1 { margin: 0; font-weight: normal; color: var(--ink); }
.gate p { margin: 0 0 6px; color: var(--muted); line-height: 1.5; }
.gate input { font: inherit; font-size: 17px; padding: 13px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--text); }

.tabs { display: flex; gap: 4px; padding: 3px; border-radius: 12px; background: var(--input); }
.tabs button { flex: 1; border: none; background: none; padding: 9px; border-radius: 10px; color: var(--muted); font-size: 15px; }
.tabs button.on { background: var(--card); color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .08); }
.pri.ghost { background: var(--input); color: var(--ink); width: 100%; }

/* 위 줄 */
.top { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-bottom: 1px solid var(--line); background: var(--bg); min-height: 54px; }
.top b { font-size: 19px; color: var(--ink); font-weight: normal; }
.back { font-size: 34px; margin-left: -6px; }

/* 방 목록 */
.rooms { flex: 1; overflow-y: auto; padding: 6px 0; }
.room { width: 100%; display: flex; align-items: center; gap: 12px; padding: 12px 16px; border: none; background: none; text-align: left; }
.room:active { background: var(--side); }
.rt { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.rt b { font-weight: normal; font-size: 18px; color: var(--ink); }
.rt small { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rr { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; }
.rr small { color: var(--muted); font-size: 12px; }
.badge { font-style: normal; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: #ED4245; color: #fff; font-size: 12px; display: inline-flex; align-items: center; justify-content: center; }

/* 대화 */
.log { flex: 1; overflow-y: auto; padding: 6px 0 12px; -webkit-overflow-scrolling: touch; }
.day { display: flex; align-items: center; margin: 14px 14px 4px; color: var(--muted); font-size: 12px; }
.day::before, .day::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.day span { padding: 0 8px; }
.msg { display: flex; gap: 10px; padding: 3px 14px; margin-top: 10px; -webkit-user-select: text; user-select: text; }
.msg.join { margin-top: 0; }
.msg .gap { width: 42px; flex: none; }
.body { flex: 1; min-width: 0; }
.who { display: flex; align-items: baseline; gap: 6px; }
.who b { font-weight: normal; font-size: 16px; }
.who small { color: var(--muted); font-size: 11px; }
.txt { line-height: 1.45; overflow-wrap: anywhere; font-size: 16.5px; }
.txt a { color: #00A8FC; }
.unread { color: var(--muted); font-size: 11px; }
.img img { display: block; max-width: 78%; max-height: 300px; border-radius: 10px; margin-top: 4px; }
.img .ph { display: inline-block; width: 180px; height: 120px; border-radius: 10px; background: var(--side); color: var(--muted); line-height: 120px; text-align: center; margin-top: 4px; }
.aud { display: flex; align-items: center; gap: 8px; margin-top: 4px; }
.aud audio { height: 36px; width: min(260px, 100%); }
.file { display: inline-flex; gap: 10px; align-items: center; margin-top: 4px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); color: inherit; text-decoration: none; max-width: 100%; }
.file b { display: block; font-weight: normal; color: var(--accent); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file small { color: var(--muted); font-size: 12px; }
.empty { height: 100%; display: flex; align-items: center; justify-content: center; color: var(--muted); }

/* 아래 입력 */
.bar { display: flex; align-items: flex-end; gap: 6px; padding: 8px 10px calc(8px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); background: var(--bg); }
.bar textarea { flex: 1; font: inherit; font-size: 16.5px; border: none; border-radius: 20px; background: var(--input); color: var(--text); padding: 10px 14px; resize: none; max-height: 140px; outline: none; }
.plus { background: var(--input); color: var(--muted); font-size: 24px; }
.send { background: var(--accent); color: #fff; font-size: 17px; }
.recbar { position: fixed; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 10px; padding: 12px 14px; border-radius: 14px; background: var(--card); border: 1px solid #ED4245; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); }
.recbar[hidden] { display: none; }
.recbar button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 8px 14px; }
.recbar .pri { padding: 8px 14px; border: none; }
.dot { width: 10px; height: 10px; border-radius: 50%; background: #ED4245; animation: blink 1s infinite; }
@keyframes blink { 50% { opacity: .25; } }

/* 프로필 */
.prof { margin: 24px auto; width: min(360px, calc(100% - 40px)); display: flex; flex-direction: column; align-items: center; gap: 14px; }
.prof .av { width: 120px; height: 120px; font-size: 48px; }
.prof label.pri { width: 100%; text-align: center; }

#toast { position: fixed; left: 50%; top: calc(14px + env(safe-area-inset-top)); transform: translateX(-50%); max-width: calc(100% - 30px); padding: 10px 16px; border-radius: 12px; background: var(--ink); color: var(--bg); font-size: 15px; z-index: 9; }
#toast[hidden] { display: none; }
.ic[hidden], [hidden] { display: none !important; }

/* 프로필 사진 자리 맞추기(패치 77.5) */
.crop-ov { position: fixed; inset: 0; z-index: 9999; display: flex; align-items: center; justify-content: center; background: rgba(0, 0, 0, .55); padding: 16px; }
.crop-box { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 20px; border-radius: 16px; background: var(--card); color: var(--text); box-shadow: 0 12px 40px rgba(0, 0, 0, .3); max-width: 100%; }
.crop-box b { font-weight: normal; font-size: 18px; color: var(--ink); }
.crop-box small { color: var(--muted); font-size: 12px; text-align: center; }
.crop-view { position: relative; overflow: hidden; border-radius: 12px; background: #000; touch-action: none; cursor: grab; }
.crop-view:active { cursor: grabbing; }
.crop-view canvas { width: 100%; height: 100%; display: block; }
.crop-ring { position: absolute; inset: 0; border-radius: 50%; box-shadow: 0 0 0 999px rgba(0, 0, 0, .5); border: 2px solid rgba(255, 255, 255, .9); pointer-events: none; }
.crop-box input[type=range] { width: 100%; accent-color: var(--accent); }
.crop-btns { display: flex; gap: 8px; width: 100%; }
.crop-btns button { flex: 1; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: transparent; color: inherit; font: inherit; cursor: pointer; }
.crop-btns .ok { background: var(--accent); border-color: var(--accent); color: #fff; }

/* 채널 · 음성 회의(패치 77.6) */
.sec { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px 4px; color: var(--muted); font-size: 13px; }
.ic.sm { width: 30px; height: 30px; font-size: 20px; color: var(--muted); }
.vwho { display: flex; }
.vwho .av { margin-left: -8px; border: 2px solid var(--bg); }
.sheet { width: min(360px, 100%); align-items: stretch; }
.sheet .kind { display: flex; align-items: center; gap: 8px; font-size: 16px; }
.sheet .kind small { color: var(--muted); font-size: 12px; }
.sheet input[type=text] { font: inherit; font-size: 16px; padding: 12px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--text); }
.vgrid { flex: 1; overflow-y: auto; display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; padding: 16px; align-content: start; }
.vgrid .empty { grid-column: 1 / -1; height: 200px; }
.vtile { display: flex; flex-direction: column; align-items: center; gap: 8px; padding: 18px 8px; border-radius: 16px; background: var(--card); border: 1px solid var(--line); }
.vtile b { font-weight: normal; color: var(--ink); }
.vtile small { color: var(--muted); font-size: 12px; min-height: 15px; }
.av.big { width: 76px; height: 76px; font-size: 30px; transition: box-shadow .12s; }
.vtile.talk .av.big { box-shadow: 0 0 0 4px #3BA55C; }
.vbar { display: flex; justify-content: center; gap: 18px; padding: 14px 16px calc(14px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.vjoin { flex: 1; max-width: 360px; }
.vbtn { width: 60px; height: 60px; border-radius: 50%; border: none; font-size: 26px; background: var(--input); }
.vbtn.off { background: #ED4245; }
.vbtn.leave, #vcbar .leave { background: #ED4245; color: #fff; }
#vcbar { position: fixed; left: 10px; right: 10px; bottom: calc(76px + env(safe-area-inset-bottom)); display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-radius: 14px; background: var(--card); border: 1px solid #3BA55C; box-shadow: 0 6px 20px rgba(0, 0, 0, .15); z-index: 5; }
#vcbar b { font-weight: normal; color: var(--ink); }
#vcbar small { color: var(--muted); }
#vcbar button { border: 1px solid var(--line); background: var(--bg); border-radius: 10px; padding: 7px 12px; font-size: 14px; }
#vcbar .leave { border: none; }
.dot.g { background: #3BA55C; }
.vtap { position: fixed; left: 50%; top: 80px; transform: translateX(-50%); z-index: 9; padding: 12px 20px; }

/* 학생 화면(패치 77.8) */
.rooms.stu { padding-bottom: 80px; }
.stabs { position: fixed; left: 0; right: 0; bottom: 0; display: flex; border-top: 1px solid var(--line); background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }
.stabs button { flex: 1; position: relative; border: none; background: none; padding: 8px 0 10px; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 22px; color: var(--muted); }
.stabs button span { font-size: 12px; }
.stabs button.on { color: var(--accent); }
.stabs .badge { position: absolute; top: 4px; left: calc(50% + 8px); }
.wait { margin: 40px auto; width: min(340px, calc(100% - 40px)); display: flex; flex-direction: column; align-items: center; gap: 10px; text-align: center; }
.wait b { font-weight: normal; font-size: 19px; color: var(--ink); }
.wait p { margin: 0 0 6px; color: var(--muted); line-height: 1.55; font-size: 15px; }
.lrow { display: flex; align-items: center; gap: 12px; margin: 6px 14px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.lrow b { font-weight: normal; color: var(--ink); }
.lrow span { color: var(--muted); }
.lrow small { margin-left: auto; font-size: 12px; padding: 3px 8px; border-radius: 8px; background: var(--input); color: var(--muted); }
.lrow.today { border-color: var(--accent); }
.lrow.today small { background: var(--accent); color: #fff; }
.lrow.k-absent, .lrow.k-off { opacity: .55; }
.jv { padding: 12px 16px 30px; }
.jsongs { margin: 4px 0 12px; color: var(--accent); font-size: 15px; }
.js { margin: 0 0 14px; padding: 14px 16px; border-radius: 14px; background: var(--card); border: 1px solid var(--line); }
.js h3 { margin: 0 0 8px; font-weight: normal; font-size: 17px; color: var(--ink); }
.js h4 { margin: 10px 0 4px; font-weight: normal; font-size: 15px; color: var(--accent); }
.js ul { margin: 0; padding: 0; list-style: none; }
.js li { margin: 5px 0; line-height: 1.5; font-size: 15.5px; }
.js li.part { color: var(--muted); font-size: 12.5px; margin-top: 10px; }
.js.cm p { margin: 0; line-height: 1.6; }
.jb { font-style: normal; font-size: 11px; padding: 2px 7px; border-radius: 8px; margin-right: 6px; background: var(--input); color: var(--muted); }
.jb-좋음 { background: #E3F4E6; color: #2E7D3E; }
.jb-문제 { background: #FDE8E6; color: #B23A2E; }
.jb-코칭 { background: #FFF1DC; color: #A86414; }
