:root {
    --bg-main: #0c0d10;
    --bg-secondary: #16181d;
    --accent: #00e5ff;
    --accent-glow: rgba(0, 229, 255, 0.4);
    --text-main: #eef1f5;
    --text-dim: #8a8f98;
    --bubble-user: #00e5ff;
    --bubble-ai: #1f2229;
    --input-bg: #1f2229;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background-color: var(--bg-main);
    background-image:
        radial-gradient(circle at 10% 10%, rgba(0, 229, 255, 0.03) 0%, transparent 40%),
        radial-gradient(circle at 90% 90%, rgba(0, 229, 255, 0.03) 0%, transparent 40%);
    color: var(--text-main);
    font-family: 'Google Sans Flex', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    margin: 0;
    padding: 0;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
    overflow-y: auto;
}

/* Header */
header {
    padding: 15px 20px;
    background: rgba(22, 24, 29, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}


.header-content {
    width: 100%;
    max-width: 1000px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--accent);
}

.end-session-btn {
    background: rgba(255, 77, 77, 0.1);
    border: 1px solid rgba(255, 77, 77, 0.3);
    color: #ff4d4d;
    font-size: 0.75rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.end-session-btn:hover {
    background: #ff4d4d;
    color: #fff;
}

header .end-session-btn::before {
    content: '';
    width: 8px;
    height: 8px;
    background: #ff4d4d;
    border-radius: 50%;
    box-shadow: 0 0 8px #ff4d4d;
}

header .end-session-btn:hover::before {
    background: #fff;
    box-shadow: 0 0 8px #fff;
}


/* Chat container */
#chat-container {
    flex: 1;
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 22px;
    /* Increased gap for better breathing room */
    width: 100%;
    max-width: 1000px;
    margin: 0 auto;
    overflow-y: visible;
    /* Header and chat flow together */
}

#chat-container::-webkit-scrollbar {
    display: none;
    /* Chrome, Safari, and Opera */
}

.message {
    max-width: 85%;
    display: flex;
    flex-direction: column;
    animation: fadeInUp 0.3s ease-out;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px) scale(0.98);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.message.user {
    align-self: flex-end;
}

.message.ai {
    align-self: flex-start;
    max-width: 100%;
    /* Match user max-width for symmetry */
}


/* Bubbles */
.bubble {
    padding: 16px 20px;
    font-size: 18px;
    line-height: 1.6;
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    letter-spacing: -0.01em;
    position: relative;
    transition: transform 0.2s ease;
    will-change: transform, opacity;
    transform: translateZ(0);
    /* Force GPU layer */
}

.user .bubble {
    background: linear-gradient(135deg, var(--bubble-user) 0%, #00b8cc 100%);
    color: #000;
    font-weight: 600;
    border-radius: 24px 24px 4px 24px;
}

.ai .bubble {
    background: transparent;
    color: var(--text-main);
    border: none;
    padding: 16px 0;
    /* Remove horizontal padding so raw text aligns perfectly left */
    box-shadow: none;
    /* Ensure no shadows if any were inherited */
}

/* Code block wrapper for copy button */
.ai .bubble pre,
.assistant .bubble pre {
    position: relative;
    background: #0d1117;
    padding: 40px 12px 12px 12px;
    border-radius: 8px;
    overflow: auto;
    margin: 10px 0;
    border: 1px solid rgba(255, 255, 255, 0.1);
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.ai .bubble pre::-webkit-scrollbar {
    display: none;
}


.copy-code-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: #161b22;
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text-dim);
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    user-select: none;
    z-index: 20;
}

.copy-code-btn:hover {
    background: #30363d;
    color: var(--accent);
    border-color: var(--accent);
}

.copy-code-btn.copied {
    border-color: #238636;
    background: #238636;
    color: white;
    width: auto;
    padding: 0 10px;
}

.copy-code-btn.copied span {
    font-size: 11px;
    font-weight: 600;
}

.bubble code {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 0.9em;
}

.bubble img {
    max-width: 100%;
    border-radius: 12px;
    margin: 15px 0;
    display: block;
}

/* Markdown Readability Enhancements */
.bubble p {
    margin-bottom: 15px;
}

.bubble>p:first-child,
.bubble>*:first-child {
    margin-top: 0;
    /* Fix extra space at the top */
}

.bubble p:last-child {
    margin-bottom: 0;
}

/* Thought/Reasoning Block */
.thought-container {
    margin: 10px 0 15px 0;
    width: max-content;
    /* Pill shape that hugs the text */
    max-width: 100%;

    animation: fadeIn 0.4s ease-out;
}

