html {
    scrollbar-gutter: stable;
    height: 100% !important;
    overflow: hidden !important;
}

/* Root Theme Variables — dark terracotta / desert gold (inspired by preview26 (blue/red)) */
:root {
    --bg-gradient: linear-gradient(135deg, #050b18 0%, #020617 100%);
    --card-bg: rgba(10, 18, 32, 0.7);
    --card-border: rgba(28, 84, 52, 0.22);
    --text-primary: #f8fafc;
    --text-secondary: #1c5434;
    --accent: #1c5434; /* Crimson accent — overridden by workspace identity via data-workspace */
    --accent-glow: rgba(28, 84, 52, 0.35);
    --pi-color: #3b82f6; /* Blue */
    --agy-color: #a855f7; /* Purple */
    --oc-color: #10b981; /* Emerald (OpenCode) */
    --pe-color: #f59e0b; /* Amber (Perch) */
    --ll-color: #06b6d4; /* Cyan (llm) */
    --cl-color: #ef4444; /* Red (Cline) */
    --cdx-color: #10b981; /* Emerald (Codex) */
    --cla-color: #d97706; /* Amber/Orange (Claude) */
    --pdx-color: #8b5cf6; /* Violet (Plandex) */
    --gem-color: #3b82f6; /* Blue (Gemini) */
    --ghcp-color: #a855f7; /* Purple (GitHub Copilot) */
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --console-bg: #020617;
    --console-border: rgba(28, 84, 52, 0.14);
    --font-sans: 'Inter', sans-serif;
    --font-mono: 'Fira Code', monospace;
}

/* Workspace identity accents — dark-mode, muted, workspace-based (not agent-based) */
:root[data-workspace="ws1"] {
    --accent: #465f7a; /* muted blue: categorical workspace identity, not slate gray */
    --accent-glow: rgba(70, 95, 122, 0.22);
    --workspace-accent-bg: rgba(70, 95, 122, 0.08);
    --workspace-accent-border: rgba(70, 95, 122, 0.36);
    --workspace-active-bg: color-mix(in srgb, var(--accent) 78%, #ffffff 22%);
    --workspace-active-border: color-mix(in srgb, var(--accent) 78%, #ffffff 22%);
    --workspace-active-text: #10203a;
}

:root[data-workspace="ws2"] {
    --accent: #4f766c; /* muted teal / green */
    --accent-glow: rgba(79, 118, 108, 0.22);
    --workspace-accent-bg: rgba(79, 118, 108, 0.08);
    --workspace-accent-border: rgba(79, 118, 108, 0.36);
    --workspace-active-bg: color-mix(in srgb, var(--accent) 78%, #ffffff 22%);
    --workspace-active-border: color-mix(in srgb, var(--accent) 78%, #ffffff 22%);
    --workspace-active-text: #10203a;
}

:root[data-workspace="ws3"] {
    --accent: #8a6f3e; /* muted amber / ochre */
    --accent-glow: rgba(138, 111, 62, 0.22);
    --workspace-accent-bg: rgba(138, 111, 62, 0.08);
    --workspace-accent-border: rgba(138, 111, 62, 0.36);
    --workspace-active-bg: var(--accent);
    --workspace-active-border: var(--accent);
    --workspace-active-text: #10203a;
}

:root[data-workspace="ws4"] {
    --accent: #6b5a7d; /* muted violet */
    --accent-glow: rgba(107, 90, 125, 0.22);
    --workspace-accent-bg: rgba(107, 90, 125, 0.08);
    --workspace-accent-border: rgba(107, 90, 125, 0.36);
    --workspace-active-bg: color-mix(in srgb, var(--accent) 76%, #ffffff 24%);
    --workspace-active-border: color-mix(in srgb, var(--accent) 76%, #ffffff 24%);
    --workspace-active-text: #10203a;
}

:root[data-workspace="ws5"] {
    --accent: #557b77; /* petroleum teal */
    --accent-glow: rgba(85, 123, 119, 0.22);
    --workspace-accent-bg: rgba(85, 123, 119, 0.08);
    --workspace-accent-border: rgba(85, 123, 119, 0.34);
    --workspace-active-bg: var(--accent);
    --workspace-active-border: var(--accent);
    --workspace-active-text: #10203a;
}

:root[data-workspace="ws6"] {
    --accent: #7a5962; /* burgundy / wine */
    --accent-glow: rgba(122, 89, 98, 0.22);
    --workspace-accent-bg: rgba(122, 89, 98, 0.08);
    --workspace-accent-border: rgba(122, 89, 98, 0.34);
    --workspace-active-bg: var(--accent);
    --workspace-active-border: var(--accent);
    --workspace-active-text: #10203a;
}

:root[data-workspace="ws7"] {
    --accent: #5f868e; /* arctic cyan */
    --accent-glow: rgba(95, 134, 142, 0.22);
    --workspace-accent-bg: rgba(95, 134, 142, 0.08);
    --workspace-accent-border: rgba(95, 134, 142, 0.34);
    --workspace-active-bg: var(--accent);
    --workspace-active-border: var(--accent);
    --workspace-active-text: #10203a;
}

:root[data-workspace="ws8"] {
    --accent: #72777d; /* graphite steel gray */
    --accent-glow: rgba(114, 119, 125, 0.22);
    --workspace-accent-bg: rgba(114, 119, 125, 0.08);
    --workspace-accent-border: rgba(114, 119, 125, 0.34);
    --workspace-active-bg: color-mix(in srgb, var(--accent) 72%, #ffffff 28%);
    --workspace-active-border: color-mix(in srgb, var(--accent) 72%, #ffffff 28%);
    --workspace-active-text: #10203a;
}

:root[data-workspace] .app-header {
    border-bottom-color: var(--workspace-accent-border) !important;
    background: linear-gradient(180deg, var(--workspace-accent-bg), rgba(22, 39, 63, 0));
}

:root[data-workspace] .glass-card,
:root[data-workspace] .hud-console-wrapper {
    border-color: var(--workspace-accent-border);
}

:root[data-workspace] #promptInput:focus {
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
}

:root[data-workspace] .next-marker,
:root[data-workspace] .mode-badge {
    border-color: var(--workspace-accent-border);
}

/* Reset and Core Layout */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    background: var(--bg-gradient);
    color: var(--text-primary);
    font-family: var(--font-sans);
    width: 100%;
    min-height: 100% !important;
    height: 100% !important;
    display: flex;
    justify-content: stretch;
    padding: 0.5rem;
    overflow: hidden !important;
}

.app-container {
    width: 100%;
    max-width: none;
    height: 100% !important;
    display: flex;
    flex-direction: column;
    gap: 0.42rem;
    min-width: 0;
    overflow: hidden !important;
}

/* Glassmorphism Card System */
.glass-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(12px);
    border-radius: 12px;
    padding: 0.85rem;
    box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

/* Header Styling */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding-bottom: 0.55rem;
    gap: 0.75rem;
    position: relative;
    z-index: 100;
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-icon {
    font-size: 1.25rem;
    color: var(--accent);
}

.felix-otter-mark {
    width: 1.7rem;
    height: 1.7rem;
    border-radius: 999px;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.11);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.18), 0 4px 12px rgba(0, 0, 0, 0.28);
    opacity: 0.88;
}

.felix-otter-mark img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 30% 24%;
    filter: saturate(0.9) brightness(0.92);
}

.felix-account-menu summary:hover .felix-otter-mark,
.felix-account-menu[open] .felix-otter-mark {
    opacity: 1;
    border-color: rgba(255, 255, 255, 0.24);
    background: rgba(255, 255, 255, 0.055);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 6px 16px rgba(0, 0, 0, 0.34);
}

.felix-account-menu summary::after {
    content: "⌄";
    color: rgba(248, 250, 252, 0.48);
    font-size: 0.62rem;
    margin-left: 0.14rem;
    transform: translateY(-0.02rem);
}

.felix-account-menu[open] summary::after {
    color: rgba(248, 250, 252, 0.75);
}

h1 {
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: -0.025em;
    white-space: nowrap;
}

.logo-area h1 {
    color: #ffffff;
}

.accent-text {
    color: var(--accent);
    font-weight: 400;
}

.header-subtitle {
    font-size: 0.9rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0.05em;
    color: var(--text-secondary);
    opacity: 0.5;
    vertical-align: middle;
    display: inline-block;
}

.header-subtitle::before {
    content: "|";
    margin: 0 0.75rem;
    color: rgba(255, 255, 255, 0.15);
    font-weight: 300;
}

/* Header Right Actions */
.header-right {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.token-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.25);
    padding: 0.25rem 0.5rem;
    border-radius: 6px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.token-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.token-input {
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    width: 140px;
    transition: width 0.2s ease;
}

.token-input:focus {
    width: 180px;
}

.auth-menu {
    position: relative;
    flex-shrink: 0;
}

.auth-menu summary {
    list-style: none;
    cursor: pointer;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1;
    padding: 0.28rem 0.42rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 6px;
    opacity: 0.55;
    user-select: none;
}

.auth-menu summary::-webkit-details-marker {
    display: none;
}

.auth-menu summary:hover,
.auth-menu[open] summary {
    opacity: 0.9;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}

.auth-menu .token-container {
    position: absolute;
    top: calc(100% + 0.35rem);
    right: 0;
    z-index: 200;
    width: max-content;
    min-width: 560px;
    flex-direction: column;
    align-items: stretch;
    gap: 0.35rem;
    background: #050914;
    border: 1px solid rgba(80, 120, 186, 0.45);
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.82), 0 0 0 1px rgba(255, 255, 255, 0.04) inset;
}

.auth-menu .token-input {
    width: 100%;
    min-width: 520px;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 4px;
    padding: 0.35rem 0.45rem;
}

.auth-menu .token-input:focus {
    width: 100%;
}

.auth-menu .byok-preset-btn {
    width: fit-content;
    margin-top: 0.25rem;
}

.user-account-menu {
    position: relative;
    flex: 0 0 auto;
}

.user-account-menu summary {
    list-style: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 999px;
    outline: none;
}

.user-account-menu summary::-webkit-details-marker {
    display: none;
}

.user-avatar-placeholder {
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.035);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(248, 250, 252, 0.82);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.24);
    transition: border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.user-account-menu summary:hover .user-avatar-placeholder,
.user-account-menu[open] .user-avatar-placeholder {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(255, 255, 255, 0.22);
    color: #ffffff;
}

.user-menu-panel {
    position: absolute;
    top: calc(100% + 0.45rem);
    right: 0;
    z-index: 220;
    min-width: 205px;
    display: grid;
    gap: 0.12rem;
    padding: 0.45rem;
    background: rgba(13, 15, 24, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(12px);
}

.user-menu-panel span {
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.2;
    padding: 0.42rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}

.user-menu-panel span:first-child,
.user-menu-panel span:nth-child(2) {
    color: var(--text-primary);
}

.user-menu-panel span:hover {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-primary);
}

/* Dropdown links (WS2 Block C): real links styled like the placeholder spans. */
.user-menu-panel a.dropdown-item,
.user-menu-panel span.dropdown-item {
    display: block;
    color: var(--text-secondary);
    font-size: 0.78rem;
    line-height: 1.2;
    padding: 0.42rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
    text-decoration: none;
    cursor: pointer;
}
.user-menu-panel a.dropdown-item:first-child,
.user-menu-panel a.dropdown-item:nth-child(2) {
    color: var(--text-primary);
}
.user-menu-panel a.dropdown-item:hover,
.user-menu-panel span.dropdown-item:hover {
    background: rgba(255, 255, 255, 0.045);
    color: var(--text-primary);
}
.user-menu-panel .dropdown-separator {
    height: 1px;
    margin: 0.3rem 0.25rem;
    padding: 0;
    background: rgba(255, 255, 255, 0.1);
}
.user-menu-panel span.dropdown-static {
    cursor: default;
    opacity: 0.55;
}

.felix-account-menu .user-menu-panel {
    left: 0;
    right: auto;
}

.source-control {
    display: flex;
    align-items: center;
    gap: 0.45rem;
}

.source-label {
    color: var(--text-secondary);
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.mode-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 9999px;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    transition: all 0.3s ease;
}

.mode-pi {
    background: rgba(59, 130, 246, 0.2);
    color: var(--pi-color);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.mode-agy {
    background: rgba(168, 85, 247, 0.2);
    color: var(--agy-color);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

.mode-oc {
    background: rgba(16, 185, 129, 0.2);
    color: var(--oc-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.mode-pe {
    background: rgba(245, 158, 11, 0.2);
    color: var(--pe-color);
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.2);
}

.mode-ll {
    background: rgba(6, 182, 212, 0.2);
    color: var(--ll-color);
    box-shadow: 0 0 10px rgba(6, 182, 212, 0.2);
}

.mode-cl {
    background: rgba(239, 68, 68, 0.2);
    color: var(--cl-color);
    box-shadow: 0 0 10px rgba(239, 68, 68, 0.2);
}

.mode-cdx {
    background: rgba(16, 185, 129, 0.2);
    color: var(--cdx-color);
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.2);
}

.mode-cla {
    background: rgba(217, 119, 6, 0.2);
    color: var(--cla-color);
    box-shadow: 0 0 10px rgba(217, 119, 6, 0.2);
}

.mode-pdx {
    background: rgba(139, 92, 246, 0.2);
    color: var(--pdx-color);
    box-shadow: 0 0 10px rgba(139, 92, 246, 0.2);
}

.mode-gem {
    background: rgba(59, 130, 246, 0.2);
    color: var(--gem-color);
    box-shadow: 0 0 10px rgba(59, 130, 246, 0.2);
}

.mode-ghcp {
    background: rgba(168, 85, 247, 0.2);
    color: var(--ghcp-color);
    box-shadow: 0 0 10px rgba(168, 85, 247, 0.2);
}

#agentIndicator #activeAgentText {
    background: transparent;
    border: none;
    box-shadow: none;
    color: var(--text-secondary);
    padding: 0;
    border-radius: 0;
    font-size: 0.78rem;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
    white-space: nowrap;
}

#agentIndicator #activeAgentText.mode-pi,
#agentIndicator #activeAgentText.mode-agy,
#agentIndicator #activeAgentText.mode-oc,
#agentIndicator #activeAgentText.mode-pe,
#agentIndicator #activeAgentText.mode-ll,
#agentIndicator #activeAgentText.mode-cl,
#agentIndicator #activeAgentText.mode-cdx,
#agentIndicator #activeAgentText.mode-cla,
#agentIndicator #activeAgentText.mode-pdx,
#agentIndicator #activeAgentText.mode-gem,
#agentIndicator #activeAgentText.mode-ghcp {
    background: transparent;
    color: var(--text-secondary);
    box-shadow: none;
}

/* Provenance / Status Strip */
.context-provenance {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-secondary);
    font-size: 0.74rem;
    font-family: var(--font-mono);
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.04);
    border-radius: 8px;
    padding: 0.45rem 0.65rem;
}

