/* 하늘다리앱 시연판 — 고령 성도 배려: 큰 글씨, 큰 버튼, 높은 대비 */
:root {
  --primary: #2f5d8a;
  --primary-dark: #214466;
  --link: #1a5fb4;   /* V40: 글 속 링크 */
  --accent: #e8a33d;
  --bg: #ececec;
  --card: #ffffff;
  --text: #1f2328;
  --muted: #6b6f76;
  --line: #e2ddd2;
  --danger: #b3403a;
  --ok: #2e7d4f;
  --radius: 16px;
  --bar-bg: #ffffff; --bar-fg: #2f5d8a; --bar-line: #dcdcdc;
  --soft-warm: #fff6e8; --warm-line: #f0d3a2; --soft-blue: #eef3f8; --soft-green: #f6f9f4;
  --notice-row: #fffaf1; --cat-bg: #e8eef5; --mine-bubble: #fbe7a1; --toast: #222; --scripture-text: #214466;
}
* { box-sizing: border-box; }
html { font-size: 17px; }
html.fs-s { font-size: 15.5px; }
html.fs-l { font-size: 19px; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font-family: "SUITE", -apple-system, "Apple SD Gothic Neo", "Noto Sans KR", "Malgun Gothic", sans-serif;
  font-weight: 300;
  line-height: 1.6; -webkit-text-size-adjust: 100%;
}
#topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; gap: 8px;
  padding: calc(10px + env(safe-area-inset-top)) 12px 10px;
  background: var(--bar-bg); color: var(--bar-fg);
  border-bottom: 1px solid var(--bar-line);
}
#topbar h1 { flex: 1; margin: 0; font-size: 1.25rem; font-weight: 700;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.icon-btn { background: none; border: 0; color: var(--bar-fg); font-size: 1.8rem;
  width: 48px; height: 48px; line-height: 1; cursor: pointer; border-radius: 12px; }
.icon-btn:active { background: rgba(0,0,0,.06); }

#app { max-width: 680px; margin: 0 auto; padding: 16px 16px 120px; }

.menu { position: fixed; top: 68px; right: 12px; z-index: 20; background: var(--card);
  border-radius: var(--radius); box-shadow: 0 8px 30px rgba(0,0,0,.2);
  padding: 8px; min-width: 240px; }
.menu button { display: block; width: 100%; text-align: left; background: none; border: 0;
  font-size: 1.05rem; padding: 14px 16px; border-radius: 10px; cursor: pointer; color: var(--text); }
.menu button:active { background: var(--bg); }
.menu-user { padding: 10px 16px; color: var(--muted); font-size: .95rem;
  border-bottom: 1px solid var(--line); margin-bottom: 4px; }

h2 { font-size: 1.3rem; margin: 8px 0 12px; }
h3 { font-size: 1.1rem; margin: 20px 0 10px; }
p { margin: 0 0 10px; }
.muted { color: var(--muted); }
.center { text-align: center; padding: 40px 0; }
.small { font-size: .85rem; }

.card { background: var(--card); border-radius: var(--radius); padding: 18px;
  margin-bottom: 14px; box-shadow: 0 1px 3px rgba(0,0,0,.06); }

label { display: block; font-weight: 600; margin: 14px 0 6px; }
input, select, textarea {
  width: 100%; font-size: 1.1rem; padding: 14px; border: 2px solid var(--line);
  border-radius: 12px; background: var(--card); color: var(--text); font-family: inherit;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--primary); }
textarea { min-height: 180px; resize: vertical; }

.btn { display: block; width: 100%; font-size: 1.15rem; font-weight: 700; padding: 16px;
  border: 0; border-radius: 14px; background: var(--primary); color: #fff; cursor: pointer;
  margin-top: 16px; text-align: center; text-decoration: none; }
.btn:active { background: var(--primary-dark); }
.btn:disabled { opacity: .5; }
.btn.secondary { background: var(--card); color: var(--primary); border: 2px solid var(--primary); }
.btn.danger { background: var(--danger); }
.btn.ok { background: var(--ok); }
.btn.inline { display: inline-block; width: auto; padding: 10px 18px; font-size: 1rem; margin: 0; }
.row { display: flex; gap: 10px; align-items: center; }
.row > * { flex: 1; }

.hero { text-align: center; padding: 30px 0 10px; }
.hero .logo { font-size: 4rem; }
.hero h2 { font-size: 1.6rem; margin: 6px 0; }

/* 방 카드 */
.room { display: flex; align-items: center; gap: 14px; cursor: pointer; }
.room .ic { font-size: 2.2rem; width: 56px; height: 56px; display: grid; place-items: center;
  background: var(--bg); border-radius: 14px; flex: none; }
.room .nm { font-size: 1.2rem; font-weight: 700; }
.room .ds { color: var(--muted); font-size: .9rem; }
.room .grow { flex: 1; min-width: 0; }
.badge { background: var(--accent); color: #fff; font-size: .8rem; font-weight: 700;
  padding: 3px 10px; border-radius: 999px; }

/* 게시글 */
.post { cursor: pointer; }
.post .meta { color: var(--muted); font-size: .9rem; margin-bottom: 6px; }
.post .ttl { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.post .body { white-space: pre-wrap; word-break: break-word; }
.post .preview { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.post img.thumb { width: 100%; max-height: 240px; object-fit: cover; border-radius: 12px; margin-top: 10px; }
.post img.full { width: 100%; border-radius: 12px; margin-top: 12px; }
.counts { color: var(--muted); font-size: .9rem; margin-top: 8px; }

.reactions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 14px; }
.react { flex: 1 1 0; min-width: 0; font-size: .9rem; padding: 10px 4px; border-radius: 12px;
  border: 2px solid var(--line); background: var(--card); cursor: pointer; color: var(--text);
  display: flex; flex-direction: column; align-items: center; gap: 2px; white-space: nowrap; }
.react .e { font-size: 1.6rem; line-height: 1.2; }
.react.on { border-color: var(--accent); background: var(--soft-warm); font-weight: 700; }

.comment { border-top: 1px solid var(--line); padding: 12px 0; }
.comment .who { font-weight: 700; font-size: .95rem; }
.comment .when { color: var(--muted); font-size: .8rem; margin-left: 6px; }
.comment .txt { white-space: pre-wrap; word-break: break-word; }
.linkbtn { background: none; border: 0; color: var(--danger); font-size: .85rem; cursor: pointer; padding: 4px 0; }

.fab { position: fixed; right: 20px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 5;
  background: var(--accent); color: #fff; border: 0; border-radius: 999px;
  padding: 18px 26px; font-size: 1.15rem; font-weight: 700; box-shadow: 0 6px 18px rgba(0,0,0,.25); cursor: pointer; }

.photo-preview { position: relative; margin-top: 10px; }
.photo-preview img { width: 100%; border-radius: 12px; }
.photo-preview button { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,.6);
  color: #fff; border: 0; border-radius: 999px; width: 40px; height: 40px; font-size: 1.2rem; }
.file-label { display: block; text-align: center; padding: 16px; border: 2px dashed var(--line);
  border-radius: 12px; cursor: pointer; font-weight: 600; color: var(--primary); margin-top: 14px; }

.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); z-index: 30;
  background: var(--toast); color: #fff; padding: 14px 22px; border-radius: 12px; font-size: 1rem;
  max-width: 90vw; text-align: center; }

.notice { background: var(--soft-warm); border: 1px solid var(--warm-line); border-radius: 12px; padding: 12px 14px; font-size: .95rem; }
.tag { display: inline-block; background: var(--bg); padding: 2px 10px; border-radius: 999px; font-size: .85rem; margin-right: 4px; }

/* reCAPTCHA 배지 숨김 (로그인 화면에 Google 안내 문구 표시로 대체) */
.grecaptcha-badge { visibility: hidden !important; }
html, body { overflow-x: hidden; }

/* 게시판형 목록 */
.card.board { padding: 4px 16px; }
.brow { padding: 14px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.brow:last-child { border-bottom: 0; }
.brow:active { background: var(--bg); }
.brow.notice-row { background: var(--notice-row); margin: 0 -16px; padding: 14px 16px; }
.bttl { font-size: 1.05rem; font-weight: 600; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; word-break: keep-all; }
.bttl .cat { margin: 0 4px 0 0; vertical-align: 2px; }
.bttl .ico { font-size: .85rem; margin-left: 2px; }
.bttl .ccount { color: var(--danger); font-size: .9rem; font-weight: 700; margin-left: 4px; }
.bmeta { color: var(--muted); font-size: .85rem; margin-top: 2px; }
.cat { display: inline-block; flex: none; font-size: .75rem; font-weight: 700; padding: 2px 8px;
  border-radius: 6px; background: var(--cat-bg); color: var(--primary); margin-bottom: 4px; }
.cat.cat-notice { background: var(--danger); color: #fff; }

/* 방 형식별 */
.typehint { background: var(--bg); border-radius: 10px; padding: 8px 12px; font-size: .85rem; color: var(--muted); }
.scripture { display: inline-block; background: var(--soft-blue); color: var(--scripture-text); font-weight: 700;
  border-radius: 8px; padding: 4px 10px; margin: 2px 0 8px; }
.appbox { background: var(--soft-green); border-left: 4px solid var(--ok); border-radius: 8px; padding: 10px 12px; margin-top: 12px; }
.eventbox { background: var(--soft-warm); border-radius: 10px; padding: 10px 12px; margin: 6px 0 10px; font-weight: 600; }
.bevent { font-size: .88rem; color: var(--primary); margin-top: 2px; }
.row > div { min-width: 0; }

/* 채팅형 */
.chat-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.chat { padding-bottom: 20px; }
body.chat-open #app { padding-bottom: 110px; }
.daysep { text-align: center; color: var(--muted); font-size: .8rem; margin: 16px 0 8px; }
.msg { margin: 8px 0; display: flex; flex-direction: column; align-items: flex-start; }
.msg.mine { align-items: flex-end; }
.msg .who { font-size: .85rem; font-weight: 700; margin: 0 0 2px 4px; }
.msg .line { display: flex; align-items: flex-end; gap: 6px; max-width: 88%; }
.msg.mine .line { flex-direction: row-reverse; }
.bubble { background: var(--card); border-radius: 16px 16px 16px 4px; padding: 10px 14px; white-space: pre-wrap;
  word-break: break-word; box-shadow: 0 1px 2px rgba(0,0,0,.08); }
.msg.mine .bubble { background: var(--mine-bubble); border-radius: 16px 16px 4px 16px; }
.msg .time { font-size: .72rem; color: var(--muted); flex: none; }
.linkbtn.tiny { font-size: .72rem; padding: 0 4px; color: var(--muted); }
.chatbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 6; display: flex; gap: 8px; align-items: flex-end;
  background: var(--card); padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); box-shadow: 0 -2px 10px rgba(0,0,0,.08); }
.chatbar textarea { min-height: 50px; max-height: 140px; padding: 12px; resize: none; flex: 1; }
.sendbtn { flex: none; background: var(--primary); color: #fff; border: 0; border-radius: 12px;
  padding: 0 18px; height: 50px; font-size: 1.05rem; font-weight: 700; }

/* 로고 */
#brand { height: 30px; width: auto; flex: none; margin-left: 2px; }
#brand[hidden] { display: none; }
.hero-logo { width: 62%; max-width: 280px; height: auto; display: block; margin: 10px auto 6px; }
/* 설치 안내 */
.install-card { margin-top: 16px; border: 2px solid var(--accent); }
.install-card .btn { margin-top: 12px; background: var(--accent); }
.sheet-bg { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 40; display: flex; align-items: flex-end; }
.sheet { background: var(--card); width: 100%; border-radius: 20px 20px 0 0; padding: 22px 20px calc(22px + env(safe-area-inset-bottom)); }
.steps { padding-left: 22px; margin: 0; }
.steps li { margin: 10px 0; font-size: 1.05rem; }
.kbd { display: inline-block; background: var(--bg); border: 1px solid var(--line); border-radius: 8px; padding: 1px 8px; font-weight: 700; }

