/* 케이원 브랜드 테마 (k1sports.kr — 블루 #0088ff / 네이비 #0a1931) */
:root {
  --bg-sidebar: #0a1931;
  --bg-sidebar-hover: #142844;
  --bg-sidebar-active: #1b3252;
  --bg-chat: #1e293b;
  --bg-input: #16202e;
  --bg-modal: #1c2a3f;
  --border: #31435e;
  --text: #e8eaed;
  --text-muted: #8da2bb;
  --accent: #0088ff;
  --accent-dark: #006fd6;
  --danger: #e5534b;
  --badge: #e5534b;
  --bubble-notice: #28344a;
  --bubble: #232f44;
  --bubble-mine: #16365c;
}
/* 라이트 테마 (기본) */
body[data-theme="light"] {
  --bg-sidebar: #f7f8fa;
  --bg-sidebar-hover: #eceef2;
  --bg-sidebar-active: #e1e6ee;
  --bg-chat: #ffffff;
  --bg-input: #eef0f4;
  --bg-modal: #ffffff;
  --border: #e2e5ea;
  --text: #1a1d21;
  --text-muted: #8a909a;
  --accent: #0088ff;
  --accent-dark: #006fd6;
  --bubble: #f1f3f5;
  --bubble-mine: #dcebff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: "Pretendard", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
  background: var(--bg-chat);
  color: var(--text);
  overflow: hidden;
  touch-action: manipulation;          /* 더블탭 확대 방지 */
  -webkit-text-size-adjust: 100%;
}
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
.muted { color: var(--text-muted); font-size: 12px; }
.spacer { flex: 1; }
[hidden] { display: none !important; }

/* ---------- 로그인 ---------- */
#login-view {
  height: 100%; display: flex; align-items: center; justify-content: center;
  background: var(--bg-sidebar);
}
.login-box {
  width: 320px; padding: 36px 28px; background: var(--bg-modal);
  border-radius: 14px; text-align: center; box-shadow: 0 8px 30px rgba(0,0,0,.4);
}
.login-logo { width: 64px; height: 64px; border-radius: 16px; margin-bottom: 12px; }
.login-box h1 { font-size: 19px; margin-bottom: 22px; }
.login-box input {
  width: 100%; padding: 12px 14px; margin-bottom: 10px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 14px;
}
.login-box input:focus { outline: none; border-color: var(--accent); }
.login-box button {
  width: 100%; padding: 12px; background: var(--accent); border: none;
  border-radius: 8px; color: #fff; font-size: 15px; font-weight: 700;
}
.login-box button:hover { background: var(--accent-dark); }
.login-error { color: var(--danger); font-size: 13px; margin-top: 10px; min-height: 16px; }
.install-link {
  margin-top: 16px; width: 100%; background: none; border: 1px dashed var(--border);
  color: var(--text-muted); font-size: 13px; padding: 11px; border-radius: 8px;
}
.install-link:hover { border-color: var(--accent); color: var(--text); }

/* 설치 안내 모달 */
.install-box {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
  padding: 16px; margin-bottom: 16px;
}
.install-steps { margin: 0 0 0 18px; line-height: 2; font-size: 14px; }
.install-steps .ic, .install-box .ic { font-size: 16px; }
.install-share { display: flex; gap: 16px; align-items: center; }
.install-qr {
  width: 120px; height: 120px; border-radius: 10px; background: #fff; padding: 6px; flex: none;
}
.install-share-info { display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.install-url {
  font-size: 15px; font-weight: 700; color: var(--accent); word-break: break-all;
}
.install-now { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .82; } }
.install-qr-pair { display: flex; gap: 16px; }
.install-qr-pair figure { margin: 0; text-align: center; }
.install-qr-pair figcaption { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
@media (max-width: 480px) {
  .install-share { flex-direction: column; align-items: flex-start; }
  .install-qr { width: 150px; height: 150px; }
}

/* ---------- 레이아웃 ---------- */
#app-view { display: flex; height: 100%; height: 100dvh; }
#sidebar {
  width: 250px; min-width: 250px; background: var(--bg-sidebar);
  display: flex; flex-direction: column; border-right: 1px solid #000;
  /* 길게 누르기(드래그/메뉴)와 글자 선택 충돌 방지 — 채팅 내용은 복사 가능하게 유지 */
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
}
#sidebar input { -webkit-user-select: text; user-select: text; }
.msg-content, .msg-quote, #chat-title {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default;
}
/* 터치 기기: 메시지 길게누르기는 액션 바텀시트 전용 — iOS 네이티브 콜아웃(복사·번역·웹검색)·텍스트선택 억제 (복사는 시트의 '복사'로) */
@media (hover: none) {
  .msg-group, .msg-content, .msg-quote, .msg-group a, .msg-image, .file-card {
    -webkit-touch-callout: none; -webkit-user-select: none; user-select: none;
  }
}
#chat { flex: 1; display: flex; flex-direction: column; min-width: 0; }

/* ---------- 사이드바 ---------- */
.ws-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; font-size: 16px; font-weight: 800;
  border-bottom: 1px solid var(--border);
}
.ws-header span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ws-logo { width: 26px; height: 26px; border-radius: 7px; flex: none; }
#sidebar-scroll { flex: 1; overflow-y: auto; padding: 8px 0 16px; }
.section { margin-top: 10px; }
.section-header {
  display: flex; align-items: center; padding: 4px 16px 6px;
  font-size: 12px; font-weight: 700; color: var(--text-muted); letter-spacing: .5px;
}
.section-header span { flex: 1; }

.cat-name {
  padding: 8px 16px 3px; font-size: 12px; font-weight: 700; color: var(--text-muted);
  cursor: pointer; user-select: none;
}
.cat-name:hover { color: var(--text); }

