@font-face {
  font-family: "Logo Rubik Glitch";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/RubikGlitch-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Logo Rubik Dirt";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/RubikDirt-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Logo Orbitron";
  font-style: normal;
  font-weight: 400 900;
  font-display: swap;
  src: url("../assets/fonts/Orbitron-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Logo IM Fell English SC";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../assets/fonts/IMFellEnglishSC-Regular.woff2") format("woff2");
}

:root {
  color-scheme: light;
  --ink: #111111;
  --paper: #fffef8;
  --paper-warm: #f6f1df;
  --panel: #fffdf4;
  --accent: #8c2f24;
  --accent-ink: var(--on-solid);
  --muted: #6d6960;
  --line: #1a1a1a;
  --notebook-blue: rgba(56, 91, 132, 0.16);
  --notebook-red: rgba(140, 47, 36, 0.32);
  --shadow: rgba(17, 17, 17, 0.2);
  --app-background: #f2f2ee;
  --app-wash-a: rgba(140, 47, 36, 0.08);
  --app-wash-b: rgba(36, 35, 33, 0.08);
  --panel-margin-rule: rgba(140, 47, 36, 0.18);
  --panel-row-rule: rgba(56, 91, 132, 0.16);
  --panel-outline: var(--ink);
  --panel-drop-shadow: var(--ink);
  --control-bg: #fffdf4;
  --control-border: #050505;
  --control-shadow: #050505;
  --x-button-size: 38px;
  --x-icon-size: 0.95rem;
  --solid-bg: var(--ink);
  --on-solid: var(--paper);
  --focus-ring: rgba(140, 47, 36, 0.35);
  --modal-backdrop: rgba(17, 17, 17, 0.62);
  --login-backdrop: rgba(17, 17, 17, 0.55);
  --field-bg: rgba(255, 254, 248, 0.86);
  --field-bg-strong: rgba(255, 254, 248, 0.9);
  --table-bg: rgba(255, 254, 248, 0.78);
  --table-bg-strong: rgba(255, 254, 248, 0.8);
  --soft-panel-bg: rgba(255, 254, 248, 0.55);
  --soft-panel-bg-alt: rgba(255, 254, 248, 0.62);
  --selected-bg: rgba(255, 244, 166, 0.48);
  --linked-bg: rgba(255, 244, 166, 0.36);
  --spent-bg: rgba(17, 17, 17, 0.06);
  --spent-ink: rgba(17, 17, 17, 0.58);
  --unavailable-bg: rgba(17, 17, 17, 0.06);
  --unavailable-ink: rgba(17, 17, 17, 0.42);
  --disabled-control-bg: rgba(255, 254, 248, 0.68);
  --menu-separator: rgba(17, 17, 17, 0.22);
  --column-rule: rgba(17, 17, 17, 0.24);
  --sheet-hole-ring: rgba(17, 17, 17, 0.34);
  --postit-bg: #fff4a6;
  --postit-corner: rgba(127, 91, 9, 0.12);
  --postit-border: rgba(17, 17, 17, 0.82);
  --postit-shadow: rgba(17, 17, 17, 0.3);
  --svg-ink: var(--ink);
  --svg-idle-filter: none;
  --asset-icon-filter: none;
  --svg-hover-filter:
    drop-shadow(0 0 6px rgba(214, 162, 27, 0.82))
    drop-shadow(2px 2px 0 rgba(127, 91, 9, 0.42));
  --external-svg-surface: transparent;
  --external-svg-border: transparent;
  --external-svg-border-width: 0;
  --external-svg-padding: 0px;
  --theme-toggle-track: var(--control-bg);
  --theme-toggle-border: #aeb3b9;
  --theme-toggle-knob: #f7f4e8;
  --theme-toggle-ring: rgba(174, 179, 185, 0.72);
  --armor-label-color: var(--on-solid);
  --armor-value-color: var(--ink);
  --armor-text-outline: #000000;
  --armor-focus-ring: rgba(214, 162, 27, 0.62);
  --shell-padding: clamp(8px, 1.7vmin, 16px);
  --shell-gap: clamp(8px, 1.8vmin, 16px);
  --panel-shadow-size: clamp(3px, 0.8vmin, 6px);
  --panel-padding: clamp(8px, 1.9dvh, 16px);
  --panel-form-gap: clamp(4px, 1.1dvh, 10px);
  --panel-field-gap: clamp(2px, 0.7dvh, 5px);
  --panel-action-gap: clamp(3px, 0.8dvh, 6px);
  --panel-control-height: clamp(25px, 4.8dvh, 36px);
  --panel-control-pad-y: clamp(2px, 0.7dvh, 6px);
  --panel-control-pad-x: clamp(8px, 1.6dvh, 12px);
  --panel-label-size: clamp(0.66rem, 1.85dvh, 0.86rem);
  --panel-button-size: clamp(0.58rem, 1.7dvh, 0.82rem);
  --sidebar-width: clamp(220px, 24vw, 300px);
  --sidebar-collapsed-width: clamp(38px, 5vmin, 48px);
  --sidebar-toggle-size: clamp(32px, 5.4vmin, 42px);
  --session-panel-space: clamp(94px, 15vmin, 118px);
  --session-button-gap: clamp(3px, 0.9vmin, 6px);
  --theme-toggle-width: clamp(54px, 8vmin, 66px);
  --theme-toggle-height: clamp(30px, 4.8vmin, 36px);
  --system-button-height: 36px;
  --system-editor-top-clearance: calc(var(--panel-padding) + var(--theme-toggle-height) + var(--session-button-gap));
}

:root[data-theme="dark"] {
  color-scheme: dark;
  --ink: #f0f3ed;
  --paper: #050505;
  --paper-warm: #111315;
  --panel: #101214;
  --accent: #c6cbd2;
  --accent-ink: #070809;
  --muted: #a7aca6;
  --line: #7a8088;
  --notebook-blue: rgba(128, 136, 148, 0.13);
  --notebook-red: rgba(150, 156, 166, 0.28);
  --shadow: rgba(0, 0, 0, 0.72);
  --app-background: #070809;
  --app-wash-a: rgba(198, 203, 210, 0.1);
  --app-wash-b: rgba(118, 131, 145, 0.1);
  --panel-margin-rule: rgba(150, 156, 166, 0.32);
  --panel-row-rule: rgba(128, 136, 148, 0.13);
  --panel-outline: var(--line);
  --panel-drop-shadow: #000000;
  --control-bg: #15181b;
  --control-border: #737982;
  --control-shadow: #000000;
  --solid-bg: #1d2228;
  --on-solid: #f4f6f2;
  --focus-ring: rgba(198, 203, 210, 0.62);
  --modal-backdrop: rgba(0, 0, 0, 0.78);
  --login-backdrop: rgba(0, 0, 0, 0.7);
  --field-bg: rgba(18, 21, 24, 0.92);
  --field-bg-strong: rgba(22, 25, 29, 0.96);
  --table-bg: rgba(13, 15, 17, 0.95);
  --table-bg-strong: rgba(17, 20, 23, 0.96);
  --soft-panel-bg: rgba(16, 18, 21, 0.82);
  --soft-panel-bg-alt: rgba(19, 22, 25, 0.88);
  --selected-bg: rgba(198, 203, 210, 0.22);
  --linked-bg: rgba(198, 203, 210, 0.16);
  --spent-bg: rgba(255, 255, 255, 0.08);
  --spent-ink: rgba(240, 243, 237, 0.58);
  --unavailable-bg: rgba(255, 255, 255, 0.06);
  --unavailable-ink: rgba(240, 243, 237, 0.46);
  --disabled-control-bg: rgba(255, 255, 255, 0.1);
  --menu-separator: rgba(240, 243, 237, 0.22);
  --column-rule: rgba(164, 171, 181, 0.36);
  --sheet-hole-ring: rgba(164, 171, 181, 0.42);
  --postit-bg: #10263d;
  --postit-corner: rgba(71, 124, 171, 0.28);
  --postit-border: rgba(120, 155, 190, 0.72);
  --postit-shadow: rgba(0, 0, 0, 0.58);
  --svg-ink: #f4f6f2;
  --svg-idle-filter: invert(1) brightness(1.08) contrast(1.04);
  --asset-icon-filter: invert(1) brightness(1.08) contrast(1.04);
  --svg-hover-filter:
    invert(1)
    brightness(1.08)
    contrast(1.04)
    drop-shadow(0 0 7px rgba(120, 155, 190, 0.46));
  --external-svg-surface: transparent;
  --external-svg-border: transparent;
  --external-svg-border-width: 0;
  --external-svg-padding: 0px;
  --theme-toggle-track: #c6cbd2;
  --theme-toggle-border: #e4e8ed;
  --theme-toggle-knob: #d9dde3;
  --theme-toggle-ring: rgba(207, 212, 219, 0.78);
  --armor-label-color: #050505;
  --armor-value-color: #050505;
  --armor-text-outline: rgba(244, 246, 242, 0.78);
  --armor-focus-ring: rgba(198, 203, 210, 0.62);
}

:root[data-theme="light"] {
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  overflow: hidden;
}

body {
  min-height: 100dvh;
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, var(--app-wash-a), transparent 34%),
    linear-gradient(315deg, var(--app-wash-b), transparent 38%),
    var(--app-background);
  font-family: "Trebuchet MS", Arial, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.app-shell {
  display: grid;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--shell-gap);
  width: 100vw;
  height: 100dvh;
  min-height: 0;
  padding: var(--shell-padding)
    calc(var(--shell-padding) + var(--panel-shadow-size))
    calc(var(--shell-padding) + var(--panel-shadow-size))
    var(--shell-padding);
  overflow: hidden;
  transition:
    grid-template-columns 180ms ease,
    gap 180ms ease;
}

.app-shell.app-shell--sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.app-shell.app-shell--sidebar-collapsed.app-shell--notes-open {
  gap: 0;
}

.app-shell.app-shell--system-view,
.app-shell.app-shell--master-view {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.app-shell.app-shell--system-view .generator-panel,
.app-shell.app-shell--system-view .sheet-stage,
.app-shell.app-shell--system-view .sidebar-toggle,
.app-shell.app-shell--system-view .close-sheet-button,
.app-shell.app-shell--master-view .generator-panel,
.app-shell.app-shell--master-view .sheet-stage,
.app-shell.app-shell--master-view .sidebar-toggle,
.app-shell.app-shell--master-view .close-sheet-button {
  display: none;
}

.generator-panel {
  display: flex;
  flex-direction: column;
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: stretch;
  height: calc(100dvh - (var(--shell-padding) * 2) - var(--panel-shadow-size));
  min-height: 0;
  padding: var(--panel-padding);
  padding-top: calc(var(--panel-padding) + var(--session-panel-space));
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 34px, var(--panel-margin-rule) 35px 37px, transparent 38px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: var(--panel-shadow-size) var(--panel-shadow-size) 0 var(--panel-drop-shadow);
  transition:
    opacity 160ms ease,
    transform 180ms ease,
    visibility 160ms ease;
}

.app-shell.app-shell--sidebar-collapsed .generator-panel {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(0px - var(--shell-padding)));
}

.brand-lockup {
  display: grid;
  flex: 0 0 auto;
  gap: clamp(3px, 0.9dvh, 6px);
  justify-items: start;
  margin-bottom: clamp(6px, 1.5dvh, 12px);
}

.auth-bar {
  position: fixed;
  top: calc(var(--shell-padding) + var(--panel-padding));
  left: calc(var(--shell-padding) + var(--panel-padding));
  z-index: 30;
  container-type: inline-size;
  display: flex;
  justify-content: flex-start;
  width: calc(var(--sidebar-width) - (var(--panel-padding) * 2) - var(--panel-shadow-size));
  max-width: calc(100vw - (var(--shell-padding) * 2));
  min-width: 0;
  min-height: 0;
  transition:
    opacity 160ms ease,
    transform 180ms ease,
    visibility 160ms ease;
}

.app-shell.app-shell--sidebar-collapsed .auth-bar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(0px - var(--shell-padding)));
}

.app-shell.app-shell--system-view .auth-bar,
.app-shell.app-shell--master-view .auth-bar {
  visibility: visible;
  z-index: 125;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.app-shell.app-shell--system-view .auth-bar,
.app-shell.app-shell--master-view .auth-bar {
  width: calc(var(--sidebar-width) - (var(--panel-padding) * 2) - var(--panel-shadow-size));
}

.app-shell.app-shell--master-view.app-shell--master-sidebar-collapsed .auth-bar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(0px - var(--shell-padding)));
}

.theme-toggle {
  --theme-toggle-core-size: calc(var(--theme-toggle-height) - 8px);
  --theme-toggle-sun-size: calc(var(--theme-toggle-core-size) * 1.85);
  --theme-toggle-moon-size: calc(var(--theme-toggle-core-size) * 2.28);
  --theme-toggle-knob-size: var(--theme-toggle-sun-size);
  --theme-toggle-knob-left: calc(4px - ((var(--theme-toggle-knob-size) - var(--theme-toggle-core-size)) / 2));
  --theme-toggle-knob-move: calc(var(--theme-toggle-width) - var(--theme-toggle-core-size) - 8px);
  --theme-toggle-moon-nudge: calc(var(--theme-toggle-core-size) * -0.2);
  position: fixed;
  top: calc(var(--shell-padding) + var(--panel-padding));
  right: calc(var(--shell-padding) + var(--panel-padding));
  z-index: 36;
  display: block;
  width: var(--theme-toggle-width);
  height: var(--theme-toggle-height);
  padding: 0;
  color: var(--ink);
  background: var(--theme-toggle-track);
  border: 0;
  border-radius: 999px;
  overflow: visible;
  box-shadow: clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.theme-toggle::before,
.theme-toggle::after {
  display: block;
  content: "";
}

.theme-toggle::before {
  position: absolute;
  top: 50%;
  left: var(--theme-toggle-knob-left);
  width: var(--theme-toggle-knob-size);
  height: var(--theme-toggle-knob-size);
  z-index: 2;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-image: url("../assets/sol.svg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  filter: drop-shadow(1px 1px 0 rgba(0, 0, 0, 0.26));
  transition:
    background-image 160ms ease,
    filter 160ms ease,
    height 160ms ease,
    transform 160ms ease;
  transform: translateY(-50%);
}

.theme-toggle::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  border: 2px solid var(--theme-toggle-border);
  border-radius: 999px;
  clip-path: inset(0 0 0 calc(var(--theme-toggle-core-size) * 1.12) round 999px);
  pointer-events: none;
  transition:
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.theme-toggle[aria-pressed="true"]::before {
  --theme-toggle-knob-size: var(--theme-toggle-moon-size);
  background-image: url("../assets/lua.svg");
  filter: none;
  transform: translate(calc(var(--theme-toggle-knob-move) + var(--theme-toggle-moon-nudge)), -50%);
}

.theme-toggle[aria-pressed="true"]::after {
  clip-path: inset(0 calc(var(--theme-toggle-core-size) * 1.02) 0 0 round 999px);
}

.theme-toggle:hover::after,
.theme-toggle:focus::after {
  border-color: var(--theme-toggle-border);
  box-shadow: 0 0 0 2px var(--theme-toggle-ring);
}

.character-library-button {
  --library-button-width: calc(var(--x-button-size) + var(--theme-toggle-width) + 10px);
  position: fixed;
  top: calc(var(--shell-padding) + var(--panel-padding) + var(--theme-toggle-height) + 10px);
  right: calc(var(--shell-padding) + var(--panel-padding));
  z-index: 36;
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  gap: 6px;
  width: var(--library-button-width);
  min-width: var(--library-button-width);
  min-height: 54px;
  padding: 6px;
  isolation: isolate;
  overflow: visible;
  color: var(--ink);
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  border-radius: 9px;
  box-shadow: clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
  font-family: "Arial Black", Impact, sans-serif;
  line-height: 1;
  text-align: left;
  cursor: pointer;
  transition:
    color 160ms ease,
    background-color 160ms ease,
    border-color 160ms ease,
    box-shadow 160ms ease;
}

.character-library-button::before {
  position: absolute;
  inset: 0 auto 0 0;
  z-index: -1;
  width: 4px;
  background: var(--accent);
  border-radius: 7px 0 0 7px;
  content: "";
  transition: width 160ms ease;
}

.character-library-button-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--control-border);
  border-radius: 7px;
  box-shadow: 2px 2px 0 var(--control-shadow);
  font-size: 1rem;
  transition:
    color 160ms ease,
    background-color 160ms ease;
}

.character-library-button-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.character-library-button-eyebrow {
  overflow: hidden;
  color: var(--muted-ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.43rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.character-library-button-label {
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(0.49rem, 1.2vmin, 0.54rem);
  letter-spacing: 0.01em;
  line-height: 1.05;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}


.character-library-button:hover {
  background: var(--panel);
  border-color: var(--accent);
  box-shadow: 4px 4px 0 var(--control-shadow);
}

.character-library-button:hover .character-library-button-icon,
.character-library-button[aria-expanded="true"] .character-library-button-icon {
  color: var(--accent-ink);
  background: var(--accent);
}

.character-library-button:focus-visible {
  border-color: var(--accent);
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.character-library-button:focus:not(:focus-visible) {
  outline: 0;
}

.character-library-button[aria-expanded="true"] {
  border-color: var(--accent);
  box-shadow: none;
}

.character-library-button[aria-expanded="true"]::before {
  width: 7px;
}

.character-library-button:active {
  box-shadow: none;
}

@media (prefers-reduced-motion: reduce) {
  .character-library-button,
  .character-library-button::before,
  .character-library-button-icon {
    transition: none;
  }
}

.app-shell.app-shell--system-view .character-library-button,
.app-shell.app-shell--master-view .character-library-button {
  display: none;
}

.close-sheet-button {
  position: fixed;
  top: calc(var(--shell-padding) + var(--panel-padding));
  right: calc(var(--shell-padding) + var(--panel-padding) + clamp(54px, 8vmin, 66px) + 10px);
  z-index: 31;
  display: grid;
  place-items: center;
  width: var(--x-button-size);
  min-width: var(--x-button-size);
  height: var(--x-button-size);
  min-height: var(--x-button-size);
  padding: 0;
  aspect-ratio: 1 / 1;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--control-border);
  border-radius: 0;
  box-shadow: clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(0.8rem, 2.6vmin, 1.05rem);
  line-height: 1;
  text-transform: uppercase;
}

.close-sheet-button[hidden] {
  display: none;
}

.close-sheet-button:hover,
.close-sheet-button:focus {
  color: var(--accent-ink);
  background: var(--accent);
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.sidebar-toggle {
  position: fixed;
  top: calc(var(--shell-padding) + var(--panel-padding));
  left: calc(var(--shell-padding) + var(--sidebar-width) + 2px);
  z-index: 32;
  display: grid;
  place-items: center;
  width: var(--sidebar-toggle-size);
  height: var(--sidebar-toggle-size);
  padding: 0;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--control-border);
  border-radius: 0;
  box-shadow: clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
  transform: translateX(-50%);
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    left 180ms ease;
}

.sidebar-toggle::before {
  content: "\00AB";
  display: block;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(1.1rem, 3.4vmin, 1.45rem);
  line-height: 0.8;
  transform: translateY(-1px);
}

.sidebar-toggle:hover,
.sidebar-toggle:focus {
  color: var(--accent-ink);
  background: var(--accent);
  outline: 0;
  box-shadow:
    0 0 0 2px var(--focus-ring),
    clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
}

.app-shell.app-shell--sidebar-collapsed .sidebar-toggle {
  left: calc(var(--shell-padding) + var(--sidebar-collapsed-width) + 2px);
}

.app-shell.app-shell--sidebar-collapsed .sidebar-toggle::before {
  content: "\00BB";
}

.auth-login-button,
.auth-logout-button,
.dialog-close-button,
.discord-signin-button,
.system-button,
.master-button {
  min-height: clamp(22px, 5.4vmin, 42px);
  max-width: 100%;
  padding: clamp(3px, 1.2vmin, 8px) clamp(6px, 1.9vmin, 12px);
  color: var(--ink);
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  border-radius: 0;
  box-shadow: clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(0.48rem, 2.35vmin, 1.08rem);
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.user-session {
  container-type: inline-size;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--session-button-gap);
  align-items: stretch;
  justify-items: stretch;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.user-session[hidden] {
  display: none;
}

.user-session-row {
  display: contents;
}

.user-name {
  display: inline-block;
  grid-column: 1 / -1;
  grid-row: 1;
  align-self: center;
  justify-self: start;
  max-width: 100%;
  min-width: 0;
  font-weight: 800;
  font-size: clamp(0.52rem, 1.85vmin, 0.95rem);
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
  white-space: nowrap;
  text-align: left;
}

.auth-login-button {
  width: calc((100% - var(--session-button-gap)) / 2);
}

.auth-login-button,
.auth-logout-button,
.system-button,
.master-button {
  padding-inline: clamp(2px, 1.1vmin, 10px);
  padding-inline: clamp(2px, 3cqw, 12px);
  font-size: min(1.08rem, 1.55vmin);
  font-size: min(1.08rem, 2.35vmin, 7.4cqw);
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
}

.auth-logout-button {
  grid-column: 1;
  grid-row: 2;
  width: 100%;
  color: var(--accent-ink);
  background: var(--accent);
}

.system-button {
  grid-column: 1;
  grid-row: 3;
  justify-self: stretch;
  width: 100%;
  color: var(--on-solid);
  background: var(--solid-bg);
}

.master-button {
  grid-column: 2;
  grid-row: 3;
  justify-self: stretch;
  width: 100%;
  color: var(--on-solid);
  background: var(--solid-bg);
}

.system-button[aria-disabled="true"],
.master-button[aria-disabled="true"] {
  color: var(--muted);
  background: var(--soft-panel-bg);
  border-color: var(--line);
  cursor: pointer;
  filter: grayscale(0.45);
  opacity: 0.72;
}

.system-button[hidden],
.master-button[hidden] {
  display: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  justify-self: center;
  width: min(100%, clamp(118px, 24dvh, 240px));
  max-height: 29dvh;
  margin-inline: auto;
  padding: var(--external-svg-padding);
  background: var(--external-svg-surface);
  border: var(--external-svg-border-width) solid var(--external-svg-border);
}

.brand-mark img {
  width: 100%;
  max-height: calc(29dvh - var(--external-svg-padding) - var(--external-svg-padding));
  height: auto;
  object-fit: contain;
  transition: filter 160ms ease;
}

.brand-mark.brand-mark--default {
  width: min(100%, clamp(78px, 20dvh, 210px));
  max-height: 24dvh;
}

.brand-mark.brand-mark--default img {
  width: auto;
  max-width: 100%;
  max-height: calc(24dvh - var(--external-svg-padding) - var(--external-svg-padding));
}

:root[data-theme="dark"] .brand-mark img {
  filter: invert(1) brightness(1.08) contrast(1.04);
}

.brand-mark .sheet-logo-text {
  width: min(100%, 220px);
  height: clamp(92px, 18dvh, 160px);
}

.brand-lockup h1 {
  justify-self: center;
  max-width: 11ch;
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(1rem, 4dvh, 1.8rem);
  line-height: 0.95;
  text-align: center;
  text-transform: none;
}

.character-form {
  display: grid;
  flex: 0 0 auto;
  gap: var(--panel-form-gap);
  min-height: 0;
  overflow: visible;
  padding-right: 0;
}

.form-field {
  display: grid;
  gap: var(--panel-field-gap);
  min-width: 0;
}

.form-field span {
  font-size: var(--panel-label-size);
  font-weight: 800;
  line-height: 1.05;
  text-transform: uppercase;
}

.form-field input,
.form-field select {
  width: 100%;
  min-height: var(--panel-control-height);
  padding: var(--panel-control-pad-y) var(--panel-control-pad-x);
  color: var(--ink);
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  border-radius: 0;
  box-shadow: clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
  font-size: clamp(0.82rem, 2.5dvh, 1rem);
  line-height: 1.1;
}

.form-field input:focus,
.form-field select:focus,
.primary-action:focus,
.secondary-action:focus,
.armor-market-shortcut:focus,
.inventory-custom-shortcut:focus,
.inventory-market-shortcut:focus,
.spell-custom-shortcut:focus,
.spell-edit-button:focus,
.spell-delete-button:focus,
.auth-login-button:focus,
.auth-logout-button:focus,
.dialog-close-button:focus,
.discord-signin-button:focus,
.system-button:focus,
.master-button:focus,
.theme-toggle:focus,
.close-sheet-button:focus,
.login-dialog:focus,
.system-dialog:focus,
.traveller-advancement-dialog:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.theme-toggle:focus {
  outline-color: var(--theme-toggle-ring);
}

.form-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  gap: var(--panel-action-gap);
  min-width: 0;
  margin-top: clamp(0px, 0.7dvh, 4px);
}

.sheet-transfer-actions {
  display: grid;
  grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(4px, 0.9dvh, 6px);
  min-width: 0;
  min-height: 0;
}

.export-control {
  position: relative;
  display: grid;
  min-width: 0;
}

.item-transfer-control {
  position: relative;
  display: grid;
  min-width: 0;
}

.item-transfer-control[hidden] {
  display: none;
}

.form-actions > .primary-action,
.export-control > .secondary-action,
.item-transfer-control > .secondary-action,
.sheet-transfer-actions > .secondary-action {
  width: 100%;
  height: auto;
  align-self: stretch;
}

.export-menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 8px);
  z-index: 10;
  display: grid;
  width: min(220px, 82vw);
  padding: 7px;
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  box-shadow: 4px 4px 0 var(--control-shadow);
}

.export-menu[hidden] {
  display: none;
}

.export-menu button {
  width: 100%;
  padding: 9px 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--menu-separator);
  font-weight: 800;
  text-align: left;
}

.export-menu button:last-child {
  border-bottom: 0;
}

.export-menu button:hover,
.export-menu button:focus {
  color: var(--on-solid);
  background: var(--solid-bg);
  outline: 0;
}

.system-section-toolbar .item-transfer-menu {
  top: calc(100% + 8px);
  bottom: auto;
}

.inventory-dialog-actions .item-transfer-control {
  flex: 0 1 auto;
}

#import-custom-inventory-item-control {
  margin-right: auto;
}

#import-custom-inventory-item-menu {
  right: auto;
  left: 0;
}

.spell-dialog-actions .item-transfer-control {
  flex: 0 1 auto;
}

#import-custom-spell-menu {
  right: auto;
  left: 0;
}

.auto-save-control {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 4px 8px;
  align-items: center;
  min-width: 0;
  padding: 7px 8px;
  color: var(--ink);
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  box-shadow: 3px 3px 0 var(--control-shadow);
}

.auto-save-control > span {
  font-size: clamp(0.62rem, 1.55dvh, 0.72rem);
  font-weight: 800;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
}

.auto-save-control[hidden] {
  display: none;
}

.auto-save-control input {
  width: 1rem;
  height: 1rem;
  margin: 0;
  accent-color: var(--solid-bg);
}

.auto-save-control input:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.auto-save-control small {
  grid-column: 2;
  min-width: 0;
  color: var(--muted-ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
  overflow-wrap: anywhere;
  font-size: clamp(0.48rem, 1.15dvh, 0.56rem);
  font-weight: 600;
  line-height: 1.2;
  text-transform: none;
  white-space: normal;
}

.auto-save-help {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  background: var(--soft-panel-bg);
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 var(--control-shadow);
}

.auto-save-help[hidden] {
  display: none;
}

.auto-save-help p {
  margin: 0;
  color: var(--ink);
  font-size: clamp(0.64rem, 1.8dvh, 0.78rem);
  font-weight: 700;
  line-height: 1.25;
}

.auto-save-help code {
  display: block;
  min-width: 0;
  overflow: hidden;
  padding: 5px 6px;
  color: var(--ink);
  background: var(--control-bg);
  border: 1px solid var(--control-border);
  font-family: "Courier New", monospace;
  font-size: clamp(0.58rem, 1.6dvh, 0.7rem);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auto-save-help-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}

.auto-save-help-button {
  min-width: 0;
  min-height: clamp(28px, 5dvh, 36px);
  padding: 5px 6px;
  color: var(--ink);
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  box-shadow: 2px 2px 0 var(--control-shadow);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(0.5rem, 1.7dvh, 0.68rem);
  line-height: 1.05;
  text-transform: uppercase;
}

.auto-save-help-button:hover,
.auto-save-help-button:focus {
  color: var(--on-solid);
  background: var(--solid-bg);
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.primary-action,
.secondary-action {
  min-height: var(--panel-control-height);
  min-width: 0;
  padding: var(--panel-control-pad-y) var(--panel-control-pad-x);
  border: 2px solid var(--control-border);
  border-radius: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: var(--panel-button-size);
  line-height: 1.05;
  overflow-wrap: anywhere;
  text-transform: uppercase;
  box-shadow: clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
}

.primary-action {
  color: var(--accent-ink);
  background: var(--accent);
}

#add-inventory-items:not([hidden]) {
  display: inline-flex;
  gap: 0.45em;
  align-items: center;
  justify-content: center;
}

#add-inventory-items .fa-solid {
  flex: 0 0 auto;
  font-size: 0.95em;
}

.secondary-action {
  color: var(--ink);
  background: var(--control-bg);
}

.app-shell.is-import-dragging #import-button {
  color: var(--on-solid);
  background: var(--solid-bg);
  outline: 3px dashed var(--focus-ring);
  outline-offset: 3px;
  transform: translate(-1px, -1px);
}

