/* ========= BASE ========== */
:root {
    --topbar-h: 52px;
    --left-pane-w: 280px;
    --left-pane-collapsed-w: 58px;
    --right-pane-w: 360px;
    --radius: 12px;
    --gap: 12px;
    --font: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Cantarell, "Noto Sans", "Helvetica Neue", Arial, "Apple Color Emoji", "Segoe UI Emoji";
    --grid-size: 32px;
    /* Тема подставит свои значения */
    --bg: #0f1318;
    --panel: #141a22;
    --panel-2: #0f141a;
    --text: #d7e1ee;
    --muted: #98a2b3;
    --line: #273143;
    --accent: #2ea7ff;
    --danger: #f05555;
    --btn-bg: #1c2430;
    --btn-bg-hover: #222c3a;
    --btn-fg: #dbe4f1;
    --pill-bg: #18212c;
    --pill-fg: #dbe4f1;
    --tab-bg: #1a2230;
    --tab-fg: #cfe0ff;
    --tab-current-bg: #263247;
    --tab-current-fg: #fff;
}

* {
    box-sizing: border-box
}

html, body {
    height: 100%
}

body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    /* Скроллим только центр */
    overflow: hidden;
}

body.workspace-shell-transition {
    position: relative;
}

body.workspace-shell-transition .layout {
    transition: opacity 220ms ease, transform 240ms ease, filter 240ms ease;
}

body.workspace-shell-transition::before {
    content: "";
    position: fixed;
    top: var(--topbar-h);
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 4;
    pointer-events: none;
    opacity: 0;
    background: linear-gradient(180deg, color-mix(in oklab, var(--panel) 82%, var(--bg)) 0%, color-mix(in oklab, var(--panel-2) 92%, var(--bg)) 100%);
    transition: opacity 200ms ease;
}

body.workspace-shell-transition.workspace-shell-booting::before {
    opacity: 1;
}

body.workspace-shell-transition.workspace-shell-booting .layout {
    opacity: 0;
    transform: translateY(10px);
    filter: blur(8px);
    pointer-events: none;
}

body.workspace-shell-transition.workspace-shell-leaving .layout {
    opacity: 0;
    transform: translateY(-6px);
    filter: blur(4px);
    pointer-events: none;
}

body.workspace-shell-transition.workspace-shell-leaving::before {
    opacity: 1;
}

body.workspace-shell-transition.workspace-shell-ready .layout {
    opacity: 1;
    transform: translateY(0);
    filter: none;
}

/* ========= TOPBAR ========= */
.topbar {
    height: var(--topbar-h);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    gap: 12px;
    background: var(--panel);
    border-bottom: 1px solid var(--line);
}

.left-tools, .right-tools {
    display: flex;
    align-items: center;
    gap: 10px
}

.scenario-picker {
    display: flex;
    align-items: center;
    gap: 8px
}

.scenario-search {
    height: 34px;
    min-width: 260px;
    padding: 0 12px;
    border-radius: 10px;
    border: 1px solid var(--line);
    background: var(--panel-2);
    color: var(--text);
    outline: none;
}

.scenario-dropdown {
    position: absolute;
    top: calc(var(--topbar-h) - 4px);
    left: 14px;
    width: 460px;
    max-height: 60vh;
    overflow: auto;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    box-shadow: 0 12px 30px rgba(0,0,0,.35);
    display: none;
    z-index: 20;
}

.scenario-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 12px;
    gap: 10px;
    border-bottom: 1px dashed rgba(255,255,255,.05)
}

    .scenario-item:last-child {
        border-bottom: none
    }

.scenario-meta {
    color: var(--muted);
    font-size: 12px
}

.save-state {
    color: #9ad39a;
    font-size: 13px;
    opacity: 1;
    transition: opacity .18s ease, color .18s ease
}

.save-state.unsaved {
    color: #f0d39c;
    opacity: 1
}

.save-state.save-state-idle {
    opacity: 0
}

/* ========= BUTTONS ========= */
.btn {
    height: 34px;
    padding: 0 12px;
    background: var(--btn-bg);
    color: var(--btn-fg);
    border: 1px solid var(--line);
    border-radius: 10px;
    cursor: pointer
}

    .btn:hover {
        background: var(--btn-bg-hover)
    }

