:root {
    --bg: #f3eee2;
    --paper: rgba(252, 249, 241, 0.95);
    --paper-strong: #fffdf8;
    --ink: #293228;
    --muted: #6e7668;
    --line: rgba(77, 86, 67, 0.16);
    --accent: #a44f2f;
    --accent-strong: #8d4123;
    --accent-soft: #eed8c7;
    --olive: #4a5a45;
    --olive-soft: #dce5d5;
    --sage: #edf2e8;
    --shadow: 0 26px 72px rgba(56, 49, 37, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    color: var(--ink);
    font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background:
        radial-gradient(circle at top left, rgba(175, 93, 50, 0.10), transparent 32%),
        radial-gradient(circle at top right, rgba(86, 114, 79, 0.12), transparent 36%),
        linear-gradient(180deg, #f8f4eb 0%, #efe8d9 100%);
}

h1, h2, h3,
.hero__title,
.detail-page h1 {
    font-family: "Fraunces", Georgia, "Times New Roman", serif;
    letter-spacing: -0.01em;
}

a {
    color: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.page-shell {
    min-height: 100vh;
    position: relative;
}

.page-shell--home {
    overflow-x: clip;
}

.page-noise {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image:
        linear-gradient(rgba(78, 86, 72, 0.045) 1px, transparent 1px),
        linear-gradient(90deg, rgba(78, 86, 72, 0.045) 1px, transparent 1px);
    background-size: 40px 40px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.54), transparent 88%);
}

.container {
    width: min(1540px, calc(100% - 28px));
    margin: 0 auto;
    padding: 24px 0 44px;
    position: relative;
    z-index: 1;
}

.container--home {
    width: min(100%, calc(100% - 18px));
    padding-top: 14px;
}

.container--wide {
    width: min(100%, calc(100% - 16px));
}

.hero-card,
.control-panel,
.strain-card,
.compound-summary,
.content-card,
.top-navbar__inner {
    background: var(--paper);
    border: 1px solid var(--line);
    border-radius: 30px;
    box-shadow: var(--shadow);
    backdrop-filter: blur(14px);
}

.hero-card,
.control-panel,
.strain-card,
.compound-summary,
.content-card {
    padding: 28px;
}

.hero-card--atlas {
    display: grid;
    grid-template-columns: minmax(0, 1.4fr) minmax(320px, 0.8fr);
    gap: 28px;
    margin-bottom: 20px;
}

.hero-card--showcase {
    min-height: calc(100vh - 28px);
    padding: 42px;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    background:
        radial-gradient(circle at top right, rgba(164, 79, 47, 0.12), transparent 26%),
        radial-gradient(circle at 20% 80%, rgba(124, 155, 106, 0.16), transparent 26%),
        radial-gradient(circle at bottom left, rgba(74, 90, 69, 0.12), transparent 24%),
        var(--paper);
}

.hero-showcase {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(360px, 0.75fr);
    gap: 30px;
    align-items: stretch;
    width: 100%;
}

.hero-showcase__copy {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.hero-showcase__panel {
    padding: 24px;
    border-radius: 30px;
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.74), rgba(247, 240, 229, 0.92));
    border: 1px solid var(--line);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.hero-panel-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 16px;
}

.hero-panel-grid article {
    padding: 22px 16px;
    border-radius: 18px;
    background: #fffdf8;
    border: 1px solid var(--line);
}

.hero-panel-grid strong {
    display: block;
    color: var(--accent);
    font-size: 1.9rem;
    margin-bottom: 6px;
}

.hero-note {
    display: grid;
    gap: 10px;
    color: var(--muted);
    line-height: 1.6;
    font-size: 0.98rem;
}

.hero-card__stats {
    display: flex;
    align-items: stretch;
    flex-direction: column;
    gap: 18px;
}

.hero-ribbon {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 18px;
}

.hero-ribbon span {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(74, 90, 69, 0.08);
    border: 1px solid var(--line);
    color: var(--olive);
}

.hero-legend {
    padding: 16px 18px;
    border-radius: 22px;
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.82), rgba(243, 237, 224, 0.92));
    border: 1px solid var(--line);
}

.hero-legend__row {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--muted);
}

.hero-legend__row + .hero-legend__row {
    margin-top: 10px;
}

.legend-dot {
    width: 11px;
    height: 11px;
    border-radius: 999px;
}

.legend-dot--sage {
    background: #7c9b6a;
}

.legend-dot--rust {
    background: #c3653e;
}