.status-message {
  flex: 0 0 auto;
  min-height: clamp(0px, 2.2dvh, 18px);
  margin: clamp(3px, 0.8dvh, 7px) 0 0;
  padding-bottom: 0;
  overflow: visible;
  color: var(--accent);
  font-size: clamp(0.66rem, 1.85dvh, 0.86rem);
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.status-message:empty {
  min-height: 0;
  margin-top: 0;
  padding-bottom: 0;
}

.app-version {
  position: fixed;
  right: calc(var(--shell-padding) + var(--panel-shadow-size));
  bottom: calc(var(--shell-padding) + var(--panel-shadow-size));
  z-index: 29;
  margin: 0;
  padding: 0;
  color: var(--accent);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(0.56rem, 1.55vmin, 0.82rem);
  line-height: 1;
  pointer-events: none;
}

.app-version[hidden] {
  display: none;
}

.sheet-tour[hidden] {
  display: none;
}

.sheet-tour {
  position: fixed;
  inset: 0;
  z-index: 150;
  color: var(--ink);
  pointer-events: none;
}

.sheet-tour-highlight {
  position: fixed;
  z-index: 0;
  border: 3px solid #fff4a6;
  background: transparent;
  box-shadow:
    0 0 0 9999px rgba(17, 17, 17, 0.54),
    0 0 0 7px rgba(255, 244, 166, 0.25),
    0 0 18px rgba(255, 244, 166, 0.72);
  pointer-events: none;
  transition:
    top 160ms ease,
    left 160ms ease,
    width 160ms ease,
    height 160ms ease;
}

:root[data-theme="dark"] .sheet-tour-highlight {
  border-color: #c6cbd2;
  box-shadow:
    0 0 0 9999px rgba(0, 0, 0, 0.68),
    0 0 0 7px rgba(198, 203, 210, 0.22),
    0 0 18px rgba(198, 203, 210, 0.52);
}

.sheet-tour-callout {
  position: fixed;
  z-index: 1;
  display: grid;
  gap: 10px;
  width: min(320px, calc(100vw - 24px));
  padding: 14px;
  background:
    linear-gradient(90deg, transparent 0 24px, var(--panel-margin-rule) 25px 27px, transparent 28px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 23px,
      var(--panel-row-rule) 24px,
      transparent 25px
    ),
    var(--panel);
  border: 3px solid var(--control-border);
  box-shadow: 5px 5px 0 var(--control-shadow);
  line-height: 1.25;
  outline: 0;
  pointer-events: auto;
}

.sheet-tour-callout::before {
  position: absolute;
  width: 16px;
  height: 16px;
  background: var(--panel);
  border: 3px solid var(--control-border);
  content: "";
  transform: rotate(45deg);
}

.sheet-tour[data-placement="right"] .sheet-tour-callout::before {
  top: calc(50% - 8px);
  left: -11px;
  border-top: 0;
  border-right: 0;
}

.sheet-tour[data-placement="left"] .sheet-tour-callout::before {
  top: calc(50% - 8px);
  right: -11px;
  border-bottom: 0;
  border-left: 0;
}

.sheet-tour[data-placement="top"] .sheet-tour-callout::before {
  right: 28px;
  bottom: -11px;
  border-top: 0;
  border-left: 0;
}

.sheet-tour[data-placement="bottom"] .sheet-tour-callout::before {
  top: -11px;
  left: 28px;
  border-right: 0;
  border-bottom: 0;
}

.sheet-tour-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) var(--x-button-size);
  gap: 10px;
  align-items: start;
}

.sheet-tour-header h2 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.96rem;
  line-height: 1;
  text-transform: uppercase;
}

.sheet-tour-close-button {
  display: grid;
  place-items: center;
  width: var(--x-button-size);
  min-width: var(--x-button-size);
  height: var(--x-button-size);
  min-height: var(--x-button-size);
  padding: 0;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--control-border);
  border-radius: 0;
  box-shadow: 2px 2px 0 var(--control-shadow);
  line-height: 1;
}

.sheet-tour-close-button .fa-solid {
  font-size: var(--x-icon-size);
}

.sheet-tour-body {
  margin: 0;
  padding-right: 4px;
  font-size: 0.92rem;
  font-weight: 800;
}

.sheet-tour-footer {
  display: grid;
  gap: 10px;
}

.sheet-tour-counter {
  color: var(--muted);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1;
  text-transform: uppercase;
}

.sheet-tour-dismiss {
  display: flex;
  gap: 8px;
  align-items: center;
  min-width: 0;
  font-size: 0.78rem;
  font-weight: 900;
  line-height: 1.1;
}

.sheet-tour-dismiss input {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  accent-color: var(--accent);
}

.sheet-tour-actions {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 8px;
}

.sheet-tour-nav-button {
  min-height: 36px;
  min-width: 0;
  padding: 7px 8px;
  color: var(--ink);
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  border-radius: 0;
  box-shadow: 2px 2px 0 var(--control-shadow);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.sheet-tour-nav-button--next {
  color: var(--on-solid);
  background: var(--solid-bg);
}

.sheet-tour-nav-button:disabled {
  opacity: 0.45;
}

.sheet-tour-close-button:focus,
.sheet-tour-nav-button:focus,
.sheet-tour-dismiss input:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.login-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--login-backdrop);
}

.login-dialog-backdrop[hidden],
.system-dialog-backdrop[hidden],
.system-record-dialog-backdrop[hidden],
.sheet-replace-dialog-backdrop[hidden],
.sheet-close-dialog-backdrop[hidden],
.class-details-dialog-backdrop[hidden],
.ability-swap-dialog-backdrop[hidden],
.traveller-advancement-dialog-backdrop[hidden],
.armor-dialog-backdrop[hidden],
.inventory-dialog-backdrop[hidden],
.spell-dialog-backdrop[hidden] {
  display: none;
}

.sheet-replace-dialog-backdrop,
.sheet-close-dialog-backdrop,
.class-details-dialog-backdrop,
.system-dialog-backdrop,
.system-record-dialog-backdrop,
.ability-swap-dialog-backdrop,
.traveller-advancement-dialog-backdrop,
.armor-dialog-backdrop,
.inventory-dialog-backdrop,
.spell-dialog-backdrop {
  position: fixed;
  inset: 0;
  z-index: 110;
  display: grid;
  place-items: center;
  padding: 18px;
  background: var(--modal-backdrop);
}

.inventory-dialog-backdrop--cart {
  grid-template-columns: minmax(240px, 300px) minmax(0, 940px) minmax(280px, 320px);
  gap: 14px;
  align-items: center;
  justify-content: center;
  justify-items: stretch;
}

.system-record-dialog-backdrop {
  z-index: 125;
}

.custom-weapon-access-confirm-dialog-backdrop {
  z-index: 135;
}

.item-json-text-dialog-backdrop {
  z-index: 135;
}

.spell-overlimit-confirm-dialog-backdrop,
.spell-higher-slot-confirm-dialog-backdrop {
  z-index: 135;
}

.spell-higher-slot-confirm-list {
  display: grid;
  gap: 5px;
  max-height: 180px;
  padding-left: 22px;
  margin: 0;
  overflow: auto;
  font-weight: 800;
}

.sheet-replace-dialog-backdrop--stacked {
  z-index: 135;
}

.login-dialog {
  width: min(360px, 100%);
  padding: 16px;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 28px, var(--panel-margin-rule) 29px 31px, transparent 32px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: 6px 6px 0 var(--panel-drop-shadow);
}

.system-dialog {
  width: min(1120px, 100%);
  max-height: calc(100dvh - 36px);
  padding: 16px 16px 16px 40px;
  overflow: auto;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 28px, var(--panel-margin-rule) 29px 31px, transparent 32px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: 6px 6px 0 var(--panel-drop-shadow);
}

.app-shell > .system-screen {
  --system-version-clearance: calc(var(--panel-shadow-size) + 0.8rem);
  position: relative;
  inset: auto;
  z-index: 20;
  grid-column: 1;
  grid-row: 1;
  display: block;
  min-width: 0;
  min-height: 0;
  padding: 0;
  overflow: hidden;
  background: transparent;
}

.app-shell > .system-screen[hidden] {
  display: none;
}

.system-screen .system-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: 100%;
  height: calc(100dvh - (var(--shell-padding) * 2) - var(--panel-shadow-size) - var(--system-version-clearance));
  max-height: none;
  padding:
    calc(var(--panel-padding) + var(--session-panel-space))
    var(--panel-padding)
    var(--panel-padding)
    clamp(40px, 4vw, 64px);
  overflow: hidden;
  box-shadow: var(--panel-shadow-size) var(--panel-shadow-size) 0 var(--panel-drop-shadow);
}

.system-screen:not(.master-screen) .system-dialog {
  position: relative;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: var(--shell-gap);
  height: calc(100dvh - (var(--shell-padding) * 2) - var(--panel-shadow-size));
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.system-screen:not(.master-screen) .system-sidebar-header {
  margin: 0;
}

.system-screen .system-dialog-header {
  margin-top: 0;
}

.system-screen .system-dialog:focus {
  outline: 0;
}

.system-screen #close-system-dialog,
.system-screen #close-master-dialog {
  display: none;
}

.system-record-dialog {
  width: min(980px, 100%);
  max-height: calc(100dvh - 36px);
  padding: 16px 16px 16px 40px;
  overflow: auto;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 28px, var(--panel-margin-rule) 29px 31px, transparent 32px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: 6px 6px 0 var(--panel-drop-shadow);
}

.character-library-dialog-backdrop {
  z-index: 125;
}

.character-library-dialog {
  display: grid;
  grid-template-rows: auto auto auto minmax(0, 1fr) auto auto;
  gap: 8px;
  width: min(900px, 100%);
  max-height: calc(100dvh - 36px);
  padding: 14px 14px 12px 38px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 28px, var(--panel-margin-rule) 29px 31px, transparent 32px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: 6px 6px 0 var(--panel-drop-shadow);
}

.character-library-dialog:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 3px;
}

.character-library-dialog .system-record-dialog-header {
  gap: 8px;
  margin: 0;
}

.character-library-dialog .dialog-close-button {
  width: 32px;
  min-width: 32px;
  height: 32px;
  min-height: 32px;
}

.character-library-dialog .dialog-close-button .fa-solid {
  font-size: 0.72rem;
}

.character-library-dialog h3 {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(0.9rem, 2.6vmin, 1.12rem);
  line-height: 1;
  text-transform: uppercase;
}

.character-library-eyebrow {
  margin: 0 0 2px;
  color: var(--accent);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.character-library-folder-panel {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 6px 0 7px;
  border-bottom: 2px solid var(--control-border);
}

.character-library-folder-toolbar {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  min-width: 0;
}

.character-library-folder-navigation {
  display: grid;
  flex: 1;
  gap: 3px;
  min-width: 0;
}

.character-library-folder-heading {
  color: var(--muted-ink);
  font-size: 0.58rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.character-library-folder-list {
  display: flex;
  gap: 4px;
  min-width: 0;
  padding: 2px 2px 3px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.character-library-folder-button {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 5px;
  min-height: 28px;
  max-width: 170px;
  padding: 4px 7px;
  color: var(--ink);
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  box-shadow: 1px 1px 0 var(--control-shadow);
  font: 800 0.66rem/1 "Trebuchet MS", Arial, sans-serif;
  cursor: pointer;
}

.character-library-folder-button:hover,
.character-library-folder-button:focus-visible,
.character-library-folder-button.is-active {
  color: var(--accent-ink);
  background: var(--accent);
}

.character-library-folder-button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.character-library-folder-button-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.character-library-folder-button > i {
  flex: 0 0 auto;
}


.character-library-folder-count {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  color: var(--ink);
  background: var(--panel);
  border: 1px solid var(--control-border);
  font-size: 0.58rem;
}

.character-library-folder-button:hover .character-library-folder-count,
.character-library-folder-button:focus-visible .character-library-folder-count,
.character-library-folder-button.is-active .character-library-folder-count {
  color: var(--ink);
  background: var(--panel);
}

.character-library-folder-actions,
.character-library-folder-form-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.character-library-folder-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

.character-library-living-filter {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  font-size: 0.64rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
  cursor: pointer;
}

.character-library-living-filter input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.character-library-living-filter input:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.character-library-folder-actions .secondary-action,
.character-library-folder-form-actions .secondary-action,
.character-library-folder-form-actions .primary-action {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 0.64rem;
  white-space: nowrap;
}

.character-library-folder-actions .secondary-action[hidden],
.character-library-folder-form[hidden] {
  display: none;
}

.character-library-folder-form {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  align-items: end;
  gap: 6px;
  padding: 7px;
  background: var(--control-bg);
  border: 2px dashed var(--control-border);
}

.character-library-folder-form > label {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: var(--muted-ink);
  font-size: 0.6rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.character-library-folder-form > label input[type="text"] {
  width: 100%;
  min-width: 0;
  height: 32px;
  padding: 5px 7px;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--control-border);
  font: 700 0.76rem/1.2 "Trebuchet MS", Arial, sans-serif;
  text-transform: none;
}

.character-library-folder-form > label input[type="text"]:focus {
  border-color: var(--accent);
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.character-library-folder-form > .character-library-folder-form-actions {
  grid-column: 2;
  grid-row: 1;
}

.character-library-empty {
  margin: 6px 0;
  padding: 12px;
  color: var(--muted-ink);
  background: var(--control-bg);
  border: 2px dashed var(--control-border);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.character-library-list {
  display: grid;
  gap: 6px;
  min-height: 0;
  max-height: min(68dvh, 640px);
  padding: 2px 5px 5px 2px;
  overflow: auto;
}

.character-library-card {
  position: relative;
  display: grid;
  grid-template-columns: minmax(150px, 0.8fr) minmax(120px, 0.55fr) minmax(220px, 1.35fr);
  gap: 8px;
  align-items: stretch;
  padding: 8px 44px 8px 10px;
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  box-shadow: 2px 2px 0 var(--control-shadow);
}

.character-library-card.is-dead {
  grid-template-columns: minmax(150px, 0.8fr) 58px minmax(120px, 0.55fr) minmax(200px, 1.25fr);
}

.character-library-card[aria-current="true"] {
  border-color: var(--accent);
  box-shadow: 2px 2px 0 var(--accent);
}

.character-library-identity {
  display: grid;
  align-content: center;
  gap: 3px;
  min-width: 0;
}

.character-library-life-state {
  display: grid;
  align-content: center;
  justify-items: center;
  gap: 3px;
  min-width: 0;
  padding: 2px 4px;
  color: var(--accent);
  text-align: center;
}

.character-library-life-state .fa-skull {
  font-size: 1rem;
  line-height: 1;
}

.character-library-life-state span {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.56rem;
  line-height: 1;
  letter-spacing: 0.05em;
}

.character-library-name {
  width: fit-content;
  max-width: 100%;
  padding: 0;
  overflow: hidden;
  color: var(--ink);
  background: transparent;
  border: 0;
  box-shadow: none;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.88rem;
  line-height: 1.1;
  text-align: left;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
  text-overflow: ellipsis;
  white-space: nowrap;
  cursor: pointer;
}

.character-library-name:hover,
.character-library-name:focus {
  color: var(--accent);
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.character-library-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 3px 8px;
  color: var(--muted-ink);
  font-size: 0.67rem;
  font-weight: 900;
  text-transform: uppercase;
}

.character-library-field {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 3px;
  min-width: 0;
  font-size: 0.63rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.character-library-field input,
.character-library-field textarea {
  width: 100%;
  min-width: 0;
  min-height: 34px;
  padding: 5px 7px;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--control-border);
  border-radius: 0;
  font: 700 0.78rem/1.2 "Trebuchet MS", Arial, sans-serif;
  text-transform: none;
}
.character-library-field input {
  height: 34px;
  align-self: start;
}


.character-library-field textarea {
  height: 34px;
  min-height: 34px;
  max-height: 104px;
  overflow-y: hidden;
  resize: none;
}

.character-library-field input:focus,
.character-library-field textarea:focus {
  border-color: var(--accent);
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.character-library-storage-state {
  color: var(--muted-ink);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1.2;
}


.character-library-card-actions {
  position: absolute;
  inset: 0 7px 0 auto;
  display: grid;
  grid-template-rows: 28px 28px;
  align-content: space-evenly;
  width: 28px;
}

.character-library-folder-settings-button,
.character-library-remove-button {
  display: grid;
  place-items: center;
  width: 28px;
  min-width: 28px;
  height: 28px;
  min-height: 28px;
  padding: 0;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--control-border);
  border-radius: 0;
  box-shadow: 1px 1px 0 var(--control-shadow);
  line-height: 1;
  cursor: pointer;
}
.character-library-folder-settings-button {
  color: var(--ink);
  background: var(--panel);
}



.character-library-folder-settings-button:hover,
.character-library-folder-settings-button:focus-visible,
.character-library-remove-button:hover,
.character-library-remove-button:focus-visible {
  color: var(--on-solid);
  background: var(--solid-bg);
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.character-library-folder-settings-button .fa-solid,
.character-library-remove-button .fa-solid {
  pointer-events: none;
  font-size: 0.72rem;
}

.character-library-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 2px;
  margin-top: 0;
}

.character-library-actions .primary-action {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 0.68rem;
}

.system-class-template-dialog {
  width: min(520px, 100%);
}

.system-back-button-text {
  display: none;
}

.system-class-template-body {
  display: grid;
  gap: 12px;
  margin-bottom: 14px;
}

body.system-journey-active .system-record-dialog-backdrop {
  z-index: 124;
  place-items: stretch;
  padding: var(--shell-padding);
  overflow: hidden;
  background: transparent;
}

body.system-journey-active .system-record-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  height: calc(100dvh - (var(--shell-padding) * 2) - var(--panel-shadow-size));
  max-height: none;
  padding:
    calc(var(--panel-padding) + var(--session-panel-space))
    var(--panel-padding)
    var(--panel-padding)
    clamp(40px, 4vw, 64px);
  overflow: hidden;
  box-shadow: var(--panel-shadow-size) var(--panel-shadow-size) 0 var(--panel-drop-shadow);
}

body.system-journey-active .system-class-template-dialog,
body.system-journey-active .system-weapon-access-dialog,
body.system-journey-active .system-kit-items-dialog {
  width: 100%;
}

body.system-journey-active .system-kit-items-dialog {
  grid-template-rows: auto auto minmax(0, 1fr) auto auto;
}

body.system-journey-active .system-record-dialog:focus {
  outline: 0;
}

body.system-journey-active .system-record-dialog-header {
  margin-top: 0;
}

body.system-journey-active .system-record-dialog-header .dialog-close-button {
  display: inline-flex;
  justify-content: center;
  width: auto;
  min-width: 0;
  height: auto;
  min-height: 34px;
  padding: 6px 10px;
  aspect-ratio: auto;
  gap: 7px;
  white-space: nowrap;
}

body.system-journey-active .system-record-dialog-header .dialog-close-button .fa-solid {
  font-size: 0.9rem;
}

body.system-journey-active .system-back-button-text {
  display: inline;
  font-size: 0.72rem;
  line-height: 1;
}

body.system-journey-active .system-class-template-body,
body.system-journey-active .system-logo-dialog-body,
body.system-journey-active .system-record-editor-body,
body.system-journey-active .system-weapon-access-body,
body.system-journey-active .system-kit-items-body {
  min-height: 0;
  overflow: auto;
  align-content: start;
  padding-right: 4px;
}

body.system-journey-active .system-record-dialog-actions {
  margin-top: 0;
  padding-top: 14px;
  border-top: 2px solid var(--line);
}

.sheet-replace-dialog,
.ability-swap-dialog,
.traveller-advancement-dialog {
  width: min(440px, 100%);
  padding: 28px 16px 16px 40px;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 28px, var(--panel-margin-rule) 29px 31px, transparent 32px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: 6px 6px 0 var(--panel-drop-shadow);
}

.class-details-dialog {
  width: min(820px, 100%);
  max-height: calc(100dvh - 36px);
  padding: 16px 16px 16px 40px;
  overflow: auto;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 28px, var(--panel-margin-rule) 29px 31px, transparent 32px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: 6px 6px 0 var(--panel-drop-shadow);
}

.armor-dialog {
  width: min(860px, 100%);
  max-height: calc(100dvh - 36px);
  padding: 16px 16px 16px 40px;
  overflow: auto;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 28px, var(--panel-margin-rule) 29px 31px, transparent 32px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: 6px 6px 0 var(--panel-drop-shadow);
}

.spell-dialog,
.inventory-dialog {
  width: min(940px, 100%);
  height: min(760px, calc(100dvh - 36px));
  max-height: calc(100dvh - 36px);
  padding: 16px 16px 16px 40px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 28px, var(--panel-margin-rule) 29px 31px, transparent 32px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: 6px 6px 0 var(--panel-drop-shadow);
}

.traveller-advancement-dialog {
  width: min(620px, 100%);
}

.ability-swap-dialog {
  width: min(500px, 100%);
}

.armor-purchase-confirm-dialog-backdrop {
  z-index: 145;
}

.armor-purchase-confirm-dialog {
  width: min(520px, 100%);
}

.armor-purchase-confirm-form {
  display: grid;
  gap: 14px;
}

.armor-purchase-confirm-summary,
.armor-purchase-confirm-copy {
  margin: 0;
  font-weight: 800;
  line-height: 1.25;
}

.armor-purchase-confirm-details {
  display: grid;
  gap: 12px;
}

.armor-purchase-confirm-group {
  padding: 10px 12px;
  background: var(--field-bg-strong);
  border: 2px solid var(--line);
}

.armor-purchase-confirm-group--purchase {
  border-left: 6px solid var(--accent);
}

.armor-purchase-confirm-group h3 {
  margin: 0 0 8px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.armor-purchase-confirm-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.armor-purchase-confirm-list li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-weight: 800;
}

.armor-purchase-confirm-quantity {
  flex: 0 0 auto;
  color: var(--accent);
  font-family: "Arial Black", Impact, sans-serif;
}

.login-dialog-header,
.system-dialog-header,
.system-record-dialog-header,
.sheet-replace-dialog-header,
.class-details-dialog-header,
.ability-swap-dialog-header,
.traveller-advancement-dialog-header,
.armor-dialog-header,
.inventory-dialog-header,
.spell-dialog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
  margin-bottom: 4px;
}

.login-dialog h2,
.system-dialog h2,
.system-record-dialog h3,
.sheet-replace-dialog h2,
.class-details-dialog h2,
.ability-swap-dialog h2,
.traveller-advancement-dialog h2,
.armor-dialog h2,
.inventory-dialog h2,
.spell-dialog h2 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.3rem;
  text-transform: uppercase;
}

#inventory-dialog-title {
  display: inline-flex;
  gap: 0.45em;
  align-items: center;
}

#inventory-dialog-title .fa-solid {
  flex: 0 0 auto;
  font-size: 0.9em;
}

.inventory-list-view--locked .inventory-list-toolbar {
  grid-template-columns: minmax(0, 280px);
  justify-content: end;
}

.system-owner-nickname-field {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.system-owner-nickname-field input {
  min-width: 0;
  width: 100%;
  height: 32px;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--field-bg-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: none;
}

.item-json-text-field {
  display: grid;
  gap: 6px;
  margin: 12px 0 8px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.76rem;
  text-transform: uppercase;
}

.item-json-text-field textarea {
  min-height: 180px;
  resize: vertical;
  color: var(--ink);
  background: var(--field-bg);
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Courier New", monospace;
  font-size: 0.82rem;
  line-height: 1.35;
  text-transform: none;
}

.sheet-replace-dialog p,
.ability-swap-primary,
.ability-swap-copy,
.ability-swap-message,
.traveller-advancement-message {
  margin: 12px 0 16px;
  font-weight: 800;
  line-height: 1.25;
}

.inventory-category-delete-dialog-backdrop {
  z-index: 145;
}

.inventory-delete-category-field {
  display: grid;
  gap: 6px;
  margin: -4px 0 16px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

#open-inventory-delete-category[hidden] {
  display: none;
}

.inventory-delete-category-field select {
  width: 100%;
  min-height: 38px;
  padding: 7px 8px;
  color: var(--ink);
  background: var(--field-bg-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  text-transform: none;
}

.ability-swap-primary {
  margin-bottom: 0;
}

.ability-swap-copy {
  margin-top: 0;
}

.ability-swap-message {
  min-height: 20px;
  margin: 0;
  color: var(--accent);
}

.class-details-dialog-body {
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.class-details-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--line);
  font-weight: 800;
}

.class-details-summary strong {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1rem;
  text-transform: uppercase;
}

.class-details-summary span {
  color: var(--accent);
}

.class-details-dialog-body .class-rules-text {
  column-count: 1;
  overflow: visible;
  font-size: 0.9rem;
  line-height: 1.28;
}

.class-details-dialog-body .class-extra-box {
  max-height: none;
  overflow: visible;
}

.manual-overrides-dialog {
  width: min(560px, 100%);
}

.manual-overrides-dialog-body {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.manual-overrides-empty {
  margin: 0;
  padding: 12px;
  border: 2px dashed var(--line);
  font-weight: 800;
}

.manual-override-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--line);
  background: var(--soft-panel-bg);
}

.manual-override-info {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.manual-override-info strong,
.manual-override-info span {
  overflow-wrap: anywhere;
}

.manual-override-info strong {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.8rem;
  text-transform: uppercase;
}

.manual-override-info span {
  font-weight: 800;
}

.manual-override-values {
  display: grid;
  gap: 2px;
}

.manual-override-value {
  line-height: 1.12;
}

.manual-override-value + .manual-override-value {
  color: var(--muted);
}

.manual-override-restore-button {
  min-width: 96px;
}

.ability-swap-form,
.traveller-advancement-form {
  display: grid;
  gap: 12px;
}

.ability-swap-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.ability-swap-field {
  display: grid;
  gap: 4px;
  min-width: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.ability-swap-field select {
  min-width: 0;
  padding: 7px 8px;
  color: var(--ink);
  background: var(--field-bg-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
  text-transform: none;
}

.ability-swap-class-field {
  margin-top: 4px;
}

.ability-swap-class-field[hidden] {
  display: none;
}

.traveller-advancement-list {
  display: grid;
  gap: 10px;
  max-height: min(56dvh, 460px);
  overflow: auto;
}

.traveller-advancement-row {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 2px solid var(--line);
  background: var(--soft-panel-bg);
}

.traveller-advancement-row h3 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.traveller-advancement-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.traveller-advancement-controls select {
  min-width: 0;
  padding: 7px 8px;
  color: var(--ink);
  background: var(--field-bg-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.86rem;
  font-weight: 800;
}

.traveller-advancement-controls select:first-child {
  grid-column: span 3;
}

.traveller-advancement-message {
  min-height: 20px;
  margin: 0;
  color: var(--accent);
}

.system-dialog-layout {
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 14px;
  min-height: min(62dvh, 620px);
}

.system-screen .system-dialog-layout {
  grid-template-columns: minmax(220px, 300px) minmax(0, 1fr);
  min-height: 0;
  height: 100%;
}

.system-screen:not(.master-screen) .system-dialog-layout {
  display: contents;
}

.system-sidebar,
.system-editor-form,
.system-editor-panel,
.system-editor-section {
  min-width: 0;
}

.system-sidebar {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  min-height: min(62dvh, 620px);
}

.system-screen .system-sidebar {
  min-height: 0;
  overflow: hidden;
}

.system-screen:not(.master-screen) .system-sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto minmax(0, 1fr) auto;
  align-self: stretch;
  width: 100%;
  height: 100%;
  padding: var(--panel-padding);
  padding-top: calc(var(--panel-padding) + var(--session-panel-space));
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 34px, var(--panel-margin-rule) 35px 37px, transparent 38px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: var(--panel-shadow-size) var(--panel-shadow-size) 0 var(--panel-drop-shadow);
  transition:
    opacity 160ms ease,
    transform 180ms ease,
    visibility 160ms ease;
}

.system-screen:not(.master-screen) .system-editor-form {
  grid-column: 2;
  grid-row: 1;
  height: 100%;
  min-height: 0;
  padding-top: var(--system-editor-top-clearance);
  padding-left: calc((var(--sidebar-toggle-size) / 2) + 8px);
}

.system-screen:not(.master-screen) .system-list {
  grid-auto-flow: row;
  grid-auto-columns: auto;
  overflow-x: hidden;
  overflow-y: auto;
}

.system-screen:not(.master-screen) .system-owner-nickname-panel {
  grid-column: auto;
}

.system-quota-message {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1.2;
  text-transform: uppercase;
}

.system-list {
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
}

.system-screen .system-list {
  min-height: 0;
}

.system-owner-nickname-panel {
  display: grid;
  gap: 8px;
  align-self: end;
  padding-top: 10px;
  border-top: 2px solid var(--line);
}

.system-list-button {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 8px;
  color: var(--ink);
  background: var(--soft-panel-bg);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 2px 2px 0 var(--line);
  font-weight: 800;
  line-height: 1.12;
  text-align: left;
}

.system-list-button[aria-current="true"] {
  color: var(--on-solid);
  background: var(--solid-bg);
}

.system-list-button span {
  font-size: 0.72rem;
  opacity: 0.82;
}

.system-editor-form {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  min-height: 0;
}

.system-screen .system-editor-form {
  overflow: hidden;
}

.system-editor-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.system-editor-tabs button {
  min-height: 32px;
  padding: 6px 9px;
  color: var(--ink);
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  border-radius: 0;
  box-shadow: 2px 2px 0 var(--control-shadow);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.system-editor-tabs button[aria-selected="true"] {
  color: var(--on-solid);
  background: var(--solid-bg);
}

.system-screen:not(.master-screen) .system-editor-form button,
.system-screen:not(.master-screen) .system-sidebar > .primary-action,
.system-screen:not(.master-screen) .system-owner-nickname-panel .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--system-button-height);
  min-height: var(--system-button-height);
  padding-block: 0;
  line-height: 1;
}

.system-editor-empty {
  display: grid;
  min-height: 220px;
  place-items: center;
  border: 2px dashed var(--line);
  background: var(--soft-panel-bg);
}

.system-editor-panel {
  display: grid;
  gap: 14px;
  min-height: var(--system-editor-panel-base-height, 520px);
}

.system-screen .system-editor-panel {
  grid-template-rows: minmax(0, 1fr) auto auto;
  min-height: 0;
  overflow: hidden;
  padding-right: 0;
}

.system-editor-section {
  display: grid;
  align-content: start;
  gap: 14px;
  min-height: var(--system-editor-panel-base-height, 520px);
}

.system-screen .system-editor-section {
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
}

.system-editor-panel[hidden],
.system-editor-section[hidden],
.system-editor-empty[hidden] {
  display: none;
}

.system-editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
}

.system-editor-toggle-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.system-quantitative-marker-editor {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 2px solid var(--line);
  background: var(--soft-panel-bg);
}

.system-quantitative-marker-editor legend {
  padding-inline: 5px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.system-quantitative-marker-editor > .system-editor-toggle {
  justify-self: start;
}

.system-quantitative-marker-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(110px, 0.35fr);
  gap: 10px;
}

.system-quantitative-marker-fields input:disabled {
  opacity: 0.58;
}

.system-postit-color-editor {
  display: grid;
  gap: 10px;
  min-width: 0;
  margin: 0;
  padding: 12px;
  border: 2px solid var(--line);
  background: var(--soft-panel-bg);
}

.system-postit-color-editor legend {
  padding-inline: 5px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.system-postit-color-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(94px, 1fr));
  gap: 8px;
}

