/**
 * ///▙▖▙▖▞▞▙▂▂▂▂▂▂▂▂▂▂▂▂▂▂ ::[0xDS]::
 * ▛//▞▞ ⟦⎊⟧ :: ⧗-25.177 // 3OX.DESIGN.SYSTEM ▞▞
 * ▛▞// 3ox.css :: ρ{define}.φ{apply}.τ{render} ▹
 * //▞⋮⋮ ⟦🎨⟧ :: [design] [css] [theme] [⊢ ⇨ ⟿ ▷]
 * ⫸ 〔design.system.context〕
 *
 * /// Status: [ACTIVE] | Version: 1.0.0 | Authority: ZENS3N | Created: ⧗-25.177
 * /// Universal design system for all 3OX.Ai interfaces
 */

/* ═══════════════════════════════════════════════════════════════
   FONTS
   ═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@300;400;500;600;700&family=Orbitron:wght@400;500;600;700;800;900&display=swap');

/* ═══════════════════════════════════════════════════════════════
   COLOR PALETTE
   ═══════════════════════════════════════════════════════════════ */

:root {
    --vh: 1vh;
    /* Backgrounds */
    --bg-void: #050508;
    --bg-deep: #0a0a0f;
    --bg-panel: #12121a;
    --bg-elevated: #1a1a24;
    --bg-surface: #22222e;
    
    /* Borders */
    --border-dim: #1a1a2a;
    --border-default: #2a2a3a;
    --border-bright: #3a3a4a;
    
    /* Text */
    --text-primary: #e8e8f0;
    --text-secondary: #a8a8b8;
    --text-dim: #6a6a7a;
    --text-muted: #4a4a5a;
    
    /* Core Accent Colors (vec3 axes) */
    --accent-tape: #ff6b35;       /* Orange - history/memory */
    --accent-pulse: #00d4aa;      /* Cyan - activity/events */
    --accent-gate: #7b5cff;       /* Purple - authority */
    --accent-warden: #7b5cff;     /* Purple - warden (alias) */
    
    /* Glow variants */
    --glow-tape: rgba(255, 107, 53, 0.4);
    --glow-pulse: rgba(0, 212, 170, 0.4);
    --glow-gate: rgba(123, 92, 255, 0.4);
    --glow-warden: rgba(123, 92, 255, 0.4);
    
    /* Subtle glow variants */
    --glow-tape-subtle: rgba(255, 107, 53, 0.15);
    --glow-pulse-subtle: rgba(0, 212, 170, 0.15);
    --glow-gate-subtle: rgba(123, 92, 255, 0.15);
    
    /* Extended Palette (Archetypes) */
    --accent-void: #444455;
    --accent-sage: #ff6b35;       /* Same as TAPE */
    --accent-storm: #00d4aa;      /* Same as PULSE */
    --accent-oracle: #7b5cff;     /* Same as GATE */
    --accent-flame: #ff9500;      /* Orange-yellow blend */
    --accent-weaver: #c77dff;     /* Light purple */
    --accent-tide: #00b4d8;       /* Ocean blue */
    --accent-crown: #ffd700;      /* Gold */
    --accent-mirror: #888899;     /* Neutral silver */
    
    /* Status Colors */
    --status-success: #00d4aa;
    --status-warning: #ffaa00;
    --status-error: #ff4757;
    --status-info: #00b4d8;
    
    /* Gradients */
    --gradient-vec3: linear-gradient(135deg, var(--accent-tape), var(--accent-pulse), var(--accent-gate));
    --gradient-fire: linear-gradient(135deg, #ff6b35, #ff9500);
    --gradient-ice: linear-gradient(135deg, #00b4d8, #00d4aa);
    --gradient-void: linear-gradient(135deg, #1a1a24, #0a0a0f);
    
    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 24px;
    --space-xl: 32px;
    --space-2xl: 48px;
    --space-3xl: 64px;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --radius-xl: 16px;
    --radius-full: 9999px;
    
    /* Shadows */
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.3);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
    --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-glow-tape: 0 0 20px var(--glow-tape);
    --shadow-glow-pulse: 0 0 20px var(--glow-pulse);
    --shadow-glow-gate: 0 0 20px var(--glow-gate);
    
    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-default: 0.25s ease;
    --transition-slow: 0.4s ease;
    --transition-bounce: 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
}

/* ═══════════════════════════════════════════════════════════════
   BASE STYLES
   ═══════════════════════════════════════════════════════════════ */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'JetBrains Mono', 'SF Mono', 'Fira Code', monospace;
    background: var(--bg-deep);
    color: var(--text-primary);
    font-size: clamp(12px, 0.95vw, 14px);
    line-height: 1.6;
    min-height: 100vh;
}

/* ═══════════════════════════════════════════════════════════════
   TYPOGRAPHY
   ═══════════════════════════════════════════════════════════════ */

/* Display - For titles and headers */
.font-display {
    font-family: 'Orbitron', sans-serif;
}

/* Mono - For code and data */
.font-mono {
    font-family: 'JetBrains Mono', monospace;
}

/* Headings */
h1, .h1 {
    font-family: 'Orbitron', sans-serif;
    font-size: 2.5rem;
    font-weight: 900;
    letter-spacing: 0.15em;
    line-height: 1.2;
}

h2, .h2 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    line-height: 1.3;
}

