/* ═══════════════════════════════════════════════════════════════════════
   Financial Sankey — Core MVP Styles
   ═══════════════════════════════════════════════════════════════════════ */

/* === RESET & BASE === */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto,
                 'Helvetica Neue', Arial, sans-serif;
    background: #FFFFFF;
    color: #2C3E50;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.hidden { display: none !important; }


/* === HEADER === */
header {
    padding: 16px 32px;
    border-bottom: 1px solid #F0F0F0;
    background: #FFFFFF;
    position: sticky;
    top: 0;
    z-index: 50;

}

.header-inner {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    position: relative;
    min-height: 25px;
}

.logo {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
    text-decoration: none;
    letter-spacing: -0.5px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: opacity 0.15s;
    flex-shrink: 0;
}

.logo:hover {
    opacity: 0.7;
}

.logo-icon {
    height: 22px;
    width: auto;
}

/* Header search bar — absolutely centered in header */
.header-search {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
}

.header-search-wrapper {
    position: relative;
}

.header-search-wrapper .search-icon {
    left: 14px;
}

#chart-search-input {
    width: 100%;
    padding: 10px 18px 10px 40px;
    font-size: 15px;
    font-family: inherit;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #F7F9FC;
    color: #1A1A2E;
}

#chart-search-input::placeholder {
    color: #9CA3AF;
}

#chart-search-input:focus {
    border-color: #3498DB;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
    background: #FFFFFF;
}


/* === HEADER SIGN-IN LINK (landing page) === */
.header-signin-link {
    margin-left: auto;
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1A1A2E;
    text-decoration: none;
    padding: 8px 22px;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    transition: all 0.15s;
    white-space: nowrap;
}

.header-signin-link:hover {
    background: #F0F7FF;
    border-color: #3498DB;
    color: #2980B9;
}

