:root {
    --ink: #101828;
    --muted: #667085;
    --soft: #f6f7fb;
    --card: #ffffff;
    --line: #d9e0ec;
    --navy: #182230;
    --blue: #2563eb;
    --cyan: #0891b2;
    --pink: #db2777;
    --amber: #d97706;
    --green: #059669;
    --red: #dc2626;
    --shadow: 0 18px 45px rgba(16, 24, 40, 0.1);
    --shadow-sm: 0 8px 22px rgba(16, 24, 40, 0.08);
    --rainbow: linear-gradient(90deg, #e11d48, #f59e0b, #eab308, #10b981, #0891b2, #2563eb, #7c3aed, #db2777);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    background: var(--soft);
    color: var(--ink);
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

body::before {
    content: "";
    position: fixed;
    inset: 0 0 auto;
    height: 6px;
    background: var(--rainbow);
    z-index: 2000;
}

a {
    color: inherit;
}

button,
input,
select {
    font: inherit;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.nav-bar {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, 0.88);
    border-bottom: 1px solid rgba(217, 224, 236, 0.8);
    backdrop-filter: blur(18px);
}

.nav-content,
.hero-content,
.insights-section,
.main-content,
.stats-section,
.comparison-section,
.footer-content {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 18px 0 14px;
}

.nav-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--ink);
    font-size: 1.05rem;
    font-weight: 800;
    text-decoration: none;
}

.brand-mark {
    display: grid;
    width: 34px;
    height: 34px;
    place-items: center;
    color: white;
    background: var(--navy);
    border-radius: 8px;
    box-shadow: inset 0 -3px 0 rgba(255, 255, 255, 0.12);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    margin: 0;
    list-style: none;
}

.nav-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    border-radius: 8px;
    color: var(--muted);
    font-size: 0.93rem;
    font-weight: 700;
    text-decoration: none;
}

.nav-link:hover,
.nav-link:focus-visible {
    color: var(--ink);
    background: #eef2f7;
    outline: none;
}

.submit-btn {
    color: white;
    background: var(--navy);
}

.submit-btn:hover,
.submit-btn:focus-visible {
    color: white;
    background: #26364d;
}

.hero {
    color: white;
    background:
        linear-gradient(135deg, rgba(16, 24, 40, 0.92), rgba(24, 34, 48, 0.84)),
        var(--rainbow);
    border-bottom: 1px solid rgba(255, 255, 255, 0.15);
}

.hero-content {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
    gap: 22px;
    padding: 58px 0 44px;
}

.hero-copy {
    align-self: center;
    min-width: 0;
}

.eyebrow {
    margin: 0 0 10px;
    color: var(--cyan);
    font-size: 0.78rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hero .eyebrow {
    color: #7dd3fc;
}

.hero h1 {
    max-width: 760px;
    margin: 0;
    font-size: clamp(2.45rem, 6vw, 5.25rem);
    line-height: 0.98;
    font-weight: 900;
}

.hero-subtitle {
    max-width: 690px;
    margin: 22px 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 1.1rem;
}

.countdown-panel,
.stat-card,
.insight,
.grid-container,
.chart-shell,
.comparison-card,
.form-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
}

.countdown-panel {
    align-self: stretch;
    display: flex;
    min-width: 0;
    flex-direction: column;
    justify-content: center;
    min-height: 210px;
    padding: 24px;
    color: var(--ink);
}

.countdown-label {
    margin-bottom: 16px;
    color: var(--muted);
    font-weight: 800;
}

