/* Earnings calendar page styles.
   Moved out of templates/earnings.html so the browser can cache them
   (served as /static/css/earnings.css?v=<file mtime>). */

.earnings-page {
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 24px;
}

.earnings-hero {
    text-align: center;
    padding: 72px 24px 64px;
    background: radial-gradient(ellipse at 50% 0%, rgba(34, 197, 94, 0.12) 0%, transparent 50%), radial-gradient(ellipse at 80% 80%, rgba(59, 130, 246, 0.08) 0%, transparent 50%);
    border-radius: var(--radius-2xl);
    margin-bottom: 40px;
    border: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}

.earnings-hero::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), var(--blue), transparent);
}

.earnings-hero::after {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%2322c55e' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    opacity: 0.5;
    pointer-events: none;
}

.live-status-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    margin-bottom: 28px;
    flex-wrap: wrap;
    position: relative;
    z-index: 1;
}

.live-pulse {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    padding: 6px 18px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.5px;
    animation: glow 2s ease-in-out infinite;
}

.live-pulse.connected {
    border-color: rgba(34, 197, 94, 0.5);
    background: rgba(34, 197, 94, 0.15);
}

@keyframes glow {
    0%, 100% { box-shadow: 0 0 5px rgba(34, 197, 94, 0.2); }
    50% { box-shadow: 0 0 20px rgba(34, 197, 94, 0.35); }
}

.live-pulse .dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

.refresh-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
}

.refresh-divider {
    color: var(--border);
}

.countdown {
    color: var(--blue);
    font-weight: 700;
    font-family: 'SF Mono', 'Monaco', monospace;
    min-width: 30px;
    display: inline-block;
}

.flash-new {
    animation: flashHighlight 1s ease-in-out 3;
}

@keyframes flashHighlight {
    0%, 100% { background: transparent; }
    50% { background: rgba(34, 197, 94, 0.15); }
}

.earnings-toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--card);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #22c55e;
    padding: 16px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 600;
    z-index: 10000;
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: var(--shadow-xl);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transform: translateY(100px);
    opacity: 0;
    transition: all 0.3s ease;
}

.earnings-toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast-dot {
    width: 8px;
    height: 8px;
    background: #22c55e;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

.earnings-hero h1 {
    font-size: clamp(36px, 5.4vw, 60px);
    font-weight: 800;
    margin-bottom: 18px;
    color: #fff;
    position: relative;
    z-index: 1;
    letter-spacing: -0.03em;
    line-height: 1.05;
}

.earnings-hero h1 .hl {
    background: linear-gradient(135deg, #22c55e 0%, #4ade80 50%, #60a5fa 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.earnings-hero p {
    color: var(--text-muted);
    font-size: 17px;
    max-width: 640px;
    margin: 0 auto 22px;
    position: relative;
    z-index: 1;
    line-height: 1.6;
}

.hero-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1.6px;
    text-transform: uppercase;
    color: #4ade80;
    background: rgba(34, 197, 94, 0.10);
    border: 1px solid rgba(34, 197, 94, 0.28);
    padding: 6px 14px;
    border-radius: 999px;
    margin-bottom: 22px;
    position: relative;
    z-index: 1;
}

.eyebrow-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
    animation: pulse 1.5s infinite;
}

.hero-trust {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: var(--text-muted);
    position: relative;
    z-index: 1;
}

.hero-trust-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hero-trust-item strong {
    color: #4ade80;
    font-weight: 700;
}

.hero-trust-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #22c55e;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 40px;
}