h3, .h3 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    line-height: 1.4;
}

h4, .h4 {
    font-family: 'Orbitron', sans-serif;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.4;
}

/* Text sizes */
.text-xs { font-size: 0.75rem; }
.text-sm { font-size: 0.875rem; }
.text-base { font-size: 1rem; }
.text-lg { font-size: 1.125rem; }
.text-xl { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 2rem; }

/* Text colors */
.text-primary { color: var(--text-primary); }
.text-secondary { color: var(--text-secondary); }
.text-dim { color: var(--text-dim); }
.text-muted { color: var(--text-muted); }
.text-tape { color: var(--accent-tape); }
.text-pulse { color: var(--accent-pulse); }
.text-gate { color: var(--accent-gate); }

/* Gradient text */
.text-gradient {
    background: var(--gradient-vec3);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

/* ═══════════════════════════════════════════════════════════════
   COMPONENTS
   ═══════════════════════════════════════════════════════════════ */

/* Panel */
.panel {
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 8px;
    min-width: 0;
    max-width: 100%;
}

.panel-elevated {
    background: var(--bg-elevated);
    box-shadow: var(--shadow-md);
}

.panel-title,
.panel__title {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.12em;
    color: var(--text-dim);
    margin-bottom: 4px;
    padding: 2px 0;
}

/* Cards */
.card {
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 6px;
    transition: var(--transition-default);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-width: 0;
}

.card__icon {
    font-size: 1rem;
    line-height: 1;
}

.card__name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.02em;
    text-align: center;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

.card .btn {
    width: 100%;
    font-size: 8px;
    padding: 4px 2px;
}

.card:hover {
    border-color: var(--border-bright);
    background: rgba(0, 0, 0, 0.4);
}

.card-tape { border-left: 3px solid var(--accent-tape); }
.card-pulse { border-left: 3px solid var(--accent-pulse); }
.card-gate, .card-warden { border-left: 3px solid var(--accent-gate); }

/* Buttons */
.btn {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    font-weight: 500;
    padding: 6px 8px;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: var(--bg-panel);
    color: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-default);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: var(--space-sm);
}

.btn:hover {
    border-color: var(--border-bright);
    background: var(--bg-elevated);
}

.btn-tape {
    border-color: var(--accent-tape);
    color: var(--accent-tape);
}
.btn-tape:hover {
    background: var(--glow-tape-subtle);
    box-shadow: var(--shadow-glow-tape);
}

.btn-pulse {
    border-color: var(--accent-pulse);
    color: var(--accent-pulse);
}
.btn-pulse:hover {
    background: var(--glow-pulse-subtle);
    box-shadow: var(--shadow-glow-pulse);
}

.btn-gate, .btn-warden {
    border-color: var(--accent-gate);
    color: var(--accent-gate);
}
.btn-gate:hover, .btn-warden:hover {
    background: var(--glow-gate-subtle);
    box-shadow: var(--shadow-glow-gate);
}

.btn-solid {
    background: var(--gradient-vec3);
    border: none;
    color: white;
    font-weight: 600;
}

/* Input / Slider */
input[type="range"] {
    width: 100%;
    height: 8px;
    border-radius: var(--radius-sm);
    background: var(--border-default);
    outline: none;
    -webkit-appearance: none;
    cursor: pointer;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--text-primary);
    cursor: pointer;
    transition: var(--transition-fast);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.2);
}

