* {
    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;
}
/* ==========================================================================
   SHARED HEADER  —  nav links used by layout/header.html
   --------------------------------------------------------------------------
   The existing `header`, `.header-content`, `.logo`, `.user-section`,
   `.user-info`, `.logout-btn` rules above are reused as-is. These rules
   only ADD the nav-link styling that was previously inline in index.html.
   Append this whole file to the end of static/css/index.css.
   ========================================================================== */

/* .logo is now an <a> — keep the gradient text, drop link underline. */
.logo {
    text-decoration: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 24px;
}

.site-nav-link {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.2s;
}

.site-nav-link:hover {
    color: #00ff88;
}

.site-nav-link.is-active {
    color: #00ff88;
    font-weight: 600;
}


/* ==========================================================================
   DISCOVER  —  categories dashboard
   Namespaced `disc-*` so nothing collides with existing rules.
   ========================================================================== */

/* --- Layout overrides, scoped to the Discover page only ------------------
   `main` above sets `flex:1; display:flex; align-items:center` for the
   homepage hero, which vertically-centres everything — wrong for a
   dashboard. These two rules pin Discover's content to the TOP and use a
   tighter width so the cards aren't stretched. The homepage is unaffected. */
.disc-main {
    align-items: flex-start;   /* top, not vertical-centre */
    padding: 0;                /* `main` gave 4rem top/bottom */
}

.disc-container {
    max-width: 1400px;         /* widened from 960 so the Discover index
                                  grid can flow to 3 columns on wide
                                  displays (the auto-fill grid below
                                  handles the column count) and so the
                                  data tables on category pages get
                                  more breathing room. Text blocks
                                  inside (disc-cat-desc) cap their own
                                  width so reading-line-length stays
                                  comfortable. */
}

.disc-hero {
    padding: 56px 0 28px;
}

.disc-title {
    font-size: 2rem;
    font-weight: 600;
    color: #f4f6f5;
    margin: 0;
    letter-spacing: -0.01em;
}

.disc-subtitle {
    font-size: 0.9375rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 8px 0 0;
}

.disc-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
    padding-bottom: 64px;
}

.disc-card {
    display: block;
    text-decoration: none;
    background: #131a17;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 22px;
    transition: border-color 0.15s ease, background 0.15s ease, transform 0.15s ease;
}

.disc-card:hover {
    border-color: rgba(0, 255, 136, 0.45);
    background: #161e1a;
    transform: translateY(-2px);
}

.disc-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 11px;
    background: rgba(0, 255, 136, 0.12);
    color: #00ff88;
    display: flex;
    align-items: center;
    justify-content: center;
}

.disc-card-name {
    font-size: 1rem;
    font-weight: 600;
    color: #f4f6f5;
    margin-top: 15px;
}

.disc-card-desc {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 7px;
}

.disc-card-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
    margin-top: 16px;
    padding-top: 13px;
}

.disc-card-count {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
}

.disc-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8125rem;
    font-weight: 600;
    color: #00ff88;
}

.disc-footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 22px 0;
    text-align: center;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.35);
}

/* ==========================================================================
   DISCOVER  —  category detail page (Serial S&P 500 beaters)
   ========================================================================== */

.disc-back {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    margin-top: 28px;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.15s;
}

.disc-back:hover {
    color: #00ff88;
}

.disc-cat-head {
    padding: 14px 0 4px;
}

.disc-cat-desc {
    font-size: 0.8125rem;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 8px;
    max-width: 720px;
}

.disc-cat-meta {
    margin-top: 9px;
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.4);
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.disc-meta-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    color: rgba(255, 255, 255, 0.5);
    text-decoration: none;
    transition: color 0.15s;
}

.disc-meta-link:hover {
    color: #00ff88;
}

/* --- Filter summary line (Massive multibaggers) ---
   A short prose line that restates the active filter — e.g.
   "Showing stocks that returned 10x or more over the last 10 years".
   The two pill values are wrapped in .disc-filter-hl so the active
   choices read brighter than the rest of the sentence. */
.disc-filter-line {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.5);
    margin: 14px 0 22px;
}

.disc-filter-hl {
    color: #00ff88;
    font-weight: 500;
}

/* --- Sector dropdown (Revenue Rocketships) ---
   Styled to sit next to the pill rows without looking out of place.
   Matches the pill height, dark bg, and ring-on-focus pattern. */
.disc-select {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.12);
    color: rgba(255, 255, 255, 0.85);
    font-family: inherit;
    font-size: 0.8125rem;
    padding: 6px 30px 6px 12px;
    border-radius: 999px;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    /* SVG chevron, sized to match the pills' visual weight */
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='rgba(255,255,255,0.5)' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'></polyline></svg>");
    background-repeat: no-repeat;
    background-position: right 10px center;
    transition: border-color 0.15s, color 0.15s;
}
.disc-select:hover {
    border-color: rgba(255, 255, 255, 0.25);
    color: #ffffff;
}
.disc-select:focus {
    outline: none;
    border-color: #00ff88;
    color: #ffffff;
}
.disc-select option {
    /* Browser-native option styling — best we can do without a
       full custom-dropdown component. */
    background: #0a1410;
    color: #ffffff;
}

