/* =============================================================================
   VIBROPRESS AI — PREMIUM B2B ENGINEERING DESIGN SYSTEM
   Clean, professional, production-grade interface
   ============================================================================= */

/* CSS Variables */
:root {
    /* Slate palette — engineering/industrial feel */
    --slate-950: #0a0f1a;
    --slate-900: #0f1629;
    --slate-800: #1e293b;
    --slate-700: #334155;
    --slate-600: #475569;
    --slate-500: #64748b;
    --slate-400: #94a3b8;
    --slate-300: #cbd5e1;
    --slate-200: #e2e8f0;
    --slate-100: #f1f5f9;
    --slate-50: #f8fafc;
    --white: #ffffff;

    /* Primary — muted professional blue */
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #3b82f6;

    /* User question bubble: light, readable, and distinct from the hero background */
    --user-bubble-bg: #e6efff;
    --user-bubble-bg-2: #d8e6ff;
    --user-bubble-border: #b9d0ff;
    --user-bubble-text: #0f1629;
    --bot-bubble-bg: #ffffff;
    --bubble-max-width: 78%;

    /* Secondary — teal/green */
    --secondary: #059669;
    --secondary-light: #10b981;

    /* Semantic */
    --accent: #f59e0b;
    --danger: #dc2626;
    --warning: #f59e0b;
    --success: #10b981;

    /* Legacy compat aliases */
    --gray-50: var(--slate-50);
    --gray-100: var(--slate-100);
    --gray-200: var(--slate-200);
    --gray-300: var(--slate-300);
    --gray-400: var(--slate-400);
    --gray-500: var(--slate-500);
    --gray-600: var(--slate-600);
    --gray-700: var(--slate-700);
    --gray-800: var(--slate-800);
    --gray-900: var(--slate-900);

    /* Shadows — refined, not heavy */
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.06), 0 2px 4px -2px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 25px -5px rgba(0,0,0,0.07), 0 8px 10px -6px rgba(0,0,0,0.03);
    --shadow-xl: 0 20px 50px -12px rgba(0,0,0,0.1);
    --shadow-chat: 0 0 0 1px rgba(0,0,0,0.04), 0 8px 40px -8px rgba(0,0,0,0.08);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;

    /* Fonts */
    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'JetBrains Mono', 'Fira Code', 'Cascadia Code', 'Consolas', monospace;

    /* Transition */
    --ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* =============================================================================
   RESET & BASE
   ============================================================================= */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    font-size: 16px;
    line-height: 1.6;
    color: var(--slate-800);
    background: var(--slate-50);
    min-height: 100vh;
    overflow-x: hidden;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 32px;
}

/* =============================================================================
   NAVIGATION
   ============================================================================= */

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    height: 64px;
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--slate-200);
    padding: 0;
    transition: box-shadow 0.2s var(--ease);
}

.navbar .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: 1280px;
    gap: 22px;
}

.nav-brand {
    flex: 0 0 auto;
    font-size: 18px;
    font-weight: 700;
    color: var(--slate-900);
    text-decoration: none;
    letter-spacing: -0.3px;
    white-space: nowrap;
    transition: color 0.15s var(--ease);
}

.nav-brand:hover {
    color: var(--primary);
}

.nav-menu {
    display: flex;
    align-items: center;
    gap: 4px;
    list-style: none;
    flex: 0 1 auto;
    min-width: 0;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 10px;
    color: var(--slate-600);
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: 8px;
    transition: color 0.15s var(--ease), background 0.15s var(--ease);
}

.nav-link:hover {
    background: var(--slate-100);
    color: var(--slate-900);
}

.btn-primary-small {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    background: var(--slate-900);
    color: var(--white) !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 14px;
    line-height: 1.2;
    white-space: nowrap;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: background 0.15s var(--ease);
}

.btn-primary-small:hover {
    background: var(--slate-700);
}

.language-switch {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    gap: 2px;
    padding: 3px;
    border: 1px solid var(--slate-200);
    border-radius: 999px;
    background: var(--slate-50);
}

.language-switch-btn {
    min-width: 34px;
    height: 28px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--slate-600);
    font: inherit;
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    transition: background 0.15s var(--ease), color 0.15s var(--ease), box-shadow 0.15s var(--ease);
}

.language-switch-btn.is-active {
    background: var(--slate-900);
    color: var(--white);
    box-shadow: var(--shadow-xs);
}

.language-switch-btn:not(.is-active):hover {
    background: var(--slate-100);
    color: var(--slate-900);
}

/* Mobile Menu */
.mobile-menu-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
}

.mobile-menu-toggle span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--slate-700);
    border-radius: 2px;
    transition: all 0.2s var(--ease);
}

.mobile-menu-toggle.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.mobile-menu-toggle.active span:nth-child(2) {
    opacity: 0;
}

.mobile-menu-toggle.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

@media (max-width: 1180px) {
    .navbar .container {
        padding: 0 20px;
        gap: 14px;
    }

    .nav-brand {
        font-size: 16px;
    }

    .nav-menu {
        gap: 2px;
    }

    .nav-link {
        padding: 8px 7px;
        font-size: 13px;
    }

    .btn-primary-small {
        padding: 8px 12px;
        font-size: 13px;
    }

    .language-switch-btn {
        min-width: 30px;
    }
}

@media (max-width: 980px) {
    .nav-menu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--white);
        flex-direction: column;
        padding: 16px;
        border-bottom: 1px solid var(--slate-200);
        box-shadow: var(--shadow-lg);
        gap: 4px;
    }

    .nav-menu.active {
        display: flex;
    }

    .nav-menu li,
    .nav-menu .nav-link,
    .nav-menu .btn-primary-small {
        width: 100%;
        justify-content: center;
        text-align: center;
    }

    .language-switch {
        width: 100%;
        justify-content: center;
    }

    .mobile-menu-toggle {
        display: flex;
    }
}

/* =============================================================================
   HERO SECTION
   ============================================================================= */

.hero {
    padding: 140px 0 80px;
    background: var(--slate-900);
    position: relative;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background:
        radial-gradient(ellipse at 20% 50%, rgba(37, 99, 235, 0.08) 0%, transparent 50%),
        radial-gradient(ellipse at 80% 20%, rgba(5, 150, 105, 0.06) 0%, transparent 50%);
    pointer-events: none;
}

.hero::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
    pointer-events: none;
}

.hero > .container {
    position: relative;
    z-index: 1;
}

.hero-content {
    position: relative;
    text-align: center;
    max-width: 760px;
    margin: 0 auto;
}

.hero-title {
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 800;
    color: var(--white);
    margin-bottom: 20px;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

.hero-subtitle {
    font-size: clamp(16px, 2vw, 19px);
    color: var(--slate-400);
    margin-bottom: 40px;
    line-height: 1.7;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.hero-buttons {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-platforms {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 16px;
    color: var(--slate-400);
    font-size: 13px;
}

.hero-platforms-label {
    font-weight: 600;
}

.hero-platform-link {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 8px 12px;
    border: 1px solid rgba(148, 163, 184, 0.32);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.07);
    color: var(--white);
    text-decoration: none;
    font-size: 13px;
    font-weight: 700;
    transition: border-color 0.15s var(--ease), background 0.15s var(--ease), transform 0.15s var(--ease);
}

.hero-platform-link:hover {
    border-color: rgba(255, 255, 255, 0.45);
    background: rgba(255, 255, 255, 0.12);
    transform: translateY(-1px);
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: var(--white);
    color: var(--slate-900);
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    border-radius: var(--radius-lg);
    border: none;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.btn-primary:hover {
    background: var(--slate-100);
    transform: translateY(-1px);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 14px 28px;
    background: transparent;
    color: var(--slate-300);
    text-decoration: none;
    font-weight: 600;
    font-size: 15px;
    border: 1.5px solid var(--slate-700);
    border-radius: var(--radius-lg);
    transition: all 0.15s var(--ease);
}

.btn-secondary:hover {
    border-color: var(--slate-500);
    color: var(--white);
}

.hero-search {
    padding: 96px 0 72px;
}

.hero-search .container {
    max-width: 1600px;
}

.hero-search-copy {
    max-width: 820px;
    margin-bottom: 28px;
}

.hero-eyebrow,
.tools-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 5px 10px;
    margin-bottom: 14px;
    border: 1px solid rgba(148, 163, 184, 0.26);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.06);
    color: var(--slate-300);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    line-height: 1;
    text-transform: uppercase;
}

.hero-search .hero-title {
    margin-bottom: 14px;
}

.hero-search .hero-subtitle {
    margin-bottom: 10px;
}

.hero-search .demo-subtitle {
    margin-bottom: 22px;
    color: var(--slate-300);
}

.hero-search .demo-layout {
    max-width: 1360px;
}

.hero-search .chat-container {
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.06),
        0 28px 90px -38px rgba(0, 0, 0, 0.88);
}

.hero-search .chat-messages {
    height: auto;
    min-height: 360px;
}

.chat-input-wrapper-top {
    order: 1;
    border-top: 1px solid var(--slate-100);
    border-bottom: 1px solid var(--slate-100);
    padding: 18px 24px 20px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.98)),
        radial-gradient(circle at 96% 0%, rgba(37, 99, 235, 0.1), transparent 34%);
}

.chat-input-wrapper-top .example-questions {
    margin: 12px 0 0;
}