.topic-item, .dm-item {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 16px 6px 22px; font-size: 14px; color: var(--text-muted);
  cursor: pointer; user-select: none;
}
.t-count { font-size: 11px; color: var(--text-muted); opacity: .7; flex: none; }
.topic-item.active .t-count { opacity: .9; }
/* 즐겨찾기 별표 — 평소 숨김, 마우스오버 시 투명별, 즐겨찾기는 금색 고정 (잔디식) */
.t-star { background: none; border: none; cursor: pointer; flex: none; padding: 1px 3px; font-size: 14px; line-height: 1; color: var(--text-muted); opacity: 0; transition: opacity .12s, transform .12s; }
.topic-item:hover .t-star, .dm-item:hover .t-star { opacity: .45; }
.t-star:hover { opacity: 1 !important; color: #f5b301; transform: scale(1.15); }
.t-star.on { opacity: 1; color: #f5b301; }
.fav-cat { color: #f5b301 !important; }
@media (hover: none) { .t-star { opacity: .3; } .t-star.on { opacity: 1; } }
.topic-item:hover, .dm-item:hover { background: var(--bg-sidebar-hover); }
.topic-item.active, .dm-item.active { background: var(--bg-sidebar-active); color: var(--text); font-weight: 600; }
.topic-item .t-icon { width: 14px; text-align: center; font-size: 12px; color: var(--text-muted); flex: none; }
.topic-item .t-name, .dm-item .t-name {
  flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--text);
}
.topic-item.has-unread .t-name, .dm-item.has-unread .t-name { color: var(--text); font-weight: 700; }
.badge {
  background: #ff3b30; color: #fff; font-size: 12px; font-weight: 800;
  border-radius: 11px; padding: 2px 8px; min-width: 22px; text-align: center;
  flex: none; box-shadow: 0 0 0 1px rgba(255, 59, 48, .35);
}
.t-mute { font-size: 10px; opacity: .65; flex: none; }
.dm-self { border-bottom: 1px solid var(--border); }
.dm-self-icon { font-size: 13px; width: 9px; text-align: center; flex: none; color: var(--accent); }

/* 토픽 드래그 정렬 */
.topic-item { -webkit-touch-callout: none; }
.drag-ghost {
  position: fixed; z-index: 400; pointer-events: none;
  background: var(--bg-sidebar-active); border-radius: 8px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5); opacity: .95;
}
.drag-source { opacity: .35; }
.drop-line { height: 2px; background: var(--accent); margin: 1px 14px; border-radius: 1px; }
.badge.b-muted { background: #5a6678; box-shadow: none; }

.online-dot {
  width: 9px; height: 9px; border-radius: 50%; background: #555a61; flex: none;
}
.online-dot.on { background: var(--accent); }

#sidebar-footer {
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px; border-top: 1px solid #142340;
}
.me-avatar, .msg-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700; color: #fff; flex: none;
}
.me-info { flex: 1; min-width: 0; }
#me-name { font-size: 13px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.icon-btn {
  background: none; border: none; color: var(--text-muted);
  font-size: 16px; padding: 4px 6px; border-radius: 6px; line-height: 1;
}
.icon-btn:hover { background: var(--bg-sidebar-hover); color: var(--text); }

/* ---------- 채팅 ---------- */
#chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; padding: 20px; }
.empty-inner { text-align: center; color: var(--text-muted); font-size: 15px; line-height: 2.2; }
.empty-card { width: 100%; max-width: 340px; text-align: center; }
.empty-logo { width: 56px; height: 56px; border-radius: 14px; opacity: .95; }
.empty-greet { font-size: 18px; line-height: 1.5; margin: 14px 0 4px; color: var(--text); }
.empty-greet b { color: var(--accent); }
.empty-unread-h { margin: 18px 0 8px; font-size: 14px; color: var(--text-muted); }
.empty-unread-h b { color: var(--danger); font-size: 16px; }
.empty-allread { margin: 20px 0; color: var(--text-muted); font-size: 14px; }
.empty-list { display: flex; flex-direction: column; gap: 6px; }
.empty-topic {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 10px 12px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); font-size: 14px; text-align: left;
}
.empty-topic:hover { border-color: var(--accent); background: var(--bg-sidebar-hover); }
.empty-topic .et-icon { flex: none; font-size: 13px; width: 16px; text-align: center; }
.empty-topic .et-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.empty-more { margin-top: 6px; font-size: 12px; }
.empty-actions { display: flex; gap: 8px; justify-content: center; margin: 20px 0 10px; }
.empty-btn {
  padding: 10px 16px; background: var(--accent); color: #fff; border: none;
  border-radius: 10px; font-size: 14px; font-weight: 600;
}
.empty-btn:hover { background: var(--accent-dark); }
.empty-btn:last-child { background: var(--bg-input); color: var(--text); border: 1px solid var(--border); }
.empty-btn:last-child:hover { border-color: var(--accent); }
.empty-hint { font-size: 12px; }

#chat-room { flex: 1; display: flex; flex-direction: column; min-height: 0; }
#chat-header {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-bottom: 1px solid var(--border);
  font-size: 15px; font-weight: 700; flex: none;
}
#chat-icon { color: var(--text-muted); font-size: 13px; }
#chat-members { font-weight: 400; }
#chat-members.clickable-count { cursor: pointer; text-decoration: underline; text-decoration-style: dotted; text-underline-offset: 3px; }
#chat-members.clickable-count:hover { color: var(--accent); }

#messages { flex: 1; overflow-y: auto; padding: 14px 18px 40px; }

.date-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0 10px; color: var(--text-muted); font-size: 12px;
}
.date-divider::before, .date-divider::after {
  content: ""; flex: 1; height: 1px; background: var(--border);
}

