/* ═══════════════════════════════════════════════
   지역 팀 조직도 — 네트워크 다단계 트리 + 프로필/활동점수
   Ver 3.2.0 · 2026-04-29n
   · n8n 와이어프레임 스타일 수평 트리
   · 팀장 편집 + 프로필 + 활동점수 + 확장 모달
   · 모바일 우선 설계
   ═══════════════════════════════════════════════ */

.sr-split-wrap {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) 2fr;
    gap: 12px;
    padding: 10px 12px;
    height: 100%;
    overflow: hidden;
}
.sr-split-left {
    overflow-y: auto;
    border-right: 1px solid #f0e8e0;
    padding-right: 10px;
}
.sr-split-right {
    overflow-y: auto;
    overflow-x: auto;
    padding: 6px 4px;
}
@media (max-width: 768px) {
    .sr-split-wrap {
        grid-template-columns: 1fr;
        gap: 6px;
        padding: 6px;
    }
    .sr-split-left {
        max-height: 150px;
        border-right: none;
        border-bottom: 1px solid #f0e8e0;
        padding-right: 0;
        padding-bottom: 6px;
    }
}

/* ─── 조직도 헤더 ─── */
.rt-hdr {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 10px 10px;
    border-bottom: 2px solid #f0e8e0;
    margin-bottom: 10px;
    flex-wrap: wrap;
    gap: 8px;
}
.rt-hdr-title { font-size: 15px; font-weight: 800; color: #7a5a3a; }
.rt-hdr-sub { font-size: 10px; color: #a08670; margin-top: 2px; }
.rt-hdr-stat {
    font-size: 10px; color: #c9a86a; font-weight: 700;
    padding: 3px 8px; background: #fff8ec;
    border: 1px solid #f0d9a8; border-radius: 10px;
}
/* [v=20260429l] 임무1-A: 편집 토글 버튼 — 세련된 에메랄드 초록 (PC 아이콘+텍스트) */
.rt-edit-toggle {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 14px;
    border-radius: 8px;
    border: 1.5px solid #059669;
    background: #10b981;
    color: #fff;
    cursor: pointer;
    box-shadow: 0 1px 5px rgba(16,185,129,0.25);
    letter-spacing: 0.01em;
    transition: background 0.18s, box-shadow 0.18s, color 0.18s, border-color 0.18s;
    white-space: nowrap;
}
.rt-edit-toggle::before {
    content: none;
}
.rt-edit-toggle:hover {
    background: #059669;
    border-color: #047857;
    box-shadow: 0 2px 8px rgba(5,150,105,0.30);
    transform: none;
}
.rt-edit-toggle:active {
    background: #047857;
    box-shadow: none;
    transform: none;
}
.rt-edit-toggle.active {
    background: #065f46;
    border-color: #047857;
    color: #a7f3d0;
    box-shadow: 0 1px 4px rgba(6,95,70,0.20);
    animation: none;
}
.rt-edit-toggle.active:hover {
    background: #047857;
    color: #d1fae5;
}
/* [v=20260429n] 임무C: @keyframes rtEditPulse 제거 — 호출처 0건 확인, dead code */

/* 모바일 크기 조정만 */
@media (max-width: 768px) {
    .rt-edit-toggle {
        font-size: 11px;
        padding: 6px 11px;
        border-radius: 7px;
    }
}

/* [v=20260429l] 임무1-A: 아이콘 전용 편집 버튼 — 에메랄드 초록 (PC: 자동 너비+패딩, 모바일: 30px) */
.rt-edit-icon-btn {
    height: 30px;
    border: 1.5px solid #059669;
    border-radius: 8px;
    background: #10b981;
    color: #fff;
    cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    gap: 4px;
    transition: background 0.18s, color 0.18s, border-color 0.18s, box-shadow 0.18s;
    flex-shrink: 0; padding: 0 10px;
    box-shadow: 0 1px 4px rgba(16,185,129,0.25);
    white-space: nowrap;
}
@media (max-width: 768px) {
    .rt-edit-icon-btn {
        width: 30px; padding: 0;
        justify-content: center;
    }
}
.rt-edit-icon-btn:hover {
    background: #059669;
    border-color: #047857;
    box-shadow: 0 2px 7px rgba(5,150,105,0.30);
    transform: none;
}
.rt-edit-icon-btn.active {
    background: #065f46;
    border-color: #047857;
    color: #a7f3d0;
    box-shadow: 0 1px 3px rgba(6,95,70,0.20);
    animation: none;
}
.rt-edit-icon-btn.active:hover {
    background: #047857;
    color: #d1fae5;
}

/* ─── L1: 지역 카드 ─── */
.rt-region {
    margin-bottom: 10px; background: #fff;
    border: 1px solid #f0e4d4; border-radius: 10px; overflow: hidden;
}
.rt-region.expanded {
    border-color: #d4af8a;
    box-shadow: 0 2px 10px rgba(201,168,106,0.15);
}
.rt-region-head {
    /* 임무 B: justify-content 제거 - 하단 재정의(gap+flex-wrap)가 담당 */
    display: flex; align-items: center;
    padding: 10px 14px; cursor: pointer;
    background: linear-gradient(135deg, #fff8ec, #fffdf6);
}
.rt-region.expanded .rt-region-head {
    background: linear-gradient(135deg, #fff4d9, #fff8ec);
}
.rt-region-name {
    display: flex; align-items: center; gap: 8px;
    font-size: 14px; font-weight: 800; color: #5a3a20;
}
.rt-region-name::before {
    content: ''; width: 7px; height: 7px;
    border-radius: 50%; background: #c9a86a;
}
/* ★ [LEAD 2026-04-26] 인원수 강조 배지 */
.rt-region-count {
    background: linear-gradient(135deg, #B8A6E8, #FFC4D1);
    color: #fff;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 600;
    font-size: 12px;
}
.rt-region-arrow { font-size: 12px; color: #b8956a; transition: transform 0.25s; margin-left: 6px; }
.rt-region.expanded .rt-region-arrow { transform: rotate(90deg); }

/* ─── 팀 캔버스 ─── */
.rt-region-body { display: none; padding: 10px; background: #fbf7f0; }
.rt-region.expanded .rt-region-body { display: block; }
.rt-team-canvas {
    background: #fff; border: 1px solid #f0d9a8;
    border-radius: 10px; margin-bottom: 10px; padding: 12px;
    overflow-x: auto; overflow-y: visible;
    -webkit-overflow-scrolling: touch;
}
.rt-team-canvas::-webkit-scrollbar { height: 8px; }
.rt-team-canvas::-webkit-scrollbar-track { background: #fbf7f0; border-radius: 4px; }
.rt-team-canvas::-webkit-scrollbar-thumb { background: #d4af8a; border-radius: 4px; }

.rt-tree { display: inline-flex; align-items: flex-start; min-width: 100%; padding: 8px 4px; }
.rt-node-wrap { display: inline-flex; align-items: center; flex-shrink: 0; }

.rt-node {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 8px 12px; background: #fff;
    border: 1.5px solid #e8d4a8; border-radius: 8px;
    font-size: 12px; font-weight: 700; color: #5a3a20;
    white-space: nowrap; cursor: pointer; transition: all 0.15s;
    box-shadow: 0 1px 3px rgba(201,168,106,0.1);
    position: relative; flex-shrink: 0;
    /* [hotfix 2026-04-30l] 터치 300ms 딜레이 제거 + 스크롤과 탭 분리 */
    touch-action: manipulation;
}
.rt-node:hover {
    border-color: #c9a86a; background: #fffdf6;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(201,168,106,0.2);
}
.rt-node.leader {
    background: linear-gradient(135deg, #fff4d9, #fff8ec);
    border-color: #d4a04a; font-weight: 800;
}
.rt-node.inactive { opacity: 0.5; }
.rt-node.inactive::after {
    content: 'OFF'; font-size: 8px; color: #c9534a;
    background: #fee; padding: 1px 5px; border-radius: 4px;
    margin-left: 4px;
}
.rt-node-avatar {
    width: 20px; height: 20px; border-radius: 50%;
    background: linear-gradient(135deg, #f0d9a8, #e8c48e);
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 9px; font-weight: 800; color: #fff; flex-shrink: 0;
}
.rt-node.leader .rt-node-avatar {
    background: linear-gradient(135deg, #f0c674, #d4a04a);
}
.rt-node-level {
    font-size: 8px; color: #b8956a;
    background: #fff8ec; padding: 1px 5px;
    border-radius: 6px; font-weight: 700;
}
.rt-node-score {
    font-size: 8px; font-weight: 800;
    background: linear-gradient(135deg, #c9e4c9, #a8d4a8);
    color: #2a5a2a; padding: 1px 5px; border-radius: 6px;
}

.rt-children { display: inline-flex; flex-direction: column; flex-shrink: 0; position: relative; }
.rt-branch { display: inline-flex; align-items: center; padding: 5px 0; position: relative; }
.rt-connector { width: 28px; height: 2px; background: #d4af8a; flex-shrink: 0; }
.rt-children.multi::before {
    content: ''; position: absolute; left: 0;
    top: calc(5px + 17px); bottom: calc(5px + 17px);
    width: 2px; background: #d4af8a;
}

/* ─── 편집 모드 버튼 ─── */
.rt-node-actions { display: none; margin-left: 6px; gap: 4px; }
.rt-tree.editing .rt-node-actions { display: inline-flex; }
.rt-btn-icon {
    width: 22px; height: 22px; border-radius: 50%;
    border: none; cursor: pointer;
    font-size: 13px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    transition: transform 0.1s;
}
.rt-btn-icon:hover { transform: scale(1.15); }
.rt-btn-add { background: #6a9e6e; color: #fff; }
.rt-btn-del { background: #c9534a; color: #fff; }

.rt-edit-hint {
    font-size: 10px; color: #8a6a4a;
    background: #fff8ec; border: 1px dashed #d4a04a;
    border-radius: 6px; padding: 6px 10px; margin-bottom: 8px;
}
.rt-tree-empty { color: #a88e70; font-size: 11px; font-style: italic; padding: 8px 4px; }

/* ═══════════════════════════════════════════════
   L4: 프로필 + 활동점수 확장 모달 (모바일 우선)
   ═══════════════════════════════════════════════ */
.rt-modal-overlay {
    display: none; position: fixed; inset: 0;
    background: rgba(40,30,20,0.55);
    z-index: 10000;
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    /* ★ [STUDY 2026-05-03b] overlay 배경 스크롤 차단 — 모달 내부만 스크롤 */
    overscroll-behavior: none;
    touch-action: none;
}
.rt-modal-overlay.show {
    display: flex;
    animation: rtFadeIn 0.2s ease;
}
@keyframes rtFadeIn { from {opacity:0;} to {opacity:1;} }
@keyframes rtSlideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}
.rt-modal {
    background: #fff;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 560px;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: 0 -8px 40px rgba(0,0,0,0.3);
    animation: rtSlideUp 0.25s ease;
    /* ★ [STUDY 2026-05-03b] 모달 내부 터치/wheel 스크롤 허용 */
    touch-action: pan-y;
    overscroll-behavior: contain;
}
@media (min-width: 768px) {
    .rt-modal-overlay { align-items: center; padding: 16px; }
    .rt-modal { border-radius: 18px; max-width: 640px; }
}

.rt-modal-head {
    padding: 18px 20px;
    background: linear-gradient(135deg, #fff8ec, #fff4d9);
    border-bottom: 1px solid #f0d9a8;
    position: sticky; top: 0; z-index: 2;
}
.rt-modal-grab {
    width: 40px; height: 4px;
    background: #d4af8a; border-radius: 2px;
    margin: 0 auto 10px;
}
@media (min-width: 768px) { .rt-modal-grab { display: none; } }
/* ★ [STUDY 2026-05-03] 헤더 제목 행 2행 → 1행: align-items center + 이름/역할 한 행 */
.rt-modal-title-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px;
}
.rt-modal-name {
    font-size: 17px; font-weight: 800; color: #5a3a20;
    display: flex; align-items: center; gap: 6px; flex-wrap: nowrap;
    min-width: 0;
}
.rt-modal-name-avatar {
    width: 30px; height: 30px; border-radius: 50%;
    background: linear-gradient(135deg, #f0c674, #d4a04a);
    color: #fff; font-size: 12px; font-weight: 800;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
/* 역할 배지: 이름 오른쪽에 인라인으로 — 2행 제거 */
.rt-modal-role {
    font-size: 10px; color: #8a6a4a; margin-top: 0;
    display: flex; gap: 5px; align-items: center; flex-wrap: nowrap;
}
.rt-modal-role-badge {
    background: #fff; border: 1px solid #d4a04a;
    color: #8a5a20; padding: 1px 7px;
    border-radius: 8px; font-weight: 700;
}
.rt-modal-close {
    width: 32px; height: 32px; border: none;
    background: rgba(255,255,255,0.9);
    border-radius: 50%; font-size: 17px;
    color: #8a6a4a; cursor: pointer;
    display: inline-flex; align-items: center; justify-content: center;
    flex-shrink: 0;
}
/* ★ [STUDY 2026-04-26] 헤더 저장 버튼 — edit 탭 + 권한 있을 때만 노출 */
.rt-modal-save-btn {
    padding: 5px 14px;
    background: linear-gradient(135deg, #f0c674, #d4a04a);
    color: #fff; border: none; border-radius: 16px;
    font-size: 12px; font-weight: 800;
    cursor: pointer; font-family: inherit;
    flex-shrink: 0;
    transition: transform 0.1s, opacity 0.1s;
}
.rt-modal-save-btn:hover { transform: translateY(-1px); opacity: 0.9; }

/* ─── 탭 (요약 / 편집 / 기능) ─── */
.rt-modal-tabs {
    display: flex;
    border-bottom: 1px solid #f0d9a8;
    background: #fffdf6;
    position: sticky; top: 0; z-index: 1;
}
.rt-modal-tab {
    flex: 1; padding: 12px 8px;
    border: none; background: none;
    font-size: 12px; font-weight: 700; color: #a08670;
    cursor: pointer; position: relative;
    font-family: inherit;
}
.rt-modal-tab.active { color: #8a5a20; }
.rt-modal-tab.active::after {
    content: ''; position: absolute;
    bottom: 0; left: 0; right: 0; height: 3px;
    background: linear-gradient(90deg, #f0c674, #d4a04a);
}

.rt-modal-body { padding: 16px 20px 20px; }
.rt-tab-panel { display: none; }
.rt-tab-panel.active { display: block; animation: rtFadeIn 0.15s ease; }

/* ─── 활동점수 바 ─── */
.rt-score-section {
    background: #fffdf6;
    border: 1px solid #f0d9a8;
    border-radius: 12px;
    padding: 14px 16px;
    margin-bottom: 12px;
}
.rt-score-title {
    font-size: 11px; font-weight: 800;
    color: #8a5a20; margin-bottom: 10px;
    letter-spacing: 0.04em; display: flex;
    align-items: center; justify-content: space-between;
}
.rt-score-total {
    font-size: 14px; font-weight: 800;
    color: #6a4a20;
}
.rt-score-item { margin-bottom: 10px; }
.rt-score-item:last-child { margin-bottom: 0; }
.rt-score-lbl {
    display: flex; justify-content: space-between;
    font-size: 11px; color: #5a3a20;
    margin-bottom: 4px; font-weight: 700;
}
.rt-score-num {
    font-size: 12px; font-weight: 800; color: #8a5a20;
}
.rt-score-bar {
    width: 100%; height: 10px;
    background: #f5ecdf; border-radius: 5px;
    overflow: hidden; position: relative;
}
.rt-score-fill {
    height: 100%; border-radius: 5px;
    transition: width 0.4s ease;
}
.rt-score-fill.study {
    background: linear-gradient(90deg, #a8d4a8, #6a9e6e);
}
.rt-score-fill.promo {
    background: linear-gradient(90deg, #f0c674, #d4a04a);
}

/* ─── 프로필 정보 리스트 ─── */
.rt-info-list {
    background: #fffdf6;
    border: 1px solid #f0d9a8;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}
.rt-info-row {
    display: flex; gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px solid #f5ecdf;
    font-size: 12px;
}
.rt-info-row:last-child { border-bottom: none; }
.rt-info-label {
    min-width: 70px; color: #a08670;
    font-weight: 700;
}
.rt-info-val { flex: 1; color: #5a3a20; word-break: break-all; }
.rt-info-val.empty { color: #c9b89a; font-style: italic; }

/* ─── 편집 폼 ─── */
.rt-form-group { margin-bottom: 12px; }
.rt-form-label {
    font-size: 11px; font-weight: 700;
    color: #8a5a20; margin-bottom: 5px;
    letter-spacing: 0.02em;
}
.rt-form-input, .rt-form-textarea {
    width: 100%; padding: 9px 12px;
    border: 1.5px solid #e8d4a8;
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    color: #3a2a10;
    background: #fffdf6;
    transition: border-color 0.15s;
}
.rt-form-input:focus, .rt-form-textarea:focus {
    outline: none; border-color: #d4a04a;
    background: #fff;
}
.rt-form-textarea { resize: vertical; min-height: 60px; }
.rt-form-row-2 {
    display: grid; grid-template-columns: 1fr 1fr;
    gap: 8px;
}
.rt-form-row-2 .rt-form-input { font-size: 12px; }

.rt-toggle-row {
    display: flex; align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    background: #fffdf6;
    border: 1px solid #f0d9a8;
    border-radius: 10px;
    margin-bottom: 12px;
}
.rt-toggle-lbl {
    font-size: 13px; font-weight: 700; color: #5a3a20;
}
.rt-toggle-sub {
    font-size: 10px; color: #a08670; margin-top: 2px;
}
.rt-toggle {
    position: relative; width: 44px; height: 24px;
    background: #e8d4a8; border-radius: 12px;
    cursor: pointer; transition: background 0.2s;
    flex-shrink: 0;
}
.rt-toggle.on { background: linear-gradient(135deg, #f0c674, #d4a04a); }
.rt-toggle::after {
    content: ''; position: absolute;
    top: 2px; left: 2px;
    width: 20px; height: 20px;
    background: #fff; border-radius: 50%;
    transition: transform 0.2s;
    box-shadow: 0 1px 3px rgba(0,0,0,0.2);
}
.rt-toggle.on::after { transform: translateX(20px); }

/* ★ [STUDY 2026-05-03] 저장 버튼 sticky — 화면 크기 무관하게 항상 보임 */
.rt-form-save-btn {
    width: 100%; padding: 12px;
    background: linear-gradient(135deg, #f0c674, #d4a04a);
    color: #fff; border: none; border-radius: 10px;
    font-size: 14px; font-weight: 800;
    cursor: pointer; font-family: inherit;
    transition: transform 0.1s;
    /* sticky 고정 — 모달 하단에 항상 노출 */
    position: sticky; bottom: 0; z-index: 5;
    box-shadow: 0 -3px 12px rgba(212,160,74,0.25);
    margin-top: 6px;
}
.rt-form-save-btn:active { transform: scale(0.98); }

/* ─── 후원인/추천인 한 행 레이아웃 ─── */
.rt-relation-row-wrap {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
}
.rt-relation-col {
    flex: 1;
    min-width: 0;
}
.rt-relation-col .rt-relation-block {
    margin-bottom: 0;
}

/* ─── 후원인/추천인 블록 ─── */
.rt-relation-block {
    background: #fffdf6;
    border: 1.5px solid #f0d9a8;
    border-radius: 10px;
    padding: 10px 12px;
    margin-bottom: 10px;
}
.rt-relation-title {
    font-size: 12px; font-weight: 800;
    color: #8a5a20;
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}
.rt-relation-hint {
    font-size: 10px; font-weight: 600;
    color: #a08670;
    margin-left: 4px;
}
.rt-rel-select {
    padding: 9px 10px;
    border: 1.5px solid #e8d4a8;
    border-radius: 8px;
    font-size: 12px;
    background: #fff;
    color: #5a3a20;
    font-family: inherit;
    cursor: pointer;
}
.rt-rel-select:focus {
    outline: none;
    border-color: #d4a04a;
}
@media (max-width: 480px) {
    .rt-relation-row-wrap {
        flex-direction: column;
        gap: 0;
    }
    .rt-relation-col .rt-relation-block {
        margin-bottom: 10px;
    }
}

/* ─── 회원정보 탭 연필 버튼 ─── */
.rt-pencil {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px; height: 22px;
    margin-left: 4px;
    border-radius: 50%;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    vertical-align: middle;
}
.rt-pencil:hover {
    background: #a5d6a7;
    transform: scale(1.12);
}
.rt-pencil.on {
    background: #ffcdd2;
    color: #c62828;
}
.rt-form-save-btn:hover { transform: translateY(-1px); }

/* ─── [2026-04-30m] 모달 헤더 편집 버튼 — 메인 rt-edit-icon-btn 동일 톤 ─── */
.rt-modal-edit-hdr-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 28px;
    padding: 0 10px;
    border: 1.5px solid #059669;
    border-radius: 8px;
    background: #10b981;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    box-shadow: 0 1px 4px rgba(16,185,129,0.25);
    transition: background 0.15s, box-shadow 0.15s;
}
.rt-modal-edit-hdr-btn:hover {
    background: #059669;
    border-color: #047857;
    box-shadow: 0 2px 7px rgba(5,150,105,0.30);
}
.rt-modal-edit-hdr-btn.active {
    background: #065f46;
    border-color: #047857;
    color: #a7f3d0;
    box-shadow: 0 1px 3px rgba(6,95,70,0.20);
}
.rt-modal-edit-hdr-btn.active:hover {
    background: #047857;
    color: #d1fae5;
}
@media (max-width: 768px) {
    .rt-modal-edit-hdr-btn span { display: none; }
    .rt-modal-edit-hdr-btn { width: 28px; padding: 0; justify-content: center; }
}

/* ★ [STUDY 2026-05-03] 활동점수 2행 → 1행: 두 rt-score-edit-row를 flex 한 줄로 */
/* 부모 .rt-form-group에 display:flex를 주고 두 row를 나란히 배치 */
.rt-score-edit-rows-wrap {
    display: flex; gap: 8px; align-items: center; flex-wrap: nowrap;
}
.rt-score-edit-row {
    display: flex; align-items: center; gap: 4px;
    flex: 1; min-width: 0;
}
.rt-score-edit-lbl {
    font-size: 11px; font-weight: 700; color: #5a3a20;
    flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.rt-score-plus {
    padding: 5px 8px; font-size: 11px; font-weight: 700;
    background: #6a9e6e; color: #fff; border: none;
    border-radius: 6px; cursor: pointer; flex-shrink: 0;
}
.rt-score-minus {
    padding: 5px 8px; font-size: 11px; font-weight: 700;
    background: #c9534a; color: #fff; border: none;
    border-radius: 6px; cursor: pointer; flex-shrink: 0;
}

/* ─── 기능 버튼 그리드 ─── */
.rt-modal-slots {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}
.rt-slot-btn {
    padding: 14px 10px;
    border: 1.5px solid #e8d4a8;
    border-radius: 12px;
    background: #fffdf6;
    cursor: pointer;
    text-align: center;
    font-family: inherit;
    transition: all 0.15s;
    position: relative;
}
.rt-slot-btn:hover:not(.disabled) {
    border-color: #c9a86a;
    background: #fff4d9;
    transform: translateY(-1px);
    box-shadow: 0 3px 8px rgba(201,168,106,0.2);
}
.rt-slot-ic {
    font-size: 20px; display: block; margin-bottom: 4px;
}
.rt-slot-btn-label { font-size: 12px; font-weight: 800; color: #5a3a20; }
.rt-slot-btn-sub { font-size: 9px; color: #a08670; margin-top: 2px; }
.rt-slot-btn.disabled { opacity: 0.5; cursor: not-allowed; }
.rt-slot-btn.unlocked::after {
    content: '팀장'; position: absolute;
    top: 6px; right: 6px; font-size: 8px;
    background: linear-gradient(135deg, #f0c674, #d4a04a);
    color: #fff; padding: 1px 6px;
    border-radius: 6px; font-weight: 800;
}

/* ─── 창고 용량 미리보기 ─── */
.rt-storage-preview {
    margin-top: 12px; padding: 12px 14px;
    background: #fffdf6; border: 1px solid #f0d9a8;
    border-radius: 10px;
}
.rt-storage-lbl {
    font-size: 11px; font-weight: 700; color: #8a5a20;
    display: flex; justify-content: space-between;
    margin-bottom: 5px;
}
.rt-storage-bar {
    width: 100%; height: 6px; background: #f5ecdf;
    border-radius: 3px; overflow: hidden;
}
.rt-storage-fill {
    height: 100%;
    background: linear-gradient(90deg, #a8d4a8, #6a9e6e);
}
.rt-storage-fill.full {
    background: linear-gradient(90deg, #f0a874, #d48a4a);
}

.rt-empty { padding: 30px 16px; text-align: center; color: #a88e70; font-size: 12px; }

/* ═══════════════════════════════════════════════
   모바일 최적화
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    .rt-hdr-title { font-size: 13px; }
    .rt-hdr-stat { font-size: 9px; padding: 2px 6px; }
    .rt-region-head { padding: 8px 10px; }
    .rt-region-name { font-size: 12px; }
    .rt-region-count { font-size: 9px; padding: 2px 8px; }
    .rt-region-name-wrap { padding: 10px 12px; min-height: 44px; }
    .rt-region-body { padding: 8px; }
    .rt-team-canvas { padding: 8px; }
    .rt-node { padding: 6px 9px; font-size: 11px; gap: 4px; }
    .rt-node-avatar { width: 17px; height: 17px; font-size: 8px; }
    .rt-node-level { font-size: 7px; padding: 1px 4px; }
    .rt-node-score { font-size: 7px; padding: 1px 4px; }
    .rt-connector { width: 20px; }
    .rt-btn-icon { width: 20px; height: 20px; font-size: 11px; }
    .rt-modal-tab { font-size: 11px; padding: 10px 6px; }
    .rt-modal-name { font-size: 17px; }
    .rt-modal-name-avatar { width: 30px; height: 30px; font-size: 12px; }
    .rt-modal-body {
        padding: 14px 16px 18px;
        /* ★ [2026-04-27w] 모바일 wheelscape — 부드러운 모멘텀 스크롤 */
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
    .rt-slot-btn { padding: 12px 8px; }
    .rt-slot-ic { font-size: 18px; }
    .rt-slot-btn-label { font-size: 11px; }
    /* ★ [2026-04-27w] iOS Safari zoom 방지 — font-size 16px 필수 (12px이면 자동 zoom 유발) */
    .rt-form-input, .rt-form-textarea { font-size: 16px; padding: 12px 14px; }
    /* ★ [2026-04-27w] 폼 행 스크롤 스냅 — 다음 input이 시작 위치에 걸림 */
    .rt-form-group, .rt-relation-block {
        scroll-snap-align: start;
        scroll-margin-top: 56px; /* 모달 헤더 높이만큼 여백 */
    }
    .rt-info-row { padding: 8px 12px; font-size: 11px; }
    .rt-info-label { min-width: 60px; }
}
@media (max-width: 480px) {
    .rt-node { padding: 5px 8px; font-size: 10px; }
    .rt-node-avatar { width: 15px; height: 15px; font-size: 7px; }
    .rt-connector { width: 16px; }
    .rt-modal-head { padding: 14px 16px; }
    .rt-modal-name { font-size: 16px; }
}

/* 지역 헤더 기능 버튼 - 임무 B: 이름+버튼이 왼쪽 그룹으로 자연스럽게 붙음 */
.rt-region-head {
    gap: 10px; row-gap: 6px;
    flex-wrap: wrap;
    /* justify-content 없음 - 이름+버튼이 왼쪽 정렬로 함께 위치 */
}
/* ★ [LEAD 2026-04-26] 지역+인원 박스 — 파스텔 라벤더+핑크 그라디언트 강조 */
.rt-region-name-wrap {
    display: flex; align-items: center; gap: 10px;
    min-width: 0; flex-shrink: 0;
    cursor: pointer;
    padding: 10px 16px;
    border-radius: 14px;
    /* 파스텔 라벤더(#B8A6E8) → 핑크(#FFC4D1) 그라디언트 */
    background: linear-gradient(135deg, rgba(184, 166, 232, 0.18) 0%, rgba(255, 196, 209, 0.22) 100%);
    border: 1.5px solid rgba(184, 166, 232, 0.45);
    box-shadow: 0 2px 10px rgba(184, 166, 232, 0.18);
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: rgba(184, 166, 232, 0.35);
    position: relative;
}
.rt-region-name-wrap::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 14px;
    pointer-events: none;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.55);
}
.rt-region-name-wrap:hover {
    background: linear-gradient(135deg, rgba(184, 166, 232, 0.32) 0%, rgba(255, 196, 209, 0.36) 100%);
    border-color: rgba(184, 166, 232, 0.65);
    box-shadow: 0 4px 16px rgba(184, 166, 232, 0.32);
    transform: translateY(-1px);
}
.rt-region-name-wrap:active {
    transform: scale(0.98) translateY(0);
    background: linear-gradient(135deg, rgba(184, 166, 232, 0.4) 0%, rgba(255, 196, 209, 0.44) 100%);
    box-shadow: 0 2px 6px rgba(184, 166, 232, 0.2);
}
.rt-region-actions {
    display: flex; align-items: center; gap: 4px;
    flex-shrink: 0;
    /* margin-left: auto 없음 - 이름 옆에 자연스럽게 붙음 */
}
.rt-region-divider {
    width: 1px; height: 18px;
    background: rgba(155,142,132,0.35);
    margin: 0 4px;
}
.rt-region-btn {
    display: inline-flex; align-items: center; gap: 3px;
    padding: 4px 8px; border: 1px solid rgba(155,142,132,0.3);
    background: rgba(255,255,255,0.7); border-radius: 6px;
    font-size: 11px; color: #8a7a6d; cursor: pointer;
    transition: all 0.15s; white-space: nowrap;
}
.rt-region-btn:hover { background: #fff; border-color: #B8956A; color: #8a6a4a; }
.rt-region-btn-icon { font-size: 12px; }
.rt-region-btn.disabled { opacity: 0.5; cursor: not-allowed; }
/* 태블릿/소형 PC */
@media (max-width: 768px) {
    .rt-region-btn { padding: 3px 7px; font-size: 10px; }
    .rt-region-btn-label { font-size: 10px; }
}
/* 모바일 */
@media (max-width: 480px) {
    .rt-region-head { gap: 6px; }
    .rt-region-btn { padding: 3px 6px; font-size: 10px; gap: 2px; }
    .rt-region-btn-label { display: none; }   /* 아이콘만 표시 */
    .rt-region-divider { margin: 0 2px; height: 14px; }
}

/* ─── 동의서 배지 (진입 강제 모달로 대체됨, 2026-04-26 숨김) ─── */
.rt-consent-badge {
    display: none !important; /* [LEAD 2026-04-26] 배지 제거 — 진입 강제 모달로 대체 */
    align-items: center;
    gap: 5px;
    padding: 5px 10px;
    border: 1.5px solid #c9a227;
    border-radius: 6px;
    background: #fff8e1;
    cursor: pointer;
    font-size: 11px;
    font-weight: 700;
    color: #7a5b00;
    white-space: nowrap;
    transition: background 0.15s, border-color 0.15s;
    flex-shrink: 0;
}
.rt-consent-badge:hover {
    background: #fff1c2;
}
.rt-consent-badge[data-consented="true"] {
    border-color: #10b981;
    background: #e6fbf1;
    color: #065f46;
}
.rt-consent-badge[data-consented="false"] {
    animation: rt-consent-pulse 2s ease-in-out infinite;
}
@keyframes rt-consent-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(201, 162, 38, 0); }
    50%       { box-shadow: 0 0 8px 2px rgba(201, 162, 38, 0.45); }
}
.rt-consent-icon { font-size: 13px; }
.rt-consent-label { font-size: 11px; font-weight: 700; }
.rt-consent-status { font-size: 10px; font-weight: 600; }
.rt-consent-badge[data-consented="true"] .rt-consent-status::before { content: '\2713\0020'; }

/* 모바일: 레이블 숨김 (아이콘 + 상태만) */
@media (max-width: 480px) {
    .rt-consent-badge { padding: 4px 7px; gap: 3px; font-size: 10px; }
    .rt-consent-label { display: none; }
}

/* 팀장/팀원 선택 트리 모달 (v4 — 다단계 트리 + 개별권한) */
.rt-leader-pick-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.40); display: none; align-items: center; justify-content: center; z-index: 10002; padding: 12px; }
.rt-leader-pick-overlay.active { display: flex; }

/* 모달 패널 — 모바일 95vw / PC 600px */
.rt-leader-pick-panel {
    background: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 600px;
    max-height: 82vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 40px rgba(0,0,0,0.22);
    overflow: hidden;
}
@media (max-width: 640px) {
    .rt-leader-pick-panel { max-width: 95vw; max-height: 80vh; }
}

/* 모달 헤더 */
.rt-pick-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px 10px;
    border-bottom: 1px solid rgba(184,166,232,0.25);
    flex-shrink: 0;
}
.rt-pick-header-title {
    font-size: 15px;
    font-weight: 700;
    color: #3D2E5C;
}
.rt-pick-header-sub {
    font-size: 11px;
    color: #9B8AC5;
    margin-top: 2px;
}
.rt-pick-close-btn {
    width: 28px; height: 28px;
    border: none; background: #f0edf9;
    border-radius: 50%; cursor: pointer;
    font-size: 14px; color: #6a5a8a;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
}
.rt-pick-close-btn:hover { background: #ddd5f5; }

/* 스크롤 가능 본문 */
.rt-pick-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px 14px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* 팀 섹션 카드 */
.rt-pick-team-card {
    border: 1.5px solid rgba(184,166,232,0.35);
    border-radius: 12px;
    overflow: hidden;
}

/* 팀장 행 */
.rt-pick-leader-row {
    display: flex;
    align-items: center;
    padding: 10px 14px;
    background: linear-gradient(135deg, #EDE8F8 0%, #FFF0F5 100%);
    cursor: pointer;
    transition: background 0.15s;
    gap: 8px;
}
.rt-pick-leader-row:hover { background: linear-gradient(135deg, #DDD5F5 0%, #FFE0EA 100%); }
.rt-pick-leader-row.disabled { opacity: 0.5; cursor: not-allowed; }

/* 자식 노드 행 */
.rt-pick-member-row {
    display: flex;
    align-items: center;
    padding: 8px 14px;
    border-top: 1px solid rgba(184,166,232,0.15);
    background: #fdfbff;
    cursor: pointer;
    transition: background 0.15s;
    gap: 8px;
}
.rt-pick-member-row:hover { background: #f3f0fc; }
.rt-pick-member-row.disabled { opacity: 0.45; cursor: not-allowed; }
.rt-pick-member-row.no-perm { background: #f8f8f8; cursor: not-allowed; }
.rt-pick-member-row.no-perm:hover { background: #f2f2f2; }

/* 들여쓰기 (depth 1=20px, 2=40px, 3=60px) */
.rt-pick-indent { display: inline-block; flex-shrink: 0; }

/* 이름/역할 */
.rt-pick-name { font-size: 13px; font-weight: 600; color: #3D2E5C; flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rt-pick-role { font-size: 10px; color: #9B8AC5; white-space: nowrap; }
.rt-pick-badge-leader { font-size: 10px; background: #D4AF37; color: #fff; padding: 1px 6px; border-radius: 10px; white-space: nowrap; }

/* 상태 배지 */
.rt-pick-status { font-size: 10px; padding: 2px 7px; border-radius: 10px; white-space: nowrap; }
.rt-pick-status.ok     { background: #e8f5e9; color: #2e7d32; }
.rt-pick-status.warn   { background: #fff8e1; color: #e65100; }
.rt-pick-status.denied { background: #f5f5f5; color: #9e9e9e; }

/* 권한 토글 (팀장/운영자만 보임) */
.rt-pick-perm-wrap { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.rt-pick-perm-btn {
    font-size: 10px;
    padding: 2px 7px;
    border-radius: 8px;
    border: 1px solid rgba(155,138,197,0.4);
    cursor: pointer;
    background: #f0edf9;
    color: #6a5a8a;
    transition: all 0.15s;
    white-space: nowrap;
}
.rt-pick-perm-btn:hover { background: #ddd5f5; }
.rt-pick-perm-btn.on  { background: #e8f5e9; border-color: #4caf50; color: #2e7d32; }
.rt-pick-perm-btn.off { background: #ffeaea; border-color: #ef9a9a; color: #c62828; }

/* 세로 라인 (트리 인디케이터) */
.rt-pick-tree-line {
    display: inline-block;
    width: 2px;
    align-self: stretch;
    background: linear-gradient(180deg, #B8A6E8 0%, #FFC4D1 100%);
    border-radius: 2px;
    flex-shrink: 0;
    min-height: 18px;
}

/* 푸터 */
.rt-pick-footer {
    padding: 10px 14px;
    border-top: 1px solid rgba(184,166,232,0.2);
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
}
.rt-pick-cancel-btn {
    padding: 8px 20px;
    background: #f0ede6;
    border: none;
    border-radius: 10px;
    font-size: 12px;
    color: #6a5a4a;
    cursor: pointer;
    transition: background 0.15s;
}
.rt-pick-cancel-btn:hover { background: #e0dbd4; }

/* 레거시 호환 (기존 단순 리스트 스타일 유지) */
.rt-leader-pick-title { font-size: 14px; font-weight: 600; color: #6a5a4a; margin-bottom: 10px; }
.rt-leader-pick-list { display: flex; flex-direction: column; gap: 6px; }
.rt-leader-pick-item { padding: 10px 12px; border: 1px solid rgba(155,142,132,0.25); border-radius: 8px; cursor: pointer; font-size: 13px; color: #6a5a4a; background: #fafaf6; transition: all 0.15s; }
.rt-leader-pick-item:hover { background: #fff; border-color: #B8956A; }
.rt-leader-pick-close { margin-top: 10px; width: 100%; padding: 8px; background: #f0ede6; border: none; border-radius: 8px; font-size: 12px; color: #8a7a6d; cursor: pointer; }

/* 팀 잔소리 모달 */
.rt-jansori-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; align-items: center; justify-content: center; z-index: 10003; padding: 16px; }
.rt-jansori-overlay.active { display: flex; }
.rt-jansori-panel { background: #fff; border-radius: 14px; padding: 20px; max-width: 420px; width: 100%; max-height: 90vh; overflow-y: auto; }
.rt-jansori-title { font-size: 15px; font-weight: 600; color: #6a5a4a; margin-bottom: 12px; }
.rt-jansori-textarea { width: 100%; min-height: 90px; padding: 10px; border: 1px solid rgba(155,142,132,0.3); border-radius: 8px; font-size: 13px; font-family: inherit; resize: vertical; box-sizing: border-box; }
.rt-jansori-members { margin: 12px 0; padding: 10px; background: #faf8f3; border-radius: 8px; max-height: 150px; overflow-y: auto; }
.rt-jansori-member { display: flex; align-items: center; gap: 8px; padding: 4px 0; font-size: 12px; color: #6a5a4a; }
.rt-jansori-member input[type=checkbox] { margin: 0; }
.rt-jansori-member-meta { color: #a08670; font-size: 11px; }
.rt-jansori-channels { display: flex; gap: 6px; margin-top: 8px; flex-wrap: wrap; }
.rt-jansori-ch-btn { flex: 1; min-width: 70px; padding: 8px; border: 1px solid rgba(155,142,132,0.3); background: #fff; border-radius: 8px; font-size: 12px; color: #6a5a4a; cursor: pointer; }
.rt-jansori-ch-btn:hover { background: #f5ede5; border-color: #B8956A; }
.rt-jansori-close { width: 100%; margin-top: 10px; padding: 8px; background: #f0ede6; border: none; border-radius: 8px; font-size: 12px; color: #8a7a6d; cursor: pointer; }

/* 팀채팅 "준비 중" 모달 */
.rt-teamchat-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.4); display: none; align-items: center; justify-content: center; z-index: 10003; padding: 16px; }
.rt-teamchat-overlay.active { display: flex; }
.rt-teamchat-panel { background: #fff; border-radius: 14px; padding: 24px; max-width: 340px; text-align: center; }
.rt-teamchat-icon { font-size: 36px; margin-bottom: 10px; }
.rt-teamchat-title { font-size: 15px; font-weight: 600; color: #6a5a4a; margin-bottom: 8px; }
.rt-teamchat-text { font-size: 12px; color: #8a7a6d; line-height: 1.6; }
.rt-teamchat-close { margin-top: 14px; padding: 8px 24px; background: #B8956A; color: #fff; border: none; border-radius: 8px; font-size: 12px; cursor: pointer; }

/* 실시간 팀채팅 모달 v2.0 — 핀룸 탭 지원 */
.rt-chat-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: none; align-items: center; justify-content: center; z-index: 10004; padding: 12px; }
.rt-chat-overlay.active { display: flex; }
.rt-chat-panel { background: #fff; border-radius: 14px; width: 100%; max-width: 440px; height: 80vh; max-height: 640px; display: flex; flex-direction: column; overflow: hidden; }
.rt-chat-header { padding: 14px 16px; border-bottom: 1px solid rgba(155,142,132,0.2); display: flex; align-items: center; justify-content: space-between; background: #faf8f3; }
.rt-chat-title-wrap { min-width: 0; flex: 1; }
.rt-chat-title { font-size: 14px; font-weight: 600; color: #6a5a4a; margin-bottom: 2px; }
.rt-chat-status { font-size: 10px; color: #a08670; }
.rt-chat-status.ok { color: #6a9e6e; }
.rt-chat-status.warn { color: #c9a04a; }
.rt-chat-status.error { color: #c9534a; }
.rt-chat-close-btn { width: 28px; height: 28px; border: none; background: transparent; font-size: 18px; color: #8a7a6d; cursor: pointer; border-radius: 50%; flex-shrink: 0; }
.rt-chat-close-btn:hover { background: rgba(0,0,0,0.06); }

/* 룸 탭바 (메인룸 + 핀룸들) */
.rt-chat-roomtabs { display: flex; gap: 4px; padding: 6px 12px; background: #f5f0e8; border-bottom: 1px solid rgba(155,142,132,0.15); overflow-x: auto; flex-shrink: 0; }
.rt-chat-roomtabs::-webkit-scrollbar { height: 3px; }
.rt-chat-roomtabs::-webkit-scrollbar-thumb { background: rgba(155,142,132,0.3); border-radius: 2px; }
.rt-chat-roomtab { padding: 4px 12px; border-radius: 12px; font-size: 11px; font-weight: 500; cursor: pointer; border: 1px solid rgba(155,142,132,0.25); background: #fff; color: #8a7a6d; white-space: nowrap; transition: all 0.2s; }
.rt-chat-roomtab:hover { border-color: #B8956A; color: #B8956A; }
.rt-chat-roomtab.active { background: #B8956A; color: #fff; border-color: #B8956A; }
.rt-chat-roomtab.pinroom { padding-left: 8px; }
.rt-chat-roomtab.pinroom::before { content: '\25CE'; margin-right: 4px; font-size: 10px; }

/* 핀룸 뱃지 (메인룸 탭에 핀룸 수 표시) */
.rt-chat-pin-badge { display: inline-block; margin-left: 4px; background: #e8a060; color: #fff; border-radius: 8px; font-size: 9px; padding: 0 5px; vertical-align: middle; }

/* 메시지 영역 */
.rt-chat-messages { flex: 1; overflow-y: auto; padding: 12px 16px; background: #fdfcfa; display: flex; flex-direction: column; gap: 10px; }
.rt-chat-loading, .rt-chat-empty { text-align: center; color: #a08670; font-size: 12px; padding: 20px 0; }

/* ★ [STUDY 2026-04-27n] 메시지 wrap — 핀셋 버튼 포함 */
.rt-chat-msg-wrap { position: relative; display: flex; flex-direction: column; align-self: flex-start; margin: 2px 0; }
.rt-chat-msg-wrap.mine { align-self: flex-end; }

/* 핀셋 버튼 — 메시지 좌상단 (mine은 우상단) */
.rt-chat-pin-btn {
    position: absolute;
    top: -8px;
    left: -8px;
    z-index: 5;
    width: 28px;
    height: 28px;
    border: none;
    background: linear-gradient(135deg, #FFB74D 0%, #FFA726 100%);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(255,152,0,0.4);
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.2s, transform 0.2s;
    padding: 0;
}
.rt-chat-pin-btn svg { width: 14px; height: 14px; pointer-events: none; }
.rt-chat-msg-wrap:hover .rt-chat-pin-btn { opacity: 1; transform: scale(1); }
.rt-chat-pin-btn:hover { transform: scale(1.15) !important; box-shadow: 0 4px 10px rgba(255,152,0,0.55); }
.rt-chat-msg-wrap.is-pinned .rt-chat-pin-btn { opacity: 1; transform: scale(1); background: linear-gradient(135deg, #FF7043 0%, #F4511E 100%); }
.rt-chat-msg-wrap.mine .rt-chat-pin-btn { left: auto; right: -8px; }

/* 메시지 버블 */
.rt-chat-msg { max-width: 78%; display: flex; flex-direction: column; align-self: flex-start; position: relative; }
.rt-chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.rt-chat-msg-name { font-size: 11px; color: #a08670; margin-bottom: 2px; padding-left: 2px; }
/* 상대방 메시지: 라벤더/핑크 그라디언트 (기존 유지) */
.rt-chat-msg-bubble { padding: 8px 12px; background: #f0ede6; color: #3a3028; font-size: 13px; border-radius: 14px 14px 14px 4px; word-break: break-word; white-space: pre-wrap; line-height: 1.4; cursor: context-menu; }
/* ★ 내 메시지: 흰색 배경 + 검은 글씨 */
.rt-chat-msg.mine .rt-chat-msg-bubble { background: #ffffff; color: #1a1a2e; border: 1px solid rgba(155,142,132,0.25); border-radius: 14px 14px 4px 14px; }
.rt-chat-msg-time { font-size: 10px; color: #a08670; margin-top: 2px; padding: 0 4px; }

/* 핀된 메시지: 주황색 배경 */
.rt-chat-msg.pinned .rt-chat-msg-bubble {
    background: linear-gradient(135deg, #FFB74D 0%, #FFA726 100%) !important;
    color: #fff !important;
    border: 1px solid #FF9800 !important;
    box-shadow: 0 2px 8px rgba(255,152,0,0.3);
}
.rt-chat-msg.pinned .rt-chat-msg-bubble::after { content: ' [핀]'; font-size: 10px; opacity: 0.75; }

/* 메시지 컨텍스트 메뉴 (핀 버튼) */
.rt-chat-ctx-menu { position: fixed; background: #fff; border: 1px solid rgba(155,142,132,0.25); border-radius: 8px; box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 10010; min-width: 130px; padding: 4px 0; }
.rt-chat-ctx-item { padding: 9px 16px; font-size: 13px; color: #4a3a2e; cursor: pointer; }
.rt-chat-ctx-item:hover { background: #faf5ee; }
.rt-chat-ctx-item.danger { color: #c05540; }

/* 핀룸 이름 입력 다이얼로그 */
.rt-pin-dialog { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: none; align-items: center; justify-content: center; z-index: 10020; }
.rt-pin-dialog.active { display: flex; }
.rt-pin-dialog-box { background: #fff; border-radius: 12px; padding: 22px 20px; width: 280px; box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.rt-pin-dialog-title { font-size: 14px; font-weight: 600; color: #5a4a3a; margin-bottom: 12px; }
.rt-pin-dialog-input { width: 100%; padding: 9px 12px; border: 1px solid rgba(155,142,132,0.35); border-radius: 8px; font-size: 13px; outline: none; box-sizing: border-box; }
.rt-pin-dialog-input:focus { border-color: #B8956A; }
.rt-pin-dialog-row { display: flex; gap: 8px; margin-top: 14px; }
.rt-pin-dialog-btn { flex: 1; padding: 9px 0; border: none; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; }
.rt-pin-dialog-btn.cancel { background: #f0ece6; color: #8a7a6d; }
.rt-pin-dialog-btn.confirm { background: #B8956A; color: #fff; }
.rt-pin-dialog-btn.cancel:hover { background: #e8e0d8; }
.rt-pin-dialog-btn.confirm:hover { background: #a88555; }

/* 입력창 */
.rt-chat-input-row { display: flex; gap: 6px; padding: 10px 12px; border-top: 1px solid rgba(155,142,132,0.2); background: #fff; }
.rt-chat-input { flex: 1; padding: 10px 12px; border: 1px solid rgba(155,142,132,0.3); border-radius: 20px; font-size: 13px; font-family: inherit; outline: none; }
.rt-chat-input:focus { border-color: #B8956A; }
.rt-chat-send-btn { padding: 0 18px; background: #B8956A; color: #fff; border: none; border-radius: 20px; font-size: 13px; font-weight: 600; cursor: pointer; }
.rt-chat-send-btn:hover { background: #a88555; }
.rt-chat-send-btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* 미디어 첨부 버튼 (카톡식 + 버튼) */
.rt-chat-media-btn {
    width: 36px; height: 36px; flex-shrink: 0;
    background: #f0ebe4; border: 1px solid rgba(155,142,132,0.3);
    border-radius: 50%; font-size: 20px; line-height: 34px; text-align: center;
    color: #8a7a6a; cursor: pointer; display: flex; align-items: center; justify-content: center;
    font-weight: 400; transition: background 0.15s;
}
.rt-chat-media-btn:hover { background: #e8e0d5; color: #B8956A; }

/* 미디어 카드 — 이미지/동영상 표시 */
.rt-chat-media-wrap { max-width: 240px; margin-bottom: 4px; border-radius: 10px; overflow: hidden; }
.rt-chat-media-img {
    display: block; width: 100%; max-width: 240px; max-height: 200px;
    object-fit: cover; border-radius: 10px; cursor: pointer;
    border: 1px solid rgba(155,142,132,0.2);
}
.rt-chat-media-img:hover { opacity: 0.9; }
.rt-chat-media-video {
    display: block; width: 100%; max-width: 240px; max-height: 180px;
    border-radius: 10px; background: #1a1a1a;
    border: 1px solid rgba(155,142,132,0.2);
}

/* 핀룸 — 입력창 숨김 (조회 전용) */
.rt-chat-panel[data-room-type="pinroom"] .rt-chat-input-row { display: none; }

/* 모바일 스와이프 힌트 */
.rt-chat-swipe-hint { text-align: center; font-size: 10px; color: #c0b0a0; padding: 4px 0 2px; background: #fdfcfa; letter-spacing: 0.5px; }

@media (max-width: 480px) {
    .rt-chat-panel { height: 90vh; max-height: 90vh; border-radius: 10px; }
    .rt-chat-header { padding: 10px 12px; }
    .rt-chat-title { font-size: 13px; }
    .rt-chat-msg { max-width: 85%; }
    .rt-chat-roomtab { padding: 4px 10px; font-size: 10px; }
}

/* ═══════════════════════════════════════════════
   임무 A — 모바일 조직도 세로 적층 트리
   (768px 이하: 가로 트리 → 세로 들여쓰기)
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* 캔버스: 가로 스크롤 해제, 세로 흐름 허용 */
    .rt-team-canvas {
        overflow-x: hidden;
        overflow-y: visible;
    }
    /* 트리 루트: 세로 방향 */
    .rt-tree {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        min-width: 0;
        padding: 6px 0;
    }
    /* 노드 래퍼: 세로 적층 */
    .rt-node-wrap {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }
    /* 자식 컨테이너: 세로 + 들여쓰기 */
    .rt-children {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding-left: 16px;
        border-left: 2px solid #d4af8a;
        margin-left: 12px;
        margin-top: 4px;
        gap: 4px;
    }
    /* 브랜치: 수직 흐름 */
    .rt-branch {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        padding: 2px 0;
        width: 100%;
    }
    /* 가로 연결선 → 숨김 (border-left가 담당) */
    .rt-connector {
        display: none;
    }
    /* 다단계 세로선 제거 (::before 대체) */
    .rt-children.multi::before {
        display: none;
    }
    /* 노드: 전체 너비 활용 */
    .rt-node {
        width: 100%;
        max-width: 100%;
        white-space: normal;
        word-break: break-word;
    }
    /* 2depth: 들여쓰기 16px */
    .rt-children .rt-node-wrap > .rt-node { margin-left: 0; }
    /* 3depth: 추가 들여쓰기 (중첩 border-left) */
    .rt-children .rt-children {
        margin-left: 12px;
        padding-left: 16px;
        border-left-color: #e8c48e;
    }
    .rt-children .rt-children .rt-children {
        border-left-color: #f0d9a8;
    }
    /* 편집 모드 버튼: 노드 오른쪽 */
    .rt-node-actions {
        position: static;
        margin-left: auto;
        flex-shrink: 0;
    }
}

/* ═══════════════════════════════════════════════
   임무 B — 시그니처 컬러 (라벤더 + 파스텔 핑크)
   CSS 변수로 중앙관리
   ═══════════════════════════════════════════════ */
:root {
    --sig-lavender:       #B8A6E8;
    --sig-lavender-deep:  #9B8AC5;
    --sig-pink:           #FFC4D1;
    --sig-pink-deep:      #FF8FA8;
    --sig-cream:          #FFF8F0;
    --sig-dark:           #3D2E5C;
    --sig-grad:           linear-gradient(135deg, #B8A6E8 0%, #FFC4D1 100%);
    --sig-grad-soft:      linear-gradient(135deg, #D4C8F4 0%, #FFD8E4 100%);
}

/* ─── 채팅 패널 헤더: 시그니처 그라디언트 ─── */
.rt-chat-header {
    background: var(--sig-grad) !important;
    border-bottom: none;
}
.rt-chat-title { color: #fff; font-weight: 700; }
.rt-chat-status { color: rgba(255,255,255,0.82); }
.rt-chat-status.ok { color: #c8ffd0; }
.rt-chat-status.warn { color: #ffe8a0; }
.rt-chat-status.error { color: #ffd0d0; }
.rt-chat-close-btn { color: rgba(255,255,255,0.9); }
.rt-chat-close-btn:hover { background: rgba(255,255,255,0.18); }

/* ─── 룸 탭바: 라벤더 톤 ─── */
.rt-chat-roomtabs {
    background: var(--sig-lavender-deep);
}
.rt-chat-roomtab {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.25);
    color: rgba(255,255,255,0.85);
}
.rt-chat-roomtab:hover {
    background: rgba(255,255,255,0.28);
    border-color: rgba(255,255,255,0.5);
    color: #fff;
}
.rt-chat-roomtab.active {
    background: #fff;
    border-color: #fff;
    color: var(--sig-lavender-deep);
}
.rt-chat-pin-badge {
    background: var(--sig-pink-deep);
}

/* ─── 메시지 버블: 시그니처 컬러 ─── */
/* 상대방: 라벤더/핑크 그라디언트 */
.rt-chat-msg-bubble {
    background: linear-gradient(135deg, rgba(184,166,232,0.4) 0%, rgba(255,196,209,0.35) 100%);
    color: var(--sig-dark);
    border-radius: 14px 14px 14px 4px;
}
/* ★ 내 메시지: 흰색 배경 + 다크 글씨 (우선순위 강제) */
.rt-chat-msg.mine .rt-chat-msg-bubble {
    background: #ffffff !important;
    color: #1a1a2e !important;
    border: 1px solid rgba(155,142,132,0.25) !important;
    border-radius: 14px 14px 4px 14px;
}

/* ─── 입력창: 크림색 + 라벤더 포커스 ─── */
.rt-chat-input-row { background: var(--sig-cream); }
.rt-chat-input {
    background: #fff;
    border-color: var(--sig-lavender);
    border-radius: 22px;
}
.rt-chat-input:focus { border-color: var(--sig-lavender-deep); }
.rt-chat-send-btn {
    background: var(--sig-lavender);
    border-radius: 22px;
}
.rt-chat-send-btn:hover { background: var(--sig-lavender-deep); }
.rt-chat-media-btn {
    background: var(--sig-cream);
    border-color: var(--sig-lavender);
    color: var(--sig-lavender-deep);
}
.rt-chat-media-btn:hover {
    background: var(--sig-grad-soft);
    color: var(--sig-dark);
}

/* ─── PC 채팅 패널 확대 (768px 초과) ─── */
/* ★ [LEAD 2026-04-26] PC 60:40 레이아웃 — 메인채팅 60% + 핀룸 사이드바 40% */
@media (min-width: 769px) {
    .rt-chat-overlay { padding: 20px; }
    .rt-chat-panel {
        max-width: 1100px;
        width: 80vw;
        height: 80vh;
        max-height: 700px;
        border-radius: 18px;
        display: flex;
        flex-direction: column;
        position: relative;
    }
    /* 헤더: PC에서는 feat-nav 인라인 표시 */
    .rt-chat-header {
        border-radius: 18px 18px 0 0;
        flex-shrink: 0;
    }
    /* PC: feat-nav 인라인 탭도 라벨 표시 */
    .rt-feat-nav-inline .rt-feat-tab .rt-feat-tab-label { display: block; }
    .rt-feat-nav-inline .rt-feat-tab { height: auto; padding: 6px 14px; }
    /* 패널 본문(헤더 아래): flex-row로 60:40 분할 */
    .rt-chat-body-row {
        display: flex;
        flex: 1;
        overflow: hidden;
        min-height: 0;
    }
    /* 슬라이드 페이지 컨테이너: 메인 60% */
    .rt-chat-pages {
        flex: 0 0 60%;
        overflow: hidden;
        border-right: 1px solid rgba(184,166,232,0.3);
    }
    .rt-chat-page {
        overflow: hidden;
        height: 100%;
        display: flex;
        flex-direction: column;
        flex: 1;
    }
    /* messages가 남은 공간 차지 */
    .rt-chat-page .rt-chat-messages { flex: 1; min-height: 0; }
    /* 우측 사이드바: 40% (핀룸 / 멤버) */
    .rt-chat-sidebar {
        flex: 0 0 40%;
        overflow-y: auto;
        background: var(--sig-cream);
        padding: 14px 16px;
        border-radius: 0 0 18px 0;
        min-width: 0;
    }
    .rt-chat-sidebar-title {
        font-size: 11px;
        font-weight: 800;
        color: var(--sig-lavender-deep);
        letter-spacing: 0.04em;
        margin-bottom: 8px;
        text-transform: uppercase;
    }
    .rt-chat-sidebar-empty {
        font-size: 11px;
        color: #b0a0b8;
        text-align: center;
        padding: 20px 0;
    }
}

/* ─── 모바일 채팅 패널 풀스크린 ─── */
@media (max-width: 768px) {
    .rt-chat-overlay { padding: 0; align-items: flex-end; }
    .rt-chat-panel {
        width: 100vw;
        max-width: 100vw;
        height: 95dvh;
        max-height: 95dvh;
        border-radius: 18px 18px 0 0;
    }
    .rt-chat-header { border-radius: 18px 18px 0 0; }
    /* ★ [LEAD 2026-04-26] 모바일: body-row는 flex-column으로 쌓기 (사이드바 숨김) */
    .rt-chat-body-row {
        display: flex;
        flex-direction: column;
        flex: 1;
        overflow: hidden;
        min-height: 0;
    }
    .rt-chat-pages { flex: 1; overflow: hidden; min-height: 0; }
    /* 사이드바는 모바일에서 숨김 (핀공지는 탭으로 전환) */
    .rt-chat-sidebar { display: none !important; }
}

/* rt-chat-body-row 기본 (모바일 외): display flex는 PC 미디어쿼리에서 처리 */
.rt-chat-body-row { display: flex; flex: 1; overflow: hidden; min-height: 0; }

/* ═══════════════════════════════════════════════
   임무 B — 기능 네비 탭 (채팅 헤더 아래)
   모바일: 4탭 + 더보기
   ═══════════════════════════════════════════════ */
.rt-feat-nav {
    display: flex;
    align-items: stretch;
    background: var(--sig-lavender-deep);
    overflow-x: auto;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.rt-feat-nav::-webkit-scrollbar { display: none; }
.rt-feat-tab {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 8px 14px;
    background: none;
    border: none;
    color: rgba(255,255,255,0.7);
    font-size: 10px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.18s;
    white-space: nowrap;
    position: relative;
}
.rt-feat-tab:hover { color: #fff; background: rgba(255,255,255,0.1); }
.rt-feat-tab.active {
    color: #fff;
    background: rgba(255,255,255,0.18);
}
.rt-feat-tab.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 8px; right: 8px;
    height: 2px;
    background: var(--sig-pink);
    border-radius: 2px;
}
.rt-feat-tab-icon { font-size: 16px; line-height: 1; }
.rt-feat-tab-label { font-size: 9px; font-weight: 700; }

/* 더보기 탭 */
.rt-feat-tab-more {
    margin-left: auto;
    padding: 8px 12px;
    font-size: 18px;
    color: rgba(255,255,255,0.7);
    letter-spacing: 1px;
}
.rt-feat-tab-more:hover { color: #fff; }

/* 기능 페이지 컨테이너 */
.rt-feat-pages {
    flex: 1;
    overflow: hidden;
    position: relative;
}
.rt-feat-page {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    transform: translateX(30px);
    transition: opacity 0.22s ease, transform 0.22s ease;
    overflow-y: auto;
    padding: 12px 16px;
}
.rt-feat-page.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateX(0);
}
.rt-feat-page.slide-left {
    transform: translateX(-30px);
}

/* 더보기 드로어 */
.rt-feat-more-drawer {
    position: absolute;
    top: 0; right: 0;
    width: 200px;
    background: #fff;
    border-radius: 0 0 0 12px;
    box-shadow: -4px 4px 20px rgba(61,46,92,0.18);
    z-index: 10;
    overflow: hidden;
    display: none;
}
.rt-feat-more-drawer.open { display: block; }
.rt-feat-more-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 700;
    color: var(--sig-dark);
    cursor: pointer;
    border-bottom: 1px solid rgba(184,166,232,0.15);
    transition: background 0.12s;
}
.rt-feat-more-item:hover { background: var(--sig-grad-soft); }
.rt-feat-more-item:last-child { border-bottom: none; }
.rt-feat-more-icon { font-size: 16px; }

/* ═══════════════════════════════════════════════
   임무 C — 팀명 변경 다이얼로그
   ═══════════════════════════════════════════════ */
.rt-rename-overlay {
    position: fixed;
    inset: 0;
    background: rgba(61,46,92,0.45);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 10050;
    padding: 20px;
}
.rt-rename-overlay.active { display: flex; }
.rt-rename-box {
    background: #fff;
    border-radius: 18px;
    width: 100%;
    max-width: 320px;
    overflow: hidden;
    box-shadow: 0 8px 40px rgba(61,46,92,0.25);
    animation: rtSlideUp 0.22s ease;
}
.rt-rename-head {
    padding: 16px 20px 12px;
    background: var(--sig-grad);
    color: #fff;
}
.rt-rename-head-title {
    font-size: 15px;
    font-weight: 800;
}
.rt-rename-head-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.8);
    margin-top: 3px;
}
.rt-rename-body { padding: 16px 20px 20px; }
.rt-rename-input {
    width: 100%;
    padding: 11px 14px;
    border: 2px solid var(--sig-lavender);
    border-radius: 10px;
    font-size: 14px;
    font-family: inherit;
    color: var(--sig-dark);
    background: var(--sig-cream);
    outline: none;
    transition: border-color 0.15s;
    margin-bottom: 12px;
}
.rt-rename-input:focus { border-color: var(--sig-lavender-deep); }
.rt-rename-btns {
    display: flex;
    gap: 8px;
}
.rt-rename-btn {
    flex: 1;
    padding: 11px;
    border: none;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 800;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
}
.rt-rename-btn.cancel {
    background: #f0ece8;
    color: #8a7a6d;
}
.rt-rename-btn.cancel:hover { background: #e8e0d8; }
.rt-rename-btn.save {
    background: var(--sig-grad);
    color: #fff;
}
.rt-rename-btn.save:hover { opacity: 0.9; transform: translateY(-1px); }

/* 롱탭 피드백 (노드 하이라이트) */
.rt-node.longpress-ready {
    outline: 2px solid var(--sig-lavender);
    outline-offset: 2px;
    background: var(--sig-grad-soft) !important;
    transition: outline 0.1s, background 0.1s;
}

/* ═══════════════════════════════════════════════
   임무 D — 스와이프 전환 애니메이션
   (기능 페이지 좌우 슬라이드)
   ═══════════════════════════════════════════════ */
.rt-feat-page.enter-right {
    animation: rtFeatSlideRight 0.22s ease forwards;
}
.rt-feat-page.enter-left {
    animation: rtFeatSlideLeft 0.22s ease forwards;
}
@keyframes rtFeatSlideRight {
    from { opacity: 0; transform: translateX(40px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes rtFeatSlideLeft {
    from { opacity: 0; transform: translateX(-40px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ═══════════════════════════════════════════════
   임무 1 — 모바일 1행 헤더 통합 (768px 이하)
   제목 + 기능탭(명함/잔소리/창고/채팅/📌/⋯)을 한 줄에
   ═══════════════════════════════════════════════ */
@media (max-width: 768px) {
    /* 헤더: flex 1행으로 모든 요소 배치 */
    .rt-chat-header {
        flex-direction: row;
        align-items: center;
        gap: 6px;
        padding: 8px 10px;
    }
    /* 제목 영역: 최소화 (ellipsis) */
    .rt-chat-title-wrap {
        flex: 0 0 auto;
        max-width: 38%;
        min-width: 0;
    }
    .rt-chat-title {
        font-size: 12px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 0;
    }
    .rt-chat-status {
        display: none;
    }
    /* 기능 네비: 헤더 안에 인라인 배치 */
    .rt-feat-nav-inline {
        flex: 1;
        display: flex;
        align-items: stretch;
        justify-content: flex-end;
        overflow-x: auto;
        background: transparent;
        scrollbar-width: none;
    }
    .rt-feat-nav-inline::-webkit-scrollbar { display: none; }
    /* 인라인 탭 버튼: 아이콘만, 컴팩트 */
    .rt-feat-nav-inline .rt-feat-tab {
        padding: 4px 8px;
        gap: 0;
        min-width: 32px;
        height: 32px;
    }
    .rt-feat-nav-inline .rt-feat-tab .rt-feat-tab-label { display: none; }
    .rt-feat-nav-inline .rt-feat-tab .rt-feat-tab-icon { font-size: 15px; }
    .rt-feat-nav-inline .rt-feat-tab-more {
        padding: 4px 8px;
        font-size: 15px;
        height: 32px;
        margin-left: 0;
    }
    /* 기존 독립 feat-nav는 모바일에서 숨김 (헤더에 인라인 됐으므로) */
    .rt-feat-nav:not(.rt-feat-nav-inline) {
        display: none;
    }
}

/* ═══════════════════════════════════════════════
   임무 2 — 고정핀셋 슬라이드 패널
   메인채팅 ↔ 고정핀셋 좌우 슬라이드 컨테이너
   ═══════════════════════════════════════════════ */

/* 슬라이드 래퍼: 두 페이지를 가로로 연결 */
.rt-chat-pages {
    flex: 1;
    display: flex;
    overflow: hidden;
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}
.rt-chat-page {
    flex: 0 0 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
/* 고정핀셋 페이지로 전환 */
.rt-chat-pages.show-pinboard {
    transform: translateX(-100%);
}

/* 고정핀셋 패널 헤더 */
.rt-pinboard-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    background: var(--sig-grad);
    flex-shrink: 0;
}
.rt-pinboard-back-btn {
    background: none;
    border: none;
    color: rgba(255,255,255,0.9);
    font-size: 20px;
    cursor: pointer;
    padding: 2px 6px;
    border-radius: 6px;
    flex-shrink: 0;
    line-height: 1;
}
.rt-pinboard-back-btn:hover { background: rgba(255,255,255,0.18); }
.rt-pinboard-title {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    flex: 1;
}

/* 공지 목록 */
.rt-pinboard-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #fdfcfa;
}
.rt-pinboard-empty {
    text-align: center;
    color: #a08670;
    font-size: 12px;
    padding: 24px 0;
}
.rt-pinboard-item {
    background: #fff;
    border: 1px solid rgba(184,166,232,0.25);
    border-radius: 10px;
    padding: 10px 12px;
    position: relative;
}
.rt-pinboard-item-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--sig-dark);
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.rt-pinboard-item-title::before {
    content: '\1F4CC';
    font-size: 12px;
}
.rt-pinboard-item-body {
    font-size: 12px;
    color: #5a4a6a;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
}
.rt-pinboard-item-meta {
    font-size: 10px;
    color: #a08670;
    margin-top: 6px;
}
.rt-pinboard-item-del {
    position: absolute;
    top: 8px; right: 10px;
    background: none;
    border: none;
    color: #c05540;
    font-size: 14px;
    cursor: pointer;
    opacity: 0.6;
    padding: 2px 4px;
}
.rt-pinboard-item-del:hover { opacity: 1; }

/* 공지 입력창 (팀장만 보임) */
.rt-pinboard-compose {
    padding: 10px 14px;
    background: #f5f0e8;
    border-top: 1px solid rgba(184,166,232,0.2);
    flex-shrink: 0;
}
.rt-pinboard-compose-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--sig-dark);
    margin-bottom: 6px;
}
.rt-pinboard-input-title {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid rgba(184,166,232,0.4);
    border-radius: 8px;
    font-size: 13px;
    font-family: inherit;
    margin-bottom: 6px;
    box-sizing: border-box;
    background: #fff;
}
.rt-pinboard-input-body {
    width: 100%;
    padding: 7px 10px;
    border: 1px solid rgba(184,166,232,0.4);
    border-radius: 8px;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    min-height: 60px;
    box-sizing: border-box;
    background: #fff;
}
.rt-pinboard-save-btn {
    width: 100%;
    margin-top: 6px;
    padding: 8px;
    background: var(--sig-grad);
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    font-family: inherit;
}
.rt-pinboard-save-btn:hover { opacity: 0.9; }
.rt-pinboard-readonly-notice {
    text-align: center;
    font-size: 11px;
    color: #a08670;
    padding: 8px 0 4px;
}

/* ── 우측 패널 팀 잔소리 인라인 패널 ── */
@keyframes rt-jansori-pulse-anim {
    0%   { box-shadow: 0 0 0 0 rgba(90,158,158,0.5); }
    60%  { box-shadow: 0 0 0 10px rgba(90,158,158,0.0); }
    100% { box-shadow: 0 0 0 0 rgba(90,158,158,0.0); }
}
#jansoriWidgetSlot.rt-jansori-pulse {
    animation: rt-jansori-pulse-anim 0.7s ease-out;
}
.rt-jansori-inline-panel {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #fdfcfa;
    border-radius: 0;
    overflow: hidden;
}
.rt-jansori-inline-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px 8px;
    border-bottom: 1px solid rgba(155,142,132,0.2);
    background: #f8f5ef;
    flex-shrink: 0;
}
.rt-jansori-inline-title {
    font-size: 13px;
    font-weight: 700;
    color: #6a5a4a;
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.rt-jansori-inline-close {
    background: none;
    border: none;
    font-size: 16px;
    color: #a08670;
    cursor: pointer;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    flex-shrink: 0;
}
.rt-jansori-inline-close:hover { background: #f0ece8; }
.rt-jansori-inline-body {
    flex: 1;
    overflow-y: auto;
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
/* picker (details) */
.rt-jansori-picker {
    background: #faf8f3;
    border: 1px solid rgba(155,142,132,0.2);
    border-radius: 8px;
    padding: 6px 10px;
}
.rt-jansori-picker-summary {
    font-size: 12px;
    font-weight: 600;
    color: #6a5a4a;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    list-style: none;
    padding: 2px 0;
}
.rt-jansori-picker-summary::-webkit-details-marker { display: none; }
.rt-jansori-count {
    font-size: 11px;
    color: #5a9e9e;
    font-weight: 700;
}
.rt-jansori-sel-btns {
    display: flex;
    gap: 6px;
    margin-top: 6px;
}
.rt-jansori-sel-btn {
    flex: 1;
    padding: 4px 0;
    border: 1px solid rgba(155,142,132,0.3);
    background: #fff;
    border-radius: 6px;
    font-size: 11px;
    color: #6a5a4a;
    cursor: pointer;
}
.rt-jansori-sel-btn:hover { background: #f5ede5; }
/* 채널 선택 라디오 */
.rt-jansori-channel-row {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
}
.rt-jansori-ch-radio {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: #6a5a4a;
    cursor: pointer;
    padding: 5px 10px;
    border: 1px solid rgba(155,142,132,0.3);
    border-radius: 8px;
    background: #fff;
    flex: 1;
    min-width: 60px;
    white-space: nowrap;
}
.rt-jansori-ch-radio input[type=radio] { margin: 0; accent-color: #5a9e9e; }
.rt-jansori-ch-radio:has(input:checked) {
    background: #e8f4f4;
    border-color: #5a9e9e;
    color: #3a7a7a;
    font-weight: 600;
}
/* 일괄 발송 버튼 */
.rt-jansori-send-team {
    width: 100%;
    padding: 9px;
    background: linear-gradient(135deg, #5a9e9e, #78bebe);
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
}
.rt-jansori-send-team:hover { opacity: 0.88; }
/* 모바일: picker summary에서 라디오 포함 */
@supports not selector(:has(input:checked)) {
    /* :has 미지원 브라우저 폴백 */
    .rt-jansori-ch-radio { background: #fff; }
}

/* ─── [LEAD 2026-04-26] 사람별 필터바 ─────────────────────── */
.rt-chat-filter-bar {
    display: flex;
    gap: 6px;
    padding: 6px 10px;
    border-bottom: 1px solid #ece5f6;
    background: #faf8ff;
    overflow-x: auto;
    flex-wrap: nowrap;
    flex-shrink: 0;
    -webkit-overflow-scrolling: touch;
}
.rt-chat-filter-bar::-webkit-scrollbar { height: 3px; }
.rt-chat-filter-bar::-webkit-scrollbar-thumb { background: rgba(184,166,232,0.35); border-radius: 2px; }
.rt-chat-filter {
    padding: 4px 10px;
    border: 1px solid #d4c8ee;
    background: #fff;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
    color: #7a6ea0;
    transition: background 0.15s, color 0.15s;
    flex-shrink: 0;
}
.rt-chat-filter:hover { border-color: #B8A6E8; color: #5a4a80; }
.rt-chat-filter.active {
    background: linear-gradient(135deg, #B8A6E8, #FFC4D1);
    color: #fff;
    border-color: transparent;
}
.rt-chat-filter-select {
    padding: 4px 10px;
    border: 1px solid #d4c8ee;
    background: #fff;
    border-radius: 999px;
    font-size: 12px;
    color: #7a6ea0;
    cursor: pointer;
    flex-shrink: 0;
    outline: none;
}
.rt-chat-filter-select:focus { border-color: #B8A6E8; }
@media (max-width: 768px) {
    .rt-chat-filter-bar { padding: 4px 6px; gap: 4px; }
    .rt-chat-filter { padding: 3px 8px; font-size: 11px; }
    .rt-chat-filter-select { padding: 3px 8px; font-size: 11px; }
}

/* ★ [LEAD 2026-04-26 v3] 잔소리 위젯과 자연스럽게 이어지는 통합 행 (운영자 정정: 그라디언트 X, 단순 세련) */
.rt-team-send-bar {
    margin: 0;
    background: #fdfcfa;
    border-top: 1px solid rgba(0,0,0,0.08);
    border-radius: 0;
    overflow: hidden;
    /* ★ [LEAD 2026-04-26 v6] idle: 헤더만 / expanded: 펼침 애니메이션 (운영자 임무1) */
    max-height: 44px;
    transition: max-height 0.35s ease, border-color 0.2s ease;
}
.rt-team-send-bar.expanded {
    max-height: 1200px;
    border-top: 1px solid var(--sumi-accent-gold, #c9a86a);
}
.rt-team-send-bar.rt-pulse {
    animation: rtTsbPulse 0.7s ease;
}
@keyframes rtTsbPulse {
    0%, 100% { background: #fdfcfa; }
    50% { background: rgba(201,168,106,0.12); }
}
.rt-tsb-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 10px 14px;
    min-height: 44px;
    box-sizing: border-box;
    /* [v=20260427i] 오늘의 잔소리 헤더와 시각 통일 — 라벤더+핑크 그라디언트 */
    background: linear-gradient(135deg, rgba(184,166,232,0.18) 0%, rgba(255,196,209,0.22) 100%);
    border-bottom: none;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: rgba(184,166,232,0.18);
    color: #5a3a20;
}
.rt-team-send-bar.expanded .rt-tsb-header {
    border-bottom: 1px solid rgba(0,0,0,0.06);
}
.rt-tsb-header-idle {
    background: linear-gradient(135deg, rgba(184,166,232,0.18) 0%, rgba(255,196,209,0.22) 100%);
}
.rt-tsb-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; font-weight: 700; color: #5a4a7a;
    flex-wrap: wrap;
}
.rt-tsb-ic { font-size: 15px; }
.rt-tsb-ctx {
    display: inline-flex; align-items: center;
    margin-left: 6px;
    padding: 2px 10px;
    background: linear-gradient(135deg, #B8A6E8, #FFC4D1);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}
.rt-tsb-hint {
    font-size: 11px; color: #8a7ca0; font-weight: 500;
}
.rt-tsb-close {
    width: 26px; height: 26px;
    border: none; background: rgba(255,255,255,0.6);
    border-radius: 50%;
    cursor: pointer;
    color: #5a4a7a; font-size: 16px; line-height: 1;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.15s;
}
.rt-tsb-close:hover {
    background: #fff;
    transform: rotate(90deg);
    box-shadow: 0 2px 6px rgba(184,166,232,0.4);
}
.rt-tsb-body {
    display: none;
    padding: 10px 14px 14px;
    background: rgba(255,255,255,0.6);
}
.rt-team-send-bar.expanded .rt-tsb-body { display: block; }
/* [v=20260427z] 발송 폼 컴팩트화 — 패딩/마진 최소화 + 아이콘 공간 확보 */
.rt-tsb-text {
    width: 100%;
    min-height: 50px;
    margin-bottom: 2px;
    padding: 4px 8px;
    border: 1px solid rgba(184,166,232,0.4);
    border-radius: 8px;
    background: #fff;
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    outline: none;
}
.rt-tsb-text:focus {
    border-color: #B8A6E8;
    box-shadow: 0 0 0 3px rgba(184,166,232,0.18);
}
.rt-tsb-row {
    display: flex; align-items: center; gap: 4px;
    margin-bottom: 2px;
    flex-wrap: wrap;
}
.rt-tsb-target-row { gap: 6px; }
.rt-tsb-cb {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    margin: 1px;
    border: 1px solid rgba(184,166,232,0.35);
    background: #fff;
    border-radius: 999px;
    font-size: 11px;
    color: #5a4a7a;
    cursor: pointer;
    user-select: none;
    transition: all 0.15s;
    line-height: 1.2;
}
.rt-tsb-cb:hover {
    background: rgba(184,166,232,0.1);
}
.rt-tsb-cb input[type=checkbox] {
    margin: 0;
    accent-color: #B8A6E8;
}
.rt-tsb-cb-disabled {
    opacity: 0.4;
    cursor: not-allowed;
}
.rt-tsb-cb-disabled:hover { background: #fff; }
.rt-tsb-sel {
    flex: 1;
    min-width: 120px;
    padding: 2px 8px;
    margin: 1px;
    border: 1px solid rgba(184,166,232,0.4);
    background: #fff;
    border-radius: 999px;
    font-size: 11px;
    color: #5a4a7a;
    cursor: pointer;
    outline: none;
    line-height: 1.2;
}
.rt-tsb-sel:focus {
    border-color: #B8A6E8;
    box-shadow: 0 0 0 3px rgba(184,166,232,0.18);
}
/* [v=20260427z] 채널 라디오 — 컴팩트 + 아이콘 공간 */
.rt-tsb-radio {
    display: inline-flex; align-items: center; gap: 4px;
    padding: 2px 8px;
    margin: 1px;
    border: 1px solid rgba(184,166,232,0.35);
    background: #fff;
    border-radius: 999px;
    font-size: 11px;
    color: #5a4a7a;
    cursor: pointer;
    user-select: none;
    line-height: 1.2;
    transition: all 0.15s;
}
.rt-tsb-radio input[type=radio] { margin: 0; accent-color: #B8A6E8; }
/* 아이콘 SVG — 작고 선명하게 */
.rt-tsb-icon {
    width: 13px;
    height: 13px;
    flex-shrink: 0;
    display: inline-block;
    vertical-align: middle;
}
.rt-tsb-radio:has(input:checked) {
    background: linear-gradient(135deg, rgba(184,166,232,0.25), rgba(255,196,209,0.25));
    border-color: rgba(184,166,232,0.6);
    color: #4a3a6a;
    font-weight: 600;
}
/* 카카오톡 라디오 — 노란색 테마 */
.rt-tsb-radio-kakao:has(input:checked) {
    background: linear-gradient(135deg, #FEE500 0%, #FFD700 100%) !important;
    border-color: #E6C800 !important;
    color: #3C1E1E !important;
}
.rt-tsb-radio-kakao .rt-tsb-icon {
    fill: #FEE500;
    stroke: #3C1E1E;
}
.rt-tsb-send-row {
    margin-top: 2px;
    margin-bottom: 0;
}
.rt-tsb-send-btn {
    flex: 1;
    padding: 6px 14px;
    margin: 1px;
    border: none;
    border-radius: 8px;
    background: linear-gradient(135deg, #B8A6E8 0%, #FFC4D1 100%);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(184,166,232,0.3);
    transition: all 0.15s;
    line-height: 1.2;
}
.rt-tsb-send-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(184,166,232,0.45);
}
.rt-tsb-send-btn:active {
    transform: translateY(0);
}
.rt-tsb-status {
    font-size: 11px;
    color: #6a4c93;
    min-width: 80px;
    text-align: right;
}
@media (max-width: 768px) {
    /* [v=20260427e] margin:0 — jansoriWidgetSlot flex column 내 밀착 부착 */
    .rt-team-send-bar { margin: 0; border-radius: 0 0 8px 8px; }
    .rt-tsb-header { padding: 8px 10px; }
    .rt-tsb-title { font-size: 12px; gap: 6px; }
    .rt-tsb-ctx { font-size: 10px; padding: 2px 8px; }
    .rt-tsb-body { padding: 6px 8px 8px; }
    .rt-tsb-text { min-height: 44px; font-size: 12px; }
    .rt-tsb-cb, .rt-tsb-radio, .rt-tsb-sel { font-size: 11px; padding: 2px 6px; }
    .rt-tsb-send-btn { padding: 5px 10px; font-size: 11px; }
}

/* ★ [LEAD 2026-04-26 v2] 운영자 정정: 위젯/미니심미봇 그대로 유지, bar 펼침만 — rt-fullspace 폐기 */
.rt-team-send-bar.expanded {
    border: 2px solid #B8A6E8;
    box-shadow: 0 4px 16px rgba(184,166,232,0.35);
}
.rt-team-send-bar.expanded .rt-tsb-text {
    min-height: 80px;
}
/* ★ [STUDY 2026-04-27 v=20260427c] 공부방 미니심미봇 — 35%/65% 비율 재편 */
/* 운영자: "말풍선 찌그러짐 → 말풍선 35% / 입력창 65% / 중복행 제거" */
/* 좌측 35%: 말풍선(위) + 로봇이미지(아래) / 우측 65%: 입력창+전송버튼 */
.panel-right > .right-slot:last-child .minibot-waiting {
    display: grid !important;
    grid-template-columns: 35% 65% !important;
    grid-template-rows: auto 1fr !important;
    column-gap: 6px !important;
    row-gap: 2px !important;
    padding: 4px 6px !important;
    align-items: center;
    box-sizing: border-box;
}
.panel-right > .right-slot:last-child .minibot-bubble {
    grid-column: 1 / 2;
    grid-row: 1 / 2;
    font-size: 10.5px !important;
    padding: 3px 6px !important;
    margin: 0 !important;
    max-width: 100% !important;
    align-self: end;
    justify-self: start;
    /* 말풍선 텍스트 줄바꿈 허용 */
    white-space: normal !important;
    word-break: keep-all;
    line-height: 1.35;
}
.panel-right > .right-slot:last-child .minibot-waiting-icon {
    grid-column: 1 / 2;
    grid-row: 2 / 3;
    width: 44px !important;
    height: 44px !important;
    align-self: center;
    justify-self: center;
}
.panel-right > .right-slot:last-child .minibot-mini-bar {
    grid-column: 2 / 3;
    grid-row: 1 / 3;
    width: 100% !important;
    min-width: 0 !important;
    align-self: center;
    box-sizing: border-box;
}
.panel-right > .right-slot:last-child .minibot-mini-input {
    width: 100% !important;
    min-width: 0;
    font-size: 11.5px !important;
    padding: 6px 8px !important;
    box-sizing: border-box;
}
/* messages: 중복 안내행 제거됐으므로 거의 비어있음 — 응답 메시지만 표시 */
.panel-right > .right-slot:last-child .minibot-messages {
    max-height: 0 !important;
    padding: 0 !important;
    overflow: hidden;
    display: none !important;
}
/* mini-msg는 더 이상 사용 안 함 (placeholder로 이동) */
.panel-right > .right-slot:last-child .minibot-messages .mini-msg {
    display: none !important;
}

/* ★ [STUDY 2026-04-26 v7] PC rt-jansori-active 분기 전체 제거 — PC 우측 14% slot 미니심미봇 영역 절대 건드리지 않음 (운영자 정정) */
/* rt-jansori-active는 모바일(@media max-width:768px)에서만 적용 */

/* ★ [STUDY 2026-04-26 v7] 잔소리 아이콘 클릭 모달 overlay */
#rtJansoriOverlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(30,24,18,0.55);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}
#rtJansoriOverlay.active {
    display: flex;
}
.rt-jansori-modal {
    background: #fdfcfa;
    border: 2px solid var(--sumi-accent-gold, #c9a86a);
    border-radius: 16px;
    box-shadow: 0 12px 36px rgba(30,24,18,0.32);
    width: min(540px, 92vw);
    max-height: 88vh;
    overflow-y: auto;
    padding: 0;
    display: flex;
    flex-direction: column;
}
.rt-jansori-modal .rt-tsb-header {
    cursor: default;
    border-radius: 14px 14px 0 0;
}
.rt-jansori-modal .rt-tsb-close {
    display: flex !important;
}
/* ★ [STUDY hotfix 2026-05-02o] region 카드 잔소리 모달 — tsb-body 강제 노출
   .rt-tsb-body는 기본 display:none (.rt-team-send-bar.expanded 부모 selector 의존)
   rtJansoriOverlay 모달 컨텍스트에선 rt-team-send-bar 없으므로 body가 숨겨짐 */
.rt-jansori-modal .rt-tsb-body {
    display: block !important;
}

/* ★ [v=20260502z] region 잔소리 iframe 모달 — l3/hub 패턴 통일 */
.rt-jansori-iframe-overlay {
    position: fixed;
    inset: 0;
    z-index: 10000;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
}
.rt-jansori-iframe-sheet {
    position: relative;
    width: 420px;
    height: 780px;
    max-height: 90vh;
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.rt-jansori-iframe-frame {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}
.rt-jansori-iframe-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1;
    font-size: 18px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}
.rt-jansori-iframe-close:hover {
    background: rgba(0, 0, 0, 0.8);
}
@media (max-width: 768px) {
    .rt-jansori-iframe-sheet {
        width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }
}

/* ★ [LEAD 2026-04-26 v3] 모바일 미니심미봇 — floating 명찰 패턴 (운영자 지시) */
/* [v=20260427s] .panel-right > .right-slot.right-slot-jansori { flex:1 1 auto } 제거 → right-panel.css 모바일 블록 통합 */
@media (max-width: 768px) {
    /* 미니심미봇 슬롯 → fixed floating 컨테이너로 변환 (운영자 지시: 우상단 공간 활용) */
    .panel-right > .right-slot:last-child {
        display: block !important;
        position: fixed !important;
        top: 64px !important;        /* 헤더 아래 */
        right: 12px !important;
        bottom: auto !important;
        width: auto !important;
        height: auto !important;
        flex: none !important;
        background: transparent !important;
        border: none !important;
        z-index: 9500 !important;
        padding: 0 !important;
        margin: 0 !important;
        overflow: visible !important;
        pointer-events: auto;
    }
    /* 평소: 명찰 (운영자 지시: 기존 .mobile-minibot-corner 디자인 패턴 그대로) */
    .panel-right > .right-slot:last-child .minibot-area {
        width: 44px !important;
        height: 44px !important;
        min-height: 44px !important;
        max-height: 44px !important;
        border-radius: 50% !important;
        overflow: hidden !important;
        background: #fff !important;
        border: 2px solid var(--sumi-accent-gold, #c9a86a) !important;
        filter: drop-shadow(0 2px 4px rgba(58,51,48,0.22)) !important;
        cursor: pointer !important;
        transition: transform 0.2s ease, width 0.28s ease, height 0.28s ease, max-height 0.28s ease, border-radius 0.28s ease !important;
        position: relative;
    }
    .panel-right > .right-slot:last-child .minibot-area:active {
        transform: scale(0.92);
    }
    /* collapsed 상태: 내부 자식 모두 숨기고 mini-simmibot.png 표시 (기존 자산 재사용) */
    .panel-right > .right-slot:last-child .minibot-area:not(.mb-expanded) > * {
        display: none !important;
    }
    .panel-right > .right-slot:last-child .minibot-area:not(.mb-expanded)::before {
        content: '';
        position: absolute; inset: 0;
        background: url('/homepage/ai-widgets/forms/mini-simmibot.png') center/cover no-repeat;
    }
    /* 펼침 상태: 280×340 카드 (입력창 + 말풍선) */
    .panel-right > .right-slot:last-child .minibot-area.mb-expanded {
        width: 290px !important;
        height: 380px !important;
        min-height: 380px !important;
        max-height: 380px !important;
        border-radius: 18px !important;
        background: #fff !important;
        box-shadow: 0 10px 28px rgba(0,0,0,0.35) !important;
        cursor: default !important;
    }
    .panel-right > .right-slot:last-child .minibot-area.mb-expanded > * {
        display: block !important;
    }
    /* 펼침 닫기 단추 */
    .rt-mb-close {
        position: absolute;
        top: 6px; right: 8px;
        width: 26px; height: 26px;
        border: none;
        background: rgba(184,166,232,0.18);
        color: #5a4a7a;
        border-radius: 50%;
        font-size: 14px;
        cursor: pointer;
        z-index: 5;
        display: flex; align-items: center; justify-content: center;
    }
    .rt-mb-close:hover { background: rgba(184,166,232,0.35); }
    /* PC에선 닫기 단추 숨김 */
}
@media (min-width: 769px) {
    .rt-mb-close { display: none !important; }
}

/* ★ [LEAD 2026-04-26] 헤더 last pick 표시 — "현재 팀: 신은영 [변경]" */
/* ★ [STUDY 2026-04-28] 심미마스터 배지 — 신은영 전용 골드 */
.rt-hdr-simmi-master {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 12px;
    background: linear-gradient(135deg, #D4AF37 0%, #f0d060 60%, #c49a28 100%);
    border: 1px solid #b8930a;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
    color: #3a2800;
    letter-spacing: 0.02em;
    box-shadow: 0 1px 6px rgba(212,175,55,0.45), inset 0 1px 0 rgba(255,255,255,0.35);
    text-shadow: 0 1px 0 rgba(255,255,200,0.5);
}
@media (max-width: 768px) {
    .rt-hdr-simmi-master { font-size: 11px; padding: 3px 9px; }
}

.rt-hdr-pick {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 4px 10px;
    background: linear-gradient(135deg, rgba(184,166,232,0.18), rgba(255,196,209,0.22));
    border: 1px solid rgba(184,166,232,0.4);
    border-radius: 999px;
    font-size: 12px;
    color: #5a4a7a;
    box-shadow: 0 1px 4px rgba(184,166,232,0.15);
}
.rt-hdr-pick-ic { font-size: 13px; }
.rt-hdr-pick-label { font-weight: 500; opacity: 0.85; }
.rt-hdr-pick-name {
    font-weight: 700;
    color: #4a3a6a;
}
.rt-hdr-pick-change {
    margin-left: 4px;
    padding: 2px 8px;
    border: 1px solid rgba(184,166,232,0.5);
    background: #fff;
    border-radius: 999px;
    font-size: 11px;
    color: #6a4c93;
    cursor: pointer;
    transition: all 0.15s;
}
.rt-hdr-pick-change:hover {
    background: linear-gradient(135deg, #B8A6E8, #FFC4D1);
    color: #fff;
    border-color: transparent;
}
@media (max-width: 768px) {
    .rt-hdr-pick { font-size: 11px; padding: 3px 8px; gap: 4px; }
    .rt-hdr-pick-change { font-size: 10px; padding: 2px 6px; }
}

/* ★ [LEAD 2026-04-26] 회원정보 모달 — 식별주소 chip (네이버 그린식) */
.rt-id-chip {
    display: inline-flex; align-items: center; gap: 4px;
    margin-left: 8px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #03C75A 0%, #00B341 100%);
    color: #fff;
    border-radius: 999px;
    font-size: 10px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    user-select: none;
    max-width: 220px;
    overflow: hidden;
}
.rt-id-chip:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(3,199,90,0.4);
}
.rt-id-chip-ic { font-size: 11px; }
.rt-id-chip-txt {
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    max-width: 130px;
    font-family: monospace;
    font-size: 9.5px;
}
.rt-id-chip-copy {
    background: rgba(255,255,255,0.25);
    padding: 1px 6px;
    border-radius: 999px;
    font-size: 9px;
    font-weight: 700;
}
/* 상태 행의 ... 식별주소 표시 */
.rt-id-ellipsis {
    display: inline-block;
    margin-left: 8px;
    padding: 2px 10px;
    background: rgba(3,199,90,0.12);
    border: 1px solid rgba(3,199,90,0.4);
    color: #03A547;
    border-radius: 999px;
    font-size: 10px;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}
.rt-id-ellipsis:hover {
    background: #03C75A;
    color: #fff;
    border-color: transparent;
}

/* ngnshop 자동완성 단추 */
.rt-autofill-btn {
    margin-left: 6px;
    padding: 2px 8px;
    background: linear-gradient(135deg, #B8A6E8, #FFC4D1);
    border: none;
    border-radius: 999px;
    font-size: 10px;
    color: #fff;
    cursor: pointer;
    font-weight: 600;
    transition: all 0.15s;
}
.rt-autofill-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 2px 6px rgba(184,166,232,0.4);
}

/* Toast 알림 */
.rt-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: linear-gradient(135deg, #5a4a7a, #4a3a6a);
    color: #fff;
    padding: 10px 20px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 16px rgba(0,0,0,0.25);
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 100000;
}
.rt-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}
@media (max-width: 768px) {
    .rt-id-chip { font-size: 9px; max-width: 160px; }
    .rt-id-chip-txt { max-width: 80px; font-size: 9px; }
    .rt-id-ellipsis { font-size: 9px; padding: 2px 8px; }
    .rt-autofill-btn { font-size: 9px; padding: 2px 6px; }
}

/* ★ [LEAD 2026-04-26 v6] 채팅 필터바+메인채팅 통합 흰박스 (운영자 명시) */
.rt-chat-unibar {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 8px 10px !important;
    background: #fff !important;
    border: 1px solid #ece5f6 !important;
    border-radius: 12px !important;
    margin: 8px 10px 6px !important;
    flex-wrap: wrap;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.rt-chat-unibar .rt-chat-filter-bar {
    display: contents;  /* 통합박스 안에서 자식들이 직접 flex item이 됨 */
    background: transparent !important;
    border-bottom: none !important;
    padding: 0 !important;
}
.rt-chat-unibar .rt-chat-roomtab {
    margin-left: auto;
}
.rt-chat-unibar .rt-chat-filter,
.rt-chat-unibar .rt-chat-roomtab {
    padding: 4px 12px;
    border: 1px solid #d4c8ee;
    background: #fff;
    border-radius: 999px;
    font-size: 12px;
    cursor: pointer;
    white-space: nowrap;
}
.rt-chat-unibar .rt-chat-filter.active,
.rt-chat-unibar .rt-chat-roomtab.active {
    background: linear-gradient(135deg, #B8A6E8, #FFC4D1);
    color: #fff;
    border-color: transparent;
    font-weight: 600;
}
.rt-pinboard-filterbar {
    margin: 6px 10px !important;
}
@media (max-width: 768px) {
    .rt-chat-unibar { gap: 4px; padding: 6px 8px !important; margin: 6px 8px !important; }
    .rt-chat-unibar .rt-chat-filter,
    .rt-chat-unibar .rt-chat-roomtab { padding: 3px 8px; font-size: 11px; }
}

/* ★ [STUDY 2026-04-26] users 테이블 자동완성 상태 표시 */
.rt-ngn-autofill-status {
    min-height: 4px;
    margin-bottom: 4px;
    font-size: 11px;
    color: #8a6a3a;
}
.rt-ngn-match-wrap {
    background: linear-gradient(135deg, rgba(184,166,232,0.12), rgba(255,196,209,0.08));
    border: 1px solid rgba(184,166,232,0.3);
    border-radius: 8px;
    padding: 8px 10px;
    margin-bottom: 6px;
}
.rt-ngn-match-label {
    font-size: 10px;
    color: #7a5a9a;
    font-weight: 600;
    margin-bottom: 5px;
}
.rt-ngn-match-select {
    width: 100%;
    padding: 5px 8px;
    border: 1px solid rgba(184,166,232,0.4);
    border-radius: 6px;
    background: rgba(255,255,255,0.7);
    font-size: 12px;
    color: #3a2a5a;
    cursor: pointer;
}
.rt-ngn-match-select:focus {
    outline: none;
    border-color: #B8A6E8;
}
@media (max-width: 768px) {
    .rt-ngn-match-label { font-size: 9px; }
    .rt-ngn-match-select { font-size: 11px; }
}

/* ─── [임무C 2026-04-27] Google 계정 전달 박스 (홍보용) v=20260430n 컴팩트 리뉴얼 ─── */
.rt-google-box {
    border: 2px solid rgba(212, 175, 55, 0.45);
    border-radius: 10px;
    background: rgba(212, 175, 55, 0.04);
    padding: 8px 11px;
    margin: 8px 0;
    position: relative;
}
.rt-google-box-header {
    font-size: 11px;
    font-weight: 700;
    color: #6a4e23;
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}
.rt-google-box-tag {
    font-size: 9px;
    padding: 1px 6px;
    background: rgba(212, 175, 55, 0.18);
    color: #8a6a20;
    border-radius: 10px;
    margin-left: auto;
    font-weight: 700;
    letter-spacing: 0.03em;
    white-space: nowrap;
    flex-shrink: 0;
}
.rt-google-box-body {
    display: flex;
    flex-direction: column;
    gap: 5px;
}
/* [v=20260430n] 컴팩트 input — Google/naver 박스 내부 전용 */
.rt-form-group-compact { margin-bottom: 0; }
.rt-form-input-compact { padding: 5px 9px !important; font-size: 12px !important; }
.rt-google-submit-btn {
    background: linear-gradient(135deg, #6a4e23, #4a3215) !important;
    margin-top: 2px;
    font-size: 12px;
    padding: 6px 12px;
}
.rt-google-status {
    font-size: 11px;
    color: #8a6a3a;
    margin-top: 2px;
    text-align: center;
    min-height: 14px;
}
/* [v=20260430n] 네이버 한 행: 라벨 + 아이디 + 비밀번호 inline-flex */
.rt-naver-row {
    display: flex;
    align-items: center;
    gap: 5px;
}
.rt-naver-row-label {
    font-size: 11px;
    font-weight: 700;
    color: #2b7a3c;
    white-space: nowrap;
    flex-shrink: 0;
}
.rt-naver-optional {
    font-size: 10px;
    color: #aaa;
    font-weight: 400;
}
.rt-naver-input {
    flex: 1;
    min-width: 0;
}