/* === HEADER SUBSCRIBE BUTTON === */
.header-subscribe-btn {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: linear-gradient(135deg, #2563EB, #3498DB);
    border: none;
    border-radius: 8px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.header-subscribe-btn:hover {
    background: linear-gradient(135deg, #1D4ED8, #2980B9);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.header-subscribe-btn.hidden {
    display: none;
}

/* === HEADER USER CONTROLS === */
.header-user {
    position: relative;
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #6B7B8D;
    background: transparent;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.premium-badge {
    display: inline-flex;
    align-items: center;
    line-height: 0;
}

.premium-badge.hidden {
    display: none;
}

.user-menu-btn:hover {
    background: #F0F7FF;
    border-color: #3498DB;
    color: #2980B9;
}

.user-email {
    font-size: 14px;
    font-weight: 500;
    max-width: 200px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.user-icon-mobile {
    display: none;
}

.user-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
    z-index: 200;
    min-width: 200px;
    overflow: hidden;
}

.user-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #2C3E50;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    text-decoration: none;
    transition: background 0.1s;
}

.user-menu-item:hover {
    background: #F0F7FF;
}

.user-menu-divider {
    border-top: 1px solid #F0F0F0;
}

.user-menu-signout:hover {
    background: #FEF2F2;
    color: #EF4444;
}

.subscribe-item {
    color: #2563EB;
    font-weight: 600;
}


/* === LANDING VIEW (scrollable marketing page) === */
#landing-view {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.landing-section {
    width: 100%;
    padding: 80px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

/* ── Hero Section ── */
.landing-hero-section {
    padding-top: 100px;
    padding-bottom: 60px;
}

.landing-hero-section h1 {
    font-size: 56px;
    font-weight: 800;
    color: #000000;
    letter-spacing: -2px;
    line-height: 1.1;
    margin-bottom: 20px;
}

.landing-hero-subtitle {
    font-size: 20px;
    color: #6B7B8D;
    font-weight: 400;
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 28px;
}

#hero-cta-btn {
    margin-bottom: 48px;
}

/* Hero carousel */
.hero-carousel {
    width: 100%;
    overflow: hidden;
    margin-top: 8px;
}

.carousel-track {
    display: flex;
    gap: 24px;
    animation: carousel-scroll 60s linear infinite;
    width: max-content;
}

.carousel-track img {
    height: 381px;
    width: auto;
    flex-shrink: 0;
}

@keyframes carousel-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

/* ── Problem Section ── */
.landing-problem-section {
    background: #FAFBFC;
}

.landing-problem-section h2,
.landing-solution-section h2,
.landing-demo-section h2 {
    font-size: 44px;
    font-weight: 800;
    color: #000000;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 16px;
}

.text-red { color: #DC2626; }

.section-subtitle {
    font-size: 18px;
    color: #6B7B8D;
    max-width: 600px;
    line-height: 1.6;
    margin-bottom: 48px;
}

/* Messy paper pile */
.paper-pile {
    position: relative;
    width: 100%;
    max-width: 720px;
    height: 420px;
    margin: -20px auto 0;
}

.paper {
    position: absolute;
    width: 253px;
    object-fit: cover;
    background: #FFFFFF;
    border: 1px solid #D1D5DB;
    border-radius: 3px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 6px 20px rgba(0, 0, 0, 0.06);
    pointer-events: none;
}


/* Scattered positions — overlapping messy pile */
.paper-1 { left: 2%;   top: 8%;   transform: rotate(-8deg);  z-index: 1; width: 230px; }
.paper-2 { left: 42%;  top: 0%;   transform: rotate(5deg);   z-index: 4; width: 265px; }
.paper-3 { left: 0%;   top: 35%;  transform: rotate(4deg);   z-index: 2; width: 242px; }
.paper-4 { left: 58%;  top: 22%;  transform: rotate(-6deg);  z-index: 5; width: 253px; }
.paper-5 { left: 20%;  top: 10%;  transform: rotate(-3deg);  z-index: 6; width: 276px; }
.paper-6 { left: 48%;  top: 42%;  transform: rotate(7deg);   z-index: 3; width: 230px; }
.paper-7 { left: 15%;  top: 48%;  transform: rotate(-5deg);  z-index: 7; width: 247px; }

/* ── Quote Section ── */
.landing-quote-section {
    padding: 60px 20px;
    background: #FFFFFF;
}

.landing-quote {
    font-size: 28px;
    font-weight: 600;
    font-style: italic;
    color: #1A1A2E;
    max-width: 700px;
    line-height: 1.5;
    letter-spacing: -0.5px;
}

.landing-quote-cite {
    display: block;
    margin-top: 16px;
    font-size: 16px;
    font-weight: 600;
    color: #6B7B8D;
    font-style: normal;
}

/* ── Three Things Section ── */
.landing-solution-section h2 {
    margin-bottom: 48px;
}

.three-things {
    display: flex;
    gap: 28px;
    max-width: 1060px;
    width: 100%;
}

.thing-card {
    flex: 1;
    padding: 36px 28px;
    border: 1.5px solid #E5E7EB;
    border-radius: 16px;
    text-align: left;
    transition: all 0.18s ease;
}

/* Color variants */
.thing-card-blue  { border-color: rgba(37, 99, 235, 0.25); background: linear-gradient(180deg, rgba(37, 99, 235, 0.04) 0%, transparent 100%); }
.thing-card-green { border-color: rgba(22, 163, 74, 0.25); background: linear-gradient(180deg, rgba(22, 163, 74, 0.04) 0%, transparent 100%); }
.thing-card-amber { border-color: rgba(217, 119, 6, 0.25); background: linear-gradient(180deg, rgba(217, 119, 6, 0.04) 0%, transparent 100%); }

.thing-card-blue:hover  { border-color: #2563eb; box-shadow: 0 6px 20px rgba(37, 99, 235, 0.12); transform: translateY(-3px); }
.thing-card-green:hover { border-color: #16a34a; box-shadow: 0 6px 20px rgba(22, 163, 74, 0.12); transform: translateY(-3px); }
.thing-card-amber:hover { border-color: #d97706; box-shadow: 0 6px 20px rgba(217, 119, 6, 0.12); transform: translateY(-3px); }

.thing-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 800;
    border-radius: 12px;
    margin-bottom: 20px;
}

.thing-number-blue  { background: #2563eb; }
.thing-number-green { background: #16a34a; }
.thing-number-amber { background: #d97706; }

.thing-card h3 {
    font-size: 24px;
    font-weight: 800;
    color: #1A1A2E;
    margin-bottom: 10px;
    letter-spacing: -0.3px;
}

.thing-card p {
    font-size: 17px;
    color: #6B7B8D;
    line-height: 1.65;
}

/* ── Demo Section ── */
.landing-demo-section {
    padding-bottom: 100px;
}

.landing-demo-section h2 {
    margin-bottom: 16px;
}

.demo-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 60px 0;
    color: #6B7B8D;
}

.demo-loading p {
    font-size: 16px;
    font-weight: 500;
}

.demo-charts {
    width: 100%;
    max-width: 1600px;
}

.demo-chart-block {
    position: relative;
    max-width: 1600px;
    margin: 60px auto;
}

.demo-badge-row {
    display: inline-flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 12px;
    padding: 10px 20px 10px 10px;
    border: 1.5px solid #E5E7EB;
    border-radius: 16px;
}

.demo-chart-blue .demo-badge-row  { border-color: rgba(37, 99, 235, 0.35); }
.demo-chart-green .demo-badge-row { border-color: rgba(22, 163, 74, 0.35); }
.demo-chart-amber .demo-badge-row { border-color: rgba(217, 119, 6, 0.35); }

.demo-badge-label {
    font-size: 24px;
    font-weight: 800;
    color: #1A1A2E;
    letter-spacing: -0.5px;
}

.demo-badge {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    color: #FFFFFF;
    font-size: 20px;
    font-weight: 800;
    border-radius: 12px;
}

.demo-badge-blue  { background: #2563eb; }
.demo-badge-green { background: #16a34a; }
.demo-badge-amber { background: #d97706; }

.demo-cta {
    margin-top: 48px;
    text-align: center;
}

.demo-cta h3 {
    font-size: 28px;
    font-weight: 800;
    color: #1A1A2E;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
}

.demo-cta p {
    font-size: 16px;
    color: #6B7B8D;
    margin-bottom: 24px;
}

/* Ticker marquee */
.ticker-marquee {
    overflow: hidden;
    width: 100%;
    max-width: 700px;
    margin: 16px auto 20px;
    mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, black 10%, black 90%, transparent);
}

.ticker-track {
    display: flex;
    gap: 10px;
    animation: ticker-scroll 25s linear infinite;
    width: max-content;
}

.ticker-chip {
    display: inline-block;
    padding: 7px 18px;
    font-size: 15px;
    font-weight: 700;
    color: #3498DB;
    background: #EBF5FB;
    border-radius: 8px;
    letter-spacing: 0.5px;
    white-space: nowrap;
    flex-shrink: 0;
}

@keyframes ticker-scroll {
    0%   { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.cta-button {
    display: inline-block;
    padding: 16px 40px;
    font-size: 17px;
    font-weight: 700;
    font-family: inherit;
    color: #FFFFFF;
    background: #1A1A2E;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.18s ease;
    letter-spacing: 0.2px;
}

.cta-button:hover {
    background: #2C2C44;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 26, 46, 0.3);
}


/* === AUTH VIEW === */
#auth-view {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 57px);
    padding: 40px 20px;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    padding: 36px 32px;
    border: 1px solid #E5E7EB;
    border-radius: 16px;
    background: #FFFFFF;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.04);
}

.auth-card h2 {
    font-size: 24px;
    font-weight: 800;
    color: #1A1A2E;
    margin-bottom: 4px;
}

.auth-subtitle {
    font-size: 14px;
    color: #9CA3AF;
    margin-bottom: 28px;
}

.oauth-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #2C3E50;
    background: #FFFFFF;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    margin-bottom: 10px;
}

.oauth-btn:hover {
    background: #F7F9FC;
    border-color: #D1D5DB;
}

.oauth-btn svg {
    flex-shrink: 0;
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 20px 0;
    color: #9CA3AF;
    font-size: 13px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #E5E7EB;
}

.auth-form input {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-family: inherit;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    color: #1A1A2E;
    margin-bottom: 12px;
}

.auth-form input::placeholder {
    color: #9CA3AF;
}

.auth-form input:focus {
    border-color: #3498DB;
    box-shadow: 0 0 0 3px rgba(52, 152, 219, 0.1);
}

.auth-submit-btn {
    display: block;
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: #FFFFFF;
    background: #3498DB;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
    margin-top: 4px;
}

.auth-submit-btn:hover {
    background: #2980B9;
}

.auth-message {
    margin-top: 16px;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.4;
}

.auth-error {
    background: #FEF2F2;
    color: #DC2626;
    border: 1px solid #FECACA;
}

.auth-success {
    background: #F0FDF4;
    color: #16A34A;
    border: 1px solid #BBF7D0;
}

.auth-toggle {
    text-align: center;
    margin-top: 20px;
    font-size: 14px;
    color: #6B7B8D;
}

.auth-toggle a {
    color: #3498DB;
    font-weight: 600;
    text-decoration: none;
}

.auth-toggle a:hover {
    text-decoration: underline;
}


/* === SEARCH VIEW (authenticated home) === */
#search-view {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 57px);
    padding: 40px 20px;
}

.hero {
    text-align: center;
    margin-bottom: 48px;
}

.hero h1 {
    font-size: 48px;
    font-weight: 800;
    color: #000000;
    letter-spacing: -1.5px;
    line-height: 1.15;
    margin-bottom: 16px;
}

.subtitle {
    font-size: 18px;
    color: #6B7B8D;
    font-weight: 400;
}


/* === SEARCH === */
.search-container {
    width: 100%;
    max-width: 600px;
}

.search-wrapper {
    position: relative;
}

.search-icon {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

#search-input {
    width: 100%;
    padding: 16px 24px 16px 50px;
    font-size: 17px;
    font-family: inherit;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    background: #FFFFFF;
    color: #1A1A2E;
}

#search-input::placeholder {
    color: #9CA3AF;
}

#search-input:focus {
    border-color: #3498DB;
    box-shadow: 0 0 0 4px rgba(52, 152, 219, 0.1);
}

/* === SEARCH EXTRAS (popular chips + recently viewed) === */
.search-extras {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    margin-top: 24px;
}

.search-extras-group {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.search-extras-label {
    font-size: 12px;
    font-weight: 600;
    color: #9CA3AF;
    text-transform: uppercase;
    letter-spacing: 0.8px;
}

.popular-chips,
.recently-viewed-chips {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 8px;
}

.popular-chip {
    display: inline-block;
    padding: 7px 18px;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    color: #3498DB;
    background: #EBF5FB;
    border: 1.5px solid transparent;
    border-radius: 8px;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.popular-chip:hover {
    background: #D6EAF8;
    border-color: #3498DB;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
}

.recent-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 14px;
    font-weight: 600;
    font-family: inherit;
    color: #2C3E50;
    background: #FFFFFF;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.18s ease;
}

.recent-chip:hover {
    background: #F7F9FC;
    border-color: #3498DB;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.1);
}

.recent-chip .recent-chip-ticker {
    font-size: 12px;
    font-weight: 700;
    color: #3498DB;
    background: #EBF5FB;
    padding: 2px 8px;
    border-radius: 5px;
    letter-spacing: 0.3px;
}


/* === AUTOCOMPLETE DROPDOWN === */
.search-dropdown {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 12px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
}

.dropdown-item {
    padding: 14px 20px;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #F5F5F5;
    transition: background 0.1s;
}

.dropdown-item:first-child {
    border-radius: 12px 12px 0 0;
}

.dropdown-item:last-child {
    border-bottom: none;
    border-radius: 0 0 12px 12px;
}

.dropdown-item:only-child {
    border-radius: 12px;
}

.dropdown-item:hover,
.dropdown-item.active {
    background: #F0F7FF;
}

.dropdown-item .company-name {
    font-weight: 600;
    color: #2C3E50;
    font-size: 15px;
}

.dropdown-item .company-exchange {
    font-size: 12px;
    color: #9CA3AF;
    margin-left: 8px;
    font-weight: 400;
}

.dropdown-item .ticker {
    font-size: 13px;
    font-weight: 700;
    color: #3498DB;
    background: #EBF5FB;
    padding: 3px 10px;
    border-radius: 6px;
    letter-spacing: 0.5px;
    flex-shrink: 0;
}


/* === CHART VIEW === */
#chart-view {
    padding: 0 32px 40px;
    max-width: 100%;
}

/* === STICKY CHART CONTROLS === */
.chart-controls {
    position: sticky;
    top: 57px;
    z-index: 40;
    background: #FFFFFF;
    border-bottom: 1px solid #F0F0F0;
    padding: 10px 32px 12px;
    margin: 0 -32px;

}

.chart-controls-inner {
    max-width: 1600px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

#chart-title {
    font-size: 30px;
    font-weight: 800;
    color: #000000;
    letter-spacing: -0.8px;
}


/* === YEAR NAVIGATION === */
.year-nav {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    max-width: 1600px;
    margin: 0 auto;
}

.year-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.year-btn {
    padding: 8px 18px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    background: #FFFFFF;
    color: #6B7B8D;
    border: 1.5px solid #E5E7EB;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.18s ease;
    user-select: none;
    letter-spacing: 0.2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.year-btn:hover {
    background: #F0F7FF;
    border-color: #3498DB;
    color: #2980B9;
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.15);
    transform: translateY(-1px);
}

.year-btn.active {
    background: #1A1A2E;
    color: #FFFFFF;
    border-color: #1A1A2E;
    box-shadow: 0 2px 10px rgba(26, 26, 46, 0.25);
}

.year-btn.locked {
    background: #F3F4F6;
    color: #B0B8C4;
    border-color: #E5E7EB;
    cursor: pointer;
    position: relative;
}

.year-btn.locked:hover {
    background: #FFF7ED;
    border-color: #F59E0B;
    color: #D97706;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.15);
    transform: translateY(-1px);
}

.year-btn.locked .lock-icon {
    margin-right: 4px;
    font-size: 12px;
}

/* === YEAR DOTS (mobile only) === */
.year-dots {
    display: none;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 6px 0 2px;
}

.year-dots.hidden {
    display: none !important;
}

.year-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #D1D5DB;
    transition: all 0.2s;
    flex-shrink: 0;
}

.year-dot.active {
    background: #1A1A2E;
    transform: scale(1.3);
}

.year-dot.locked {
    background: #E5E7EB;
    position: relative;
    overflow: hidden;
}

.year-dot.locked::before,
.year-dot.locked::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 5px;
    height: 1px;
    background: #9CA3AF;
}

.year-dot.locked::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.year-dot.locked::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

/* === LOCKED YEARS HINT (mobile only) === */
.locked-years-hint {
    display: none;
    align-items: center;
    gap: 5px;
    padding: 5px 14px;
    font-size: 12px;
    font-weight: 500;
    font-family: inherit;
    color: #92400E;
    background: #FFF7ED;
    border: 1px solid #FDE68A;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
}

.locked-years-hint:hover {
    background: #FEF3C7;
    border-color: #F59E0B;
}

.locked-years-hint.hidden {
    display: none !important;
}

.lock-hint-icon {
    font-size: 11px;
}

/* === FREE UNLOCK BUTTON === */
.free-unlock-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    font-size: 13px;
    font-weight: 600;
    font-family: inherit;
    color: #16A34A;
    background: #F0FDF4;
    border: 1.5px solid #BBF7D0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.15s;
    white-space: nowrap;
    margin-left: 12px;
}

.free-unlock-btn:hover {
    background: #DCFCE7;
    border-color: #16A34A;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(22, 163, 74, 0.15);
}

.free-unlock-btn.hidden {
    display: none;
}

/* Year arrow nav (mobile only — hidden on desktop) */
.year-arrow,
.year-label {
    display: none;
}

/* Header search toggle (mobile only — hidden on desktop) */
.header-search-toggle {
    display: none;
}


/* === CHART WRAPPER & TOOLBAR === */
.chart-wrapper {
    position: relative;
    max-width: 1600px;
    margin: 24px auto;
}

.chart-toolbar {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    position: relative;
}

.chart-header-left {
    display: flex;
    align-items: center;
    gap: 8px;
}

.chart-title-text {
    font-size: 28px;
    font-weight: 800;
    color: #1A1A2E;
    letter-spacing: -0.5px;
    white-space: nowrap;
}

.chart-subtitle-text {
    font-size: 16px;
    font-weight: 400;
    color: #6B7B8D;
    text-align: center;
    margin-top: 2px;
    margin-bottom: 4px;
}

.chart-subtitle-text:empty {
    display: none;
}

.info-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    padding: 0;
    background: transparent;
    border: 1.5px solid transparent;
    border-radius: 50%;
    cursor: pointer;
    color: #9CA3AF;
    transition: all 0.18s ease;
    user-select: none;
    flex-shrink: 0;
}

.info-btn:hover {
    background: #F0F7FF;
    border-color: #3498DB;
    color: #2980B9;
}

.info-btn svg {
    flex-shrink: 0;
}

.download-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    background: transparent;
    border: 1.5px solid #E5E7EB;
    border-radius: 8px;
    cursor: pointer;
    color: #6B7B8D;
    transition: all 0.18s ease;
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
}

.download-btn:hover {
    background: #F0F7FF;
    border-color: #3498DB;
    color: #2980B9;
}

.download-btn.download-locked {
    opacity: 0.45;
}

.download-btn.download-locked:hover {
    background: #FFF7ED;
    border-color: #F59E0B;
    color: #D97706;
    opacity: 1;
}

/* Download dropdown menu */
.download-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 4px;
    background: #FFFFFF;
    border: 1px solid #E5E7EB;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1), 0 2px 8px rgba(0, 0, 0, 0.04);
    z-index: 200;
    min-width: 160px;
    overflow: hidden;
}

