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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: linear-gradient(180deg, #0a1a1a 0%, #051010 100%);
    color: #ffffff;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    -webkit-font-smoothing: antialiased;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Header */
header {
    padding: 1.5rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

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

.logo {
    font-size: 1.5rem;
    font-weight: 700;
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.03em;
}

.user-section {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
}

.user-downloads {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
}

.logout-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.logout-btn:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Main Section */
main {
    flex: 1;
    display: flex;
    align-items: center;
    padding: 4rem 0;
}

/* Login State */
.login-state {
    max-width: 580px;
    margin: 0 auto;
    text-align: center;
}

.login-state h1 {
    font-size: 3.5rem;
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.04em;
    margin-bottom: 1.5rem;
    color: #ffffff;
}

.login-state p {
    font-size: 1.125rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2.5rem;
}

.cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 1rem 2rem;
    background: #00ff88;
    color: #0a0a0a;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.cta-button:hover {
    background: #00cc6a;
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0, 255, 136, 0.4);
}

.cta-button:active {
    transform: translateY(0);
}

.google-icon {
    width: 20px;
    height: 20px;
}

.features {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    margin-top: 4rem;
    padding-top: 4rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.feature {
    text-align: center;
}

.feature-icon {
    width: 48px;
    height: 48px;
    margin: 0 auto 1rem;
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #00ff88;
}

.feature h3 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #ffffff;
}

.feature p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

/* App State */
.app-state {
    display: none;
    width: 100%;
}

.app-state.active {
    display: block;
}

.hero {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    text-align: center;
}

.hero-title {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1rem;
    letter-spacing: -0.03em;
    color: #ffffff;
}

.hero-subtitle {
    font-size: 1.125rem;
    color: rgba(255, 255, 255, 0.7);
    margin-bottom: 2.5rem;
    line-height: 1.6;
}

.usage-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    margin-bottom: 2rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: #ffffff;
}

.usage-badge.warning {
    background: #fff4e6;
    border-color: #ffaa00;
    color: #cc8800;
}

.usage-badge.limit-reached {
    background: #ffe6e6;
    border-color: #ff4466;
    color: #cc2244;
}

/* Search Box */
.search-container {
    margin-bottom: 2rem;
}

.search-wrapper {
    position: relative;
    background: rgba(255, 255, 255, 0.05);
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    padding: 0.75rem;
    transition: all 0.2s ease;
}

.search-wrapper:focus-within {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 0 0 4px rgba(255, 255, 255, 0.05);
}

.search-input {
    width: 100%;
    background: none;
    border: none;
    outline: none;
    font-size: 1.25rem;
    font-weight: 500;
    color: #ffffff;
    padding: 0.75rem 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.search-input::placeholder {
    color: rgba(255, 255, 255, 0.4);
    text-transform: none;
    letter-spacing: 0;
    font-weight: 400;
}

.search-button {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: #00ff88;
    color: #0a0a0a;
    border: none;
    padding: 0.875rem 1.75rem;
    border-radius: 12px;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.search-button:hover {
    background: #00cc6a;
}

.search-button:disabled {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}

.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #0a0a0a;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: inline-block;
    margin-right: 0.5rem;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Examples */
.examples {
    display: flex;
    justify-content: center;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin-top: 1.5rem;
}

/* Ratios Section */
.ratios-section {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.ratios-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
    user-select: none;
}

.ratios-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.ratios-toggle svg {
    transition: transform 0.3s ease;
}

.ratios-toggle.expanded svg {
    transform: rotate(180deg);
}

.ratios-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.ratios-content.expanded {
    max-height: 300px;
}

.ratios-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
    padding: 1.5rem;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    margin-top: 1rem;
}

.ratio-checkbox {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    transition: all 0.2s ease;
}

.ratio-checkbox:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(0, 255, 136, 0.3);
}

.ratio-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #00ff88;
}