.context-provenance strong {
    color: var(--text-primary);
    font-weight: 600;
}

.context-provenance .divider {
    color: rgba(255, 255, 255, 0.08);
}

.status-online {
    color: var(--success) !important;
}

.status-offline {
    color: var(--danger) !important;
}

.status-stopped {
    color: var(--warning) !important;
}

.status-neutral {
    color: var(--text-secondary) !important;
}

.status-unknown {
    color: var(--text-secondary) !important;
}

/* Workspace Layout */
.workspace {
    display: grid;
    grid-template-columns: 1.2fr 0.8fr;
    gap: 0.75rem;
    flex: 1;
    min-height: 0;
}

@media (max-width: 900px) {
    .workspace {
        grid-template-columns: 1fr;
        height: auto;
        overflow-y: auto;
    }
    .console-workspace {
        flex: 1 !important;
        min-height: 0 !important;
        height: auto !important;
        overflow: hidden !important;
    }
    .compact-header {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    .header-nav {
        width: 100%;
        justify-content: center;
    }
}

.console-workspace {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    grid-template-areas:
        "prompt"
        "output";
    flex: 1 !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: hidden !important;
    gap: 0;
    min-width: 0;
}

.console-workspace .prompt-input-panel {
    grid-area: prompt;
    height: auto;
    min-height: 0;
    padding: 0.4rem 0.68rem 0;
    gap: 0.2rem;
    position: relative;
    z-index: 20;
}

.console-workspace .console-output-panel {
    grid-area: output;
    min-height: 0;
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.console-split-resizer {
    display: none !important;
}

.console-split-resizer::after {
    content: "Drag to resize";
    position: absolute;
    left: 50%;
    top: 50%;
    min-width: 7.5rem;
    height: 14px;
    border-radius: 999px;
    transform: translate(-50%, -50%);
    background: rgba(28, 84, 52, 0.18);
    color: rgba(248, 250, 252, 0.56);
    font-size: 0.58rem;
    line-height: 14px;
    text-align: center;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.console-split-resizer:hover,
.console-split-resizer.is-dragging {
    opacity: 1;
    border-color: var(--workspace-accent-border, rgba(28, 84, 52, 0.32));
    background: rgba(255, 255, 255, 0.035);
}

body.output-maximized {
    overflow: hidden;
}

body.output-maximized .app-header {
    display: none !important;
}

body.output-maximized .header-row-2,
body.output-maximized .nav-row-1 {
    display: none !important;
}

body.output-maximized .workspace-selector {
    display: flex !important;
    pointer-events: auto;
}

.console-output-panel.output-maximized {
    position: fixed;
    inset: 0.55rem;
    z-index: 1000;
    height: auto;
    min-height: 0;
    padding: 0.75rem;
    background: rgba(36, 21, 18, 0.98);
    border-color: var(--accent);
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.72), 0 14px 44px rgba(0, 0, 0, 0.58);
}

body.output-maximized .prompt-input-panel {
    display: none !important;
}

body.output-maximized .prompt-input-panel .hud-header {
    display: flex;
}

body.output-maximized .prompt-input-panel #btnSendPrompt {
    min-height: 36px;
    padding: 0.45rem 0.9rem;
    z-index: 2;
}

body.output-maximized .prompt-form-wrapper {
    flex: 1 1 auto;
    min-height: 0;
}

body.output-maximized .prompt-input-panel #promptInput {
    flex: 1 1 auto;
    min-height: 7.4rem;
    height: 100%;
    max-height: none;
}

