:root {
    --bg: #f5efe4;
    --paper: #fffdf8;
    --ink: #1d2a2f;
    --muted: #5f6d72;
    --line: #d8cdbb;
    --accent: #0f766e;
    --accent-dark: #115e59;
    --soft: #eaf4f1;
    --warn: #fff4dc;
    --danger: #fde7df;
    --success: #e6f5eb;
    --shadow: 0 18px 40px rgba(47, 55, 63, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Georgia, "Times New Roman", serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(15, 118, 110, 0.12), transparent 28%),
        linear-gradient(180deg, #fbf7ef 0%, var(--bg) 100%);
    line-height: 1.6;
}

a {
    color: var(--accent-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: min(1120px, calc(100% - 32px));
    margin: 0 auto;
}

.narrow {
    width: min(760px, calc(100% - 32px));
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    backdrop-filter: blur(18px);
    background: rgba(251, 247, 239, 0.82);
    border-bottom: 1px solid rgba(216, 205, 187, 0.8);
}

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

.brand {
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.site-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.hero,
.content-hero {
    padding: 48px 0 28px;
}

.hero-shell {
    display: flex;
    justify-content: center;
}

.hero-copy-block {
    width: min(760px, 100%);
}

.eyebrow {
    margin: 0 0 8px;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    font-size: 0.78rem;
    color: var(--accent-dark);
}

h1,
h2,
h3 {
    line-height: 1.15;
    margin-top: 0;
}

h1 {
    font-size: clamp(2.3rem, 5vw, 4.5rem);
    margin-bottom: 16px;
}

.hero-copy {
    font-size: 1.08rem;
    color: var(--muted);
    max-width: 62ch;
}

.panel,
.metric-card {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 22px;
    box-shadow: var(--shadow);
}

.panel {
    padding: 22px;
}

.hero-links {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 24px;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    padding: 12px 18px;
    font-weight: 700;
    transition: transform 0.18s ease, background 0.18s ease;
}

.button:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

.button-primary {
    color: #fff;
    background: var(--accent);
}

.button-secondary {
    background: transparent;
    border: 1px solid var(--line);
}

.app-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 24px;
    padding-bottom: 28px;
}

.results-column {
    display: grid;
    gap: 18px;
}

.field,
.field-row {
    display: grid;
    gap: 8px;
}

.sample-switcher {
    display: grid;
    gap: 10px;
    margin-bottom: 18px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: var(--soft);
}

.sample-switcher span {
    font-weight: 700;
}

.sample-switcher-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip-button {
    border: 1px solid var(--line);
    background: #fff;
    color: var(--ink);
    border-radius: 999px;
    padding: 10px 14px;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.chip-button:hover {
    background: #f7f3eb;
}

.field {
    margin-bottom: 16px;
}

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

label span,
.download-list h3,
.metric-card span {
    font-weight: 700;
}

input,
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
}

small {
    color: var(--muted);
}

.download-list {
    margin-top: 22px;
    display: grid;
    gap: 8px;
}

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

.metric-card {
    padding: 18px;
}

.metric-card strong {
    display: block;
    margin-top: 12px;
    font-size: 1.9rem;
}

.chart-panel .plotly-graph-div {
    width: 100%;
}

.two-col {
    display: grid;
    grid-template-columns: 1.3fr 1fr;
    gap: 18px;
}

.table-wrap {
    max-height: 320px;
    overflow: auto;
    border: 1px solid var(--line);
    border-radius: 16px;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 10px 14px;
    border-bottom: 1px solid var(--line);
    text-align: left;
}

.alert-error,
.error {
    background: var(--danger);
}

.warning {
    background: var(--warn);
}

.success {
    background: var(--success);
}

.empty-state {
    min-height: 220px;
    display: grid;
    align-content: center;
}

.seo-grid,
.content-stack {
    display: grid;
    gap: 18px;
    padding-bottom: 48px;
}

.site-footer {
    border-top: 1px solid var(--line);
    background: rgba(255, 253, 248, 0.75);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    padding: 28px 0 42px;
}

.support-strip {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    padding: 0 0 32px;
}

.support-copy {
    display: grid;
    gap: 6px;
}

.support-strip p {
    margin: 0;
}

.support-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: flex-end;
}

.support-link-fallback {
    font-size: 0.95rem;
}

@media (max-width: 960px) {
    .app-grid,
    .two-col,
    .footer-grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 640px) {
    .site-header {
        position: static;
    }

    .nav-shell,
    .site-nav,
    .field-row,
    .metrics-grid {
        grid-template-columns: 1fr;
    }

    .nav-shell,
    .site-nav {
        display: grid;
    }

    .support-strip {
        flex-direction: column;
        align-items: flex-start;
    }

    .support-actions {
        justify-content: flex-start;
    }

    h1 {
        font-size: 2.5rem;
    }
}