.thought-container .thought-summary,
.thought-container.static-badge .thought-summary {
    background: transparent;
    border: none;
    border-radius: 0;
    transition: all 0.3s ease;
    width: max-content;
}

.thought-container .thought-summary {
    padding: 8px 0;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-dim);
    cursor: default;
    list-style: none;
    display: flex;
    align-items: center;
    gap: 8px;
    user-select: none;
    transition: color 0.2s;
    outline: none;
}

.thought-container.static-badge .thought-summary {
    cursor: default;
    color: var(--text-dim);
    margin-bottom: -10px;
}

.thought-container .thought-summary::before {
    content: '◈';
    color: var(--accent);
    font-size: 16px;
    filter: drop-shadow(0 0 5px var(--accent-glow));
}

/* Cleaned up details animation */

.thought-container summary:hover {
    color: var(--text-main);
    background: none; /* Removed the faint highlight */
}

.thought-container.static-badge .thought-summary:hover {
    background: none;
    color: var(--text-dim);
}

.thought-content {
    padding: 2px 16px 16px 16px;
    font-size: 14px;
    line-height: 1.6;
    color: var(--text-dim);
    font-style: italic;
    border-top: none;
}



.bubble h1,
.bubble h2,
.bubble h3 {
    margin: 25px 0 15px 0;
    color: var(--accent);
    line-height: 1.3;
}

.bubble h1:first-child,
.bubble h2:first-child,
.bubble h3:first-child {
    margin-top: 0;
}

.bubble ul,
.bubble ol {
    margin-bottom: 15px;
    padding-left: 20px;
}

.bubble li {
    margin-bottom: 8px;
}

.bubble strong {
    color: #fff;
    font-weight: 700;
}

/* Input Area */
.input-area {
    padding: 10px 20px calc(8px + env(safe-area-inset-bottom)) 20px;
    background: #16181d !important;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: none;
    display: flex;
    flex-direction: column;
    align-items: center;
    position: sticky;
    bottom: 0;
    z-index: 1000;
}

.input-area-content {
    width: 100%;
    max-width: 1000px;
}

/* Agent Selector */
.input-footer-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 12px;
    padding: 8px 4px 0 4px;
    width: 100%;
    position: relative; /* Anchor for all child menus */
}

.mode-selector-wrapper,
.tool-selector-wrapper,
.agent-selector-wrapper {
    position: static; /* Let absolute menus find the footer parent */
}

.mode-display-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 18px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.mode-display-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.mode-display-btn.locked {
    opacity: 0.5;
    cursor: not-allowed;
    pointer-events: none;
    background: transparent !important;
}

.tool-selector-wrapper {
    position: relative;
}

.tool-display-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 18px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.tool-display-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.tool-display-btn.active {
    color: var(--accent);
    background: rgba(0, 229, 255, 0.05);
}

.agent-selector-wrapper {
    position: static;
}

.agent-display-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: 18px;
    background: transparent;
    border: 1px solid transparent;
    color: var(--text-dim);
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.agent-display-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-main);
}

.menu-upward {
    position: absolute;
    bottom: calc(100% + 12px);
    left: 50%;
    transform: translateX(-50%);
    background: #1e2025;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 8px;
    min-width: 240px;
    display: none;
    flex-direction: column;
    gap: 4px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
    z-index: 1100;
    animation: slideUpCenter 0.2s ease-out;
}

.menu-upward.right {
    right: 0;
}

.menu-upward.left {
    left: 0;
}

/* keep for compat if needed, but prefer .menu-upward.right */

@keyframes slideUpCenter {
    from {
        transform: translate(-50%, 10px);
        opacity: 0;
    }

    to {
        transform: translate(-50%, 0);
        opacity: 1;
    }
}

.menu-item {
    display: flex;
    flex-direction: column;
    padding: 10px 12px;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s;
}

.menu-item:hover {
    background: rgba(255, 255, 255, 0.05);
}

.menu-item.active {
    background: rgba(0, 229, 255, 0.08);
}

.menu-item .title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-main);
}

.menu-item.active .title {
    color: var(--accent);
}

.menu-item .desc {
    font-size: 11px;
    color: var(--text-dim);
    margin-top: 2px;
}