body.output-maximized .prompt-input-panel .form-actions {
    display: flex;
}

body.output-maximized .console-split-resizer,
body.output-maximized #btnTogglePromptExpand,
body.output-maximized .output-maximize-btn {
    display: none !important;
}

body.output-maximized .close-fullscreen-btn {
    display: flex !important;
}

.console-output-panel.output-maximized .hud-console-wrapper {
    min-height: 0;
}

.console-output-panel .hud-header {
    min-width: 0;
}

.console-output-panel .hud-actions {
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* HUD Panels */
.hud-panel {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
    height: 100%;
    min-height: 0;
}

.hud-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.hud-title {
    font-size: 1.05rem;
    font-weight: 600;
}

.tmux-output-title {
    display: inline-flex;
    align-items: baseline;
    gap: 0.45rem;
    color: rgba(248, 250, 252, 0.88);
    font-weight: 650;
}

.tmux-output-subtitle {
    color: rgba(142, 149, 165, 0.62);
    font-family: var(--font-sans);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.02em;
}

.next-marker {
    white-space: normal;
    color: var(--text-primary) !important;
    font-family: var(--font-mono);
    font-size: 0.78em;
    font-weight: 700;
    opacity: 1;
    margin-left: -0.25rem;
}

.next-marker.state-marker {
    opacity: 0.62;
}

.next-marker:not(.state-marker) {
    animation: next-marker-pulse 2.4s ease-in-out infinite;
}

@keyframes next-marker-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
    50% { box-shadow: 0 0 10px 1px rgba(255, 255, 255, 0.22); }
}

