
:root {
  color-scheme: dark;
  --night: #100a08;
  --surface: #261914;
  --raised: #3b281e;
  --ink: #ffedc1;
  --muted: #e6c98a;
  --accent: #e5b957;
  --primary: #801d2e;
  --positive: #9dbe9a;
  --danger: #f0a197;
  --edge: color-mix(in srgb, var(--accent) 32%, var(--surface));
  --rule: color-mix(in srgb, var(--ink) 16%, transparent);
  --field: color-mix(in srgb, var(--surface), var(--night) 44%);
  --paper: color-mix(in srgb, var(--surface), var(--night) 18%);
  --art: url("themes/classic.webp");
  --page: 1536px;
  --serif: Georgia, "Times New Roman", serif;
  font: 16px/1.4 system-ui, sans-serif;
  background: var(--night);
  color: var(--ink);
  scrollbar-color: var(--edge) var(--field);
}
* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; }
[hidden] { display: none !important; }
a { color: inherit; }
::selection { color: var(--night); background: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.skip { position: absolute; top: .5rem; left: .5rem; z-index: 20; padding: .5rem; background: var(--night); transform: translateY(-200%); }
.skip:focus { transform: none; }

button, input, select, textarea { font: inherit; }
button, select, input, textarea, .file-menu summary {
  border: 1px solid var(--edge);
  border-radius: 5px;
  background: var(--field);
  color: var(--ink);
  min-height: 34px;
  padding: .34rem .56rem;
}
button, select, .file-menu summary { cursor: pointer; }
button:hover:not(:disabled), select:hover, .file-menu summary:hover { background: var(--raised); border-color: var(--accent); }
button:disabled { opacity: .43; cursor: default; }
button.primary { background: var(--accent); border-color: var(--accent); color: var(--night); font-weight: 720; }
button.primary:hover:not(:disabled) { background: color-mix(in srgb, var(--accent), white 14%); }
button.danger { background: color-mix(in srgb, #903f36 48%, var(--surface)); border-color: color-mix(in srgb, var(--danger) 50%, var(--surface)); }
button.quiet { color: var(--accent); font-size: .75rem; min-height: 29px; white-space: normal; }
input, textarea { width: 100%; caret-color: var(--accent); }
input[type="checkbox"] { width: auto; min-height: 1.15rem; min-width: 1.15rem; accent-color: var(--accent); }
textarea { resize: vertical; }
input::placeholder, textarea::placeholder { color: var(--muted); opacity: .86; }
select { min-width: 0; }
small { color: var(--muted); font-size: .72rem; }
h1, h2, h3, p { margin: 0; }
h2 { font: bold 1.4rem/1.14 var(--serif); color: var(--ink); }
h3 { font-size: .86rem; line-height: 1.2; }
p { overflow-wrap: anywhere; }
.actions { display: flex; align-items: center; gap: .35rem; flex-wrap: wrap; }
.prose { display: grid; gap: .65rem; white-space: pre-wrap; overflow-wrap: anywhere; }
.empty { color: var(--muted); font-size: .8rem; margin: .25rem 0; }

.top { border-bottom: 1px solid var(--edge); background: var(--paper); }
.top-inner {
  width: min(100% - 2rem, var(--page));
  min-height: 56px;
  margin: auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, max-content) minmax(0, 1fr);
  align-items: center;
  gap: .55rem;
}
.brand {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: .5rem;
  font: bold 1.48rem var(--serif);
  text-decoration: none;
  color: var(--accent);
}
.brand img { border-radius: 8px; object-fit: cover; }
.site-nav { display: flex; align-items: center; gap: .22rem; }
.site-nav a { padding: .36rem .62rem; border: 1px solid transparent; border-radius: 5px; font-size: .83rem; font-weight: 650; color: var(--muted); text-decoration: none; }
.site-nav a:hover, .site-nav a[aria-current] { border-color: var(--edge); background: var(--field); color: var(--accent); }
.roster-control, .utilities { display: flex; align-items: center; gap: .42rem; font-size: .82rem; min-width: 0; }
.roster-control { grid-column: 3; }
.utilities { grid-column: 4; justify-content: flex-end; }
.roster-control label, .utilities label { color: var(--muted); }
.roster-control select { width: clamp(7rem, 14vw, 13rem); }
.utilities select { max-width: min(16rem, 52%); }
.file-menu { position: relative; }
.file-menu summary { list-style: none; display: flex; align-items: center; gap: .4rem; }
.file-menu summary::after { content: ""; width: .38rem; height: .38rem; border-right: 1px solid var(--accent); border-bottom: 1px solid var(--accent); transform: rotate(45deg) translateY(-2px); }
.file-menu-actions { display: grid; gap: .33rem; position: absolute; z-index: 12; top: calc(100% + .35rem); right: 0; width: 10.4rem; padding: .4rem; border: 1px solid var(--edge); border-radius: 5px; background: var(--surface); box-shadow: 0 8px 20px #0007; }

.layout { width: min(100% - 2rem, var(--page)); margin: .85rem auto 1.4rem; }
.layout:focus { outline: none; }
.breadcrumbs { margin: 0 0 .58rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .38rem; margin: 0; padding: 0; list-style: none; color: var(--muted); font-size: .78rem; }
.breadcrumbs li { display: inline-flex; align-items: center; gap: .4rem; overflow-wrap: anywhere; min-width: 0; }
.breadcrumbs li + li::before { content: ""; flex: 0 0 auto; width: .32rem; height: .32rem; border-top: 1px solid var(--accent); border-right: 1px solid var(--accent); transform: rotate(45deg); }
.breadcrumbs [aria-current] { color: var(--ink); }
.breadcrumbs a { text-underline-offset: .2em; }
.roster-page, .shop-page, .theme-detail, .missing-page { max-width: 1170px; margin-inline: auto; }
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  flex-wrap: wrap;
  gap: .68rem 1rem;
  border: 1px solid var(--edge);
  border-radius: 8px;
  padding: clamp(.85rem, 3.2vw, 2rem);
  margin-bottom: .85rem;
  background: linear-gradient(90deg, var(--night), color-mix(in srgb, var(--night) 58%, transparent)), var(--art) center / cover var(--paper);
}
.page-heading h1, .theme-detail h1 { font: bold clamp(1.95rem, 4vw, 3.1rem)/1.07 var(--serif); color: var(--ink); }
.page-heading p, .theme-detail p { color: var(--muted); font-size: .92rem; margin-top: .33rem; max-width: 56ch; }
.page-note { color: var(--muted); font-size: .83rem; margin-top: .7rem; }
.hero-grid, .theme-grid { list-style: none; padding: 0; margin: 0; display: grid; gap: .68rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr)); }
.hero-grid li, .theme-grid li { min-width: 0; }
.hero-card, .theme-card {
  min-width: 0;
  border: 1px solid var(--edge);
  background: var(--surface);
  border-radius: 7px;
  text-decoration: none;
}
.hero-card:hover, .theme-card:hover { border-color: var(--accent); background: var(--raised); }
.hero-card { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: .4rem .7rem; padding: .72rem; }
.hero-card .portrait { width: 48px; height: 50px; font-size: 1.3rem; }
.hero-card-copy { display: grid; gap: .13rem; min-width: 0; overflow-wrap: anywhere; }
.hero-card-copy strong, .theme-card-copy strong { font: bold 1.22rem/1.1 var(--serif); }
.hero-card-copy span, .hero-card-status { color: var(--muted); font-size: .77rem; }
.hero-card-status { grid-column: 2 / -1; }
.hero-card-meta { display: grid; justify-items: center; color: var(--accent); }
.hero-card-meta strong { font: bold 1.18rem var(--serif); }
.theme-card { overflow: hidden; display: block; height: 100%; }
.theme-image { display: block; width: 100%; height: auto; aspect-ratio: 8 / 3; object-fit: cover; background: var(--field); }
.theme-card-copy { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: .27rem .5rem; padding: .64rem .73rem; }
.theme-price { color: var(--accent); font-size: .82rem; }
.shop-page > input { margin-bottom: .68rem; max-width: 24rem; }
.store-information { display: flex; flex-wrap: wrap; gap: .45rem 1rem; margin-top: .8rem; padding: .6rem 0 0; border-top: 1px solid var(--edge); color: var(--muted); font-size: .79rem; }
.store-information a { text-underline-offset: .2em; }
.store-information a:hover { color: var(--accent); }
.theme-detail { border: 1px solid var(--edge); background: var(--surface); border-radius: 9px; overflow: hidden; }
.theme-detail .theme-image { aspect-ratio: 3.4; }
.theme-detail-copy { padding: clamp(.85rem, 3.2vw, 2rem); display: grid; justify-items: start; gap: .55rem; }
.theme-detail-copy .theme-price { font-size: 1rem; }
.link-button { min-height: 34px; display: inline-flex; align-items: center; padding: .35rem .62rem; border: 1px solid var(--edge); border-radius: 5px; font-size: .82rem; text-decoration: none; background: var(--field); }
.link-button:hover { border-color: var(--accent); background: var(--raised); }
.link-primary, .link-primary:hover { color: var(--night); background: var(--accent); font-weight: 720; }
.hero-banner {
  position: relative;
  min-height: 112px;
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: .6rem 1.4rem;
  border: 1px solid var(--edge);
  border-radius: 9px 9px 4px 4px;
  padding: .65rem 1rem .65rem 1.05rem;
  background:
    linear-gradient(90deg, var(--night) 0%, color-mix(in srgb, var(--night) 87%, transparent) 29%, color-mix(in srgb, var(--night) 26%, transparent) 66%, color-mix(in srgb, var(--night) 70%, transparent)),
    var(--art) center 51% / cover var(--paper);
  box-shadow: 0 3px 14px #0003;
}
.hero-banner::before {
  content: "";
  position: absolute;
  inset: 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 27%, transparent);
  border-radius: 6px 6px 2px 2px;
  pointer-events: none;
}
.hero-identity { min-width: 0; display: flex; align-items: center; gap: .72rem; }
.hero-identity > div { min-width: 0; }
.hero-identity h1 { font: bold clamp(1.95rem, 3.6vw, 2.85rem)/1 var(--serif); letter-spacing: -.025em; overflow-wrap: anywhere; }
.portrait { width: 61px; height: 66px; padding: 0; overflow: hidden; display: grid; place-items: center; border: 1px solid var(--accent); border-radius: 6px; background: var(--surface); color: var(--accent); font: bold 1.85rem var(--serif); }
.portrait img { display: block; width: 100%; height: 100%; object-fit: cover; }
.demo-label { color: var(--accent); }
#hero-meta { color: var(--muted); font-size: .82rem; margin: .24rem 0 .28rem; }
#character-actions button { min-height: 27px; padding: .23rem .55rem; font-size: .74rem; }
.hero-facts { flex: 0 0 auto; display: flex; align-items: stretch; gap: .35rem; }
.metric { min-width: 4.7rem; padding: .32rem .48rem; background: color-mix(in srgb, var(--night) 86%, var(--surface)); border: 1px solid var(--edge); border-radius: 5px; text-align: center; display: flex; flex-direction: column-reverse; justify-content: center; }
.metric small, .health-meter small { font-size: .68rem; }
.metric strong, .health-meter strong { font: bold 1.38rem/1.1 var(--serif); color: var(--accent); white-space: nowrap; }
.metric.armor strong { color: var(--ink); }
.summary-roll { padding: 0; background: transparent; border: 0; }
.summary-roll .metric { height: 100%; }
.summary-roll:hover:not(:disabled) .metric { border-color: var(--accent); background: var(--primary); }

