:root {
    color-scheme: light;
    --bg: #f6f7f3;
    --surface: #ffffff;
    --surface-2: #eef3ec;
    --ink: #172018;
    --muted: #657067;
    --line: #d9e0d8;
    --green: #2f6f4e;
    --blue: #286c8f;
    --amber: #9a6420;
    --danger: #9b3d32;
    --shadow: 0 16px 45px rgba(24, 39, 30, 0.12);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
            radial-gradient(circle at top left, rgba(47, 111, 78, 0.10), transparent 28rem),
            linear-gradient(180deg, #f8faf6 0%, var(--bg) 100%);
    color: var(--ink);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
    font: inherit;
}

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

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.language-switch {
    display: flex;
    padding: 3px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
}

.language-switch button {
    min-width: 42px;
    height: 36px;
    border: 0;
    border-radius: 6px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-weight: 800;
}

.language-switch button.active {
    background: var(--green);
    color: white;
}

.brand-mark {
    width: 52px;
    height: 52px;
    display: grid;
    place-items: center;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--green), #65a56d 62%, #d2c34f);
    color: white;
    font-weight: 800;
    box-shadow: var(--shadow);
}

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

h1 {
    font-size: 28px;
    line-height: 1.05;
}

.brand p,
.empty-state p {
    color: var(--muted);
}

.icon-button {
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--surface);
    color: var(--green);
    cursor: pointer;
    font-weight: 800;
    box-shadow: 0 8px 20px rgba(24, 39, 30, 0.08);
}

.icon-button:hover {
    border-color: var(--green);
}

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

.summary-grid article,
.toolbar,
.list-panel,
.detail-panel {
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
}

.summary-grid article {
    min-height: 86px;
    padding: 16px;
    border-radius: 8px;
}

.summary-grid span,
label span,
.eyebrow,
dt {
    display: block;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.summary-grid strong {
    display: block;
    margin-top: 8px;
    font-size: 28px;
}

.summary-grid strong.source-list {
    font-size: 16px;
    line-height: 1.35;
}

.toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 12px;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 14px;
}

label {
    display: grid;
    gap: 6px;
}

input,
select {
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--ink);
    padding: 0 12px;
}

input:focus,
select:focus,
button:focus-visible {
    outline: 3px solid rgba(40, 108, 143, 0.24);
    border-color: var(--blue);
}

.workspace {
    display: grid;
    grid-template-columns: 390px minmax(0, 1fr);
    gap: 14px;
    height: calc(100vh - 324px);
    min-height: 500px;
}

.list-panel,
.detail-panel {
    border-radius: 8px;
    overflow: hidden;
}

.list-panel {
    display: grid;
    grid-template-rows: auto minmax(0, 1fr) auto;
}

.panel-heading {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    border-bottom: 1px solid var(--line);
}

.panel-heading h2 {
    font-size: 17px;
}

#resultCount {
    color: var(--muted);
    font-weight: 700;
}

.frog-list {
    min-height: 0;
    overflow: hidden;
}

.pagination {
    min-height: 58px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 12px;
    border-top: 1px solid var(--line);
    background: #fbfcfa;
}

.pagination button {
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border: 1px solid rgba(47, 111, 78, 0.28);
    border-radius: 8px;
    background: var(--green);
    color: white;
    cursor: pointer;
    font-size: 22px;
    font-weight: 800;
    line-height: 1;
    box-shadow: 0 7px 16px rgba(47, 111, 78, 0.18);
    transition: transform 120ms ease, background 120ms ease, box-shadow 120ms ease;
}

.pagination button:hover:not(:disabled) {
    background: #255b40;
    box-shadow: 0 9px 18px rgba(47, 111, 78, 0.24);
    transform: translateY(-1px);
}

.pagination button:disabled {
    cursor: not-allowed;
    border-color: var(--line);
    background: #eef3ec;
    color: #9aa69e;
    box-shadow: none;
    transform: none;
}

#pageStatus {
    min-width: 112px;
    padding: 8px 10px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: white;
    color: var(--muted);
    font-size: 13px;
    font-weight: 800;
    text-align: center;
}