.next-marker-helper {
    color: #1c5434;
    font-size: 0.76em;
    font-weight: 500;
    opacity: 0.86;
}

.next-marker-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.1em;
    height: 1.1em;
    margin-right: 0.25rem;
    padding: 0;
    border: none;
    background: transparent;
    color: var(--text-secondary);
    font-size: 0.78em;
    font-weight: 700;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.15s ease;
    vertical-align: baseline;
}

.next-marker-toggle:hover {
    opacity: 1;
}

.next-marker-helper.helper-collapsed {
    display: none;
}

.hud-actions {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.auto-llm-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.72rem;
    font-weight: 500;
    opacity: 0.68;
    user-select: none;
    cursor: pointer;
    white-space: nowrap;
}

.auto-llm-toggle:hover {
    opacity: 0.82;
}

.auto-llm-toggle input {
    appearance: none;
    -webkit-appearance: none;
    width: 0.78rem;
    height: 0.78rem;
    margin: 0;
    display: inline-grid;
    place-content: center;
    background: rgba(255, 255, 255, 0.015);
    border: 1px solid rgba(28, 84, 52, 0.28);
    border-radius: 3px;
    cursor: pointer;
}

.auto-llm-toggle input:hover {
    border-color: rgba(28, 84, 52, 0.42);
    background: rgba(255, 255, 255, 0.025);
}

.auto-llm-toggle input:focus-visible {
    outline: 1px solid rgba(28, 84, 52, 0.35);
    outline-offset: 2px;
}

.auto-llm-toggle input:checked {
    background: rgba(28, 84, 52, 0.12);
    border-color: rgba(28, 84, 52, 0.5);
}

.auto-llm-toggle input:checked::after {
    content: "✓";
    color: rgba(28, 84, 52, 0.85);
    font-size: 0.62rem;
    line-height: 1;
    transform: translateY(-0.02rem);
}

.quick-command-buttons,
.quick-command-controls {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    margin-left: 0.1rem;
}

.quick-command-btn,
.quick-command-select {
    background: var(--workspace-accent-bg, rgba(255, 255, 255, 0.03));
    border: 1px solid var(--workspace-accent-border, rgba(255, 255, 255, 0.12));
    color: var(--text-secondary);
    padding: 0.16rem 0.42rem;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.68rem;
    font-weight: 600;
    line-height: 1.15;
    opacity: 0.72;
    transition: all 0.2s ease;
}

.quick-command-select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 1.2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='%23e59b73'%3E%3Cpath d='M0 0h10L5 6z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.35rem center;
    background-size: 0.55rem;
    min-width: 4.2rem;
}

.quick-command-select option {
    background: #0a1525;
    color: var(--text-primary);
    font-size: 0.72rem;
}

.quick-command-btn:hover,
.quick-command-select:hover {
    color: var(--text-primary);
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow);
    opacity: 0.95;
}

.quick-command-btn:active,
.quick-command-select:active {
    background: var(--accent);
    color: #10203a;
    transform: translateY(1px);
}

.quick-command-btn:disabled,
.quick-command-select:disabled {
    cursor: not-allowed;
    opacity: 0.34;
    box-shadow: none;
}

.quick-command-btn:disabled:hover,
.quick-command-select:disabled:hover {
    color: var(--text-secondary);
    border-color: var(--workspace-accent-border, rgba(255, 255, 255, 0.12));
}

.hud-btn {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-primary);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.78rem;
    font-weight: 600;
    transition: all 0.2s ease;
}

.hud-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.highlight-btn {
    background: var(--accent);
    border-color: var(--accent);
    color: #10203a;
}

.highlight-btn:hover {
    background: var(--accent);
    filter: brightness(1.2);
    box-shadow: 0 0 12px var(--accent-glow);
}

.highlight-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    box-shadow: none;
    filter: none;
}