.chat-input-heading {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.chat-input-heading strong {
    color: var(--slate-950);
    font-size: 15px;
    line-height: 1.2;
    font-weight: 800;
}

.chat-input-heading span {
    color: var(--slate-500);
    font-size: 12px;
    line-height: 1.35;
    text-align: right;
}

.hero-search .chat-input {
    min-height: 54px;
    background: var(--white);
    border-width: 2px;
    box-shadow: inset 0 1px 0 rgba(15, 22, 41, 0.03);
}

.hero-search .send-btn {
    width: 54px;
    height: 54px;
}

.tools-section {
    padding: 72px 0 72px;
    background: var(--slate-50);
}

.tools-section .container {
    max-width: 1200px;
}

.tools-section-header {
    max-width: 760px;
    margin: 0 auto 28px;
    text-align: center;
}

.tools-section .section-title {
    margin-bottom: 10px;
}

.tools-section .demo-subtitle {
    margin-bottom: 0;
}

.tools-eyebrow {
    background: var(--white);
    border-color: var(--slate-200);
    color: var(--primary-dark);
}

/* =============================================================================
   DEMO SECTION & CHAT
   ============================================================================= */

.demo-section {
    padding: 80px 0 96px;
    background: var(--white);
}

.demo-section .container {
    max-width: 1600px;
}

.section-title {
    font-size: clamp(28px, 3.5vw, 38px);
    font-weight: 800;
    color: var(--slate-900);
    text-align: center;
    margin-bottom: 12px;
    letter-spacing: -0.03em;
    line-height: 1.15;
}

.demo-subtitle {
    font-size: 16px;
    color: var(--slate-500);
    text-align: center;
    margin-bottom: 48px;
    max-width: 640px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* Mode Switcher */
.mode-switcher {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 32px;
}

.mode-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 14px 20px;
    background: var(--white);
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-lg);
    cursor: pointer;
    transition: all 0.15s var(--ease);
    min-width: 120px;
}

.mode-btn:hover {
    border-color: var(--slate-300);
    box-shadow: var(--shadow-sm);
}

.mode-btn.active {
    background: var(--slate-900);
    border-color: var(--slate-900);
    color: var(--white);
}

.mode-icon {
    font-size: 24px;
}

.mode-name {
    font-size: 13px;
    font-weight: 600;
}

/* Chat Container */
.demo-layout {
    display: grid;
    grid-template-columns: minmax(120px, 190px) minmax(0, 960px) minmax(120px, 190px);
    gap: 14px;
    align-items: start;
    margin: 0 auto;
}

.demo-layout .chat-container {
    width: 100%;
    margin: 0;
}

.side-highlight-stack {
    position: sticky;
    top: 96px;
    display: grid;
    gap: 12px;
}

.side-highlight-card {
    position: relative;
    min-height: 196px;
    padding: 14px;
    background:
        radial-gradient(circle at 12% 0%, rgba(37, 99, 235, 0.12), transparent 42%),
        radial-gradient(circle at 96% 12%, rgba(16, 185, 129, 0.14), transparent 38%),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.side-highlight-card::before {
    content: "";
    position: absolute;
    inset: 0;
    border-top: 3px solid var(--secondary-light);
    pointer-events: none;
}

.video-highlight-card {
    min-height: 150px;
    background:
        radial-gradient(circle at 88% 0%, rgba(245, 158, 11, 0.13), transparent 42%),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
}

.video-highlight-card::before {
    border-top-color: var(--accent);
}

.podcast-highlight-card {
    min-height: 170px;
    background:
        radial-gradient(circle at 88% 0%, rgba(37, 99, 235, 0.16), transparent 42%),
        radial-gradient(circle at 12% 100%, rgba(245, 158, 11, 0.12), transparent 42%),
        linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,250,252,0.98));
}

.podcast-highlight-card::before {
    border-top-color: var(--primary);
}

.side-highlight-kicker {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 3px 8px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: rgba(15, 22, 41, 0.08);
    color: var(--slate-700);
    font-size: 11px;
    line-height: 1;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.side-highlight-title {
    margin: 0 0 8px;
    color: var(--slate-950);
    font-size: 17px;
    line-height: 1.18;
    font-weight: 800;
}

.side-highlight-text {
    margin: 0;
    color: var(--slate-600);
    font-size: 13px;
    line-height: 1.5;
}

.side-highlight-list {
    display: grid;
    gap: 6px;
    margin: 12px 0 14px;
    padding: 0;
    list-style: none;
}

.side-highlight-list li {
    position: relative;
    padding-left: 16px;
    color: var(--slate-700);
    font-size: 12px;
    line-height: 1.35;
}

.side-highlight-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--secondary-light);
}

.side-highlight-soon {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 6px 10px;
    margin-top: 12px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: var(--slate-50);
    color: var(--slate-700);
    font-size: 12px;
    line-height: 1;
    font-weight: 800;
}

.side-highlight-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 8px;
    background: var(--slate-900);
    color: var(--white);
    font-size: 12px;
    line-height: 1.2;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s var(--ease), box-shadow 0.15s var(--ease), background 0.15s var(--ease);
}

.side-highlight-btn:hover {
    background: var(--slate-800);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.chat-container {
    display: flex;
    flex-direction: column;
    max-width: 960px;
    min-height: 0;
    margin: 0 auto;
    background: var(--white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-chat);
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header {
    order: 3;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: nowrap;
    padding: 12px 24px;
    background: var(--slate-900);
    color: var(--white);
}

.chat-status {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    font-weight: 500;
}

.status-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.4; }
}

.status-text {
    color: var(--slate-400);
    font-size: 12px;
}

#current-mode {
    color: var(--accent);
    font-weight: 700;
}

.chat-header-actions {
    display: flex;
    align-items: center;
    gap: 7px;
    flex-wrap: wrap;
    justify-content: flex-end;
    margin-left: auto;
}

.chat-header-promo {
    display: flex;
    align-items: center;
    gap: 6px;
    padding-right: 8px;
    margin-right: 4px;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.chat-header-promo-label {
    color: var(--slate-400);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chat-header-promo .chat-access-controls {
    flex-wrap: nowrap;
    gap: 6px;
}

.chat-header-promo .promo-code-input {
    min-width: 150px;
    height: 32px;
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
}

.chat-header-promo .promo-code-input::placeholder {
    color: rgba(226, 232, 240, 0.72);
}

.chat-header-promo .promo-code-input:focus {
    border-color: rgba(96, 165, 250, 0.72);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.18);
}

.chat-header-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    min-height: 32px;
    padding: 6px 12px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    color: var(--slate-300);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    color: var(--white);
}

.chat-header-btn-accent {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.18), rgba(34, 197, 94, 0.14));
    border-color: rgba(14, 165, 233, 0.28);
    color: #dbeafe;
}

.chat-header-btn-accent:hover {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.28), rgba(34, 197, 94, 0.22));
}

.chat-header-btn-podcast {
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.26);
    color: #fde68a;
}

.chat-header-btn-podcast:hover {
    background: rgba(245, 158, 11, 0.2);
    color: var(--white);
}

.chat-access-strip {
    order: 4;
    display: grid;
    grid-template-columns: minmax(180px, 1fr) auto;
    align-items: center;
    justify-content: stretch;
    gap: 12px;
    padding: 10px 24px 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    border-bottom: 1px solid var(--slate-200);
}

.chat-access-copy {
    display: flex;
    align-items: center;
    gap: 8px;
    max-width: none;
    font-size: 12px;
    color: var(--slate-500);
}

.chat-access-copy strong {
    display: inline-flex;
    color: var(--slate-700);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.chat-access-strip > .chat-access-controls {
    display: flex;
    justify-content: flex-end;
    flex-wrap: nowrap;
}

#promo-status-text.is-error {
    color: #b91c1c;
}

.chat-access-controls {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.promo-code-input {
    min-width: 220px;
    height: 36px;
    padding: 0 12px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--slate-800);
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
}

.promo-code-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

/* Chat Messages */
.chat-messages {
    order: 2;
    flex: 1 1 auto;
    height: auto;
    min-height: 360px;
    max-height: none;
    overflow-y: visible;
    padding: 28px 24px 24px;
    background: var(--white);
    scroll-behavior: smooth;
}

.chat-messages::-webkit-scrollbar {
    width: 0;
}

.chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* Messages */
.message {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    animation: msg-in 0.25s var(--ease);
}

@keyframes msg-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Compat: fadeInUp alias used in some places */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.user-message {
    flex-direction: row-reverse;
}

.user-message .message-content {
    flex: 0 1 auto;
    max-width: var(--bubble-max-width);
    background: linear-gradient(180deg, var(--user-bubble-bg), var(--user-bubble-bg-2));
    color: var(--user-bubble-text);
    border: 1px solid var(--user-bubble-border);
    border-radius: var(--radius-lg) 3px var(--radius-lg) var(--radius-lg);
    box-shadow: 0 1px 2px rgba(15, 22, 41, 0.06);
}

.user-message .message-content p {
    color: var(--user-bubble-text);
}

.bot-message .message-content {
    flex: 0 1 auto;
    max-width: var(--bubble-max-width);
    background: var(--bot-bubble-bg);
    border: 1px solid var(--slate-200);
    border-radius: 3px var(--radius-lg) var(--radius-lg) var(--radius-lg);
    box-shadow: var(--shadow-xs);
}