.system-postit-color-option {
  display: grid;
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  color: var(--ink);
  background: var(--field-bg);
  border: 2px solid var(--line);
  cursor: pointer;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1;
  text-transform: uppercase;
}

.system-postit-color-option:has(input:disabled) {
  cursor: default;
  opacity: 0.62;
}

.system-postit-color-swatch {
  display: block;
  width: 26px;
  height: 26px;
  background:
    linear-gradient(135deg, transparent 0 68%, var(--postit-corner) 69% 82%, transparent 83%),
    var(--postit-bg);
  border: 2px solid var(--line);
  box-shadow: 2px 2px 0 var(--shadow);
}

.system-postit-color-option input:checked + .system-postit-color-swatch {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.system-postit-color-option input:focus-visible + .system-postit-color-swatch {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.system-postit-color-label {
  min-width: 0;
  overflow-wrap: anywhere;
}

.system-visual-preview-row {
  display: flex;
  justify-content: center;
}

.system-visual-preview-row .secondary-action {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
}

.system-share-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-top: 10px;
}

.system-logo-row {
  display: grid;
  grid-template-columns: 156px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 2px solid var(--line);
  background: var(--soft-panel-bg);
}

.system-logo-preview {
  display: grid;
  place-items: center;
  width: 132px;
  min-height: 96px;
  pointer-events: none;
  background: var(--field-bg);
  border: 2px solid var(--line);
}

.system-logo-preview img {
  width: 104px;
  max-height: 82px;
  object-fit: contain;
}

.system-logo-info {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.system-logo-info strong {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.82rem;
  line-height: 1;
  text-transform: uppercase;
}

.system-logo-info span {
  font-weight: 800;
  line-height: 1.2;
}

.system-logo-dialog-body {
  display: grid;
  gap: 14px;
}


.system-sheet-preview-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1060px, 100%);
  height: min(92dvh, 860px);
  max-height: calc(100dvh - 36px);
  overflow: hidden;
}

.system-sheet-preview-body {
  display: grid;
  justify-items: center;
  align-items: start;
  min-height: 0;
  padding: 12px;
  overflow: auto;
  background:
    linear-gradient(90deg, transparent 0 28px, var(--panel-margin-rule) 29px 31px, transparent 32px),
    repeating-linear-gradient(
      0deg,
      var(--paper) 0,
      var(--paper) 25px,
      var(--notebook-blue) 26px,
      var(--paper) 27px
    );
  border: 2px solid var(--line);
}

.system-sheet-preview-body .sheet-workspace {
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
}

.system-sheet-preview-body .sheet-fit {
  --sheet-scale: 0.72;
  width: calc(900px * var(--sheet-scale));
  height: calc(1120px * var(--sheet-scale));
  margin-right: 0;
}

.system-sheet-preview-body .sheet {
  pointer-events: none;
}

.system-sheet-preview-body .character-notes-toggle,
.system-sheet-preview-body .character-notes-backdrop,
.system-sheet-preview-body .character-notes-panel {
  display: none;
}

.system-logo-editor-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.system-logo-preview-large {
  display: grid;
  place-items: center;
  min-height: 170px;
  padding: 12px;
  pointer-events: none;
  border: 3px solid var(--line);
  background:
    linear-gradient(90deg, transparent 0 28px, var(--panel-margin-rule) 29px 31px, transparent 32px),
    repeating-linear-gradient(
      0deg,
      var(--paper) 0,
      var(--paper) 25px,
      var(--notebook-blue) 26px,
      var(--paper) 27px
    );
}

.system-logo-preview-large .sheet-logo-text {
  width: 160px;
  height: 116px;
  font-size: 1.42rem;
}

.system-logo-preview-large .sheet-logo-text[data-logo-font="rubik-glitch"] {
  font-size: 1.48rem;
}

.system-logo-preview-large .sheet-logo-text[data-logo-font="rubik-dirt"] {
  font-size: 1.34rem;
}

.system-logo-preview-large .sheet-logo-text[data-logo-font="im-fell-english-sc"] {
  font-size: 1.62rem;
}

.system-logo-toggle-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.system-logo-toggle-row label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 2px solid var(--line);
  background: var(--field-bg);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.system-section-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.system-toolbar-search {
  width: min(100%, 280px);
  margin-right: auto;
}

.system-search-field {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.system-search-field input {
  min-width: 0;
  height: 34px;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--field-bg);
  border: 2px solid var(--line);
  border-radius: 0;
}

.system-editor-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.system-editor-field[hidden] {
  display: none !important;
}

.system-editor-field input,
.system-editor-field select,
.system-editor-field textarea {
  min-width: 0;
  width: 100%;
  padding: 8px;
  color: var(--ink);
  background: var(--field-bg-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
  text-transform: none;
}

.system-editor-field input[type="checkbox"] {
  width: 18px;
  min-width: 18px;
  height: 18px;
  padding: 0;
  accent-color: var(--accent);
}

.system-editor-checkbox-field input[type="checkbox"] {
  justify-self: start;
  margin: 0;
}

.system-editor-inline-check {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.system-editor-toggle input[type="checkbox"] {
  justify-self: start;
}

.system-record-static-field strong {
  min-width: 0;
  width: 100%;
  padding: 8px;
  color: var(--ink);
  background: transparent;
  border: 2px solid var(--line);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.9rem;
  line-height: 1.2;
  text-transform: none;
  overflow-wrap: anywhere;
}

.system-json-editor {
  min-height: max(220px, calc(var(--system-editor-panel-base-height, 520px) - 84px));
  resize: vertical;
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.78rem;
  font-weight: 400;
  white-space: pre;
}

.system-mini-list,
.system-card-list {
  display: grid;
  align-content: start;
  gap: 10px;
  max-height: min(48dvh, 520px);
  overflow: auto;
}

.system-screen .system-mini-list,
.system-screen .system-card-list {
  max-height: none;
}

[data-system-panel="items"] .system-card-list,
[data-system-panel="spells"] .system-card-list {
  max-height: max(220px, calc(var(--system-editor-panel-base-height, 520px) - 64px));
}

.system-screen [data-system-panel="items"] .system-card-list,
.system-screen [data-system-panel="spells"] .system-card-list {
  max-height: none;
}
[data-system-panel="movement"] {
  grid-template-rows: auto minmax(0, 1fr);
}

.system-movement-table-wrap {
  min-height: 0;
  overflow: auto;
  border: 2px solid var(--line);
  background: var(--soft-panel-bg);
}

.system-movement-table {
  width: 100%;
  min-width: 980px;
  border-collapse: collapse;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.82rem;
  line-height: 1.15;
}

.system-movement-table th,
.system-movement-table td {
  min-width: 0;
  padding: 0;
  border: 1px solid var(--line);
  vertical-align: top;
}

.system-movement-table th {
  padding: 8px;
  color: var(--on-solid);
  background: var(--solid-bg);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1.05;
  text-align: left;
  text-transform: uppercase;
}

.system-movement-table input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 7px 8px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  font: inherit;
  font-weight: 800;
  outline: 0;
}

.system-movement-table input:focus {
  background: var(--paper-bg);
  box-shadow: inset 0 0 0 2px var(--accent);
}

.system-movement-table .system-movement-remove-button {
  width: 100%;
  min-height: 36px;
  border: 0;
  box-shadow: none;
}

.system-movement-empty {
  padding: 12px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
}

[data-system-panel="abilities"] .system-mini-list,
[data-system-panel="classes"] .system-card-list {
  max-height: none;
  overflow: visible;
}

.system-mini-row,
.system-card-row {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 2px solid var(--line);
  background: var(--soft-panel-bg);
}

.system-mini-empty {
  padding: 10px;
  border: 2px solid var(--line);
  background: var(--soft-panel-bg);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.system-mini-row {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: end;
}

[data-system-panel="saves"] .system-mini-row {
  grid-template-columns: minmax(72px, 0.42fr) minmax(0, 1fr) auto;
}

[data-system-panel="abilities"] .system-mini-row {
  grid-template-columns: minmax(0, 1fr) minmax(74px, 0.58fr) minmax(158px, 1fr) auto;
}

.system-mini-row .system-editor-field {
  font-size: 0.66rem;
}

.system-card-row {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.system-card-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.system-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.system-card-edit-button,
.system-card-duplicate-button,
.system-card-remove-button,
.system-record-remove-button,
.system-record-add-button {
  min-height: 32px;
  padding: 6px 9px;
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 2px 2px 0 var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
}

.system-card-edit-button,
.system-card-duplicate-button {
  color: var(--ink);
  background: transparent;
}

.system-card-remove-button,
.system-record-remove-button,
.system-record-add-button {
  color: var(--accent-ink);
  background: var(--accent);
}

.system-record-editor-body {
  display: grid;
  gap: 14px;
}

.system-record-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px 14px;
}

.system-record-grid .system-editor-field--wide,
.system-record-section {
  grid-column: 1 / -1;
}

.system-record-section {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 2px solid var(--line);
  background: var(--soft-panel-bg);
}

.system-record-section h4 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.system-record-feature-list,
.system-record-rule-list,
.system-record-special-list,
.system-record-progression-list {
  display: grid;
  gap: 10px;
}

.system-record-feature-row,
.system-record-rule-row,
.system-record-special-row {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 2px solid var(--line);
  background: var(--field-bg);
}

.system-record-feature-row {
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 1fr) auto;
  align-items: end;
}

.system-record-rule-row {
  grid-template-columns: minmax(0, 0.45fr) minmax(0, 1fr) auto;
  align-items: end;
}

.system-record-special-row {
  grid-template-columns: minmax(130px, 0.7fr) minmax(160px, 1fr) auto;
  align-items: end;
}

.system-record-special-details {
  display: grid;
  grid-column: 1 / -1;
  gap: 10px;
  min-width: 0;
}

.system-record-choice-options {
  display: grid;
  gap: 10px;
}

.system-record-choice-option {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  font-weight: 800;
}

.system-record-choice-option input {
  flex: 0 0 auto;
}

.system-record-special-row > .system-record-remove-button {
  grid-column: 3;
  grid-row: 1;
  align-self: end;
}

.system-record-inline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.system-record-type-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.system-record-spell-type-list {
  display: grid;
  gap: 14px;
}

.system-record-spell-type-row {
  display: grid;
  grid-template-columns: 120px minmax(0, 1fr) minmax(0, 1fr) minmax(210px, 270px) auto;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border: 2px solid var(--line);
  background: var(--soft-panel-bg);
}

.system-record-spell-type-row > .system-editor-field,
.system-record-spell-type-row > .system-record-remove-button {
  align-self: center;
}

.system-spell-type-asset-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px;
  gap: 12px;
  align-items: center;
}

.system-spell-type-asset-preview {
  display: grid;
  place-items: center;
  width: 72px;
  height: 72px;
  padding: 8px;
  border: 2px solid var(--line);
  background: var(--accent);
}

.system-spell-type-asset-preview[hidden] {
  display: none;
}

.system-spell-type-asset-preview-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
  filter: brightness(0);
}

.system-record-save-grid {
  display: grid;
  grid-column: 1 / -2;
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
  gap: 10px;
}

.system-record-special-progress-grid {
  display: grid;
  grid-column: 1 / -2;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 10px;
}

.system-record-special-table-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.system-record-progression-table-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.system-record-special-table-wrap {
  max-width: 100%;
  overflow-x: auto;
  border: 2px solid var(--line);
  background: var(--paper-bg);
}

.system-record-special-edit-table {
  width: 100%;
  min-width: 460px;
  border-collapse: collapse;
  table-layout: fixed;
}

.system-record-progression-edit-table {
  min-width: 820px;
  table-layout: auto;
}

.system-record-special-edit-table th,
.system-record-special-edit-table td {
  min-width: 118px;
  padding: 0;
  border: 1px solid var(--line);
  background: var(--field-bg);
  vertical-align: top;
}

.system-record-special-edit-table th {
  background: var(--soft-panel-bg);
}

.system-record-progression-edit-table th,
.system-record-progression-edit-table td {
  min-width: 84px;
}

.system-record-progression-edit-table .system-record-progression-level-cell,
.system-record-progression-edit-table .system-record-progression-small-cell {
  width: 72px;
  min-width: 72px;
}

.system-record-progression-edit-table .system-record-progression-xp-cell,
.system-record-progression-edit-table .system-record-progression-spell-cell,
.system-record-progression-edit-table .system-record-progression-hit-points-cell {
  min-width: 104px;
}

.system-record-progression-edit-table .system-record-progression-save-cell {
  width: 86px;
  min-width: 86px;
}

.system-record-progression-edit-table .system-record-progression-special-cell {
  min-width: 128px;
}

.system-record-progression-header-label {
  display: block;
  min-width: 0;
  padding: 8px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1.08;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.system-record-special-table-actions-cell {
  width: 96px;
  min-width: 96px;
  max-width: 96px;
  text-align: center;
}

.system-record-special-table-cell-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px;
  align-items: stretch;
  min-width: 0;
}

.system-record-special-table-input {
  width: 100%;
  min-width: 0;
  height: 34px;
  padding: 7px 8px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-weight: 800;
  outline: none;
}

.system-record-special-table-input:focus {
  box-shadow: inset 0 0 0 2px var(--accent);
  background: var(--paper-bg);
}

.system-record-progression-table-input {
  height: 36px;
}

.system-record-progression-edit-table .system-record-remove-button {
  width: 100%;
  min-height: 36px;
  border: 0;
  box-shadow: none;
  background: var(--soft-panel-bg);
  color: var(--ink);
}

.system-record-progression-edit-table .system-record-remove-button:hover,
.system-record-progression-edit-table .system-record-remove-button:focus {
  background: var(--accent);
  color: var(--paper-bg);
  outline: none;
}

.system-record-special-table-action {
  width: 100%;
  min-height: 34px;
  padding: 6px 8px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: var(--soft-panel-bg);
  color: var(--ink);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  text-transform: uppercase;
  cursor: pointer;
}

.system-record-special-table-action:hover,
.system-record-special-table-action:focus {
  background: var(--accent);
  color: var(--paper-bg);
  outline: none;
}

.system-record-special-table-action:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.system-record-special-table-action--add {
  border-left: 0;
  background: var(--accent);
  color: var(--paper-bg);
}

.system-record-special-table-note-row .system-editor-field {
  margin-top: 2px;
}

.system-record-weapon-access-field,
.system-record-kit-field {
  align-items: start;
}

.system-record-weapon-access-control,
.system-record-kit-control {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.system-record-weapon-access-summary,
.system-record-kit-summary {
  flex: 1 1 220px;
  min-width: 0;
  margin: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.25;
  text-transform: none;
  overflow-wrap: anywhere;
}

.system-weapon-access-dialog,
.system-kit-items-dialog {
  width: min(860px, 100%);
}

.system-kit-items-search {
  display: grid;
  gap: 4px;
  min-width: 0;
  margin: 8px 0 12px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.system-kit-items-search input {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--field-bg);
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
}

.system-weapon-access-body,
.system-kit-items-body {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(132px, auto) minmax(0, 1fr);
  gap: 14px;
  align-items: stretch;
}

.system-weapon-access-list,
.system-kit-items-list {
  display: grid;
  gap: 6px;
  min-width: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.system-weapon-access-list select,
.system-kit-items-list select {
  min-width: 0;
  width: 100%;
  min-height: 260px;
  padding: 8px;
  color: var(--ink);
  background: var(--field-bg-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
}

body.system-journey-active .system-weapon-access-list,
body.system-journey-active .system-weapon-access-list select,
body.system-journey-active .system-kit-items-list,
body.system-journey-active .system-kit-items-list select {
  min-height: 0;
}

body.system-journey-active .system-weapon-access-list select,
body.system-journey-active .system-kit-items-list select {
  height: 100%;
}

.system-weapon-access-controls,
.system-kit-items-controls {
  display: grid;
  gap: 10px;
  align-content: center;
}

.system-weapon-access-controls .secondary-action,
.system-kit-items-controls .secondary-action {
  width: 100%;
}

.system-weapon-access-controls .secondary-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
}

.system-record-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
}

.system-card-row strong {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.82rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.system-card-row span {
  font-weight: 800;
  line-height: 1.15;
}

.system-editor-message {
  min-height: 20px;
  margin: 0;
  color: var(--accent);
  font-weight: 800;
}

.system-editor-actions {
  --system-editor-action-width: 104px;
  --system-editor-action-height: var(--system-button-height);
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  padding-top: 2px;
}

.system-editor-actions .primary-action,
.system-editor-actions .secondary-action,
.system-editor-actions .system-danger-action {
  display: inline-flex;
  flex: 0 0 var(--system-editor-action-width);
  align-items: center;
  justify-content: center;
  width: var(--system-editor-action-width);
  min-width: var(--system-editor-action-width);
  max-width: var(--system-editor-action-width);
  height: var(--system-editor-action-height);
  min-height: var(--system-editor-action-height);
  padding: 0 10px;
  font-size: 0.72rem;
  line-height: 1;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: keep-all;
}

.system-danger-action {
  min-height: 36px;
  padding: 7px 10px;
  margin-right: auto;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 2px 2px 0 var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  text-transform: uppercase;
}

.system-danger-action:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.armor-form,
.inventory-form,
.spell-form {
  display: grid;
  gap: 12px;
}

.inventory-form,
.spell-form {
  grid-template-rows: auto minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
}

.armor-list-view,
.armor-custom-view,
.inventory-list-view,
.inventory-selection-view,
.inventory-custom-view,
.spell-custom-view,
.spell-preparation-view,
.spell-prepared-view,
.spell-learning-view,
.spell-visibility-view {
  display: grid;
  gap: 12px;
}

.inventory-list-view,
.inventory-selection-view,
.spell-preparation-view,
.spell-learning-view {
  grid-template-rows: auto auto minmax(0, 1fr);
  min-height: 0;
}

.spell-prepared-view {
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.spell-visibility-view {
  grid-template-rows: auto auto minmax(0, 1fr) auto;
  min-height: 0;
}

.inventory-custom-view,
.spell-custom-view {
  min-height: 0;
  overflow: auto;
  padding-right: 3px;
}

.inventory-custom-view,
.spell-custom-view {
  align-content: center;
  justify-items: center;
  padding: clamp(10px, 2.4vmin, 24px) clamp(8px, 2vmin, 18px);
}

.inventory-custom-view .inventory-dialog-summary,
.spell-custom-view .spell-dialog-summary {
  justify-content: center;
  width: min(100%, 760px);
  text-align: center;
}

.armor-custom-view[hidden],
.inventory-list-view[hidden],
.inventory-selection-view[hidden],
.inventory-custom-view[hidden],
.spell-custom-view[hidden],
.spell-preparation-view[hidden],
.spell-prepared-view[hidden],
.spell-learning-view[hidden],
.spell-visibility-view[hidden] {
  display: none;
}

.inventory-selection-view {
  gap: 7px;
  grid-template-rows: auto minmax(0, 1fr);
}

.armor-dialog-summary,
.inventory-dialog-summary,
.spell-dialog-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin: 8px 0 6px;
  font-weight: 800;
  line-height: 1.16;
}

.inventory-selection-view .inventory-dialog-summary {
  margin-bottom: 0;
}


.inventory-debit-control {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.62rem;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
  white-space: nowrap;
}

.inventory-debit-control input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--accent);
}

.armor-dialog-summary strong,
.inventory-dialog-summary strong,
.spell-dialog-summary strong {
  padding: 2px 6px;
  color: var(--on-solid);
  background: var(--solid-bg);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.78rem;
  line-height: 1;
  text-transform: uppercase;
}

.spell-toolbar,
.inventory-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 10px;
  align-items: end;
}

.inventory-list-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 10px;
  align-items: end;
}

.inventory-list-toolbar .inventory-search-field {
  min-width: 0;
}

.spell-tab-stack {
  display: grid;
  gap: 6px;
}

.spell-higher-slot-control,
.spell-hidden-only-control {
  display: inline-flex;
  gap: 7px;
  align-items: center;
  justify-self: start;
  width: fit-content;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.66rem;
  line-height: 1.1;
  text-transform: uppercase;
  cursor: pointer;
}

.spell-higher-slot-control input,
.spell-hidden-only-control input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.spell-higher-slot-note {
  display: block;
  margin-top: 3px;
  color: var(--accent-ink);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.66rem;
  font-weight: 900;
  line-height: 1.1;
}

.armor-market-shortcut,
.inventory-custom-shortcut,
.inventory-market-shortcut,
.spell-custom-shortcut {
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 2px 2px 0 var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  line-height: 1;
}

.armor-market-shortcut,
.inventory-market-shortcut,
.inventory-custom-shortcut {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  font-size: 1rem;
}

.armor-market-shortcut[hidden],
.inventory-custom-shortcut[hidden],
.inventory-market-shortcut[hidden],
.spell-custom-shortcut[hidden] {
  display: none;
}

.armor-market-shortcut .fa-solid,
.inventory-custom-shortcut .fa-solid,
.inventory-market-shortcut .fa-solid,
.spell-custom-shortcut .fa-solid {
  flex: 0 0 auto;
  font-size: 0.95rem;
}

.spell-custom-shortcut {
  display: grid;
  width: 34px;
  height: 34px;
  padding: 0;
  place-items: center;
  font-size: 1.1rem;
}

.inventory-search-actions,
.spell-search-actions {
  display: grid;
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.inventory-search-actions {
  grid-template-columns: minmax(0, 1fr) max-content;
}

.spell-search-actions {
  grid-template-columns: minmax(0, 1fr) 34px;
}

.spell-search-actions--learning {
  grid-template-columns: minmax(0, 1fr) 34px 34px;
}

.spell-dialog-summary > .spell-list-shortcut {
  flex: 0 0 auto;
  margin-left: auto;
}

.inventory-market-layout {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  min-width: 0;
  min-height: 0;
}

.spell-cycle-tabs,
.inventory-category-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.spell-cycle-tabs[hidden] {
  display: none;
}

.spell-cycle-tab,
.inventory-category-tab {
  min-height: 34px;
  padding: 5px 8px;
  color: var(--ink);
  background: var(--paper);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 2px 2px 0 var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.spell-cycle-tab[aria-selected="true"],
.inventory-category-tab[aria-selected="true"] {
  color: var(--on-solid);
  background: var(--solid-bg);
}

.spell-cycle-tab:disabled,
.inventory-category-tab:disabled {
  color: var(--unavailable-ink);
  background: var(--unavailable-bg);
  box-shadow: none;
  cursor: not-allowed;
  opacity: 0.62;
}

.spell-type-tab {
  min-height: 30px;
  font-size: 0.64rem;
}

.spell-search-field,
.inventory-search-field {
  display: grid;
  gap: 3px;
  min-width: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
}

.spell-search-field input,
.inventory-search-field input {
  min-width: 0;
  height: 34px;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--field-bg);
  border: 2px solid var(--line);
  border-radius: 0;
}

.armor-table-wrap {
  max-height: min(62dvh, 560px);
  overflow: auto;
  border: 3px solid var(--line);
  background: var(--table-bg);
}

.spell-table-wrap,
.inventory-table-wrap {
  min-height: 0;
  max-height: none;
  overflow: auto;
  border: 3px solid var(--line);
  background: var(--table-bg);
}

.armor-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  line-height: 1.16;
}

.spell-preparation-table,
.spell-prepared-table,
.spell-learning-table,
.spell-visibility-table,
.inventory-table,
.inventory-selection-table {
  width: 100%;
  border-collapse: collapse;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  line-height: 1.16;
}

.inventory-selection-table {
  table-layout: fixed;
}

.armor-table th,
.armor-table td,
.spell-preparation-table th,
.spell-preparation-table td,
.spell-prepared-table th,
.spell-prepared-table td,
.spell-learning-table th,
.spell-learning-table td,
.spell-visibility-table th,
.spell-visibility-table td,
.inventory-table th,
.inventory-table td,
.inventory-selection-table th,
.inventory-selection-table td {
  padding: 8px 7px;
  border: 2px solid var(--line);
  vertical-align: top;
}

.armor-table thead th,
.spell-preparation-table thead th,
.spell-prepared-table thead th,
.spell-learning-table thead th,
.spell-visibility-table thead th,
.inventory-table thead th,
.inventory-selection-table thead th {
  color: var(--on-solid);
  background: var(--solid-bg);
  text-align: left;
  text-transform: uppercase;
}

.inventory-selection-table thead th {
  white-space: nowrap;
}

.armor-table tbody th,
.spell-preparation-table tbody th,
.spell-prepared-table tbody th,
.spell-learning-table tbody th,
.spell-visibility-table tbody th,
.inventory-table tbody th,
.inventory-selection-table tbody th {
  text-align: left;
}

.inventory-table td:nth-child(1),
.inventory-table td:nth-child(3),
.inventory-table td:nth-child(4),
.inventory-table td:nth-child(5),
.inventory-selection-table td:nth-child(1),
.inventory-selection-table td:nth-child(3),
.inventory-selection-table td:nth-child(4) {
  text-align: center;
  white-space: nowrap;
}

.inventory-selection-table th:nth-child(1),
.inventory-selection-table td:nth-child(1) {
  width: 96px;
}

.inventory-selection-table th:nth-child(3),
.inventory-selection-table td:nth-child(3) {
  width: 76px;
}

.inventory-selection-table th:nth-child(4),
.inventory-selection-table td:nth-child(4) {
  width: 76px;
}

.spell-preparation-table td:nth-child(1),
.spell-preparation-table td:nth-child(3),
.spell-prepared-table td:nth-child(1),
.spell-prepared-table td:nth-child(3),
.spell-learning-table td:nth-child(1),
.spell-learning-table td:nth-child(3),
.spell-visibility-table td:nth-child(1),
.spell-visibility-table td:nth-child(3) {
  text-align: center;
  white-space: nowrap;
}

.spell-preparation-table td:nth-child(4),
.spell-prepared-table td:nth-child(4),
.spell-learning-table td:nth-child(4),
.spell-visibility-table td:nth-child(4) {
  width: 52%;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.18;
}

.spell-description-text {
  white-space: pre-line;
}

.inventory-table td:nth-child(6),
.inventory-selection-table td:nth-child(5) {
  width: 44%;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.18;
}

.inventory-table tbody th,
.inventory-table tbody td,
.inventory-selection-table tbody th,
.inventory-selection-table tbody td {
  padding: 3px 5px;
  vertical-align: middle;
}

.inventory-notes-cell {
  max-width: 0;
  white-space: nowrap;
}

.inventory-notes-inline,
.inventory-notes-preview {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-notes-toggle {
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr);
  gap: 3px;
  align-items: center;
  width: 100%;
  min-width: 0;
  min-height: 18px;
  padding: 0;
  overflow: hidden;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: inherit;
  line-height: 1.05;
  text-align: left;
}

.inventory-notes-toggle--open {
  align-items: start;
  white-space: normal;
}

.inventory-notes-toggle .fa-solid {
  color: var(--accent);
  font-size: 0.58rem;
  line-height: 1.4;
  transition: transform 140ms ease;
}

.inventory-notes-toggle--open .fa-solid {
  transform: rotate(90deg);
}