.secondary-btn {
    opacity: 0.55;
    border-color: rgba(255, 255, 255, 0.08);
    font-weight: 500;
}

.secondary-btn:hover {
    opacity: 0.9;
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.2);
}

.output-font-btn,
.output-maximize-btn {
    min-width: 2.2rem;
    min-height: 2.2rem;
    padding: 0.35rem 0.55rem;
    font-family: var(--font-mono);
    font-size: 0.82rem;
    touch-action: manipulation;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.output-maximize-btn {
    font-size: 0.95rem;
    font-weight: 800;
}

.close-fullscreen-btn {
    display: none !important;
    align-items: center;
    justify-content: center;
    min-width: 2.2rem;
    min-height: 2.2rem;
    padding: 0.35rem 0.65rem;
    color: #f8fafc !important;
    background: #16273f !important;
    border: 1px solid #1c2a40 !important;
    border-radius: 8px;
    cursor: pointer;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32);
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.close-fullscreen-btn:hover {
    color: #ffffff !important;
    background: #1c2a40 !important;
    border-color: rgba(28, 84, 52, 0.35) !important;
}

.neutral-highlight-btn {
    background: rgba(30, 44, 66, 0.95);
    border-color: rgba(28, 84, 52, 0.35);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.35);
    margin-left: 0.35rem; /* Clearer separation from Manual Refresh */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.neutral-highlight-btn:hover {
    background: rgba(110, 70, 58, 0.95);
    border-color: rgba(28, 84, 52, 0.5);
    box-shadow: 0 6px 14px rgba(0, 0, 0, 0.45), 0 0 8px rgba(28, 84, 52, 0.15);
    transform: translateY(-1px);
}

.neutral-highlight-btn:active {
    background: rgba(22, 39, 63, 0.95);
    border-color: rgba(255, 255, 255, 0.4);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transform: translateY(1px) scale(0.97);
}




/* Terminal Console View */
.hud-console-wrapper {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: var(--console-bg);
    border: 1px solid var(--console-border);
    border-radius: 8px;
    overflow: hidden;
    position: relative; /* Enable absolute positioning for children */
}

.floating-scroll-btn {
    position: absolute;
    bottom: 1rem;
    right: 1.25rem;
    background: var(--accent);
    color: #10203a;
    border: none;
    padding: 0.45rem 0.9rem;
    border-radius: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px var(--accent-glow);
    display: flex;
    align-items: center;
    gap: 0.35rem;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 10;
}

.floating-scroll-btn:hover {
    filter: brightness(1.25);
    transform: translateY(-1px);
}

.floating-scroll-btn.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(5px);
}

.console-body {
    flex: 1;
    padding: 1rem;
    font-family: var(--font-mono);
    font-size: var(--console-font-size, 0.72rem);
    line-height: 1.5;
    overflow: auto;
    white-space: pre-wrap;
    word-break: normal;
    overflow-wrap: anywhere;
    -webkit-user-select: text;
    user-select: text;
    -webkit-touch-callout: default;
    touch-action: pan-y;
    color: rgba(248, 250, 252, 0.94);
    background:
        radial-gradient(circle at top left, rgba(28, 84, 52, 0.055), transparent 30%),
        linear-gradient(180deg, rgba(255, 255, 255, 0.018), rgba(255, 255, 255, 0));
    text-shadow: 0 1px 0 rgba(0, 0, 0, 0.25);
    tab-size: 4;
    min-width: 0;
}

.es-copy-btn {
    display: none;
    align-self: flex-start;
    margin: 0.5rem 0 0.75rem 1rem;
    font-family: var(--font-mono);
}

.es-copy-btn.visible {
    display: inline-block;
}


/* Prompt Form View */
.prompt-input-panel {
    display: flex;
    flex-direction: column;
}

.shortcut-tip {
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.6;
}

.prompt-actions {
    margin-left: auto;
    flex-shrink: 0;
}

.prompt-actions .hud-btn {
    font-size: 0.74rem;
    padding: 0.35rem 0.6rem;
    min-height: 1.9rem;
}

.prompt-expand-btn {
    border-style: dashed !important;
    border-color: var(--accent) !important;
    color: var(--accent) !important;
    opacity: 0.92;
}

.prompt-input-panel.prompt-expanded .prompt-expand-btn {
    opacity: 1;
    background: rgba(var(--accent-rgb, 99, 102, 241), 0.14) !important;
}

.prompt-form-wrapper {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
    min-height: 0;
}

#promptInput {
    flex: 0 0 auto;
    height: 2rem;
    min-height: 2rem;
    max-height: 2rem;
    background: rgba(24, 13, 11, 0.5);
    border: 1px solid rgba(178, 83, 69, 0.35);
    border-radius: 8px;
    padding: 0.5rem 0.65rem;
    font-family: var(--font-sans);
    font-size: 0.9rem;
    color: var(--text-primary);
    outline: none;
    resize: none;
    line-height: 1.35;
    overflow-y: auto;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.6);
    animation: inputGlowPulse 4s infinite ease-in-out;
    transition: border-color 0.25s ease, background-color 0.25s ease, box-shadow 0.25s ease, transform 0.2s ease, height 0.2s ease, max-height 0.2s ease;
}

@keyframes inputGlowPulse {
    0% { border-color: rgba(178, 83, 69, 0.4); box-shadow: 0 0 4px 0.5px rgba(178, 83, 69, 0.35), inset 0 2px 4px rgba(0,0,0,0.6); }
    50% { border-color: rgba(178, 83, 69, 0.8); box-shadow: 0 0 8px 1px rgba(178, 83, 69, 0.75), inset 0 2px 4px rgba(0,0,0,0.5); }
    100% { border-color: rgba(178, 83, 69, 0.4); box-shadow: 0 0 4px 0.5px rgba(178, 83, 69, 0.35), inset 0 2px 4px rgba(0,0,0,0.6); }
}

.prompt-input-panel.prompt-expanded .prompt-form-wrapper {
    flex: 0 0 auto;
}

