:root {
    --bg: #f5efe1;
    --bg-wash: #dce9e4;
    --paper: rgba(255, 252, 246, 0.92);
    --paper-strong: #fffdf9;
    --ink: #183541;
    --muted: #5a6d76;
    --line: #cfd8d4;
    --line-strong: #aebcb7;
    --primary: #1d5a6b;
    --primary-strong: #123d4b;
    --accent: #c97729;
    --accent-soft: #f7e6d1;
    --alert: #9b3923;
    --alert-soft: #f5ddd6;
    --success: #2c735c;
    --success-soft: #dcefe5;
    --shadow: 0 24px 48px rgba(17, 39, 47, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    background:
        radial-gradient(circle at top left, rgba(22, 95, 116, 0.18), transparent 34%),
        radial-gradient(circle at top right, rgba(201, 119, 41, 0.15), transparent 24%),
        linear-gradient(180deg, #f6f1e5 0%, #edf2eb 48%, #f5efe1 100%);
}

body {
    margin: 0;
    min-height: 100vh;
    color: var(--ink);
    font-family: "Trebuchet MS", Verdana, Geneva, sans-serif;
    line-height: 1.65;
    background: transparent;
}

a {
    color: var(--primary-strong);
    text-decoration: none;
}

a:hover,
a:focus {
    color: var(--accent);
}

img {
    max-width: 100%;
    height: auto;
}

table {
    border-collapse: separate;
    border-spacing: 0;
}

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

.app-shell {
    width: min(1100px, calc(100% - 32px));
    margin: 0 auto;
    padding: 28px 0 56px;
}

.page-main {
    display: grid;
    gap: 24px;
    margin-top: 26px;
}

.page-hero {
    position: relative;
    overflow: hidden;
    padding: 32px;
    border-radius: 30px;
    color: #f9f7f1;
    background:
        radial-gradient(circle at top right, rgba(255, 255, 255, 0.18), transparent 24%),
        linear-gradient(140deg, #174d61 0%, #1a6770 48%, #547543 100%);
    box-shadow: var(--shadow);
}

.page-hero::after {
    content: "";
    position: absolute;
    right: -32px;
    bottom: -46px;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
}

.page-kicker,
.section-kicker {
    margin: 0 0 10px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.78rem;
    font-weight: 700;
}

.page-title,
.section-title,
.home-title,
.card-title {
    margin: 0;
    color: inherit;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
    line-height: 1.08;
}

.page-title {
    font-size: clamp(2.2rem, 4vw, 4rem);
}

.page-lede,
.section-text,
.hero-note,
.prose {
    color: inherit;
    max-width: 68ch;
}

.page-lede {
    margin: 16px 0 0;
    font-size: 1.04rem;
    color: rgba(249, 247, 241, 0.9);
}

.hero-stats {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 22px 0 0;
}

.hero-stat {
    display: inline-flex;
    flex-direction: column;
    min-width: 120px;
    padding: 12px 14px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.08);
}

.hero-stat strong {
    font-size: 1.1rem;
}

.hero-stat span {
    font-size: 0.85rem;
    color: rgba(249, 247, 241, 0.75);
}

.tool-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.tool-nav a {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.1);
    color: #fdfcf8;
    font-size: 0.94rem;
    transition: transform 0.18s ease, background 0.18s ease, color 0.18s ease;
}

.tool-nav a:hover,
.tool-nav a:focus {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
}

.tool-nav a.is-active {
    background: #fdfbf6;
    color: var(--primary-strong);
    border-color: rgba(255, 255, 255, 0.36);
}

.split-layout,
.split-layout--wide {
    display: grid;
    gap: 24px;
    align-items: start;
}

.split-layout {
    grid-template-columns: minmax(0, 1.8fr) minmax(260px, 1fr);
}

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

.card,
.tool-card,
.faq-card,
.footer-card,
.stat-card {
    background: var(--paper);
    border: 1px solid rgba(174, 188, 183, 0.55);
    border-radius: 24px;
    box-shadow: var(--shadow);
}

.card,
.faq-card,
.footer-card,
.stat-card {
    padding: 24px;
}

.card--muted {
    background: rgba(244, 239, 225, 0.8);
}

.card--accent {
    background: linear-gradient(180deg, rgba(247, 230, 209, 0.95), rgba(255, 252, 246, 0.94));
}

.card--success {
    background: linear-gradient(180deg, rgba(220, 239, 229, 0.95), rgba(255, 252, 246, 0.94));
}

.card p:first-child,
.card h2:first-child,
.card h3:first-child,
.faq-card h3:first-child {
    margin-top: 0;
}

.section-title,
.card-title {
    font-size: clamp(1.45rem, 2vw, 2rem);
    color: var(--primary-strong);
}

.eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.84rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.muted,
.section-text,
.prose,
.meta-text,
.helper-text {
    color: var(--muted);
}

.prose p,
.prose li {
    margin: 0 0 12px;
}

.home-grid,
.tool-grid,
.faq-grid,
.stats-grid {
    display: grid;
    gap: 18px;
}

.tool-grid {
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.faq-grid,
.stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.tool-card {
    display: grid;
    gap: 14px;
    padding: 22px;
}

.tool-card h3 {
    margin: 0;
    font-size: 1.35rem;
    color: var(--primary-strong);
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

.tool-card p {
    margin: 0;
    color: var(--muted);
}

.tool-card .meta-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 10px;
    border-radius: 999px;
    background: rgba(29, 90, 107, 0.1);
    color: var(--primary-strong);
    font-size: 0.84rem;
    font-weight: 700;
}

.stack-form {
    display: grid;
    gap: 16px;
}

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

.field-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.field-row--stretch > * {
    flex: 1 1 180px;
}

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

.field-label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-strong);
}

