:root {
    --pico-primary: #0f5b78;
    --pico-primary-hover: #08445c;
    --pico-primary-focus: rgba(15, 91, 120, 0.25);
    --pico-background-color: #f5f1e8;
    --pico-card-background-color: rgba(255, 255, 255, 0.9);
    --pico-muted-color: #5d6b6d;
}

body {
    background:
        radial-gradient(circle at top left, rgba(225, 162, 76, 0.18), transparent 28%),
        radial-gradient(circle at top right, rgba(15, 91, 120, 0.15), transparent 22%),
        linear-gradient(180deg, #f5f1e8 0%, #f0efe9 100%);
    min-height: 100vh;
}

.topbar,
.topbar-actions,
.search-form,
.auth-panel form {
    display: flex;
    gap: 1rem;
    align-items: center;
}

.topbar {
    justify-content: space-between;
    padding: 1.2rem 0;
}

.hero {
    padding: 2rem 0 1rem;
}

.hero.compact {
    padding-top: 1rem;
}

.hero h1 {
    margin-bottom: 0.5rem;
}

.eyebrow {
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--pico-primary);
    font-size: 0.8rem;
    margin-bottom: 0.5rem;
}

.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
    margin: 1rem 0 2rem;
}

.catalog-card,
.panel,
.message {
    border: 1px solid rgba(15, 91, 120, 0.12);
    border-radius: 22px;
    backdrop-filter: blur(6px);
    box-shadow: 0 18px 50px rgba(32, 35, 42, 0.08);
}

.catalog-card {
    padding: 1.2rem;
    background: rgba(255, 255, 255, 0.82);
}

.catalog-card.special {
    background: linear-gradient(145deg, rgba(15, 91, 120, 0.92), rgba(8, 68, 92, 0.9));
    color: #fff;
}

.catalog-card.locked {
    opacity: 0.75;
}

.catalog-index {
    font-size: 0.9rem;
    color: var(--pico-muted-color);
}

.catalog-card.special .catalog-index,
.catalog-card.special a,
.catalog-card.special span {
    color: #fff;
}

.panel {
    padding: 1rem 1.2rem;
    background: rgba(255, 255, 255, 0.85);
    margin-bottom: 1rem;
}

.auth-panel {
    max-width: 480px;
}

.auth-panel form {
    display: block;
}

.search-form input {
    margin-bottom: 0;
}

pre {
    white-space: pre-wrap;
    margin: 0;
    font-size: 0.85rem;
}

.catalog-layout {
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 2rem;
    align-items: start;
}

.catalog-sidebar {
    position: sticky;
    top: 1rem;
    background: rgba(238, 241, 245, 0.9);
    border-radius: 24px;
    padding: 1.5rem 1.25rem;
    min-height: 70vh;
}

.sidebar-title {
    font-size: 0.95rem;
    color: #4f5e66;
    margin-bottom: 1rem;
}

.catalog-nav {
    display: grid;
    gap: 0.8rem;
}

.catalog-nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: #1d2b38;
    text-decoration: none;
    font-size: 1.05rem;
}

.catalog-nav-link.active {
    font-weight: 700;
}

.catalog-nav-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid #9aa7b2;
    background: #fff;
    display: inline-block;
}

.catalog-nav-link.active .catalog-nav-dot {
    background: #ff5d5d;
    border-color: #ff5d5d;
    box-shadow: inset 0 0 0 4px #fff;
}

.catalog-main {
    min-width: 0;
}

.stacked-search-form {
    display: grid;
    gap: 0.85rem;
}

.stacked-search-form label {
    font-weight: 600;
    margin-bottom: -0.2rem;
}

.stacked-search-form button {
    width: fit-content;
}

.search-hint {
    margin: 0;
    color: #385f7d;
    background: rgba(215, 230, 246, 0.8);
    border-radius: 14px;
    padding: 1rem 1.1rem;
}

.records-list {
    display: grid;
    gap: 1rem;
}

.record-card {
    border: 1px solid rgba(15, 91, 120, 0.12);
    border-radius: 18px;
    padding: 1rem;
    background: rgba(255, 255, 255, 0.88);
}

.record-meta {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    align-items: center;
    margin-bottom: 0.85rem;
}

.record-sheet,
.record-row {
    font-size: 0.85rem;
    border-radius: 999px;
    padding: 0.25rem 0.7rem;
    background: rgba(15, 91, 120, 0.08);
    color: #244960;
}

.record-table {
    width: 100%;
    margin-bottom: 0;
}

.record-table th {
    width: 28%;
    min-width: 210px;
}

.record-table th,
.record-table td {
    vertical-align: top;
    border-bottom: 1px solid rgba(15, 91, 120, 0.08);
}

.empty-state {
    padding: 1rem 1.1rem;
    border-radius: 16px;
    background: rgba(215, 230, 246, 0.65);
    color: #274863;
}

.catalog-subtitle {
    color: #6d7d83;
    margin-top: -0.2rem;
}

.sheet-group {
    border: 1px solid rgba(15, 91, 120, 0.12);
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    overflow: hidden;
}

.sheet-group summary {
    cursor: pointer;
    list-style: none;
    padding: 1rem 1.1rem;
    font-weight: 600;
    color: #244960;
}

.sheet-group summary::-webkit-details-marker {
    display: none;
}

.sheet-group-body {
    padding: 0 1rem 1rem;
}

.group-separator td {
    padding: 0.75rem 0;
    border-bottom: none;
}

.table-wrap {
    overflow-x: auto;
}

.structure-table {
    width: 100%;
    min-width: 760px;
    margin-bottom: 0;
}

.structure-table th,
.structure-table td {
    vertical-align: top;
    white-space: normal;
}

.structure-table th {
    font-weight: 700;
}

@media (max-width: 900px) {
    .catalog-layout {
        grid-template-columns: 1fr;
    }

    .catalog-sidebar {
        position: static;
        min-height: auto;
    }

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

    .record-table th {
        width: 100%;
        min-width: 0;
    }
}