.inventory-notes-toggle--open .inventory-notes-preview {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.inventory-notes-remaining {
  display: block;
  grid-column: 2;
  min-width: 0;
  max-height: 96px;
  margin: 0;
  padding-top: 3px;
  overflow: auto;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.16;
  text-transform: none;
  white-space: pre-line;
}

.inventory-notes-remaining[hidden] {
  display: none;
}

.inventory-quantity-stack {
  display: grid;
  justify-items: center;
  gap: 3px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  line-height: 1.05;
}

.inventory-quantity-count {
  display: block;
}

.inventory-usage-control {
  display: inline-flex;
  gap: 2px;
  align-items: center;
  justify-content: center;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: inherit;
  line-height: inherit;
}

.inventory-usage-control input {
  width: 34px;
  height: 20px;
  padding: 0 2px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: inherit;
  line-height: inherit;
  text-align: right;
}

.inventory-usage-control input:focus {
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
  background: var(--field-bg);
}

.inventory-usage-control span {
  font-size: inherit;
  line-height: inherit;
}

.armor-custom-grid,
.inventory-custom-grid,
.spell-custom-grid {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(160px, 0.8fr) repeat(4, minmax(86px, 0.35fr));
  gap: 10px;
  align-items: end;
}

.armor-custom-grid {
  grid-template-columns: minmax(180px, 1fr) repeat(4, minmax(96px, 0.4fr));
}

.spell-custom-grid {
  width: min(100%, 760px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.inventory-custom-grid {
  width: min(100%, 760px);
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.inventory-custom-field[for="custom-item-name"],
.inventory-custom-field[for="custom-item-category"] {
  grid-column: span 2;
}

.spell-custom-field[for="custom-spell-name"] {
  grid-column: span 3;
}

.spell-custom-field[for="custom-spell-range"],
.spell-custom-field[for="custom-spell-duration"] {
  grid-column: span 2;
}

.armor-custom-field,
.inventory-custom-field,
.spell-custom-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.7rem;
  text-transform: uppercase;
}
.armor-custom-field[hidden],
.inventory-custom-field[hidden] {
  display: none;
}


.armor-custom-field--wide,
.inventory-custom-field--wide,
.spell-custom-field--wide {
  grid-column: 1 / -1;
}

.armor-custom-field--check,
.inventory-custom-field--check {
  display: flex;
  align-items: center;
  gap: 7px;
}

.inventory-custom-field--check {
  align-self: end;
  min-height: 35px;
}

.armor-custom-field--check input,
.inventory-custom-field--check input {
  width: auto;
}

.armor-custom-field input,
.armor-custom-field select,
.armor-custom-field textarea,
.inventory-custom-field input,
.inventory-custom-field select,
.inventory-custom-field textarea,
.spell-custom-field input,
.spell-custom-field textarea {
  min-width: 0;
  padding: 6px 8px;
  color: var(--ink);
  background: var(--field-bg);
  border: 2px solid var(--line);
  border-radius: 0;
}

.armor-custom-field input,
.armor-custom-field select,
.inventory-custom-field input,
.inventory-custom-field select,
.spell-custom-field input {
  min-height: 42px;
}

.inventory-custom-field textarea,
.spell-custom-field textarea {
  min-height: 128px;
  resize: vertical;
}

.inventory-category-row th {
  color: var(--accent-ink);
  background: var(--accent);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.74rem;
  text-align: left;
  text-transform: uppercase;
}

.inventory-table tbody tr.inventory-row-linked {
  background: var(--linked-bg);
}

.inventory-table tbody tr.inventory-row-weightless .inventory-weight-value {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-thickness: 2px;
}

.inventory-selection-table tbody tr.inventory-row-selected {
  background: var(--selected-bg);
}

.inventory-armor-access-warning {
  display: block;
  margin-top: 3px;
  color: var(--accent);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.1;
}

.spell-preparation-table tbody tr.spell-row-prepared {
  background: var(--selected-bg);
}

.spell-preparation-table tbody tr.spell-row-higher-slot {
  box-shadow: inset 5px 0 0 var(--accent);
}

.spell-prepared-table {
  font-size: 0.8rem;
}

.spell-prepared-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--ink);
}

.spell-learning-table input[type="checkbox"],
.spell-visibility-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.spell-learning-table input[type="checkbox"]:disabled {
  opacity: 0.7;
}

.spell-prepared-table tbody tr.spell-row-spent {
  color: var(--spent-ink);
  background: var(--spent-bg);
}

.spell-learning-table tbody tr.spell-row-known {
  background: var(--selected-bg);
}

.spell-visibility-table tbody tr.spell-row-hidden {
  color: var(--unavailable-ink);
  background: var(--unavailable-bg);
}

.spell-hidden-badge {
  display: inline-flex;
  margin-left: 7px;
  padding: 2px 5px;
  color: var(--on-solid);
  background: var(--muted);
  font-size: 0.56rem;
  line-height: 1;
  text-transform: uppercase;
  vertical-align: middle;
}

.spell-management-actions-cell {
  width: 64px;
  text-align: center;
  white-space: nowrap;
}

.spell-management-actions {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  justify-content: center;
}

.spell-modified-badge {
  background: var(--solid-bg);
}

.spell-custom-badge {
  color: var(--accent-ink);
  background: var(--accent);
}

.spell-type-row th {
  color: var(--on-solid);
  background: var(--solid-bg);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  text-align: left;
  text-transform: uppercase;
}

.spell-row-spent .spell-prepared-name {
  text-decoration: line-through;
  text-decoration-thickness: 3px;
}

.spell-count-control,
.inventory-count-control {
  display: inline-grid;
  grid-template-columns: 28px 42px 28px;
  gap: 4px;
  align-items: center;
}

.spell-count-control button,
.inventory-count-control button {
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Arial Black", Impact, sans-serif;
  line-height: 1;
}

.spell-count-control button:disabled,
.inventory-count-control button:disabled {
  color: var(--muted);
  background: var(--disabled-control-bg);
  opacity: 1;
}

.spell-count-control input,
.inventory-count-control input {
  width: 42px;
  height: 28px;
  padding: 2px;
  border: 2px solid var(--line);
  border-radius: 0;
  background: var(--paper);
  font-family: "Arial Black", Impact, sans-serif;
  text-align: center;
}

.inventory-count-control {
  grid-template-columns: 22px 34px 22px;
  gap: 2px;
}

.inventory-count-control button {
  width: 22px;
  height: 22px;
}

.inventory-count-control input {
  width: 34px;
  height: 22px;
  padding: 0 2px;
}

.spell-empty-row td,
.inventory-empty-row td {
  padding: 18px;
  font-weight: 900;
  text-align: center;
}

.inventory-action-column,
.inventory-table td:first-child {
  width: 72px;
  text-align: center;
}

.inventory-weight-count-column,
.inventory-table td:nth-child(4) {
  width: 72px;
  text-align: center;
}

.inventory-weight-toggle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 100%;
  min-height: 20px;
  cursor: pointer;
}

.inventory-weight-toggle input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--accent);
}

.inventory-action-buttons {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
}

.spell-edit-button,
.spell-delete-button,
.inventory-edit-button,
.inventory-remove-button,
.inventory-clear-button {
  width: 22px;
  height: 22px;
  padding: 0;
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Arial Black", Impact, sans-serif;
  line-height: 1;
}

.spell-edit-button,
.inventory-edit-button {
  color: var(--on-solid);
  background: var(--solid-bg);
}

.spell-learning-spell-title {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  justify-content: space-between;
}

.spell-learning-spell-title > span {
  min-width: 0;
}

.spell-edit-button,
.spell-delete-button {
  flex: 0 0 auto;
}

.spell-delete-button,
.inventory-remove-button,
.inventory-clear-button {
  color: var(--accent-ink);
  background: var(--accent);
}

.inventory-selection-personal-title {
  display: flex;
  gap: 8px;
  align-items: center;
}

.inventory-selection-personal-name {
  flex: 1 1 auto;
  min-width: 0;
}

.inventory-selection-personal-delete {
  flex: 0 0 auto;
  margin-left: auto;
}

.spell-edit-button .fa-solid,
.spell-delete-button .fa-solid,
.inventory-edit-button .fa-solid,
.inventory-remove-button .fa-solid,
.inventory-clear-button .fa-solid {
  pointer-events: none;
  font-size: 0.72rem;
}

.inventory-clear-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.armor-table td:nth-child(4),
.armor-table td:nth-child(5),
.armor-table td:nth-child(6) {
  text-align: right;
  white-space: nowrap;
}

.armor-purchase-column,
.armor-choice-column,
.armor-table td:first-child,
.armor-table td:nth-child(2) {
  width: 42px;
  text-align: center;
}

.armor-debit-coins-toggle,
.armor-purchase-button,
.armor-remove-custom-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--line);
  border-radius: 0;
  font-size: 0.82rem;
  line-height: 1;
}

.armor-debit-coins-toggle {
  cursor: pointer;
}

.armor-custom-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.armor-remove-custom-button {
  color: var(--accent-ink);
  background: var(--accent);
  cursor: pointer;
}

.armor-remove-custom-button .fa-solid {
  pointer-events: none;
  font-size: 0.72rem;
}

.armor-purchase-button:disabled {
  color: var(--muted);
  background: var(--disabled-control-bg);
  cursor: not-allowed;
  opacity: 1;
}

.armor-table input[type="radio"],
.armor-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.armor-choice-cell {
  position: relative;
}

.armor-choice-control {
  position: relative;
  display: inline-grid;
  width: 18px;
  height: 18px;
  place-items: center;
  vertical-align: top;
}

.armor-row-purchase-required > th,
.armor-row-purchase-required > td {
  background-color: var(--unavailable-bg);
}

.armor-row-purchase-required .armor-choice-cell input {
  opacity: 0.18;
  filter: grayscale(1);
}

.armor-row-purchase-required label {
  cursor: not-allowed;
}

.armor-purchase-required-indicator {
  position: absolute;
  z-index: 1;
  top: 0;
  left: 0;
  display: grid;
  box-sizing: border-box;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid transparent;
  box-shadow: none;
  font-size: 0.58rem;
  pointer-events: none;
}

.armor-purchase-required-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 5px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 1px solid transparent;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.6rem;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}

.armor-equip-unavailable-trigger {
  position: absolute;
  z-index: 2;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: help;
}

.armor-equip-unavailable-trigger:focus-visible {
  outline: 3px solid var(--focus-ring);
  outline-offset: -4px;
}

.armor-equip-hint {
  position: fixed;
  z-index: 140;
  width: max-content;
  max-width: min(280px, calc(100vw - 24px));
  padding: 8px 10px;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 var(--shadow);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.8rem;
  font-weight: 900;
  line-height: 1.25;
  text-align: left;
}

.armor-row-unavailable {
  color: var(--unavailable-ink);
  background: var(--unavailable-bg);
}

.armor-row-unavailable label {
  cursor: not-allowed;
}

.armor-purchase-note {
  color: var(--accent);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.armor-table label {
  cursor: pointer;
}

.armor-dialog-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.armor-purchase-status {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 auto 0 0;
  color: var(--accent);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  line-height: 1.08;
  text-transform: uppercase;
}

.armor-purchase-status:empty {
  display: none;
}

.spell-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: flex-end;
}

.spell-dialog-actions-start {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-right: auto;
}

.spell-dialog-actions #copy-prepared-spells {
  color: var(--on-solid);
  background: var(--solid-bg);
}


.inventory-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
}

.inventory-selection-stock,
.inventory-selection-cart {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  box-sizing: border-box;
  width: 100%;
  height: min(760px, calc(100dvh - 36px));
  max-height: calc(100dvh - 36px);
  min-width: 0;
  min-height: 0;
  padding: 16px 16px 16px 40px;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 28px, var(--panel-margin-rule) 29px 31px, transparent 32px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: 6px 6px 0 var(--panel-drop-shadow);
}

.inventory-selection-stock[hidden],
.inventory-selection-cart[hidden] {
  display: none;
}

.inventory-selection-cart-header {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: space-between;
  padding: 8px 9px;
  color: var(--on-solid);
  background: var(--solid-bg);
  border-bottom: 2px solid var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  line-height: 1;
  text-transform: uppercase;
}

.inventory-selection-cart-title {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  min-width: 0;
}

.inventory-selection-cart-title .fa-solid {
  flex: 0 0 auto;
}

.inventory-selection-cart-header strong {
  flex: 0 0 auto;
  padding: 3px 5px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--line);
  box-shadow: 1px 1px 0 var(--line);
}

.inventory-selection-cart-summary {
  display: inline-flex;
  flex: 0 0 auto;
  gap: 6px;
  align-items: center;
}

.inventory-selection-cart-clear {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 25px;
  height: 25px;
  padding: 0;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 1px 1px 0 var(--line);
  cursor: pointer;
  font-size: 0.68rem;
  line-height: 1;
}

.inventory-selection-cart-clear:hover:not(:disabled),
.inventory-selection-cart-clear:focus-visible {
  color: var(--on-solid);
  background: var(--solid-bg);
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.inventory-selection-cart-clear:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.inventory-selection-cart-items {
  display: grid;
  align-content: start;
  min-height: 0;
  overflow: auto;
}

.inventory-selection-cart-empty {
  margin: 0;
  padding: 16px 10px;
  color: var(--muted);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.82rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
}

.inventory-selection-cart-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: start;
  padding: 8px 9px;
  border-bottom: 2px solid var(--line);
  font-family: "Trebuchet MS", Arial, sans-serif;
  line-height: 1.15;
}

.inventory-selection-cart-item-content {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.inventory-selection-cart-item-name {
  min-width: 0;
  overflow: hidden;
  color: var(--ink);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1.08;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.inventory-selection-cart-item-meta {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
}

.inventory-selection-cart-item-actions {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: flex-end;
}

.inventory-selection-cart-item-subtotal {
  color: var(--ink);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1.08;
  text-align: right;
  white-space: nowrap;
}

.inventory-selection-cart-remove {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 1px 1px 0 var(--line);
  cursor: pointer;
  font-size: 0.68rem;
  line-height: 1;
}

.inventory-selection-totals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 8px;
  padding: 8px 9px;
  background: var(--field-bg);
  border-top: 2px solid var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1.08;
  text-transform: uppercase;
}

.inventory-selection-totals[hidden] {
  display: none;
}

.inventory-selection-total {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.inventory-selection-total--spend {
  grid-column: span 2;
}

.inventory-selection-total-label {
  color: var(--muted);
}

.inventory-selection-total-value {
  color: var(--ink);
  font-weight: 900;
}

.inventory-selection-total-value-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 8px;
  align-items: center;
  min-width: 0;
}

.inventory-selection-total-value--overrun {
  color: var(--accent);
}

.inventory-selection-total-note {
  display: block;
  color: var(--accent);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-weight: 400;
}

.ability-swap-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.traveller-advancement-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.sheet-replace-dialog-option {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  align-items: center;
  gap: 4px 9px;
  padding: 10px 12px;
  margin: 12px 0;
  color: var(--ink);
  background: var(--control-bg);
  border: 2px solid var(--control-border);
  cursor: pointer;
}
.sheet-replace-dialog-option[hidden] {
  display: none;
}


.sheet-replace-dialog-option input {
  grid-column: 1;
  grid-row: 1;
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--accent);
}

.sheet-replace-dialog-option span {
  grid-column: 2;
  font-weight: 900;
  line-height: 1.2;
}

.sheet-replace-dialog-option small {
  grid-column: 2;
  color: var(--muted-ink);
  font-size: 0.74rem;
  font-weight: 700;
  line-height: 1.3;
}

.sheet-replace-dialog-option input:disabled,
.sheet-replace-dialog-option input:disabled ~ span,
.sheet-replace-dialog-option input:disabled ~ small {
  cursor: not-allowed;
  opacity: 0.62;
}

.sheet-replace-dialog-select {
  display: grid;
  gap: 5px;
  padding: 10px 12px;
  margin: 12px 0;
  color: var(--ink);
  background: var(--control-bg);
  border: 2px solid var(--control-border);
}

.sheet-replace-dialog-select[hidden] {
  display: none;
}

.sheet-replace-dialog-select span {
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sheet-replace-dialog-select select {
  width: 100%;
  min-width: 0;
  height: 36px;
  padding: 5px 28px 5px 8px;
  color: var(--ink);
  background-color: var(--panel);
  border: 2px solid var(--control-border);
  font: 800 0.8rem/1.2 "Trebuchet MS", Arial, sans-serif;
  cursor: pointer;
}

.sheet-replace-dialog-select select:focus {
  border-color: var(--accent);
  outline: 2px solid var(--focus-ring);
  outline-offset: 1px;
}

.sheet-replace-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
}

.sheet-replace-dialog-actions .secondary-action,
.ability-swap-dialog-actions .secondary-action,
.traveller-advancement-dialog-actions .secondary-action,
.armor-dialog-actions .secondary-action,
.inventory-dialog-actions .secondary-action,
.spell-dialog-actions .secondary-action {
  color: var(--accent-ink);
  background: var(--accent);
}

.sheet-replace-dialog-actions .primary-action,
.ability-swap-dialog-actions .primary-action,
.traveller-advancement-dialog-actions .primary-action,
.armor-dialog-actions .primary-action,
.inventory-dialog-actions .primary-action,
.spell-dialog-actions .primary-action {
  color: var(--on-solid);
  background: var(--solid-bg);
}

.spell-dialog-actions #learn-spell-button,
.spell-dialog-actions #prepare-spells-again {
  color: var(--on-solid);
  background: var(--solid-bg);
}

.dialog-close-button {
  display: grid;
  width: var(--x-button-size);
  min-width: var(--x-button-size);
  height: var(--x-button-size);
  min-height: var(--x-button-size);
  padding: 0;
  aspect-ratio: 1 / 1;
  place-items: center;
  color: var(--accent-ink);
  background: var(--accent);
  font-size: 1.3rem;
  line-height: 1;
}

.close-sheet-button .fa-solid,
.dialog-close-button .fa-solid {
  font-size: var(--x-icon-size);
  line-height: 1;
}

.login-options {
  display: grid;
  gap: 9px;
}

.login-provider-list {
  display: grid;
  gap: 10px;
}

.google-signin-button {
  display: grid;
  align-items: center;
  width: 100%;
  min-height: 44px;
}

.google-signin-button > div {
  width: 100% !important;
}

.google-signin-button > #container-div {
  padding: 0 !important;
  background: transparent !important;
}

.google-signin-button > #container-div > div[role="button"] {
  width: 100% !important;
  max-width: none !important;
  min-width: 0 !important;
}

.google-signin-button iframe {
  clip-path: inset(2px 10px) !important;
}
.google-signin-button [id$="-overlay"][role="button"] {
  /* Keep Firefox clicks on Google's transparent overlay instead of the iframe edge. */
  inset: -2px -10px !important;
  z-index: 1 !important;
  width: auto !important;
  height: auto !important;
}

.discord-signin-button {
  width: 100%;
  min-height: 44px;
  color: #fffdf4;
  background: #5865f2;
}

.auth-modal-message {
  min-height: 20px;
  margin: 0;
  color: var(--accent);
  font-weight: 800;
  line-height: 1.25;
}

.sheet-stage {
  --notes-layout-gap: 12px;
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.app-shell.app-shell--notes-open .sheet-stage {
  padding-right: var(--sheet-stage-library-clearance, 0px);
}

.app-shell.app-shell--notes-open:not(.app-shell--sidebar-collapsed) .sheet-stage {
  place-items: center start;
  padding-left: calc((var(--sidebar-toggle-size) / 2) + var(--notes-layout-gap) + 2px - var(--shell-gap));
}

.app-shell.app-shell--sidebar-collapsed.app-shell--notes-open .sheet-stage {
  place-items: center start;
  padding-left: calc((var(--sidebar-toggle-size) / 2) + var(--notes-layout-gap, 12px) + 2px);
}

.app-shell.app-shell--notes-open .sheet-workspace[data-notes-layout="side"][data-notes-open="true"] .sheet-fit {
  justify-self: start;
}

#sheet-root:not(.sheet-placeholder) {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}


.sheet-workspace {
  --notes-panel-width: 360px;
  --notes-panel-height: 100%;
  --notes-toggle-size: 48px;
  --notes-layout-gap: 12px;
  --notes-toggle-rail-width: calc(var(--notes-toggle-size) + var(--notes-layout-gap));
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
}

.sheet-workspace[data-notes-layout="side"][data-notes-open="true"] {
  grid-template-columns: minmax(0, 1fr) var(--notes-panel-width);
  gap: var(--notes-layout-gap);
}

.sheet-workspace[data-notes-layout="side"][data-notes-open="true"] .sheet-fit {
  grid-column: 1;
}

.character-notes-toggle {
  position: absolute;
  top: clamp(52px, 8vmin, 72px);
  right: calc(-1 * var(--notes-toggle-rail-width));
  z-index: 35;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  width: var(--notes-toggle-size);
  height: var(--notes-toggle-size);
  padding: 6px;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 4px 4px 0 var(--control-shadow);
  font-size: 1rem;
  line-height: 1;
}

.character-notes-toggle i {
  display: block;
  line-height: 1;
}

.character-notes-toggle:hover,
.character-notes-toggle:focus,
.character-notes-close:hover,
.character-notes-close:focus {
  color: var(--accent-ink);
  background: var(--accent);
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.character-notes-panel {
  z-index: 34;
  grid-template-rows: auto minmax(0, 1fr) auto;
  width: 100%;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  overflow: hidden;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 0 28px, var(--notebook-red) 29px 31px, transparent 32px),
    repeating-linear-gradient(0deg, transparent 0, transparent 25px, var(--notebook-blue) 26px, transparent 27px),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: 7px 7px 0 var(--panel-drop-shadow);
}

.character-notes-panel:not([hidden]) {
  display: grid;
}

.sheet-workspace[data-notes-layout="side"] .character-notes-panel {
  grid-column: 2;
  width: var(--notes-panel-width);
  height: var(--notes-panel-height);
  align-self: center;
}

.sheet-workspace[data-notes-layout="drawer"] .character-notes-panel {
  position: absolute;
  top: 50%;
  right: 0;
  width: min(430px, 100%);
  height: calc(100% - 16px);
  transform: translateY(-50%);
}

.character-notes-backdrop {
  position: absolute;
  inset: 0;
  z-index: 33;
  background: var(--modal-backdrop);
}

.character-notes-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 48px;
  padding: 9px 10px 8px 38px;
  border-bottom: 3px solid var(--panel-outline);
}

.character-notes-header h2 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1rem;
  line-height: 1;
  text-transform: uppercase;
}

.character-notes-close {
  display: none;
  place-items: center;
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--line);
  border-radius: 0;
}

.character-notes-editor {
  min-width: 0;
  min-height: 0;
  padding: 0 0 0 30px;
  overflow: hidden;
}

.character-notes-error {
  margin: 0;
  padding: 8px 10px 8px 38px;
  color: var(--accent);
  background: var(--panel);
  border-top: 2px solid var(--panel-outline);
  font-weight: 800;
}

.character-notes-panel .toastui-editor-defaultUI {
  height: 100% !important;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-radius: 0;
}

.character-notes-panel .toastui-editor-toolbar {
  height: auto;
  min-height: 42px;
  padding: 4px;
  overflow-x: auto;
  background: var(--panel);
  border-bottom: 2px solid var(--panel-outline);
}

.character-notes-panel .toastui-editor-toolbar-group {
  margin-right: 3px;
}

.character-notes-panel .toastui-editor-toolbar-icons {
  width: 30px;
  height: 30px;
  margin: 1px;
  border-color: transparent;
}

.character-notes-panel .toastui-editor-main,
.character-notes-panel .toastui-editor-main-container,
.character-notes-panel .toastui-editor-ww-container {
  min-height: 0;
  color: var(--ink);
  background: transparent;
}

.character-notes-panel .toastui-editor-ww-container .ProseMirror,
.character-notes-panel .toastui-editor-contents {
  min-height: 100%;
  padding: 16px 14px 28px 12px;
  color: var(--ink);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.9rem;
  line-height: 1.55;
}

.character-notes-panel .toastui-editor-contents h1,
.character-notes-panel .toastui-editor-contents h2,
.character-notes-panel .toastui-editor-contents h3,
.character-notes-panel .toastui-editor-contents h4,
.character-notes-panel .toastui-editor-contents strong,
.character-notes-panel .toastui-editor-contents code,
.character-notes-panel .toastui-editor-contents th,
.character-notes-panel .toastui-editor-contents td,
.notes-markdown h1,
.notes-markdown h2,
.notes-markdown h3,
.notes-markdown h4,
.notes-markdown strong,
.notes-markdown code,
.notes-markdown th,
.notes-markdown td {
  color: inherit;
}

.character-notes-panel .toastui-editor-contents a,
.notes-markdown a {
  color: var(--accent);
  text-decoration: underline;
  overflow-wrap: anywhere;
}

.character-notes-panel .toastui-editor-contents pre,
.character-notes-panel .toastui-editor-contents code,
.notes-markdown pre,
.notes-markdown code {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.character-notes-panel .toastui-editor-contents table,
.notes-markdown table {
  display: table;
  width: 100%;
  border-collapse: collapse;
}

.character-notes-panel .toastui-editor-contents th,
.character-notes-panel .toastui-editor-contents td,
.notes-markdown th,
.notes-markdown td {
  padding: 5px 6px;
  border: 1px solid currentColor;
}


:root[data-theme="dark"] .character-notes-panel .toastui-editor-defaultUI,
:root[data-theme="dark"] .character-notes-panel .toastui-editor-main,
:root[data-theme="dark"] .character-notes-panel .toastui-editor-main-container,
:root[data-theme="dark"] .character-notes-panel .toastui-editor-ww-container {
  color: #f0f3ed;
  background: #0b0d0f;
}

:root[data-theme="dark"] .character-notes-panel .toastui-editor-toolbar {
  background: #171a1e;
  border-bottom-color: #5f6670;
}

:root[data-theme="dark"] .character-notes-panel .toastui-editor-ww-container .ProseMirror,
:root[data-theme="dark"] .character-notes-panel .toastui-editor-contents {
  color: #f4f6f2;
  background: #0b0d0f;
  caret-color: #ffffff;
}

:root[data-theme="dark"] .character-notes-panel .toastui-editor-contents p,
:root[data-theme="dark"] .character-notes-panel .toastui-editor-contents li,
:root[data-theme="dark"] .character-notes-panel .toastui-editor-contents ul,
:root[data-theme="dark"] .character-notes-panel .toastui-editor-contents ol,
:root[data-theme="dark"] .character-notes-panel .toastui-editor-contents blockquote p {
  color: #f4f6f2;
}

:root[data-theme="dark"] .character-notes-panel .toastui-editor-contents .placeholder::before {
  color: #a7aca6;
}

:root[data-theme="dark"] .character-notes-panel .toastui-editor-contents blockquote {
  color: #d9ddd8;
  border-left-color: #7a8088;
}

:root[data-theme="dark"] .character-notes-panel .toastui-editor-contents a {
  color: #d5dae1;
}

.notes-markdown > :first-child {
  margin-top: 0;
}

.notes-markdown > :last-child {
  margin-bottom: 0;
}
.sheet-placeholder {
  display: grid;
  place-items: center;
  gap: 14px;
  width: 100%;
  max-width: 720px;
  height: 100%;
  max-height: 520px;
  min-height: 0;
  padding: clamp(10px, 4vmin, 32px);
  color: var(--muted);
  background:
    linear-gradient(90deg, transparent 0 58px, var(--notebook-red) 59px 61px, transparent 62px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--notebook-blue) 26px,
      transparent 27px
    ),
    var(--paper);
  border: 3px dashed var(--line);
  text-align: center;
}

.placeholder-mark {
  display: grid;
  place-items: center;
  width: min(92%, 620px);
  padding: var(--external-svg-padding);
  background: var(--external-svg-surface);
  border: var(--external-svg-border-width) solid var(--external-svg-border);
  opacity: 0.9;
}

.placeholder-mark img {
  width: 100%;
  max-height: 430px;
  height: auto;
  object-fit: contain;
  transition: filter 160ms ease;
}

:root[data-theme="dark"] .placeholder-mark img {
  filter: invert(1) brightness(1.08) contrast(1.04);
}

.placeholder-mark .sheet-logo-text {
  width: min(100%, 560px);
  height: clamp(240px, 44vmin, 410px);
}

.sheet-placeholder strong {
  font-size: 1rem;
}

.sheet-fit {
  --sheet-scale: 1;
  position: relative;
  flex: 0 0 auto;
  width: 900px;
  height: 1120px;
  margin-right: var(--notes-toggle-rail-width, 58px);
}

.sheet {
  position: absolute;
  top: 0;
  left: 0;
  --ink: #111111;
  --paper: #fffef8;
  --paper-warm: #f6f1df;
  --line: #1a1a1a;
  --notebook-blue: rgba(56, 91, 132, 0.16);
  --notebook-red: rgba(140, 47, 36, 0.32);
  --shadow: rgba(17, 17, 17, 0.2);
  --solid-bg: #111111;
  --on-solid: #fffef8;
  --soft-panel-bg: rgba(255, 254, 248, 0.55);
  --soft-panel-bg-alt: rgba(255, 254, 248, 0.62);
  --table-bg: rgba(255, 254, 248, 0.78);
  --table-bg-strong: rgba(255, 254, 248, 0.8);
  --selected-bg: rgba(255, 244, 166, 0.48);
  --linked-bg: rgba(255, 244, 166, 0.36);
  --spent-bg: rgba(17, 17, 17, 0.06);
  --spent-ink: rgba(17, 17, 17, 0.58);
  --unavailable-bg: rgba(17, 17, 17, 0.06);
  --unavailable-ink: rgba(17, 17, 17, 0.42);
  --disabled-control-bg: rgba(255, 254, 248, 0.68);
  --column-rule: rgba(17, 17, 17, 0.24);
  --sheet-hole-ring: rgba(17, 17, 17, 0.34);
  --postit-bg: #fff4a6;
  --postit-corner: rgba(127, 91, 9, 0.12);
  --postit-border: rgba(17, 17, 17, 0.82);
  --postit-shadow: rgba(17, 17, 17, 0.3);
  --svg-idle-filter: none;
  --svg-hover-filter:
    drop-shadow(0 0 6px rgba(214, 162, 27, 0.82))
    drop-shadow(2px 2px 0 rgba(127, 91, 9, 0.42));
  --armor-label-color: #fffef8;
  --armor-value-color: #111111;
  --armor-text-outline: #000000;
  --armor-focus-ring: rgba(214, 162, 27, 0.62);
  --sheet-brightness: none;
  --sheet-hole-x: 16px;
  --sheet-hole-gap: 305.4545px;
  --sheet-hole-margin: 101.8182px;
  display: grid;
  grid-template-rows: auto 342px minmax(0, 1fr) 22px;
  gap: 10px;
  width: 900px;
  height: 1120px;
  padding: 24px 26px 22px 34px;
  overflow: hidden;
  color: var(--ink);
  background:
    radial-gradient(circle at var(--sheet-hole-x) var(--sheet-hole-margin), transparent 0 8px, var(--sheet-hole-ring) 9px 10px, transparent 11px),
    radial-gradient(circle at var(--sheet-hole-x) calc(var(--sheet-hole-margin) + var(--sheet-hole-gap)), transparent 0 8px, var(--sheet-hole-ring) 9px 10px, transparent 11px),
    radial-gradient(circle at var(--sheet-hole-x) calc(var(--sheet-hole-margin) + 610.9090px), transparent 0 8px, var(--sheet-hole-ring) 9px 10px, transparent 11px),
    radial-gradient(circle at var(--sheet-hole-x) calc(var(--sheet-hole-margin) + 916.3635px), transparent 0 8px, var(--sheet-hole-ring) 9px 10px, transparent 11px),
    linear-gradient(90deg, transparent 0 56px, var(--notebook-red) 57px 59px, transparent 60px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--notebook-blue) 26px,
      transparent 27px
    ),
    var(--paper);
  border: 4px solid var(--line);
  box-shadow: 10px 10px 0 var(--shadow);
  filter: var(--sheet-brightness);
  transform: scale(var(--sheet-scale));
  transform-origin: top left;
}

:root[data-theme="dark"] .sheet {
  --sheet-brightness: brightness(0.78);
}

.sheet::before,
.sheet::after {
  position: absolute;
  z-index: 0;
  pointer-events: none;
  content: "";
  border: 2px solid var(--line);
  transform: rotate(-0.25deg);
}

.sheet::before {
  inset: 12px;
}

.sheet::after {
  inset: 18px;
}

.sheet > * {
  position: relative;
  z-index: 1;
}

.sheet-credit {
  justify-self: end;
  align-self: center;
  max-width: 420px;
  margin-right: 6px;
  padding: 3px 8px 2px;
  color: var(--ink);
  background: var(--paper);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1.15;
  text-align: right;
  text-decoration: none;
  overflow-wrap: anywhere;
  transform: translateY(-3px);
}

