:root {
	color-scheme: light dark;
	--background-colour: light-dark(#fffefa, #222523);
	--border-colour: light-dark(#484943, #aaa99d);
	--text-colour-base: light-dark(#252823, #ecece3);
	--text-colour-placeholder: light-dark(#646a63, #bbbeb5);
	--sheet-muted: light-dark(#656960, #b6b9af);
	--sheet-wash: light-dark(#eeeee7, #323732);
	--sheet-rule: light-dark(#c7c9bf, #555e55);
	--sheet-accent: light-dark(#186579, #9dd3de);
	--sheet-width: 1060px;
}

*, *::before, *::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	padding: 32px 20px 20px;
	color: var(--text-colour-base);
	background: light-dark(#e8e9e2, #171a18);
	font: 13px/1.4 Arial, Helvetica, sans-serif;
}

.charsheet {
	max-width: var(--sheet-width);
	margin-inline: auto;
	padding: 28px;
	border: 1px solid var(--sheet-rule);
	background-color: var(--background-colour);
	box-shadow: 0 3px 18px #0000000d;
}

.charsheet label {
	cursor: pointer;
}

.charsheet :is(input, textarea, select) {
	min-width: 0;
	max-width: 100%;
	margin: 0;
	padding: 3px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--text-colour-base);
	font: inherit;
}

.charsheet :is(input:not([type="checkbox"]), textarea) {
	width: 100%;
}

.charsheet textarea {
	resize: vertical;
	line-height: 1.6;
}

.charsheet input[type="number"] {
	appearance: textfield;
}

.charsheet input::-webkit-inner-spin-button,
.charsheet input::-webkit-outer-spin-button {
	appearance: none;
	margin: 0;
}

.charsheet ::placeholder {
	color: var(--text-colour-placeholder);
	opacity: 1;
}

.charsheet :is(input, textarea, select):hover {
	background: var(--sheet-wash);
}

:is(input, textarea, select, summary, button):focus-visible {
	outline: 2px solid var(--sheet-accent);
	outline-offset: 2px;
}

.charsheet input[data-calculation-state]::placeholder {
	color: var(--text-colour-base);
	opacity: 1;
}

.charsheet input[data-calculation-state="override"] {
	color: var(--sheet-accent, var(--text-colour-base));
	text-decoration: underline;
	text-underline-offset: 0.15em;
}

.validation-message {
	display: block;
	color: light-dark(#8b0000, #ffb4ab);
	font-size: 0.875rem;
}

.validation-message:empty {
	display: none;
}

.sr-only {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
}

.sheet-actions {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.75rem;
	margin-block-end: 1rem;
}

.sheet-actions,
body > footer {
	max-width: var(--sheet-width);
	margin-inline: auto;
}

.sheet-actions button {
	padding: 8px 12px;
	border: 1px solid var(--sheet-rule);
	border-radius: 4px;
	background: var(--background-colour);
	color: var(--text-colour-base);
	font: inherit;
	cursor: pointer;
}

.sheet-actions button:disabled {
	opacity: 0.6;
}

body > footer {
	margin-top: 20px;
	color: var(--sheet-muted);
	font-size: 11px;
	text-align: center;
}

.print-value {
	display: none;
}

@media print {
	:root {
		color-scheme: light;
		--background-colour: white;
		--border-colour: #333;
		--text-colour-base: #111;
		--text-colour-placeholder: #555;
		--sheet-muted: #444;
		--sheet-wash: #f2f2f2;
		--sheet-rule: #bbb;
		--sheet-accent: #111;
	}

	body {
		padding: 0;
		background: white;
	}

	.charsheet {
		max-width: none;
		padding: 0;
		border: 0;
		box-shadow: none;
	}

	.sheet-actions,
	body > footer {
		display: none;
	}

	.charsheet.printing :is(input:not([type="checkbox"]), textarea, select) {
		display: none;
	}

	.charsheet .print-value {
		display: block;
		white-space: pre-wrap;
		overflow-wrap: anywhere;
		min-width: 0;
	}

	.charsheet .print-value.overridden {
		text-decoration: underline;
		text-underline-offset: 0.15em;
	}

	.charsheet .validation-message {
		display: none;
	}
}
/* D&D 2024 layout; theme and native controls come from base.css. */
.charsheet :is(section, div, li) {
  min-width: 0;
}

.charsheet ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.charsheet :is(input, textarea, select, summary):focus-visible {
  background-color: var(--sheet-wash);
}

.charsheet .death-dot:focus-visible {
  outline: 2px solid var(--sheet-accent);
  outline-offset: 2px;
  background-color: var(--sheet-wash);
}

.charsheet :where(header label, .label-container, .label,
  .textblock > label, .combat label, .attacksandspellcasting > div > label,
  .equipment > div > label, .flavor label, .features label) {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .045em;
  text-transform: uppercase;
}

.charsheet>header {
  display: grid;
  grid-template-columns: 1fr 2fr;
  align-items: center;
}

.charname {
  display: flex;
  flex-direction: column-reverse;
  padding: 12px 16px;
  border: 1px solid var(--border-colour);
  border-right: 0;
  border-radius: 3px 0 0 3px;
  box-shadow: 0 5px 0 var(--sheet-wash), 0 -5px 0 var(--sheet-wash);
}

.charname :is(input, .print-value) {
  font: 25px Georgia, serif;
  height: 42px;
}

.charname label {
  border-top: 1px solid var(--sheet-rule);
  padding-top: 4px;
}

.misc {
  padding: 12px 16px;
  border: 1px solid var(--border-colour);
  border-radius: 8px 2px;
}

/* Wrapped labels must not shift their inputs above the rest of the row. */
.misc ul {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  align-items: start;
  gap: 10px 12px;
}

.misc li {
  display: flex;
  flex-direction: column-reverse;
  grid-column: span 2;
}

.misc li:first-child {
  grid-column: span 4;
}

.misc li:nth-child(2) {
  grid-column: span 2;
}

.misc li:nth-child(4) {
  grid-column: span 4;
}

.misc li:nth-child(n+5) {
  grid-column: span 4;
}

.misc li:nth-last-child(-n+2) {
  grid-column: span 6;
}

.training fieldset {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  margin: 0 0 12px;
  padding: 0;
  border: 0;
}

.training legend {
  margin-bottom: 6px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
}

.training fieldset label {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
}

.training :is(textarea, textarea + .print-value) {
  display: block;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--sheet-rule);
}

.misc :is(input, .print-value) {
  border-bottom: 1px solid var(--sheet-rule);
  height: 28px;
}

.misc label {
  padding-top: 4px;
}

.sheet-help {
  margin: 16px 0;
  color: var(--sheet-muted);
  font-size: 12px;
}

.sheet-help summary {
  cursor: pointer;
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: .1em;
}

.sheet-help summary span {
  float: right;
  text-transform: none;
  letter-spacing: 0;
}

.sheet-help p {
  max-width: 90ch;
  margin: 10px 0;
}

.sheet-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.sheet-body>section {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.attributes {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px;
}

.scores {
  padding: 10px 6px;
  background: var(--sheet-wash);
  border-radius: 12px;
}

.scores ul {
  display: grid;
  grid-template-rows: repeat(6, 1fr);
  gap: 18px;
  height: 100%;
}

.scores li {
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.score {
  padding: 7px 2px 10px;
  background: var(--background-colour);
  border: 1px solid var(--border-colour);
  border-radius: 10px 3px;
  box-shadow: inset 0 0 0 2px var(--background-colour), inset 0 0 0 3px var(--sheet-rule);
}

.score label {
  display: block;
  font-size: 8px;
  font-weight: 700;
  text-transform: uppercase;
}

.score :is(input, .print-value) {
  height: 50px;
  font: 34px Georgia, serif;
  text-align: center;
}

.modifier {
  align-self: center;
  width: 44px;
  margin-top: -12px;
  z-index: 1;
}

.modifier :is(input, .print-value) {
  height: 28px;
  border: 1px solid var(--border-colour);
  border-radius: 50%;
  background: var(--background-colour);
  text-align: center;
  font-size: 16px;
}

.attr-applications {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

:is(.inspiration, .proficiencybonus, .passive-perception) {
  display: flex;
  flex-direction: row-reverse;
  align-items: center;
  min-height: 38px;
}

.label-container {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1;
  min-height: 30px;
  padding: 4px;
  border: 1px solid var(--border-colour);
  border-left: 0;
  border-radius: 0 7px 7px 0;
  text-align: center;
}

:is(.proficiencybonus, .passive-perception)>.label-container {
  margin-left: -21px;
  padding-left: 25px;
}

.charsheet :is(.proficiencybonus, .passive-perception)>:is(input, .print-value) {
  position: relative;
  flex: 0 0 42px;
  width: 42px;
  height: 38px;
  border: 1px solid var(--border-colour);
  border-radius: 50%;
  background: var(--background-colour);
  text-align: center;
  font-size: 19px;
}

.charsheet input[type="checkbox"] {
  appearance: none;
  flex: 0 0 12px;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 1px solid var(--border-colour);
  border-radius: 50%;
  cursor: pointer;
}

.charsheet input[type="checkbox"]:checked {
  background: var(--text-colour-base);
  box-shadow: inset 0 0 0 2px var(--background-colour);
}

.charsheet input.expertise {
  border-radius: 2px;
}

.charsheet .inspiration input {
  flex-basis: 38px;
  width: 38px;
  height: 38px;
  border-radius: 4px;
}

:is(.list-section, .textblock, .attacksandspellcasting, .equipment, .features > div) {
  border: 1px solid var(--border-colour);
  border-radius: 9px 3px;
  padding: 10px;
}

.list-section ul li {
  display: flex;
  align-items: center;
  gap: 5px;
  min-height: 22px;
}

.list-section li label {
  order: 3;
  font-size: 11px;
}

.list-section .skill {
  color: var(--sheet-muted);
  font-size: 9px;
}

.charsheet .list-section :is(input[type="number"], .print-value) {
  order: 2;
  flex: 0 0 28px;
  width: 28px;
  height: 22px;
  padding: 0;
  border-bottom: 1px solid var(--sheet-rule);
  text-align: center;
  font-size: 13px;
}

.list-section input[type="checkbox"] {
  order: 1;
}

.label {
  margin-top: 10px;
  text-align: center;
}

.textblock {
  display: flex;
  flex-direction: column-reverse;
}

.textblock>label {
  text-align: center;
  padding-top: 8px;
}

.training.textblock {
  flex: 1;
  flex-direction: column;
}

.training :is(textarea, textarea + .print-value) {
  flex: 1;
}

.training>label {
  text-align: left;
}

.combat {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  background: var(--sheet-wash);
  border-radius: 12px;
  min-height: 412px;
}

:is(.armorclass, .initiative, .speed) {
  grid-column: span 2;
}

:is(.armorclass, .initiative, .speed)>div {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  padding: 5px;
  border: 1px solid var(--border-colour);
  border-radius: 10px 3px;
  background: var(--background-colour);
}

.armorclass>div {
  border-radius: 12px 12px 45% 45%;
}

.charsheet #ac {
  color: var(--text-colour-base);
  text-decoration: none;
}

.ac-baseline {
  display: none;
  font-size: 8px;
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* The shared binding distinguishes automatic values from unfinished edits. */
.armorclass:has(input[data-calculation-state="automatic"]) .ac-baseline {
  display: block;
}

.combat :is(.armorclass, .initiative, .speed) label {
  font-size: 9px;
  max-width: 10ch;
  text-align: center;
}

.combat :is(.armorclass, .initiative, .speed) :is(input, .print-value) {
  text-align: center;
  font: 30px Georgia, serif;
  height: 48px;
}

.hp {
  grid-column: span 6;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.shield-status {
  grid-column: span 6;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

:is(.regular, .temporary, .hitdice > div, .deathsaves > div) {
  border: 1px solid var(--border-colour);
  border-radius: 8px 3px;
  background: var(--background-colour);
  padding: 8px;
}

.max,
.total {
  display: flex;
  align-items: center;
  gap: 8px;
}

.combat :is(.max, .total) label {
  text-transform: none;
  font-size: 10px;
  color: var(--sheet-muted);
  letter-spacing: 0;
  font-weight: 400;
  white-space: nowrap;
}

.max :is(input, .print-value),
.total :is(input, .print-value) {
  border-bottom: 1px solid var(--sheet-rule);
  text-align: center;
}

:is(.current, .temporary, .remaining) {
  display: flex;
  flex-direction: column-reverse;
  text-align: center;
}

:is(.current, .temporary) :is(input, .print-value) {
  height: 52px;
  text-align: center;
  font: 28px Georgia, serif;
}

:is(.hitdice, .deathsaves) {
  grid-column: span 3;
}

:is(.hitdice, .deathsaves)>div {
  min-height: 82px;
  height: 100%;
}

.hitdice>div {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.remaining :is(input, .print-value) {
  height: 30px;
  text-align: center;
  font-size: 18px;
}

.deathsaves>div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: space-between;
}

.deathsaves .label {
  margin-top: 4px;
}

.death-track-row {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 4px;
  min-height: 24px;
}

.deathsave-label {
  font-size: 8px;
  text-transform: uppercase;
}

.bubbles {
  display: flex;
  gap: 4px;
}

.death-dot {
  display: block;
  width: 13px;
  height: 13px;
  border: 1px solid var(--border-colour);
  border-radius: 50%;
  cursor: pointer;
}

.bubbles input:checked+.death-dot {
  background: var(--text-colour-base);
  box-shadow: inset 0 0 0 2px var(--background-colour);
}

.attacksandspellcasting {
  min-height: 300px;
}

.attacksandspellcasting>div {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.attacksandspellcasting>div>label {
  order: 3;
  margin-top: 8px;
  text-align: center;
}

.attacksandspellcasting table {
  width: 100%;
  table-layout: fixed;
  border-spacing: 3px;
}

.attacksandspellcasting th {
  text-align: left;
  font-size: 9px;
  font-weight: 400;
  color: var(--sheet-muted);
  text-transform: uppercase;
}

.attacksandspellcasting th:first-child {
  width: 38%;
}

.attacksandspellcasting th:nth-child(2) {
  width: 28%;
}

.attack-notes label {
  font-size: 9px;
  color: var(--sheet-muted);
}

.attack-notes td {
  padding-bottom: 8px;
}

.attacksandspellcasting td {
  vertical-align: top;
}

.attacksandspellcasting table :is(input, .print-value) {
  background: var(--sheet-wash);
  border-radius: 3px;
  height: 26px;
}

.attacksandspellcasting :is(textarea, textarea + .print-value) {
  flex: 1;
  min-height: 140px;
}

.equipment {
  flex: 1;
  min-height: 264px;
}

.equipment>div {
  display: flex;
  flex-wrap: wrap;
  height: 100%;
  gap: 8px;
}

.equipment>div>label {
  order: 3;
  flex: 0 0 100%;
  align-self: end;
  text-align: center;
}

.money {
  width: 78px;
}

.money ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.money li {
  display: flex;
  align-items: center;
}

.money label {
  width: 23px;
  font-size: 9px;
  text-transform: uppercase;
}

.money :is(input, .print-value) {
  border: 1px solid var(--border-colour);
  border-radius: 8px 3px;
  text-align: center;
  height: 32px;
}

.equipment :is(textarea, textarea + .print-value) {
  flex: 1;
  width: 0;
  min-height: 200px;
}

.flavor {
  display: grid;
  grid-template-rows: repeat(4, 1fr);
  gap: 8px;
  padding: 10px;
  background: var(--sheet-wash);
  border-radius: 12px;
  min-height: 412px;
}

.flavor>div {
  display: flex;
  flex-direction: column-reverse;
  padding: 7px;
  border: 1px solid var(--border-colour);
  border-radius: 8px 3px;
  background: var(--background-colour);
}

.flavor label {
  text-align: center;
  margin-top: 4px;
}

.flavor :is(textarea, textarea + .print-value) {
  flex: 1;
  min-height: 50px;
  height: 50px;
}

.features {
  display: flex;
  flex: 1;
}

.features>div {
  display: flex;
  flex-direction: column-reverse;
  flex: 1;
}

.features label {
  text-align: center;
  padding-top: 8px;
}

.features :is(textarea, textarea + .print-value) {
  flex: 1;
  min-height: 350px;
}

.charsheet .validation-message {
  font-size: 11px;
  line-height: 1.3;
  overflow-wrap: anywhere;
  letter-spacing: 0;
}

.charsheet .validation-message:not(:empty) {
  margin: 4px 0;
}

.charsheet :is(.list-section li, .proficiencybonus, .passive-perception, .max, .money li):has(.validation-message:not(:empty)) {
  flex-wrap: wrap;
}

.charsheet :is(.list-section li, .proficiencybonus, .passive-perception, .max, .money li)>.validation-message {
  flex-basis: 100%;
  order: 4;
}

.scores li:has(.validation-message:not(:empty)) {
  gap: 8px;
}

.scores li:has(.validation-message:not(:empty)) .modifier {
  margin-top: 0;
  width: 100%;
}

.scores .modifier .validation-message {
  text-align: left;
}

body>footer {
  max-width: 850px;
  margin: 18px auto 0;
}

.spellsheet {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 2px solid var(--border-colour);
}

.spellsheet h2 {
  margin: 0 0 16px;
  font-size: 20px;
  font-weight: 600;
}

.spellcasting-details {
  display: grid;
  grid-template-columns: 2fr repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.spellcasting-details>div {
  display: flex;
  flex-direction: column-reverse;
  justify-content: flex-end;
  padding: 10px;
  border: 1px solid var(--border-colour);
  border-radius: 10px 3px;
  text-align: center;
}

.spellcasting-details :is(input, select, .print-value) {
  height: 40px;
  text-align: center;
  font-size: 24px;
}

.spellcasting-details select {
  width: 100%;
  font-size: 18px;
}

.spellcasting-details .casting-class {
  text-align: left;
}

.casting-class :is(input, .print-value) {
  text-align: left;
}

.spell-help {
  margin: 12px 0 20px;
  color: var(--sheet-muted);
  font-size: 11px;
}

.spell-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.spell-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.spell-level {
  break-inside: avoid;
}

.spell-level-heading {
  display: grid;
  grid-template-columns: .8fr 1fr 1fr;
  align-items: start;
  gap: 6px;
  min-height: 58px;
  padding: 6px;
  border: 1px solid var(--border-colour);
  border-radius: 10px 3px;
  background: var(--sheet-wash);
}

.spell-level h3 {
  align-self: center;
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
}

.spell-slots label,
.spell-list-label {
  font-size: 9px;
  text-transform: uppercase;
  letter-spacing: .025em;
}

.spell-slots {
  text-align: center;
}

.spell-slots :is(input, .print-value) {
  height: 27px;
  border-bottom: 1px solid var(--sheet-rule);
  text-align: center;
  font-size: 18px;
}

.spell-list-label {
  margin: 8px 0 2px;
  color: var(--sheet-muted);
}

.spell-list li {
  display: flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  border-bottom: 1px solid var(--sheet-rule);
}

.spell-list :is(input:not([type="checkbox"]), .print-value) {
  flex: 1;
  width: 0;
  height: 27px;
}

@media screen and (max-width: 1000px) {
  .spell-columns {
    gap: 14px;
  }

  .spell-level-heading {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  <<<<<<< HEAD .spell-level h3 {
    grid-column: 1 / -1;

    =======.spell-level h3 {
      grid-column: 1 / -1;
    }
  }

  @media screen and (max-width: 640px) {
    .spellcasting-details {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .spell-columns {
      grid-template-columns: 1fr;
      gap: 20px;
    }

    .spell-level-heading {
      grid-template-columns: .8fr 1fr 1fr;
    }

    .spell-level h3 {
      grid-column: auto;
    }

    .spell-list li {
      min-height: 36px;
    }

    .spell-list :is(input:not([type="checkbox"]), .print-value) {
      height: 35px;
    }
  }

  @media screen and (max-width: 1000px) {
    body {
      padding: 20px 12px;
    }

    .charsheet {
      padding: 20px;
    }

    .charsheet>header {
      grid-template-columns: 1fr;
      gap: 14px;
    }

    .charname {
      border-right: 1px solid var(--border-colour);
      border-radius: 3px;
    }

    .sheet-body {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sheet-body>section:last-child {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .features :is(textarea, textarea + .print-value) {
      min-height: 350px;
    }
  }

  @media screen and (max-width: 640px) {
    body {
      padding: 0;
    }

    .charsheet {
      padding: 20px 14px;
      border: 0;
      box-shadow: none;
    }

    .misc {
      padding: 10px;
    }

    .misc ul {
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 10px 12px;
    }

    .misc li:nth-child(n+3) {
      grid-column: span 3;
    }

    .misc li:nth-child(3) {
      grid-column: span 2;
    }

    .misc li:nth-child(4) {
      grid-column: span 4;
    }

    .misc li:last-child {
      grid-column: span 6;
    }

    .charsheet header label {
      font-size: 9px;
      letter-spacing: 0;
    }

    .sheet-body {
      grid-template-columns: 1fr;
      gap: 20px;
    }

    .sheet-body>section:last-child {
      grid-column: auto;
      display: flex;
    }

    .attributes {
      grid-template-columns: 82px minmax(0, 1fr);
    }

    .list-section ul li {
      min-height: 30px;
      gap: 7px;
    }

    .list-section li label {
      font-size: 12px;
    }

    .charsheet input[type="checkbox"] {
      width: 16px;
      height: 16px;
      flex-basis: 16px;
    }

    .charsheet .inspiration input {
      width: 38px;
      height: 38px;
      flex-basis: 38px;
    }

    .charsheet :is(input, textarea, select),
    .charsheet .list-section :is(input[type="number"], .print-value) {
      font-size: 16px;
    }

    .charsheet .score :is(input, .print-value) {
      font-size: 34px;
    }

    .charsheet .charname :is(input, .print-value) {
      font-size: 25px;
    }

    .charsheet .combat :is(.armorclass, .initiative, .speed) :is(input, .print-value) {
      font-size: 30px;
    }

    .charsheet :is(.current, .temporary) :is(input, .print-value) {
      font-size: 28px;
    }

    .death-dot {
      width: 16px;
      height: 16px;
    }

    .death-track-row {
      min-height: 28px;
    }

    .features :is(textarea, textarea + .print-value) {
      min-height: 380px;
    }

    body>footer {
      padding: 0 20px 20px;
    }
  }

  @page {
    margin: 10mm;
  }

  @media print {
    .spellsheet {
      break-before: page;
      margin-top: 0;
      padding-top: 0;
      border-top: 0;
    }

    .charsheet {
      width: 1040px;
      zoom: .7;
    }

    .charsheet>header {
      grid-template-columns: 1fr 2fr;
      gap: 0;
    }

    .charname {
      border-right: 0;
    }

    .sheet-help,
    noscript {
      display: none;
    }

    .sheet-body {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      margin-top: 20px;
    }

    .sheet-body>section:last-child {
      display: flex;
      grid-column: auto;
    }

    .sheet-body>section {
      gap: 6px;
    }

    .charsheet {
      print-color-adjust: exact;
      -webkit-print-color-adjust: exact;
    }
  }

  @media print {
    .charsheet .print-value {
      width: 100%;
      padding: 3px;
    }

    .charsheet #ac+.print-value {
      text-decoration: none;
    }

    .charsheet textarea+.print-value {
      height: auto;
    }
  }

  /* Keep the attribution with printed copies of the sheet. */
  @media print {
    body>footer {
      display: block;
      >>>>>>>e8822c7 (Update combat records for the 2024 character sheet)
    }
  }

  @media screen and (max-width: 640px) {
    .spellcasting-details {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .spell-columns {
      grid-template-columns: 1fr;
      gap: 20px;
    }

    .spell-level-heading {
      grid-template-columns: .8fr 1fr 1fr;
    }

    .spell-level h3 {
      grid-column: auto;
    }

    .spell-list li {
      min-height: 36px;
    }

    .spell-list :is(input:not([type="checkbox"]), .print-value) {
      height: 35px;
    }
  }

  @media screen and (max-width: 1000px) {
    body {
      padding: 20px 12px;
    }

    .charsheet {
      padding: 20px;
    }

    .charsheet>header {
      grid-template-columns: 1fr;
      gap: 14px;
    }

    .charname {
      border-right: 1px solid var(--border-colour);
      border-radius: 3px;
    }

    .sheet-body {
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .sheet-body>section:last-child {
      grid-column: 1 / -1;
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .features :is(textarea, textarea + .print-value) {
      min-height: 350px;
    }
  }

  @media screen and (max-width: 640px) {
    body {
      padding: 0;
    }

    .charsheet {
      padding: 20px 14px;
      border: 0;
      box-shadow: none;
    }

    .misc {
      padding: 10px;
    }

    .misc ul {
      grid-template-columns: repeat(6, minmax(0, 1fr));
      gap: 10px 12px;
    }

    .misc li:nth-child(n+3) {
      grid-column: span 3;
    }

    .misc li:nth-child(3) {
      grid-column: span 2;
    }

    .misc li:nth-child(4) {
      grid-column: span 4;
    }

    .misc li:last-child {
      grid-column: span 6;
    }

    .charsheet header label {
      font-size: 9px;
      letter-spacing: 0;
    }

    .sheet-body {
      grid-template-columns: 1fr;
      gap: 20px;
    }

    .sheet-body>section:last-child {
      grid-column: auto;
      display: flex;
    }

    .attributes {
      grid-template-columns: 82px minmax(0, 1fr);
    }

    .list-section ul li {
      min-height: 30px;
      gap: 7px;
    }

    .list-section li label {
      font-size: 12px;
    }

    .charsheet input[type="checkbox"] {
      width: 16px;
      height: 16px;
      flex-basis: 16px;
    }

    .charsheet .inspiration input {
      width: 38px;
      height: 38px;
      flex-basis: 38px;
    }

    .charsheet :is(input, textarea, select),
    .charsheet .list-section :is(input[type="number"], .print-value) {
      font-size: 16px;
    }

    .charsheet .score :is(input, .print-value) {
      font-size: 34px;
    }

    .charsheet .charname :is(input, .print-value) {
      font-size: 25px;
    }

    .charsheet .combat :is(.armorclass, .initiative, .speed) :is(input, .print-value) {
      font-size: 30px;
    }

    .charsheet :is(.current, .temporary) :is(input, .print-value) {
      font-size: 28px;
    }

    .death-dot {
      width: 16px;
      height: 16px;
    }

    .death-track-row {
      min-height: 28px;
    }

    .features :is(textarea, textarea + .print-value) {
      min-height: 380px;
    }

    body>footer {
      padding: 0 20px 20px;
    }
  }

  @page {
    margin: 10mm;
  }

  @media print {
    .spellsheet {
      break-before: page;
      margin-top: 0;
      padding-top: 0;
      border-top: 0;
    }

    .charsheet {
      width: 1040px;
      zoom: .7;
    }

    .charsheet>header {
      grid-template-columns: 1fr 2fr;
      gap: 0;
    }

    .charname {
      border-right: 0;
    }

    .sheet-help,
    noscript {
      display: none;
    }

    .sheet-body {
      grid-template-columns: repeat(3, minmax(0, 1fr));
      margin-top: 20px;
    }

    .sheet-body>section:last-child {
      display: flex;
      grid-column: auto;
    }

    .charsheet {
      print-color-adjust: exact;
      -webkit-print-color-adjust: exact;
    }
  }

  @media print {
    .charsheet .print-value {
      width: 100%;
      padding: 3px;
    }

    .charsheet #ac+.print-value {
      text-decoration: none;
    }

    .charsheet textarea+.print-value {
      height: auto;
    }
  }

  body>footer a {
    overflow-wrap: anywhere;
  }

  body>footer a {
    overflow-wrap: anywhere;
  }
