.moonlit-page .bestiary { width: min(96%, 82rem); margin: 1rem auto 2rem; }
.bestiary h2, .bestiary h3, .bestiary h4 { margin: 0 0 .4rem; }
.bestiary p { margin: .3rem 0 .8rem; }
.bestiary-panel {
    min-width: 0;
    padding: clamp(.85rem, 2.5vw, 1.45rem);
    color: var(--ink);
    overflow-wrap: anywhere;
}
.bestiary-panel a:not([class]) { color: #76162c; text-decoration: underline; }
.bestiary-filters {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 8rem), 1fr));
    align-items: end;
    gap: .7rem;
}
.bestiary-filters label:first-child { grid-column: span 2; }
.bestiary label { display: grid; gap: .25rem; font-weight: bold; }
.bestiary input:not([type=radio]):not([type=checkbox]), .bestiary select {
    box-sizing: border-box;
    width: 100%;
    min-width: 0;
    min-height: 2.75rem;
    padding: .4rem .5rem;
    border: 1px solid #97632e;
    border-radius: .25rem;
    background: #fff3d6;
    color: #281810;
    font: inherit;
}
.bestiary .button_general, .bestiary .button_secondary { min-height: 2.65rem; align-content: center; }
.bestiary-action small { font-size: .78em; }
.bestiary-cards { display: grid; gap: .75rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 15rem), 1fr)); }
.bestiary-card h3 a { font-size: 1.25rem; }
.bestiary-stats { display: flex; flex-wrap: wrap; gap: .45rem; margin: .75rem 0; }
.bestiary-stats div { flex: 1; min-width: 3.25rem; text-align: center; padding: .35rem; border: 1px solid #a8793d; border-radius: .25rem; background: #f9e6b6; }
.bestiary-stats div:nth-child(3n+1) { color: #792c3a; }
.bestiary-stats div:nth-child(3n+2) { color: #173b5d; }
.bestiary-stats div:nth-child(3n+3) { color: #1d5c43; }
.bestiary-stats dt { font-size: .84rem; font-weight: bold; }
.bestiary dd { margin: 0; }
.bestiary-stats dd { font-weight: bold; font-size: 1.13rem; }
.bestiary-status { font-weight: bold; color: #702839; }
.bestiary-pagination { display: flex; align-items: center; flex-wrap: wrap; gap: .55rem; margin: 1rem 0; }
.bestiary-detail { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); align-items: start; }
.bestiary-statblock header { border-bottom: 2px solid #9f6e39; }
.bestiary-statblock h2 { color: #76162c; font-size: clamp(1.65rem, 4vw, 2.65rem); }
.bestiary-reference div, .bestiary-action { border-bottom: 1px solid #a5764360; padding-block: .5rem; }
.bestiary-reference dt { font-weight: bold; }
.bestiary-action h4 { color: #6e2630; }
.bestiary-action p { white-space: pre-line; }
.bestiary-exclusions { margin-block: .75rem; }
.bestiary-exclusions ul { padding-inline-start: 1.35rem; }
.bestiary-attribution { margin-top: 1rem; }
.bestiary summary { cursor: pointer; font-weight: bold; }
.bestiary-config { display: grid; gap: .65rem; }
.bestiary-config fieldset { min-width: 0; border: 1px solid #9d6b34; border-radius: .3rem; padding: .6rem; margin: 0; }
.bestiary-config legend { padding-inline: .3rem; font-weight: bold; }
.bestiary-config label + label { margin-top: .45rem; }
.bestiary label.bestiary-choice { grid-template-columns: 1.2rem minmax(0, 1fr); align-items: start; cursor: pointer; padding-block: .25rem; }
.bestiary-choice input { accent-color: #831d37; margin: .24rem 0 0; }
@media (max-width: 690px) {
    .bestiary-detail { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 420px) {
    .bestiary-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 690px) {
    .bestiary-statblock .bestiary-stats {
        display: grid;
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
    .bestiary-statblock .bestiary-stats div { min-width: 0; }
}
