/* Group — Teams 스타일 UI */
:root, [data-theme="dark"] {
  --bg0: #0f0f0f; --bg1: #1b1b1b; --bg2: #1f1f1f; --bg3: #141414;
  --card: #292929; --card2: #2e2e2e; --card3: #333;
  --border: #3b3b3b; --border2: #2c2c2c;
  --text: #fff; --text2: #d6d6d6; --muted: #adadad; --faint: #7a7a7a;
  --accent: #7f85f5; --accent2: #5b5fc7; --accent-bg: #3d3e66; --accent-soft: rgba(127,133,245,.16);
  --hover: #2b2b2b; --sel: #333; --rail-sel: #7f85f5;
  --danger: #f1707b; --danger-bg: #3e1f25; --ok: #6ccb5f; --warn: #fce100; --orange: #f7a86b;
  --mine: #3d3e66; --shadow: 0 8px 28px rgba(0,0,0,.55);
  --input: #292929; --input-border: #474747;
  --grid: #3a3a3a; --grid-head: #262626; --cell: #1f1f1f;
  color-scheme: dark;
}
[data-theme="light"] {
  --bg0: #ebebeb; --bg1: #f5f5f5; --bg2: #ffffff; --bg3: #f0f0f0;
  --card: #fff; --card2: #fafafa; --card3: #f5f5f5;
  --border: #e0e0e0; --border2: #ececec;
  --text: #242424; --text2: #424242; --muted: #616161; --faint: #9e9e9e;
  --accent: #5b5fc7; --accent2: #4f52b2; --accent-bg: #e8ebfa; --accent-soft: rgba(91,95,199,.10);
  --hover: #f0f0f0; --sel: #e8ebfa; --rail-sel: #5b5fc7;
  --danger: #c4314b; --danger-bg: #fdf3f4; --ok: #13a10e; --warn: #c19c00; --orange: #ca5010;
  --mine: #e8ebfa; --shadow: 0 8px 28px rgba(0,0,0,.18);
  --input: #fff; --input-border: #d1d1d1;
  --grid: #e1e1e1; --grid-head: #f3f3f3; --cell: #fff;
  color-scheme: light;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg2); color: var(--text); }