.msg-group { display: flex; gap: 10px; margin-top: 14px; }
.msg-group.cont { margin-top: 2px; }
.msg-group.cont .msg-avatar, .msg-group.cont .msg-head { display: none; }
.msg-group.cont .msg-body { margin-left: 44px; }
.msg-body { min-width: 0; flex: 1; }
.msg-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 3px; }
.msg-name { font-size: 14px; font-weight: 700; color: var(--text); }
.msg-title {
  font-size: 10px; color: #8da2bb; background: var(--bg-input);
  border: 1px solid var(--border); border-radius: 7px; padding: 1px 6px; flex: none;
}
.msg-time { font-size: 11px; color: var(--text-muted); }
.msg-line { display: flex; align-items: flex-end; gap: 8px; }
.msg-main { min-width: 0; position: relative; }
.msg-side { display: flex; align-items: center; gap: 6px; flex: none; }
.msg-group.highlight { background: rgba(0, 136, 255, .12); border-radius: 8px; transition: background .3s; }

/* 답장 인용 */
.msg-quote {
  font-size: 12px; color: var(--text-muted); cursor: pointer;
  border-left: 2px solid var(--accent); padding: 2px 8px; margin-bottom: 3px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 480px;
}
.msg-quote:hover { color: var(--text); }
.msg-quote b { color: #6fb3ff; }

/* 안읽음 숫자 */
.msg-unread {
  background: none; border: none; color: var(--accent);
  font-size: 11px; font-weight: 800; padding: 2px 4px; cursor: default;
}
.msg-unread.clickable { cursor: pointer; }
.msg-unread.clickable:hover { text-decoration: underline; }

/* 반응 칩 */
.msg-reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 6px; }
.react-chip {
  background: var(--bg-chat); border: 1px solid var(--border); border-radius: 12px;
  color: var(--text); font-size: 12px; padding: 2px 9px; cursor: pointer;
}
.react-chip:hover { border-color: var(--accent); }
.react-chip.mine { background: rgba(0, 136, 255, .18); border-color: var(--accent); }

/* 메시지 액션 툴바 — 가로 공간을 차지하지 않도록 메시지 하단에 떠오르는 방식(PC 호버) */
/* 버블에 7px 겹쳐 띄워 버블↔툴바 사이 빈틈을 없애고(hover 끊김 방지), 숨김에 유예시간을 둬 버튼으로 이동 가능 */
.msg-actions {
  position: absolute; top: calc(100% - 7px); left: 0; z-index: 6;
  display: flex; gap: 1px; padding: 3px 5px;
  background: var(--bg-modal); border: 1px solid var(--border);
  border-radius: 18px; box-shadow: 0 4px 14px rgba(0,0,0,.28);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity .12s ease .2s, visibility 0s linear .32s;
}
@media (hover: hover) {
  .msg-group:hover .msg-actions { opacity: 1; visibility: visible; pointer-events: auto; transition-delay: 0s; }
}
.msg-actions button {
  background: none; border: none; color: var(--text-muted);
  font-size: 15px; line-height: 1; padding: 5px 7px; border-radius: 50%; cursor: pointer;
}
.msg-actions button:hover { background: var(--bg-sidebar-hover); color: var(--text); }
/* 터치 기기: 호버 툴바 숨기고, 메시지를 길게 눌러 바텀시트로 */
@media (hover: none) {
  .msg-actions { display: none; }
}

/* 답장 입력 바 */
#reply-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 0 18px 6px; padding: 7px 12px;
  background: var(--bg-input); border-left: 3px solid var(--accent);
  border-radius: 8px; font-size: 12px; color: var(--text-muted); flex: none;
}
#reply-bar-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#reply-bar b { color: #6fb3ff; }

/* 반응 선택창 */
#react-picker {
  position: fixed; z-index: 300; display: flex; gap: 2px;
  background: var(--bg-modal); border: 1px solid var(--border); border-radius: 22px;
  padding: 5px 8px; box-shadow: 0 6px 20px rgba(0,0,0,.45);
}
#react-picker button {
  background: none; border: none; font-size: 19px; padding: 3px 6px;
  border-radius: 50%; cursor: pointer;
}
#react-picker button:hover { background: var(--bg-sidebar-hover); transform: scale(1.18); }
.msg-content {
  font-size: 14px; line-height: 1.55; white-space: pre-wrap; word-break: break-word;
  max-width: 720px;
  background: var(--bubble); padding: 8px 12px; border-radius: 4px 14px 14px 14px;
  display: inline-block;
}
/* 내가 보낸 메시지 말풍선 강조 */
.msg-group.mine .msg-content { background: var(--bubble-mine); }
/* 이미지·파일은 말풍선 배경 없이 */
.msg-content:has(.msg-image), .msg-content:has(.file-card), .msg-content:has(.msg-album) { background: none; padding: 0; }
.msg-content a { color: var(--accent); }
.msg-content img.msg-image {
  max-width: min(360px, 80%); max-height: 300px; border-radius: 8px;
  display: block; margin-top: 4px; cursor: pointer;
}
.file-card {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 4px;
  padding: 10px 14px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 10px; color: var(--text); text-decoration: none; font-size: 13px;
}
.file-card:hover { border-color: var(--accent); }
.msg-actions .msg-del:hover { color: var(--danger); }

/* ---------- 서식 툴바 ---------- */
#format-bar {
  display: flex; gap: 2px; margin: 0 18px 4px; flex: none;
}
#format-bar button {
  background: none; border: none; color: var(--text-muted);
  width: 30px; height: 28px; border-radius: 6px; font-size: 14px; cursor: pointer;
}
#format-bar button:hover { background: var(--bg-input); color: var(--text); }
#format-bar .fmt-mention { color: var(--accent); font-weight: 800; font-size: 16px; }
#format-bar .fmt-mention:hover { background: rgba(0,136,255,.15); }
.fmt-sep { width: 1px; align-self: center; height: 16px; background: var(--border); margin: 0 4px; }