.message-avatar {
    width: 36px;
    height: 36px;
    font-size: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border-radius: 10px;
    margin-top: 2px;
}

.bot-message .message-avatar {
    background: var(--slate-100);
}

.user-message .message-avatar {
    background: var(--primary);
    border-radius: 10px;
}

.message-content {
    flex: 1;
    padding: 14px 18px;
    font-size: 15.5px;
    line-height: 1.7;
    min-width: 0;
}

.message-content::before {
    content: attr(data-author);
    display: block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
    text-transform: uppercase;
    opacity: 0.6;
}

.message-content:not([data-author])::before,
.message-content[data-author=""]::before {
    display: none;
}

.user-message .message-content::before {
    color: var(--primary);
    text-align: right;
}

.bot-message .message-content::before {
    color: var(--slate-500);
}

.message-content p {
    margin: 0 0 10px 0;
    color: var(--slate-800);
}

.message-content p:last-child {
    margin-bottom: 0;
}

/* Chat Input */
.chat-input-wrapper {
    order: 1;
    padding: 14px 24px 16px;
    background: var(--white);
    border-top: 1px solid var(--slate-100);
}

.example-questions {
    display: flex;
    gap: 6px;
    flex-wrap: nowrap;
    margin-bottom: 10px;
    overflow-x: auto;
    padding-bottom: 2px;
}

.example-question {
    padding: 7px 14px;
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--slate-600);
    cursor: pointer;
    transition: all 0.15s var(--ease);
    line-height: 1.4;
}

.example-question:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}

.chat-input-container {
    display: flex;
    gap: 10px;
    align-items: flex-end;
    min-width: 0;
}

.chat-disclaimer {
    display: none;
    margin-top: 6px;
    font-size: 11px;
    color: var(--slate-400);
    line-height: 1.4;
}

.chat-input {
    flex: 1;
    min-width: 0;
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.5;
    resize: none;
    transition: border-color 0.15s var(--ease), box-shadow 0.15s var(--ease);
    min-height: 48px;
    max-height: 220px;
    background: var(--slate-50);
    color: var(--slate-900);
}

.chat-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.08);
    background: var(--white);
}

.chat-input::placeholder {
    color: var(--slate-400);
}

.send-btn {
    width: 48px;
    height: 48px;
    background: var(--slate-900);
    color: var(--white);
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s var(--ease);
    flex-shrink: 0;
}

.send-btn:hover:not(:disabled) {
    background: var(--slate-700);
}

.send-btn:active:not(:disabled) {
    transform: scale(0.96);
}

.send-btn:disabled {
    background: var(--slate-300);
    cursor: not-allowed;
}

.send-btn svg {
    width: 20px;
    height: 20px;
}

/* =============================================================================
   FEATURES SECTION
   ============================================================================= */

.features {
    padding: 96px 0;
    background: var(--slate-50);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    margin-top: 48px;
}

.feature-card {
    padding: 32px 28px;
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--slate-100);
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.feature-card:hover {
    border-color: var(--slate-200);
    box-shadow: var(--shadow-md);
}

.feature-icon {
    font-size: 32px;
    margin-bottom: 16px;
    display: block;
    width: 52px;
    height: 52px;
    background: var(--slate-50);
    border: 1px solid var(--slate-100);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.feature-description {
    font-size: 14px;
    color: var(--slate-500);
    line-height: 1.6;
}

/* =============================================================================
   HOW IT WORKS SECTION
   ============================================================================= */

.how-it-works {
    padding: 96px 0;
    position: relative;
    overflow: hidden;
    background:
        radial-gradient(circle at top center, rgba(245, 158, 11, 0.18), transparent 34%),
        linear-gradient(180deg, #101729 0%, #0b1120 100%);
    color: var(--white);
}

.how-it-works::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        linear-gradient(180deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 120px 120px;
    opacity: 0.2;
    pointer-events: none;
}

.how-it-works .container {
    position: relative;
    z-index: 1;
}

.how-it-works .section-title {
    color: var(--white);
    margin-bottom: 0;
}

.how-header {
    max-width: 780px;
    margin: 0 auto;
    text-align: center;
}

.how-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 34px;
    padding: 0 14px;
    margin-bottom: 18px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: var(--slate-200);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.how-lead {
    margin: 18px auto 0;
    max-width: 720px;
    font-size: 16px;
    line-height: 1.75;
    color: rgba(226, 232, 240, 0.82);
}

.steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 20px;
    margin-top: 48px;
}

.step {
    position: relative;
    min-height: 272px;
    padding: 28px 28px 32px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.09), rgba(255, 255, 255, 0.04));
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(8, 15, 31, 0.32);
    backdrop-filter: blur(12px);
    text-align: left;
}

.step::after {
    content: '';
    position: absolute;
    left: 28px;
    right: 28px;
    bottom: 0;
    height: 3px;
    border-radius: 999px;
    background: linear-gradient(90deg, var(--accent) 0%, rgba(245, 158, 11, 0.08) 100%);
}

.step-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 22px;
}

.step-number {
    width: 52px;
    height: 52px;
    background: rgba(255, 255, 255, 0.96);
    color: var(--slate-900);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.08em;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.2);
}

.step-chip {
    display: inline-flex;
    align-items: center;
    min-height: 32px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(245, 158, 11, 0.12);
    border: 1px solid rgba(245, 158, 11, 0.24);
    color: #fde68a;
    font-size: 12px;
    font-weight: 700;
    white-space: nowrap;
}

.step-title {
    font-size: 21px;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 12px;
    color: var(--white);
    letter-spacing: -0.02em;
}

.step-description {
    margin: 0;
    font-size: 15px;
    color: rgba(226, 232, 240, 0.82);
    line-height: 1.7;
}

.how-note {
    margin-top: 24px;
    display: flex;
    align-items: flex-start;
    gap: 18px;
    padding: 20px 22px;
    background: rgba(15, 23, 42, 0.44);
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 20px;
    box-shadow: 0 18px 44px rgba(8, 15, 31, 0.24);
}

.how-note-label {
    flex: 0 0 180px;
    font-size: 14px;
    font-weight: 800;
    color: var(--white);
}

.how-note-text {
    margin: 0;
    font-size: 15px;
    line-height: 1.7;
    color: rgba(226, 232, 240, 0.82);
}

@media (max-width: 900px) {
    .steps {
        grid-template-columns: 1fr;
    }

    .step {
        min-height: 0;
    }

    .step-top,
    .how-note {
        flex-direction: column;
        align-items: flex-start;
    }

    .how-note-label {
        flex-basis: auto;
    }
}

/* =============================================================================
   FOR WHOM SECTION
   ============================================================================= */

.for-whom {
    padding: 80px 0;
    background: var(--white);
}

.badges {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 40px;
}

.badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 24px;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    transition: all 0.15s var(--ease);
}

.badge:hover {
    border-color: var(--slate-300);
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
}

.badge-icon {
    font-size: 22px;
}

.badge-text {
    font-size: 15px;
    font-weight: 600;
    color: var(--slate-800);
}

/* =============================================================================
   CTA SECTION
   ============================================================================= */

.cta {
    padding: 96px 0;
    background: var(--slate-900);
    text-align: center;
}

.cta-title {
    font-size: clamp(28px, 3.5vw, 38px);
    font-weight: 800;
    color: var(--white);
    margin-bottom: 16px;
    letter-spacing: -0.03em;
}

.cta-subtitle {
    font-size: 16px;
    color: var(--slate-400);
    margin-bottom: 36px;
    max-width: 520px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

.cta .btn-primary {
    font-size: 16px;
    padding: 16px 32px;
}

/* =============================================================================
   MESSENGER LINKS SECTION
   ============================================================================= */

.messenger-links {
    padding: 72px 0;
    background: var(--slate-50);
    scroll-margin-top: 92px;
}

.messenger-links-header {
    max-width: 760px;
    margin: 0 auto 48px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.messenger-links .section-title {
    margin-left: auto;
    margin-right: auto;
    text-wrap: balance;
}

.messenger-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    max-width: 800px;
    margin: 0 auto;
}

.messenger-card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    padding: 32px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}

.messenger-card:hover {
    border-color: var(--slate-300);
    box-shadow: var(--shadow-lg);
}

.messenger-card-top {
    margin-bottom: 24px;
    width: 100%;
}

.messenger-badge {
    display: inline-block;
    padding: 4px 14px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 12px;
}

.messenger-badge-telegram {
    background: #e0f2fe;
    color: #0369a1;
}

.messenger-badge-max {
    background: #fce7f3;
    color: #9d174d;
}

.messenger-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.messenger-handle {
    margin-bottom: 10px;
    color: var(--slate-500);
    font-size: 14px;
    font-weight: 500;
}

.messenger-description {
    font-size: 14px;
    color: var(--slate-500);
    line-height: 1.6;
}

.messenger-qr-link {
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
    margin-bottom: 16px;
}

.messenger-qr {
    width: 160px;
    height: 160px;
    display: block;
    border-radius: 12px;
    border: 1px solid var(--slate-200);
    transition: box-shadow 0.2s var(--ease);
}

.messenger-qr:hover {
    box-shadow: var(--shadow-md);
}

.messenger-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--primary);
    text-decoration: none;
    padding: 10px 20px;
    border: 1.5px solid var(--primary);
    border-radius: 8px;
    margin: 0 auto;
    transition: all 0.15s var(--ease);
    min-width: 150px;
}