.eyebrow,
.doc-meta {
    margin: 0 0 12px;
    color: var(--muted);
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

h1,
h2,
p {
    margin-top: 0;
}

h1 {
    font-size: clamp(2.8rem, 5vw, 5.2rem);
    line-height: 0.97;
    margin-bottom: 16px;
    max-width: 12ch;
}

h2 {
    font-size: clamp(1.55rem, 2vw, 2.15rem);
    line-height: 1.08;
    margin-bottom: 8px;
}

.hero-copy,
.detail-lead {
    max-width: 72ch;
    font-size: 1.05rem;
    line-height: 1.75;
    color: #41503f;
}

.stats {
    display: grid;
    gap: 16px;
    width: 100%;
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.stats article {
    padding: 18px;
    background: linear-gradient(180deg, #fffdf8 0%, #f4efe5 100%);
    border-radius: 20px;
    border: 1px solid var(--line);
}

.stats strong {
    display: block;
    color: var(--accent);
    font-size: 2rem;
    margin-bottom: 6px;
}

.control-panel {
    margin-bottom: 20px;
    background:
        radial-gradient(circle at top right, rgba(164, 79, 47, 0.06), transparent 28%),
        var(--paper);
}

.control-panel--catalog {
    position: relative;
    z-index: 2;
    width: min(1280px, calc(100% - 56px));
    margin: -110px auto 0;
    padding: 24px 26px;
}

.control-panel__heading {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    margin-bottom: 18px;
}

.control-panel__hint {
    max-width: 36ch;
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.6;
}

.search-form {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(220px, 0.7fr) auto;
    gap: 16px;
    align-items: end;
}

.search-form--compact {
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.95fr) auto;
}

.search-field {
    display: grid;
    gap: 8px;
    align-content: start;
}

.search-field span {
    font-size: 0.92rem;
    color: var(--olive);
    font-weight: 700;
}

.search-field input {
    width: 100%;
    height: 60px;
    padding: 0 20px;
    border-radius: 20px;
    border: 1px solid var(--line);
    background: #fffdf8;
    color: var(--ink);
    font: inherit;
    outline: none;
}

.search-field input:focus {
    border-color: rgba(164, 79, 47, 0.45);
    box-shadow: 0 0 0 4px rgba(164, 79, 47, 0.08);
}

.search-actions {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-self: start;
    padding-top: 30px;
}

.search-actions--compact {
    padding-top: 0;
}

.search-actions--home {
    justify-content: flex-end;
    align-items: center;
    min-width: 220px;
}

.search-live-badge {
    display: inline-flex;
    align-items: center;
    min-height: 44px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(74, 90, 69, 0.08);
    border: 1px solid var(--line);
    color: var(--olive);
    white-space: nowrap;
}

.action-button,
.secondary-button,
.back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 54px;
    padding: 0 20px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid transparent;
    font: inherit;
    cursor: pointer;
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease, background-color 180ms ease;
}

.action-button,
.back-link {
    background: var(--accent);
    color: #fffaf4;
    box-shadow: 0 14px 28px rgba(164, 79, 47, 0.18);
}

.secondary-button {
    background: rgba(74, 90, 69, 0.08);
    color: var(--olive);
    border-color: var(--line);
}

.action-button:hover,
.secondary-button:hover,
.back-link:hover,
.compound-tile:hover,
.related-links a:hover {
    transform: translateY(-2px);
}

.results-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
    margin-bottom: 18px;
}

.mini-search-card {
    padding: 12px;
    border-radius: 18px;
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(244, 237, 225, 0.95));
    border: 1px solid var(--line);
    min-height: 176px;
}

.mini-search-card__head {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 10px;
}

.mini-search-card__head strong {
    color: var(--olive);
    font-size: 0.96rem;
}

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

.mini-search-list {
    display: grid;
    gap: 8px;
}

.mini-search-list a {
    display: grid;
    gap: 3px;
    text-decoration: none;
    padding: 10px 12px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(77, 86, 67, 0.1);
}

.mini-search-list a span {
    color: var(--ink);
    font-size: 0.94rem;
}

.mini-search-list a small,
.mini-search-empty {
    color: var(--muted);
}

.results-summary__pill,
.results-summary__query {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(74, 90, 69, 0.08);
    border: 1px solid var(--line);
    color: var(--olive);
}

.results-summary__pill strong {
    color: var(--accent);
}

.results-summary__query code {
    padding: 4px 10px;
    border-radius: 999px;
    background: #fffdf8;
}

.results-summary--clean {
    margin-bottom: 18px;
    padding-top: 8px;
}

.home-shell {
    padding-top: 8px;
}

.strain-stack {
    display: grid;
    gap: 18px;
}

#catalog-results {
    width: min(1280px, calc(100% - 56px));
    margin: 0 auto;
}

.strain-card__header,
.section-heading,
.spectrum-workspace,
.compound-summary__layout {
    display: flex;
    gap: 18px;
}

.strain-card__header,
.section-heading {
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 18px;
}

.strain-card--empty {
    text-align: center;
}

.strain-card--catalog {
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.92), rgba(245, 239, 227, 0.95));
}