.btn.small {
    height: auto;
    padding: 6px 10px;
    font-size: 13px;
    pointer-events: auto;
}

.btn-ghost {
    background: transparent;
    color: var(--muted);
    border-color: transparent
}

    .btn-ghost:hover {
        background: var(--btn-bg)
    }

.btn-danger {
    /* fallback для IDE */
    background: rgba(240, 85, 85, 0.25);
    border-color: rgba(240, 85, 85, 0.40);
    /* современный вариант */
    background: color-mix(in oklab, var(--danger) 25%, transparent);
    border-color: color-mix(in oklab, var(--danger) 40%, transparent);
}

    .btn-danger:hover {
        background: rgba(240, 85, 85, 0.35);
        background: color-mix(in oklab, var(--danger) 35%, transparent);
    }

.block-list {
    display: flex;
    flex-direction: column;
    gap: 10px
}

.block-pill {
    height: 40px;
    border-radius: 999px;
    background: var(--pill-bg);
    color: var(--pill-fg);
    border: 1px solid var(--line);
    cursor: pointer
}

/* ========= SWITCH ========= */
.switch {
    position: relative;
    display: inline-flex;
    align-items: center;
    width: 48px;
    height: 26px
}

    .switch input {
        appearance: none;
        display: none
    }

    .switch .slider {
        position: absolute;
        inset: 0;
        border-radius: 999px;
        background: #2a3444;
        border: 1px solid var(--line);
        transition: 200ms
    }

        .switch .slider::after {
            content: "";
            position: absolute;
            top: 3px;
            left: 3px;
            width: 20px;
            height: 20px;
            border-radius: 50%;
            background: #fff;
            transition: 200ms
        }

    .switch input:checked + .slider {
        background: #3a79ff
    }

        .switch input:checked + .slider::after {
            transform: translateX(22px)
        }

.switch-label {
    color: var(--muted);
    font-size: 13px
}

/* ========= LAYOUT ========= */
.layout {
    height: calc(100vh - var(--topbar-h));
    display: grid;
    grid-template-columns: var(--left-pane-w) 1fr var(--right-pane-w);
    gap: 0;
    transition: grid-template-columns 180ms ease;
}

.left-pane, .right-pane {
    position: sticky;
    top: 0;
    align-self: start;
    height: 100%;
    overflow: auto;
    overscroll-behavior: contain;
    background: var(--panel);
    border-right: 1px solid var(--line);
}

.right-pane {
    border-right: none;
    border-left: 1px solid var(--line);
    overflow-x: hidden; /* фикс нижней горизонтальной прокрутки */
}

.pane-title {
    font-weight: 600;
    margin: 12px;
    margin-bottom: 8px
}

.mt {
    margin-top: 18px
}

.help {
    color: var(--muted);
    font-size: 13px;
    padding: 0 12px 12px
}

/* Центр */
.canvas-wrap {
    height: 100%;
    overflow: auto; /* скролл только если есть переполнение */
    scrollbar-gutter: stable both-edges; /* без дёрганий контента при появлении полос */
    position: relative;
    background: var(--panel-2);
    scrollbar-width: none; /* Firefox */
}

    .canvas-wrap::-webkit-scrollbar {
        width: 0;
        height: 0
    }

.surface {
    position: relative;
    width: 100%;
    height: 100%
}

.grid {
    position: absolute;
    inset: 0
}

#canvas {
    position: absolute;
    inset: 0
}

/* сетка */
.grid {
    background: linear-gradient(to right, var(--line) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size), linear-gradient(to bottom, var(--line) 1px, transparent 1px) 0 0 / var(--grid-size) var(--grid-size);
    opacity: .5;
}

/* ========= Tabs ========= */
#rightTabs {
    display: flex;
    gap: 8px;
    padding: 12px
}

.tab {
    height: 30px;
    padding: 0 12px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--tab-bg);
    color: var(--tab-fg);
    cursor: pointer
}

    .tab.current {
        background: var(--tab-current-bg);
        color: var(--tab-current-fg);
        border-color: transparent
    }

.tab-panel {
    /* было: padding: 12px */
    padding: 0 12px 12px; /* убрали лишний верхний отступ */
}