.navigation {
  position: sticky;
  top: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .3rem .6rem;
  min-height: 47px;
  background: var(--night);
  border-bottom: 1px solid var(--edge);
  padding: .28rem .12rem;
  margin: .15rem 0 .6rem;
}
.navigation nav, .navigation-dice { display: flex; align-items: center; gap: .18rem; }
.navigation nav { overflow: auto; scrollbar-width: thin; }
.navigation nav a { display: block; padding: .43rem .62rem; border-radius: 4px; white-space: nowrap; font-size: .82rem; font-weight: 650; color: var(--muted); text-decoration: none; }
.navigation nav a:hover, .navigation nav a:focus-visible, .navigation nav a[aria-current] { background: var(--raised); color: var(--ink); }
.navigation-dice { flex: 0 0 auto; gap: .37rem; }
.navigation-dice select, .navigation-dice button { min-height: 31px; font-size: .77rem; }
#roll-dice { color: var(--accent); }

.board {
  display: grid;
  grid-template-columns: minmax(0, 1.13fr) minmax(0, 1.02fr) minmax(0, .94fr);
  gap: .62rem;
  align-items: start;
}
.lane { display: grid; gap: .62rem; min-width: 0; }
.encounter-lane { grid-column: 2; grid-row: 1; }
.check-lane { grid-column: 1; grid-row: 1; }
.kit-lane { grid-column: 3; grid-row: 1; }
.block {
  min-width: 0;
  border: 1px solid var(--edge);
  border-radius: 7px;
  background: var(--surface);
  padding: .62rem .72rem .72rem;
  scroll-margin-top: 56px;
}
.block:target { outline: 1px solid var(--accent); outline-offset: -1px; }
.block-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .28rem .4rem;
  margin-bottom: .53rem;
  padding-bottom: .42rem;
  border-bottom: 1px solid var(--edge);
}
.block-heading .actions { justify-content: flex-end; }
.block-heading h2 { overflow-wrap: anywhere; }
.ability-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .68rem; }
.ability-stack { display: grid; align-content: start; gap: .52rem; }
.ability-group { min-width: 0; display: grid; gap: .19rem; }
.ability-heading { display: flex; align-items: center; justify-content: space-between; gap: .26rem; }
.ability-heading h3 { font: bold 1.05rem var(--serif); overflow-wrap: anywhere; }
.ability-heading strong { color: var(--accent); font-size: .93rem; }
.ability-group > .actions { display: grid; grid-template-columns: 1.17fr 1fr; gap: .22rem; }
.ability-group > .actions button { padding: .18rem .22rem; min-height: 28px; font-size: .7rem; text-align: center; }
.save-roll[data-trained="true"] { border-color: var(--positive); }
.skill-row {
  width: 100%;
  min-height: 25px;
  display: grid;
  grid-template-columns: .58rem minmax(0, 1fr) auto;
  align-items: center;
  gap: .36rem;
  padding: .14rem .28rem;
  background: color-mix(in srgb, var(--raised) 55%, var(--surface));
  border-color: transparent;
  text-align: left;
  font-size: .73rem;
  overflow-wrap: anywhere;
}
.skill-row > strong { min-width: 1.44rem; text-align: right; color: var(--accent); font-variant-numeric: tabular-nums; }
.skill-mark { width: .53rem; height: .53rem; border: 1px solid var(--muted); border-radius: 50%; }
.skill-mark[data-rank="1"] { border-color: var(--accent); background: var(--accent); }
.skill-mark[data-rank="2"] { border-color: var(--accent); background: var(--accent); box-shadow: 0 0 0 2px var(--surface), 0 0 0 3px var(--accent); }
.subheading { color: var(--muted); margin: .6rem 0 .37rem; }
.passives { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .26rem; }
.passives .metric { min-width: 0; padding: .32rem .15rem; background: var(--field); }
.passives .metric small { overflow-wrap: anywhere; font-size: .66rem; }
.passives .metric strong { font-size: 1.05rem; }
details:not(.file-menu) { margin-top: .32rem; }
details:not(.file-menu) > summary { cursor: pointer; color: var(--accent); font-size: .76rem; padding: .22rem 0; }
.proficiency-list { display: grid; grid-template-columns: minmax(0, auto) 1fr; gap: .3rem .45rem; margin: .4rem 0 0; font-size: .77rem; }
.proficiency-list dt { color: var(--muted); }
.proficiency-list dd { margin: 0; overflow-wrap: anywhere; }

