:root {
    color-scheme: light;
    --bg: #f4f6f8;
    --panel: #ffffff;
    --ink: #18202a;
    --muted: #647184;
    --line: #d9e0e8;
    --accent: #0f766e;
    --accent-dark: #0b5f59;
    --badge: #e8f4f2;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background: var(--bg);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.5;
}

a {
    color: inherit;
}

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

.search-panel,
.empty-state,
.notice,
.result-card {
    background: var(--panel);
    border: 1px solid var(--line);
    border-radius: 8px;
}

.search-panel {
    padding: 28px;
}

.eyebrow {
    margin: 0 0 6px;
    color: var(--accent-dark);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

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

h1 {
    margin-bottom: 24px;
    font-size: clamp(2rem, 3vw, 3rem);
    line-height: 1.08;
}

h2 {
    margin-bottom: 4px;
    font-size: 1.35rem;
}

h3 {
    margin-bottom: 8px;
    font-size: 1.08rem;
    line-height: 1.35;
}

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

.field {
    display: grid;
    gap: 7px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

input[type="search"],
select {
    width: 100%;
    min-height: 44px;
    border: 1px solid var(--line);
    border-radius: 6px;
    padding: 0 12px;
    color: var(--ink);
    background: #fff;
    font: inherit;
}

input[type="search"]:focus,
select:focus {
    border-color: var(--accent);
    outline: 3px solid rgba(15, 118, 110, 0.18);
}

.sources {
    display: flex;
    min-height: 44px;
    grid-column: 1 / 2;
    gap: 16px;
    align-items: center;
    margin: 0;
    border: 0;
    padding: 0;
}

.sources legend {
    float: left;
    margin-right: 14px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.sources label {
    display: inline-flex;
    gap: 7px;
    align-items: center;
    color: var(--ink);
    font-size: 0.95rem;
}

button {
    min-height: 44px;
    border: 0;
    border-radius: 6px;
    padding: 0 22px;
    color: #fff;
    background: var(--accent);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

button:hover {
    background: var(--accent-dark);
}

.quick-searches {
    display: flex;
    flex-wrap: wrap;
    grid-column: 1 / -1;
    gap: 8px;
    align-items: center;
    margin-top: -2px;
}

.quick-searches span {
    margin-right: 4px;
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
}

.quick-search-button {
    min-height: 34px;
    border: 1px solid var(--line);
    padding: 0 12px;
    color: var(--accent-dark);
    background: #fff;
    font-size: 0.92rem;
    font-weight: 800;
}

.quick-search-button:hover,
.quick-search-button.active {
    border-color: var(--accent);
    color: #fff;
    background: var(--accent);
}

.results-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 26px 0 12px;
}

.results-header p,
.empty-state p,
.result-card p,
.notice p {
    color: var(--muted);
}

.empty-state,
.notice {
    margin-top: 24px;
    padding: 24px;
}

.notice {
    border-color: #f2c46d;
    background: #fff9eb;
}

.notice p:last-child,
.result-card p:last-child,
.empty-state p:last-child {
    margin-bottom: 0;
}

.results-list {
    display: grid;
    gap: 12px;
}

.result-card {
    padding: 20px;
}

.result-card h3 a {
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
}

.result-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    align-items: center;
    margin-bottom: 10px;
    color: var(--muted);
    font-size: 0.84rem;
}

.badge {
    border-radius: 999px;
    padding: 3px 9px;
    color: var(--accent-dark);
    background: var(--badge);
    font-weight: 800;
}

.authors {
    margin-bottom: 8px;
    color: var(--ink) !important;
    font-size: 0.92rem;
}

@media (max-width: 760px) {
    .app-shell {
        width: min(100% - 24px, 1120px);
        padding-top: 16px;
    }

    .search-panel {
        padding: 20px;
    }

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

    .sources {
        grid-column: auto;
        flex-wrap: wrap;
    }

    button {
        width: 100%;
    }

    .quick-searches {
        align-items: stretch;
    }

    .quick-searches span {
        flex-basis: 100%;
    }

    .quick-search-button {
        width: auto;
        flex: 1 1 130px;
    }
}
