/* Resize handles for every draggable split in the app.
   A 9px gutter of nothing tells nobody that the panes can be dragged, so each handle carries a
   visible grip, a hover state and a drag state. Shared by the Scripted APIs, Script Libraries,
   Scripting Console, App Builder panels and the workflow designer (shell + query builder) — do not
   re-declare the grip in a page's own styles. */

.oc-api-strip,
.oc-lib-strip,
.oc-scripting-strip,
.oc-resize-strip,
.wf-resizer,
.wf-cq-resizer,
.wf-cb-resizer {
    cursor: col-resize;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    background-color: transparent;
    transition: background-color 0.15s ease;
}

/* Only the three in-flow strips need positioning here; .oc-resize-strip is absolutely positioned
   by its page, which already anchors the grip. */
.oc-api-strip,
.oc-lib-strip,
.oc-scripting-strip,
.wf-resizer,
.wf-cq-resizer,
.wf-cb-resizer {
    position: relative;
}

/* The grip: two columns of dots, faintly visible at rest so the affordance is findable without
   hovering. Dots rather than a bar — a bar thin enough to fit the gutter reads as a border. */
.oc-api-strip::after,
.oc-lib-strip::after,
.oc-scripting-strip::after,
.oc-resize-strip::after,
.wf-resizer::after,
.wf-cq-resizer::after,
.wf-cb-resizer::after {
    --oc-grip-dot: rgb(from var(--mud-palette-text-secondary) r g b / 0.55);

    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 7px;
    height: 34px;
    background-image:
        radial-gradient(circle at 2px 3px, var(--oc-grip-dot) 1.2px, transparent 1.5px),
        radial-gradient(circle at 5px 3px, var(--oc-grip-dot) 1.2px, transparent 1.5px);
    background-size: 7px 6px;
    background-repeat: repeat-y;
    transition: height 0.15s ease;
    pointer-events: none;
}

.oc-api-strip:hover::after,
.oc-lib-strip:hover::after,
.oc-scripting-strip:hover::after,
.oc-resize-strip:hover::after,
.wf-resizer:hover::after,
.wf-resizer.is-dragging::after,
.wf-cq-resizer:hover::after,
.wf-cq-resizer.is-dragging::after,
.wf-cb-resizer:hover::after,
.wf-cb-resizer.is-dragging::after {
    --oc-grip-dot: var(--mud-palette-text-secondary);

    height: 52px;
}

.oc-api-strip:focus-visible,
.oc-lib-strip:focus-visible,
.oc-scripting-strip:focus-visible,
.oc-resize-strip:focus-visible,
.wf-resizer:focus-visible,
.wf-cq-resizer:focus-visible,
.wf-cb-resizer:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.oc-api-strip:hover,
.oc-lib-strip:hover,
.oc-scripting-strip:hover,
.oc-resize-strip:hover,
.wf-resizer:hover,
.wf-cq-resizer:hover,
.wf-cb-resizer:hover {
    background-color: rgb(from var(--mud-palette-primary) r g b / 0.08);
}

.oc-api-strip.is-resizing,
.oc-lib-strip.is-resizing,
.oc-scripting-strip.is-resizing,
.oc-resize-strip.is-resizing,
.wf-resizer.is-dragging,
.wf-cq-resizer.is-dragging,
.wf-cb-resizer.is-dragging {
    background-color: rgb(from var(--mud-palette-primary) r g b / 0.16);
}

.oc-api-strip.is-resizing::after,
.oc-lib-strip.is-resizing::after,
.oc-scripting-strip.is-resizing::after,
.oc-resize-strip.is-resizing::after,
.wf-resizer.is-dragging::after,
.wf-cq-resizer.is-dragging::after,
.wf-cb-resizer.is-dragging::after {
    --oc-grip-dot: var(--mud-palette-primary);

    height: 52px;
}

/* While dragging, the pointer must not select text or flicker over the panes it crosses.
   The axis classes are what keeps the cursor correct for a bottom-docked pane. */
body.oc-split-dragging {
    user-select: none;
    -webkit-user-select: none;
}

body.oc-split-dragging-x,
body.oc-split-dragging-x * {
    cursor: col-resize !important;
}

body.oc-split-dragging-y,
body.oc-split-dragging-y * {
    cursor: row-resize !important;
}

/* Stacked panes: the page above these screens cannot always scroll, so the split itself scrolls its
   panes. Height comes from oc-panes.js (see fit()), which measures the space left below the split. */
[data-stacked="1"] {
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

/* Short window: the split is only as tall as the viewport allows, so let it scroll rather than clip
   anything that still has an intrinsic minimum height. */
[data-compact="1"] {
    overflow-y: auto !important;
    overscroll-behavior: contain;
}

/* ── Horizontal strips ──
   A pane docked under the editor (email definition/body + validation, script library/API test pane)
   is resized vertically, so its gutter lies flat: row-resize cursor and a sideways dot grip. */
.oc-api-strip[data-axis="y"],
.oc-lib-strip[data-axis="y"],
.oc-mail-strip[data-axis="y"] {
    cursor: row-resize;
}

.oc-api-strip[data-axis="y"]::after,
.oc-lib-strip[data-axis="y"]::after,
.oc-mail-strip[data-axis="y"]::after {
    width: 34px;
    height: 7px;
    background-image:
        radial-gradient(circle at 3px 2px, var(--oc-grip-dot) 1.2px, transparent 1.5px),
        radial-gradient(circle at 3px 5px, var(--oc-grip-dot) 1.2px, transparent 1.5px);
    background-size: 6px 7px;
    background-repeat: repeat-x;
}

.oc-api-strip[data-axis="y"]:hover::after,
.oc-lib-strip[data-axis="y"]:hover::after,
.oc-mail-strip[data-axis="y"]:hover::after,
.oc-api-strip[data-axis="y"].is-resizing::after,
.oc-lib-strip[data-axis="y"].is-resizing::after,
.oc-mail-strip[data-axis="y"].is-resizing::after {
    width: 52px;
    height: 7px;
}

/* The mail strips get the same grip as the script screens — one implementation, one look. */
.oc-mail-strip {
    position: relative;
    cursor: col-resize;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
    background-color: transparent;
    transition: background-color 0.15s ease;
}

.oc-mail-strip::after {
    --oc-grip-dot: rgb(from var(--mud-palette-text-secondary) r g b / 0.55);

    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 7px;
    height: 34px;
    background-image:
        radial-gradient(circle at 2px 3px, var(--oc-grip-dot) 1.2px, transparent 1.5px),
        radial-gradient(circle at 5px 3px, var(--oc-grip-dot) 1.2px, transparent 1.5px);
    background-size: 7px 6px;
    background-repeat: repeat-y;
    transition: height 0.15s ease;
    pointer-events: none;
}

.oc-mail-strip:hover,
.oc-mail-strip.is-resizing {
    background-color: rgb(from var(--mud-palette-primary) r g b / 0.08);
}

.oc-mail-strip:hover::after {
    --oc-grip-dot: var(--mud-palette-text-secondary);

    height: 52px;
}

.oc-mail-strip:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}
