@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600&family=Plus+Jakarta+Sans:wght@300;400;500;600;700&display=swap');

:root {
    /* Color Palette - Light Mode Default */
    --bg: hsl(220, 20%, 98%);
    --surface: hsl(0, 0%, 100%);
    --text: hsl(224, 47%, 11%);
    --text-muted: hsl(220, 14%, 42%);
    --accent: hsl(224, 85%, 52%);
    --accent-glow: hsla(224, 85%, 52%, 0.15);
    --border: hsl(220, 20%, 92%);
    --timeline-line: hsl(220, 20%, 90%);
    --shadow: 0 4px 20px -2px hsla(224, 47%, 11%, 0.05), 0 2px 8px -1px hsla(224, 47%, 11%, 0.03);
    
    --font-heading: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --font-body: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    
    --transition-speed: 0.3s;
    --transition-timing: cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] {
    /* Color Palette - Dark Mode */
    --bg: hsl(224, 25%, 6%);
    --surface: hsl(224, 25%, 10%);
    --text: hsl(210, 40%, 96%);
    --text-muted: hsl(217, 13%, 65%);
    --accent: hsl(210, 100%, 65%);
    --accent-glow: hsla(210, 100%, 65%, 0.2);
    --border: hsl(224, 25%, 15%);
    --timeline-line: hsl(224, 25%, 14%);
    --shadow: 0 10px 30px -10px hsla(0, 0%, 0%, 0.5), 0 1px 3px hsla(0, 0%, 0%, 0.2);
}

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

body {
    background-color: var(--bg);
    color: var(--text);
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.6;
    letter-spacing: -0.011em;
    min-height: 100vh;
    padding-bottom: 80px;
    transition: background-color var(--transition-speed) var(--transition-timing),
                color var(--transition-speed) var(--transition-timing);
    -webkit-font-smoothing: antialiased;
}

/* Base Layout Container */
.container {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 32px;
}

@media (max-width: 640px) {
    .container {
        padding: 0 20px;
    }
}

/* Header Styles */
.header-wrapper {
    padding-top: 80px;
    padding-bottom: 40px;
}

@media (max-width: 768px) {
    .header-wrapper {
        padding-top: 40px;
        padding-bottom: 20px;
    }
}

.header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 48px;
}

@media (max-width: 768px) {
    .header-row {
        flex-direction: column-reverse;
        align-items: center;
        text-align: center;
        gap: 32px;
    }
}

.profile-desc {
    flex: 1;
}

.profile-desc h1 {
    font-family: var(--font-heading);
    font-size: 42px;
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 12px;
}

.profile-desc h2 {
    font-family: var(--font-heading);
    font-size: 18px;
    font-weight: 400;
    color: var(--text-muted);
    line-height: 1.4;
    max-width: 520px;
    margin-bottom: 24px;
}

/* Theme Toggle Button */
.theme-toggle-btn {
    background: none;
    border: 1px solid var(--border);
    border-radius: 99px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 18px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    color: var(--text);
    background-color: var(--surface);
    gap: 8px;
    box-shadow: var(--shadow);
    transition: all 0.2s var(--transition-timing);
    margin-top: 8px;
}

.theme-toggle-btn:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
}

.theme-toggle-btn:active {
    transform: translateY(0);
}

.theme-toggle-btn svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

/* Profile Picture container */
.profile-pic-container {
    flex-shrink: 0;
    width: 180px;
    height: 180px;
    border-radius: 32px;
    overflow: hidden;
    position: relative;
    box-shadow: var(--shadow);
    border: 4px solid var(--surface);
    transition: transform 0.4s var(--transition-timing), border-color var(--transition-speed) var(--transition-timing);
}

.profile-pic-container:hover {
    transform: scale(1.03) rotate(1deg);
    border-color: var(--accent);
}

.profile-pic-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

.profile-pic-container video {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s var(--transition-timing);
    pointer-events: none;
    z-index: 5;
}