/* --- Profitable badge (Revenue Rocketships) ---
   Small green check inline next to the sector tag. Indicates the
   company was profitable in at least 3 of the last 5 reported years. */
.disc-co-prof {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #00ff88;
    margin-left: 4px;
    line-height: 0;
}

/* --- Profitable-only toggle (Revenue Rocketships) ---
   A checkbox that doubles as the inline legend for the row badge.
   Shows the same green check, with text "Profitable only". Off by
   default. Pill-shaped to match the other controls. */
.disc-toggle {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
    padding: 6px 14px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(255, 255, 255, 0.03);
    transition: border-color 0.15s, background 0.15s;
}
.disc-toggle:hover {
    border-color: rgba(255, 255, 255, 0.25);
}
.disc-toggle input[type="checkbox"] {
    /* Hidden — we render our own track via .disc-toggle-track. The
       native input still drives state, focus, and accessibility. */
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.disc-toggle-track {
    position: relative;
    display: inline-block;
    width: 26px;
    height: 14px;
    background: rgba(255, 255, 255, 0.15);
    border-radius: 999px;
    transition: background 0.15s;
    flex-shrink: 0;
}
.disc-toggle-track::after {
    content: "";
    position: absolute;
    top: 2px;
    left: 2px;
    width: 10px;
    height: 10px;
    background: #ffffff;
    border-radius: 50%;
    transition: transform 0.15s;
}
.disc-toggle input:checked + .disc-toggle-track {
    background: #00ff88;
}
.disc-toggle input:checked + .disc-toggle-track::after {
    transform: translateX(12px);
}
.disc-toggle-text {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.85);
}
.disc-toggle-icon {
    color: #00ff88;
    flex-shrink: 0;
}
.disc-toggle input:focus-visible + .disc-toggle-track {
    box-shadow: 0 0 0 2px rgba(0, 255, 136, 0.5);
}

/* --- Sort / Show pill controls --- */
.disc-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.disc-control-group {
    display: flex;
    align-items: center;
    gap: 9px;
}

.disc-control-label {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.4);
}

.disc-pills {
    display: flex;
    gap: 6px;
}

.disc-pill {
    font-size: 0.72rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.55);
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 999px;
    padding: 5px 12px;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s, background 0.15s;
}

.disc-pill:hover {
    color: rgba(255, 255, 255, 0.85);
}

.disc-pill.is-on {
    color: #00ff88;
    border-color: rgba(0, 255, 136, 0.4);
    background: rgba(0, 255, 136, 0.1);
}

/* --- Summary stat cards --- */
.disc-stats {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin-top: 18px;
}

.disc-stat {
    background: #131a17;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 8px;
    padding: 12px 14px;
}

.disc-stat-label {
    font-size: 0.6875rem;
    color: rgba(255, 255, 255, 0.4);
}

.disc-stat-value {
    font-size: 1.125rem;
    font-weight: 600;
    color: #f4f6f5;
    margin-top: 3px;
}

.disc-stat-green   { color: #00ff88; }
.disc-stat-red     { color: #ff5a5a; }
.disc-stat-neutral { color: rgba(255, 255, 255, 0.8); }

/* --- Leaderboard table --- */
.disc-table {
    margin-top: 20px;
    padding-bottom: 64px;
}

.disc-row {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 13px 2px;
}

.disc-row-head {
    padding: 0 2px 8px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.disc-row-head .disc-col-rank,
.disc-row-head .disc-col-co,
.disc-row-head .disc-col-num,
.disc-row-head .disc-col-pe,
.disc-row-head .disc-col-act {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: rgba(255, 255, 255, 0.35);
}

.disc-row-head,
.disc-row-main {
    display: flex;
    align-items: center;
    gap: 12px;
}

.disc-col-rank {
    width: 24px;
    text-align: center;
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.4);
    flex-shrink: 0;
}

.disc-col-co {
    flex: 1;
    min-width: 0;
}

.disc-col-num {
    width: 84px;
    text-align: right;
    flex-shrink: 0;
}

/* P/E column — Magnificent 7 page only. Narrower than .disc-col-num. */
.disc-col-pe {
    width: 60px;
    text-align: right;
    flex-shrink: 0;
}

.disc-col-act {
    width: 96px;
    text-align: right;
    flex-shrink: 0;
}

.disc-co-top {
    display: flex;
    align-items: center;
    gap: 8px;
}

.disc-co-ticker {
    font-size: 0.85rem;
    font-weight: 600;
    color: #f4f6f5;
}

.disc-co-sector {
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.55);
    background: rgba(255, 255, 255, 0.05);
    border-radius: 100px;
    padding: 2px 8px;
}

.disc-co-sub {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.5);
    margin-top: 2px;
}

.disc-num-big {
    font-size: 0.85rem;
    font-weight: 600;
}