body { font: 14px/1.43 "Segoe UI", -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif; overflow: hidden; -webkit-font-smoothing: antialiased; }
button, input, textarea, select { font: inherit; color: inherit; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
[hidden] { display: none !important; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb { background: rgba(128,128,128,.35); border-radius: 6px; border: 2px solid transparent; background-clip: padding-box; }
::-webkit-scrollbar-thumb:hover { background-color: rgba(128,128,128,.6); }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-corner { background: transparent; }
svg { flex: none; }

.boot { position: fixed; inset: 0; display: grid; place-items: center; background: var(--bg2); }
.boot-logo, .logo-sq { display: inline-grid; place-items: center; background: linear-gradient(135deg, #7f85f5, #4f52b2); color: #fff; font-weight: 700; border-radius: 10px; }
.boot-logo { width: 64px; height: 64px; font-size: 34px; animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(.92); opacity: .7; } }

/* ---------- 앱 레이아웃 ---------- */
#app { display: grid; grid-template-columns: 68px var(--side-w, 300px) 1fr; grid-template-rows: 48px 1fr; height: 100vh; }
#topbar { grid-column: 1 / -1; display: flex; align-items: center; background: var(--bg0); padding: 0 12px 0 14px; gap: 12px; -webkit-app-region: drag; }
#topbar > * { -webkit-app-region: no-drag; }
.tb-left { display: flex; align-items: center; gap: 4px; width: calc(68px + var(--side-w, 300px) - 26px); min-width: 0; }
.tb-brand { display: flex; align-items: center; gap: 8px; font-weight: 600; margin-right: auto; min-width: 0; }
.tb-brand span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.logo-sq { width: 24px; height: 24px; font-size: 14px; border-radius: 6px; }
.tb-search { flex: 1; max-width: 680px; position: relative; display: flex; align-items: center; background: var(--card); border: 1px solid var(--border); border-radius: 6px; height: 32px; padding: 0 10px; gap: 8px; }
.tb-search:focus-within { border-color: var(--accent); }
.tb-search input { flex: 1; background: none; border: 0; outline: 0; min-width: 0; }
.tb-search .ic { color: var(--muted); display: flex; }
.tb-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.me-btn { background: none; border: 0; padding: 2px; border-radius: 50%; cursor: pointer; display: flex; }
.conn { width: 8px; height: 8px; border-radius: 50%; background: var(--ok); }
.conn.off { background: var(--danger); animation: pulse 1s infinite; }
.suggest { position: absolute; top: 36px; left: 0; right: 0; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); z-index: 50; padding: 6px; max-height: 420px; overflow: auto; }
.suggest .sg-h { font-size: 12px; color: var(--muted); padding: 6px 8px 2px; }
.suggest .sg { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 6px; cursor: pointer; }
.suggest .sg.on, .suggest .sg:hover { background: var(--hover); }
.suggest .sg small { color: var(--muted); margin-left: auto; }

#rail { background: var(--bg0); display: flex; flex-direction: column; align-items: stretch; padding-top: 4px; overflow: hidden auto; }
.rail-btn { position: relative; height: 56px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; color: var(--muted); background: none; border: 0; cursor: pointer; font-size: 10.5px; }
.rail-btn:hover { color: var(--text); }
.rail-btn.on { color: var(--accent); }
.rail-btn.on::before { content: ""; position: absolute; left: 0; top: 12px; bottom: 12px; width: 3px; border-radius: 0 3px 3px 0; background: var(--rail-sel); }
.rail-btn .badge { position: absolute; top: 6px; left: 38px; }
.rail-sp { flex: 1; }
.badge { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: #c4314b; color: #fff; font-size: 11px; font-weight: 600; display: inline-grid; place-items: center; line-height: 1; }
.badge.at { background: #c4314b; }

#side { background: var(--bg1); border-radius: 8px 0 0 0; display: flex; flex-direction: column; min-width: 0; overflow: hidden; position: relative; }
#side .resizer { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 5; }
#main { background: var(--bg2); min-width: 0; min-height: 0; display: flex; flex-direction: column; overflow: hidden; border-left: 1px solid var(--border2); }

.side-head { display: flex; align-items: center; gap: 6px; padding: 14px 12px 10px 18px; font-size: 18px; font-weight: 700; }
.side-head .grow { flex: 1; }
.side-scroll { flex: 1; overflow: auto; padding: 0 8px 16px; }
.side-sec { font-size: 12px; color: var(--muted); padding: 12px 10px 4px; display: flex; align-items: center; gap: 4px; cursor: default; user-select: none; }
.side-item { display: flex; align-items: center; gap: 10px; padding: 6px 10px; border-radius: 6px; cursor: pointer; min-height: 36px; position: relative; color: var(--text2); }
.side-item:hover { background: var(--hover); }
.side-item.on { background: var(--sel); color: var(--text); }
.side-item.unread { color: var(--text); font-weight: 700; }
.side-item .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .sub { font-size: 12px; color: var(--muted); font-weight: 400; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-item .meta { font-size: 11.5px; color: var(--muted); font-weight: 400; }
.side-item .more { opacity: 0; }
.side-item:hover .more, .side-item.on .more { opacity: 1; }
.chan-item { padding-left: 46px; min-height: 30px; }
.team-row { font-weight: 600; color: var(--text); }
.team-row .chev { color: var(--muted); transition: transform .15s; display: flex; }
.team-row.closed .chev { transform: rotate(-90deg); }
.two-line { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.two-line .row1 { display: flex; gap: 6px; align-items: baseline; }
.two-line .row1 .t { flex: 1; }

/* ---------- 공통 요소 ---------- */
.icon-btn { background: none; border: 0; color: var(--text2); width: 32px; height: 32px; border-radius: 6px; display: inline-grid; place-items: center; cursor: pointer; flex: none; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.sm { width: 26px; height: 26px; }
.icon-btn.on { color: var(--accent); }
.btn { display: inline-flex; align-items: center; gap: 6px; height: 32px; padding: 0 12px; border-radius: 6px; border: 1px solid var(--border); background: var(--card); color: var(--text); cursor: pointer; font-weight: 600; white-space: nowrap; }
.btn:hover { background: var(--hover); }
.btn.primary { background: var(--accent2); border-color: var(--accent2); color: #fff; }
.btn.primary:hover { background: var(--accent); border-color: var(--accent); }
[data-theme="light"] .btn.primary:hover { background: #4f52b2; }
.btn.danger { color: var(--danger); }
.btn.danger.fill { background: #c4314b; color: #fff; border-color: #c4314b; }
.btn.ghost { background: none; border-color: transparent; }
.btn.ghost:hover { background: var(--hover); }
.btn.sm { height: 26px; padding: 0 8px; font-size: 12.5px; }
.btn:disabled { opacity: .5; cursor: default; }
.inp, .sel, textarea.inp { background: var(--input); border: 1px solid var(--input-border); border-bottom-color: var(--muted); border-radius: 4px; height: 32px; padding: 0 10px; outline: 0; width: 100%; color: var(--text); }
textarea.inp { height: auto; padding: 8px 10px; resize: vertical; min-height: 70px; }
.inp:focus, .sel:focus, textarea.inp:focus { border-bottom: 2px solid var(--accent); }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field > label { font-size: 12.5px; color: var(--text2); font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }
.muted { color: var(--muted); }
.small { font-size: 12px; }
.ellip { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.chk { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; }
.chk input { width: 16px; height: 16px; accent-color: var(--accent2); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 10px; color: var(--muted); padding: 40px 20px; height: 100%; }
.empty .big { font-size: 18px; font-weight: 700; color: var(--text); }
.empty .art { width: 150px; height: 120px; opacity: .9; }
.pill { display: inline-flex; align-items: center; height: 22px; padding: 0 9px; border-radius: 11px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.kbd { font-size: 11px; border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; color: var(--muted); }
hr.sep { border: 0; border-top: 1px solid var(--border); margin: 10px 0; }
.seg { display: inline-flex; background: var(--card); border: 1px solid var(--border); border-radius: 6px; padding: 2px; gap: 2px; }
.seg button { border: 0; background: none; padding: 3px 10px; border-radius: 4px; cursor: pointer; color: var(--text2); font-size: 13px; }
.seg button.on { background: var(--accent-bg); color: var(--text); font-weight: 600; }
.spin { width: 18px; height: 18px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; animation: rot .8s linear infinite; display: inline-block; }
@keyframes rot { to { transform: rotate(360deg); } }

/* 아바타 */
.av { position: relative; display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 600; flex: none; background-size: cover; background-position: center; user-select: none; }
.av .pr { position: absolute; right: -2px; bottom: -2px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--bg1); background: #8a8886; }
.av .pr.available { background: #6bb700; }
.av .pr.busy, .av .pr.dnd { background: #c4314b; }
.av .pr.dnd::after { content: ""; position: absolute; left: 2px; right: 2px; top: 3px; height: 2px; background: #fff; border-radius: 1px; }
.av .pr.away { background: #ffaa44; }
.av .pr.offline { background: transparent; border-color: var(--bg1); box-shadow: inset 0 0 0 2px #8a8886; }
.av-stack { display: inline-flex; }
.av-stack .av { margin-left: -6px; box-shadow: 0 0 0 2px var(--card); }
.av-stack .av:first-child { margin-left: 0; }
.tav { display: inline-grid; place-items: center; color: #fff; font-weight: 700; border-radius: 6px; flex: none; }

/* 모달 / 메뉴 / 토스트 */
#layer { position: fixed; inset: 0; pointer-events: none; z-index: 100; }
#layer > * { pointer-events: auto; }
.mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: grid; place-items: center; animation: fade .12s; }
@keyframes fade { from { opacity: 0; } }
.modal { background: var(--card); border-radius: 8px; box-shadow: var(--shadow); width: min(560px, calc(100vw - 32px)); max-height: calc(100vh - 60px); display: flex; flex-direction: column; animation: pop .14s ease-out; }
@keyframes pop { from { transform: translateY(8px) scale(.98); opacity: 0; } }
.modal-h { display: flex; align-items: center; padding: 20px 24px 8px; font-size: 18px; font-weight: 700; gap: 8px; }
.modal-h .grow { flex: 1; }
.modal-b { padding: 8px 24px 12px; overflow: auto; }
.modal-f { padding: 12px 24px 20px; display: flex; justify-content: flex-end; gap: 8px; }
.modal.wide { width: min(900px, calc(100vw - 32px)); }
.modal.full { width: calc(100vw - 48px); height: calc(100vh - 48px); max-height: none; }
.menu { position: fixed; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; min-width: 200px; z-index: 200; animation: fade .08s; max-height: 70vh; overflow: auto; }
.menu .mi { display: flex; align-items: center; gap: 10px; padding: 7px 10px; border-radius: 4px; cursor: pointer; white-space: nowrap; color: var(--text); }
.menu .mi:hover, .menu .mi.on { background: var(--hover); }
.menu .mi.danger { color: var(--danger); }
.menu .mi .ic { width: 18px; display: flex; color: var(--text2); }
.menu .mi.danger .ic { color: var(--danger); }
.menu .mi small { margin-left: auto; color: var(--muted); padding-left: 16px; }
.menu .msep { height: 1px; background: var(--border); margin: 4px 0; }
.menu .mh { font-size: 12px; color: var(--muted); padding: 6px 10px 2px; }
#toasts { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); display: flex; flex-direction: column; gap: 8px; z-index: 300; align-items: center; }
.toast { background: var(--card3); color: var(--text); border: 1px solid var(--border); padding: 10px 16px; border-radius: 8px; box-shadow: var(--shadow); animation: pop .15s; max-width: 520px; display: flex; gap: 10px; align-items: center; }
.toast.err { border-color: var(--danger); }
.toast.notif { cursor: pointer; }
.notif-pop { position: fixed; right: 16px; bottom: 16px; width: 340px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 12px 14px; display: flex; gap: 10px; cursor: pointer; animation: pop .2s; z-index: 300; }
.notif-pop .nt { font-weight: 700; font-size: 13px; }
.notif-pop .nb { font-size: 13px; color: var(--text2); display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 채널 / 채팅 헤더 + 탭 ---------- */
.view { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.vhead { display: flex; align-items: center; gap: 10px; padding: 0 16px; height: 56px; flex: none; border-bottom: 1px solid var(--border2); background: var(--bg2); }
.vhead .vt { font-size: 16px; font-weight: 700; white-space: nowrap; display: flex; align-items: center; gap: 6px; }
.vtabs { display: flex; align-items: stretch; height: 100%; gap: 2px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.vtabs::-webkit-scrollbar { display: none; }
.vtab { display: flex; align-items: center; gap: 4px; padding: 0 8px; color: var(--text2); cursor: pointer; position: relative; white-space: nowrap; font-size: 14px; border: 0; background: none; }
.vtab:hover { color: var(--text); }
.vtab.on { color: var(--text); font-weight: 600; }
.vtab.on::after { content: ""; position: absolute; left: 6px; right: 6px; bottom: 0; height: 3px; border-radius: 3px 3px 0 0; background: var(--accent); }
.vtab .caret { opacity: 0; display: flex; }
.vtab-un { min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; margin-left: 2px; }
.vtab-un.m { background: #c4314b; }
.vtab.on .caret, .vtab:hover .caret { opacity: .8; }
.vhead .right { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.vbody { flex: 1; min-height: 0; position: relative; display: flex; flex-direction: column; }

/* ---------- 메시지 ---------- */
.conv { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 16px 0 8px; position: relative; }
.conv-inner { max-width: 1060px; margin: 0 auto; padding: 0 24px; }
.conv.channel .conv-inner { max-width: 980px; }
.daysep { display: flex; align-items: center; gap: 12px; color: var(--muted); font-size: 12px; margin: 18px 0 10px; }
.daysep::before, .daysep::after { content: ""; flex: 1; height: 1px; background: var(--border); }
.sysmsg { text-align: center; color: var(--muted); font-size: 12.5px; margin: 10px 0; display: flex; justify-content: center; align-items: center; gap: 6px; }
.post { background: var(--card); border-radius: 6px; margin: 0 0 16px; box-shadow: 0 1px 2px rgba(0,0,0,.25); position: relative; border-left: 0; }
.post.important { box-shadow: inset 4px 0 0 #c4314b, 0 1px 2px rgba(0,0,0,.25); }
.post.hl, .msg.hl { animation: hl 2.4s ease-out; }
@keyframes hl { 0%, 40% { box-shadow: 0 0 0 2px var(--accent); } }
.post-main { padding: 12px 16px 6px; position: relative; }
.post-replies { border-top: 1px solid var(--border2); }
.post-replies .more-replies { padding: 8px 16px 0 56px; color: var(--accent); cursor: pointer; font-size: 13px; }
.post-reply-btn { display: flex; align-items: center; gap: 10px; padding: 8px 16px; color: var(--text2); cursor: pointer; border-top: 1px solid var(--border2); font-size: 13px; }
.post-reply-btn:hover { color: var(--text); background: var(--hover); border-radius: 0 0 6px 6px; }
.msg { display: flex; gap: 12px; padding: 4px 0; position: relative; }
.post .msg { padding: 0; }
.post-replies .msg { padding: 10px 16px 6px; }
.msg .mbody { flex: 1; min-width: 0; }
.msg .mhead { display: flex; align-items: baseline; gap: 8px; font-size: 12.5px; color: var(--muted); }
.msg .mhead b { color: var(--text); font-size: 13px; font-weight: 600; }
.msg .mhead .edited { font-style: italic; }
.msg .subject { font-size: 18px; font-weight: 700; margin: 4px 0 2px; }
.mtext { word-wrap: break-word; overflow-wrap: anywhere; color: var(--text); }
.mtext p { margin: 0 0 4px; }
.mtext p:last-child { margin-bottom: 0; }
.mtext pre { background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; overflow-x: auto; font: 12.5px/1.45 ui-monospace, "SF Mono", Menlo, Consolas, monospace; margin: 6px 0; white-space: pre; }
.mtext code { background: var(--bg3); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; font: 12.5px ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.mtext pre code { border: 0; padding: 0; background: none; }
.mtext blockquote { margin: 4px 0; padding: 2px 10px; border-left: 3px solid var(--border); color: var(--text2); }
.mtext ul, .mtext ol { margin: 4px 0; padding-left: 22px; }
.mtext h1, .mtext h2, .mtext h3 { margin: 8px 0 4px; line-height: 1.3; }
.mtext h1 { font-size: 20px; } .mtext h2 { font-size: 17px; } .mtext h3 { font-size: 15px; }
.mtext table { border-collapse: collapse; margin: 6px 0; }
.mtext td, .mtext th { border: 1px solid var(--border); padding: 3px 8px; }
.mention { --mc: #4f9bff; color: var(--mc); font-weight: 600; background: color-mix(in srgb, var(--mc) 15%, transparent); border-radius: 3px; padding: 0 2px; }
[data-theme="light"] .mention { --mc: #1a62d6; }
.mention[data-uid] { cursor: pointer; }
.mention[data-uid]:hover { text-decoration: underline; }
.mention.me { background: color-mix(in srgb, var(--mc) 28%, transparent); }
.ucard { display: flex; gap: 12px; align-items: center; padding: 10px 12px 8px; min-width: 240px; }
.ucard .n { font-weight: 600; font-size: 15px; display: flex; gap: 6px; align-items: center; }
.ucard .av, .msg .av[data-uid], .member-row:not([style*="cursor"]) .av[data-uid] { cursor: pointer; }
.photo-view { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 4px 4px; text-align: center; cursor: zoom-out; }
.photo-view .pv-photo { width: min(400px, 78vw); height: min(400px, 78vw); border-radius: 16px; object-fit: cover; margin-bottom: 8px; background: var(--card3); }
.photo-view .pv-none { display: grid; place-items: center; color: #fff; font-size: 96px; font-weight: 700; }
.photo-view .n { font-size: 18px; font-weight: 700; display: flex; gap: 6px; align-items: center; }
.mtext .task-box { accent-color: var(--accent2); vertical-align: -2px; }
.mtext img.inline { max-width: 100%; }
.clamp { max-height: 260px; overflow: hidden; position: relative; }
.clamp::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 60px; background: linear-gradient(transparent, var(--card)); }
.see-more { color: var(--accent); cursor: pointer; font-size: 13px; margin-top: 4px; display: inline-block; }
.msg-actions { position: absolute; top: -14px; right: 12px; display: none; background: var(--card3); border: 1px solid var(--border); border-radius: 6px; box-shadow: var(--shadow); padding: 2px; z-index: 5; }
.msg:hover > .msg-actions, .post-main:hover > .msg-actions, .msg-actions.keep { display: flex; }
.msg-actions button { background: none; border: 0; width: 30px; height: 28px; border-radius: 4px; cursor: pointer; font-size: 16px; display: grid; place-items: center; color: var(--text2); }
.msg-actions button:hover { background: var(--hover); transform: scale(1.12); }
.reactions { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.react { display: inline-flex; align-items: center; gap: 4px; height: 24px; padding: 0 7px; border-radius: 12px; border: 1px solid var(--border); background: var(--card2); cursor: pointer; font-size: 13px; color: var(--text2); }
.react.mine { border-color: var(--accent); background: var(--accent-soft); color: var(--text); }
.react:hover { border-color: var(--accent); }
.attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 6px; }
.att { display: flex; align-items: center; gap: 10px; border: 1px solid var(--border); background: var(--card2); border-radius: 6px; padding: 8px 10px; min-width: 220px; max-width: 340px; cursor: pointer; }
.att:hover { border-color: var(--accent); }
.att .an { font-weight: 600; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .as { font-size: 12px; color: var(--muted); }
.att-img { max-width: 320px; max-height: 260px; border-radius: 6px; cursor: zoom-in; border: 1px solid var(--border); display: block; object-fit: cover; }
.quote-box { border-left: 3px solid var(--accent); background: var(--accent-soft); border-radius: 4px; padding: 4px 10px; margin: 4px 0 6px; font-size: 13px; color: var(--text2); cursor: pointer; }
.quote-box b { color: var(--text); font-weight: 600; }

/* 채팅(말풍선) */
.conv.chat .msg { padding: 1px 0; }
.conv.chat .msg.first { margin-top: 12px; }
.conv.chat .bubble { background: var(--card); border-radius: 6px; padding: 7px 12px 8px; max-width: min(78%, 720px); display: inline-block; position: relative; text-align: left; }
.conv.chat .msg.mine { justify-content: flex-end; }
.conv.chat .msg.mine .bubble { background: var(--mine); }
.conv.chat .msg.mine .mbody { display: flex; flex-direction: column; align-items: flex-end; }
.conv.chat .msg .avs { width: 32px; flex: none; }
.conv.chat .msg.mine .avs { display: none; }
.conv.chat .msg-actions { top: -16px; }
.conv.chat .msg.mine .msg-actions { right: 0; left: auto; }
.conv.chat .msg:not(.mine) .msg-actions { right: auto; left: 44px; }
.conv.chat .msg.deleted .bubble { font-style: italic; color: var(--muted); background: transparent; border: 1px dashed var(--border); }
.read-mark { font-size: 11px; color: var(--muted); margin-top: 2px; display: flex; align-items: center; gap: 3px; }
.typing { height: 22px; font-size: 12px; color: var(--muted); padding: 0 24px; max-width: 1060px; margin: 0 auto; width: 100%; }
.typing .dots span { display: inline-block; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); margin-right: 2px; animation: blink 1.2s infinite; }
.typing .dots span:nth-child(2) { animation-delay: .2s; } .typing .dots span:nth-child(3) { animation-delay: .4s; }
@keyframes blink { 50% { opacity: .2; } }
.pinbar { display: flex; align-items: center; gap: 8px; padding: 6px 16px; border-bottom: 1px solid var(--border2); font-size: 13px; background: var(--bg2); cursor: pointer; flex: none; }
.pinbar:hover { background: var(--hover); }
.pinbar .ellip { flex: 1; }
.new-post-bar { padding: 8px 24px 16px; max-width: 980px; width: 100%; margin: 0 auto; flex: none; }
.load-older { text-align: center; padding: 6px; }

/* 투표 */
.poll { border: 1px solid var(--border); border-radius: 8px; padding: 12px; margin-top: 6px; background: var(--card2); max-width: 460px; }
.poll .pq { font-weight: 700; margin-bottom: 8px; }
.poll .po { position: relative; border: 1px solid var(--border); border-radius: 6px; padding: 7px 10px; margin-bottom: 6px; cursor: pointer; overflow: hidden; display: flex; justify-content: space-between; gap: 8px; }
.poll .po .bar { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent-soft); z-index: 0; transition: width .3s; }
.poll .po > span { position: relative; z-index: 1; }
.poll .po.mine { border-color: var(--accent); }
.poll .pf { font-size: 12px; color: var(--muted); }

/* ---------- 작성기 ---------- */
.composer { flex: none; padding: 0 24px 16px; max-width: 1060px; width: 100%; margin: 0 auto; }
.post .composer, .reply-composer .composer { padding: 8px 16px 12px; max-width: none; }
.cbox { background: var(--card); border: 1px solid var(--border); border-radius: 6px; position: relative; }
.cbox:focus-within { border-bottom: 2px solid var(--accent); }
.cbox .subject { width: 100%; border: 0; border-bottom: 1px solid var(--border2); background: none; padding: 10px 12px; font-size: 16px; font-weight: 700; outline: 0; }
.cbox textarea { display: block; width: 100%; border: 0; outline: 0; background: none; resize: none; padding: 10px 12px 4px; min-height: 40px; max-height: 320px; line-height: 1.45; }
/* 글 + 그림 편집기 */
.redit { display: block; width: 100%; outline: 0; padding: 10px 12px 4px; min-height: 40px; max-height: 320px; overflow-y: auto; line-height: 1.45; white-space: pre-wrap; word-break: break-word; cursor: text; }
.redit.post { max-height: 60vh; }
.redit.is-empty::before { content: attr(data-ph); color: var(--text3, var(--muted)); pointer-events: none; position: absolute; }
.redit p, .redit div { margin: 0; }
.redit ul, .redit ol { margin: 2px 0; padding-left: 22px; }
.redit blockquote { margin: 4px 0; padding-left: 10px; border-left: 3px solid var(--border); color: var(--text2, inherit); }
.redit pre { margin: 4px 0; padding: 8px 10px; background: var(--card2); border-radius: 6px; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; white-space: pre-wrap; }
.redit h1, .redit h2, .redit h3 { margin: 6px 0 2px; font-size: 1.15em; }
.redit a { color: var(--accent); }
.ri-img { position: relative; display: inline-block; margin: 3px 2px; vertical-align: bottom; border-radius: 8px; line-height: 0; user-select: none; cursor: grab; }
.ri-img img { border-radius: 8px; border: 1px solid var(--border); display: block; pointer-events: none; }
.ri-img.s img { height: 200px; width: auto; max-width: 100%; object-fit: cover; }
.ri-img.l img { max-width: min(560px, 100%); max-height: 420px; }
.ri-img.dragging { opacity: .35; }
.ri-img .ri-bar { position: absolute; top: 6px; right: 6px; display: flex; gap: 4px; opacity: 0; transition: opacity .1s; }
.ri-img:hover .ri-bar { opacity: 1; }
@media (hover: none) { .ri-img .ri-bar { opacity: 1; } }
.ri-img .ri-bar button { height: 24px; min-width: 24px; border-radius: 12px; border: 0; background: rgba(0,0,0,.62); color: #fff; display: grid; place-items: center; cursor: pointer; font-size: 11.5px; padding: 0 8px; line-height: 1; }
.ri-img .ri-bar .ri-x { padding: 0; width: 24px; }
.ri-img .ri-prog { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); border-radius: 0 0 0 8px; }
.ri-img.loading img { opacity: .55; }
.ri-img.err img { opacity: .35; outline: 2px solid var(--danger); }
/* 본문 안 그림 (게시물·메시지): 작게(s)는 높이 200px 로 나란히, 크게(l)는 넓게 */
.mtext .inl-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0; align-items: flex-end; }
.mtext img.inl-img { border-radius: 8px; border: 1px solid var(--border); cursor: zoom-in; display: inline-block; vertical-align: bottom; }
.mtext img.inl-img.s { height: 200px; width: auto; max-width: 100%; object-fit: cover; }
.mtext img.inl-img.l { max-width: min(560px, 100%); max-height: 460px; }
@media (max-width: 760px) { .mtext img.inl-img.s, .ri-img.s img { height: 150px; } }

.ctool { display: flex; align-items: center; gap: 2px; padding: 2px 6px 6px; }
.ctool .grow { flex: 1; }
.ctool .send { color: var(--accent); }
.ctool .send:disabled { color: var(--faint); cursor: default; }
.cfmt { display: flex; gap: 2px; padding: 4px 6px; border-bottom: 1px solid var(--border2); flex-wrap: wrap; }
.cfiles { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 10px; }
.cfile { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); background: var(--card2); border-radius: 4px; padding: 3px 4px 3px 8px; font-size: 12.5px; max-width: 280px; }
.cfile .prog { height: 3px; background: var(--accent); border-radius: 2px; }
.cquote { margin: 8px 10px 0; display: flex; gap: 6px; align-items: flex-start; }
.cquote .quote-box { flex: 1; margin: 0; }
.mention-pop { position: absolute; bottom: calc(100% + 4px); left: 8px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 4px; min-width: 260px; max-height: 280px; overflow: auto; z-index: 20; }
.mention-pop .mp { display: flex; align-items: center; gap: 10px; padding: 6px 8px; border-radius: 4px; cursor: pointer; }
.mention-pop .mp.on { background: var(--hover); }
.emoji-pop { width: 340px; padding: 8px; }
.emoji-pop .eg { display: grid; grid-template-columns: repeat(9, 1fr); gap: 2px; }
.emoji-pop .eg button { background: none; border: 0; font-size: 20px; height: 34px; border-radius: 4px; cursor: pointer; }
.emoji-pop .eg button:hover { background: var(--hover); }
.emoji-pop .ecat { font-size: 12px; color: var(--muted); margin: 6px 2px 2px; }
.drop-hint { position: absolute; inset: 0; background: var(--accent-soft); border: 2px dashed var(--accent); border-radius: 8px; display: grid; place-items: center; font-weight: 700; color: var(--accent); z-index: 30; pointer-events: none; }

/* ---------- 파일 ---------- */
.files { display: flex; flex-direction: column; height: 100%; min-height: 0; position: relative; }
.ftool { display: flex; align-items: center; gap: 6px; padding: 10px 20px; border-bottom: 1px solid var(--border2); flex-wrap: wrap; flex: none; }
.fcrumb { display: flex; align-items: center; gap: 4px; padding: 12px 20px 4px; font-size: 18px; font-weight: 700; flex-wrap: wrap; flex: none; }
.fcrumb span.c { cursor: pointer; }
.fcrumb span.c:hover { text-decoration: underline; }
.fcrumb .sl { color: var(--muted); font-weight: 400; }
.ftable-wrap { flex: 1; overflow: auto; padding: 0 20px 20px; }
table.ftable { width: 100%; border-collapse: collapse; }
.ftable th { text-align: left; font-weight: 400; color: var(--text2); font-size: 13px; padding: 10px 8px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg2); z-index: 1; white-space: nowrap; cursor: pointer; user-select: none; }
.ftable td { padding: 9px 8px; border-bottom: 1px solid var(--border2); font-size: 13.5px; vertical-align: middle; }
.ftable tr:hover td { background: var(--hover); }
.ftable tr.selr td { background: var(--sel); }
.ftable .fname { display: flex; align-items: center; gap: 10px; cursor: pointer; min-width: 0; }
.ftable .fname span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ftable .fname:hover span { text-decoration: underline; }
.ftable .who { display: inline-flex; padding: 1px 8px; border-radius: 10px; background: var(--card3); font-size: 12px; }
.tags { display: flex; flex-wrap: wrap; gap: 4px; }
.fgallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; padding: 14px 20px; overflow: auto; }
.fcard { border: 1px solid var(--border); border-radius: 8px; overflow: hidden; cursor: pointer; background: var(--card); }
.fcard .thumb { height: 120px; display: grid; place-items: center; background: var(--card2); background-size: cover; background-position: center; }
.fcard .fn { padding: 8px 10px; font-size: 13px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fcard .fm { padding: 0 10px 8px; font-size: 12px; color: var(--muted); }
.ficon { width: 24px; height: 24px; flex: none; }
.uploads { position: absolute; right: 20px; bottom: 20px; width: 320px; background: var(--card); border: 1px solid var(--border); border-radius: 8px; box-shadow: var(--shadow); padding: 10px 12px; z-index: 10; }
.uploads .up { font-size: 12.5px; margin: 4px 0; }
.uploads .bar { height: 4px; border-radius: 2px; background: var(--border); overflow: hidden; margin-top: 3px; }
.uploads .bar i { display: block; height: 100%; background: var(--accent); }
.preview { display: flex; flex-direction: column; height: 100%; }
.preview .pv-h { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-bottom: 1px solid var(--border); }
.preview .pv-b { flex: 1; min-height: 0; overflow: auto; display: flex; justify-content: center; align-items: flex-start; background: var(--bg3); }
.preview .pv-b iframe, .preview .pv-b embed { width: 100%; height: 100%; border: 0; background: #fff; }
.preview .pv-b img, .preview .pv-b video { max-width: 100%; max-height: 100%; margin: auto; display: block; }
.preview .pv-b pre { margin: 0; padding: 16px; width: 100%; white-space: pre-wrap; font: 13px/1.5 ui-monospace, Menlo, Consolas, monospace; }
.preview .pv-b .mtext { padding: 24px 32px; width: 100%; max-width: 900px; background: var(--card); min-height: 100%; }
.xlsx-view { width: 100%; height: 100%; overflow: auto; background: var(--cell); }
.xlsx-view table { border-collapse: collapse; font-size: 12.5px; }
.xlsx-view td { border: 1px solid var(--grid); padding: 2px 6px; min-width: 60px; white-space: pre-wrap; vertical-align: top; }

/* ---------- Tasks Checklist ---------- */
.tasks { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--bg3); }
.tasks-top { display: flex; align-items: center; gap: 10px; padding: 12px 18px; background: var(--bg2); border-bottom: 1px solid var(--border2); flex: none; }
.tasks-top .tt { font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 8px; }
.tasks-top .search { display: flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; height: 34px; width: 320px; background: var(--card); margin: 0 auto; }
.tasks-top .search input { border: 0; outline: 0; background: none; flex: 1; }
.tasks-cols { flex: 1; display: flex; gap: 16px; padding: 18px; overflow: auto; align-items: flex-start; }
.tcol { width: 300px; flex: none; background: var(--card); border: 1px solid var(--border); border-radius: 10px; padding: 14px; display: flex; flex-direction: column; gap: 10px; max-height: 100%; }
.tcol.drag-over { outline: 2px dashed var(--accent); }
.tcol-h { display: flex; align-items: center; gap: 4px; }
.tcol-h .tn { flex: 1; text-align: center; font-weight: 700; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tprog { font-size: 12px; color: var(--muted); display: flex; justify-content: space-between; }
.tbar { height: 8px; border-radius: 4px; background: var(--border); overflow: hidden; }
.tbar i { display: block; height: 100%; background: #2563eb; border-radius: 4px; transition: width .3s; }
.tdesc { font-size: 12.5px; color: var(--text2); display: flex; justify-content: space-between; gap: 6px; cursor: pointer; }
.tdesc.ph { color: var(--muted); }
.tadd { display: flex; gap: 8px; }
.tadd input { flex: 1; height: 36px; border: 1px solid var(--border); border-radius: 8px; padding: 0 10px; background: var(--card2); outline: 0; min-width: 0; }
.tadd input:focus { border-color: #2563eb; }
.tadd button { width: 36px; height: 36px; border-radius: 8px; border: 0; background: #2563eb; color: #fff; font-size: 20px; cursor: pointer; display: grid; place-items: center; }
.titems { display: flex; flex-direction: column; gap: 10px; overflow: auto; padding: 2px; min-height: 30px; }
.titem { border: 1px solid var(--border); border-radius: 8px; padding: 10px 10px 8px 12px; background: var(--card); position: relative; cursor: grab; }
.titem:hover { border-color: var(--faint); }
.titem.pri-high { border-left: 4px solid #e53935; }
.titem.pri-med { border-left: 4px solid #fb8c00; }
.titem.pri-low { border-left: 4px solid #43a047; }
.titem .trow { display: flex; gap: 8px; align-items: flex-start; }
.titem .tdot { width: 7px; height: 7px; border-radius: 50%; margin-top: 7px; flex: none; }
.titem input[type=checkbox] { width: 18px; height: 18px; margin: 1px 0 0; accent-color: #2563eb; flex: none; cursor: pointer; }
.titem .ttext { flex: 1; font-size: 14px; word-break: break-word; }
.titem.done .ttext { text-decoration: line-through; color: var(--muted); }
.titem .tfoot { display: flex; align-items: center; gap: 6px; margin-top: 8px; min-height: 22px; }
.titem .due { font-size: 11.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 3px; }
.titem .due.late { color: #e53935; font-weight: 600; }
.titem .due.today { color: #fb8c00; font-weight: 600; }
.titem .tnote { font-size: 12px; color: var(--muted); margin: 4px 0 0 26px; white-space: pre-wrap; }
.titem.dragging { opacity: .4; }
.tcol-add { width: 300px; flex: none; min-height: 200px; border: 2px dashed var(--border); border-radius: 10px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; color: var(--muted); cursor: pointer; align-self: stretch; }
.tcol-add:hover { border-color: var(--accent); color: var(--accent); }
.tcol-add .plus { font-size: 32px; font-weight: 300; }
.assignee-pick { display: flex; flex-wrap: wrap; gap: 6px; }
.assignee-pick .ap { display: inline-flex; align-items: center; gap: 6px; border: 1px solid var(--border); border-radius: 16px; padding: 2px 10px 2px 3px; cursor: pointer; font-size: 13px; }
.assignee-pick .ap.on { border-color: var(--accent); background: var(--accent-soft); }
.mytasks { padding: 16px 24px; overflow: auto; height: 100%; }
.mytasks .grp { margin-bottom: 18px; }
.mytasks .gh { font-weight: 700; margin: 6px 0; display: flex; gap: 8px; align-items: center; }
.mt-row { display: flex; align-items: center; gap: 10px; padding: 9px 12px; border: 1px solid var(--border2); background: var(--card); border-radius: 6px; margin-bottom: 6px; }
.mt-row .where { font-size: 12px; color: var(--muted); }
.mt-row.done .tx { text-decoration: line-through; color: var(--muted); }

/* ---------- 링크 목록 ---------- */
.links { display: flex; flex-direction: column; height: 100%; }
.links table { width: 100%; border-collapse: collapse; }
.links th { text-align: left; font-weight: 400; color: var(--text2); font-size: 13px; padding: 10px 10px; border-bottom: 1px solid var(--border); position: sticky; top: 0; background: var(--bg2); z-index: 1; }
.links td { padding: 10px 10px; border-bottom: 1px solid var(--border2); vertical-align: top; font-size: 14px; }
.links tr:hover td { background: var(--hover); }
.links td.lt { font-weight: 600; }
.links td.lu a { word-break: break-all; font-size: 13px; }
.links .lbar { width: 3px; background: var(--border); border-radius: 2px; }

/* ---------- 시트 ---------- */
.sheet { display: flex; flex-direction: column; height: 100%; min-height: 0; background: var(--bg2); position: relative; }
.sh-tool { display: flex; align-items: center; gap: 2px; padding: 6px 10px; border-bottom: 1px solid var(--border2); flex-wrap: wrap; flex: none; background: var(--bg2); }
.sh-tool .sep { width: 1px; height: 20px; background: var(--border); margin: 0 4px; }
.sh-tool .icon-btn { width: 30px; height: 30px; }
.sh-tool select { height: 28px; background: var(--card); border: 1px solid var(--border); border-radius: 4px; padding: 0 4px; }
.sh-tool .colorbtn { position: relative; }
.sh-tool .colorbtn i { position: absolute; left: 7px; right: 7px; bottom: 5px; height: 3px; border-radius: 1px; }
.sh-fbar { display: flex; align-items: center; gap: 0; border-bottom: 1px solid var(--border2); flex: none; height: 30px; }
.sh-fbar .addr { width: 90px; text-align: center; border-right: 1px solid var(--border2); font-size: 13px; height: 100%; display: grid; place-items: center; }
.sh-fbar .fx { width: 34px; text-align: center; color: var(--muted); font-style: italic; font-family: Georgia, serif; }
.sh-fbar input { flex: 1; height: 100%; border: 0; outline: 0; background: none; padding: 0 8px; font: 13px ui-monospace, Menlo, Consolas, monospace; }
.sh-grid { flex: 1; position: relative; min-height: 0; overflow: hidden; background: var(--cell); user-select: none; outline: none; }
/* Excel 처럼 시트 칸은 항상 흰 바탕 (원본 xlsx 의 글자색이 그대로 보이게) */
.sh-grid { --cell: #fff; --grid: #e1e1e1; --grid-head: #f3f3f3; --text: #1f1f1f; --muted: #666; --faint: #9e9e9e; --accent-soft: rgba(91,95,199,.14); color-scheme: light; color: #1f1f1f; }
.sh-corner, .sh-colh, .sh-rowh, .sh-frozen, .sh-scroll { position: absolute; }
.sh-corner { left: 0; top: 0; background: var(--grid-head); border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); z-index: 4; }
.sh-colh { top: 0; right: 0; overflow: hidden; background: var(--grid-head); border-bottom: 1px solid var(--grid); z-index: 3; }
.sh-rowh { left: 0; bottom: 0; overflow: hidden; background: var(--grid-head); border-right: 1px solid var(--grid); z-index: 3; }
.sh-frozen { right: 0; overflow: hidden; z-index: 2; background: var(--cell); border-bottom: 2px solid var(--faint); }
.sh-scroll { right: 0; bottom: 0; overflow: auto; }
.sh-layer { position: absolute; left: 0; top: 0; }
.sh-hc { position: absolute; display: grid; place-items: center; font-size: 12px; color: var(--muted); border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); box-sizing: border-box; }
.sh-hc.sel { background: var(--accent-soft); color: var(--text); font-weight: 600; }
.sh-hc .rz { position: absolute; right: -3px; top: 0; bottom: 0; width: 6px; cursor: col-resize; z-index: 2; }
.sh-hc .rzr { position: absolute; left: 0; right: 0; bottom: -3px; height: 6px; cursor: row-resize; z-index: 2; }
.sh-c { position: absolute; box-sizing: border-box; border-right: 1px solid var(--grid); border-bottom: 1px solid var(--grid); padding: 1px 4px; font-size: 13px; line-height: 1.35; overflow: hidden; white-space: nowrap; color: var(--text); display: flex; align-items: flex-end; }
.sh-c.wrap { white-space: pre-wrap; word-break: break-word; align-items: flex-start; }
.sh-c.num { justify-content: flex-end; }
.sh-c.err { color: var(--danger); }
.sh-c > span { min-width: 0; overflow: hidden; text-overflow: clip; width: 100%; }
.sh-c.num > span { text-align: right; }
.sh-c.al-c > span { text-align: center; } .sh-c.al-r > span { text-align: right; } .sh-c.al-l > span { text-align: left; }
.sh-c.va-m { align-items: center; } .sh-c.va-t { align-items: flex-start; }
.sh-c a { color: var(--accent); }
.sh-sel { position: absolute; border: 2px solid var(--accent2); background: rgba(91,95,199,.10); pointer-events: none; z-index: 3; }
.sh-act { position: absolute; border: 2px solid var(--accent2); pointer-events: none; z-index: 4; }
.sh-act .fill { position: absolute; right: -4px; bottom: -4px; width: 7px; height: 7px; background: var(--accent2); border: 1px solid var(--cell); pointer-events: auto; cursor: crosshair; }
.sh-peer { position: absolute; border: 2px solid; pointer-events: none; z-index: 3; }
.sh-peer span { position: absolute; top: -17px; left: -2px; font-size: 10.5px; color: #fff; padding: 0 4px; border-radius: 3px 3px 3px 0; white-space: nowrap; }
.sh-edit { position: absolute; z-index: 6; border: 2px solid var(--accent2); background: var(--cell); padding: 1px 4px; font-size: 13px; line-height: 1.35; resize: none; outline: 0; box-shadow: var(--shadow); color: var(--text); overflow: hidden; }
.sh-tabs { display: flex; align-items: center; gap: 2px; padding: 0 8px; height: 34px; border-top: 1px solid var(--border2); flex: none; background: var(--bg2); overflow-x: auto; }
.sh-tab { padding: 0 14px; height: 28px; display: grid; place-items: center; border-radius: 4px; cursor: pointer; font-size: 13px; color: var(--text2); white-space: nowrap; }
.sh-tab:hover { background: var(--hover); }
.sh-tab.on { color: var(--accent); font-weight: 600; background: var(--accent-soft); }
.sh-status { margin-left: auto; font-size: 12px; color: var(--muted); display: flex; gap: 10px; align-items: center; white-space: nowrap; }
.sh-hist { position: absolute; right: 0; top: 70px; bottom: 34px; width: 340px; background: var(--card); border-left: 1px solid var(--border); z-index: 8; display: flex; flex-direction: column; box-shadow: var(--shadow); }
.sh-hist .hh { display: flex; align-items: center; padding: 10px 12px; font-weight: 700; border-bottom: 1px solid var(--border); }
.sh-hist .hl { flex: 1; overflow: auto; padding: 6px 10px; }
.sh-hist .he { padding: 6px 4px; border-bottom: 1px solid var(--border2); font-size: 12.5px; cursor: pointer; }
.sh-hist .he:hover { background: var(--hover); }
.sh-hist .he .v { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12px; }
.sh-hist .he .old { color: var(--danger); text-decoration: line-through; }
.sh-hist .he .new { color: var(--ok); }
.swatches { display: grid; grid-template-columns: repeat(10, 22px); gap: 4px; padding: 8px; }
.swatches button { width: 22px; height: 22px; border-radius: 3px; border: 1px solid var(--border); cursor: pointer; }

/* ---------- 위키 ---------- */
.wiki { display: flex; height: 100%; min-height: 0; }
.wiki-list { width: 240px; border-right: 1px solid var(--border2); display: flex; flex-direction: column; flex: none; background: var(--bg1); }
.wiki-list .wl { flex: 1; overflow: auto; padding: 6px; }
.wiki-main { flex: 1; display: flex; flex-direction: column; min-width: 0; }
.wiki-main .wt { font-size: 26px; font-weight: 700; border: 0; outline: 0; background: none; padding: 20px 32px 4px; width: 100%; }
.wiki-main .wmeta { padding: 0 32px 8px; font-size: 12px; color: var(--muted); display: flex; gap: 8px; align-items: center; }
.wiki-main .wbody { flex: 1; display: flex; min-height: 0; border-top: 1px solid var(--border2); }
.wiki-main textarea { flex: 1; border: 0; outline: 0; background: var(--bg2); padding: 16px 32px; resize: none; font: 14px/1.6 ui-monospace, "SF Mono", Menlo, Consolas, monospace; }
.wiki-main .wprev { flex: 1; overflow: auto; padding: 16px 32px; border-left: 1px solid var(--border2); }

/* ---------- 일정 ---------- */
.cal { display: flex; flex-direction: column; height: 100%; min-height: 0; }
.cal-top { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border-bottom: 1px solid var(--border2); flex: none; }
.cal-top .ttl { font-size: 18px; font-weight: 700; margin: 0 8px; }
.cal-week { flex: 1; overflow: auto; position: relative; }
.cal-wh { display: grid; grid-template-columns: 56px repeat(7, 1fr); position: sticky; top: 0; background: var(--bg2); z-index: 3; border-bottom: 1px solid var(--border); }
.cal-wh > div { padding: 8px 6px; font-size: 13px; }
.cal-wh .dn { font-size: 22px; font-weight: 300; }
.cal-wh .today { color: var(--accent); }
.cal-wh .today .dn { font-weight: 700; }
.cal-allday { display: grid; grid-template-columns: 56px repeat(7, 1fr); border-bottom: 1px solid var(--border); min-height: 26px; position: sticky; top: 64px; background: var(--bg2); z-index: 3; }
.cal-allday > div { border-left: 1px solid var(--border2); padding: 2px; display: flex; flex-direction: column; gap: 2px; }
.cal-grid { display: grid; grid-template-columns: 56px repeat(7, 1fr); position: relative; }
.cal-hours > div { height: 48px; font-size: 11px; color: var(--muted); text-align: right; padding-right: 6px; transform: translateY(-7px); }
.cal-day { border-left: 1px solid var(--border2); position: relative; background-image: repeating-linear-gradient(to bottom, transparent 0, transparent 47px, var(--border2) 47px, var(--border2) 48px); }
.cal-day.today { background-color: var(--accent-soft); }
.cal-ev { position: absolute; left: 3px; right: 3px; border-radius: 4px; padding: 2px 6px; font-size: 12px; overflow: hidden; color: #fff; cursor: pointer; border-left: 3px solid rgba(0,0,0,.25); }
.cal-ev b { display: block; font-weight: 600; }
.cal-chip { border-radius: 3px; padding: 1px 6px; font-size: 12px; color: #fff; cursor: pointer; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.cal-now { position: absolute; left: 0; right: 0; height: 2px; background: #c4314b; z-index: 2; }
.cal-month { flex: 1; display: grid; grid-template-columns: repeat(7, 1fr); grid-auto-rows: 1fr; overflow: auto; }
.cal-month .mh { padding: 6px; font-size: 12px; color: var(--muted); border-bottom: 1px solid var(--border); }
.cal-month .md { border-right: 1px solid var(--border2); border-bottom: 1px solid var(--border2); padding: 4px; min-height: 96px; display: flex; flex-direction: column; gap: 2px; cursor: default; }
.cal-month .md .dn { font-size: 12px; padding: 2px 4px; }
.cal-month .md.other { opacity: .45; }
.cal-month .md.today .dn { background: var(--accent2); color: #fff; border-radius: 10px; align-self: flex-start; }
.mini-cal { padding: 8px 14px; }
.mini-cal .mc-h { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 4px; }
.mini-cal .mc-g { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 12px; gap: 2px; }
.mini-cal .mc-g span { padding: 4px 0; border-radius: 50%; cursor: pointer; }
.mini-cal .mc-g span.o { color: var(--faint); }
.mini-cal .mc-g span.t { background: var(--accent2); color: #fff; }
.mini-cal .mc-g span:hover { background: var(--hover); }

/* ---------- 저장소 / 관리 ---------- */
.page { padding: 24px 32px; overflow: auto; height: 100%; }
.page h2 { margin: 0 0 4px; font-size: 22px; }
.page h3 { margin: 24px 0 10px; font-size: 16px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; margin: 14px 0; }
.card { background: var(--card); border: 1px solid var(--border); border-radius: 8px; padding: 14px 16px; }
.card .k { font-size: 12px; color: var(--muted); }
.card .v { font-size: 22px; font-weight: 700; margin-top: 2px; }
.meter { height: 8px; background: var(--border); border-radius: 4px; overflow: hidden; margin-top: 8px; }
.meter i { display: block; height: 100%; background: var(--accent); }
table.tbl { width: 100%; border-collapse: collapse; background: var(--card); border-radius: 8px; overflow: hidden; }
.tbl th { text-align: left; font-weight: 600; font-size: 12.5px; color: var(--text2); padding: 9px 12px; border-bottom: 1px solid var(--border); background: var(--card2); }
.tbl td { padding: 9px 12px; border-bottom: 1px solid var(--border2); font-size: 13.5px; vertical-align: middle; }
.tbl tr:last-child td { border-bottom: 0; }
.code-box { font: 13px ui-monospace, Menlo, Consolas, monospace; background: var(--bg3); border: 1px solid var(--border); border-radius: 6px; padding: 8px 10px; word-break: break-all; user-select: all; }

/* ---------- 활동 ---------- */
.act-item { display: flex; gap: 10px; padding: 10px; border-radius: 6px; cursor: pointer; position: relative; }
.act-item:hover { background: var(--hover); }
.act-item.on { background: var(--sel); }
.act-item.unread::before { content: ""; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; border-radius: 2px; background: var(--accent); }
.act-item .ai { position: relative; }
.act-item .ai .kind { position: absolute; right: -4px; bottom: -4px; width: 18px; height: 18px; border-radius: 50%; display: grid; place-items: center; font-size: 10px; color: #fff; border: 2px solid var(--bg1); }
.act-item .ab { flex: 1; min-width: 0; }
.act-item .at1 { display: flex; gap: 6px; font-size: 13px; }
.act-item .at1 b { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-item.unread .at1 b { font-weight: 700; }
.act-item .at2 { font-size: 12px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.act-item .at3 { font-size: 13px; color: var(--text2); overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

/* ---------- 로그인 ---------- */
#auth { position: fixed; inset: 0; display: grid; place-items: center; background: radial-gradient(1200px 600px at 20% 0%, rgba(127,133,245,.25), transparent), var(--bg2); overflow: auto; padding: 20px; }
.auth-card { width: min(420px, 100%); background: var(--card); border: 1px solid var(--border); border-radius: 12px; padding: 32px 32px 26px; box-shadow: var(--shadow); }
.auth-card .brand { display: flex; align-items: center; gap: 10px; margin-bottom: 18px; font-size: 22px; font-weight: 700; }
.auth-card .brand .logo-sq { width: 36px; height: 36px; font-size: 20px; border-radius: 9px; }
.auth-card h1 { font-size: 20px; margin: 0 0 6px; }
.auth-card p { color: var(--muted); margin: 0 0 18px; font-size: 13.5px; }
.auth-card .err { color: var(--danger); font-size: 13px; min-height: 18px; margin: 4px 0 8px; }
.auth-card .btn.primary { width: 100%; justify-content: center; height: 38px; }
.auth-card .alt { margin-top: 14px; text-align: center; font-size: 13px; color: var(--muted); }

/* 채널 정보 패널 */
.info-pane { width: 320px; border-left: 1px solid var(--border2); background: var(--bg1); overflow: auto; padding: 16px; flex: none; }
.info-pane h4 { margin: 14px 0 6px; font-size: 13px; color: var(--muted); font-weight: 600; }
.split { display: flex; flex: 1; min-height: 0; }
.split > .grow { display: flex; flex-direction: column; min-height: 0; }
.member-row { display: flex; align-items: center; gap: 10px; padding: 6px 4px; border-radius: 6px; }
.member-row:hover { background: var(--hover); }
.profile-card { display: flex; gap: 14px; align-items: center; }
.webtab { width: 100%; height: 100%; border: 0; background: #fff; }

@media (max-width: 860px) {
  #app { grid-template-columns: 56px 220px 1fr; }
  .tb-left { width: auto; }
}

/* 직급 배지 */
.pos-pill { background: color-mix(in srgb, var(--pc) 16%, transparent); color: var(--pc); border: 1px solid color-mix(in srgb, var(--pc) 35%, transparent); }
.pos-pill.sm { height: 18px; padding: 0 7px; font-size: 11px; }
[data-theme="dark"] .pos-pill { color: color-mix(in srgb, var(--pc) 55%, #fff); }
.perm-grid { border-collapse: collapse; width: 100%; max-width: 860px; }
.perm-grid th, .perm-grid td { padding: 10px 12px; border-bottom: 1px solid var(--border); text-align: center; }
.perm-grid th:first-child, .perm-grid td:first-child { text-align: left; }
.perm-grid td.lock { color: var(--muted); font-size: 12px; }
.perm-grid input[type=checkbox] { width: 18px; height: 18px; accent-color: var(--accent); cursor: pointer; }
.pos-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 14px; }
.pos-tabs .chip { border: 1px solid var(--border); border-radius: 16px; padding: 4px 12px; cursor: pointer; font-size: 13px; background: var(--card); }
.pos-tabs .chip.on { background: var(--accent-bg); border-color: var(--accent); font-weight: 600; }
.perm-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--border); }
.perm-row .grow { min-width: 0; }
.perm-row select { width: 130px; }

/* ---------- 휴대폰 (홈 화면 웹앱) ---------- */
#tb-menu { display: none; }
@media (max-width: 760px) {
  html, body { height: 100%; overscroll-behavior: none; }
  #app { grid-template-columns: minmax(0, 1fr); grid-template-rows: calc(50px + env(safe-area-inset-top)) minmax(0, 1fr) calc(68px + env(safe-area-inset-bottom)); height: 100vh; height: var(--vvh, 100dvh); position: fixed; left: 0; right: 0; top: var(--vvtop, 0); width: 100%; overflow: hidden; }
  html, body { overflow: hidden; overscroll-behavior: none; } /* 화면이 옆으로 밀리며 왼쪽이 잘리던 것 방지 */
  #main, #side, #topbar { min-width: 0; max-width: 100vw; }
  /* 자판이 올라와 있는 동안: 아래 탭 막대는 숨기고 그 자리까지 대화 영역으로 */
  body.kb-open #app { grid-template-rows: calc(50px + env(safe-area-inset-top)) minmax(0, 1fr) 0; }
  body.kb-open #rail { display: none; }
  #topbar { grid-row: 1; padding: env(safe-area-inset-top) 8px 0 6px; gap: 6px; }
  .tb-left { width: auto; gap: 2px; }
  #tb-back, #tb-fwd, #tb-name { display: none; }
  #tb-menu { display: inline-flex; }
  body.m-side #tb-menu { visibility: hidden; }
  .tb-search { flex: 1; min-width: 0; max-width: none; }
  .tb-right { gap: 2px; }
  #tb-conn { display: none; }
  #rail { grid-row: 3; grid-column: 1; flex-direction: row; align-items: stretch; padding: 0 0 env(safe-area-inset-bottom); overflow-x: auto; overflow-y: hidden; border-top: 1px solid var(--border2); scrollbar-width: none; }
  #rail::-webkit-scrollbar { display: none; }
  /* 아래 탭: 크게, 한 화면에 5개 (활동·채팅·팀·과제·일정), 나머지는 옆으로 밀어서 */
  #rail { scroll-snap-type: x mandatory; -webkit-mask-image: linear-gradient(90deg, #000 88%, transparent); mask-image: linear-gradient(90deg, #000 88%, transparent); }
  .rail-btn { flex: 0 0 20%; min-width: 68px; height: 68px; font-size: 12.5px; font-weight: 600; gap: 4px; scroll-snap-align: start; }
  .rail-btn svg { width: 27px; height: 27px; }
  .rail-btn.on { background: color-mix(in srgb, var(--accent) 10%, transparent); }
  .rail-btn.on::before { left: 18px; right: 18px; top: 0; bottom: auto; width: auto; height: 3px; border-radius: 0 0 3px 3px; }
  .rail-btn .badge { top: 6px; left: calc(50% + 6px); }
  .rail-sp, #rail .rail-help { display: none; }
  #side, #main { grid-row: 2; grid-column: 1; border-radius: 0; border-left: 0; }
  #side .resizer { display: none; }
  body:not(.m-side) #side { display: none; }
  body.m-side #main { display: none; }
  .side-item { min-height: 44px; }
  .side-item .more { opacity: 1; }
  /* 화면 머리 */
  .vhead { padding: 0 8px 0 10px; height: auto; min-height: 50px; flex-wrap: wrap; row-gap: 0; }
  .vhead .vt { max-width: calc(100vw - 120px); overflow: hidden; text-overflow: ellipsis; }
  .vhead .vtabs { order: 5; flex-basis: 100%; height: 40px; }
  .info-pane { position: absolute; inset: 0; width: auto; z-index: 20; }
  .split { position: relative; }
  .composer { padding: 0 8px calc(8px + env(safe-area-inset-bottom) * 0); }
  .page { padding: 16px; }
  .page .row { flex-wrap: wrap; }
  .tbl { display: block; overflow-x: auto; white-space: nowrap; }
  .modal { max-height: calc(100dvh - 24px - env(safe-area-inset-top) - env(safe-area-inset-bottom)); }
  .modal-h { padding: 16px 16px 6px; }
  .modal-b { padding: 6px 16px 10px; }
  .modal-f { padding: 10px 16px 16px; flex-wrap: wrap; }
  /* 전체 화면 창(사진·파일 미리보기): 아이폰 상태 막대·다이내믹 아일랜드·홈 막대를 피해서 */
  .modal.full { width: 100vw; height: 100dvh; max-height: 100dvh; border-radius: 0;
    padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left); }
  .preview .pv-h { padding: 6px 6px 6px 12px; gap: 6px; }
  .preview .pv-h .btn[data-dl] { padding: 0 10px; height: 36px; }
  .preview .pv-h [data-open] { display: none; }
  .preview .pv-h [data-x] { width: 44px; height: 44px; flex: none; }
  .preview .pv-b { align-items: center; }
  .preview .pv-b pre, .preview .pv-b .mtext, .preview .pv-b iframe { align-self: stretch; }
  .menu { max-width: calc(100vw - 16px); }
  .menu .mi { padding: 10px 12px; }
  /* iOS 는 16px 미만 입력칸에 초점이 가면 화면을 확대한다 */
  input, textarea, select, [contenteditable] { font-size: 16px !important; }
  .cal-top { flex-wrap: wrap; gap: 6px; padding: 8px 10px; }
  .cal-top .ttl { font-size: 16px; }
  .cal-wh > div { font-size: 11px; }
  .cards { grid-template-columns: 1fr; }
  .sh-tool { flex-wrap: nowrap; overflow-x: auto; }
  .msg-actions { right: 4px; }
  .cal-month { grid-template-columns: repeat(7, minmax(0, 1fr)); overflow-x: hidden; }
  .cal-month .md { min-width: 0; padding: 2px; }
  .cal-chip { font-size: 10.5px; padding: 1px 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .cal-wh, .cal-allday, .cal-grid { grid-template-columns: 34px repeat(7, minmax(0, 1fr)); }
  .cal-hours > div { font-size: 9px; }
  .cal-ev { font-size: 10.5px; padding: 1px 3px; overflow: hidden; }
}
/* 터치 화면: 메시지를 누르면 반응·더보기 버튼이 보임 */
@media (hover: none) {
  .msg:hover > .msg-actions, .post-main:hover > .msg-actions { display: none; }
  .msg-actions.keep { display: flex; }
  .msg-actions button { width: 36px; height: 34px; }
}

/* 휴대폰 푸시 알림 안내 */
.push-ask { position: fixed; left: 8px; right: 8px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 300; display: flex; align-items: center; gap: 8px; padding: 10px 12px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); font-size: 13.5px; }
.push-ask .grow { display: flex; gap: 6px; align-items: flex-start; }

/* ---------- 일정: Google 캘린더 스타일 ---------- */
.gc-create-wrap { padding: 14px 12px 6px; }
.gc-create { display: inline-flex; align-items: center; gap: 12px; height: 54px; padding: 0 22px 0 16px; border: 0; border-radius: 16px; background: var(--card); color: var(--text); font-size: 14px; font-weight: 600; cursor: pointer; box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 4px 8px 3px rgba(0,0,0,.15); }
.gc-create:hover { background: var(--card2); box-shadow: 0 1px 3px rgba(0,0,0,.3), 0 6px 10px 4px rgba(0,0,0,.18); }
.mini-cal { padding: 10px 12px 4px 16px; }
.mini-cal .mc-h { display: flex; align-items: center; gap: 2px; font-weight: 500; font-size: 14px; margin-bottom: 6px; padding-left: 4px; }
.mini-cal .mc-g { gap: 0; font-size: 11px; }
.mini-cal .mc-g b { font-weight: 500; color: var(--muted); padding: 4px 0; }
.mini-cal .mc-g span { width: 26px; height: 26px; line-height: 26px; padding: 0; margin: 1px auto; border-radius: 50%; }
.mini-cal .mc-g span:hover { background: var(--hover); }
.mini-cal .mc-g span.t { background: var(--accent2); color: #fff; font-weight: 600; }
.mini-cal .mc-g span.sel { background: var(--accent-bg); color: var(--accent); font-weight: 600; }
.gc-lists { padding: 4px 8px 16px; }
.gc-sec { display: flex; align-items: center; padding: 14px 8px 4px 10px; font-size: 14px; font-weight: 600; color: var(--text); }
.gc-row { display: flex; align-items: center; gap: 12px; padding: 0 10px; min-height: 32px; border-radius: 6px; cursor: pointer; font-size: 13.5px; color: var(--text2); }
.gc-row:hover { background: var(--hover); }
.gc-row .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gc-row input[type=checkbox] { appearance: none; -webkit-appearance: none; flex: none; width: 18px; height: 18px; margin: 0; border: 2px solid var(--c); border-radius: 3px; background: transparent; cursor: pointer; position: relative; }
.gc-row input[type=checkbox]:checked { background: var(--c); }
.gc-row input[type=checkbox]:checked::after { content: ""; position: absolute; left: 4px; top: 0; width: 5px; height: 10px; border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg); }
.gc-top { gap: 6px; padding: 8px 16px; }
.gc-top .ttl { font-size: 22px; font-weight: 400; margin: 0 10px; letter-spacing: -.2px; }
.gc-today { height: 36px; padding: 0 18px; border-radius: 18px; border: 1px solid var(--input-border); background: transparent; color: var(--text); font-size: 14px; font-weight: 500; cursor: pointer; margin-right: 6px; }
.gc-today:hover { background: var(--hover); }
.gc-views { display: inline-flex; border: 1px solid var(--input-border); border-radius: 18px; overflow: hidden; height: 36px; }
.gc-views button { border: 0; background: transparent; color: var(--text); padding: 0 16px; font-size: 14px; font-weight: 500; cursor: pointer; }
.gc-views button.on { background: var(--accent-bg); color: var(--accent); }
.gc-add { display: none; }
/* 월 보기 */
.gm { flex: 1; min-height: 0; display: flex; flex-direction: column; border-top: 1px solid var(--border2); }
.gm-row { flex: 1 1 0; min-height: 0; position: relative; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); border-bottom: 1px solid var(--border2); }
.gm-row:last-child { border-bottom: 0; }
.gm-cell { border-right: 1px solid var(--border2); min-width: 0; text-align: center; padding-top: 6px; cursor: pointer; }
.gm-cell:last-of-type { border-right: 0; }
.gm-wd { font-size: 11px; font-weight: 600; color: var(--muted); line-height: 14px; margin-bottom: 2px; }
.gm-dn { display: inline-flex; align-items: center; justify-content: center; min-width: 24px; height: 24px; padding: 0 6px; border-radius: 12px; font-size: 12px; font-weight: 500; color: var(--text); }
.gm-dn:hover { background: var(--hover); }
.gm-dn.today { background: var(--accent2); color: #fff; }
.gm-cell.other .gm-dn { color: var(--faint); }
.gm-items { position: absolute; left: 0; right: 0; top: 28px; bottom: 2px; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); grid-auto-rows: 22px; row-gap: 2px; pointer-events: none; overflow: hidden; }
.gm-row.first .gm-items { top: 44px; }
.gm-items > * { pointer-events: auto; min-width: 0; margin: 0 6px 0 4px; }
.gm-bar { background: var(--c); color: #fff; border-radius: 4px; padding: 0 8px; font-size: 12px; font-weight: 500; line-height: 22px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; cursor: pointer; }
.gm-bar.cl { margin-left: 0; border-top-left-radius: 0; border-bottom-left-radius: 0; }
.gm-bar.cr { margin-right: 0; border-top-right-radius: 0; border-bottom-right-radius: 0; }
.gm-bar:hover { filter: brightness(.92); }
.gm-ev { display: flex; align-items: center; gap: 6px; padding: 0 4px; border-radius: 4px; font-size: 12px; line-height: 22px; white-space: nowrap; overflow: hidden; cursor: pointer; color: var(--text); }
.gm-ev:hover { background: var(--hover); }
.gm-ev i { flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.gm-ev i.sq { border-radius: 2px; }
.gm-ev .tx { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.gm-ev .tm { color: var(--text2); }
.gm .past { opacity: .5; }
.gm-more { font-size: 12px; font-weight: 600; color: var(--text2); padding: 0 6px; line-height: 22px; border-radius: 4px; cursor: pointer; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.gm-more:hover { background: var(--hover); }
.gm-daylist { display: flex; flex-direction: column; gap: 4px; }
.gm-daylist > * { margin: 0; }
@media (max-width: 760px) {
  .gc-add { display: inline-flex; }
  .gc-top .ttl { font-size: 17px; margin: 0 4px; }
  .gc-today { padding: 0 12px; height: 32px; }
  .gc-views { height: 32px; } .gc-views button { padding: 0 10px; }
  .gm-items > * { margin: 0 1px; }
  .gm-bar { padding: 0 3px; font-size: 10.5px; }
  .gm-ev { gap: 3px; padding: 0 1px; font-size: 10.5px; } .gm-ev .tm { display: none; } .gm-ev i { width: 6px; height: 6px; }
  .gm-more { padding: 0 2px; font-size: 10.5px; }
  .gc-top { flex-wrap: nowrap; gap: 2px; padding: 6px 8px; }
  .gc-top .icon-btn { width: 30px; height: 30px; }
  .gc-top .ttl { font-size: 15px; white-space: nowrap; }
  .gm-dn { white-space: nowrap; padding: 0 3px; font-size: 11px; }
}

/* 왼쪽 목록 패널 접기 (⌘B · 위쪽 패널 버튼) */
body.side-off #app { grid-template-columns: 68px 0 1fr; }
body.side-off #side { display: none; }
body.side-off .tb-left { width: auto; }
body.side-off #main { border-left: 0; grid-column: 3; grid-row: 2; }
body.side-off #tb-side { color: var(--accent); }
@media (max-width: 760px) { #tb-side { display: none; } }

/* 직급 표식: 교수 왕관 · 랩장 별 (프로필 오른쪽 아래) */
.av .rb { position: absolute; right: -3px; bottom: -3px; border-radius: 50%; display: grid; place-items: center; box-shadow: 0 0 0 2px var(--bg1); z-index: 1; }
.av .rb svg { display: block; }
.av.has-rb .pr { bottom: auto; top: -2px; }

/* Google 시트 연동 */
.sh-tool .gs-chip { margin-left: auto; white-space: nowrap; }
.sh-tool .gs-chip.on { color: #34a853; border-color: color-mix(in srgb, #34a853 45%, transparent); }
.sh-tool .gs-chip.err { color: var(--danger, #e5484d); border-color: color-mix(in srgb, #e5484d 45%, transparent); }
.gs-dlg ol { padding-left: 20px; margin: 0 0 14px; display: grid; gap: 10px; }
.gs-dlg .chk { align-items: flex-start; margin: 6px 0; }
.gs-dlg .chk input { margin-top: 3px; }

/* Mac 앱 메일(네이티브 Gmail 이 본문 위에 겹침): 짧은 안내는 가려지지 않는 위쪽 막대 자리로 */
body.mail-native #toasts { top: 7px; bottom: auto; z-index: 400; }
body.mail-native #toasts .toast { padding: 5px 14px; animation: none; font-size: 13px; }

/* 채널 로고 */
.side-item .cav { margin-right: 2px; }
.logo-edit { display: flex; gap: 10px; align-items: center; }
.logo-edit .inp { flex: 1; }
.logo-sw { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.logo-sw .sw { width: 24px; height: 24px; border-radius: 6px; border: 2px solid transparent; cursor: pointer; padding: 0; font-size: 10px; color: var(--text2, var(--text)); background: var(--card3); }
.logo-sw .sw:not([style*="background"]) { width: auto; padding: 0 6px; }
.logo-sw .sw.on { border-color: var(--text); }
.logo-sw .pick { position: relative; overflow: hidden; background: conic-gradient(#c4314b, #fce100, #13a10e, #0f6cbd, #8764b8, #c4314b); }
.logo-sw .pick input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.howto { margin: 4px 0 0; padding-left: 20px; line-height: 1.65; }
.howto li { margin: 3px 0; }

/* 입력창 이미지 미리보기 */
.cimg { position: relative; width: 96px; height: 96px; border-radius: 8px; overflow: hidden; border: 1px solid var(--border); background: var(--card2); flex: none; }
.cimg img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cimg .prog { position: absolute; left: 0; bottom: 0; height: 4px; background: var(--accent); }
.cimg .cerr { position: absolute; inset: auto 0 0 0; background: rgba(196,49,75,.9); color: #fff; font-size: 11px; padding: 2px 4px; }
.cimg .icon-btn { position: absolute; top: 3px; right: 3px; width: 22px; height: 22px; background: rgba(0,0,0,.55); color: #fff; border-radius: 50%; opacity: 0; }
.cimg:hover .icon-btn { opacity: 1; }
@media (hover: none) { .cimg .icon-btn { opacity: 1; } }

/* 게시물·메시지 이미지: 바로 보이게 */
.att-imgs { display: grid; gap: 6px; margin-top: 6px; max-width: 560px; }
.att-imgs .att-img { max-width: 100%; max-height: none; width: 100%; }
.att-imgs.n1 { grid-template-columns: 1fr; }
.att-imgs.n1 .att-img { width: auto; max-width: 100%; max-height: 460px; object-fit: contain; background: var(--card2); }
.att-imgs.n2 { grid-template-columns: 1fr 1fr; }
.att-imgs.n3 { grid-template-columns: 1fr 1fr 1fr; }
.att-imgs.n2 .att-img, .att-imgs.n3 .att-img { aspect-ratio: 1; height: auto; object-fit: cover; }

/* 필독 */
.req-pill { background: #e8a800; color: #1b1b1f; height: 18px; font-weight: 600; }
.req-modal .modal-b { max-height: min(70vh, 720px); }
.req-read .mtext { font-size: 15px; line-height: 1.65; }
.req-end { text-align: center; padding: 18px 0 4px; }

/* 서식 막대 · 글자 크기·색 */
.rtool { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }
.rtool .sep { width: 1px; height: 18px; background: var(--border); margin: 0 4px; }
.rtool .rsize { height: 26px; border-radius: 5px; border: 1px solid var(--border); background: var(--card2); color: var(--text); font-size: 12.5px; padding: 0 4px; }
.rcolors { display: grid; grid-template-columns: repeat(4, 26px); gap: 6px; padding: 8px; }
.rcolors button { width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; background: var(--card2); color: var(--text); font-weight: 700; }
.fs-sm, .redit font[size="1"], .redit font[size="2"] { font-size: .85em; }
.fs-lg, .redit font[size="4"], .redit font[size="5"] { font-size: 1.3em; }
.fs-xl, .redit font[size="6"], .redit font[size="7"] { font-size: 1.65em; line-height: 1.3; }

/* 앱 업데이트 알림 (왼쪽 아래 — 메일 화면을 가리지 않게) */
.upd-ask { position: fixed; left: 76px; bottom: 16px; width: 320px; z-index: 350; background: var(--card); border: 1px solid var(--accent); border-radius: 10px; box-shadow: var(--shadow); padding: 12px 14px; }
.upd-ask .ut { display: flex; align-items: center; gap: 6px; margin-bottom: 4px; }

/* 체크리스트 바로가기 · 강조 */
.msg-link { margin-top: 6px; }
.titem.flash { animation: tflash 2.4s ease-out; }
@keyframes tflash { 0%, 30% { box-shadow: 0 0 0 3px var(--accent); background: var(--accent-soft); } 100% { box-shadow: 0 0 0 0 transparent; } }

.req-pick .btn.on { color: #b07d00; border-color: color-mix(in srgb, #e8a800 50%, transparent); background: color-mix(in srgb, #e8a800 14%, transparent); }
[data-theme="dark"] .req-pick .btn.on { color: #f5c542; }

/* ---------- 랩 가계부 ---------- */
.menu .mi.dis { opacity: .45; cursor: default; }
.menu .mi.dis:hover { background: none; }
.lg-page { max-width: 1280px; }
.lg-head { display: flex; align-items: flex-start; gap: 12px; flex-wrap: wrap; margin-bottom: 4px; }
.lg-head h2 { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; word-break: keep-all; overflow-wrap: anywhere; }
/* 제목 칸이 좁아지면 버튼을 다음 줄로 (과제 이름이 길어도 한 글자씩 꺾이지 않게) */
.lg-head > .grow { flex: 1 1 340px; min-width: 0; }
.lg-dot { display: inline-block; width: 10px; height: 10px; border-radius: 3px; flex: none; }
.side-item .lg-dot { width: 12px; height: 12px; margin: 0 4px; }
.lg-grants { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.lg-gcard { cursor: pointer; transition: box-shadow .12s; }
.lg-gcard:hover { box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.lg-gname { font-weight: 700; font-size: 15px; }
.lg-left { margin-top: 12px; font-size: 13px; }
.lg-left b { font-size: 20px; margin-left: 4px; }
.lg-st { display: inline-flex; align-items: center; height: 22px; padding: 0 8px; border-radius: 11px; font-size: 12px; font-weight: 600; border: 0; white-space: nowrap; font-family: inherit; }
button.lg-st { cursor: pointer; }
.st-spent { background: var(--card2); color: var(--text2); box-shadow: inset 0 0 0 1px var(--border); }
.st-req { background: #4a3c10; color: #fce100; }
.st-paid { background: #1d3b1d; color: #92e08f; }
[data-theme="light"] .st-req { background: #fff4ce; color: #8a5a00; }
[data-theme="light"] .st-paid { background: #dff6dd; color: #0e700e; }
.lg-filters { gap: 8px; flex-wrap: wrap; margin: 4px 0 10px; }
.lg-filters .inp.sel { width: auto; max-width: 200px; }
.lg-scroll { overflow-x: auto; border-radius: 8px; }
.lg-tbl td, .lg-tbl th, .lg-lines td { white-space: normal; }
.tbl .r, .tbl th.r { text-align: right; white-space: nowrap; }
.lg-tbl { min-width: 740px; }
.lg-tbl th { white-space: nowrap; }
.lg-lines { min-width: 620px; }
.lg-people { min-width: 760px; }
.lg-people td:first-child { white-space: nowrap; }
.lg-lines td:first-child { min-width: 110px; }
.tbl .nowrap { white-space: nowrap; }
.lg-tbl tr.on td, .lg-lines tr.on td { background: var(--sel); }
.lg-lines tbody tr:not(.lg-total):hover td { background: var(--hover); }
.lg-lines .meter { margin-top: 0; }
.lg-total td { font-weight: 700; background: var(--card2); }
.lg-title { font-weight: 600; }
.lg-foot { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; padding: 10px 12px; font-size: 13px; }
.lg-bulk { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 8px 12px; margin-bottom: 8px; border-radius: 8px; background: var(--accent-bg); border: 1px solid var(--accent); font-size: 13px; }
.lg-bulk[hidden] { display: none; }
.lg-empty ol { margin: 8px 0 0; padding-left: 20px; line-height: 1.9; }
.lg-form .field { margin-bottom: 12px; }
.lg-seg { display: flex; flex-wrap: wrap; }
.lg-seg button { padding: 6px 12px; }
.lg-seg button:disabled { opacity: .4; cursor: default; }
.lg-amt { font-size: 16px; font-weight: 700; text-align: right; }
/* 놀이 · 사다리 타기 */
.gm-page { max-width: 1200px; }
.gm-hero { display: flex; gap: 16px; align-items: center; margin-bottom: 16px; }
.gm-hero .em { font-size: 48px; line-height: 1; }
.gm-big { height: 42px; padding: 0 18px; font-size: 15px; }
.gm-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 12px; }
.gm-card { cursor: pointer; }
.gm-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.18); }
.gm-tip { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 12px 0 10px; font-size: 14px; }
.gm-mine-inline { font-size: 16px; color: var(--accent); }
.gm-scroll { overflow-x: auto; padding-bottom: 8px; }
.gm-board { margin: 0 auto; }
.gm-top, .gm-bot { display: grid; }
.gm-name { display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 6px 2px; margin: 0 3px; border: 2px solid transparent; border-radius: 10px; background: none; color: var(--text); font: inherit; font-size: 12.5px; cursor: pointer; min-width: 0; }
.gm-name:hover { border-color: var(--c); }
.gm-name.me { background: var(--accent-bg); }
.gm-name.done { border-color: var(--c); }
.gm-name span { max-width: 100%; }
.gm-svg { display: block; }
.gm-svg .base line { stroke: var(--border); stroke-width: 3; stroke-linecap: round; }
.gm-svg .trails path { fill: none; stroke-width: 5; stroke-linecap: round; stroke-linejoin: round; transition: opacity .2s; }
.gm-svg .trails path.dim { opacity: .3; }
.gm-prize { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; min-height: 52px; margin: 6px 3px 0; padding: 4px; border-radius: 10px; background: var(--card2); border: 2px dashed var(--border); text-align: center; min-width: 0; }
.gm-prize b { font-size: 14px; word-break: keep-all; }
.gm-prize.open { border: 2px solid var(--c); background: var(--card); }
.gm-prize .small { max-width: 100%; color: var(--text2); }
.gm-secret { max-width: 640px; }
.gm-secret h4 { margin: 18px 0 8px; }
.gm-mine { margin: 16px 0 4px; text-align: center; }
.gm-scratch { margin-top: 8px; height: 56px; padding: 0 32px; font-size: 16px; border-style: dashed; }
.gm-result-big { margin-top: 8px; font-size: 30px; font-weight: 800; color: var(--accent); }
.gm-chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; }
.gm-prize-chip { padding: 2px 10px; border-radius: 12px; background: var(--card2); border: 1px solid var(--border); font-size: 13px; }
.lg-rcs { display: flex; flex-wrap: wrap; gap: 8px; padding: 4px; margin: -4px; border-radius: 8px; border: 1px dashed transparent; }
.lg-rcs.drop { border-color: var(--accent); background: var(--accent-bg); }
.lg-rc { display: flex; align-items: center; gap: 8px; max-width: 250px; height: 46px; padding: 0 4px 0 4px; border: 1px solid var(--border); border-radius: 8px; background: var(--card2); cursor: pointer; font-size: 13px; }
.lg-rc:hover { border-color: var(--accent); }
.lg-rc.new { border-style: dashed; }
.lg-rc .th { width: 38px; height: 38px; flex: none; display: flex; align-items: center; justify-content: center; border-radius: 6px; overflow: hidden; background: var(--bg3); }
.lg-rc .th img { width: 100%; height: 100%; object-fit: cover; }
.lg-rc .nm { display: flex; flex-direction: column; min-width: 0; line-height: 1.3; }
.lg-rc .icon-btn { width: 26px; height: 26px; flex: none; }
.lg-rc.add { padding: 0 12px; color: var(--accent); font-weight: 600; border-style: dashed; }
.lg-rcb { display: inline-flex; align-items: center; gap: 2px; margin-left: 6px; padding: 1px 6px; vertical-align: 1px; border: 0; border-radius: 9px; background: var(--accent-bg); color: var(--accent); font-family: inherit; font-size: 11.5px; font-weight: 600; line-height: 1.4; cursor: pointer; }
.lg-rcb:hover { filter: brightness(1.15); }
.lg-ledit td { padding: 4px 6px; }
.lg-ledit .inp { height: 32px; }
.inp.r { text-align: right; }
@media (max-width: 760px) {
  .lg-page { padding: 16px; }
  .lg-head h2 { font-size: 19px; line-height: 1.35; }
  .lg-head > .grow { flex-basis: 100%; }
  .lg-page .cards { grid-template-columns: 1fr 1fr; gap: 8px; }
  .lg-page .card .v { font-size: 18px; }
  .lg-filters .inp, .lg-filters .inp.sel { width: 100% !important; max-width: none; }
}