.profile-pic-container.video-active video {
    opacity: 1;
}

/* Icon Row */
.social-icons {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 768px) {
    .social-icons {
        justify-content: center;
    }
}

.social-icons a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text-muted);
    transition: all 0.2s var(--transition-timing);
    box-shadow: var(--shadow);
}

.social-icons a:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    background-color: var(--accent-glow);
}

.social-icons a svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Custom Email Obfuscation Button */
.email-reveal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background-color: var(--surface);
    color: var(--text-muted);
    padding: 0 16px;
    height: 44px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.2s var(--transition-timing);
}

.email-reveal-btn:hover {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-2px);
    background-color: var(--accent-glow);
}

.email-reveal-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* Horizontal line separator */
hr {
    border: none;
    height: 1px;
    background-color: var(--border);
    margin: 48px 0;
}

/* Timeline Layout - Karpathy style 3-column Grid */
.timeline {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 36px;
}

.entry.row {
    display: grid;
    grid-template-columns: 140px 48px 1fr;
    gap: 24px;
    align-items: flex-start;
}

.timespan {
    font-family: var(--font-heading);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-muted);
    text-align: right;
    padding-top: 2px;
    letter-spacing: -0.01em;
}

.ico {
    display: flex;
    justify-content: center;
    align-items: center;
    padding-top: 2px;
    width: 100%;
    max-width: 48px;
}

.ico img {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    object-fit: contain;
    filter: grayscale(100%);
    opacity: 0.55;
    transition: all 0.25s var(--transition-timing);
}

[data-theme="dark"] .ico img {
    filter: grayscale(100%) invert(0.9) brightness(1.2);
    opacity: 0.55;
}

/* Ensure original brand colors pop on hover */
.entry.row:hover .ico img {
    filter: grayscale(0%) invert(0) brightness(1);
    opacity: 1;
    transform: scale(1.1);
}

.logo-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.logo-group img {
    width: 28px;
    height: 28px;
    max-width: 28px;
    max-height: 28px;
    object-fit: contain;
}

.desc {
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--text);
}

.desc strong {
    font-weight: 600;
}

.desc a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-muted);
    transition: all 0.2s var(--transition-timing);
}

.desc a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}

/* Responsive collapse for small screens */
@media (max-width: 768px) {
    .entry.row {
        grid-template-columns: 1fr;
        gap: 12px;
        margin-bottom: 8px;
    }

    .timespan {
        text-align: left;
        font-size: 13.5px;
        color: var(--accent);
        margin-bottom: 2px;
        padding-top: 0;
    }

    .ico {
        justify-content: flex-start;
        padding-top: 0;
        margin-bottom: 4px;
        width: auto;
        max-width: 100%;
    }

    .ico img {
        filter: grayscale(0%) !important;
        opacity: 0.95 !important;
    }
    
    [data-theme="dark"] .ico img {
        filter: grayscale(0%) invert(0) brightness(1) !important;
    }

    .logo-group {
        flex-direction: row;
        align-items: center;
        gap: 16px;
    }
}

/* Footer & Copyright */
.footer-text {
    text-align: center;
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 64px;
    font-family: var(--font-heading);
}

.footer-text a {
    color: var(--text);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.footer-text a:hover {
    color: var(--accent);
}

/* Animations */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-fade-in {
    opacity: 0;
    animation: fadeInUp 0.8s var(--transition-timing) forwards;
}

.delay-1 {
    animation-delay: 0.15s;
}

.delay-2 {
    animation-delay: 0.3s;
}

.delay-3 {
    animation-delay: 0.45s;
}

/* Writings & Research Grid */
.writings-section {
    margin-top: 16px;
}

.section-title {
    font-family: var(--font-heading);
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
    color: var(--text);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 24px;
    height: 3px;
    border-radius: 2px;
    background-color: var(--accent);
}

.writings-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-top: 16px;
}

@media (max-width: 992px) {
    .writings-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    .writings-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
}

