/* 채널·계정 화면 — 서버사령부 InstaAuto 조종판의 줄(채널) 구조를 가져온 스타일 */
body.pg .card + .card { margin-top: 16px; }
.chIntro .chAdmin { margin-top: 10px; font-size: 13.5px; color: var(--muted); }
.chIntro .chAdmin b { color: var(--ok); }

.chHead { display: grid; grid-template-columns: minmax(0, 1.25fr) 26px minmax(0, 1fr) 26px minmax(0, 1fr); gap: 0; padding: 10px 14px 4px; font-size: 13px; font-weight: 800; color: var(--muted); }
.chHead em { font-style: normal; font-weight: 600; color: var(--dim); margin-left: 4px; }
.chList { display: grid; gap: 12px; margin-top: 8px; }
.chLine { display: grid; grid-template-columns: minmax(0, 1.25fr) 26px minmax(0, 1fr) 26px minmax(0, 1fr); align-items: stretch; padding: 12px 14px; border: 1px solid var(--line); border-radius: 16px; background: rgba(255, 255, 255, .025); }
.chLine.single { grid-template-columns: minmax(0, 1fr) 26px minmax(0, 1.1fr); }
.chArrow { display: grid; place-items: center; color: var(--dim); font-size: 18px; }
.chLabel { grid-column: 1 / -1; font-size: 13px; color: var(--muted); margin-bottom: 8px; line-height: 1.5; }
.chLabel b { color: var(--text); }

.slot { display: flex; flex-direction: column; gap: 8px; padding: 12px; border-radius: 14px; border: 1px solid var(--line); background: var(--bg2); min-width: 0; }
.slot.off { opacity: .62; }
.slot.slotEmpty { border-style: dashed; background: transparent; justify-content: center; }
.slotTop { display: flex; align-items: center; gap: 11px; min-width: 0; }
.avatar { width: 46px; height: 46px; border-radius: 50%; flex: none; object-fit: cover; background: linear-gradient(135deg, #7b6bff, #4f8bff); display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; overflow: hidden; }
.who { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nameBtn { all: unset; cursor: pointer; font-size: 16px; font-weight: 800; letter-spacing: -.2px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nameBtn:hover { color: #cfc8ff; text-decoration: underline; }
.nameBtn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.handle { font-size: 13px; color: var(--blue); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slotMeta { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12.5px; color: var(--muted); }
.slotRow { display: flex; align-items: center; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.slotNote { font-size: 13.5px; color: var(--muted); line-height: 1.5; }
.slotLabel { font-size: 14.5px; font-weight: 800; }

.swPill { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px 4px 8px; border-radius: 999px; border: 1px solid rgba(74, 222, 155, .5); background: rgba(74, 222, 155, .12); color: #7cf0b8; font-size: 13px; font-weight: 800; cursor: pointer; }
.swPill::before { content: ''; width: 10px; height: 10px; border-radius: 50%; background: var(--ok); }
.swPill.is-off { border-color: var(--line); background: var(--panel); color: var(--muted); }
.swPill.is-off::before { background: var(--dim); }
.swPill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.swPill[disabled] { opacity: .5; cursor: wait; }
.tagChip { display: inline-block; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); font-size: 12px; color: var(--muted); }
.tagChip.soon { color: var(--warn); border-color: rgba(255, 201, 92, .5); }
.tagChip.expired { color: var(--danger); border-color: rgba(255, 107, 129, .55); }
.tagChip.badge { color: #c9c2ff; border-color: rgba(139, 123, 255, .5); background: rgba(139, 123, 255, .1); }
.linkBtn { all: unset; cursor: pointer; font-size: 13px; font-weight: 700; color: var(--blue); }
.linkBtn:hover { text-decoration: underline; }
.connectBtn { align-self: flex-start; }

.mediaHead { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; }
.mediaWho { display: flex; align-items: center; gap: 12px; font-size: 18px; font-weight: 800; }
.mediaGrid { margin-top: 14px; display: grid; gap: 12px; grid-template-columns: repeat(auto-fill, minmax(168px, 1fr)); }
.mTile { display: flex; flex-direction: column; border: 1px solid var(--line); border-radius: 14px; overflow: hidden; background: var(--bg2); text-decoration: none; color: var(--text); }
.mTile:hover { border-color: rgba(139, 123, 255, .6); }
.mTile .mImg { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; background: #0d1018; display: block; }
.mTile .mNo { width: 100%; aspect-ratio: 4 / 5; display: grid; place-items: center; background: #0d1018; color: var(--dim); font-size: 13px; }
.mTile .mTxt { padding: 9px 11px 11px; display: flex; flex-direction: column; gap: 4px; }
.mTile .mCap { font-size: 13.5px; line-height: 1.45; word-break: keep-all; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mTile .mSub { font-size: 12px; color: var(--muted); }

.dlg { border: 1px solid var(--line); border-radius: 18px; background: #12151f; color: var(--text); padding: 0; width: min(440px, 92vw); }
.dlg::backdrop { background: rgba(0, 0, 0, .6); }
.dlgBody { padding: 22px; display: flex; flex-direction: column; gap: 12px; }
.dlgTitle { font-size: 18px; font-weight: 800; }
.dlgBtns { display: flex; justify-content: flex-end; gap: 8px; margin-top: 4px; }
.dlgMsg { min-height: 18px; color: var(--danger); }
.connBox { padding: 12px 14px; border-radius: 12px; background: rgba(255, 201, 92, .07); border: 1px solid rgba(255, 201, 92, .35); font-size: 14px; line-height: 1.65; }

@media (max-width: 980px) {
  .chHead { display: none; }
  .chLine, .chLine.single { grid-template-columns: 1fr; gap: 6px; }
  .chArrow { transform: rotate(90deg); height: 20px; }
  .chArrow:empty::before { content: '→'; }
}

/* ===== 결과 안내 · 연결 해제 버튼 (Threads 연결 추가) ===== */
.toast { margin-bottom: 14px; padding: 13px 16px; border-radius: 14px; font-size: 15px; line-height: 1.6; border: 1px solid var(--line); background: var(--panel); }
.toast.ok { border-color: rgba(74, 222, 155, .5); background: rgba(74, 222, 155, .08); color: #b9f5d6; }
.toast.warn { border-color: rgba(255, 201, 92, .5); background: rgba(255, 201, 92, .08); color: #ffe3a3; }
.toast.bad { border-color: rgba(255, 107, 129, .55); background: rgba(255, 107, 129, .08); color: #ffc2cc; }
.linkDanger { color: var(--danger); }
.linkDanger:hover { text-decoration: underline; }

/* + 계정 연결 창 */
.addList { display: flex; flex-direction: column; margin-top: 4px; }
.addRow { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); }
.addRow:first-child { border-top: 0; }
.addWho { min-width: 0; flex: 1; }
.addName { font-weight: 800; font-size: 15px; }
.addNote { color: var(--muted); font-size: 12.5px; margin-top: 3px; line-height: 1.45; }
.addAct { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 6px; max-width: 48%; }
.addAdmin { margin-top: 6px; font-size: 12px; color: var(--dim); }
.addAdmin summary { cursor: pointer; }