.text-input,
.select-input,
textarea {
    width: 100%;
    padding: 13px 15px;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: var(--paper-strong);
    color: var(--ink);
    font: inherit;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

textarea {
    min-height: 220px;
    resize: vertical;
}

.text-input:focus,
.select-input:focus,
textarea:focus {
    outline: none;
    border-color: rgba(29, 90, 107, 0.45);
    box-shadow: 0 0 0 4px rgba(29, 90, 107, 0.11);
}

.button,
input[type="submit"],
button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 46px;
    padding: 0 18px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, #1a5b69 0%, #2f745a 100%);
    color: #fff;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 12px 22px rgba(26, 91, 105, 0.22);
}

.button:hover,
input[type="submit"]:hover,
button:hover,
.button:focus,
input[type="submit"]:focus,
button:focus {
    transform: translateY(-1px);
}

.button--secondary {
    background: linear-gradient(135deg, #cb7f2e 0%, #a05e20 100%);
    box-shadow: 0 12px 22px rgba(160, 94, 32, 0.2);
}

.button--ghost {
    background: rgba(18, 61, 75, 0.08);
    color: var(--primary-strong);
    box-shadow: none;
    border: 1px solid rgba(18, 61, 75, 0.12);
}

.button--small {
    min-height: 36px;
    padding: 0 12px;
    font-size: 0.9rem;
}

.button-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-strong);
    font-weight: 700;
}

.button-link:hover,
.button-link:focus {
    color: var(--accent);
}

.notice {
    padding: 16px 18px;
    border-radius: 18px;
    border: 1px solid rgba(201, 119, 41, 0.18);
    background: var(--accent-soft);
    color: #6f4317;
}

.notice--error {
    border-color: rgba(155, 57, 35, 0.22);
    background: var(--alert-soft);
    color: var(--alert);
}

.notice--success {
    border-color: rgba(44, 115, 92, 0.2);
    background: var(--success-soft);
    color: var(--success);
}

.metrics-row {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.metric {
    display: inline-flex;
    flex-direction: column;
    gap: 2px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(29, 90, 107, 0.08);
    color: var(--primary-strong);
}

.metric strong {
    font-size: 1.35rem;
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
}

.metric span {
    font-size: 0.86rem;
    color: var(--muted);
}

.table-wrap {
    overflow-x: auto;
    border: 1px solid rgba(174, 188, 183, 0.55);
    border-radius: 22px;
    background: var(--paper-strong);
}

.results-table,
.data-table {
    width: 100%;
    min-width: 620px;
}

.results-table th,
.results-table td,
.data-table th,
.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid rgba(174, 188, 183, 0.4);
    vertical-align: top;
}