.sheet-credit[href]:hover,
.sheet-credit[href]:focus {
  text-decoration: underline;
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.sheet-header {
  display: grid;
  grid-template-columns: 155px 1fr 230px;
  gap: 16px;
  align-items: end;
  padding-bottom: 10px;
  border-bottom: 3px solid var(--line);
}

.sheet-logo {
  display: grid;
  place-items: center;
  min-height: 104px;
}

.sheet-logo img {
  width: 132px;
  max-height: 96px;
  object-fit: contain;
}

.sheet-logo-text {
  display: grid;
  place-items: center;
  width: 132px;
  height: 96px;
  color: var(--ink);
  font-family: "Logo Orbitron", "Arial Black", Impact, sans-serif;
  font-size: 1.18rem;
  font-weight: 400;
  line-height: 0.92;
  text-align: center;
  overflow: hidden;
  text-transform: none;
  overflow-wrap: anywhere;
}

.sheet-logo-text span {
  display: block;
  max-width: 126px;
  overflow-wrap: normal;
  text-wrap: balance;
  word-break: normal;
}

.sheet-logo-text[data-logo-font="rubik-glitch"] {
  font-family: "Logo Rubik Glitch", "Arial Black", Impact, sans-serif;
  font-size: 1.22rem;
}

.sheet-logo-text[data-logo-font="rubik-dirt"] {
  font-family: "Logo Rubik Dirt", "Arial Black", Impact, sans-serif;
  font-size: 1.12rem;
}

.sheet-logo-text[data-logo-font="orbitron"] {
  font-family: "Logo Orbitron", "Arial Black", Impact, sans-serif;
  letter-spacing: 0;
}

.sheet-logo-text[data-logo-font="im-fell-english-sc"] {
  font-family: "Logo IM Fell English SC", Georgia, serif;
  font-size: 1.38rem;
  line-height: 0.9;
  text-transform: none;
}

.sheet-logo-text--bold {
  font-weight: 900;
  text-shadow: 0.7px 0 currentColor, -0.7px 0 currentColor;
}

.sheet-logo-text--italic {
  font-style: italic;
  transform: skewX(-4deg);
}

.sheet-logo-text--long {
  font-size: 0.98rem;
  line-height: 0.96;
}

.sheet-logo-text--very-long {
  font-size: 0.78rem;
  line-height: 1;
}

.system-logo-preview-large .sheet-logo-text--long {
  font-size: 1.12rem;
}

.system-logo-preview-large .sheet-logo-text--very-long {
  font-size: 0.92rem;
}

.system-logo-preview-large .sheet-logo-text[data-logo-font].sheet-logo-text--long {
  font-size: 1.12rem;
}

.system-logo-preview-large .sheet-logo-text[data-logo-font].sheet-logo-text--very-long {
  font-size: 0.92rem;
}

.sheet-logo-text[data-logo-font="rubik-glitch"].sheet-logo-text--long,
.sheet-logo-text[data-logo-font="rubik-dirt"].sheet-logo-text--long,
.sheet-logo-text[data-logo-font="orbitron"].sheet-logo-text--long {
  font-size: 0.98rem;
}

.sheet-logo-text[data-logo-font="rubik-glitch"].sheet-logo-text--very-long,
.sheet-logo-text[data-logo-font="rubik-dirt"].sheet-logo-text--very-long,
.sheet-logo-text[data-logo-font="orbitron"].sheet-logo-text--very-long {
  font-size: 0.76rem;
}

.sheet-logo-text[data-logo-font="im-fell-english-sc"].sheet-logo-text--long {
  font-size: 1.08rem;
}

.sheet-logo-text[data-logo-font="im-fell-english-sc"].sheet-logo-text--very-long {
  font-size: 0.88rem;
}

.system-logo-preview-large .sheet-logo-text[data-logo-font="im-fell-english-sc"].sheet-logo-text--long {
  font-size: 1.24rem;
}

.system-logo-preview-large .sheet-logo-text[data-logo-font="im-fell-english-sc"].sheet-logo-text--very-long {
  font-size: 1rem;
}

.sheet-logo-text--diagonal span {
  transform: rotate(-13deg);
}

.brand-mark .sheet-logo-text,
.placeholder-mark .sheet-logo-text {
  aspect-ratio: 11 / 8;
  height: auto;
  font-size: 3rem;
  line-height: 0.92;
}

.brand-mark .sheet-logo-text[data-logo-font],
.placeholder-mark .sheet-logo-text[data-logo-font],
.brand-mark .sheet-logo-text[data-logo-font].sheet-logo-text--long,
.brand-mark .sheet-logo-text[data-logo-font].sheet-logo-text--very-long,
.placeholder-mark .sheet-logo-text[data-logo-font].sheet-logo-text--long,
.placeholder-mark .sheet-logo-text[data-logo-font].sheet-logo-text--very-long {
  font-size: 3rem;
}

.brand-mark .sheet-logo-text[data-logo-font].sheet-logo-text--long {
  font-size: clamp(1.15rem, 3.2dvh, 2rem);
}

.brand-mark .sheet-logo-text[data-logo-font].sheet-logo-text--very-long {
  font-size: clamp(0.82rem, 2.4dvh, 1.35rem);
}

.brand-mark .sheet-logo-text span,
.placeholder-mark .sheet-logo-text span {
  max-width: calc(100% - 8px);
}

.identity-grid {
  display: grid;
  gap: 9px;
}

.field-line {
  display: grid;
  grid-template-columns: minmax(96px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  min-width: 0;
}

.field-line.small-label {
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
}

.field-label,
.block-title,
.save-code {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  color: var(--on-solid);
  background: var(--solid-bg);
  font-family: "Arial Black", Impact, sans-serif;
  line-height: 1;
  text-transform: uppercase;
}

.field-label {
  font-size: 1.18rem;
  transform: rotate(-0.5deg);
}

.field-value,
.blank-line,
.write-line {
  min-height: 26px;
  border-bottom: 2px solid var(--line);
}

.field-value {
  max-width: 100%;
  min-width: 0;
  padding: 3px 8px 0;
  font-size: 1.14rem;
  font-weight: 800;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.sheet-field-input {
  display: block;
  width: 100%;
  min-width: 0;
  margin: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 2px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  appearance: none;
}

.name-field {
  align-items: start;
}

.name-field .field-label {
  margin-top: 2px;
}

.name-field .field-value {
  font-size: clamp(0.92rem, 2.2vw, 1.14rem);
}

.sheet-field-textarea {
  height: auto;
  min-height: 26px;
  overflow: hidden;
  resize: none;
  white-space: pre-wrap;
  word-break: break-word;
}

.sheet-field-input:focus {
  outline: 0;
}

.sheet-field-input[data-sheet-manual="true"]:focus {
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.field-line.small-label .sheet-field-input[data-sheet-manual="true"] {
  border-bottom: 2px solid var(--line);
}

.ability-score-input {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0 4px;
  color: inherit;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font: inherit;
  line-height: 1;
  text-align: center;
  appearance: none;
}

.ability-score-input:focus {
  outline: 3px solid var(--solid-bg);
  outline-offset: -7px;
}

.gold-field {
  align-items: stretch;
}

.gold-field .field-label {
  align-self: center;
}

.gold-control-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 6px;
  align-items: end;
  min-width: 0;
}

.gold-control {
  display: grid;
  gap: 2px;
  min-width: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.58rem;
  line-height: 1;
  text-transform: uppercase;
}

.gold-input {
  min-height: 23px;
  padding: 2px 3px 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.92rem;
  line-height: 1.05;
  text-align: center;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
}

.gold-total {
  display: grid;
  gap: 2px;
  justify-items: end;
  min-width: 60px;
  padding-bottom: 2px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.58rem;
  line-height: 1;
  text-transform: uppercase;
}

.gold-total strong {
  font-size: 0.9rem;
  line-height: 1.05;
  white-space: nowrap;
}

.header-stack {
  display: grid;
  gap: 9px;
}

.sheet-main {
  display: grid;
  grid-template-columns: 224px minmax(18px, 1fr) 184px minmax(18px, 1fr) 290px;
  gap: 0;
  align-items: stretch;
  height: 342px;
  overflow: hidden;
}

.ability-panel {
  grid-column: 1;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  min-height: 0;
  padding: 10px 0 0;
}

.ability-panel .block-title {
  margin-bottom: 0;
  margin-left: 10px;
}

.ability-panel > .ability-table {
  align-self: stretch;
  grid-template-rows: repeat(var(--ability-row-count, 7), minmax(0, 1fr));
  min-height: 0;
  background: transparent;
  border-width: 0;
}

.ability-panel .ability-head-empty {
  background: transparent;
}

.ability-panel .ability-score,
.ability-panel .ability-mod {
  background: var(--paper);
}

.ability-panel .ability-head,
.ability-panel .ability-name,
.ability-panel .ability-score,
.ability-panel .ability-mod {
  min-height: 0;
}

.combat-panel {
  grid-column: 2 / 5;
  --combat-box-size: 132px;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 6px;
  margin-inline: 4px;
  min-height: 0;
}

.combat-panel .block-title {
  margin-bottom: 0;
}

.saves-box {
  grid-column: 5;
}

.block {
  position: relative;
}

.block-title {
  gap: 7px;
  width: fit-content;
  max-width: 100%;
  margin: 0 0 7px;
  font-size: 1.05rem;
  transform: rotate(-0.25deg);
  white-space: normal;
}

.block-title.large {
  font-size: 1.36rem;
}

.ability-table {
  display: grid;
  grid-template-columns: 74px 1fr 1fr;
  border: 3px solid var(--line);
  background: var(--paper);
}

.ability-head,
.ability-name,
.ability-score,
.ability-mod {
  min-height: 42px;
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
}

.ability-head {
  display: grid;
  place-items: center;
  padding: 4px;
  color: var(--on-solid);
  background: var(--solid-bg);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  text-align: center;
  text-transform: uppercase;
}

.ability-head-empty {
  background: var(--soft-panel-bg);
}

.ability-name {
  display: grid;
  place-items: center;
  color: var(--on-solid);
  background: var(--solid-bg);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.18rem;
}

.ability-score,
.ability-mod {
  display: grid;
  place-items: center;
  font-family: "Arial Black", Impact, sans-serif;
}

.ability-score {
  font-size: 1.76rem;
}

.ability-mod {
  font-size: 1.4rem;
}

.ability-panel--dense {
  gap: 5px;
  padding-top: 8px;
}

.ability-panel--dense .block-title.large {
  font-size: 1.22rem;
}

.ability-table--dense {
  grid-template-columns: 66px 1fr 1fr;
}

.ability-table--dense .ability-head {
  padding: 3px;
  font-size: 0.64rem;
}

.ability-table--dense .ability-name {
  font-size: 1rem;
}

.ability-table--dense .ability-score {
  font-size: 1.42rem;
}

.ability-table--dense .ability-mod {
  font-size: 1.14rem;
}

.ability-panel--compact {
  gap: 4px;
  padding-top: 6px;
}

.ability-panel--compact .block-title {
  margin-left: 8px;
}

.ability-panel--compact .block-title.large {
  padding: 2px 5px;
  font-size: 1.08rem;
}

.ability-table--compact {
  grid-template-columns: 58px 1fr 1fr;
}

.ability-table--compact .ability-head {
  padding: 2px;
  font-size: 0.56rem;
}

.ability-table--compact .ability-head,
.ability-table--compact .ability-name,
.ability-table--compact .ability-score,
.ability-table--compact .ability-mod {
  border-right-width: 1px;
  border-bottom-width: 1px;
}

.ability-table--compact .ability-name {
  font-size: 0.84rem;
}

.ability-table--compact .ability-score {
  font-size: 1.14rem;
}

.ability-table--compact .ability-mod {
  font-size: 0.92rem;
}

.ability-panel--micro {
  gap: 3px;
  padding-top: 5px;
}

.ability-panel--micro .block-title.large {
  font-size: 0.96rem;
}

.ability-table--micro {
  grid-template-columns: 52px 1fr 1fr;
}

.ability-table--micro .ability-head {
  font-size: 0.5rem;
}

.ability-table--micro .ability-name {
  font-size: 0.74rem;
}

.ability-table--micro .ability-score {
  font-size: 0.98rem;
}

.ability-table--micro .ability-mod {
  font-size: 0.78rem;
}

.ability-table > :nth-last-child(-n + 3) {
  border-bottom: 0;
}

.ability-table > :nth-child(3n) {
  border-right: 0;
}

.ability-swap-table {
  grid-template-columns: 82px 74px minmax(64px, 1fr) minmax(58px, 0.8fr);
  margin: 2px 0 4px;
}

.ability-swap-select-head,
.ability-swap-select-cell,
.ability-swap-score,
.ability-swap-mod {
  min-height: 42px;
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
}

.ability-swap-select-cell {
  display: grid;
  place-items: center;
  padding: 4px;
  background: var(--paper);
}

.ability-swap-select-button {
  width: 100%;
  min-height: 30px;
  padding: 4px 6px;
  color: var(--ink);
  background: var(--field-bg-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.64rem;
  line-height: 1;
  text-transform: uppercase;
  cursor: pointer;
}

.ability-swap-select-button[aria-pressed="true"] {
  color: var(--on-solid);
  background: var(--accent);
}

.ability-swap-select-button:disabled {
  cursor: not-allowed;
  opacity: 0.54;
}

.ability-swap-score,
.ability-swap-mod {
  display: grid;
  place-items: center;
  font-family: "Arial Black", Impact, sans-serif;
}

.ability-swap-score {
  font-size: 1.76rem;
}

.ability-swap-mod {
  font-size: 1.4rem;
}

.ability-table.ability-swap-table > :nth-child(3n) {
  border-right: 2px solid var(--line);
}

.ability-table.ability-swap-table > :nth-child(4n) {
  border-right: 0;
}

.ability-table.ability-swap-table > :nth-last-child(-n + 4) {
  border-bottom: 0;
}

.hit-area {
  display: grid;
  place-items: center;
  grid-template-columns: repeat(2, minmax(0, var(--combat-box-size)));
  grid-template-rows: var(--combat-box-size) 126px;
  gap: 4px;
  justify-content: center;
  align-content: center;
  box-sizing: border-box;
  height: 100%;
  min-height: 0;
  padding-top: 6px;
}

.hit-area--with-quantitative-marker {
  grid-template-rows: var(--combat-box-size) minmax(42px, auto) 96px;
  align-content: start;
}

.hit-area--with-quantitative-marker .dv-box,
.hit-area--with-quantitative-marker .bba-box {
  box-sizing: border-box;
}

.hit-area--with-quantitative-marker .bba-box {
  grid-row: 3;
  grid-template-columns: auto auto minmax(0, 1fr) 70px;
  gap: 4px 2px;
  max-height: 96px;
  padding: 6px;
}

.hit-area--with-quantitative-marker .weapon-box {
  width: 70px;
}

.hit-area--with-quantitative-marker .weapon-sword {
  transform: translateY(-12px) rotate(-16deg) scale(0.88);
}

.hit-area--with-quantitative-marker .weapon-box:hover .weapon-sword,
.hit-area--with-quantitative-marker .weapon-box:focus-visible .weapon-sword {
  transform: translateY(-12px) rotate(-16deg) scale(0.88);
}

.hit-area--with-quantitative-marker .bba-label {
  padding: 1px 5px;
  font-size: 0.76rem;
}

.hit-area--with-quantitative-marker .bba-value {
  font-size: 1.5rem;
}

.hit-area--with-quantitative-marker .attack-list {
  gap: 3px;
}

.hit-area--with-quantitative-marker .attack-row {
  gap: 6px;
  border-bottom-width: 1px;
}

.hit-area--with-quantitative-marker .attack-label {
  font-size: 0.68rem;
}

.hit-area--with-quantitative-marker .attack-value {
  font-size: 0.94rem;
}

.hit-area--with-quantitative-marker .quantitative-marker {
  transform: translateY(2px);
}

.quantitative-marker {
  box-sizing: border-box;
  display: grid;
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto;
  gap: 3px;
  align-items: center;
  width: 100%;
  height: 100%;
  min-height: 42px;
  padding: 4px 8px;
  border: 3px solid var(--line);
  background: var(--soft-panel-bg);
}

.quantitative-marker-label {
  min-width: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.65rem;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quantitative-marker-dots {
  display: flex;
  flex-wrap: nowrap;
  gap: 2px;
  align-items: center;
  justify-content: flex-start;
  min-width: 0;
}

.quantitative-marker-dot {
  width: 10px;
  height: 10px;
  flex: 0 0 10px;
  padding: 0;
  color: var(--ink);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
  appearance: none;
}

.quantitative-marker-dot[aria-pressed="true"] {
  background: currentColor;
}

.quantitative-marker-dot:hover {
  border-color: var(--accent);
}

.quantitative-marker-dot:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.bba-box {
  display: grid;
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: auto auto minmax(0, 1fr) 78px;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px 2px;
  width: 100%;
  height: 100%;
  max-height: 126px;
  min-height: 0;
  padding: 8px;
  align-self: center;
  justify-self: center;
  border: 3px solid var(--line);
  background: var(--soft-panel-bg);
}

.weapon-box {
  display: grid;
  grid-column: 4;
  grid-row: 1 / -1;
  width: 78px;
  height: 100%;
  padding: 0;
  align-self: stretch;
  justify-self: end;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  overflow: visible;
  appearance: none;
}

.weapon-box:focus-visible {
  outline: 3px solid var(--armor-focus-ring);
  outline-offset: 4px;
}

.weapon-sword {
  width: 100%;
  height: 100%;
  place-self: center;
  filter: var(--svg-idle-filter);
  object-fit: contain;
  pointer-events: none;
  transition:
    filter 160ms ease,
    transform 160ms ease;
  transform: rotate(-24deg);
}

.weapon-box:hover .weapon-sword,
.weapon-box:focus-visible .weapon-sword {
  filter: var(--svg-hover-filter);
  transform: rotate(-24deg) scale(1.035);
}

.bba-label {
  align-self: center;
  grid-column: 1;
  padding: 2px 6px;
  color: var(--on-solid);
  background: var(--solid-bg);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.95rem;
  line-height: 1;
}

.bba-value {
  align-self: center;
  grid-column: 2;
  justify-self: start;
  width: 3ch;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.96rem;
  line-height: 0.92;
}

.bba-input {
  display: block;
  width: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 0;
  font: inherit;
  line-height: inherit;
  text-align: left;
  appearance: none;
}

.attack-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-column: 1 / 4;
  gap: 5px;
  align-self: center;
  justify-items: start;
}

.attack-row {
  display: inline-flex;
  gap: 8px;
  align-items: baseline;
  justify-self: start;
  width: fit-content;
  max-width: 100%;
  border-bottom: 2px solid var(--line);
}

.attack-copy-button {
  padding: 0;
  color: inherit;
  background: transparent;
  border-top: 0;
  border-right: 0;
  border-left: 0;
  cursor: pointer;
  appearance: none;
}

.attack-copy-button:hover,
.attack-copy-button:focus-visible {
  color: var(--accent);
}

.attack-copy-button:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 3px;
}

.attack-label {
  display: inline;
  min-width: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.84rem;
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
}

.attack-value {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.18rem;
  line-height: 1;
}

.attack-copy-feedback {
  position: absolute;
  top: 14px;
  left: 50%;
  z-index: 5;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 6px 10px;
  color: #ffffff;
  background: #247a3b;
  border: 2px solid #0f4e24;
  border-radius: 4px;
  font-family: Arial, sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1;
  box-shadow: 3px 3px 0 var(--shadow);
  pointer-events: none;
  transform: translateX(-50%);
}

.attack-copy-feedback::before {
  display: grid;
  place-items: center;
  width: 1.05em;
  height: 1.05em;
  color: #247a3b;
  background: #ffffff;
  border-radius: 50%;
  font-size: 0.82em;
  line-height: 1;
  content: "\2713";
}

.attack-copy-feedback[hidden] {
  display: none;
}

.dv-box {
  display: grid;
  grid-template-rows: auto 1fr;
  gap: 8px;
  width: 100%;
  height: 100%;
  align-self: center;
  justify-self: center;
  padding: 10px;
  border: 3px solid var(--line);
  background: var(--soft-panel-bg);
}

.dv-box--hit-points {
  grid-template-rows: auto auto 1fr;
  gap: 6px;
}

.dv-box--hit-points .dv-value {
  column-gap: 0.08em;
  font-size: 2rem;
}

.dv-box--hit-points .dv-current,
.dv-box--hit-points .dv-maximum-input {
  width: min(4.5ch, 100%);
}

.armor-box {
  position: relative;
  display: block;
  grid-column: 1;
  grid-row: 1;
  width: 100%;
  height: 100%;
  padding: 0;
  align-self: center;
  justify-self: center;
  color: inherit;
  background: transparent;
  border: 0;
  cursor: pointer;
  overflow: visible;
  appearance: none;
}

.armor-box:focus-visible {
  outline: 3px solid var(--armor-focus-ring);
  outline-offset: 8px;
}

.dv-box {
  grid-column: 2;
  grid-row: 1;
}

.dv-label {
  display: inline-flex;
  align-items: center;
  padding: 2px 6px;
  color: var(--on-solid);
  background: var(--solid-bg);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.9rem;
  line-height: 1;
  text-transform: uppercase;
}

.dv-label {
  align-self: start;
  justify-self: start;
}

.dv-static-row {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  justify-self: start;
  font-family: "Arial Black", Impact, sans-serif;
  line-height: 1;
  text-transform: uppercase;
}

.dv-static-label {
  padding: 2px 6px;
  color: var(--on-solid);
  background: var(--solid-bg);
  font-size: 0.72rem;
}

.dv-static-value {
  font-size: 1.05rem;
}

.dv-static-input {
  width: 3ch;
  min-height: 0;
  padding: 0;
  border-bottom: 0;
  font: inherit;
  line-height: inherit;
}

.dv-value {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: baseline;
  align-self: center;
  justify-self: center;
  column-gap: 0.04em;
  width: 100%;
  min-width: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 2.72rem;
  font-weight: 900;
  line-height: 0.9;
  transform: translateY(-6px);
}

.dv-current {
  justify-self: end;
  width: min(3.6ch, 100%);
  min-height: 0;
  padding: 0;
  border-bottom: 0;
  font: inherit;
  line-height: inherit;
  text-align: right;
  overflow: visible;
}

.dv-maximum-input {
  justify-self: start;
  width: min(3.6ch, 100%);
  min-height: 0;
  padding: 0;
  border-bottom: 0;
  font: inherit;
  line-height: inherit;
  text-align: left;
  overflow: visible;
}

.dv-separator,
.dv-maximum {
  font: inherit;
  line-height: inherit;
}

.dv-separator {
  justify-self: center;
}

.dv-maximum {
  justify-self: start;
}

.armor-shield {
  position: absolute;
  top: 52%;
  left: 50%;
  width: 156%;
  height: 156%;
  filter: var(--svg-idle-filter);
  object-fit: contain;
  pointer-events: none;
  transition:
    filter 160ms ease,
    transform 160ms ease;
  transform: translate(-50%, -50%);
}

.armor-box:hover .armor-shield,
.armor-box:focus-visible .armor-shield {
  filter: var(--svg-hover-filter);
  transform: translate(-50%, -50%) scale(1.035);
}

.armor-label,
.armor-value {
  position: absolute;
  z-index: 1;
  font-family: "Arial Black", Impact, sans-serif;
  line-height: 1;
}

.armor-label {
  top: 44%;
  left: 33%;
  color: var(--armor-label-color);
  font-size: 1.4rem;
  text-shadow:
    -1px -1px 0 var(--armor-text-outline),
    1px -1px 0 var(--armor-text-outline),
    -1px 1px 0 var(--armor-text-outline),
    1px 1px 0 var(--armor-text-outline);
  -webkit-text-stroke: 0.55px var(--armor-text-outline);
  text-transform: uppercase;
  transform: translate(-50%, -50%);
}

.armor-value {
  top: 44%;
  left: 52%;
  width: 2ch;
  color: var(--armor-value-color);
  font-size: 1.4rem;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum";
  text-align: center;
  transform: translateY(-50%);
}

.lined-box {
  display: grid;
  gap: 10px;
  padding: 10px 12px;
  border: 3px solid var(--line);
  background: var(--soft-panel-bg);
}

.class-rules-box,
.saves-box {
  isolation: isolate;
}

.class-rules-box > *,
.saves-box > * {
  position: relative;
  z-index: 1;
}

.ability-panel,
.combat-panel,
.saves-box {
  border: 3px solid var(--line);
  background: var(--soft-panel-bg);
}

.combat-panel,
.saves-box {
  padding: 10px;
}

.quick-detail-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.quick-detail-list dt {
  width: fit-content;
  padding: 2px 6px;
  color: var(--on-solid);
  background: var(--solid-bg);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.78rem;
  text-transform: uppercase;
}

.quick-detail-list dd {
  margin: 0;
  font-weight: 800;
  line-height: 1.18;
}

.class-detail-control {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
  width: 100%;
  min-width: 0;
}

.class-detail-input {
  width: 100%;
  min-width: 0;
  padding: 0;
  border-bottom: 0;
  font: inherit;
  font-weight: 800;
  line-height: inherit;
}

.class-detail-suffix {
  flex: 0 0 auto;
}

.quick-note {
  margin: 0;
  font-weight: 800;
  line-height: 1.24;
}

.class-rules-box {
  --class-rules-side-min-height: 168px;
  --class-rules-overflow-button-height: 0px;
  display: grid;
  grid-template-rows: auto minmax(calc(var(--class-rules-side-min-height) + var(--class-rules-overflow-button-height)), 1fr) auto;
  gap: 10px;
  min-height: 0;
  overflow: hidden;
}

.class-rules-box--with-magic {
  --class-rules-side-min-height: 250px;
}

.class-rules-box--has-overflow {
  --class-rules-overflow-button-height: 38px;
}

.class-details-more-button {
  justify-self: end;
  width: 132px;
  min-height: 28px;
  margin-right: 4px;
  padding: 5px 9px;
  color: var(--accent-ink);
  background: var(--accent);
  border: 2px solid var(--line);
  border-radius: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1;
  text-transform: uppercase;
  box-shadow: 3px 3px 0 var(--control-shadow);
}

.class-details-more-button[hidden] {
  display: none;
}

.class-details-more-button:hover,
.class-details-more-button:focus {
  color: var(--on-solid);
  background: var(--solid-bg);
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.class-title-row {
  position: relative;
  display: flex;
  justify-content: center;
  min-width: 0;
}

.class-rules-box > .block-title.large,
.class-title-row > .block-title.large {
  justify-self: center;
  min-width: 230px;
  justify-content: center;
  margin-bottom: 0;
  font-size: 2rem;
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-weight: 400;
  text-transform: none;
}

.manual-overrides-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  position: absolute;
  top: -10px;
  right: 4px;
  width: 48px;
  height: 48px;
  color: var(--line);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
}

.manual-overrides-button:hover,
.manual-overrides-button:focus {
  color: var(--accent);
  background: transparent;
  outline: 3px solid var(--focus-ring);
  outline-offset: 2px;
}

.manual-overrides-button i {
  font-size: 1.77rem;
  line-height: 1;
  pointer-events: none;
}

.class-rules-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 138px;
  gap: 12px;
  align-items: stretch;
  min-width: 0;
  min-height: 0;
}

.class-rules-text {
  column-count: var(--class-rules-columns, 3);
  column-gap: 18px;
  column-rule: 2px solid var(--column-rule);
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  font-size: 0.78rem;
  line-height: 1.16;
}

.class-rules-side {
  display: grid;
  gap: 8px;
  align-content: start;
  justify-items: end;
  align-self: start;
  min-width: 0;
  min-height: 0;
}

.class-postits {
  display: grid;
  gap: 10px;
  align-content: start;
  justify-items: end;
  align-self: start;
  min-width: 0;
  min-height: 0;
}

.class-postits--with-magic {
  gap: 6px;
}

.system-postit-color-option[data-postit-color-option="yellow"],
.class-postits[data-postit-color="yellow"] {
  --postit-bg: #fff4a6;
  --postit-corner: rgba(127, 91, 9, 0.12);
}

.system-postit-color-option[data-postit-color-option="gray"],
.class-postits[data-postit-color="gray"] {
  --postit-bg: #d2d0c7;
  --postit-corner: rgba(70, 70, 66, 0.16);
}

.system-postit-color-option[data-postit-color-option="blue"],
.class-postits[data-postit-color="blue"] {
  --postit-bg: #adc5d7;
  --postit-corner: rgba(45, 82, 112, 0.16);
}

.system-postit-color-option[data-postit-color-option="red"],
.class-postits[data-postit-color="red"] {
  --postit-bg: #d9a39d;
  --postit-corner: rgba(120, 44, 36, 0.16);
}

.system-postit-color-option[data-postit-color-option="green"],
.class-postits[data-postit-color="green"] {
  --postit-bg: #b9cfad;
  --postit-corner: rgba(58, 94, 44, 0.16);
}

.system-postit-color-option[data-postit-color-option="purple"],
.class-postits[data-postit-color="purple"] {
  --postit-bg: #c6b4d6;
  --postit-corner: rgba(77, 54, 113, 0.16);
}

.system-postit-color-option[data-postit-color-option="pink"],
.class-postits[data-postit-color="pink"] {
  --postit-bg: #dfb3c7;
  --postit-corner: rgba(126, 54, 87, 0.15);
}

.system-postit-color-option[data-postit-color-option="orange"],
.class-postits[data-postit-color="orange"] {
  --postit-bg: #ffc966;
  --postit-corner: rgba(126, 75, 18, 0.13);
}

.class-postit {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto auto;
  place-items: center;
  justify-self: end;
  width: 132px;
  min-height: 156px;
  margin: 0 4px 0 0;
  padding: 10px 9px 8px;
  color: var(--ink);
  background:
    linear-gradient(135deg, transparent 0 78%, var(--postit-corner) 79% 84%, transparent 85%),
    var(--postit-bg);
  border: 2px solid var(--postit-border);
  box-shadow: 4px 4px 0 var(--postit-shadow);
  font-family: "Arial Black", Impact, sans-serif;
  text-align: center;
  transform: rotate(1.4deg);
  contain: layout paint;
}

button.class-postit {
  appearance: none;
}

.class-postits--with-magic .class-postit {
  width: 126px;
  height: 126px;
  min-height: 126px;
  padding: 7px 8px 6px;
}

.class-postit--magic {
  grid-template-rows: auto minmax(0, 1fr);
  cursor: pointer;
}

.class-postit--backpack {
  grid-template-rows: auto minmax(0, 1fr) auto;
  cursor: pointer;
}

.class-postits--with-magic .class-postit--magic {
  padding: 6px 4px 5px;
}

.class-postit-label,
.class-postit-unit {
  line-height: 1;
  text-transform: uppercase;
}

.class-postit-label {
  font-size: 0.78rem;
}

.class-postits--with-magic .class-postit-label {
  font-size: 0.72rem;
}

.class-postit-image {
  width: 86px;
  max-width: 100%;
  height: 72px;
  max-height: 72px;
  margin: 6px 0 5px;
  filter: var(--svg-idle-filter);
  object-fit: contain;
  transition:
    filter 160ms ease,
    transform 160ms ease;
}

.class-postit:hover .class-postit-image,
.class-postit-image:hover {
  filter: var(--svg-hover-filter);
}

.class-postit--magic .class-postit-image {
  width: 94px;
  height: 92px;
  max-height: 92px;
  margin: 8px 0 0;
}

.class-postits--with-magic .class-postit-image {
  width: 76px;
  height: 52px;
  max-height: 52px;
  margin: 4px 0 3px;
}

.class-postits--with-magic .class-postit--magic .class-postit-image {
  width: 116px;
  height: 100px;
  max-height: 100px;
  margin: 2px 0 0;
}

.class-postit-value {
  max-width: 100%;
  font-size: 1.48rem;
  line-height: 0.95;
  overflow-wrap: anywhere;
}

.class-postits--with-magic .class-postit-value {
  font-size: 1.28rem;
}

.class-postit--backpack .class-postit-value--compact {
  font-size: 1.16rem;
  overflow-wrap: normal;
  white-space: nowrap;
}

.master-rendered-sheet .class-postit--backpack .class-postit-value.class-postit-value--compact {
  font-size: 1.36rem;
  overflow-wrap: normal;
  white-space: nowrap;
}

.class-postit-unit {
  margin-top: 2px;
  font-size: 0.64rem;
}

.class-postit-metrics {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 4px;
  align-items: start;
  width: 100%;
}

.class-postit-metric {
  display: grid;
  justify-items: center;
  min-width: 0;
}

.class-postit-metric--secondary {
  padding: 0 4px 0 7px;
  border-left: 1px solid var(--line);
}

.class-postit-metric--secondary .class-postit-value {
  font-size: 1.1rem;
  overflow-wrap: normal;
  white-space: nowrap;
}

.class-postit-metric--secondary .class-postit-unit {
  font-size: 0.68rem;
  text-transform: lowercase;
}

.class-postit-note {
  margin-top: 1px;
  font-size: 0.52rem;
  line-height: 1;
  text-transform: lowercase;
}

.class-postits--with-magic .class-postit-unit {
  font-size: 0.58rem;
}

.class-postits--with-magic .class-postit-metric--secondary .class-postit-unit {
  font-size: 0.62rem;
}

.class-postits--with-magic .class-postit-note {
  font-size: 0.5rem;
}

.class-rule {
  break-inside: avoid;
  margin: 0 0 8px;
}

.class-rule h3 {
  margin: 0 0 2px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.82rem;
  text-transform: uppercase;
}

.class-rule p {
  margin: 0 0 4px;
}

.class-rule--hit-points-formula {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-bottom: 6px;
}

.class-rule--hit-points-formula h3 {
  flex: 0 0 auto;
  margin: 0;
  padding: 2px 5px 1px;
  color: var(--on-solid);
  background: var(--solid-bg);
  font-size: 0.64rem;
  line-height: 1;
}

.class-rule--hit-points-formula p {
  margin: 0;
  font-weight: 800;
  line-height: 1;
}

.class-extra-box {
  display: grid;
  gap: 2px;
  padding: 4px 6px 10px;
  border: 2px solid var(--line);
  background: var(--soft-panel-bg-alt);
  max-height: 292px;
  overflow: hidden;
}

.class-extra-box .quick-detail-list {
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 1px 6px;
  align-items: baseline;
}

.class-extra-box .quick-detail-list dt {
  font-size: 0.58rem;
}

.class-extra-box .quick-detail-list dd {
  font-size: 0.74rem;
  line-height: 1;
}

.class-extra-box .block-title {
  margin-right: auto;
  margin-bottom: 0;
  margin-left: auto;
  font-size: 1rem;
}

.class-extra-subtitle {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  line-height: 1;
  text-transform: uppercase;
}

.traveller-choice-log {
  min-height: 0;
}

.traveller-choice-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 1px 5px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.traveller-choice-list li {
  display: flex;
  gap: 4px;
  align-items: baseline;
  min-width: 0;
  padding-bottom: 0;
  border-bottom: 1px solid var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.58rem;
  line-height: 1;
  white-space: nowrap;
}

.traveller-choice-list strong {
  flex: 0 0 auto;
}

.traveller-choice-list span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.spell-table-stack {
  display: grid;
  gap: 4px;
  min-height: 0;
}

.class-extra-box .spell-table-stack:last-child {
  margin-bottom: 3px;
}

.spell-table-stack--multiple {
  gap: 2px;
}

.spell-table {
  width: 100%;
  margin-top: 0;
  border-collapse: collapse;
  background: var(--table-bg);
  font-family: "Arial Black", Impact, sans-serif;
  text-align: center;
}

.spell-table caption {
  margin-bottom: 2px;
  font-size: 0.68rem;
  text-align: left;
  text-transform: uppercase;
}

.class-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--table-bg-strong);
  font-family: "Arial Black", Impact, sans-serif;
  text-align: center;
}