input[type="range"].tape::-webkit-slider-thumb {
    background: var(--accent-tape);
    box-shadow: var(--shadow-glow-tape);
}

input[type="range"].pulse::-webkit-slider-thumb {
    background: var(--accent-pulse);
    box-shadow: var(--shadow-glow-pulse);
}

input[type="range"].gate::-webkit-slider-thumb {
    background: var(--accent-gate);
    box-shadow: var(--shadow-glow-gate);
}

/* Text input */
input[type="text"],
input[type="email"],
input[type="password"],
textarea {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    padding: var(--space-sm) var(--space-md);
    background: var(--bg-void);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    width: 100%;
    transition: var(--transition-default);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-pulse);
    box-shadow: 0 0 0 2px var(--glow-pulse-subtle);
}

/* ═══════════════════════════════════════════════════════════════
   GLYPHS & DECORATIONS
   ═══════════════════════════════════════════════════════════════ */

/* SXSL Header Glyph */
.glyph-header {
    font-size: 0.8rem;
    color: var(--text-muted);
    letter-spacing: 0.1em;
    opacity: 0.6;
}

/* Border decoration */
.border-glyph {
    color: var(--text-muted);
    font-size: 0.75rem;
    opacity: 0.4;
}

/* Saga marker */
.saga-marker::before {
    content: '▛//▞▞ ⟦⎊⟧';
    color: var(--text-dim);
    opacity: 0.5;
    margin-right: var(--space-sm);
}

/* Section divider */
.divider {
    height: 1px;
    background: var(--border-default);
    margin: 6px 0;
    flex-shrink: 0;
}

.chat .divider {
    margin: 4px var(--space-md);
}

.divider-glyph {
    display: flex;
    align-items: center;
    gap: var(--space-md);
    color: var(--text-muted);
    font-size: 0.75rem;
}

.divider-glyph::before,
.divider-glyph::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-default);
}

/* Loading bar (3ox style) */
.loading-bar {
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.875rem;
    color: var(--text-dim);
}

.loading-bar::before {
    content: '...loading ▛▞//';
}

.loading-bar::after {
    content: '▹';
}

/* Status indicators */
.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
}

.status-dot.online { background: var(--status-success); box-shadow: 0 0 8px var(--status-success); }
.status-dot.warning { background: var(--status-warning); box-shadow: 0 0 8px var(--status-warning); }
.status-dot.offline { background: var(--status-error); box-shadow: 0 0 8px var(--status-error); }

/* ═══════════════════════════════════════════════════════════════
   ANIMATIONS
   ═══════════════════════════════════════════════════════════════ */

