/* htapp - 배치·흐름은 텔레그램처럼 단순하게(로고·아이콘 자료는 쓰지 않음), 색은 홈페이지 v2 남색 (확정 ㊵ ㊶)
   primary #1428A0 / pressed #0E1F80 / deep navy #0B1A4F / line #9AA8D6 / hairline #DADFEA / paper #F3F5FA
   text #24252E / muted #5E606B / focus #F2B705 */
:root {
  --primary: #1428A0; --primary-press: #0E1F80; --navy: #0B1A4F; --line: #9AA8D6; --hair: #DADFEA;
  --paper: #F3F5FA; --panel: #FFFFFF; --text: #24252E; --muted: #5E606B; --focus: #F2B705;
  --mine: #1428A0; --mine-text: #FFFFFF; --mine-meta: rgba(255,255,255,.72);
  --theirs: #FFFFFF; --theirs-text: #24252E; --theirs-meta: #8A8D99;
  --chat-bg: #E4E9F3; --chat-dot: rgba(20,40,160,.07); --sel: #E8EDFB; --hover: #F1F4FB;
  --danger: #C62828; --ok: #1E8E3E; --warn: #F2B705; --badge: #1428A0; --badge-muted: #9AA3B8;
  --shadow: 0 6px 24px rgba(11,26,79,.16);
  --font: "IBM Plex Sans KR", "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --primary: #5C7CFA; --primary-press: #4263EB; --navy: #0A1438; --line: #3A4A7A; --hair: #243056;
    --paper: #0E1530; --panel: #131C3D; --text: #E8EBF5; --muted: #9AA3C2;
    --mine: #2F4BC7; --mine-text: #FFFFFF; --mine-meta: rgba(255,255,255,.7);
    --theirs: #1C2750; --theirs-text: #E8EBF5; --theirs-meta: #8D97BD;
    --chat-bg: #0B1128; --chat-dot: rgba(120,145,255,.06); --sel: #1E2A58; --hover: #18224A;
    --badge: #5C7CFA; --badge-muted: #4A5580; --shadow: 0 6px 24px rgba(0,0,0,.5);
    color-scheme: dark;
  }
}
* { box-sizing: border-box; }
[v-cloak] { display: none; }
html, body { margin: 0; height: 100%; background: var(--paper); color: var(--text); font: 15px/1.45 var(--font);
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; }
#app { height: 100%; }
svg.i { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round;
  stroke-linejoin: round; vertical-align: middle; flex: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; border-radius: 10px; padding: 8px 14px; }