/* 멘션 (메시지 본문) */
.mention {
  color: #6fb3ff; background: rgba(0,136,255,.12);
  border-radius: 4px; padding: 0 3px; font-weight: 600;
}
.mention-me { color: #fff; background: var(--accent); }
.msg-content code {
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 5px; font-size: 13px;
  font-family: "Consolas", monospace;
}

/* 멘션 자동완성 */
#mention-list {
  position: fixed; z-index: 250; max-height: 220px; overflow-y: auto;
  background: var(--bg-modal); border: 1px solid var(--border); border-radius: 10px;
  box-shadow: 0 6px 24px rgba(0,0,0,.45); padding: 4px;
}
.mention-item {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 7px; font-size: 14px; cursor: pointer;
}
.mention-item.active, .mention-item:hover { background: var(--bg-sidebar-hover); }
.mention-ava {
  width: 24px; height: 24px; border-radius: 50%; flex: none;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; color: #fff;
}

/* ---------- 입력창 ---------- */
#composer {
  display: flex; align-items: flex-end; gap: 8px;
  margin: 0 18px; padding: 8px 10px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 12px;
}
#composer:focus-within { border-color: var(--accent); }
#msg-input {
  flex: 1; min-width: 0; background: none; border: none;
  color: var(--text); font-size: 14px; line-height: 1.5;
  max-height: 140px; overflow-y: auto;
  padding: 6px 2px; white-space: pre-wrap; word-break: break-word;
}
#msg-input:focus { outline: none; }
#msg-input:empty:before {
  content: attr(data-ph); color: var(--text-muted); pointer-events: none;
}
#msg-input b, #msg-input strong { font-weight: 800; }
#msg-input u { text-decoration: underline; }
#msg-input s { text-decoration: line-through; }
#btn-send {
  background: var(--accent); border: none; color: #fff;
  width: 34px; height: 34px; border-radius: 8px; font-size: 15px; flex: none;
}
#btn-send:hover { background: var(--accent-dark); }
.composer-hint { padding: 5px 22px 10px; flex: none; }

/* ---------- 모달 ---------- */
#modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.55);
  display: flex; align-items: center; justify-content: center; z-index: 100;
}
#modal {
  width: min(560px, 94vw); max-height: 86vh; overflow-y: auto;
  background: var(--bg-modal); border-radius: 14px; padding: 22px 24px;
  box-shadow: 0 10px 40px rgba(0,0,0,.5);
}
#modal h2 { font-size: 17px; margin-bottom: 16px; }
#modal h3 { font-size: 14px; margin: 18px 0 8px; color: var(--text-muted); }
.modal-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.modal-tabs button {
  padding: 7px 14px; border-radius: 8px; border: 1px solid var(--border);
  background: none; color: var(--text-muted); font-size: 13px; font-weight: 600;
}
.modal-tabs button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.form-row { display: flex; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.form-row input, .form-row select {
  flex: 1; min-width: 110px; padding: 9px 12px;
  background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 8px; color: var(--text); font-size: 13px;
}
.form-row input:focus, .form-row select:focus { outline: none; border-color: var(--accent); }
.form-row label.check {
  display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text);
  padding: 9px 4px;
}
.btn-primary {
  padding: 9px 18px; background: var(--accent); border: none;
  border-radius: 8px; color: #fff; font-size: 13px; font-weight: 700;
}
.btn-primary:hover { background: var(--accent-dark); }
.btn-ghost {
  padding: 9px 14px; background: none; border: 1px solid var(--border);
  border-radius: 8px; color: var(--text-muted); font-size: 13px;
}
.btn-ghost:hover { color: var(--text); border-color: var(--text-muted); }
.btn-danger-ghost {
  background: none; border: none; color: var(--danger); font-size: 12px; padding: 4px 8px;
}
.list-row {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 4px; border-bottom: 1px solid #3a3d4233; font-size: 13px;
}
.list-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.member-filters { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 4px; }
.mf-btn {
  padding: 5px 12px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-muted); font-size: 12px; font-weight: 600;
}
.mf-btn:hover { border-color: var(--accent); color: var(--text); }
.member-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
  gap: 4px; margin: 8px 0;
}
.member-grid label {
  display: flex; align-items: center; gap: 6px; font-size: 13px;
  padding: 5px 8px; border-radius: 6px; cursor: pointer;
}
.member-grid label:hover { background: var(--bg-sidebar-hover); }
.modal-footer { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

.lvl-chip {
  font-size: 11px; padding: 1px 8px; border-radius: 8px;
  background: var(--bg-input); border: 1px solid var(--border); color: var(--text-muted); flex: none;
}

/* ---------- 드라이브 ---------- */
.drive-filters { display: flex; gap: 6px; margin-bottom: 14px; }
.drive-filters button {
  padding: 6px 16px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--bg-input); color: var(--text-muted); font-size: 13px; font-weight: 600;
}
.drive-filters button.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.drive-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px;
}
.drive-item {
  display: block; text-decoration: none; color: var(--text);
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
  padding: 8px; overflow: hidden;
}
.drive-item:hover { border-color: var(--accent); }
.drive-thumb {
  height: 90px; border-radius: 6px; overflow: hidden; margin-bottom: 6px;
  display: flex; align-items: center; justify-content: center; background: var(--bg-sidebar);
}
.drive-thumb img { width: 100%; height: 100%; object-fit: cover; }
.drive-fileicon { font-size: 34px; }
.drive-fname { font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.drive-sub { font-size: 11px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-modal-list { margin: -4px -8px 0; }

/* ---------- 이미지 라이트박스 ---------- */
#lightbox {
  position: fixed; inset: 0; z-index: 500; background: rgba(0,0,0,.92);
  display: flex; align-items: center; justify-content: center;
}
#lightbox-img { max-width: 96vw; max-height: 90vh; object-fit: contain; border-radius: 4px; }
#lightbox-bar {
  position: absolute; top: 0; right: 0; display: flex; gap: 8px;
  padding: 14px; padding-top: calc(14px + env(safe-area-inset-top));
}
#lightbox-bar a, #lightbox-close {
  background: rgba(0,0,0,.6); color: #fff;
  border: 1.5px solid rgba(255,255,255,.85);
  width: 44px; height: 44px; border-radius: 50%; font-size: 18px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.55);
}
#lightbox-bar a:hover, #lightbox-close:hover { background: rgba(0,0,0,.8); }