.stat-card {
    background: linear-gradient(180deg, rgba(13, 24, 41, 0.85), rgba(13, 24, 41, 0.55));
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 26px 22px;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.stat-card .stat-icon {
    margin: 0;
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(148, 163, 184, 0.2);
}

.stat-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.stat-card.total::before { background: linear-gradient(90deg, #3b82f6, #60a5fa); }
.stat-card.beat::before { background: linear-gradient(90deg, #22c55e, #4ade80); }
.stat-card.miss::before { background: linear-gradient(90deg, #ef4444, #f87171); }
.stat-card.pending::before { background: linear-gradient(90deg, #f59e0b, #fbbf24); }

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.stat-card.total .stat-icon { background: rgba(59, 130, 246, 0.12); }
.stat-card.beat .stat-icon { background: rgba(34, 197, 94, 0.12); }
.stat-card.miss .stat-icon { background: rgba(239, 68, 68, 0.12); }
.stat-card.pending .stat-icon { background: rgba(245, 158, 11, 0.12); }

.stat-icon svg {
    width: 24px;
    height: 24px;
}

.stat-card.total .stat-icon svg { stroke: #3b82f6; }
.stat-card.beat .stat-icon svg { stroke: #22c55e; }
.stat-card.miss .stat-icon svg { stroke: #ef4444; }
.stat-card.pending .stat-icon svg { stroke: #f59e0b; }

.stat-value {
    font-size: 44px;
    font-weight: 800;
    line-height: 1;
    margin-bottom: 6px;
    letter-spacing: -0.03em;
}

.stat-card.total .stat-value { color: #3b82f6; }
.stat-card.beat .stat-value { color: #22c55e; }
.stat-card.miss .stat-value { color: #ef4444; }
.stat-card.pending .stat-value { color: #f59e0b; }

.stat-label {
    font-size: 13px;
    color: var(--text-muted);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.tabs-container {
    display: flex;
    gap: 4px;
    background: rgba(13, 24, 41, 0.7);
    padding: 6px;
    border-radius: 14px;
    border: 1px solid var(--border);
    backdrop-filter: blur(10px);
}

.tab-btn {
    padding: 10px 20px;
    border: none;
    background: transparent;
    color: var(--text-muted);
    border-radius: 10px;
    cursor: pointer;
    font-size: 13.5px;
    font-weight: 600;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: inherit;
    text-decoration: none;
}

.tab-btn:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.tab-btn.active {
    background: var(--accent-gradient);
    color: #022c22;
    box-shadow: 0 2px 8px rgba(34, 197, 94, 0.25);
}

.tab-count {
    background: rgba(255, 255, 255, 0.15);
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 12px;
}

.tab-btn.active .tab-count {
    background: rgba(0, 0, 0, 0.15);
}

.search-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 10px 16px;
    transition: all 0.2s;
}

.search-box:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.08);
}

.search-box input {
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 14px;
    outline: none;
    width: 200px;
    font-family: inherit;
}

.search-box input::placeholder {
    color: var(--text-dim);
}

.search-box svg {
    width: 18px;
    height: 18px;
    stroke: var(--text-muted);
}

.earnings-table-container {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-md);
}

.earnings-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
}

.earnings-table th {
    background: rgba(15, 23, 42, 0.7);
    padding: 14px 20px;
    text-align: left;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-dim);
    font-weight: 700;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
}

.earnings-table td {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border-light);
    font-size: 14px;
    transition: background 0.15s;
    color: var(--text-secondary);
}

.earnings-table tr:last-child td {
    border-bottom: none;
}

.earnings-table tbody tr {
    cursor: pointer;
    transition: all 0.15s;
}

.earnings-table tbody tr:hover {
    background: rgba(34, 197, 94, 0.04);
}

.earnings-table tbody tr:hover td:first-child {
    color: var(--accent);
}

.symbol-cell {
    display: flex;
    align-items: center;
    gap: 12px;
}

.symbol-logo {
    width: 36px;
    height: 36px;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.15), rgba(59, 130, 246, 0.15));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 12px;
    color: var(--accent);
    border: 1px solid var(--border-light);
}

.symbol-info {
    display: flex;
    flex-direction: column;
}

.symbol-ticker {
    font-weight: 700;
    color: var(--text-main);
    font-size: 15px;
}

.symbol-name {
    font-size: 12px;
    color: var(--text-muted);
}

.date-cell {
    display: flex;
    flex-direction: column;
}

.date-main {
    font-weight: 600;
    color: var(--text-main);
}

.date-relative {
    font-size: 12px;
    color: var(--text-dim);
}

.surprise-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 999px;
    font-weight: 700;
    font-size: 13px;
}

.surprise-badge.beat {
    background: rgba(34, 197, 94, 0.1);
    color: #22c55e;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.surprise-badge.miss {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.surprise-badge.pending {
    background: rgba(245, 158, 11, 0.1);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.2);
}

.surprise-badge.upcoming-badge {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.timing-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
}

.timing-badge.bmo {
    background: rgba(251, 191, 36, 0.1);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.15);
}

.timing-badge.amc {
    background: rgba(139, 92, 246, 0.1);
    color: #a78bfa;
    border: 1px solid rgba(139, 92, 246, 0.15);
}

.timing-badge.dmh {
    background: rgba(107, 114, 128, 0.08);
    color: #9ca3af;
    border: 1px solid rgba(107, 114, 128, 0.12);
}

.timing-badge svg {
    width: 13px;
    height: 13px;
}

tr.upcoming-row {
    background: rgba(59, 130, 246, 0.04) !important;
    border-left: 3px solid #3b82f6;
}

tr.upcoming-row:hover {
    background: rgba(59, 130, 246, 0.08) !important;
}

.surprise-badge svg {
    width: 14px;
    height: 14px;
}

.eps-cell {
    font-family: 'SF Mono', 'Monaco', monospace;
}

.eps-actual {
    font-weight: 700;
    color: var(--text-main);
}

.eps-estimate {
    color: var(--text-dim);
    font-size: 12px;
}

.revenue-cell {
    font-family: 'SF Mono', 'Monaco', monospace;
}

@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

.action-btn {
    background: var(--accent-gradient);
    color: #022c22;
    border: none;
    padding: 8px 18px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    font-family: inherit;
}

.action-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(34, 197, 94, 0.3);
    filter: brightness(1.05);
}

.no-data {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

.no-data svg {
    width: 64px;
    height: 64px;
    stroke: var(--border);
    margin-bottom: 20px;
}

.no-data h3 {
    font-size: 18px;
    color: var(--text-main);
    margin-bottom: 8px;
}

.loading {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
}

.loading-spinner {
    width: 48px;
    height: 48px;
    border: 3px solid var(--border);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 20px;
}

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

.ai-insight-bar {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(13, 24, 41, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(168, 85, 247, 0.2);
    border-radius: var(--radius-lg);
    padding: 18px 24px;
    margin-bottom: 24px;
    position: relative;
    overflow: hidden;
}

.ai-insight-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, #a855f7, #3b82f6);
}

.ai-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #a855f7, #3b82f6);
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(168, 85, 247, 0.25);
}

.ai-icon svg {
    width: 20px;
    height: 20px;
    stroke: white;
}

.ai-text {
    flex: 1;
}

.ai-title {
    font-weight: 700;
    font-size: 13px;
    color: var(--purple-soft);
    margin-bottom: 4px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.ai-message {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
}

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

@media (max-width: 768px) {
    .earnings-hero h1 {
        font-size: 32px;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
        gap: 12px;
    }

    .stat-card {
        padding: 20px;
    }

    .stat-value {
        font-size: 32px;
    }

    .filter-bar {
        flex-direction: column;
        align-items: stretch;
    }

    .tabs-container {
        overflow-x: auto;
        justify-content: flex-start;
        width: 100%;
        min-width: 0;
        max-width: 100%;
        box-sizing: border-box;
    }

    .tab-btn {
        flex: 0 0 auto;
    }

    .earnings-table-container {
        overflow-x: auto;
    }

    .earnings-table {
        min-width: 650px;
    }

    .alert-section {
        padding: 40px 24px;
    }

    .alert-content h2 {
        font-size: 24px;
    }

}

.alert-section {
    background: rgba(13, 24, 41, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--border);
    border-radius: var(--radius-2xl);
    padding: 60px 48px;
    margin: 40px 0;
    position: relative;
    overflow: hidden;
}

.alert-section::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(90deg, var(--accent), var(--blue), var(--purple));
}

.alert-section::after {
    content: "";
    position: absolute;
    bottom: -50%;
    left: -20%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.08) 0%, transparent 70%);
    pointer-events: none;
}

.alert-content {
    position: relative;
    z-index: 1;
    text-align: center;
}

.alert-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, rgba(34, 197, 94, 0.2), rgba(34, 197, 94, 0.1));
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: #22c55e;
    padding: 8px 16px;
    border-radius: 30px;
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 20px;
}

.alert-badge svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
}