button:disabled { opacity: .45; cursor: default; }
button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px; }
.btn { background: var(--hover); color: var(--text); font-weight: 500; }
.btn.primary, button.primary { background: var(--primary); color: #fff; font-weight: 600; }
.btn.primary:active, button.primary:active { background: var(--primary-press); }
.btn.danger { color: var(--danger); background: transparent; }
.btn.small, button.small { padding: 5px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; padding: 11px 14px; margin-top: 8px; }
.link { color: var(--primary); padding: 6px; font-weight: 500; }
.iconbtn { width: 40px; height: 40px; padding: 0; border-radius: 50%; display: inline-flex; align-items: center;
  justify-content: center; color: inherit; flex: none; }
.iconbtn:hover { background: rgba(127,140,190,.14); }
input, select, textarea { font: inherit; color: var(--text); background: var(--panel); border: 1px solid var(--hair);
  border-radius: 10px; padding: 10px 12px; width: 100%; }
input:focus, textarea:focus, select:focus { border-color: var(--primary); outline: none; }
input[type=checkbox] { width: auto; accent-color: var(--primary); }
small, .muted { color: var(--muted); font-weight: normal; }
.hint { color: var(--muted); font-size: 13px; margin: 2px 0 8px; }
.error { color: var(--danger); margin: 4px 0; font-size: 14px; }
.notice { background: var(--sel); color: var(--text); border-radius: 10px; padding: 9px 12px; margin: 4px 0; font-size: 14px; }
.empty { color: var(--muted); text-align: center; padding: 36px 16px; font-size: 14px; }
.tag { font-size: 11px; background: var(--sel); color: var(--primary); border-radius: 6px; padding: 1px 7px; margin-left: 4px;
  font-weight: 600; white-space: nowrap; }
.tag.red { background: rgba(198,40,40,.12); color: var(--danger); }
.tag.gray { background: var(--hover); color: var(--muted); }

/* 띠·토스트 */
.banner { position: fixed; left: 0; right: 0; top: env(safe-area-inset-top, 0); z-index: 70; text-align: center;
  padding: 7px 12px; font-size: 13px; font-weight: 500; }
.banner.warn { background: var(--warn); color: #1d1d1d; }
.banner.conn { background: var(--navy); color: #fff; }
.banner.info { background: var(--primary); color: #fff; cursor: pointer; }
.toast { position: fixed; left: 50%; bottom: calc(84px + env(safe-area-inset-bottom, 0)); transform: translateX(-50%);
  background: rgba(11,26,79,.94); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 80; max-width: 90vw;
  font-size: 14px; box-shadow: var(--shadow); }

/* 로그인·가입 */
.auth { min-height: 100%; display: flex; align-items: center; justify-content: center; padding: 24px 16px;
  background: linear-gradient(160deg, #16328F 0%, #0B1A4F 60%, #070F33 100%); }
.auth-card { width: 100%; max-width: 400px; background: var(--panel); border-radius: 18px; padding: 26px 22px;
  display: flex; flex-direction: column; gap: 11px; box-shadow: 0 18px 50px rgba(0,0,0,.28); }
.auth-card h2 { margin: 0; font-size: 20px; }
.auth-card label { display: flex; flex-direction: column; gap: 4px; font-size: 13px; color: var(--muted); }
.brand { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-bottom: 6px; }
.brand img { width: 76px; height: 76px; }
.brand span { font-size: 24px; font-weight: 700; color: var(--text); letter-spacing: .2px; }
.captcha { display: flex; gap: 8px; align-items: center; }
.captcha img { height: 48px; border-radius: 8px; cursor: pointer; flex: none; background: #fff; }
.consent { border: 1px solid var(--hair); border-radius: 12px; padding: 10px 12px; }
.consent label { flex-direction: row; align-items: center; gap: 8px; color: var(--text); font-size: 14px; }
.consent pre { white-space: pre-wrap; font: 12.5px/1.55 var(--font); color: var(--muted); max-height: 180px; overflow: auto;
  margin: 8px 0 0; background: var(--paper); border-radius: 8px; padding: 8px; }
.boot { height: 100%; display: flex; align-items: center; justify-content: center; background: var(--navy); }
.boot img { width: 96px; height: 96px; }

/* 본 화면 배치: PC 좌우 2단, 모바일 한 화면씩 */
.shell { height: 100%; display: flex; }
.side { width: 100%; display: flex; flex-direction: column; background: var(--panel); min-width: 0; }
.chat { flex: 1; display: none; flex-direction: column; min-width: 0; position: relative; }
.shell.chat-open .side { display: none; }
.shell.chat-open .chat { display: flex; }
.shell.wide .side { width: 360px; flex: none; display: flex; border-right: 1px solid var(--hair); }
.shell.wide .chat { display: flex; }
.chat-empty { flex: 1; display: flex; align-items: center; justify-content: center; background: var(--chat-bg); }
.chat-empty span { background: rgba(11,26,79,.35); color: #fff; padding: 6px 14px; border-radius: 16px; font-size: 14px; }

.topbar { height: 56px; flex: none; display: flex; align-items: center; gap: 4px; padding: 0 6px 0 10px;
  background: var(--panel); border-bottom: 1px solid var(--hair); padding-top: env(safe-area-inset-top, 0); box-sizing: content-box; }
.topbar .title { flex: 1; font-size: 18px; font-weight: 600; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat .topbar { gap: 8px; }
.chat-head { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; cursor: pointer; }
.chat-head .t { font-weight: 600; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.chat-head .s { font-size: 13px; color: var(--muted); }
.searchbox { padding: 8px 10px; border-bottom: 1px solid var(--hair); }
.searchbox input { background: var(--paper); border: 0; border-radius: 20px; padding: 9px 14px; }

/* 목록 줄 */
.list { flex: 1; overflow-y: auto; }
.row { display: flex; align-items: center; gap: 12px; padding: 9px 12px; cursor: pointer; position: relative; }
.row:hover { background: var(--hover); }
.row.selected { background: var(--sel); }
.shell.wide .row.selected { background: var(--primary); color: #fff; }
.shell.wide .row.selected .row-sub, .shell.wide .row.selected .row-meta .time, .shell.wide .row.selected small, .shell.wide .row.selected .row-sub b { color: rgba(255,255,255,.85); }
.shell.wide .row.selected .row-main { border-bottom-color: transparent; }
.shell.wide .row.selected .badge { background: #fff; color: var(--primary); }
.row-main { flex: 1; min-width: 0; border-bottom: 1px solid var(--hair); padding-bottom: 9px; margin-bottom: -9px; }
.row:last-child .row-main { border-bottom: 0; }
.row-top { display: flex; align-items: baseline; gap: 6px; }
.row-name { font-weight: 600; font-size: 15.5px; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-name small { font-weight: 400; margin-left: 4px; }
.row-sub { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px;
  display: flex; gap: 6px; align-items: center; }
.row-sub .snip { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.row-sub b { color: var(--text); font-weight: 500; }
.row-meta .time { font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.badge { min-width: 22px; height: 22px; border-radius: 11px; background: var(--badge); color: #fff; font-size: 12.5px;
  font-weight: 600; display: inline-flex; align-items: center; justify-content: center; padding: 0 7px; flex: none; }
.badge.muted { background: var(--badge-muted); }
.section-title { font-size: 13px; font-weight: 600; color: var(--primary); padding: 12px 14px 4px; }
.section-toggle { width: 100%; text-align: left; color: var(--muted); padding: 12px 14px; font-size: 14px; }

/* 둥근 얼굴 (이름 첫 글자) */
.avatar { width: 50px; height: 50px; border-radius: 50%; flex: none; display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 600; font-size: 19px; background: var(--primary); user-select: none; }
.avatar.sm { width: 38px; height: 38px; font-size: 15px; }
.avatar.xs { width: 30px; height: 30px; font-size: 13px; }
.avatar.lg { width: 84px; height: 84px; font-size: 32px; }
.avatar.special { background: var(--navy); }
.avatar svg.i { width: 24px; height: 24px; }

/* 아래 탭 (모바일) */
.tabs { display: flex; border-top: 1px solid var(--hair); background: var(--panel); padding-bottom: env(safe-area-inset-bottom, 0); flex: none; }
.tabs button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 11.5px; padding: 7px 0 6px;
  color: var(--muted); border-radius: 0; position: relative; }
.tabs button.on { color: var(--primary); font-weight: 600; }
.tabs .dot { position: absolute; top: 5px; left: calc(50% + 8px); min-width: 17px; height: 17px; border-radius: 9px; font-size: 10.5px;
  background: var(--danger); color: #fff; font-style: normal; display: flex; align-items: center; justify-content: center; padding: 0 4px; }

/* 대화방 */
.pinbar { display: flex; align-items: center; gap: 10px; padding: 7px 12px; background: var(--panel); border-bottom: 1px solid var(--hair);
  cursor: pointer; font-size: 14px; flex: none; }
.pinbar .bar { width: 3px; align-self: stretch; background: var(--primary); border-radius: 2px; }
.pinbar .pt { color: var(--primary); font-weight: 600; font-size: 13px; }
.pinbar .pb { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.archived-note { background: var(--hover); color: var(--muted); text-align: center; font-size: 13px; padding: 6px; flex: none; }
.messages { flex: 1; overflow-y: auto; padding: 10px 8px 14px; background-color: var(--chat-bg);
  background-image: radial-gradient(var(--chat-dot) 1.4px, transparent 1.5px), radial-gradient(var(--chat-dot) 1.4px, transparent 1.5px);
  background-size: 26px 26px; background-position: 0 0, 13px 13px; }
.msg-wrap { max-width: 760px; margin: 0 auto; }
.daypill, .syspill { text-align: center; margin: 10px 0; }
.daypill span, .syspill span { display: inline-block; background: rgba(11,26,79,.38); color: #fff; font-size: 12.5px;
  padding: 3px 11px; border-radius: 14px; font-weight: 500; }
.syspill span { background: rgba(11,26,79,.26); }
.msg { display: flex; align-items: flex-end; gap: 6px; margin: 2px 0; }
.msg.mine { justify-content: flex-end; }
.msg .avatar.xs { visibility: hidden; margin-bottom: 2px; }
.msg.tailed .avatar.xs { visibility: visible; }
.msg.sel .bubble { outline: 2px solid var(--focus); }
.bubble { position: relative; max-width: min(78%, 520px); background: var(--theirs); color: var(--theirs-text);
  border-radius: 14px; padding: 6px 9px 6px 10px; box-shadow: 0 1px 1px rgba(11,26,79,.12); word-break: break-word; }
.msg.mine .bubble { background: var(--mine); color: var(--mine-text); }
.msg.tailed:not(.mine) .bubble { border-bottom-left-radius: 4px; }
.msg.tailed.mine .bubble { border-bottom-right-radius: 4px; }
.msg.tailed:not(.mine) .bubble::before { content: ""; position: absolute; left: -7px; bottom: 0; width: 10px; height: 14px;
  background: var(--theirs); clip-path: path("M10 0 L10 14 L0 14 C4 12 8 8 10 0 Z"); }
.msg.tailed.mine .bubble::before { content: ""; position: absolute; right: -7px; bottom: 0; width: 10px; height: 14px;
  background: var(--mine); clip-path: path("M0 0 L0 14 L10 14 C6 12 2 8 0 0 Z"); }
.bubble .sender { font-size: 13.5px; font-weight: 600; margin-bottom: 1px; }
.bubble .text { white-space: pre-wrap; font-size: 15px; }
.bubble .meta { float: right; margin: 6px 0 -3px 10px; font-size: 11.5px; color: var(--theirs-meta); display: inline-flex;
  gap: 5px; align-items: center; position: relative; top: 3px; white-space: nowrap; }
.msg.mine .bubble .meta { color: var(--mine-meta); }
.meta .unread { color: var(--primary); font-weight: 700; }
.msg.mine .meta .unread { color: #FFE58A; }
.bubble.deleted .text { font-style: italic; opacity: .75; }
.bubble.urgent { box-shadow: 0 0 0 2px var(--danger); }
.quote { border-left: 3px solid currentColor; padding: 2px 8px; margin: 2px 0 4px; font-size: 13.5px; border-radius: 4px;
  background: rgba(20,40,160,.07); cursor: pointer; }
.msg.mine .quote { background: rgba(255,255,255,.13); }
.quote b { display: block; font-size: 13px; color: var(--primary); }
.msg.mine .quote b { color: #fff; }
.reactions { display: flex; gap: 4px; flex-wrap: wrap; margin-top: 4px; }
.reactions button { padding: 1px 8px; border-radius: 12px; font-size: 13px; background: rgba(20,40,160,.1); color: inherit; }
.msg.mine .reactions button { background: rgba(255,255,255,.18); }
.reactions button.mine { box-shadow: inset 0 0 0 1.5px currentColor; }
.photo { display: block; margin: -2px -5px 4px -6px; border-radius: 11px; overflow: hidden; cursor: zoom-in; background: rgba(0,0,0,.06); }
.photo img { display: block; width: 100%; max-width: 320px; max-height: 360px; object-fit: cover; }
.filecard { display: flex; gap: 10px; align-items: center; min-width: 220px; padding: 2px 0 4px; }
.filecard .fi { width: 44px; height: 44px; border-radius: 50%; background: var(--primary); color: #fff; display: flex;
  align-items: center; justify-content: center; flex: none; cursor: pointer; }
.msg.mine .filecard .fi { background: #fff; color: var(--primary); }
.filecard .fn { font-weight: 600; font-size: 14px; word-break: break-all; }
.filecard .fs { font-size: 12.5px; opacity: .75; }
.progress { height: 4px; border-radius: 2px; background: rgba(127,127,127,.25); overflow: hidden; margin-top: 4px; }
.progress i { display: block; height: 100%; background: currentColor; transition: width .2s; }
.retry { color: var(--danger); font-size: 13px; padding: 2px 6px; }
.more-btn { display: block; margin: 6px auto 10px; background: rgba(11,26,79,.35); color: #fff; border-radius: 14px; font-size: 13px; padding: 4px 12px; }
.jump { position: absolute; right: 16px; bottom: 76px; width: 44px; height: 44px; border-radius: 50%; background: var(--panel);
  box-shadow: var(--shadow); display: flex; align-items: center; justify-content: center; color: var(--muted); }

/* 입력줄 */
.replybar { display: flex; align-items: center; gap: 10px; padding: 6px 10px; background: var(--panel); border-top: 1px solid var(--hair); flex: none; }
.replybar .bar { width: 3px; align-self: stretch; background: var(--primary); border-radius: 2px; }
.replybar .rb { flex: 1; min-width: 0; font-size: 13.5px; }
.replybar .rb b { color: var(--primary); display: block; }
.replybar .rb span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.composer { display: flex; align-items: flex-end; gap: 4px; padding: 6px 8px; background: var(--panel); border-top: 1px solid var(--hair);
  padding-bottom: calc(6px + env(safe-area-inset-bottom, 0)); flex: none; }
.composer textarea { border: 0; resize: none; max-height: 140px; min-height: 40px; padding: 9px 6px; background: transparent; }
.composer .iconbtn { color: var(--muted); }
.composer .send { color: var(--primary); }
.composer .send:disabled { color: var(--muted); }

/* 떠 있는 메뉴·시트 */
.overlay { position: fixed; inset: 0; background: rgba(8,14,40,.45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.overlay.clear { background: transparent; }
.overlay.center { align-items: center; }
.menu { position: fixed; min-width: 210px; background: var(--panel); border-radius: 14px; box-shadow: var(--shadow); padding: 6px; z-index: 61; }
.menu > button { display: flex; width: 100%; text-align: left; gap: 12px; align-items: center; padding: 9px 12px; border-radius: 8px; font-size: 14.5px; }
.menu > button:hover { background: var(--hover); }
.menu > button.danger { color: var(--danger); }
.emoji-row { display: flex; justify-content: space-between; padding: 2px 4px 6px; border-bottom: 1px solid var(--hair); margin-bottom: 4px; }
.emoji-row button { font-size: 21px; padding: 3px 5px; border-radius: 50%; }
.emoji-row button:hover { background: var(--hover); transform: scale(1.12); }
.sheet { background: var(--panel); width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0;
  padding: 16px 16px calc(16px + env(safe-area-inset-bottom, 0)); }
.overlay.center .sheet { border-radius: 18px; max-width: 460px; margin: 16px; }
.sheet h3 { margin: 2px 0 12px; font-size: 18px; }
.sheet .grab { width: 40px; height: 4px; border-radius: 2px; background: var(--hair); margin: -6px auto 12px; }
.sheet-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; justify-content: flex-end; }
.cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.member { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--hair); }
.member .mn { flex: 1; min-width: 0; }
.member-actions { display: flex; gap: 4px; flex-wrap: wrap; justify-content: flex-end; }
.attach-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 6px 0 12px; }
.attach-grid button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 4px; background: var(--hover); border-radius: 14px; font-size: 13px; }
.attach-grid .ic { width: 48px; height: 48px; border-radius: 50%; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--hair); font-size: 14.5px; }
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 4px; cursor: pointer; }
.segmented { display: flex; background: var(--hover); border-radius: 10px; padding: 3px; margin: 4px 0 10px; }
.segmented button { flex: 1; padding: 6px; border-radius: 8px; font-size: 13.5px; color: var(--muted); }
.segmented button.on { background: var(--panel); color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.08); }

/* 사진·PDF 보기 */
.viewer { position: fixed; inset: 0; background: rgba(0,0,0,.92); z-index: 90; display: flex; flex-direction: column; }
.viewer .vbar { display: flex; align-items: center; gap: 8px; color: #fff; padding: 8px 10px; padding-top: calc(8px + env(safe-area-inset-top, 0)); }
.viewer .vbar .title { flex: 1; font-size: 15px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .vbody { flex: 1; overflow: auto; display: flex; align-items: center; justify-content: center; touch-action: pan-x pan-y pinch-zoom; }
.viewer .vbody img { max-width: 100%; max-height: 100%; }
.viewer canvas { background: #fff; max-width: none; box-shadow: 0 4px 30px rgba(0,0,0,.4); }
.viewer .pdfnav { display: flex; gap: 8px; align-items: center; justify-content: center; color: #fff; padding: 8px; padding-bottom: calc(8px + env(safe-area-inset-bottom, 0)); }
.viewer .pdfnav button { color: #fff; background: rgba(255,255,255,.14); }

/* 공지 */
.notice-card { background: var(--panel); border-radius: 14px; padding: 12px 14px; margin: 8px 10px; border: 1px solid var(--hair); cursor: pointer; }
.notice-card .nt { font-weight: 600; display: flex; gap: 6px; align-items: center; }
.notice-card .nb { color: var(--muted); font-size: 14px; margin-top: 4px; white-space: pre-wrap; max-height: 3em; overflow: hidden; }
.notice-card .nm { font-size: 12.5px; color: var(--muted); margin-top: 6px; }
.popup-card { text-align: left; }
.popup-card .pc-from { font-size: 13px; color: var(--muted); }
.popup-card .pc-body { white-space: pre-wrap; font-size: 16px; margin: 10px 0; }

/* 더보기·관리 */
.me-card { display: flex; gap: 14px; align-items: center; padding: 18px 16px; border-bottom: 8px solid var(--paper); }
.me-card .mc-name { font-size: 19px; font-weight: 600; }
.menu-list > button, .menu-list > a { display: flex; width: 100%; gap: 14px; align-items: center; padding: 13px 16px; border-radius: 0;
  text-align: left; font-size: 15px; border-bottom: 1px solid var(--hair); color: inherit; text-decoration: none; }
.menu-list > button:hover { background: var(--hover); }
.menu-list .mi-ic { color: var(--primary); }
.menu-list .mi-t { flex: 1; }
.panel { padding: 12px 14px 90px; }
.panel h4 { margin: 18px 0 8px; font-size: 15px; }
.form-grid { display: grid; gap: 8px; }
.form-row { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.form-row > input, .form-row > select, .form-row > textarea, .form-row > label { flex: 1; min-width: 120px; }
.form-row > button { flex: none; }
.admin-item { padding: 10px 0; border-bottom: 1px solid var(--hair); }
.admin-item .ai-top { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.admin-item .ai-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; align-items: center; }
.ai-actions select { width: auto; padding: 5px 8px; font-size: 13px; border-radius: 8px; }
.tablewrap { overflow-x: auto; }
table.grid { border-collapse: collapse; width: 100%; font-size: 13px; }
table.grid th, table.grid td { border-bottom: 1px solid var(--hair); padding: 6px 8px; text-align: left; white-space: nowrap; }
table.grid th { position: sticky; top: 0; background: var(--panel); font-weight: 600; }
table.grid select { padding: 3px 4px; font-size: 12.5px; width: auto; }
.chips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 12px; border-bottom: 1px solid var(--hair); }
.chips button { white-space: nowrap; background: var(--hover); border-radius: 16px; padding: 6px 12px; font-size: 13.5px; }
.chips button.on { background: var(--primary); color: #fff; }
.version { text-align: center; color: var(--muted); font-size: 12px; padding: 16px; }
.codebox { font: 600 20px/1.3 ui-monospace, Consolas, monospace; letter-spacing: 3px; background: var(--paper); border-radius: 10px;
  padding: 10px; text-align: center; user-select: all; }
.linkbox { font: 12.5px/1.4 ui-monospace, Consolas, monospace; word-break: break-all; background: var(--paper); border-radius: 8px; padding: 8px; user-select: all; }

@media (max-width: 899px) {
  .bubble { max-width: 84%; }
  .cols { grid-template-columns: 1fr; }
}

/* ── MVP-3: @멘션 · 메시지 고정 · 전달 · 대화 검색 (확정 ⑱) ── */
.mention { color: var(--primary); font-weight: 600; }
.mention.me { background: rgba(20,40,160,.12); border-radius: 4px; padding: 0 2px; }
.msg.mine .mention { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.msg.mine .mention.me { background: rgba(255,255,255,.2); }
.mention-pop { position: relative; margin: 0 8px; background: var(--panel); border: 1px solid var(--hair); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 240px; overflow-y: auto; padding: 4px; flex: none; max-width: 380px; }
.mention-pop button { display: flex; align-items: center; gap: 10px; width: 100%; text-align: left; padding: 7px 10px; border-radius: 8px; font-size: 14.5px; }
.mention-pop button small { color: var(--muted); }
.mention-pop button.on, .mention-pop button:hover { background: var(--hover); }
.pinbar.pinmsg .iconbtn { width: 32px; height: 32px; color: var(--muted); }
.fwd-label { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--primary); margin-bottom: 2px; font-style: italic; }
.fwd-label .i { width: 14px; height: 14px; }
.msg.mine .fwd-label { color: inherit; opacity: .85; }
.msg.flash .bubble { animation: htFlash 2.2s ease-out; }
@keyframes htFlash { 0%, 35% { box-shadow: 0 0 0 3px #F2B705; } 100% { box-shadow: 0 0 0 0 transparent; } }
.search-sheet { max-width: 620px; }
.sresult { padding: 10px 4px; border-bottom: 1px solid var(--hair); cursor: pointer; }
.sresult:hover { background: var(--hover); }
.sresult .sr-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14px; }
.sresult .sr-top span { color: var(--muted); font-size: 12.5px; flex: none; }
.sresult .sr-body { font-size: 14px; color: var(--text); margin-top: 2px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.sresult .sr-who { color: var(--muted); }
.sresult mark { background: rgba(242,183,5,.45); color: inherit; border-radius: 3px; padding: 0 1px; }