.writing-card {
    background-color: var(--surface);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 22px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    transition: all 0.3s var(--transition-timing);
    overflow: hidden;
}

.writing-card-img-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 12px;
    margin-bottom: 16px;
    background-color: var(--border);
}

.writing-card-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s var(--transition-timing);
}

.writing-card:hover {
    border-color: var(--accent);
    transform: translateY(-3px);
    box-shadow: 0 12px 30px -10px hsla(224, 85%, 52%, 0.08), var(--shadow);
}

.writing-card:hover .writing-card-img {
    transform: scale(1.04);
}

.writing-badge {
    align-self: flex-start;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 10px;
    border-radius: 99px;
    margin-bottom: 16px;
    border: 1px solid transparent;
}

/* Light / dark adaptive pill colors */
.writing-badge.paper {
    background-color: hsla(280, 85%, 52%, 0.08);
    color: hsl(280, 85%, 52%);
    border-color: hsla(280, 85%, 52%, 0.15);
}
[data-theme="dark"] .writing-badge.paper {
    background-color: hsla(280, 100%, 70%, 0.12);
    color: hsl(280, 100%, 75%);
    border-color: hsla(280, 100%, 70%, 0.2);
}

.writing-badge.blog {
    background-color: hsla(32, 100%, 50%, 0.08);
    color: hsl(32, 95%, 45%);
    border-color: hsla(32, 100%, 50%, 0.15);
}
[data-theme="dark"] .writing-badge.blog {
    background-color: hsla(32, 100%, 65%, 0.12);
    color: hsl(32, 100%, 70%);
    border-color: hsla(32, 100%, 65%, 0.2);
}

.writing-badge.library {
    background-color: hsla(150, 85%, 40%, 0.08);
    color: hsl(150, 85%, 35%);
    border-color: hsla(150, 85%, 40%, 0.15);
}
[data-theme="dark"] .writing-badge.library {
    background-color: hsla(150, 100%, 60%, 0.12);
    color: hsl(150, 100%, 65%);
    border-color: hsla(150, 100%, 60%, 0.2);
}

.writing-badge.social {
    background-color: hsla(210, 85%, 50%, 0.08);
    color: hsl(210, 85%, 45%);
    border-color: hsla(210, 85%, 50%, 0.15);
}
[data-theme="dark"] .writing-badge.social {
    background-color: hsla(210, 100%, 65%, 0.12);
    color: hsl(210, 100%, 70%);
    border-color: hsla(210, 100%, 65%, 0.2);
}

.writing-title {
    font-family: var(--font-heading);
    font-size: 17px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 10px;
    color: var(--text);
    letter-spacing: -0.01em;
}

.writing-desc {
    color: var(--text-muted);
    font-size: 14.5px;
    line-height: 1.6;
    margin-bottom: 20px;
    flex-grow: 1;
}

.writing-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    color: var(--accent);
    text-decoration: none;
    transition: color 0.2s var(--transition-timing);
    align-self: flex-start;
    margin-top: auto;
}

.writing-link:hover {
    color: var(--text);
}

.writing-link .link-arrow {
    width: 16px;
    height: 16px;
    transition: transform 0.2s var(--transition-timing);
    stroke: currentColor;
    stroke-width: 2.5;
    fill: none;
}

.writing-link:hover .link-arrow {
    transform: translateX(4px);
}

/* LinkedIn Pulse Carousel */
.linkedin-carousel-container {
    position: relative;
    width: 100%;
    margin-bottom: 40px;
}

.linkedin-carousel {
    display: flex;
    align-items: stretch;
    gap: 24px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    /* Expanded padding prevents active card zoom and box-shadow clipping by overflow BFC mask */
    padding: 20px 12px 28px 12px;
    margin: -12px -12px 0 -12px;
    scrollbar-width: none; /* Hide standard thin scrollbar on Firefox */
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
}

.linkedin-carousel::-webkit-scrollbar {
    display: none; /* Hide default scrollbars on Chrome/Safari/Webkit */
}