.strain-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    border-radius: 999px;
    background: var(--olive-soft);
    color: var(--olive);
    font-size: 0.92rem;
    white-space: nowrap;
}

.compound-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 18px;
}

.compound-tile {
    position: relative;
    overflow: hidden;
    text-decoration: none;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 20px;
    background:
        linear-gradient(180deg, #fffdf8 0%, #f5efe3 100%);
    transition: transform 180ms ease, border-color 180ms ease, box-shadow 180ms ease;
}

.compound-tile__glow {
    position: absolute;
    inset: auto -20px -55px auto;
    width: 140px;
    height: 140px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(196, 101, 62, 0.18), transparent 70%);
    pointer-events: none;
}

.compound-tile--rich {
    display: grid;
    gap: 14px;
}

.compound-tile__top,
.compound-tile__meta,
.compound-tile__footer {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: baseline;
}

.compound-tile__top {
    flex-direction: column;
}

.compound-tile strong {
    font-size: 1.08rem;
}

.compound-tile__formula,
.compound-tile__meta span,
.compound-tile__footer span {
    color: var(--muted);
}

.compound-tile__formula {
    font-size: 1rem;
    color: var(--accent-strong);
}

.compound-tile__formula sub {
    font-size: 0.75em;
    line-height: 0;
}

.compound-tile__reference {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
}

.compound-tile__footer {
    padding-top: 10px;
    border-top: 1px solid var(--line);
}

.compound-tile__link {
    color: var(--accent);
    font-weight: 700;
}

.top-navbar {
    position: sticky;
    top: 0;
    z-index: 10;
    padding: 12px 8px 0;
}

.top-navbar__inner {
    width: min(100%, calc(100% - 12px));
    margin: 0 auto;
    padding: 14px 20px;
}

.top-navbar__inner--wide {
    width: min(100%, calc(100% - 8px));
}

.top-navbar__brand,
.top-navbar__title-wrap {
    display: flex;
    gap: 18px;
    align-items: center;
}

.top-navbar__title-wrap {
    flex-direction: column;
    align-items: flex-start;
    gap: 4px;
}

.top-navbar__title-wrap strong {
    font-size: 1.08rem;
}

.detail-page {
    display: grid;
    gap: 18px;
}

.compound-summary--expanded,
.content-card {
    width: 100%;
}

.compound-summary__title {
    margin-bottom: 18px;
}

.compound-summary__layout--wide {
    align-items: stretch;
}

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

.detail-metric,
.summary-card,
.summary-sidecard {
    border: 1px solid var(--line);
    background: linear-gradient(180deg, rgba(255, 253, 248, 0.94), rgba(243, 236, 223, 0.94));
}

.detail-metric {
    padding: 16px 18px;
    border-radius: 20px;
}

.detail-metric span {
    display: block;
    color: var(--muted);
    font-size: 0.88rem;
    margin-bottom: 8px;
}

.detail-metric strong {
    color: var(--accent-strong);
    font-size: 1.1rem;
}

.detail-metric strong sub {
    font-size: 0.72em;
    line-height: 0;
}

.detail-metric__link {
    display: inline-flex;
    margin-top: 10px;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 3px;
    word-break: break-all;
}

.structure-panel {
    width: min(360px, 100%);
    padding: 20px;
    border-radius: 24px;
    border: 1px solid var(--line);
    background: linear-gradient(180deg, #fffdfa 0%, #f1ecdf 100%);
    display: flex;
    align-items: center;
    justify-content: center;
}

.structure-panel--wide {
    width: min(400px, 100%);
}

.structure-panel img {
    max-height: 360px;
    object-fit: contain;
}

.structure-empty,
.empty-state {
    width: 100%;
    padding: 28px;
    border-radius: 18px;
    background: rgba(74, 90, 69, 0.06);
    color: var(--muted);
    text-align: center;
    line-height: 1.7;
}

.summary-table-wrap,
.table-wrap {
    overflow-x: auto;
    width: 100%;
}

.summary-cluster {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.9fr);
    gap: 16px;
    width: 100%;
}

.summary-card {
    border-radius: 24px;
    padding: 10px 14px;
}

.summary-sidecards {
    display: grid;
    gap: 16px;
}

.summary-sidecard {
    padding: 18px;
    border-radius: 24px;
}