@keyframes pulse-glow {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

@keyframes fade-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes slide-in-left {
    from { opacity: 0; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes rotate-slow {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.animate-pulse { animation: pulse-glow 2s ease-in-out infinite; }
.animate-fade-in { animation: fade-in 0.4s ease-out; }
.animate-slide-in { animation: slide-in-left 0.3s ease-out; }

/* ═══════════════════════════════════════════════════════════════
   UTILITY CLASSES
   ═══════════════════════════════════════════════════════════════ */

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-xs { gap: var(--space-xs); }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }

.p-sm { padding: var(--space-sm); }
.p-md { padding: var(--space-md); }
.p-lg { padding: var(--space-lg); }
.p-xl { padding: var(--space-xl); }

.m-auto { margin: auto; }
.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }

.w-full { width: 100%; }
.h-full { height: 100%; }
.max-w-lg { max-width: 800px; }
.max-w-xl { max-width: 1200px; }
.max-w-2xl { max-width: 1400px; }

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.opacity-50 { opacity: 0.5; }
.opacity-75 { opacity: 0.75; }

.cursor-pointer { cursor: pointer; }
.select-none { user-select: none; }

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE
   ═══════════════════════════════════════════════════════════════ */

@media (max-width: 768px) {
    h1, .h1 { font-size: 1.75rem; }
    h2, .h2 { font-size: 1.25rem; }
    .panel { padding: var(--space-md); }
}

/* ═══════════════════════════════════════════════════════════════
   FOOTER SIGNATURE
   ═══════════════════════════════════════════════════════════════ */

.footer-3ox {
    text-align: center;
    padding: var(--space-xl) 0;
    border-top: 1px solid var(--border-default);
    color: var(--text-dim);
    font-size: 0.8rem;
}

.footer-3ox .glyph {
    opacity: 0.4;
    margin-bottom: var(--space-sm);
}

.footer-3ox .signature::after {
    content: ':: 𝜵';
    display: block;
    margin-top: var(--space-xs);
}

/* ═══════════════════════════════════════════════════════════════
   VIEWPORT LOCK & LAYOUT
   ═══════════════════════════════════════════════════════════════ */

/* Viewport lock - no page scrolling */
html, body {
    height: 100%;
    overflow: hidden;
}

body {
    margin: 0;
    padding: 0;
}

/* Layout variables */
:root {
    --navFull: 248px;
    --navRail: 72px;
    --chatFull: 360px;
    --chatRail: 64px;

    --navW: clamp(64px, 18vw, var(--navFull));
    --chatW: clamp(64px, 26vw, var(--chatFull));

    --gap: clamp(8px, 1.2vw, 14px);
    --pad: clamp(8px, 1.2vw, 14px);
}

*, *::before, *::after {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    overflow: hidden;
    width: 100%;
    height: 100%;
}

/* Slim scrollbars */
::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
::-webkit-scrollbar-track {
    background: transparent;
}
::-webkit-scrollbar-thumb {
    background: var(--border-default);
    border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
    background: var(--text-dim);
}

/* ═══════════════════════════════════════════
   RESPONSIVE GRID SYSTEM
   Mode3: Desktop (full panels)
   Mode2: Tablet (nav rail)
   Mode1: Mobile (nav/chat toggles)
   ═══════════════════════════════════════════ */

/* Base app container */
.app {
    height: calc(var(--vh) * 100);
    width: 100vw;
    max-width: 100%;
    display: grid;
    grid-template-columns: var(--navW) minmax(0, 1fr) var(--chatW);
    grid-template-rows: 1fr;
    align-items: stretch;
    gap: var(--gap);
    padding: var(--pad);
    box-sizing: border-box;
    overflow: hidden;
}

@supports (height: 100dvh) { .app { height: 100dvh; } }
@supports (height: 100svh) { .app { min-height: 100svh; } }

/* Mode 3: Full Desktop Console */
.app.mode3 {
    grid-template-columns: var(--navFull) minmax(0, 1fr) var(--chatFull);
}
.app.mode3 .nav__toggle { display: none; }

/* Mode 2: Tablet Console (nav rail + center + chat) */
.app.mode2 {
    grid-template-columns: var(--navRail) minmax(0, 1fr) var(--chatW);
}
.app.mode2 .nav__label,
.app.mode2 .nav__sectionTitle,
.app.mode2 .nav__hint,
.app.mode2 .brand__subtitle,
.app.mode2 .brand__title { display: none; }
.app.mode2 .nav__item { justify-content: center; }
.app.mode2 .nav__top { justify-content: center; padding: var(--space-sm); }
.app.mode2 .nav__footer .pill__text,
.app.mode2 .nav__hint { display: none; }

/* Hide chat content in mode2 by default */
.app.mode2 .chat__title,
.app.mode2 .agentList,
.app.mode2 .divider,
.app.mode2 .chatBox,
.app.mode2 .chatActions,
.app.mode2 .chatInputRow { display: none; }
.app.mode2 .chat__top { justify-content: center; padding: var(--space-sm); }

/* Mode 1: Mobile Console (rails only, overlays for expand) */
.app.mode1 {
    grid-template-columns: var(--navRail) minmax(0, 1fr) var(--chatRail);
    --gap: 6px;
    --pad: 6px;
}
.app.mode1 .nav__label,
.app.mode1 .nav__sectionTitle,
.app.mode1 .nav__hint,
.app.mode1 .brand__subtitle,
.app.mode1 .brand__title { display: none; }
.app.mode1 .nav__item { justify-content: center; }
.app.mode1 .nav__top { justify-content: center; padding: var(--space-sm); }
.app.mode1 .nav__footer .pill__text,
.app.mode1 .nav__hint { display: none; }

/* Hide chat content in mode1 by default */
.app.mode1 .chat__title,
.app.mode1 .agentList,
.app.mode1 .divider,
.app.mode1 .chatBox,
.app.mode1 .chatActions,
.app.mode1 .chatInputRow { display: none; }
.app.mode1 .chat__top { justify-content: center; padding: var(--space-sm); }

/* ═══════════════════════════════════════════
   STATE: NAV OPEN (expand nav rail)
   ═══════════════════════════════════════════ */
.app.isNavOpen.mode1 {
    grid-template-columns: min(var(--navFull), 45vw) minmax(0, 1fr) var(--chatRail);
}
.app.isNavOpen.mode2 {
    grid-template-columns: min(var(--navFull), 45vw) minmax(0, 1fr) var(--chatW);
}
.app.isNavOpen .nav__label,
.app.isNavOpen .nav__sectionTitle,
.app.isNavOpen .nav__hint,
.app.isNavOpen .brand__subtitle,
.app.isNavOpen .brand__title { display: block; }
.app.isNavOpen .nav__item { justify-content: flex-start; }
.app.isNavOpen .nav__top {
    justify-content: space-between;
    padding: var(--space-md) var(--space-md) var(--space-sm);
}
.app.isNavOpen .nav__footer .pill__text,
.app.isNavOpen .nav__hint { display: block; }

/* ═══════════════════════════════════════════
   STATE: CHAT EXPANDED (expand chat rail)
   ═══════════════════════════════════════════ */
.app.isChatExpanded.mode1 {
    grid-template-columns: var(--navRail) minmax(0, 1fr) min(var(--chatFull), 50vw);
}
.app.isChatExpanded.mode2 {
    grid-template-columns: var(--navRail) minmax(0, 1fr) min(var(--chatFull), 50vw);
}
.app.isChatExpanded.mode1 .chat__title,
.app.isChatExpanded.mode2 .chat__title { display: block; }
.app.isChatExpanded.mode1 .agentList,
.app.isChatExpanded.mode2 .agentList { display: grid; }
.app.isChatExpanded.mode1 .divider,
.app.isChatExpanded.mode2 .divider { display: block; }
.app.isChatExpanded.mode1 .chatBox,
.app.isChatExpanded.mode2 .chatBox { display: flex; }
.app.isChatExpanded.mode1 .chatActions,
.app.isChatExpanded.mode2 .chatActions { display: block; }
.app.isChatExpanded.mode1 .chatInputRow,
.app.isChatExpanded.mode2 .chatInputRow { display: flex; }
.app.isChatExpanded.mode1 .chat__top,
.app.isChatExpanded.mode2 .chat__top {
    justify-content: space-between;
    padding: var(--space-md) var(--space-md) var(--space-sm);
}

/* ═══════════════════════════════════════════
   STATE: BOTH OPEN (nav + chat expanded)
   ═══════════════════════════════════════════ */
.app.isNavOpen.isChatExpanded.mode1 {
    grid-template-columns: min(var(--navFull), 35vw) minmax(0, 1fr) min(var(--chatFull), 35vw);
}
.app.isNavOpen.isChatExpanded.mode2 {
    grid-template-columns: min(var(--navFull), 35vw) minmax(0, 1fr) min(var(--chatFull), 35vw);
}

/* ═══════════════════════════════════════════
   DENSITY: SHORT VIEWPORT
   ═══════════════════════════════════════════ */
.app.isShort {
    --gap: 6px;
    --pad: 6px;
}
.app.isShort .nav__top,
.app.isShort .chat__top {
    min-height: 44px;
    padding: var(--space-sm) var(--space-md);
}
.app.isShort .nav__footer {
    padding-bottom: var(--space-sm);
}
.app.isShort .chatInputRow {
    padding: var(--space-sm) var(--space-md);
}

/* Grid children fill cells */
.app > * {
    height: 100%;
    max-height: 100%;
    overflow: hidden;
}

/* Flex/grid child shrink rules */
.main, .grid2, .panel, .panel--tall,
.statusList, .log, .chat, .agentList,
.chatBox { min-height: 0; }

.nav,
.main,
.chat {
    min-width: 0;
}

/* Navigation, Main, Chat - all need min-height:0 for flex children */
.nav, .main, .chat {
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    position: relative;
    min-width: 0;
    min-height: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Navigation */
.nav {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.nav__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--border-dim);
}

.brand__title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 900;
    letter-spacing: 0.18em;
    font-size: 18px;
}

.brand__subtitle {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.12em;
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}

.nav__sections {
    padding: var(--space-sm) var(--space-sm);
    overflow: auto;
    flex: 1;
    min-height: 0;
}

.nav__section {
    margin-bottom: var(--space-md);
}

.nav__sectionTitle {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.14em;
    color: var(--text-dim);
    padding: var(--space-sm) var(--space-sm) var(--space-xs);
}

.nav__item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 8px;
    margin: 2px 4px;
    border-radius: var(--radius-md);
    text-decoration: none;
    color: var(--text-primary);
    border: 1px solid transparent;
    transition: var(--transition-default);
}

