﻿:root {
    --ws-shell-top-height: 46px;
    --ws-shell-bottom-height: 25px;
    --ws-shell-top-bg: var(--theme-surface-soft, #121a25);
    --ws-shell-top-border: var(--theme-border, #2b3c52);
    --ws-shell-bottom-bg: color-mix(in srgb, var(--theme-surface-2, #203246) 86%, var(--theme-accent, #62beff) 14%);
    --ws-shell-border-muted: var(--theme-border, #32485f);
    --ws-shell-text: var(--theme-text, #e9f2fb);
    --ws-shell-text-muted: var(--theme-muted, #9fb4c9);
}

body.ws-shell-enabled {
    padding-top: var(--ws-shell-top-height);
    padding-bottom: var(--ws-shell-bottom-height);
}

body.ws-shell-enabled.ws-shell-bottom-hidden {
    padding-bottom: 0;
}

.ws-shell-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--ws-shell-top-height);
    z-index: 4000;
    border-bottom: 1px solid var(--ws-shell-top-border);
    background: linear-gradient(180deg, color-mix(in srgb, var(--ws-shell-top-bg) 94%, #ffffff 6%), var(--ws-shell-top-bg));
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 12px;
    color: var(--ws-shell-text);
}

.ws-shell-brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    white-space: nowrap;
}

.ws-shell-brand-title {
    font-size: 14px;
    font-weight: 700;
    color: var(--ws-shell-text);
}

.ws-shell-brand-sub {
    font-size: 11px;
    color: var(--ws-shell-text-muted);
}

.ws-shell-nav {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.ws-shell-link {
    text-decoration: none;
    color: var(--ws-shell-text);
    border: 1px solid var(--ws-shell-border-muted);
    border-radius: 8px;
    padding: 4px 9px;
    font-size: 12px;
    line-height: 1;
    background: color-mix(in srgb, var(--theme-surface-soft, #121a25) 82%, #000000 18%);
}

.ws-shell-link:hover {
    border-color: var(--theme-border-strong, #5b83ae);
}

.ws-shell-link.active {
    border-color: var(--theme-border-strong, #5b83ae);
    background: color-mix(in srgb, var(--theme-surface-2, #233956) 70%, var(--theme-accent, #62beff) 30%);
    color: #f4f9ff;
}

.ws-shell-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.ws-shell-theme,
.ws-shell-locale {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-right: 2px;
}

.ws-shell-theme-label {
    font-size: 11px;
    color: var(--ws-shell-text-muted);
}

.ws-shell-theme-select,
.theme-select-compact,
.ws-shell-locale-select {
    border: 1px solid var(--ws-shell-border-muted);
    border-radius: 8px;
    background: color-mix(in srgb, var(--theme-surface, #1b2e44) 86%, #000000 14%);
    color: var(--ws-shell-text);
    font-size: 12px;
    padding: 3px 8px;
    min-width: 130px;
    outline: none;
}

.ws-shell-theme-select:focus,
.theme-select-compact:focus,
.ws-shell-locale-select:focus {
    border-color: var(--theme-accent, #62beff);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--theme-accent, #62beff) 35%, transparent);
}

.ws-shell-user {
    font-size: 12px;
    color: var(--ws-shell-text-muted);
    max-width: 220px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-shell-bottom {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    height: var(--ws-shell-bottom-height);
    z-index: 4000;
    background: var(--ws-shell-bottom-bg);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 0 8px;
    font-size: 11px;
}

.ws-shell-bottom-left {
    min-width: 0;
    max-width: 45%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ws-shell-bottom-right {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.ws-shell-record-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.ws-shell-record-version {
    cursor: default;
}

.ws-shell-record-pop {
    position: absolute;
    right: 0;
    bottom: calc(100% + 8px);
    min-width: 280px;
    max-width: 360px;
    border: 1px solid var(--ws-shell-border-muted);
    border-radius: 8px;
    background: color-mix(in srgb, var(--theme-surface-soft, #15253b) 90%, #000000 10%);
    color: var(--ws-shell-text);
    padding: 8px 10px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
    line-height: 1.45;
    font-size: 12px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .16s ease, transform .16s ease, visibility .16s ease;
    pointer-events: none;
    white-space: normal;
    z-index: 5002;
}

.ws-shell-record-wrap.is-open .ws-shell-record-pop {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.ws-shell-record-link {
    color: color-mix(in srgb, var(--theme-accent, #62beff) 90%, #ffffff 10%);
    text-decoration: none;
}

.ws-shell-record-link:hover {
    color: color-mix(in srgb, var(--theme-accent, #62beff) 70%, #ffffff 30%);
    text-decoration: underline;
}

.ws-shell-record-icon {
    display: inline-block;
    width: 14px;
    text-align: center;
    margin-right: 4px;
    line-height: 1;
    transform: translateY(1px);
}

body.ws-shell-enabled.ai-page .ai-app {
    height: calc(100dvh - var(--ws-shell-top-height) - var(--ws-shell-bottom-height));
}

body.ws-shell-enabled.collab-page .layout {
    height: calc(100dvh - var(--ws-shell-top-height) - var(--ws-shell-bottom-height));
}

body.ws-shell-enabled.collab-page {
    overflow: hidden;
}

body.ws-shell-enabled.cas-dashboard-page .container-fluid {
    min-height: calc(100dvh - var(--ws-shell-top-height) - var(--ws-shell-bottom-height));
}

@media (max-width: 1120px) {
    .ws-shell-theme-label {
        display: none;
    }
    .ws-shell-theme-select,
    .theme-select-compact {
        min-width: 108px;
    }
}

@media (max-width: 980px) {
    .ws-shell-brand-sub,
    .ws-shell-user {
        display: none;
    }
    .ws-shell-bottom-left {
        max-width: 56%;
    }
    .ws-shell-record-pop {
        min-width: 240px;
    }
    .ws-shell-theme,
    .ws-shell-locale {
        margin-right: 0;
    }
    .ws-shell-theme-select,
    .theme-select-compact {
        min-width: 90px;
        max-width: 116px;
        font-size: 11px;
    }
}