.spectrum-image-card {
    padding: 18px;
    border-radius: 28px;
    background: linear-gradient(180deg, #fffdf8 0%, #f3ecde 100%);
    border: 1px solid var(--line);
}

.spectrum-image-card img {
    width: 100%;
    border-radius: 20px;
    object-fit: contain;
    background: #fff;
}

.cms-shell {
    background:
        radial-gradient(circle at top left, rgba(164, 79, 47, 0.14), transparent 24%),
        radial-gradient(circle at bottom right, rgba(74, 90, 69, 0.16), transparent 28%),
        linear-gradient(180deg, #f7f1e5 0%, #efe6d8 100%);
}

.cms-layout {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 18px;
    padding: 14px;
}

.cms-sidebar,
.cms-page-head,
.cms-section-card,
.cms-auth-card {
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: var(--shadow);
}

.cms-sidebar {
    border-radius: 28px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.cms-brand {
    display: grid;
    gap: 4px;
}

.cms-nav {
    display: grid;
    gap: 10px;
}

.cms-nav a {
    text-decoration: none;
    padding: 12px 14px;
    border-radius: 16px;
    background: #fffdf8;
    border: 1px solid var(--line);
}

.cms-main {
    padding: 4px 0 24px;
    display: grid;
    gap: 18px;
}

.cms-page-head,
.cms-section-card {
    border-radius: 28px;
    padding: 22px;
}

.cms-page-head {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: center;
}

.cms-head-stats {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cms-head-stats span,
.cms-message {
    padding: 10px 14px;
    border-radius: 999px;
    background: rgba(74, 90, 69, 0.08);
    border: 1px solid var(--line);
}

.cms-field-list,
.cms-table {
    display: grid;
    gap: 12px;
}

.cms-field-row,
.cms-table__row {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    align-items: flex-start;
    padding: 16px 18px;
    border-radius: 18px;
    background: #fffdf8;
    border: 1px solid var(--line);
}

.cms-field-row strong,
.cms-table__row strong {
    display: block;
    margin-bottom: 6px;
}

.cms-field-row p,
.cms-table__row p {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.cms-field-row--edit form,
.cms-field-row--edit div {
    width: 100%;
}

.cms-inline-actions,
.cms-table__actions,
.cms-form-actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.cms-edit-form {
    display: grid;
    gap: 14px;
}

.cms-edit-form p {
    margin: 0;
    display: grid;
    gap: 8px;
}

.cms-edit-form label {
    color: var(--olive);
    font-weight: 700;
}

.cms-input,
.cms-field-row input,
.cms-field-row textarea,
.cms-field-row select,
.cms-auth-form input,
.cms-edit-form input,
.cms-edit-form textarea,
.cms-edit-form select {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fff;
    font: inherit;
}

.cms-auth-form textarea,
.cms-edit-form textarea,
.cms-field-row textarea {
    min-height: 120px;
}

.cms-login {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
}

.cms-auth-card {
    width: min(480px, 100%);
    border-radius: 28px;
    padding: 28px;
}

.cms-auth-form {
    display: grid;
    gap: 14px;
}

.cms-auth-form label {
    display: grid;
    gap: 8px;
}

.cms-logout {
    width: 100%;
}

.cms-messages {
    display: grid;
    gap: 10px;
}

.summary-table,
.peak-table {
    width: 100%;
    border-collapse: collapse;
}

.summary-table th,
.summary-table td,
.peak-table th,
.peak-table td {
    padding: 14px 16px;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--line);
}

.summary-table th,
.peak-table th {
    width: 220px;
    color: var(--olive);
    font-weight: 700;
}

.chip-row,
.links-list,
.related-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.fragment-chip {
    display: inline-flex;
    align-items: center;
    padding: 8px 12px;
    border-radius: 999px;
    background: var(--accent-soft);
    color: var(--accent-strong);
    font-size: 0.92rem;
}

.links-list a {
    word-break: break-all;
    color: var(--accent);
}

.section-heading--center {
    align-items: center;
}

.spectrum-layout {
    padding-bottom: 20px;
}

.spectrum-workspace {
    align-items: stretch;
    margin-bottom: 18px;
}

.spectrum-card {
    flex: 1 1 auto;
    min-width: 0;
    padding: 18px;
    border-radius: 28px;
    background: linear-gradient(180deg, #faf6ed 0%, #f5efdf 100%);
    border: 1px solid rgba(120, 109, 92, 0.18);
}

.spectrum-card--wide {
    min-height: 540px;
}

.peak-focus {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 14px 16px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.55);
    border: 1px solid rgba(120, 109, 92, 0.18);
    margin-bottom: 14px;
}

.peak-focus strong {
    font-size: 1rem;
}

.peak-focus span {
    color: var(--muted);
    text-align: right;
}

.spectrum-chart {
    width: 100%;
    height: auto;
    display: block;
}

.peak-sidebar {
    width: 320px;
    display: grid;
    gap: 16px;
}

.peak-sidebar__card {
    padding: 18px;
    border-radius: 24px;
    background: linear-gradient(180deg, #fffdf8 0%, #f3ecdf 100%);
    border: 1px solid var(--line);
}

.peak-detail-panel {
    display: grid;
    gap: 12px;
}

.peak-detail-panel div {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line);
}

.peak-detail-panel span {
    color: var(--muted);
}

.peak-detail-panel strong {
    color: var(--accent);
}

.related-links a,
.related-links__active {
    display: inline-flex;
    align-items: center;
    padding: 10px 14px;
    border-radius: 999px;
    text-decoration: none;
    border: 1px solid var(--line);
    background: #fffdf8;
}

.related-links__active {
    background: var(--accent);
    color: #fffaf4;
    border-color: transparent;
}

.peak-table tbody tr {
    cursor: pointer;
    transition: background-color 150ms ease;
}

.peak-table tbody tr:nth-child(odd) {
    background: rgba(74, 90, 69, 0.04);
}

.peak-table tbody tr:hover,
.peak-table tbody tr.is-selected {
    background: rgba(164, 79, 47, 0.12);
}

.peak-stem,
.peak-cap {
    transition: stroke 150ms ease, fill 150ms ease, r 150ms ease, stroke-width 150ms ease;
}

.peak-stem.is-selected {
    stroke: #d76e35;
    stroke-width: 5;
}

.peak-cap.is-selected {
    fill: #d76e35;
    r: 7;
}

@media (max-width: 1200px) {
    .hero-card--atlas,
    .hero-showcase,
    .search-form,
    .compound-summary__layout,
    .spectrum-workspace {
        grid-template-columns: 1fr;
        flex-direction: column;
    }

    .hero-card--showcase {
        min-height: auto;
    }

    .control-panel--catalog,
    #catalog-results {
        width: min(100%, calc(100% - 20px));
    }

    .peak-sidebar,
    .structure-panel,
    .structure-panel--wide {
        width: 100%;
    }

    .detail-metrics,
    .summary-cluster {
        grid-template-columns: 1fr 1fr;
    }

    .cms-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 760px) {
    .container,
    .container--wide {
        width: min(100%, calc(100% - 14px));
        padding-top: 16px;
    }

    .container--home {
        width: min(100%, calc(100% - 10px));
        padding-top: 10px;
    }

    .hero-card,
    .control-panel,
    .strain-card,
    .compound-summary,
    .content-card {
        padding: 18px;
        border-radius: 24px;
    }

    .top-navbar {
        padding: 8px 6px 0;
    }

    .top-navbar__inner {
        width: min(100%, calc(100% - 8px));
        padding: 12px 14px;
        border-radius: 22px;
    }

    .top-navbar__brand,
    .strain-card__header,
    .section-heading,
    .control-panel__heading,
    .peak-focus {
        flex-direction: column;
        align-items: flex-start;
    }

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

    .search-form {
        display: grid;
        grid-template-columns: 1fr;
    }

    .control-panel--catalog {
        width: 100%;
        margin-top: -40px;
        padding: 18px;
    }

    #catalog-results {
        width: 100%;
    }

    .search-actions {
        padding-top: 0;
    }

    h1 {
        font-size: 2.35rem;
    }

    .summary-table th,
    .peak-table th {
        width: 150px;
    }

    .detail-metrics,
    .summary-cluster {
        grid-template-columns: 1fr;
    }

    .hero-panel-grid,
    .cms-page-head,
    .cms-field-row,
    .cms-table__row {
        grid-template-columns: 1fr;
        flex-direction: column;
        align-items: flex-start;
    }

    .search-actions--home {
        width: 100%;
        justify-content: space-between;
    }
}

/* ===========================================================
   Home page — refreshed, professional layout
   =========================================================== */

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    padding: 14px 16px 0;
}

.site-header__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 14px 22px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    background: rgba(252, 249, 241, 0.85);
    backdrop-filter: blur(18px);
    border: 1px solid var(--line);
    border-radius: 999px;
    box-shadow: 0 14px 40px rgba(56, 49, 37, 0.08);
}