.nav__item:hover {
    border-color: var(--accent-pulse);
    background: var(--glow-pulse-subtle);
}

.nav__item.isActive {
    border-color: var(--accent-pulse);
    background: var(--glow-pulse-subtle);
    color: var(--accent-pulse);
}

.nav__icon {
    width: 18px;
    text-align: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.nav__label {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0;
}

.nav__footer {
    margin-top: auto;
    padding: var(--space-sm) var(--space-sm) var(--space-md);
    border-top: 1px solid var(--border-dim);
    display: grid;
    gap: var(--space-sm);
    flex-shrink: 0;
}

.nav__hint {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.35;
}

/* Icon Button */
.iconBtn {
    border: 1px solid var(--border-default);
    background: rgba(0, 0, 0, 0.18);
    color: var(--text-primary);
    border-radius: var(--radius-sm);
    padding: 4px 8px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-default);
    font-size: 12px;
}

.iconBtn:hover {
    border-color: var(--accent-pulse);
    background: var(--glow-pulse-subtle);
}

.iconBtn__glyph {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.06em;
}

/* Main content */
.main {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: auto;
}

.main__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--border-dim);
    min-height: 52px;
    flex-shrink: 0;
    gap: var(--space-sm);
}

.headerActions {
    display: flex;
    align-items: center;
    gap: var(--space-sm);
    flex-shrink: 0;
    margin-left: auto;
}

