.wisePanelContainerLayout {
    width: 100%;
    height: 100%;
}

.wisePanelContainerLayout[data-layout="split-left-right"] {
    display: flex;
    flex-direction: row;
}

.wisePanelContainerLayout[data-layout="split-top-bottom"] {
    display: flex;
    flex-direction: column;
}

.wisePanelContainerLayout[data-layout="single"] .wisePanel {
    width: 100%;
    height: 100%;
}

.wisePanelContainerLayout[data-layout="split-left-right"] .wisePanel {
    height: 100%;
}

.wisePanelContainerLayout[data-layout="split-top-bottom"] .wisePanel {
    width: 100%;
}

.wisePanel {
    position: relative;
    display: none;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
}

.wisePanel.active {
    display: block;
}

.wisePanelContainerLayout[data-layout="split-left-right"] .wisePanel.active,
.wisePanelContainerLayout[data-layout="split-top-bottom"] .wisePanel.active {
    flex-grow: 0;
    flex-shrink: 0;
}

/* ========================================
   Panel internal layout
======================================== */
.wisePanelBody {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.wisePanelUiArea {
    position: absolute;
    inset: 0;
    z-index: 10;
    pointer-events: none;
}

/* side UI open: panel itself becomes row layout */
.wisePanel.active.wisePanel-sideUiOpen {
    display: flex;
    flex-direction: row;
    align-items: stretch;
}

/* side UI open: body becomes main content area */
.wisePanelBody-sideMode {
    position: relative;
    z-index: 1;
    flex: 1 1 auto;
    width: auto;
    height: 100%;
    min-width: 0;
    min-height: 0;
    order: 2;
}

/* side UI open: ui area joins the layout */
.wisePanelUiArea-sideMode {
    position: relative;
    inset: auto;
    z-index: 10;
    display: flex;
    flex: 0 0 min(420px, 40%);
    width: min(420px, 40%);
    max-width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    pointer-events: auto;
    order: 1;
    overflow: hidden;
}

/* ========================================
   Base layers
======================================== */
#wiseBaseLayerPanelContainer {
    z-index: 0;
}

#wiseBaseLayerPanelOverlay {
    z-index: 1000;
}

#wiseBaseLayerHud {
    z-index: 2000;
}

#wiseBaseLayerSuperOverlay {
    z-index: 3000;
}