.hidden {
    display: none
}

.muted {
    color: var(--muted)
}

/* ========= Overlay ========= */
.overlay.hidden {
    display: none
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: grid;
    place-items: center
}

.overlay-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,.45)
}

.overlay-panel {
    position: relative;
    width: min(1100px,96vw);
    height: min(80vh,800px);
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line)
}

.gallery-grid {
    padding: 16px;
    overflow: auto;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px,1fr));
    gap: 12px
}

/* ==== Wide gallery overlay ==== */
:root {
    --topbar-h: 52px;
    --left-pane-w: 280px;
    --right-pane-w: 360px;
    --overlay-z: 1000;
    --overlay-bg: rgba(0,0,0,.35);
}

.overlay {
    position: fixed;
    inset: 0;
    z-index: var(--overlay-z);
}

    .overlay.hidden {
        display: none;
    }

.overlay-backdrop {
    position: fixed;
    top: var(--topbar-h);
    left: var(--left-pane-w);
    right: var(--right-pane-w);
    bottom: 0;
    background: var(--overlay-bg);
}

.overlay-panel {
    position: fixed;
    top: var(--topbar-h);
    left: var(--left-pane-w);
    right: var(--right-pane-w);
    bottom: 0;
    width: auto;
    height: auto;
    margin: 0;
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.overlay-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--line);
    flex: 0 0 auto;
}

.gallery-grid, #galleryGrid {
    flex: 1 1 auto;
    overflow: auto;
    padding: 12px 16px;
    height: 100%;
    box-sizing: border-box;
}
/* Dropdown full width */
:root {
    --topbar-h: 52px;
    --left-pane-w: 280px;
    --right-pane-w: 360px;
}

.scenario-dropdown {
    position: fixed !important;
    top: var(--topbar-h);
    left: var(--left-pane-w);
    right: var(--right-pane-w);
    bottom: 0;
    width: auto !important;
    max-height: none !important;
    margin: 0;
    border-radius: 12px;
    overflow: auto;
    z-index: 1000;
    pointer-events: none;
}

.scenario-dropdown[style*="display: block"] {
    pointer-events: auto;
}
}

.scenario-item {
    padding: 10px 14px;
    gap: 12px;
}

/* ====== (старый) Props attribute grid — можно оставить на будущее ====== */
.props-grid {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 6px 12px;
    padding: 8px 12px 16px;
    align-items: start;
}

    .props-grid .h {
        grid-column: 1 / -1;
        margin: 8px 0 4px;
        color: var(--muted);
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: .06em;
    }

.attr-name {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
    white-space: nowrap;
}

.attr-value {
    font-size: 13px;
    line-height: 1.4;
    word-break: break-word;
}

    .attr-value code {
        font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
        font-size: 12px;
        background: var(--panel-2);
        border: 1px dashed var(--line);
        padding: 2px 6px;
        border-radius: 6px;
    }

.props-actions {
    display: flex;
    gap: 8px;
    padding: 8px 12px 16px;
}

/* ===== Props: табличная атрибутивная модель ===== */
.props-head {
    padding: 0 12px 6px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-weight: 600;
}

.props-table {
    border: 1px solid var(--line);
    border-radius: 10px;
    overflow: hidden;
    margin: 0; /* не распираем панель */
    width: 100%;
    box-sizing: border-box;
}

.props-behavior {
    display: grid;
    gap: 10px;
    margin: 10px 0 0;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: color-mix(in oklab, var(--panel) 94%, var(--text) 6%);
}

.props-behavior__head {
    display: grid;
    gap: 4px;
}

.props-behavior__head span {
    font-size: 13px;
    font-weight: 700;
}

.props-behavior__head small,
.props-regex__note {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.35;
}

.step-events-table {
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: color-mix(in oklab, var(--panel) 92%, transparent);
}

.step-events-row {
    display: grid;
    grid-template-columns: minmax(92px, .82fr) minmax(0, 1.18fr);
    min-height: 44px;
    border-top: 1px solid var(--line);
}

.step-events-row:first-child {
    border-top: 0;
}

.step-events-row > div {
    min-width: 0;
    padding: 9px 10px;
}