/* Grab cursors to signal desktop drag-to-scroll capability */
.linkedin-carousel.grab-active {
    cursor: grab;
}
.linkedin-carousel.grabbing {
    cursor: grabbing;
    scroll-snap-type: none; /* Disable snapping while actively dragging for perfect real-time cursor alignment */
    scroll-behavior: auto;  /* Instantly track drag gestures without smoothing delay */
}

.linkedin-carousel .writing-card {
    flex: 0 0 calc(33.333% - 16px);
    scroll-snap-align: start;
    min-width: 280px;
    user-select: none; /* Prevent text selection highlight glitches during dragging */
    -webkit-user-drag: none; /* Prevent browser image/card ghosting during drag gestures */
}

@media (max-width: 1024px) {
    .linkedin-carousel .writing-card {
        flex: 0 0 calc(50% - 12px);
    }
}

@media (max-width: 768px) {
    .linkedin-carousel .writing-card {
        flex: 0 0 85%;
    }
    .linkedin-carousel {
        gap: 16px;
        /* Mobile touch has native swiping, keep standard overflow margins */
        padding: 16px 12px 24px 12px;
    }
}

/* Floating Navigation Arrows & Edge Fades */
.carousel-fade-overlay {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 60px;
    pointer-events: none;
    z-index: 5;
    transition: opacity 0.3s var(--transition-timing);
    opacity: 0;
}

.carousel-fade-overlay.left {
    left: 0;
    background: linear-gradient(to right, var(--bg) 0%, transparent 100%);
}

.carousel-fade-overlay.right {
    right: 0;
    background: linear-gradient(to left, var(--bg) 0%, transparent 100%);
}

.carousel-fade-overlay.visible {
    opacity: 1;
}

.carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid var(--border);
    color: var(--text-muted);
    display: none; /* hidden by default, shown on desktop (hover support) */
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: all 0.3s var(--transition-timing);
    z-index: 10;
    opacity: 1;
}

[data-theme="dark"] .carousel-arrow {
    background: rgba(10, 12, 16, 0.45);
    border-color: var(--border);
}

.carousel-arrow:hover {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent);
    transform: translateY(-50%) scale(1.1);
}

.carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.carousel-arrow.arrow-left {
    left: -22px;
}

.carousel-arrow.arrow-right {
    right: -22px;
}

/* Graceful fading for edge bounds */
.carousel-arrow.is-hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-50%) scale(0.9);
}

/* Only show carousel arrows on desktop pointer devices */
@media (hover: hover) and (pointer: fine) {
    .carousel-arrow {
        display: flex;
    }
}

/* ==========================================================================
   MCP AGENT CONSOLE SIMULATOR & FLOATING TRIGGER (FAB)
   ========================================================================== */

/* Floating Launcher Button */
.mcp-launcher-btn {
    position: fixed;
    bottom: 32px;
    right: 32px;
    left: auto;
    z-index: 999;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
    border-radius: 99px;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    color: var(--text);
    font-family: var(--font-heading);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 10px 30px -5px hsla(224, 47%, 11%, 0.1), var(--shadow);
    transition: all 0.4s var(--transition-timing);
    animation: mcp-fab-entrance 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
    animation-delay: 1s;
    opacity: 0;
    transform: translateY(20px) scale(0.9);
}

[data-theme="dark"] .mcp-launcher-btn {
    background: rgba(15, 18, 25, 0.7);
    border-color: rgba(255, 255, 255, 0.08);
}

.mcp-launcher-btn:hover {
    border-color: var(--accent);
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 15px 35px -5px var(--accent-glow), 0 5px 15px -3px rgba(0, 0, 0, 0.05);
}

.mcp-launcher-btn:active {
    transform: translateY(-2px) scale(0.98);
}

.mcp-launcher-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    width: 18px;
    height: 18px;
}

.mcp-launcher-text {
    letter-spacing: -0.01em;
    display: flex;
    align-items: center;
}