.messenger-action:hover {
    background: var(--primary);
    color: var(--white);
}

.messenger-action-secondary {
    margin-top: 10px;
    border-color: var(--slate-300);
    color: var(--slate-700);
    background: var(--slate-50);
}

.messenger-action-secondary:hover {
    border-color: var(--slate-900);
    background: var(--slate-900);
    color: var(--white);
}

/* =============================================================================
   PODCASTS SECTION
   ============================================================================= */

.podcasts-section {
    padding: 78px 0;
    background: linear-gradient(180deg, var(--white) 0%, var(--slate-50) 100%);
    scroll-margin-top: 92px;
}

.podcasts-header {
    max-width: 820px;
    margin: 0 auto 36px;
    text-align: center;
}

.podcasts-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    margin-bottom: 12px;
    border-radius: 999px;
    background: #fff7ed;
    color: #9a3412;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.podcast-list {
    max-width: 920px;
    margin: 0 auto;
}

.podcast-card {
    display: grid;
    grid-template-columns: minmax(260px, 0.72fr) minmax(0, 1fr) minmax(260px, 0.58fr);
    gap: 24px;
    align-items: stretch;
    padding: 28px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-lg);
    background: var(--white);
    box-shadow: var(--shadow-lg);
}

.podcast-cover {
    min-height: 260px;
    border-radius: var(--radius-md);
    background:
        linear-gradient(120deg, rgba(10, 15, 26, 0.92), rgba(10, 15, 26, 0.12)),
        var(--slate-900);
    background-size: cover;
    background-position: center;
    overflow: hidden;
    display: flex;
    align-items: stretch;
}

.podcast-cover-overlay {
    width: 100%;
    min-height: 100%;
    padding: 20px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    color: var(--white);
    background: linear-gradient(180deg, rgba(10, 15, 26, 0.08), rgba(10, 15, 26, 0.72));
}

.podcast-cover-kicker {
    display: inline-flex;
    align-self: flex-start;
    min-height: 26px;
    padding: 4px 10px;
    margin-bottom: 10px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #dbeafe;
    font-size: 12px;
    font-weight: 800;
}

.podcast-cover-overlay strong {
    max-width: 320px;
    font-size: 24px;
    line-height: 1.12;
    font-weight: 900;
    text-wrap: balance;
}

.podcast-meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 14px;
}

.podcast-badge,
.podcast-duration {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.podcast-badge {
    background: #eff6ff;
    color: #1d4ed8;
}

.podcast-duration {
    background: var(--slate-100);
    color: var(--slate-600);
}

.podcast-title {
    margin: 0 0 10px;
    color: var(--slate-950);
    font-size: 26px;
    line-height: 1.15;
    font-weight: 850;
}

.podcast-subtitle {
    margin: 0;
    color: var(--slate-600);
    font-size: 15px;
    line-height: 1.6;
}

.podcast-notes {
    display: grid;
    gap: 8px;
    margin: 18px 0 0;
    padding: 0;
    list-style: none;
}

.podcast-notes li {
    position: relative;
    padding-left: 18px;
    color: var(--slate-700);
    font-size: 14px;
    line-height: 1.45;
}

.podcast-notes li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
}

.podcast-player-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 14px;
    padding: 18px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    background: var(--slate-50);
}

.podcast-status {
    display: inline-flex;
    align-self: flex-start;
    min-height: 28px;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 800;
}

.podcast-status.is-soon {
    background: #fef3c7;
    color: #92400e;
}

.podcast-status.is-ready {
    background: #dcfce7;
    color: #166534;
}

.podcast-audio {
    width: 100%;
}

.podcast-audio[aria-disabled="true"] {
    opacity: 0.55;
}

.podcast-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.podcast-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 8px 12px;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    color: var(--slate-800);
    background: var(--white);
    font-size: 13px;
    font-weight: 800;
    text-decoration: none;
}

.podcast-action:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.podcast-listen-btn {
    border-color: var(--primary);
    background: var(--primary);
    color: var(--white);
    cursor: pointer;
}

.podcast-listen-btn:hover:not(:disabled) {
    background: var(--primary-dark);
    color: var(--white);
}

.podcast-listen-btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.podcast-empty {
    padding: 28px;
    border: 1px dashed var(--slate-300);
    border-radius: var(--radius-md);
    color: var(--slate-500);
    background: var(--white);
    text-align: center;
}

/* =============================================================================
   FOOTER
   ============================================================================= */

.footer {
    padding: 40px 0;
    background: var(--slate-900);
    text-align: center;
    border-top: 1px solid rgba(255,255,255,0.04);
}

.footer-text {
    font-size: 14px;
    color: var(--slate-500);
    margin-bottom: 6px;
}

.footer-text:last-child {
    margin-bottom: 0;
}

.footer-link {
    color: var(--slate-400);
    text-decoration: none;
    transition: color 0.15s var(--ease);
}

.footer-link:hover {
    color: var(--white);
}

/* =============================================================================
   LOADING STATES
   ============================================================================= */

.typing-indicator {
    display: flex;
    gap: 5px;
    padding: 6px 14px;
    background: var(--slate-100);
    border-radius: 16px;
    width: fit-content;
}

.typing-indicator span {
    width: 7px;
    height: 7px;
    background: var(--slate-400);
    border-radius: 50%;
    animation: typing-bounce 1.4s infinite both;
}

.typing-indicator span:nth-child(1) { animation-delay: 0s; }
.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing-bounce {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.3; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* Compat alias */
@keyframes bounce {
    0%, 60%, 100% { transform: translateY(0); }
    30% { transform: translateY(-6px); }
}

/* =============================================================================
   MESSAGE CONTENT FORMATTING
   ============================================================================= */

.message-content ul,
.message-content ol {
    margin: 10px 0;
    padding-left: 0;
    list-style: none;
}

.message-content li {
    position: relative;
    padding-left: 22px;
    margin-bottom: 6px;
    line-height: 1.6;
}

.message-content ul li::before {
    content: "";
    position: absolute;
    left: 6px;
    top: 10px;
    width: 5px;
    height: 5px;
    background: var(--slate-400);
    border-radius: 50%;
}

.user-message .message-content ul li::before {
    background: var(--primary);
}

.message-content ol {
    counter-reset: item;
}

.message-content ol li {
    counter-increment: item;
}

.message-content ol li::before {
    content: counter(item) ".";
    position: absolute;
    left: 0;
    color: var(--slate-500);
    font-weight: 700;
    font-size: 13px;
}

.message-content strong {
    font-weight: 700;
    color: var(--slate-900);
}

.user-message .message-content strong {
    color: var(--user-bubble-text);
}

.message-content code {
    background: var(--slate-100);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: var(--font-mono);
    font-size: 0.88em;
    color: var(--slate-700);
}

.user-message .message-content code {
    background: rgba(255, 255, 255, 0.65);
    color: var(--user-bubble-text);
}

.message-content pre {
    background: var(--slate-900);
    color: var(--slate-100);
    padding: 16px;
    border-radius: var(--radius-md);
    overflow-x: auto;
    margin: 12px 0;
    font-size: 13px;
    line-height: 1.5;
}

.message-content pre code {
    background: none;
    color: inherit;
    padding: 0;
    font-size: inherit;
}

.message-content h3 {
    font-size: 16px;
    font-weight: 700;
    color: var(--slate-900);
    margin: 18px 0 10px;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--slate-200);
}

.message-content h4 {
    font-size: 15px;
    font-weight: 600;
    color: var(--slate-800);
    margin: 14px 0 8px;
}

.citation-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    vertical-align: baseline;
}

.citation-marker {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 18px;
    margin: 0 2px;
    padding: 0 6px;
    border: 1px solid var(--slate-300);
    border-radius: 999px;
    background: var(--slate-50);
    color: var(--slate-700);
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
}

.citation-marker:hover,
.citation-marker:focus,
.citation-marker.is-active {
    border-color: var(--primary);
    background: #eff6ff;
    color: var(--primary-dark);
    outline: none;
}

.citation-preview {
    position: absolute;
    left: 0;
    top: calc(100% + 8px);
    z-index: 60;
    width: min(360px, calc(100vw - 48px));
    max-height: 280px;
    overflow: auto;
    padding: 12px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: var(--white);
    box-shadow: var(--shadow-lg);
    color: var(--slate-700);
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
}

.citation-preview strong,
.citation-preview-meta,
.citation-preview-snippet {
    display: block;
}

.citation-preview strong {
    margin-bottom: 4px;
    color: var(--slate-900);
    font-size: 12px;
}

.citation-preview-meta {
    margin-bottom: 8px;
    color: var(--slate-500);
    font-size: 11px;
}

.citation-preview-snippet {
    color: var(--slate-700);
}

.message-content .answer-heading {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 14px 0 6px;
    padding: 4px 10px;
    border-radius: 999px;
    background: var(--slate-100);
    color: var(--slate-900);
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.045em;
}

.message-content .answer-section {
    margin: 12px 0;
}

/* Tables */
.message-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: 13px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-sm);
    overflow: hidden;
}

.message-content thead {
    background: var(--slate-800);
    color: var(--white);
}

.message-content th {
    padding: 10px 14px;
    text-align: left;
    font-weight: 600;
    font-size: 12px;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.message-content td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--slate-100);
    font-size: 13px;
    color: var(--slate-700);
}