.prompt-input-panel.prompt-expanded #promptInput {
    height: 12rem !important;
    min-height: 12rem !important;
    max-height: 24rem !important;
    resize: vertical !important;
}

#promptInput:hover {
    animation: none;
    border-color: var(--accent);
    background: rgba(178, 83, 69, 0.06);
    box-shadow: 0 0 10px 1px rgba(178, 83, 69, 0.8), inset 0 2px 4px rgba(0,0,0,0.4);
    transform: translateY(-1px);
}

#promptInput:focus {
    animation: none;
    border-color: var(--accent);
    box-shadow: 0 0 12px 2px rgba(178, 83, 69, 0.9), inset 0 2px 4px rgba(0,0,0,0.2);
    background: rgba(178, 83, 69, 0.1);
}

.form-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    min-height: 0;
    padding-top: 0.1rem;
}

.char-counter {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
}

/* Toast Notification */
.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    background: #10203a;
    border: 1px solid var(--accent);
    color: var(--text-primary);
    padding: 0.75rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    z-index: 1000;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.toast.hidden {
    opacity: 0;
    transform: translate(-50%, 1rem);
    pointer-events: none;
}

/* Navigation Header Styles */
.header-nav {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 320px;
    justify-content: flex-end;
}

/* New navigation rows */
.header-row-1 {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    margin-top: 0;
}

.nav-row-1, .nav-row-2 {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    width: 100%;
}

.nav-row-1 {
    justify-content: flex-end;
}

.nav-row-2 {
    justify-content: flex-start;
}

.workspace-selector {
    flex-wrap: wrap;
    gap: 0.3rem;
    align-self: stretch;
}

.workspace-selector-label {
    align-self: center;
    color: rgba(142, 149, 165, 0.78);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    margin-right: 0.12rem;
    text-transform: uppercase;
}

.workspace-slot {
    min-width: 2.28rem;
    text-align: center;
}

.operational-slot {
    border-color: rgba(255, 255, 255, 0.08);
}

.future-workspace-slot {
    color: rgba(142, 149, 165, 0.62);
    background: rgba(255, 255, 255, 0.018);
    border-color: rgba(255, 255, 255, 0.055);
    cursor: help;
    filter: grayscale(0.35);
}

.future-workspace-slot::after {
    content: "future";
    display: block;
    font-size: 0.46rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    margin-top: 0.08rem;
    opacity: 0.58;
    text-transform: uppercase;
}

.future-workspace-slot:hover {
    color: rgba(248, 250, 252, 0.72);
    background: rgba(255, 255, 255, 0.035);
    border-color: rgba(245, 158, 11, 0.24);
}

/* Optional separator line */
.header-row-1 > .logo-area {
    border-bottom: none;
    padding-bottom: 0;
}