.download-menu-item {
    display: block;
    width: 100%;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    color: #2C3E50;
    background: transparent;
    border: none;
    cursor: pointer;
    text-align: left;
    transition: background 0.1s;
}

.download-menu-item:hover {
    background: #F0F7FF;
}

.download-menu-item + .download-menu-item {
    border-top: 1px solid #F0F0F0;
}

/* === INFO MODAL === */
.info-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.info-modal.hidden {
    display: none !important;
}

.info-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(4px);
}

.info-modal-content {
    position: relative;
    background: #FFFFFF;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
    max-width: 520px;
    width: 100%;
    padding: 32px;
    max-height: 80vh;
    overflow-y: auto;
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(8px); }
    to   { opacity: 1; transform: scale(1) translateY(0); }
}

.info-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    font-size: 22px;
    color: #9CA3AF;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.15s;
}

.info-modal-close:hover {
    background: #F0F0F0;
    color: #2C3E50;
}

.info-modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 16px;
    padding-right: 32px;
}

.info-modal-body {
    font-size: 15px;
    line-height: 1.7;
    color: #4A5568;
}

.info-modal-body h4 {
    font-size: 14px;
    font-weight: 700;
    color: #1A1A2E;
    margin: 16px 0 6px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.info-modal-body h4:first-child {
    margin-top: 0;
}

.info-modal-body p {
    margin: 0 0 8px;
}

.info-modal-body .info-tip {
    margin-top: 16px;
    padding: 12px 16px;
    background: #F0F7FF;
    border-radius: 10px;
    font-size: 13px;
    color: #2980B9;
    line-height: 1.6;
}

/* === CHART CONTAINER === */
.chart-container {
    display: flex;
    justify-content: center;
    overflow-x: auto;
    padding: 8px 0;
}

.chart-container svg {
    max-width: 100%;
    height: auto;
}


/* === LOADING === */
.loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 100px 0;
    color: #6B7B8D;
}