.message-content tbody tr:last-child td {
    border-bottom: none;
}

.message-content tbody tr:nth-child(even) {
    background: var(--slate-50);
}

.message-content tbody tr:hover {
    background: #f0f7ff;
}

/* =============================================================================
   SOURCES & METADATA
   ============================================================================= */

.sources {
    margin-top: 16px;
    padding: 14px;
    background: var(--slate-50);
    border-radius: var(--radius-md);
    border-left: 3px solid var(--secondary);
}

.sources h4 {
    margin: 0 0 10px;
    font-size: 12px;
    font-weight: 700;
    color: var(--slate-500);
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sources h4::before {
    content: "📚";
    font-size: 14px;
}

.source-item {
    margin-bottom: 10px;
    padding: 10px 12px;
    background: var(--white);
    border-radius: var(--radius-sm);
    border: 1px solid var(--slate-100);
    transition: all 0.15s var(--ease);
}

.source-item:last-child {
    margin-bottom: 0;
}

.source-item:hover {
    border-color: var(--slate-200);
    box-shadow: var(--shadow-xs);
}

.source-item strong {
    color: var(--slate-800);
    font-size: 13px;
    font-weight: 600;
}

.source-item span {
    color: var(--slate-500);
    font-size: 12px;
}

.source-item p {
    margin: 6px 0 0;
    color: var(--slate-500);
    font-size: 12px;
    line-height: 1.5;
}

/* Entity Tags */
.entities {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.entity-tag {
    display: inline-flex;
    padding: 3px 10px;
    background: var(--slate-100);
    color: var(--slate-600);
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* Message Meta */
.message-meta {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--slate-100);
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
}

.complaint-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: #fef2f2;
    color: var(--danger);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 700;
    border: 1px solid #fecaca;
}

.complaint-badge::before {
    content: "⚖️";
    font-size: 12px;
}

.model-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--slate-100);
    color: var(--slate-500);
    border-radius: var(--radius-sm);
    font-size: 11px;
    font-weight: 600;
}

.model-badge::before {
    content: "🤖";
    font-size: 12px;
}

/* =============================================================================
   IMAGES
   ============================================================================= */

.message-images {
    margin-top: 16px;
    padding-top: 14px;
    border-top: 1px solid var(--slate-100);
}

.images-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--slate-500);
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.images-title::before {
    content: "🖼️";
    font-size: 14px;
}

.images-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 12px;
}

.image-card {
    background: var(--white);
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    transition: all 0.15s var(--ease);
    cursor: pointer;
}

.image-card:hover {
    border-color: var(--slate-300);
    box-shadow: var(--shadow-md);
}

.image-wrapper {
    position: relative;
    width: 100%;
    padding-top: 75%;
    background: var(--slate-100);
    overflow: hidden;
}

.image-wrapper img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.2s var(--ease);
}

.image-card:hover .image-wrapper img {
    transform: scale(1.02);
}

.image-caption {
    padding: 10px 12px;
    background: var(--white);
    border-top: 1px solid var(--slate-100);
}

.image-caption-text {
    font-size: 12px;
    color: var(--slate-700);
    font-weight: 500;
    line-height: 1.4;
}

.image-meta {
    margin-top: 4px;
    display: flex;
    gap: 8px;
    font-size: 11px;
    color: var(--slate-400);
}

/* Lightbox */
.image-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.image-lightbox.active {
    display: flex;
}

.lightbox-content {
    max-width: 90%;
    max-height: 90%;
    position: relative;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: var(--radius-md);
}

.lightbox-close {
    position: absolute;
    top: -48px;
    right: 0;
    width: 40px;
    height: 40px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    font-size: 20px;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s var(--ease);
}

.lightbox-close:hover {
    background: rgba(255,255,255,0.2);
}

/* =============================================================================
   RATING SYSTEM
   ============================================================================= */

.rating-container {
    margin-top: 16px;
    padding: 14px;
    background: #f8fafc;
    border-radius: var(--radius-md);
    border: 1px solid #dbeafe;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.feedback-panel {
    width: 100%;
    align-items: stretch;
}

.feedback-panel-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
}

.feedback-panel-hint {
    margin-top: 2px;
    font-size: 12px;
    line-height: 1.45;
    color: var(--slate-500);
}

.rating-label {
    font-size: 13px;
    font-weight: 800;
    color: var(--slate-800);
}

.rating-buttons {
    display: flex;
    gap: 4px;
}

.rating-btn {
    width: 36px;
    height: 36px;
    border: 1.5px solid var(--slate-200);
    background: var(--white);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    color: var(--slate-500);
    cursor: pointer;
    transition: all 0.15s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
}

.rating-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}

.rating-btn.selected {
    background: var(--slate-900);
    border-color: var(--slate-900);
    color: var(--white);
}

.rating-btn:active {
    transform: scale(0.95);
}

.rating-thanks {
    font-size: 12px;
    color: var(--success);
    font-weight: 600;
    animation: fade-in 0.2s var(--ease);
}

.rating-followup {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding-top: 4px;
}

.rating-followup-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--slate-500);
}

.rating-followup-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.rating-followup-tag {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--slate-200);
    border-radius: 999px;
    background: var(--white);
    color: var(--slate-700);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.rating-followup-tag:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.rating-followup-tag.selected {
    border-color: var(--slate-900);
    background: var(--slate-900);
    color: var(--white);
}

.rating-followup-note {
    width: 100%;
    min-height: 76px;
    padding: 10px 12px;
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    resize: vertical;
    font: inherit;
    color: var(--slate-800);
    background: var(--white);
}

.rating-followup-note:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.rating-followup-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.rating-followup-save,
.rating-followup-skip {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.rating-followup-save {
    border: 1px solid var(--slate-900);
    background: var(--slate-900);
    color: var(--white);
}

.rating-followup-skip {
    border: 1px solid var(--slate-200);
    background: var(--white);
    color: var(--slate-600);
}

.rating-followup-save:disabled,
.rating-followup-skip:disabled {
    opacity: 0.6;
    cursor: default;
}

@keyframes fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

.answer-actions {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding-top: 2px;
}

.answer-action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 36px;
    padding: 0 14px;
    border: 1px solid var(--slate-300);
    border-radius: 8px;
    background: var(--white);
    color: var(--slate-700);
    cursor: pointer;
    font-size: 13px;
    font-weight: 800;
    transition: all 0.15s var(--ease);
}

.answer-action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(15, 23, 42, 0.1);
    border-color: var(--primary);
    color: var(--primary);
    background: #eff6ff;
}

.answer-action-btn.action-primary {
    border-color: #2563eb;
    background: #2563eb;
    color: var(--white);
}

.answer-action-btn.action-primary:hover {
    background: #1d4ed8;
    border-color: #1d4ed8;
    color: var(--white);
}

.answer-action-btn.action-secondary:hover {
    border-color: #2563eb;
    color: #1d4ed8;
    background: #eff6ff;
}

.answer-action-btn.loading,
.answer-action-btn:disabled {
    cursor: wait;
    opacity: 0.6;
}

.answer-action-btn.done {
    border-color: var(--success);
    background: #ecfdf5;
    color: #047857;
    cursor: default;
}

.expand-btn {
    border-color: rgba(15, 118, 110, 0.22);
    color: #0f766e;
    background: #ecfeff;
}

.context-btn {
    border-color: rgba(180, 83, 9, 0.24);
    color: #92400e;
    background: #fffbeb;
}

.context-refine-panel {
    width: 100%;
}

.context-refine-card {
    margin-top: 4px;
    padding: 12px;
    border: 1px solid var(--slate-200);
    border-radius: 12px;
    background: var(--white);
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.context-refine-title {
    color: var(--slate-900);
    font-size: 13px;
    font-weight: 800;
}

.context-refine-hint,
.context-refine-state {
    color: var(--slate-500);
    font-size: 12px;
    line-height: 1.5;
}

.context-refine-input {
    width: 100%;
    min-height: 78px;
    padding: 10px 12px;
    border: 1px solid var(--slate-200);
    border-radius: 10px;
    resize: vertical;
    font: inherit;
    color: var(--slate-800);
    background: var(--slate-50);
}

.context-refine-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.context-refine-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.context-refine-submit,
.context-refine-cancel {
    min-height: 34px;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.context-refine-submit {
    border: 1px solid var(--slate-900);
    background: var(--slate-900);
    color: var(--white);
}

.context-refine-cancel {
    border: 1px solid var(--slate-200);
    background: var(--white);
    color: var(--slate-600);
}

.improve-feedback-container {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
}

.improve-feedback-buttons {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.improve-feedback-btn {
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--slate-700);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.improve-feedback-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.improve-feedback-btn.selected {
    border-color: var(--success);
    background: #ecfdf5;
    color: #047857;
}

.improve-feedback-btn:disabled {
    opacity: 0.6;
    cursor: default;
}

.improve-feedback-thanks {
    font-size: 12px;
    color: var(--success);
    font-weight: 600;
}

.copy-btn {
    margin-left: auto;
    min-width: 40px;
    height: 36px;
    padding: 0 10px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--slate-600);
    cursor: pointer;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.15s var(--ease);
}

.copy-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.response-meta {
    margin-top: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.news-card {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid rgba(14, 165, 233, 0.18);
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(14, 165, 233, 0.12), transparent 32%),
        linear-gradient(180deg, #f8fdff 0%, #ffffff 100%);
    box-shadow: var(--shadow-sm);
}

.news-card-head {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 10px;
}

.news-card-eyebrow {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0369a1;
}

.news-card-title {
    font-size: 18px;
    line-height: 1.3;
    font-weight: 700;
    color: var(--slate-900);
}

.news-card-summary {
    margin: 0;
    color: var(--slate-700);
    line-height: 1.65;
}

.news-card-why {
    margin-top: 12px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(14, 165, 233, 0.08);
}

.news-card-why-label {
    display: inline-block;
    margin-bottom: 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #0369a1;
}

.news-card-why p {
    margin: 0;
    color: var(--slate-800);
}

.news-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 14px;
}

.news-card-chip {
    padding: 6px 10px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.06);
    color: var(--slate-700);
    font-size: 12px;
    font-weight: 600;
}

.news-card-chip-muted {
    background: rgba(14, 165, 233, 0.08);
    color: #075985;
}

.news-card-note {
    margin-top: 12px;
    font-size: 12px;
    color: var(--slate-500);
}

.news-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 16px;
}

