:root {
    --ink: #17202f;
    --muted: #697386;
    --line: #e4e8ef;
    --paper: #f7f8fb;
    --card: #ffffff;
    --blue: #3766e8;
    --blue-dark: #2447ad;
    --mint: #b8f0db;
    --warm: #fff2d7;
}

html {
    font-size: 16px;
    min-height: 100%;
}

body {
    min-height: 100vh;
    margin: 0;
    color: var(--ink);
    background: var(--paper);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    letter-spacing: -0.01em;
}

a {
    color: inherit;
    text-decoration: none;
}

a:hover {
    color: var(--blue-dark);
}

.site-header {
    background: rgba(247, 248, 251, 0.92);
    border-bottom: 1px solid var(--line);
    backdrop-filter: blur(12px);
}

.navbar {
    min-height: 74px;
}

.brand-mark {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    margin-right: 2rem;
    color: var(--ink);
    font-size: 1.15rem;
    font-weight: 750;
    letter-spacing: -0.04em;
}

.brand-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 5px 0 0 var(--mint);
}

.nav-link,
.header-link {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 600;
}

.nav-link:hover,
.header-link:hover {
    color: var(--ink);
}

.hero-panel {
    position: relative;
    overflow: hidden;
    padding: clamp(2rem, 6vw, 5.5rem);
    border-radius: 28px;
    color: #fff;
    background: linear-gradient(122deg, #172b61 0%, #2449a7 55%, #4773ee 100%);
    box-shadow: 0 24px 60px rgba(35, 64, 143, 0.2);
}

.hero-panel::after {
    position: absolute;
    right: -8%;
    bottom: -65%;
    width: 52%;
    height: 130%;
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
    content: "";
    transform: rotate(-18deg);
}

.hero-panel h1 {
    position: relative;
    z-index: 1;
    max-width: 680px;
    margin: 0.8rem 0 1rem;
    font-size: clamp(2.7rem, 7vw, 5.7rem);
    font-weight: 780;
    letter-spacing: -0.07em;
    line-height: 0.98;
}

.hero-copy {
    position: relative;
    z-index: 1;
    max-width: 580px;
    margin: 0;
    color: rgba(255, 255, 255, 0.8);
    font-size: clamp(1.05rem, 2vw, 1.35rem);
    line-height: 1.55;
}

.eyebrow {
    color: var(--blue);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.hero-panel .eyebrow {
    color: var(--mint);
}

h1,
h2,
h3 {
    font-weight: 750;
    letter-spacing: -0.045em;
}

h1 {
    margin-top: 0.5rem;
    font-size: clamp(2.4rem, 5vw, 4.5rem);
}

h2 {
    font-size: clamp(1.65rem, 3vw, 2.35rem);
}

h3 {
    font-size: 1.35rem;
    line-height: 1.15;
}

.btn {
    border-radius: 999px;
    padding: 0.7rem 1.15rem;
    font-weight: 700;
}

.btn-primary {
    border-color: var(--blue);
    background: var(--blue);
}

.btn-primary:hover {
    border-color: var(--blue-dark);
    background: var(--blue-dark);
}

.btn-quiet {
    border: 1px solid var(--line);
    background: #fff;
}

.hero-panel .btn-quiet {
    border-color: rgba(255, 255, 255, 0.35);
    color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

.section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.section-heading h2 {
    margin: 0.35rem 0 0;
}

.text-link {
    color: var(--blue-dark);
    font-size: 0.9rem;
    font-weight: 700;
}

.story-card,
.metric-card,
.admin-panel,
.auth-card,
.empty-state {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: 0 12px 32px rgba(31, 43, 72, 0.04);
}

.story-card {
    display: flex;
    flex-direction: column;
    min-height: 250px;
    padding: 1.15rem;
}

.story-card h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0.8rem 0 0.55rem;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.story-card p {
    display: -webkit-box;
    overflow: hidden;
    margin-bottom: 0.75rem;
    color: var(--muted);
    line-height: 1.6;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.tag {
    align-self: flex-start;
    padding: 0.3rem 0.55rem;
    border-radius: 999px;
    color: #72531d;
    background: var(--warm);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.card-meta {
    margin-top: auto;
    padding-top: 0.75rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 650;
    line-height: 1.4;
}

.feature-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--line);
}

.feature-card {
    display: flex;
    gap: 1rem;
    min-height: 140px;
    padding: 1.5rem;
    background: var(--card);
    transition: background 140ms ease, transform 140ms ease;
}

.feature-card:hover {
    background: #fbfcff;
    transform: translateY(-2px);
}

.feature-number {
    color: var(--blue);
    font-size: 0.8rem;
    font-weight: 800;
}

.feature-card strong,
.feature-card small {
    display: block;
}

.feature-card strong {
    margin-bottom: 0.4rem;
    font-size: 1.15rem;
}

.feature-card small {
    max-width: 240px;
    color: var(--muted);
    line-height: 1.45;
}

.list-card {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    height: 100%;
    padding: 1.15rem 1.25rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card);
    transition: border-color 140ms ease, transform 140ms ease;
}

.list-card:hover {
    border-color: #b7c5ee;
    transform: translateY(-2px);
}

.list-card strong {
    line-height: 1.35;
}

.list-card small,
.entity-card small,
.entity-row small,
.related-item small {
    color: var(--muted);
    font-size: 0.78rem;
}

.entity-card {
    display: flex;
    flex-direction: column;
    padding: 1.45rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: 0 12px 32px rgba(31, 43, 72, 0.04);
    transition: border-color 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.entity-card:hover {
    border-color: #b7c5ee;
    box-shadow: 0 16px 36px rgba(31, 43, 72, 0.08);
    transform: translateY(-3px);
}

.entity-card h2 {
    margin: 1rem 0 0.65rem;
    font-size: 1.45rem;
}

.entity-card p {
    flex: 1;
    color: var(--muted);
    line-height: 1.55;
}

.entity-symbol {
    display: grid;
    width: 2.3rem;
    height: 2.3rem;
    place-items: center;
    border-radius: 12px;
    color: var(--blue-dark);
    background: #e9eeff;
    font-weight: 800;
}

.entity-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-bottom: 0.9rem;
}

.entity-card-meta span,
.chip {
    display: inline-flex;
    align-items: center;
    padding: 0.3rem 0.55rem;
    border: 1px solid var(--line);
    border-radius: 999px;
    color: var(--muted);
    background: #fbfcff;
    font-size: 0.75rem;
    font-weight: 650;
}

.entity-panel,
.sidebar-card {
    padding: 1.35rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
}

.entity-row,
.related-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 0;
    border-bottom: 1px solid var(--line);
}

.entity-row:last-child,
.related-item:last-child {
    border-bottom: 0;
}

.entity-row span:first-child,
.related-item span:first-child {
    display: flex;
    min-width: 0;
    flex-direction: column;
    gap: 0.18rem;
}

.entity-row:hover,
.related-item:hover {
    color: var(--blue-dark);
}

.entity-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.chip:hover {
    border-color: #b7c5ee;
    color: var(--blue-dark);
}

.detail-header {
    max-width: 900px;
    margin-bottom: 3rem;
}

.detail-header h1 {
    max-width: 920px;
    margin-bottom: 0.8rem;
}

.detail-meta {
    margin-bottom: 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.content-section {
    margin-bottom: 3rem;
}

.content-section > p {
    color: #4f5d73;
    font-size: 1.05rem;
    line-height: 1.75;
}

.fact-list {
    display: grid;
    gap: 0.75rem;
    padding-left: 1.25rem;
    color: #4f5d73;
    line-height: 1.6;
}

.source-list {
    display: flex;
    flex-direction: column;
}

.source-item {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
}

.source-item:first-child {
    padding-top: 0;
}

.source-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.source-item p {
    margin: 0.55rem 0;
    color: var(--muted);
    font-size: 0.88rem;
    line-height: 1.45;
}

.sidebar-score {
    display: block;
    margin: 0.6rem 0;
    color: var(--blue-dark);
    font-size: 2.7rem;
    letter-spacing: -0.06em;
}

.sidebar-score small {
    color: var(--muted);
    font-size: 0.95rem;
    letter-spacing: 0;
}

.trend-score {
    color: var(--blue-dark);
    font-variant-numeric: tabular-nums;
}

.facts-list {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 0.8rem 1rem;
    margin-bottom: 0;
}

.facts-list dt {
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 650;
}

.facts-list dd {
    margin: 0;
    overflow-wrap: anywhere;
    text-align: right;
}

.filter-bar {
    display: flex;
    align-items: end;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1.15rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
}

.filter-bar > div {
    min-width: 190px;
}

.filter-bar .form-label {
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.timeline-list {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 0;
}

.timeline-list::before {
    position: absolute;
    top: 1rem;
    bottom: 1rem;
    left: 6.25rem;
    width: 1px;
    background: var(--line);
    content: "";
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 5rem 2.5rem minmax(0, 1fr);
    gap: 1rem;
    padding: 1.4rem 0;
}

.timeline-item time {
    padding-top: 0.15rem;
    color: var(--muted);
    font-size: 0.82rem;
    font-weight: 750;
    text-align: right;
}

.timeline-item time small {
    display: block;
    color: #9aa4b4;
    font-size: 0.7rem;
}

.timeline-marker {
    z-index: 1;
    width: 0.7rem;
    height: 0.7rem;
    margin: 0.3rem auto 0;
    border: 3px solid var(--paper);
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 0 0 1px var(--blue);
}

.timeline-content {
    padding: 1.2rem 1.35rem;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--card);
}

.timeline-content h2 {
    margin: 0 0 0.55rem;
    font-size: 1.3rem;
}

.timeline-content p {
    margin-bottom: 0.9rem;
    color: var(--muted);
    line-height: 1.55;
}

.site-footer {
    padding: 1.5rem 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 0.82rem;
}

.page-intro {
    max-width: 720px;
    margin-bottom: 3rem;
}

.page-intro p {
    color: var(--muted);
    font-size: 1.15rem;
    line-height: 1.6;
}

.search-panel {
    max-width: 860px;
    padding: 1.35rem;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--card);
    box-shadow: 0 12px 32px rgba(31, 43, 72, 0.04);
}

.search-result-description {
    display: -webkit-box;
    overflow: hidden;
    color: var(--muted);
    line-height: 1.5;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.empty-state {
    padding: clamp(2rem, 5vw, 4rem);
    text-align: center;
}

.empty-state.compact {
    max-width: 720px;
    margin: 0 auto;
}

.empty-state h2 {
    margin-top: 1rem;
}

.empty-state p {
    margin-bottom: 0;
    color: var(--muted);
}

.empty-icon {
    color: var(--blue);
    font-size: 2rem;
}

.auth-shell {
    display: grid;
    min-height: 60vh;
    place-items: center;
}

.auth-card {
    width: min(100%, 470px);
    padding: clamp(1.5rem, 5vw, 3rem);
}

.auth-card h1 {
    font-size: 2.5rem;
}

.form-control {
    border-color: var(--line);
    border-radius: 10px;
    padding: 0.75rem 0.9rem;
}

.form-control:focus {
    border-color: var(--blue);
    box-shadow: 0 0 0 0.2rem rgba(55, 102, 232, 0.14);
}

.metric-card {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
    padding: 1.25rem;
}

.metric-label,
.metric-card small {
    color: var(--muted);
    font-size: 0.8rem;
}

.metric-card strong {
    font-size: 2rem;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    align-self: flex-start;
    padding: 0.45rem 0.7rem;
    border: 1px solid #bfe6d0;
    border-radius: 999px;
    color: #247347;
    background: #effaf4;
    font-size: 0.8rem;
    font-weight: 700;
}

.status-pill-warning {
    border-color: #f0d48b;
    color: #8b6411;
    background: #fff9e8;
}

.status-pill-warning .status-dot {
    background: #d89b20;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #36aa69;
}

.admin-panel {
    padding: clamp(1.5rem, 4vw, 2.5rem);
}

.creative-slot {
    width: 100%;
    margin: 1.25rem 0 2.5rem;
    overflow: hidden;
    text-align: center;
}

.creative-slot img,
.creative-slot iframe,
.creative-slot video {
    max-width: 100%;
}

.creative-code-summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.8rem 1rem;
    border: 1px solid var(--line);
    border-radius: 12px;
    color: var(--muted);
    background: #fbfcff;
    font-size: 0.85rem;
}

.creative-code-summary strong {
    color: var(--ink);
}

.creative-code-editor {
    min-height: 16rem;
    resize: vertical;
    font-family: "Cascadia Code", "SFMono-Regular", Consolas, monospace;
    font-size: 0.82rem;
    line-height: 1.55;
    tab-size: 2;
}

.admin-panel h2 {
    margin: 0.4rem 0 1.5rem;
}

.checklist {
    display: grid;
    gap: 0.9rem;
}

.checklist > div {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 0.8rem;
    padding-bottom: 0.9rem;
    border-bottom: 1px solid var(--line);
}

.checklist > div:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.checkmark {
    display: grid;
    width: 24px;
    height: 24px;
    place-items: center;
    border-radius: 50%;
    color: #227548;
    background: var(--mint);
    font-weight: 800;
}

.checkmark.pending {
    color: #7a5b1e;
    background: var(--warm);
}

.check-status {
    color: #227548;
    font-size: 0.78rem;
    font-weight: 750;
}

.pending-text {
    color: #896a2d;
}

@media (max-width: 767.98px) {
    .feature-grid {
        grid-template-columns: 1fr;
    }

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

    .timeline-list::before {
        left: 3.35rem;
    }

    .timeline-item {
        grid-template-columns: 2.35rem 2rem minmax(0, 1fr);
        gap: 0.6rem;
    }

    .timeline-item time {
        font-size: 0.7rem;
    }

    .facts-list {
        grid-template-columns: 1fr;
        gap: 0.3rem;
    }

    .facts-list dd {
        margin-bottom: 0.45rem;
        text-align: left;
    }
}