.results-table thead th,
.data-table thead th {
    background: linear-gradient(135deg, #1a5566 0%, #244758 100%);
    color: #fff;
    text-align: left;
    font-size: 0.9rem;
    letter-spacing: 0.03em;
}

.results-table tbody tr:nth-child(even),
.data-table tbody tr:nth-child(even) {
    background: rgba(232, 239, 234, 0.55);
}

.results-table tbody tr:last-child td,
.data-table tbody tr:last-child td {
    border-bottom: 0;
}

.results-table .actions-cell,
.results-table .search-cell {
    white-space: nowrap;
}

.inline-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.icon-links {
    display: flex;
    gap: 10px;
    align-items: center;
}

.icon-links a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: rgba(29, 90, 107, 0.08);
    border: 1px solid rgba(29, 90, 107, 0.12);
}

.icon-links img {
    max-width: 22px;
    max-height: 22px;
}

.recent-links,
.pill-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.recent-links a,
.pill-links a {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 12px;
    border-radius: 999px;
    background: rgba(29, 90, 107, 0.08);
    color: var(--primary-strong);
    font-size: 0.92rem;
}

.helper-list,
.bullet-list,
.faq-list {
    margin: 0;
    padding-left: 18px;
    color: var(--muted);
}

.helper-text {
    margin: 0;
    font-size: 0.92rem;
}

.helper-list li,
.bullet-list li,
.faq-list li {
    margin-bottom: 10px;
}

.radio-row,
.checkbox-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 14px;
    align-items: center;
}

.choice {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 14px;
    background: rgba(29, 90, 107, 0.06);
}

.choice input {
    margin: 0;
}

.tagger-output {
    padding: 20px;
    border-radius: 20px;
    border: 1px solid rgba(201, 119, 41, 0.28);
    background: #fef7e4;
    font-family: "Courier New", Courier, monospace;
    line-height: 1.8;
    color: #5d4a17;
}

.gene-tag {
    color: #86712a;
    font-weight: 700;
}

.gene-attribute {
    color: #6b5a22;
}

.gene-token {
    color: #c56d1f;
    font-weight: 700;
}

.gene-link {
    color: #205b80;
    text-decoration: underline;
}

.taxonomy-list,
.lineage-list {
    display: grid;
    gap: 12px;
}

.lineage-step {
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(29, 90, 107, 0.08);
    border: 1px solid rgba(29, 90, 107, 0.1);
}

.footer-card {
    display: grid;
    gap: 16px;
}

.site-footer {
    display: grid;
    gap: 18px;
}

.footer-search-form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}

.footer-search-form .text-input {
    flex: 1 1 240px;
}

.footer-meta {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 10px;
    padding: 0 6px;
    color: var(--muted);
    font-size: 0.94rem;
}

.footer-brand {
    font-family: "Palatino Linotype", "Book Antiqua", Palatino, Georgia, serif;
    font-weight: 700;
}

.mono {
    font-family: "Courier New", Courier, monospace;
}

.empty-state {
    display: grid;
    gap: 14px;
    justify-items: start;
}

@media (max-width: 900px) {
    .split-layout,
    .split-layout--wide,
    .field-grid,
    .faq-grid,
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .page-hero {
        padding: 26px 22px;
    }

    .app-shell {
        width: min(100% - 20px, 1100px);
        padding-top: 18px;
    }
}

@media (max-width: 640px) {
    .page-title {
        font-size: 2.2rem;
    }

    .card,
    .faq-card,
    .footer-card,
    .tool-card,
    .stat-card {
        padding: 20px;
        border-radius: 20px;
    }

    .field-row,
    .footer-search-form,
    .inline-actions {
        align-items: stretch;
    }

    .button,
    input[type="submit"],
    button {
        width: 100%;
    }

    .tool-nav a {
        width: 100%;
        justify-content: center;
    }

    .hero-stats {
        flex-direction: column;
    }
}
