.bestiary {
  --width: 1360px;
  --ground: #0e1319;
  --panel: #151c24;
  --line: #5f5541;
  --ink: #f0e6d0;
  --muted: #b7b5b0;
  --gold: #dac298;
  --archive-frame: #10151c;
  --archive-rim: #8d795777;
}
.bestiary > header { margin-top: clamp(18px, 3vw, 32px); }
.bestiary h1 { margin-block: .15em .35em; font-size: clamp(1.85rem, 4.6vw, 3.1rem); line-height: 1.12; }
.bestiary > header p:last-child { margin-top: 0; color: var(--muted); }
.enemy-controls { display: flex; flex-wrap: wrap; align-items: end; gap: 8px 12px; padding-bottom: 12px; border-bottom: 1px solid var(--archive-rim); }
.enemy-controls label { display: grid; gap: 4px; min-width: 0; color: var(--muted); font-size: .86rem; }
.enemy-search { flex: 1 1 225px; }
.enemy-controls label select { min-width: 0; max-width: 190px; }
.enemy-controls input, .enemy-controls select, .enemy-modes button, #enemy-pages button, .enemy-detail > button {
  min-height: 36px;
  padding: .35em .65em;
  background: #131a22;
  border-color: var(--archive-rim);
  font-size: .9rem;
}
.enemy-modes { display: flex; gap: 4px; }
.enemy-modes button[aria-pressed="true"] { color: #ffe4ad; border-color: #bea575; background: #292823; }
.enemy-controls .enemy-spoiler { display: flex; align-items: center; min-height: 36px; gap: 6px; }
.enemy-spoiler input { min-height: auto; accent-color: #b69968; }
.enemy-layout { display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; margin-top: 12px; align-items: start; }
@media (min-width: 730px) { .enemy-layout { grid-template-columns: minmax(210px, 31%) minmax(0, 1fr); } }
.enemy-list, .enemy-detail { min-width: 0; margin: 0; border: 1px solid var(--archive-rim); border-radius: 5px; background: var(--archive-frame); box-shadow: inset 0 0 0 3px #0b1118; }
.enemy-list { padding: 8px 11px; }
.enemy-frame-title { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 8px; min-height: 33px; text-align: center; }
.enemy-frame-title span { height: 20px; background: url("../disciplines/art/spellbook-inlay.webp") left center / min(100%, 62px) auto no-repeat, linear-gradient(#bea57555, #bea57555) center / 100% 1px no-repeat; }
.enemy-frame-title span:last-child { transform: scaleX(-1); }
.enemy-frame-title h2 { margin: 0; font-size: 1.15rem; }
#enemy-count { margin: 4px 2px 7px; color: var(--muted); font-size: .83rem; }
#enemy-results { padding: 0; margin: 0; list-style: none; }
#enemy-results li + li { margin-top: 3px; }
#enemy-results a { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0 .55rem; padding: 7px 8px; border: 1px solid #5f554146; border-radius: 4px; line-height: 1.28; text-decoration: none; overflow-wrap: anywhere; }
#enemy-results a:hover { border-color: #bea575; }
#enemy-results a[aria-current] { color: #ffe4ad; border-color: #bea575; background: #272722; }
#enemy-results small { font-size: .77rem; }
#enemy-pages { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-block: 10px 3px; font-size: .85rem; }
#enemy-pages button:disabled { opacity: .45; cursor: default; }
.enemy-detail { padding: clamp(14px, 2.7vw, 26px); overflow-wrap: anywhere; scroll-margin-top: 12px; }
.enemy-detail:focus { outline: 1px solid var(--gold); }
.enemy-heading { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 14px; align-items: start; margin-bottom: 12px; }
.enemy-heading .kicker, .enemy-meta { margin: 0; }
.enemy-detail h2 { margin: .23em 0 .42em; font-size: clamp(1.4rem, 3vw, 2.2rem); }
.enemy-meta, .enemy-biomes { color: var(--muted); font-size: .87rem; }
.enemy-biomes { margin: 5px 0; }
.enemy-biomes p { margin-block: 4px; }
.enemy-portrait { width: clamp(68px, 15vw, 164px); height: clamp(92px, 18vw, 186px); padding: 4px; border: 1px solid var(--archive-rim); object-fit: contain; object-position: center bottom; background: radial-gradient(ellipse at 50% 86%, #333033, #141a24 75%); }
.enemy-lineup { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 137px), 1fr)); gap: 8px; margin-block: 12px 18px; }
.enemy-roster { display: grid; align-content: start; gap: 4px; padding: 8px; border: 1px solid var(--archive-rim); border-radius: 4px; }
.enemy-roster h3 { margin: 0; font-size: 1.04rem; }
.enemy-roster a { line-height: 1.3; }
.enemy-briefing-title { margin: 0 0 7px; font-size: 1.2rem; }
.enemy-actions { list-style: none; margin: 0; padding: 0; max-width: none; }
.enemy-actions li { padding: 8px 0; border-top: 1px solid var(--archive-rim); }
.enemy-actions strong { display: block; color: var(--gold); font-size: .84rem; }
.enemy-actions p { margin: 2px 0 0; }
.enemy-appearances { padding-top: 9px; border-top: 1px solid var(--archive-rim); }
.enemy-appearances ul { margin-block: 5px 0; padding-inline-start: 22px; }
.enemy-footnote { color: var(--muted); font-size: .87rem; }
@media (max-width: 389px) {
  .enemy-heading { gap: 8px; }
  .enemy-controls label select { max-width: 145px; }
}