.ratio-checkbox label {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.9);
    cursor: pointer;
    flex: 1;
}

.ratios-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: 1rem;
}

.ratios-action-btn {
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.ratios-action-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

.examples {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.example-chip {
    font-size: 0.875rem;
    padding: 0.5rem 1rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 100px;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    transition: all 0.2s ease;
    font-weight: 500;
}

.example-chip:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: #ffffff;
}

/* Messages */
.message {
    max-width: 600px;
    margin: 2rem auto;
    padding: 1rem 1.5rem;
    border-radius: 12px;
    border: 1px solid;
    display: none;
    font-size: 0.9375rem;
}

.message.show {
    display: block;
}

.message.error {
    background: rgba(255, 68, 102, 0.1);
    border-color: #ff4466;
    color: #ff6688;
}

.message.warning {
    background: rgba(255, 170, 0, 0.1);
    border-color: #ffaa00;
    color: #ffcc44;
}

.message-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

/* Download Card */
.download-card {
    max-width: 600px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    display: none;
}

.download-card.show {
    display: block;
}

.download-header {
    display: flex;
    align-items: start;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.download-icon {
    width: 48px;
    height: 48px;
    background: #00ff88;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: #0a0a0a;
}

.download-info h3 {
    font-size: 1.125rem;
    font-weight: 600;
    margin-bottom: 0.25rem;
    color: #ffffff;
}

.download-info p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.download-button {
    width: 100%;
    padding: 1rem;
    background: #00ff88;
    color: #0a0a0a;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.download-button:hover {
    background: #00cc6a;
    transform: translateY(-1px);
}

.download-button-secondary {
    margin-top: 0.75rem;
    background: rgba(0, 255, 136, 0.15);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.3);
}

.download-button-secondary:hover {
    background: rgba(0, 255, 136, 0.25);
    border-color: rgba(0, 255, 136, 0.5);
}

/* Footer */
footer {
    padding: 2rem 0;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.875rem;
}

/* Mobile */
@media (max-width: 768px) {
    .login-state h1 {
        font-size: 2.5rem;
    }

    .features {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .search-button {
        position: static;
        width: 100%;
        margin-top: 0.75rem;
        transform: none !important;
    }

    .user-details {
        display: none;
    }
}

/* ===================================== */
/* Business Summary Section Styles      */
/* ===================================== */

.business-summary-section {
    margin-top: 1.5rem;
}

/* ===================================== */
/* Valuation Report Section Styles      */
/* ===================================== */

.valuation-report-section {
    margin-top: 1.5rem;
}

/* Valuation Toggle (like ratios) */
.valuation-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
    user-select: none;
}

.valuation-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.valuation-toggle svg {
    transition: transform 0.3s ease;
}

.valuation-toggle.expanded svg {
    transform: rotate(180deg);
}

.valuation-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.valuation-content.expanded {
    max-height: 300px;
}

/* Valuation checkbox container */
/* Valuation panel — matches AI Chat panel design */
.valuation-checkbox-container {
    background: linear-gradient(180deg, rgba(244, 201, 80, 0.04), rgba(244, 201, 80, 0.01));
    border: 1px solid rgba(244, 201, 80, 0.25);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
}

.valuation-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.valuation-checkbox-wrapper:hover {
    /* no background change — match chat panel which has no hover effect */
}

.valuation-checkbox-wrapper input[type="checkbox"] {
    margin-top: 0.25rem;
    accent-color: #f4c950;
    cursor: pointer;
    width: 1.1rem;
    height: 1.1rem;
}

.valuation-checkbox-label {
    flex: 1;
}

.valuation-checkbox-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f4c950;
    margin-bottom: 0.25rem;
}

.valuation-checkbox-description {
    font-size: 0.825rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
}

/* ===================================== */
/* Business Summary Section Styles      */
/* ===================================== */

/* Summary Toggle (like ratios) */
.summary-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    cursor: pointer;
    padding: 0.5rem;
    transition: color 0.2s ease;
    user-select: none;
}