.site-header__brand {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    color: var(--ink);
    font-weight: 600;
}

.site-header__mark {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, #c8754f 100%);
    color: #fffaf4;
    font-family: "Fraunces", Georgia, serif;
    font-weight: 700;
    letter-spacing: 0.02em;
    box-shadow: 0 8px 18px rgba(164, 79, 47, 0.28);
}

.site-header__title {
    font-size: 1.02rem;
    letter-spacing: 0.01em;
}

.site-header__nav {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.site-header__nav a {
    text-decoration: none;
    color: var(--muted);
    font-size: 0.94rem;
    padding: 8px 14px;
    border-radius: 999px;
    transition: color 160ms ease, background-color 160ms ease;
}

.site-header__nav a:hover {
    color: var(--ink);
    background: rgba(74, 90, 69, 0.08);
}

.home-shell {
    max-width: 1320px;
    margin: 0 auto;
    padding: 28px 16px 80px;
    display: grid;
    gap: 32px;
}

.hero {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.95fr);
    gap: 36px;
    align-items: stretch;
    padding: 56px clamp(28px, 4vw, 60px);
    border-radius: 36px;
    background:
        radial-gradient(120% 120% at 100% 0%, rgba(164, 79, 47, 0.10), transparent 55%),
        radial-gradient(110% 110% at 0% 100%, rgba(74, 90, 69, 0.10), transparent 55%),
        linear-gradient(180deg, #fffdf8 0%, #f7f1e3 100%);
    border: 1px solid var(--line);
    box-shadow: 0 30px 70px rgba(56, 49, 37, 0.10);
    overflow: hidden;
    position: relative;
}

.hero::before {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background:
        radial-gradient(circle at 85% 15%, rgba(164, 79, 47, 0.08), transparent 40%);
}

.hero__copy {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 22px;
    max-width: 56ch;
}

.hero__copy .eyebrow {
    margin: 0;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.78rem;
    letter-spacing: 0.18em;
}

.hero__title {
    margin: 0;
    font-size: clamp(2.4rem, 4.6vw, 4rem);
    line-height: 1.04;
    color: var(--ink);
    max-width: 18ch;
}

.hero__lead {
    margin: 0;
    font-size: 1.08rem;
    line-height: 1.7;
    color: #44503f;
    max-width: 56ch;
}

.hero__cta {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 8px;
}

.action-button,
.ghost-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 22px;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: 1px solid transparent;
    transition: transform 160ms ease, box-shadow 180ms ease, background-color 180ms ease, border-color 180ms ease, color 180ms ease;
}

