/*
 * Workspace chrome — split, fixture bar, panel edge.
 *
 * The footer `.workspace-bars` is a fixture, not a panel. It
 * sits outside the resize frame: status channel, then a
 * locked 50 / 50 control deck. Dragging the split only
 * resizes the panels above. The static divider stays at
 * center and is not the resize handle. Panel frames and
 * both dividers use `--workspace-edge`.
 */

.workspace-bars {
    flex-direction: column;
    background: var(--bar-row-bg);
    border-top: var(--bar-row-border);
    border-bottom: 1px solid var(--workspace-edge);
    box-shadow: var(--bar-row-shadow), var(--bar-fixture-lift);
    z-index: 2;
    overflow: visible;
}

.workspace-bars__deck {
    display: flex;
    flex-direction: row;
    width: 100%;
    min-width: 0;
}

.workspace-bar-channel {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    height: var(--bar-channel-height);
    padding-inline: var(--spacing-sm);
    border-bottom: var(--bar-row-divider);
    background: color-mix(in srgb, var(--navy-dark) 55%, var(--bar-row-bg));
    min-width: 0;
    overflow: visible;
}

.workspace-bar-channel__cluster {
    display: flex;
    align-items: center;
    gap: var(--spacing-md);
    min-width: 0;
}

.workspace-bar-channel__cell {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-xs);
    min-width: 0;
    color: var(--text-muted);
    cursor: default;
}

.workspace-bar-channel__light {
    width: 0.375rem;
    height: 0.375rem;
    flex: 0 0 auto;
    border-radius: var(--radius-pill);
    background: var(--text-muted);
}

.workspace-bar-channel__light[data-tone="ok"] {
    background: var(--text-success);
    box-shadow: 0 0 0.4rem color-mix(in srgb, var(--text-success) 55%, transparent);
}

.workspace-bar-channel__light[data-tone="live"] {
    background: var(--text-accent);
    box-shadow: 0 0 0.4rem color-mix(in srgb, var(--text-accent) 55%, transparent);
    animation: workspace-bar-channel-pulse 1.2s ease-in-out infinite;
}

.workspace-bar-channel__light[data-tone="warn"] {
    background: var(--status-warning);
    box-shadow: 0 0 0.4rem color-mix(in srgb, var(--status-warning) 50%, transparent);
}

.workspace-bar-channel__light[data-tone="down"] {
    background: var(--text-error);
    box-shadow: 0 0 0.4rem color-mix(in srgb, var(--text-error) 50%, transparent);
}

.workspace-bar-channel__label {
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem;
    font-weight: 400;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    line-height: 1;
}

.workspace-bar-channel__cell[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    left: 0;
    bottom: calc(100% + var(--spacing-xs));
    z-index: 4;
    box-sizing: border-box;
    width: max-content;
    max-width: 18rem;
    padding: var(--spacing-xs) var(--spacing-sm);
    border: 1px solid color-mix(in srgb, var(--text-accent) 30%, transparent);
    border-radius: var(--radius-sm);
    background: var(--modal-bg);
    color: var(--text-secondary);
    font-family: 'IBM Plex Mono', monospace;
    font-size: 0.625rem;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    line-height: 1.35;
    white-space: normal;
    pointer-events: none;
    opacity: 0;
    visibility: hidden;
    transition:
        opacity var(--duration-fast),
        visibility var(--duration-fast);
    transition-delay: 0s;
}

.workspace-bar-channel__cell[data-tooltip]:hover::after,
.workspace-bar-channel__cell[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
    transition-delay: var(--duration-fast);
}

@keyframes workspace-bar-channel-pulse {
    50% { opacity: 0.35; }
}

/* Fixture owns the bottom stroke. The old viewport hairline
   was a second color and stacked on this edge. */
body::after {
    display: none;
}

/* Fixture deck is a locked 50 / 50. Do not inherit the
   live split — a dragged panel must not squash ENTITIES /
   NEW PROJECT. Side strokes continue the panel frame. */
.workspace-bars__chat,
.workspace-bars__panel {
    flex: 1 1 0;
    min-width: 0;
}

.workspace-bars__chat {
    border-left: 1px solid var(--workspace-edge);
}

.workspace-bars__panel {
    border-right: 1px solid var(--workspace-edge);
}

.workspace-chat-region,
.workspace-panel-region {
    min-width: var(--workspace-region-min);
}

/* Open the panel box into the bar — top + sides only. The
   fixture owns the bottom stroke so the blue does not stop
   at the panel / bar seam. */
.workspace-chat-region .panel-container.focused,
.workspace-panel-region .panel-container.focused {
    box-shadow:
        inset 1px 0 0 0 var(--workspace-edge),
        inset -1px 0 0 0 var(--workspace-edge),
        inset 0 1px 0 0 var(--workspace-edge);
}

.workspace-divider--static {
    cursor: default;
    pointer-events: none;
    flex: 0 0 var(--workspace-divider-size);
}

/* Fixture owns the top hairline. Docked bars drop theirs so
   the deck is one stroke, not two stacked seams. */
.workspace-bars .m-panel-bar,
.workspace-bars .chat-bar-row {
    border-top: none;
    box-shadow: none;
    margin-inline: 0;
}

.workspace-bars .chat-input-container {
    box-shadow: none;
}

/* Brief overlap while the outgoing host is still in the slot. */
.workspace-bars__chat > :not(:last-child),
.workspace-bars__panel > :not(:last-child) {
    display: none;
}