.summary-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.summary-toggle svg {
    transition: transform 0.3s ease;
}

.summary-toggle.expanded svg {
    transform: rotate(180deg);
}

.summary-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.summary-content.expanded {
    max-height: 300px;
}

/* Summary panel (Pro tier) — matches AI Chat panel design */
.summary-checkbox-container {
    background: linear-gradient(180deg, rgba(244, 201, 80, 0.04), rgba(244, 201, 80, 0.01));
    border: 1px solid rgba(244, 201, 80, 0.25);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
}

.summary-checkbox-wrapper {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    cursor: pointer;
}

.summary-checkbox-wrapper:hover {
    /* no background change — match chat panel which has no hover effect */
}

.summary-checkbox-wrapper input[type="checkbox"] {
    margin-top: 0.25rem;
    accent-color: #f4c950;
    cursor: pointer;
    width: 1.1rem;
    height: 1.1rem;
}

.summary-checkbox-label {
    flex: 1;
}

.summary-checkbox-title {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #f4c950;
    margin-bottom: 0.25rem;
}

.summary-checkbox-description {
    font-size: 0.825rem;
    color: rgba(255, 255, 255, 0.65);
    line-height: 1.5;
}

/* Locked Dialog (Free Tier) */
.summary-locked-dialog {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 12px;
    padding: 1.25rem;
}

.summary-locked-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1.25rem;
}

.summary-locked-title {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
}

.upgrade-btn {
    background: linear-gradient(135deg, #00ff88 0%, #00cc6a 100%);
    color: #0a1a1a;
    border: none;
    border-radius: 8px;
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.upgrade-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 255, 136, 0.3);
}

.locked-features-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.locked-feature-item {
    display: flex;
    gap: 0.75rem;
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 8px;
}

.locked-feature-icon {
    font-size: 1.25rem;
    opacity: 0.5;
    flex-shrink: 0;
}

.locked-feature-content {
    flex: 1;
}

.locked-feature-name {
    font-size: 0.9375rem;
    font-weight: 500;
    color: #00ff88;
    margin-bottom: 0.25rem;
}

.locked-feature-description {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.4;
}

.locked-features-note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1rem;
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Summary Loading State */
.summary-loading {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(0, 255, 136, 0.2);
    border-radius: 12px;
    padding: 1.5rem;
    text-align: center;
}

.summary-loading-progress {
    position: relative;
    width: 120px;
    height: 120px;
    margin: 0 auto 1.5rem;
}

.progress-ring {
    transform: rotate(-90deg);
}

.progress-ring-circle {
    transition: stroke-dashoffset 0.3s ease;
}

.progress-ring-bg {
    stroke: rgba(0, 255, 136, 0.1);
}

.progress-ring-progress {
    stroke: #00ff88;
    stroke-linecap: round;
}

.progress-time {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    font-weight: 700;
    color: #ffffff;
}

.summary-loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(0, 255, 136, 0.2);
    border-top-color: #00ff88;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 1rem;
}

.summary-loading-text {
    font-size: 1rem;
    font-weight: 600;
    color: #ffffff;
    margin-bottom: 0.5rem;
}

.summary-loading-time {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.6);
}

.summary-loading-note {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .summary-locked-header {
        flex-direction: column;
    }

    .upgrade-btn {
        width: 100%;
        justify-content: center;
    }
}

/* ==========================================================================
   AI CHAT (PRO) — added 2026-05-04
   This section adds the "Enable AI Chat" dropdown for Pro users and the
   in-place lifecycle UI (pre-generate checkbox → indexing → ready).
   The locked state for free users is added to the existing
   .summary-locked-dialog as a third feature.
   ========================================================================== */

/* The chat section sits below the business summary section and uses the
   same toggle/content pattern as the existing optionals.  The accent color
   is a warm gold to distinguish AI-chat from the green Excel flow. */