/* 좋아요 (인스타그램식) */
.reactions { display: flex; align-items: center; gap: 4px; margin-top: 10px; }
.iconbtn { background: none; border: 0; padding: 6px; color: var(--text); cursor: pointer; line-height: 0; border-radius: 50%; }
.iconbtn.heart.on { color: #ed4956; }
.iconbtn.pop svg { animation: pop .35s ease; }
@keyframes pop { 0% { transform: scale(1); } 40% { transform: scale(1.3); } 100% { transform: scale(1); } }
.likecount { font-size: .95rem; margin-left: 6px; }

.postactions { display: flex; gap: 18px; margin-top: 8px; }
.linkbtn.edit { color: var(--primary); }

/* 버튼·방 이름 등을 길게 눌러도 글자 선택/구글 검색 창이 뜨지 않게 (글 본문은 복사 가능) */
#topbar, .menu, .room, .brow, .btn, .iconbtn, .linkbtn, .fab, .react, .tag, .badge, .cat,
.install-card, label, select, .typehint, .sendbtn {
  -webkit-user-select: none; user-select: none; -webkit-touch-callout: none;
}
body { -webkit-tap-highlight-color: transparent; }

/* 비공개 방·멤버 관리 */
.lock { font-size: .9rem; }
.adminroom { display: block; }
.arname { margin-bottom: 8px; }
.arctrl { display: flex; flex-wrap: wrap; gap: 8px 12px; align-items: center; }
.arctrl select { width: auto; flex: 1 1 130px; padding: 8px; font-size: .95rem; }
.chk { display: inline-flex; align-items: center; gap: 4px; margin: 0; font-weight: 400; font-size: .92rem; }
.chk input { width: 22px; height: 22px; }
.chk:has(input:disabled) { opacity: .75; }
.msgcount { font-size: .82rem; color: #b45309; padding: 4px 10px 0; }
.rsearch { margin: 0 0 10px; }
.rsearch .rsq { width: 100%; }
.rschips { display: flex; gap: 6px; overflow-x: auto; padding: 8px 0 2px; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.rschip { flex: none; white-space: nowrap; font-size: .85rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: inherit; cursor: pointer; }
.rschip.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.rsinfo { display: flex; justify-content: space-between; align-items: center; padding-top: 6px; }
.rsinfo[hidden], .rsnone[hidden], [data-rs][hidden] { display: none !important; }
.rsnone { text-align: center; padding: 14px 0; }
.rsctx { opacity: .55; }
#adminRooms.rsbusy .draghandle, #adminRooms.rsbusy .ordbtns { visibility: hidden; }
.small-btn { padding: 8px 14px !important; font-size: .92rem !important; }
.mrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.mrow[hidden] { display: none; }

/* 아이콘 고르기 */
.iconedit { font-size: 1.5rem; background: var(--bg); border: 2px solid var(--line); border-radius: 12px;
  width: 44px; height: 44px; margin-right: 8px; cursor: pointer; vertical-align: middle; line-height: 1; padding: 0; }
.iconedit.big { width: 100%; height: 54px; font-size: 1.8rem; margin: 0; }
.icongrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); gap: 6px; max-height: 45vh; overflow-y: auto; }
.iconpick { font-size: 1.7rem; background: var(--card); border: 2px solid var(--line); border-radius: 12px; height: 52px; cursor: pointer; }
.iconpick.on { border-color: var(--accent); background: var(--soft-warm); }

/* 화면 맨 아래 버전 표시 */
#app { padding-bottom: 40px; }
.appver { text-align: center; color: #a3a7ad; font-size: .7rem; padding: 0 0 calc(96px + env(safe-area-inset-bottom)); letter-spacing: .5px; }
body.chat-open .appver { display: none; }

/* SUITE Light 본문 + 제목·버튼은 굵게 */
button, input, select, textarea { font-family: inherit; }
input, textarea, select { font-weight: 400; }
b, strong { font-weight: 700; }

/* ===== 다크 모드 (메뉴에서 자동/밝게/어둡게 선택) ===== */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --primary: #3b6a9c; --primary-dark: #2c5480; --accent: #d9983a; --link: #8fc1ff;
    --bg: #15171a; --card: #22252a; --text: #e6e4e0; --muted: #9aa0a6; --line: #373c43;
    --danger: #e0645c; --ok: #3f9a64;
    --soft-warm: #33291a; --warm-line: #5a4826; --soft-blue: #1f2d3d; --soft-green: #1d2a21;
    --notice-row: #2a2419; --cat-bg: #253447; --mine-bubble: #5b4a1e; --toast: #3a3f46; --scripture-text: #a9c8ea;
    --bar-bg: #22252a; --bar-fg: #e6e4e0; --bar-line: #373c43;
    color-scheme: dark;
  }
  :root:not([data-theme="light"]) .hero-logo, :root:not([data-theme="light"]) #brand { filter: brightness(0) invert(1); opacity: .92; }
  :root:not([data-theme="light"]) .btn.secondary { color: #a9c8ea; border-color: #4f7fb0; }
}
:root[data-theme="dark"] {
  --primary: #3b6a9c; --primary-dark: #2c5480; --accent: #d9983a; --link: #8fc1ff;
  --bg: #15171a; --card: #22252a; --text: #e6e4e0; --muted: #9aa0a6; --line: #373c43;
  --danger: #e0645c; --ok: #3f9a64;
  --soft-warm: #33291a; --warm-line: #5a4826; --soft-blue: #1f2d3d; --soft-green: #1d2a21;
  --notice-row: #2a2419; --cat-bg: #253447; --mine-bubble: #5b4a1e; --toast: #3a3f46; --scripture-text: #a9c8ea;
  --bar-bg: #22252a; --bar-fg: #e6e4e0; --bar-line: #373c43;
  color-scheme: dark;
}
:root[data-theme="dark"] .hero-logo, :root[data-theme="dark"] #brand { filter: brightness(0) invert(1); opacity: .92; }
:root[data-theme="dark"] .btn.secondary { color: #a9c8ea; border-color: #4f7fb0; }

/* 방별 알림 켜기/끄기 */
.roomtop { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 10px; }
.chat-actions { display: flex; align-items: center; gap: 12px; flex: none; }
.mutebtn { flex: none; background: var(--card); color: var(--primary); border: 1.5px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: .85rem; font-weight: 600; cursor: pointer; font-family: inherit; }
.mutebtn.off { color: #8e8e8e; background: #dedede; border-color: #c6c6c6; font-weight: 500; filter: grayscale(1); }
:root[data-theme="dark"] .mutebtn.off { color: #8a8a8a; background: #2c2c2c; border-color: #444; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mutebtn.off { color: #8a8a8a; background: #2c2c2c; border-color: #444; } }

/* 종교교회 홈페이지 링크 */
.churchlink { display: block; text-align: center; margin: 18px 0 4px; padding: 12px; color: var(--primary);
  font-weight: 600; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 14px; }
.churchlink:active { opacity: .7; }

/* 홈 화면 방 타일 (한 줄에 3개) */
.homehead { display: flex; align-items: baseline; justify-content: space-between; }
.homehead .linkbtn { font-size: .88rem; color: var(--primary); }
.tiles { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; margin-bottom: 14px; }
.tile { position: relative; background: var(--card); border-radius: 16px; padding: 14px 6px 12px; text-align: center;
  cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.06); -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.tile:active { transform: scale(.97); }
.tile .ic { position: relative; font-size: 2.1rem; width: 58px; height: 58px; margin: 0 auto 6px; display: grid; place-items: center;
  background: var(--bg); border-radius: 16px; line-height: 1; }
.tile .dot { position: absolute; top: -4px; right: -4px; width: 15px; height: 15px; background: #e53935; border-radius: 50%; border: 2px solid var(--card); }
.tile .nm { font-size: .9rem; font-weight: 700; line-height: 1.3; word-break: keep-all;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.tile .mk { position: absolute; top: 6px; left: 7px; font-size: .68rem; opacity: .85; }
.tiles.editing .tile { cursor: default; outline: 2px dashed var(--line); }
.tile .mv { display: flex; justify-content: center; gap: 6px; margin-top: 6px; }
.tile .mv button { width: 38px; height: 32px; border-radius: 10px; border: 1.5px solid var(--line); background: var(--bg);
  color: var(--primary); font-size: .9rem; cursor: pointer; }
.orderbar { display: flex; flex-direction: column; gap: 8px; margin-bottom: 14px; }
.orderbar[hidden] { display: none; }
.orderbar .row { display: flex; gap: 10px; }
.orderbar .row .btn { flex: 1; margin: 0; }

/* 관리자 방 순서 ▲▼ */
.ordbtns { display: inline-flex; flex-direction: column; gap: 2px; margin-right: 8px; vertical-align: middle; }
.ordbtns button { width: 34px; height: 22px; font-size: .7rem; line-height: 1; border: 1px solid var(--line); background: var(--bg);
  color: var(--primary); border-radius: 6px; cursor: pointer; padding: 0; }

/* 처음 쓰는 분 안내 팝업 */
.sheet.onb { text-align: center; }
.sheet.onb .steps { text-align: left; }
.onb-ic { font-size: 3rem; line-height: 1; margin: 4px 0 6px; }
.stepnum { font-size: .8rem; color: var(--muted); font-weight: 600; }
.sheet.onb .linkbtn { display: block; margin: 12px auto 0; color: var(--muted); }

/* 크롬 "탭하여 검색" 막기: 글자 선택을 끄고 입력칸만 허용 (복사는 [📋 복사] 버튼) */
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, select, [contenteditable="true"] { -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* 방 타일 알림 벨 (오른쪽 위) */
.tile .bell { position: absolute; top: 2px; right: 2px; width: 40px; height: 40px; border: 0; background: none;
  font-size: .95rem; line-height: 1; cursor: pointer; border-radius: 50%; padding: 0; }
.tile .bell:active { background: var(--bg); }
.tile .bell.off { filter: grayscale(1); opacity: .55; }
.tile .mk { font-size: .75rem; }

/* 끌어서 순서 바꾸기 */
.tiles.editing .tile { animation: wiggle .35s ease-in-out infinite alternate; touch-action: none; }
.tiles.editing .tile:nth-child(2n) { animation-delay: .15s; }
@keyframes wiggle { from { transform: rotate(-1.2deg); } to { transform: rotate(1.2deg); } }
.drag-ghost { opacity: .35; }
.drag-chosen { box-shadow: 0 8px 22px rgba(0,0,0,.18); }
.draghandle { display: inline-block; font-size: 1.3rem; color: var(--muted); padding: 0 8px 0 2px; cursor: grab;
  vertical-align: middle; touch-action: none; }

/* 켜기/끄기 스위치 */
.swrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.switch { position: relative; display: inline-block; width: 54px; height: 32px; flex: none; margin: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider { position: absolute; inset: 0; background: #c7c7c7; border-radius: 999px; transition: .2s; cursor: pointer; }
.switch .slider::before { content: ""; position: absolute; width: 26px; height: 26px; left: 3px; top: 3px; background: #fff;
  border-radius: 50%; transition: .2s; box-shadow: 0 1px 3px rgba(0,0,0,.25); }
.switch input:checked + .slider { background: var(--primary); }
.switch input:checked + .slider::before { transform: translateX(22px); }
.switch input:disabled + .slider { opacity: .6; }
#copyPost, #sharePost { color: var(--primary); }
/* 끄는 동안에는 흔들림 멈춤 (흔들림이 끌기를 방해하지 않게) */
.tiles.editing .tile.drag-chosen, .tiles.editing .tile.sortable-fallback, .sortable-fallback { animation: none !important; }
.sortable-fallback { opacity: .9 !important; box-shadow: 0 10px 28px rgba(0,0,0,.25); }

/* 홈: 내가 참여한 방 상자 + 작은 전체 방 둘러보기 */
.mybox { border: 2px solid var(--primary); border-radius: 20px; padding: 4px 12px 10px; background: rgba(255,255,255,.35); margin-bottom: 10px; }
.mybox .homehead h3 { margin: 12px 0 10px; }
.mybox .tiles { margin-bottom: 6px; }
.draghint { margin: 2px 2px 4px; font-size: .78rem; }
.browsewrap { text-align: right; margin: 0 0 14px; }
.browsebtn { background: var(--card); color: var(--primary); border: 1.5px solid var(--primary); border-radius: 999px;
  padding: 7px 16px; font-size: .9rem; font-weight: 600; font-family: inherit; cursor: pointer; }
.browsebtn:active { opacity: .7; }
.tile.drag-chosen { transform: scale(1.06); z-index: 2; }
:root[data-theme="dark"] .mybox { background: rgba(255,255,255,.03); border-color: #4f7fb0; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mybox { background: rgba(255,255,255,.03); border-color: #4f7fb0; } }

/* 큰방 / 작은방 */
.tile .pn { font-size: .68rem; color: var(--muted); line-height: 1.2; margin-top: 1px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.subroom { margin-left: 22px; position: relative; }
.subroom::before { content: "↳"; position: absolute; left: -18px; top: 26px; color: var(--muted); }
.pn2 { color: var(--primary); font-weight: 600; }
.adminroom.child { padding-left: 22px; background: var(--soft-blue); }
.subbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 8; background: var(--card); border-top: 1px solid var(--line);
  box-shadow: 0 -2px 12px rgba(0,0,0,.08); padding: 6px 8px calc(6px + env(safe-area-inset-bottom)); }
.subbar.top { position: sticky; top: 64px; bottom: auto; border-top: 0; border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px rgba(0,0,0,.05); padding-bottom: 6px; }
.sbrow { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; max-width: 680px; margin: 0 auto; align-items: stretch; }
.sbrow::-webkit-scrollbar { display: none; }
.sb { flex: 0 0 auto; width: 72px; background: none; border: 0; border-radius: 12px; padding: 4px 2px; cursor: pointer; font-family: inherit; color: var(--text); }
.sb.on { background: var(--soft-blue); outline: 2px solid var(--primary); }
.sb.dim { opacity: .45; }
.sbi { position: relative; display: block; font-size: 1.6rem; line-height: 1.2; }
.sbl { position: absolute; right: 10px; bottom: -2px; font-size: .7rem; }
.sbn { display: block; font-size: .7rem; font-weight: 600; line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sbdiv { flex: 0 0 1px; background: var(--line); margin: 6px 2px; }
body.has-subbar .fab { bottom: calc(96px + env(safe-area-inset-bottom)); }
body.has-subbar .appver { padding-bottom: calc(170px + env(safe-area-inset-bottom)); }
.permopt { display: flex; margin: 8px 0; font-size: 1rem; }
.permopt input { width: 22px; height: 22px; }
.permroom { display: flex; padding: 8px 4px; border-bottom: 1px solid var(--line); }
.permroom.child { padding-left: 24px; }

/* ===== V26: 카톡·밴드처럼 ===== */
/* 동그란 프로필 */
.av { display: inline-flex; align-items: center; justify-content: center; flex: none; width: 40px; height: 40px; border-radius: 50%;
  color: #fff; font-weight: 700; font-size: 1.05rem; }
.av.sm { width: 32px; height: 32px; font-size: .9rem; }

/* 밴드식 게시판 */
.card.band { cursor: pointer; }
.bhead { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bhead b { font-size: 1rem; }
.bfoot { border-top: 1px solid var(--line); margin-top: 12px; padding-top: 10px; color: var(--muted); font-size: .9rem; }
.noticebox { padding: 6px 14px; }
.nrow { display: flex; align-items: center; gap: 8px; padding: 10px 0; border-bottom: 1px solid var(--line); cursor: pointer; }
.nrow:last-child { border-bottom: 0; }
.ntag { flex: none; background: #e53935; color: #fff; font-size: .75rem; font-weight: 700; border-radius: 6px; padding: 2px 8px; }
.nt { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dots { background: none; border: 0; font-size: 1.6rem; line-height: 1; color: var(--muted); padding: 4px 8px; cursor: pointer; }
.pgrid { display: grid; gap: 3px; margin-top: 10px; border-radius: 12px; overflow: hidden; }
.pgrid.n1 { grid-template-columns: 1fr; }
.pgrid.n2 { grid-template-columns: 1fr 1fr; }
.pgrid.n3 { grid-template-columns: 2fr 1fr; grid-template-rows: 1fr 1fr; }
.pgrid.n3 .pcell:first-child { grid-row: span 2; }
.pgrid.n4 { grid-template-columns: 1fr 1fr; }
.pcell { position: relative; background: var(--bg); aspect-ratio: 1 / 1; }
.pgrid.n1 .pcell { aspect-ratio: auto; max-height: 360px; }
.pcell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pmore { position: absolute; inset: 0; background: rgba(0,0,0,.45); color: #fff; font-size: 1.6rem; font-weight: 700; display: grid; place-items: center; }
.ytthumb { position: relative; margin-top: 10px; border-radius: 12px; overflow: hidden; }
.ytthumb img { width: 100%; display: block; }
.ytthumb span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2.4rem; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.bandwrite { display: flex; align-items: center; gap: 8px; margin: 12px 0 8px; }
.pvgrid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.photo-preview.small { margin-top: 8px; }
.photo-preview.small img { aspect-ratio: 1 / 1; object-fit: cover; border-radius: 10px; }
.photo-preview.small button { top: 4px; right: 4px; width: 26px; height: 26px; font-size: .8rem; }
img.full { cursor: zoom-in; }

/* 아래에서 올라오는 메뉴 (⋯, 말풍선 꾹, ＋) */
.actsheet { padding-top: 12px; }
.actsheet button { display: block; width: 100%; text-align: left; background: none; border: 0; border-bottom: 1px solid var(--line);
  font-size: 1.1rem; padding: 16px 8px; cursor: pointer; color: var(--text); font-family: inherit; }
.actsheet button.danger { color: var(--danger); }
.actsheet button.cancel { text-align: center; border: 0; color: var(--muted); margin-top: 6px; }

/* 사진 크게 보기 */
.viewer { position: fixed; inset: 0; z-index: 60; background: rgba(0,0,0,.92); display: grid; place-items: center; }
.viewer img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.viewer button { position: absolute; background: rgba(255,255,255,.15); color: #fff; border: 0; width: 48px; height: 48px; border-radius: 50%; font-size: 1.6rem; cursor: pointer; }
.viewer .vx { top: calc(14px + env(safe-area-inset-top)); right: 14px; }
.viewer .vp { left: 10px; top: 50%; } .viewer .vn { right: 10px; top: 50%; }
.viewer .vc { position: absolute; bottom: calc(20px + env(safe-area-inset-bottom)); color: #fff; font-size: .9rem; }

/* 댓글: 프로필 + 이름 + 내용 */
.comment { display: flex; gap: 10px; align-items: flex-start; }
.comment .cbody { flex: 1; min-width: 0; }

/* 카톡식 채팅 */
.chat { background: #b2c7d9; margin: 0 -16px; padding: 10px 12px 20px; min-height: 60vh; }
:root[data-theme="dark"] .chat { background: #1c2733; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .chat { background: #1c2733; } }
.daysep { display: flex; justify-content: center; }
.daysep span { background: rgba(0,0,0,.18); color: #fff; border-radius: 999px; padding: 3px 12px; font-size: .75rem; }
.msg { flex-direction: row; align-items: flex-start; gap: 8px; margin: 10px 0 0; }
.msg.cont { margin-top: 3px; }
.msg.mine { flex-direction: row; justify-content: flex-end; }
.avcol { width: 40px; flex: none; }
.mcol { display: flex; flex-direction: column; min-width: 0; max-width: 78%; }
.msg.mine .mcol { align-items: flex-end; }
.msg .who { font-size: .82rem; font-weight: 600; margin: 0 0 3px 2px; color: #333; }
.msg .who span { font-weight: 400; opacity: .7; }
:root[data-theme="dark"] .msg .who { color: #ddd; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .msg .who { color: #ddd; } }
.msg .line { max-width: 100%; }
.bubble { background: #fff; color: #111; border-radius: 4px 16px 16px 16px; padding: 8px 12px; box-shadow: none; -webkit-user-select: none; user-select: none; }
.msg.cont .bubble { border-radius: 16px; }
.msg.mine .bubble { background: #fee500; color: #111; border-radius: 16px 4px 16px 16px; }
.msg.mine.cont .bubble { border-radius: 16px; }
.bubble.media { padding: 3px; background: transparent !important; }
.msg .time { font-size: .68rem; color: #555; }
:root[data-theme="dark"] .msg .time { color: #aaa; }
.ctext { white-space: pre-wrap; word-break: break-word; }
/* V40: 글·댓글·채팅 속 링크 (밝은 화면 #1a5fb4 · 어두운 화면 #8fc1ff — 노란/갈색 내 말풍선에서도 읽힘) */
a.ulink { color: var(--link); text-decoration: underline; text-underline-offset: 2px; word-break: break-all; }
.rq { border-left: 3px solid rgba(0,0,0,.25); padding: 2px 8px; margin: 2px 0 6px; font-size: .82rem; opacity: .8; display: flex; flex-direction: column; }
.rq span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 220px; }
.cimgs { display: grid; gap: 3px; border-radius: 12px; overflow: hidden; max-width: 240px; }
.cimgs.n1 { grid-template-columns: 1fr; } .cimgs.n2, .cimgs.n4 { grid-template-columns: 1fr 1fr; } .cimgs.n3 { grid-template-columns: 1fr 1fr 1fr; }
.cimgs img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; display: block; cursor: zoom-in; }
.cimgs.n1 img { aspect-ratio: auto; max-height: 320px; }
/* V38: 5장 이상은 3칸 × 2줄, 6번째 칸 위에 "+남은 수" (6번째 사진과 같은 칸에 겹침) */
.cimgs.n6 { grid-template-columns: 1fr 1fr 1fr; }
.cimgs.n6 img:nth-child(6), .cimgs .cmore { grid-column: 3; grid-row: 2; }
.cimgs .cmore { z-index: 1; display: grid; place-items: center; background: rgba(0,0,0,.45); color: #fff; font: inherit; font-size: 1.3rem; font-weight: 700; cursor: zoom-in;
  border: 0; border-radius: 0; padding: 0; margin: 0; width: 100%; height: 100%; min-width: 0; min-height: 0; box-shadow: none; }   /* V39: 버튼 (키보드로도) */
.cimgs .cmore:focus-visible { outline: 3px solid #fff; outline-offset: -3px; }
.cvid { display: block; width: 240px; max-width: 100%; border-radius: 12px; background: #000; }
.cyt { position: relative; display: block; margin-top: 6px; border-radius: 10px; overflow: hidden; width: 220px; max-width: 100%; }
.cyt img { width: 100%; display: block; }
.cyt span { position: absolute; inset: 0; display: grid; place-items: center; font-size: 2rem; color: #fff; text-shadow: 0 2px 8px rgba(0,0,0,.5); }
.chatbar { flex-direction: column; align-items: stretch; gap: 6px; }
.chatrow { display: flex; gap: 8px; align-items: flex-end; }
.plusbtn { flex: none; width: 44px; height: 50px; border: 0; background: none; font-size: 1.8rem; color: var(--muted); cursor: pointer; }
.replybar { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: .85rem; background: var(--bg); border-radius: 10px; padding: 6px 10px; }
.replybar[hidden] { display: none; }
.replybar span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.replybar button { background: none; border: 0; font-size: 1rem; color: var(--muted); }
.sb.plus .sbi { color: var(--primary); font-weight: 700; }
/* V56 (0-80): 옆방 — 방 위쪽 줄 · [방 관리] 이름표 · 고르기 창 */
.siderow { display: block; margin: 8px 0 2px; }
.sidelbl { display: block; font-size: .8rem; font-weight: 700; color: var(--muted); margin: 0 2px 2px; }
.siderow .sbrow { max-width: none; margin: 0; }
.siderow .sbn { white-space: normal; max-height: 2.4em; overflow: hidden; }
.siderow .sbn .pp { display: block; color: var(--muted); font-weight: 500; }
.sidechips { display: flex; flex-wrap: wrap; gap: 6px; }
.sidechip { display: inline-flex; align-items: center; gap: 4px; background: var(--soft-blue); border-radius: 999px; padding: 4px 6px 4px 12px; font-size: .9rem; }
.sideinfo { width: 18px; height: 18px; border-radius: 50%; border: 1px solid var(--line); background: var(--card); color: var(--muted); font-family: inherit; font-size: .7rem; font-weight: 600; line-height: 1; padding: 0; margin-left: 4px; cursor: pointer; vertical-align: 1px; }
.sidetip { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 6px 2px 0; padding: 7px 10px; border-radius: 10px; background: var(--soft-blue); color: var(--primary); font-size: .85rem; }
.sidetipx { border: 0; background: none; color: inherit; font-size: .95rem; cursor: pointer; padding: 2px 4px; font-family: inherit; }
.sideinfosheet p { line-height: 1.6; margin: 0 0 8px; }
/* V58: 사용법 묻기 (하톡 도우미) */
.helpsheet { max-height: 90vh; display: flex; flex-direction: column; }
.helplog { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; min-height: 80px; max-height: 50vh; margin: 4px 0 8px; }
.hmsg { max-width: 88%; padding: 9px 12px; border-radius: 14px; line-height: 1.6; font-size: .95rem; }
.hmsg.me { align-self: flex-end; background: var(--primary); color: #fff; border-bottom-right-radius: 4px; }
.hmsg.bot { align-self: flex-start; background: var(--soft-blue); color: var(--text); border-bottom-left-radius: 4px; }
.hmsg.err { background: var(--card); border: 1px solid var(--line); }
.hsrc { display: block; margin-top: 6px; font-size: .78rem; color: var(--muted); }
.helpsamples { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.helpsamples[hidden] { display: none; }
/* V60 (0-96·0-97): 음성 파일 재생 막대 · 글 안 동영상 */
.faudio { display: flex; flex-direction: column; gap: 6px; }
.aplayer { width: 100%; height: 40px; }
.pvideos { display: flex; flex-direction: column; gap: 10px; margin-top: 12px; }
.pvideo { width: 100%; max-height: 70vh; border-radius: 12px; background: #000; }
.vdlist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
/* V59 (0-94): 도우미 [?] — 홈 떠 있는 버튼 · 방 맨 위 줄 · 지금 있는 곳 */
.helpfab { position: fixed; right: 16px; bottom: calc(76px + env(safe-area-inset-bottom)); z-index: 19;
  width: 56px; height: 56px; border-radius: 50%; border: 0; background: var(--primary); color: #fff;
  font-size: 1.6rem; font-weight: 800; line-height: 1; cursor: pointer; box-shadow: 0 4px 14px rgba(0,0,0,.25); font-family: inherit; }
.helpfab[hidden] { display: none; }
#topbar .helpbtn { width: 40px; height: 40px; font-size: 1.15rem; font-weight: 800; color: var(--primary);
  border: 2px solid var(--primary); border-radius: 50%; background: var(--soft-blue); margin-right: 2px; flex: none; }
#topbar .helpbtn[hidden] { display: none; }
.helpwhere { margin: -4px 0 8px; font-size: .85rem; color: var(--primary); font-weight: 600; }
/* V59 (0-95): 새 버전 안내 띠 */
.newver { position: fixed; left: 50%; transform: translateX(-50%); top: calc(var(--tbh, 64px) + 8px); z-index: 35;
  display: flex; align-items: center; gap: 10px; background: var(--toast); color: #fff; border-radius: 14px; padding: 8px 8px 8px 14px;
  box-shadow: 0 4px 14px rgba(0,0,0,.25); font-size: .92rem; max-width: calc(100vw - 32px); }
.newver .btn { width: auto; margin: 0; padding: 8px 14px; font-size: .9rem; }
.helpchip { border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 12px; font-family: inherit; font-size: .88rem; cursor: pointer; }
.helprow { display: flex; gap: 8px; align-items: flex-end; margin-bottom: 8px; }
.helprow textarea { flex: 1; min-width: 0; box-sizing: border-box; }
.helprow .btn { width: auto; flex: none; margin: 0; }
/* V57: AI에게 묻기 (시범) */
.aiaskbtn { width: 100%; margin: 0 0 10px; }
.aisheet { max-height: 88vh; overflow-y: auto; }
.aisheet textarea { width: 100%; box-sizing: border-box; }
.aiscope { display: flex; flex-direction: column; gap: 4px; margin: 8px 0 10px; font-size: .9rem; }
.aiscope label, .aitoggle { display: flex; align-items: center; gap: 8px; margin: 0; }
.aiscope input, .aitoggle input { width: auto; flex: none; margin: 0; }   /* V57.1 (0-88): 체크칸·동그라미를 글자 바로 왼쪽에 */
.aitoggle { margin-top: 8px; font-weight: 600; }
.aiout { margin: 12px 0; }
.aians { background: var(--soft-blue); border-radius: 12px; padding: 12px; line-height: 1.7; }
.airef { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; margin: 6px 0 0; cursor: pointer; font-family: inherit; color: var(--text); }
.sidechip.back { background: var(--card); border: 1px dashed var(--line); padding: 4px 12px; }
.sideback { width: 100%; margin: 8px 0 2px; }
.sidechip button { border: 0; background: none; cursor: pointer; font-size: .95rem; padding: 2px 6px; color: var(--muted); font-family: inherit; }
.sidesheet { max-height: 85vh; display: flex; flex-direction: column; }
.sidelist { overflow-y: auto; margin: 8px 0 12px; flex: 1 1 auto; min-height: 120px; }
.siderowpick { display: flex; align-items: center; gap: 10px; padding: 8px 2px; border-bottom: 1px solid var(--line); cursor: pointer; margin: 0; }
.siderowpick .sbi { flex: none; }
.siderowpick .spn { flex: 1; font-weight: 600; }
.siderowpick .spn .pp { color: var(--muted); font-weight: 500; }
.siderowpick input { width: 22px; height: 22px; flex: none; margin: 0; }

/* ===== V27 ===== */
/* 아이패드: 왼쪽 위 창 조절 점(●●●)을 피해 ‹ 버튼·제목을 오른쪽으로 */
html.ipad #topbar { padding-left: 78px; }
#backBtn { min-width: 48px; min-height: 48px; }

/* 메뉴 맨 아래 작은 로그아웃 */
.menu button.logout { font-size: .85rem; color: var(--muted); padding: 10px 16px; margin-top: 6px; border-top: 1px solid var(--line); border-radius: 0 0 10px 10px; }

/* 기다리는 동안 회색 틀 */
.skwrap .sk { height: 12px; border-radius: 6px; background: var(--line); margin: 10px 0; animation: skp 1.2s ease-in-out infinite; }
.skhead { display: flex; align-items: center; gap: 10px; }
.skhead .sk { margin: 0; }
.skav { width: 40px; height: 40px; border-radius: 50%; background: var(--line); flex: none; animation: skp 1.2s ease-in-out infinite; }
.skmsg { display: flex; margin: 14px 0; }
.skmsg .sk { height: 34px; border-radius: 14px; }
.skmsg.r { justify-content: flex-end; }
@keyframes skp { 0%, 100% { opacity: .55; } 50% { opacity: 1; } }

/* 방 위: 설명 · 👑 관리자 · 👥 멤버 수 */
.rinfo { min-width: 0; flex: 1; }
.mgrline { font-size: .82rem; color: var(--muted); margin-top: 2px; }
.mgrline b { color: var(--text); font-weight: 600; }
.chat-actions { gap: 8px; }
.room .ds.mgr:empty { display: none; }
.room .ds.mgr { font-size: .8rem; }

/* 홈 타일: 안 읽은 수 빨간 숫자 */
.tile .cnt { position: absolute; top: -7px; right: -9px; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 11px;
  background: #e53935; color: #fff; font-size: .75rem; font-weight: 700; line-height: 22px; border: 2px solid var(--card); box-sizing: content-box; }
.hello { display: flex; align-items: center; gap: 10px; font-size: 1.15rem; }
.hello a { display: inline-flex; text-decoration: none; }

/* 채팅: 안 읽은 사람 수(노란 숫자) + 시간 */
.msg .tm { display: flex; flex-direction: column; align-items: flex-start; flex: none; line-height: 1.2; }
.msg.mine .tm { align-items: flex-end; }
.msg .ur { font-size: .7rem; font-weight: 700; color: #e6b800; }  /* V28에서 아래 새 값으로 바뀜 */
.msg .ur:empty { display: none; }
/* 채팅 공감 */
.rx { display: inline-flex; gap: 4px; margin-top: 3px; background: none; border: 0; padding: 0; cursor: pointer; }
.rx span { background: var(--card); border: 1px solid var(--line); border-radius: 999px; padding: 1px 8px; font-size: .8rem; color: #333; }
.rx span.me { border-color: var(--primary); border-width: 1.5px; font-weight: 700; }
.msg.mine .mcol .rx { align-self: flex-end; }
.rxpick { display: flex; justify-content: space-around; padding: 4px 0 12px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.actsheet .rxpick button { width: 46px; height: 46px; padding: 0; font-size: 1.6rem; border-radius: 50%; text-align: center; background: var(--bg); }
.actsheet .rxpick button.on { outline: 2.5px solid var(--primary); }

/* 대화상대 목록 */
.prow { display: flex; align-items: center; gap: 12px; cursor: default; }

/* 내 정보 */
.av.xl { width: 96px; height: 96px; font-size: 2.3rem; }
img.av { object-fit: cover; }
.mephoto { position: relative; background: none; border: 0; padding: 0; cursor: pointer; }
.mephoto .cam { position: absolute; right: -2px; bottom: -2px; background: var(--card); border-radius: 50%; width: 32px; height: 32px;
  display: grid; place-items: center; font-size: 1rem; box-shadow: 0 1px 4px rgba(0,0,0,.25); }
.dangerlink { display: block; margin: 24px auto 0; color: var(--muted); text-decoration: underline; }

/* 로그인·약관 */
.loginlinks { text-align: center; margin-top: 14px; font-size: .85rem; color: var(--muted); }
.loginlinks a { color: var(--muted); }
.loginlinks .linkbtn { color: var(--primary); font-size: .95rem; margin-bottom: 8px; }
.consent { margin: 14px 0 4px; padding: 12px; background: var(--bg); border-radius: 12px; }
.consent .chk { display: flex; align-items: center; gap: 8px; font-weight: 400; margin: 6px 0; font-size: .95rem; flex-wrap: wrap; }
.consent .chk input { width: 22px; height: 22px; flex: none; }
.consent .chk.all { font-size: 1.05rem; border-bottom: 1px solid var(--line); padding-bottom: 8px; }
.consent .linkbtn.small { color: var(--primary); font-size: .82rem; text-decoration: underline; }
.policy h2 { margin-top: 0; }
.policy h3 { font-size: 1rem; margin: 16px 0 4px; }
.policy p, .policy li { font-size: .92rem; }
/* 방 위 줄: 설명·관리자는 한 줄(넘치면 …), 버튼은 그 아래 오른쪽 */
.roomtop, .chat-top { flex-wrap: wrap; row-gap: 6px; }
.rinfo { flex: 1 1 100%; display: flex; gap: 8px; align-items: baseline; white-space: nowrap; overflow: hidden; }
.rinfo > * { overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.rinfo > .muted { flex: 0 1 auto; }
.rinfo .mgrline { flex: 0 1 auto; margin-top: 0; }
.rinfo:empty { display: none; }
.chat-actions { margin-left: auto; }
.tile .cnt { right: auto; left: -10px; }

/* ===== V28 ===== */
/* 2. 채팅 "안 읽은 사람 수": 카톡처럼 밝은 노란색 + 굵게 + 얇은 그림자 (밝은/어두운 화면 모두 또렷하게) */
.msg .ur { color: #ffe600; font-size: .8rem; font-weight: 800; letter-spacing: .01em;
  text-shadow: 0 0 2px rgba(0,0,0,.75), 0 1px 1px rgba(0,0,0,.55); }

/* 1. 프로필 사진 편집 (동그라미 안에서 위치·크기 조절) */
body.noscroll { overflow: hidden; }
.cropper { position: fixed; inset: 0; z-index: 70; background: #111; color: #fff; display: flex; flex-direction: column;
  padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.crophead { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px; }
.crophead b { font-size: 1.1rem; }
.crophead .linkbtn { color: #fff; font-size: 1.05rem; padding: 10px 6px; font-weight: 600; }
.crophead #cropOk { color: #ffe600; }
.cropstage { flex: 1; display: grid; place-items: center; min-height: 0; }
.cropview { position: relative; width: min(82vw, 360px); height: min(82vw, 360px); overflow: hidden; border-radius: 50%;
  touch-action: none; cursor: grab; background: #333; box-shadow: 0 0 0 3px rgba(255,255,255,.85), 0 0 0 9999px rgba(0,0,0,.55); }
.cropview:active { cursor: grabbing; }
.cropview img { position: absolute; left: 0; top: 0; transform-origin: 0 0; max-width: none; user-select: none; -webkit-user-drag: none; pointer-events: none; }
.crophint { text-align: center; color: #ccc; font-size: .9rem; margin: 10px 0 4px; }
.cropzoom { display: flex; align-items: center; gap: 12px; padding: 8px 28px 22px; max-width: 480px; width: 100%; margin: 0 auto; }
.cropzoom span { font-size: 1.4rem; color: #fff; width: 24px; text-align: center; }
.cropzoom input[type=range] { flex: 1; padding: 0; border: 0; height: 36px; accent-color: #ffe600; background: none; }

/* 4. [원인] html·body 둘 다 overflow-x:hidden 이면 body가 따로 스크롤 상자가 되어
      "화면 위에 붙어 있기(sticky)"가 모두 풀려 버림 → 맨 위 줄·방 위 메뉴가 대화와 함께 밀려 올라갔음.
      가로 넘침은 그대로 막되(clip), 세로로는 화면에 붙도록 고침 */
html { overflow-x: hidden; }
body { overflow-x: clip; }
@supports not (overflow-x: clip) { body { overflow-x: visible; } }

/* 4. 방 위 메뉴: 화면에 붙어 따라다니다가 아래로 내리면 숨고, 위로 올리면 다시 나타남 */
.roomhead { position: sticky; top: var(--tbh, 64px); z-index: 9; background: var(--bg);
  margin: -16px -16px 10px; padding: 10px 16px 8px; transition: transform .28s ease, margin-bottom .28s ease; will-change: transform;
  box-shadow: 0 2px 6px rgba(0,0,0,.06); }
.roomhead.hide { transform: translateY(calc(-100% - 6px)); pointer-events: none; }
/* V59 (0-86): 글이 적은 방 — 접으면 자리까지 비워 화면을 넓게 */
.roomhead.fold { margin-bottom: calc(10px - var(--rhh, 0px)); }
.roomhead .roomtop, .roomhead .chat-top { margin-bottom: 0; }
.roomhead .subbar.top { position: static; margin: -10px -16px 8px; box-shadow: none; }
.chathead { margin-bottom: 0; }

/* 5. 문서 파일 첨부·카드 */
.flist { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.fitem, .fcard { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1.5px solid var(--line); border-radius: 12px;
  background: var(--card); color: var(--text); text-decoration: none; min-width: 0; }
.fitem button { margin-left: auto; flex: none; background: var(--bg); border: 0; border-radius: 50%; width: 30px; height: 30px; color: var(--muted); cursor: pointer; }
.fic { font-size: 1.7rem; line-height: 1; flex: none; }
.fnm { display: flex; flex-direction: column; min-width: 0; line-height: 1.35; }
.fnm b { font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcards { display: flex; flex-direction: column; gap: 6px; margin-top: 12px; }
.fcard { cursor: pointer; }
.fcard:active { background: var(--bg); }
.fcards.inchat { margin: 0; width: 240px; max-width: 100%; }
.fcards.inchat .fcard { background: #fff; color: #111; border-color: rgba(0,0,0,.08); }
.fcards.inchat .fcard .muted { color: #666; }
.bubble.hasfile { padding: 4px; }
.bubble.hasfile .ctext { padding: 4px 8px; }
.pdf-tip { margin: 7px 2px 10px; color: var(--primary); font-size: .84rem; font-weight: 600; }
.actsheet .pdf-tip { margin: 8px 18px 4px; text-align: left; }
.fbadge { display: inline-block; margin-top: 10px; font-size: .85rem; color: var(--primary); background: var(--soft-blue);
  border-radius: 999px; padding: 2px 10px; font-weight: 600; }

/* 7. 목록 하트: 글 보기와 같은 모양 (내가 누르면 빨간 하트) */
.lcnt { display: flex; align-items: center; gap: 16px; color: var(--muted); }
.lcnt .lk, .lcnt .lc { display: inline-flex; align-items: center; gap: 4px; line-height: 1; }
.lcnt svg { display: block; color: var(--muted); }
.lcnt .lk.on { color: #ed4956; }
.lcnt span > span:empty { display: none; }

/* 8. 떠 있는 홈 버튼 🏠 */
.homefab { position: fixed; right: 16px; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 15;
  width: 54px; height: 54px; border-radius: 50%; border: 1px solid rgba(0,0,0,.08); font-size: 1.6rem; line-height: 1; cursor: pointer;
  background: rgba(255,255,255,.82); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  box-shadow: 0 4px 14px rgba(0,0,0,.22); opacity: 0; transform: scale(.85); pointer-events: none;
  transition: opacity .45s ease, transform .3s ease; }
.homefab.show { opacity: 1; transform: scale(1); pointer-events: auto; transition: opacity .15s ease, transform .15s ease; }
.homefab.instant { transition: none; }
:root[data-theme="dark"] .homefab { background: rgba(50,55,62,.85); border-color: rgba(255,255,255,.12); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .homefab { background: rgba(50,55,62,.85); border-color: rgba(255,255,255,.12); } }

/* ===== V29 ===== */
/* 성도 인증 기록 */
.approval-line { margin: 12px 0 0; padding: 9px 12px; border-radius: 10px; background: var(--soft-green);
  color: var(--ok); font-size: .88rem; font-weight: 650; }
.roster-total { font-size: 1.12rem; }
.roster-head label { margin-top: 12px; }
.roster-sort { display: flex; gap: 8px; margin-top: 10px; }
.roster-sort button { flex: 1; border: 1.5px solid var(--line); border-radius: 10px; padding: 10px 8px;
  background: var(--card); color: var(--muted); font: inherit; font-weight: 650; cursor: pointer; }
.roster-sort button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.roster-person { display: flex; align-items: center; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
.roster-person .av { width: 52px; height: 52px; font-size: 1.25rem; }
.roster-person > div { min-width: 0; display: flex; flex-direction: column; }
.roster-person b { font-size: 1.12rem; }
.roster-person span { color: var(--muted); font-size: .9rem; }
.roster-info { margin: 12px 0 0; }
.roster-info > div { display: grid; grid-template-columns: 92px 1fr; gap: 8px; padding: 4px 0; }
.roster-info dt { color: var(--muted); font-size: .84rem; }
.roster-info dd { margin: 0; font-size: .9rem; word-break: break-word; }
.backfill-note { margin: 9px 0 0; color: var(--muted); font-size: .8rem; }

/* PDF 앱 안 보기 */
.pdf-viewer { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column; overflow: hidden;
  background: #2b3036; color: #fff; padding: env(safe-area-inset-top) 0 env(safe-area-inset-bottom); }
.pdf-bar { flex: none; min-height: 58px; display: flex; align-items: center; gap: 8px; padding: 7px 10px;
  background: #17202a; border-bottom: 1px solid rgba(255,255,255,.15); }
.pdf-bar button, .pdf-bar a, .pdf-tools button { border: 0; border-radius: 10px; min-height: 42px; padding: 8px 10px;
  background: rgba(255,255,255,.12); color: #fff; font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; }
.pdf-title { flex: 1; min-width: 0; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-weight: 700; }
.pdf-count { flex: none; min-width: 60px; text-align: center; color: #e8edf3; font-size: .86rem; }
.pdf-download { flex: none; display: inline-flex; align-items: center; gap: 4px; }
.pdf-tools { flex: none; height: 48px; display: flex; align-items: center; justify-content: center; gap: 10px;
  background: #202a35; border-bottom: 1px solid rgba(255,255,255,.12); }
.pdf-tools button { width: 48px; min-height: 36px; padding: 2px; font-size: 1.35rem; }
.pdf-zoom { min-width: 58px; text-align: center; font-size: .9rem; font-weight: 650; }
.pdf-body { position: relative; flex: 1; min-height: 0; overflow: auto; overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch; touch-action: pan-x pan-y; }
.pdf-pages { width: max-content; min-width: 100%; display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 12px; }
.pdf-page { flex: none; position: relative; display: grid; place-items: center; overflow: hidden; background: #fff;
  color: #707780; box-shadow: 0 2px 12px rgba(0,0,0,.45); transition: width .08s linear, height .08s linear; }
.pdf-page canvas { display: block; background: #fff; }
.pdf-page-wait, .pdf-page-error { position: absolute; inset: 0; display: grid; place-items: center; background: #fff; color: #737b85; }
.pdf-status { position: fixed; z-index: 2; left: 50%; top: 52%; transform: translate(-50%,-50%); min-width: 190px;
  display: grid; grid-template-columns: 26px 1fr auto; align-items: center; gap: 8px; padding: 14px 16px; border-radius: 14px;
  background: rgba(17,24,31,.94); color: #fff; box-shadow: 0 5px 24px rgba(0,0,0,.4); }
.pdf-status[hidden] { display: none; }
.pdf-spinner { width: 22px; height: 22px; border: 3px solid rgba(255,255,255,.25); border-top-color: #fff;
  border-radius: 50%; animation: pdfspin .8s linear infinite; }
.pdf-progress { font-variant-numeric: tabular-nums; }
.pdf-download.busy { opacity: .55; pointer-events: none; }
@keyframes pdfspin { to { transform: rotate(360deg); } }
.pdf-fail { width: min(420px, calc(100vw - 32px)); margin: 56px auto; color: var(--text); text-align: center; }
.pdf-fail-icon { font-size: 3rem; }
.pdf-fail .btn { color: #fff; }
@media (max-width: 430px) {
  .pdf-bar { gap: 5px; padding-inline: 7px; }
  .pdf-bar button, .pdf-bar a { padding-inline: 8px; font-size: .88rem; }
  .pdf-title { font-size: .9rem; }
  .pdf-count { min-width: 52px; font-size: .78rem; }
}
@media (max-width: 360px) { .pdf-close span, .pdf-download span { display: none; } }

/* ===== V30 ===== */
/* 맨 위 제목: 방 아이콘 + 이름 + 작은 자물쇠 */
#topbar h1 { display: flex; align-items: center; gap: 8px; min-width: 0; }
#topbar h1 .ttxt { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#topbar h1 .tlock { display: inline-flex; flex: none; color: var(--muted); }

/* 방 아이콘: 연한 색 바탕(그 색 약 12%) + 같은 색 선 그림 — 오래된 아이폰에서도 되도록 color-mix 대신 ::before 사용 */
.ri { position: relative; display: inline-grid; place-items: center; flex: none; vertical-align: middle;
  width: 34px; height: 34px; border-radius: 10px; color: var(--ac, #3b7ddd); line-height: 1; }
.ri::before { content: ""; position: absolute; inset: 0; border-radius: inherit; background: var(--ac, #3b7ddd); opacity: .12; }
.ri svg { position: relative; width: 58%; height: 58%; }
.ri.emo { font-size: 1.25rem; }
.ri.big { width: 58px; height: 58px; border-radius: 16px; }
.ri.big.emo { font-size: 2rem; }
.ri.big svg { width: 52%; height: 52%; }
.ri.card { width: 56px; height: 56px; border-radius: 14px; }
.ri.card.emo { font-size: 2rem; }
.ri.card svg { width: 52%; height: 52%; }
.ri.hd { width: 30px; height: 30px; border-radius: 9px; }
.ri.hd.emo { font-size: 1.1rem; }
.ri.sb { width: 36px; height: 36px; border-radius: 10px; }
.ri.sb.emo { font-size: 1.3rem; }
.ri.xs { width: 22px; height: 22px; border-radius: 6px; vertical-align: -5px; }
.ri.xs.emo { font-size: .85rem; }
.ri.xs svg { width: 64%; height: 64%; }
:root[data-theme="dark"] .ri::before { opacity: .24; }
:root[data-theme="dark"] .ri svg { filter: brightness(1.45) saturate(.9); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ri::before { opacity: .24; }
  :root:not([data-theme="light"]) .ri svg { filter: brightness(1.45) saturate(.9); }
}
.ico-lock, .ico-bell { display: inline-block; vertical-align: middle; flex: none; }

/* 홈: 내가 참여한 방 — 테두리 없이 연한 하늘빛 바탕 + 위·아래 얇은 실선 */
.mybox { border: 0; border-top: 1px solid #c6d7ea; border-bottom: 1px solid #c6d7ea; border-radius: 0;
  background: #e9f1f9; margin: 0 -16px 10px; padding: 4px 16px 12px; }
:root[data-theme="dark"] .mybox { background: #1b2734; border-color: #2e4257; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .mybox { background: #1b2734; border-color: #2e4257; } }

/* 홈 방 타일: 빨간 숫자·점 = 그림 오른쪽 위 / 자물쇠 = 이름 옆 / 종 = 칸 오른쪽 아래 (겹치지 않게 아래 여백 확보) */
.tile { padding: 14px 6px 34px; }
.tiles.editing .tile { padding-bottom: 12px; }
.tile .ic { width: 58px; height: 58px; background: none; border-radius: 16px; font-size: inherit; }
.tile .nm { padding: 0 2px; }
.tile .mk { position: static; display: inline-block; margin-right: 3px; color: var(--muted); opacity: 1; font-size: inherit; vertical-align: -1px; }
.tile .bell { top: auto; left: auto; right: 0; bottom: 0; width: 42px; height: 32px; border-radius: 0 0 16px 10px;
  display: grid; place-items: center; color: #8a8f96; font-size: inherit; filter: none; opacity: 1; }
.tile .bell.off { color: #a7abb1; filter: none; opacity: 1; }
.tile .bell:active { background: rgba(0,0,0,.06); }
.tile .cnt { left: auto; right: -10px; top: -7px; }
.tile .dot { top: -4px; right: -4px; }

/* 최신 공지 한 줄 (인사말 위) */
.homenotice { display: flex; align-items: center; gap: 8px; background: var(--card); border-radius: 12px; padding: 9px 10px 9px 12px;
  margin: -4px 0 12px; text-decoration: none; color: var(--text); box-shadow: 0 1px 3px rgba(0,0,0,.06); min-width: 0; }
.homenotice:active { opacity: .75; }
.homenotice .ntag { font-size: .72rem; padding: 2px 7px; }
.homenotice .nt { flex: 1; min-width: 0; font-size: .95rem; }
.homenotice .nd { flex: none; color: var(--muted); font-size: .8rem; }
.homenotice .chev { flex: none; color: var(--muted); font-size: 1.1rem; line-height: 1; }

/* 알림 켜기·설치 안내: 큰 주황 카드 → 얇은 한 줄 띠 (✕로 닫으면 다시 안 나옴) */
.strip { display: flex; align-items: center; gap: 6px; background: var(--soft-warm); border: 1px solid var(--warm-line);
  border-radius: 12px; padding: 5px 4px 5px 12px; margin: 10px 0 0; font-size: .92rem; }
.strip[hidden] { display: none; }
.strip .stxt { flex: 1; min-width: 0; }
.strip .sgo { flex: none; background: var(--accent); color: #fff; border: 0; border-radius: 999px; padding: 6px 14px;
  font-family: inherit; font-size: .88rem; font-weight: 700; cursor: pointer; }
.strip .sx { flex: none; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 1rem; cursor: pointer; border-radius: 50%; }

/* 교회 홈페이지: 맨 아래 작은 링크 */
.churchlink { background: none; border: 0; margin: 26px 0 0; padding: 8px; font-size: .85rem; font-weight: 500; color: var(--muted); }

/* 방 안 알림 버튼 · 이름 옆 표시 (회색 선 그림 종) */
.mutebtn { display: inline-flex; align-items: center; gap: 5px; }
.mutebtn .ico-bell { color: #8a8f96; }
.lock { display: inline-flex; vertical-align: -2px; color: var(--muted); }
.nrname { display: inline-flex; align-items: center; gap: 8px; min-width: 0; }
.nrname > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.invroom .ri { margin-right: 2px; }

/* 작은방 줄 */
.sbi { display: flex; justify-content: center; }
.sbl { right: 12px; bottom: -3px; display: inline-flex; background: var(--card); border-radius: 50%; padding: 1px; color: var(--muted); }

/* 관리자: 아이콘 버튼 */
.iconedit { display: inline-grid; place-items: center; background: var(--card); }
.iconedit .ri { pointer-events: none; }

/* 아이콘 고르기 화면 */
.iconsheet { max-height: 90vh; overflow-y: auto; }
.ipick-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.itabs { display: flex; gap: 6px; overflow-x: auto; padding: 2px 0 8px; scrollbar-width: none; }
.itabs::-webkit-scrollbar { display: none; }
.itabs button { flex: none; border: 1.5px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px;
  padding: 6px 12px; font-family: inherit; font-size: .88rem; font-weight: 600; white-space: nowrap; cursor: pointer; }
.itabs button.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.iconsheet .icongrid { max-height: 38vh; }
.iconpick { position: relative; display: grid; place-items: center; color: var(--ac); background: none; border: 2px solid transparent; }
.iconpick::before { content: ""; position: absolute; inset: 3px; border-radius: 10px; background: var(--ac); opacity: .12; }
.iconpick svg { position: relative; }
.iconpick.on { border-color: var(--ac); background: none; }
:root[data-theme="dark"] .iconpick svg { filter: brightness(1.45) saturate(.9); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .iconpick svg { filter: brightness(1.45) saturate(.9); } }
.icolors { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; margin: 14px 0 2px; }
.icolor { width: 34px; height: 34px; border-radius: 50%; border: 3px solid var(--card); background: var(--ac); cursor: pointer;
  box-shadow: 0 0 0 1.5px var(--line); padding: 0; }
.icolor.on { box-shadow: 0 0 0 3px var(--ac); }

/* 성도 명단: 전화번호부처럼 한 줄 → 누르면 펼침 */
.roster-list { padding: 2px 14px; }
.roster-card { border-bottom: 1px solid var(--line); }
.roster-card:last-child { border-bottom: 0; }
.roster-person { display: flex; align-items: center; gap: 10px; width: 100%; background: none; border: 0; padding: 10px 0;
  font: inherit; color: inherit; text-align: left; cursor: pointer; border-bottom: 0; }
.roster-person .av { width: 32px; height: 32px; font-size: .9rem; }
.rp-name { flex: 1; min-width: 0; display: flex; align-items: baseline; gap: 6px; overflow: hidden; white-space: nowrap; }
.rp-name b { font-size: 1.02rem; overflow: hidden; text-overflow: ellipsis; }
.rp-name span { color: var(--muted); font-size: .85rem; flex: none; }
.rp-date { flex: none; color: var(--muted); font-size: .82rem; }
.rp-norec { color: var(--danger); font-weight: 600; }
.roster-person .chev { flex: none; color: var(--muted); transition: transform .2s; }
.roster-card.open .chev { transform: rotate(90deg); }
.roster-more { padding: 0 0 10px 42px; }
.roster-more[hidden] { display: none; }
.roster-more .roster-info { margin: 0; }
.roster-filter { display: block; width: 100%; margin-top: 10px; border: 1.5px dashed var(--line); background: none; border-radius: 10px;
  padding: 9px; font: inherit; font-size: .9rem; color: var(--muted); cursor: pointer; }
.roster-filter.on { border-style: solid; border-color: var(--danger); color: var(--danger); font-weight: 650; }

/* 열 수 없는 파일 (가짜 링크 막기) */
.fcard.bad { opacity: .7; cursor: default; }

/* ===== V31 ===== */
/* 작은방: 큰방 그림(흐리게, 뒤) + 작은방 그림(작게, 오른쪽 아래 앞) */
.ri-stack { position: relative; display: inline-block; flex: none; vertical-align: middle; }
.ri-stack.big { width: 58px; height: 58px; }
.ri-stack.card { width: 56px; height: 56px; }
.ri-stack > .ri.ghost { position: absolute; inset: 0; opacity: .5; }
.ri.mini { position: absolute; right: -8px; bottom: -6px; width: 30px; height: 30px; border-radius: 10px; z-index: 1;
  background: var(--card); box-shadow: 0 0 0 2px var(--card); }
.ri.mini svg { width: 62%; height: 62%; }
.ri.mini.emo { font-size: 1rem; }
.room .ri-stack { margin-right: 4px; }
.tile .cnt, .tile .dot { z-index: 2; }

/* 흐르는 공지: 길 때만 전광판처럼 (짧으면 그대로) · 손가락을 대면 멈춤 */
.homenotice .mq { overflow: hidden; white-space: nowrap; text-overflow: clip; }
.homenotice .mqi { display: inline-block; }
.homenotice .mq:not(.run) .mqi { max-width: 100%; overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
.homenotice .mq.run .mqi { animation: mqflow 20s linear infinite; will-change: transform; }
.homenotice .mqgap { display: inline-block; width: 48px; }
.homenotice.hold .mq.run .mqi { animation-play-state: paused; }
@keyframes mqflow { from { transform: translateX(0); } to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) {
  .homenotice .mq, .homenotice .mq.run { white-space: normal; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
  .homenotice .mq.run .mqi { animation: none; }
  .homenotice .mq.run .mqi > span:not(:first-child) { display: none; }
}

/* 다른 방 둘러보기: 두 줄로 늘어놓고 좌우로 밀기 (비공개 방은 빠짐) */
.othhead { display: flex; align-items: baseline; justify-content: space-between; margin: 16px 2px 8px; }
.othtitle { color: var(--primary); font-size: 1.02rem; font-weight: 700; padding: 4px 0; }
.ostrip { display: grid; grid-template-rows: repeat(2, auto); grid-auto-flow: column; grid-auto-columns: calc((100% - 16px) / 3.3);
  gap: 8px; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; padding: 2px 2px 8px;
  margin: 0 -16px; padding-left: 16px; padding-right: 16px; scroll-padding-left: 16px; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.ostrip::-webkit-scrollbar { display: none; }
.ocard { scroll-snap-align: start; background: var(--card); border-radius: 14px; padding: 10px 4px 8px; text-align: center; cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.06); display: flex; flex-direction: column; align-items: center; min-width: 0; }
.ocard .ri.card, .ocard .ri-stack.card { width: 44px; height: 44px; border-radius: 12px; }
.ocard .ri-stack.card .ri.ghost { border-radius: 12px; }
.ocard .ri.mini { width: 24px; height: 24px; border-radius: 8px; right: -6px; bottom: -5px; }
.ocard .ri svg { width: 24px; height: 24px; }
.ocard .ri.mini svg { width: 14px; height: 14px; }
.ri.card svg { width: 28px; height: 28px; }
.ri.mini svg { width: 18px; height: 18px; }
.ocard .nm { font-size: .82rem; font-weight: 700; line-height: 1.25; margin-top: 6px; width: 100%; word-break: keep-all;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ocard .pn { font-size: .66rem; color: var(--muted); width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ocard .ojoin { margin-top: auto; padding: 4px 0; width: 74%; min-height: 30px; border: 0; border-radius: 999px; background: var(--primary); color: #fff;
  font-family: inherit; font-size: .8rem; font-weight: 700; cursor: pointer; }
.ocard .ojoin:disabled { opacity: .5; }

/* 글 보기: 본문·댓글만 꾹 눌러 원하는 부분을 골라 복사 (앱의 다른 곳은 지금처럼 선택 안 됨) */
.postview .body, .postview .ttl, .postview .scripture, .postview .eventbox, .postview .comment .txt {
  -webkit-user-select: text; user-select: text; -webkit-touch-callout: default; }

/* V31 추가: 작은방은 폴더처럼 "큰방 /" (흐린 작은 글씨) 위 + 작은방 이름(큰방보다 작게) 아래 · 작은방 그림 10% 크게 */
.tile .pup, .ocard .pup { font-size: .68rem; color: var(--muted); line-height: 1.2; margin-top: 6px; width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 4px; }
.tile .nm.sub { font-size: .8rem; }
.ocard .pup { margin-top: 6px; font-size: .64rem; }
.ocard .pup + .nm { margin-top: 0; }
.ocard .nm.sub { font-size: .76rem; }
.ri.mini { width: 33px; height: 33px; right: -9px; bottom: -7px; border-radius: 11px; }
.ri.mini svg { width: 20px; height: 20px; }
.ocard .ri.mini { width: 26px; height: 26px; right: -7px; bottom: -5px; border-radius: 9px; }
.ocard .ri.mini svg { width: 15px; height: 15px; }

/* ===== V33 ===== */
/* 방 아이콘 네모(.ri.card)가 흰 상자 .card 의 안쪽 여백(18px)까지 받아 그림이 오른쪽 아래로 밀리던 문제 */
.ri.card { padding: 0; }

/* ===== V34 ===== */
/* 알림 글(토스트)은 사진·PDF 보기 화면 위에도 보이게 */
.toast { z-index: 100; }
.sheet-bg.sharebg { z-index: 95; }
/* 사진 크게 보기의 [📤] (왼쪽 위) */
.viewer .vs { top: calc(14px + env(safe-area-inset-top)); left: 14px; font-size: 1.25rem; }
/* PDF 보기의 [📤 공유] */
.pdf-share { flex: none; display: inline-flex; align-items: center; gap: 4px; }
@media (max-width: 430px) { .pdf-share span { display: none; } }
/* 파일 칸 오른쪽 [📤] */
.fcard .fnm { flex: 1; }
.fshare { flex: none; display: grid; place-items: center; width: 40px; height: 40px; margin: -4px -4px -4px 0; border-radius: 10px;
  background: var(--bg); font-size: 1.15rem; cursor: pointer; }
.fcards.inchat .fshare { background: #f1f3f5; }
/* 게시판형 방 위쪽 줄의 [나가기] (채팅방과 같게) */
.roomhead .leavebtn { color: #c0392b; }
/* 작은방 줄의 새 글 빨간 점 */
.sbdot { position: absolute; top: -1px; right: 14px; width: 10px; height: 10px; border-radius: 50%; background: #e53935; border: 2px solid var(--card); }
.cnoticebox select { width: 100%; }
.fnm .muted { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== V35 ===== */
/* 하루 글 개수를 다 썼을 때 안내 */
.limitfull { color: var(--danger, #c0392b); font-weight: 600; }
.notice.limitfull { margin-bottom: 12px; }
#saveBtn:disabled { opacity: .45; }

/* ===== V36 ===== */
/* 선 그림 아이콘 — 버튼 안 그림을 눌러도 버튼이 눌리게 */
.ui { vertical-align: -4px; flex: none; }
button svg, label svg, a svg { pointer-events: none; }
.actsheet button .ui { margin-right: 6px; color: var(--primary); }
.actsheet button.danger .ui { color: var(--danger); }
/* 아래 탭 */
.tabbar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; display: flex; background: var(--card); border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom); box-shadow: 0 -2px 10px rgba(0,0,0,.04); }
.tabbar[hidden] { display: none; }
.tabbar button { flex: 1; min-height: 60px; background: none; border: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
  color: var(--muted); font: inherit; font-size: .74rem; font-weight: 700; cursor: pointer; position: relative; }
.tabbar button.on { color: var(--primary); }
.tabbar .tdot { position: absolute; top: 9px; left: calc(50% + 8px); width: 9px; height: 9px; border-radius: 50%; background: #e53935; }
.tabbar .tdot[hidden] { display: none; }
body.tabbed .appver { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
/* 맨 아래 교회 정보: 첫 화면·로그인 화면에만 */
.appver { display: none; line-height: 1.6; padding-top: 10px; }
body.showfoot .appver { display: block; }
.appver a { color: inherit; }
body.chat-open .appver { display: none; }
/* 떠 있는 홈 버튼은 더 이상 쓰지 않음 */
.homefab { display: none !important; }
/* 더보기 */
.meuser { display: flex; align-items: center; gap: 12px; width: 100%; border: 0; text-align: left; font: inherit; font-size: 1.05rem; cursor: pointer; color: var(--text); }
.meuser .mname { flex: 1; }
.morelist { padding: 4px 0; }
.morelist[hidden] { display: none; }
.morelist button { display: flex; align-items: center; gap: 14px; width: 100%; padding: 14px 18px; background: none; border: 0; border-bottom: 1px solid var(--line);
  font: inherit; font-size: 1.02rem; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; }
.morelist button:last-child { border-bottom: 0; }
.morelist button[hidden] { display: none; }
.morelist button .ui { color: var(--primary); }
.morelist button span { flex: 1; }
.morelist button em { font-style: normal; color: var(--muted); font-weight: 500; font-size: .92rem; }
.morelist button.danger, .morelist button.danger .ui { color: var(--danger); }
.ui.chev { color: #aab0b6 !important; }
.mbadge { background: #e53935; color: #fff; font-size: .75rem; font-weight: 800; border-radius: 10px; padding: 1px 8px; }
.mbadge[hidden] { display: none; }
/* ≡ 방 메뉴 */
#menuBtn .ui { color: var(--primary); }
.drawer-bg { align-items: stretch; justify-content: flex-end; }
.rdrawer { width: min(300px, 82vw); background: var(--card); height: 100%; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top);
  box-shadow: -6px 0 20px rgba(0,0,0,.2); animation: drawin .18s ease-out; }
@keyframes drawin { from { transform: translateX(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .rdrawer { animation: none; } }
.rdh { display: flex; align-items: center; gap: 10px; padding: 18px 16px 12px; border-bottom: 1px solid var(--line); font-size: 1.05rem; }
.rdrawer > button { display: flex; align-items: center; gap: 12px; padding: 15px 16px; background: none; border: 0; border-bottom: 1px solid var(--line); border-radius: 0;
  font: inherit; font-size: 1rem; font-weight: 600; color: var(--text); cursor: pointer; text-align: left; width: 100%; margin: 0; box-shadow: none; }
.rdrawer > button .ui, .rdrawer > button .ico-bell { color: var(--primary); }
.rdrawer > button span { flex: 1; }
.rdrawer > button em { font-style: normal; color: var(--muted); font-weight: 500; }
.rdrawer > button.off { color: var(--muted); }
.rdrawer > #leaveBtn { margin-top: auto; color: var(--danger); border-top: 1px solid var(--line); }
.rdrawer > #leaveBtn .ui { color: var(--danger); }
/* 채팅 "↓ 새 메시지" */
.newmsg { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(78px + env(safe-area-inset-bottom)); z-index: 15; border: 0; border-radius: 18px;
  background: rgba(31,35,40,.86); color: #fff; padding: 8px 15px; font: inherit; font-size: .88rem; font-weight: 700; display: flex; align-items: center; gap: 6px; cursor: pointer; }
.newmsg[hidden] { display: none; }
/* 신고 */
.repsheet h3 { display: flex; align-items: center; gap: 8px; margin: 0 0 4px; }
.repsheet h3 .ui { color: var(--danger); }
.ropt { display: flex; align-items: center; gap: 10px; font-weight: 500; margin: 0; padding: 10px 2px; border-bottom: 1px solid var(--line); font-size: 1rem; }
.ropt input { width: 20px; height: 20px; }
.repsheet #rnote { margin-top: 10px; }
.repsheet .row { margin-top: 12px; }
.linkbtn.repc { color: var(--muted); margin-left: 8px; }
.rcard .rtop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.rtag { background: #fdecea; color: var(--danger); border-radius: 8px; padding: 2px 8px; font-size: .82rem; font-weight: 800; }
.rprev { margin: 8px 0 6px; font-size: 1rem; word-break: break-word; }
.rcard .row { margin-top: 10px; gap: 8px; flex-wrap: wrap; }
/* 채팅 약속 */
.chatrules ul { text-align: left; padding-left: 1.2em; line-height: 1.7; margin: 8px 0 16px; }
.chatrules .onb-ic .ui { color: var(--primary); }
/* 비밀번호 보기 */
.pwwrap { position: relative; display: block; }
.pwwrap input { padding-right: 48px; }
.pweye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 42px; height: 42px; border: 0; background: none; color: var(--muted); cursor: pointer;
  display: grid; place-items: center; }
.capsnote { color: var(--danger); font-size: .85rem; margin-top: 4px; }
.capsnote[hidden] { display: none; }
/* 안드로이드: 내 파일에서 사진 고르기 */
.photo2 { display: inline-flex; align-items: center; gap: 6px; margin: 6px 0 2px; color: var(--primary); font-weight: 600; cursor: pointer; }
.strip .stxt .ui { color: var(--primary); margin-right: 4px; }
.rdrawer > button .ico-bell { width: 20px; height: 20px; }
/* V40: 여러 명 초대 — 고른 사람 이름표 줄 + [○명 초대하기] (초대 목록을 보는 동안 화면 아래에 붙어 있음) */
.pickbtn.on { background: var(--primary); color: #fff; border-color: var(--primary); }
.pickbar { position: sticky; bottom: 0; z-index: 5; margin-top: 10px; padding: 12px 14px calc(12px + env(safe-area-inset-bottom, 0px)); background: var(--card); border: 2px solid var(--primary); border-radius: 16px 16px 0 0; box-shadow: 0 -4px 14px rgba(0,0,0,.12); }
.pickhead { display: flex; align-items: center; gap: 8px; }
.pickhead .linkbtn { margin-left: auto; }
.pickchips { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0 10px; max-height: 120px; overflow-y: auto; }
.pchip { border: 1px solid var(--line); background: var(--soft-blue, #e7eef6); color: var(--text); border-radius: 999px; padding: 6px 12px; font: inherit; font-size: .95rem; min-height: 36px; cursor: pointer; }
/* V42: 화면 전환 (카톡처럼) — 들어가기는 오른쪽에서, 뒤로는 왼쪽에서, 아래 탭끼리는 흐려졌다 나타남. 짧고 가볍게(0.18~0.24초) */
#app.pg-fwd { animation: pgFwd .24s cubic-bezier(.2,.8,.2,1); }
#app.pg-back { animation: pgBack .24s cubic-bezier(.2,.8,.2,1); }
#app.pg-fade { animation: pgFade .18s ease-out; }
@keyframes pgFwd { from { transform: translateX(28%); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes pgBack { from { transform: translateX(-22%); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes pgFade { from { opacity: 0; } to { opacity: 1; } }
/* 아래에서 올라오는 창(초대·신고·사진 고르기 등)도 부드럽게 */
.sheet-bg { animation: pgFade .16s ease-out; }
.sheet-bg > .sheet { animation: sheetUp .22s cubic-bezier(.2,.8,.2,1); }
@keyframes sheetUp { from { transform: translateY(40px); opacity: .4; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  #app.pg-fwd, #app.pg-back, #app.pg-fade, .sheet-bg, .sheet-bg > .sheet { animation: none; }
}

/* V43: 설치 먼저 (로그인 전 설치 안내) */
.gate h3 { margin: 0 0 8px; font-size: 1.2rem; }
.gate .btn { margin-top: 14px; }
.gate .notice { margin-top: 12px; }
.gate-steps { list-style: none; margin: 4px 0 0; padding: 0; }
.gate-steps li { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line); font-size: 1.05rem; line-height: 1.45; }
.gate-steps li:last-child { border-bottom: 0; }
.gate-ico { flex: none; width: 44px; height: 44px; border-radius: 12px; background: var(--soft-blue); color: #0a66d8; display: flex; align-items: center; justify-content: center; }
.gate-ico.gate-txt { font-weight: 700; font-size: .95rem; }
.gate-url { margin: 8px 0 0; text-align: center; word-break: break-all; user-select: all; -webkit-user-select: all; }
.gate-help { text-align: center; margin: 12px 0 0; }
.loginlinks .gate-esc { color: var(--muted); text-decoration: underline; font-size: 1rem; min-height: 48px; padding: 10px 12px; }
.notice.ok { background: var(--soft-green); border-color: #b9dcc6; margin: 4px 0 10px; }
:root[data-theme="dark"] .gate-ico { color: #8fc1ff; }
:root[data-theme="dark"] .notice.ok { border-color: #3d6b52; }

/* V44: 방 맨 위 바로가기 (주보방 "이번 주 주보 보기") */
.quicklink { margin: 0 0 12px; text-align: center; }
.quicklink .btn { margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px; }
.quicklink .linkbtn { display: inline-block; color: var(--primary); font-size: .95rem; padding: 10px 8px; min-height: 44px; }

/* V45: 설치 창이 늦게 준비되면 [하늘다리 설치하기]를 다시 누르라고 살짝 강조 */
.gate .btn.pulse { animation: gatePulse 1.2s ease-in-out 3; box-shadow: 0 0 0 0 rgba(47,93,138,.5); }
@keyframes gatePulse { 50% { box-shadow: 0 0 0 10px rgba(47,93,138,0); transform: scale(1.02); } }
@media (prefers-reduced-motion: reduce) { .gate .btn.pulse { animation: none; outline: 3px solid var(--accent); } }
/* V50: 방 위 [👥 ○명] (0-55) · 프사 크게 보기 (0-64) */
.withpeople > .rinfo { flex: 1 1 0; }
.peoplechip { margin-left: auto; white-space: nowrap; }
img.av.zoomable { cursor: zoom-in; }
.avview figure { margin: 0; display: grid; justify-items: center; gap: 14px; max-width: min(92vw, 520px); }
.avview figure img { width: min(86vw, 480px); height: min(86vw, 480px); max-height: 70vh; object-fit: cover; border-radius: 18px; background: #222; }
.avview figcaption { color: #fff; font-size: 1.25rem; font-weight: 700; text-align: center; }
/* ===== V51 ===== */
/* 0-65 사진 크게 보기: 손가락으로 밀기 · ‹ › 크게 */
.viewer { touch-action: pan-y pinch-zoom; }
.viewer .vmedia { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.viewer video.vmedia { max-height: 82vh; background: #000; }
.viewer .vp, .viewer .vn { width: 56px; height: 56px; font-size: 2.2rem; line-height: 1; transform: translateY(-50%); background: rgba(255,255,255,.22); }
.viewer .vc { background: rgba(0,0,0,.45); padding: 4px 12px; border-radius: 999px; }
/* 0-67 붙여넣은 사진 확인 창 */
.pastesheet h3 { margin: 0 0 12px; }
.pasteprev { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 6px; margin-bottom: 14px; }
.pasteprev img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; flex: none; background: var(--bg); }
.pastesheet .row { display: flex; gap: 10px; }
.pastesheet .row .btn { flex: 1; margin: 0; }
/* 0-68 다른 방 둘러보기 점 — 한 쪽(3칸)씩 멈춤 */
.ostrip { scroll-snap-type: x mandatory; }
.ocard { scroll-snap-align: none; }
.ocard.pgstart { scroll-snap-align: start; }
.odots { display: flex; justify-content: center; align-items: center; gap: 4px; margin: 2px 0 6px; }
.odots[hidden] { display: none; }
.odots button { width: 22px; height: 22px; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.odots button::after { content: ""; width: 8px; height: 8px; border-radius: 4px; background: #c2c7ce; transition: width .2s, background .2s; }
.odots button.on::after { width: 20px; background: var(--primary); }
/* 0-32 ⭐ 자주 가는 방 */
.favbox { margin: 12px 0 4px; }
.favh { margin: 0 0 8px; font-size: 1.05rem; }
.favgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.favcard { display: flex; align-items: center; gap: 10px; min-width: 0; height: 76px; box-sizing: border-box; padding: 10px 8px 10px 10px;
  background: var(--card); border: 1.5px solid #f0d27a; border-radius: 14px; cursor: pointer; }
.favcard .ic { position: relative; flex: none; width: 46px; height: 46px; display: grid; place-items: center; }
.favcard .ic .ri.card, .favcard .ic .ri-stack.card { width: 46px; height: 46px; border-radius: 12px; }
.favcard .cnt { position: absolute; top: -8px; right: -10px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
  background: #e53935; color: #fff; font-size: .72rem; font-weight: 700; line-height: 20px; text-align: center; border: 2px solid var(--card); box-sizing: content-box; }
.favcard .dot { position: absolute; top: -4px; right: -4px; width: 13px; height: 13px; background: #e53935; border-radius: 50%; border: 2px solid var(--card); }
.favcard .ftx { display: flex; flex-direction: column; min-width: 0; }
.favcard .ftx b { font-size: 1.02rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favcard .ftx .small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.favguide { display: flex; align-items: center; gap: 6px; background: var(--soft-warm); border: 1px solid var(--warm-line); border-radius: 12px;
  padding: 8px 4px 8px 12px; margin: 10px 0 0; font-size: .9rem; line-height: 1.45; }
.favguide[hidden] { display: none; }
.favguide span { flex: 1; min-width: 0; }
.favguide .sx { flex: none; width: 36px; height: 36px; border: 0; background: none; color: var(--muted); font-size: 1rem; cursor: pointer; border-radius: 50%; }
.favrow { margin: 6px 0 10px; }
.favbtn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--primary);
  background: var(--card); color: var(--primary); font-family: inherit; font-size: .95rem; font-weight: 700; cursor: pointer; max-width: 100%; }
.favbtn .star { font-size: 1.2rem; line-height: 1; }
.favbtn.on { background: #fff3c4; border-color: #d9a520; color: #7a5200; }
.favbtn.on .star { color: #e0a800; }
:root[data-theme="dark"] .favbtn.on { background: #4a3d16; color: #ffe08a; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .favbtn.on { background: #4a3d16; color: #ffe08a; } }
/* 0-15 K-4 채팅방 공지 띠 */
.cnotice { position: relative; background: var(--card); border-radius: 12px; margin: 4px 0 8px;   /* 위에 붙는 방 머리(.roomhead) 안에 있어 함께 붙어 있음 */
  box-shadow: 0 2px 8px rgba(0,0,0,.14); }
.cnotice[hidden] { display: none; }
.cnrow { display: flex; align-items: center; }
.cnmain { flex: 1; min-width: 0; display: flex; align-items: center; gap: 10px; padding: 9px 4px 9px 10px; border: 0; background: none;
  font-family: inherit; color: inherit; text-align: left; cursor: pointer; }
.cnic { flex: none; width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; display: grid; place-items: center; }
.cntx { display: flex; flex-direction: column; min-width: 0; }
.cntx em { font-style: normal; font-size: .72rem; font-weight: 700; color: var(--primary); }
.cntx b { font-weight: 500; font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cnotice.open .cntx b { white-space: pre-wrap; word-break: break-word; }
.cnmore { flex: none; width: 40px; height: 44px; border: 0; background: none; color: var(--muted); cursor: pointer; display: grid; place-items: center; }
.cnmore svg { transform: rotate(90deg); transition: transform .2s; }
.cnotice.open .cnmore svg { transform: rotate(-90deg); }
.cnact { display: flex; flex-wrap: wrap; gap: 4px 16px; padding: 0 12px 10px 50px; }
.cnact .linkbtn { color: var(--primary); }
.cnact .linkbtn.danger { color: var(--danger); }
.msg.flash .bubble { animation: msgflash 1.6s ease-out; }
@keyframes msgflash { 0%, 40% { box-shadow: 0 0 0 4px #ffd54a; } 100% { box-shadow: 0 0 0 0 transparent; } }
/* 0-15 K-5 사진·동영상 / 파일 모아 보기 */
.mtabs { display: flex; border-bottom: 1px solid var(--line); margin: 0 -16px 8px; background: var(--card); }
.mtabs button { flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 0 10px; border: 0;
  border-bottom: 3px solid transparent; background: none; font-family: inherit; font-size: .98rem; color: var(--muted); cursor: pointer; }
.mtabs button.on { color: var(--text); font-weight: 700; border-bottom-color: var(--primary); }
.mday { margin: 14px 2px 6px; font-size: .88rem; color: var(--muted); }
.mgrid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; margin: 0 -16px; }
.mcell { position: relative; aspect-ratio: 1; padding: 0; border: 0; background: #d9dde2; cursor: pointer; overflow: hidden; }
.mcell img { width: 100%; height: 100%; object-fit: cover; display: block; }
.mcell.vid { background: #2b2f36; }
.mplay { position: absolute; left: 6px; bottom: 6px; background: rgba(0,0,0,.6); color: #fff; font-size: .75rem; font-weight: 700; padding: 2px 7px; border-radius: 6px; }
.mfiles { display: flex; flex-direction: column; gap: 4px; }
.mfile .fcards { margin: 0; }
.mfile > .small { display: block; margin: 2px 4px 8px; }
#mmore { margin-top: 14px; }
/* V51 보완: 채팅방 ☆ 버튼은 방 머리 안에 작게 · 방 ≡ 메뉴의 자주 가는 방 */
.favrow.compact { margin: 4px 0 2px; }
.favrow.compact .favbtn { padding: 5px 12px; font-size: .84rem; border-width: 1.2px; }
.favrow.compact .favbtn .star { font-size: 1rem; }
.rdrawer > #drawerFav .star { flex: none; width: 22px; text-align: center; font-size: 1.25rem; line-height: 1; color: var(--primary); }
.rdrawer > #drawerFav.on .star { color: #e0a800; }
/* ===== V52 ===== */
/* 0-69 홈 '내가 참여한 방' — 작은 3칸 (높이 76, 자주 가는 방 카드와 같게 · 시안 B2) */
.tile { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 76px; box-sizing: border-box;
  padding: 9px 4px 8px; border-radius: 14px; }
.tile .ic { width: 36px; height: 36px; margin: 0 auto 6px; }
.tile .ri.big, .tile .ri-stack.big { width: 36px; height: 36px; border-radius: 10px; }
.tile .ri-stack.big .ri.ghost { border-radius: 10px; }
.tile .ri.big.emo { font-size: 1.3rem; }
.tile .ri.big svg { width: 56%; height: 56%; }
.tile .ri.mini { width: 20px; height: 20px; right: -6px; bottom: -5px; border-radius: 7px; }
.tile .ri.mini svg { width: 12px; height: 12px; }
.tile .pup { display: none; }
.tile .nm, .tile .nm.sub { display: block; width: 100%; font-size: .86rem; line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .nm.sub { font-size: .8rem; }
.tile .bell { top: 0; right: 0; bottom: auto; left: auto; width: 32px; height: 30px; border-radius: 0 14px 0 10px; }
.tile .bell svg { width: 15px; height: 15px; }
.tile .cnt { right: 0; top: -8px; min-width: 18px; height: 18px; line-height: 18px; padding: 0 5px; font-size: .7rem; border-radius: 9px; }
.tile .dot { top: -3px; right: -3px; width: 12px; height: 12px; }
.tiles.editing .tile { min-height: 76px; padding-bottom: 8px; }
/* 0-70 방 안 검색 · 회의록 */
.rsearch { margin: 0 0 10px; }
.rsbox { display: flex; align-items: center; gap: 6px; background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 0 6px 0 12px; }
.rsbox input { flex: 1; min-width: 0; border: 0; background: none; padding: 11px 0; font-size: 1rem; outline: none; margin: 0; }
.rsbox button { border: 0; background: none; color: var(--muted); width: 34px; height: 34px; font-size: 1rem; cursor: pointer; border-radius: 50%; }
.rsfilter { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.rschips { flex: 1; min-width: 0; display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.rschips::-webkit-scrollbar { display: none; }
.rschip { flex: none; border: 1px solid var(--line); background: var(--card); color: var(--text); border-radius: 999px; padding: 6px 12px; font-size: .88rem; cursor: pointer; font-family: inherit; }
.rschip.on { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 700; }
.rsfilter select { flex: none; width: auto; margin: 0; padding: 6px 8px; font-size: .88rem; }
.sresn { margin: 2px 2px 8px; }
.shit { cursor: pointer; }
.shrow { margin-top: 8px; }
.shrow > div, .shpdf { display: block; width: 100%; text-align: left; border: 0; background: var(--bg); border-radius: 10px; padding: 8px 10px; font-family: inherit; font-size: .92rem; color: var(--text); }
.shpdf { cursor: pointer; border: 1px solid var(--line); }
.shlab { display: block; font-size: .78rem; font-weight: 700; color: var(--primary); margin-bottom: 2px; }
.shsn { word-break: break-word; line-height: 1.5; }
.shsn mark { background: #ffe58a; color: inherit; border-radius: 3px; padding: 0 1px; }
.attline { margin: 6px 0 2px; font-size: .92rem; color: var(--muted); }
.attline summary { cursor: pointer; }
.mlabel { margin-top: 10px; font-weight: 700; font-size: .95rem; }
.attchips { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 8px 0 4px; }
.attsheet { max-height: 86vh; display: flex; flex-direction: column; }
.attsheet h3 { margin: 0 0 10px; }
.attsheet .attall { display: flex; gap: 8px; margin: 8px 0; }
.attlist { flex: 1; min-height: 120px; overflow-y: auto; border-top: 1px solid var(--line); margin-bottom: 12px; }
.attrow { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px solid var(--line); font-size: 1rem; cursor: pointer; }
.attrow[hidden] { display: none; }
.attrow input { width: 22px; height: 22px; margin: 0; flex: none; }

/* ===== V53 (0-76): 자주 가는 방 별칭 ===== */
.favrow { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.aliasbtn { display: inline-flex; align-items: center; gap: 4px; padding: 9px 13px; border-radius: 999px; border: 1.5px solid var(--primary);
  background: var(--card); color: var(--primary); font-family: inherit; font-size: .95rem; font-weight: 700; cursor: pointer; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.aliasbtn.has { background: var(--soft-blue); }
.favrow.compact { gap: 6px; }
.favrow.compact .aliasbtn { padding: 5px 10px; font-size: .84rem; border-width: 1.2px; }
.favcard .ftx b.alias { font-size: 1.12rem; }
.aliassheet h3 { margin: 0 0 4px; }
.aliassheet p { margin: 0 0 12px; }
.aliasin { display: flex; align-items: center; gap: 8px; border: 1.5px solid var(--primary); border-radius: 12px; padding: 0 12px; background: var(--card); }
.aliasin input { flex: 1; min-width: 0; border: 0; outline: 0; padding: 12px 0; font-size: 1.05rem; font-family: inherit; background: transparent; color: var(--text); }
.aliasbtns { display: flex; gap: 8px; margin-top: 14px; }
.aliasbtns .btn { flex: 1; margin: 0; }

/* ===== V54 (0-77·0-78·0-79): 작은방 "큰방/작은방" 두 줄 · 꾹 누르기 메뉴 · 이름 글자 수 ===== */
.tile .nm.sub { white-space: normal; text-overflow: clip; line-height: 1.2; }
.tile .nm .pp, .tile .nm .cn, .favcard .fname .pp, .favcard .fname .cn { display: inline-block; max-width: 100%; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; vertical-align: top; }
.tile .nm .pp, .favcard .fname .pp { color: var(--muted); font-weight: 500; }
.favcard { height: auto; min-height: 76px; }
.favcard .ftx b.fname { white-space: normal; line-height: 1.2; }
.tile, .favcard { -webkit-touch-callout: none; -webkit-user-select: none; user-select: none; }
.holdsheet .hshead { display: flex; align-items: center; gap: 10px; padding: 0 2px 10px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.holdsheet .hshead .ic { position: relative; width: 40px; height: 40px; flex: none; display: grid; place-items: center; }
.holdsheet .hshead .ri.card, .holdsheet .hshead .ri-stack.card { width: 40px; height: 40px; border-radius: 11px; }
.holdsheet .hshead span.small { display: block; line-height: 1.2; }
.holdsheet .hshead b { font-size: 1.05rem; }
.holdsheet button[data-hm] { display: flex; align-items: center; gap: 12px; width: 100%; padding: 13px 6px; border: 0; background: none; font-family: inherit;
  font-size: 1.02rem; color: var(--text); text-align: left; border-radius: 10px; cursor: pointer; }
.holdsheet button[data-hm]:active { background: var(--bg); }
.holdsheet .i { width: 28px; text-align: center; font-size: 1.15rem; }
.holdsheet em { margin-left: auto; font-style: normal; color: var(--muted); font-size: .85rem; }
.holdsheet button.out { color: var(--danger); font-weight: 700; }
.ncnt { margin-left: 6px; font-weight: 400; }
.ncnt.over { color: var(--danger); }
#rName + .ncnt, #sName + .ncnt { display: block; margin: 2px 2px 0; }
.minutes-tip { background: var(--soft-warm); border: 1px solid var(--warm-line); border-radius: 10px; padding: 8px 10px; }

.card.room .nm .pp { color: var(--muted); font-weight: 500; }
/* V63 (0-51): 디모데 앱이 안 열렸을 때 앱스토어 안내 (아이폰) */
.dimodeask { position: fixed; left: 16px; right: 16px; bottom: calc(96px + env(safe-area-inset-bottom)); z-index: 120; max-width: 420px; margin: 0 auto;
  background: var(--card, #fff); color: var(--text, #222); border-radius: 14px; box-shadow: 0 6px 24px rgba(0,0,0,.18); padding: 14px 16px; }
.dimodeask p { margin: 0 0 10px; line-height: 1.5; }
.dimodeask small { color: var(--muted, #777); }
.dimodeask div { display: flex; gap: 8px; justify-content: flex-end; }
.dimodeask button, .dimodeask a { padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line, #ddd); background: none; color: inherit; font: inherit; text-decoration: none; }
.dimodeask a { background: var(--primary); border-color: transparent; color: #fff; }