.spinner {
    width: 44px;
    height: 44px;
    border: 3px solid #E5E7EB;
    border-top-color: #3498DB;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-bottom: 20px;
}

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

.loading p {
    font-size: 16px;
    font-weight: 500;
    text-align: center;
}

.loading-dots::after {
    content: '';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%   { content: ''; }
    25%  { content: '.'; }
    50%  { content: '..'; }
    75%  { content: '...'; }
    100% { content: ''; }
}

.loading-subtitle {
    font-size: 13px;
    font-weight: 400;
    color: #9CA3AF;
    text-align: center;
    margin-top: 8px;
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.4s ease;
}

.loading-subtitle.visible {
    opacity: 1;
}


/* === ERROR === */
.error {
    text-align: center;
    padding: 60px 40px;
    max-width: 500px;
    margin: 0 auto;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-title {
    font-size: 20px;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 8px;
}

.error-detail {
    font-size: 15px;
    color: #6B7B8D;
    line-height: 1.5;
}


/* === RESPONSIVE === */
@media (max-width: 768px) {
    .hero h1 {
        font-size: 32px;
        letter-spacing: -1px;
    }

    .subtitle {
        font-size: 16px;
    }

    .landing-hero-section h1 {
        font-size: 34px;
        letter-spacing: -1px;
    }

    .landing-hero-subtitle {
        font-size: 16px;
    }

    .carousel-track img {
        height: 246px;
    }

    .landing-problem-section h2,
    .landing-solution-section h2,
    .landing-demo-section h2 {
        font-size: 30px;
        letter-spacing: -1px;
    }

    .section-subtitle {
        font-size: 16px;
    }

    .paper-pile {
        max-width: 340px;
        height: 260px;
    }

    .paper { width: 140px !important; }
    .paper-2 { width: 150px !important; }
    .paper-5 { width: 155px !important; }

    .three-things {
        flex-direction: column;
    }

    .landing-section {
        padding: 48px 16px;
    }

    .landing-hero-section {
        padding-top: 60px;
    }

    .user-email {
        max-width: 120px;
    }

    .auth-card {
        padding: 28px 20px;
    }

    #search-input {
        font-size: 16px;
        padding: 14px 20px 14px 46px;
    }

    header {
        padding: 12px 16px;
    }

    .header-search {
        max-width: 260px;
    }

    #chart-search-input {
        padding: 8px 14px 8px 36px;
        font-size: 14px;
    }

    #chart-view {
        padding: 0 16px 16px;
    }

    .chart-controls {
        top: 49px;
        padding: 8px 16px 10px;
        margin: 0 -16px;
    }

    #chart-title {
        font-size: 24px;
    }

    .year-nav {
        gap: 8px;
    }

    .year-btn {
        padding: 8px 16px;
        font-size: 14px;
    }

    .chart-toolbar {
        justify-content: center;
    }

    .chart-header-left {
        flex-direction: column;
        align-items: center;
    }

    .chart-header-left .info-btn {
        position: absolute;
        right: 44px;
        top: 50%;
        transform: translateY(-50%);
    }

    .chart-title-text {
        font-size: 22px;
        text-align: center;
    }

    .chart-title-text .chart-type {
        display: block;
    }

    .chart-subtitle-text {
        font-size: 14px;
    }

    .info-modal-content {
        padding: 24px;
    }

    .info-modal-title {
        font-size: 18px;
    }

    .user-email {
        display: none;
    }

    .user-icon-mobile {
        display: inline-block;
    }

    .header-subscribe-btn {
        font-size: 11px;
        padding: 5px 10px;
    }

    .free-unlock-btn {
        font-size: 11px;
        padding: 5px 10px;
        margin-left: 8px;
    }

    .demo-cta {
        overflow: hidden;
        max-width: 100%;
    }

    .demo-cta h3 {
        font-size: 20px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .demo-cta p {
        font-size: 14px;
        word-wrap: break-word;
        overflow-wrap: break-word;
    }

    .landing-quote {
        font-size: 22px;
    }

    /* ── Mobile year nav: compact arrow-based selector ── */
    .year-buttons {
        display: none !important;
    }

    .year-arrow {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: #FFFFFF;
        border: 1.5px solid #E5E7EB;
        border-radius: 10px;
        cursor: pointer;
        color: #2C3E50;
        transition: all 0.15s;
        flex-shrink: 0;
        padding: 0;
        font-family: inherit;
    }

    .year-arrow:hover {
        background: #F0F7FF;
        border-color: #3498DB;
        color: #2980B9;
    }

    .year-arrow:disabled {
        opacity: 0.3;
        cursor: default;
        pointer-events: none;
    }

    .year-label {
        display: inline-block;
        font-size: 16px;
        font-weight: 700;
        color: #1A1A2E;
        min-width: 50px;
        text-align: center;
        user-select: none;
    }

    .year-dots:not(.hidden) {
        display: flex;
    }

    .locked-years-hint:not(.hidden) {
        display: inline-flex;
    }

    /* ── Mobile search: icon toggle ── */
    .header-search-toggle:not(.hidden) {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: transparent;
        border: 1.5px solid #E5E7EB;
        border-radius: 10px;
        cursor: pointer;
        color: #6B7B8D;
        transition: all 0.15s;
        margin-left: auto;
        margin-right: 8px;
        padding: 0;
        flex-shrink: 0;
    }

    .header-search-toggle:hover {
        background: #F0F7FF;
        border-color: #3498DB;
        color: #2980B9;
    }

    /* Hide the inline search bar on mobile by default */
    .header-search {
        display: none !important;
    }

    /* When expanded, show search as full-width bar below header */
    .header-search.mobile-expanded {
        display: block !important;
        position: fixed;
        top: 50px;
        left: 0;
        right: 0;
        z-index: 60;
        max-width: 100%;
        width: 100%;
        transform: none;
        background: #FFFFFF;
        padding: 10px 16px;
        border-bottom: 1px solid #E5E7EB;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    }
}


/* === UPGRADE MODAL === */
.upgrade-benefits {
    list-style: none;
    padding: 0;
    margin: 0 0 4px;
}

.upgrade-benefits li {
    position: relative;
    padding-left: 24px;
    font-size: 15px;
    color: #4A5568;
    line-height: 1.7;
}

.upgrade-benefits li::before {
    content: "\2713";
    position: absolute;
    left: 0;
    color: #16A34A;
    font-weight: 700;
}

/* === PREMIUM CELEBRATION === */
.celebration-subtitle {
    font-size: 16px;
    color: #6B7B8D;
    margin-bottom: 16px;
}

.celebration-cta {
    display: block;
    width: 100%;
    margin-top: 20px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    font-family: inherit;
    color: #FFFFFF;
    background: #1A1A2E;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.15s;
}

.celebration-cta:hover {
    background: #2C2C44;
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(26, 26, 46, 0.3);
}

.upgrade-plans {
    display: flex;
    gap: 16px;
    margin-top: 20px;
}

.upgrade-plan-btn {
    flex: 1;
    padding: 24px 20px;
    border: 2px solid #E5E7EB;
    border-radius: 14px;
    background: #FFFFFF;
    cursor: pointer;
    transition: all 0.18s ease;
    text-align: center;
    font-family: inherit;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.upgrade-plan-btn:hover {
    border-color: #3498DB;
    box-shadow: 0 4px 16px rgba(52, 152, 219, 0.15);
    transform: translateY(-2px);
}

.upgrade-plan-btn .plan-name {
    font-size: 18px;
    font-weight: 700;
    color: #1A1A2E;
    margin-bottom: 4px;
}

.upgrade-plan-btn .plan-price {
    font-size: 28px;
    font-weight: 800;
    color: #2563EB;
    margin-bottom: 2px;
}

.upgrade-plan-btn .plan-interval {
    font-size: 13px;
    color: #9CA3AF;
}

.upgrade-plan-btn .plan-cta {
    display: block;
    margin-top: 16px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 700;
    color: #FFFFFF;
    background: #1A1A2E;
    border: none;
    border-radius: 8px;
    pointer-events: none;
}

.upgrade-plan-btn .plan-savings {
    font-size: 12px;
    font-weight: 700;
    color: #16A34A;
    background: #F0FDF4;
    padding: 3px 10px;
    border-radius: 6px;
    display: inline-block;
    margin-top: 10px;
}

.upgrade-plan-btn .plan-savings-spacer {
    height: 10px;
    margin-top: 10px;
}

/* ═══════════════════════════════════════════════════════════════════════
   SANKEY TOOLTIP + HOVER GLOW
   ═══════════════════════════════════════════════════════════════════════ */

/* Tooltip card */
#sankey-tooltip {
    position: fixed;
    pointer-events: none;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.97);
    color: #1a1a2e;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    line-height: 1.5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
    border: 1px solid #e5e7eb;
    backdrop-filter: blur(8px);
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.15s ease, transform 0.15s ease;
    max-width: 320px;
    white-space: normal;
    word-wrap: break-word;
}

#sankey-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Tooltip content typography */
#sankey-tooltip .tt-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    color: #1a1a2e;
}

#sankey-tooltip .tt-value {
    font-size: 16px;
    font-weight: 600;
    color: #2563eb;
    margin-bottom: 4px;
}

#sankey-tooltip .tt-detail {
    font-size: 12px;
    color: #6b7b8d;
}

#sankey-tooltip .tt-flow-arrow {
    color: #6b7b8d;
    font-size: 12px;
    margin-bottom: 2px;
}

/* Base cursor + transition on interactive elements */
.sankey-node,
.sankey-link {
    cursor: pointer;
}

/* Hover glow classes (toggled by JS) */
.sankey-link.highlighted {
    filter: brightness(1.4) drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}

.sankey-node.highlighted {
    filter: brightness(1.2) drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}

/* Waterfall bar hover */
.waterfall-bar {
    cursor: pointer;
}

.waterfall-bar.highlighted {
    filter: brightness(1.2) drop-shadow(0 0 6px rgba(255, 255, 255, 0.4));
}
