:root {
    --bg: #f4f7fb;
    --surface: #ffffff;
    --surface-soft: #f8fafc;
    --ink: #111827;
    --muted: #667085;
    --line: #d9e2ec;
    --brand: #0f766e;
    --brand-strong: #115e59;
    --brand-soft: #e6f5f2;
    --accent: #1d4ed8;
    --warning: #92400e;
    --warning-soft: #fff7ed;
    --shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, Arial, Helvetica, sans-serif;
    line-height: 1.5;
    margin: 0;
}

.app-header {
    background: #0b1726;
    color: #ffffff;
}

.topbar {
    align-items: center;
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 18px clamp(18px, 5vw, 56px);
}

.brand {
    align-items: center;
    color: #ffffff;
    display: inline-flex;
    gap: 12px;
    text-decoration: none;
}

.brand-mark {
    align-items: center;
    background: var(--brand);
    border-radius: 8px;
    display: inline-flex;
    font-weight: 800;
    height: 42px;
    justify-content: center;
    width: 42px;
}

.brand strong,
.brand small {
    display: block;
}

.brand small {
    color: #b9c7d6;
    font-size: 12px;
    margin-top: 2px;
}

.top-actions,
.section-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.button,
.filter-chip {
    border: 0;
    border-radius: 8px;
    cursor: pointer;
    display: inline-flex;
    font: inherit;
    font-weight: 700;
    justify-content: center;
    min-height: 40px;
    padding: 10px 14px;
    text-decoration: none;
}

.button.primary {
    background: var(--brand);
    color: #ffffff;
}

.button.ghost {
    background: rgba(255, 255, 255, 0.1);
    color: #ffffff;
}

.hero {
    display: grid;
    gap: 28px;
    grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
    padding: 44px clamp(18px, 5vw, 56px) 54px;
}

.hero-copy {
    max-width: 780px;
}

.eyebrow,
.section-label {
    color: var(--brand);
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.08em;
    margin: 0 0 8px;
    text-transform: uppercase;
}

.hero h1 {
    font-size: clamp(34px, 5vw, 58px);
    letter-spacing: 0;
    line-height: 1.02;
    margin: 0;
}

.hero p:not(.eyebrow) {
    color: #d4dde8;
    font-size: 18px;
    margin: 16px 0 0;
    max-width: 660px;
}

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

.summary-card {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    padding: 18px;
}

.summary-card span {
    color: #b9c7d6;
    display: block;
    font-size: 13px;
    font-weight: 700;
}

.summary-card strong {
    display: block;
    font-size: 34px;
    margin-top: 6px;
}

.summary-card.warning strong {
    color: #fed7aa;
}

.dashboard {
    padding: 28px clamp(18px, 5vw, 56px) 56px;
}

.control-panel {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    gap: 16px;
    margin: -58px 0 30px;
    padding: 18px;
}

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

.search-box label {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-transform: uppercase;
}

.search-box input {
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--ink);
    font: inherit;
    min-height: 46px;
    padding: 11px 14px;
    width: 100%;
}

.search-box input:focus {
    border-color: var(--brand);
    outline: 3px solid rgba(15, 118, 110, 0.15);
}

.filter-chip {
    background: var(--surface-soft);
    border: 1px solid var(--line);
    color: var(--ink);
}

.filter-chip.is-active {
    background: var(--brand);
    border-color: var(--brand);
    color: #ffffff;
}

.result-status {
    color: var(--muted);
    font-weight: 700;
    min-height: 24px;
}

.data-section {
    margin-bottom: 40px;
    scroll-margin-top: 16px;
}

.data-section.is-hidden {
    display: none;
}

.section-head {
    align-items: flex-end;
    display: flex;
    gap: 16px;
    justify-content: space-between;
    margin-bottom: 10px;
}

.section-head h2 {
    font-size: 26px;
    margin: 0;
}

.section-counts {
    color: var(--muted);
    text-align: right;
}

.section-counts strong {
    color: var(--ink);
    display: block;
    font-size: 24px;
}

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

.record-card {
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 230px;
    padding: 18px;
}

.record-card.is-hidden {
    display: none;
}

.record-media {
    align-items: center;
    background: linear-gradient(135deg, #f8fbff, #eef5f7);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: flex;
    justify-content: center;
    min-height: 72px;
    overflow: hidden;
    padding: 10px;
}

.record-media img {
    display: block;
    height: 44px;
    max-width: 140px;
    object-fit: contain;
    width: auto;
}

.record-main h3 {
    font-size: 18px;
    line-height: 1.35;
    margin: 0;
    overflow-wrap: anywhere;
}

.record-main p {
    color: #475467;
    margin: 10px 0 0;
}

.meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.pill {
    background: var(--brand-soft);
    border: 1px solid #bfe3dc;
    border-radius: 999px;
    color: var(--brand-strong);
    font-size: 12px;
    font-weight: 800;
    padding: 4px 9px;
}

.source-link {
    align-items: center;
    color: var(--accent);
    display: inline-flex;
    font-weight: 800;
    margin-top: auto;
    text-decoration: none;
}

.source-link::after {
    content: ">";
    margin-left: 6px;
}

.empty {
    background: var(--surface);
    border: 1px dashed var(--line);
    border-radius: 8px;
    color: var(--muted);
    font-weight: 700;
    padding: 22px;
}

.empty.is-hidden {
    display: none;
}

.load-status {
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    margin: 14px 0 0;
}

@media (max-width: 920px) {
    .hero {
        grid-template-columns: 1fr;
    }

    .control-panel {
        margin-top: -42px;
        position: static;
    }
}

@media (max-width: 680px) {
    .topbar,
    .section-head {
        align-items: flex-start;
        flex-direction: column;
    }

    .top-actions {
        width: 100%;
    }

    .button {
        flex: 1;
    }

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

    .section-counts {
        text-align: left;
    }
}