.class-table caption {
  margin-bottom: 2px;
  font-size: 0.72rem;
  text-align: left;
  text-transform: uppercase;
}

.class-table th,
.class-table td {
  padding: 3px 2px;
  border: 1px solid var(--line);
  font-size: 0.62rem;
  line-height: 1;
}

.class-table thead th {
  color: var(--on-solid);
  background: var(--solid-bg);
}

.class-table-note {
  margin: -2px 0 0;
  font-size: 0.66rem;
  font-weight: 800;
}

.export-png-canvas .class-table {
  margin-bottom: 0;
}

.export-png-class-table-note-spacer {
  min-height: 18px;
}

.export-png-canvas .class-table-note {
  display: block;
  min-height: 14px;
  margin: 0 0 12px;
  padding-top: 0;
  font-size: 0.5rem;
  line-height: 1.15;
  white-space: normal;
  overflow-wrap: normal;
}

.spell-table th,
.spell-table td {
  padding: 8px 4px;
  border: 2px solid var(--line);
  line-height: 1;
}

.class-table-input,
.spell-slot-input {
  display: inline-block;
  box-sizing: content-box;
  width: 2ch;
  min-width: 0;
  max-width: 2ch;
  height: 1em;
  margin: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 0;
  font: inherit;
  line-height: inherit;
  text-align: center;
  vertical-align: baseline;
  appearance: none;
}

.spell-table th {
  color: var(--on-solid);
  background: var(--solid-bg);
  font-size: 0.8rem;
}

.class-extra-box .spell-table th,
.class-extra-box .spell-table td {
  padding: 2px 3px;
}

.class-extra-box .spell-table th {
  font-size: 0.64rem;
}

.spell-table-stack--multiple .spell-table caption {
  margin-bottom: 2px;
  font-size: 0.66rem;
}

.spell-table-stack--multiple .spell-table th,
.spell-table-stack--multiple .spell-table td {
  padding: 3px 4px;
}

.spell-table-stack--multiple .spell-table th {
  font-size: 0.7rem;
}

.saving-table {
  display: grid;
  gap: 7px;
}

.save-row {
  display: grid;
  grid-template-columns: 45px 1fr;
  gap: 8px;
  align-items: center;
}

.save-value {
  display: grid;
  place-items: center;
  width: 45px;
  min-height: 38px;
  border: 3px solid var(--line);
  background: var(--soft-panel-bg-alt);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 1.26rem;
}

.save-input {
  display: block;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: 0;
  font: inherit;
  line-height: 1;
  text-align: center;
  appearance: none;
}

.saving-table--dense .save-input {
  height: 100%;
  line-height: 1;
}

.saving-table--compact .save-input {
  height: 100%;
  line-height: 1;
}

.saving-table--micro .save-input {
  height: 100%;
  line-height: 1;
}

.save-label {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 7px;
  min-height: 40px;
  align-items: center;
  border-bottom: 2px solid var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.76rem;
  line-height: 1.05;
  text-transform: uppercase;
  overflow-wrap: anywhere;
}

.save-code {
  justify-content: center;
  min-width: 28px;
}

.saves-box--dense {
  padding: 9px;
}

.saves-box--dense .block-title.large {
  margin-bottom: 5px;
  font-size: 1.22rem;
}

.saving-table--dense {
  gap: 5px;
}

.saving-table--dense .save-row {
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 6px;
}

.saving-table--dense .save-value {
  width: 40px;
  min-height: 34px;
  font-size: 1.08rem;
}

.saving-table--dense .save-label {
  grid-template-columns: 26px minmax(0, 1fr);
  gap: 5px;
  min-height: 36px;
  font-size: 0.68rem;
}

.saving-table--dense .save-code {
  min-width: 24px;
}

.saves-box--compact {
  padding: 7px 8px;
}

.saves-box--compact .block-title.large {
  margin-bottom: 4px;
  padding: 2px 5px;
  font-size: 1.08rem;
}

.saving-table--compact {
  gap: 2px;
}

.saving-table--compact .save-row {
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 4px;
}

.saving-table--compact .save-value {
  width: 30px;
  min-height: 24px;
  border-width: 2px;
  font-size: 0.82rem;
}

.saving-table--compact .save-label {
  grid-template-columns: 22px minmax(0, 1fr);
  gap: 3px;
  min-height: 24px;
  border-bottom-width: 1px;
  font-size: 0.54rem;
  line-height: 0.98;
}

.saving-table--compact .save-code {
  min-width: 20px;
  padding: 1px 4px;
}

.saves-box--micro {
  padding: 6px;
}

.saves-box--micro .block-title.large {
  margin-bottom: 3px;
  font-size: 0.96rem;
}

.saving-table--micro .save-row {
  grid-template-columns: 28px minmax(0, 1fr);
}

.saving-table--micro .save-value {
  width: 28px;
  min-height: 22px;
  font-size: 0.74rem;
}

.saving-table--micro .save-label {
  min-height: 22px;
  font-size: 0.5rem;
}

.live-share-trigger {
  flex: 0 0 auto;
  width: 100%;
  min-height: clamp(24px, 4.5dvh, 32px);
  margin-top: clamp(4px, 1dvh, 8px);
  padding: 2px 6px;
  font-size: clamp(0.52rem, 1.55vmin, 0.66rem);
  line-height: 1;
  overflow-wrap: normal;
  white-space: nowrap;
  word-break: normal;
}

.live-share-dialog {
  width: min(480px, 100%);
}

.live-share-dialog .live-share-control {
  margin-top: 0;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.live-share-control {
  display: grid;
  gap: 8px;
  margin-top: 10px;
  padding: 10px;
  background: var(--soft-panel-bg-alt);
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 var(--control-shadow);
}

.live-share-control[hidden] {
  display: none;
}

.live-share-header {
  display: grid;
  gap: 4px;
}

.live-share-header h2 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(0.58rem, 1.85vmin, 0.88rem);
  line-height: 1.05;
  text-transform: uppercase;
}

.live-share-message,
.master-status-message,
.master-empty-state {
  min-height: 1.2em;
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.25;
}

.live-share-field,
.master-field {
  display: grid;
  gap: 5px;
  min-width: 0;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.live-share-field textarea,
.master-field input,
.master-field textarea {
  width: 100%;
  min-width: 0;
  padding: 8px;
  color: var(--ink);
  background: var(--field-bg-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  font: 0.78rem/1.35 ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  resize: vertical;
}

.live-room-picker {
  display: grid;
  gap: 7px;
  min-width: 0;
}

.live-room-picker[hidden] {
  display: none;
}

.live-room-picker-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.live-room-picker-header h4 {
  margin: 0;
  color: var(--ink-strong);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.live-room-picker-header .secondary-action {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 0.62rem;
}

.live-room-list {
  display: grid;
  gap: 6px;
  min-height: 34px;
}

.live-room-list-empty {
  margin: 0;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
}

.live-room-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 8px;
  color: var(--ink);
  text-align: left;
  background: var(--field-bg-strong);
  border: 2px solid var(--line);
  border-radius: 0;
  box-shadow: 2px 2px 0 var(--control-shadow);
  cursor: pointer;
}

.live-room-option:hover,
.live-room-option:focus-visible,
.live-room-option.is-selected {
  color: var(--button-text);
  background: var(--button-bg);
  outline: none;
}

.live-room-option strong,
.live-room-option span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-room-option strong {
  font-size: 0.76rem;
  line-height: 1.05;
  text-transform: uppercase;
}

.live-room-option span {
  font-size: 0.64rem;
  line-height: 1.15;
}

.text-action {
  justify-self: start;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 800;
  text-decoration: underline;
  text-transform: uppercase;
  cursor: pointer;
}

.text-action:hover,
.text-action:focus-visible {
  color: var(--ink);
}
.live-share-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
}

.live-share-actions .secondary-action {
  min-width: 0;
  padding-inline: 6px;
  white-space: normal;
}


.master-invite-card {
  grid-template-rows: auto 84px 4.2em;
}

.master-invite-card header strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-invite-card header span {
  flex: 0 0 auto;
  max-width: 48%;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.62rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}


.master-invite-card .live-share-actions {
  grid-template-columns: 1fr;
  grid-template-rows: repeat(2, 39px);
  align-content: start;
}

.master-invite-card .live-share-actions .primary-action,
.master-invite-card .live-share-actions .secondary-action {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 39px;
  min-height: 39px;
  padding-block: 4px;
  overflow: hidden;
}

.master-invite-card .master-status-message {
  height: 4.2em;
  min-height: 4.2em;
  max-height: 4.2em;
  overflow: hidden;
  color: var(--muted);
  font-size: 0.68rem;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.master-dialog-layout {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  min-height: 0;
  height: 100%;
}

.master-sidebar,
.master-dashboard,
.master-tables-panel,
.master-table-panel {
  min-width: 0;
  min-height: 0;
}

.master-sidebar {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  overflow: hidden;
}

.master-invite-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 0;
  overflow: auto;
}

.master-owner-nickname-panel {
  min-width: 0;
}

.master-local-simulation-toggle {
  justify-self: end;
  min-width: 128px;
  white-space: nowrap;
}

.master-local-simulation-toggle--hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.master-local-simulation-toggle span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.master-invite-card,
.master-character-card {
  display: grid;
  gap: 8px;
  padding: 10px;
  background: var(--soft-panel-bg-alt);
  border: 2px solid var(--line);
  box-shadow: 3px 3px 0 var(--control-shadow);
}

.master-invite-card header,
.master-character-card header,
.master-dashboard-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 10px;
}

.master-card-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: flex-end;
  gap: 6px;
}

.master-remove-player-button,
.master-clear-focus-button {
  min-height: 0;
  padding: 3px 6px;
  font-size: 0.62rem;
  line-height: 1.1;
}

.master-invite-card strong,
.master-character-card strong,
.master-dashboard-header h3,
.master-table-panel h4 {
  margin: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.82rem;
  line-height: 1.08;
  text-transform: uppercase;
}

.master-invite-card > span,
.master-character-card > span {
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1.2;
}


.master-response-form {
  display: grid;
  gap: 8px;
  padding-top: 10px;
  border-top: 2px solid var(--line);
}

.master-dashboard {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
  overflow: hidden;
}

.master-card-list {
  --master-card-gap: clamp(8px, 1.4vmin, 14px);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, clamp(220px, 27vmin, 320px)), 1fr));
  grid-auto-rows: minmax(clamp(320px, 47vmin, 540px), 1fr);
  gap: var(--master-card-gap);
  min-height: 0;
  height: 100%;
  overflow: auto;
  padding: 2px 6px 6px 2px;
  align-content: stretch;
}
.master-card-list.master-card-list--minimal:not(.master-card-list--focused) {
  --master-card-gap: clamp(5px, 0.9vmin, 9px);
  --master-minimal-row-height: 100%;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-auto-rows: minmax(clamp(205px, 26vmin, 310px), var(--master-minimal-row-height));
  align-content: start;
}

.master-card-list.master-card-list--minimal-rows-2:not(.master-card-list--focused) {
  --master-minimal-row-height: calc((100% - var(--master-card-gap)) / 2);
}

.master-card-list.master-card-list--minimal-rows-3:not(.master-card-list--focused) {
  --master-minimal-row-height: calc((100% - var(--master-card-gap) - var(--master-card-gap)) / 3);
}

.master-card-list.master-card-list--minimal-dense:not(.master-card-list--focused) {
  --master-card-gap: clamp(2px, 0.35vmin, 4px);
  --master-minimal-row-height: calc((100% - var(--master-card-gap)) / 2);
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-auto-rows: var(--master-minimal-row-height);
  padding: 1px 3px 3px 1px;
}
.master-card-list.master-card-list--focused {
  grid-template-columns: minmax(0, 1fr) minmax(180px, clamp(190px, 20vmin, 250px));
  grid-auto-rows: minmax(0, 1fr);
  overflow: hidden;
}
.master-card-list.master-card-list--focused.master-card-list--minimal {
  grid-template-columns: minmax(0, 1fr) minmax(190px, clamp(210px, 22vmin, 290px));
}

.master-card-list.master-card-list--single-focus {
  grid-template-columns: minmax(0, 1fr);
}

.master-card-side-rail {
  display: grid;
  grid-auto-rows: clamp(255px, 34vmin, 360px);
  gap: clamp(7px, 1.1vmin, 12px);
  align-content: start;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  padding-right: 4px;
  padding-bottom: calc(var(--system-version-clearance) + 6px);
}
.master-card-list--minimal .master-card-side-rail {
  grid-auto-rows: clamp(210px, 30vmin, 330px);
}

.master-card-list:empty {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  place-items: center;
  overflow: hidden;
  padding: clamp(10px, 2vmin, 22px);
}

.master-card-list.master-card-list--minimal:empty {
  --master-card-gap: clamp(8px, 1.4vmin, 14px);
  grid-template-columns: minmax(0, 1fr);
  grid-auto-rows: minmax(0, 1fr);
  align-content: stretch;
  padding: clamp(10px, 2vmin, 22px);
}

.master-card-list:empty::before {
  box-sizing: border-box;
  content: "Nenhuma ficha conectada.";
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: clamp(360px, 62vmin, 620px);
  padding: clamp(18px, 4vmin, 34px);
  color: var(--muted);
  background: var(--soft-panel-bg);
  border: 3px dashed var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(0.8rem, 1.6vmin, 1rem);
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}

.master-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
}

.master-stat-grid div {
  min-width: 0;
  padding: 6px;
  background: var(--field-bg);
  border: 1px solid var(--line);
}

.master-stat-grid b {
  display: block;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.62rem;
  line-height: 1;
  text-transform: uppercase;
}

.master-ability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.master-ability-list span {
  padding: 3px 5px;
  color: var(--ink);
  background: var(--selected-bg);
  border: 1px solid var(--line);
  font-weight: 800;
}

.master-table-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 7px;
  overflow: hidden;
}

.master-table-panel-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 7px;
  min-width: 0;
}

.master-table-panel-header h4 {
  flex: 0 0 auto;
}

.master-summary-import-button {
  margin-left: 0;
}

.master-summary-add-button {
  margin-left: 0;
}

.master-summary-add-button + .master-table-search {
  margin-left: 0;
}

.master-table-search {
  flex: 0 1 260px;
  width: min(100%, 260px);
  max-width: 280px;
  margin-left: auto;
}

.master-table-search-control {
  position: relative;
  display: block;
  width: 100%;
}

.master-table-search-control .fa-solid {
  position: absolute;
  top: 50%;
  left: 9px;
  z-index: 1;
  color: var(--muted);
  font-size: 0.78rem;
  line-height: 1;
  pointer-events: none;
  transform: translateY(-50%);
}

.master-table-search input {
  padding-left: 30px;
}

.master-table-panel-header .master-table-filter,
.master-table-panel-header .master-table-toggle,
.master-table-panel-header .master-table-toggle-button,
.master-table-panel-header .master-table-icon-button {
  flex: 0 0 auto;
}

.master-summary-import-control,
.master-summary-export-control {
  position: relative;
  display: inline-grid;
}

.master-summary-import-control {
  flex: 0 0 auto;
  margin-left: auto;
}

.master-summary-transfer-menu {
  top: calc(100% + 6px);
  right: 0;
  bottom: auto;
  width: 148px;
  z-index: 60;
}

.master-summary-export-menu {
  position: fixed;
  top: 0;
  right: auto;
  bottom: auto;
  left: 0;
  z-index: 220;
}

.master-summary-transfer-menu button {
  padding: 7px 8px;
  font-size: 0.62rem;
}

.master-summary-clipboard-feedback {
  position: fixed;
  top: 10px;
  left: 50%;
  z-index: 200;
  display: inline-flex;
  gap: 6px;
  align-items: center;
  padding: 4px 10px;
  color: #ffffff;
  background: #247a3b;
  border: 2px solid #0f4e24;
  border-radius: 4px;
  box-shadow: 3px 3px 0 var(--shadow);
  font-family: Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  line-height: 1;
  pointer-events: none;
  transform: translateX(-50%);
}

.master-summary-clipboard-feedback::before {
  display: grid;
  place-items: center;
  width: 1.05em;
  height: 1.05em;
  color: #247a3b;
  background: #ffffff;
  border-radius: 50%;
  font-size: 0.82em;
  line-height: 1;
  content: "\2713";
}

.master-summary-clipboard-feedback[hidden] {
  display: none;
}

.master-table-scroll {
  position: relative;
  isolation: isolate;
  min-height: 0;
  overflow: auto;
  border: 1px solid var(--line);
  background: var(--table-bg);
}

.master-table {
  width: 100%;
  min-width: 760px;
  border: 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 0.74rem;
  line-height: 1.25;
}

.master-table th,
.master-table td {
  padding: 7px 8px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.master-table th {
  background: var(--panel);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.66rem;
}

.master-table thead th {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: var(--panel);
  background-clip: padding-box;
  text-transform: uppercase;
}

.master-table td:last-child,
.master-table th:last-child {
  border-right: 0;
}

.master-table tr:last-child td,
.master-table tr:last-child th {
  border-bottom: 1px solid var(--line);
}

.master-summary-table {
  min-width: 980px;
}

.master-summary-table th:nth-child(4),
.master-summary-table th:nth-child(5),
.master-summary-table th:nth-child(6),
.master-summary-table td:nth-child(4),
.master-summary-table td:nth-child(5),
.master-summary-table td:nth-child(6) {
  width: 44px;
  min-width: 44px;
  max-width: 52px;
  padding-inline: 4px;
  text-align: center;
  white-space: nowrap;
}

.master-summary-table .master-summary-icon-heading {
  vertical-align: middle;
}

.master-summary-table .master-summary-icon-heading .fa-solid {
  font-size: 0.82rem;
  line-height: 1;
}

.master-summary-table td:nth-child(4) .master-summary-manual-input,
.master-summary-table td:nth-child(5) .master-summary-manual-input,
.master-summary-table td:nth-child(6) .master-summary-manual-input {
  min-width: 36px;
  padding-inline: 3px;
  text-align: center;
}
.master-summary-table th:nth-child(2),
.master-summary-table td:nth-child(2) {
  width: 92px;
  min-width: 84px;
  max-width: 112px;
}

.master-summary-table th:nth-child(7),
.master-summary-table td:nth-child(7) {
  width: 270px;
  min-width: 250px;
  max-width: 330px;
}

.master-summary-table th:nth-child(8),
.master-summary-table td:nth-child(8) {
  width: 68px;
  min-width: 62px;
  max-width: 76px;
}

.master-summary-table th:nth-child(9),
.master-summary-table td:nth-child(9) {
  width: 74px;
  min-width: 68px;
  max-width: 88px;
}

.master-summary-table th:nth-child(10),
.master-summary-table td:nth-child(10) {
  width: 112px;
  min-width: 106px;
  max-width: 126px;
}

.master-summary-table th:nth-child(11),
.master-summary-table td:nth-child(11) {
  width: 286px;
  min-width: 272px;
  max-width: 340px;
}
.master-summary-table td:nth-child(10) .master-summary-manual-input {
  min-width: 0;
}

.master-summary-saves-cell {
  overflow: visible;
}

.master-summary-saves-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(42px, max-content));
  justify-content: start;
  gap: 3px;
  min-width: 0;
}

.master-summary-saves-list--manual {
  grid-template-columns: repeat(auto-fit, minmax(42px, max-content));
  justify-content: start;
  gap: 3px;
}

.master-summary-save-item {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: start;
  gap: 3px;
  min-width: 0;
  padding: 2px 3px;
  color: var(--ink);
  background: var(--soft-panel-bg-alt);
  border: 1px solid var(--line);
}

.master-summary-save-item--manual {
  grid-template-columns: auto 28px;
  justify-content: start;
  gap: 2px;
  padding: 2px 3px;
}

.master-summary-save-label {
  min-width: 0;
  overflow: hidden;
  color: var(--muted);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.58rem;
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.master-summary-save-value {
  color: var(--ink);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.78rem;
  line-height: 1;
  text-align: right;
  white-space: nowrap;
}

.master-summary-saves-cell .master-summary-save-input {
  width: 28px;
  min-width: 28px;
  padding: 2px 1px;
  font-size: 0.72rem;
  text-align: center;
}

.master-summary-saves-empty {
  color: var(--muted);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.62rem;
  line-height: 1.1;
  text-transform: uppercase;
}
.master-summary-abilities-cell {
  overflow: visible;
}

.master-summary-abilities-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
  width: 100%;
  gap: 3px;
}

.master-summary-ability-item {
  min-width: 0;
  padding-inline: 3px;
}

.master-summary-ability-label {
  overflow: visible;
  text-overflow: clip;
}

.master-summary-ability-value {
  font-size: 0.72rem;
}
.master-summary-name-cell {
  min-width: 170px;
}

.master-summary-name-content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.master-summary-name-text {
  min-width: 0;
}

.master-summary-drag-handle {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  color: var(--muted);
  border: 1px solid transparent;
  cursor: grab;
}

.master-summary-drag-handle:hover,
.master-summary-drag-handle:focus-visible {
  color: var(--ink);
  border-color: var(--accent);
  outline: 0;
}

.master-summary-drag-handle:active {
  cursor: grabbing;
}

.master-summary-row--dragging {
  opacity: 0.55;
}

.master-summary-row--drop-before td {
  box-shadow: inset 0 2px 0 var(--accent);
}

.master-summary-row--drop-after td {
  box-shadow: inset 0 -2px 0 var(--accent);
}
.master-summary-row--manual td {
  vertical-align: middle;
}

.master-summary-manual-input {
  width: 100%;
  min-width: 62px;
  padding: 4px 5px;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
  font-weight: 800;
  line-height: 1.1;
}

.master-summary-manual-input:focus {
  border-color: var(--accent);
  outline: 0;
}
.master-summary-manual-select {
  min-width: 0;
  padding: 3px 4px;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  font: inherit;
  font-weight: 800;
  line-height: 1.1;
}

.master-summary-manual-select:focus {
  border-color: var(--accent);
  outline: 0;
}

.master-summary-manual-name-input {
  min-width: 130px;
}

.master-summary-manual-field-group {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.master-summary-manual-class-level-group,
.master-summary-manual-xp-group {
  display: grid;
  width: 100%;
  gap: 3px;
}

.master-summary-manual-class-level-group {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.master-summary-manual-xp-group {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.master-summary-manual-class-level-group .master-summary-manual-input,
.master-summary-manual-xp-group .master-summary-manual-input {
  min-width: 0;
  padding-inline: 3px;
}
.master-summary-manual-xp-group .master-summary-manual-input + .master-summary-manual-input {
  border-top: 0;
}
.master-summary-manual-class-level-group .master-summary-manual-input + .master-summary-manual-input {
  border-top: 0;
}

.master-summary-manual-class-level-group .master-summary-manual-level-input {
  width: 100%;
  text-align: center;
}
.master-summary-manual-class-level-group .master-summary-manual-class-input {
  text-align: center;
}
.master-summary-weight-group {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 14px;
  align-items: center;
  gap: 3px;
  min-width: 0;
}

.master-summary-weight-input {
  min-width: 0;
  text-align: center;
}

.master-summary-weight-count-input {
  width: 12px;
  height: 12px;
  margin: 0;
  accent-color: var(--ink);
  cursor: pointer;
}
.master-summary-resource-group {
  display: grid;
  grid-template-columns: 36px 28px auto 28px;
  align-items: center;
  gap: 2px;
  width: 100%;
  min-width: 0;
}

.master-summary-resource-select {
  width: 36px;
  padding-inline: 1px;
  font-size: 0.66rem;
}

.master-summary-resource-input {
  width: 28px;
  padding-inline: 1px;
  text-align: center;
  appearance: textfield;
}

.master-summary-resource-input::-webkit-outer-spin-button,
.master-summary-resource-input::-webkit-inner-spin-button {
  margin: 0;
  appearance: none;
}

.master-summary-resource-separator {
  color: var(--ink);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  line-height: 1;
  text-align: center;
}

.master-summary-manual-actions {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
}

.master-summary-player-status-cell {
  min-width: 140px;
}

.master-summary-player-status-actions {
  display: grid;
  grid-template-columns: auto auto minmax(18px, 1fr) auto;
  align-items: center;
  column-gap: 5px;
  width: 100%;
  min-width: 0;
  white-space: nowrap;
}

.master-summary-player-status-time {
  color: var(--muted);
  font-size: 0.66rem;
  line-height: 1;
}

.master-summary-remove-player-button {
  grid-column: 4;
  justify-self: end;
  width: 22px;
  height: 22px;
}
.master-summary-skills-cell {
  position: relative;
  overflow: visible;
}
.master-summary-skills-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 104px;
  min-height: 24px;
  padding: 4px 6px;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.62rem;
  line-height: 1.05;
  text-transform: uppercase;
  cursor: pointer;
}

.master-summary-skills-button:hover,
.master-summary-skills-button:focus-visible {
  color: var(--on-solid);
  background: var(--solid-bg);
  outline: 0;
}

.master-summary-skills-preview {
  position: absolute;
  left: 50%;
  bottom: calc(100% + 6px);
  z-index: 80;
  display: none;
  grid-template-columns: minmax(0, 1fr);
  gap: 4px;
  width: max-content;
  min-width: 190px;
  max-width: min(340px, 70vw);
  padding: 8px 10px;
  color: var(--ink);
  background: var(--panel);
  border: 2px solid var(--line);
  box-shadow: 4px 4px 0 var(--control-shadow);
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.2;
  text-align: left;
  text-transform: none;
  transform: translateX(-50%);
  pointer-events: none;
  white-space: normal;
}

.master-summary-skills-floating-preview {
  position: fixed;
  top: var(--master-summary-skills-preview-top, 0);
  left: var(--master-summary-skills-preview-left, 0);
  bottom: auto;
  z-index: 10000;
  display: grid;
  max-width: min(360px, calc(100vw - 24px));
  transform: none;
}

.master-summary-skills-preview::after {
  content: "";
  position: absolute;
  left: var(--master-summary-skills-arrow-left, 50%);
  bottom: -7px;
  width: 10px;
  height: 10px;
  background: var(--panel);
  border-right: 2px solid var(--line);
  border-bottom: 2px solid var(--line);
  transform: translateX(-50%) rotate(45deg);
}

.master-summary-skills-floating-preview--below::after {
  top: -7px;
  bottom: auto;
  border-top: 2px solid var(--line);
  border-left: 2px solid var(--line);
  border-right: 0;
  border-bottom: 0;
}


.master-summary-skills-floating-preview--pulse {
  animation: master-summary-skills-preview-pulse 2s ease forwards;
}


@keyframes master-summary-skills-preview-pulse {
  0%,
  82% {
    visibility: visible;
    opacity: 1;
  }

  100% {
    visibility: hidden;
    opacity: 0;
  }
}

.master-summary-skills-preview-row {
  display: block;
  min-width: 0;
  overflow-wrap: anywhere;
}

.master-summary-skills-preview-row strong {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  line-height: 1.05;
}

.master-summary-skills-preview-empty {
  color: var(--muted);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1.15;
  text-transform: uppercase;
}
.master-skills-dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 12px;
  width: min(720px, 100%);
  max-height: min(620px, calc(100dvh - 36px));
  overflow: hidden;
}

.master-skills-body {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 10px;
  min-height: 0;
}

.master-skills-list {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: min(180px, 40dvh);
  max-height: min(360px, 50dvh);
  padding-right: 4px;
  overflow: auto;
}

.master-skill-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(0, 1.4fr) 28px;
  gap: 8px;
  align-items: start;
  min-width: 0;
  padding: 8px;
  background: var(--soft-panel-bg-alt);
  border: 2px solid var(--line);
}

