/* Zone editor panel chrome — shared tokens for sidebar, sash, float, accordions */
:root {
    interpolate-size: allow-keywords;
}

.editor-sidebar {
    --panel-bg: #ffffff;
    --panel-surface: #f7f8fa;
    --panel-border: #e6e8ec;
    --panel-text: #2c3340;
    --panel-muted: #6b7280;
    --panel-accent: #5b6cff;
    --panel-radius: 10px;
    --panel-shadow: 0 8px 28px rgba(15, 23, 42, 0.12);
    --sash-hot: rgba(91, 108, 255, 0.55);
    --accordion-ease: cubic-bezier(0.22, 1, 0.36, 1);
    --sidebar-width: 320px;
    background: var(--panel-bg);
    color: var(--panel-text);
}

/* Dock mode segmented control */
.dock-mode-control {
    display: inline-flex;
    align-items: stretch;
    border: 1px solid var(--panel-border);
    border-radius: 8px;
    overflow: hidden;
    background: var(--panel-surface);
}

.dock-mode-control button {
    border: none;
    background: transparent;
    color: var(--panel-muted);
    padding: 4px 8px;
    font-size: 11px;
    line-height: 1;
    min-height: 28px;
    min-width: 28px;
    cursor: pointer;
    transition: background 0.15s ease, color 0.15s ease;
}

.dock-mode-control button + button {
    border-left: 1px solid var(--panel-border);
}

.dock-mode-control button:hover {
    color: var(--panel-text);
    background: rgba(91, 108, 255, 0.06);
}

.dock-mode-control button.active {
    background: #ffffff;
    color: var(--panel-accent);
    font-weight: 600;
}

.dock-mode-control button:focus-visible {
    outline: 2px solid var(--panel-accent);
    outline-offset: -2px;
    z-index: 1;
}

/* VS Code–style sash */
.sidebar-sash {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 12px;
    margin: 0;
    padding: 0;
    border: none;
    background: transparent;
    cursor: col-resize;
    z-index: 6;
    touch-action: none;
}

.sidebar-sash::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    transform: translateX(-50%);
    background: transparent;
    transition: background 0.15s ease, opacity 0.15s ease;
    opacity: 0;
}

.sidebar-sash:hover::after,
.sidebar-sash:focus-visible::after,
.sidebar-sash.is-dragging::after {
    background: var(--sash-hot);
    opacity: 1;
}

.sidebar-sash:focus-visible {
    outline: none;
}

.editor-sidebar.docked-left .sidebar-sash {
    right: -6px;
}

.editor-sidebar.docked-right .sidebar-sash {
    left: -6px;
}

/* Float card chrome */
.editor-sidebar.floating {
    border-radius: var(--panel-radius);
    box-shadow: var(--panel-shadow);
    border: 1px solid var(--panel-border);
    overflow: hidden;
}

.editor-sidebar.floating .sidebar-header {
    cursor: grab;
    user-select: none;
}

.editor-sidebar.floating .sidebar-header.is-dragging {
    cursor: grabbing;
}

.sidebar-drag-grip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    color: var(--panel-muted);
    opacity: 0.55;
    letter-spacing: 1px;
    font-size: 10px;
    margin-right: 4px;
}

.sidebar-drag-grip::before {
    content: "⋮⋮";
}

/* Float resize grips */
.float-resize-handle {
    position: absolute;
    z-index: 7;
    background: transparent;
    touch-action: none;
}

.float-resize-e {
    top: 12px;
    right: 0;
    width: 8px;
    bottom: 12px;
    cursor: ew-resize;
}

.float-resize-s {
    left: 12px;
    right: 12px;
    bottom: 0;
    height: 8px;
    cursor: ns-resize;
}

.float-resize-se {
    right: 0;
    bottom: 0;
    width: 14px;
    height: 14px;
    cursor: nwse-resize;
}

.editor-sidebar.floating:hover .float-resize-se::after {
    content: "";
    position: absolute;
    right: 3px;
    bottom: 3px;
    width: 8px;
    height: 8px;
    border-right: 2px solid var(--panel-muted);
    border-bottom: 2px solid var(--panel-muted);
    opacity: 0.7;
}

/* Snap ghost */
.dock-snap-ghost {
    position: fixed;
    top: 60px;
    bottom: 0;
    width: 8px;
    background: var(--sash-hot);
    opacity: 0;
    pointer-events: none;
    z-index: 1005;
    transition: opacity 0.15s ease;
}

.dock-snap-ghost.visible {
    opacity: 0.55;
}

.dock-snap-ghost.left {
    left: 0;
}

.dock-snap-ghost.right {
    right: 0;
}

/* Accordion chrome (shared; component CSS also applies) */
.settings-accordion {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.settings-accordion details.accordion-section {
    border-bottom: 1px solid var(--panel-border, #e6e8ec);
}

.settings-accordion details.accordion-section:last-child {
    border-bottom: none;
}

.settings-accordion details.accordion-section > summary {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 4px 10px 10px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--panel-muted, #6b7280);
    cursor: pointer;
    background: var(--panel-bg, #fff);
    border-left: 2px solid transparent;
    transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
    user-select: none;
}

.settings-accordion details.accordion-section > summary::-webkit-details-marker {
    display: none;
}

.settings-accordion details.accordion-section > summary::after {
    content: "";
    margin-left: auto;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(-45deg);
    transition: transform 0.2s var(--accordion-ease, ease);
    opacity: 0.7;
}

.settings-accordion details.accordion-section[open] > summary {
    color: var(--panel-text, #2c3340);
    background: var(--panel-surface, #f7f8fa);
}

.settings-accordion details.accordion-section[open] > summary::after {
    transform: rotate(45deg);
}

.settings-accordion details.accordion-section.is-context > summary,
.settings-accordion details.accordion-section.is-pinned > summary {
    border-left-color: var(--panel-accent, #5b6cff);
}

/* Native <details> already hides closed content. Do not force height:0 /
   content-visibility:hidden on ::details-content — that clips pointer events
   on lower fields (e.g. Zone purpose) during open transitions so clicks hit
   the next section summary and collapse the panel. */
.settings-accordion details.accordion-section::details-content {
    display: block;
}

.settings-accordion .accordion-body {
    padding: 4px 4px 14px 10px;
}

.settings-accordion .inspector-row {
    display: grid;
    grid-template-columns: minmax(72px, 38%) 1fr;
    gap: 8px;
    align-items: start;
    margin-bottom: 10px;
}

.settings-accordion .inspector-row .setting-label,
.settings-accordion .inspector-row .property-label {
    margin-bottom: 0;
    padding-top: 6px;
}