.input-container {
    background: rgba(31, 34, 41, 0.4);
    border-radius: 24px;
    padding: 6px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.input-container:focus-within {
    border-color: var(--accent);
    background: rgba(31, 34, 41, 0.8);
    box-shadow: 0 0 20px rgba(0, 229, 255, 0.15), inset 0 0 10px rgba(0, 229, 255, 0.05);
    transform: translateY(-2px);
}

#user-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-main);
    padding: 10px 5px;
    font-size: 15px;
    resize: none;
    max-height: 120px;
    outline: none;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

#user-input::-webkit-scrollbar {
    display: none;
}


.icon-btn {
    background: transparent;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s, background 0.2s;
}

.icon-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.05);
}

.send-btn {
    color: var(--accent);
}

.send-btn:disabled {
    opacity: 0.3;
}

/* Image Preview */
#image-preview-container {
    display: none;
    padding: 10px;
    position: relative;
}

#image-preview {
    height: 60px;
    width: 60px;
    object-fit: cover;
    border-radius: 10px;
    border: 2px solid var(--accent);
}

.remove-img {
    position: absolute;
    top: 0;
    left: 60px;
    background: var(--bg-main);
    color: var(--text-main);
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

/* Modals */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(8px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 2000;
    animation: fadeIn 0.2s ease-out;
}

.modal-content {
    background: var(--bg-secondary);
    padding: 30px;
    border-radius: 20px;
    max-width: 400px;
    width: 90%;
    text-align: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    animation: scaleUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-content h2 {
    margin-top: 0;
    font-size: 20px;
    color: var(--text-main);
}

.secondary-btn {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-main);
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.secondary-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
}

.modal-content .end-session-btn {
    padding: 12px 20px;
    border-radius: 12px;
    font-size: 14px;
}


@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes scaleUp {
    from {
        opacity: 0;
        transform: scale(0.9);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}


/* Thinking Indicator - The Void Spark */
.thinking-container {
    display: flex;
    padding: 15px 25px;
    align-items: center;
    justify-content: flex-start;
    background: rgba(31, 34, 41, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border-radius: 4px 24px 24px 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    width: fit-content;
    margin: 10px 0;
}

.void-spark-container {
    position: relative;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.void-core {
    width: 8px;
    height: 8px;
    background: var(--accent);
    border-radius: 50%;
    box-shadow: 0 0 15px var(--accent-glow);
    animation: corePulse 1.5s infinite ease-in-out;
}

.void-ring {
    position: absolute;
    width: 22px;
    height: 22px;
    border: 1.5px solid transparent;
    border-top-color: rgba(0, 229, 255, 0.2);
    border-bottom-color: rgba(0, 229, 255, 0.1);
    border-radius: 50%;
    animation: ringOrbit 2s infinite linear;
}

.void-ring:nth-child(2) {
    width: 16px;
    height: 16px;
    border-top-color: transparent;
    border-right-color: rgba(0, 229, 255, 0.4);
    animation: ringOrbit 1.2s infinite linear reverse;
}

@keyframes corePulse {

    0%,
    100% {
        transform: scale(0.8);
        opacity: 0.5;
        filter: blur(1px);
    }

    50% {
        transform: scale(1.2);
        opacity: 1;
        filter: blur(0);
    }
}

@keyframes ringOrbit {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Atmospheric Background Elements */
.mist-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: url('https://www.transparenttextures.com/patterns/p6.png');
    /* Very subtle noise */
    opacity: 0.15;
    pointer-events: none;
    z-index: 1;
}

.glow-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle at 50% 50%, rgba(0, 229, 255, 0.05) 0%, transparent 70%);
    pointer-events: none;
    z-index: 0;
    animation: pulseGlow 10s infinite alternate ease-in-out;
}

@keyframes pulseGlow {
    from {
        opacity: 0.3;
        transform: scale(1);
    }

    to {
        opacity: 0.5;
        transform: scale(1.05);
    }
}

/* Mobile Performance Patch */
@media (max-width: 768px) {

    header,
    .input-area,
    .ai .bubble,
    .thinking-container,
    .search-status-indicator,
    .modal-overlay {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
    }

    header {
        background: #16181d !important;
    }

    /*.ai .bubble {
        background: #1f2229 !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5) !important;
    }*/

    .input-area {
        background: #16181d !important;
        padding: 8px 16px calc(6px + env(safe-area-inset-bottom)) 16px;
    }

    .glow-bg {
        animation: none !important;
        /* Disable continuous scaling on mobile */
        opacity: 0.3 !important;
    }

    .message {
        animation: fadeIn 0.3s ease-out;
        /* Simpler animation */
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Scroll adjustments to keep everything feeling tight */
html {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.1) transparent;
}

/* Agent Tool Modal specific */
.agent-modal {
    max-width: 450px !important;
}

.tool-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 20px;
}

.tool-item {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 20px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-align: left;
    position: relative;
    overflow: hidden;
}

.tool-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(0, 229, 255, 0.1) 0%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s;
}

.tool-item:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: var(--accent);
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 10px 30px rgba(0, 229, 255, 0.15);
}