.mcp-launcher-extra {
    display: inline-block;
    max-width: 0;
    opacity: 0;
    overflow: hidden;
    white-space: nowrap;
    transition: max-width 0.3s cubic-bezier(0.25, 1, 0.5, 1), opacity 0.25s ease, margin-left 0.25s ease;
}

.mcp-launcher-btn:hover .mcp-launcher-extra {
    max-width: 100px;
    opacity: 1;
    margin-left: 2px;
}

/* Pulsing Notification Ring on FAB */
.mcp-launcher-btn::after {
    content: '';
    position: absolute;
    top: -2px;
    right: -2px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--accent);
    box-shadow: 0 0 0 2px var(--bg);
    animation: mcp-pulse-ring 2s infinite;
}

/* MCP Dialog Overlay Window */
dialog.mcp-console-dialog {
    border: none;
    border-radius: 24px;
    padding: 0;
    background: transparent;
    max-width: 960px;
    width: calc(100% - 48px);
    max-height: 640px;
    height: calc(100% - 48px);
    box-shadow: var(--shadow);
    overflow: hidden;
    margin: auto;
    z-index: 10000;
    
    /* Top-Layer Native discretes for Entry/Exit Animations */
    opacity: 0;
    transform: translateY(32px) scale(0.97);
    transition: opacity 0.4s var(--transition-timing),
                transform 0.4s var(--transition-timing),
                display 0.4s var(--transition-timing) allow-discrete,
                overlay 0.4s var(--transition-timing) allow-discrete;
}

dialog.mcp-console-dialog[open] {
    opacity: 1;
    transform: translateY(0) scale(1);
    
    @starting-style {
        opacity: 0;
        transform: translateY(32px) scale(0.97);
    }
}

/* Dialog Backdrop styling */
dialog.mcp-console-dialog::backdrop {
    background-color: rgba(10, 12, 16, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    opacity: 0;
    transition: opacity 0.4s var(--transition-timing),
                display 0.4s var(--transition-timing) allow-discrete,
                overlay 0.4s var(--transition-timing) allow-discrete;
}

dialog.mcp-console-dialog[open]::backdrop {
    opacity: 1;
    
    @starting-style {
        opacity: 0;
    }
}

/* Monospace Window structure */
.mcp-window {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    overflow: hidden;
    background: rgba(13, 16, 23, 0.93);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-radius: 24px;
}

/* macOS title bar styling */
.mcp-window-header {
    display: grid;
    grid-template-columns: 80px 1fr 150px;
    align-items: center;
    background: rgba(20, 24, 33, 0.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    padding: 14px 20px;
    user-select: none;
}

.mcp-header-dots {
    display: flex;
    gap: 8px;
}

.mcp-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    display: inline-block;
}

.mcp-dot.red { background-color: #ff5f56; cursor: pointer; }
.mcp-dot.yellow { background-color: #ffbd2e; }
.mcp-dot.green { background-color: #27c93f; }

.mcp-header-title {
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.45);
    text-align: center;
    font-weight: 500;
}

.mcp-header-status {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.6);
}

.mcp-status-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: #27c93f;
    display: inline-block;
    box-shadow: 0 0 8px #27c93f;
}

.mcp-window-close-btn {
    display: none; /* We use red macOS dot to close on desktop, but keep accessible standard */
}

/* Split Panes Workspace */
.mcp-window-body {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    height: calc(100% - 46px);
    overflow: hidden;
}

/* Custom Glassmonospaced Scrollbar track for standard browser engines */
.mcp-pane {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.mcp-pane::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.mcp-pane::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.08);
    border-radius: 99px;
}

.mcp-pane::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.15);
}

/* Pane 1: Monospaced Stdio telemetry stream */
.terminal-pane {
    border-right: 1px solid rgba(255, 255, 255, 0.06);
    background: rgba(8, 10, 15, 0.4);
}

.terminal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 20px;
    background: rgba(10, 12, 17, 0.3);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.35);
}