.ai-chat-section {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.ai-chat-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    cursor: pointer;
    padding: 0.5rem;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
    user-select: none;
}

.ai-chat-toggle:hover {
    color: rgba(255, 255, 255, 0.9);
}

.ai-chat-toggle svg {
    transition: transform 0.2s;
}

.ai-chat-toggle.expanded svg {
    transform: rotate(180deg);
}

.ai-chat-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.ai-chat-content.expanded {
    max-height: 600px;
}

/* Pro-only chat panel.  Uses the same surface treatment as
   .summary-checkbox-container but with a gold-tinted border. */
.ai-chat-panel {
    background: linear-gradient(180deg, rgba(244, 201, 80, 0.04), rgba(244, 201, 80, 0.01));
    border: 1px solid rgba(244, 201, 80, 0.25);
    border-radius: 0.75rem;
    padding: 1rem 1.25rem;
    margin-top: 0.5rem;
}

/* The panel renders one of two phases controlled by the data-phase
   attribute on .ai-chat-panel.  Indexing happens offline now, so chat
   is binary: either "ready" (the user can click Open chat) or
   "unavailable" (this ticker hasn't been indexed yet). */
.ai-chat-phase-ready,
.ai-chat-phase-unavailable {
    display: none;
}

.ai-chat-panel[data-phase="ready"]       .ai-chat-phase-ready       { display: flex; }
.ai-chat-panel[data-phase="unavailable"] .ai-chat-phase-unavailable { display: flex; }

/* Both phases share the same horizontal layout — icon on the left,
   text in the middle, optional action on the right. */
.ai-chat-phase-ready,
.ai-chat-phase-unavailable {
    align-items: center;
    gap: 0.875rem;
}

.ai-chat-ready-icon {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(244, 201, 80, 0.08);
    border: 1px solid rgba(244, 201, 80, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #f4c950;
    font-size: 1rem;
    flex-shrink: 0;
}

.ai-chat-ready-text {
    flex: 1;
}

.ai-chat-ready-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #f4c950;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.ai-chat-ready-pill {
    font-size: 0.65rem;
    font-weight: 600;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    background: rgba(0, 255, 136, 0.08);
    color: #00ff88;
    border: 1px solid rgba(0, 255, 136, 0.25);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.ai-chat-ready-desc {
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.65);
    margin-top: 0.15rem;
}

.ai-chat-open-btn {
    background: linear-gradient(135deg, #f4c950 0%, #d9a83a 100%);
    color: #1a1408;
    border: none;
    padding: 0.625rem 1.25rem;
    border-radius: 0.5rem;
    font-size: 0.825rem;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease;
}

.ai-chat-open-btn:hover {
    transform: translateY(-1px);
}

/* ==========================================================================
   AI CHAT MODAL (PRO) — added 2026-05-04
   Modal overlay opened by clicking "Open chat" on the chat panel.
   Stays hidden until .active is applied to .ai-chat-modal.
   ========================================================================== */

.ai-chat-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: none;
    align-items: center;
    justify-content: center;
}
.ai-chat-modal.active {
    display: flex;
}

.ai-chat-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.ai-chat-modal-window {
    position: relative;
    background: #0d1f17;
    border: 1px solid rgba(244, 201, 80, 0.25);
    border-radius: 1rem;
    width: min(720px, 92vw);
    height: min(720px, 88vh);
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.ai-chat-modal-header {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    background: linear-gradient(180deg, rgba(244, 201, 80, 0.06), rgba(244, 201, 80, 0));
}
.ai-chat-modal-title-block { flex: 1; }
.ai-chat-modal-title {
    font-size: 1.05rem;
    font-weight: 600;
    color: #f4c950;
    margin-bottom: 0.2rem;
}
.ai-chat-modal-subtitle {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.45);
}
.ai-chat-modal-close {
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.7);
    width: 32px;
    height: 32px;
    border-radius: 8px;
    font-size: 1.4rem;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.ai-chat-modal-close:hover {
    color: white;
    border-color: rgba(255, 255, 255, 0.25);
}