.step-events-row > div + div {
    border-left: 1px solid var(--line);
}

.step-events-row--head {
    min-height: 30px;
    background: color-mix(in oklab, var(--accent) 12%, transparent);
    color: var(--muted);
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.step-events-row--head > div {
    padding-top: 7px;
    padding-bottom: 7px;
}

.step-events-row--editable {
    background: color-mix(in oklab, var(--accent) 6%, transparent);
}

.step-event-name {
    display: grid;
    align-content: center;
    gap: 3px;
}

.step-event-name strong {
    color: var(--text);
    font-size: 12px;
    line-height: 1.2;
}

.step-event-name small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.2;
    text-transform: uppercase;
}

.step-event-handler {
    display: grid;
    gap: 5px;
    align-content: center;
    color: var(--text);
    font-size: 12px;
    line-height: 1.35;
    overflow-wrap: anywhere;
}

.step-event-handler small {
    color: var(--muted);
    font-size: 10px;
    line-height: 1.25;
}

.step-event-control {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 28px;
    gap: 6px;
    align-items: center;
}

.step-event-missing {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 74px;
    gap: 6px;
    align-items: center;
}

.step-event-missing label {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 4px;
    align-items: center;
}

.step-event-missing label span {
    color: var(--muted);
    font-size: 10px;
}

.step-event-remove,
.step-event-add {
    border: 1px solid var(--line);
    background: color-mix(in oklab, var(--panel) 88%, var(--text) 12%);
    color: var(--text);
    cursor: pointer;
}

.step-event-remove {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    font-size: 17px;
    line-height: 1;
}

.step-event-remove:disabled,
.step-event-add:disabled {
    opacity: .45;
    cursor: default;
}

.step-event-add {
    justify-self: start;
    padding: 6px 9px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
}

.props-field {
    display: grid;
    gap: 6px;
}

.props-field.is-hidden,
.inline-check.is-hidden {
    display: none;
}

.props-wait-grid {
    display: grid;
    gap: 8px;
}

.inline-check {
    display: flex;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 12px;
}

.props-field > span {
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.props-input {
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
    padding: 7px 9px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--panel);
    color: var(--text);
    outline: none;
}

.props-input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px color-mix(in oklab, var(--accent) 18%, transparent);
}

.element-grade {
    display: grid;
    gap: 3px;
    padding: 9px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: color-mix(in oklab, var(--panel) 92%, transparent);
    color: var(--muted);
    font-size: 12px;
}

.element-grade strong {
    color: var(--text);
}