/* ---------- 토스트 ---------- */
#toast-container {
  position: fixed; top: 14px; right: 14px; z-index: 200;
  display: flex; flex-direction: column; gap: 8px;
}
.toast {
  background: var(--bg-modal); border: 1px solid var(--border); border-left: 3px solid var(--accent);
  border-radius: 10px; padding: 12px 16px; max-width: 320px;
  box-shadow: 0 6px 20px rgba(0,0,0,.4); cursor: pointer;
  animation: slideIn .2s ease;
}
.toast .t-title { font-size: 13px; font-weight: 700; margin-bottom: 2px; }
.toast .t-body { font-size: 12px; color: var(--text-muted); }
@keyframes slideIn { from { transform: translateX(30px); opacity: 0; } }

/* ---------- 검색 ---------- */
#search-bar {
  display: flex; align-items: center; gap: 8px;
  margin: 10px 12px 2px; padding: 8px 12px;
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 10px;
}
#search-bar:focus-within { border-color: var(--accent); }
.search-icon { font-size: 13px; opacity: .6; }
#search-input {
  flex: 1; background: none; border: none; color: var(--text); font-size: 13px; min-width: 0;
}
#search-input:focus { outline: none; }
#search-input::-webkit-search-cancel-button { display: none; }

#search-results { padding: 6px 0 16px; }
.tab-panel.search-hidden { display: none !important; }
.sr-section { padding: 10px 16px 4px; font-size: 12px; font-weight: 700; color: var(--text-muted); }
.sr-row {
  padding: 9px 16px; cursor: pointer;
}
.sr-row:hover { background: var(--bg-sidebar-hover); }
.sr-top { display: flex; gap: 8px; align-items: baseline; font-size: 13px; }
.sr-topic { font-weight: 700; }
.sr-meta { font-size: 11px; color: var(--text-muted); }
.sr-snippet { font-size: 13px; color: #b8c2d4; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sr-snippet b { color: var(--accent); }
.sr-empty { padding: 20px 16px; color: var(--text-muted); font-size: 13px; text-align: center; }

/* ---------- 조직도 ---------- */
.org-group { padding: 12px 16px 4px; font-size: 12px; font-weight: 800; color: var(--text-muted); letter-spacing: .5px; }
.org-row {
  display: flex; align-items: center; gap: 10px; padding: 8px 16px;
}
.org-row:hover { background: var(--bg-sidebar-hover); }
.org-row .grow { flex: 1; min-width: 0; }
.org-name { font-size: 14px; font-weight: 600; }
.org-sub { font-size: 11px; color: var(--text-muted); }
.org-presence {
  display: flex; flex-direction: column; align-items: flex-end; gap: 3px; flex: none;
  min-width: 52px;
}
.org-seen { font-size: 10px; color: var(--text-muted); white-space: nowrap; }
.org-chat-btn {
  background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px;
  color: var(--accent); font-size: 13px; padding: 6px 12px; cursor: pointer; flex: none;
}
.org-chat-btn:hover { border-color: var(--accent); }

/* ---------- 메뉴 탭 ---------- */
.menu-row {
  display: flex; align-items: center; gap: 12px;
  padding: 13px 18px; font-size: 15px; color: var(--text);
  cursor: pointer; text-decoration: none;
}
.menu-row:hover { background: var(--bg-sidebar-hover); }
.menu-row .m-icon { font-size: 18px; width: 24px; text-align: center; }
.menu-row .m-arrow { margin-left: auto; color: var(--text-muted); font-size: 12px; }
.menu-divider { height: 1px; background: #142340; margin: 8px 16px; }

/* ---------- 하단 탭 내비게이션 ---------- */
#bottom-nav { display: none; }

/* ---------- 최신 메시지 점프 ---------- */
#jump-latest {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: 110px; z-index: 5;
  background: var(--accent); color: #fff; border: none; border-radius: 16px;
  padding: 7px 16px; font-size: 13px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 14px rgba(0,0,0,.4);
}
#chat-room { position: relative; }

/* ---------- 스크롤바 ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-thumb { background: #3a4d6b; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ---------- 데스크톱: 모바일 전용 패널 숨김 ---------- */
#panel-chats, #panel-org, #panel-menu { display: none; }

/* ---------- 모바일 ---------- */
.mobile-only { display: none; }
@media (max-width: 760px) {
  .mobile-only { display: inline-block; }
  .desktop-only { display: none; }
  #sidebar { width: 100%; min-width: 100%; }

  /* 하단 탭 구조 */
  #sidebar-footer { display: none; }
  #panel-topics .desktop-only-block { display: none; }
  .tab-panel { display: none; }
  body[data-tab="topics"] #panel-topics { display: block; }
  body[data-tab="chats"] #panel-chats { display: block; }
  body[data-tab="org"] #panel-org { display: block; }
  body[data-tab="menu"] #panel-menu { display: block; }

  #bottom-nav {
    display: flex; flex: none;
    border-top: 1px solid #142340; background: var(--bg-sidebar);
    padding-bottom: env(safe-area-inset-bottom);
  }
  #bottom-nav button {
    flex: 1; position: relative;
    display: flex; flex-direction: column; align-items: center; gap: 3px;
    background: none; border: none; color: var(--text-muted);
    font-size: 11px; font-weight: 600; padding: 9px 0 7px;
  }
  #bottom-nav button .nav-icon { font-size: 21px; line-height: 1; filter: grayscale(1) brightness(1.4); }
  #bottom-nav button.active { color: var(--text); }
  #bottom-nav button.active .nav-icon { filter: none; }
  .nav-badge {
    position: absolute; top: 4px; left: calc(50% + 8px);
    background: #ff3b30; color: #fff; font-size: 10px; font-weight: 800;
    border-radius: 9px; padding: 1px 6px; min-width: 18px;
  }
  #chat { display: none; }
  body.mobile-chat #sidebar { display: none; }
  body.mobile-chat #chat { display: flex; }
  .composer-hint { display: none; }
  #composer { margin: 0 10px 10px; }
  #messages { padding: 12px; }
  #reply-bar { margin: 0 10px 6px; }

  /* 모바일 글씨 한 단계 확대 */
  .ws-header { font-size: 18px; }
  .topic-item, .dm-item { font-size: 16px; padding-top: 9px; padding-bottom: 9px; }
  .cat-name { font-size: 13px; }
  .section-header { font-size: 13px; }
  #chat-header { font-size: 17px; }
  .msg-name { font-size: 15px; }
  .msg-content { font-size: 16px; }
  .msg-quote { font-size: 13px; }
  .react-chip { font-size: 13px; padding: 3px 10px; }
  #msg-input { font-size: 16px; }   /* 16px 미만이면 iOS가 입력 시 자동 확대함 */
  #me-name { font-size: 14px; }
  .badge { font-size: 13px; }
}