/* ========================================
   Panel view
======================================== */
.wisePanelView {
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

.wisePanelViewContents {
    position: relative;
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
}

/* ========================================
   Header / toolbar / contents
======================================== */
.wisePanelHeader {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    min-height: 48px;
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    background: #fff;
}

.wisePanelHeaderLeft,
.wisePanelHeaderRight {
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    flex: 0 1 auto;
    flex-shrink: 0;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    scrollbar-width: thin;
}

.wisePanelTitle {
    flex: 1 1 0;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: center;
}

.wisePanelToolbar {
    flex: 0 0 auto;
    min-width: 0;
    padding: 8px 12px;
    border-bottom: 1px solid #ddd;
    background: #fff;
}

.wisePanelMainContentContainer {
    position: relative;
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.wisePanelMainContentArea {
    flex: 1 1 auto;
    min-width: 0;
    min-height: 0;
    overflow: auto;
    overscroll-behavior: contain;
}

/* ========================================
   View handle
======================================== */
.wisePanelViewHandle {
    position: absolute;
    top: 0;
    left: 0;
    z-index: 30;
    display: none;
    width: 14px;
    height: 100%;
    background: transparent;
    pointer-events: auto !important;
    touch-action: none;
    user-select: none;
    cursor: col-resize;
    transform: translateX(-50%);
}

.wisePanel-sideUiOpen .wisePanelViewHandle {
    display: block;
}

.wisePanelViewHandle::before {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
}

.wisePanelViewHandle::after {
    top: 50%;
    left: 50%;
    width: 8px;
    height: 56px;
    transform: translate(-50%, -50%);
}

/* ========================================
   Panel UI
======================================== */
.wisePanelUi-side,
.wisePanelUi-float {
    pointer-events: auto;
}

.wisePanelUi-side {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 12;
    display: flex;
    flex-direction: column;
    width: min(420px, 40%);
    max-width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
    background: #fff;
    border-left: 1px solid #ddd;
}

.wisePanelUiArea-sideMode .wisePanelUi-side {
    position: relative;
    top: auto;
    right: auto;
    z-index: auto;
    flex: 1 1 auto;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    border-left: 0;
    border-right: 1px solid #ddd;
    background: #fff;
}

.wisePanelUi-float {
    position: fixed;
    z-index: 15;
}

.wisePanelUi-side ul,
.wisePanelUi-float ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* ========================================
   Form controls in header / toolbar
======================================== */
.wisePanelHeader button,
.wisePanelHeader select,
.wisePanelHeader input,
.wisePanelToolbar button,
.wisePanelToolbar select,
.wisePanelToolbar input {
    max-width: 100%;
}

.wisePanelHeader img,
.wisePanelToolbar img {
    display: block;
    max-width: 100%;
    height: auto;
}

/* ========================================
   Layout splitter
======================================== */
.wisePanelLayoutSplitter {
    position: absolute;
    z-index: 30;
    display: none;
    background: transparent;
    pointer-events: auto !important;
    touch-action: none;
    user-select: none;
}

.wisePanelLayoutSplitter::before,
.wisePanelLayoutSplitter::after,
.wisePanelViewHandle::before,
.wisePanelViewHandle::after {
    content: "";
    position: absolute;
    pointer-events: none;
    transition:
        background-color 0.15s ease,
        opacity 0.15s ease,
        box-shadow 0.15s ease,
        transform 0.15s ease;
}

.wisePanelLayoutSplitter::before,
.wisePanelViewHandle::before {
    background: rgba(120, 130, 145, 0.9);
    border-radius: 999px;
    opacity: 0.9;
}

.wisePanelLayoutSplitter::after,
.wisePanelViewHandle::after {
    background: rgba(255, 255, 255, 0.96);
    border: 1px solid rgba(160, 170, 185, 0.95);
    border-radius: 999px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18);
    opacity: 0.95;
}

/******************************************************
 * 左右分割
 ******************************************************/
.wisePanelContainerLayout[data-layout="split-left-right"] .wisePanelLayoutSplitter {
    top: 0;
    bottom: 0;
    display: block;
    width: 14px;
    margin-left: -7px;
    cursor: col-resize;
}

.wisePanelContainerLayout[data-layout="split-left-right"] .wisePanelLayoutSplitter::before {
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
}

.wisePanelContainerLayout[data-layout="split-left-right"] .wisePanelLayoutSplitter::after {
    top: 50%;
    left: 50%;
    width: 8px;
    height: 56px;
    transform: translate(-50%, -50%);
}

/******************************************************
 * 上下分割
 ******************************************************/
.wisePanelContainerLayout[data-layout="split-top-bottom"] .wisePanelLayoutSplitter {
    left: 0;
    right: 0;
    display: block;
    height: 14px;
    margin-top: -7px;
    cursor: row-resize;
}

.wisePanelContainerLayout[data-layout="split-top-bottom"] .wisePanelLayoutSplitter::before {
    left: 0;
    right: 0;
    top: 50%;
    height: 2px;
    transform: translateY(-50%);
}

.wisePanelContainerLayout[data-layout="split-top-bottom"] .wisePanelLayoutSplitter::after {
    top: 50%;
    left: 50%;
    width: 56px;
    height: 8px;
    transform: translate(-50%, -50%);
}

/******************************************************
 * hover / drag
 ******************************************************/
.wisePanelLayoutSplitter:hover::before,
.wisePanelLayoutSplitter:hover::after,
.wisePanelViewHandle:hover::before,
.wisePanelViewHandle:hover::after
{
    background-color: rgba(57, 213, 255, 0.98);
    border-color: rgba(57, 213, 255, 0.98);
    box-shadow: 0 0 0 1px rgba(57, 213, 255, 0.12), 0 0 10px rgba(57, 213, 255, 0.35);
}

.wisePanelViewHandle.wisePanelViewHandleDragging::before,
.wisePanelViewHandle.wisePanelViewHandleDragging::after,
.wisePanelViewHandle:hover::before,
.wisePanelViewHandle:hover::after
{
    background-color: rgba(57, 213, 255, 1);
    border-color: rgba(57, 213, 255, 1);
    box-shadow: 0 0 0 1px rgba(57, 213, 255, 0.16), 0 0 14px rgba(57, 213, 255, 0.45);
}


/******************************************************
 * move
 ******************************************************/
 /* デバッグ 後で復元 */
 /* .wisePanelDragScrollLock {
    overscroll-behavior: contain;
    touch-action: none;
} */

.wisePanelDragScrollLock {
    overflow: hidden !important;
    overscroll-behavior: contain;
    touch-action: none;
}

.wiseSelectionLock,
.wiseSelectionLock * {
    user-select: none;
    -webkit-user-select: none;
}

.wiseSelectionLock textarea,
.wiseSelectionLock input {
    user-select: none;
    -webkit-user-select: none;
}

.drag-source-hidden {
    opacity: 0;
    pointer-events: none;
}


.drag-current-preview-clone.cannot-drop {
    border: 2px solid red;
    background: rgba(255, 0, 0, 0.1);
}

.drag-current-preview-clone.cannot-drop::after {
    content: '✖';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    
    font-size: 48px;
    color: red;
    font-weight: bold;

    pointer-events: none;
}

/******************************************************
 * screen overlay
 ******************************************************/
 .wisePanelScreenOverlay {
    position: absolute;
    inset: 0;

    width: 100%;
    height: 100%;

    display: flex;
    justify-content: center;
    align-items: center;

    background: rgba(0, 0, 0, 0.5);

    visibility: hidden;
    opacity: 0;

    transition: opacity 0.2s ease;

    z-index: 10;

    /* パネル外へのイベント漏れ防止 */
    pointer-events: none;
}

.wisePanelScreenOverlay.overlay-on {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}