.element-grade--good {
    border-color: color-mix(in oklab, #22c55e 55%, var(--line));
}

.element-grade--warning {
    border-color: color-mix(in oklab, #f59e0b 60%, var(--line));
}

.element-grade--risky {
    border-color: color-mix(in oklab, #ef4444 60%, var(--line));
}

.props-regex,
.props-condition {
    display: grid;
    gap: 8px;
}

.props-regex.is-hidden,
.props-condition.is-hidden {
    display: none;
}

.props-regex.is-invalid .props-input {
    border-color: #ef4444;
}

.props-regex.is-invalid .props-regex__note {
    color: #fca5a5;
}

    .props-table .row {
        display: grid;
        grid-template-columns: 180px 1fr; /* фикс ширина колонки имени */
        gap: 0;
        align-items: center;
        padding: 4px 8px; /* компактнее */
        border-top: 1px solid color-mix(in oklab, var(--line) 85%, transparent);
    }

        .props-table .row:first-child {
            border-top: none;
        }
        /* зебра с fallback */
        .props-table .row:nth-child(odd) {
            background: rgba(0,0,0,.02);
            background: color-mix(in oklab, var(--panel) 92%, var(--text) 8%);
        }
    /* вертикальная граница между колонками */
    .props-table .attr-name {
        color: var(--muted);
        font-size: 13px;
        line-height: 1.3;
        white-space: nowrap;
        padding-right: 8px;
        margin-right: 8px;
        border-right: 1px solid var(--line);
    }

    .props-table .attr-value {
        font-size: 13px;
        line-height: 1.3;
        word-break: break-word;
        white-space: normal;
    }
        /* code-чипы */
        .props-table .attr-value code {
            font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, 'Liberation Mono', monospace;
            font-size: 12px;
            background: color-mix(in oklab, var(--panel) 92%, var(--text) 8%);
            border: 1px dashed var(--line);
            padding: 2px 6px;
            border-radius: 6px;
        }

/* JSON-блок под таблицей */
pre.json {
    margin: 8px 0 12px; /* нет боковых внешних отступов */
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid var(--line);
    background: rgba(0,0,0,.03);
    background: color-mix(in oklab, var(--panel) 94%, var(--text) 6%);
    max-width: 100%;
    overflow: auto; /* скролл внутри JSON, не у всей страницы */
}

/* ссылки внутри значений */
.attr-value a {
    color: var(--accent);
    text-decoration: none;
}

    .attr-value a:hover {
        text-decoration: underline;
    }
/* ====== БЛОК CSS — кнопка закрытия как в списке сценариев: BEGIN ====== */
.scgrp-close {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--line);
    border-radius: 8px;
    padding: 4px 8px;
    cursor: pointer;
    line-height: 1;
}

    .scgrp-close:hover {
        border-color: var(--accent);
    }
/* ====== БЛОК CSS — кнопка закрытия как в списке сценариев: END ====== */

/* ========= Workspace Navigation / Access ========= */
.workspace-nav {
    display: grid;
    gap: 10px;
    padding: 0 12px 12px;
}

.workspace-nav__controls {
    display: flex;
    justify-content: flex-end;
}

.workspace-nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: color-mix(in oklab, var(--pill-bg) 82%, var(--panel));
    color: var(--text);
    cursor: pointer;
    transition: border-color 160ms ease, background 160ms ease, color 160ms ease;
}

.workspace-nav-toggle:hover {
    border-color: color-mix(in oklab, var(--accent) 48%, var(--line));
    background: color-mix(in oklab, var(--pill-bg) 72%, var(--panel));
}

.workspace-nav-toggle__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
}

.workspace-nav-toggle__icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.8;
    transition: transform 180ms ease;
}

.workspace-nav-toggle__label {
    min-width: 0;
}

.workspace-server-status {
    display: grid;
    grid-template-columns: 10px auto 1fr;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: color-mix(in oklab, var(--pill-bg) 82%, var(--panel));
    color: var(--muted);
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease, opacity 180ms ease;
}

.workspace-server-status__dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: #d8b36e;
    box-shadow: 0 0 0 4px color-mix(in oklab, #d8b36e 20%, transparent);
}

.workspace-server-status__label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.workspace-server-status__value {
    justify-self: end;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
}