.frog-item {
    width: 100%;
    display: grid;
    gap: 3px;
    min-height: 64px;
    padding: 10px 16px;
    border: 0;
    border-bottom: 1px solid var(--line);
    background: transparent;
    text-align: left;
    cursor: pointer;
}

.frog-item:hover,
.frog-item.active {
    background: var(--surface-2);
}

.frog-item strong {
    font-size: 15px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.frog-item span {
    color: var(--muted);
    font-size: 13px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.detail-panel {
    padding: 22px;
}

.empty-state {
    height: 100%;
    min-height: 560px;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 18px;
    text-align: center;
}

.frog-visual {
    position: relative;
    width: 168px;
    height: 124px;
    border-radius: 48% 48% 36% 36%;
    background: linear-gradient(160deg, #6fb35d, #2f6f4e 70%);
    box-shadow: inset 0 -18px 28px rgba(0, 0, 0, 0.12), var(--shadow);
}

.frog-visual .eye {
    position: absolute;
    top: 20px;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: white;
}

.frog-visual .eye::after {
    content: "";
    position: absolute;
    top: 10px;
    left: 12px;
    width: 11px;
    height: 11px;
    border-radius: 50%;
    background: var(--ink);
}

.frog-visual .left {
    left: 38px;
}

.frog-visual .right {
    right: 38px;
}

.frog-visual .mouth {
    position: absolute;
    left: 50%;
    bottom: 30px;
    width: 74px;
    height: 28px;
    border-bottom: 4px solid rgba(255, 255, 255, 0.85);
    border-radius: 50%;
    transform: translateX(-50%);
}

.detail {
    display: grid;
    gap: 22px;
}

.hidden {
    display: none !important;
}

.detail-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    padding-bottom: 18px;
    border-bottom: 1px solid var(--line);
}

.detail-header h2 {
    margin-top: 4px;
    font-size: 30px;
    line-height: 1.1;
}

#detailScientific {
    margin-top: 6px;
    color: var(--muted);
    font-style: italic;
}

.status-pill {
    max-width: 220px;
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(154, 100, 32, 0.12);
    color: var(--amber);
    font-size: 13px;
    font-weight: 800;
    overflow-wrap: anywhere;
}

.frog-photo {
    margin: 0;
    border: 1px solid var(--line);
    border-radius: 8px;
    overflow: hidden;
    background: #fbfcfa;
}

.frog-photo img {
    display: block;
    width: 100%;
    max-height: 360px;
    object-fit: contain;
    background: #edf2eb;
}

.frog-photo figcaption {
    padding: 9px 12px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.frog-photo a {
    color: var(--blue);
}

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

.facts div {
    min-height: 96px;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: #fbfcfa;
}

dd {
    margin: 8px 0 0;
    color: #27342b;
    line-height: 1.45;
}

.chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0;
    margin: 10px 0 0;
    list-style: none;
}

.chips li {
    padding: 8px 10px;
    border-radius: 8px;
    background: rgba(40, 108, 143, 0.10);
    color: var(--blue);
    font-size: 13px;
    font-weight: 700;
}

.sources {
    display: grid;
    gap: 10px;
}

.source-row {
    display: grid;
    grid-template-columns: 160px minmax(0, 1fr);
    gap: 12px;
    padding: 10px 0;
    border-top: 1px solid var(--line);
}

.source-row a {
    color: var(--blue);
    overflow-wrap: anywhere;
}

.source-value {
    color: var(--muted);
    overflow-wrap: anywhere;
}

.source-meta {
    margin-top: 3px;
    color: var(--muted);
    font-size: 12px;
    font-weight: 700;
}

.error {
    padding: 12px 16px;
    color: white;
    background: var(--danger);
}

@media (max-width: 840px) {
    .shell {
        width: min(100% - 20px, 1180px);
        padding-top: 14px;
    }

    .summary-grid,
    .toolbar,
    .workspace,
    .facts {
        grid-template-columns: 1fr;
    }

    .workspace {
        height: auto;
        min-height: auto;
    }

    .list-panel {
        height: auto;
    }

    .frog-list {
        max-height: none;
    }

    .detail-header {
        display: grid;
    }

    .topbar {
        align-items: flex-start;
    }

    .topbar-actions {
        flex-shrink: 0;
    }
}
