:root {
  --ink: #1c1915;
  --muted: #6f675e;
  --paper: #f4efe6;
  --paper-2: #ebe4d6;
  --rule: #ddd4c6;
  --sidebar: #1a211c;
  --sidebar-text: #efe7da;
  --sidebar-dim: #b7aa98;
  --copper: #9a4e24;
  --copper-deep: #6f3418;
  --focus: #b5683a;
  --serif: "Fraunces", "Iowan Old Style", Palatino, Georgia, serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
  --shadow: 0 16px 40px rgba(40, 28, 16, 0.08);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.5;
}
a { color: var(--copper-deep); text-decoration-thickness: 1px; text-underline-offset: 0.16em; }
a:hover { color: var(--copper); }
button, input, select, textarea { font: inherit; color: inherit; }
::selection { background: #efd3b4; color: var(--ink); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.sr, .skip {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}
.skip:focus {
  position: fixed;
  top: 0.5rem;
  left: 0.5rem;
  width: auto;
  height: auto;
  clip: auto;
  z-index: 50;
  background: white;
  padding: 0.4rem 0.7rem;
}

.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 272px;
  flex: none;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: auto;
  background: var(--sidebar);
  color: var(--sidebar-text);
  display: flex;
  flex-direction: column;
  padding: 1.15rem 0.9rem 1rem;
}
.brand a {
  display: flex;
  gap: 0.75rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
  padding: 0.2rem 0.45rem 0.9rem;
}
.brand strong { display: block; font-family: var(--serif); font-size: 1.25rem; font-weight: 560; letter-spacing: -0.02em; }
.brand small { display: block; color: var(--sidebar-dim); letter-spacing: 0.04em; }
.mark {
  width: 2.4rem;
  height: 2.4rem;
  display: grid;
  place-items: center;
  border: 1px solid rgba(239, 231, 218, 0.35);
  border-radius: 0.45rem;
  font-family: var(--serif);
  color: #f0d7b4;
}
.side-label {
  margin: 0.4rem 0.55rem 0.35rem;
  color: var(--sidebar-dim);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
.side-nav { display: flex; flex-direction: column; gap: 0.12rem; }
.side-nav a {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  color: var(--sidebar-text);
  text-decoration: none;
  padding: 0.42rem 0.6rem;
  border-radius: 0.4rem;
  border-left: 2px solid transparent;
}
.side-nav a:hover { background: rgba(255, 255, 255, 0.05); }
.side-nav a.is-active { background: rgba(255, 255, 255, 0.07); border-left-color: #e0a36a; }
.side-nav em { color: var(--sidebar-dim); font-style: normal; font-variant-numeric: tabular-nums; }
.side-foot {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 1rem 0.55rem 0.2rem;
  border-top: 1px solid rgba(239, 231, 218, 0.12);
}
.side-foot a { color: #f0d7b4; }

.main { flex: 1; min-width: 0; }
.topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem;
  background: rgba(244, 239, 230, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--rule);
}
.nav-toggle {
  display: none;
  border: 1px solid var(--ink);
  background: white;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  font-weight: 600;
}
.search { position: relative; flex: 1; display: flex; align-items: center; }
.search input {
  width: 100%;
  border: 1px solid transparent;
  background: white;
  border-radius: 999px;
  padding: 0.62rem 3rem 0.62rem 1rem;
  box-shadow: inset 0 0 0 1px var(--rule);
}
.search input:focus { box-shadow: inset 0 0 0 1px var(--focus); }
.search kbd {
  position: absolute;
  right: 0.7rem;
  border: 1px solid var(--rule);
  border-bottom-width: 2px;
  border-radius: 0.3rem;
  padding: 0 0.35rem;
  color: var(--muted);
  font-family: var(--sans);
  font-size: 0.8rem;
  background: var(--paper);
}
.suggest {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  right: 0;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 0.8rem;
  box-shadow: var(--shadow);
  padding: 0.35rem;
  z-index: 8;
}
.suggest a, .suggest p {
  display: block;
  padding: 0.55rem 0.7rem;
  border-radius: 0.5rem;
  text-decoration: none;
  color: inherit;
}
.suggest a strong, .results strong { display: block; font-weight: 600; }
.suggest a span, .results span { display: block; color: var(--muted); font-size: 0.92rem; }
.suggest a.is-active, .suggest a:hover { background: #f7f1e6; }

.admin-bar {
  background: #2a2118;
  color: #f3e6d4;
  text-align: center;
  padding: 0.4rem 1rem;
  font-size: 0.92rem;
}
.content {
  width: min(1120px, calc(100% - 3rem));
  margin: 0 auto;
  padding: 1.6rem 0 4.5rem;
}
.page-head { margin-bottom: 1.25rem; }
.kicker, .page-head .kicker {
  margin: 0 0 0.35rem;
  color: var(--copper);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}
h1, h2, h3 { font-family: var(--serif); font-weight: 560; letter-spacing: -0.03em; line-height: 1.15; }
h1 { font-size: clamp(2.1rem, 4vw, 3.4rem); margin: 0; }
h2 { font-size: 1.55rem; margin: 0; }
.lede { font-size: 1.15rem; max-width: 42rem; color: #3c352e; }
.count-line { color: var(--muted); }
.action-row { display: flex; flex-wrap: wrap; gap: 0.75rem 1rem; align-items: center; }
.action-row form, .sheet-tools form.inline-form { margin: 0; }
.action-row button {
  border: 1px solid var(--ink);
  background: var(--ink);
  color: white;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
  font: inherit;
}
.flash {
  width: min(1120px, calc(100% - 3rem));
  margin: 0.8rem auto 0;
  padding: 0.7rem 0.9rem;
  border-radius: 0.6rem;
  background: #e7f2ea;
}
.flash-bad { background: #fde8e4; }
.auth .flash { width: auto; margin: 0 0 1rem; }

.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 0.85rem;
}
.card {
  display: block;
  background: #f7f1e4;
  color: inherit;
  text-decoration: none;
  border: 2px solid #7a3b22;
  box-shadow: inset 0 0 0 1px #c4a574;
  border-radius: 0.35rem;
  padding: 1rem 1rem 1.05rem;
  min-height: 9.5rem;
}
.card:hover { box-shadow: inset 0 0 0 1px #c4a574, var(--shadow); }
.card-count { color: #7a3b22; font-variant-numeric: tabular-nums; font-size: 0.92rem; letter-spacing: 0.06em; }
.card h2 { margin: 0.35rem 0 0.4rem; font-size: 1.35rem; color: #7a3b22; letter-spacing: 0.04em; text-transform: uppercase; }
.card p { margin: 0; color: var(--muted); }

.filter-box { display: flex; flex-direction: column; gap: 0.75rem; margin: 0.5rem 0 1rem; }
.chip-row { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; }
.chip-row > span { color: var(--muted); font-size: 0.78rem; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 0.25rem; }
.chip-row a, .letters a, .jumps a, .pager a {
  text-decoration: none;
  border: 1px solid var(--rule);
  background: white;
  color: var(--ink);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
}
.chip-row a.is-on, .letters a.is-on, .pager a.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filters { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: end; }
.filters label, .stack label, .editor label { display: flex; flex-direction: column; gap: 0.28rem; color: var(--muted); font-size: 0.92rem; }
.filters input, .filters select, .stack input, .stack select, .editor input, .editor textarea {
  border: 1px solid var(--rule);
  background: white;
  border-radius: 0.55rem;
  padding: 0.5rem 0.65rem;
  min-width: 12rem;
}
.editor textarea { min-height: 9rem; width: 100%; }
.editor { display: flex; flex-direction: column; gap: 0.85rem; max-width: 44rem; }
button, .form-actions a {
  border: 0;
  background: var(--ink);
  color: var(--paper);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  cursor: pointer;
  text-decoration: none;
}
button.danger { background: #9f1239; }
.form-actions { display: flex; gap: 0.7rem; align-items: center; }
.form-actions a { background: transparent; color: var(--copper-deep); padding-left: 0; }
.delete-form { margin-top: 1.5rem; }
.letters, .jumps, .pager { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0.4rem 0 1rem; }
.jumps { position: sticky; top: 4.1rem; z-index: 3; background: rgba(244, 239, 230, 0.94); padding: 0.35rem 0; }

.table-wrap { overflow-x: auto; border: 1px solid var(--rule); border-radius: 0.8rem; background: white; }
.catalog { width: 100%; border-collapse: collapse; }
.catalog th {
  text-align: left;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 600;
  padding: 0.7rem 0.8rem;
  border-bottom: 1px solid var(--rule);
}
.catalog th a {
  color: inherit;
  text-decoration: none;
}
.catalog th a.is-on {
  color: var(--ink);
  box-shadow: inset 0 -2px 0 #7a3b22;
}
.catalog th a:hover { color: var(--copper-deep); }
.catalog td { padding: 0.72rem 0.8rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
.catalog tr:last-child td { border-bottom: 0; }
.catalog tbody tr:hover td { background: #fbf7f0; }
.catalog .name { font-family: var(--serif); font-size: 1.08rem; letter-spacing: -0.02em; min-width: 14rem; }
.catalog .name a { color: inherit; text-decoration: none; }
.catalog .name a:hover { color: var(--copper-deep); text-decoration: underline; }
.catalog td.detail { color: #3c352e; font-size: 0.95rem; max-width: 28rem; }
.actions { white-space: nowrap; }

.group { margin: 0 0 1.6rem; }
.group h2 { margin: 0.2rem 0 0.7rem; }
.group h2 span { color: var(--muted); font-family: var(--sans); font-size: 0.95rem; letter-spacing: 0; }
.glossary { display: flex; flex-direction: column; }
.gloss { padding: 1rem 0; border-top: 1px solid var(--rule); }
.gloss h2 { font-size: 1.7rem; }
.gloss h2 a { color: inherit; text-decoration: none; }
.gloss h2 a:hover { color: var(--copper-deep); }
.features, .lines, .plain-list, .results { margin: 0.4rem 0 0; padding: 0; list-style: none; }
.features li, .lines li { padding: 0.18rem 0 0.18rem 0.9rem; position: relative; }
.features li::before, .lines li::before { content: ""; width: 0.32rem; height: 0.32rem; border-radius: 50%; background: #e0b089; position: absolute; left: 0; top: 0.62rem; }
.features em { font-style: normal; color: var(--muted); }
.plain-list { columns: 2; gap: 1.5rem; }
.plain-list li { break-inside: avoid; padding: 0.22rem 0; }
.results a { display: block; padding: 0.75rem 0; border-bottom: 1px solid var(--rule); text-decoration: none; color: inherit; }
.result-group { margin-top: 1.2rem; }
.meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1rem 1.4rem;
  margin: 0.4rem 0 1.4rem;
  padding: 1rem 0;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.meta div { min-width: 0; }
.meta dt { font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
.meta dd { margin: 0.25rem 0 0; }
.block { margin: 1.3rem 0; }
.block p, .gloss p { max-width: 68ch; }
.block.narrow { max-width: 32rem; }
.muted { color: var(--muted); }
.empty { padding: 1rem 0 2rem; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 0.3rem; }
.tag {
  display: inline-block;
  text-decoration: none;
  background: var(--paper-2);
  color: var(--ink);
  border-radius: 999px;
  padding: 0.08rem 0.5rem;
  font-size: 0.92rem;
}
.badge {
  display: inline-block;
  text-decoration: none;
  border-radius: 999px;
  padding: 0.08rem 0.55rem;
  font-size: 0.92rem;
}
.q-common { background: #ece7df; color: #4d463e; }
.q-uncommon { background: #e5f2ea; color: #1f6b45; }
.q-rare { background: #e7f0fa; color: #1d4e89; }
.q-very { background: #f3e8ff; color: #6d28a8; }
.q-legend { background: #fdecdc; color: #9a4e12; }
.q-artifact { background: #fde8ee; color: #9f1239; }
.q-other { background: var(--paper-2); color: var(--ink); }
.chip-row a.q-common.is-on, .chip-row a.q-uncommon.is-on, .chip-row a.q-rare.is-on,
.chip-row a.q-very.is-on, .chip-row a.q-legend.is-on, .chip-row a.q-artifact.is-on {
  box-shadow: inset 0 0 0 1px currentColor;
}

.entry-lead { font-size: 1.12rem; max-width: 68ch; margin: 0.2rem 0 1rem; }
.entry-lead p { margin: 0 0 0.7rem; }
.access {
  max-width: 68ch;
  background: white;
  border: 1px solid var(--rule);
  border-left: 4px solid var(--copper);
  border-radius: 0.75rem;
  padding: 0.85rem 1rem 0.95rem;
  margin: 0 0 1.25rem;
}
.access h2 {
  font-family: var(--sans);
  font-size: 0.74rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--copper);
  margin: 0 0 0.4rem;
}
.access p { margin: 0.25rem 0 0; }
.fine { font-size: 0.88rem; }
.entry-nav { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-top: 2rem; border-top: 1px solid var(--rule); padding-top: 1rem; }
.entry-nav a { text-decoration: none; color: inherit; }
.entry-nav .next { text-align: right; }
.entry-nav small { display: block; color: var(--muted); letter-spacing: 0.08em; text-transform: uppercase; font-size: 0.72rem; }
.entry-nav a:hover { color: var(--copper-deep); }

.auth { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background:
  radial-gradient(circle at top left, rgba(224, 163, 106, 0.25), transparent 28rem),
  var(--paper);
}
.auth-card {
  width: min(28rem, 100%);
  background: white;
  border: 1px solid var(--rule);
  border-radius: 1rem;
  padding: 1.4rem 1.4rem 1.5rem;
  box-shadow: var(--shadow);
}
.auth-back { color: var(--muted); text-decoration: none; }
.stack { display: flex; flex-direction: column; gap: 0.75rem; }
.stack input, .stack select { width: 100%; }
.npc-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  gap: 0.75rem 1rem;
  margin: 0 0 1.5rem;
  padding: 1rem 1.1rem 1.15rem;
  background: white;
  border: 1px solid var(--rule);
  border-radius: 1rem;
}
.npc-form h2, .npc-form .lede, .npc-form button { grid-column: 1 / -1; }
.npc-form h2 { margin: 0; }
.npc-form .lede { margin: 0; }
.npc-form label { display: flex; flex-direction: column; gap: 0.28rem; color: var(--muted); font-size: 0.92rem; }
.npc-form input, .npc-form select {
  border: 1px solid var(--rule);
  background: white;
  border-radius: 0.55rem;
  padding: 0.5rem 0.65rem;
  width: 100%;
}
.catalog .inline-form { display: flex; gap: 0.4rem; align-items: center; margin: 0; }
.catalog .inline-form input { min-width: 9rem; }
.scrim { display: none; }

@media (max-width: 860px) {
  .nav-toggle { display: inline-flex; }
  .search kbd { display: none; }
  .sidebar {
    position: fixed;
    z-index: 20;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow);
  }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(20, 16, 12, 0.45); z-index: 15; }
  .content, .flash { width: min(1120px, calc(100% - 1.5rem)); }
  .plain-list { columns: 1; }
  .jumps { top: 3.6rem; }
  .entry-nav { grid-template-columns: 1fr; }
  .entry-nav .next { text-align: left; }
}
@media (max-width: 640px) {
  .catalog .name { min-width: 9rem; }
  h1 { font-size: 2rem; }
}

body.is-sheet .content { width: min(1180px, calc(100% - 2rem)); }
.sheet-tools, .sheet-tabs { display: flex; flex-wrap: wrap; gap: 0.65rem 0.8rem; align-items: end; margin: 0 0 0.8rem; }
.sheet-tools label, .sheet-identity label, .sheet-stats label, .detail-grid label { display: flex; flex-direction: column; gap: 0.2rem; font-size: 0.92rem; }
.sheet-tools input, .sheet-tools select, .sheet-identity input, .sheet-identity select, .sheet-stats input, .sheet-stats textarea, .detail-grid input, .detail-grid textarea, .ability input, .attack-row input, .coins input, .death input {
  border: 1px solid var(--rule);
  background: white;
  border-radius: 0.35rem;
  padding: 0.35rem 0.5rem;
}
.sheet-tools button, .sheet-delete button, .text-button {
  border: 1px solid var(--ink);
  background: white;
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
  cursor: pointer;
}
.sheet-tools button#sheet-save { background: var(--ink); color: white; }
.sheet-tabs { margin-top: 0.2rem; }
.sheet-tabs button { border: 1px solid var(--rule); background: transparent; border-radius: 999px; padding: 0.35rem 0.8rem; cursor: pointer; }
.sheet-tabs button.is-on { background: white; border-color: var(--copper); color: var(--copper-deep); }
.sheet-page {
  background: white;
  border: 1px solid var(--rule);
  border-radius: 0.8rem;
  padding: 1rem;
  box-shadow: var(--shadow);
}
.sheet-label { display: block; font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--copper); font-weight: 600; }
.sheet-identity, .detail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.7rem; }
.sheet-identity .grow { grid-column: span 2; }
.sheet-body { display: grid; grid-template-columns: 7.5rem minmax(16rem, 1.1fr) minmax(18rem, 1.3fr); gap: 1rem; margin-top: 1rem; }
.sheet-abilities { display: flex; flex-direction: column; gap: 0.45rem; }
.ability { display: grid; justify-items: center; border: 1px solid var(--rule); border-radius: 0.7rem; padding: 0.35rem; background: var(--paper); }
.ability span { font-size: 0.68rem; letter-spacing: 0.06em; text-transform: uppercase; }
.ability strong { font-family: var(--serif); font-size: 1.35rem; font-weight: 560; }
.ability input { width: 4rem; text-align: center; }
.save-grid, .skill-grid { display: grid; gap: 0.2rem; margin: 0.6rem 0; }
.save-grid label, .skill-grid label { display: flex; gap: 0.35rem; align-items: center; }
.skill-grid { grid-template-columns: 1fr 1fr; }
.skill-grid em { color: var(--muted); font-style: normal; font-size: 0.78rem; }
.prof-line, .passive, .checkline { margin: 0.35rem 0; }
.sheet-stats { display: flex; flex-direction: column; gap: 0.55rem; }
.sheet-stats textarea, .detail-grid textarea { min-height: 4.5rem; resize: vertical; }
.attack-head, .attack-row { display: grid; grid-template-columns: 1.4fr 0.6fr 1fr; gap: 0.35rem; }
.attack-head { color: var(--muted); font-size: 0.78rem; }
.coins, .death { display: flex; flex-wrap: wrap; gap: 0.45rem; }
.coins label, .death label { display: flex; flex-direction: column; font-size: 0.78rem; color: var(--muted); }
.coins input, .death input { width: 4.5rem; }
.spell-head { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0.4rem 1rem; margin-bottom: 0.8rem; }
.spell-filter { display: flex; flex-direction: column; gap: 0.25rem; max-width: 24rem; }
.spell-filter input { border: 1px solid var(--rule); border-radius: 0.35rem; padding: 0.4rem 0.55rem; }
.spell-list { display: grid; gap: 1rem; margin-top: 0.8rem; }
.spell-list h2 { font-size: 1rem; margin: 0 0 0.35rem; }
.spell-row { display: flex; gap: 0.45rem; align-items: center; padding: 0.15rem 0; }
.spell-check { display: flex; }
.spell-open {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--copper-deep);
  text-decoration: underline;
  text-underline-offset: 0.16em;
  cursor: pointer;
  text-align: left;
}
.spell-open:hover { color: var(--copper); }
.spell-dialog {
  width: min(42rem, calc(100vw - 2rem));
  max-height: min(80vh, 42rem);
  overflow: auto;
  border: 2px solid #7a3b22;
  border-radius: 0.35rem;
  padding: 0.9rem 1.05rem 1.1rem;
  background: #f7f1e4;
  color: var(--ink);
  box-shadow: inset 0 0 0 1px #c4a574, var(--shadow);
}
.spell-dialog::backdrop { background: rgba(28, 25, 21, 0.48); }
.spell-dialog-close {
  float: right;
  border: 1px solid var(--ink);
  background: white;
  border-radius: 999px;
  padding: 0.25rem 0.75rem;
  cursor: pointer;
}
.monster-layout { display: grid; grid-template-columns: minmax(0, 42rem) minmax(14rem, 20rem); gap: 1.2rem; align-items: start; margin-bottom: 1.2rem; }
.monster-layout.no-art { grid-template-columns: minmax(0, 42rem); }
.statblock {
  background: #f7f1e4;
  border: 2px solid #7a3b22;
  border-radius: 0.35rem;
  padding: 0.9rem 1.05rem 1.1rem;
  box-shadow: inset 0 0 0 1px #c4a574;
}
.stat-name {
  margin: 0;
  color: #7a3b22;
  font-size: 1.7rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 2px solid #7a3b22;
  padding-bottom: 0.25rem;
}
.stat-type { font-style: italic; margin: 0.4rem 0 0.2rem; }
.statblock .rule { border: 0; border-top: 1px solid #7a3b22; margin: 0.45rem 0; }
.statblock p { margin: 0.18rem 0; }
.ability-table { width: 100%; border-collapse: collapse; text-align: center; margin: 0.2rem 0; }
.ability-table th { font-size: 0.72rem; letter-spacing: 0.08em; color: #7a3b22; font-weight: 700; }
.ability-table td { padding-top: 0.15rem; }
.stat-section {
  margin: 0.7rem 0 0.25rem;
  color: #7a3b22;
  font-size: 1rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  border-bottom: 1px solid #7a3b22;
}
.stat-traits p { margin: 0.35rem 0; }
.stat-traits strong { color: #7a3b22; }
.stat-prose p { margin: 0.45rem 0; }
.statblock .features { margin: 0.15rem 0 0.4rem; }
.stat-source { margin-top: 0.8rem !important; color: var(--muted); font-size: 0.92rem; }
.monster-art { margin: 0; background: #f7f1e4; border: 2px solid #c4a574; border-radius: 0.7rem; padding: 0.45rem; }
.monster-art img { display: block; width: 100%; height: auto; }
@media (max-width: 800px) {
  .monster-layout, .monster-layout.no-art { grid-template-columns: 1fr; }
}
.spell-dialog .statblock {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
}
.spell-dialog h2#spell-dialog-title { padding-right: 5rem; }
.spell-dialog .access { margin-top: 0.9rem; background: #fffaf3; }
.prep-label { color: var(--muted); font-size: 0.78rem; }
.sheet-delete { margin-top: 1rem; }
.text-button { margin-top: 0.2rem; }
@media (max-width: 980px) {
  .sheet-body, .sheet-identity, .detail-grid, .spell-head, .skill-grid { grid-template-columns: 1fr 1fr; }
  .sheet-abilities { flex-direction: row; flex-wrap: wrap; }
}
@media print {
  .sidebar, .topbar, .scrim, .sheet-tools, .sheet-tabs, .sheet-delete, .page-head, .text-button, .spell-dialog { display: none !important; }
  .shell { display: block; }
  .sheet-page { box-shadow: none; border: 0; }
  .sheet-page[hidden] { display: block !important; break-before: page; }
}