.workspace-server-status.is-online {
    border-color: color-mix(in oklab, #16a34a 34%, var(--line));
    background: color-mix(in oklab, #16a34a 10%, var(--panel));
}

.workspace-server-status.is-online .workspace-server-status__dot {
    background: #22c55e;
    box-shadow: 0 0 0 4px color-mix(in oklab, #22c55e 22%, transparent);
}

.workspace-server-status.is-online .workspace-server-status__value {
    color: #9ff0ba;
}

.workspace-server-status.is-reconnecting {
    border-color: color-mix(in oklab, #d8b36e 40%, var(--line));
    background: color-mix(in oklab, #d8b36e 10%, var(--panel));
}

.workspace-server-status.is-reconnecting .workspace-server-status__value {
    color: #f2d58e;
}

.workspace-server-status.is-offline {
    border-color: color-mix(in oklab, #ef4444 36%, var(--line));
    background: color-mix(in oklab, #ef4444 10%, var(--panel));
}

.workspace-server-status.is-offline .workspace-server-status__dot {
    background: #ef4444;
    box-shadow: 0 0 0 4px color-mix(in oklab, #ef4444 22%, transparent);
}

.workspace-server-status.is-offline .workspace-server-status__value {
    color: #ffb5be;
}

.workspace-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 42px;
    padding: 0 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: color-mix(in oklab, var(--pill-bg) 82%, var(--panel));
    color: var(--text);
    text-decoration: none;
    transition: border-color 160ms ease, transform 160ms ease, background 160ms ease;
}

.workspace-link:hover {
    border-color: color-mix(in oklab, var(--accent) 48%, var(--line));
    transform: translateY(-1px);
}

.workspace-link.current {
    border-color: color-mix(in oklab, var(--accent) 72%, var(--line));
    background: color-mix(in oklab, var(--accent) 16%, var(--pill-bg));
}

.workspace-link__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    color: color-mix(in oklab, var(--accent) 48%, var(--muted));
}

.workspace-link__icon svg {
    width: 100%;
    height: 100%;
    stroke-width: 1.8;
}

.workspace-link__label {
    min-width: 0;
}

.workspace-link.current .workspace-link__icon {
    color: var(--accent);
}

body.workspace-nav-collapsed {
    --left-pane-w: var(--left-pane-collapsed-w);
}

body.workspace-nav-collapsed .workspace-nav {
    padding-left: 6px;
    padding-right: 6px;
    gap: 8px;
}

body.workspace-nav-collapsed .left-pane {
    overflow-x: hidden;
}

body.workspace-nav-collapsed .left-pane > :not(.workspace-nav) {
    display: none !important;
}

body.workspace-nav-collapsed .workspace-nav__controls {
    justify-content: center;
}

body.workspace-nav-collapsed .workspace-nav-toggle {
    width: 36px;
    min-height: 36px;
    padding: 0;
    border-radius: 12px;
}

body.workspace-nav-collapsed .workspace-nav-toggle__icon svg {
    transform: rotate(180deg);
}

body.workspace-nav-collapsed .workspace-nav-toggle__label,
body.workspace-nav-collapsed .workspace-link__label,
body.workspace-nav-collapsed .workspace-server-status__label,
body.workspace-nav-collapsed .workspace-server-status__value {
    display: none;
}

body.workspace-nav-collapsed .workspace-link,
body.workspace-nav-collapsed .workspace-server-status {
    justify-content: center;
    grid-template-columns: 1fr;
    padding: 0;
    min-height: 36px;
    border-radius: 12px;
}

body.workspace-nav-collapsed .workspace-link__icon,
body.workspace-nav-collapsed .workspace-server-status__dot {
    justify-self: center;
}

body.workspace-nav-collapsed .workspace-server-status {
    background: color-mix(in oklab, var(--pill-bg) 60%, var(--panel));
}

body.workspace-nav-collapsed .workspace-server-status__dot {
    box-shadow: none;
}

.access-badge {
    display: inline-flex;
    align-items: center;
    max-width: 220px;
    min-height: 32px;
    padding: 0 10px;
    border-radius: 999px;
    border: 1px solid color-mix(in oklab, var(--accent) 35%, var(--line));
    background: color-mix(in oklab, var(--accent) 10%, var(--panel));
    color: var(--text);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    transition: border-color 180ms ease, background 180ms ease, color 180ms ease, opacity 180ms ease;
}

.access-badge.is-warning {
    border-color: #d8b36e;
    background: color-mix(in oklab, #d8b36e 16%, var(--panel));
}

.access-badge.is-danger {
    border-color: #d98690;
    background: color-mix(in oklab, #d98690 16%, var(--panel));
}

.access-notice {
    position: absolute;
    inset: 16px 16px auto 16px;
    display: grid;
    gap: 6px;
    padding: 14px 16px;
    border-radius: 16px;
    border: 1px solid color-mix(in oklab, var(--accent) 32%, var(--line));
    background: color-mix(in oklab, var(--panel) 88%, var(--panel-2));
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.18);
    z-index: 6;
    transition: opacity 180ms ease, transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

.access-notice.hidden {
    display: none !important;
}

.access-notice strong {
    font-size: 14px;
}

.access-notice span {
    color: var(--muted);
    font-size: 13px;
    line-height: 1.4;
}

.canvas-wrap.access-blocked #surface {
    pointer-events: none;
    user-select: none;
}

.btn:disabled,
.block-pill:disabled,
select:disabled,
input:disabled,
textarea:disabled {
    opacity: 0.58;
    cursor: not-allowed;
}

.is-disabled {
    opacity: 0.58;
}
.access-notice--inline {
    position: static;
    margin-bottom: 16px;
}

.workspace-surface.is-access-blocked {
    opacity: 0.9;
}
