.mindmap-shell {
    height: 100%;
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #eaf3ff;
}

/* tabs */
.mm-tabs {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    min-height: 34px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 1px;
}
.mm-tabs::-webkit-scrollbar { display: none; }

.mm-tab {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 30px;
    padding: 0 11px;
    border: 1px solid rgba(145, 165, 196, 0.18);
    border-bottom: none;
    border-radius: 7px 7px 0 0;
    color: rgba(178, 197, 222, 0.65);
    background: rgba(255, 255, 255, 0.03);
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    white-space: nowrap;
    transition: background 0.15s, color 0.15s;
    user-select: none;
}
.mm-tab:hover { color: rgba(232, 241, 255, 0.9); background: rgba(96, 165, 250, 0.08); }
.mm-tab.active {
    color: #f8fbff;
    background: rgba(96, 165, 250, 0.15);
    border-color: rgba(125, 211, 252, 0.35);
}

.mm-tab-name { max-width: 120px; overflow: hidden; text-overflow: ellipsis; }

.mm-tab-x {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    border: none;
    border-radius: 50%;
    background: transparent;
    color: rgba(178, 197, 222, 0.5);
    font-size: 0.85rem;
    line-height: 1;
    cursor: pointer;
    padding: 0;
}
.mm-tab-x:hover { background: rgba(239, 68, 68, 0.25); color: #fca5a5; }

.mm-tab-add {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px dashed rgba(145, 165, 196, 0.25);
    border-radius: 7px;
    background: transparent;
    color: rgba(178, 197, 222, 0.55);
    cursor: pointer;
    font-size: 0.8rem;
    margin-bottom: 1px;
    transition: background 0.15s, color 0.15s;
}
.mm-tab-add:hover { background: rgba(96, 165, 250, 0.12); color: #7dd3fc; }

.mm-tab-load {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 7px;
    background: rgba(125, 211, 252, 0.07);
    color: rgba(125, 211, 252, 0.70);
    cursor: pointer;
    font-size: 0.8rem;
    margin-bottom: 1px;
    transition: background 0.15s, color 0.15s;
}
.mm-tab-load:hover { background: rgba(125, 211, 252, 0.16); color: #7dd3fc; }

/* 불러오기 모달 */
.mm-load-modal {
    position: absolute;
    inset: 0;
    z-index: 900;
    display: flex;
    align-items: center;
    justify-content: center;
}
.mm-load-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(4, 10, 20, 0.70);
}
.mm-load-inner {
    position: relative;
    z-index: 1;
    width: 420px;
    max-height: 70vh;
    display: flex;
    flex-direction: column;
    background: rgba(10, 20, 38, 0.97);
    border: 1px solid rgba(125, 211, 252, 0.22);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
    overflow: hidden;
}
.mm-load-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 18px;
    border-bottom: 1px solid rgba(125, 211, 252, 0.12);
    font-size: 0.9rem;
    font-weight: 700;
    color: rgba(224, 240, 255, 0.95);
    flex-shrink: 0;
}
.mm-load-header i { margin-right: 7px; color: #7dd3fc; }
.mm-load-new-folder {
    background: none;
    border: none;
    color: rgba(125, 211, 252, 0.55);
    font-size: 0.95rem;
    cursor: pointer;
    padding: 2px 4px;
    transition: color 0.15s;
}
.mm-load-new-folder:hover { color: #7dd3fc; }
.mm-load-close {
    background: none;
    border: none;
    color: rgba(178, 197, 222, 0.6);
    font-size: 1.2rem;
    cursor: pointer;
    line-height: 1;
    padding: 0 4px;
    transition: color 0.15s;
}
.mm-load-close:hover { color: #f87171; }
.mm-load-list {
    overflow-y: auto;
    padding: 8px 0;
}
.mm-load-list::-webkit-scrollbar { width: 5px; }
.mm-load-list::-webkit-scrollbar-track { background: transparent; }
.mm-load-list::-webkit-scrollbar-thumb { background: rgba(125, 211, 252, 0.2); border-radius: 3px; }
.mm-load-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 11px 18px;
    cursor: pointer;
    transition: background 0.12s;
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}
.mm-load-item:last-child { border-bottom: none; }
.mm-load-item:hover { background: rgba(125, 211, 252, 0.07); }
.mm-load-item.is-open { opacity: 0.55; cursor: default; }
.mm-load-item.is-open:hover { background: transparent; }
.mm-load-info { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.mm-load-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: rgba(224, 240, 255, 0.95);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.mm-load-date { font-size: 0.72rem; color: rgba(148, 163, 184, 0.7); }
.mm-load-badge {
    flex-shrink: 0;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 20px;
    background: rgba(96, 165, 250, 0.18);
    color: #7dd3fc;
    border: 1px solid rgba(125, 211, 252, 0.25);
}
.mm-load-item.is-open .mm-load-badge {
    background: rgba(100, 116, 139, 0.15);
    color: rgba(148, 163, 184, 0.6);
    border-color: rgba(100, 116, 139, 0.2);
}
.mm-load-empty {
    padding: 30px 18px;
    text-align: center;
    color: rgba(148, 163, 184, 0.5);
    font-size: 0.85rem;
}

/* 폴더 그룹 */
.mm-folder-group { border-bottom: 1px solid rgba(255,255,255,0.05); transition: background 0.15s; }
.mm-folder-group:last-child { border-bottom: none; }
.mm-folder-group.mm-drag-over { background: rgba(125, 211, 252, 0.08); outline: 1px dashed rgba(125, 211, 252, 0.4); outline-offset: -2px; }
.mm-load-item.mm-dragging { opacity: 0.4; cursor: grabbing; }
.mm-load-item[draggable="true"] { cursor: grab; }
.mm-folder-header {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 8px 14px 6px;
    font-size: 0.78rem;
    font-weight: 700;
    color: rgba(125, 211, 252, 0.85);
    letter-spacing: 0.03em;
    user-select: none;
}
.mm-folder-header i { font-size: 0.8rem; color: #7dd3fc; }
.mm-folder-count {
    margin-left: auto;
    background: rgba(125, 211, 252, 0.12);
    color: rgba(125, 211, 252, 0.7);
    border-radius: 8px;
    padding: 1px 7px;
    font-size: 0.7rem;
    font-weight: 600;
}
.mm-folder-items { padding-bottom: 4px; }

/* 불러오기 아이템 오른쪽 액션 */
.mm-load-actions { display: flex; align-items: center; gap: 6px; flex-shrink: 0; }
.mm-load-move-btn {
    background: none;
    border: 1px solid rgba(125, 211, 252, 0.2);
    color: rgba(125, 211, 252, 0.55);
    border-radius: 5px;
    padding: 3px 7px;
    font-size: 0.72rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.mm-load-move-btn:hover { background: rgba(125, 211, 252, 0.12); color: #7dd3fc; border-color: rgba(125, 211, 252, 0.4); }

/* 탭 우클릭 컨텍스트 메뉴 */
.mm-tab-menu {
    position: fixed;
    z-index: 99999;
    background: rgba(12, 25, 45, 0.97);
    border: 1px solid rgba(125, 211, 252, 0.25);
    border-radius: 8px;
    padding: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.5);
    min-width: 140px;
}
.mm-tab-menu button {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    color: rgba(232, 241, 255, 0.85);
    font-size: 0.82rem;
    padding: 7px 12px;
    border-radius: 5px;
    cursor: pointer;
    text-align: left;
    transition: background 0.13s, color 0.13s;
}
.mm-tab-menu button:hover { background: rgba(125, 211, 252, 0.1); color: #7dd3fc; }
.mm-tab-menu button i { width: 14px; text-align: center; }

/* toolbar */
.mindmap-toolbar {
    min-height: 52px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 10px 12px;
    border: 1px solid rgba(146, 164, 190, 0.18);
    border-radius: 0 10px 10px 10px;
    background: rgba(12, 25, 43, 0.80);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
    flex-shrink: 0;
}

.mindmap-title-block {
    display: flex;
    flex-direction: column;
    gap: 2px;
    flex-shrink: 0;
}
.mindmap-title-block strong { color: #f8fbff; font-size: 0.95rem; font-weight: 780; }
.mindmap-title-block span { color: rgba(178, 197, 222, 0.65); font-size: 0.72rem; transition: color 0.18s; }
.mindmap-title-block span.saved { color: #79f2bd; }

.mindmap-actions {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
}

.mindmap-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 32px;
    padding: 0 10px;
    border: 1px solid rgba(145, 165, 196, 0.18);
    border-radius: 7px;
    color: rgba(232, 241, 255, 0.88);
    background: rgba(255, 255, 255, 0.045);
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 660;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.14s, border-color 0.14s, color 0.14s;
}
.mindmap-btn:hover {
    color: #fff;
    border-color: rgba(126, 211, 255, 0.36);
    background: rgba(96, 165, 250, 0.12);
}
.mindmap-btn.primary {
    color: #062137;
    border-color: rgba(125, 211, 252, 0.68);
    background: linear-gradient(180deg, rgba(125, 211, 252, 0.95), rgba(74, 196, 255, 0.82));
}
.mindmap-btn.icon-only { padding: 0 9px; }
.mindmap-btn.mm-btn-danger {
    border-color: rgba(239, 68, 68, 0.35);
    color: rgba(252, 165, 165, 0.85);
}
.mindmap-btn.mm-btn-danger:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.6);
    color: #fca5a5;
}

/* zoom group */
.mm-zoom-group {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    border: 1px solid rgba(145, 165, 196, 0.18);
    border-radius: 7px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}
.mm-zoom-group .mindmap-btn {
    border: none;
    border-radius: 0;
    background: transparent;
}
.mm-zoom-group .mindmap-btn:hover { background: rgba(96, 165, 250, 0.14); }

.mm-zoom-label {
    min-width: 38px;
    text-align: center;
    font-size: 0.74rem;
    color: rgba(178, 197, 222, 0.75);
    pointer-events: none;
}

/* color picker */
.mm-color-wrap { position: relative; }

.mm-color-dot {
    display: inline-block;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: rgba(255, 255, 255, 0.18);
    flex-shrink: 0;
}

.mm-color-palette {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    flex-wrap: wrap;
    gap: 5px;
    padding: 10px;
    width: 172px;
    background: rgba(8, 18, 32, 0.97);
    border: 1px solid rgba(145, 165, 196, 0.24);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.mm-color-palette.open { display: flex; }

.mm-color-chip {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 6px;
    cursor: pointer;
    transition: transform 0.12s, box-shadow 0.12s;
}
.mm-color-chip:hover {
    transform: scale(1.18);
    box-shadow: 0 0 8px rgba(255, 255, 255, 0.25);
}
.mm-color-chip.reset {
    background: linear-gradient(135deg, #7dd3fc, #a78bfa, #fca5a5);
}

/* 팔레트 내 글자색 구분선 */
.mm-palette-divider {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 4px 0 2px;
    padding-top: 6px;
    border-top: 1px solid rgba(145, 165, 196, 0.2);
    color: rgba(145, 165, 196, 0.65);
    font-size: 0.68rem;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.mm-tcolor-chip {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    font-weight: 900;
    transition: transform 0.12s, box-shadow 0.12s;
    background: rgba(255,255,255,0.06);
}
.mm-tcolor-chip:hover { transform: scale(1.18); box-shadow: 0 0 8px rgba(255,255,255,0.25); }
.mm-tcolor-chip.reset { background: transparent; border-style: dashed; }

.mm-tcolor-dot {
    display: inline-block;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    border: 1px solid rgba(255,255,255,0.4);
    background: rgba(248,251,255,0.7);
    flex-shrink: 0;
}

/* board */
.mindmap-board-wrap {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow: hidden;
    cursor: grab;
    touch-action: none;
    border: 1px solid rgba(146, 164, 190, 0.16);
    border-radius: 12px;
    background:
        radial-gradient(circle at 20% 20%, rgba(96, 165, 250, 0.10), transparent 30%),
        radial-gradient(circle at 82% 28%, rgba(168, 85, 247, 0.08), transparent 32%),
        linear-gradient(180deg, rgba(8, 18, 32, 0.97), rgba(10, 22, 38, 0.96));
}
.mindmap-board-wrap:active { cursor: grabbing; }

.mindmap-board {
    position: absolute;
    top: 0;
    left: 0;
    width: 6000px;
    height: 4000px;
    transform-origin: 0 0;
    touch-action: none;
    background-image:
        linear-gradient(rgba(148, 163, 184, 0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(148, 163, 184, 0.05) 1px, transparent 1px);
    background-size: 40px 40px;
}

.mindmap-lines,
.mindmap-nodes {
    position: absolute;
    inset: 0;
    touch-action: none;
}

.mindmap-lines {
    pointer-events: none;
    overflow: visible;
}
.mindmap-lines path {
    fill: none;
    stroke: rgba(125, 211, 252, 0.55);
    stroke-width: 2;
    filter: drop-shadow(0 0 5px rgba(125, 211, 252, 0.22));
}

.mindmap-node {
    position: absolute;
    width: 150px;
    display: flex;
    align-items: center;
    padding: 6px 10px;
    border: 1px solid rgba(125, 211, 252, 0.28);
    border-radius: 10px;
    background: rgba(16, 34, 56, 0.92);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22), 0 0 14px rgba(56, 189, 248, 0.08);
    cursor: grab;
    user-select: none;
    touch-action: none;
    transition: box-shadow 0.15s;
    box-sizing: border-box;
}
.mindmap-node:active { cursor: grabbing; }

.mindmap-node.root {
    width: 176px;
    border-color: rgba(255, 179, 71, 0.52);
    background: rgba(54, 35, 18, 0.94);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.24), 0 0 20px rgba(255, 179, 71, 0.16);
}
.mindmap-node.warm  { border-color: rgba(255, 179, 71, 0.32); }
.mindmap-node.cool  { border-color: rgba(168, 85, 247, 0.32); }
.mindmap-node.selected {
    border-color: rgba(125, 211, 252, 0.88);
    box-shadow: 0 0 0 2px rgba(125, 211, 252, 0.16), 0 0 24px rgba(125, 211, 252, 0.28);
}

.mm-node-ta {
    width: 100%;
    border: 0;
    outline: 0;
    color: #f8fbff;
    background: transparent;
    font-family: inherit;
    font-size: 0.86rem;
    font-weight: 680;
    text-align: center;
    cursor: text;
    resize: none;
    overflow: hidden;
    line-height: 1.5;
    padding: 0;
    box-sizing: border-box;
    word-break: break-word;
}
.mindmap-node.root .mm-node-ta { font-size: 0.94rem; font-weight: 720; }

.mm-node-resize {
    position: absolute;
    bottom: 2px;
    right: 2px;
    width: 14px;
    height: 14px;
    cursor: se-resize;
    opacity: 0;
    transition: opacity 0.15s;
    background:
        linear-gradient(135deg, transparent 40%, rgba(125,211,252,0.7) 40%, rgba(125,211,252,0.7) 55%, transparent 55%),
        linear-gradient(135deg, transparent 60%, rgba(125,211,252,0.5) 60%, rgba(125,211,252,0.5) 75%, transparent 75%);
}
.mindmap-node:hover .mm-node-resize,
.mindmap-node.selected .mm-node-resize { opacity: 1; }

.mindmap-node.ellipse { border-radius: 50%; justify-content: center; }
.mindmap-node.root.ellipse { border-radius: 50%; }

/* style-group (shape / arrow / dash toggles) */
.mm-style-group {
    display: inline-flex;
    align-items: center;
    gap: 1px;
    border: 1px solid rgba(145, 165, 196, 0.18);
    border-radius: 7px;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.03);
}
.mm-style-group .mindmap-btn {
    border: none;
    border-radius: 0;
    background: transparent;
}
.mm-style-group .mindmap-btn:hover { background: rgba(96, 165, 250, 0.14); }
.mm-style-group .mindmap-btn.active {
    color: #7dd3fc;
    background: rgba(125, 211, 252, 0.14);
}

/* view-level classes */
.content-panel.mindmap-bg {
    padding: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    background: transparent;
}
.top-nav.mindmap-header {
    background: transparent;
    border-bottom: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
}
.top-nav.mindmap-header #currentPageTitle {
    color: #ffffff;
    text-shadow: 0 1px 6px rgba(0, 0, 0, 0.75);
}
.main-layout.mindmap-main { background: #081220; }

/* 내보내기 드롭다운 */
.mm-export-menu {
    display: none;
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    z-index: 200;
    flex-direction: column;
    gap: 3px;
    padding: 6px;
    min-width: 130px;
    background: rgba(8, 18, 32, 0.97);
    border: 1px solid rgba(145, 165, 196, 0.24);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
}
.mm-export-menu.open { display: flex; }
.mm-export-item {
    display: flex;
    align-items: center;
    gap: 7px;
    padding: 7px 10px;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #c8d8ee;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.13s;
}
.mm-export-item:hover { background: rgba(96, 165, 250, 0.14); color: #f0f8ff; }

/* 접기 버튼 */
.mm-collapse-btn {
    position: absolute;
    right: -10px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px; height: 18px;
    border-radius: 50%;
    border: 1px solid rgba(125,211,252,0.45);
    background: rgba(8,18,32,0.92);
    color: rgba(125,211,252,0.8);
    font-size: 0.55rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s;
    z-index: 5;
    padding: 0;
    line-height: 1;
}
.mindmap-node:hover .mm-collapse-btn,
.mindmap-node.selected .mm-collapse-btn { opacity: 1; }

/* 검색 하이라이트 */
.mindmap-node.mm-search-match {
    border-color: rgba(250,204,21,0.85) !important;
    box-shadow: 0 0 0 2px rgba(250,204,21,0.25), 0 0 18px rgba(250,204,21,0.3) !important;
}

/* 드롭 대상 하이라이트 */
.mindmap-node.mm-drop-target {
    border-color: rgba(74,222,128,0.9) !important;
    box-shadow: 0 0 0 2px rgba(74,222,128,0.25), 0 0 18px rgba(74,222,128,0.3) !important;
}

/* 복사 시각 피드백 */
.mindmap-node.mm-copied {
    border-color: rgba(96,165,250,0.9) !important;
    box-shadow: 0 0 0 3px rgba(96,165,250,0.3) !important;
    transition: box-shadow 0.1s, border-color 0.1s;
}

/* 검색 입력창 */
.mm-search-wrap {
    display: inline-flex;
    align-items: center;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(145,165,196,0.22);
    border-radius: 7px;
    padding: 0 8px;
    gap: 5px;
}
.mm-search-icon { color: rgba(145,165,196,0.6); font-size: 0.72rem; }
.mm-search-input {
    background: transparent;
    border: 0;
    outline: 0;
    color: #c8d8ee;
    font-size: 0.78rem;
    width: 96px;
    padding: 4px 0;
}
.mm-search-input::placeholder { color: rgba(145,165,196,0.45); }

@media (max-width: 760px) {
    .mindmap-toolbar {
        flex-direction: row;
        align-items: center;
        padding: 6px 8px;
        min-height: unset;
    }
    .mindmap-title-block { display: none; }
    .mindmap-actions {
        flex-wrap: nowrap;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }
    .mindmap-actions::-webkit-scrollbar { display: none; }
    .mindmap-board-wrap { min-height: 55vh; }
}

@media (max-width: 760px) {
    .quick-popup-body {
        display: block;
    }

    .quick-company-list-wrap {
        max-height: 38vh;
        border-right: 0;
        border-bottom: 1px solid rgba(148, 163, 184, 0.14);
    }

    .quick-info-grid {
        grid-template-columns: 1fr;
    }
}