.tool-item:hover::before {
    opacity: 1;
}

.tool-icon-circle {
    width: 48px;
    height: 48px;
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    transition: all 0.3s;
}

.tool-item:hover .tool-icon-circle {
    background: var(--accent);
    transform: rotate(10deg);
    box-shadow: 0 0 15px var(--accent-glow);
}

.tool-details {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.tool-name {
    font-weight: 700;
    font-size: 16px;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.tool-desc {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.4;
}

#search-query-input {
    width: 100%;
    background: #0d1117;
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: white;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    box-sizing: border-box;
}

#search-query-input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(0, 229, 255, 0.2);
}

#execute-search-btn {
    background: var(--accent);
    color: #000;
    border: none;
    padding: 12px 20px;
    border-radius: 12px;
    font-weight: 600;
    cursor: pointer;
}

#active-tool-container {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 8px;
    min-height: 0;
}

.tool-badge {
    background: rgba(0, 229, 255, 0.1);
    border: 1px solid rgba(0, 229, 255, 0.3);
    color: var(--accent);
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: badgePulse 2s infinite ease-in-out;
    cursor: default;
    backdrop-filter: blur(4px);
}

.tool-badge .remove-tool {
    cursor: pointer;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    color: white;
    transition: background 0.2s;
}

.tool-badge .remove-tool:hover {
    background: #ff4d4d;
}

@keyframes badgePulse {
    0% {
        box-shadow: 0 0 0 0 rgba(0, 229, 255, 0.2);
    }

    70% {
        box-shadow: 0 0 0 8px rgba(0, 229, 255, 0);
    }

    100% {
        box-shadow: 0 0 0 0 rgba(0, 229, 255, 0);
    }
}


/* Search Status Indicator - Mystic Pulse */
.search-status-indicator {
    background: rgba(31, 34, 41, 0.4);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(0, 229, 255, 0.15);
    border-radius: 16px;
    padding: 12px 20px;
    margin: 10px 0;
    align-self: center;
    max-width: fit-content;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2), 0 0 15px rgba(0, 229, 255, 0.05);
    animation: statusFadeIn 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

.search-status-indicator::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 200%;
    height: 100%;
    background: linear-gradient(90deg,
            transparent,
            rgba(0, 229, 255, 0.05),
            rgba(0, 229, 255, 0.1),
            rgba(0, 229, 255, 0.05),
            transparent);
    animation: scanBeam 2.5s infinite linear;
}

.search-status-content {
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 1;
    position: relative;
}

.search-status-content span {
    font-size: 13px;
    font-weight: 500;
    color: var(--accent);
    letter-spacing: 0.02em;
    text-transform: uppercase;
    font-family: 'Fira Code', monospace;
    opacity: 0.9;
}

.search-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(0, 229, 255, 0.1);
    border-top: 2px solid var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite, glowPulse 2s infinite ease-in-out;
}

@keyframes statusFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes scanBeam {
    0% {
        left: -150%;
    }

    100% {
        left: 150%;
    }
}

@keyframes glowPulse {

    0%,
    100% {
        box-shadow: 0 0 5px rgba(0, 229, 255, 0.2);
    }

    50% {
        box-shadow: 0 0 15px rgba(0, 229, 255, 0.5);
    }
}

@keyframes spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* Context Window Gauge (Header) */
.context-gauge {
    display: flex;
    align-items: center;
    gap: 8px;
}

.context-gauge-bar {
    width: 80px;
    height: 6px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 3px;
    overflow: hidden;
    position: relative;
}

.context-gauge-fill {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.4s ease, background 0.4s ease;
    box-shadow: 0 0 6px var(--accent-glow);
}

.context-gauge-fill.warn {
    background: #ffaa00;
    box-shadow: 0 0 6px rgba(255, 170, 0, 0.4);
}

.context-gauge-fill.critical {
    background: #ff4d4d;
    box-shadow: 0 0 6px rgba(255, 77, 77, 0.4);
}

.context-gauge-label {
    font-size: 11px;
    color: var(--text-dim);
    font-weight: 500;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

@media (max-width: 480px) {
    .context-gauge-bar {
        width: 50px;
    }

    .context-gauge-label {
        font-size: 10px;
    }
}