.ai-chat-modal-messages {
    flex: 1;
    overflow-y: auto;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.ai-chat-empty-state {
    margin: auto;
    text-align: center;
    color: rgba(255, 255, 255, 0.55);
    max-width: 420px;
}
.ai-chat-empty-icon {
    font-size: 1.8rem;
    color: #f4c950;
    margin-bottom: 0.75rem;
}
.ai-chat-empty-title {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.75);
    margin-bottom: 1rem;
}
.ai-chat-empty-suggestions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
}
.ai-chat-suggestion {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: rgba(255, 255, 255, 0.75);
    padding: 0.5rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    cursor: pointer;
    transition: all 0.15s;
}
.ai-chat-suggestion:hover {
    background: rgba(244, 201, 80, 0.08);
    border-color: rgba(244, 201, 80, 0.25);
    color: #f4c950;
}

/* Message bubbles */
.ai-chat-msg {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    max-width: 92%;
}
.ai-chat-msg.user { align-self: flex-end; align-items: flex-end; }
.ai-chat-msg.assistant { align-self: flex-start; }

.ai-chat-msg-bubble {
    padding: 0.75rem 1rem;
    border-radius: 0.85rem;
    font-size: 0.9rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-wrap: break-word;
}
.ai-chat-msg.user .ai-chat-msg-bubble {
    background: rgba(244, 201, 80, 0.12);
    border: 1px solid rgba(244, 201, 80, 0.2);
    color: rgba(255, 255, 255, 0.95);
    border-bottom-right-radius: 0.25rem;
}
.ai-chat-msg.assistant .ai-chat-msg-bubble {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: rgba(255, 255, 255, 0.92);
    border-bottom-left-radius: 0.25rem;
}

/* Citations under assistant messages */
.ai-chat-citations {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.1rem;
}
.ai-chat-citation {
    font-size: 0.7rem;
    background: rgba(244, 201, 80, 0.06);
    border: 1px solid rgba(244, 201, 80, 0.18);
    color: #f4c950;
    padding: 0.2rem 0.55rem;
    border-radius: 999px;
    cursor: help;
}

/* Typing indicator */
.ai-chat-msg.typing .ai-chat-msg-bubble {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.55);
    font-style: italic;
}
.ai-chat-msg.typing .dots::after {
    content: '';
    animation: ai-chat-dots 1.4s steps(4, end) infinite;
}
@keyframes ai-chat-dots {
    0%, 20% { content: ''; }
    40% { content: '.'; }
    60% { content: '..'; }
    80%, 100% { content: '...'; }
}

/* Input row */
.ai-chat-modal-input-row {
    display: flex;
    align-items: flex-end;
    gap: 0.5rem;
    padding: 0.85rem 1rem 1rem;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.ai-chat-input {
    flex: 1;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: white;
    padding: 0.75rem 1rem;
    font-size: 0.9rem;
    font-family: inherit;
    line-height: 1.4;
    resize: none;
    max-height: 140px;
    outline: none;
    transition: border-color 0.15s;
}
.ai-chat-input:focus {
    border-color: rgba(244, 201, 80, 0.4);
}
.ai-chat-input::placeholder { color: rgba(255, 255, 255, 0.35); }

.ai-chat-send-btn {
    background: linear-gradient(135deg, #f4c950 0%, #d9a83a 100%);
    color: #1a1408;
    border: none;
    width: 38px;
    height: 38px;
    border-radius: 9px;
    font-size: 1.2rem;
    font-weight: 700;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.1s;
}
.ai-chat-send-btn:hover:not(:disabled) { transform: translateY(-1px); }
.ai-chat-send-btn:disabled {
    background: rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.3);
    cursor: not-allowed;
}