.nav-row-2 {
    margin-top: 0;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    padding: 0.35rem 0.54rem;
    border-radius: 6px;
    border: 1px solid transparent;
    transition: all 0.2s ease-in-out;
    position: relative;
}
.nav-row-2 .nav-link[data-activity-marker]::after {
    content: attr(data-activity-marker);
    position: absolute;
    right: 0.18rem;
    top: 50%;
    transform: translateY(-52%);
    color: rgba(248, 250, 252, 0.52);
    font-size: 0.72em;
    font-weight: 500;
    line-height: 1;
    pointer-events: none;
}
.nav-link:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.05);
}
.nav-link.active {
    color: var(--workspace-active-text, #10203a);
    background: var(--workspace-active-bg, var(--accent));
    border: 1px solid var(--workspace-active-border, var(--accent));
}

/* Compact Header Scaling overrides to match port 8765 */
.compact-header {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding-bottom: 0.55rem;
}

.compact-header .logo-area {
    align-self: flex-start;
}

.compact-header .header-nav {
    align-self: flex-end;
}
.compact-header h1 {
    font-size: 1.05rem;
    white-space: nowrap;
}
.compact-header .logo-icon {
    font-size: 1.25rem;
}


/* Modern dashboard polish layer — 2026-07-03
   Visual-only overrides: preserves existing layout, controls, and button positions.
   Palette: dark terracotta / desert gold, inspired by preview26 (blue/red). */
:root {
    --bg-gradient:
        radial-gradient(circle at 50% -20%, rgba(28, 84, 52, 0.08), transparent 32rem),
        radial-gradient(circle at 90% 80%, rgba(28, 84, 52, 0.045), transparent 28rem),
        linear-gradient(135deg, #050b18 0%, #020617 100%);
    --card-bg: rgba(10, 18, 32, 0.70);
    --card-border: rgba(28, 84, 52, 0.22);
    --text-primary: #f8fafc;
    --text-secondary: #1c5434;
    --console-bg: #020617;
    --console-border: rgba(28, 84, 52, 0.16);
}

body {
    background: var(--bg-gradient);
    padding: 0.65rem;
}

.app-container,
.cognitive-shell {
    gap: 0.6rem;
}

.app-header.compact-header,
.cognitive-shell > .app-header.compact-header {
    background: linear-gradient(180deg, rgba(22, 39, 63, 0.88), rgba(22, 39, 63, 0.65)) !important;
    border: 1px solid rgba(28, 84, 52, 0.22) !important;
    border-radius: 14px;
    padding: 0.72rem 0.86rem !important;
    box-shadow: 0 14px 42px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(14px);
}

.logo-area h1,
.cognitive-title {
    letter-spacing: -0.03em;
}

.header-subtitle,
.cognitive-subtitle,
.tmux-output-subtitle {
    color: #1c5434;
    opacity: 0.78;
}

.nav-link {
    background: rgba(13, 24, 40, 0.6);
    border-color: rgba(28, 84, 52, 0.12);
    border-radius: 9px;
    color: rgba(28, 84, 52, 0.85);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.nav-link:hover {
    background: rgba(30, 44, 66, 0.9);
    border-color: rgba(28, 84, 52, 0.35);
    color: #f8fafc;
    transform: translateY(-1px);
}

.nav-link.active {
    color: var(--workspace-active-text, #10203a);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.065), 0 8px 20px var(--accent-glow);
}

.glass-card {
    background:
        linear-gradient(180deg, rgba(22, 39, 63, 0.82), rgba(22, 39, 63, 0.62));
    border-color: rgba(28, 84, 52, 0.20);
    border-radius: 14px;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.035);
    backdrop-filter: blur(16px);
}

.console-workspace {
    gap: 0;
}

.console-workspace .prompt-input-panel {
    padding: 0.4rem 0.68rem 0;
}

.console-output-panel {
    padding: 0.35rem 0.82rem 0.82rem;
}

.hud-header {
    gap: 0.75rem;
}

.hud-title {
    color: #f8fafc;
    font-size: 0.92rem;
    font-weight: 760;
    letter-spacing: -0.018em;
}

.tmux-output-title {
    color: #f8fafc;
    font-size: 0.86rem;
    font-weight: 700;
}

.tmux-output-title::before {
    display: none !important;
}

/* Compact toolbar grouping for output controls (font, fullscreen, copy) */
.console-output-panel .hud-actions {
    gap: 0.3rem;
    flex-wrap: nowrap;
}

.console-output-panel .hud-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.74rem;
    line-height: 1;
}

.console-output-panel .highlight-btn {
    padding: 0.4rem 0.7rem;
    font-size: 0.76rem;
}

.output-font-group {
    display: inline-flex;
    align-items: center;
    gap: 0.18rem;
}

.output-font-group .output-font-btn {
    border-radius: 7px;
    min-width: 1.9rem;
}

/* === Shared retractable-group pattern (ES + CS) === */
.retractable-group {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 1px 4px;
    border-radius: 6px;
    background: transparent;
    border: 1px solid transparent;
    transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    max-width: 800px;
}

.retractable-group > * {
    flex-shrink: 0 !important;
}

.retractable-group:not(.fixed):not(:hover) {
    max-width: 800px;
    opacity: 1;
}

.retractable-group:not(.fixed):not(:hover) > *:not(.pin-btn) {
    opacity: 1 !important;
    pointer-events: auto !important;
    transition: none;
}

.retractable-zone:hover .retractable-group,
.retractable-group:hover,
.retractable-group.fixed {
    max-width: 800px;
    opacity: 1;
    background: rgba(255, 255, 255, 0.04);
    border-color: rgba(255, 255, 255, 0.12);
}

.retractable-zone:hover .retractable-group > *,
.retractable-group:hover > *,
.retractable-group.fixed > * {
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: translateX(0) !important;
}

.pin-btn {
    cursor: pointer;
    background: none;
    border: none;
    padding: 3px;
    font-size: 0.72rem;
    color: var(--text-secondary);
    opacity: 0.4;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.pin-btn:hover {
    opacity: 0.85;
    color: var(--text-primary);
}

.retractable-group.fixed .pin-btn {
    color: #1c5434 !important;
    transform: rotate(90deg);
    opacity: 1 !important;
    filter: drop-shadow(0 0 3px rgba(28, 84, 52, 0.7));
}

.retractable-group:not(.fixed) .pin-btn {
    transform: rotate(0deg);
}

.hud-title::before,
.cognitive-title::before {
    content: '';
    display: inline-block;
    width: 0.46rem;
    height: 0.46rem;
    margin-right: 0.45rem;
    border-radius: 999px;
    background: var(--accent);
    box-shadow: 0 0 14px var(--accent-glow);
    vertical-align: 0.08rem;
}

.mode-badge,
.next-marker,
#connectionStatus,
.connection-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    border-radius: 999px !important;
    border: 1px solid rgba(28, 84, 52, 0.22) !important;
    background: rgba(13, 24, 40, 0.72) !important;
    padding: 0.18rem 0.58rem !important;
    font-size: 0.72rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.025em !important;
    text-transform: uppercase !important;
    color: #f8fafc !important;
}

.status-online,
.connection-pill:not(:empty) {
    border-color: rgba(34, 197, 94, 0.32) !important;
    background: rgba(34, 197, 94, 0.10) !important;
    color: #86efac !important;
}

.status-offline {
    border-color: rgba(239, 68, 68, 0.34) !important;
    background: rgba(239, 68, 68, 0.10) !important;
    color: #fca5a5 !important;
}

.status-stopped,
.status-unknown {
    border-color: rgba(245, 158, 11, 0.30) !important;
    background: rgba(245, 158, 11, 0.09) !important;
    color: #fcd34d !important;
}

.next-marker::before {
    display: none;
}

.hud-btn,
.quick-command-btn,
.quick-command-select {
    border-radius: 9px;
    background: rgba(13, 24, 40, 0.72);
    border-color: rgba(28, 84, 52, 0.18);
    color: #f8fafc;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.hud-btn:hover,
.quick-command-btn:hover,
.quick-command-select:hover {
    background: rgba(30, 44, 66, 0.92);
    border-color: rgba(28, 84, 52, 0.40);
    color: #ffffff;
    transform: translateY(-1px);
}

.highlight-btn {
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 88%, #ffffff 12%), var(--accent));
    border-color: color-mix(in srgb, var(--accent) 80%, #ffffff 20%);
    color: #10203a;
    box-shadow: 0 10px 26px var(--accent-glow), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.secondary-btn {
    opacity: 0.82;
}

#promptInput,
.setup-field input {
    background: rgba(13, 24, 40, 0.9);
    border-color: rgba(28, 84, 52, 0.25);
    border-radius: 10px;
    box-shadow: inset 0 2px 10px rgba(0, 0, 0, 0.22);
}

#promptInput:focus,
.setup-field input:focus {
    border-color: color-mix(in srgb, var(--accent) 78%, #ffffff 22%);
    box-shadow: 0 0 0 3px var(--accent-glow), inset 0 2px 10px rgba(0, 0, 0, 0.24);
}

.hud-console-wrapper,
.cognitive-frame-wrap {
    background: #10203a;
    border-color: rgba(28, 84, 52, 0.16);
    border-radius: 12px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.025), inset 0 0 0 1px rgba(0, 0, 0, 0.20);
}

.console-body {
    background:
        radial-gradient(circle at 12% 0%, rgba(28, 84, 52, 0.12), transparent 24rem),
        linear-gradient(180deg, rgba(22, 39, 63, 0.65), rgba(5, 11, 24, 0.15));
    color: rgba(248, 250, 252, 0.96);
}

.cognitive-panel,
.cognitive-setup {
    border-radius: 14px;
}

.cognitive-header {
    padding-bottom: 0.68rem;
    border-bottom: 1px solid rgba(28, 84, 52, 0.18);
}

.toast {
    border-color: rgba(28, 84, 52, 0.42);
    background: rgba(58, 38, 32, 0.94);
    border-radius: 999px;
    box-shadow: 0 18px 48px rgba(0, 0, 0, 0.42);
}

/* Copy to LLM button: compact, prominent, integrated with output toolbar */
#btnCopyToLLM {
    font-size: 0.78rem !important;
    font-weight: 720 !important;
    line-height: 1.1 !important;
    letter-spacing: -0.005em !important;
    padding: 0.4rem 0.7rem !important;
    min-height: 1.9rem !important;
    border-radius: 8px !important;
    color: #10203a !important;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 82%, #ffffff 18%), color-mix(in srgb, var(--accent) 90%, #000000 10%)) !important;
    border-color: color-mix(in srgb, var(--accent) 78%, #ffffff 22%) !important;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.20), 0 0 12px color-mix(in srgb, var(--accent-glow) 55%, transparent) !important;
    filter: saturate(0.88) brightness(0.97) !important;
}

#btnCopyToLLM:hover {
    color: #10203a !important;
    background: linear-gradient(180deg, color-mix(in srgb, var(--accent) 76%, #ffffff 24%), var(--accent)) !important;
    border-color: color-mix(in srgb, var(--accent) 70%, #ffffff 30%) !important;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.24), 0 0 14px color-mix(in srgb, var(--accent-glow) 65%, transparent) !important;
    filter: saturate(0.92) brightness(1) !important;
}

/* Next marker: compact inline tag */
.next-marker {
    display: inline-flex !important;
    align-items: center !important;
    white-space: nowrap !important;
    max-width: none;
    font-size: 1.05rem !important;
    font-weight: 800 !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
    text-transform: none !important;
    letter-spacing: 0.01em !important;
    padding: 0.22rem 0.6rem !important;
    border: 1px solid rgba(255, 255, 255, 0.28) !important;
    background: rgba(255, 255, 255, 0.1) !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.55) !important;
}

.next-marker-helper {
    display: block !important;
    margin-top: 0.08rem !important;
    font-size: 0.66rem !important;
    font-weight: 500 !important;
    line-height: 1.2 !important;
    color: rgba(28, 84, 52, 0.82) !important;
}

/* Send to Agent: compact, matches Copy to LLM height */
#btnSendPrompt {
    font-size: 0.78rem !important;
    font-weight: 720 !important;
    line-height: 1.1 !important;
    padding: 0.4rem 0.7rem !important;
    min-height: 1.9rem !important;
    letter-spacing: -0.005em !important;
}

/* Cognitive fullscreen: use the same integrated close control as Live Execution Output */
body.output-maximized .cognitive-panel #btnCloseFullscreen {
    position: static !important;
    top: auto !important;
    left: auto !important;
    z-index: auto !important;
    display: flex !important;
    width: auto !important;
    height: auto !important;
    min-width: 2.2rem !important;
    min-height: 2.2rem !important;
    padding: 0.35rem 0.65rem !important;
    border-radius: 8px !important;
    font-size: 1rem !important;
    background: #16273f !important;
    border-color: #1c2a40 !important;
    color: #f8fafc !important;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.32) !important;
}

body.output-maximized .cognitive-panel #btnCloseFullscreen:hover {
    color: #ffffff !important;
    background: #1c2a40 !important;
    border-color: rgba(28, 84, 52, 0.35) !important;
    transform: none !important;
}

body.output-maximized .cognitive-panel #btnCloseFullscreen::after {
    content: none !important;
}

/* Green overrides for duplicate module environments */
body.duplicate-module-active .highlight-btn,
body.duplicate-module-active #btnSendPrompt,
body.duplicate-module-active #btnCopyToLLM {
    background: #08321b !important;
    border-color: #1e5c38 !important;
    color: #e2f0e8 !important;
    box-shadow: 0 0 8px rgba(30, 92, 56, 0.25) !important;
}

body.duplicate-module-active .highlight-btn:hover,
body.duplicate-module-active #btnSendPrompt:hover,
body.duplicate-module-active #btnCopyToLLM:hover {
    background: #14522f !important;
    border-color: #277749 !important;
    box-shadow: 0 0 16px rgba(39, 119, 73, 0.45) !important;
    filter: none !important;
}

/* === Tablet / narrow-screen: hide output title + subtitle === */
@media (max-width: 1024px) {
    .es-title-label,
    .es-subtitle-label {
        display: none !important;
    }
    .console-output-panel .hud-header {
        grid-template-columns: 1fr auto !important;
    }
    .console-output-panel .hud-actions.retractable-zone {
        justify-self: end !important;
        flex-shrink: 0;
    }
    .next-marker-helper,
    .next-marker-toggle {
        display: none !important;
    }
    .next-marker {
        font-size: 0.7rem !important;
        padding: 0.16rem 0.42rem !important;
    }
}

/* Even narrower: ensure Copy to LLM never gets pushed off */
@media (max-width: 768px) {
    .console-output-panel .hud-header {
        grid-template-columns: 1fr auto !important;
        gap: 0.3rem !important;
    }
    .next-marker {
        font-size: 0.68rem !important;
        padding: 0.14rem 0.38rem !important;
    }
    .next-marker-helper {
        display: none !important;
    }
    .next-marker-toggle {
        display: none !important;
    }
}