.topBar {
    display: flex;
    gap: 3px;
    align-items: center;
    flex-shrink: 0;
    z-index: 10;
    position: relative;
    margin-right: 6px;
    padding-right: 2px;
}

.topBar .pill {
    font-size: 8px;
    padding: 2px 5px;
    letter-spacing: 0.02em;
}

.topBar .pill__dot {
    width: 5px;
    height: 5px;
    flex-shrink: 0;
}

.h1 {
    margin: 0;
    font-size: clamp(18px, 2.2vw, 22px) !important;
    letter-spacing: 0.10em;
}

.sub {
    margin-top: 2px;
    color: var(--text-dim);
    font-size: 9px;
    letter-spacing: 0.08em;
}

.grid2 {
    flex: 1;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 4px;
    padding: 4px;
    min-height: 0;
    min-width: 0;
    overflow: auto;
}

/* Dashboard shell - top/bottom layout */
.dashboardShell {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: var(--space-sm);
    gap: var(--space-sm);
    min-height: 0;
    overflow: hidden;
}

.dashboardTop {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: var(--space-sm);
    flex: 1;
    min-height: 0;
}

.dashboardTop .panel {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
}

.dashboardBottom {
    flex-shrink: 0;
    background: var(--bg-panel);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    padding: var(--space-sm);
    max-height: 180px;
    overflow: auto;
}

.panel--tall {
    display: flex;
    flex-direction: column;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
}

.panel--tall > * {
    flex-shrink: 0;
}

.panel--tall > .cardRow,
.panel--tall > .cardWide {
    width: 100%;
}

.panel--tall .log {
    flex: 1;
    overflow: auto;
    min-height: 60px;
}

.statusBlock {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-height: 0;
}

.statusList {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 4px;
}

.statusItem {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border-dim);
    background: rgba(0, 0, 0, 0.18);
}

.statusItem__bar {
    width: 4px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 999px;
    background: var(--border-default);
}

.statusItem__name {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.08em;
    font-size: 10px;
    flex: 1;
}

.statusItem__state {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    letter-spacing: 0.06em;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-dim);
    background: rgba(255, 255, 255, 0.03);
    margin-left: auto;
}

.statusItem.isOnline .statusItem__bar {
    background: var(--status-success);
}

.statusItem.isOffline .statusItem__bar {
    background: var(--status-error);
}