.alert-content h2 {
    font-size: 36px;
    font-weight: 800;
    margin-bottom: 16px;
    background: linear-gradient(135deg, #fff 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.alert-content > p {
    color: var(--text-muted);
    font-size: 18px;
    max-width: 600px;
    margin: 0 auto 32px;
}

.alert-form {
    display: flex;
    gap: 12px;
    max-width: 500px;
    margin: 0 auto 40px;
}

.alert-input {
    flex: 1;
    background: var(--card);
    border: 2px solid var(--border);
    border-radius: 12px;
    padding: 16px 20px;
    font-size: 16px;
    color: var(--text-main);
    outline: none;
    transition: border-color 0.2s;
}

.alert-input:focus {
    border-color: var(--accent);
}

.alert-input::placeholder {
    color: var(--text-muted);
}

.alert-btn {
    background: linear-gradient(135deg, var(--accent), #16a34a);
    color: #0f172a;
    border: none;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    white-space: nowrap;
}

.alert-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(34, 197, 94, 0.4);
}

.alert-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.alert-message {
    padding: 12px 20px;
    border-radius: 8px;
    margin-bottom: 24px;
    font-weight: 500;
    display: none;
}

.alert-message.success {
    background: rgba(34, 197, 94, 0.15);
    color: #22c55e;
    display: block;
}

.alert-message.error {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    display: block;
}

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

.alert-feature {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 24px;
    background: rgba(15, 23, 42, 0.5);
    border: 1px solid var(--border);
    border-radius: 16px;
}

.feature-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.feature-icon.morning {
    background: rgba(245, 158, 11, 0.15);
}

.feature-icon.data {
    background: rgba(59, 130, 246, 0.15);
}

.feature-icon.free {
    background: rgba(34, 197, 94, 0.15);
}

.feature-icon svg {
    width: 24px;
    height: 24px;
}

.feature-icon.morning svg { stroke: #f59e0b; }
.feature-icon.data svg { stroke: #3b82f6; }
.feature-icon.free svg { stroke: #22c55e; }

.alert-feature h4 {
    font-size: 16px;
    font-weight: 700;
    margin: 0;
}

.alert-feature p {
    font-size: 14px;
    color: var(--text-muted);
    margin: 0;
    text-align: center;
}

.subscriber-count {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 14px;
}

.subscriber-count .avatars {
    display: flex;
}

.subscriber-count .avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #a855f7);
    border: 2px solid var(--bg);
    margin-left: -8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    font-weight: 700;
    color: white;
}

.subscriber-count .avatar:first-child {
    margin-left: 0;
}

.ticker-history-section {
    margin-bottom: 32px;
}
.ticker-search-bar {
    margin-bottom: 16px;
}
.ticker-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 12px 16px;
    transition: all 0.2s;
}
.ticker-search-input-wrap:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.08);
}
.ticker-search-input-wrap input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-main);
    font-size: 15px;
    outline: none;
    text-transform: uppercase;
}
.ticker-search-input-wrap input::placeholder {
    text-transform: none;
    color: var(--text-muted);
}
.ticker-search-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    background: var(--accent-gradient);
    color: #022c22;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
    font-family: inherit;
}
.ticker-search-btn:hover { filter: brightness(1.05); box-shadow: 0 2px 8px rgba(34, 197, 94, 0.3); }
.ticker-search-btn:disabled { opacity: 0.5; cursor: not-allowed; }
.ticker-history-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
    flex-wrap: wrap;
    gap: 12px;
}
.ticker-history-title {
    display: flex;
    align-items: center;
    gap: 12px;
}
.ticker-history-title h3 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
    color: var(--text-main);
}
.ticker-history-count {
    background: rgba(59, 130, 246, 0.1);
    color: var(--blue-soft);
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    border: 1px solid rgba(59, 130, 246, 0.15);
}
.ticker-history-actions {
    display: flex;
    gap: 8px;
}
.download-csv-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(34, 197, 94, 0.08);
    color: var(--accent);
    border: 1px solid rgba(34, 197, 94, 0.2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.download-csv-btn:hover {
    background: rgba(34, 197, 94, 0.15);
    border-color: rgba(34, 197, 94, 0.35);
}
.close-history-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: rgba(239, 68, 68, 0.08);
    color: var(--red);
    border: 1px solid rgba(239, 68, 68, 0.2);
    border-radius: var(--radius-sm);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}
