/* --- Tone down Pico's large defaults --- */
html {
    /* Pico scales the base font size up on wider screens; pin it to a normal size. */
    font-size: 100%;
}

:root {
    /* One consistent rounding for every element. */
    --pico-border-radius: 6px;
    --pico-spacing: 0.9rem;
    --pico-form-element-spacing-vertical: 0.5rem;
    --pico-form-element-spacing-horizontal: 0.75rem;
    --pico-typography-spacing-vertical: 0.8rem;
    /* Small shadow + slight gray border instead of Pico's large soft card shadow. */
    --pico-card-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
    --pico-card-border-color: #e2e2e2;
}

h1 {
    font-size: 1.8rem;
}

h2 {
    font-size: 1.3rem;
}

h3 {
    font-size: 1.1rem;
}

section {
    margin-bottom: 2rem;
}

figure {
    margin: 0;
}

/* Compact, auto-width buttons (Pico stretches them by default). */
button {
    width: auto;
    padding: 0.4rem 0.9rem;
}

input,
select {
    border: 1px solid #d0d0d0;
}

table {
    border: 1px solid #e2e2e2;
    border-radius: var(--pico-border-radius);
    font-size: 0.9rem;
}

/* Section caption with a right-aligned action. */
.section-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 1rem;
}

.section-head h2 {
    margin: 0;
}

.section-head button {
    flex: 0 0 auto;
    margin: 0;
    padding: 0.2rem 0.7rem;
    font-size: 0.8rem;
}

.field-row {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.field-row > label {
    flex: 1 1 16rem;
}

code {
    font-family: var(--pico-font-family-monospace, monospace);
    word-break: break-all;
}

/* Catalog summary cards: small shadow, slight border, consistent radius. */
.summary-grid {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
    margin: 1rem 0;
}

.summary-grid article {
    flex: 1 1 9rem;
    text-align: center;
    margin: 0;
    padding: 0.75rem;
    border: 1px solid #e2e2e2;
    border-radius: var(--pico-border-radius);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.summary-grid article strong {
    display: block;
    font-size: 1.5rem;
}

/* Clickable standard search result rows. */
.clickable-row {
    cursor: pointer;
}

.clickable-row:hover {
    background: var(--pico-table-row-stripped-background-color, #f3f3f3);
}

.badge {
    display: inline-block;
    padding: 0.1rem 0.5rem;
    border-radius: var(--pico-border-radius);
    font-size: 0.8rem;
    color: #fff;
}

.badge.valid {
    background: #2e7d32;
}

.badge.invalid {
    background: #9e9e9e;
}

.expand-icon {
    display: inline-block;
    font-size: 0.7rem;
    color: var(--pico-muted-color, #777);
    margin-right: 0.2rem;
    user-select: none;
}

.messages-detail td {
    background: var(--pico-card-background-color, #f9f9f9);
    padding: 0.75rem 1rem;
    border-top: none;
}

.messages-list {
    display: flex;
    flex-wrap: wrap;
    gap: 0.3rem;
    margin-top: 0.4rem;
}

.messages-list code {
    background: var(--pico-code-background-color, #eef);
    padding: 0.1rem 0.4rem;
    border-radius: var(--pico-border-radius);
    font-size: 0.8rem;
    word-break: normal;
}

.muted {
    color: var(--pico-muted-color, #777);
}

.error {
    color: #c62828;
}