.master-skill-row label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.master-skill-row label span {
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.62rem;
  line-height: 1;
  text-transform: uppercase;
}

.master-skill-row input,
.master-skill-row textarea {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 6px 7px;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  font: 800 0.82rem "Trebuchet MS", Arial, sans-serif;
  line-height: 1.2;
}

.master-skill-row textarea {
  min-height: 54px;
  resize: vertical;
}

.master-skill-row input:focus,
.master-skill-row textarea:focus {
  border-color: var(--accent);
  outline: 0;
}

.master-skill-remove-button {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
}

.master-skill-remove-button:hover,
.master-skill-remove-button:focus-visible {
  color: var(--on-solid);
  background: var(--solid-bg);
  outline: 0;
}

.master-skills-empty {
  display: grid;
  place-items: center;
  min-height: 120px;
  margin: 0;
  color: var(--muted);
  background: var(--soft-panel-bg);
  border: 2px dashed var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: center;
  text-transform: uppercase;
}

.master-skill-add-button {
  justify-self: start;
  min-width: 180px;
}

.master-skills-dialog-actions {
  padding-top: 12px;
  border-top: 2px solid var(--line);
}

@media (max-width: 720px) {
  .master-skill-row {
    grid-template-columns: minmax(0, 1fr) 28px;
  }

  .master-skill-row label {
    grid-column: 1;
  }

  .master-skill-remove-button {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
}
.master-spells-table {
  table-layout: fixed;
  min-width: 700px;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.76rem;
}

.master-spells-table th:nth-child(1),
.master-spells-table td:nth-child(1) {
  width: 18%;
}

.master-spells-table th:nth-child(2),
.master-spells-table td:nth-child(2) {
  width: 54px;
  text-align: center;
}

.master-spells-table th:nth-child(3),
.master-spells-table td:nth-child(3) {
  width: 21%;
}

.master-spells-table th:nth-child(4),
.master-spells-table td:nth-child(4) {
  width: 76px;
  text-align: center;
  white-space: nowrap;
}

.master-spells-table th:nth-child(5),
.master-spells-table td:nth-child(5) {
  width: auto;
}

.master-spells-table td:nth-child(5) {
  font-family: "Trebuchet MS", Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 800;
  line-height: 1.18;
}

.master-spells-table details {
  max-width: 100%;
}

.master-spells-table summary,
.master-spells-table .spell-description-text {
  overflow-wrap: anywhere;
  word-break: break-word;
}

.master-spells-table summary {
  display: list-item;
  cursor: pointer;
}

.master-spells-table tbody tr.spell-row-spent {
  color: var(--spent-ink);
  background: var(--spent-bg);
}

.master-spells-table input[type="checkbox"] {
  width: 15px;
  height: 15px;
  margin: 0;
  accent-color: var(--ink);
}

.master-spells-table tbody th {
  font-size: inherit;
  text-transform: none;
}

.master-spells-table .spell-type-row th {
  color: var(--on-solid);
  background: var(--solid-bg);
  font-size: 0.72rem;
  text-transform: uppercase;
}


.master-dashboard-title-group {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.master-dashboard-title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  min-width: 0;
}

.master-max-weight {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  padding: 2px 6px;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.68rem;
  line-height: 1.05;
  text-transform: uppercase;
  white-space: nowrap;
}

.master-max-weight[hidden] {
  display: none;
}

.master-table-filter {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 4px;
  min-width: 0;
}

.master-table-filter button,
.master-table-toggle,
.master-table-toggle-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  padding: 3px 6px;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.62rem;
  line-height: 1.05;
  text-transform: uppercase;
  cursor: pointer;
}

.master-table-filter button[aria-pressed="true"],
.master-table-toggle-button[aria-pressed="true"] {
  color: var(--on-solid);
  background: var(--solid-bg);
}

.master-table-toggle[hidden] {
  display: none;
}

.master-table-icon-button,
.master-summary-manual-action-button {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  padding: 0;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  font-size: 0.72rem;
  line-height: 1;
  cursor: pointer;
}

.master-table-icon-button:hover,
.master-table-icon-button:focus-visible,
.master-summary-manual-action-button:hover,
.master-summary-manual-action-button:focus-visible {
  color: var(--on-solid);
  background: var(--solid-bg);
  outline: 0;
}

.master-table-toggle input {
  width: 14px;
  height: 14px;
  margin: 0;
  accent-color: var(--ink);
}

.master-view-toggle {
  justify-self: end;
  min-width: min(220px, 100%);
  padding-inline: 8px;
  white-space: normal;
}

.master-card-list[hidden],
.master-tables-panel[hidden] {
  display: none;
}

.master-tables-panel {
  display: grid;
  grid-template-rows: repeat(3, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
  overflow: hidden;
}

.master-tables-panel--combat {
  grid-template-rows: minmax(0, 1fr);
}

.master-tables-panel--combat .master-summary-panel {
  min-height: 0;
}

.master-tables-panel--combat .master-inventory-panel,
.master-tables-panel--combat .master-spells-panel {
  display: none;
}

.master-combat-mode-button .fa-solid {
  font-size: 0.72rem;
  line-height: 1;
}

.master-character-card.master-rendered-card {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: clamp(3px, 0.6vmin, 6px);
  height: 100%;
  min-height: 0;
  padding: clamp(6px, 1vmin, 10px);
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
}

.master-card-list--minimal .master-character-card.master-rendered-card:not(.master-rendered-card--side) {
  align-content: start;
  grid-template-rows: auto auto auto minmax(0, 1fr);
}

.master-card-list--minimal .master-character-card.master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) {
  gap: 0;
  padding: clamp(2px, 0.35vmin, 4px);
}

.master-card-list--minimal-dense .master-character-card.master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) {
  gap: 0;
  padding: 1px;
}
.master-rendered-card {
  cursor: pointer;
}

.master-rendered-card:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

.master-character-card.master-rendered-card--focused {
  cursor: default;
}

.master-character-card.master-rendered-card--side {
  grid-template-rows: auto minmax(0, 1fr);
  gap: clamp(4px, 0.75vmin, 7px);
  min-height: 0;
  height: 100%;
  padding: clamp(5px, 0.8vmin, 8px);
  border: 2px solid transparent;
}

.master-character-card.master-rendered-card--side:hover,
.master-character-card.master-rendered-card--side:focus-visible {
  border-color: var(--accent);
}

.master-character-card.master-rendered-card--side > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 3px;
}

.master-rendered-card--side .master-rendered-title {
  gap: 1px;
}

.master-rendered-card--side .master-rendered-title strong {
  font-size: clamp(0.68rem, 1.35vmin, 0.86rem);
  line-height: 0.98;
  overflow-wrap: break-word;
  word-break: normal;
}

.master-rendered-card--side .master-rendered-title span {
  font-size: clamp(0.52rem, 1.02vmin, 0.64rem);
  line-height: 1.12;
}

.master-rendered-card--side .master-rendered-actions {
  justify-content: flex-start;
  gap: 4px;
}

.master-rendered-card--side .master-status-pill,
.master-rendered-card--side .master-remove-player-button {
  padding: 2px 4px;
  font-size: 0.54rem;
}

.master-rendered-card--side .master-rendered-sheet-frame {
  place-items: start center;
}

.master-rendered-card > header {
  display: flex;
  gap: 8px;
  align-items: start;
  justify-content: space-between;
  min-width: 0;
}

.master-rendered-card:not(.master-rendered-card--side) > header {
  justify-self: center;
  width: min(100%, var(--master-rendered-sheet-width, 100%));
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) > header {
  align-items: start;
  gap: 5px;
  margin-bottom: clamp(0.55rem, 0.9vmin, 0.82rem);
}