.terminal-clear-btn {
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    font-family: inherit;
    font-size: 10px;
    padding: 2px 8px;
    border-radius: 4px;
    background: rgba(255, 255, 255, 0.04);
    transition: all 0.2s;
}

.terminal-clear-btn:hover {
    color: #ff5f56;
    background: rgba(255, 95, 86, 0.08);
}

.terminal-content {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 12.5px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.85);
    background: #06080c;
}

/* Terminal Log syntax coloring */
.term-log {
    margin-bottom: 12px;
    word-break: break-all;
    white-space: pre-wrap;
}

.term-time { color: rgba(255, 255, 255, 0.25); margin-right: 8px; }
.term-sys { color: #88c0d0; }
.term-client { color: #81a1c1; }
.term-server { color: #b48ead; }
.term-tool { color: #a3be8c; font-weight: 600; }
.term-args { color: #ebcb8b; }
.term-thought { color: #d8dee9; font-style: italic; opacity: 0.7; border-left: 2px solid rgba(129, 161, 193, 0.3); padding-left: 8px; margin: 4px 0; }
.term-json { color: #d8dee9; background: rgba(255, 255, 255, 0.02); border: 1px solid rgba(255, 255, 255, 0.04); padding: 8px 12px; border-radius: 8px; margin: 4px 0; font-size: 11.5px; overflow-x: auto; }

/* Pane 2: User Chat interface */
.chat-pane {
    background: rgba(13, 16, 23, 0.2);
}

.chat-header {
    padding: 12px 20px;
    background: rgba(20, 24, 33, 0.2);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
    font-family: var(--font-heading);
    font-size: 13.5px;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.8);
    display: flex;
    align-items: center;
    gap: 8px;
}

.chat-header::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background-color: #27c93f;
    border-radius: 50%;
}

.chat-history {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 16px;
    scroll-behavior: smooth;
}

.chat-msg {
    max-width: 85%;
    display: flex;
    flex-direction: column;
}

.chat-msg.user {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-msg.agent {
    align-self: flex-start;
    align-items: flex-start;
}

.chat-bubble {
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.5;
}

.chat-msg.user .chat-bubble {
    background: var(--accent);
    color: #fff;
    border-bottom-right-radius: 4px;
    box-shadow: 0 4px 15px rgba(224, 85, 52, 0.1);
}

.chat-msg.agent .chat-bubble {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.9);
    border-bottom-left-radius: 4px;
}

/* Chat bubble styling inside light mode fallback */
[data-theme="light"] .chat-msg.agent .chat-bubble {
    color: rgba(255, 255, 255, 0.95); /* Keep high contrast terminal texts */
}

/* Markdown elements inside chatbot output bubble */
.chat-bubble p { margin-bottom: 10px; }
.chat-bubble p:last-child { margin-bottom: 0; }
.chat-bubble ul, .chat-bubble ol { padding-left: 20px; margin-bottom: 10px; }
.chat-bubble li { margin-bottom: 4px; }
.chat-bubble a { color: var(--accent); font-weight: 600; text-decoration: none; border-bottom: 1px dotted var(--accent); }
.chat-bubble a:hover { color: #fff; border-bottom-style: solid; }

.chat-msg-meta {
    font-size: 10.5px;
    color: rgba(255, 255, 255, 0.25);
    margin-top: 4px;
    font-family: var(--font-heading);
}

/* Active Typing state indicator */
.chat-bubble.typing {
    display: flex;
    gap: 4px;
    padding: 14px 18px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    background-color: rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    animation: mcp-typing-bounce 1.4s infinite ease-in-out both;
}

.typing-dot:nth-child(2) { animation-delay: 0.2s; }
.typing-dot:nth-child(3) { animation-delay: 0.4s; }

/* Interactive Badge indicating tool usage in chat bubble */
.tool-query-badge {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 11px;
    color: #a3be8c;
    background: rgba(163, 190, 140, 0.08);
    border: 1px solid rgba(163, 190, 140, 0.15);
    border-radius: 6px;
    padding: 3px 8px;
    margin-bottom: 8px;
}

.tool-query-badge svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* Pre-canned Suggestions chips wrapper */
.chat-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(10, 12, 17, 0.2);
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.chat-chip {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 99px;
    color: rgba(255, 255, 255, 0.7);
    padding: 6px 14px;
    font-family: var(--font-heading);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s var(--transition-timing);
}

.chat-chip:hover {
    color: #fff;
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

.chat-chip:active {
    transform: translateY(0);
}

/* Chat Input Command bar styling */
.chat-input-form {
    display: flex;
    padding: 16px 20px;
    background: rgba(20, 24, 33, 0.4);
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    gap: 12px;
    align-items: center;
}

.chat-input-form input {
    flex: 1;
    background: rgba(6, 8, 12, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    padding: 12px 16px;
    font-family: var(--font-body);
    font-size: 13.5px;
    outline: none;
    transition: all 0.2s;
}

.chat-input-form input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(224, 85, 52, 0.2);
}

.chat-input-form input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.chat-input-form button {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: var(--accent);
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(224, 85, 52, 0.15);
    flex-shrink: 0;
}

.chat-input-form button:hover {
    transform: translateY(-2px);
    background: var(--text);
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}

.chat-input-form button:active {
    transform: translateY(0);
}

.chat-input-form button svg {
    width: 18px;
    height: 18px;
}

/* Monospaced Cursor terminal blink */
.term-cursor {
    display: inline-block;
    width: 8px;
    height: 15px;
    background-color: var(--mcp-term-text, #a3be8c);
    animation: mcp-cursor-blink 1s step-end infinite;
    vertical-align: middle;
    margin-left: 2px;
}

/* Keyframes Animations definitions */
@keyframes mcp-pulse-ring {
    0% { transform: scale(0.95); opacity: 0.8; }
    50% { transform: scale(1.4); opacity: 0.3; }
    100% { transform: scale(2.2); opacity: 0; }
}

@keyframes mcp-fab-entrance {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes mcp-cursor-blink {
    from, to { background-color: transparent; }
    50% { background-color: #a3be8c; }
}

@keyframes mcp-typing-bounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* ==========================================================================
   MCP RESPONSIVE RESPONSIVENESS FALLBACK CODES
   ========================================================================== */
@media (max-width: 900px) {
    dialog.mcp-console-dialog {
        max-height: calc(100% - 32px);
        height: calc(100% - 32px);
        width: calc(100% - 32px);
        bottom: 16px;
        right: 16px;
    }
    .mcp-window-body {
        grid-template-columns: 1fr; /* Stack panes vertically on mid/mobile screen layouts */
    }
    .terminal-pane {
        display: none; /* Hide dev log stream completely to maximize interactive chatbot area */
    }
    .mcp-window-header {
        grid-template-columns: 80px 1fr 44px;
    }
    .mcp-window-close-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        color: rgba(255, 255, 255, 0.4);
        font-size: 24px;
        cursor: pointer;
        line-height: 1;
        padding-bottom: 2px;
    }
    .mcp-window-close-btn:hover {
        color: #ff5f56;
    }
}

@media (max-width: 640px) {
    .mcp-launcher-btn {
        bottom: 20px;
        right: 20px;
        left: auto;
        padding: 10px 16px;
    }
    .mcp-launcher-text {
        display: none; /* Hide text label on mobile, leaving minimal FAB badge */
    }
    .chat-chips {
        padding: 8px 16px;
        gap: 6px;
    }
    .chat-chip {
        padding: 5px 10px;
        font-size: 11px;
    }
    .chat-input-form {
        padding: 12px 16px;
    }
}

/* Glassmorphic unanswered question submit styles */
.unanswered-feedback-card {
    margin-top: 12px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.02);
    border: 1px dashed rgba(255, 255, 255, 0.1);
    border-radius: 14px;
    font-size: 13px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
    animation: fadeIn 0.3s ease;
    backdrop-filter: blur(4px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.feedback-card-text {
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.45;
}

.feedback-submit-btn {
    background: rgba(224, 85, 52, 0.12);
    border: 1.5px solid var(--accent);
    color: var(--accent);
    padding: 7px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: var(--font-heading);
    letter-spacing: 0.02em;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.feedback-submit-btn:hover {
    background: var(--accent);
    color: #fff;
    box-shadow: 0 4px 14px rgba(224, 85, 52, 0.25);
    transform: translateY(-1.5px);
}

.feedback-submit-btn:active {
    transform: translateY(-0.5px);
}

.feedback-submit-btn.submitted {
    background: rgba(46, 204, 113, 0.12);
    border-color: #2ecc71;
    color: #2ecc71;
    cursor: default;
    box-shadow: none;
    transform: none;
}

.feedback-inline-form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.feedback-form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.feedback-prompt {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--accent);
    opacity: 0.85;
    font-weight: 600;
}

.feedback-value-prefilled {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    padding: 8px 12px;
    border-radius: 8px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 12px;
    font-family: var(--font-mono);
    line-height: 1.45;
    word-break: break-word;
}

.feedback-input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 8px 12px;
    border-radius: 8px;
    color: #fff;
    font-size: 12px;
    font-family: var(--font-mono);
    outline: none;
    transition: all 0.2s ease;
}

.feedback-input:focus {
    border-color: var(--accent);
    background: rgba(255, 255, 255, 0.08);
    box-shadow: 0 0 8px rgba(224, 85, 52, 0.15);
}

.feedback-input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback-error-notice {
    font-size: 11.5px;
    color: #ff6b6b;
    background: rgba(231, 76, 60, 0.08);
    border: 1px solid rgba(231, 76, 60, 0.2);
    padding: 8px 12px;
    border-radius: 8px;
    line-height: 1.45;
    margin-top: 4px;
    animation: fadeIn 0.3s ease;
}

.feedback-error-notice code {
    background: rgba(0, 0, 0, 0.2);
    padding: 1px 4px;
    border-radius: 4px;
    font-family: var(--font-mono);
}

/* AI Reference Accordion for Answer Engine Optimization */
.ai-ref-container {
    max-width: var(--container-width);
    margin: 64px auto 32px;
    padding: 24px;
    border-radius: 20px;
    background-color: var(--surface);
    border: 1px solid var(--border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: var(--shadow);
}

.ai-ref-title {
    font-family: var(--font-heading);
    font-size: 16px;
    font-weight: 600;
    color: var(--accent);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    letter-spacing: -0.01em;
}

.ai-ref-title svg {
    width: 16px;
    height: 16px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.5;
}

.ai-ref-item {
    border-bottom: 1px solid var(--border);
    padding: 14px 0;
}

.ai-ref-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.ai-ref-item summary {
    font-family: var(--font-heading);
    font-size: 14.5px;
    font-weight: 500;
    color: var(--text);
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: color 0.2s var(--transition-timing);
}

.ai-ref-item summary::-webkit-details-marker {
    display: none;
}

.ai-ref-item summary::after {
    content: '+';
    font-size: 18px;
    font-weight: 300;
    color: var(--text-muted);
    transition: transform 0.3s var(--transition-timing);
}

.ai-ref-item[open] summary::after {
    transform: rotate(45deg);
    color: var(--accent);
}

.ai-ref-item summary:hover {
    color: var(--accent);
}

.ai-ref-content {
    margin-top: 10px;
    font-size: 13.5px;
    line-height: 1.65;
    color: var(--text-muted);
    padding-right: 20px;
}

.ai-ref-content strong {
    color: var(--text);
    font-weight: 500;
}

.ai-ref-content a {
    color: var(--text);
    text-decoration: none;
    border-bottom: 1px dotted var(--text-muted);
    transition: all 0.2s var(--transition-timing);
}

.ai-ref-content a:hover {
    color: var(--accent);
    border-bottom-color: var(--accent);
}