.disc-num-green   { color: #00ff88; }
.disc-num-red     { color: #ff5a5a; }
.disc-num-neutral { color: rgba(255, 255, 255, 0.8); }

.disc-num-sub {
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.4);
    margin-top: 1px;
}

/* --- Export button --- */
.disc-export {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 0.72rem;
    font-weight: 500;
    color: #00ff88;
    background: transparent;
    border: 1px solid rgba(0, 255, 136, 0.35);
    border-radius: 6px;
    padding: 5px 9px;
    cursor: pointer;
    transition: background 0.15s;
}

.disc-export:hover {
    background: rgba(0, 255, 136, 0.13);
}

/* --- Year-by-year bars --- */
.disc-years {
    display: flex;
    gap: 8px;
    margin-top: 11px;
    padding-left: 36px;
}

.disc-year {
    flex: 1;
    min-width: 0;
}

.disc-year-top {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.disc-year-label {
    font-size: 0.625rem;
    color: rgba(255, 255, 255, 0.4);
}

.disc-year-val {
    font-size: 0.66rem;
    font-weight: 600;
    color: #00ff88;
}

.disc-year-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.07);
    border-radius: 2px;
    margin-top: 3px;
}

.disc-year-fill {
    height: 4px;
    background: #00ff88;
    border-radius: 2px;
}

/* --- Footnote (e.g. survivorship-bias caveat) --- */
.disc-note {
    margin-top: 14px;
    padding-bottom: 48px;
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.35);
    line-height: 1.5;
}

/* --- Loading state (Magnificent 7 async fetch) --- */
.disc-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 56px 24px 64px;
}

.disc-spinner {
    width: 28px;
    height: 28px;
    border: 2.5px solid rgba(255, 255, 255, 0.12);
    border-top-color: #00ff88;
    border-radius: 50%;
    animation: disc-spin 0.7s linear infinite;
}

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

.disc-loading-text {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.45);
}

/* --- Empty state --- */
.disc-empty {
    text-align: center;
    padding: 72px 24px;
    color: rgba(255, 255, 255, 0.5);
}

.disc-empty-sub {
    font-size: 0.8125rem;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 6px;
}

/* --- Mobile --- */
@media (max-width: 640px) {
    .site-nav {
        gap: 16px;
    }
    .disc-grid {
        grid-template-columns: 1fr;
    }
    .disc-hero {
        padding: 36px 0 20px;
    }
    .disc-title {
        font-size: 1.625rem;
    }
    .disc-stats {
        grid-template-columns: 1fr;
    }

    /* --- Stacked row layout for category leaderboards on mobile --------
       On desktop each row is a flex row of fixed-width columns. On a
       phone (~360px) those columns can't fit alongside the company name,
       so labels and values overlap. Below we:
         - hide the column header row (labels move inline instead);
         - lay out each row as a 2-column grid: rank on the left, the
           company on the right, then each metric on its own full-width
           sub-row beneath, with the column name shown inline via
           attr(data-label) (e.g. "Market cap     $5.34T");
         - put the Export button on its own full-width row at the bottom.
       Templates add data-label="..." on each metric cell so the inline
       label is derived purely in CSS — no per-page rules needed. */

    .disc-row-head {
        display: none;
    }

    .disc-row {
        padding: 16px 4px;
    }

    .disc-row-main {
        display: grid;
        grid-template-columns: auto 1fr;
        column-gap: 12px;
        row-gap: 0;
        align-items: start;
    }

    .disc-col-rank {
        grid-column: 1;
        grid-row: 1;
        width: auto;
        text-align: left;
    }

    .disc-col-co {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
    }

    .disc-col-num,
    .disc-col-pe {
        grid-column: 1 / -1;
        width: auto;
        text-align: right;
        display: flex;
        align-items: baseline;
        justify-content: space-between;
        padding: 8px 0 0;
    }

    /* Inline metric label, read from the cell's data-label attribute. */
    .disc-col-num::before,
    .disc-col-pe::before {
        content: attr(data-label);
        font-size: 0.78rem;
        font-weight: 400;
        color: rgba(255, 255, 255, 0.5);
        letter-spacing: 0;
        text-transform: none;
    }

    /* Numbers sit larger on the right; their sub-labels (e.g. "per year")
       are redundant once the column name is inline, so hide them. */
    .disc-num-big {
        font-size: 0.95rem;
    }
    .disc-num-sub {
        display: none;
    }

    /* Export gets its own full-width row at the bottom of the card. */
    .disc-col-act {
        grid-column: 1 / -1;
        width: auto;
        text-align: left;
        padding-top: 12px;
    }
    .disc-export {
        width: 100%;
        justify-content: center;
        padding: 8px 12px;
    }

    /* Year-by-year strip (beaters page) — already wraps; just align. */
    .disc-years {
        padding-left: 0;
        flex-wrap: wrap;
        margin-top: 14px;
    }
    .disc-year {
        flex-basis: calc(33% - 8px);
    }
}