.countdown-timer {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.countdown-unit {
    padding: 12px 8px;
    text-align: center;
    background: #f1f5f9;
    border-radius: 8px;
}

.countdown-number {
    display: block;
    font-size: clamp(1.55rem, 3vw, 2.35rem);
    line-height: 1;
    font-weight: 900;
}

.countdown-text {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.68rem;
    font-weight: 800;
    text-transform: uppercase;
}

.countdown-message {
    color: var(--muted);
}

.hero-stats {
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 14px;
}

.stat-card {
    min-height: 116px;
    padding: 20px;
}

.stat-number {
    display: block;
    color: var(--ink);
    font-size: clamp(1.9rem, 4vw, 3rem);
    line-height: 1;
    font-weight: 900;
}

.stat-label {
    display: block;
    margin-top: 10px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.insights-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    padding: 24px 0 0;
}

.insight {
    display: flex;
    align-items: center;
    gap: 14px;
    min-width: 0;
    padding: 18px;
}

.insight i {
    display: grid;
    width: 42px;
    height: 42px;
    place-items: center;
    color: var(--blue);
    background: #eff6ff;
    border-radius: 8px;
}

.insight-label {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
}

.insight strong {
    display: block;
    margin-top: 2px;
    font-size: 0.98rem;
    overflow-wrap: anywhere;
}

.main-content,
.stats-section,
.comparison-section {
    padding: 42px 0 0;
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    margin-bottom: 18px;
}

.section-heading.centered {
    display: block;
    max-width: 680px;
    text-align: center;
}

.section-heading h2 {
    margin: 0;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    line-height: 1.08;
}

.section-heading p:last-child,
#resultSummary {
    margin: 0;
    color: var(--muted);
    font-weight: 600;
}

.controls-section {
    display: grid;
    grid-template-columns: minmax(220px, 1fr) auto minmax(210px, auto);
    gap: 12px;
    margin-bottom: 16px;
}

.search-bar {
    position: relative;
    display: block;
}

.search-bar i {
    position: absolute;
    top: 50%;
    left: 15px;
    color: var(--muted);
    transform: translateY(-50%);
}

.search-bar input,
.sort-dropdown select {
    width: 100%;
    min-height: 46px;
    color: var(--ink);
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.search-bar input {
    padding: 0 14px 0 44px;
}

.sort-dropdown select {
    padding: 0 42px 0 14px;
    font-weight: 700;
}

.search-bar input:focus,
.sort-dropdown select:focus,
.filter-btn:focus-visible {
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
    outline: none;
}

.filter-buttons {
    display: flex;
    gap: 6px;
    padding: 4px;
    background: #e9eef6;
    border-radius: 8px;
}

.filter-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 38px;
    padding: 0 12px;
    color: var(--muted);
    background: transparent;
    border: 1px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 800;
    white-space: nowrap;
}

.filter-btn:hover {
    color: var(--ink);
}

.filter-btn.active {
    color: white;
    background: var(--navy);
}

.grid-container {
    padding: 16px;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(176px, 1fr));
    gap: 12px;
}

.corporation-item {
    position: relative;
    display: flex;
    min-height: 212px;
    flex-direction: column;
    gap: 12px;
    padding: 14px;
    overflow: hidden;
    background: #f8fafc;
    border: 1px solid #e6ebf2;
    border-radius: 8px;
}

.corporation-item::before {
    content: "";
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    background: #cbd5e1;
}

.corporation-item.active::before,
.corporation-item.returning::before {
    background: var(--rainbow);
}

.corporation-item.expired::before {
    background: var(--red);
}

.corporation-item:hover {
    border-color: #b9c3d4;
    box-shadow: var(--shadow-sm);
    transform: translateY(-2px);
}

.logo-link {
    width: 76px;
    height: 76px;
    margin-top: 8px;
}

.logo-link img {
    display: block;
    width: 76px;
    height: 76px;
    object-fit: cover;
    background: white;
    border: 1px solid var(--line);
    border-radius: 50%;
}

.handle {
    display: -webkit-box;
    min-height: 44px;
    overflow: hidden;
    color: var(--ink);
    font-weight: 900;
    line-height: 1.25;
    text-decoration: none;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.handle:hover {
    color: var(--blue);
}

.card-meta {
    margin-top: auto;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 700;
}

.badge-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.badge {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
    padding: 0 8px;
    color: #344054;
    background: #eef2f7;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 900;
}

.badge.active {
    color: white;
    background: var(--green);
}

.badge.expired {
    color: white;
    background: var(--red);
}

.badge.returning {
    color: white;
    background: var(--blue);
}

.no-results {
    grid-column: 1 / -1;
    padding: 48px 16px;
    color: var(--muted);
    text-align: center;
    font-weight: 700;
}

.chart-shell {
    position: relative;
    height: 430px;
    padding: 22px;
}

.no-data-message {
    position: absolute;
    inset: 22px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    text-align: center;
}

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

.no-data-message i {
    margin-bottom: 12px;
    color: #98a2b3;
    font-size: 2rem;
}

.comparison-section {
    padding-bottom: 54px;
}

.comparison-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}

.comparison-card {
    padding: 24px;
}