.action-button {
    background: linear-gradient(135deg, var(--accent) 0%, #b75a35 100%);
    color: #fffaf4;
    box-shadow: 0 14px 28px rgba(164, 79, 47, 0.22);
}

.action-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 34px rgba(164, 79, 47, 0.28);
}

.ghost-button {
    background: transparent;
    color: var(--ink);
    border-color: var(--line);
}

.ghost-button:hover {
    background: rgba(74, 90, 69, 0.06);
    border-color: rgba(74, 90, 69, 0.28);
}

.hero__panel {
    position: relative;
    padding: 28px;
    border-radius: 28px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96) 0%, rgba(247, 240, 226, 0.96) 100%);
    border: 1px solid var(--line);
    box-shadow: 0 20px 44px rgba(56, 49, 37, 0.08), inset 0 1px 0 rgba(255, 255, 255, 0.6);
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-self: center;
}

.metric-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.metric {
    padding: 18px 14px;
    border-radius: 18px;
    background: #fffdf8;
    border: 1px solid var(--line);
    text-align: left;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.metric__value {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--accent);
    line-height: 1;
}

.metric__label {
    color: var(--muted);
    font-size: 0.84rem;
    letter-spacing: 0.02em;
}

.hero__legend {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 8px;
    color: #4f5b48;
    font-size: 0.94rem;
}

.hero__legend li {
    position: relative;
    padding-left: 18px;
    line-height: 1.55;
}

.hero__legend li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.55em;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--accent);
    opacity: 0.65;
}

/* Search panel */

.search-panel {
    padding: 28px clamp(22px, 3vw, 36px);
    border-radius: 28px;
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: 0 18px 44px rgba(56, 49, 37, 0.08);
    backdrop-filter: blur(14px);
    margin: 0;
    width: 100%;
}

.search-panel__heading {
    margin-bottom: 18px;
}

.search-panel__heading h2 {
    margin: 0;
    font-size: clamp(1.35rem, 1.6vw, 1.7rem);
    color: var(--ink);
}

.search-panel .search-form {
    display: grid;
    grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) auto;
    gap: 16px;
    align-items: end;
}

.search-panel .search-field input {
    height: 54px;
    padding: 0 18px;
    border-radius: 14px;
    border: 1px solid var(--line);
    background: #fffdf8;
    font: inherit;
    color: var(--ink);
    transition: border-color 160ms ease, box-shadow 160ms ease;
}

.search-panel .search-field input:focus {
    outline: none;
    border-color: rgba(164, 79, 47, 0.55);
    box-shadow: 0 0 0 4px rgba(164, 79, 47, 0.08);
}

.search-panel .search-field span {
    color: var(--olive);
    font-weight: 600;
    font-size: 0.88rem;
    letter-spacing: 0.02em;
}

.search-panel .search-actions {
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 14px;
    min-height: 54px;
}

.search-indicator {
    display: none;
    align-items: center;
    gap: 4px;
}

.search-indicator.htmx-request,
.htmx-request .search-indicator {
    display: inline-flex;
}

.search-indicator__dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.4;
    animation: search-dot 900ms ease-in-out infinite;
}

.search-indicator__dot:nth-child(2) { animation-delay: 150ms; }
.search-indicator__dot:nth-child(3) { animation-delay: 300ms; }