.close-history-btn:hover {
    background: rgba(239, 68, 68, 0.15);
    border-color: rgba(239, 68, 68, 0.3);
}
.filter-right {
    display: flex;
    align-items: center;
    gap: 10px;
}
@media (max-width: 768px) {
    .ticker-search-input-wrap {
        flex-wrap: wrap;
    }
    .ticker-search-btn {
        width: 100%;
        justify-content: center;
    }
    .ticker-history-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .filter-right {
        width: 100%;
        min-width: 0;
    }
    .filter-right .search-box {
        flex: 1;
        min-width: 0;
    }
    .filter-right .search-box input {
        width: 100%;
        min-width: 0;
    }

    .alert-features {
        grid-template-columns: minmax(0, 1fr);
    }
}

@media (max-width: 480px) {
    .alert-form {
        flex-direction: column;
    }
    .alert-input,
    .alert-btn {
        width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }
}

.seo-guide {
    max-width: 900px;
    margin: 0 auto;
    padding: 48px 24px;
    color: var(--text-muted);
    line-height: 1.8;
}
.seo-guide h1 {
    color: var(--text-main);
    font-size: 32px;
    font-weight: 800;
    margin-bottom: 24px;
    line-height: 1.3;
}
.seo-guide h2 {
    color: var(--text-main);
    font-size: 22px;
    font-weight: 700;
    margin: 32px 0 12px;
}
.seo-guide p {
    margin-bottom: 16px;
    font-size: 16px;
}
.seo-guide-separator {
    border: none;
    border-bottom: 1px solid var(--border);
    margin: 0 auto 40px;
    max-width: 900px;
}

