:root {
  --ink: #1b2333; --ink-2: #252f44; --ink-text: #c3cbdb; --ink-muted: #8590a6;
  --accent: #3b5bdb; --accent-dark: #2f4ac0; --accent-soft: #edf1ff;
  --bg: #fff; --surface: #f5f6f8; --line: #e3e6eb; --text: #1d2330; --muted: #667085;
  --danger: #d92d20; --warn-bg: #fff6da; --ok: #12b76a;
  --radius: 8px; --shadow: 0 8px 28px rgba(16, 24, 40, .16);
}
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body { font: 14px/1.5 Pretendard, -apple-system, BlinkMacSystemFont, 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans KR', sans-serif; color: var(--text); background: var(--bg); -webkit-text-size-adjust: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; text-align: inherit; }
a { color: var(--accent); }
h1, h2, h3, h4, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; border-radius: 4px; }
.grow { flex: 1; min-width: 0; }
.ic { display: inline-flex; flex: none; }
.empty { color: var(--muted); text-align: center; padding: 28px 12px; }
.muted-text { color: var(--muted); }

/* 버튼 · 입력 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; height: 34px; padding: 0 14px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; font-weight: 600; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--surface); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary:hover { background: var(--accent-dark); }
.btn.danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn.big { height: 44px; width: 100%; font-size: 15px; }
.btn.block { width: 100%; margin-bottom: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.iconbtn { display: inline-flex; align-items: center; justify-content: center; width: 32px; height: 32px; border-radius: 6px; color: var(--muted); flex: none; }
.iconbtn:hover { background: var(--surface); color: var(--text); }
.iconbtn.on { background: var(--accent-soft); color: var(--accent); }
.iconbtn.star.on { background: none; color: #f08c00; }
.iconbtn.star.on svg { fill: #fcc419; }
.iconbtn.dark { width: 24px; height: 24px; color: var(--ink-muted); }
.iconbtn.dark:hover { background: var(--ink-2); color: #fff; }
.iconbtn.dark svg { width: 15px; height: 15px; }
.linkbtn { color: var(--accent); font-weight: 600; text-decoration: none; padding: 2px 4px; border-radius: 4px; }
.linkbtn:hover { text-decoration: underline; }
.linkbtn.danger { color: var(--danger); }
.input, .field input, .field select { width: 100%; height: 38px; padding: 0 11px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.input:focus, .field input:focus, .field select:focus, .side-filter:focus { outline: 2px solid var(--accent); outline-offset: -1px; }
.field { display: block; margin-bottom: 14px; }
.field > span { display: block; font-weight: 600; font-size: 13px; margin-bottom: 5px; }
.check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.check small { color: var(--muted); }
.form-error { color: var(--danger); min-height: 0; font-size: 13px; }
.form-error:not(:empty) { margin-bottom: 10px; }
.actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.actions.left { justify-content: flex-start; }

/* 로그인 */
.auth { min-height: 100dvh; display: grid; place-items: center; padding: 24px 16px; background: var(--ink); }
.auth > p { color: #fff; }
.auth-card { width: min(400px, 100%); background: #fff; border-radius: 14px; padding: 32px 28px; box-shadow: var(--shadow); }
.auth-logo { margin-bottom: 14px; }
.auth-card h1 { font-size: 22px; letter-spacing: -.02em; }
.auth-sub { color: var(--muted); margin: 4px 0 22px; }
.auth-hint { color: var(--muted); font-size: 12.5px; text-align: center; margin-top: 14px; }
.field input { height: 42px; }

/* 전체 구성 */
#app { display: flex; height: 100dvh; overflow: hidden; }
.sidebar { width: 264px; flex: none; background: var(--ink); color: var(--ink-text); display: flex; flex-direction: column; }
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; position: relative; }
.panel { width: 380px; flex: none; border-left: 1px solid var(--line); display: flex; flex-direction: column; background: #fff; }
.scrim { display: none; }

/* 왼쪽 목록 */
.team { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px; height: 56px; color: #fff; font-size: 16px; flex: none; border-bottom: 1px solid var(--ink-2); }
.team strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.01em; }
.team:hover { background: var(--ink-2); }
.side-filter-wrap { padding: 12px 12px 4px; }
.side-filter { width: 100%; height: 32px; border: 0; border-radius: 6px; padding: 0 10px; background: var(--ink-2); color: #fff; }
.side-filter::placeholder { color: var(--ink-muted); }
.side-scroll { flex: 1; overflow-y: auto; padding: 4px 8px 12px; }
.side-title { display: flex; align-items: center; justify-content: space-between; height: 32px; padding: 0 8px; margin-top: 10px; font-size: 12px; font-weight: 700; color: var(--ink-muted); letter-spacing: .02em; }
.side-actions { display: flex; gap: 2px; }
.side-empty { padding: 4px 8px; font-size: 13px; color: var(--ink-muted); }
.room { display: flex; align-items: center; gap: 8px; width: 100%; height: 32px; padding: 0 8px; border-radius: 6px; color: var(--ink-text); }
.room:hover { background: var(--ink-2); }
.room.active { background: var(--accent); color: #fff; }
.room.unread { color: #fff; font-weight: 700; }
.room-ic svg { width: 15px; height: 15px; opacity: .8; }
.room-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.room .muted svg { width: 13px; height: 13px; opacity: .6; }
.badge { min-width: 20px; height: 18px; padding: 0 6px; border-radius: 9px; background: #e8590c; color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.badge.mention { background: var(--danger); }
.me-bar { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--ink-2); flex: none; }
.me-bar:hover { background: var(--ink-2); }
.me-text { min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.me-text strong { color: #fff; }
.me-text small { color: var(--ink-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { position: relative; display: inline-flex; align-items: center; justify-content: center; border-radius: 30%; color: #fff; font-weight: 700; flex: none; user-select: none; line-height: 1; }
.avatar .dot { position: absolute; right: -2px; bottom: -2px; width: 9px; height: 9px; border-radius: 50%; background: #98a2b3; box-shadow: 0 0 0 2px #fff; }
.sidebar .avatar .dot { box-shadow: 0 0 0 2px var(--ink); }
.avatar .dot.on { background: var(--ok); }

/* 머리줄 */
.header { display: flex; align-items: center; gap: 8px; min-height: 56px; padding: 6px 12px 6px 18px; border-bottom: 1px solid var(--line); flex: none; }
.nav-toggle { display: none; }
.head-title { flex: 1; min-width: 0; }
.head-name { display: flex; align-items: center; gap: 6px; }
.head-name h1 { font-size: 16px; letter-spacing: -.01em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-name > .ic { color: var(--muted); }
.head-name .iconbtn { width: 26px; height: 26px; }
.head-sub { font-size: 12.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.head-tools { display: flex; gap: 2px; flex: none; }
.notice-bar { display: flex; align-items: center; gap: 8px; padding: 7px 12px 7px 18px; background: var(--warn-bg); border-bottom: 1px solid #f1e3b0; font-size: 13px; }
.notice-bar > .ic { color: #b7791f; }
.notice-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.notice-text:hover { text-decoration: underline; }
.notice-bar small { color: var(--muted); white-space: nowrap; }

/* 메시지 */
.messages { flex: 1; overflow-y: auto; padding: 8px 0 12px; overflow-anchor: none; }
.room-start { padding: 24px 20px 8px; }
.room-start strong { font-size: 20px; letter-spacing: -.02em; }
.room-start p { color: var(--muted); }
.day, .new-line { display: flex; align-items: center; gap: 12px; margin: 14px 20px 6px; color: var(--muted); font-size: 12px; font-weight: 600; }
.day::before, .day::after, .new-line::before, .new-line::after { content: ''; flex: 1; height: 1px; background: var(--line); }
.new-line { color: var(--danger); }
.new-line::before, .new-line::after { background: #f3b4ae; }
.sys { text-align: center; color: var(--muted); font-size: 12.5px; padding: 4px 20px; }
.sys time { margin-left: 6px; font-size: 11px; opacity: .8; }
.msg { position: relative; display: flex; gap: 10px; padding: 6px 20px 2px; }
.msg.compact { padding-top: 1px; }
.msg:hover, .msg:focus-within { background: #f8f9fb; }
.msg.to-me { background: #fffbea; }
.msg.hl { animation: hl 2.4s ease-out; }
@keyframes hl { 0%, 60% { background: #fff1c2; } 100% { background: transparent; } }
.gutter { width: 36px; flex: none; text-align: right; }
.hover-time { font-size: 10.5px; color: var(--muted); visibility: hidden; line-height: 21px; }
.msg:hover .hover-time { visibility: visible; }
.msg-main { flex: 1; min-width: 0; }
.meta { display: flex; align-items: baseline; gap: 6px; line-height: 1.3; }
.meta .name { font-weight: 700; }
.meta .name:hover { text-decoration: underline; }
.meta .pos, .meta time { font-size: 12px; color: var(--muted); }
.unread-n { font-size: 11px; font-weight: 700; color: #e8590c; }
.unread-n.side { position: absolute; right: 20px; bottom: 3px; }
.text { white-space: pre-wrap; overflow-wrap: anywhere; }
.edited { color: var(--muted); font-size: 11.5px; }
.mention { color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 0 3px; font-weight: 600; }
.mention.me { background: #ffe8a3; color: #7a4d00; }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin: 4px 0 2px; }
.rx { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; font-size: 13px; }
.rx b { font-size: 12px; color: var(--muted); }
.rx.mine { border-color: var(--accent); background: var(--accent-soft); }
.rx.mine b { color: var(--accent); }
.replies { display: inline-flex; align-items: center; gap: 5px; margin: 3px 0; color: var(--accent); font-weight: 600; font-size: 13px; }
.replies svg { width: 15px; height: 15px; }
.replies:hover { text-decoration: underline; }
.msg-actions { position: absolute; right: 16px; top: -14px; display: none; background: #fff; border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 2px 8px rgba(16, 24, 40, .08); padding: 2px; z-index: 2; }
.msg:hover .msg-actions, .msg:focus-within .msg-actions { display: flex; }
.msg-actions .iconbtn { width: 28px; height: 28px; }
.edit-area { width: 100%; border: 1px solid var(--accent); border-radius: var(--radius); padding: 8px 10px; resize: vertical; }
.edit .actions { margin-top: 6px; }

.file-image { margin: 4px 0; }
.thumb { display: block; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); max-width: min(360px, 100%); }
.thumb img { display: block; max-width: 100%; max-height: 280px; }
.file-meta { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--muted); max-width: 360px; }
.file-meta span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-meta .iconbtn { width: 24px; height: 24px; }
.file-card { display: flex; align-items: center; gap: 12px; width: min(380px, 100%); margin: 4px 0; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; color: var(--text); text-decoration: none; }
.file-card:hover { border-color: var(--accent); }
.file-card strong, .file-card small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-card small { color: var(--muted); }
.file-card .ic { color: var(--muted); }
.file-ext { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 8px; background: var(--accent-soft); color: var(--accent); font-size: 11px; font-weight: 800; flex: none; }
.file-ext.small { width: 36px; height: 36px; font-size: 10px; }
.lightbox { position: fixed; inset: 0; z-index: 60; background: rgba(10, 14, 22, .88); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 24px; }
.lightbox img { max-width: 100%; max-height: calc(100% - 60px); border-radius: 6px; }

.card { width: min(400px, 100%); margin: 4px 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.card-kind { display: flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.card-kind svg { width: 14px; height: 14px; }
.card-kind em { font-style: normal; font-weight: 600; color: var(--muted); background: var(--surface); border-radius: 4px; padding: 0 6px; }
.card-kind em.end { color: var(--danger); background: #fdecea; }
.card-title { display: block; font-size: 15px; overflow-wrap: anywhere; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; color: var(--muted); }
.poll .card-title { margin-bottom: 8px; }
.poll-opt { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 10px; width: 100%; min-height: 36px; margin-top: 6px; padding: 6px 12px; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: #fff; }
.poll-opt:hover:not(:disabled) { border-color: var(--accent); }
.poll-opt:disabled { cursor: default; }
.poll-opt .bar { position: absolute; inset: 0 auto 0 0; background: var(--surface); }
.poll-opt.mine { border-color: var(--accent); font-weight: 700; }
.poll-opt.mine .bar { background: var(--accent-soft); }
.poll-opt span, .poll-opt b { position: relative; }
.poll-text { overflow-wrap: anywhere; }
.poll-opt b { font-size: 12px; color: var(--muted); white-space: nowrap; }
.todo-line { display: flex; align-items: flex-start; gap: 10px; cursor: pointer; }
.todo-line input, .todo-row input { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--accent); flex: none; }
.todo.done .card-title, .todo-row.done strong { text-decoration: line-through; color: var(--muted); }
.due { font-size: 12px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.due.over { color: var(--danger); }

#jump { position: relative; height: 0; }
.jump-btn { position: absolute; right: 20px; bottom: 10px; display: inline-flex; align-items: center; gap: 4px; height: 32px; padding: 0 12px 0 8px; border-radius: 16px; background: var(--text); color: #fff; font-size: 12.5px; font-weight: 600; box-shadow: var(--shadow); z-index: 3; }

/* 입력창 */
.composer { position: relative; padding: 0 20px 16px; flex: none; }
.compose-box { border: 1px solid #cfd4dc; border-radius: 10px; background: #fff; }
.compose-box:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.compose-box textarea { display: block; width: 100%; border: 0; outline: 0; resize: none; padding: 10px 12px 4px; background: transparent; max-height: 180px; }
.compose-tools { display: flex; align-items: center; gap: 2px; padding: 4px 6px 6px; }
.hint { color: #98a2b3; font-size: 11.5px; margin-right: 8px; white-space: nowrap; }
.btn.send { width: 36px; height: 30px; padding: 0; }
.mention-pop { position: absolute; left: 20px; bottom: calc(100% - 4px); width: min(280px, calc(100% - 40px)); background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 4px; z-index: 5; }
.mention-pop button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 5px 8px; border-radius: 6px; }
.mention-pop button.sel, .mention-pop button:hover { background: var(--accent-soft); }
.mention-pop small { color: var(--muted); margin-left: auto; }
.all-ic { width: 22px; height: 22px; border-radius: 30%; background: var(--text); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 12px; }
.main.dropping::after { content: '여기에 놓으면 파일을 올립니다'; position: absolute; inset: 8px; border: 2px dashed var(--accent); border-radius: 12px; background: rgba(237, 241, 255, .92); display: grid; place-items: center; font-size: 17px; font-weight: 700; color: var(--accent); z-index: 10; pointer-events: none; }

/* 오른쪽 패널 */
.panel-head { display: flex; align-items: center; justify-content: space-between; height: 56px; padding: 0 10px 0 16px; border-bottom: 1px solid var(--line); flex: none; }
.panel-head h2 { font-size: 15px; }
.panel-body { flex: 1; overflow-y: auto; padding: 12px; min-height: 0; }
.panel-body.thread { display: flex; flex-direction: column; padding: 0; overflow: hidden; }
.thread-list { flex: 1; overflow-y: auto; padding: 8px 0; }
.thread .msg { padding-left: 14px; padding-right: 14px; }
.thread .composer { padding: 0 12px 12px; }
.thread .hint { display: none; }
.filters { display: grid; gap: 8px; margin-bottom: 10px; }
.filters .row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.filters .input { height: 34px; }
.count { font-size: 12px; font-weight: 700; color: var(--muted); margin: 10px 2px 6px; }
.result { display: block; width: 100%; padding: 10px; border: 1px solid var(--line); border-radius: var(--radius); margin-bottom: 8px; }
.result:hover { border-color: var(--accent); background: #fafbff; }
.result-top { display: flex; align-items: center; gap: 6px; }
.result-top time { margin-left: auto; font-size: 12px; color: var(--muted); }
.result p { margin: 4px 0 2px; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; white-space: pre-wrap; }
.result small { color: var(--muted); }
.file-row, .todo-row, .list-row { display: flex; align-items: center; gap: 10px; padding: 8px 6px; border-bottom: 1px solid var(--line); width: 100%; }
.todo-row { align-items: flex-start; }
.file-row-main strong, .file-row-main small, .list-row strong, .list-row small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-row-main small, .list-row small { color: var(--muted); font-size: 12.5px; }
.file-row-main:hover strong { text-decoration: underline; }
.mini { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; flex: none; background: var(--surface); }
.list-row.click:hover { background: var(--surface); }
.list-row.bad { color: var(--danger); }
.list-row > .ic { color: var(--muted); }

/* 창 · 팝업 */
#layer { position: relative; z-index: 50; }
.overlay { position: fixed; inset: 0; background: rgba(16, 24, 40, .5); display: flex; align-items: flex-start; justify-content: center; padding: 8vh 16px 16px; overflow-y: auto; z-index: 50; }
.modal { width: min(460px, 100%); background: #fff; border-radius: 12px; box-shadow: var(--shadow); }
.modal.wide { width: min(920px, 100%); }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 12px 10px 20px; }
.modal-head h2 { font-size: 17px; letter-spacing: -.01em; }
.modal-body { padding: 4px 20px 20px; }
.modal-body h4 { margin: 20px 0 10px; padding-top: 16px; border-top: 1px solid var(--line); font-size: 14px; }
.confirm-text { margin-bottom: 14px; white-space: pre-wrap; }
.popover { position: fixed; z-index: 70; background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: var(--shadow); }
.menu { padding: 4px; min-width: 170px; }
.menu button { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border-radius: 6px; }
.menu button:hover { background: var(--surface); }
.menu button.danger { color: var(--danger); }
.menu .ic { color: var(--muted); }
.menu .ic svg { width: 16px; height: 16px; }
.menu hr { border: 0; border-top: 1px solid var(--line); margin: 4px 0; }
.emoji-grid { display: grid; grid-template-columns: repeat(8, 34px); padding: 6px; }
.emoji-grid button { height: 34px; border-radius: 6px; font-size: 19px; text-align: center; }
.emoji-grid button:hover { background: var(--surface); }
.toast { position: fixed; left: 50%; bottom: 28px; transform: translateX(-50%); max-width: calc(100vw - 32px); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); z-index: 90; }
.toast.error { background: var(--danger); }
.list { max-height: 50vh; overflow-y: auto; }
.pick-list { max-height: 220px; overflow-y: auto; margin-top: 8px; border: 1px solid var(--line); border-radius: var(--radius); }
.pick { display: flex; align-items: center; gap: 8px; padding: 6px 10px; cursor: pointer; }
.pick:hover { background: var(--surface); }
.pick small { color: var(--muted); margin-left: auto; }
.opt-list { display: grid; gap: 6px; margin-bottom: 6px; }
.modal .list + .input, .modal .input + .list { margin-top: 10px; }

.profile-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.profile-head h3 { font-size: 19px; }
.profile-head p { color: var(--muted); }
.profile-head .status { color: var(--text); }
.tag { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 2px 6px; vertical-align: middle; }
.info { display: grid; grid-template-columns: 64px 1fr; gap: 6px 10px; margin: 0; }
.info dt { color: var(--muted); }
.info dd { margin: 0; overflow-wrap: anywhere; }
.org { max-height: 60vh; overflow-y: auto; margin-top: 10px; }
.org h4 { border: 0; margin: 14px 0 2px; padding: 0; }
.org h4 small { color: var(--muted); font-weight: 400; }
.temp-pw { display: flex; align-items: center; gap: 10px; padding: 12px; background: var(--surface); border-radius: var(--radius); }
.temp-pw code { flex: 1; font-size: 18px; font-weight: 700; letter-spacing: .04em; user-select: all; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 14px; overflow-x: auto; }
.tabs button { padding: 8px 12px; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs button.on { color: var(--accent); border-color: var(--accent); }
.admin-body { min-height: 300px; }
.admin-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; color: var(--muted); }
.admin-note { color: var(--muted); font-size: 13px; margin-bottom: 10px; }
.table-wrap { overflow-x: auto; max-height: 56vh; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); }
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td { padding: 8px 10px; text-align: left; border-bottom: 1px solid var(--line); white-space: nowrap; }
.table th { position: sticky; top: 0; background: var(--surface); font-size: 12px; color: var(--muted); }
.table tr.off td { color: #98a2b3; }
.cell-user { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; }
.cell-actions { text-align: right !important; }
.narrow { max-width: 360px; }

/* 좁은 화면 */
@media (max-width: 1100px) { .panel { position: absolute; right: 0; top: 0; bottom: 0; z-index: 20; box-shadow: var(--shadow); } #app { position: relative; } }
@media (max-width: 760px) {
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 30; width: min(300px, 86vw); transform: translateX(-100%); transition: transform .18s ease; }
  .nav-open .sidebar { transform: none; }
  .nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(16, 24, 40, .5); z-index: 25; }
  .nav-toggle { display: inline-flex; }
  .header { padding-left: 8px; flex-wrap: wrap; }
  .head-tools { width: 100%; justify-content: space-between; }
  .panel { position: fixed; inset: 0; width: auto; }
  .msg, .day, .new-line { padding-left: 12px; padding-right: 12px; margin-left: 0; margin-right: 0; }
  .day, .new-line { padding: 0 12px; }
  .composer { padding: 0 10px calc(10px + env(safe-area-inset-bottom)); }
  .hint { display: none; }
  .msg-actions { display: flex; position: static; border: 0; box-shadow: none; background: none; align-self: flex-start; }
  .msg-actions .iconbtn:not(:last-child) { display: none; }
  .room, .side-title { height: 40px; }
  .overlay { padding-top: 16px; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
