/* =========================================================
   POMTALK — 스타일
   ========================================================= */
:root {
  --bg: #F3F4F7;
  --panel: #FFFFFF;
  --panel-2: #F6F7F9;
  --line: #E5E7EB;
  --text: #191B20;
  --muted: #6A717D;
  --faint: #9AA0AA;
  --primary: #3B5BDB;
  --primary-press: #2F4BC0;
  --primary-soft: #EDF1FD;
  --chat-bg: #E8ECF2;
  --bubble-other: #FFFFFF;
  --bubble-mine: #3B5BDB;
  --badge: #F03E3E;
  --unread: #D99A00;
  --danger: #E03131;
  --mention: #E8590C;
  --flash: rgba(255, 196, 0, .35);
  --shadow: 0 10px 40px rgba(15, 23, 42, .14);
  --fs: 15.5px;
  color-scheme: only light;   /* 브라우저 자동 어둡게 처리 방지 */
}
/* 다크 모드: 설정이 '시스템'이면 기기 설정을 따르고, '다크'를 고르면 항상 적용 */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0E1014;
    --panel: #16191F;
    --panel-2: #1D2128;
    --line: #2A2F38;
    --text: #E9EBEF;
    --muted: #A0A6B1;
    --faint: #6E7581;
    --primary: #5C7CFA;
    --primary-press: #4C6EF5;
    --primary-soft: #1E2640;
    --chat-bg: #101318;
    --bubble-other: #222731;
    --bubble-mine: #4C6EF5;
    --unread: #F2B824;
    --mention: #FF922B;
    --flash: rgba(255, 196, 0, .22);
    --shadow: 0 10px 40px rgba(0, 0, 0, .5);
    color-scheme: only dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0E1014;
  --panel: #16191F;
  --panel-2: #1D2128;
  --line: #2A2F38;
  --text: #E9EBEF;
  --muted: #A0A6B1;
  --faint: #6E7581;
  --primary: #5C7CFA;
  --primary-press: #4C6EF5;
  --primary-soft: #1E2640;
  --chat-bg: #101318;
  --bubble-other: #222731;
  --bubble-mine: #4C6EF5;
  --unread: #F2B824;
  --mention: #FF922B;
  --flash: rgba(255, 196, 0, .22);
  --shadow: 0 10px 40px rgba(0, 0, 0, .5);
  color-scheme: only dark;
}

* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
html { background: var(--panel); }
body {
  font-family: "Pretendard Variable", Pretendard, -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", system-ui, sans-serif;
  background: var(--panel); color: var(--text); font-size: 15px;   /* 상단 상태 표시줄 색 = 헤더 색 */
  -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; overflow: hidden;
}
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
svg { width: 22px; height: 22px; flex: none; }
svg.ic { width: 17px; height: 17px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hint { font-size: 12.5px; color: var(--faint); margin: 6px 2px 0; line-height: 1.5; }

/* ---------- 버튼 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 10px 16px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--panel); color: var(--text); font-weight: 600; cursor: pointer; transition: background .15s, opacity .15s;
}
.btn:hover { background: var(--panel-2); }
a.btn { text-decoration: none; }
#lock-forgot { margin-top: 18px; }
.btn.primary { background: var(--primary); color: #fff; border-color: transparent; }
.btn.primary:hover { background: var(--primary-press); }
.btn:disabled { opacity: .4; cursor: default; }
.btn.danger { color: var(--danger); }
.btn.small { padding: 6px 11px; font-size: 13px; border-radius: 8px; }
.btn.block { width: 100%; padding: 12px; margin-top: 6px; }
.icon-btn {
  width: 38px; height: 38px; border-radius: 10px; border: 0; background: transparent;
  display: grid; place-items: center; cursor: pointer; flex: none; color: var(--text);
}
.icon-btn:hover { background: var(--panel-2); }
.link-btn { border: 0; background: none; color: var(--muted); text-decoration: underline; cursor: pointer; font-size: 13px; padding: 8px; }
input, textarea, select { font: inherit; color: var(--text); }

/* ---------- 로딩 / 로그인 ---------- */
.boot { background: var(--bg); height: 100dvh; display: grid; place-items: center; color: var(--faint); }
.auth { background: var(--bg); height: 100vh; height: 100dvh; display: grid; place-items: center; padding: 24px; overflow-y: auto; }
.auth-card { width: 100%; max-width: 380px; background: var(--panel); border-radius: 22px; padding: 32px 28px 26px; box-shadow: var(--shadow); }
.brand { display: flex; align-items: center; gap: 12px; margin-bottom: 26px; }
.brand img { width: 46px; height: 46px; border-radius: 13px; }
.brand h1 { margin: 0; font-size: 25px; letter-spacing: -.03em; }
.auth-tabs { display: flex; background: var(--panel-2); border-radius: 12px; padding: 4px; margin-bottom: 20px; }
.auth-tabs button { flex: 1; border: 0; background: none; padding: 9px; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; }
.auth-tabs button.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
form label, .pad, .sheet-body > label, .field-label { display: block; font-size: 13.5px; font-weight: 600; color: var(--muted); margin-bottom: 12px; }
form input:not([type=checkbox]), form textarea, .search input, .sheet-body input:not([type=checkbox]) {
  display: block; width: 100%; margin-top: 6px; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  background: var(--panel-2); font-weight: 400; outline: none; transition: border-color .15s, background .15s; resize: vertical;
}
form input:not([type=checkbox]):focus, form textarea:focus, .search input:focus, .sheet-body input:not([type=checkbox]):focus { border-color: var(--primary); background: var(--panel); }
.opt { font-weight: 400; color: var(--faint); }
.auth-msg { min-height: 1.2em; font-size: 13.5px; color: var(--muted); margin: 14px 0 0; line-height: 1.55; white-space: pre-line; }
.auth-msg.err { color: var(--danger); }
.setup-title { margin: 0 0 10px; font-size: 21px; }
.setup-text { margin: 0; color: var(--muted); line-height: 1.65; }

/* ---------- 잠금 ---------- */
.lock, .privacy-cover { position: fixed; inset: 0; z-index: 200; background: var(--bg); }
.lock { display: grid; place-items: center; padding: 24px; }
.lock-inner { display: flex; flex-direction: column; align-items: center; width: 100%; max-width: 300px; }
.lock-logo { width: 56px; height: 56px; border-radius: 16px; margin-bottom: 18px; }
.lock h2 { margin: 0; font-size: 19px; }
.lock-msg { min-height: 1.3em; margin: 8px 0 16px; font-size: 13.5px; color: var(--muted); text-align: center; }
.lock-msg.err { color: var(--danger); }
.lock-dots { display: flex; gap: 16px; margin-bottom: 30px; }
.lock-dots i { width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--faint); }
.lock-dots i.on { background: var(--primary); border-color: var(--primary); }
.lock-dots.shake { animation: shake .35s; }
@keyframes shake { 25% { transform: translateX(-8px); } 75% { transform: translateX(8px); } }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; width: 100%; }
.keypad button { height: 62px; border-radius: 18px; border: 0; background: var(--panel); font-size: 24px; font-weight: 500; cursor: pointer; }
.keypad button:active { background: var(--primary-soft); }
.keypad .fn { background: transparent; font-size: 15px; color: var(--muted); }

/* ---------- 메인 레이아웃 ---------- */
.main { display: grid; grid-template-columns: minmax(200px, min(var(--side-w, 340px), calc(100vw - 300px))) 6px minmax(0, 1fr); height: 100vh; height: 100dvh; }
.sidebar { display: flex; flex-direction: column; min-height: 0; min-width: 0; background: var(--panel); }
.resizer { position: relative; cursor: col-resize; background: var(--panel); touch-action: none; z-index: 2; }
.resizer::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 1px; background: var(--line); transition: background .15s, width .15s; }
.resizer:hover::after, .resizer.dragging::after { width: 3px; background: var(--primary); }
body.resizing { cursor: col-resize; user-select: none; }
.side-head { display: flex; align-items: center; justify-content: space-between; padding: calc(14px + env(safe-area-inset-top)) 10px 8px 20px; }
.side-head h1 { margin: 0; font-size: 21px; letter-spacing: -.03em; }
.head-actions { display: flex; gap: 0; }
.notify-banner { display: flex; align-items: center; gap: 8px; margin: 2px 12px 8px; padding: 9px 9px 9px 14px; background: var(--primary-soft); border-radius: 12px; font-size: 13px; }
.notify-banner span { flex: 1; }
.tabs { display: flex; padding: 0 12px; border-bottom: 1px solid var(--line); }
.tabs button {
  flex: 1; padding: 10px 0 11px; border: 0; background: none; cursor: pointer; font-weight: 600; color: var(--faint);
  border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; justify-content: center; gap: 6px;
}
.tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.side-body { flex: 1; overflow-y: auto; min-height: 0; padding-bottom: env(safe-area-inset-bottom); }