.health-meter { display: grid; grid-template-columns: 1.2fr 1fr; gap: .35rem; margin: 0 0 .42rem; }
.health-value, .temp-value { border: 1px solid var(--edge); border-radius: 5px; background: var(--field); padding: .4rem .52rem; display: flex; justify-content: space-between; align-items: center; gap: .4rem; }
.health-value { background: color-mix(in srgb, var(--primary) 39%, var(--surface)); }
.health-value strong { color: var(--ink); }
.health-meter progress { appearance: none; grid-column: 1 / -1; height: 4px; width: 100%; border: 0; border-radius: 6px; overflow: hidden; background: var(--field); }
.health-meter progress::-webkit-progress-bar { background: var(--field); }
.health-meter progress::-webkit-progress-value { background: var(--positive); border-radius: 6px; }
.health-meter progress::-moz-progress-bar { background: var(--positive); }
#combat input { width: 4rem; }
#combat .actions button { font-size: .74rem; }
.combat-toolbar { display: flex; flex-wrap: wrap; gap: .3rem; margin-top: .45rem; }
.status-toggle, .effect, .death-mark { min-height: 27px; font-size: .72rem; padding: .2rem .41rem; }
.status-toggle[aria-pressed="true"], .death-mark[aria-pressed="true"] { color: var(--night); border-color: var(--accent); background: var(--accent); font-weight: 680; }
.effect-list { display: flex; flex-wrap: wrap; gap: .25rem; margin-top: .48rem; }
.effect { color: var(--positive); }
.death-track { border: 1px solid var(--edge); border-radius: 5px; padding: .45rem; margin-top: .38rem; display: grid; gap: .3rem; font-size: .76rem; }