.comparison-card.current {
    border-top: 4px solid var(--blue);
}

.comparison-year {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 900;
    text-transform: uppercase;
}

.stat-value {
    display: block;
    margin-top: 8px;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 1;
    font-weight: 900;
}

.stat-description,
#comparisonNote {
    color: var(--muted);
    font-weight: 700;
}

#comparisonNote {
    margin: 12px 0 0;
}

.footer {
    color: rgba(255, 255, 255, 0.76);
    background: var(--navy);
}

.footer-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    min-height: 68px;
}

.footer p {
    margin: 0;
    font-weight: 700;
}

.social-links {
    display: flex;
    gap: 8px;
}

.social-links a {
    display: grid;
    width: 36px;
    height: 36px;
    place-items: center;
    color: white;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    text-decoration: none;
}

.social-links a:hover,
.social-links a:focus-visible {
    background: rgba(255, 255, 255, 0.18);
    outline: none;
}

.submit-container {
    width: min(880px, calc(100% - 32px));
    margin: 0 auto;
    padding: 40px 0 54px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 24px;
    color: var(--blue);
    font-weight: 800;
    text-decoration: none;
}

.submit-hero {
    margin-bottom: 22px;
}

.submit-hero h1 {
    margin: 0;
    font-size: clamp(2rem, 5vw, 3.6rem);
    line-height: 1;
}

.submit-hero p {
    max-width: 650px;
    margin: 14px 0 0;
    color: var(--muted);
    font-size: 1.06rem;
}

.form-card {
    padding: 18px;
}

.iframe-container {
    height: min(760px, 80vh);
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
}

iframe {
    width: 100%;
    height: 100%;
    border: 0;
}

.tips-section {
    margin-top: 18px;
    padding: 18px;
    background: #f8fafc;
    border-radius: 8px;
}

.tips-section h2 {
    margin: 0 0 10px;
    font-size: 1.05rem;
}

.tips-list {
    display: grid;
    gap: 8px;
    padding: 0;
    margin: 0;
    color: var(--muted);
    list-style: none;
}

.tips-list li {
    display: flex;
    gap: 8px;
}

.tips-list i {
    margin-top: 4px;
    color: var(--green);
}

@media (max-width: 980px) {
    .hero-content,
    .insights-section,
    .controls-section {
        grid-template-columns: 1fr;
    }

    .hero-stats {
        grid-template-columns: repeat(2, 1fr);
    }

    .filter-buttons {
        overflow-x: auto;
    }
}

@media (max-width: 720px) {
    .nav-content,
    .hero-content,
    .insights-section,
    .main-content,
    .stats-section,
    .comparison-section,
    .footer-content {
        width: min(1180px, calc(100% - 24px));
    }

    .nav-content {
        align-items: flex-start;
        flex-direction: column;
        gap: 14px;
        padding: 14px 0 12px;
    }

    .nav-links {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        gap: 8px;
        padding-bottom: 2px;
    }

    .nav-link {
        justify-content: center;
        width: 100%;
        min-width: 0;
    }

    .hero-content {
        padding-top: 38px;
        gap: 16px;
    }

    .countdown-timer {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .filter-buttons {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        overflow-x: visible;
    }

    .filter-btn {
        min-width: 0;
        padding: 0 8px;
        white-space: normal;
    }

    .section-heading,
    .footer-content {
        align-items: flex-start;
        flex-direction: column;
    }

    .comparison-grid {
        grid-template-columns: 1fr;
    }

    .grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    }
}

@media (max-width: 480px) {
    .hero h1 {
        font-size: 2rem;
        line-height: 1.08;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    .nav-link {
        min-height: 40px;
        padding: 0 8px;
        font-size: 0.88rem;
    }

    .hero-stats,
    .insights-section,
    .comparison-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .countdown-panel,
    .stat-card,
    .insight,
    .comparison-card {
        padding: 16px;
    }

    .countdown-panel {
        min-height: 0;
    }

    .countdown-unit {
        min-width: 0;
        padding: 12px 6px;
    }

    .stat-card {
        min-height: 92px;
    }

    .controls-section {
        gap: 10px;
    }

    .grid-container {
        padding: 10px;
    }

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

    .corporation-item {
        min-height: 190px;
    }

    .chart-shell {
        height: 320px;
        padding: 14px;
    }
}