/* ---------- 프로필 팝업 (채팅창 아바타·이름·멘션 클릭) ---------- */
#messages .msg-avatar, #messages .msg-name, #messages .mention { cursor: pointer; }
.profile-card { text-align: center; padding: 8px 0; }
.profile-actions { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
.profile-actions .btn-primary, .profile-actions a.btn-primary {
  display: inline-flex; align-items: center; gap: 4px; padding: 9px 18px;
}
.profile-presence {
  display: flex; align-items: center; justify-content: center; gap: 6px;
  margin-top: 8px; font-size: 12px; color: var(--text-muted);
}

/* ---------- 새 채팅 (검색 + 단체채팅) ---------- */
.newchat-top { display: flex; gap: 8px; align-items: center; margin-bottom: 6px; }
.newchat-top #nc-search {
  flex: 1; padding: 9px 12px; background: var(--bg-input); color: var(--text);
  border: 1px solid var(--border); border-radius: 8px; font-size: 15px;
}
#nc-group-toggle { flex: none; white-space: nowrap; }
#nc-group-toggle.active { background: var(--accent); color: #fff; border-color: var(--accent); }
#nc-list { max-height: 50vh; overflow-y: auto; }
#nc-list .nc-cb { width: 18px; height: 18px; flex: none; accent-color: var(--accent); }
.dm-group-icon { flex: none; font-size: 14px; line-height: 1; width: 9px; text-align: center; }

/* 단체방 멤버 선택 — 모두 선택/해제 바 */
.select-bar { display: flex; align-items: center; gap: 8px; margin: 0 2px 6px; }
.select-bar .muted { font-size: 12px; margin-left: auto; }

/* ---------- 사진 앨범(묶음) ---------- */
.msg-album { display: grid; gap: 3px; margin-top: 4px; width: min(360px, 80%); }
.msg-album.cols-1 { grid-template-columns: 1fr; }
.msg-album.cols-2 { grid-template-columns: repeat(2, 1fr); }
.msg-album.cols-3 { grid-template-columns: repeat(3, 1fr); }
.album-cell { position: relative; aspect-ratio: 1 / 1; overflow: hidden; border-radius: 6px; }
.album-cell img.msg-image {
  width: 100%; height: 100%; max-width: none; max-height: none;
  object-fit: cover; margin: 0; border-radius: 6px; cursor: pointer;
}

/* ---------- 파일 드래그앤드롭 오버레이 ---------- */
#chat-room.dragover { position: relative; }
#chat-room.dragover::after {
  content: '📎 여기에 놓아 첨부';
  position: absolute; inset: 8px; z-index: 50;
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--accent);
  background: color-mix(in srgb, var(--accent) 12%, var(--bg-input));
  border: 3px dashed var(--accent); border-radius: 14px;
  pointer-events: none;
}

/* ---------- 임시 첨부 트레이 (전송 전 미리보기) ---------- */
#attach-tray {
  border-top: 1px solid var(--border); background: var(--bg-input);
  padding: 8px 10px 6px;
}
.attach-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.attach-item { position: relative; flex: none; width: 64px; height: 64px; }
.attach-item img {
  width: 64px; height: 64px; object-fit: cover; border-radius: 8px;
  border: 1px solid var(--border);
}
.attach-file {
  width: 64px; height: 64px; border-radius: 8px; border: 1px solid var(--border);
  background: var(--bg-modal); display: flex; flex-direction: column; align-items: center;
  justify-content: center; gap: 2px; font-size: 18px; padding: 4px;
}
.attach-file span {
  font-size: 9px; color: var(--text-muted); max-width: 58px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.attach-x {
  position: absolute; top: -6px; right: -6px; width: 18px; height: 18px;
  border-radius: 50%; border: none; background: rgba(0,0,0,.65); color: #fff;
  font-size: 11px; line-height: 18px; padding: 0; display: flex;
  align-items: center; justify-content: center;
}
.attach-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 4px; }
.attach-clear {
  background: none; border: none; color: var(--text-muted);
  font-size: 12px; text-decoration: underline;
}

/* ---------- 답장 스레드 (원문 아래 댓글 묶음, 2개 이상) ---------- */
.msg-thread {
  margin: 4px 0 10px 46px;
  border-left: 2px solid var(--accent);
  padding: 2px 0 2px 12px;
}
.msg-thread .msg-group { margin-top: 8px; }
.msg-thread .msg-group:first-child { margin-top: 2px; }
.msg-thread .msg-avatar { width: 28px; height: 28px; font-size: 12px; }
.msg-thread .msg-group.cont .msg-body { margin-left: 38px; }
.msg-thread .msg-content { font-size: 14px; }