.related-stocks-section {
    max-width: 1000px;
    margin: 3rem auto;
    padding: 2rem;
    text-align: center;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    position: relative;
    overflow: hidden;
}
.related-stocks-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: var(--accent-gradient);
}
.related-stocks-section h2 {
    font-size: 1.25rem;
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-weight: 700;
}
.related-stocks-section p {
    color: var(--text-dim);
    margin-bottom: 1.5rem;
}
.stock-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
}
.stock-links a {
    background: rgba(34, 197, 94, 0.06);
    border: 1px solid rgba(34, 197, 94, 0.2);
    color: var(--accent);
    padding: 0.5rem 1rem;
    border-radius: var(--radius-sm);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s;
    letter-spacing: 0.3px;
}
.stock-links a:hover {
    background: rgba(34, 197, 94, 0.12);
    border-color: rgba(34, 197, 94, 0.35);
    transform: translateY(-1px);
}

/* ---- Results states, pager and notices (server-rendered partial) ---- */
.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.symbol-line {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}

.surprise-badge.neutral {
    background: rgba(107, 114, 128, 0.1);
    color: var(--text-muted);
    border: 1px solid rgba(107, 114, 128, 0.2);
}

.timing-badge.tbd {
    background: rgba(107, 114, 128, 0.08);
    color: var(--text-muted);
    border: 1px solid rgba(107, 114, 128, 0.12);
}

.eps-actual.is-pending,
.eps-actual.is-unavailable {
    font-weight: 600;
    font-size: 13px;
    color: var(--text-muted);
}

a.action-btn {
    display: inline-block;
    text-decoration: none;
    line-height: 1.2;
}

.earnings-pager {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 14px 4px 4px;
    color: var(--text-muted);
    font-size: 13px;
}

.pager-links {
    display: inline-flex;
    gap: 10px;
}

.pager-link {
    display: inline-block;
    padding: 8px 16px;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-main);
    text-decoration: none;
    font-weight: 600;
}

.pager-link:hover,
.pager-link:focus-visible {
    border-color: var(--accent);
    color: var(--accent);
}

.data-notice {
    margin: 0 0 16px;
    padding: 12px 16px;
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-left-width: 4px;
    border-radius: var(--radius-sm);
    background: rgba(245, 158, 11, 0.08);
    color: var(--text-main);
    font-size: 14px;
    line-height: 1.5;
}

.data-notice[hidden] {
    display: none;
}

.earnings-table-container.is-refreshing {
    opacity: 0.6;
    transition: opacity 0.15s ease;
}