.metaBlock {
    display: grid;
    gap: 4px;
    padding: 4px;
    border-top: 1px solid var(--border-dim);
    margin-top: 4px;
}

.metaRow {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-sm);
}

.metaKey {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.10em;
    color: var(--text-dim);
}

.metaVal {
    font-size: 9px;
    color: var(--text-primary);
}

.mono {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.04em;
}

/* Card Row */
.quickActionsGrid {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.cardRow {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
}

.cardWide {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100%;
    position: relative;
    background: rgba(0, 0, 0, 0.20);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    box-sizing: border-box;
}

.cardWide__icon {
    position: absolute;
    top: 6px;
    left: 8px;
    font-size: 0.8rem;
    line-height: 1;
}

.cardWide__name {
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    letter-spacing: 0.04em;
    text-align: center;
}

.cardWide .btn {
    font-size: 9px;
    padding: 6px 24px;
}

/* Output Box */
.outputBox {
    background: rgba(0, 0, 0, 0.30);
    border: 1px solid var(--border-dim);
    border-radius: var(--radius-sm);
    margin-top: 8px;
    overflow: hidden;
}

.outputBox__header {
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.10em;
    color: var(--text-dim);
    padding: 4px 8px;
    border-bottom: 1px solid var(--border-dim);
    background: rgba(0, 0, 0, 0.20);
}

.outputBox__content {
    font-family: 'JetBrains Mono', monospace;
    font-size: 10px;
    color: var(--text-secondary);
    padding: 8px;
    min-height: 40px;
    max-height: 120px;
    overflow-y: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

.outputBox__content.success {
    color: var(--status-success);
}

.outputBox__content.error {
    color: var(--status-error);
}

.outputBox__content.loading {
    color: var(--accent-pulse);
}

.badge {
    font-size: 1.2rem;
}

.badge--gold { color: var(--accent-crown); }
.badge--neutral { opacity: 0.7; }

/* Log */
.log {
    flex: 1;
    min-height: 0;
    overflow: auto;
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-dim);
    background: rgba(0, 0, 0, 0.20);
    padding: var(--space-xs);
    font-family: 'JetBrains Mono', monospace;
    font-size: 9px;
    color: var(--text-secondary);
    line-height: 1.55;
}

.logLine {
    padding: 4px 0;
    border-bottom: 1px solid var(--border-dim);
}

.logLine:last-child {
    border-bottom: none;
}

.logTag {
    display: inline-block;
    min-width: 60px;
    font-weight: 500;
}

.logTime {
    color: var(--text-dim);
}

.logMsg {
    color: var(--text-secondary);
}

/* Log levels */
.logTag--info {
    color: var(--status-warning);
}

.logTag--success {
    color: var(--status-success);
}

.logTag--error {
    color: var(--status-error);
}

.logLine--success .logMsg {
    color: var(--status-success);
}

.logLine--error .logMsg {
    color: var(--status-error);
}


/* Pills */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 999px;
    border: 1px solid var(--border-default);
    background: rgba(0, 0, 0, 0.18);
    font-family: 'JetBrains Mono', monospace;
    font-size: 8px;
    letter-spacing: 0.04em;
    white-space: nowrap;
    flex-shrink: 0;
    color: var(--text-secondary);
}

.pill__dot {
    width: 9px;
    height: 9px;
    border-radius: 999px;
    background: var(--text-dim);
}

.pill--ok {
    border-color: var(--status-success);
    background: var(--glow-pulse-subtle);
}

.pill--ok .pill__dot {
    background: var(--status-success);
}

.pill--muted {
    border-color: var(--accent-pulse);
    background: var(--glow-pulse-subtle);
}

.pill--muted .pill__dot {
    background: var(--accent-pulse);
}

/* Chat */
.chat {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.chat__top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-md) var(--space-md) var(--space-sm);
    border-bottom: 1px solid var(--border-dim);
    min-height: 52px;
    flex-shrink: 0;
}

.chat__top .chat__title {
    padding: 0;
}

.chat__title {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.14em;
    font-size: 12px;
    color: var(--text-dim);
    padding: var(--space-sm) var(--space-md);
    flex-shrink: 0;
}

.agentList {
    padding: var(--space-sm) var(--space-md);
    display: grid;
    gap: var(--space-sm);
    overflow: auto;
    min-height: 0;
    flex-shrink: 1;
    flex-grow: 0;
}