/* ---------- 목록 ---------- */
.list { list-style: none; margin: 0; padding: 4px 0; }
.item { display: flex; align-items: center; gap: 12px; padding: 9px 16px; cursor: pointer; outline: none; width: 100%; border: 0; background: none; text-align: left; }
.item:hover, .item:focus-visible { background: var(--panel-2); }
.item.active { background: var(--primary-soft); }
.item.pinned:not(.active) { background: color-mix(in srgb, var(--panel-2) 60%, transparent); }
.item-main { flex: 1; min-width: 0; }
.item-top, .item-bottom { display: flex; align-items: center; gap: 5px; }
.item-title { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: calc(var(--fs) - .5px); }
.item-tag { color: var(--faint); font-size: 13px; flex: none; }
.item-ico { width: 14px; height: 14px; color: var(--faint); flex: none; }
.item-time { margin-left: auto; color: var(--faint); font-size: 12px; flex: none; padding-left: 6px; }
.item-sub { flex: 1; color: var(--muted); font-size: calc(var(--fs) - 2px); margin-top: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.item-at { color: var(--mention); font-weight: 800; font-size: 13px; flex: none; }
.section-label { padding: 14px 16px 4px; font-size: 12.5px; color: var(--faint); font-weight: 600; }
.section-label.flush { padding: 18px 2px 6px; }
.empty { padding: 48px 24px; text-align: center; color: var(--faint); white-space: pre-line; line-height: 1.65; }
.search { padding: 10px 12px 4px; }
.search input { margin-top: 0; }
.badge { background: var(--badge); color: #fff; font-size: 11.5px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; display: inline-grid; place-items: center; flex: none; line-height: 1; }
.badge.muted-badge { background: var(--faint); }
.me-tag, .owner-tag { font-size: 11.5px; font-weight: 700; color: var(--primary); background: var(--primary-soft); border-radius: 6px; padding: 1px 6px; flex: none; }
.owner-tag { color: #B7791F; background: color-mix(in srgb, #F6C343 22%, transparent); }

.avatar {
  --av: #5C7CFA; width: 46px; height: 46px; border-radius: 17px; flex: none; background: var(--av); color: #fff;
  display: grid; place-items: center; font-weight: 700; font-size: 14px; letter-spacing: -.04em; overflow: hidden; position: relative;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar.group { background: var(--panel-2); color: var(--muted); border: 1px solid var(--line); }
.avatar.group svg { width: 24px; height: 24px; }
.avatar.blank { background: var(--line); }

/* ---------- 채팅 ---------- */
.chat { position: relative; display: flex; flex-direction: column; min-width: 0; min-height: 0; background: var(--chat-bg); }
.chat-empty { flex: 1; display: grid; place-items: center; color: var(--faint); text-align: center; line-height: 1.7; }
.chat-panel { flex: 1; display: flex; flex-direction: column; min-height: 0; position: relative; }
.chat-head { display: flex; align-items: center; gap: 2px; padding: calc(9px + env(safe-area-inset-top)) 8px 9px; background: var(--panel); border-bottom: 1px solid var(--line); }
.back { display: none; }
.chat-title { flex: 1; min-width: 0; display: flex; align-items: center; gap: 7px; padding: 6px 8px; border: 0; background: none; cursor: pointer; text-align: left; border-radius: 8px; }
.chat-title h2 { margin: 0; font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -.02em; }
#chat-sub { color: var(--faint); font-size: 14px; flex: none; }
.title-icon { width: 15px; height: 15px; color: var(--faint); }

.notice-bar {
  position: absolute; top: calc(57px + env(safe-area-inset-top)); left: 10px; right: 10px; z-index: 5;
  display: flex; align-items: center; gap: 2px; padding: 4px 4px 4px 2px; background: var(--panel); border-radius: 14px; box-shadow: 0 4px 16px rgba(0,0,0,.08);
}
.notice-main { flex: 1; min-width: 0; display: flex; align-items: center; gap: 8px; border: 0; background: none; padding: 7px 8px; cursor: pointer; text-align: left; }
.notice-main svg { color: var(--primary); width: 20px; height: 20px; }
.notice-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; }
.notice-btn { border: 0; background: none; color: var(--faint); font-size: 12.5px; cursor: pointer; padding: 6px 8px; border-radius: 8px; flex: none; }
.notice-btn:hover { background: var(--panel-2); }
.notice-btn.icon { padding: 4px; display: grid; }
.notice-btn svg { width: 18px; height: 18px; }
.notice-pill { position: absolute; top: calc(65px + env(safe-area-inset-top)); right: 14px; z-index: 5; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--panel); color: var(--primary); display: grid; place-items: center; cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,.1); }
.notice-pill svg { width: 20px; height: 20px; }
.has-notice .messages { padding-top: 64px; }

.messages { flex: 1; overflow-y: auto; overflow-x: hidden; padding: 8px 16px 18px; overscroll-behavior: contain; }
.bubble, .poll, .bubble.media, .bubble.file { max-width: 100%; }
.line { max-width: 100%; min-width: 0; }
.messages { container-type: inline-size; }
@container (max-width: 460px) {
  .msg-body { max-width: calc(100% - 46px) !important; }
  .msg.mine .msg-body { max-width: 92% !important; }
  .more-btn { display: none; }
  .msg > .avatar, .avatar-space { width: 32px; height: 32px; border-radius: 12px; font-size: 11px; }
}
.line > .bubble, .line > .poll { min-width: 0; flex: 0 1 auto; }
.bubble.file { min-width: 0 !important; }
.drop-hint { position: absolute; inset: 60px 16px 80px; border: 2px dashed var(--primary); border-radius: 18px; display: grid; place-items: center; background: color-mix(in srgb, var(--primary-soft) 85%, transparent); color: var(--primary); font-weight: 700; z-index: 20; pointer-events: none; }
.load-more { text-align: center; padding: 8px 0 2px; }
.loading { text-align: center; color: var(--faint); padding: 40px 0; }
.day-sep { display: flex; justify-content: center; margin: 18px 0 8px; }
.day-sep span { font-size: 12px; color: var(--muted); padding: 4px 12px; border-radius: 999px; background: color-mix(in srgb, var(--panel) 65%, transparent); }
.sys { text-align: center; font-size: 12.5px; color: var(--muted); margin: 12px 0; }

.msg { display: flex; gap: 8px; margin-top: 3px; align-items: flex-start; border-radius: 12px; transition: background .4s; }
.msg.first { margin-top: 12px; }
.msg.flash { background: var(--flash); }
.msg > .avatar, .avatar-space { width: 38px; height: 38px; border-radius: 14px; font-size: 12.5px; flex: none; border: 0; padding: 0; cursor: pointer; }
.msg-body { min-width: 0; max-width: min(72%, 560px); display: flex; flex-direction: column; }
.sender { font-size: 13px; color: var(--muted); margin: 1px 0 4px 2px; border: 0; background: none; padding: 0; cursor: pointer; text-align: left; align-self: flex-start; }
.line { display: flex; align-items: flex-end; gap: 6px; }
.bubble {
  background: var(--bubble-other); padding: 8px 12px; border-radius: 16px; font-size: var(--fs);
  white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.48; box-shadow: 0 1px 1px rgba(0,0,0,.04); min-width: 0;
}
.msg.first:not(.mine) .bubble { border-top-left-radius: 5px; }
.bubble a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }
.msg.mine { justify-content: flex-end; }
.msg.mine .msg-body { align-items: flex-end; }
.msg.mine .line { flex-direction: row-reverse; }
.msg.mine .bubble { background: var(--bubble-mine); color: #fff; }
.msg.mine.first .bubble { border-top-right-radius: 5px; }
.bubble.deleted { background: transparent !important; color: var(--faint) !important; border: 1px dashed var(--line); box-shadow: none; font-style: italic; font-size: calc(var(--fs) - 1.5px); }
.mention { color: var(--primary); font-weight: 700; }
.msg.mine .mention, .msg.mine .mention.me { color: #FFE066; }   /* 내 말풍선(파란색) 위에서도 색으로 구분 */
.mention.me { color: var(--mention); }
.meta { display: flex; flex-direction: column; align-items: flex-start; flex: none; font-size: 11px; color: var(--faint); line-height: 1.3; padding-bottom: 1px; white-space: nowrap; }
.msg.mine .meta { align-items: flex-end; }
.unread { color: var(--unread); font-weight: 700; }
.more-btn { flex: none; border: 0; background: none; color: var(--faint); cursor: pointer; width: 26px; height: 26px; border-radius: 8px; opacity: 0; font-size: 16px; line-height: 1; align-self: center; }
.msg:hover .more-btn { opacity: 1; }
.more-btn:hover { background: color-mix(in srgb, var(--panel) 70%, transparent); }
.touch .more-btn { display: none; }
.touch .bubble { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }

/* 답장 인용 */
.quote { display: block; border: 0; background: none; padding: 0 0 7px; margin: 0 0 7px; border-bottom: 1px solid color-mix(in srgb, currentColor 18%, transparent); cursor: pointer; text-align: left; color: inherit; width: 100%; font-size: calc(var(--fs) - 2px); }
.quote b { display: block; font-weight: 700; margin-bottom: 2px; font-size: 12.5px; }
.quote span { display: block; opacity: .72; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 280px; }

/* 사진 / 파일 */
.bubble.media { padding: 0; overflow: hidden; background: var(--panel-2) !important; cursor: zoom-in; line-height: 0; border-radius: 16px !important; }
.bubble.media img { display: block; width: 100%; height: 100%; object-fit: cover; }
.media-box { width: min(240px, 60vw); max-height: 320px; background: var(--line); }
.bubble.file { display: flex; align-items: center; gap: 10px; cursor: pointer; width: 260px; }
.bubble.file .fico { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.msg.mine .bubble.file .fico { background: rgba(255,255,255,.2); color: #fff; }
.bubble.file .finfo { min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.bubble.file .fname { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bubble.file .fsize { font-size: 12px; opacity: .7; }
.pending .bubble { opacity: .6; }

/* 반응 */
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.rx-chip { display: inline-flex; align-items: center; gap: 3px; padding: 2px 8px 2px 6px; border-radius: 999px; border: 1px solid var(--line); background: var(--panel); font-size: 13px; cursor: pointer; line-height: 1.5; }
.rx-chip.mine { border-color: var(--primary); background: var(--primary-soft); color: var(--primary); font-weight: 700; }

/* 투표 */
.poll { background: var(--bubble-other); border-radius: 16px; padding: 14px; width: 290px; box-shadow: 0 1px 1px rgba(0,0,0,.04); font-size: var(--fs); }
.msg.first:not(.mine) .poll { border-top-left-radius: 5px; }
.msg.mine.first .poll { border-top-right-radius: 5px; }
.poll-head { display: flex; align-items: center; gap: 6px; color: var(--primary); font-weight: 700; font-size: 12.5px; margin-bottom: 6px; }
.poll-head svg { width: 15px; height: 15px; }
.poll-head .tag { margin-left: auto; color: var(--faint); font-weight: 600; }
.poll-q { font-weight: 700; margin-bottom: 10px; line-height: 1.4; white-space: pre-wrap; word-break: keep-all; }
.poll-opt { position: relative; display: flex; align-items: center; gap: 8px; width: 100%; padding: 9px 11px; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel-2); cursor: pointer; overflow: hidden; text-align: left; font-size: calc(var(--fs) - 1px); }
.poll-opt:disabled { cursor: default; }
.poll-opt .bar { position: absolute; inset: 0 auto 0 0; background: var(--primary-soft); transition: width .3s; }
.poll-opt > span { position: relative; }
.poll-opt .ptxt { flex: 1; min-width: 0; word-break: keep-all; }
.poll-opt .pcnt { font-weight: 700; color: var(--muted); font-size: 13px; }
.poll-opt .chk { width: 18px; height: 18px; border-radius: 50%; border: 2px solid var(--faint); flex: none; display: grid; place-items: center; }
.poll-opt.multi .chk { border-radius: 5px; }
.poll-opt.sel { border-color: var(--primary); }
.poll-opt.sel .chk { background: var(--primary); border-color: var(--primary); }
.poll-opt.sel .chk::after { content: ""; width: 7px; height: 4px; border: 2px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.poll-foot { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--muted); margin-top: 4px; flex-wrap: wrap; }
.poll-foot button { border: 0; background: none; color: var(--primary); font-size: 12.5px; cursor: pointer; padding: 2px 4px; font-weight: 600; }
.poll-foot .grow { flex: 1; }

/* 하단 입력 영역 */
.bottom { position: relative; }
.sched-bar { display: flex; align-items: center; gap: 6px; width: 100%; border: 0; border-top: 1px solid var(--line); background: var(--panel); color: var(--primary); padding: 8px 16px; font-size: 13px; font-weight: 600; cursor: pointer; }
.sched-bar svg { width: 16px; height: 16px; }
.reply-bar { display: flex; align-items: center; gap: 8px; padding: 8px 8px 8px 16px; background: var(--panel); border-top: 1px solid var(--line); }
.reply-info { flex: 1; min-width: 0; display: flex; flex-direction: column; font-size: 13px; border-left: 3px solid var(--primary); padding-left: 10px; }
.reply-info strong { color: var(--primary); }
.reply-info span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.input-lock-bar { display: flex; align-items: center; gap: 8px; padding: 12px 12px calc(12px + env(safe-area-inset-bottom)) 16px; background: var(--panel); border-top: 1px solid var(--line); color: var(--muted); font-size: 14px; }
.input-lock-bar svg { width: 18px; height: 18px; }
.input-lock-bar span { flex: 1; }
.composer { display: flex; align-items: flex-end; gap: 6px; padding: 10px 10px calc(10px + env(safe-area-inset-bottom)); background: var(--panel); border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); background: var(--panel-2); border-radius: 20px; padding: 9px 15px; max-height: 140px; line-height: 1.45; outline: none; min-height: 40px; font-size: var(--fs); }
.composer textarea:focus { border-color: var(--primary); background: var(--panel); }
.attach-btn { width: 40px; height: 40px; border-radius: 50%; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; flex: none; transition: transform .2s; }
.attach-btn:hover { background: var(--panel-2); }
.attach-btn.open { transform: rotate(45deg); color: var(--text); }
.send { width: 40px; height: 40px; border-radius: 50%; border: 0; flex: none; cursor: pointer; background: var(--primary); color: #fff; display: grid; place-items: center; transition: opacity .15s; }
.send svg { width: 20px; height: 20px; }
.send:disabled { opacity: .3; cursor: default; }
.attach-menu { position: absolute; bottom: 100%; left: 10px; margin-bottom: 8px; display: grid; grid-template-columns: repeat(4, 76px); gap: 4px; padding: 12px 10px; background: var(--panel); border-radius: 18px; box-shadow: var(--shadow); z-index: 10; }
.attach-menu button { display: flex; flex-direction: column; align-items: center; gap: 7px; border: 0; background: none; cursor: pointer; font-size: 12.5px; color: var(--muted); padding: 4px 0; border-radius: 10px; }
.attach-menu button:hover { background: var(--panel-2); }
.attach-menu .ico { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; color: #fff; }
.ico.c1 { background: #12B886; } .ico.c2 { background: #4C6EF5; } .ico.c3 { background: #F59F00; } .ico.c4 { background: #BE4BDB; }
.mention-pop { position: absolute; bottom: 100%; left: 10px; right: 10px; margin: 0 0 8px; padding: 6px; list-style: none; background: var(--panel); border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); z-index: 10; max-height: min(360px, 50vh); overflow-y: auto; }
.mention-pop.below { bottom: auto; top: 100%; left: 0; right: 0; margin: 6px 0 0; max-height: 260px; }
.mention-wrap { position: relative; display: block; }
.mention-pop li { display: flex; align-items: center; gap: 12px; padding: 8px 10px; border-radius: 10px; cursor: pointer; font-size: 15px; color: var(--text); font-weight: 400; }
.mention-pop li.sel, .mention-pop li:hover { background: var(--panel-2); }
.mention-pop li b { font-weight: 700; white-space: nowrap; }
.mention-pop .avatar { width: 36px; height: 36px; border-radius: 12px; font-size: 12px; }
.mention-pop .all-av { background: #15AABF; color: #fff; font-size: 18px; font-weight: 700; }
.mention-pop .mrole { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.mention-pop .mdesc { margin-left: auto; color: var(--muted); font-size: 13.5px; white-space: nowrap; }

/* 앱 내 알림 */
.inapp {
  position: fixed; top: calc(10px + env(safe-area-inset-top)); left: 50%; transform: translateX(-50%); z-index: 150;
  width: min(420px, calc(100vw - 24px)); display: flex; align-items: center; gap: 10px; padding: 10px 14px; text-align: left;
  background: var(--panel); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); cursor: pointer; animation: drop .25s ease-out;
}
.inapp .avatar { width: 38px; height: 38px; border-radius: 14px; font-size: 12px; }
.inapp .t { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.inapp b { font-size: 14px; }
.inapp span { color: var(--muted); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
@keyframes drop { from { opacity: 0; transform: translate(-50%, -12px); } }

/* ---------- 대화상자 ---------- */
dialog.sheet { border: 0; padding: 0; border-radius: 20px; background: var(--panel); color: var(--text); width: min(440px, calc(100vw - 32px)); max-height: min(700px, calc(100dvh - 48px)); box-shadow: var(--shadow); }
dialog.sheet.tall { height: min(640px, calc(100dvh - 48px)); }
dialog.sheet.small-sheet { width: min(360px, calc(100vw - 32px)); }
dialog.sheet[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: rgba(10, 12, 16, .45); }
.sheet-inner { flex: 1; min-height: 0; display: flex; flex-direction: column; margin: 0; }
.sheet-inner > header { display: flex; align-items: center; justify-content: space-between; padding: 16px 12px 8px 20px; }
.sheet-inner h3 { margin: 0; font-size: 17px; }
.sheet-inner > .pad { padding: 4px 20px 0; margin: 0; }
.sheet-inner > .search { padding: 4px 20px 6px; }
.sheet-body { padding: 4px 20px 12px; overflow-y: auto; flex: 1; min-height: 0; }
.list.scroll { flex: 1; overflow-y: auto; min-height: 140px; }
.sheet-inner > footer { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 20px calc(16px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
.sheet-inner > footer.stack { flex-direction: column; align-items: stretch; }
label.item { margin: 0; font-size: 15px; font-weight: 400; color: var(--text); }
.check input { width: 20px; height: 20px; margin: 0; accent-color: var(--primary); flex: none; }
.info-box { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; background: var(--panel-2); border-radius: 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.settings-group { background: var(--panel-2); border-radius: 14px; padding: 2px 14px; }
.settings-group.gap { margin-top: 14px; }
.settings-group .hint { padding-bottom: 10px; margin-top: 0; }
.switch-row { display: flex !important; align-items: center; justify-content: space-between; gap: 12px; padding: 11px 0; margin: 0 !important; font-size: 15px !important; font-weight: 500 !important; color: var(--text) !important; cursor: pointer; }
.switch-row + .switch-row { border-top: 1px solid var(--line); }
.switch-row span { display: flex; align-items: center; gap: 8px; }
.switch-row small { font-size: 12px; font-weight: 400; }
.switch { appearance: none; -webkit-appearance: none; width: 46px; height: 28px; border-radius: 14px; background: var(--line); position: relative; cursor: pointer; flex: none; margin: 0; transition: background .2s; }
.switch::after { content: ""; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,.25); transition: transform .2s; }
.switch:checked { background: var(--primary); }
.switch:checked::after { transform: translateX(18px); }
.dl-row { display: flex; align-items: center; gap: 8px; padding: 12px 0 8px; font-size: 14.5px; overflow-wrap: anywhere; }
.dl-actions { padding-bottom: 6px; }
.row-btn { display: block; width: 100%; text-align: left; border: 0; border-top: 1px solid var(--line); background: none; padding: 12px 0; cursor: pointer; font-size: 15px; }
.segmented { display: flex; background: var(--panel-2); border-radius: 12px; padding: 4px; }
.segmented button { flex: 1; border: 0; background: none; padding: 8px 0; border-radius: 9px; font-weight: 600; color: var(--muted); cursor: pointer; font-size: 13.5px; }
.segmented button.active { background: var(--panel); color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.font-preview { background: var(--chat-bg); border-radius: 12px; padding: 14px; margin-top: 8px; }
.font-preview .bubble { display: inline-block; }
.me-row { border-radius: 14px; background: var(--panel-2); padding: 12px 14px; margin-top: 4px; }

/* 채팅방 설정 */
.room-hero { display: flex; align-items: center; gap: 14px; padding: 6px 0 12px; }
.hero-avatar { border: 0; padding: 0; background: none; cursor: default; position: relative; }
.hero-avatar.editable { cursor: pointer; }
.hero-avatar .avatar { width: 62px; height: 62px; border-radius: 22px; font-size: 18px; }
.hero-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.hero-text strong { font-size: 17px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#room-photo-actions { margin: 0; }
.invite-row { padding-left: 2px; padding-right: 2px; }
.invite-row .avatar { width: 40px; height: 40px; border-radius: 15px; }
#room-members .item { padding-left: 2px; padding-right: 2px; }
#room-members .avatar { width: 40px; height: 40px; border-radius: 15px; }
.kick-btn { font-size: 12.5px; padding: 5px 10px; }

/* 프로필 */
.profile-sheet .sheet-inner > header { padding-bottom: 0; }
.pview { display: flex; flex-direction: column; align-items: center; text-align: center; padding: 0 24px 18px; }
.pview-avatar { border: 0; padding: 0; background: none; cursor: zoom-in; margin-bottom: 14px; }
.pview-avatar .avatar { width: 108px; height: 108px; border-radius: 38px; font-size: 30px; }
.pview h3 { font-size: 21px; margin: 0 0 4px; }
.pview p { margin: 0; }
.pview-status { margin-top: 10px !important; padding: 8px 14px; background: var(--panel-2); border-radius: 12px; font-size: 14px; max-width: 100%; word-break: keep-all; }
.pview-status:empty { display: none; }
#pview-phone { margin-top: 8px; }
.pview-actions { justify-content: center !important; gap: 10px !important; }
.pview-actions .btn { flex: 1; max-width: 180px; }
.pedit-photo { display: flex; align-items: center; gap: 16px; margin: 4px 0 18px; }
.pedit-photo .avatar { width: 72px; height: 72px; border-radius: 26px; font-size: 20px; }

/* 메시지 메뉴 */
.react-row { display: flex; justify-content: space-between; gap: 2px; padding: 14px 12px 10px; border-bottom: 1px solid var(--line); }
.react-row button { width: 38px; height: 38px; border-radius: 12px; border: 0; background: none; font-size: 22px; cursor: pointer; display: grid; place-items: center; }
.react-row button:hover { background: var(--panel-2); }
.react-row button.mine { background: var(--primary-soft); box-shadow: inset 0 0 0 1.5px var(--primary); }
.msg-menu { display: flex; flex-direction: column; padding: 6px 0; }
.msg-menu button { display: flex; align-items: center; gap: 12px; padding: 12px 20px; border: 0; background: none; cursor: pointer; text-align: left; font-size: 15px; }
.msg-menu button:hover { background: var(--panel-2); }
.msg-menu button svg { width: 20px; height: 20px; color: var(--muted); }
.msg-menu button.danger { color: var(--danger); }
.msg-menu button.danger svg { color: var(--danger); }
.menu-sep { border: 0; border-top: 1px solid var(--line); margin: 4px 14px; }
/* 우클릭 위치에 뜨는 작은 메뉴 */
dialog.sheet.ctx { margin: 0 !important; position: fixed; right: auto !important; bottom: auto !important; width: 230px !important; max-width: calc(100vw - 16px); border-radius: 12px !important; border: 1px solid var(--line); box-shadow: 0 8px 28px rgba(0,0,0,.22); }
dialog.sheet.ctx::backdrop { background: transparent; }
dialog.sheet.ctx .msg-menu { padding: 6px 0; }
dialog.sheet.ctx .msg-menu button { padding: 9px 16px; font-size: 14.5px; gap: 11px; }
dialog.sheet.ctx .msg-menu svg { width: 19px; height: 19px; }
/* 마우스를 올리면 나오는 반응 바 */
.hover-bar { position: fixed; z-index: 40; display: flex; align-items: center; gap: 2px; padding: 4px 6px; background: var(--panel); border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 6px 20px rgba(0,0,0,.14); }
.hover-bar button { width: 34px; height: 34px; border: 0; background: none; border-radius: 9px; cursor: pointer; display: grid; place-items: center; font-size: 20px; color: var(--muted); transition: transform .1s; }
.hover-bar button:hover { background: var(--panel-2); transform: scale(1.12); }
.hover-bar button.mine { background: var(--primary-soft); }
.hover-bar #hb-emojis { display: flex; gap: 2px; }
.hover-bar svg { width: 20px; height: 20px; }
.hover-bar .hb-more { font-size: 18px; }
.hb-sep { width: 1px; height: 20px; background: var(--line); margin: 0 3px; }
/* 전달 */
.fwd-preview { margin: 0 20px 6px; padding: 10px 12px; background: var(--panel-2); border-radius: 12px; display: flex; flex-direction: column; gap: 2px; font-size: 13.5px; }
.fwd-preview span { color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.react-who { padding: 0 20px 14px; font-size: 13px; color: var(--muted); line-height: 1.7; }
.react-who:empty { display: none; }

/* 투표 만들기 */
.poll-opts-edit { display: flex; flex-direction: column; gap: 8px; margin-bottom: 10px; }
.poll-opt-row { display: flex; gap: 6px; align-items: center; }
.poll-opt-row input { margin-top: 0 !important; }

/* 예약 */
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { border: 1px solid var(--line); background: var(--panel); border-radius: 999px; padding: 6px 12px; font-size: 13px; cursor: pointer; }
.chip:hover { background: var(--panel-2); }
.sched-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.sched-list li { display: flex; align-items: flex-start; gap: 10px; padding: 10px 12px; background: var(--panel-2); border-radius: 12px; }
.sched-list .st { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.sched-list .st b { font-size: 12.5px; color: var(--primary); }
.sched-list .st span { font-size: 14px; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; }

/* 검색 결과 */
.results .item { align-items: flex-start; }
.results .avatar { width: 38px; height: 38px; border-radius: 14px; font-size: 12px; }
.results .item-sub { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
mark { background: color-mix(in srgb, #FFD43B 60%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }

/* 사진 보기 */
dialog.viewer { border: 0; padding: 0; margin: 0; width: 100vw; height: 100dvh; max-width: none; max-height: none; background: rgba(0,0,0,.92); }
dialog.viewer[open] { display: grid; place-items: center; }
dialog.viewer img { max-width: 100vw; max-height: 100dvh; object-fit: contain; }
.viewer-bar { position: fixed; top: calc(10px + env(safe-area-inset-top)); right: 10px; display: flex; gap: 6px; }
.viewer-bar .icon-btn { color: #fff; background: rgba(255,255,255,.12); }

.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(22,24,30,.94); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 14px; z-index: 300; max-width: calc(100vw - 32px); text-align: center; line-height: 1.45; }

/* ---------- 모바일 ---------- */
/* 핸드폰(터치 + 좁은 화면)에서만 한 화면씩 전환. PC는 창 크기와 관계없이 목록 + 대화 함께 표시 */
@media (max-width: 760px) and (pointer: coarse) {
  .main { grid-template-columns: 1fr; }
  .resizer { display: none; }
  .chat { display: none; }
  body.room-open .sidebar { display: none; }
  body.room-open .chat { display: flex; }
  .back { display: grid; }
  .chat-title { padding-left: 2px; }
  .messages { padding: 6px 12px 16px; }
  .msg-body { max-width: 78%; }
  input, textarea { font-size: max(16px, var(--fs)) !important; }
  dialog.sheet { width: 100%; max-width: 100%; margin: auto 0 0; border-radius: 20px 20px 0 0; max-height: 90dvh; }
  dialog.sheet.small-sheet { width: 100%; }
  dialog.sheet.tall { height: 90dvh; }
  .attach-menu { right: 10px; grid-template-columns: repeat(4, 1fr); }
}

/* ---------- 오른쪽 채팅방 서랍 ---------- */
.chat { flex-direction: row; container-type: inline-size; container-name: chatarea; }
.chat-empty, .chat-panel { flex: 1; min-width: 0; }
.room-panel { width: 340px; flex: none; display: flex; flex-direction: column; min-height: 0; background: var(--panel); border-left: 1px solid var(--line); }
.rp-head { display: flex; align-items: center; padding: calc(9px + env(safe-area-inset-top)) 8px 4px; }
.rp-head .grow { flex: 1; }
#rp-mute.off { color: var(--faint); }
.rp-body { flex: 1; overflow-y: auto; padding: 0 14px calc(16px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.rp-hero { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; padding: 4px 0 6px; }
.rp-hero .hero-avatar .avatar { width: 76px; height: 76px; border-radius: 26px; font-size: 22px; }
.rp-hero strong { font-size: 17px; margin-top: 8px; word-break: keep-all; }
.row-actions.center { justify-content: center; margin-top: 6px; }
.rp-card { background: var(--panel-2); border-radius: 14px; padding: 14px 16px; }
.rp-card.clickable { cursor: pointer; }
.rp-card.clickable:hover { background: color-mix(in srgb, var(--panel-2) 80%, var(--primary-soft)); }
.rp-card-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.rp-card-head b { font-size: 15px; }
.rp-link { border: 0; background: none; color: var(--muted); font-size: 13.5px; cursor: pointer; padding: 2px 0; }
#btn-invite.rp-link { color: var(--primary); font-weight: 600; }
.rp-avatars { display: flex; align-items: center; gap: 8px; margin-top: 12px; border: 0; background: none; padding: 0; cursor: pointer; }
.rp-avatars .avatar { width: 36px; height: 36px; border-radius: 13px; font-size: 12px; }
.rp-more-count { width: 36px; height: 36px; border-radius: 13px; background: var(--panel); color: var(--muted); display: grid; place-items: center; font-size: 13px; font-weight: 700; }
#room-members { margin-top: 8px; }
#room-members .item { padding: 7px 2px; }
#room-members .avatar { width: 38px; height: 38px; border-radius: 14px; font-size: 12px; }
.rp-settings { padding-top: 4px; padding-bottom: 4px; }
.rp-text { margin: 10px 0 0; color: var(--text); font-size: 14px; line-height: 1.5; white-space: pre-wrap; word-break: keep-all; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.rp-list { list-style: none; margin: 8px 0 0; padding: 0; display: flex; flex-direction: column; }
.rp-list li { display: flex; align-items: center; gap: 10px; padding: 9px 4px; border-radius: 10px; cursor: pointer; min-width: 0; }
.rp-list li:hover { background: var(--panel); }
#rp-poll-list li { flex-direction: column; align-items: flex-start; gap: 2px; }
#rp-poll-list b { font-size: 14px; }
.rp-list .fico { width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); flex: none; }
.rp-li-main { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rp-li-main b { font-size: 14px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-url { color: var(--primary); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }
.rp-tabs { display: flex; margin: -4px -6px 10px; border-bottom: 1px solid var(--line); }
.rp-tabs button { flex: 1; border: 0; background: none; padding: 9px 0 10px; font-weight: 600; font-size: 14px; color: var(--faint); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.rp-tabs button.active { color: var(--primary); border-bottom-color: var(--primary); }
.rp-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.rp-tile { aspect-ratio: 1; border: 0; padding: 0; border-radius: 6px; overflow: hidden; background: var(--line); cursor: pointer; position: relative; display: grid; place-items: center; }
.rp-tile img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-video { font-size: 22px; color: var(--muted); }
.rp-vname { position: absolute; left: 4px; right: 4px; bottom: 4px; font-size: 10.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rp-empty { color: var(--faint); font-size: 13.5px; text-align: center; padding: 16px 0; margin: 0; }
.rp-more { width: 100%; margin-top: 10px; border: 0; background: var(--panel); border-radius: 10px; padding: 9px; cursor: pointer; color: var(--muted); font-weight: 600; }
.rp-leave { margin-top: 4px; }
/* 대화 영역이 좁으면 서랍이 대화 위를 덮음 */
@container chatarea (max-width: 720px) {
  .room-panel { position: absolute; top: 0; right: 0; bottom: 0; width: min(360px, 100%); z-index: 30; box-shadow: -8px 0 30px rgba(0,0,0,.18); }
}
@media (max-width: 760px) and (pointer: coarse) {
  .room-panel { position: fixed; inset: 0; width: 100%; z-index: 60; border-left: 0; }
}

/* 대화 목록 필터 (전체 / 안 읽음) */
.room-filter { display: flex; gap: 6px; padding: 10px 14px 4px; }
.room-filter button { border: 1px solid var(--line); background: var(--panel); color: var(--muted); border-radius: 999px; padding: 6px 13px; font-size: 13.5px; font-weight: 600; cursor: pointer; display: inline-flex; align-items: center; gap: 5px; }
.room-filter button.active { background: var(--text); color: var(--panel); border-color: var(--text); }
.rf-count { background: var(--badge); color: #fff; border-radius: 9px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px; display: inline-grid; place-items: center; }

/* ---------- 할 일 ---------- */
.todo-pane { padding: 10px 10px 16px; }
.todo-new { margin: 2px 0 10px; }
.tcat-list { display: flex; flex-direction: column; gap: 2px; }
.tcat-list button { display: flex; align-items: center; gap: 12px; padding: 11px 12px; border: 0; background: none; border-radius: 12px; cursor: pointer; font-size: 15.5px; font-weight: 600; color: var(--text); text-align: left; }
.tcat-list button svg { width: 22px; height: 22px; color: var(--muted); }
.tcat-list button span { flex: 1; }
.tcat-list button b { font-size: 13px; color: var(--muted); font-weight: 700; }
.tcat-list button:hover { background: var(--panel-2); }
.tcat-list button.active { background: var(--primary-soft); color: var(--primary); }
.tcat-list button.active svg { color: var(--primary); }
.tcat-sep { height: 1px; background: var(--line); margin: 10px 4px; }
.tcat-list .section-label { padding: 2px 12px 4px; }

.todo-view { flex: 1; min-width: 0; display: flex; flex-direction: column; background: var(--panel); }
body.mode-todo #chat-empty, body.mode-todo #chat-panel, body.mode-todo #room-panel { display: none !important; }
.todo-head { display: flex; align-items: center; gap: 6px; padding: calc(12px + env(safe-area-inset-top)) 16px 12px 20px; border-bottom: 1px solid var(--line); }
.todo-head .back { display: grid; margin-left: -10px; }
.todo-head h2 { flex: 1; margin: 0; font-size: 18px; }
#todo-sort { border: 1px solid var(--line); background: var(--panel); border-radius: 10px; padding: 8px 10px; font-size: 14px; cursor: pointer; }
.todo-body { flex: 1; overflow-y: auto; padding: 4px 24px 24px; }
.todo-empty { text-align: center; color: var(--faint); padding: 60px 0; white-space: pre-line; line-height: 1.7; }
.todo-list { list-style: none; margin: 0; padding: 0; }
.todo-item { display: flex; gap: 14px; padding: 18px 6px; border-bottom: 1px solid var(--line); cursor: pointer; align-items: flex-start; border-radius: 4px; }
.todo-item:hover { background: var(--panel-2); }
.todo-check { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--faint); background: none; flex: none; cursor: pointer; display: grid; place-items: center; margin-top: 1px; padding: 0; color: var(--faint); transition: background .15s, border-color .15s; }
.todo-check:hover { border-color: var(--primary); }
.todo-check.on { background: var(--primary); border-color: var(--primary); }
.todo-check.on::after { content: ""; width: 9px; height: 5px; border: 2.5px solid #fff; border-top: 0; border-right: 0; transform: rotate(-45deg) translate(1px, -1px); }
.todo-check.ghost { border-style: dashed; cursor: default; }
.todo-check.ghost svg { width: 13px; height: 13px; }
.todo-main { flex: 1; min-width: 0; }
.todo-text { font-size: calc(var(--fs) + .5px); line-height: 1.45; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.todo-item.is-done .todo-text { color: var(--faint); text-decoration: line-through; }
.todo-new-dot { display: inline-block; font-size: 10.5px; font-weight: 800; color: #fff; background: var(--badge); border-radius: 6px; padding: 1px 5px; margin-right: 6px; vertical-align: 2px; }
.todo-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 8px; }
.todo-date { color: var(--faint); font-size: 13px; }
.tchip { display: inline-flex; align-items: center; gap: 4px; background: var(--panel-2); color: var(--muted); border-radius: 6px; padding: 2px 8px; font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.tchip.due { color: var(--primary); background: var(--primary-soft); }
.tchip.due.today { color: #B7791F; background: color-mix(in srgb, #F6C343 24%, transparent); }
.tchip.due.over { color: var(--danger); background: color-mix(in srgb, var(--danger) 13%, transparent); }
.tchip.ok { color: #2B8A3E; background: color-mix(in srgb, #40C057 16%, transparent); }

.todo-form, .todo-detail { max-width: 760px; padding-top: 16px; display: flex; flex-direction: column; gap: 12px; }
.todo-textarea { width: 100%; border: 1px solid var(--line); background: var(--panel-2); border-radius: 14px; padding: 16px 18px; font-size: calc(var(--fs) + .5px); line-height: 1.5; resize: vertical; outline: none; min-height: 140px; }
.todo-textarea:focus { border-color: var(--primary); background: var(--panel); }
.todo-src { display: flex; align-items: center; gap: 6px; margin: 0; color: var(--muted); font-size: 13px; }
.due-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; color: var(--muted); }
.due-row .chip.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.todo-date-input { width: auto !important; align-self: flex-start; border: 1px solid var(--line); background: var(--panel-2); border-radius: 10px; padding: 8px 10px; }
.todo-sep { height: 1px; background: var(--line); margin: 6px 0; }
.todo-ahead { display: flex; align-items: center; justify-content: space-between; }
.todo-ahead b { font-size: 15.5px; }
.rp-link.add { color: var(--primary); font-weight: 600; font-size: 14.5px; }
.todo-hint { text-align: center; color: var(--faint); line-height: 1.7; white-space: pre-line; padding: 30px 0; margin: 0; }
.todo-assignees { display: flex; flex-wrap: wrap; gap: 8px; }
.person-chip { display: inline-flex; align-items: center; gap: 8px; padding: 4px 6px 4px 4px; border: 1px solid var(--line); border-radius: 999px; font-size: 14px; }
.person-chip .avatar { width: 28px; height: 28px; border-radius: 50%; font-size: 10.5px; }
.person-chip .x { border: 0; background: none; color: var(--faint); font-size: 18px; cursor: pointer; padding: 0 4px; line-height: 1; }
.todo-form-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }
.todo-detail-text { font-size: calc(var(--fs) + 2px); line-height: 1.55; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; font-weight: 600; }
.todo-info { display: grid; grid-template-columns: 56px 1fr; gap: 8px 12px; margin: 4px 0 0; font-size: 14px; }
.todo-info dt { color: var(--faint); }
.todo-info dd { margin: 0; }
.todo-detail > .btn.small { align-self: flex-start; }
.todo-people .item { padding-left: 2px; padding-right: 2px; cursor: default; }
.todo-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

/* 대화방 안의 할 일 카드 */
.todo-card { background: var(--bubble-other); border-radius: 16px; padding: 14px; width: 270px; max-width: 100%; box-shadow: 0 1px 1px rgba(0,0,0,.04); font-size: var(--fs); }
.msg.first:not(.mine) .todo-card { border-top-left-radius: 5px; }
.msg.mine.first .todo-card { border-top-right-radius: 5px; }
.todo-card-text { font-weight: 600; margin: 2px 0 12px; white-space: pre-wrap; word-break: keep-all; overflow-wrap: anywhere; line-height: 1.45; }
.todo-card .btn { width: 100%; }
.line > .todo-card { min-width: 0; flex: 0 1 auto; }

@media (max-width: 760px) and (pointer: coarse) {
  body.mode-todo:not(.todo-open) .chat { display: none; }
  body.todo-open .sidebar { display: none; }
  body.todo-open .chat { display: flex; }
  .todo-body { padding: 4px 16px 24px; }
}

/* 영상 */
.bubble.media.video { background: #000 !important; cursor: default; }
.bubble.media.video video { width: 100%; height: 100%; object-fit: contain; display: block; background: #000; }
dialog.viewer video { max-width: 100vw; max-height: 100dvh; background: #000; }
.rp-tile .rp-video { position: absolute; inset: 0; display: grid; place-items: center; color: #fff; font-size: 22px; text-shadow: 0 1px 6px rgba(0,0,0,.5); }
.rp-tile:not(:has(img)) .rp-video { color: var(--muted); text-shadow: none; }

/* ---------- 설치·사용법 안내 ---------- */
.install-chip { display: flex; align-items: center; justify-content: center; gap: 6px; margin: 0 12px 8px; padding: 9px 12px; border: 1px dashed var(--primary); border-radius: 12px; background: var(--primary-soft); color: var(--primary); font-weight: 700; font-size: 14px; cursor: pointer; }
.coach { position: fixed; inset: 0; z-index: 400; pointer-events: none; }
.coach-hole { position: fixed; border-radius: 14px; box-shadow: 0 0 0 9999px rgba(8, 10, 16, .74); transition: left .35s ease, top .35s ease, width .35s ease, height .35s ease, border-radius .35s; pointer-events: none; }
.coach-hole.none { box-shadow: 0 0 0 9999px rgba(8, 10, 16, .74); }
.coach-hole.edge { border-radius: 999px; background: radial-gradient(circle, rgba(255,212,59,.35), rgba(255,212,59,.05) 70%); }
.coach-hole.edge.pulse::after { border-radius: 999px; }
.coach-hole.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 18px; border: 3px solid #FFD43B; animation: coachPulse 1.4s ease-out infinite; }
@keyframes coachPulse { 0% { opacity: 1; transform: scale(1); } 100% { opacity: 0; transform: scale(1.18); } }
.coach-block { position: fixed; pointer-events: auto; background: transparent; }
.coach-arrow { position: fixed; width: 40px; text-align: center; font-size: 40px; font-weight: 900; color: #FFD43B; text-shadow: 0 2px 8px rgba(0,0,0,.5); pointer-events: none; }
.coach-arrow.down { animation: bounceDown 1s ease-in-out infinite; }
.coach-arrow.up { animation: bounceUp 1s ease-in-out infinite; }
@keyframes bounceDown { 50% { transform: translateY(10px); } }
@keyframes bounceUp { 50% { transform: translateY(-10px); } }
.coach-card { position: fixed; pointer-events: auto; width: min(340px, calc(100vw - 24px)); background: var(--panel); color: var(--text); border-radius: 18px; padding: 16px 18px 14px; box-shadow: 0 16px 50px rgba(0,0,0,.35); transition: left .35s ease, top .35s ease; }
.coach-card.pop { animation: coachPop .3s ease-out; }
@keyframes coachPop { from { opacity: 0; transform: translateY(6px) scale(.98); } }
.coach-top { display: flex; align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--faint); font-weight: 700; min-height: 18px; }
.coach-skip { border: 0; background: none; color: var(--faint); font-size: 13px; cursor: pointer; padding: 2px 0; text-decoration: underline; }
.coach-card h3 { margin: 6px 0 6px; font-size: 17px; }
.coach-card p { margin: 0; font-size: 14.5px; line-height: 1.6; color: var(--muted); word-break: keep-all; }
.coach-actions { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.coach-hint { margin-right: auto; font-size: 13px; font-weight: 700; color: #E8590C; }
body.coaching .hover-bar { display: none !important; }

/* 읽음 확인 (7.2) */
.meta .unread { border: 0; background: none; padding: 0; margin: 0; font: inherit; font-weight: 700; color: var(--unread); cursor: pointer; display: inline-flex; align-items: center; gap: 1px; line-height: inherit; }
.meta .unread .chev { font-weight: 400; color: var(--faint); font-size: 13px; line-height: 1; }
@media (hover: hover) { .meta .unread:hover { text-decoration: underline; } }
#dlg-list.read-status .sheet-inner { min-height: min(520px, 78vh); }
.read-tabs { justify-content: flex-start; gap: 20px; margin: -4px 0 6px; padding: 0 2px; }
.read-tabs button { flex: none; padding: 8px 2px 10px; color: var(--faint); font-size: 15px; }
.read-tabs button.active { color: var(--text); border-bottom-color: var(--text); }
.read-tabs b { font-weight: 700; }
.empty-read { text-align: center; padding: 40px 0; }
.read-tabs { position: sticky; top: 0; z-index: 1; background: var(--panel); }

/* 이메일 인증 완료 화면 (7.4) */
.confirm-card { text-align: center; }
.confirm-card .brand { justify-content: center; }
.confirm-check { width: 64px; height: 64px; margin: 8px auto 14px; border-radius: 50%; background: var(--primary); color: #fff; font-size: 34px; font-weight: 700; display: grid; place-items: center; }
.confirm-check.fail { background: var(--danger); }
.confirm-card h2 { font-size: 19px; margin: 0 0 10px; }
.confirm-text { color: var(--muted); font-size: 14.5px; line-height: 1.65; margin: 0 0 20px; white-space: pre-line; }
.confirm-card .btn.block { text-decoration: none; display: flex; justify-content: center; }
.confirm-foot { margin: 14px 0 0; }
.confirm-text, .confirm-card h2 { word-break: keep-all; }
.rp-hero .row-actions { align-items: center; }
.rp-hero .row-actions.center { margin-bottom: 10px; }

/* ===== 7.6 글자 서식 ===== */
.md-p { white-space: pre-wrap; }
.md-h { display: block; font-size: 1.16em; font-weight: 700; line-height: 1.4; margin: 1px 0 2px; }
.md-list { margin: 2px 0; padding-left: 1.45em; white-space: normal; }
.md-list li { white-space: pre-wrap; margin: 1px 0; }
.md-list li::marker { color: currentColor; }
.bubble strong { font-weight: 700; }
.md-code { font-family: ui-monospace, "Cascadia Mono", Consolas, "D2Coding", monospace; font-size: .9em; background: rgba(0,0,0,.07); padding: 1px 5px; border-radius: 5px; }
.md-pre { display: block; margin: 4px 0; padding: 8px 11px; background: rgba(0,0,0,.06); border-radius: 8px; white-space: pre-wrap; overflow-wrap: anywhere; font-family: ui-monospace, "Cascadia Mono", Consolas, "D2Coding", monospace; font-size: .88em; line-height: 1.5; }
.msg.mine .md-code, .msg.mine .md-pre { background: rgba(255,255,255,.18); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .md-code, :root:not([data-theme="light"]) .md-pre { background: rgba(255,255,255,.1); } }
:root[data-theme="dark"] .md-code, :root[data-theme="dark"] .md-pre { background: rgba(255,255,255,.1); }

.composer { flex-wrap: wrap; }
.fmt-bar { flex-basis: 100%; order: -1; display: flex; align-items: center; gap: 2px; padding: 0 2px 6px; margin-bottom: 2px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.fmt-bar button { flex: none; min-width: 32px; height: 30px; border: 0; background: none; border-radius: 7px; color: var(--muted); cursor: pointer; font-size: 15px; display: grid; place-items: center; padding: 0 6px; font-family: inherit; }
.fmt-bar button:hover { background: var(--panel-2); color: var(--text); }
.fmt-bar button svg { width: 18px; height: 18px; }
.fmt-bar button i { font-family: Georgia, serif; }
.fmt-sep { width: 1px; height: 18px; background: var(--line); margin: 0 4px; flex: none; }
.fmt-btn svg, .cap-btn svg { width: 21px; height: 21px; }
.fmt-btn.on { color: var(--primary); background: var(--primary-soft); }
.cap-btn.open { color: var(--text); background: var(--panel-2); }
@media (pointer: coarse) { .cap-btn { display: none; } }
.md-preview { margin: 0 12px 6px; padding: 8px 10px; border: 1px dashed var(--line); border-radius: 12px; background: var(--panel); max-height: 180px; overflow-y: auto; }
.md-preview-label { display: block; font-size: 11.5px; color: var(--faint); margin-bottom: 4px; }
.md-preview-body { display: inline-block; max-width: 100%; box-shadow: none; }

/* ===== 채팅방 우클릭 메뉴 ===== */
.msg-menu button .ic-blank { width: 20px; height: 20px; flex: none; }
.msg-menu button.on svg { color: var(--primary); }

/* ===== 캡처 ===== */
.pop-menu { position: absolute; bottom: 100%; right: 56px; margin-bottom: 8px; min-width: 168px; padding: 6px 0; background: var(--panel); border-radius: 12px; box-shadow: var(--shadow); z-index: 12; display: flex; flex-direction: column; }
.pop-menu[hidden] { display: none; }
.pop-menu button, .pop-menu label { display: flex; align-items: center; gap: 10px; padding: 9px 16px; border: 0; background: none; cursor: pointer; font-size: 14.5px; text-align: left; color: var(--text); }
.pop-menu button:hover, .pop-menu label:hover { background: var(--panel-2); }
.pop-menu .ic { width: 19px; height: 19px; color: var(--muted); }
.pop-menu .menu-sep { margin: 4px 10px; }
.pop-menu input[type=checkbox] { width: 17px; height: 17px; margin: 0 2px 0 1px; accent-color: var(--primary); }
body:not(.is-desk) .desk-only { display: none !important; }
dialog.capture-sheet { width: min(860px, calc(100vw - 32px)); }
.capture-body { display: grid; place-items: center; background: var(--panel-2); margin: 0 16px; border-radius: 12px; padding: 12px; }
.capture-body img { max-width: 100%; max-height: min(62vh, 560px); object-fit: contain; border-radius: 6px; box-shadow: 0 1px 6px rgba(0,0,0,.15); }
.capture-actions { display: flex; justify-content: flex-end; gap: 8px; padding: 14px 16px 16px; flex-wrap: wrap; }
.capture-actions .btn { display: inline-flex; align-items: center; gap: 6px; }
.capture-actions .ic { width: 17px; height: 17px; }
.region-picker { position: fixed; inset: 0; z-index: 1000; background: #000; cursor: crosshair; user-select: none; }
.region-picker[hidden] { display: none; }
.region-picker img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: fill; pointer-events: none; }
.region-picker::after { content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.35); pointer-events: none; }
.region-box { position: absolute; z-index: 2; border: 2px solid #4C6EF5; box-shadow: 0 0 0 9999px rgba(0,0,0,.35); background: transparent; pointer-events: none; }
.region-picker:has(.region-box:not([hidden]))::after { display: none; }
.region-tip { position: absolute; top: 18px; left: 50%; transform: translateX(-50%); z-index: 3; background: rgba(20,22,28,.85); color: #fff; padding: 8px 16px; border-radius: 999px; font-size: 14px; pointer-events: none; }
#dlg-capture .capture-actions { justify-content: flex-end !important; } #cap-save { margin-right: auto; }

/* ===== 7.7 서식 입력창 (보이는 그대로 편집) ===== */
.rich-input { flex: 1; min-width: 0; border: 1px solid var(--line); background: var(--panel-2); border-radius: 20px; padding: 9px 15px; max-height: 160px; min-height: 40px; overflow-y: auto; line-height: 1.45; outline: none; font-size: var(--fs); color: var(--text); white-space: pre-wrap; overflow-wrap: anywhere; word-break: keep-all; cursor: text; -webkit-user-select: text; user-select: text; }
.rich-input:focus { border-color: var(--primary); background: var(--panel); }
.rich-input:empty::before { content: attr(data-placeholder); color: var(--faint); pointer-events: none; }
.rich-input > div, .rich-input p { margin: 0; }
.rich-input h1, .rich-input h2, .rich-input h3, .rich-input .md-h { display: block; font-size: 1.16em; font-weight: 700; margin: 1px 0 2px; line-height: 1.4; }
.rich-input ul, .rich-input ol { margin: 2px 0; padding-left: 1.45em; }
.rich-input pre { margin: 4px 0; padding: 7px 10px; background: rgba(0,0,0,.06); border-radius: 8px; white-space: pre-wrap; font-family: ui-monospace, "Cascadia Mono", Consolas, "D2Coding", monospace; font-size: .9em; }
.rich-input code { font-family: ui-monospace, "Cascadia Mono", Consolas, "D2Coding", monospace; font-size: .9em; background: rgba(0,0,0,.07); padding: 1px 5px; border-radius: 5px; }
.rich-input a { color: var(--primary); text-decoration: underline; }
.mention-chip { color: var(--primary); font-weight: 600; background: var(--primary-soft); border-radius: 5px; padding: 0 3px; margin: 0 1px; white-space: nowrap; }
.sched-input { display: block; border-radius: 12px; min-height: 84px; max-height: 220px; margin-top: 6px; font-weight: 400; }
@media (pointer: coarse) { .rich-input { font-size: max(16px, var(--fs)); } }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .rich-input pre, :root:not([data-theme="light"]) .rich-input code { background: rgba(255,255,255,.1); } }
:root[data-theme="dark"] .rich-input pre, :root[data-theme="dark"] .rich-input code { background: rgba(255,255,255,.1); }
.fmt-bar button.on { background: var(--primary-soft); color: var(--primary); }
/* 로그인 옵션 */
.login-opts { display: flex; gap: 18px; margin: -2px 0 14px; }
.login-opts label.check { display: inline-flex; align-items: center; gap: 7px; margin: 0; font-size: 13.5px; font-weight: 500; color: var(--muted); cursor: pointer; }
.login-opts input { width: 17px; height: 17px; margin: 0; accent-color: var(--primary); }

/* ===== 7.9 알림 설정 ===== */
.set-row { display: flex !important; align-items: center; justify-content: space-between; gap: 14px; padding: 11px 0; margin: 0 !important; font-size: 15px !important; font-weight: 400 !important; color: var(--text) !important; cursor: default; border-top: 1px solid var(--line); }
label.set-row { cursor: pointer; }
.settings-group > .set-row:first-child { border-top: 0; }
.set-txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.set-txt b, .set-check b { font-weight: 500; font-size: 15px; }
.set-txt small { font-size: 12.5px; color: var(--faint); line-height: 1.45; font-weight: 400; }
.set-select { flex: none; min-width: 132px; max-width: 46%; padding: 8px 30px 8px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--panel) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%23888' stroke-width='2.4' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center; appearance: none; -webkit-appearance: none; font-size: 14px; color: var(--text); cursor: pointer; }
.set-select:disabled { opacity: .5; cursor: default; }
.set-check { display: inline-flex !important; align-items: center; gap: 9px; margin: 0 !important; cursor: pointer; color: var(--text) !important; }
.set-check input { width: 19px; height: 19px; margin: 0; accent-color: var(--primary); }
#notify-detail.off { opacity: .45; pointer-events: none; }

/* 켜짐/꺼짐 스위치: 어디서든 파란색(켜짐) / 회색(꺼짐)이 분명하게 (7.11) */
:root { --switch-off: #C5CAD3; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) { --switch-off: #4A505C; } }
:root[data-theme="dark"] { --switch-off: #4A505C; }
input.switch, input.switch:focus { background: var(--switch-off) !important; border: 0 !important; }
input.switch:checked, input.switch:checked:focus { background: var(--primary) !important; }
input.switch:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }

/* ===== 7.13 설정: 왼쪽 메뉴 + 오른쪽 내용 ===== */
dialog.sheet.settings-dlg { width: min(860px, calc(100vw - 32px)); height: min(680px, calc(100dvh - 48px)); max-height: none; overflow: hidden; }
.set-shell { display: grid; grid-template-columns: 228px 1fr; height: 100%; min-height: 0; width: 100%; }
.set-nav { display: flex; flex-direction: column; gap: 4px; padding: 18px 12px 12px; border-right: 1px solid var(--line); background: var(--panel); min-height: 0; overflow-y: auto; }
.set-nav-head { display: flex; align-items: center; justify-content: space-between; padding: 0 8px 6px; }
.set-nav-head h3 { margin: 0; font-size: 19px; }
.set-close-m { display: none; }
.set-nav .me-row { margin: 2px 0 8px; border-radius: 12px; }
.set-nav-list { display: flex; flex-direction: column; gap: 2px; padding-top: 6px; border-top: 1px solid var(--line); }
.set-nav-list button, .set-logout { display: flex; align-items: center; gap: 12px; width: 100%; padding: 11px 12px; border: 0; background: none; border-radius: 10px; font-size: 15px; color: var(--text); cursor: pointer; text-align: left; }
.set-nav-list button svg, .set-logout svg { width: 20px; height: 20px; color: var(--muted); flex: none; }
.set-nav-list button:hover, .set-logout:hover { background: var(--panel-2); }
.set-nav-list button.active { background: var(--panel-2); font-weight: 700; }
.set-nav-list button.active svg { color: var(--primary); }
.set-logout { margin-top: auto; color: var(--danger); }
.set-logout svg { color: var(--danger); }
.set-main { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.set-main-head { display: flex; align-items: center; gap: 6px; padding: 16px 12px 8px 24px; }
.set-main-head h3 { margin: 0; flex: 1; font-size: 17px; }
.set-back { display: none; }
.set-body { flex: 1; min-height: 0; overflow-y: auto; padding: 4px 24px 24px; }
.set-sec > .section-label:first-child { margin-top: 4px; }
.set-sec .section-label { display: flex; align-items: center; gap: 8px; }
.set-sec .section-label .rp-link { margin-left: auto; font-size: 12.5px; }
.set-lead { margin: 2px 0 10px; }
.set-val { flex: none; font-weight: 700; color: var(--muted); }
@media (max-width: 680px) {
  dialog.sheet.settings-dlg { width: 100vw; height: 100dvh; max-width: none; border-radius: 0; margin: 0; }
  .set-shell { grid-template-columns: 1fr; }
  .set-nav { border-right: 0; padding-top: calc(16px + env(safe-area-inset-top)); }
  .set-close-m { display: grid; }
  .set-main { display: none; }
  .set-shell.detail .set-nav { display: none; }
  .set-shell.detail .set-main { display: flex; }
  .set-back { display: grid; }
  .set-main-head { padding: calc(12px + env(safe-area-inset-top)) 8px 8px 6px; }
  .set-body { padding: 4px 16px calc(24px + env(safe-area-inset-bottom)); }
}
/* 단축키 */
.sc-row { display: flex; align-items: center; gap: 10px; padding: 9px 0; border-top: 1px solid var(--line); }
.settings-group > .sc-row:first-child { border-top: 0; }
.sc-name { flex: 1; min-width: 0; font-size: 14.5px; }
.sc-key { font-family: inherit; font-size: 13px; font-weight: 600; padding: 4px 10px; border-radius: 7px; background: var(--panel); border: 1px solid var(--line); color: var(--text); white-space: nowrap; min-width: 84px; text-align: center; }
.sc-key.wait { border-color: var(--primary); color: var(--primary); animation: scBlink 1s infinite; }
.sc-key.none { color: var(--faint); font-weight: 400; }
@keyframes scBlink { 50% { opacity: .5; } }
.sc-row .btn.small { padding: 5px 10px; }
/* 데이터 확인 */
.usage-box { padding: 6px 14px 10px; }
.usage-item { padding: 10px 0 6px; border-top: 1px solid var(--line); }
.usage-box > .usage-item:first-child { border-top: 0; }
.usage-top { display: flex; justify-content: space-between; gap: 8px; font-size: 14.5px; margin-bottom: 7px; }
.usage-top span { color: var(--muted); font-size: 13px; white-space: nowrap; }
.usage-bar { height: 8px; border-radius: 4px; background: var(--switch-off); overflow: hidden; }
.usage-bar i { display: block; height: 100%; background: var(--primary); border-radius: 4px; }
.usage-bar i.warn { background: #F59F00; } .usage-bar i.full { background: var(--danger); }
.usage-sub { font-size: 12px; color: var(--faint); margin-top: 5px; }
/* 기기 관리 */
.dev-list { margin-bottom: 10px; }
.dev-list li { display: flex; align-items: center; gap: 12px; padding: 10px 2px; border-top: 1px solid var(--line); }
.dev-list li:first-child { border-top: 0; }
.dev-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--panel-2); display: grid; place-items: center; color: var(--muted); flex: none; }
.dev-ico svg { width: 21px; height: 21px; }
.dev-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.dev-main b { font-size: 14.5px; font-weight: 600; }
.dev-main span { font-size: 12.5px; color: var(--faint); }
.dev-me { font-size: 11.5px; font-weight: 700; color: var(--primary); background: var(--primary-soft); padding: 2px 7px; border-radius: 999px; margin-left: 6px; }
/* 사진 보기 확대 */
dialog.viewer { overflow: hidden; touch-action: none; }
dialog.viewer img.zoomed { cursor: grab; max-width: none; max-height: none; }
dialog.viewer img.dragging { cursor: grabbing; }
dialog.viewer img { transform-origin: 50% 50%; will-change: transform; user-select: none; -webkit-user-drag: none; }
.viewer-zoom { position: fixed; left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%); background: rgba(0,0,0,.6); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; pointer-events: none; }
@media (pointer: coarse) { .set-nav-list [data-sec=shortcut] { display: none; } }

/* ===== 7.14 출근 · 북마크 · 관리자 ===== */
.att-bar { display: flex; align-items: center; gap: 8px; margin: 2px 12px 8px; padding: 8px 8px 8px 12px; border-radius: 12px; background: #FFF4E6; color: #8A4B08; font-size: 13.5px; }
.att-bar .ic { width: 17px; height: 17px; flex: none; }
.att-bar span:not(.att-ok) { flex: 1; }
.att-bar.done { background: var(--panel-2); color: var(--muted); }
.att-ok { color: #2B8A3E; font-weight: 700; padding-right: 6px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .att-bar:not(.done) { background: #3A2A12; color: #FFC078; } }
:root[data-theme="dark"] .att-bar:not(.done) { background: #3A2A12; color: #FFC078; }
.bm-mark { color: #F59F00; display: inline-flex; }
.bm-mark svg { width: 13px; height: 13px; }
.avatar.bot { background: transparent; }
.avatar.bot img { border-radius: inherit; }
.sender.bot { font-weight: 700; color: var(--primary); }
.bm-list li.bm-item { display: flex; align-items: flex-start; gap: 12px; padding: 12px 6px; border-bottom: 1px solid var(--line); cursor: pointer; border-radius: 10px; }
.bm-list li.bm-item:hover { background: var(--panel-2); }
.bm-list .item-time { font-size: 12px; color: var(--faint); margin-left: auto; white-space: nowrap; }
.bm-room { font-size: 12px; color: var(--primary); margin: 2px 0 3px; }
.bm-text { font-size: 14px; color: var(--text); white-space: pre-wrap; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; word-break: break-all; }
.bm-del { color: #F59F00; flex: none; }
.bm-list .empty { white-space: pre-line; }
.adm-list { padding: 2px 0; }
.adm-row { display: flex !important; align-items: center; gap: 10px; padding: 9px 0; margin: 0 !important; border-top: 1px solid var(--line); font-size: 14.5px !important; font-weight: 400 !important; color: var(--text) !important; }
.adm-list > .adm-row:first-child, .adm-targets > .adm-row:first-child { border-top: 0; }
.adm-row .avatar { width: 32px; height: 32px; font-size: 12px; border-radius: 11px; flex: none; }
.adm-name { flex: 1; min-width: 0; }
.adm-name small { color: var(--faint); font-size: 12px; }
.adm-pick { display: block; margin: 0 0 8px; max-width: 100%; }
.adm-targets { padding: 2px 14px; max-height: 340px; overflow-y: auto; }
#admin-list { padding: 2px 14px; }
#my-ip-state.ok { color: #2B8A3E; } #my-ip-state.warn { color: #E8590C; }
.att-month { margin-left: 8px; padding: 4px 8px; border: 1px solid var(--line); border-radius: 8px; background: var(--panel); color: var(--text); font: inherit; font-size: 13px; }
.att-records { display: flex; flex-direction: column; gap: 6px; }
.att-day { background: var(--panel-2); border-radius: 12px; padding: 4px 14px; }
.att-day summary { cursor: pointer; padding: 8px 0; font-weight: 600; font-size: 14px; }
.att-day ul { list-style: none; margin: 0 0 8px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 4px 12px; font-size: 13.5px; }
.att-day li b { font-variant-numeric: tabular-nums; margin-right: 4px; }
.att-day small { color: var(--faint); }
.set-row .btn.small { white-space: nowrap; flex: none; }
