.mdi2 {
    display: flex;
    flex-direction: column;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    background: #fff;
    box-shadow: var(--shadow);
}

.mdi2-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 12px;
    background: #fff;
    border-bottom: 1px solid var(--border);
}

.mdi2-workspace {
    position: relative;
    flex: 1;
    display: flex;
    overflow: hidden;
    background: var(--bg);
}

.mdi2-empty {
    position: absolute; inset: 0;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 14px; color: var(--text-light); text-align: center; line-height: 1.7; font-size: 14px;
}
.mdi2-empty-icon { font-size: 44px; opacity: .55; }

/* 워크스페이스 가장자리 도킹 가이드 */
.dock-edge {
    position: absolute; z-index: 40;
    display: flex; align-items: center; justify-content: center;
    background: rgba(255,255,255,.95);
    border: 1px solid var(--primary); border-radius: 6px;
    box-shadow: 0 2px 8px rgba(45,53,71,.2);
    color: var(--primary); font-size: 13px; pointer-events: auto; cursor: copy;
}
.dock-edge.top    { top: 8px;    left: 50%; transform: translateX(-50%); width: 50px; height: 32px; }
.dock-edge.bottom { bottom: 8px; left: 50%; transform: translateX(-50%); width: 50px; height: 32px; }
.dock-edge.left   { left: 8px;   top: 50%;  transform: translateY(-50%); width: 32px; height: 50px; }
.dock-edge.right  { right: 8px;  top: 50%;  transform: translateY(-50%); width: 32px; height: 50px; }

.dock-edge-preview { position: absolute; z-index: 38; background: rgba(93,135,255,.16); border: 2px dashed var(--primary); pointer-events: none; }
.dock-edge-preview.top    { left: 0; right: 0; top: 0; height: 33%; }
.dock-edge-preview.bottom { left: 0; right: 0; bottom: 0; height: 33%; }
.dock-edge-preview.left   { top: 0; bottom: 0; left: 0; width: 33%; }
.dock-edge-preview.right  { top: 0; bottom: 0; right: 0; width: 33%; }
/* ───── 분할 컨테이너 ───── */
.dock-split {
    display: flex;
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    width: 100%;
    height: 100%;
}
.dock-split.h { flex-direction: row; }
.dock-split.v { flex-direction: column; }

.dock-pane {
    display: flex;
    flex-basis: 0;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.dock-splitter { flex: 0 0 6px; background: var(--border); position: relative; }
.dock-splitter:hover { background: var(--primary); }
.dock-splitter.h { cursor: col-resize; }
.dock-splitter.v { cursor: row-resize; }

/* ───── 탭 그룹 ───── */
.dock-group {
    display: flex;
    flex-direction: column;
    flex: 1 1 0;
    min-width: 0;
    min-height: 0;
    position: relative;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 8px;
    margin: 4px;
    overflow: hidden;
    box-shadow: var(--shadow);
}
.dock-group.active { border-color: var(--primary); box-shadow: 0 0 0 1px var(--primary) inset; }

.dock-tabs {
    display: flex;
    background: #f7f9fc;
    border-bottom: 1px solid var(--border);
    overflow-x: auto;
    flex-shrink: 0;
}
.dock-tab {
    display: inline-flex; align-items: center; gap: 7px;
    padding: 8px 8px 8px 13px;
    border-right: 1px solid var(--border);
    border-top: 2px solid transparent;
    cursor: pointer; font-size: 12.5px; white-space: nowrap; color: var(--text-muted);
    user-select: none;
}
.dock-tab:hover { background: var(--primary-soft); color: var(--primary); }
.dock-tab.active { background: #fff; font-weight: 700; color: var(--text); border-top-color: var(--primary); }
.dock-tab-icon { font-size: 12px; }
.dock-tab-close {
    border: none; background: rgba(45,53,71,.07); color: var(--text-muted);
    width: 17px; height: 17px; line-height: 1; border-radius: 50%;
    cursor: pointer; font-size: 9px; padding: 0; display: inline-flex; align-items: center; justify-content: center;
}
.dock-tab-close:hover { background: var(--error); color: #fff; }

.dock-content { flex: 1; overflow: auto; position: relative; background: #fff; }
.dock-doc { height: 100%; padding: 18px; }

/* ───── 도킹 가이드(다이아몬드) ───── */
.dock-guide-wrap {
    position: absolute; inset: 0; z-index: 30;
    display: flex; align-items: center; justify-content: center;
    pointer-events: none;
}
.dock-preview { position: absolute; background: rgba(93,135,255,.2); border: 2px solid var(--primary); pointer-events: none; }
.dock-preview.center { inset: 0; }
.dock-preview.left   { left: 0; top: 0; bottom: 0; width: 50%; }
.dock-preview.right  { right: 0; top: 0; bottom: 0; width: 50%; }
.dock-preview.top    { left: 0; right: 0; top: 0; height: 50%; }
.dock-preview.bottom { left: 0; right: 0; bottom: 0; height: 50%; }

.dock-guide { position: relative; width: 132px; height: 132px; }
.dock-z {
    position: absolute; width: 40px; height: 40px;
    background: rgba(255,255,255,.95);
    border: 1px solid var(--primary); border-radius: 6px;
    box-shadow: 0 2px 8px rgba(45,53,71,.2);
    pointer-events: auto; cursor: copy;
}
.dock-z::after {
    content: ""; position: absolute; inset: 5px;
    background: var(--primary-soft); border: 1px solid var(--primary); border-radius: 2px;
}
.dock-z.on { background: var(--primary); }
.dock-z.on::after { background: #fff; }
.dock-z.center { left: 46px; top: 46px; }
.dock-z.top    { left: 46px; top: 0; }
.dock-z.bottom { left: 46px; bottom: 0; }
.dock-z.left   { left: 0;  top: 46px; }
.dock-z.right  { right: 0; top: 46px; }