.collection-list { max-height: 12rem; overflow: auto; scrollbar-width: thin; min-width: 0; }
.attack-list { max-height: 8.25rem; }
.resource-list, .feature-list { max-height: 9.5rem; }
.attack-row, .resource-row, .gear-row, .spell-row, .feature-row, .slot-row {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .34rem;
  padding: .31rem .05rem;
  border-bottom: 1px solid var(--rule);
}
.attack-row { display: grid; grid-template-columns: minmax(0, 1fr) 4.45rem 4.5rem; }
.attack-row > div, .spell-row > div, .gear-row > div, .resource-row > div { min-width: 0; }
.attack-row small, .spell-row small, .gear-row small, .resource-row small { display: block; overflow-wrap: anywhere; }
.attack-labels { color: var(--muted); text-align: center; font-size: .65rem; padding-top: 0; }
.attack-labels :first-child { text-align: left; }
.roll-chip, .plain-damage { text-align: center; padding: .17rem .24rem; min-height: 28px; font-size: .76rem; color: var(--accent); overflow-wrap: anywhere; }
.text-button { min-height: 26px; padding: .05rem 0; border: 0; background: transparent; text-align: left; font-weight: 640; font-size: .83rem; overflow-wrap: anywhere; }
.text-button:hover:not(:disabled) { background: transparent; color: var(--accent); text-decoration: underline; text-underline-offset: .18em; }
.spell-row, .gear-row { padding-block: .2rem; }
.spell-row .text-button, .gear-row .text-button { min-height: 21px; }
.step { min-width: 1.62rem; min-height: 27px; padding: .11rem .25rem; font-size: .82rem; }
.counter { min-width: 2rem; text-align: center; font-size: .77rem; color: var(--accent); }
.resource-row strong { font-size: .79rem; }
.resource-row .actions, .slot-row .actions { flex-wrap: nowrap; }