/* ---------- 메시지 수정 ---------- */
.msg-edited { font-size: 11px; color: var(--text-muted); }
.edit-box { display: flex; flex-direction: column; gap: 6px; min-width: 220px; }
.edit-input {
  width: 100%; min-height: 48px; resize: vertical; padding: 8px 10px;
  background: var(--bg-input); color: var(--text); border: 1px solid var(--accent);
  border-radius: 8px; font-size: 14px; font-family: inherit;
}
.edit-actions { display: flex; gap: 6px; justify-content: flex-end; }
.edit-actions button { padding: 5px 12px; border-radius: 7px; font-size: 13px; border: 1px solid var(--border); background: var(--bg-input); color: var(--text); }
.edit-actions .edit-save { background: var(--accent); color: #fff; border: none; }
.edit-hint { font-size: 11px; }

/* ---------- 공지 필독 확인 ---------- */
.msg-ack-toggle.on { opacity: 1; filter: drop-shadow(0 0 2px var(--accent)); }
.ack-box {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 6px;
  padding: 8px 10px; background: var(--bubble-notice); border: 1px solid var(--border);
  border-radius: 10px; max-width: min(420px, 90%);
}
.ack-tag { font-size: 12px; font-weight: 700; color: var(--accent); }
.ack-btn {
  padding: 6px 14px; background: var(--accent); color: #fff; border: none;
  border-radius: 8px; font-size: 13px; font-weight: 600;
}
.ack-btn:hover { background: var(--accent-dark); }
.ack-done { font-size: 13px; color: #00a86b; font-weight: 600; }
.ack-status {
  margin-left: auto; font-size: 12px; color: var(--text-muted);
  background: none; border: none; text-decoration: underline;
}

/* ---------- 투표 ---------- */
.poll { min-width: 240px; max-width: min(420px, 92%); }
.poll-q { font-weight: 700; font-size: 15px; margin-bottom: 2px; }
.poll-closed-tag { font-size: 11px; color: var(--danger); border: 1px solid var(--danger); border-radius: 5px; padding: 0 5px; font-weight: 600; }
.poll-meta { margin-bottom: 8px; }
.poll-opts { display: flex; flex-direction: column; gap: 6px; }
.poll-opt {
  position: relative; display: flex; align-items: center; gap: 8px; overflow: hidden;
  padding: 9px 12px; background: var(--bg-input); border: 1px solid var(--border);
  border-radius: 9px; color: var(--text); font-size: 14px; text-align: left;
}
.poll-opt:hover:not(.closed) { border-color: var(--accent); }
.poll-opt.picked { border-color: var(--accent); }
.poll-opt.closed { cursor: default; }
.poll-bar { position: absolute; left: 0; top: 0; bottom: 0; background: color-mix(in srgb, var(--accent) 18%, transparent); transition: width .3s; z-index: 0; }
.poll-label { position: relative; z-index: 1; flex: 1; }
.poll-count { position: relative; z-index: 1; font-size: 12px; color: var(--text-muted); flex: none; }
.poll-opt.picked .poll-label { font-weight: 700; color: var(--accent); }
.poll-close { margin-top: 8px; background: none; border: none; color: var(--text-muted); font-size: 12px; text-decoration: underline; }
.poll-new-opt { display: flex; gap: 6px; margin-bottom: 6px; }
.poll-new-opt .pn-opt { flex: 1; padding: 8px 10px; background: var(--bg-input); color: var(--text); border: 1px solid var(--border); border-radius: 8px; }
.poll-new-opt .pn-del { flex: none; width: 32px; background: var(--bg-input); border: 1px solid var(--border); border-radius: 8px; color: var(--text-muted); }

/* ---------- 메시지 고정(핀) 바 ---------- */
.msg-pin.on { opacity: 1; filter: drop-shadow(0 0 2px var(--accent)); }
#pin-bar {
  flex: none; border-bottom: 1px solid var(--border); background: var(--bubble-notice);
  max-height: 120px; overflow-y: auto;
}
.pin-item {
  display: flex; align-items: center; gap: 8px; padding: 8px 14px; cursor: pointer;
  border-bottom: 1px solid var(--border);
}
.pin-item:last-child { border-bottom: none; }
.pin-item:hover { background: var(--bg-sidebar-hover); }
.pin-ic { flex: none; font-size: 13px; }
.pin-text { flex: 1; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pin-unpin { flex: none; background: none; border: none; color: var(--text-muted); font-size: 13px; }
.pin-unpin:hover { color: var(--danger); }

/* ---------- 멘션·저장 모아보기 ---------- */
.msg-save.on { opacity: 1; filter: drop-shadow(0 0 2px var(--accent)); }
.mc-item { padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; margin-bottom: 8px; cursor: pointer; }
.mc-item:hover { border-color: var(--accent); background: var(--bg-input); }
.mc-head { font-size: 13px; margin-bottom: 3px; }
.mc-body { font-size: 14px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 문서 인앱 미리보기 ---------- */
.file-card.previewable { cursor: pointer; }
#doc-preview {
  position: fixed; inset: 0; z-index: 600; background: rgba(0,0,0,.85);
  display: flex; flex-direction: column;
}
#doc-bar {
  display: flex; align-items: center; gap: 12px; padding: 10px 16px;
  background: var(--bg-modal); color: var(--text); border-bottom: 1px solid var(--border);
}
#doc-name { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#doc-bar a, #doc-bar button {
  color: var(--accent); background: none; border: none; font-size: 14px; text-decoration: none; white-space: nowrap;
}
#doc-bar #doc-close { color: var(--text); font-size: 18px; }
#doc-frame { flex: 1; width: 100%; border: none; background: #fff; }