@keyframes search-dot {
    0%, 80%, 100% { opacity: 0.25; transform: translateY(0); }
    40% { opacity: 1; transform: translateY(-3px); }
}

/* Catalog block */

#catalog-results {
    width: 100%;
    margin: 0;
    display: grid;
    gap: 18px;
}

#catalog-results .results-summary {
    margin-bottom: 4px;
}

.strain-card--catalog {
    border-radius: 28px;
    padding: 28px;
    background:
        linear-gradient(180deg, rgba(255, 253, 248, 0.96) 0%, rgba(245, 239, 227, 0.96) 100%);
    border: 1px solid var(--line);
    box-shadow: 0 16px 38px rgba(56, 49, 37, 0.06);
}

.strain-card--catalog .strain-card__header h2 {
    font-size: 1.35rem;
    line-height: 1.2;
}

.compound-tile {
    border-radius: 18px;
    background: linear-gradient(180deg, #fffdf8 0%, #f7f0e0 100%);
    box-shadow: 0 8px 22px rgba(56, 49, 37, 0.05);
    transition: transform 180ms ease, box-shadow 180ms ease, border-color 180ms ease;
}

.compound-tile:hover {
    transform: translateY(-2px);
    border-color: rgba(164, 79, 47, 0.4);
    box-shadow: 0 18px 36px rgba(56, 49, 37, 0.10);
}

/* Footer */

.site-footer {
    padding: 24px 16px 32px;
}

.site-footer__inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 18px 24px;
    border-top: 1px solid var(--line);
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: space-between;
    color: var(--muted);
    font-size: 0.9rem;
}

@media (max-width: 1100px) {
    .hero {
        grid-template-columns: 1fr;
        padding: 44px 28px;
        gap: 28px;
    }

    .hero__panel {
        align-self: stretch;
    }

    .search-panel .search-form {
        grid-template-columns: 1fr;
    }

    .search-panel .search-actions {
        justify-content: flex-start;
    }
}

@media (max-width: 640px) {
    .site-header {
        padding: 10px 10px 0;
    }

    .site-header__inner {
        padding: 12px 16px;
        border-radius: 24px;
    }

    .site-header__title {
        display: none;
    }

    .home-shell {
        padding: 18px 12px 60px;
        gap: 22px;
    }

    .hero {
        padding: 32px 22px;
        border-radius: 28px;
    }

    .hero__title {
        font-size: clamp(2rem, 8vw, 2.6rem);
    }

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

    .strain-card--catalog {
        padding: 22px;
        border-radius: 22px;
    }
}

/* ===========================================================
   Top matches preview (HTMX live results under search)
   =========================================================== */

.top-matches {
    padding: 22px clamp(20px, 2.4vw, 28px);
    border-radius: 24px;
    background: linear-gradient(180deg, #fffdf8 0%, #f8f1de 100%);
    border: 1px solid var(--line);
    box-shadow: 0 16px 36px rgba(56, 49, 37, 0.07);
    display: grid;
    gap: 14px;
}

.top-matches__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
}

.top-matches__head h3 {
    margin: 0;
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.15rem;
    color: var(--ink);
}

.top-matches__count {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    background: rgba(164, 79, 47, 0.10);
    color: var(--accent-strong);
    font-size: 0.84rem;
    font-weight: 600;
}

.top-matches__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 10px;
}

.top-match {
    display: grid;
    gap: 4px;
    padding: 12px 14px;
    border-radius: 14px;
    background: #fffdf8;
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
    transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.top-match:hover {
    transform: translateY(-2px);
    border-color: rgba(164, 79, 47, 0.4);
    box-shadow: 0 12px 26px rgba(56, 49, 37, 0.10);
}

.top-match__name {
    font-weight: 600;
    font-size: 0.98rem;
}

.top-match__formula {
    color: var(--accent-strong);
    font-size: 0.9rem;
}

.top-match__formula sub {
    font-size: 0.75em;
    line-height: 0;
}

.top-match__strain {
    color: var(--muted);
    font-size: 0.82rem;
}

.top-matches__empty {
    margin: 0;
    color: var(--muted);
}

/* ===========================================================
   Detail page — match home page width / spacing
   =========================================================== */

.home-shell.detail-page {
    grid-template-columns: 1fr;
}

.detail-breadcrumbs {
    display: inline-flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    color: var(--muted);
    font-size: 0.92rem;
}

.detail-breadcrumbs a {
    color: var(--muted);
    text-decoration: none;
    transition: color 160ms ease;
}

.detail-breadcrumbs a:hover {
    color: var(--accent);
}

.detail-breadcrumbs__sep {
    opacity: 0.5;
}

.detail-breadcrumbs__current {
    color: var(--ink);
    font-weight: 600;
}

.home-shell.detail-page .compound-summary,
.home-shell.detail-page .content-card {
    border-radius: 28px;
    padding: 28px clamp(22px, 3vw, 36px);
    background: var(--paper);
    border: 1px solid var(--line);
    box-shadow: 0 18px 44px rgba(56, 49, 37, 0.08);
}

.home-shell.detail-page h1 {
    font-size: clamp(2rem, 3.4vw, 2.8rem);
    line-height: 1.08;
    max-width: none;
    margin-bottom: 12px;
}

.home-shell.detail-page h2 {
    font-size: clamp(1.2rem, 1.6vw, 1.55rem);
}

/* ===========================================================
   Icon-only redirect buttons (detail page external links)
   =========================================================== */

.icon-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fffdf8;
    border: 1px solid var(--line);
    color: var(--accent-strong);
    text-decoration: none;
    transition: transform 160ms ease, border-color 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
    box-shadow: 0 4px 10px rgba(56, 49, 37, 0.06);
}