.slot-area { margin-bottom: .49rem; }
.magic-stats { display: flex; align-items: center; justify-content: space-between; gap: .38rem; flex-wrap: wrap; margin-bottom: .36rem; font-size: .77rem; color: var(--accent); }
.subheading-row { display: flex; justify-content: space-between; align-items: center; gap: .35rem; margin-bottom: .23rem; color: var(--muted); }
.slots { max-height: 7rem; overflow: auto; scrollbar-width: thin; }
.slot-row { font-size: .78rem; padding-block: .16rem; }
.collection-filters { display: flex; align-items: center; gap: .28rem; }
.collection-filters input { min-width: 0; }
.collection-filters button { flex: 0 0 auto; }
input[type="search"], textarea { font-size: .8rem; }
#magic .collection-list { max-height: 9rem; }
.concentration { margin-bottom: .35rem; padding: .33rem; border: 1px solid var(--positive); border-radius: 4px; display: flex; gap: .31rem; justify-content: space-between; align-items: center; flex-wrap: wrap; font-size: .73rem; }
.concentration strong { color: var(--positive); }

.inventory-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: .27rem .5rem;
  margin-bottom: .42rem;
  font-size: .75rem;
  color: var(--muted);
}
.summary-action { color: var(--accent); font-weight: 700; min-height: 29px; }
.inventory-summary details { flex: 1; min-width: max-content; }
.inventory-summary details[open] { flex-basis: 100%; }
.attached-list { display: grid; gap: .12rem; }
.attached-list .actions { justify-content: space-between; }
.gear-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; }
.equip { display: grid; place-items: center; color: var(--muted); }
.equip::before { content: ""; height: .49rem; width: .49rem; border: 1px solid currentColor; transform: rotate(45deg); }
.equip[aria-pressed="true"] { color: var(--accent); border-color: var(--accent); }
.equip[aria-pressed="true"]::before { background: currentColor; }
.collection-label { margin: .33rem 0 .12rem; color: var(--muted); font-size: .68rem; }
.bio { font-size: .78rem; overflow-wrap: anywhere; }
.bio p { margin: .2rem 0 .54rem; }
footer { color: var(--muted); font-size: .71rem; margin: .63rem 0 0; }