/* ---------- 메시지 액션 바텀시트 (모바일 길게누르기) ---------- */
.msg-sheet-backdrop {
  position: fixed; inset: 0; z-index: 400; background: rgba(0,0,0,.4);
  display: flex; align-items: flex-end; opacity: 0; transition: opacity .2s ease;
}
.msg-sheet-backdrop.show { opacity: 1; }
.msg-sheet {
  width: 100%; background: var(--bg-modal); color: var(--text);
  border-radius: 18px 18px 0 0; padding: 8px 0 max(12px, env(safe-area-inset-bottom));
  max-height: 80vh; overflow-y: auto;
  transform: translateY(100%); transition: transform .22s cubic-bezier(.32,.72,0,1);
  box-shadow: 0 -6px 24px rgba(0,0,0,.3);
}
.msg-sheet-backdrop.show .msg-sheet { transform: none; }
.sheet-grip { width: 38px; height: 4px; border-radius: 2px; background: var(--border); margin: 4px auto 10px; }
.sheet-emojis {
  display: flex; justify-content: space-around; gap: 6px;
  padding: 6px 16px 12px; border-bottom: 1px solid var(--border);
}
.sheet-emoji {
  background: var(--bg-input); border: none; border-radius: 14px;
  font-size: 26px; padding: 8px 0; cursor: pointer; flex: 1; max-width: 72px;
}
.sheet-emoji:active { background: var(--bg-sidebar-hover); transform: scale(1.08); }
.sheet-list { display: flex; flex-direction: column; padding: 6px 0; }
.sheet-item {
  display: flex; align-items: center; gap: 16px; width: 100%;
  background: none; border: none; color: var(--text); text-align: left;
  font-size: 16px; padding: 13px 22px; cursor: pointer;
}
.sheet-item:active { background: var(--bg-sidebar-hover); }
.sheet-item.danger { color: var(--danger); }
.sheet-ic { font-size: 18px; width: 24px; text-align: center; flex: none; }

/* ---------- 백업 / 복구 모달 ---------- */
.backup-box { display: flex; flex-direction: column; }
.backup-h { font-size: 15px; font-weight: 700; color: var(--text); margin: 2px 0 6px; }
.backup-h.danger { color: var(--danger); }
.backup-desc { font-size: 13px; line-height: 1.55; margin-bottom: 10px; }
.backup-dl { text-decoration: none; display: inline-block; text-align: center; padding: 11px 16px; border-radius: 10px; }
.backup-size { font-size: 12px; margin-top: 7px; }
.backup-note { font-size: 12px; line-height: 1.5; margin-top: 10px; background: var(--bg-input); border-radius: 8px; padding: 9px 11px; }
.backup-divider { height: 1px; background: var(--border); margin: 18px 0; }
.backup-file { display: block; width: 100%; margin-bottom: 10px; font-size: 13px; color: var(--text); }
.backup-restore { color: var(--danger); border-color: var(--danger); }
.backup-restore:disabled { opacity: .5; cursor: default; }
.backup-status { margin-top: 10px; font-size: 13px; line-height: 1.5; }

/* ---------- 하단 설치 안내 배너 ---------- */
#install-banner {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 120%);
  width: min(520px, calc(100% - 20px)); z-index: 500;
  margin-bottom: max(12px, env(safe-area-inset-bottom));
  display: flex; align-items: center; gap: 12px;
  background: var(--bg-modal); color: var(--text);
  border: 1px solid var(--border); border-radius: 16px;
  padding: 12px 14px; box-shadow: 0 8px 28px rgba(0,0,0,.32);
  transition: transform .28s cubic-bezier(.32,.72,0,1); opacity: .98;
}
#install-banner.show { transform: translate(-50%, 0); }
#install-banner .ib-icon { width: 40px; height: 40px; border-radius: 9px; flex: none; }
#install-banner .ib-text { display: flex; flex-direction: column; min-width: 0; flex: 1; }
#install-banner .ib-text b { font-size: 14px; }
#install-banner .ib-text span { font-size: 12px; color: var(--text-muted); }
#install-banner .ib-btn {
  flex: none; background: var(--accent); color: #fff; border: none;
  border-radius: 9px; padding: 9px 16px; font-size: 14px; font-weight: 700; cursor: pointer;
}
#install-banner .ib-btn:hover { background: var(--accent-dark); }
#install-banner .ib-x {
  flex: none; background: none; border: none; color: var(--text-muted);
  font-size: 16px; cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
#install-banner .ib-x:hover { background: var(--bg-sidebar-hover); color: var(--text); }

/* ---------- 링크 미리보기 카드 ---------- */
.link-preview:empty { display: none; }
/* 말풍선 안에 표시 (카톡식) */
.link-preview { margin-top: 7px; width: min(340px, 72vw); }
.lp-card { display: flex; text-decoration: none; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; background: var(--bg-chat); }
.lp-card:hover { border-color: var(--accent); }
.msg-group.mine .lp-card { background: rgba(255,255,255,.55); }
.lp-img { flex: 0 0 86px; height: 86px; background: var(--bg-chat); }
.lp-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.lp-text { padding: 8px 12px; min-width: 0; display: flex; flex-direction: column; justify-content: center; gap: 3px; }
.lp-title { font-size: 13px; font-weight: 700; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lp-desc { font-size: 12px; color: var(--text-muted); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.lp-domain { font-size: 11px; color: var(--text-muted); }

/* ---------- 내 정보 관리 ---------- */
.myinfo-box { display: flex; flex-direction: column; }
.myinfo-id { display: flex; align-items: center; gap: 12px; margin-bottom: 16px; }
.myinfo-name { font-size: 16px; font-weight: 700; color: var(--text); }
.myinfo-h { font-size: 14px; font-weight: 700; color: var(--text); margin: 2px 0 8px; }
.myinfo-box label.check { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); cursor: pointer; }
.myinfo-box label.check.disabled { opacity: .6; cursor: default; }
.myinfo-box .form-row { margin-bottom: 8px; }