.agentPill {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-sm);
    border-radius: 14px;
    border: 1px solid var(--border-dim);
    background: rgba(0, 0, 0, 0.18);
    cursor: pointer;
    transition: var(--transition-default);
}

.agentPill:hover {
    border-color: var(--accent-pulse);
    background: var(--glow-pulse-subtle);
}

.agentPill.isActive {
    border-color: var(--accent-pulse);
    background: var(--glow-pulse-subtle);
}

.agentName {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.08em;
    font-size: 12px;
}

.agentRole {
    font-size: 11px;
    color: var(--text-dim);
}

.agentTag {
    font-family: 'JetBrains Mono', monospace;
    font-size: 11px;
    letter-spacing: 0.06em;
    padding: 6px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-dim);
    background: rgba(255, 255, 255, 0.03);
}

.chatBox {
    flex: 1 1 0;
    min-height: 0;
    margin: 0 var(--space-md) var(--space-sm);
    padding: var(--space-sm);
    overflow: auto;
    overflow-x: hidden;
    border-radius: var(--radius-lg);
    word-wrap: break-word;
    overflow-wrap: break-word;
    border: 1px solid var(--border-dim);
    background: rgba(0, 0, 0, 0.20);
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.chatHint {
    color: var(--text-dim);
    font-size: 12px;
    line-height: 1.45;
}

.bubble {
    max-width: 90%;
    border-radius: 14px;
    padding: var(--space-sm);
    border: 1px solid var(--border-dim);
    background: rgba(255, 255, 255, 0.04);
    font-size: 12px;
    line-height: 1.45;
    word-wrap: break-word;
    overflow-wrap: break-word;
    box-sizing: border-box;
}

.bubble.me {
    margin-left: auto;
    border-color: var(--accent-pulse);
    background: var(--glow-pulse-subtle);
}

.bubble.agent {
    border-color: var(--accent-gate);
    background: var(--glow-gate-subtle);
}

.bubbleMeta {
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: 0.06em;
    font-size: 10px;
    opacity: 0.72;
    margin-bottom: 4px;
}

.chatActions {
    padding: var(--space-xs) var(--space-md);
    border-top: 1px solid var(--border-dim);
    min-height: 20px;
    flex-shrink: 0;
}

.chatActions {
    flex-shrink: 0;
    padding: 0 var(--space-md);
}

.chatInputRow {
    display: flex;
    gap: var(--space-sm);
    padding: var(--space-sm) var(--space-md) var(--space-md);
    flex-shrink: 0;
    margin-top: auto;
}

.chatInputRow .btn {
    flex-shrink: 0;
    white-space: nowrap;
}

.chatInput {
    flex: 1;
    border-radius: var(--radius-md);
    border: 1px solid var(--border-default);
    background: rgba(0, 0, 0, 0.20);
    padding: var(--space-sm) var(--space-sm);
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    font-size: 13px;
    font-family: 'JetBrains Mono', monospace;
}

.chatInput:focus {
    border-color: var(--accent-pulse);
    box-shadow: 0 0 0 3px var(--glow-pulse-subtle);
}

.btn--ghost {
    width: auto;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background: rgba(0, 0, 0, 0.22);
}

/* Expanded chat - share console space without reforming layout */
.app.isChatExpanded.mode2 {
    grid-template-columns: var(--navRail) minmax(0, 1fr) min(var(--chatFull), 45vw);
}

.app.isChatExpanded.mode1 {
    grid-template-columns: var(--navRail) minmax(0, 1fr) min(var(--chatFull), 45vw);
}

/* Responsive tuning */
@media (max-width: 1400px) {
    .dashboardTop {
        grid-template-columns: 1fr;
    }
}


/* Larger screens - increase sizes */
@media (min-width: 1400px) {
    .panel {
        padding: 12px;
    }
    .nav__label {
        font-size: 12px;
    }
    .panel__title,
    .panel-title {
        font-size: 11px;
    }
    .topBar .pill {
        font-size: 8px;
        padding: 2px 5px;
    }
}

@media (max-width: 700px) {
    .topBar {
        flex-wrap: wrap;
    }
}

/* ═══════════════════════════════════════════════════════════════
   :: ∎
   ═══════════════════════════════════════════════════════════════ */
