/* The workbench (#5613): a full-window shell in the playground's palette (BarrelBrain.ScriptResults.Ui/theme.css tokens,
   with fallbacks so the shell stands on its own). Docking is dockview's, themed abyss to sit on the same dark ink. */

html, body { height: 100%; margin: 0; overflow: hidden; }

.wb-root {
    --wb-ink: var(--color-ink, #0b1020);
    --wb-ink-deep: var(--color-ink-deep, #070a14);
    --wb-line: var(--color-line, #1e2638);
    --wb-fg: var(--color-fg, #e2e8f0);
    --wb-soft: var(--color-fg-soft, #94a3b8);
    --wb-accent: var(--color-check, #38bdf8);
    display: flex; flex-direction: column; height: 100vh; height: 100dvh;
    background: var(--wb-ink); color: var(--wb-fg); font: 13px/1.4 Inter, system-ui, sans-serif;
}

.wb-bar { display: flex; align-items: center; gap: 12px; padding: 6px 12px; border-bottom: 1px solid var(--wb-line); background: var(--wb-ink-deep); min-height: 40px; }
.wb-brand { font-weight: 700; color: #fff; text-decoration: none; white-space: nowrap; }
.wb-brand span { color: var(--wb-accent); }
.wb-workspace { display: inline-flex; align-items: center; gap: 6px; color: var(--wb-fg); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; min-width: 0; }
.wb-kind { font-size: 11px; padding: 1px 6px; border-radius: 4px; border: 1px solid var(--wb-line); color: var(--wb-soft); }
.wb-actions { margin-left: auto; display: flex; gap: 6px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }

.wb-button { display: inline-flex; align-items: center; gap: 4px; padding: 4px 10px; border-radius: 6px; border: 1px solid var(--wb-line); background: transparent; color: var(--wb-fg); cursor: pointer; font: inherit; white-space: nowrap; }
.wb-button:hover:not(:disabled) { border-color: var(--wb-accent); }
.wb-button:disabled { opacity: .45; cursor: default; }
.wb-primary { background: var(--wb-accent); color: #04121c; border-color: var(--wb-accent); font-weight: 600; }
.wb-icon { border: 0; background: transparent; color: var(--wb-soft); cursor: pointer; padding: 2px 6px; border-radius: 4px; font: inherit; }
.wb-icon:hover:not(:disabled) { color: #fff; background: var(--wb-line); }
.wb-icon:disabled { opacity: .35; cursor: default; }
.wb-select, .wb-input { background: var(--wb-ink); color: var(--wb-fg); border: 1px solid var(--wb-line); border-radius: 6px; padding: 4px 6px; font: inherit; }
.wb-input { min-width: 200px; }
.wb-hidden-input { display: none; }

.wb-notice, .wb-ask { display: flex; align-items: center; gap: 10px; padding: 6px 12px; border-bottom: 1px solid var(--wb-line); background: #0f172a; flex-wrap: wrap; }
.wb-notice[data-kind=error] { background: #3b0d14; }
.wb-notice[data-kind=unsupported] { background: #3a2a07; }
.wb-ask { background: #10213a; }

.wb-main { flex: 1; display: flex; min-height: 0; position: relative; }
.wb-explorer { width: var(--wb-explorer-w, 260px); max-width: calc(100% - 320px); flex: none; display: flex; flex-direction: column; background: var(--wb-ink-deep); min-height: 0; }
.wb-explorer-bar { display: flex; align-items: center; gap: 2px; padding: 6px 6px 6px 10px; border-bottom: 1px solid var(--wb-line); }
.wb-heading { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--wb-soft); margin-right: auto; }
.wb-demo-bar { display: flex; align-items: center; gap: 8px; padding: 6px 6px 6px 10px; border-bottom: 1px solid var(--wb-line); font-size: 12px; }
.wb-demo-bar .wb-faint { margin-right: auto; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-demo-bar .wb-button { padding: 2px 8px; }
.wb-tree { flex: 1; overflow: auto; padding: 4px 0; }
.wb-node { display: flex; gap: 6px; align-items: center; padding: 2px 8px; cursor: pointer; white-space: nowrap; user-select: none; }
.wb-node:hover { background: #121a2e; }
.wb-selected { background: #16233f; }
.wb-node-icon { width: 10px; color: var(--wb-soft); text-align: center; }
.wb-empty { color: var(--wb-soft); padding: 12px; }
.wb-faint { color: var(--wb-soft); }

.wb-center { flex: 1; display: flex; flex-direction: column; min-width: 0; position: relative; }
.wb-dock { flex: 1; min-height: 0; }
.wb-dock-empty { position: absolute; inset: 0 0 36px 0; display: flex; align-items: center; justify-content: center; color: var(--wb-soft); pointer-events: none; }
.wb-panel-area { flex: none; height: 36px; display: flex; flex-direction: column; background: var(--wb-ink-deep); overflow: hidden; }
.wb-panel-area.wb-results-open { height: var(--wb-results-h, 42%); min-height: 120px; max-height: calc(100% - 120px); }
.wb-results-bar { flex: none; height: 36px; display: flex; gap: 12px; align-items: center; padding: 0 12px; overflow-x: auto; white-space: nowrap; }
.wb-results { flex: 1; overflow: auto; padding: 8px 12px 12px; }
.wb-sends { color: var(--wb-soft); border: 1px solid var(--wb-line); border-radius: 999px; padding: 1px 8px; font-size: 12px; }
.wb-check { display: inline-flex; gap: 4px; align-items: center; font-size: 12px; color: var(--wb-soft); }
.wb-pending { color: var(--wb-soft); }
.wb-run-message { margin: 0 0 8px; }
.wb-run-message[data-kind=refused], .wb-run-message[data-kind=error], .wb-run-message[data-kind=sign-in-required],
.wb-run-message[data-kind=quota-exceeded], .wb-run-message[data-kind=unavailable] { color: #f0b46a; }

.wb-pool { position: absolute; width: 0; height: 0; overflow: hidden; }
.wb-panel { height: 100%; display: flex; flex-direction: column; }
.wb-slot { height: 100%; display: flex; flex-direction: column; min-height: 0; }
.wb-doc-bar { display: flex; align-items: center; gap: 8px; padding: 4px 8px; border-bottom: 1px solid var(--wb-line); }
.wb-spacer { flex: 1; }
.wb-dirty { font-size: 11px; color: #fbbf24; }
.wb-editor { flex: 1; min-height: 0; }
.wb-editor-host { height: 100%; width: 100%; }

.wb-tab { display: flex; align-items: center; gap: 6px; padding: 0 4px 0 10px; height: 100%; }
.wb-tab-title { white-space: nowrap; }
.wb-tab-close { border: 0; background: transparent; color: inherit; opacity: .6; cursor: pointer; font-size: 14px; padding: 0 4px; border-radius: 4px; }
.wb-tab-close:hover { opacity: 1; background: rgba(255,255,255,.1); }

/* The side pane's tabs (#5619): the explorer and the catalog share the left column. */
.wb-pane-tabs { display: flex; border-bottom: 1px solid var(--wb-line); }
.wb-pane-tab { flex: 1; border: 0; border-bottom: 2px solid transparent; background: transparent; color: var(--wb-soft); padding: 7px 8px; font: inherit; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; cursor: pointer; }
.wb-pane-tab:hover { color: #fff; }
.wb-pane-tab.wb-active { color: #fff; border-bottom-color: var(--wb-accent); }
.wb-explorer.wb-wide { width: var(--wb-catalog-w, 360px); }
.wb-empty .wb-button { margin-top: 8px; }

/* The catalog pane: search, the list by hub, and the selected entry's preview below it. */
.wb-catalog { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.wb-catalog-bar { display: flex; align-items: center; gap: 8px; padding: 8px; border-bottom: 1px solid var(--wb-line); }
.wb-catalog-search { flex: 1; min-width: 0; }
.wb-catalog-pages { font-size: 12px; white-space: nowrap; }
.wb-catalog-list { flex: 1 1 50%; overflow: auto; padding: 4px 0; min-height: 120px; }
.wb-catalog-count { padding: 4px 10px; font-size: 12px; }
.wb-catalog-hub { padding: 10px 10px 4px; font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--wb-accent); }
.wb-catalog-item { display: block; width: 100%; text-align: left; border: 0; border-left: 2px solid transparent; background: transparent; color: var(--wb-fg); padding: 5px 10px; font: inherit; cursor: pointer; }
.wb-catalog-item:hover { background: var(--wb-line); }
.wb-catalog-item.wb-selected { background: #13203a; border-left-color: var(--wb-accent); }
.wb-catalog-item-hub { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: .06em; color: var(--wb-accent); }
.wb-catalog-item-title { display: block; font-weight: 600; }
.wb-catalog-item-description { display: block; font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wb-catalog-preview { flex: 1 1 50%; overflow: auto; border-top: 1px solid var(--wb-line); padding: 10px; display: flex; flex-direction: column; gap: 6px; min-height: 0; }
.wb-catalog-title { font-weight: 700; font-size: 14px; color: #fff; }
.wb-catalog-description { margin: 0; color: var(--wb-fg); }
.wb-chips { display: flex; flex-wrap: wrap; gap: 4px; }
.wb-chip { font: 11px/1.4 "JetBrains Mono", monospace; border: 1px solid var(--wb-line); border-radius: 999px; padding: 0 7px; color: var(--wb-soft); }
.wb-catalog-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.wb-catalog-actions a { font-size: 12px; }
.wb-catalog-preview summary { cursor: pointer; color: var(--wb-soft); font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; }
.wb-catalog-notes div { color: var(--wb-fg); font-size: 12px; overflow-wrap: anywhere; }
.wb-catalog-notes div table { font-size: 11px; border-collapse: collapse; }
.wb-catalog-notes div td, .wb-catalog-notes div th { border: 1px solid var(--wb-line); padding: 1px 4px; }
.wb-catalog-source pre { margin: 6px 0 0; padding: 8px; background: var(--wb-ink); border: 1px solid var(--wb-line); border-radius: 6px; font: 11px/1.45 "JetBrains Mono", monospace; overflow: auto; max-height: 320px; color: var(--wb-fg); }

/* The splitters (#5621): a thin line with a wider grab area, the side pane's on its right edge and the results panel's on
   its top edge. While one drags, the editors underneath don't take the pointer. */
.wb-splitter { flex: none; position: relative; z-index: 5; background: var(--wb-line); outline: none; touch-action: none; }
.wb-splitter::after { content: ""; position: absolute; }
.wb-splitter-x { width: 1px; cursor: col-resize; }
.wb-splitter-x::after { inset: 0 -4px; }
.wb-splitter-y { height: 1px; cursor: row-resize; }
.wb-splitter-y::after { inset: -4px 0; }
.wb-splitter:hover, .wb-splitter:focus-visible, .wb-splitter.wb-dragging { background: var(--wb-accent); }
.wb-splitter-x:focus-visible, .wb-splitter-x.wb-dragging { box-shadow: 0 0 0 1px var(--wb-accent); }
.wb-splitter-y:focus-visible, .wb-splitter-y.wb-dragging { box-shadow: 0 0 0 1px var(--wb-accent); }
.wb-resizing-x, .wb-resizing-x * { cursor: col-resize !important; user-select: none; }
.wb-resizing-y, .wb-resizing-y * { cursor: row-resize !important; user-select: none; }
.wb-resizing-x .wb-dock, .wb-resizing-y .wb-dock { pointer-events: none; }
.wb-panel-area:not(.wb-results-open) { border-top: 1px solid var(--wb-line); }

.wb-only-phone { display: none; }

/* A phone: the explorer slides over the editor from a toggle, and the docked tabs stay tabs. */
@media (max-width: 720px) {
    .wb-only-phone { display: inline-block; }
    .wb-hide-phone { display: none; }
    .wb-bar { flex-wrap: wrap; gap: 6px; }
    .wb-actions { margin-left: 0; width: 100%; justify-content: flex-start; }
    .wb-splitter { display: none; }
    .wb-panel-area.wb-results-open { height: 42%; min-height: 160px; max-height: none; border-top: 1px solid var(--wb-line); }
    .wb-explorer { position: absolute; z-index: 20; inset: 0 auto 0 0; width: min(85vw, 300px); max-width: none; border-right: 1px solid var(--wb-line); transform: translateX(-100%); transition: transform .15s; }
    .wb-explorer.wb-open { transform: none; box-shadow: 0 0 40px rgba(0,0,0,.6); }
    .wb-explorer.wb-wide { width: min(92vw, 360px); }
    .wb-input { min-width: 0; width: 100%; }
}