.icon-link:hover,
.icon-link:focus-visible {
    background: var(--accent);
    color: #fffaf4;
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: 0 10px 22px rgba(164, 79, 47, 0.24);
    outline: none;
}

.icon-link svg {
    transition: transform 160ms ease;
}

.icon-link:hover svg {
    transform: translate(1px, -1px);
}

.icon-link--inline {
    margin-top: 8px;
    width: 32px;
    height: 32px;
}

.icon-link-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.ref-cell {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
}

/* ===========================================================
   Compound card — refined catalog tile
   =========================================================== */

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

.compound-card {
    position: relative;
    display: grid;
    grid-template-rows: auto auto auto 1fr;
    gap: 14px;
    padding: 18px 18px 16px;
    border-radius: 20px;
    background: linear-gradient(180deg, #fffdf8 0%, #faf3e3 100%);
    border: 1px solid var(--line);
    text-decoration: none;
    color: var(--ink);
    box-shadow: 0 8px 22px rgba(56, 49, 37, 0.05);
    transition: transform 200ms ease, box-shadow 200ms ease, border-color 200ms ease;
    overflow: hidden;
    isolation: isolate;
}

.compound-card::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background: radial-gradient(circle, rgba(164, 79, 47, 0.14), transparent 65%);
    pointer-events: none;
    transform: translate(40%, -40%);
    z-index: -1;
    transition: transform 320ms ease, opacity 320ms ease;
}

.compound-card:hover,
.compound-card:focus-visible {
    transform: translateY(-3px);
    border-color: rgba(164, 79, 47, 0.45);
    box-shadow: 0 22px 44px rgba(56, 49, 37, 0.12);
    outline: none;
}

.compound-card:hover::after,
.compound-card:focus-visible::after {
    transform: translate(20%, -20%);
}

.compound-card__head {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 12px;
    align-items: center;
}

.compound-card__avatar {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent) 0%, #c8754f 100%);
    color: #fffaf4;
    font-family: "Fraunces", Georgia, serif;
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    box-shadow: 0 6px 14px rgba(164, 79, 47, 0.24);
    flex-shrink: 0;
}

.compound-card__title {
    display: grid;
    gap: 2px;
    min-width: 0;
}

.compound-card__title strong {
    font-family: "Fraunces", Georgia, serif;
    font-size: 1.05rem;
    line-height: 1.25;
    color: var(--ink);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    overflow: hidden;
    word-break: break-word;
}

.compound-card__ref {
    font-size: 0.74rem;
    color: var(--muted);
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compound-card__formula {
    font-size: 1rem;
    font-weight: 600;
    color: var(--accent-strong);
    padding: 8px 12px;
    border-radius: 10px;
    background: rgba(164, 79, 47, 0.08);
    width: fit-content;
    max-width: 100%;
    overflow-wrap: anywhere;
}

.compound-card__formula sub {
    font-size: 0.72em;
    line-height: 0;
}

.compound-card__stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
}

.compound-card__stat {
    display: grid;
    gap: 2px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(74, 90, 69, 0.06);
    border: 1px solid rgba(74, 90, 69, 0.12);
}

.compound-card__stat span {
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    color: var(--olive);
    text-transform: uppercase;
}

.compound-card__stat strong {
    font-size: 0.94rem;
    color: var(--ink);
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.compound-card__footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding-top: 10px;
    border-top: 1px dashed var(--line);
    align-self: end;
}

.compound-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--accent);
    font-weight: 600;
    font-size: 0.9rem;
    transition: gap 200ms ease, color 200ms ease;
}

.compound-card__cta svg {
    transition: transform 220ms ease;
}

.compound-card:hover .compound-card__cta {
    gap: 10px;
    color: var(--accent-strong);
}

.compound-card:hover .compound-card__cta svg {
    transform: translateX(3px);
}

@media (max-width: 640px) {
    .compound-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .compound-card {
        padding: 16px;
        border-radius: 18px;
    }
}