.news-card-feedback {
    margin-top: 16px;
    padding: 12px 14px;
    border-radius: 14px;
    background: rgba(15, 23, 42, 0.04);
}

.news-card-feedback-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-700);
}

.news-card-feedback-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.news-refresh-btn,
.news-open-btn,
.news-feedback-btn {
    padding: 10px 14px;
    border-radius: 10px;
    border: 1px solid var(--slate-200);
    background: var(--white);
    color: var(--slate-700);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.news-refresh-btn:hover,
.news-open-btn:hover,
.news-feedback-btn:hover {
    border-color: #0ea5e9;
    color: #0369a1;
}

.news-feedback-btn.selected {
    border-color: #0ea5e9;
    background: rgba(14, 165, 233, 0.1);
    color: #075985;
}

.news-feedback-btn:disabled {
    cursor: default;
    opacity: 0.78;
}

.news-feedback-state {
    margin-top: 10px;
    font-size: 12px;
    color: #0369a1;
}

.news-feedback-state.is-error {
    color: #b91c1c;
}

.mix-design-beta-card {
    margin-top: 18px;
    padding: 18px;
    border: 1px solid rgba(37, 99, 235, 0.18);
    border-radius: 16px;
    background: linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    box-shadow: var(--shadow-sm);
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    gap: 18px;
}

.mix-design-beta-eyebrow {
    display: inline-flex;
    margin-bottom: 8px;
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.mix-design-beta-card h3 {
    margin: 0;
    color: var(--slate-900);
    font-size: 18px;
    line-height: 1.25;
}

.mix-design-beta-card p {
    margin: 8px 0 0;
    color: var(--slate-600);
    font-size: 13px;
    line-height: 1.6;
}

.mix-design-beta-actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px;
}

.mix-design-beta-actions a {
    text-decoration: none;
}

.mix-design-open-btn {
    min-height: 44px;
    padding: 12px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    border: 1px solid rgba(37, 99, 235, 0.35);
    color: var(--white);
    box-shadow: 0 12px 26px -14px rgba(37, 99, 235, 0.85);
}

.mix-design-open-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), #047857);
    color: var(--white);
    box-shadow: 0 16px 32px -16px rgba(5, 150, 105, 0.9);
}

.mix-design-preview-btn {
    min-height: 44px;
    padding: 12px 18px;
    background: var(--white);
    border: 1px solid var(--slate-300);
    color: var(--slate-700);
}

.mix-design-preview-btn:hover {
    background: var(--slate-50);
    border-color: var(--primary);
    color: var(--primary-dark);
}

.mix-preview-card {
    margin-top: 16px;
    padding: 18px;
    border: 1px solid var(--slate-200);
    border-radius: 16px;
    background:
        radial-gradient(circle at top right, rgba(37, 99, 235, 0.08), transparent 28%),
        linear-gradient(180deg, #f8fbff 0%, #ffffff 100%);
    box-shadow: var(--shadow-sm);
}

.mix-preview-head {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
    margin-bottom: 16px;
}

.mix-preview-title-wrap {
    min-width: 0;
}

.mix-preview-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(37, 99, 235, 0.1);
    color: var(--primary-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.mix-preview-title {
    font-size: 18px;
    line-height: 1.2;
    font-weight: 800;
    color: var(--slate-900);
    letter-spacing: -0.02em;
}

.mix-preview-subtitle {
    margin-top: 8px;
    color: var(--slate-600);
    font-size: 13px;
    line-height: 1.6;
}

.mix-preview-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.mix-preview-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--slate-900);
    color: var(--white);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.mix-preview-badge-muted {
    background: var(--slate-100);
    color: var(--slate-700);
}

.mix-preview-kpis {
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 10px;
    margin-bottom: 16px;
}

.mix-preview-kpi {
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--white);
    border: 1px solid var(--slate-100);
}

