:root {
    --bg: #eef1e7;
    --paper: #f9faf6;
    --card: #ffffff;
    --ink: #18342b;
    --muted: #5d7168;
    --line: rgba(24, 52, 43, 0.12);
    --accent: #0f7a54;
    --accent-strong: #0b5a3e;
    --warning: #fff3cf;
    --shadow: 0 24px 50px rgba(24, 52, 43, 0.08);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(15, 122, 84, 0.14), transparent 28%),
        radial-gradient(circle at top right, rgba(220, 200, 135, 0.3), transparent 22%),
        linear-gradient(180deg, #f6f8f1 0%, var(--bg) 100%);
}

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

.shell {
    width: min(1320px, calc(100% - 32px));
    margin: 0 auto;
    padding: 24px 0 48px;
}

.site-header {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    align-items: flex-start;
    margin-bottom: 28px;
}

.brand {
    display: inline-block;
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.03em;
}

.brand-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
}

.top-nav {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.top-nav a,
.button {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.65);
    padding: 12px 16px;
    border-radius: 999px;
    font-weight: 700;
    transition: 180ms ease;
}

.top-nav a:hover,
.button:hover {
    transform: translateY(-1px);
    border-color: rgba(15, 122, 84, 0.28);
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: white;
    background: linear-gradient(135deg, var(--accent), var(--accent-strong));
    border: none;
    cursor: pointer;
}

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

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

.hero-copy,
.hero-meta,
.panel,
.stat-card,
.notice,
.error-page {
    background: rgba(255, 255, 255, 0.78);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
}

.hero-copy {
    padding: 32px;
}

.hero-copy h1,
.detail-header h1,
.error-page h1 {
    margin: 10px 0 14px;
    font-size: clamp(2.1rem, 4vw, 3.5rem);
    line-height: 0.98;
    letter-spacing: -0.04em;
}

.hero-copy p,
.panel-header p,
.empty-state p,
.detail-list dd,
.error-page p {
    color: var(--muted);
}

.hero-meta {
    padding: 22px;
    display: grid;
    gap: 16px;
    align-content: start;
}

.meta-card,
.detail-meta-box {
    background: linear-gradient(180deg, rgba(15, 122, 84, 0.08), rgba(15, 122, 84, 0.02));
    border: 1px solid rgba(15, 122, 84, 0.12);
    border-radius: 20px;
    padding: 18px;
}

.meta-card span,
.stat-card span,
.eyebrow,
.detail-meta-box span {
    display: inline-block;
    color: var(--muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.meta-card strong,
.stat-card strong,
.detail-meta-box strong {
    display: block;
    margin-top: 8px;
    font-size: 1.8rem;
    line-height: 1;
}

.meta-card small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
}

.notice {
    margin-bottom: 24px;
    padding: 18px 22px;
}

.notice-warning {
    background: linear-gradient(180deg, rgba(255, 243, 207, 0.9), rgba(255, 249, 230, 0.9));
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    padding: 22px;
}

.stat-card small {
    display: block;
    margin-top: 8px;
    color: var(--muted);
}

.panel {
    padding: 24px;
}

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

.panel-header h2,
.detail-list dt {
    margin: 0;
}

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

.filters label,
.filter-toggles,
.filter-actions {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.filters span {
    font-size: 0.92rem;
    font-weight: 700;
}

input,
select {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 16px;
    background: white;
    padding: 13px 14px;
    font: inherit;
    color: var(--ink);
}

.checkbox {
    flex-direction: row;
    align-items: center;
    font-weight: 700;
}

.checkbox input {
    width: auto;
}

.filter-toggles {
    justify-content: flex-end;
}

.filter-actions {
    justify-content: flex-end;
}

.content-grid,
.detail-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
    gap: 20px;
    margin-top: 24px;
}

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

.map {
    width: 100%;
    min-height: 520px;
    border-radius: 24px;
    overflow: hidden;
    border: 1px solid var(--line);
}

.map-small {
    min-height: 320px;
}

.association-list,
.payload-list {
    display: grid;
    gap: 14px;
}

.association-card {
    display: block;
    border: 1px solid var(--line);
    border-radius: 22px;
    padding: 18px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(247, 249, 245, 0.95));
    transition: 180ms ease;
}

.association-card:hover,
.association-card.is-highlighted {
    transform: translateY(-2px);
    border-color: rgba(15, 122, 84, 0.4);
    box-shadow: 0 14px 30px rgba(15, 122, 84, 0.12);
}

.association-card-top,
.detail-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    align-items: flex-start;
}

.association-meta,
.association-tags,
.detail-badges {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 10px 0 0;
    color: var(--muted);
}

.association-tags span,
.soft-badge {
    background: rgba(15, 122, 84, 0.08);
    border: 1px solid rgba(15, 122, 84, 0.12);
    border-radius: 999px;
    padding: 7px 10px;
    font-size: 0.86rem;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 0.82rem;
    font-weight: 800;
}

.status-badge.is-active {
    color: #08543a;
    background: rgba(15, 122, 84, 0.14);
}

.status-badge.is-inactive {
    color: #803535;
    background: rgba(198, 82, 82, 0.14);
}

.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 18px;
}

.pagination a {
    min-width: 42px;
    text-align: center;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: white;
}

.pagination a.is-current {
    background: var(--ink);
    color: white;
}

.detail-header {
    margin-bottom: 24px;
}

.back-link {
    display: inline-flex;
    margin-bottom: 12px;
    color: var(--muted);
    font-weight: 700;
}

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

.detail-list div {
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 14px;
    background: rgba(255, 255, 255, 0.76);
}

.detail-list dt {
    font-size: 0.88rem;
    color: var(--muted);
}

.detail-list dd {
    margin: 8px 0 0;
    font-weight: 700;
    word-break: break-word;
}

.hash {
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: 0.85rem;
}

.payload-item {
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    overflow: hidden;
}

.payload-item summary {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    cursor: pointer;
    font-weight: 700;
}

.payload-item pre {
    margin: 0;
    padding: 0 18px 18px;
    overflow-x: auto;
    font-size: 0.84rem;
    line-height: 1.5;
}

.empty-state,
.error-page {
    padding: 28px;
}

@media (max-width: 1100px) {
    .hero,
    .content-grid,
    .detail-grid,
    .stats-grid,
    .filters {
        grid-template-columns: 1fr;
    }

    .site-header,
    .detail-header,
    .panel-header {
        flex-direction: column;
    }
}

@media (max-width: 720px) {
    .shell {
        width: min(100% - 18px, 1320px);
        padding-top: 18px;
    }

    .hero-copy,
    .panel,
    .stat-card {
        padding: 18px;
    }

    .detail-list {
        grid-template-columns: 1fr;
    }

    .map {
        min-height: 340px;
    }
}