.roll-feed, .toast {
  z-index: 9;
  position: fixed;
  bottom: .75rem;
  right: max(.75rem, calc((100% - var(--page)) / 2));
  max-width: min(380px, calc(100vw - 1.5rem));
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: var(--field);
  box-shadow: 0 7px 25px #0007;
}
.roll-feed { display: flex; align-items: center; gap: .55rem; padding: .47rem; }
#roll-result { display: flex; align-items: center; gap: .53rem; font-size: .76rem; }
#roll-result strong { padding: .18rem .53rem; color: var(--accent); border-right: 1px solid var(--edge); font: bold 1.6rem/1.1 var(--serif); }
#roll-result small { display: block; }
#roll-dismiss { min-height: 28px; padding: .14rem .35rem; }
.toast { z-index: 10; padding: .45rem .64rem; font-size: .8rem; }
.toast:empty { display: none; }
.roll-feed:not([hidden]) + .toast { bottom: 4.75rem; }
dialog {
  width: min(40rem, calc(100% - 1.2rem));
  max-height: 85dvh;
  padding: .95rem 1.05rem;
  border: 1px solid var(--accent);
  border-radius: 7px;
  background: var(--surface);
  color: var(--ink);
}
dialog::backdrop { background: #070604cb; }
dialog h2 { margin-bottom: .72rem; }
dialog .actions { margin-top: .55rem; }
.prose > .actions { margin-top: .04rem; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .58rem; }
.form-grid label { display: grid; gap: .23rem; font-size: .82rem; }
.form-grid .checkbox-field { display: flex; flex-direction: row-reverse; justify-content: start; align-items: center; min-height: 34px; }
.form-grid .wide { grid-column: 1 / -1; }
.form-error { color: var(--danger); font-size: .8rem; margin-top: .34rem; }
.form-error:empty { display: none; }
.dice-dialog { display: grid; gap: .45rem; }
.dice-form { flex-wrap: nowrap; }
.roll-history { max-height: 12rem; overflow: auto; }
@media (max-width: 1190px) {
  .block { padding-inline: .5rem; }
  .ability-grid { gap: .37rem; }
  .ability-group > .actions button { font-size: .65rem; }
  .attack-row { grid-template-columns: minmax(0, 1fr) 3.6rem 3.4rem; }
}
@media (max-width: 920px) {
  .board { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
  .kit-lane { grid-column: 1 / -1; grid-row: 2; grid-template-columns: 1fr 1fr; align-items: start; }
}
@media (max-width: 740px) {
  .top-inner, .layout { width: calc(100% - 1.05rem); }
  .top-inner { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); padding: .36rem 0; gap: .35rem; }
  .brand { font-size: 1.23rem; gap: .34rem; }
  .brand img { width: 28px; height: 28px; }
  .utilities { grid-column: 2; grid-row: 1; }
  .utilities label { display: none; }
  .utilities select { max-width: none; width: 100%; }
  .site-nav { grid-column: 1 / -1; grid-row: 2; }
  .roster-control { grid-column: 1 / -1; grid-row: 3; }
  .roster-control select { flex: 1; width: auto; }
  .hero-banner { align-items: start; flex-direction: column; padding: .72rem .68rem; gap: .5rem; }
  .portrait { width: 46px; height: 51px; font-size: 1.45rem; }
  .hero-facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); width: 100%; }
  .hero-facts .metric { min-width: 0; padding: .25rem .22rem; }
  .hero-facts .metric strong { font-size: 1.1rem; }
  .hero-facts .metric small { font-size: .62rem; }
  .navigation { display: grid; grid-template-columns: minmax(0, 1fr); gap: .17rem; margin-bottom: .45rem; }
  .navigation nav a { padding: .36rem .42rem; font-size: .75rem; }
  .navigation-dice { justify-content: flex-end; }
  .board { grid-template-columns: minmax(0, 1fr); }
  .lane, .encounter-lane, .check-lane, .kit-lane { display: grid; grid-column: auto; grid-row: auto; grid-template-columns: minmax(0, 1fr); }
  .block { scroll-margin-top: 87px; }
}
@media (max-width: 380px) {
  .block-heading h2 { font-size: 1.28rem; }
  .block-heading .quiet { font-size: .67rem; padding-inline: .25rem; }
  .ability-heading h3 { font-size: .92rem; }
  .ability-group > .actions button { font-size: .62rem; padding-inline: .08rem; }
  .collection-filters button { font-size: .66rem; }
}
@media print {
  :root { color-scheme: light; --night: #fff; --surface: #fff; --raised: #f2f2f2; --ink: #191919; --muted: #404040; --accent: #473b25; --edge: #777; --positive: #365336; --primary: #f5f5f5; }
  body { background: white; }
  .top, .navigation, .breadcrumbs, footer, .toast, .roll-feed, #character-actions, button.quiet, button.danger, #combat > .actions, .skip { display: none !important; }
  .layout { width: 100%; margin: 0; }
  .hero-banner { min-height: 0; background: white; box-shadow: none; padding: .4rem; flex-direction: row; align-items: center; break-inside: avoid; }
  .hero-facts { display: flex; width: auto; }
  .board { display: block; }
  .lane { margin-top: .4rem; }
  .block, .ability-group, .spell-row, .attack-row, .gear-row { break-inside: avoid; }
  .collection-list, .slots { max-height: none !important; overflow: visible; }
  .collection-filters, input[type="search"] { display: none; }
  button, textarea { color: #191919; }
}