.mix-preview-kpi-accent {
    background: linear-gradient(180deg, #eff6ff 0%, #ffffff 100%);
    border-color: rgba(37, 99, 235, 0.16);
}

.mix-preview-kpi-label {
    display: block;
    margin-bottom: 6px;
    color: var(--slate-500);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mix-preview-kpi strong {
    color: var(--slate-900);
    font-size: 15px;
    line-height: 1.25;
}

.mix-preview-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-bottom: 12px;
}

.mix-preview-grid-lists {
    margin-bottom: 0;
}

.mix-preview-section {
    padding: 14px;
    border-radius: 14px;
    background: var(--white);
    border: 1px solid var(--slate-100);
}

.mix-preview-section-title {
    margin-bottom: 10px;
    color: var(--slate-900);
    font-size: 13px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.mix-preview-constraints,
.mix-preview-variants {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mix-preview-constraint,
.mix-preview-variant {
    padding: 10px 12px;
    border-radius: 12px;
    background: var(--slate-50);
    border: 1px solid var(--slate-100);
}

.mix-preview-constraint-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 6px;
}

.mix-preview-chip {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mix-preview-chip-applied {
    background: #ecfdf5;
    color: #047857;
}

.mix-preview-chip-check {
    background: #fff7ed;
    color: #c2410c;
}

.mix-preview-chip-note {
    background: var(--slate-100);
    color: var(--slate-700);
}

.mix-preview-constraint-meta,
.mix-preview-variant-row {
    color: var(--slate-600);
    font-size: 12px;
    line-height: 1.5;
}

.mix-preview-variant-title {
    margin-bottom: 6px;
    color: var(--slate-900);
    font-size: 13px;
    font-weight: 700;
    text-transform: capitalize;
}

.mix-preview-variant-row-accent {
    margin-top: 4px;
    color: var(--primary-dark);
    font-weight: 700;
}

.mix-preview-list {
    margin: 0;
    padding-left: 18px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: var(--slate-600);
    font-size: 12px;
    line-height: 1.6;
}

.mix-preview-muted {
    color: var(--slate-500);
    font-size: 12px;
    line-height: 1.6;
}

.mix-preview-footnote {
    margin-top: 14px;
    padding: 12px 14px;
    border-radius: 12px;
    background: var(--slate-900);
    color: var(--slate-100);
    font-size: 12px;
    line-height: 1.6;
}

.mix-preview-footnote strong {
    color: var(--white);
}

.response-meta-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.response-meta-badge {
    display: inline-flex;
    align-items: center;
    min-height: 28px;
    padding: 0 10px;
    border-radius: 999px;
    background: var(--slate-100);
    color: var(--slate-700);
    font-size: 12px;
    font-weight: 600;
}

.response-meta-badge-web {
    background: #ecfeff;
    color: #0f766e;
}

.response-norms-note {
    font-size: 11px;
    line-height: 1.45;
    color: var(--slate-500);
    margin-top: 8px;
}

.response-disclaimer {
    font-size: 12px;
    line-height: 1.5;
    color: var(--slate-500);
    padding: 10px 12px;
    border-radius: 10px;
    background: var(--slate-50);
    border: 1px solid var(--slate-100);
}

.issue-feedback {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding: 10px 12px;
    border: 1px dashed #fecaca;
    border-radius: 10px;
    background: #fff7f7;
}

.issue-feedback-label {
    font-size: 12px;
    font-weight: 800;
    color: #991b1b;
}

.issue-feedback-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.issue-feedback-btn {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    background: var(--white);
    color: var(--slate-700);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.issue-feedback-btn:hover {
    border-color: #dc2626;
    color: #b91c1c;
    background: #fff1f2;
}

.issue-feedback-btn.selected {
    border-color: #b91c1c;
    background: #fef2f2;
    color: #b91c1c;
}

.issue-feedback-btn:disabled {
    opacity: 0.65;
    cursor: default;
}

.issue-feedback-thanks {
    font-size: 12px;
    color: var(--success);
    font-weight: 600;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* =============================================================================
   COLLAPSIBLE SOURCES
   ============================================================================= */

.sources-container {
    margin-top: 16px;
    border: 1px solid var(--slate-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}

.sources-toggle {
    width: 100%;
    padding: 10px 16px;
    background: var(--slate-50);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--slate-600);
    transition: background 0.15s var(--ease);
    text-align: left;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.sources-toggle:hover {
    background: var(--slate-100);
}

.sources-toggle.expanded {
    border-bottom: 1px solid var(--slate-200);
}

.toggle-icon {
    font-size: 10px;
    color: var(--slate-400);
    transition: transform 0.2s var(--ease);
    width: 14px;
}

.sources-toggle.expanded .toggle-icon {
    transform: rotate(90deg);
}

.sources-content {
    background: var(--white);
    max-height: 400px;
    overflow-y: auto;
}

.sources-content .source-item {
    padding: 12px 16px;
    border-bottom: 1px solid var(--slate-50);
    margin: 0;
    border-radius: 0;
    border: none;
    transition: background 0.15s var(--ease);
}

.sources-content .source-item:last-child {
    border-bottom: none;
}

.sources-content .source-item:hover {
    background: var(--slate-50);
    box-shadow: none;
}

.sources-content .source-item.is-citation-active {
    background: #eff6ff;
    box-shadow: inset 3px 0 0 var(--primary);
}

.source-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.source-header strong {
    flex: 1;
    min-width: 150px;
    color: var(--slate-800);
    font-size: 13px;
}

.source-page {
    font-size: 11px;
    color: var(--slate-500);
    background: var(--slate-100);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 500;
}

.source-score {
    font-size: 11px;
    color: var(--white);
    background: var(--slate-700);
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: 600;
}

.source-text {
    font-size: 12px;
    color: var(--slate-500);
    line-height: 1.6;
    margin: 0;
}

/* Scrollbar for sources */
.sources-content::-webkit-scrollbar {
    width: 5px;
}

.sources-content::-webkit-scrollbar-track {
    background: transparent;
}

.sources-content::-webkit-scrollbar-thumb {
    background: var(--slate-300);
    border-radius: 3px;
}

.sources-content::-webkit-scrollbar-thumb:hover {
    background: var(--slate-400);
}

/* =============================================================================
   CHAT HISTORY SIDEBAR
   ============================================================================= */

.chat-history-toggle {
    position: fixed;
    top: 80px;
    right: 20px;
    width: 44px;
    height: 44px;
    background: var(--slate-900);
    color: var(--white);
    border: none;
    border-radius: 10px;
    font-size: 20px;
    cursor: pointer;
    box-shadow: var(--shadow-lg);
    z-index: 999;
    transition: all 0.15s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
}

.chat-history-toggle:hover {
    background: var(--slate-700);
    transform: scale(1.05);
}

.mix-preview-toggle {
    position: fixed;
    top: 87px;
    right: 72px;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 9px;
    background: rgba(15, 23, 42, 0.82);
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 800;
    cursor: pointer;
    z-index: 1000;
    box-shadow: var(--shadow-sm);
    opacity: 0.78;
    transition: all 0.15s var(--ease);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    text-decoration: none;
}

.mix-preview-toggle:hover {
    opacity: 1;
    color: var(--white);
    border-color: rgba(96, 165, 250, 0.38);
    background: rgba(15, 23, 42, 0.96);
    transform: translateY(-1px);
}

.mix-preview-toggle[hidden] {
    display: none !important;
}

.chat-history-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 380px;
    height: 100vh;
    background: var(--white);
    box-shadow: -8px 0 30px rgba(0, 0, 0, 0.08);
    z-index: 1001;
    transition: right 0.25s var(--ease);
    display: flex;
    flex-direction: column;
}

.chat-history-sidebar.open {
    right: 0;
}

.chat-history-header {
    padding: 18px 20px;
    background: var(--slate-900);
    color: var(--white);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.chat-history-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.chat-history-close {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: var(--white);
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: background 0.15s var(--ease);
}

.chat-history-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.chat-history-actions {
    padding: 14px 16px;
    display: flex;
    gap: 8px;
    border-bottom: 1px solid var(--slate-100);
}

.chat-action-btn {
    flex: 1;
    padding: 9px;
    background: var(--slate-50);
    border: 1px solid var(--slate-200);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--slate-600);
    cursor: pointer;
    transition: all 0.15s var(--ease);
}

.chat-action-btn:hover {
    background: var(--slate-100);
}

.chat-action-btn.primary {
    background: var(--slate-900);
    border-color: var(--slate-900);
    color: var(--white);
}

.chat-action-btn.primary:hover {
    background: var(--slate-700);
}

.chat-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.chat-history-item {
    padding: 12px 14px;
    background: var(--white);
    border: 1px solid var(--slate-100);
    border-radius: var(--radius-md);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    position: relative;
}

.chat-history-item:hover {
    background: var(--slate-50);
    border-color: var(--slate-200);
}

.chat-item-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--slate-800);
    margin-bottom: 4px;
    padding-right: 28px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-item-meta {
    font-size: 11px;
    color: var(--slate-400);
    display: flex;
    gap: 10px;
}

.chat-item-delete {
    position: absolute;
    top: 10px;
    right: 10px;
    background: none;
    border: none;
    font-size: 14px;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.15s var(--ease);
    padding: 4px;
    border-radius: 4px;
}

.chat-history-item:hover .chat-item-delete {
    opacity: 0.5;
}

.chat-item-delete:hover {
    opacity: 1 !important;
}

.empty-history {
    text-align: center;
    color: var(--slate-400);
    padding: 40px 16px;
    font-size: 13px;
}

.chat-history-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s var(--ease);
}

.chat-history-overlay.active {
    opacity: 1;
    pointer-events: all;
}

/* =============================================================================
   PDF MODAL (inline compat — also in pdf-modal-styles.css)
   ============================================================================= */

.source-open-btn {
    padding: 4px 10px;
    background: var(--slate-800);
    color: var(--white);
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s var(--ease);
    margin-left: 6px;
}

.source-open-btn:hover {
    background: var(--slate-700);
}

.source-open-btn:active {
    transform: scale(0.96);
}

.pdf-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.15s var(--ease);
}

.pdf-modal.active {
    display: flex;
}

.pdf-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
}

.pdf-modal-content {
    position: relative;
    width: 90%;
    max-width: 1200px;
    height: 90vh;
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.2s var(--ease);
}

@keyframes slideUp {
    from { opacity: 0; transform: translateY(20px) scale(0.97); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.pdf-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    border-bottom: 1px solid var(--slate-200);
    background: var(--slate-900);
}

.pdf-modal-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--white);
    margin: 0;
    max-width: calc(100% - 56px);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.pdf-modal-close {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    color: var(--white);
    font-size: 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.15s var(--ease);
    flex-shrink: 0;
}

.pdf-modal-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pdf-modal-body {
    flex: 1;
    position: relative;
    background: var(--slate-100);
}

#pdf-iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */

@media (max-width: 980px) {
    .demo-section .container {
        max-width: 964px;
    }

    .demo-layout {
        grid-template-columns: minmax(0, 1fr);
        gap: 18px;
        justify-content: center;
        width: 100%;
        max-width: 100%;
    }

    .side-highlight-stack {
        position: static;
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .side-highlight-card {
        min-height: 0;
    }

    .search-first-layout .chat-container {
        order: 1;
    }

    .search-first-layout .side-highlight-stack-left {
        order: 2;
    }

    .search-first-layout .side-highlight-stack-right {
        order: 3;
    }
}

.source-ref-label {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 20px;
    border-radius: 999px;
    background: var(--slate-100);
    color: var(--slate-600);
    font-size: 11px;
    font-weight: 700;
}

.source-section {
    margin: 0 0 6px;
    color: var(--slate-600);
    font-size: 12px;
    font-weight: 600;
}

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

    .podcast-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    :root {
        --bubble-max-width: 88%;
    }

    .container {
        padding: 0 16px;
    }

    .hero {
        padding: 120px 0 60px;
    }

    .hero-search {
        padding: 78px 0 42px;
    }

    .hero-search-copy {
        max-width: none;
        margin-bottom: 14px;
        text-align: left;
    }

    .hero-search .demo-layout {
        width: calc(100vw - 32px);
        max-width: calc(100vw - 32px);
    }

    .hero-eyebrow {
        min-height: 24px;
        margin-bottom: 10px;
        padding: 4px 9px;
        font-size: 10px;
    }

    .hero-title {
        font-size: 32px;
    }

    .hero-search .hero-title {
        margin-bottom: 8px;
        font-size: 24px;
        line-height: 1.08;
        overflow-wrap: anywhere;
    }

    .hero-subtitle {
        font-size: 15px;
    }

    .hero-search .hero-subtitle {
        margin-bottom: 6px;
        font-size: 14px;
        line-height: 1.45;
        max-width: none;
    }

    .hero-search .demo-subtitle {
        margin-bottom: 16px;
        font-size: 13px;
        line-height: 1.45;
        text-align: left;
        max-width: none;
    }

    .hero-buttons {
        flex-direction: column;
        align-items: center;
    }

    .hero-search .hero-buttons {
        display: none;
    }

    .hero-platforms {
        justify-content: flex-start;
        gap: 8px;
        margin-top: 12px;
        font-size: 12px;
    }

    .hero-platform-link {
        min-height: 32px;
        padding: 7px 10px;
        font-size: 12px;
    }

    .demo-section {
        padding: 56px 0 72px;
    }

    .demo-layout {
        gap: 16px;
    }

    .side-highlight-stack {
        grid-template-columns: minmax(0, 1fr);
    }

    .side-highlight-card {
        padding: 16px;
    }

    .side-highlight-title {
        font-size: 18px;
    }

    .side-highlight-btn {
        width: 100%;
    }

    .section-title {
        font-size: 26px;
    }

    .mode-switcher {
        gap: 6px;
    }

    .mode-btn {
        min-width: auto;
        padding: 10px 14px;
    }

    .chat-container {
        border-radius: var(--radius-lg);
    }

    .hero-search .chat-container {
        width: 100%;
        max-width: 100%;
        border-radius: 20px;
        box-shadow:
            0 0 0 1px rgba(255, 255, 255, 0.06),
            0 24px 60px -30px rgba(0, 0, 0, 0.9);
    }

    .hero-search .chat-messages {
        height: auto;
        min-height: 320px;
    }

    .chat-messages {
        height: auto;
        min-height: 320px;
        padding: 16px;
    }

    .message {
        gap: 8px;
    }

    .message-avatar {
        width: 30px;
        height: 30px;
        font-size: 16px;
        border-radius: 8px;
    }

    .message-content {
        padding: 12px 14px;
        font-size: 15px;
    }

    .chat-input-wrapper {
        padding: 12px 16px 16px;
    }

    .chat-input-wrapper-top {
        padding: 16px 16px 18px;
    }

    .chat-input-heading {
        align-items: flex-start;
        flex-direction: column;
        gap: 4px;
        margin-bottom: 14px;
    }

    .chat-input-heading strong {
        font-size: 20px;
    }

    .chat-input-heading span {
        max-width: 280px;
        font-size: 13px;
        text-align: left;
    }

    .hero-search .chat-input-container {
        display: grid;
        grid-template-columns: minmax(0, 1fr) 68px;
        gap: 12px;
    }

    .hero-search .chat-input {
        min-height: 64px;
        padding: 16px;
        font-size: 16px;
        line-height: 1.4;
        border-radius: 14px;
    }

    .hero-search .send-btn {
        width: 64px;
        height: 64px;
        border-radius: 16px;
    }

    .hero-search .send-btn svg {
        width: 24px;
        height: 24px;
    }

    .hero-search .chat-input-wrapper-top .example-questions {
        margin-top: 14px;
    }

    .chat-access-strip {
        grid-template-columns: 1fr;
        padding: 12px 16px;
        align-items: flex-start;
    }

    .hero-search .chat-access-strip {
        display: grid;
    }

    .chat-access-strip > .chat-access-controls {
        flex-wrap: wrap;
        justify-content: flex-start;
    }

    .chat-header {
        padding: 14px 16px;
        flex-wrap: wrap;
    }

    .hero-search .chat-header {
        padding: 12px 16px;
        gap: 10px;
    }

    .hero-search .chat-header-btn {
        min-height: 34px;
        padding: 6px 9px;
        font-size: 12px;
    }

    .hero-search .status-text,
    .hero-search .chat-access-copy {
        font-size: 12px;
    }

    .hero-search .chat-header-promo {
        display: block;
    }

    .hero-search .chat-header-promo-label {
        display: none;
    }

    .hero-search .chat-header-promo .chat-access-controls {
        display: grid;
        grid-template-columns: minmax(0, 1fr);
        align-items: center;
        width: 100%;
    }

    .hero-search .chat-header-promo .promo-code-input {
        width: 100%;
        min-width: 0;
    }

    .hero-search .chat-header-promo .chat-header-btn {
        justify-content: center;
        width: 100%;
    }

    .hero-search .chat-header-promo .promo-clear-btn {
        display: none;
    }

    .chat-header-actions {
        width: 100%;
        justify-content: flex-start;
    }

    .chat-header-promo {
        width: 100%;
        margin-right: 0;
        padding-right: 0;
        border-right: 0;
        justify-content: space-between;
    }

    .chat-header-promo .chat-access-controls {
        width: 100%;
        flex-wrap: wrap;
    }

    .chat-header-promo .promo-code-input,
    .promo-code-input {
        min-width: 0;
        width: 100%;
    }

    .example-questions {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 4px;
        -webkit-overflow-scrolling: touch;
    }

    .example-question {
        flex-shrink: 0;
    }

    .features {
        padding: 64px 0;
    }

    .features-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .feature-card {
        padding: 24px 20px;
    }

    .how-it-works {
        padding: 64px 0;
    }

    .steps {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .step {
        max-width: none;
        padding: 24px 20px 28px;
    }

    .how-eyebrow {
        margin-bottom: 14px;
    }

    .how-lead {
        font-size: 15px;
        line-height: 1.65;
    }

    .step-title {
        font-size: 19px;
    }

    .how-note {
        padding: 18px;
    }

    .for-whom {
        padding: 56px 0;
    }

    .badges {
        gap: 10px;
    }

    .badge {
        padding: 12px 16px;
    }

    .cta {
        padding: 64px 0;
    }

    .cta-title {
        font-size: 26px;
    }

    .messenger-links {
        padding: 64px 0;
    }

    .messenger-grid {
        grid-template-columns: 1fr;
    }

    .podcasts-section {
        padding: 56px 0;
    }

    .podcasts-header {
        text-align: left;
    }

    .podcast-card {
        padding: 20px;
    }

    .podcast-title {
        font-size: 22px;
    }

    .tools-section {
        padding: 52px 0 56px;
    }

    .tools-section-header {
        margin-bottom: 18px;
        text-align: left;
    }

    .tools-section .section-title,
    .tools-section .demo-subtitle {
        text-align: left;
    }

    .mix-design-beta-card {
        grid-template-columns: 1fr;
    }

    .mix-design-beta-actions {
        justify-content: flex-start;
    }

    .mix-design-beta-actions .chat-header-btn {
        width: 100%;
        justify-content: center;
    }

    .images-grid {
        grid-template-columns: 1fr;
    }

    .chat-history-sidebar {
        width: 100%;
        right: -100%;
    }

    .chat-history-toggle {
        top: auto;
        bottom: 20px;
        right: 16px;
    }

    .mix-preview-toggle {
        top: auto;
        bottom: 27px;
        right: 68px;
    }

    .rating-container {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }

    .chat-access-controls,
    .rating-followup-actions {
        width: 100%;
    }

    .rating-buttons {
        width: 100%;
        justify-content: space-between;
    }

    .rating-btn {
        flex: 1;
        max-width: 48px;
    }

    .answer-actions,
    .copy-btn {
        margin-left: 0;
        width: 100%;
        justify-content: center;
    }

    .answer-action-btn {
        flex: 1 1 100%;
        justify-content: center;
    }

    .message-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 6px;
    }

    .mix-preview-head,
    .mix-preview-grid {
        grid-template-columns: 1fr;
        display: grid;
    }

    .mix-preview-head {
        gap: 12px;
    }

    .mix-preview-badges {
        justify-content: flex-start;
    }

    .mix-preview-kpis {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    /* PDF Modal */
    .pdf-modal-content {
        width: 95%;
        height: 95vh;
        border-radius: var(--radius-md);
    }

    .pdf-modal-header {
        padding: 14px 16px;
    }

    .pdf-modal-title {
        font-size: 14px;
    }

    .source-open-btn {
        padding: 3px 8px;
        font-size: 11px;
    }
}

@media (max-width: 480px) {
    .chat-messages {
        min-height: 300px;
    }

    .message-avatar {
        width: 28px;
        height: 28px;
        font-size: 14px;
        border-radius: 7px;
    }

    .mix-preview-card {
        padding: 14px;
    }

    .mix-preview-kpis {
        grid-template-columns: 1fr;
    }
}

/* =============================================================================
   UTILITIES
   ============================================================================= */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skeleton {
    background: linear-gradient(90deg, var(--slate-200) 25%, var(--slate-100) 50%, var(--slate-200) 75%);
    background-size: 1000px 100%;
    animation: shimmer 2s infinite;
    border-radius: var(--radius-sm);
}

@keyframes shimmer {
    0% { background-position: -1000px 0; }
    100% { background-position: 1000px 0; }
}

/* PDF Loading & Error states */
.pdf-loading {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--slate-100);
    z-index: 10;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--slate-200);
    border-top-color: var(--slate-600);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    margin-bottom: 14px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.pdf-loading p {
    font-size: 13px;
    color: var(--slate-500);
    margin: 0;
}

.pdf-error {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: var(--slate-100);
    padding: 32px;
    text-align: center;
}

.pdf-error p {
    font-size: 15px;
    color: var(--slate-700);
    margin: 6px 0;
}

.pdf-error-details {
    font-size: 13px !important;
    color: var(--slate-500) !important;
    font-family: var(--font-mono);
}

.pdf-error .btn-primary-small {
    margin-top: 14px;
}

.pdf-page-info {
    position: absolute;
    top: 56px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--slate-800);
    color: var(--white);
    padding: 10px 18px;
    border-radius: 8px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    text-align: center;
    animation: slideDown 0.2s var(--ease);
}

.pdf-page-info p {
    margin: 3px 0;
    color: var(--white) !important;
    font-size: 13px;
}

@keyframes slideDown {
    from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
    to { opacity: 1; transform: translateX(-50%) translateY(0); }
}

/* PDF Modal loading state placeholder */
.pdf-modal-body::after {
    content: "Загрузка документа...";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14px;
    color: var(--slate-400);
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s var(--ease);
}

.pdf-modal-body:not(:has(#pdf-iframe[src]))::after {
    opacity: 1;
}