.master-card-list--minimal-dense .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) > header {
  gap: 3px;
  margin-bottom: clamp(0.42rem, 0.65vmin, 0.62rem);
}
.master-rendered-title {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-title {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
  gap: 2px;
}

.master-card-list--minimal-dense .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-title {
  gap: 1px;
}
.master-rendered-title strong {
  font-size: clamp(0.76rem, 1.55vmin, 0.98rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-title strong {
  color: var(--ink);
  font-size: clamp(1.12rem, 2.1vmin, 1.38rem);
  line-height: 0.9;
  overflow: hidden;
  overflow-wrap: normal;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.master-card-list--minimal-dense .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-title strong {
  font-size: clamp(0.98rem, 1.42vmin, 1.14rem);
}
.master-rendered-title span {
  color: var(--muted);
  font-size: clamp(0.58rem, 1.2vmin, 0.72rem);
  line-height: 1.2;
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-title-summary {
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(0.88rem, 1.55vmin, 1.08rem);
  font-weight: 900;
  line-height: 0.95;
  opacity: 0.96;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.master-card-list--minimal-dense .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-title-summary {
  font-size: clamp(0.72rem, 1.02vmin, 0.82rem);
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-title-details {
  overflow: hidden;
  color: var(--ink);
  font-size: clamp(0.7rem, 1.14vmin, 0.84rem);
  font-weight: 800;
  line-height: 1;
  opacity: 0.86;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.master-card-list--minimal-dense .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-title-details {
  font-size: clamp(0.58rem, 0.82vmin, 0.66rem);
}
.master-rendered-actions {
  flex: 0 0 auto;
}

.master-rendered-note-field {
  display: grid;
  gap: 3px;
  justify-self: center;
  width: min(100%, var(--master-rendered-sheet-width, 100%));
  min-width: 0;
  color: var(--ink);
  cursor: text;
}

.master-rendered-note-field span {
  overflow: hidden;
  color: var(--muted);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(0.56rem, 1vmin, 0.68rem);
  line-height: 1;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.master-rendered-note-input {
  box-sizing: border-box;
  width: 100%;
  min-height: clamp(42px, 6vmin, 72px);
  padding: 5px 6px;
  color: var(--ink);
  background: var(--field-bg);
  border: 1px solid var(--line);
  border-radius: 0;
  font: 800 clamp(0.66rem, 1.08vmin, 0.78rem) "Trebuchet MS", Arial, sans-serif;
  line-height: 1.2;
  resize: vertical;
}

.master-rendered-note-input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.master-rendered-card--focused .master-rendered-note-input {
  min-height: clamp(72px, 11vmin, 120px);
}

.master-rendered-card--side .master-rendered-note-field {
  display: none;
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-note-field {
  gap: 2px;
  margin-top: clamp(3px, 0.55vmin, 5px);
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-note-field span {
  font-size: clamp(0.48rem, 0.7vmin, 0.56rem);
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-note-input {
  min-height: clamp(32px, 4.4vmin, 44px);
  padding: 3px 4px;
  font-size: clamp(0.58rem, 0.86vmin, 0.68rem);
  line-height: 1.1;
}

.master-card-list--minimal-dense .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-note-field span {
  display: none;
}

.master-card-list--minimal-dense .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-note-input {
  min-height: clamp(24px, 3.5vmin, 32px);
  padding: 2px 3px;
  font-size: clamp(0.5rem, 0.7vmin, 0.58rem);
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-actions {
  align-self: start;
  gap: 3px;
  justify-content: flex-end;
}

.master-card-list--minimal-dense .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-actions {
  gap: 2px;
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-status-pill,
.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-remove-player-button {
  padding: 1px 3px;
  font-size: clamp(0.46rem, 0.74vmin, 0.56rem);
  line-height: 1;
}

.master-card-list--minimal-dense .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-status-pill,
.master-card-list--minimal-dense .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-remove-player-button {
  padding: 1px 2px;
  font-size: clamp(0.42rem, 0.65vmin, 0.5rem);
}
.master-rendered-sheet-frame {
  display: grid;
  place-items: center;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-sheet-frame {
  place-items: start center;
}

.master-card-list--minimal .master-rendered-card:not(.master-rendered-card--focused):not(.master-rendered-card--side) .master-rendered-sheet {
  align-self: start;
  height: auto;
  max-height: 100%;
  place-items: start center;
}
.master-rendered-sheet {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  overflow: hidden;
  color: #111111;
  pointer-events: auto;
}

.master-rendered-sheet .sheet-workspace {
  display: block;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  overflow: visible;
}

.master-rendered-sheet .sheet-fit {
  margin-right: 0;
}

.master-rendered-sheet .sheet {
  pointer-events: none;
}
.master-card-list--minimal .master-rendered-sheet .sheet {
  grid-template-rows: 342px;
  height: auto;
  min-height: 0;
}

.master-minimal-weight {
  display: none;
}

.master-card-list--minimal .master-rendered-sheet .combat-panel {
  grid-template-rows: auto minmax(0, 1fr) auto;
}

.master-card-list--minimal .master-rendered-sheet .master-minimal-weight {
  display: inline-flex;
  align-items: baseline;
  justify-self: center;
  gap: 4px;
  margin-top: 6px;
  padding: 2px 8px;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--line);
  font-family: "Arial Black", Impact, sans-serif;
  line-height: 1;
  text-transform: uppercase;
}

.master-card-list--minimal .master-rendered-sheet .master-minimal-weight-label,
.master-card-list--minimal .master-rendered-sheet .master-minimal-weight-unit {
  font-size: 0.72rem;
}

.master-card-list--minimal .master-rendered-sheet .master-minimal-weight-value {
  font-size: 1.08rem;
  line-height: 0.92;
}

.master-card-list--minimal .master-rendered-sheet .sheet-header,
.master-card-list--minimal .master-rendered-sheet .class-rules-box,
.master-card-list--minimal .master-rendered-sheet .sheet-credit {
  display: none;
}

.master-rendered-sheet [data-inventory-trigger],
.master-rendered-sheet [data-spell-trigger] {
  cursor: pointer;
  pointer-events: auto;
}

.master-rendered-sheet .bba-value {
  width: 3.5ch;
  font-size: 2.22rem;
  line-height: 0.88;
}

.master-rendered-sheet .hit-area--with-quantitative-marker .bba-value {
  font-size: 1.72rem;
}

.master-rendered-sheet .armor-value {
  left: 49.5%;
  width: 2.6ch;
  font-size: 1.68rem;
}

.master-rendered-sheet .attack-value {
  font-size: 1.4rem;
}

.master-rendered-sheet .hit-area--with-quantitative-marker .attack-value {
  font-size: 1.14rem;
}

.master-rendered-sheet .class-postit--backpack .class-postit-value {
  font-size: 1.78rem;
  line-height: 0.92;
}

.master-rendered-sheet .class-postit--backpack .class-postit-unit {
  margin-top: 1px;
  font-size: 0.72rem;
}

.master-rendered-sheet .class-postit--backpack .class-postit-metric--secondary .class-postit-value {
  font-size: 1.15rem;
}

.master-rendered-sheet .class-postits--with-magic .class-postit--backpack .class-postit-label {
  font-size: 0.78rem;
}

.master-rendered-sheet .character-notes-toggle,
.master-rendered-sheet .character-notes-backdrop,
.master-rendered-sheet .character-notes-panel,
.master-rendered-sheet .attack-copy-feedback {
  display: none;
}

.master-rendered-sheet-fallback {
  margin: 0;
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 800;
  text-align: center;
}

.master-status-pill {
  display: inline-block;
  padding: 2px 5px;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 1px solid var(--line);
  font-size: 0.66rem;
  font-weight: 800;
  text-transform: uppercase;
}

.master-screen .master-dialog {
  position: relative;
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  gap: var(--shell-gap);
  height: calc(100dvh - (var(--shell-padding) * 2) - var(--panel-shadow-size));
  padding: 0;
  overflow: hidden;
  background: transparent;
  border: 0;
  box-shadow: none;
  transition:
    grid-template-columns 180ms ease,
    gap 180ms ease;
}

.master-screen .master-dialog.master-dialog--sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.system-screen.master-screen .master-dialog {
  height: calc(100dvh - (var(--shell-padding) * 2) - var(--panel-shadow-size));
}

.master-screen .master-dialog-header {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  margin: 0;
  padding: 0 0 clamp(4px, 1dvh, 8px) clamp(18px, 3.8vmin, 44px);
}

.master-screen .master-dialog-header h2 {
  font-size: clamp(1rem, 3.2vmin, 1.55rem);
  line-height: 1;
}

.master-sidebar-toggle {
  position: fixed;
  top: calc(var(--shell-padding) + var(--panel-padding));
  left: calc(var(--shell-padding) + var(--sidebar-width) + 2px);
  z-index: 126;
  display: grid;
  place-items: center;
  width: var(--sidebar-toggle-size);
  height: var(--sidebar-toggle-size);
  padding: 0;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--control-border);
  border-radius: 0;
  box-shadow: clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
  transform: translateX(-50%);
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    left 180ms ease;
}

.master-sidebar-toggle::before {
  content: "\00AB";
  display: block;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(1.1rem, 3.4vmin, 1.45rem);
  line-height: 0.8;
  transform: translateY(-1px);
}

.master-sidebar-toggle:hover,
.master-sidebar-toggle:focus {
  color: var(--accent-ink);
  background: var(--accent);
  outline: 0;
  box-shadow:
    0 0 0 2px var(--focus-ring),
    clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
}

.master-dialog.master-dialog--sidebar-collapsed .master-sidebar-toggle {
  left: calc(var(--shell-padding) + var(--sidebar-collapsed-width) + 2px);
}

.master-dialog.master-dialog--sidebar-collapsed .master-sidebar-toggle::before {
  content: "\00BB";
}

.master-screen .master-dialog-layout {
  display: contents;
}

.master-screen .master-sidebar {
  grid-column: 1;
  grid-row: 1 / -1;
  align-self: stretch;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  padding: var(--panel-padding);
  padding-top: calc(var(--panel-padding) + var(--session-panel-space));
  background:
    linear-gradient(90deg, transparent 0 34px, var(--panel-margin-rule) 35px 37px, transparent 38px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 25px,
      var(--panel-row-rule) 26px,
      transparent 27px
    ),
    var(--panel);
  border: 3px solid var(--panel-outline);
  box-shadow: var(--panel-shadow-size) var(--panel-shadow-size) 0 var(--panel-drop-shadow);
  transition:
    opacity 160ms ease,
    transform 180ms ease,
    visibility 160ms ease;
}

.master-screen .master-dialog.master-dialog--sidebar-collapsed .master-sidebar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(0px - var(--shell-padding)));
}

.master-screen .master-dashboard {
  grid-column: 2;
  grid-row: 2;
  height: 100%;
  padding: 0 0 calc(var(--system-version-clearance) + 2px);
  background: transparent;
  border: 0;
}

.master-screen .master-dashboard-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  align-items: center;
  padding-left: clamp(18px, 3.8vmin, 44px);
}

.master-minimal-toggle,
.master-local-simulation-toggle {
  justify-self: end;
  white-space: nowrap;
}

.master-screen .master-view-toggle,
.master-screen .master-minimal-toggle,
.master-screen .master-local-simulation-toggle {
  margin-top: clamp(10px, 2.2vmin, 20px);
}

.master-screen .master-empty-state {
  align-self: end;
  margin-top: clamp(22px, 4vmin, 42px);
}
@media (max-width: 900px) {
  .master-screen .master-dialog {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto minmax(0, 1fr);
    overflow: auto;
  }

  .master-screen .master-dialog.master-dialog--sidebar-collapsed {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .master-screen .master-dialog-header {
    grid-column: 1;
    grid-row: 1;
    padding-left: calc(var(--sidebar-toggle-size) + 10px);
  }

  .master-screen .master-sidebar {
    grid-column: 1;
    grid-row: 2;
    height: auto;
    padding-top: calc(var(--panel-padding) + var(--session-panel-space));
  }

  .master-screen .master-dialog.master-dialog--sidebar-collapsed .master-sidebar {
    display: none;
  }

  .master-screen .master-dashboard {
    grid-column: 1;
    grid-row: 3;
    min-height: min(70dvh, 620px);
  }

  .master-screen .master-dialog.master-dialog--sidebar-collapsed .master-dashboard {
    grid-row: 2;
  }
  .master-dialog-layout {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

  .master-sidebar {
    grid-template-rows: minmax(0, 1fr) auto;
    overflow: visible;
  }

  .master-screen .master-dashboard-header {
    grid-template-columns: minmax(0, 1fr);
  }
  .master-screen .master-view-toggle,
  .master-screen .master-minimal-toggle,
  .master-screen .master-local-simulation-toggle {
    width: 100%;
    justify-self: stretch;
  }

  .master-invite-list {
    max-height: 180px;
  }

  .master-dashboard {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .master-card-list {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr));
    grid-auto-rows: minmax(320px, auto);
  }

  .master-card-list.master-card-list--minimal:not(.master-card-list--focused) {
    grid-template-columns: minmax(0, 1fr);
    grid-auto-rows: minmax(260px, auto);
  }
  .master-card-list.master-card-list--focused {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(420px, 1fr) minmax(150px, 220px);
    overflow: auto;
  }

  .master-card-list.master-card-list--single-focus {
    grid-template-rows: minmax(420px, 1fr);
  }

  .master-card-side-rail {
    grid-auto-flow: column;
    grid-auto-columns: minmax(180px, 44vw);
    grid-auto-rows: 1fr;
    overflow-x: auto;
    overflow-y: hidden;
    padding-right: 0;
    padding-bottom: 4px;
  }

  .master-tables-panel {
    grid-template-rows: repeat(3, minmax(180px, 1fr));
  }
}
@media (max-height: 720px) {
  :root {
    --panel-padding: clamp(7px, 1.8dvh, 14px);
    --panel-form-gap: clamp(3px, 0.9dvh, 7px);
    --panel-action-gap: clamp(3px, 0.7dvh, 6px);
    --panel-control-height: clamp(23px, 4.8dvh, 31px);
    --panel-control-pad-y: clamp(2px, 0.7dvh, 5px);
    --panel-control-pad-x: clamp(7px, 1.3dvh, 10px);
    --panel-label-size: clamp(0.62rem, 1.9dvh, 0.8rem);
    --panel-button-size: clamp(0.54rem, 1.7dvh, 0.74rem);
    --session-panel-space: clamp(84px, 15dvh, 102px);
  }

  .brand-lockup {
    grid-template-columns: minmax(52px, 36%) minmax(0, 1fr);
    align-items: center;
    gap: clamp(4px, 1dvh, 7px);
    margin-bottom: clamp(4px, 1dvh, 8px);
  }

  .brand-mark {
    width: clamp(72px, 18dvh, 152px);
    max-height: 20dvh;
  }

  .brand-mark.brand-mark--default {
    width: clamp(52px, 14dvh, 120px);
    max-height: 16dvh;
  }

  .brand-mark.brand-mark--default img {
    max-height: calc(16dvh - var(--external-svg-padding) - var(--external-svg-padding));
  }

  .brand-lockup h1 {
    max-width: none;
    font-size: clamp(0.78rem, 3dvh, 1.22rem);
  }
}

@media (max-height: 560px) {
  :root {
    --panel-padding: clamp(7px, 1.6dvh, 10px);
    --panel-form-gap: 3px;
    --panel-field-gap: 1px;
    --panel-action-gap: 3px;
    --panel-control-height: clamp(21px, 4.6dvh, 26px);
    --panel-control-pad-y: 1px;
    --panel-control-pad-x: clamp(6px, 1.2dvh, 8px);
    --panel-label-size: clamp(0.54rem, 1.65dvh, 0.66rem);
    --panel-button-size: clamp(0.48rem, 1.5dvh, 0.6rem);
    --session-panel-space: clamp(74px, 15dvh, 88px);
  }

  .brand-lockup {
    grid-template-columns: minmax(42px, 28%) minmax(0, 1fr);
    gap: 4px;
    margin-bottom: 3px;
  }

  .brand-mark {
    width: clamp(48px, 12dvh, 80px);
    max-height: 13dvh;
  }

  .brand-mark.brand-mark--default {
    width: clamp(38px, 10dvh, 64px);
    max-height: 10dvh;
  }

  .brand-mark.brand-mark--default img {
    max-height: calc(10dvh - var(--external-svg-padding) - var(--external-svg-padding));
  }

  .brand-lockup h1 {
    font-size: clamp(0.68rem, 2.45dvh, 0.94rem);
  }

  .primary-action,
  .secondary-action {
    line-height: 0.98;
  }
}

@media (max-height: 420px) {
  :root {
    --shell-padding: 6px;
    --shell-gap: 6px;
    --panel-padding: 7px;
    --panel-form-gap: 2px;
    --panel-field-gap: 1px;
    --panel-action-gap: 2px;
    --panel-control-height: clamp(20px, 5.8dvh, 24px);
    --panel-control-pad-y: 1px;
    --panel-control-pad-x: 7px;
    --panel-label-size: clamp(0.5rem, 2.1dvh, 0.62rem);
    --panel-button-size: clamp(0.46rem, 1.9dvh, 0.56rem);
    --session-panel-space: clamp(66px, 17dvh, 80px);
  }

  .brand-lockup {
    grid-template-columns: minmax(36px, 24%) minmax(0, 1fr);
    gap: 4px;
    margin-bottom: 3px;
  }

  .brand-mark {
    width: clamp(44px, 12dvh, 78px);
    max-height: 13dvh;
  }

  .brand-mark.brand-mark--default {
    width: clamp(36px, 11dvh, 68px);
    max-height: 12dvh;
  }

  .brand-mark.brand-mark--default img {
    max-height: calc(12dvh - var(--external-svg-padding) - var(--external-svg-padding));
  }

  .status-message {
    min-height: 0;
    margin-top: 4px;
    font-size: clamp(0.58rem, 2.4dvh, 0.72rem);
  }
}

@media (max-width: 1280px) {
  .inventory-dialog-backdrop--cart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr) minmax(220px, 36dvh);
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
  }

  .inventory-dialog-backdrop--cart .inventory-dialog {
    grid-column: 1 / -1;
    grid-row: 1;
    height: 100%;
    max-height: none;
  }

  .inventory-dialog-backdrop--cart .inventory-selection-stock {
    grid-column: 1;
    grid-row: 2;
  }

  .inventory-dialog-backdrop--cart .inventory-selection-cart {
    grid-column: 2;
    grid-row: 2;
  }

  .inventory-dialog-backdrop--cart .inventory-selection-stock,
  .inventory-dialog-backdrop--cart .inventory-selection-cart {
    height: 100%;
    max-height: none;
  }
}

@media (max-width: 760px) {
  .character-library-card {
    grid-template-columns: minmax(120px, 0.55fr) minmax(180px, 1.45fr);
  }

  .character-library-card.is-dead {
    grid-template-columns: 58px minmax(120px, 0.55fr) minmax(180px, 1.45fr);
  }

  .character-library-identity {
    grid-column: 1 / -1;
  }
}

@media (max-width: 900px) {
  .app-shell {
    --sidebar-width: clamp(96px, 30vw, 220px);
    grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
    gap: var(--shell-gap);
    padding: var(--shell-padding);
  }

  .auth-bar {
    width: calc(
      var(--sidebar-width) + 2px - var(--panel-padding) - clamp(16px, 2.7vmin, 21px) -
        var(--session-button-gap)
    );
    max-width: min(32vmin, 160px, calc(100vw - (var(--shell-padding) * 2)));
    min-height: 38px;
  }

  .app-shell.app-shell--system-view .auth-bar,
  .app-shell.app-shell--master-view .auth-bar {
    width: calc(
      var(--sidebar-width) + 2px - var(--panel-padding) - clamp(16px, 2.7vmin, 21px) -
        var(--session-button-gap)
    );
    max-width: min(32vmin, 160px, calc(100vw - (var(--shell-padding) * 2)));
  }

  .generator-panel {
    grid-column: 1;
    grid-row: 1;
    height: calc(100dvh - (var(--shell-padding) * 2) - var(--panel-shadow-size));
    padding: var(--panel-padding);
    padding-top: calc(var(--panel-padding) + var(--session-panel-space));
  }

  .sheet-stage {
    grid-column: 2;
    grid-row: 1;
  }

  .brand-lockup {
    display: flex;
    align-items: center;
    gap: clamp(5px, 1.2dvh, 8px);
    margin-bottom: clamp(4px, 1dvh, 7px);
  }

  .brand-mark {
    width: clamp(82px, 18dvh, 154px);
  }

  .brand-mark.brand-mark--default {
    width: clamp(72px, 15dvh, 132px);
  }

  .brand-lockup h1 {
    max-width: none;
    font-size: clamp(0.92rem, 2.8dvh, 1.24rem);
  }

  .character-form {
    grid-template-columns: 1fr;
    gap: var(--panel-action-gap);
  }

  .form-actions {
    grid-column: 1 / -1;
    grid-template-columns: 1fr 1fr;
    margin-top: 0;
  }

  .form-field input,
  .form-field select,
  .primary-action,
  .secondary-action,
  .discord-signin-button {
    min-height: var(--panel-control-height);
    padding: var(--panel-control-pad-y) var(--panel-control-pad-x);
  }

  .auth-login-button,
  .auth-logout-button,
  .system-button,
  .master-button {
    min-height: clamp(22px, 5.4vmin, 42px);
    padding-block: clamp(3px, 1.2vmin, 8px);
    padding-inline: clamp(2px, 1.1vmin, 10px);
    padding-inline: clamp(2px, 3cqw, 12px);
  }

  .status-message {
    display: none;
  }

  .system-dialog-layout {
    grid-template-columns: 1fr;
  }

  .system-screen .system-dialog {
    height: calc(100dvh - (var(--shell-padding) * 2) - var(--system-version-clearance));
    padding:
      calc(var(--panel-padding) + var(--session-panel-space))
      var(--panel-padding)
      var(--panel-padding);
    overflow: hidden;
  }

  body.system-journey-active .system-record-dialog {
    height: calc(100dvh - (var(--shell-padding) * 2));
    padding:
      calc(var(--panel-padding) + var(--session-panel-space))
      var(--panel-padding)
      var(--panel-padding);
    overflow: auto;
  }

  .system-screen .system-dialog-layout {
    grid-template-rows: auto minmax(0, 1fr);
    height: 100%;
    min-height: 0;
  }

  .system-screen .system-editor-form,
  .system-screen .system-editor-panel {
    overflow: hidden;
  }

  body.system-journey-active .system-class-template-body,
  body.system-journey-active .system-logo-dialog-body,
  body.system-journey-active .system-record-editor-body,
  body.system-journey-active .system-weapon-access-body,
  body.system-journey-active .system-kit-items-body {
    overflow: visible;
  }

  body.system-journey-active .system-weapon-access-list select,
  body.system-journey-active .system-kit-items-list select {
    height: auto;
    min-height: 220px;
  }

  .system-sidebar {
    grid-template-columns: auto minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: start;
    min-height: 0;
  }

  .system-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(150px, 1fr);
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .system-owner-nickname-panel {
    grid-column: 1 / -1;
    align-self: auto;
  }

  .system-record-grid,
  .system-weapon-access-body,
  .system-kit-items-body,
  .system-record-type-row,
  .system-logo-editor-grid,
  .system-record-feature-row,
  .system-record-rule-row,
  .system-record-special-row,
  .system-record-spell-type-row {
    grid-template-columns: 1fr;
  }

  .system-record-save-grid,
  .system-record-special-progress-grid,
  .system-record-special-details,
  .system-record-special-row > .system-record-remove-button {
    grid-column: auto;
    grid-row: auto;
  }
}

@media (max-width: 720px) {
  .armor-dialog-backdrop,
  .inventory-dialog-backdrop,
  .spell-dialog-backdrop {
    padding: 8px;
    align-items: stretch;
  }

  .inventory-dialog-backdrop--cart {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: minmax(0, 1fr) minmax(220px, 38dvh);
    gap: 8px;
    align-items: stretch;
    justify-content: stretch;
    overflow: hidden;
  }

  .armor-dialog,
  .inventory-dialog,
  .spell-dialog {
    display: grid;
    width: 100%;
    max-height: calc(100dvh - 16px);
    padding: 14px 12px 12px 24px;
    overflow: hidden;
    box-shadow: 4px 4px 0 var(--panel-drop-shadow);
  }

  .inventory-dialog,
  .spell-dialog {
    height: calc(100dvh - 16px);
  }

  .inventory-dialog-backdrop--cart .inventory-dialog {
    height: 100%;
    max-height: none;
  }

  .inventory-dialog-backdrop--cart .inventory-selection-stock,
  .inventory-dialog-backdrop--cart .inventory-selection-cart {
    height: 100%;
    max-height: none;
    padding: 14px 12px 12px 24px;
    box-shadow: 4px 4px 0 var(--panel-drop-shadow);
  }

  .armor-form,
  .inventory-form,
  .spell-form {
    grid-template-rows: auto minmax(0, 1fr) auto;
    height: 100%;
    min-height: 0;
    max-height: calc(100dvh - 48px);
  }

  .armor-dialog-header,
  .inventory-dialog-header,
  .spell-dialog-header {
    margin-top: 2px;
  }

  .armor-dialog h2,
  .inventory-dialog h2,
  .spell-dialog h2 {
    font-size: 1rem;
  }

  .armor-list-view,
  .armor-custom-view,
  .inventory-list-view,
  .inventory-selection-view,
  .inventory-custom-view,
  .spell-custom-view,
  .spell-preparation-view,
  .spell-prepared-view,
  .spell-learning-view {
    min-height: 0;
  }

  .armor-list-view {
    grid-template-rows: minmax(0, 1fr);
  }

  .inventory-list-view {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .inventory-selection-view,
  .spell-preparation-view,
  .spell-learning-view {
    grid-template-rows: auto auto minmax(0, 1fr);
  }

  .inventory-selection-view {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .spell-prepared-view {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .armor-custom-view,
  .inventory-custom-view,
  .spell-custom-view {
    overflow: auto;
    padding-right: 3px;
  }

  .armor-dialog-summary,
  .inventory-dialog-summary,
  .spell-dialog-summary {
    margin: 2px 0 0;
    gap: 6px 8px;
    font-size: 0.8rem;
  }

  .armor-dialog-summary strong,
  .inventory-dialog-summary strong,
  .spell-dialog-summary strong {
    font-size: 0.68rem;
  }

  .spell-toolbar,
  .inventory-toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
    align-items: stretch;
  }

  .inventory-list-toolbar {
    grid-template-columns: 1fr;
    gap: 8px;
    justify-content: stretch;
  }

  .inventory-list-view--locked .inventory-list-toolbar {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .inventory-list-toolbar .inventory-search-field {
    width: 100%;
  }

  .inventory-market-layout {
    grid-template-rows: auto minmax(0, 1fr);
    gap: 8px;
  }

  .inventory-selection-cart-header {
    padding: 7px 8px;
    font-size: 0.68rem;
  }

  .inventory-selection-cart-item {
    padding: 7px 8px;
  }

  .spell-cycle-tabs,
  .inventory-category-tabs {
    flex-wrap: nowrap;
    max-width: 100%;
    padding: 2px 0 5px;
    overflow-x: auto;
  }

  .spell-cycle-tab,
  .inventory-category-tab {
    flex: 0 0 auto;
    min-height: 36px;
  }

  .spell-search-field input,
  .inventory-search-field input {
    height: 38px;
  }

  .armor-table-wrap,
  .spell-table-wrap,
  .inventory-table-wrap {
    min-height: 0;
    max-height: none;
  }

  .armor-table thead th,
  .spell-preparation-table thead th,
  .spell-prepared-table thead th,
  .spell-learning-table thead th,
  .spell-visibility-table thead th,
  .inventory-table thead th,
  .inventory-selection-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
  }

  .armor-table {
    min-width: 760px;
  }

  .inventory-table {
    min-width: 700px;
  }

  .inventory-selection-table,
  .spell-preparation-table,
  .spell-prepared-table,
  .spell-learning-table,
  .spell-visibility-table {
    min-width: 700px;
  }

  .armor-table th,
  .armor-table td,
  .spell-preparation-table th,
  .spell-preparation-table td,
  .spell-prepared-table th,
  .spell-prepared-table td,
  .spell-learning-table th,
  .spell-learning-table td,
  .spell-visibility-table th,
  .spell-visibility-table td,
  .inventory-table th,
  .inventory-table td,
  .inventory-selection-table th,
  .inventory-selection-table td {
    padding: 7px 6px;
  }

  .inventory-table tbody th,
  .inventory-table tbody td,
  .inventory-selection-table tbody th,
  .inventory-selection-table tbody td {
    padding: 3px 5px;
  }

  .spell-preparation-table td:nth-child(4),
  .spell-prepared-table td:nth-child(4),
  .spell-learning-table td:nth-child(4),
  .spell-visibility-table td:nth-child(4),
  .inventory-table td:nth-child(6),
  .inventory-selection-table td:nth-child(5) {
    width: auto;
    min-width: 220px;
  }

  .armor-table th:nth-child(3),
  .armor-table td:nth-child(3) {
    min-width: 180px;
  }

  .spell-count-control,
  .inventory-count-control {
    grid-template-columns: 32px 44px 32px;
  }

  .spell-count-control button,
  .inventory-count-control button,
  .spell-edit-button,
  .spell-delete-button,
  .inventory-edit-button,
  .inventory-remove-button,
  .inventory-clear-button {
    width: 32px;
    height: 32px;
  }

  .spell-count-control input,
  .inventory-count-control input {
    width: 44px;
    height: 32px;
  }

  .inventory-count-control {
    grid-template-columns: 24px 36px 24px;
    gap: 2px;
  }

  .inventory-count-control button,
  .spell-edit-button,
  .spell-delete-button,
  .inventory-edit-button,
  .inventory-remove-button,
  .inventory-clear-button {
    width: 24px;
    height: 24px;
  }

  .inventory-count-control input {
    width: 36px;
    height: 24px;
  }

  .armor-custom-grid,
  .inventory-custom-grid,
  .spell-custom-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .armor-custom-field--wide,
  .inventory-custom-field--wide,
  .spell-custom-field--wide {
    grid-column: 1 / -1;
  }

  .spell-custom-field[for="custom-spell-name"],
  .spell-custom-field[for="custom-spell-range"],
  .spell-custom-field[for="custom-spell-duration"] {
    grid-column: span 2;
  }

  .armor-dialog-actions,
  .inventory-dialog-actions,
  .spell-dialog-actions {
    justify-content: stretch;
    gap: 8px;
  }

  .spell-dialog-actions-start {
    flex: 1 1 100%;
    gap: 8px;
    margin-right: 0;
  }

  .armor-dialog-actions .primary-action,
  .armor-dialog-actions .secondary-action,
  .inventory-dialog-actions .item-transfer-control,
  .spell-dialog-actions .item-transfer-control,
  .inventory-dialog-actions .primary-action,
  .inventory-dialog-actions .secondary-action,
  .spell-dialog-actions .primary-action,
  .spell-dialog-actions .secondary-action {
    flex: 1 1 140px;
    min-width: 0;
    min-height: 38px;
    padding: 7px 8px;
    font-size: 0.7rem;
    line-height: 1.04;
    white-space: normal;
  }

  .inventory-selection-totals {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    padding: 7px 8px;
  }
}


@media (max-width: 560px) {
  .character-library-dialog-backdrop {
    padding: 9px;
  }

  .character-library-dialog {
    max-height: calc(100dvh - 18px);
    padding: 12px 10px 10px 34px;
  }

  .character-library-folder-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .character-library-folder-actions,
  .character-library-folder-form-actions {
    justify-content: flex-end;
  }

  .character-library-folder-form {
    grid-template-columns: minmax(0, 1fr);
  }

  .character-library-folder-form > .character-library-folder-form-actions {
    grid-column: 1;
    grid-row: auto;
  }

  .character-library-card {
    grid-template-columns: minmax(0, 1fr);
    padding: 8px 42px 8px 8px;
  }

  .character-library-card.is-dead {
    grid-template-columns: minmax(0, 1fr);
  }

  .character-library-identity {
    grid-column: auto;
  }

  .brand-lockup {
    display: none;
  }

  .character-form {
    grid-template-columns: 1fr;
  }

  .form-actions {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 3px;
  }

  .sheet-transfer-actions {
    gap: 3px;
  }

  .auto-save-control {
    padding: 5px 6px;
  }

  .auto-save-control > span {
    font-size: clamp(0.56rem, 1.7vmin, 0.62rem);
  }

  .auto-save-control small {
    font-size: clamp(0.42rem, 1.35vmin, 0.5rem);
  }

  .ability-swap-grid {
    grid-template-columns: 1fr;
  }

  .traveller-advancement-controls {
    grid-template-columns: 1fr;
  }

  .traveller-advancement-controls select:first-child {
    grid-column: auto;
  }

  .class-details-dialog {
    padding: 14px;
  }

  .system-sidebar,
  .system-share-row,
  .system-logo-row,
  [data-system-panel="abilities"] .system-mini-row,
  .system-mini-row {
    grid-template-columns: 1fr;
  }

  .primary-action,
  .secondary-action {
    padding-right: 3px;
    padding-left: 3px;
    font-size: clamp(0.36rem, 1.8vmin, 0.7rem);
    overflow-wrap: normal;
    word-break: normal;
  }

  .app-version {
    font-size: clamp(0.46rem, 2.4vmin, 0.68rem);
  }

  .armor-dialog-backdrop,
  .inventory-dialog-backdrop,
  .spell-dialog-backdrop {
    padding: 0;
  }

  .inventory-dialog-backdrop--cart {
    grid-template-columns: 1fr;
    grid-template-rows: minmax(0, 1fr) minmax(110px, 20dvh) minmax(220px, 30dvh);
    gap: 0;
  }

  .inventory-dialog-backdrop--cart .inventory-dialog {
    grid-column: 1;
    grid-row: 1;
    min-height: 0;
  }

  .inventory-dialog-backdrop--cart .inventory-selection-stock {
    grid-column: 1;
    grid-row: 2;
  }

  .inventory-dialog-backdrop--cart .inventory-selection-cart {
    grid-column: 1;
    grid-row: 3;
  }

  .armor-dialog,
  .inventory-dialog,
  .spell-dialog {
    width: 100%;
    max-height: 100dvh;
    min-height: 100dvh;
    padding: 12px 10px 10px 18px;
    border-width: 2px;
    box-shadow: none;
  }

  .inventory-dialog,
  .spell-dialog {
    height: 100dvh;
  }

  .inventory-dialog-backdrop--cart .inventory-selection-stock,
  .inventory-dialog-backdrop--cart .inventory-selection-cart {
    padding: 12px 10px 10px 18px;
    border-width: 2px;
    box-shadow: none;
  }

  .armor-form,
  .inventory-form,
  .spell-form {
    max-height: calc(100dvh - 24px);
    gap: 9px;
  }

  .armor-dialog h2,
  .inventory-dialog h2,
  .spell-dialog h2 {
    font-size: 0.9rem;
  }

  .armor-dialog-summary,
  .inventory-dialog-summary,
  .spell-dialog-summary {
    font-size: 0.74rem;
  }

  .armor-custom-grid,
  .inventory-custom-grid,
  .spell-custom-grid {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .inventory-custom-field[for="custom-item-name"],
  .inventory-custom-field[for="custom-item-category"],
  .spell-custom-field[for="custom-spell-name"],
  .spell-custom-field[for="custom-spell-range"],
  .spell-custom-field[for="custom-spell-duration"] {
    grid-column: 1 / -1;
  }

  .armor-custom-field--check,
  .inventory-custom-field--check {
    min-height: 38px;
  }

  .inventory-search-actions {
    grid-template-columns: minmax(0, 1fr) max-content;
  }

  .inventory-market-layout {
    grid-template-rows: auto minmax(0, 1fr);
  }

  .inventory-selection-cart-item {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
  }

  .inventory-selection-cart-item-subtotal {
    text-align: left;
  }

  .inventory-selection-cart-item-actions {
    justify-content: space-between;
  }

  .inventory-selection-totals {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .spell-search-actions {
    grid-template-columns: minmax(0, 1fr) 38px;
  }

  .spell-search-actions--learning {
    grid-template-columns: minmax(0, 1fr) 38px 38px;
  }

  .armor-market-shortcut,
  .inventory-custom-shortcut,
  .inventory-market-shortcut {
    width: 38px;
    height: 38px;
    font-size: 1.05rem;
  }

  .spell-custom-shortcut {
    width: 38px;
    height: 38px;
  }

  .armor-dialog-actions .primary-action,
  .armor-dialog-actions .secondary-action,
  .inventory-dialog-actions .item-transfer-control,
  .spell-dialog-actions .item-transfer-control,
  .inventory-dialog-actions .primary-action,
  .inventory-dialog-actions .secondary-action,
  .spell-dialog-actions .primary-action,
  .spell-dialog-actions .secondary-action {
    flex-basis: calc(50% - 4px);
    font-size: 0.66rem;
  }
}

.export-png-capture-host {
  position: fixed;
  top: 0;
  left: -10000px;
  z-index: -1;
  pointer-events: none;
}

.export-png-canvas {
  display: grid;
  grid-template-columns: 900px 320px;
  gap: 22px;
  align-items: start;
  box-sizing: content-box;
  padding: 0 28px 28px 0;
  color: #111111;
  background: transparent;
}

.export-png-canvas .class-details-more-button,
.export-png-canvas .manual-overrides-button,
.export-print-sheet-frame .class-details-more-button,
.export-print-sheet-frame .manual-overrides-button {
  display: none !important;
}

.export-png-sheet-frame {
  grid-column: 1;
  grid-row: 1;
  width: 900px;
  height: 1120px;
  overflow: hidden;
}

.export-notebook-sidebar {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  gap: 16px;
  align-content: start;
  min-height: 1120px;
  padding: 8px 0 8px;
}

.export-notebook-card {
  background:
    linear-gradient(90deg, transparent 0 34px, rgba(140, 47, 36, 0.36) 35px 37px, transparent 38px),
    repeating-linear-gradient(
      0deg,
      transparent 0,
      transparent 23px,
      rgba(56, 91, 132, 0.18) 24px,
      transparent 25px
    ),
    #fffef8;
}

.export-notebook-card {
  box-sizing: border-box;
  width: 100%;
  padding: 16px 14px 18px 48px;
  border: 2px solid #111111;
  box-shadow: 5px 5px 0 rgba(17, 17, 17, 0.18);
  font-family: "Trebuchet MS", Arial, sans-serif;
}

.export-png-canvas > .export-notebook-card--inventory-wide {
  grid-column: 1 / -1;
  width: calc(100% - 8px);
}

.export-notebook-title,
.export-notebook-subtitle {
  margin: 0;
  color: #111111;
  font-family: "Arial Black", Impact, sans-serif;
  line-height: 1;
  text-transform: uppercase;
}

.export-notebook-title {
  margin-bottom: 10px;
  font-size: 1.06rem;
}

.export-notebook-subtitle {
  margin: 12px 0 5px;
  font-size: 0.62rem;
  letter-spacing: 0;
}

.export-notebook-list {
  display: grid;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.export-notebook-list li {
  min-height: 21px;
  padding: 2px 0 1px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.55);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.export-notebook-blank-line {
  color: transparent;
}

.export-notebook-write-line {
  display: grid;
  grid-template-columns: minmax(86px, auto) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
}

.export-notebook-write-label {
  color: rgba(17, 17, 17, 0.74);
  font-size: 0.66rem;
  line-height: 1.1;
  text-transform: uppercase;
}

.export-notebook-empty {
  color: rgba(17, 17, 17, 0.62);
  font-style: italic;
}

.export-notebook-text {
  min-height: 21px;
  margin: 0;
  padding: 2px 0 1px;
  border-bottom: 1px solid rgba(17, 17, 17, 0.55);
  font-size: 0.74rem;
  font-weight: 800;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.export-notebook-card--inventory-wide .export-notebook-list {
  display: block;
  column-width: 250px;
  column-gap: 18px;
}

.export-notebook-card--inventory-wide .export-notebook-list li {
  break-inside: avoid;
  page-break-inside: avoid;
}

.export-notebook-card--notes .notes-markdown {
  color: #111111;
  font-size: 0.76rem;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.export-notebook-card--notes .notes-markdown h1,
.export-notebook-card--notes .notes-markdown h2,
.export-notebook-card--notes .notes-markdown h3,
.export-notebook-card--notes .notes-markdown h4 {
  margin: 12px 0 6px;
  color: #111111;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 0.9rem;
  line-height: 1.15;
}

.export-notebook-card--notes .notes-markdown p,
.export-notebook-card--notes .notes-markdown ul,
.export-notebook-card--notes .notes-markdown ol,
.export-notebook-card--notes .notes-markdown blockquote,
.export-notebook-card--notes .notes-markdown pre,
.export-notebook-card--notes .notes-markdown table {
  margin: 0 0 9px;
}

.export-notebook-card--notes .notes-markdown blockquote {
  padding-left: 9px;
  border-left: 3px solid rgba(17, 17, 17, 0.55);
}

.export-notebook-card--notes .notes-markdown pre {
  padding: 7px;
  background: rgba(17, 17, 17, 0.07);
  border: 1px solid rgba(17, 17, 17, 0.45);
}

.export-notebook-card--notes .notes-markdown a {
  color: #111111;
}

.export-notebook-card--notes-wide {
  width: 100%;
}

:root[data-theme="dark"] .export-notebook-card {
  filter: brightness(0.78);
}

:root[data-theme="dark"] .export-png-sheet-frame {
  background: #c7c6c1;
}

.export-print-pages {
  display: none;
}

.export-detail-title,
.export-detail-heading,
.export-detail-subheading {
  color: #111111;
  font-family: "Arial Black", Impact, sans-serif;
  line-height: 1;
  text-transform: uppercase;
}

.export-detail-title {
  margin: 0 0 4mm;
  font-size: 20pt;
}

.export-detail-subtitle,
.export-detail-summary {
  margin: 0 0 4mm;
  color: #111111;
  font-weight: 800;
}

.export-detail-section {
  margin: 0 0 6mm;
}

.export-detail-heading {
  margin: 0 0 3mm;
  font-size: 13pt;
}

.export-detail-subheading {
  margin: 3mm 0 1.5mm;
  font-size: 9pt;
}

.export-detail-table {
  width: 100%;
  margin: 0 0 3mm;
  border-collapse: collapse;
  color: #111111;
  background: rgba(255, 254, 248, 0.82);
  font-family: Arial, sans-serif;
  font-size: 8pt;
}

.export-detail-table th,
.export-detail-table td {
  padding: 2mm 1.6mm;
  border: 0.35mm solid #111111;
  line-height: 1.18;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.export-detail-table th {
  color: #fffef8;
  background: #111111;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 7.2pt;
  text-transform: uppercase;
}

.export-detail-write-table td {
  height: 6mm;
}

.export-detail-write-table td:first-child {
  width: 36mm;
  color: rgba(17, 17, 17, 0.74);
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 6.8pt;
  text-transform: uppercase;
}

.export-detail-compact-list,
.export-detail-known-summary,
.export-detail-inventory-list {
  color: #111111;
  font-family: Arial, sans-serif;
  font-size: 8pt;
  line-height: 1.18;
}

.export-detail-compact-list {
  display: flex;
  flex-wrap: wrap;
  gap: 1mm 4mm;
  margin: 0 0 3mm;
  padding: 0;
  list-style: none;
}

.export-detail-compact-list li {
  min-width: 38mm;
  padding-bottom: 1mm;
  border-bottom: 0.25mm solid rgba(17, 17, 17, 0.6);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.export-detail-known-summary {
  margin: 0 0 3mm;
  padding-bottom: 2mm;
  border-bottom: 0.35mm solid #111111;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.export-detail-inventory-list {
  display: block;
  margin: 0;
  padding: 0;
  column-width: 42mm;
  column-gap: 5mm;
  list-style: none;
}

.export-detail-inventory-list li {
  min-height: 4.9mm;
  padding: 1mm 0 0.8mm;
  border-bottom: 0.25mm solid rgba(17, 17, 17, 0.6);
  break-inside: avoid;
  page-break-inside: avoid;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.export-detail-inventory-list .export-detail-inventory-category {
  min-height: 0;
  padding: 1.5mm 0 0.6mm;
  border-bottom: 0.35mm solid #111111;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: 7pt;
  line-height: 1;
  text-transform: uppercase;
}

.export-detail-empty {
  color: rgba(17, 17, 17, 0.62);
  font-style: italic;
}

@page {
  size: A4;
  margin: 7mm;
}

.app-shell.app-shell--system-view.app-shell--system-sidebar-collapsed .auth-bar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(0px - var(--shell-padding)));
}

.system-screen:not(.master-screen) .system-dialog {
  transition:
    grid-template-columns 180ms ease,
    gap 180ms ease;
}

.system-screen:not(.master-screen) .system-dialog.system-dialog--sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.system-sidebar-toggle {
  position: fixed;
  top: calc(var(--shell-padding) + var(--panel-padding));
  left: calc(var(--shell-padding) + var(--sidebar-width) + 2px);
  z-index: 126;
  display: grid;
  place-items: center;
  width: var(--sidebar-toggle-size);
  height: var(--sidebar-toggle-size);
  padding: 0;
  color: var(--on-solid);
  background: var(--solid-bg);
  border: 2px solid var(--control-border);
  border-radius: 0;
  box-shadow: clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
  transform: translateX(-50%);
  transition:
    background-color 160ms ease,
    box-shadow 160ms ease,
    color 160ms ease,
    left 180ms ease;
}

.system-sidebar-toggle::before {
  content: "\00AB";
  display: block;
  font-family: "Arial Black", Impact, sans-serif;
  font-size: clamp(1.1rem, 3.4vmin, 1.45rem);
  line-height: 0.8;
  transform: translateY(-1px);
}

.system-sidebar-toggle:hover,
.system-sidebar-toggle:focus {
  color: var(--accent-ink);
  background: var(--accent);
  outline: 0;
  box-shadow:
    0 0 0 2px var(--focus-ring),
    clamp(2px, 0.7vmin, 3px) clamp(2px, 0.7vmin, 3px) 0 var(--control-shadow);
}

.system-dialog.system-dialog--sidebar-collapsed .system-sidebar-toggle {
  left: calc(var(--shell-padding) + var(--sidebar-collapsed-width) + 2px);
}

.system-dialog.system-dialog--sidebar-collapsed .system-sidebar-toggle::before {
  content: "\00BB";
}

.system-screen:not(.master-screen) .system-dialog.system-dialog--sidebar-collapsed .system-sidebar {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transform: translateX(calc(0px - var(--shell-padding)));
}
@media print {
  .sheet-tour {
    display: none !important;
  }

  html,
  body {
    height: auto;
    overflow: visible;
  }

  body {
    background: #fff;
  }

  body.exporting-character-pdf .app-shell {
    display: none;
  }

  body.exporting-character-pdf .export-print-pages {
    display: block;
  }

  .export-print-page {
    box-sizing: border-box;
    width: 196mm;
    min-height: 283mm;
    margin: 0 auto;
    color: #111111;
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
    break-after: page;
    page-break-after: always;
  }

  .export-print-page:last-child {
    break-after: auto;
    page-break-after: auto;
  }

  .export-print-sheet-page {
    display: grid;
    justify-items: center;
    align-items: start;
    min-height: 283mm;
    overflow: hidden;
    background: #ffffff;
  }

  .export-print-sheet-frame {
    position: relative;
    width: 196mm;
    height: 244mm;
    overflow: visible;
  }

  .export-print-sheet-frame .sheet {
    position: relative !important;
    top: 0 !important;
    left: 0 !important;
    width: 900px !important;
    height: 1120px !important;
    margin: 0 !important;
    transform: none !important;
    transform-origin: top left;
    zoom: 0.823;
  }

  .export-print-detail-page {
    padding: 8mm 8mm 8mm 12mm;
    background:
      linear-gradient(90deg, transparent 0 4mm, rgba(140, 47, 36, 0.36) 4.3mm 4.8mm, transparent 5.1mm),
      repeating-linear-gradient(
        0deg,
        transparent 0,
        transparent 6mm,
        rgba(56, 91, 132, 0.18) 6.25mm,
        transparent 6.5mm
      ),
      #fffef8;
    filter: none;
  }

  :root[data-theme="dark"] .export-print-detail-page {
    filter: brightness(0.78);
  }

  :root[data-theme="dark"] .export-print-detail-page .export-notebook-card {
    filter: none;
  }

  .export-print-detail-page .export-notebook-card {
    box-shadow: none;
    break-inside: auto;
    page-break-inside: auto;
  }

  .export-print-notes-page {
    height: auto;
    min-height: 283mm;
    overflow: visible;
  }

  .export-print-notes-page .export-notebook-card--notes {
    padding-right: 5mm;
    break-inside: auto;
    page-break-inside: auto;
  }

  .export-print-notes-page .notes-markdown {
    font-size: 9pt;
    line-height: 1.42;
  }

  .export-print-notes-page .notes-markdown > * {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .export-print-detail-page .export-notebook-card--inventory-wide {
    padding-right: 5mm;
  }

  .export-print-detail-page .export-notebook-card--inventory-continued {
    break-before: page;
    page-break-before: always;
    margin-top: 8mm;
  }

  .export-print-detail-page .export-notebook-card--inventory-wide .export-notebook-list {
    column-width: 55mm;
    column-gap: 5mm;
  }

  .export-print-detail-page .export-notebook-list li,
  .export-print-detail-page .export-notebook-text {
    min-height: 5.2mm;
    font-size: 8pt;
    line-height: 1.18;
  }

  .export-detail-section,
  .export-detail-heading,
  .export-detail-subheading {
    break-after: avoid;
    page-break-after: avoid;
  }

  .export-detail-table tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .app-shell {
    display: block;
    width: auto;
    height: auto;
    min-height: auto;
    padding: 0;
    overflow: visible;
  }

    .generator-panel,
    .sidebar-toggle,
    .system-sidebar-toggle,
    .character-library-button,
    .close-sheet-button,
    .app-version,
    .class-details-more-button,
    .manual-overrides-button,
    .character-library-dialog-backdrop,
    .class-details-dialog-backdrop,
  .sheet-placeholder {
    display: none;
  }

  .sheet-stage {
    display: grid;
    justify-items: center;
    overflow: visible;
  }

  .sheet-fit {
    margin-right: 0;
    width: 196mm !important;
    height: 244mm !important;
    overflow: visible;
  }

  .sheet {
    position: absolute;
    width: 900px;
    height: 1120px;
    border-width: 3px;
    box-shadow: none;
    transform: scale(0.823) !important;
    transform-origin: top left;
    break-inside: avoid;
  }
}
