:root {
  color-scheme: dark;
  --bg: #110f13;
  --bg-2: #211818;
  --sidebar: #0d0b0f;
  --sidebar-2: #181116;
  --surface: #201a20;
  --surface-2: #2b2428;
  --surface-3: #382f31;
  --ink: #fff3e7;
  --muted: #b8aa9d;
  --muted-strong: #ded0c2;
  --line: rgba(226, 195, 151, 0.24);
  --line-dark: rgba(226, 195, 151, 0.28);
  --accent: #d34a5b;
  --accent-rgb: 211, 74, 91;
  --accent-deep: #8c2535;
  --accent-deep-rgb: 140, 37, 53;
  --theme-soft: #ebbdc1;
  --gold: #d89d4a;
  --equipped-gold: #e4b760;
  --equipped-gold-soft: rgba(216, 157, 74, 0.14);
  --equipped-gold-dim: rgba(216, 157, 74, 0.42);
  --attuned-cyan: #86e1ff;
  --attuned-violet: #b8a6ff;
  --attuned-rose: #f6d365;
  --attuned-soft: rgba(134, 225, 255, 0.11);
  --attuned-violet-soft: rgba(184, 166, 255, 0.12);
  --teal: #59b3a0;
  --success: #55b878;
  --tutorial-highlight: #45e188;
  --tutorial-highlight-rgb: 69, 225, 136;
  --danger: #d85852;
  --arcane: #9b91ee;
  --shadow: 0 18px 44px rgba(0, 0, 0, 0.36);
  --soft-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
  --portal-sidebar-width: 300px;
}

* { box-sizing: border-box; min-width: 0; }
html, body {
  min-height: 100%;
  -ms-overflow-style: none;
  scrollbar-width: none;
  -webkit-text-size-adjust: 100%;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
  height: 0;
  width: 0;
}

body {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), transparent 42%),
    linear-gradient(180deg, var(--bg), var(--bg-2));
  color: var(--ink);
  font-family: "Segoe UI Variable Text", "Segoe UI", system-ui, sans-serif;
  margin: 0;
}

body.loading-active {
  overflow: hidden;
}

.mobile-orientation-lock {
  align-items: center;
  background:
    radial-gradient(circle at 50% 36%, rgba(216, 157, 74, 0.16), transparent 32%),
    linear-gradient(180deg, rgba(17, 15, 19, 0.98), rgba(33, 24, 24, 0.98));
  color: var(--ink);
  display: none;
  inset: 0;
  justify-items: center;
  padding: max(28px, env(safe-area-inset-top)) 18px max(28px, env(safe-area-inset-bottom));
  position: fixed;
  text-align: center;
  z-index: 4000;
}

.mobile-orientation-card {
  align-items: center;
  display: grid;
  gap: 10px;
  max-width: 320px;
}

.mobile-orientation-mark {
  border: 2px solid rgba(216, 157, 74, 0.76);
  border-radius: 18px;
  box-shadow:
    inset 0 0 0 5px rgba(255, 250, 242, 0.055),
    0 18px 42px rgba(0, 0, 0, 0.32);
  display: block;
  height: 88px;
  position: relative;
  width: 54px;
}

.mobile-orientation-mark::before {
  background: rgba(255, 250, 242, 0.56);
  border-radius: 999px;
  content: "";
  height: 5px;
  left: 50%;
  position: absolute;
  top: 8px;
  transform: translateX(-50%);
  width: 18px;
}

.mobile-orientation-lock .kicker {
  color: var(--gold);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mobile-orientation-lock h1 {
  font-size: 30px;
  line-height: 1;
}

.mobile-orientation-lock p {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 800;
  line-height: 1.35;
}

.version-update-dialog {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 3600;
}

.version-update-backdrop {
  background: rgba(5, 7, 10, 0.76);
  inset: 0;
  position: absolute;
}

.version-update-panel {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.12), rgba(var(--accent-rgb), 0.08)),
    rgba(32, 26, 32, 0.98);
  border: 1px solid rgba(216, 157, 74, 0.36);
  border-radius: 8px;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.48);
  display: grid;
  gap: 10px;
  max-width: 430px;
  padding: 20px;
  position: relative;
  width: min(430px, calc(100vw - 32px));
}

.version-update-panel .kicker {
  color: var(--gold);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.version-update-panel h2 {
  color: var(--ink);
  font-size: 26px;
  line-height: 1.08;
}

.version-update-panel p {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.version-update-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (orientation: landscape) {
  body.mobile-portrait-required {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.mobile-portrait-required .mobile-orientation-lock {
    display: grid;
  }
}

html.panel-scroll-dragging,
body.panel-scroll-dragging,
html.sidebar-toggle-dragging,
body.sidebar-toggle-dragging {
  overscroll-behavior: none;
}

body.panel-scroll-dragging,
body.panel-scroll-dragging *,
body.sidebar-toggle-dragging,
body.sidebar-toggle-dragging * {
  -webkit-touch-callout: none !important;
  -webkit-user-select: none !important;
  user-select: none !important;
}

button, input, select, textarea { font: inherit; }

button,
a,
[role="button"],
label {
  touch-action: manipulation;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button,
.btn,
[role="button"] {
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
}

button > svg,
.btn > svg,
[role="button"] > svg {
  pointer-events: none;
}

.hero-settings-button,
.battle-map-fab,
.support-fab,
[data-combat-action],
.portal-map-tool,
.portal-map-icon-btn {
  touch-action: manipulation !important;
}

input, select, textarea { font-size: 16px; }
h1, h2, h3, p { margin: 0; }
h1, h2, h3 { letter-spacing: 0; }

.portal-loading-screen {
  --portal-load-progress: 0%;
  align-items: center;
  background:
    radial-gradient(circle at 50% 45%, rgba(216, 157, 74, 0.1), transparent 28%),
    radial-gradient(circle at 50% 57%, rgba(var(--accent-rgb), 0.15), transparent 42%),
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), transparent 40%),
    linear-gradient(180deg, rgba(17, 15, 19, 0.98), rgba(33, 24, 24, 0.98));
  color: var(--ink);
  display: grid;
  inset: 0;
  justify-items: center;
  padding: max(34px, env(safe-area-inset-top)) 16px max(34px, env(safe-area-inset-bottom));
  position: fixed;
  transition: opacity .28s ease, visibility .28s ease;
  z-index: 2200;
}

.portal-loading-screen::before {
  background:
    linear-gradient(rgba(255, 250, 242, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 250, 242, 0.025) 1px, transparent 1px);
  background-size: 34px 34px;
  content: "";
  inset: 0;
  opacity: .5;
  pointer-events: none;
  position: absolute;
}

.portal-loading-screen.is-hidden {
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

.portal-loading-panel {
  align-items: center;
  display: grid;
  gap: 14px;
  justify-items: center;
  max-width: 620px;
  padding: 0;
  position: relative;
  text-align: center;
  width: min(100%, 620px);
  z-index: 1;
}

.portal-loading-panel::before,
.portal-loading-panel::after {
  content: none;
}

.portal-loading-brand {
  align-items: center;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.portal-loading-mark {
  align-items: center;
  background:
    linear-gradient(160deg, rgba(var(--accent-rgb), 0.3), rgba(216, 157, 74, 0.12)),
    rgba(255, 250, 242, 0.06);
  border: 1px solid rgba(216, 157, 74, 0.42);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 242, 0.14);
  display: inline-flex;
  height: 58px;
  justify-content: center;
  position: relative;
  width: 58px;
}

.portal-loading-mark::after {
  animation: portalLoadingMark 1.8s linear infinite;
  border: 1px solid rgba(216, 157, 74, 0.28);
  border-left-color: rgba(var(--accent-rgb), 0.7);
  border-radius: 8px;
  content: "";
  inset: 6px;
  position: absolute;
}

.portal-loading-mark img {
  height: 38px;
  object-fit: contain;
  position: relative;
  width: 38px;
  z-index: 1;
}

.portal-loading-copy {
  display: grid;
  gap: 4px;
  justify-items: center;
}

.portal-loading-copy span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.portal-loading-copy h1 {
  color: #fffaf2;
  font-size: 38px;
  font-weight: 950;
  line-height: .96;
  text-shadow:
    0 0 22px rgba(216, 157, 74, 0.24),
    0 4px 16px rgba(0, 0, 0, 0.52);
}

.portal-loading-meter {
  display: grid;
  gap: 8px;
  margin-top: 8px;
  max-width: 380px;
  width: min(100%, 380px);
}

.portal-loading-track {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.06), rgba(0, 0, 0, 0.16)),
    rgba(255, 250, 242, 0.07);
  border: 1px solid rgba(226, 195, 151, 0.26);
  border-radius: 999px;
  height: 11px;
  overflow: hidden;
  padding: 1px;
}

.portal-loading-track i {
  background:
    linear-gradient(90deg, var(--accent-deep), var(--accent), var(--gold));
  border-radius: 999px;
  box-shadow: 0 0 18px rgba(var(--accent-rgb), 0.28);
  display: block;
  height: 100%;
  overflow: hidden;
  position: relative;
  transition: width .32s ease;
  width: var(--portal-load-progress);
}

.portal-loading-track i::after {
  animation: portalLoadingSheen 1.2s linear infinite;
  background: linear-gradient(90deg, transparent, rgba(255, 250, 242, 0.5), transparent);
  content: "";
  inset: 0;
  position: absolute;
  transform: translateX(-100%);
}

.portal-loading-meter-copy {
  align-items: center;
  color: var(--muted-strong);
  display: flex;
  font-size: 11px;
  font-weight: 850;
  gap: 12px;
  justify-content: space-between;
  line-height: 1.3;
}

.portal-loading-meter-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-loading-meter-copy strong {
  color: #fffaf2;
  font-size: 11px;
  font-weight: 950;
}

.portal-loading-tip {
  align-items: center;
  color: rgba(226, 195, 151, 0.92);
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  gap: 10px;
  line-height: 1.2;
  max-width: min(100%, 360px);
  text-shadow:
    0 0 18px rgba(216, 157, 74, 0.18),
    0 3px 12px rgba(0, 0, 0, 0.48);
}

.portal-loading-tip::before,
.portal-loading-tip::after {
  background: linear-gradient(90deg, transparent, rgba(216, 157, 74, 0.62));
  content: "";
  display: block;
  height: 1px;
  width: 46px;
}

.portal-loading-tip::after {
  background: linear-gradient(90deg, rgba(216, 157, 74, 0.62), transparent);
}

.portal-loading-retry {
  justify-self: center;
}

@media (max-width: 640px) {
  .portal-loading-panel {
    gap: 13px;
  }

  .portal-loading-copy h1 {
    font-size: 30px;
  }

  .portal-loading-tip {
    font-size: 11px;
    max-width: 330px;
  }

  .portal-loading-tip::before,
  .portal-loading-tip::after {
    width: 28px;
  }

  .portal-loading-meter {
    max-width: 330px;
  }
}

.portal-shell {
  --portal-active-sidebar-width: var(--portal-sidebar-width);
  --sidebar-toggle-top: max(12px, env(safe-area-inset-top));
  display: grid;
  grid-template-columns: var(--portal-active-sidebar-width) minmax(0, 1fr);
  min-height: 100vh;
  position: relative;
}

.portal-shell.sidebar-collapsed {
  --portal-active-sidebar-width: 0px;
}

.portal-shell.sidebar-collapsed .sheet-content {
  max-width: none;
}

.portal-shell.sidebar-collapsed .play-sheet {
  padding-left: max(42px, calc(30px + env(safe-area-inset-left)));
}

.portal-shell.sidebar-collapsed .panel-scroll-rail {
  --panel-scroll-sidebar: 0px;
}

.character-sidebar {
  align-self: start;
  background:
    linear-gradient(180deg, rgba(185, 128, 47, 0.08), transparent 38%),
    var(--sidebar);
  border-right: 1px solid var(--line-dark);
  color: #f8efe4;
  display: flex;
  flex-direction: column;
  gap: 16px;
  height: 100vh;
  height: 100dvh;
  max-height: 100vh;
  max-height: 100dvh;
  min-height: 100vh;
  min-width: 0;
  overflow: hidden;
  padding: 18px;
  position: sticky;
  top: 0;
}

.portal-shell.sidebar-collapsed .character-sidebar {
  border-right-color: transparent;
  opacity: 0;
  padding-left: 0;
  padding-right: 0;
  pointer-events: none;
  transform: translateX(-100%);
  width: 0;
}

.sidebar-toggle {
  align-items: center;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.11), rgba(255, 250, 242, 0.045)),
    rgba(13, 10, 14, 0.9);
  border: 1px solid rgba(226, 195, 151, 0.26);
  border-radius: 9px 0 0 9px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34), 0 0 18px rgba(216, 157, 74, 0.12);
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 86%, 0 100%);
  color: #fffaf2;
  cursor: pointer;
  display: inline-flex;
  height: 44px;
  justify-content: center;
  left: calc(var(--portal-active-sidebar-width) - 16px);
  overflow: hidden;
  padding: 0;
  position: fixed;
  top: var(--sidebar-toggle-top);
  touch-action: none;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, color .16s ease, transform .16s ease;
  user-select: none;
  width: 32px;
  z-index: 870;
}

.sidebar-toggle:hover,
.sidebar-toggle:focus-visible {
  background:
    linear-gradient(180deg, rgba(216, 157, 74, 0.24), rgba(255, 250, 242, 0.06)),
    rgba(13, 10, 14, 0.96);
  border-color: rgba(255, 214, 148, 0.5);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.4), 0 0 24px rgba(216, 157, 74, 0.22);
  color: #ffd694;
  outline: none;
}

.sidebar-toggle:active {
  transform: translateY(1px);
}

.sidebar-toggle.is-dragging {
  cursor: ns-resize;
  transform: none;
  transition: none;
}

.portal-shell.sidebar-collapsed .sidebar-toggle {
  border-radius: 0 9px 9px 0;
  left: max(0px, env(safe-area-inset-left));
}

.sidebar-toggle-icon {
  display: block;
  height: 100%;
  position: relative;
  width: 100%;
}

.sidebar-toggle-icon::before {
  border-color: currentColor;
  border-style: solid;
  border-width: 0 2px 2px 0;
  content: "";
  display: block;
  height: 8px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(135deg);
  width: 8px;
}

.portal-shell.sidebar-collapsed .sidebar-toggle-icon::before {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.brand {
  align-items: center;
  display: flex;
  gap: 12px;
  min-height: 50px;
}

.brand-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
  width: 100%;
}

.brand-title-row {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.brand-mark {
  height: 42px;
  object-fit: contain;
  width: 42px;
}

.brand-title {
  font-size: 18px;
  font-weight: 900;
  letter-spacing: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.brand-logout {
  border: 1px solid rgba(255, 250, 242, 0.16);
  border-radius: 999px;
  color: rgba(255, 250, 242, 0.78);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  padding: 7px 9px;
  text-decoration: none;
}

.brand-logout:hover,
.brand-logout:focus-visible {
  background: rgba(255, 250, 242, 0.08);
  border-color: rgba(216, 157, 74, 0.46);
  color: #fffaf2;
  outline: 0;
}

.brand-subtitle,
.eyebrow,
.kicker,
.muted {
  color: var(--muted);
}

.character-sidebar .brand-subtitle,
.character-sidebar .field span {
  color: rgba(248, 239, 228, 0.68);
}

.brand-subtitle {
  font-size: 12px;
  margin-top: 2px;
}

.field {
  display: grid;
  gap: 6px;
  margin: 0;
}

.field span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.input,
.select {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  line-height: 1.25;
  min-height: 40px;
  padding: 9px 10px;
  width: 100%;
}

.character-sidebar .select {
  background: rgba(255, 250, 242, 0.08);
  border-color: rgba(255, 250, 242, 0.16);
  color: #fffaf2;
}

.character-owner-group {
  background: rgba(255, 250, 242, 0.045);
  border: 1px solid rgba(255, 250, 242, 0.09);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 10px;
  width: 100%;
}

.character-owner-group header {
  min-width: 0;
}

.character-owner-toggle {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 2px 8px;
  grid-template-areas:
    "kicker icon"
    "name icon"
    "count icon";
  grid-template-columns: minmax(0, 1fr) 28px;
  padding: 0;
  text-align: left;
  width: 100%;
}

.character-owner-toggle:focus-visible {
  border-radius: 6px;
  outline: 2px solid rgba(var(--accent-rgb), 0.36);
  outline-offset: 4px;
}

.character-owner-kicker {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  grid-area: kicker;
  text-transform: uppercase;
}

.character-owner-name {
  color: #fffaf2;
  font-size: 13px;
  font-weight: 950;
  grid-area: name;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-owner-count {
  color: rgba(255, 250, 242, 0.54);
  font-size: 11px;
  font-style: normal;
  font-weight: 800;
  grid-area: count;
}

.character-owner-icon {
  align-self: center;
  border: 1px solid rgba(255, 250, 242, 0.16);
  border-radius: 999px;
  display: block;
  grid-area: icon;
  height: 28px;
  position: relative;
  width: 28px;
}

.character-owner-icon::before {
  border-bottom: 2px solid rgba(255, 250, 242, 0.72);
  border-right: 2px solid rgba(255, 250, 242, 0.72);
  content: "";
  height: 7px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -58%) rotate(45deg);
  transition: transform 0.14s ease;
  width: 7px;
}

.character-owner-group.is-collapsed .character-owner-icon::before {
  transform: translate(-42%, -50%) rotate(-45deg);
}

.character-owner-list {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.character-owner-list[hidden] {
  display: none;
}

.input:focus,
.select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(var(--accent-rgb), 0.18);
}

.field.is-invalid .input,
.field.is-invalid .select,
.field.is-invalid .textarea,
.ability-entry.is-invalid .input {
  border-color: var(--danger);
  outline: 2px solid rgba(184, 66, 60, 0.22);
}

.field-error {
  color: #ffb7af;
  display: block;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.35;
}

.btn {
  align-items: center;
  appearance: none;
  background: #251b20;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-flex;
  font-weight: 850;
  justify-content: center;
  min-height: 40px;
  overflow: hidden;
  padding: 8px 13px;
  position: relative;
  text-decoration: none;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
  white-space: nowrap;
}

.btn:hover {
  background: #35272e;
  border-color: var(--gold);
}

.btn.primary {
  background: var(--accent);
  border-color: var(--accent);
}

.btn.success {
  background: var(--success);
  border-color: var(--success);
}

.btn.danger {
  background: var(--danger);
  border-color: var(--danger);
}

.btn.ghost {
  background: rgba(255, 250, 242, 0.08);
  border-color: rgba(255, 250, 242, 0.16);
  color: #fffaf2;
}

.btn.small {
  font-size: 12px;
  min-height: 32px;
  padding: 6px 10px;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.52;
}

.btn.is-working {
  color: transparent !important;
  pointer-events: none;
}

.btn.is-working::after {
  animation: spin .75s linear infinite;
  border: 2px solid rgba(255, 255, 255, .45);
  border-radius: 999px;
  border-top-color: #fff;
  content: "";
  height: 15px;
  position: absolute;
  width: 15px;
}

.character-roster {
  display: grid;
  flex: 1 1 auto;
  gap: 9px;
  grid-template-rows: auto minmax(0, 1fr);
  min-height: 0;
}

.character-roster-head {
  padding: 0 2px;
}

.character-stack {
  align-content: start;
  align-items: start;
  display: grid;
  gap: 9px;
  grid-auto-rows: max-content;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.character-card {
  align-content: start;
  appearance: none;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), transparent 58%),
    rgba(255, 250, 242, 0.07);
  border: 1px solid rgba(255, 250, 242, 0.13);
  border-radius: 8px;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.16);
  color: #fffaf2;
  cursor: pointer;
  display: grid;
  gap: 8px 10px;
  min-height: 82px;
  padding: 10px;
  position: relative;
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease, box-shadow 0.14s ease, transform 0.12s ease;
  width: 100%;
}

.character-profile-card {
  align-items: center;
  grid-template-columns: 50px minmax(0, 1fr);
}

.character-card:hover,
.character-card:focus-visible,
.character-card.active {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.26), rgba(216, 157, 74, 0.08)),
    rgba(255, 250, 242, 0.09);
  border-color: rgba(216, 157, 74, 0.58);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.24);
  outline: none;
  transform: translateY(-1px);
}

.character-card.discord-active {
  border-color: rgba(85, 184, 120, 0.7);
  box-shadow:
    inset 0 0 0 1px rgba(85, 184, 120, 0.36),
    inset 3px 0 0 var(--success),
    0 10px 24px rgba(0, 0, 0, 0.2);
}

.character-card-avatar {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 8px;
  height: 50px;
  object-fit: cover;
  width: 50px;
}

.character-card-avatar.avatar-shape-circle {
  border-radius: 50%;
}

.character-card-avatar.fallback {
  align-items: center;
  color: var(--gold);
  display: inline-flex;
  font-size: 23px;
  font-weight: 950;
  justify-content: center;
}

.character-card-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.character-card-server {
  background: rgba(255, 250, 242, 0.07);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 999px;
  color: rgba(255, 250, 242, 0.66);
  font-size: 11px;
  font-weight: 760;
  grid-column: 1 / -1;
  justify-self: start;
  line-height: 1.2;
  max-width: 100%;
  padding: 4px 8px;
}

.character-card.pending-card {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.16), transparent 58%),
    rgba(255, 250, 242, 0.07);
  border-color: rgba(216, 157, 74, 0.46);
  box-shadow: inset 3px 0 0 var(--gold);
  cursor: default;
}

.character-card.pending-card:hover {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.18), transparent 58%),
    rgba(255, 250, 242, 0.08);
  transform: none;
}

.character-card.rejected-pending-card {
  border-color: rgba(216, 88, 82, 0.58);
  box-shadow: inset 3px 0 0 var(--danger);
}

.character-card.rejected-pending-card strong {
  color: #ffd2cc;
}

.character-card.rejected-pending-card:hover {
  background:
    linear-gradient(135deg, rgba(216, 88, 82, 0.18), transparent 58%),
    rgba(255, 250, 242, 0.08);
}

.pending-dismiss-btn {
  align-self: end;
  appearance: none;
  background: rgba(216, 88, 82, 0.16);
  border: 1px solid rgba(216, 88, 82, 0.42);
  border-radius: 7px;
  color: #ffd2cc;
  cursor: pointer;
  font: inherit;
  font-size: 11px;
  font-weight: 950;
  justify-self: start;
  line-height: 1;
  min-height: 28px;
  padding: 7px 10px;
  text-transform: uppercase;
}

.pending-dismiss-btn:hover,
.pending-dismiss-btn:focus-visible {
  background: rgba(216, 88, 82, 0.28);
  border-color: rgba(216, 88, 82, 0.72);
  outline: none;
}

.character-card.editable-pending-card {
  cursor: pointer;
}

.character-card.editable-pending-card:hover {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.22), transparent 58%),
    rgba(255, 250, 242, 0.08);
  border-color: rgba(216, 157, 74, 0.72);
}

.character-profile-card .pending-dismiss-btn {
  grid-column: 2;
}

.character-card-copy strong,
.character-card-copy span,
.character-card-copy em,
.character-card-server,
.character-card.create-card span,
.character-card.create-card em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.character-card-copy strong {
  font-size: 15px;
  font-weight: 950;
  line-height: 1.1;
}

.character-card-copy span,
.character-card-copy em,
.character-card.create-card span,
.character-card.create-card em {
  color: rgba(248, 239, 228, 0.68);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.2;
}

.character-card.create-card {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.15), transparent 58%),
    rgba(255, 250, 242, 0.055);
  border-color: rgba(216, 157, 74, 0.36);
  border-style: dashed;
  color: var(--gold);
  column-gap: 10px;
  grid-template-columns: 50px minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-height: 74px;
}

.character-card.create-card strong {
  align-items: center;
  background: rgba(216, 157, 74, 0.13);
  border: 1px solid rgba(216, 157, 74, 0.32);
  border-radius: 999px;
  display: inline-flex;
  font-size: 24px;
  grid-row: 1 / 3;
  height: 38px;
  justify-content: center;
  line-height: 1;
  width: 38px;
}

.character-card.create-card span {
  color: #fffaf2;
  font-size: 14px;
  font-weight: 950;
}

.vendor-shelf {
  border-top: 1px solid rgba(255, 250, 242, 0.11);
  display: grid;
  flex: 0 0 auto;
  gap: 6px;
  max-height: 106px;
  min-height: 0;
  padding-top: 8px;
}

.vehicle-shelf {
  border-top-color: rgba(114, 211, 190, 0.18);
}

.sidebar-section-head {
  align-items: baseline;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.sidebar-section-head span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.sidebar-section-head strong {
  color: rgba(255, 250, 242, 0.64);
  font-size: 12px;
  font-weight: 850;
}

.vendor-stack {
  display: grid;
  gap: 5px;
  max-height: 72px;
  min-height: 0;
  overflow-y: auto;
  padding-right: 3px;
  scrollbar-gutter: stable;
}

.character-card.vendor-card {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.14), transparent 58%),
    rgba(255, 250, 242, 0.08);
  min-height: 76px;
}

.vendor-shelf .character-card.vendor-card {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.11), transparent 62%),
    rgba(255, 250, 242, 0.052);
  box-shadow: none;
  gap: 2px 8px;
  grid-template-columns: 34px minmax(0, 1fr);
  grid-template-rows: auto auto;
  min-height: 50px;
  padding: 7px 8px;
}

.vendor-shelf .character-card.vendor-card::before {
  align-items: center;
  align-self: center;
  background: rgba(216, 157, 74, 0.13);
  border: 1px solid rgba(216, 157, 74, 0.34);
  border-radius: 7px;
  color: var(--gold);
  content: "NPC";
  display: inline-flex;
  font-size: 10px;
  font-weight: 950;
  grid-row: 1 / 3;
  height: 32px;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  width: 32px;
}

.character-card.vendor-card strong::before {
  color: var(--gold);
  content: "NPC";
  display: block;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  margin-bottom: 3px;
}

.vendor-shelf .character-card.vendor-card strong::before {
  content: none;
  display: none;
}

.vendor-shelf .character-card.vendor-card strong,
.vendor-shelf .character-card.vendor-card span,
.vendor-shelf .character-card.vendor-card em {
  grid-column: 2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vendor-shelf .character-card.vendor-card strong {
  color: #fffaf2;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.12;
}

.vendor-shelf .character-card.vendor-card span,
.vendor-shelf .character-card.vendor-card em {
  color: rgba(255, 250, 242, 0.64);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.2;
}

.vendor-shelf .character-card.vendor-card em {
  display: none;
}

.character-card.vehicle-card {
  background:
    linear-gradient(135deg, rgba(114, 211, 190, 0.16), transparent 58%),
    rgba(255, 250, 242, 0.08);
}

.vendor-shelf .character-card.vehicle-card {
  background:
    linear-gradient(135deg, rgba(114, 211, 190, 0.12), transparent 62%),
    rgba(255, 250, 242, 0.052);
}

.vendor-shelf .character-card.vehicle-card::before {
  background: rgba(114, 211, 190, 0.12);
  border-color: rgba(114, 211, 190, 0.34);
  color: #72d3be;
  content: "VEH";
}

.character-card.vehicle-card strong::before {
  color: #72d3be;
  content: "VEH";
}

.vendor-shelf .character-card.vehicle-card strong::before {
  content: none;
  display: none;
}

.sidebar-resource-hub {
  border-top: 1px solid rgba(255, 250, 242, 0.11);
  display: grid;
  flex: 0 0 auto;
  gap: 7px;
  padding-top: 8px;
}

.sidebar-resource-grid {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sidebar-resource-button {
  appearance: none;
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.12), transparent 60%),
    rgba(255, 250, 242, 0.06);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  color: #fffaf2;
  cursor: pointer;
  display: grid;
  gap: 2px;
  min-height: 62px;
  padding: 8px;
  text-align: left;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.12s ease;
}

.sidebar-resource-button span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.sidebar-resource-button strong,
.sidebar-resource-button em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-resource-button strong {
  font-size: 13px;
  font-weight: 950;
  line-height: 1.15;
}

.sidebar-resource-button em {
  color: rgba(255, 250, 242, 0.64);
  font-size: 11px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.2;
}

.sidebar-resource-button b {
  color: #fffaf2;
  font-weight: 950;
}

.sidebar-resource-button:hover,
.sidebar-resource-button:focus-visible,
.sidebar-resource-button.active {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.22), transparent 60%),
    rgba(255, 250, 242, 0.08);
  border-color: rgba(216, 157, 74, 0.5);
  outline: none;
  transform: translateY(-1px);
}

.sidebar-resource-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  transform: none;
}

.sidebar-resource-button.vehicle-resource {
  background:
    linear-gradient(135deg, rgba(114, 211, 190, 0.12), transparent 60%),
    rgba(255, 250, 242, 0.06);
}

.sidebar-resource-button.vehicle-resource span {
  color: #72d3be;
}

.sidebar-resource-button.vehicle-resource:hover,
.sidebar-resource-button.vehicle-resource:focus-visible,
.sidebar-resource-button.vehicle-resource.active {
  background:
    linear-gradient(135deg, rgba(114, 211, 190, 0.2), transparent 60%),
    rgba(255, 250, 242, 0.08);
  border-color: rgba(114, 211, 190, 0.5);
}

.sidebar-resource-wide {
  grid-column: 1 / -1;
  min-height: 68px;
}

.sidebar-resource-button.codex-resource {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.13), rgba(89, 179, 160, 0.08) 58%, transparent),
    rgba(255, 250, 242, 0.06);
}

.sidebar-resource-button.codex-resource span {
  color: #f0c66a;
}

.sidebar-resource-button.codex-resource:hover,
.sidebar-resource-button.codex-resource:focus-visible,
.sidebar-resource-button.codex-resource.active {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.24), rgba(89, 179, 160, 0.14) 62%, transparent),
    rgba(255, 250, 242, 0.08);
  border-color: rgba(240, 198, 106, 0.55);
}

.sidebar-footer {
  display: grid;
  gap: 8px;
  margin-top: auto;
}

.mobile-hero-bar,
.mobile-hero-drawer,
.return-character-btn {
  display: none;
}

.mobile-drawer-open {
  overflow: hidden;
}

@media (min-width: 921px) {
  .mobile-hero-drawer:not(.hidden) {
    align-items: start;
    display: grid;
    inset: 0 0 0 var(--portal-sidebar-width);
    padding: 22px;
    position: fixed;
    z-index: 840;
  }

  .portal-shell.sidebar-collapsed .mobile-hero-drawer:not(.hidden) {
    inset-left: 0;
  }

  .mobile-hero-drawer-backdrop {
    background: rgba(0, 0, 0, 0.42);
    inset: 0;
    position: absolute;
  }

  .mobile-hero-drawer-panel {
    background:
      linear-gradient(180deg, rgba(var(--accent-rgb), 0.12), transparent 36%),
      rgba(20, 15, 18, 0.98);
    border: 1px solid rgba(255, 250, 242, 0.17);
    border-radius: 8px;
    box-shadow: var(--shadow);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    justify-self: start;
    max-height: min(82dvh, 720px);
    overflow: hidden;
    position: relative;
    width: min(520px, calc(100vw - var(--portal-sidebar-width) - 44px));
  }

  .portal-shell.sidebar-collapsed .mobile-hero-drawer-panel {
    width: min(520px, calc(100vw - 44px));
  }

  .mobile-hero-drawer-head {
    align-items: center;
    border-bottom: 1px solid rgba(255, 250, 242, 0.12);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px;
  }

  .mobile-hero-drawer-head h2 {
    font-size: 20px;
    font-weight: 950;
    line-height: 1.1;
  }

  .mobile-hero-drawer-body {
    display: grid;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 12px 12px;
  }

  .mobile-drawer-card-stack {
    display: grid;
    gap: 8px;
    min-width: 0;
  }
}

.install-prompt {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.18), rgba(216, 157, 74, 0.08)),
    rgba(255, 250, 242, 0.07);
  border: 1px solid rgba(216, 157, 74, 0.34);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 10px;
  padding: 12px;
}

.install-kicker {
  color: var(--gold);
  display: block;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.install-prompt strong {
  display: block;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.25;
  margin-top: 3px;
}

.install-prompt p {
  color: rgba(248, 239, 228, 0.74);
  font-size: 12px;
  line-height: 1.35;
  margin-top: 4px;
}

.install-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.play-sheet {
  padding: 20px;
}

.sheet-content {
  display: grid;
  gap: 14px;
  margin: 0 auto;
  max-width: 1440px;
}

.sheet-content.codex-mode {
  max-width: none;
}

.play-sheet:has(.sheet-content.codex-mode) {
  padding-left: clamp(8px, 1vw, 12px);
  padding-right: clamp(8px, 1vw, 12px);
}

.portal-shell.sidebar-collapsed .play-sheet:has(.sheet-content.codex-mode) {
  padding-left: max(42px, calc(30px + env(safe-area-inset-left)));
}

.sheet-hero {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.92), rgba(var(--accent-deep-rgb), 0.98) 58%),
    var(--accent-deep);
  border: 1px solid rgba(185, 128, 47, 0.48);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #fffaf2;
  display: grid;
  gap: 18px;
  grid-template-columns: auto minmax(0, 1fr) minmax(404px, 488px);
  min-height: 132px;
  padding: 18px;
  position: relative;
}

.hero-settings {
  display: block;
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 8;
}

.vendor-mode .hero-settings,
.vehicle-mode .hero-settings,
.codex-mode .hero-settings {
  display: none;
}

.codex-mode .sheet-hero,
.codex-mode .sheet-compass,
.codex-mode .sheet-progress {
  display: none;
}

.codex-sticky-header {
  --codex-header-accent: #f0c66a;
  --codex-header-accent-rgb: 240, 198, 106;
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.08), rgba(255, 250, 242, 0.024)),
    linear-gradient(90deg, rgba(89, 179, 160, 0.12), rgba(240, 198, 106, 0.08) 46%, rgba(125, 148, 214, 0.1)),
    rgba(17, 13, 16, 0.88);
  backdrop-filter: blur(18px);
  border: 1px solid rgba(var(--codex-header-accent-rgb), 0.28);
  border-radius: 8px;
  box-shadow:
    0 16px 34px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(255, 250, 242, 0.1);
  color: #fffaf2;
  display: none;
  gap: 10px;
  grid-template-columns: 98px minmax(0, 1fr) 98px;
  isolation: isolate;
  min-height: 66px;
  padding: 8px;
  position: sticky;
  top: 0;
  top: env(safe-area-inset-top, 0px);
  z-index: 48;
}

.sheet-content.codex-mode .codex-sticky-header {
  display: grid;
}

.sheet-content.codex-mode .sheet-page.codex-page {
  align-content: start;
  min-height: calc(100dvh - 104px - env(safe-area-inset-top, 0px));
  padding-top: clamp(18px, 3vh, 42px);
}

.codex-sticky-header::before,
.codex-sticky-header::after {
  content: "";
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.codex-sticky-header::before {
  background:
    linear-gradient(90deg, transparent, rgba(var(--codex-header-accent-rgb), 0.34), transparent),
    repeating-linear-gradient(90deg, transparent 0 18px, rgba(255, 250, 242, 0.035) 18px 19px);
  bottom: 0;
  height: 1px;
  left: 12px;
  right: 12px;
}

.codex-sticky-header::after {
  background: linear-gradient(180deg, rgba(17, 13, 16, 0.62), rgba(17, 13, 16, 0));
  height: 22px;
  left: 18px;
  opacity: .8;
  right: 18px;
  top: calc(100% - 3px);
}

.codex-sticky-header > * {
  position: relative;
  z-index: 1;
}

.codex-header-back,
.codex-index-btn {
  align-items: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.07);
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 7px;
  color: #fffaf2;
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  gap: 8px;
  justify-content: center;
  line-height: 1;
  min-height: 48px;
  min-width: 76px;
  padding: 0 12px;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
  white-space: nowrap;
}

.codex-header-back {
  justify-self: start;
}

.codex-header-back strong,
.codex-index-btn strong {
  display: block;
  max-width: 112px;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-header-back:hover,
.codex-header-back:focus-visible,
.codex-index-btn:hover,
.codex-index-btn:focus-visible,
.codex-index-btn[aria-expanded="true"] {
  background: rgba(var(--codex-header-accent-rgb), 0.16);
  border-color: rgba(var(--codex-header-accent-rgb), 0.5);
  outline: none;
}

.codex-header-back span {
  border-color: currentColor;
  border-style: solid;
  border-width: 0 2px 2px 0;
  display: block;
  height: 9px;
  transform: translateX(2px) rotate(135deg);
  width: 9px;
}

.codex-header-brand {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(var(--codex-header-accent-rgb), 0.2), rgba(89, 179, 160, 0.12)),
    rgba(255, 250, 242, 0.055);
  border: 1px solid rgba(var(--codex-header-accent-rgb), 0.34);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.04);
  display: none;
  height: 48px;
  place-items: center;
  width: 48px;
}

.codex-header-brand span {
  border: 2px solid rgba(var(--codex-header-accent-rgb), 0.92);
  border-radius: 4px 6px 6px 4px;
  display: block;
  height: 25px;
  position: relative;
  width: 30px;
}

.codex-header-brand span::before {
  background: rgba(var(--codex-header-accent-rgb), 0.82);
  border-radius: 999px;
  bottom: 3px;
  content: "";
  left: 7px;
  position: absolute;
  top: 3px;
  width: 2px;
}

.codex-header-brand span::after {
  background: linear-gradient(180deg, rgba(255, 250, 242, 0.56), rgba(255, 250, 242, 0));
  border-radius: 3px;
  content: "";
  height: 1px;
  left: 12px;
  position: absolute;
  right: 4px;
  top: 7px;
}

.codex-header-copy {
  display: grid;
  gap: 3px;
  justify-items: center;
  min-width: 0;
  text-align: center;
}

.codex-header-copy span {
  color: rgba(var(--codex-header-accent-rgb), 0.86);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.codex-header-copy strong {
  color: #fffaf2;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.05;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-header-copy em {
  color: rgba(255, 250, 242, 0.64);
  display: none;
  font-size: 12px;
  font-style: normal;
  font-weight: 820;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.codex-header-index {
  align-items: center;
  display: flex;
  gap: .55rem;
  justify-self: end;
  position: relative;
}

.codex-read-all-btn {
  background: rgba(8, 6, 10, 0.5);
  border: 1px solid rgba(var(--codex-header-accent-rgb), 0.34);
  border-radius: 999px;
  color: rgba(255, 248, 226, 0.92);
  cursor: pointer;
  font: 850 .66rem/1 var(--font-ui, inherit);
  letter-spacing: .08em;
  min-height: 2.45rem;
  padding: 0 .95rem;
  position: relative;
  text-transform: uppercase;
  white-space: nowrap;
}

.codex-read-all-btn:hover,
.codex-read-all-btn:focus-visible {
  background: rgba(var(--codex-header-accent-rgb), 0.16);
  border-color: rgba(var(--codex-header-accent-rgb), 0.52);
  outline: none;
}

.codex-read-all-btn:disabled {
  cursor: default;
  opacity: .42;
}

.codex-index-btn span {
  border: 2px solid currentColor;
  border-left-width: 3px;
  border-radius: 3px 5px 5px 3px;
  display: block;
  height: 18px;
  position: relative;
  width: 15px;
}

.codex-index-btn span::before {
  background: currentColor;
  border-radius: 999px;
  box-shadow: 0 5px 0 currentColor;
  content: "";
  height: 2px;
  left: 5px;
  opacity: .9;
  position: absolute;
  right: 3px;
  top: 4px;
}

.codex-index-btn span::after {
  background: currentColor;
  border-radius: 999px;
  bottom: 3px;
  content: "";
  opacity: .75;
  position: absolute;
  right: 3px;
  top: 3px;
  width: 2px;
}

.codex-quick-menu {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.065), rgba(255, 250, 242, 0.018)),
    rgba(15, 11, 15, 0.97);
  border: 1px solid rgba(var(--codex-header-accent-rgb), 0.32);
  border-radius: 8px;
  box-shadow:
    0 22px 58px rgba(0, 0, 0, 0.54),
    inset 0 1px 0 rgba(255, 250, 242, 0.08);
  display: grid;
  gap: 12px;
  max-height: min(72dvh, 620px);
  min-width: min(560px, calc(100vw - 34px));
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 12px;
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  width: min(640px, calc(100vw - 34px));
  z-index: 55;
}

.codex-quick-menu.hidden {
  display: none;
}

.codex-quick-menu section {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  min-width: 0;
}

.codex-quick-menu section > span {
  color: rgba(var(--codex-header-accent-rgb), 0.8);
  font-size: 10px;
  font-weight: 950;
  grid-column: 1 / -1;
  line-height: 1;
  text-transform: uppercase;
}

.codex-quick-menu button {
  align-items: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.052);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  color: #fffaf2;
  cursor: pointer;
  display: grid;
  gap: 3px;
  justify-items: start;
  min-height: 48px;
  min-width: 0;
  padding: 9px 10px;
  text-align: left;
}

.codex-quick-menu button em {
  color: rgba(89, 179, 160, 0.86);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.codex-quick-menu button strong {
  color: #fffaf2;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.codex-quick-menu button:hover,
.codex-quick-menu button:focus-visible,
.codex-quick-menu button.active {
  background: rgba(var(--codex-header-accent-rgb), 0.13);
  border-color: rgba(var(--codex-header-accent-rgb), 0.42);
  outline: none;
}

@media (max-width: 760px) {
  .sheet-content.codex-mode .sheet-page.codex-page {
    min-height: calc(100dvh - 140px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    padding-top: clamp(14px, 3vh, 30px);
  }

  .codex-sticky-header {
    gap: 8px;
    grid-template-columns: auto minmax(0, 1fr) auto;
    min-height: 58px;
    padding: 6px;
  }

  .codex-header-brand {
    display: none;
  }

  .codex-header-back,
  .codex-index-btn,
  .codex-read-all-btn {
    gap: 6px;
    min-height: 44px;
    padding: 0 10px;
  }

  .codex-header-copy strong {
    font-size: 17px;
  }

  .codex-header-copy em {
    font-size: 11px;
  }

  .codex-quick-menu {
    max-height: calc(100dvh - 82px - env(safe-area-inset-top, 0px) - env(safe-area-inset-bottom, 0px));
    right: -6px;
    top: calc(100% + 8px);
  }
}

@media (max-width: 520px) {
  .codex-sticky-header {
    grid-template-columns: 42px minmax(0, 1fr) auto;
  }

  .codex-header-back,
  .codex-index-btn {
    gap: 0;
    min-height: 42px;
    min-width: 42px;
    padding: 0;
    width: 42px;
  }

  .codex-header-index {
    gap: 6px;
  }

  .codex-read-all-btn {
    font-size: 9px;
    letter-spacing: .06em;
    min-height: 42px;
    padding: 0 8px;
  }

  .codex-header-back strong,
  .codex-index-btn strong,
  .codex-header-copy em {
    display: none;
  }

  .codex-header-copy {
    gap: 2px;
  }

  .codex-header-copy strong {
    font-size: 16px;
  }

  .codex-quick-menu {
    min-width: calc(100vw - 24px);
    padding: 10px;
    right: -6px;
    width: calc(100vw - 24px);
  }

  .codex-quick-menu section {
    grid-template-columns: minmax(0, 1fr);
  }
}

.hero-settings-button {
  align-items: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.14);
  border: 1px solid rgba(255, 250, 242, 0.24);
  border-radius: 999px;
  color: #fffaf2;
  cursor: pointer;
  display: inline-flex;
  font-size: 18px;
  font-weight: 950;
  height: 40px;
  justify-content: center;
  line-height: 1;
  overflow: hidden;
  padding: 0;
  width: 40px;
}

.hero-settings-icon {
  display: block;
  height: 20px;
  fill: none;
  pointer-events: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  vector-effect: non-scaling-stroke;
  width: 20px;
}

.hero-settings-button:hover,
.hero-settings-button[aria-expanded="true"],
.hero-settings-button:focus-visible {
  background: rgba(255, 250, 242, 0.22);
  border-color: rgba(255, 250, 242, 0.46);
  outline: none;
}

@media (min-width: 1221px) {
  .hero-settings {
    grid-column: 3;
    grid-row: 1;
    inset: 0 auto auto 0;
  }
}

.sheet-hero.combat-turn {
  border-color: rgba(255, 215, 128, 0.88);
  box-shadow:
    0 0 0 3px rgba(255, 215, 128, 0.22),
    0 18px 46px rgba(0, 0, 0, 0.34),
    0 0 34px rgba(216, 157, 74, 0.2);
}

.turn-badge {
  align-items: center;
  background: rgba(255, 250, 242, 0.15);
  border: 1px solid rgba(255, 215, 128, 0.55);
  border-radius: 8px;
  color: #fff5cf;
  display: inline-flex;
  font-size: 11px;
  font-weight: 950;
  justify-self: start;
  line-height: 1;
  min-height: 26px;
  padding: 6px 9px;
  text-transform: uppercase;
}

.vendor-mode .hero-trackers,
.vendor-mode .hero-conditions,
.vendor-mode .hero-actions,
.vendor-mode .hp-popover,
.vehicle-mode .hero-trackers,
.vehicle-mode .hero-conditions,
.vehicle-mode .hero-actions,
.vehicle-mode .hp-popover,
.codex-mode .hero-trackers,
.codex-mode .hero-conditions,
.codex-mode .hero-actions,
.codex-mode .hp-popover {
  display: none;
}

.vendor-mode .hero-side,
.vehicle-mode .hero-side,
.codex-mode .hero-side {
  --hero-control-grid: repeat(3, minmax(0, 1fr));
  padding-left: 0;
}

.vendor-mode .hero-stats,
.vehicle-mode .hero-stats,
.codex-mode .hero-stats {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.vendor-mode #heroHpButton,
.vehicle-mode #heroHpButton,
.codex-mode #heroHpButton {
  cursor: default;
  pointer-events: none;
}

.portrait-frame {
  --hero-token-border-accent: #000000;
  --hero-token-border-primary: #050505;
  --hero-token-border-secondary: #1A1A1A;
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid rgba(255, 250, 242, 0.2);
  border-radius: 8px;
  box-shadow: none;
  height: 96px;
  overflow: visible;
  position: relative;
  width: 96px;
}

.portrait-frame.avatar-shape-circle {
  border-radius: 50%;
}

.portrait-frame.token-border-active {
  border-color: var(--hero-token-border-primary);
  border-width: 2px;
  box-shadow:
    0 0 0 2px color-mix(in srgb, var(--hero-token-border-secondary), transparent 24%),
    0 0 0 4px color-mix(in srgb, var(--hero-token-border-accent), transparent 10%);
}

.portrait-frame.token-border-active::before,
.portrait-frame.token-border-active::after {
  content: none;
}

.portrait-frame.token-border-active::before {
  display: none;
}

.portrait-frame.token-border-active::after {
  display: none;
}

.portrait-frame.token-border-image-active {
  border-color: transparent;
  border-width: 0;
  box-shadow: none;
}

.hero-token-border-image {
  height: calc(100% * var(--hero-token-border-image-scale, 1.5));
  left: calc(50% + var(--hero-token-border-image-offset-x, 0%));
  object-fit: contain;
  pointer-events: none;
  position: absolute;
  top: calc(50% + var(--hero-token-border-image-offset-y, 0%));
  transform: translate(-50%, -50%);
  width: calc(100% * var(--hero-token-border-image-scale, 1.5));
  z-index: 4;
}

.portrait {
  border-radius: inherit;
  height: 100%;
  object-fit: cover;
  position: relative;
  width: 100%;
  z-index: 1;
}

.hero-copy {
  display: grid;
  gap: 6px;
}

.eyebrow,
.kicker {
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.sheet-hero .eyebrow,
.sheet-hero .hero-meta {
  color: rgba(255, 250, 242, 0.72);
}

.hero-copy h1 {
  font-size: clamp(28px, 5vw, 54px);
  font-weight: 950;
  line-height: .95;
  overflow-wrap: anywhere;
}

.hero-meta {
  color: var(--muted);
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.hero-side {
  --hero-control-gap: 8px;
  --hero-control-grid: repeat(3, minmax(0, 1fr));
  --hero-side-offset: 48px;
  align-content: center;
  display: grid;
  gap: var(--hero-control-gap);
  margin-right: 0;
  padding-left: var(--hero-side-offset);
}

.hero-stats {
  display: grid;
  gap: var(--hero-control-gap);
  grid-template-columns: var(--hero-control-grid);
}

.hero-stats > .hero-hp-wrap {
  display: grid;
}

.hero-stats > .hero-stat,
.hero-stats .hero-hp-wrap > .hero-stat {
  min-height: 0;
}

.hero-hp-wrap {
  min-width: 0;
  position: relative;
}

.hero-trackers {
  display: grid;
  gap: var(--hero-control-gap);
  grid-template-columns: var(--hero-control-grid);
}

.hero-tracker {
  align-items: center;
  background: rgba(255, 250, 242, 0.075);
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 2px 7px;
  grid-template-areas:
    "label label"
    "value action";
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 42px;
  min-width: 0;
  padding: 6px 7px 6px 8px;
}

.hero-tracker.no-action {
  grid-template-areas:
    "label"
    "value";
  grid-template-columns: minmax(0, 1fr);
}

.hero-tracker span {
  color: rgba(255, 250, 242, 0.64);
  font-size: 10px;
  grid-area: label;
  font-weight: 950;
  min-width: 0;
  overflow: visible;
  text-transform: uppercase;
  white-space: nowrap;
}

.hero-tracker strong {
  color: #fffaf2;
  font-size: 15px;
  grid-area: value;
  font-weight: 950;
  line-height: 1;
}

.hero-tracker .btn {
  grid-area: action;
}

.hero-conditions {
  display: grid;
  gap: var(--hero-control-gap);
}

.conditions-wrap {
  display: grid;
  gap: var(--hero-control-gap);
  min-width: 0;
  position: relative;
}

.hero-condition-controls {
  display: grid;
  gap: var(--hero-control-gap);
  grid-template-columns: var(--hero-control-grid);
}

.condition-trigger {
  grid-column: 1;
}

.condition-trigger {
  align-items: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.1);
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 2px;
  min-height: 40px;
  min-width: 0;
  padding: 7px 9px;
  text-align: left;
  touch-action: manipulation;
  width: 100%;
  -webkit-tap-highlight-color: transparent;
}

.condition-trigger:hover,
.condition-trigger[aria-expanded="true"] {
  background: rgba(255, 250, 242, 0.14);
  border-color: rgba(255, 250, 242, 0.32);
}

.condition-trigger:focus-visible,
.condition-toggle:focus-visible,
.death-save-strip:focus-visible {
  outline: 2px solid rgba(255, 250, 242, 0.76);
  outline-offset: 2px;
}

.condition-trigger span {
  color: rgba(255, 250, 242, 0.64);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.condition-trigger strong {
  color: #fffaf2;
  font-size: 12px;
  font-weight: 950;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.condition-popover {
  background: rgba(22, 17, 18, 0.98);
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #fffaf2;
  display: grid;
  gap: 10px;
  padding: 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(520px, calc(100vw - 40px));
  z-index: 45;
}

.condition-popover-head {
  align-items: end;
  border-bottom: 1px solid rgba(255, 250, 242, 0.12);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding-bottom: 8px;
}

.condition-popover-head strong {
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.condition-popover-head span {
  color: rgba(255, 250, 242, 0.58);
  font-size: 11px;
  font-weight: 850;
}

.condition-toggle-list {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(116px, 1fr));
  max-height: 252px;
  overflow-y: auto;
  padding-right: 2px;
}

.condition-toggle {
  align-items: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.07);
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 7px;
  color: var(--muted-strong);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-size: 11px;
  font-weight: 950;
  justify-content: center;
  line-height: 1.1;
  min-height: 32px;
  padding: 6px 8px;
  text-align: center;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.condition-toggle:hover {
  background: rgba(255, 250, 242, 0.12);
  color: #fffaf2;
}

.condition-toggle.active {
  background: rgba(216, 88, 82, 0.18);
  border-color: rgba(216, 88, 82, 0.5);
  color: #fffaf2;
  box-shadow: inset 0 0 0 1px rgba(216, 88, 82, 0.18);
}

.condition-custom-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.death-save-wrap {
  display: grid;
  grid-column: 2 / 4;
  min-width: 0;
  position: relative;
}

.death-save-strip {
  align-items: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.1);
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 8px;
  color: inherit;
  cursor: pointer;
  display: grid;
  font: inherit;
  gap: 8px;
  grid-template-columns: auto minmax(max-content, 1fr) auto;
  min-height: 40px;
  min-width: 0;
  padding: 6px 8px;
  width: 100%;
}

.death-save-strip:hover,
.death-save-strip[aria-expanded="true"] {
  background: rgba(255, 250, 242, 0.14);
  border-color: rgba(255, 250, 242, 0.32);
}

.death-save-pips {
  align-items: center;
  display: flex;
  gap: 6px;
  justify-content: center;
}

.death-save-pip {
  background: rgba(255, 250, 242, 0.08);
  border: 1px solid rgba(255, 250, 242, 0.2);
  border-radius: 999px;
  display: block;
  height: 13px;
  width: 13px;
}

.death-save-pip.failure.active {
  background: var(--danger);
  border-color: rgba(255, 160, 154, 0.72);
  box-shadow: 0 0 10px rgba(216, 88, 82, 0.32);
}

.death-save-pip.success.active {
  background: var(--success);
  border-color: rgba(141, 218, 157, 0.72);
  box-shadow: 0 0 10px rgba(71, 177, 104, 0.3);
}

.death-save-label {
  color: rgba(255, 250, 242, 0.78);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  text-align: center;
  text-transform: uppercase;
}

.death-save-popover {
  background: rgba(22, 17, 18, 0.98);
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
  box-sizing: border-box;
  color: #fffaf2;
  display: grid;
  gap: 9px;
  padding: 10px;
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(310px, calc(100vw - 40px));
  z-index: 45;
}

.death-save-popover > span {
  color: rgba(255, 250, 242, 0.72);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.3;
}

.death-save-menu-actions {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.death-save-menu-actions .btn {
  min-width: 0;
  min-height: 34px;
  padding-inline: 8px;
  width: 100%;
}

.compact-select,
.compact-input {
  min-height: 32px;
  padding: 6px 8px;
}

.condition-list.compact {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.condition-list.compact .condition-card {
  align-items: center;
  background: rgba(255, 250, 242, 0.075);
  border-color: rgba(255, 250, 242, 0.14);
  border-left-width: 2px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 30px;
  min-width: 0;
  padding: 5px 6px;
}

.condition-list.compact .condition-card span {
  display: none;
}

.condition-list.compact .condition-card strong {
  color: #fffaf2;
  font-size: 11px;
  line-height: 1.15;
}

.condition-list.compact .condition-remove {
  display: inline-grid;
  font-size: 0;
  min-height: 22px;
  padding: 0;
  place-items: center;
  position: relative;
  width: 22px;
}

.condition-list.compact .condition-remove::before,
.condition-list.compact .condition-remove::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 2px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 10px;
}

.condition-list.compact .condition-remove::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

@media (pointer: coarse) {
  .condition-toggle {
    min-height: 40px;
    padding: 9px 10px;
  }

  .condition-list.compact .condition-remove {
    min-height: 32px;
    width: 32px;
  }
}

.condition-empty {
  color: rgba(255, 250, 242, 0.56);
  font-size: 11px;
  font-weight: 850;
}

.hero-actions {
  display: flex;
  justify-content: flex-end;
}

.icon-btn {
  min-width: 38px;
  padding: 0;
}

.hero-actions .btn {
  min-height: 32px;
  padding-inline: 14px;
}

.btn.micro {
  border-radius: 7px;
  font-size: 10px;
  min-height: 24px;
  padding: 3px 7px;
}

.hero-stat,
.stat-card,
.summary-cell {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px;
}

.sheet-hero .hero-stat {
  background: rgba(255, 250, 242, 0.1);
  border-color: rgba(255, 250, 242, 0.18);
}

.hero-combat-stat {
  gap: 0;
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  padding: 0;
}

.hero-combat-stat-item {
  align-content: center;
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px;
}

.hero-initiative-stat {
  border-left: 1px solid rgba(255, 250, 242, 0.12);
  display: none;
}

.sheet-content:not(.vendor-mode):not(.vehicle-mode):not(.codex-mode) .hero-combat-stat {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sheet-content:not(.vendor-mode):not(.vehicle-mode):not(.codex-mode) .hero-initiative-stat {
  display: grid;
}

.hp-trigger {
  appearance: none;
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
  width: 100%;
}

.hp-trigger:hover,
.hp-trigger[aria-expanded="true"] {
  background: rgba(255, 250, 242, 0.14);
  border-color: rgba(255, 250, 242, 0.32);
}

.hp-trigger:focus-visible {
  outline: 2px solid rgba(255, 250, 242, 0.76);
  outline-offset: 2px;
}

.hp-popover {
  background: rgba(22, 17, 18, 0.98);
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #fffaf2;
  display: grid;
  gap: 9px;
  left: 0;
  padding: 10px;
  position: absolute;
  top: calc(100% + 8px);
  width: min(340px, calc(100vw - 44px));
  z-index: 40;
}

.hp-menu-summary {
  color: rgba(255, 250, 242, 0.72);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.3;
}

.hp-menu-grid {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.hp-menu-grid .field {
  min-width: 0;
}

.hp-menu-grid .field span {
  color: rgba(255, 250, 242, 0.68);
}

.hp-menu-grid .btn {
  min-height: 36px;
  width: 100%;
}

.hero-stat span,
.stat-card span,
.summary-cell span,
.tracker span,
.death-save-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sheet-hero .hero-stat span {
  color: rgba(255, 250, 242, 0.62);
}

.hero-stat strong,
.stat-card strong,
.summary-cell strong {
  font-size: 22px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-hero .hero-stat strong {
  color: #fffaf2;
}

.hero-stat small {
  color: rgba(255, 250, 242, 0.54);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-stat small:empty {
  display: none;
}

.hero-stat small.has-temp {
  color: #b7e2b7;
}

.sheet-compass {
  align-items: center;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.075), rgba(255, 250, 242, 0.025)),
    rgba(18, 13, 17, 0.78);
  backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  box-shadow:
    0 12px 28px rgba(0, 0, 0, 0.28),
    inset 0 1px 0 rgba(255, 250, 242, 0.08);
  display: grid;
  gap: 6px;
  grid-template-columns: 42px minmax(0, 1fr) 42px;
  padding: 5px;
  position: sticky;
  top: 0;
  top: env(safe-area-inset-top, 0px);
  z-index: 35;
  isolation: isolate;
}

.sheet-compass::after {
  background: linear-gradient(180deg, rgba(17, 15, 19, 0.72), rgba(17, 15, 19, 0));
  content: "";
  height: 18px;
  left: 18px;
  opacity: 0.7;
  pointer-events: none;
  position: absolute;
  right: 18px;
  top: calc(100% - 3px);
  z-index: 0;
}

.sheet-compass > * {
  position: relative;
  z-index: 1;
}

.sheet-tabs {
  cursor: grab;
  border-radius: 7px;
  min-width: 0;
  min-height: 48px;
  overflow: hidden;
  position: relative;
  touch-action: pan-y;
  user-select: none;
}

.sheet-tabs.is-dragging {
  cursor: grabbing;
}

.sheet-tabs::before,
.sheet-tabs::after {
  content: "";
  pointer-events: none;
  position: absolute;
  top: 0;
  bottom: 0;
  width: 72px;
  z-index: 4;
}

.sheet-tabs::before {
  background: linear-gradient(90deg, rgba(18, 13, 17, 0.92), transparent);
  left: 0;
}

.sheet-tabs::after {
  background: linear-gradient(270deg, rgba(18, 13, 17, 0.92), transparent);
  right: 0;
}

.sheet-tab-selector {
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.3), rgba(255, 250, 242, 0.08)),
    rgba(255, 250, 242, 0.06);
  border: 1px solid rgba(216, 157, 74, 0.5);
  border-radius: 7px;
  box-shadow:
    0 8px 18px rgba(0, 0, 0, 0.26),
    inset 0 1px 0 rgba(255, 250, 242, 0.12);
  bottom: 4px;
  left: 50%;
  pointer-events: none;
  position: absolute;
  top: 4px;
  transform: translateX(-50%);
  width: min(clamp(168px, 18vw, 260px), calc(100% - 10px));
  z-index: 1;
}

.sheet-tab-rail {
  display: flex;
  gap: 6px;
  position: relative;
  transition: transform .22s ease;
  width: max-content;
  will-change: transform;
  z-index: 2;
}

.sheet-tabs.is-dragging .sheet-tab-rail {
  transition: none;
}

.sheet-tab-rail.is-normalizing {
  transition: none !important;
}

.sheet-page-menu {
  display: none;
}

.sheet-arrow {
  align-items: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.06);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 7px;
  color: #fff5cf;
  cursor: pointer;
  display: grid;
  font-size: 0;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  line-height: 0;
  padding: 0;
  place-items: center;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
  width: 42px;
}

.sheet-arrow span {
  border-color: currentColor;
  border-style: solid;
  border-width: 0 2px 2px 0;
  box-sizing: border-box;
  display: block;
  height: 10px;
  line-height: 0;
  width: 10px;
}

.sheet-arrow[data-sheet-nav="prev"] span {
  transform: translateX(2px) rotate(135deg);
}

.sheet-arrow[data-sheet-nav="next"] span {
  transform: translateX(-2px) rotate(-45deg);
}

.sheet-arrow:hover:not(:disabled) {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(216, 157, 74, 0.5);
}

.sheet-arrow:disabled {
  color: rgba(255, 250, 242, 0.24);
  cursor: default;
  opacity: .72;
}

.sheet-tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  color: rgba(255, 250, 242, 0.66);
  cursor: pointer;
  display: grid;
  flex: 0 0 clamp(168px, 18vw, 260px);
  gap: 1px;
  align-content: center;
  justify-items: center;
  min-height: 42px;
  padding: 6px 10px 7px;
  text-align: center;
}

.sheet-tab span {
  color: rgba(185, 128, 47, 0.82);
  font-size: 9px;
  font-weight: 950;
}

.sheet-tab strong {
  font-size: 14px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.sheet-tab:hover {
  background: rgba(255, 250, 242, 0.055);
  border-color: rgba(255, 250, 242, 0.08);
  color: #fffaf2;
}

.sheet-tab:focus-visible,
.sheet-arrow:focus-visible,
.theme-swatch:focus-visible {
  outline: 2px solid rgba(216, 157, 74, 0.7);
  outline-offset: 2px;
}

.sheet-tab.active {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  color: #fffaf2;
}

.sheet-tab.active span {
  color: var(--gold);
}

.sheet-tab[data-offset="-2"],
.sheet-tab[data-offset="2"] {
  opacity: .68;
}

.sheet-tab[data-offset="-1"],
.sheet-tab[data-offset="1"] {
  opacity: .86;
}

.sheet-tab.active {
  opacity: 1;
}

.sheet-progress {
  display: none;
  justify-content: center;
  gap: 8px;
}

.sheet-progress span {
  background: rgba(255, 250, 242, 0.28);
  border-radius: 3px;
  height: 6px;
  transition: width .16s ease, background .16s ease;
  width: 6px;
}

.sheet-progress span.active {
  background: linear-gradient(90deg, var(--gold), #f1c36f);
  width: 24px;
}

@media (max-width: 760px) {
  .sheet-compass.page-menu-open {
    border-color: rgba(216, 157, 74, 0.36);
    box-shadow:
      0 16px 36px rgba(0, 0, 0, 0.36),
      inset 0 1px 0 rgba(255, 250, 242, 0.1);
  }

  .sheet-page-menu:not(.hidden) {
    background:
      linear-gradient(180deg, rgba(255, 250, 242, 0.08), rgba(255, 250, 242, 0.035)),
      rgba(18, 13, 17, 0.96);
    backdrop-filter: blur(18px);
    border: 1px solid rgba(216, 157, 74, 0.28);
    border-radius: 8px;
    box-shadow:
      0 20px 48px rgba(0, 0, 0, 0.44),
      inset 0 1px 0 rgba(255, 250, 242, 0.08);
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: min(56dvh, 360px);
    overflow-y: auto;
    padding: 8px;
    position: absolute;
    left: 50%;
    top: calc(100% + 6px);
    transform: translateX(-50%);
    width: min(430px, calc(100% - 96px));
    z-index: 12;
  }

  .sheet-page-menu-item {
    align-items: center;
    appearance: none;
    background: rgba(255, 250, 242, 0.045);
    border: 1px solid rgba(255, 250, 242, 0.1);
    border-radius: 7px;
    color: rgba(255, 250, 242, 0.82);
    cursor: pointer;
    display: grid;
    gap: 2px;
    min-height: 48px;
    padding: 8px 9px;
    text-align: left;
    touch-action: manipulation;
  }

  .sheet-page-menu-item span {
    color: rgba(216, 157, 74, 0.82);
    font-size: 9px;
    font-weight: 950;
    line-height: 1;
  }

  .sheet-page-menu-item strong {
    color: inherit;
    font-size: 13px;
    font-weight: 900;
    line-height: 1.1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sheet-page-menu-item.active {
    background:
      linear-gradient(180deg, rgba(var(--accent-rgb), 0.28), rgba(255, 250, 242, 0.08)),
      rgba(255, 250, 242, 0.07);
    border-color: rgba(216, 157, 74, 0.5);
    box-shadow:
      inset 0 1px 0 rgba(255, 250, 242, 0.12),
      0 8px 18px rgba(0, 0, 0, 0.24);
    color: #fffaf2;
  }

  .sheet-page-menu-item:focus-visible {
    outline: 2px solid rgba(216, 157, 74, 0.72);
    outline-offset: 2px;
  }
}

.panel-scroll-rail {
  --panel-scroll-gutter: 32px;
  --panel-scroll-sidebar: 300px;
  --panel-scroll-drag-direction: 1;
  --panel-scroll-drag-scale: 1.46;
  --panel-scroll-drag-shift: 5px;
  --panel-scroll-width: 32px;
  --panel-scroll-track-height: clamp(126px, 36vh, 320px);
  align-items: center;
  background: rgba(13, 10, 14, 0.08);
  border: 1px solid transparent;
  border-radius: 999px;
  box-shadow: none;
  contain: layout;
  display: grid;
  gap: 4px;
  justify-items: center;
  left: calc(var(--panel-scroll-sidebar) + ((var(--panel-scroll-gutter) - var(--panel-scroll-width)) / 2));
  padding: 7px 0;
  position: fixed;
  top: 50%;
  touch-action: none;
  transform: translateY(-50%) translateX(0) scale(1);
  transform-origin: left center;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, left .16s ease, opacity .16s ease, right .16s ease, transform .18s cubic-bezier(.18, .9, .2, 1), width .16s ease;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  will-change: transform;
  width: var(--panel-scroll-width);
  z-index: 32;
}

body.panel-scroll-right .panel-scroll-rail {
  --panel-scroll-drag-direction: -1;
  left: auto;
  right: max(4px, calc((var(--panel-scroll-gutter) - var(--panel-scroll-width)) / 2), env(safe-area-inset-right));
  transform-origin: right center;
}

.panel-scroll-rail:hover,
.panel-scroll-rail.is-expanded {
  background: rgba(13, 10, 14, 0.68);
  border-color: rgba(226, 195, 151, 0.16);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.panel-scroll-rail.is-dragging {
  background: rgba(13, 10, 14, 0.86);
  border-color: rgba(255, 214, 148, 0.34);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.4), 0 0 30px rgba(216, 157, 74, 0.2);
  transform: translateY(-50%) translateX(calc(var(--panel-scroll-drag-shift) * var(--panel-scroll-drag-direction))) scale(var(--panel-scroll-drag-scale));
}

.panel-scroll-dots {
  cursor: grab;
  height: var(--panel-scroll-track-height);
  padding: 2px 0;
  position: relative;
  touch-action: none;
  width: 100%;
}

.panel-scroll-dots::before {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(216, 157, 74, 0.24) 12%,
    rgba(216, 157, 74, 0.38) 50%,
    rgba(216, 157, 74, 0.24) 88%,
    transparent
  );
  bottom: 5px;
  content: "";
  left: 50%;
  position: absolute;
  top: 5px;
  transform: translateX(-50%);
  width: 2px;
}

.panel-scroll-thumb {
  background: linear-gradient(180deg, rgba(216, 157, 74, 0.95), rgba(255, 250, 242, 0.48));
  border: 1px solid rgba(255, 250, 242, 0.22);
  border-radius: 999px;
  box-shadow: 0 0 16px rgba(216, 157, 74, 0.22);
  content: "";
  height: var(--panel-scroll-thumb-height, 28px);
  left: 50%;
  opacity: .74;
  pointer-events: none;
  position: absolute;
  top: var(--panel-scroll-thumb-top, 0);
  transform: translateX(-50%);
  transition: top .08s ease, height .08s ease, opacity .14s ease, width .14s ease;
  width: 8px;
  z-index: 3;
}

.panel-scroll-rail:hover .panel-scroll-thumb,
.panel-scroll-rail.is-expanded .panel-scroll-thumb {
  opacity: 1;
  width: 12px;
}

.panel-scroll-rail.is-dragging .panel-scroll-thumb {
  box-shadow: 0 0 0 3px rgba(216, 157, 74, 0.14), 0 0 24px rgba(216, 157, 74, 0.38);
  opacity: 1;
  transition: box-shadow .16s ease, opacity .16s ease, width .16s ease;
  width: 16px;
}

.panel-scroll-rail.is-dragging .panel-scroll-dots {
  cursor: grabbing;
}

.panel-scroll-rail.is-dragging .panel-scroll-dots::before {
  background: linear-gradient(
    to bottom,
    transparent,
    rgba(255, 214, 148, 0.32) 10%,
    rgba(255, 214, 148, 0.58) 50%,
    rgba(255, 214, 148, 0.32) 90%,
    transparent
  );
  width: 3px;
}

.panel-scroll-dot,
.panel-scroll-arrow {
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 0;
  position: relative;
}

.panel-scroll-dot {
  background: rgba(255, 250, 242, 0.46);
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(255, 250, 242, 0.08);
  height: 6px;
  left: 50%;
  margin: 0;
  position: absolute;
  top: var(--panel-dot-pos, 0%);
  transform: translate(-50%, -50%);
  transition: background .14s ease, box-shadow .14s ease, height .14s ease, opacity .14s ease, transform .14s ease, width .14s ease;
  width: 6px;
  z-index: 2;
}

.panel-scroll-dot:hover,
.panel-scroll-dot.active {
  background: var(--gold);
  box-shadow: 0 0 0 3px rgba(216, 157, 74, 0.16), 0 0 14px rgba(216, 157, 74, 0.28);
}

.panel-scroll-dot.active {
  transform: translate(-50%, -50%) scale(1.32);
}

.panel-scroll-rail.is-dragging .panel-scroll-dot {
  background: rgba(255, 250, 242, 0.68);
  height: 8px;
  opacity: .72;
  transform: translate(-50%, -50%) scale(1.02);
  width: 8px;
}

.panel-scroll-rail.is-dragging .panel-scroll-dot.active {
  background: #ffd694;
  box-shadow: 0 0 0 4px rgba(216, 157, 74, 0.18), 0 0 22px rgba(216, 157, 74, 0.42);
  opacity: 1;
  transform: translate(-50%, -50%) scale(1.38);
}

.panel-scroll-rail.is-dragging .panel-scroll-arrow::before {
  border-left-width: 5px;
  border-right-width: 5px;
  border-bottom-width: 6px;
}

.panel-scroll-rail.is-dragging .panel-scroll-arrow.down::before {
  border-bottom-width: 0;
  border-top-width: 6px;
}

.panel-scroll-arrow {
  background: transparent;
  height: 15px;
  width: 100%;
}

.panel-scroll-arrow::before {
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-bottom: 5px solid rgba(216, 157, 74, 0.82);
  content: "";
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
}

.panel-scroll-arrow.down::before {
  border-bottom: 0;
  border-top: 5px solid rgba(216, 157, 74, 0.82);
}

.panel-scroll-arrow:hover::before {
  border-bottom-color: var(--gold);
  border-top-color: var(--gold);
}

.panel-scroll-arrow:disabled {
  cursor: default;
  opacity: .28;
}

.panel-scroll-dot:focus-visible,
.panel-scroll-arrow:focus-visible {
  outline: 2px solid rgba(216, 157, 74, 0.7);
  outline-offset: 1px;
}

.sheet-track {
  display: grid;
  grid-auto-columns: 100%;
  grid-auto-flow: column;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  overflow-y: hidden;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  touch-action: pan-y;
  transition: height .18s ease;
  width: 100%;
}

.sheet-track.is-settling {
  scroll-behavior: auto;
  scroll-snap-type: none;
}

.sheet-track.is-queued-transition {
  scroll-snap-type: none;
}

.sheet-track::-webkit-scrollbar {
  display: none;
}

.sheet-page {
  align-content: start;
  align-self: start;
  box-sizing: border-box;
  display: grid;
  gap: 15px;
  min-width: 0;
  padding: 2px 1px 30px;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  width: 100%;
}

.sheet-page:not(.current) {
  contain: layout paint style;
  content-visibility: auto;
  contain-intrinsic-size: 820px;
}

.sheet-page.vendor-page:not(.current) {
  contain-intrinsic-size: 700px;
}

.sheet-page[data-sheet-page="profile"] { order: 1; }
.sheet-page[data-sheet-page="abilities"] { order: 2; }
.sheet-page[data-sheet-page="combat"] { order: 3; }
.sheet-page[data-sheet-page="magic"] { order: 4; }
.sheet-page[data-sheet-page="gear"] { order: 5; }
.sheet-page[data-sheet-page="companion"] { order: 6; }
.sheet-page[data-sheet-page="journal"] { order: 7; }

.sheet-page > * {
  min-width: 0;
}

.sheet-page.codex-page {
  align-content: center;
  box-sizing: border-box;
  min-height: calc(100dvh - 40px);
  padding-bottom: clamp(28px, 5vh, 72px);
  padding-left: 0;
  padding-right: 0;
  padding-top: clamp(28px, 5vh, 72px);
}

.codex-shell {
  background: transparent;
  border: 0;
  box-shadow: none;
  display: grid;
  gap: 14px;
  padding: 0;
}

.codex-home-shell {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  padding: 0;
}

.codex-category-shell,
.codex-list-shell {
  justify-self: center;
  width: 100%;
}

.codex-category-shell {
  align-content: start;
  min-height: 0;
}

.codex-options-shell.codex-category-shell {
  width: 100%;
}

.codex-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fill, minmax(178px, 230px));
  justify-content: start;
}

.codex-home-grid {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  justify-content: stretch;
}

.codex-home-shell .codex-home-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.codex-section-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-content: stretch;
}

.codex-category-shell .codex-section-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.codex-options-shell .codex-section-grid-count-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.codex-section-grid > .codex-tile {
  width: 100%;
}

.codex-card-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
  justify-content: start;
}

.codex-classes-shell .codex-card-grid,
.codex-options-shell.codex-list-shell .codex-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  justify-content: stretch;
}

.codex-vehicle-grid {
  grid-template-columns: repeat(auto-fill, minmax(205px, 1fr));
  justify-content: stretch;
}

.codex-tutorial-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  justify-content: stretch;
}

.codex-tutorial-actions {
  display: flex;
  justify-content: flex-end;
  margin-bottom: 12px;
}

.codex-public-feed {
  display: grid;
  gap: 16px;
  margin: 0 auto;
  max-width: min(860px, 100%);
  width: 100%;
}

.codex-feed-post {
  background:
    linear-gradient(145deg, rgba(216, 157, 74, 0.16), transparent 56%),
    rgba(19, 15, 20, 0.9);
  border: 1px solid rgba(216, 157, 74, 0.28);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 242, 0.08), 0 18px 38px rgba(0, 0, 0, 0.22);
  color: #fffaf2;
  cursor: pointer;
  display: grid;
  gap: 12px;
  overflow: hidden;
  padding: 14px;
  position: relative;
}

.codex-feed-post:hover,
.codex-feed-post:focus-visible,
.codex-feed-post.active {
  border-color: rgba(216, 157, 74, 0.62);
  outline: none;
  transform: translateY(-1px);
}

.codex-feed-post.unread {
  border-color: rgba(213, 40, 63, 0.58);
}

.codex-feed-post-head {
  align-items: center;
  display: flex;
  gap: 11px;
  min-width: 0;
  padding-right: 2.1rem;
}

.codex-feed-avatar {
  align-items: center;
  background: rgba(255, 250, 242, 0.08);
  border: 1px solid rgba(255, 250, 242, 0.2);
  color: #f0c66a;
  display: inline-flex;
  flex: 0 0 46px;
  height: 46px;
  justify-content: center;
  overflow: hidden;
  width: 46px;
}

.codex-feed-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.codex-feed-post-head strong,
.codex-feed-post-body h3 {
  color: #fff8df;
  display: block;
  font-weight: 900;
}

.codex-feed-post-head em {
  color: rgba(255, 250, 242, 0.62);
  display: block;
  font-size: .82rem;
  font-style: normal;
  line-height: 1.35;
}

.codex-feed-post-body {
  display: grid;
  gap: 10px;
}

.codex-feed-post-body h3 {
  font-size: clamp(1.05rem, 2.3vw, 1.32rem);
  line-height: 1.08;
  margin: 0;
}

.codex-feed-image-frame {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.07), rgba(255, 250, 242, 0.02)),
    rgba(7, 5, 7, 0.44);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  display: flex;
  justify-content: center;
  margin: 0;
  overflow: hidden;
}

.codex-feed-image {
  display: block;
  height: auto;
  border-radius: 7px;
  max-height: min(68vh, 640px);
  object-fit: contain;
  width: 100%;
}

.codex-feed-prose {
  color: rgba(255, 250, 242, 0.78);
}

.codex-section-back {
  justify-self: start;
}

.codex-tile {
  --tile-accent: #d89d4a;
  --tile-accent-rgb: 216, 157, 74;
  --codex-card-gradient-rgb: var(--tile-accent-rgb);
  --codex-card-gradient-alpha: 0.18;
  --codex-card-gradient-hover-alpha: 0.22;
  --codex-card-fade-alpha: 0.4;
  align-content: end;
  appearance: none;
  aspect-ratio: 1 / 1;
  background:
    linear-gradient(145deg, rgba(var(--tile-accent-rgb), 0.22), transparent 58%),
    linear-gradient(0deg, rgba(18, 13, 17, 0.92), rgba(28, 21, 25, 0.8));
  border: 1px solid rgba(var(--tile-accent-rgb), 0.42);
  border-radius: 8px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 242, 0.08), 0 16px 34px rgba(0, 0, 0, 0.22);
  color: #fffaf2;
  cursor: pointer;
  display: grid;
  gap: 5px;
  isolation: isolate;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 13px;
  position: relative;
  text-align: left;
  transition: border-color 0.14s ease, transform 0.14s ease, background 0.14s ease;
}

.codex-unread-badge {
  align-items: center;
  background: #d5283f;
  border: 2px solid rgba(255, 244, 224, 0.92);
  border-radius: 999px;
  box-sizing: border-box;
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34), 0 0 0 2px rgba(213, 40, 63, 0.2);
  color: #fffaf0;
  display: inline-flex;
  font: 900 .68rem/1 var(--font-ui, inherit);
  height: 1.55rem;
  justify-content: center;
  letter-spacing: 0;
  line-height: 1;
  min-width: 1.55rem;
  padding: 0 .38rem;
  pointer-events: none;
  position: absolute;
  right: .65rem;
  top: .65rem;
  white-space: nowrap;
  width: max-content;
  z-index: 5;
}

.codex-result-card .codex-unread-badge,
.codex-read-all-btn .codex-unread-badge {
  right: -.52rem;
  top: -.52rem;
}

.codex-home-shell .codex-tile {
  aspect-ratio: 16 / 10;
  min-height: 236px;
  padding: 18px;
}

.codex-section-grid .codex-section-tile.has-image {
  aspect-ratio: 16 / 10;
  min-height: 210px;
  padding: 16px;
}

.codex-vehicle-grid .codex-vehicle-tile {
  aspect-ratio: 5 / 4;
  min-height: 220px;
}

.codex-tile:hover,
.codex-tile:focus-visible,
.codex-tile.active {
  background:
    linear-gradient(145deg, rgba(var(--tile-accent-rgb), 0.34), transparent 62%),
    linear-gradient(0deg, rgba(18, 13, 17, 0.94), rgba(34, 25, 27, 0.86));
  border-color: rgba(var(--tile-accent-rgb), 0.74);
  outline: none;
  transform: translateY(-1px);
}

.codex-tile.has-image:not(.codex-lore-tile) {
  background-clip: padding-box;
  background-color: #070507;
  background-image:
    linear-gradient(0deg, rgba(7, 5, 7, calc(0.99 * var(--codex-card-fade-alpha))) 0%, rgba(7, 5, 7, calc(0.88 * var(--codex-card-fade-alpha))) 34%, rgba(7, 5, 7, calc(0.46 * var(--codex-card-fade-alpha))) 67%, rgba(7, 5, 7, calc(0.16 * var(--codex-card-fade-alpha))) 100%),
    linear-gradient(135deg, rgba(var(--codex-card-gradient-rgb), var(--codex-card-gradient-alpha)), rgba(0, 0, 0, calc(0.18 * var(--codex-card-fade-alpha))) 50%, transparent),
    var(--codex-tile-image);
  background-position: center;
  background-size: cover;
  border-color: rgba(var(--tile-accent-rgb), 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 250, 242, 0.12), 0 20px 44px rgba(0, 0, 0, 0.28);
}

.codex-tile.has-image::after {
  background: linear-gradient(
    0deg,
    rgba(7, 5, 7, var(--codex-card-fade-alpha)) 0 18px,
    rgba(7, 5, 7, calc(0.94 * var(--codex-card-fade-alpha))) 38px,
    rgba(7, 5, 7, calc(0.72 * var(--codex-card-fade-alpha))) 56px,
    rgba(7, 5, 7, 0) 100%
  );
  bottom: -1px;
  content: "";
  height: 76px;
  left: -1px;
  pointer-events: none;
  position: absolute;
  right: -1px;
  z-index: 1;
}

.codex-tile.has-image > * {
  position: relative;
  z-index: 2;
}

.codex-tile > .codex-unread-badge,
.codex-tile.has-image > .codex-unread-badge,
.codex-result-card > .codex-unread-badge,
.codex-feed-post > .codex-unread-badge {
  align-self: start;
  justify-self: end;
  max-width: calc(100% - 1.1rem);
  position: absolute;
  right: .65rem;
  top: .65rem;
  z-index: 7;
}

.codex-tile.has-image:not(.codex-lore-tile):hover,
.codex-tile.has-image:not(.codex-lore-tile):focus-visible,
.codex-tile.has-image:not(.codex-lore-tile).active {
  background-image:
    linear-gradient(0deg, rgba(7, 5, 7, calc(0.99 * var(--codex-card-fade-alpha))) 0%, rgba(7, 5, 7, calc(0.82 * var(--codex-card-fade-alpha))) 31%, rgba(7, 5, 7, calc(0.34 * var(--codex-card-fade-alpha))) 65%, rgba(7, 5, 7, calc(0.1 * var(--codex-card-fade-alpha))) 100%),
    linear-gradient(135deg, rgba(var(--codex-card-gradient-rgb), var(--codex-card-gradient-hover-alpha)), rgba(0, 0, 0, calc(0.1 * var(--codex-card-fade-alpha))) 48%, transparent),
    var(--codex-tile-image);
  border-color: rgba(var(--tile-accent-rgb), 0.86);
}

.codex-tile-art {
  align-items: center;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 250, 242, 0.28), transparent 38%),
    rgba(var(--tile-accent-rgb), 0.18);
  border: 1px solid rgba(var(--tile-accent-rgb), 0.38);
  border-radius: 8px;
  display: inline-flex;
  height: 46px;
  justify-content: center;
  position: absolute;
  right: 12px;
  top: 12px;
  width: 46px;
}

.codex-tile-art b {
  color: var(--tile-accent);
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
}

.codex-tile-kicker {
  color: var(--tile-accent);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  padding-right: 52px;
  text-transform: uppercase;
}

.codex-tile.has-image:not(.codex-lore-tile) .codex-tile-kicker {
  padding-right: 0;
}

.codex-tile strong {
  font-size: 19px;
  font-weight: 950;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.codex-tile em {
  color: rgba(255, 250, 242, 0.72);
  display: -webkit-box;
  font-size: 12px;
  font-style: normal;
  font-weight: 720;
  line-height: 1.28;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.codex-tile small {
  align-self: end;
  color: rgba(255, 250, 242, 0.58);
  font-size: 10px;
  font-weight: 900;
  line-height: 1.15;
  text-transform: uppercase;
}

.codex-tile.has-image:not(.codex-lore-tile) .codex-tile-kicker,
.codex-tile.has-image:not(.codex-lore-tile) strong,
.codex-tile.has-image:not(.codex-lore-tile) em,
.codex-tile.has-image:not(.codex-lore-tile) small {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.88);
}

.codex-home-shell .codex-tile-kicker {
  font-size: 11px;
  padding-right: 0;
}

.codex-home-shell .codex-tile strong {
  font-size: 25px;
}

.codex-home-shell .codex-tile em {
  font-size: 13px;
  max-width: 31ch;
}

.codex-home-shell .codex-tile small {
  color: rgba(255, 250, 242, 0.72);
  margin-top: 3px;
}

.codex-small-tile strong {
  font-size: 17px;
}

.codex-section-grid .codex-section-tile.has-image strong {
  font-size: 21px;
}

.codex-tile-rules,
.codex-result-card {
  --tile-accent: #72d3be;
  --tile-accent-rgb: 114, 211, 190;
}

.codex-tile-classes {
  --tile-accent: #e0846e;
  --tile-accent-rgb: 224, 132, 110;
}

.codex-tile-options {
  --tile-accent: #9fcf6e;
  --tile-accent-rgb: 159, 207, 110;
}

.codex-tile-spells,
.spell-result {
  --tile-accent: #a99cf0;
  --tile-accent-rgb: 169, 156, 240;
}

.codex-tile-vehicles,
.codex-vehicle-tile {
  --tile-accent: #71bfe8;
  --tile-accent-rgb: 113, 191, 232;
}

.codex-tile-tutorials,
.codex-tutorial-chapter-tile {
  --tile-accent: #ee9f64;
  --tile-accent-rgb: 238, 159, 100;
}

.codex-tutorial-chapter-tile {
  aspect-ratio: 16 / 10;
  min-height: 218px;
}

.codex-tutorial-chapter-tile.complete {
  --tile-accent: #8fdaa3;
  --tile-accent-rgb: 143, 218, 163;
  border-color: rgba(143, 218, 163, 0.86);
  box-shadow:
    inset 0 0 0 1px rgba(223, 255, 240, 0.12),
    0 20px 44px rgba(0, 0, 0, 0.28),
    0 0 24px rgba(85, 184, 120, 0.16);
}

.codex-complete-badge {
  position: absolute !important;
  right: 12px;
  top: 12px;
  z-index: 3 !important;
}

.codex-tile-lore,
.codex-lore-tile {
  --tile-accent: #f0c66a;
  --tile-accent-rgb: 240, 198, 106;
}

.codex-lore-tile.has-image {
  aspect-ratio: 4 / 5;
  background-clip: padding-box;
  background-color: #070507;
  background-image:
    linear-gradient(0deg, rgba(7, 5, 7, 0.98) 0%, rgba(7, 5, 7, 0.86) 28%, rgba(7, 5, 7, 0.38) 62%, rgba(7, 5, 7, 0.08) 100%),
    var(--codex-lore-image);
  background-position: center;
  background-size: cover;
  border-color: rgba(255, 250, 242, 0.2);
  min-height: 260px;
  padding: 16px;
}

.codex-lore-tile.has-image:hover,
.codex-lore-tile.has-image:focus-visible,
.codex-lore-tile.has-image.active {
  background-image:
    linear-gradient(0deg, rgba(7, 5, 7, 0.98) 0%, rgba(7, 5, 7, 0.78) 24%, rgba(7, 5, 7, 0.28) 60%, rgba(7, 5, 7, 0.04) 100%),
    var(--codex-lore-image);
  border-color: rgba(var(--tile-accent-rgb), 0.76);
}

.codex-lore-tile.has-image .codex-tile-kicker {
  padding-right: 0;
  text-shadow: 0 1px 10px rgba(0, 0, 0, 0.8);
}

.codex-lore-tile.has-image strong,
.codex-lore-tile.has-image em {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.86);
}

.codex-tile-worldMap {
  --tile-accent: #7fc8ad;
  --tile-accent-rgb: 127, 200, 173;
}

.codex-world-map-shell {
  width: 100%;
}

.world-atlas-layout {
  display: block;
  width: 100%;
}

.world-atlas-map-shell {
  background:
    repeating-linear-gradient(0deg, rgba(255, 250, 242, 0.035) 0 1px, transparent 1px 34px),
    repeating-linear-gradient(90deg, rgba(255, 250, 242, 0.028) 0 1px, transparent 1px 34px),
    linear-gradient(135deg, rgba(12, 20, 18, 0.84), rgba(29, 21, 22, 0.74));
  border: 1px solid rgba(127, 200, 173, 0.28);
  border-radius: 8px;
  box-shadow: 0 22px 56px rgba(0, 0, 0, 0.28);
  display: grid;
  gap: 12px;
  isolation: isolate;
  margin: 0 auto;
  max-width: min(1440px, 100%);
  min-width: 0;
  overflow: hidden;
  padding: clamp(10px, 1.4vw, 16px);
  position: relative;
}

.world-atlas-bar {
  align-items: flex-start;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.world-atlas-bar > div:first-child {
  display: grid;
  gap: 3px;
  min-width: min(420px, 100%);
}

.world-atlas-bar span,
.world-atlas-panel-section > span {
  color: #7fc8ad;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.world-atlas-bar strong {
  color: #fffaf2;
  font-size: 20px;
  font-weight: 950;
  line-height: 1.05;
}

.world-atlas-bar em {
  color: rgba(255, 250, 242, 0.64);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.28;
}

.world-atlas-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.world-atlas-zoom-controls {
  align-items: center;
  background: rgba(7, 5, 7, 0.34);
  border: 1px solid rgba(255, 250, 242, 0.11);
  border-radius: 8px;
  display: inline-flex;
  gap: 6px;
  padding: 4px;
}

.world-atlas-zoom-controls span {
  color: rgba(255, 250, 242, 0.78);
  font-size: 11px;
  font-weight: 900;
  min-width: 44px;
  text-align: center;
}

.world-atlas-zoom-button {
  min-width: 32px;
  padding-left: 0;
  padding-right: 0;
}

.world-atlas-breadcrumbs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.world-atlas-breadcrumbs button,
.world-atlas-breadcrumbs span {
  background: rgba(255, 250, 242, 0.07);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 999px;
  color: rgba(255, 250, 242, 0.78);
  font-size: 11px;
  font-weight: 850;
  line-height: 1;
  padding: 7px 10px;
}

.world-atlas-breadcrumbs button {
  cursor: pointer;
}

.world-atlas-viewer {
  min-width: 0;
  position: relative;
}

.world-atlas-map-frame {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.08), rgba(255, 250, 242, 0.025)) padding-box,
    linear-gradient(135deg, rgba(216, 157, 74, 0.7), rgba(127, 200, 173, 0.52) 48%, rgba(184, 166, 255, 0.48)) border-box;
  border: 1px solid transparent;
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(7, 5, 7, 0.62),
    0 18px 42px rgba(0, 0, 0, 0.34);
  isolation: isolate;
  overflow: hidden;
  padding: clamp(12px, 1.8vw, 22px);
  position: relative;
}

.world-atlas-map-frame::before {
  animation: worldAtlasFrameTurn 32s linear infinite;
  background:
    conic-gradient(from 0deg at 50% 50%,
      rgba(216, 157, 74, 0),
      rgba(216, 157, 74, 0.34),
      rgba(127, 200, 173, 0.1),
      rgba(184, 166, 255, 0.26),
      rgba(216, 157, 74, 0));
  content: "";
  inset: -58%;
  opacity: 0.64;
  position: absolute;
  z-index: 0;
}

.world-atlas-map-frame::after {
  background:
    repeating-conic-gradient(from 45deg at 16% 82%, rgba(216, 157, 74, 0.12) 0deg 4deg, transparent 4deg 18deg),
    repeating-linear-gradient(0deg, rgba(255, 250, 242, 0.055) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(90deg, rgba(255, 250, 242, 0.045) 0 1px, transparent 1px 32px),
    repeating-linear-gradient(135deg, transparent 0 26px, rgba(127, 200, 173, 0.05) 26px 27px, transparent 27px 54px),
    linear-gradient(135deg, rgba(33, 24, 24, 0.96), rgba(9, 18, 17, 0.98) 54%, rgba(22, 17, 24, 0.96));
  border-radius: 6px;
  content: "";
  inset: 4px;
  opacity: 0.96;
  position: absolute;
  z-index: 0;
}

.world-atlas-map-frame > .world-atlas-stage-viewport {
  position: relative;
  z-index: 1;
}

.world-atlas-stage-viewport {
  background:
    linear-gradient(180deg, rgba(10, 20, 18, 0.82), rgba(16, 13, 15, 0.86)),
    repeating-linear-gradient(0deg, rgba(255, 250, 242, 0.05) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(90deg, rgba(255, 250, 242, 0.04) 0 1px, transparent 1px 28px),
    repeating-linear-gradient(32deg, transparent 0 34px, rgba(216, 157, 74, 0.05) 34px 35px, transparent 35px 70px),
    #0a1412;
  border: 1px solid rgba(245, 214, 107, 0.34);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(0, 0, 0, 0.42),
    inset 0 0 42px rgba(216, 157, 74, 0.08),
    0 12px 30px rgba(0, 0, 0, 0.34);
  cursor: grab;
  max-height: min(76dvh, 840px);
  min-height: 0;
  overflow: hidden;
  overscroll-behavior: none;
  touch-action: none;
  user-select: none;
  width: 100%;
}

.world-atlas-stage-viewport.panning {
  cursor: grabbing;
}

.world-atlas-stage {
  aspect-ratio: var(--atlas-aspect, 16 / 10);
  background: #0a1412;
  container-type: size;
  min-width: min(640px, 100%);
  overflow: hidden;
  position: relative;
  touch-action: none;
  transform: translate3d(var(--atlas-pan-x, 0px), var(--atlas-pan-y, 0px), 0) scale(var(--atlas-zoom, 1));
  transform-origin: 0 0;
  width: 100%;
  will-change: transform;
}

.world-atlas-stage::before {
  animation: worldAtlasMapGleam 7s ease-in-out infinite;
  background:
    linear-gradient(90deg, rgba(245, 214, 107, 0.94), transparent 30%) top left / 42% 2px no-repeat,
    linear-gradient(90deg, transparent 70%, rgba(127, 200, 173, 0.82)) top right / 42% 2px no-repeat,
    linear-gradient(90deg, rgba(127, 200, 173, 0.82), transparent 30%) bottom left / 42% 2px no-repeat,
    linear-gradient(90deg, transparent 70%, rgba(245, 214, 107, 0.94)) bottom right / 42% 2px no-repeat,
    linear-gradient(180deg, rgba(245, 214, 107, 0.9), transparent 30%) top left / 2px 42% no-repeat,
    linear-gradient(180deg, rgba(127, 200, 173, 0.82), transparent 30%) top right / 2px 42% no-repeat,
    linear-gradient(180deg, transparent 70%, rgba(127, 200, 173, 0.82)) bottom left / 2px 42% no-repeat,
    linear-gradient(180deg, transparent 70%, rgba(245, 214, 107, 0.94)) bottom right / 2px 42% no-repeat;
  border: 1px solid rgba(245, 214, 107, 0.42);
  box-shadow:
    inset 0 0 0 3px rgba(7, 5, 7, 0.28),
    inset 0 0 34px rgba(0, 0, 0, 0.36),
    0 0 20px rgba(127, 200, 173, 0.12);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
  z-index: 8;
}

.world-atlas-stage > img {
  display: block;
  height: 100%;
  inset: 0;
  object-fit: fill;
  position: absolute;
  -webkit-user-drag: none;
  width: 100%;
  z-index: 1;
}

.world-atlas-zones,
.world-atlas-text-labels,
.world-atlas-markers {
  inset: 0;
  position: absolute;
}

.world-atlas-zones {
  height: 100%;
  pointer-events: auto;
  width: 100%;
  z-index: 2;
}

.world-atlas-text-labels {
  height: 100%;
  overflow: visible;
  pointer-events: none;
  width: 100%;
  z-index: 4;
}

.world-atlas-text-label {
  align-items: flex-end;
  color: var(--atlas-text-color, #f3ead2);
  column-gap: var(--atlas-text-spacing, 0.04em);
  display: inline-flex;
  font-family: var(--atlas-text-family, Georgia, serif);
  font-size: clamp(9px, var(--atlas-text-base-px, 22px), 92px);
  font-size: clamp(9px, calc(var(--atlas-text-size, 3.2) * 1cqh), 92px);
  font-weight: 850;
  left: 50%;
  letter-spacing: 0;
  line-height: 1;
  pointer-events: none;
  position: absolute;
  text-shadow:
    0 1px 0 rgba(8, 7, 5, 0.98),
    1px 0 0 rgba(8, 7, 5, 0.9),
    -1px 0 0 rgba(8, 7, 5, 0.9),
    0 0 8px rgba(0, 0, 0, 0.68);
  top: 50%;
  transform: translate(-50%, -50%) rotate(var(--atlas-text-rotation, 0deg));
  transform-origin: center;
  white-space: nowrap;
}

.world-atlas-text-glyph {
  display: inline-block;
  transform: translateY(var(--atlas-glyph-y, 0)) rotate(var(--atlas-glyph-rotate, 0deg));
  transform-origin: 50% 85%;
}

.world-atlas-zones path {
  cursor: pointer;
  fill: color-mix(in srgb, var(--atlas-zone-color) 10%, transparent);
  outline: none;
  pointer-events: all;
  stroke: color-mix(in srgb, var(--atlas-zone-color) 68%, #fffaf2);
  stroke-opacity: .96;
  stroke-width: .72;
  transition: fill .14s ease, stroke-width .14s ease, filter .14s ease;
  vector-effect: non-scaling-stroke;
}

.world-atlas-zones path:hover,
.world-atlas-zones path:focus-visible {
  fill: color-mix(in srgb, var(--atlas-zone-color) 18%, transparent);
  filter: drop-shadow(0 0 7px color-mix(in srgb, var(--atlas-zone-color) 78%, transparent));
  stroke-width: 1.08;
}

.world-atlas-marker,
.world-atlas-active-marker {
  align-items: center;
  background: rgba(8, 12, 11, 0.72);
  border: 1px solid rgba(255, 250, 242, 0.22);
  border-radius: 999px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.34);
  color: #fffaf2;
  display: inline-flex;
  gap: 6px;
  max-width: min(210px, 22vw);
  min-height: 28px;
  padding: 5px 9px 5px 6px;
  position: absolute;
  transform: translate(-50%, -50%);
  white-space: nowrap;
}

.world-atlas-marker {
  appearance: none;
  cursor: pointer;
  pointer-events: auto;
  z-index: 6;
}

.world-atlas-markers {
  pointer-events: none;
  z-index: 5;
}

.world-atlas-marker:hover,
.world-atlas-marker:focus-visible {
  border-color: rgba(127, 200, 173, 0.8);
  outline: none;
}

.world-atlas-marker span,
.world-atlas-active-marker span {
  background: #f0c66a;
  border: 2px solid rgba(7, 5, 7, 0.72);
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(240, 198, 106, 0.24);
  display: grid;
  flex: 0 0 auto;
  height: 24px;
  place-items: center;
  width: 24px;
}

.world-atlas-marker span img {
  display: block;
  height: 18px;
  object-fit: contain;
  width: 18px;
}

.world-atlas-marker-mine span { background: #b8a6ff; box-shadow: 0 0 0 3px rgba(184, 166, 255, 0.24); }
.world-atlas-marker-town span,
.world-atlas-marker-market span,
.world-atlas-marker-port span { background: #7fc8ad; box-shadow: 0 0 0 3px rgba(127, 200, 173, 0.24); }
.world-atlas-marker-ruin span,
.world-atlas-marker-fort span { background: #e0846e; box-shadow: 0 0 0 3px rgba(224, 132, 110, 0.24); }

.world-atlas-marker strong,
.world-atlas-active-marker strong {
  display: block;
  font-size: 11px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
}

.world-atlas-active-marker {
  border-color: rgba(245, 214, 107, 0.84);
  pointer-events: none;
  z-index: 7;
}

.world-atlas-active-marker span {
  animation: worldAtlasPulse 1.8s ease-in-out infinite;
  background: #fff2a8;
}

@keyframes worldAtlasPulse {
  0%, 100% { box-shadow: 0 0 0 3px rgba(245, 214, 107, 0.28), 0 0 0 8px rgba(245, 214, 107, 0); }
  50% { box-shadow: 0 0 0 4px rgba(245, 214, 107, 0.42), 0 0 0 14px rgba(245, 214, 107, 0.16); }
}

@keyframes worldAtlasFrameTurn {
  to { transform: rotate(1turn); }
}

@keyframes worldAtlasMapGleam {
  0%, 100% {
    opacity: 0.76;
    filter: drop-shadow(0 0 0 rgba(216, 157, 74, 0));
  }
  50% {
    opacity: 1;
    filter: drop-shadow(0 0 8px rgba(216, 157, 74, 0.28));
  }
}

.world-atlas-legend-popover,
.world-atlas-floating-panel {
  background: rgba(8, 12, 11, 0.92);
  border: 1px solid rgba(127, 200, 173, 0.28);
  border-radius: 8px;
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
  position: absolute;
  z-index: 20;
}

.world-atlas-legend-popover {
  display: grid;
  gap: 12px;
  max-height: min(560px, 68dvh);
  overflow: auto;
  padding: 13px;
  right: 12px;
  scrollbar-color: rgba(127, 200, 173, 0.55) rgba(255, 250, 242, 0.08);
  top: 12px;
  width: min(340px, calc(100% - 24px));
}

.world-atlas-legend-popover header,
.world-atlas-legend-section {
  display: grid;
  gap: 6px;
}

.world-atlas-legend-popover header span,
.world-atlas-legend-section > span {
  color: #7fc8ad;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.world-atlas-legend-popover header strong {
  color: #fffaf2;
  font-size: 15px;
  font-weight: 950;
  line-height: 1.1;
}

.world-atlas-legend-section p {
  color: rgba(255, 250, 242, 0.6);
  font-size: 12px;
  font-weight: 760;
  margin: 0;
}

.world-atlas-floating-panel {
  bottom: 12px;
  left: 12px;
  max-width: min(360px, calc(100% - 24px));
}

.world-atlas-floating-panel .world-atlas-panel-section {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.world-atlas-panel {
  align-content: start;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.world-atlas-panel-section {
  background: rgba(255, 250, 242, 0.055);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 13px;
}

.world-atlas-panel-section h3 {
  color: #fffaf2;
  font-size: 19px;
  font-weight: 950;
  line-height: 1.08;
}

.world-atlas-panel-section p {
  color: rgba(255, 250, 242, 0.68);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.38;
}

.world-atlas-current {
  border-top: 1px solid rgba(255, 250, 242, 0.12);
  display: grid;
  gap: 6px;
  padding-top: 10px;
}

.world-atlas-current em {
  color: rgba(255, 250, 242, 0.55);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.world-atlas-current strong {
  color: #fffaf2;
  font-size: 14px;
  font-weight: 900;
}

.world-atlas-unread-panel {
  background:
    linear-gradient(135deg, rgba(213, 40, 63, 0.12), transparent 58%),
    rgba(7, 5, 7, 0.32);
  border: 1px solid rgba(213, 40, 63, 0.28);
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 10px;
}

.world-atlas-unread-panel > header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.world-atlas-unread-panel > header span {
  color: #ffccd3;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.world-atlas-unread-panel > header em {
  color: rgba(255, 250, 242, 0.64);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
}

.world-atlas-unread-list {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr));
}

.world-atlas-unread-list button {
  appearance: none;
  background: rgba(7, 5, 7, 0.4);
  border: 1px solid rgba(255, 250, 242, 0.13);
  border-radius: 8px;
  color: #fffaf2;
  cursor: pointer;
  display: grid;
  gap: 3px;
  min-height: 68px;
  padding: 10px 42px 10px 10px;
  position: relative;
  text-align: left;
}

.world-atlas-unread-list button:hover,
.world-atlas-unread-list button:focus-visible {
  border-color: rgba(255, 205, 115, 0.58);
  outline: none;
}

.world-atlas-unread-list button > span {
  color: #f0c66a;
  font-size: 9px;
  font-weight: 950;
  text-transform: uppercase;
}

.world-atlas-unread-list strong {
  font-size: 13px;
  font-weight: 950;
  line-height: 1.08;
}

.world-atlas-unread-list em {
  color: rgba(255, 250, 242, 0.6);
  font-size: 10px;
  font-style: normal;
  font-weight: 760;
  line-height: 1.2;
}

.world-atlas-list {
  display: grid;
  gap: 7px;
}

.world-atlas-list button,
.world-atlas-clear {
  appearance: none;
  background: rgba(7, 5, 7, 0.34);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  color: #fffaf2;
  cursor: pointer;
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  text-align: left;
}

.world-atlas-list button:hover,
.world-atlas-list button:focus-visible,
.world-atlas-clear:hover,
.world-atlas-clear:focus-visible {
  border-color: rgba(127, 200, 173, 0.64);
  outline: none;
}

.world-atlas-list strong {
  font-size: 13px;
  font-weight: 900;
}

.world-atlas-list em {
  color: rgba(255, 250, 242, 0.56);
  font-size: 10px;
  font-style: normal;
  font-weight: 850;
  text-transform: uppercase;
}

.world-atlas-clear {
  color: rgba(255, 250, 242, 0.68);
  font-size: 11px;
  font-weight: 850;
}

.world-atlas-selected-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.world-atlas-selected img {
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 8px;
  display: block;
  max-height: 180px;
  object-fit: cover;
  width: 100%;
}

.codex-search-shell {
  background: rgba(255, 250, 242, 0.064);
  border: 1px solid rgba(255, 250, 242, 0.13);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 10px 12px 12px;
}

.codex-search-shell span {
  color: rgba(255, 250, 242, 0.62);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.codex-search {
  appearance: none;
  background: transparent;
  border: 0;
  color: #fffaf2;
  font-size: 18px;
  font-weight: 850;
  line-height: 1.2;
  min-height: 32px;
  outline: none;
  width: 100%;
}

.codex-search::placeholder {
  color: rgba(255, 250, 242, 0.34);
}

.sheet-block.codex-rules-shell,
.sheet-block.codex-spells-shell {
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  min-height: min(74vh, 720px);
  padding: 0;
}

.sheet-page > .sheet-block.codex-rules-shell,
.sheet-page > .sheet-block.codex-spells-shell {
  margin-left: 0;
}

.codex-rules-search-page,
.codex-spells-search-page {
  align-content: center;
  display: grid;
  gap: 24px;
  justify-items: center;
  min-height: clamp(360px, 58vh, 590px);
  width: 100%;
}

.codex-rules-search-page.has-query,
.codex-spells-search-page.has-query {
  align-content: start;
  min-height: 0;
  padding-top: 18px;
}

.codex-rules-search-hero,
.codex-spells-search-hero {
  display: grid;
  gap: 14px;
  justify-items: center;
  width: min(720px, 100%);
}

.codex-rules-wordmark,
.codex-spells-wordmark {
  color: #fffaf2;
  font-size: clamp(44px, 7vw, 76px);
  font-weight: 950;
  line-height: 0.95;
  text-align: center;
  text-shadow: 0 18px 52px rgba(0, 0, 0, 0.46);
}

.codex-rules-search-page.has-query .codex-rules-wordmark,
.codex-spells-search-page.has-query .codex-spells-wordmark {
  font-size: clamp(28px, 3.6vw, 40px);
}

.codex-rules-search-box,
.codex-spells-search-box {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.09), rgba(255, 250, 242, 0.035)),
    rgba(11, 8, 10, 0.7);
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 999px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 250, 242, 0.08);
  display: grid;
  gap: 12px;
  grid-template-columns: 22px minmax(0, 1fr);
  min-height: 58px;
  padding: 0 22px;
  position: relative;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, background 0.14s ease;
  width: min(680px, 100%);
}

.codex-rules-search-box:hover,
.codex-rules-search-box:focus-within,
.codex-spells-search-box:hover,
.codex-spells-search-box:focus-within {
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.12), rgba(255, 250, 242, 0.05)),
    rgba(16, 12, 15, 0.78);
  border-color: rgba(240, 198, 106, 0.48);
  box-shadow: 0 20px 58px rgba(0, 0, 0, 0.34), 0 0 0 3px rgba(240, 198, 106, 0.08);
}

.codex-rules-search-label,
.codex-spells-search-label {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.codex-rules-search-icon,
.codex-spells-search-icon {
  border: 2px solid rgba(255, 250, 242, 0.56);
  border-radius: 999px;
  height: 15px;
  position: relative;
  width: 15px;
}

.codex-rules-search-icon::after,
.codex-spells-search-icon::after {
  background: rgba(255, 250, 242, 0.56);
  border-radius: 999px;
  bottom: -6px;
  content: "";
  height: 8px;
  position: absolute;
  right: -4px;
  transform: rotate(-45deg);
  transform-origin: center;
  width: 2px;
}

.codex-rules-search-input,
.codex-spells-search-input {
  font-size: 21px;
  min-height: 42px;
}

.codex-rules-results,
.codex-spells-results {
  gap: 6px;
  justify-self: center;
  width: min(860px, 100%);
}

.codex-rule-result-wrap,
.codex-spell-result-wrap {
  border-bottom: 1px solid rgba(255, 250, 242, 0.08);
  padding-bottom: 6px;
}

.codex-result-card.rule-result,
.codex-result-card.spell-result {
  background: transparent;
  border-color: transparent;
  border-radius: 10px;
  box-shadow: none;
  padding: 13px 14px;
}

.codex-result-card.rule-result:hover,
.codex-result-card.rule-result:focus-visible,
.codex-result-card.rule-result.active,
.codex-result-card.spell-result:hover,
.codex-result-card.spell-result:focus-visible,
.codex-result-card.spell-result.active {
  background: rgba(255, 250, 242, 0.055);
  border-color: rgba(240, 198, 106, 0.24);
}

.codex-result-card.rule-result strong,
.codex-result-card.spell-result strong {
  color: #fffaf2;
  font-size: 18px;
}

.codex-result-card.rule-result em,
.codex-result-card.spell-result em {
  color: rgba(255, 250, 242, 0.68);
  max-width: 78ch;
}

.codex-rule-detail,
.codex-spell-detail {
  background: rgba(11, 8, 10, 0.48);
  border-color: rgba(240, 198, 106, 0.16);
  margin: 0 14px 8px;
}

.codex-rules-empty,
.codex-spells-empty {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
  min-height: 0;
}

.codex-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.codex-tabs button {
  align-items: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.07);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 999px;
  color: rgba(255, 250, 242, 0.78);
  cursor: pointer;
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  gap: 6px;
  line-height: 1;
  min-height: 32px;
  padding: 8px 11px;
}

.codex-tabs button.active,
.codex-tabs button:hover,
.codex-tabs button:focus-visible {
  background: rgba(240, 198, 106, 0.16);
  border-color: rgba(240, 198, 106, 0.46);
  color: #fffaf2;
  outline: none;
}

.codex-tabs em {
  color: rgba(255, 250, 242, 0.58);
  font-size: 10px;
  font-style: normal;
}

.codex-results {
  display: grid;
  gap: 10px;
}

.codex-live-stack {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.codex-card-wrap {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.codex-card-wrap > .codex-tile {
  width: 100%;
}

.codex-result-wrap {
  display: grid;
  gap: 8px;
}

.codex-result-card {
  align-items: start;
  appearance: none;
  background:
    linear-gradient(135deg, rgba(var(--tile-accent-rgb), 0.13), transparent 54%),
    rgba(255, 250, 242, 0.052);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  color: #fffaf2;
  cursor: pointer;
  display: grid;
  gap: 5px;
  padding: 12px;
  text-align: left;
}

.codex-result-card:hover,
.codex-result-card:focus-visible,
.codex-result-card.active {
  border-color: rgba(var(--tile-accent-rgb), 0.52);
  outline: none;
}

.codex-result-card span {
  color: var(--tile-accent);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.codex-result-card strong {
  font-size: 17px;
  font-weight: 950;
  line-height: 1.12;
}

.codex-result-card em {
  color: rgba(255, 250, 242, 0.7);
  font-size: 13px;
  font-style: normal;
  line-height: 1.35;
}

.codex-inline-detail,
.codex-detail-card {
  background: rgba(12, 9, 11, 0.52);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  color: rgba(255, 250, 242, 0.82);
  display: grid;
  gap: 11px;
  padding: 13px;
}

.codex-detail-card {
  margin-top: 2px;
}

.codex-detail-card header {
  display: grid;
  gap: 2px;
}

.codex-detail-card header span,
.codex-inline-detail h3,
.codex-detail-section h3 {
  color: rgba(240, 198, 106, 0.82);
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

.codex-detail-card header h3 {
  color: #fffaf2;
  font-size: 21px;
  font-weight: 950;
  line-height: 1.1;
  margin: 0;
}

.codex-inline-detail p,
.codex-detail-card p {
  font-size: 13px;
  line-height: 1.48;
  margin: 0;
}

.codex-detail-section,
.codex-track-stack,
.codex-rank-list {
  display: grid;
  gap: 8px;
}

.codex-track-card,
.codex-rank-card {
  background: rgba(255, 250, 242, 0.052);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  padding: 10px;
}

.codex-rank-card {
  display: grid;
  gap: 7px;
}

.codex-rank-card strong {
  color: #fffaf2;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.18;
}

.codex-rank-card em {
  color: rgba(240, 198, 106, 0.82);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  text-transform: uppercase;
}

.codex-fact-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.codex-fact-grid div {
  background: rgba(255, 250, 242, 0.06);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 3px;
  padding: 9px;
}

.codex-fact-grid dt {
  color: rgba(255, 250, 242, 0.52);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.codex-fact-grid dd {
  color: #fffaf2;
  font-size: 13px;
  font-weight: 850;
  margin: 0;
}

.codex-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.codex-chip-row span {
  background: rgba(255, 250, 242, 0.08);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 999px;
  color: rgba(255, 250, 242, 0.76);
  font-size: 10px;
  font-weight: 900;
  line-height: 1;
  padding: 6px 8px;
}

.codex-subgrid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.codex-subgrid section,
.codex-levels section article {
  background: rgba(255, 250, 242, 0.056);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 10px;
}

.codex-subgrid strong,
.codex-levels strong {
  color: #fffaf2;
  font-size: 14px;
  font-weight: 950;
  line-height: 1.16;
}

.codex-subgrid em,
.codex-levels em {
  color: rgba(255, 250, 242, 0.62);
  font-size: 12px;
  font-style: normal;
  line-height: 1.3;
}

.codex-levels {
  display: grid;
  gap: 10px;
}

.codex-levels > section {
  display: grid;
  gap: 8px;
}

.codex-levels > section > span {
  color: rgba(240, 198, 106, 0.78);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.codex-empty,
.codex-count-note {
  background: rgba(255, 250, 242, 0.052);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  color: rgba(255, 250, 242, 0.62);
  font-size: 13px;
  font-weight: 760;
  min-height: 56px;
  padding: 16px;
}

.codex-empty.compact {
  background: transparent;
  border: 0;
  min-height: 0;
  padding: 0;
}

.codex-lore-dialog {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 1220;
}

.codex-lore-modal-backdrop {
  background:
    linear-gradient(180deg, rgba(8, 6, 8, 0.7), rgba(8, 6, 8, 0.92)),
    rgba(9, 7, 10, 0.86);
  inset: 0;
  position: absolute;
}

.codex-lore-panel {
  --tile-accent: #f0c66a;
  --tile-accent-rgb: 240, 198, 106;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.055), rgba(255, 250, 242, 0.018)),
    #141015;
  border: 1px solid rgba(var(--tile-accent-rgb), 0.34);
  border-radius: 8px;
  box-shadow:
    0 30px 90px rgba(0, 0, 0, 0.64),
    inset 0 1px 0 rgba(255, 250, 242, 0.08);
  color: #fffaf2;
  display: grid;
  grid-template-columns: minmax(300px, 0.88fr) minmax(0, 1.12fr);
  height: min(780px, calc(100dvh - 36px));
  max-height: min(780px, calc(100dvh - 36px));
  max-width: min(1060px, calc(100vw - 32px));
  overflow: hidden;
  position: relative;
  width: min(1060px, calc(100vw - 32px));
  z-index: 1;
}

.codex-lore-panel > .codex-lore-modal-close {
  background: rgba(12, 9, 11, 0.68);
  border-color: rgba(255, 250, 242, 0.22);
  color: #fffaf2;
  position: absolute;
  right: 14px;
  top: 14px;
  z-index: 5;
}

.codex-lore-modal-close:hover,
.codex-lore-modal-close:focus-visible {
  background: rgba(var(--tile-accent-rgb), 0.2);
  border-color: rgba(var(--tile-accent-rgb), 0.62);
  outline: none;
}

.codex-lore-modal-art {
  --codex-card-gradient-rgb: var(--tile-accent-rgb);
  --codex-card-gradient-alpha: 0;
  --codex-card-fade-alpha: 0.4;
  align-content: end;
  background:
    linear-gradient(0deg, rgba(7, 5, 7, 0.98) 0%, rgba(7, 5, 7, 0.82) 30%, rgba(7, 5, 7, 0.2) 78%, rgba(7, 5, 7, 0.05) 100%),
    linear-gradient(135deg, rgba(var(--tile-accent-rgb), 0.23), rgba(89, 179, 160, 0.13) 62%, rgba(160, 105, 84, 0.12));
  display: grid;
  min-height: 560px;
  overflow: hidden;
  padding: 24px;
  position: relative;
}

.codex-lore-modal-art.has-image {
  background-image:
    linear-gradient(0deg, rgba(7, 5, 7, calc(0.99 * var(--codex-card-fade-alpha))) 0%, rgba(7, 5, 7, calc(0.82 * var(--codex-card-fade-alpha))) 28%, rgba(7, 5, 7, calc(0.36 * var(--codex-card-fade-alpha))) 64%, rgba(7, 5, 7, calc(0.08 * var(--codex-card-fade-alpha))) 100%),
    linear-gradient(135deg, rgba(var(--codex-card-gradient-rgb), var(--codex-card-gradient-alpha)), rgba(0, 0, 0, calc(0.12 * var(--codex-card-fade-alpha))) 58%, transparent),
    var(--codex-lore-image);
  background-position: center;
  background-size: cover;
}

.codex-lore-modal-art.no-image {
  align-content: center;
  gap: 26px;
}

.codex-lore-modal-initials {
  align-items: center;
  border: 1px solid rgba(var(--tile-accent-rgb), 0.34);
  border-radius: 8px;
  color: rgba(var(--tile-accent-rgb), 0.8);
  display: inline-flex;
  font-size: 58px;
  font-weight: 950;
  height: 132px;
  justify-content: center;
  justify-self: center;
  line-height: 1;
  width: 132px;
}

.codex-lore-modal-art-copy {
  display: grid;
  gap: 7px;
  max-width: 100%;
  position: relative;
  text-shadow: 0 3px 22px rgba(0, 0, 0, 0.9);
  z-index: 1;
}

.codex-lore-modal-art-copy span {
  color: rgba(var(--tile-accent-rgb), 0.92);
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.codex-lore-modal-art-copy h2 {
  color: #fffaf2;
  font-size: 42px;
  font-weight: 950;
  line-height: 0.98;
  margin: 0;
  overflow-wrap: anywhere;
}

.codex-lore-modal-art-copy p {
  color: rgba(255, 250, 242, 0.78);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  margin: 0;
}

.codex-lore-modal-body {
  align-content: start;
  background:
    linear-gradient(135deg, rgba(89, 179, 160, 0.07), transparent 50%),
    rgba(18, 13, 17, 0.96);
  display: grid;
  gap: 18px;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-y: auto;
  padding: 28px;
  scrollbar-color: rgba(var(--tile-accent-rgb), 0.5) rgba(255, 250, 242, 0.06);
  scrollbar-width: thin;
  -webkit-overflow-scrolling: touch;
}

.codex-lore-modal-body::-webkit-scrollbar {
  width: 10px;
}

.codex-lore-modal-body::-webkit-scrollbar-track {
  background: rgba(255, 250, 242, 0.05);
}

.codex-lore-modal-body::-webkit-scrollbar-thumb {
  background: rgba(var(--tile-accent-rgb), 0.42);
  border: 2px solid rgba(18, 13, 17, 0.96);
  border-radius: 999px;
}

.codex-lore-modal-eyebrow {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-right: 42px;
}

.codex-lore-modal-eyebrow span,
.codex-lore-modal-eyebrow strong {
  border: 1px solid rgba(255, 250, 242, 0.13);
  border-radius: 999px;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  padding: 7px 9px;
  text-transform: uppercase;
}

.codex-lore-modal-eyebrow span {
  background: rgba(var(--tile-accent-rgb), 0.14);
  color: rgba(var(--tile-accent-rgb), 0.92);
}

.codex-lore-modal-eyebrow strong {
  background: rgba(89, 179, 160, 0.11);
  color: rgba(255, 250, 242, 0.74);
}

.codex-lore-modal-summary {
  display: grid;
  gap: 11px;
}

.codex-lore-modal-summary p,
.codex-lore-modal-sections p {
  color: rgba(255, 250, 242, 0.88);
  font-size: 15px;
  line-height: 1.62;
  margin: 0;
  max-width: 68ch;
}

.codex-lore-modal-summary strong,
.codex-lore-modal-sections strong {
  color: #fffaf2;
  font-weight: 950;
}

.codex-lore-modal-facts {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin: 0;
}

.codex-lore-modal-facts div {
  background: rgba(255, 250, 242, 0.055);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 10px;
}

.codex-lore-modal-facts dt {
  color: rgba(var(--tile-accent-rgb), 0.78);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.codex-lore-modal-facts dd {
  color: #fffaf2;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.32;
  margin: 0;
  overflow-wrap: anywhere;
}

.codex-lore-modal-sections {
  display: grid;
  gap: 18px;
}

.codex-lore-modal-sections section {
  border-top: 1px solid rgba(255, 250, 242, 0.1);
  display: grid;
  gap: 10px;
  padding-top: 16px;
}

.codex-lore-modal-sections h3 {
  color: rgba(var(--tile-accent-rgb), 0.84);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

.codex-lore-modal-body .codex-chip-row {
  padding-top: 2px;
}

.codex-detail-panel-classes,
.codex-tile-classes {
  --tile-accent: #e4896f;
  --tile-accent-rgb: 228, 137, 111;
}

.codex-detail-panel-races,
.codex-detail-panel-backgrounds,
.codex-tile-options {
  --tile-accent: #a7d978;
  --tile-accent-rgb: 167, 217, 120;
}

.codex-detail-panel-vehicles,
.codex-vehicle-tile {
  --tile-accent: #76c8ea;
  --tile-accent-rgb: 118, 200, 234;
}

.codex-modal-list,
.codex-subclass-stack {
  display: grid;
  gap: 10px;
}

.codex-modal-list article,
.codex-subclass-card {
  background: rgba(255, 250, 242, 0.055);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  color: rgba(255, 250, 242, 0.84);
  display: grid;
  gap: 7px;
  padding: 11px;
}

.codex-modal-list article strong {
  color: #fffaf2;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
}

.codex-modal-list article p {
  font-size: 13px;
  line-height: 1.48;
}

.codex-detail-panel-resource-table {
  --tile-accent: #8cd6ff;
  --tile-accent-rgb: 140, 214, 255;
}

.resource-table-modal-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.resource-table-loading {
  background: rgba(255, 250, 242, 0.055);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  color: rgba(255, 250, 242, 0.72);
  font-size: 13px;
  font-weight: 850;
  padding: 14px;
}

.resource-table-note {
  color: rgba(255, 250, 242, 0.78);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.resource-table-pool,
.resource-table-list {
  display: grid;
  gap: 9px;
}

.resource-table-pool {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.resource-table-pool article,
.resource-table-list article {
  background: rgba(255, 250, 242, 0.055);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  color: rgba(255, 250, 242, 0.84);
  min-width: 0;
}

.resource-table-pool article {
  display: grid;
  gap: 7px;
  padding: 11px;
}

.resource-table-pool span,
.resource-table-roll,
.resource-table-cost {
  background: rgba(var(--tile-accent-rgb), 0.14);
  border: 1px solid rgba(var(--tile-accent-rgb), 0.28);
  border-radius: 999px;
  color: rgba(var(--tile-accent-rgb), 0.94);
  display: inline-flex;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  padding: 6px 8px;
  text-transform: uppercase;
  width: fit-content;
}

.resource-table-pool strong {
  color: #fffaf2;
  font-size: 20px;
  font-weight: 950;
  line-height: 1;
}

.resource-table-pool p,
.resource-table-list p {
  color: rgba(255, 250, 242, 0.78);
  font-size: 13px;
  line-height: 1.48;
  margin: 0;
}

.resource-table-list article {
  display: grid;
  gap: 10px;
  grid-template-columns: 48px minmax(0, 1fr);
  padding: 10px;
}

.resource-table-list.resource-table-uses article {
  grid-template-columns: minmax(72px, auto) minmax(0, 1fr);
}

.resource-table-roll {
  align-items: center;
  border-radius: 8px;
  font-size: 13px;
  justify-content: center;
  min-height: 34px;
  padding: 8px 6px;
  width: 100%;
}

.resource-table-cost {
  align-self: start;
  border-radius: 8px;
  justify-content: center;
  min-height: 30px;
  text-align: center;
  width: 100%;
}

.resource-table-list article > div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.resource-table-list strong {
  color: #fffaf2;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.codex-subclass-card {
  padding: 0;
}

.codex-subclass-card summary {
  align-items: start;
  cursor: pointer;
  display: grid;
  gap: 5px;
  grid-template-columns: minmax(0, 1fr) auto;
  list-style: none;
  padding: 12px;
}

.codex-subclass-card summary::-webkit-details-marker {
  display: none;
}

.codex-subclass-card summary::after {
  background:
    linear-gradient(currentColor, currentColor) center / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 10px no-repeat,
    rgba(var(--tile-accent-rgb), 0.14);
  border: 1px solid rgba(var(--tile-accent-rgb), 0.28);
  border-radius: 999px;
  color: rgba(var(--tile-accent-rgb), 0.92);
  content: "";
  display: block;
  flex: 0 0 auto;
  font-weight: 950;
  height: 26px;
  line-height: 1;
  width: 26px;
}

.codex-subclass-card[open] summary::after {
  background:
    linear-gradient(currentColor, currentColor) center / 10px 2px no-repeat,
    rgba(var(--tile-accent-rgb), 0.14);
}

.codex-subclass-card summary span,
.codex-subclass-body h4 {
  color: rgba(var(--tile-accent-rgb), 0.84);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  margin: 0;
  text-transform: uppercase;
}

.codex-subclass-card summary strong,
.codex-subclass-card summary em {
  grid-column: 1;
}

.codex-subclass-card summary strong {
  color: #fffaf2;
  font-size: 16px;
  font-weight: 950;
  line-height: 1.16;
}

.codex-subclass-card summary em {
  color: rgba(255, 250, 242, 0.68);
  font-size: 12px;
  font-style: normal;
  line-height: 1.36;
}

.codex-subclass-body {
  border-top: 1px solid rgba(255, 250, 242, 0.08);
  display: grid;
  gap: 12px;
  padding: 12px;
}

.codex-lore-modal-sections .codex-levels,
.codex-lore-modal-sections .codex-track-stack {
  gap: 12px;
}

.codex-lore-modal-sections .codex-levels > section > span,
.codex-lore-modal-sections .codex-rank-card em {
  color: rgba(var(--tile-accent-rgb), 0.78);
}

.codex-lore-modal-sections .codex-levels section article,
.codex-lore-modal-sections .codex-track-card,
.codex-lore-modal-sections .codex-rank-card {
  background: rgba(255, 250, 242, 0.052);
  border-color: rgba(255, 250, 242, 0.1);
}

@media (max-width: 760px) {
  .play-sheet:has(.sheet-content.codex-mode) {
    padding: 0;
  }

  .sheet-content.codex-mode {
    gap: 0;
  }

  .sheet-content.codex-mode .sheet-page[data-codex-page="codex:world-map"] {
    align-content: stretch;
    min-height: calc(100dvh - 136px - env(safe-area-inset-bottom, 0px));
    padding: 0;
  }

  .sheet-page[data-codex-page="codex:world-map"] .codex-world-map-shell,
  .sheet-page[data-codex-page="codex:world-map"] .world-atlas-layout,
  .sheet-page[data-codex-page="codex:world-map"] .world-atlas-map-shell,
  .sheet-page[data-codex-page="codex:world-map"] .world-atlas-map-frame,
  .sheet-page[data-codex-page="codex:world-map"] .world-atlas-viewer {
    height: 100%;
    min-height: 0;
  }

  .sheet-page[data-codex-page="codex:world-map"] .codex-world-map-shell {
    gap: 0;
  }

  .world-atlas-map-shell {
    background: #0a1412;
    border: 0;
    border-radius: 0;
    max-width: none;
    overflow: hidden;
    padding: 0;
  }

  .world-atlas-bar {
    align-items: center;
    display: flex;
    left: 8px;
    pointer-events: none;
    position: absolute;
    right: 8px;
    top: 8px;
    z-index: 26;
  }

  .world-atlas-bar > div:first-child,
  .world-atlas-breadcrumbs {
    display: none;
  }

  .world-atlas-actions {
    justify-content: space-between;
    pointer-events: auto;
    width: 100%;
  }

  .world-atlas-map-frame {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    box-shadow: none;
    padding: 7px;
  }

  .world-atlas-map-frame::after {
    inset: 2px;
  }

  .world-atlas-zoom-controls {
    background: rgba(7, 5, 7, 0.62);
    backdrop-filter: blur(10px);
    margin-left: auto;
    order: 2;
  }

  .world-atlas-zoom-button {
    display: none;
  }

  .world-atlas-stage-viewport {
    --atlas-mobile-stage-height: calc(100dvh - 136px - env(safe-area-inset-bottom, 0px));
    border-color: rgba(245, 214, 107, 0.3);
    border-radius: 6px;
    height: calc(var(--atlas-mobile-stage-height) - 14px);
    max-height: none;
    overscroll-behavior: none;
    scrollbar-width: none;
    touch-action: none;
  }

  .world-atlas-stage-viewport::-webkit-scrollbar {
    display: none;
  }

  .world-atlas-stage {
    height: var(--atlas-stage-mobile-height, var(--atlas-mobile-stage-height));
    min-height: 100%;
    min-width: 100%;
    width: var(--atlas-stage-mobile-width, 100%);
  }

  .world-atlas-text-label {
    font-size: clamp(8px, calc(var(--atlas-text-size, 3.2) * 1cqh), 74px);
    text-shadow:
      0 1px 0 rgba(8, 7, 5, 0.98),
      1px 0 0 rgba(8, 7, 5, 0.86),
      -1px 0 0 rgba(8, 7, 5, 0.86),
      0 0 7px rgba(0, 0, 0, 0.62);
  }

  .world-atlas-legend-popover {
    left: 8px;
    max-height: calc(100% - 68px);
    right: 8px;
    top: 58px;
    width: auto;
  }

  .world-atlas-marker,
  .world-atlas-active-marker {
    max-width: 170px;
  }

  .world-atlas-marker strong,
  .world-atlas-active-marker strong {
    font-size: 10px;
  }

  .codex-lore-dialog {
    align-items: stretch;
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom));
  }

  .codex-lore-panel {
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto minmax(0, 1fr);
    height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-height: calc(100dvh - 20px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    max-width: 100%;
    min-height: 0;
    width: 100%;
  }

  .codex-lore-modal-art {
    min-height: 270px;
    padding: 18px;
  }

  .codex-lore-modal-art.has-image {
    background-position: center top;
  }

  .codex-lore-modal-art-copy h2 {
    font-size: 34px;
  }

  .codex-lore-modal-body {
    gap: 15px;
    padding: 18px;
  }

  .codex-lore-modal-close {
    right: 12px;
    top: 12px;
  }
}

@media (max-width: 460px) {
  .world-atlas-marker,
  .world-atlas-active-marker {
    padding: 5px;
  }

  .world-atlas-floating-panel {
    bottom: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
  }

  .world-atlas-legend-popover {
    left: 8px;
    right: 8px;
    top: 58px;
    width: auto;
  }

  .world-atlas-marker strong,
  .world-atlas-active-marker strong {
    display: none;
  }

  .codex-lore-modal-art {
    min-height: 238px;
  }

  .codex-lore-modal-art-copy h2 {
    font-size: 30px;
  }

  .codex-lore-modal-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .codex-lore-modal-summary p,
  .codex-lore-modal-sections p {
    font-size: 14px;
  }

  .resource-table-list article,
  .resource-table-list.resource-table-uses article {
    grid-template-columns: minmax(0, 1fr);
  }

  .resource-table-roll,
  .resource-table-cost {
    justify-self: start;
    width: fit-content;
  }
}

@media (max-width: 1120px) and (min-width: 621px) {
  .codex-home-shell .codex-home-grid,
  .codex-section-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1180px) {
  .codex-vehicle-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1179px) and (min-width: 821px) {
  .codex-vehicle-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  .codex-shell {
    gap: 12px;
    padding: 8px;
  }

  .codex-home-shell {
    min-height: 0;
    padding: 0;
  }

  .codex-grid {
    gap: 10px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

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

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

  .codex-home-shell .codex-home-grid {
    align-content: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    min-height: 0;
  }

  .codex-section-grid {
    align-content: stretch;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-rows: none;
    min-height: 0;
  }

  .codex-category-shell .codex-section-grid,
  .codex-options-shell .codex-section-grid-count-2 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .codex-tile {
    min-height: 158px;
    padding: 11px;
  }

  .codex-home-shell .codex-tile,
  .codex-section-grid .codex-tile {
    aspect-ratio: auto;
    min-height: 188px;
    padding: 12px;
  }

  .codex-section-grid .codex-section-tile.has-image {
    min-height: 188px;
  }

  .codex-tile-art {
    height: 38px;
    right: 10px;
    top: 10px;
    width: 38px;
  }

  .codex-tile-art b {
    font-size: 13px;
  }

  .codex-tile-kicker {
    font-size: 9px;
    padding-right: 44px;
  }

  .codex-tile strong {
    font-size: 15px;
    line-height: 1.08;
    overflow-wrap: normal;
    word-break: normal;
  }

  .codex-tile em {
    font-size: 11px;
    -webkit-line-clamp: 2;
    overflow-wrap: normal;
    word-break: normal;
  }

  .codex-home-shell .codex-tile-kicker,
  .codex-section-grid .codex-tile-kicker {
    font-size: 9px;
  }

  .codex-home-shell .codex-tile strong,
  .codex-section-grid .codex-section-tile.has-image strong {
    font-size: clamp(17px, 4.65vw, 22px);
    line-height: 1.04;
    overflow-wrap: normal;
    word-break: normal;
  }

  .codex-home-shell .codex-tile em,
  .codex-section-grid .codex-section-tile.has-image em {
    font-size: 12px;
    line-height: 1.26;
    max-width: none;
    -webkit-line-clamp: 3;
  }

  .codex-home-shell .codex-tile small,
  .codex-section-grid .codex-section-tile.has-image small {
    font-size: 9px;
  }

  .codex-home-shell .codex-tile em {
    -webkit-line-clamp: 3;
  }

  .codex-search {
    font-size: 16px;
  }

  .sheet-block.codex-rules-shell,
  .sheet-block.codex-spells-shell {
    min-height: min(64vh, 560px);
    padding: 0;
  }

  .codex-rules-search-page,
  .codex-spells-search-page {
    gap: 18px;
    min-height: clamp(300px, 50vh, 460px);
  }

  .codex-rules-search-page.has-query,
  .codex-spells-search-page.has-query {
    padding-top: 8px;
  }

  .codex-rules-search-hero,
  .codex-spells-search-hero {
    gap: 12px;
    width: 100%;
  }

  .codex-rules-wordmark,
  .codex-spells-wordmark {
    font-size: clamp(38px, 12vw, 52px);
  }

  .codex-rules-search-page.has-query .codex-rules-wordmark,
  .codex-spells-search-page.has-query .codex-spells-wordmark {
    font-size: 28px;
  }

  .codex-rules-search-box,
  .codex-spells-search-box {
    gap: 10px;
    grid-template-columns: 20px minmax(0, 1fr);
    min-height: 52px;
    padding: 0 16px;
  }

  .codex-rules-search-input,
  .codex-spells-search-input {
    font-size: 16px;
    min-height: 38px;
  }

  .codex-result-card.rule-result,
  .codex-result-card.spell-result {
    padding: 12px 8px;
  }

  .codex-result-card.rule-result strong,
  .codex-result-card.spell-result strong {
    font-size: 16px;
  }

  .codex-rule-detail,
  .codex-spell-detail {
    margin: 0 8px 8px;
  }

  .codex-fact-grid,
  .codex-subgrid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.sheet-track.is-animating[data-direction="next"] .sheet-page.current {
  animation: sheetPageInNext .28s ease both;
}

.sheet-track.is-animating[data-direction="prev"] .sheet-page.current {
  animation: sheetPageInPrev .28s ease both;
}

.page-head {
  color: #fffaf2;
  display: grid;
  gap: 3px;
  justify-items: center;
  padding: 3px 2px;
  text-align: center;
}

.page-head h2 {
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
}

.page-head .kicker {
  color: rgba(255, 250, 242, 0.62);
}

.page-grid {
  align-items: start;
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.page-grid.split-wide {
  grid-template-columns: minmax(0, .95fr) minmax(0, 1.35fr);
}

.weight-load-block {
  padding: 10px 13px;
}

.weight-load-bar {
  --weight-color: var(--muted);
  --weight-color-end: var(--muted-strong);
  --weight-glow: rgba(255, 250, 242, 0.1);
  align-items: center;
  color: var(--muted-strong);
  display: grid;
  gap: 10px 16px;
  grid-template-columns: 76px 38px minmax(116px, max-content) 58px minmax(160px, 1fr) minmax(104px, max-content);
  min-height: 38px;
}

.weight-load-bar.load-light {
  --weight-color: var(--success);
  --weight-color-end: #88d69d;
  --weight-glow: rgba(85, 184, 120, 0.2);
}

.weight-load-bar.load-medium {
  --weight-color: var(--gold);
  --weight-color-end: #e6bb6d;
  --weight-glow: rgba(216, 157, 74, 0.22);
}

.weight-load-bar.load-heavy {
  --weight-color: #e77855;
  --weight-color-end: #f0aa65;
  --weight-glow: rgba(231, 120, 85, 0.24);
}

.weight-load-bar.load-overloaded {
  --weight-color: var(--danger);
  --weight-color-end: #f07b73;
  --weight-glow: rgba(216, 88, 82, 0.26);
}

.weight-load-bar.load-infinite {
  --weight-color: #58e0cb;
  --weight-color-end: #f0d98a;
  --weight-glow: rgba(112, 232, 215, 0.32);
}

.weight-load-kicker {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.weight-load-icon {
  align-self: center;
  background: rgba(255, 243, 231, 0.055);
  border: 1px solid rgba(255, 243, 231, 0.16);
  border-radius: 8px;
  color: rgba(255, 250, 242, 0.84);
  display: grid;
  height: 34px;
  place-items: center;
  width: 34px;
}

.weight-load-icon svg {
  display: block;
  fill: currentColor;
  height: 23px;
  width: 23px;
}

.weight-load-amount,
.weight-load-state {
  color: #fff3e7;
  font-size: 13px;
  font-weight: 950;
  white-space: nowrap;
}

.weight-load-percent {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.weight-load-track {
  background: rgba(255, 250, 242, 0.08);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 242, 0.04);
  display: block;
  height: 13px;
  min-width: 120px;
  overflow: hidden;
  position: relative;
}

.weight-load-track i {
  background: linear-gradient(90deg, var(--weight-color), var(--weight-color-end));
  box-shadow: 0 0 16px var(--weight-glow);
  display: block;
  height: 100%;
  transition: width 180ms ease, background 180ms ease;
  width: var(--weight-fill, 0%);
}

.weight-load-bar.load-infinite .weight-load-icon {
  border-color: rgba(88, 224, 203, 0.36);
  box-shadow: 0 0 18px rgba(88, 224, 203, 0.12), inset 0 0 14px rgba(240, 217, 138, 0.08);
  color: #dffcf6;
}

.weight-load-bar.load-infinite .weight-load-amount {
  color: #f8f1cd;
  text-shadow: 0 0 14px rgba(88, 224, 203, 0.28);
}

.weight-load-bar.load-infinite .weight-load-percent {
  color: #91f0df;
}

.weight-load-bar.load-infinite .weight-load-track {
  background: linear-gradient(90deg, rgba(88, 224, 203, 0.16), rgba(240, 217, 138, 0.11));
  border-color: rgba(88, 224, 203, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 250, 242, 0.08), 0 0 22px rgba(88, 224, 203, 0.13);
}

.weight-load-bar.load-infinite .weight-load-track i {
  background: linear-gradient(90deg, #58e0cb, #f8f1cd, #ad8cff, #58e0cb);
  background-size: 220% 100%;
  animation: infinite-weight-flow 2.8s linear infinite;
}

.weight-load-state {
  color: var(--weight-color);
  justify-self: end;
  text-align: right;
}

@keyframes infinite-weight-flow {
  from { background-position: 0% 50%; }
  to { background-position: 220% 50%; }
}

@media (prefers-reduced-motion: reduce) {
  .weight-load-bar.load-infinite .weight-load-track i {
    animation: none;
  }
}

@media (min-width: 921px) {
  .gear-grid {
    align-items: start;
    --gear-equipment-height: auto;
    grid-template-columns: minmax(360px, .78fr) minmax(0, 1.55fr);
  }

  .gear-grid > .sheet-block {
    min-height: 0;
  }

  .gear-grid .equipment-block {
    position: sticky;
    top: 76px;
  }

  .gear-grid .inventory-block {
    align-content: stretch;
    grid-template-rows: auto minmax(0, 1fr);
    height: var(--gear-equipment-height);
    overflow: hidden;
  }

  .gear-grid #inventoryList {
    height: 100%;
    max-height: none;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding-right: 4px;
    scrollbar-gutter: stable;
  }
}

.magic-stack {
  display: grid;
  gap: 14px;
}

.combat-loadout-grid {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr) minmax(190px, max-content);
}

.combat-top-grid {
  align-items: stretch;
  grid-template-columns: minmax(0, 1fr);
}

.combat-top-grid > .sheet-block {
  min-width: 0;
}

.movement-block {
  align-self: stretch;
  justify-self: start;
  max-width: 100%;
  min-width: 190px;
  width: max-content;
}

.conditions-block {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), transparent 54%),
    var(--surface);
  display: none;
}

.condition-controls {
  align-items: end;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, 220px) minmax(180px, 1fr) auto;
}

.sheet-block {
  align-content: start;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 12px;
  padding: 15px;
}

.vendor-store-grid,
.vendor-sell-list {
  display: grid;
  gap: 7px;
}

.vendor-store-grid {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

.vendor-search-block {
  background:
    linear-gradient(135deg, rgba(89, 179, 160, 0.12), transparent 54%),
    var(--surface);
  gap: 8px;
}

.vendor-search-row {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.vendor-search-field {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.vendor-search-field span,
.vendor-search-count {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
}

.vendor-search-input {
  min-height: 38px;
}

.vendor-search-clear {
  align-self: end;
  min-height: 38px;
}

.vendor-store-card,
.vendor-sell-row {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.08), transparent 50%),
    var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 38px minmax(0, 1fr);
  padding: 8px;
}

.vendor-sell-row {
  align-items: center;
  grid-template-columns: 38px minmax(0, 1fr) auto;
}

.vendor-store-card.browse-only {
  align-items: start;
}

.vendor-stock-block {
  gap: 10px;
}

.vendor-store-card .item-heading strong,
.vendor-sell-row .item-heading strong {
  font-size: 14px;
}

.vendor-store-card .item-heading span,
.vendor-sell-row .item-heading span {
  padding: 3px 6px;
}

.vendor-store-card .item-traits span,
.vendor-sell-row .item-traits span {
  padding: 3px 6px;
}

.vendor-store-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.vendor-store-head {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.vendor-store-actions {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 70px auto;
  justify-content: start;
}

.vendor-store-card .vendor-store-actions {
  grid-template-columns: 70px auto;
}

.vendor-store-card .vendor-store-actions-secondary {
  grid-template-columns: auto;
}

.vendor-inspect-action {
  min-height: 34px;
}

.vendor-heading-inspect {
  justify-self: end;
  min-width: 78px;
}

.vendor-qty-input {
  min-height: 34px;
  padding: 6px 8px;
}

.vendor-stock-block .item-description {
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  display: -webkit-box;
  font-size: 12px;
  line-height: 1.3;
  overflow: hidden;
}

.vendor-store-card.browse-only .item-description {
  -webkit-line-clamp: 1;
}

.vendor-modal-description {
  display: grid;
  gap: 8px;
  overflow-wrap: anywhere;
}

.vendor-modal-description p {
  margin: 0;
}

.codex-detail-panel-vendor-item .codex-lore-modal-art.no-image {
  background:
    radial-gradient(circle at 22% 20%, rgba(216, 157, 74, 0.32), transparent 34%),
    linear-gradient(150deg, rgba(89, 179, 160, 0.18), rgba(216, 157, 74, 0.12)),
    #21171a;
}

.vendor-modal-effects {
  align-items: flex-start;
}

.vendor-modal-properties {
  gap: 8px;
}

.vendor-item-facts,
.vendor-item-properties {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.inventory-expanded-title.compact {
  border-top: 1px solid var(--line);
  padding-top: 2px;
}

.vendor-item-status {
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  justify-self: start;
  line-height: 1;
  padding: 5px 7px;
}

.vendor-stock-more {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.vendor-stock-more .btn {
  min-height: 34px;
}

.vendor-closed-block {
  border-color: rgba(245, 158, 11, 0.28);
  background: rgba(245, 158, 11, 0.08);
}

.vendor-closed-block .section-title strong {
  color: #f8d37e;
}

.vehicle-page-head .kicker {
  color: #72d3be;
}

.vehicle-traits,
.vehicle-system-grid,
.vehicle-upgrade-grid {
  display: grid;
  gap: 10px;
}

.vehicle-system-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.vehicle-system-card,
.vehicle-upgrade-card {
  background:
    linear-gradient(135deg, rgba(114, 211, 190, 0.1), transparent 52%),
    var(--surface-2);
  border: 1px solid rgba(114, 211, 190, 0.18);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  min-width: 0;
  padding: 12px;
}

.vehicle-system-card span {
  color: #72d3be;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.vehicle-system-card strong,
.vehicle-upgrade-card strong {
  font-size: 15px;
  font-weight: 950;
}

.vehicle-system-card p,
.vehicle-upgrade-card p {
  color: rgba(248, 239, 228, 0.72);
  font-size: 13px;
  line-height: 1.45;
  margin: 0;
}

.vehicle-upgrade-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.vehicle-progress {
  background: rgba(255, 250, 242, 0.1);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.vehicle-progress span {
  background: linear-gradient(90deg, #72d3be, var(--gold));
  display: block;
  height: 100%;
  transition: width 180ms ease;
}

.vehicle-contribute-row {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(86px, 1fr) auto;
}

.vehicle-cargo-card {
  background:
    linear-gradient(135deg, rgba(114, 211, 190, 0.08), transparent 52%),
    var(--surface-2);
  border-color: rgba(114, 211, 190, 0.16);
}

.vehicle-cargo-actions {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(72px, 96px) repeat(3, auto);
  justify-content: start;
}

.vehicle-cargo-qty {
  min-height: 34px;
  padding: 6px 8px;
}

.section-title {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.section-title span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.section-title strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-grid,
.ability-grid,
.detail-grid {
  display: grid;
  gap: 9px;
}

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

.tag-list,
.score-list,
.equipment-list,
.weapon-list,
.movement-list,
.condition-list,
.inventory-list,
.spell-slots,
.spell-list,
.resource-list,
.feature-list {
  align-content: start;
  display: grid;
  gap: 8px;
}

.inventory-category-title span,
.inventory-expanded-title span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.inventory-category-title strong {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.inventory-category {
  display: grid;
  gap: 9px;
}

.inventory-category-title {
  align-items: center;
  border-bottom: 1px solid rgba(226, 195, 151, 0.16);
  display: flex;
  gap: 10px;
  justify-content: space-between;
  padding: 2px 2px 7px;
}

.tag-list {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
}

.condition-list {
  grid-template-columns: repeat(auto-fit, minmax(154px, max-content));
}

.condition-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 58px;
  min-width: min(220px, 100%);
  padding: 10px 12px;
}

.condition-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  grid-column: 1 / -1;
  text-transform: uppercase;
}

.condition-card strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  overflow-wrap: anywhere;
}

.condition-remove {
  align-self: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.06);
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 999px;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 10px;
  font-weight: 950;
  min-height: 26px;
  padding: 5px 8px;
  text-transform: uppercase;
  touch-action: manipulation;
  white-space: nowrap;
  -webkit-tap-highlight-color: transparent;
}

.condition-remove:hover {
  background: rgba(216, 88, 82, 0.18);
  border-color: rgba(216, 88, 82, 0.42);
  color: #fffaf2;
}

.condition-card.danger {
  border-left-color: var(--danger);
}

.condition-card.success {
  border-left-color: var(--success);
}

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

.gear-grid .equipment-list {
  grid-template-columns: 1fr;
}

.tag-list.spaced {
  margin-top: 8px;
}

.tag {
  align-content: center;
  background: rgba(255, 243, 231, 0.045);
  border: 1px solid rgba(226, 195, 151, 0.18);
  border-radius: 999px;
  box-shadow: inset 0 1px 0 rgba(255, 250, 242, 0.04);
  color: var(--muted);
  cursor: default;
  display: inline-grid;
  font-size: 11px;
  font-weight: 850;
  gap: 3px;
  line-height: 1.15;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  overflow-wrap: break-word;
  padding: 5px 9px;
  vertical-align: top;
  word-break: normal;
}

.tag small {
  color: rgba(var(--accent-rgb), 0.88);
  display: block;
  font-size: 10px;
  font-weight: 950;
  line-height: 1.1;
  text-transform: uppercase;
}

.tag.success {
  border-color: rgba(47, 123, 79, 0.42);
  color: var(--success);
}

.tag.danger {
  border-color: rgba(184, 66, 60, 0.44);
  color: var(--danger);
}

.tag.accent {
  border-color: rgba(79, 74, 143, 0.36);
  color: var(--arcane);
}

.empty-inline {
  color: var(--muted);
  font-size: 13px;
}

.empty-card {
  background: rgba(255, 243, 231, 0.04);
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
  padding: 12px;
}

.story-copy {
  color: var(--muted-strong);
  display: grid;
  gap: 10px;
  line-height: 1.52;
  overflow-wrap: anywhere;
}

.story-copy .lede {
  color: var(--ink);
  font-size: 16px;
  font-weight: 750;
}

.story-note {
  border-top: 1px solid rgba(255, 250, 242, 0.08);
  display: grid;
  gap: 6px;
  padding-top: 10px;
}

.story-note strong {
  color: var(--gold);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.theme-block {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), transparent 58%),
    var(--surface);
}

.theme-picker {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(150px, auto);
}

.theme-swatches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.theme-swatch {
  appearance: none;
  background: color-mix(in srgb, var(--swatch) 24%, var(--surface-2));
  border: 1px solid color-mix(in srgb, var(--swatch) 60%, var(--line));
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  min-height: 42px;
  min-width: 42px;
  overflow: hidden;
  padding: 0;
  position: relative;
}

.theme-swatch::before {
  background: var(--swatch);
  content: "";
  inset: 7px;
  position: absolute;
  border-radius: 6px;
}

.theme-swatch span {
  height: 1px;
  overflow: hidden;
  position: absolute;
  width: 1px;
}

.theme-swatch.default::after {
  color: #fffaf2;
  content: "D";
  font-size: 11px;
  font-weight: 950;
  inset: 0;
  position: absolute;
  display: grid;
  place-items: center;
}

.theme-swatch.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(216, 157, 74, 0.22), 0 10px 24px rgba(var(--accent-rgb), 0.16);
}

.theme-custom {
  justify-self: end;
  width: 150px;
}

.theme-custom-controls {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px minmax(0, 1fr);
}

.theme-custom input[type="color"] {
  cursor: pointer;
  min-height: 40px;
  padding: 4px;
}

.avatar-editor {
  align-items: start;
  border-top: 1px solid rgba(255, 250, 242, 0.08);
  display: grid;
  gap: 12px;
  grid-template-columns: 64px minmax(0, 1fr);
  margin-top: 14px;
  padding-top: 14px;
}

.avatar-editor-preview {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 64px;
  overflow: hidden;
  width: 64px;
}

.avatar-editor-preview.avatar-shape-circle {
  border-radius: 50%;
}

.avatar-editor-preview img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.avatar-editor-main {
  display: grid;
  gap: 9px;
  min-width: 0;
}

.avatar-editor-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatar-upload-label {
  cursor: pointer;
  margin-top: 0;
  position: relative;
}

.avatar-upload-label input {
  height: 1px;
  opacity: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.avatar-shape-toggle {
  background: rgba(255, 250, 242, 0.055);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-width: 230px;
  padding: 3px;
}

.avatar-shape-button {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 6px;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 12px;
  font-weight: 900;
  min-height: 30px;
  padding: 6px 10px;
}

.avatar-shape-button.selected,
.avatar-shape-button:focus-visible {
  background: rgba(var(--accent-rgb), 0.2);
  color: var(--ink);
  outline: none;
}

.avatar-link-panel {
  max-width: min(100%, 560px);
}

.avatar-link-panel summary {
  color: var(--gold);
  cursor: pointer;
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.avatar-link-controls {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 8px;
}

.link-grid {
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.link-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 2px;
  min-height: 58px;
  padding: 10px;
  text-decoration: none;
}

.link-card:hover {
  border-color: var(--accent);
}

.link-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.link-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.journal-tabs-block,
.journal-page-block {
  gap: 14px;
}

.journal-tabs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(156px, 1fr));
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.journal-tabs::-webkit-scrollbar {
  display: none;
  height: 0;
  width: 0;
}

.journal-tab {
  --journal-nav-accent: var(--accent);
  --journal-nav-accent-rgb: var(--accent-rgb);
  appearance: none;
  background:
    linear-gradient(135deg, rgba(255, 243, 231, 0.055), rgba(255, 243, 231, 0.02)),
    var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 5px 10px;
  grid-template-areas:
    "icon kicker count"
    "icon label count";
  grid-template-columns: 32px minmax(0, 1fr) auto;
  min-height: 70px;
  overflow: hidden;
  padding: 11px 12px;
  position: relative;
  text-align: left;
  touch-action: manipulation;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-select: none;
}

.journal-nav-icon {
  align-self: center;
  background: rgba(var(--journal-nav-accent-rgb), 0.13);
  border: 1px solid rgba(var(--journal-nav-accent-rgb), 0.34);
  border-radius: 8px;
  color: var(--journal-nav-accent);
  display: grid;
  grid-area: icon;
  height: 32px;
  place-items: center;
  width: 32px;
}

.journal-nav-icon svg {
  display: block;
  fill: none;
  height: 19px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 19px;
}

.journal-tab::after {
  background: var(--journal-nav-accent);
  border-radius: 999px;
  bottom: 8px;
  content: "";
  height: 2px;
  left: 12px;
  opacity: 0;
  position: absolute;
  right: 12px;
  transition: opacity 140ms ease;
}

.journal-nav-entries {
  --journal-nav-accent: #59b3a0;
  --journal-nav-accent-rgb: 89, 179, 160;
}

.journal-nav-character {
  --journal-nav-accent: var(--accent);
  --journal-nav-accent-rgb: var(--accent-rgb);
}

.journal-nav-main {
  --journal-nav-accent: #f0c66a;
  --journal-nav-accent-rgb: 240, 198, 106;
}

.journal-nav-side {
  --journal-nav-accent: #55b878;
  --journal-nav-accent-rgb: 85, 184, 120;
}

.journal-nav-whispers {
  --journal-nav-accent: #a99cf0;
  --journal-nav-accent-rgb: 169, 156, 240;
}

.journal-tab > span:not(.journal-nav-icon) {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  grid-area: kicker;
  line-height: 1.2;
  text-transform: uppercase;
}

.journal-tab strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  grid-area: label;
  line-height: 1.16;
  min-width: 0;
  overflow-wrap: anywhere;
}

.journal-tab em {
  align-self: center;
  color: var(--muted-strong);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  grid-area: count;
  justify-self: end;
  line-height: 1.15;
  text-align: right;
  white-space: nowrap;
}

.journal-tab:hover,
.journal-tab.active {
  border-color: var(--journal-nav-accent);
}

.journal-tab.active {
  background: linear-gradient(135deg, rgba(var(--journal-nav-accent-rgb), 0.18), rgba(255, 250, 242, 0.04));
  box-shadow: 0 0 0 2px rgba(var(--journal-nav-accent-rgb), 0.12);
}

.journal-tab.active::after {
  opacity: 1;
}

.journal-content,
.journal-entry-list,
.journal-quest-sections,
.journal-quest-list,
.journal-whisper-list {
  display: grid;
  gap: 10px;
}

.journal-quest-list {
  grid-template-columns: minmax(0, 1fr);
}

.journal-codex-grid {
  grid-template-columns: repeat(auto-fill, minmax(220px, 280px));
  justify-content: start;
}

.journal-codex-grid > .codex-tile {
  width: 100%;
}

.journal-card-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
}

.journal-entry-form {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), transparent 56%),
    rgba(255, 243, 231, 0.035);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.journal-dm-whisper-form {
  background:
    linear-gradient(135deg, rgba(169, 156, 240, 0.14), transparent 58%),
    rgba(255, 243, 231, 0.035);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 14px;
}

.journal-dm-whisper-form textarea {
  min-height: 130px;
  resize: vertical;
}

.journal-entry-grid {
  display: grid;
  gap: 10px;
}

.journal-body-field textarea {
  min-height: 156px;
  resize: vertical;
}

.journal-image-field input {
  min-height: 42px;
}

.journal-image-controls {
  align-items: stretch;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.journal-image-controls .input {
  flex: 1 1 220px;
  min-width: 0;
}

.journal-upload-label {
  flex: 0 0 auto;
  min-height: 42px;
  position: relative;
}

.journal-upload-label input {
  height: 1px;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  width: 1px;
}

.journal-form-actions,
.journal-card-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.journal-visibility-toggle {
  align-items: center;
  background: rgba(0, 0, 0, 0.16);
  border: 1px solid rgba(226, 195, 151, 0.16);
  border-radius: 8px;
  color: var(--muted-strong);
  cursor: pointer;
  display: inline-flex;
  gap: 9px;
  min-height: 38px;
  padding: 7px 10px;
  position: relative;
  touch-action: manipulation;
}

.journal-visibility-toggle input {
  height: 1px;
  opacity: 0;
  position: absolute;
  width: 1px;
}

.journal-visibility-toggle span {
  background: rgba(255, 250, 242, 0.08);
  border: 1px solid rgba(226, 195, 151, 0.28);
  border-radius: 999px;
  height: 18px;
  position: relative;
  width: 34px;
}

.journal-visibility-toggle span::after {
  background: var(--muted);
  border-radius: 50%;
  content: "";
  height: 12px;
  left: 3px;
  position: absolute;
  top: 2px;
  transition: transform 140ms ease, background 140ms ease;
  width: 12px;
}

.journal-visibility-toggle input:checked + span {
  background: rgba(var(--accent-rgb), 0.2);
  border-color: rgba(var(--accent-rgb), 0.46);
}

.journal-visibility-toggle input:focus-visible + span {
  box-shadow: 0 0 0 2px rgba(var(--accent-rgb), 0.26);
}

.journal-visibility-toggle input:checked + span::after {
  background: var(--accent);
  transform: translateX(15px);
}

.journal-visibility-toggle strong {
  color: var(--ink);
  font-size: 12px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.journal-entry-card,
.journal-quest-card,
.journal-whisper-card {
  align-content: start;
  background:
    linear-gradient(135deg, rgba(255, 243, 231, 0.048), rgba(255, 243, 231, 0.016)),
    var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  min-height: 180px;
  padding: 14px;
}

.journal-quest-card {
  min-height: 0;
}

.journal-quest-tile,
.codex-detail-panel-journal_quest {
  --tile-accent: #f0c66a;
  --tile-accent-rgb: 240, 198, 106;
}

.journal-quest-tile.side {
  --tile-accent: #55b878;
  --tile-accent-rgb: 85, 184, 120;
}

.journal-quest-tile.character {
  --tile-accent: var(--accent);
  --tile-accent-rgb: var(--accent-rgb);
}

.journal-whisper-tile,
.codex-detail-panel-journal_whisper {
  --tile-accent: #a99cf0;
  --tile-accent-rgb: 169, 156, 240;
}

.journal-whisper-tile.dream,
.journal-whisper-tile.secret {
  --tile-accent: var(--accent);
  --tile-accent-rgb: var(--accent-rgb);
}

.journal-whisper-tile.ominous {
  --tile-accent: #ed4245;
  --tile-accent-rgb: 237, 66, 69;
}

.journal-entry-card.public {
  border-color: rgba(var(--accent-rgb), 0.34);
}

.journal-entry-card.private {
  border-color: rgba(226, 195, 151, 0.18);
}

.journal-entry-card.automated.consumable-entry {
  background:
    linear-gradient(135deg, rgba(89, 179, 160, 0.16), rgba(240, 198, 106, 0.07)),
    var(--surface-2);
  border-color: rgba(89, 179, 160, 0.48);
  border-left: 4px solid #59b3a0;
}

.journal-quest-section {
  display: grid;
  gap: 12px;
}

.journal-entry-card > header,
.journal-quest-card > header,
.journal-whisper-card > header,
.journal-section-head {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.journal-section-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.journal-entry-card header > div:first-child,
.journal-quest-card header > div:first-child,
.journal-whisper-card header > div:first-child,
.journal-section-head > div:first-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.journal-entry-heading {
  align-items: center;
  display: flex;
  gap: 10px;
  min-width: 0;
}

.journal-entry-heading > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.journal-entry-visual {
  flex: 0 0 auto;
}

.journal-entry-visual .item-thumb {
  height: 44px;
  width: 44px;
}

.journal-entry-card span,
.journal-quest-card span,
.journal-whisper-card span,
.journal-section-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.journal-entry-card strong,
.journal-quest-card strong,
.journal-whisper-card strong,
.journal-section-head strong {
  color: var(--ink);
  font-weight: 950;
  overflow-wrap: anywhere;
}

.journal-whisper-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.journal-quest-section.main,
.journal-quest-card.main {
  border-color: rgba(216, 157, 74, 0.38);
}

.journal-quest-section.side,
.journal-quest-card.side {
  border-color: rgba(85, 184, 120, 0.28);
}

.journal-quest-section.character,
.journal-quest-card.character,
.journal-whisper-card.dream,
.journal-whisper-card.secret {
  border-color: rgba(var(--accent-rgb), 0.42);
}

.journal-mini-status.quest {
  background: rgba(var(--accent-rgb), 0.13);
  border-color: rgba(var(--accent-rgb), 0.34);
  color: var(--accent);
}

.journal-mini-status.public {
  background: rgba(var(--accent-rgb), 0.13);
  border-color: rgba(var(--accent-rgb), 0.34);
  color: var(--accent);
}

.journal-mini-status.private {
  background: rgba(113, 92, 68, 0.18);
  border-color: rgba(226, 195, 151, 0.22);
  color: var(--muted-strong);
}

.journal-mini-status.consumable {
  background: rgba(89, 179, 160, 0.15);
  border-color: rgba(89, 179, 160, 0.38);
  color: #7de0c8;
}

.journal-whisper-card.ominous {
  border-color: rgba(237, 66, 69, 0.44);
}

.journal-sent-whisper-log {
  background:
    linear-gradient(135deg, rgba(169, 156, 240, 0.1), transparent 60%),
    rgba(0, 0, 0, 0.13);
  border: 1px solid rgba(169, 156, 240, 0.28);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.journal-sent-whisper-log > header,
.journal-sent-whisper-row > header {
  align-items: start;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.journal-sent-whisper-log > header div,
.journal-sent-whisper-row > header div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.journal-sent-whisper-log span,
.journal-sent-whisper-row span,
.journal-sent-whisper-row footer {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.journal-sent-whisper-log strong,
.journal-sent-whisper-row strong {
  color: var(--ink);
  font-weight: 950;
  overflow-wrap: anywhere;
}

.journal-sent-whisper-list {
  display: grid;
  gap: 8px;
}

.journal-sent-whisper-row {
  background: rgba(255, 243, 231, 0.035);
  border: 1px solid rgba(226, 195, 151, 0.16);
  border-left: 3px solid rgba(169, 156, 240, 0.68);
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 11px;
}

.journal-sent-whisper-row.read {
  border-left-color: var(--success);
}

.journal-sent-whisper-row.pending {
  border-left-color: #f0c66a;
}

.journal-sent-whisper-row em {
  background: rgba(255, 243, 231, 0.07);
  border: 1px solid rgba(226, 195, 151, 0.18);
  border-radius: 8px;
  color: var(--muted-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
  padding: 7px 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.journal-sent-whisper-row.read em {
  background: rgba(47, 123, 79, 0.14);
  border-color: rgba(47, 123, 79, 0.34);
  color: var(--success);
}

.journal-sent-whisper-body {
  color: var(--muted-strong);
  display: grid;
  font-size: 13px;
  gap: 7px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.journal-sent-whisper-body p {
  margin: 0;
}

.journal-prose {
  color: var(--muted-strong);
  display: grid;
  gap: 8px;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.journal-prose.compact {
  font-size: 13px;
}

.journal-prose p {
  margin: 0;
}

.journal-meta-grid,
.journal-fact-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.journal-meta-grid.primary {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.journal-meta-grid.secondary {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
}

.journal-meta-card {
  align-content: start;
  background: rgba(0, 0, 0, 0.17);
  border: 1px solid rgba(226, 195, 151, 0.14);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  min-height: 72px;
  padding: 9px 10px;
}

.journal-meta-card.secondary {
  border-left-color: rgba(var(--accent-rgb), 0.34);
  min-height: 58px;
}

.journal-meta-card span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1.1;
  text-transform: uppercase;
}

.journal-meta-card strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.28;
  overflow-wrap: break-word;
}

.journal-mini-status {
  background: rgba(47, 123, 79, 0.13);
  border: 1px solid rgba(47, 123, 79, 0.38);
  border-radius: 8px;
  color: var(--success);
  display: inline-grid;
  font-size: 11px;
  font-weight: 950;
  min-height: 34px;
  place-items: center;
  padding: 7px 9px;
  text-transform: uppercase;
}

.journal-details {
  border-top: 1px solid rgba(226, 195, 151, 0.13);
  display: grid;
  gap: 9px;
  padding-top: 2px;
}

.journal-details summary {
  align-items: center;
  border: 1px solid rgba(226, 195, 151, 0.16);
  border-radius: 8px;
  color: var(--muted-strong);
  cursor: pointer;
  display: flex;
  font-size: 11px;
  font-weight: 950;
  justify-content: space-between;
  line-height: 1.1;
  list-style: none;
  min-height: 38px;
  padding: 9px 10px;
  text-transform: uppercase;
  touch-action: manipulation;
}

.journal-details summary::-webkit-details-marker {
  display: none;
}

.journal-details summary::after {
  background:
    linear-gradient(currentColor, currentColor) center / 10px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 10px no-repeat;
  color: var(--accent);
  content: "";
  display: inline-block;
  flex: 0 0 18px;
  height: 18px;
  line-height: 1;
  width: 18px;
}

.journal-details[open] summary::after {
  background: linear-gradient(currentColor, currentColor) center / 10px 2px no-repeat;
}

.journal-details[open] .journal-meta-grid {
  padding-top: 1px;
}

.journal-note {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid rgba(255, 250, 242, 0.07);
  border-radius: 8px;
  padding: 10px;
}

.journal-entry-image,
.journal-quest-image,
.journal-whisper-image {
  background: rgba(0, 0, 0, 0.18);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  height: auto;
  margin: 0 auto;
  max-height: min(420px, 64vh);
  max-width: 100%;
  object-fit: contain;
  object-position: center;
  width: auto;
}

.journal-quest-image {
  max-height: min(360px, 58vh);
}

.companion-hero {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: 96px minmax(0, 1fr) minmax(250px, .48fr);
}

.companion-portrait,
.companion-portrait-fallback {
  background: rgba(0, 0, 0, 0.24);
  border: 1px solid var(--line);
  border-radius: 8px;
  height: 96px;
  overflow: hidden;
}

.companion-portrait.avatar-shape-circle {
  border-radius: 50%;
}

.companion-portrait img {
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.companion-portrait-fallback {
  align-items: center;
  color: var(--accent);
  display: grid;
  font-size: 28px;
  font-weight: 950;
  height: 100%;
  justify-items: center;
}

.companion-hero-copy {
  align-content: center;
  display: grid;
  gap: 8px;
  min-width: 0;
}

.companion-hero-copy > span,
.companion-story-card > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.companion-hero-copy h3 {
  color: var(--ink);
  font-size: 28px;
  font-weight: 950;
  line-height: 1;
  overflow-wrap: anywhere;
}

.companion-hero-copy p {
  color: var(--muted-strong);
  line-height: 1.4;
  margin: 0;
  overflow-wrap: anywhere;
}

.companion-hero-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.companion-link {
  text-decoration: none;
}

.companion-hero-side {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.companion-hero-stats {
  grid-template-columns: repeat(3, minmax(70px, 1fr));
}

.companion-hero .hero-stat {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), rgba(255, 243, 231, 0.025)),
    var(--surface-2);
  border-color: rgba(var(--accent-rgb), 0.2);
}

.companion-hero .hp-trigger:hover,
.companion-hero .hp-trigger[aria-expanded="true"] {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.15), rgba(255, 243, 231, 0.04)),
    var(--surface-2);
  border-color: rgba(var(--accent-rgb), 0.34);
}

.companion-hero .hp-trigger:focus-visible {
  outline-color: rgba(var(--accent-rgb), 0.72);
}

.companion-avatar-editor {
  margin-top: 12px;
}

.companion-vital-card {
  align-content: center;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(255, 243, 231, 0.035)),
    var(--surface-2);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 13px;
}

.companion-vital-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.companion-vital-card strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.companion-hp-meter {
  background: rgba(0, 0, 0, 0.26);
  border: 1px solid rgba(255, 250, 242, 0.08);
  border-radius: 999px;
  height: 9px;
  overflow: hidden;
}

.companion-hp-meter i {
  background: linear-gradient(90deg, var(--danger), var(--gold), var(--success));
  display: block;
  height: 100%;
  transition: width .18s ease;
}

.companion-overview-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(260px, .75fr);
}

.companion-stat-grid,
.companion-ability-grid,
.companion-equipment-list,
.companion-action-list,
.companion-story {
  display: grid;
  gap: 9px;
}

.companion-stat-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.companion-ability-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.companion-ability-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 86px;
  padding: 10px 8px;
  text-align: center;
}

.companion-ability-card span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
}

.companion-ability-card strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
}

.companion-ability-card em {
  color: var(--muted-strong);
  font-style: normal;
  font-weight: 900;
}

.companion-equipment-row {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: inset 3px 0 0 rgba(216, 157, 74, 0.18);
  display: grid;
  gap: 10px;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  min-height: 64px;
  padding: 9px;
  position: relative;
}

.companion-equipment-row.equipped:not(.unavailable) {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.105), rgba(255, 243, 231, 0) 42%, rgba(255, 250, 242, 0.02)) padding-box,
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(135deg, #f2c76f, #6e5030 32%, #d7a754 66%, #3a2a21) border-box;
  border-color: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(255, 238, 184, 0.08),
    inset 3px 0 0 rgba(216, 157, 74, 0.46),
    0 10px 22px rgba(0, 0, 0, 0.16);
  isolation: isolate;
  overflow: hidden;
}

.companion-slot-action {
  justify-self: end;
}

.companion-equipment-row.unavailable {
  border-color: rgba(216, 88, 82, 0.3);
  box-shadow: inset 3px 0 0 rgba(216, 88, 82, 0.64);
}

.companion-equipment-row div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.companion-equipment-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.companion-equipment-row strong,
.companion-equipment-row em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.companion-equipment-row strong {
  color: var(--ink);
  font-weight: 950;
}

.companion-equipment-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.companion-feature-group {
  display: grid;
  gap: 9px;
}

.companion-feature-card,
.companion-story-card {
  background:
    linear-gradient(135deg, rgba(255, 243, 231, 0.048), rgba(255, 243, 231, 0.018)),
    var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px;
}

.companion-feature-card header {
  align-items: baseline;
  display: flex;
  gap: 8px;
  justify-content: space-between;
}

.companion-feature-card header span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.companion-feature-card header strong {
  color: var(--ink);
  font-weight: 950;
  overflow-wrap: anywhere;
  text-align: right;
}

.companion-feature-card > em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  overflow-wrap: anywhere;
}

.companion-item-row .item-description {
  margin-top: 4px;
}

.companion-inventory-actions {
  margin-top: 8px;
}

.companion-request-panel {
  max-width: min(1180px, 100vw);
  width: min(1180px, 100vw);
}

.companion-request-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.companion-request-body {
  display: block;
  height: 100%;
  max-height: none;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px clamp(16px, 3vw, 34px) clamp(24px, 3vw, 36px);
  scrollbar-gutter: stable;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.companion-wizard-body {
  margin: 0 auto;
  max-width: 1100px;
}

.companion-request-search,
.companion-request-details {
  align-content: start;
  display: grid;
  gap: 12px;
  min-width: 0;
}

.companion-search-results {
  display: grid;
  gap: 8px;
  max-height: clamp(240px, 52dvh, 560px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding-right: 2px;
  scrollbar-gutter: stable;
  touch-action: pan-y;
  -webkit-overflow-scrolling: touch;
}

.companion-search-card {
  align-items: center;
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 8px 10px;
  grid-template-areas:
    "thumb title slots"
    "thumb meta slots";
  grid-template-columns: 48px minmax(0, 1fr) minmax(96px, auto);
  grid-template-rows: auto auto;
  min-height: 76px;
  padding: 10px;
  text-align: left;
  width: 100%;
}

.companion-search-card:hover,
.companion-search-card.selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.22);
}

.companion-search-card img,
.companion-search-card > span {
  background: rgba(0, 0, 0, 0.22);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  display: grid;
  font-size: 12px;
  font-weight: 950;
  grid-area: thumb;
  height: 48px;
  object-fit: cover;
  place-items: center;
  width: 48px;
}

.companion-search-card strong,
.companion-search-card em {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.companion-search-card strong {
  align-self: end;
  grid-area: title;
  font-weight: 950;
  line-height: 1.2;
}

.companion-search-card em {
  align-self: start;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  grid-area: meta;
  line-height: 1.28;
}

.companion-search-card small {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  align-self: center;
  grid-area: slots;
  justify-self: end;
  max-width: 90px;
  overflow-wrap: anywhere;
  text-align: right;
  text-transform: uppercase;
}

.companion-selected-summary {
  min-height: 58px;
}

.companion-selected-card {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.14), rgba(255, 243, 231, 0.028)),
    var(--surface-2);
  border: 1px solid rgba(var(--accent-rgb), 0.32);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 11px;
}

.companion-selected-card strong,
.companion-selected-card span {
  overflow-wrap: anywhere;
}

.companion-selected-card span {
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.35;
}

.hp-meter {
  align-items: center;
  background: #2b201d;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  display: grid;
  height: 46px;
  overflow: hidden;
  position: relative;
}

.hp-fill {
  background: linear-gradient(90deg, var(--danger), var(--gold), var(--success));
  height: 100%;
  transition: width .18s ease;
  width: 0;
}

.hp-meter span {
  color: #fffaf2;
  font-size: 15px;
  font-weight: 950;
  inset: 0;
  line-height: 46px;
  position: absolute;
  text-align: center;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.34);
}

.hp-controls {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr)) minmax(110px, auto);
}

.hp-controls.action-row {
  grid-template-columns: minmax(120px, .8fr) minmax(96px, auto) minmax(82px, auto);
}

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

.tracker {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 11px;
}

.tracker strong {
  font-size: 24px;
  font-weight: 950;
}

.death-save-row {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  padding: 11px;
}

.death-save-row strong {
  display: block;
  margin-top: 2px;
  overflow-wrap: anywhere;
}

.death-save-block {
  align-content: start;
}

.death-save-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 9px;
  padding: 10px;
}

.death-save-card > strong {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 850;
  line-height: 1.25;
}

.death-save-actions {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.death-save-actions .btn {
  font-size: 12px;
  min-height: 32px;
  width: 100%;
}

.ability-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ability-card {
  appearance: none;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 9px;
  min-height: 126px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.ability-top {
  align-items: center;
  display: grid;
  gap: 8px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
}

.ability-top div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.ability-icon-thumb {
  align-self: center;
  background: rgba(255, 243, 231, 0.055);
  border: 1px solid rgba(255, 243, 231, 0.16);
  border-radius: 8px;
  color: rgba(255, 250, 242, 0.88);
  display: grid;
  height: 36px;
  place-items: center;
  width: 36px;
}

.ability-icon-thumb svg {
  display: block;
  fill: currentColor;
  height: 24px;
  stroke: none;
  width: 24px;
}

.ability-top strong {
  color: var(--accent);
  font-size: 14px;
  font-weight: 950;
}

.ability-top span,
.item-meta {
  color: var(--muted);
  font-size: 12px;
}

.ability-top em {
  color: var(--muted-strong);
  font-style: normal;
  font-weight: 950;
}

.ability-score {
  font-size: 34px;
  font-weight: 950;
  line-height: .95;
}

.passive-check-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin-top: 10px;
}

.passive-check-grid:empty {
  display: none;
}

.passive-check-card {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  min-height: 56px;
  padding: 10px 11px;
}

.passive-check-card > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.passive-check-card strong {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 900;
  line-height: 1.2;
}

.passive-check-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.passive-check-card em {
  color: var(--accent);
  font-size: 28px;
  font-style: normal;
  font-weight: 950;
  line-height: 1;
}

.rollable-card {
  cursor: pointer;
  touch-action: manipulation;
  transition: background-color .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.rollable-card:hover,
.rollable-card:focus-visible {
  background: linear-gradient(180deg, rgba(216, 157, 74, 0.12), rgba(var(--accent-rgb), 0.09)), var(--surface-2);
  border-color: rgba(216, 157, 74, 0.78);
  box-shadow: 0 0 0 1px rgba(216, 157, 74, 0.26), 0 14px 26px rgba(0, 0, 0, 0.24);
}

.rollable-card:focus-visible {
  outline: 2px solid rgba(255, 243, 231, 0.78);
  outline-offset: 2px;
}

.rollable-card:active {
  transform: translateY(1px) scale(.995);
}

.score-row,
.equipment-row {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 46px;
  padding: 9px 11px;
  position: relative;
}

.score-row.rollable-card {
  appearance: none;
  color: var(--ink);
  font: inherit;
  text-align: left;
  width: 100%;
}

.score-row.has-score-icon {
  grid-template-columns: 34px minmax(0, 1fr) auto;
}

.score-icon-thumb {
  --score-icon-color: rgba(255, 250, 242, 0.86);
  --score-icon-soft: rgba(255, 243, 231, 0.055);
  align-self: center;
  background: linear-gradient(135deg, var(--score-icon-soft), rgba(255, 250, 242, 0.035));
  border: 1px solid rgba(255, 243, 231, 0.16);
  border-radius: 8px;
  color: var(--score-icon-color);
  display: grid;
  height: 34px;
  place-items: center;
  width: 34px;
}

.score-icon-thumb svg {
  display: block;
  height: 22px;
  width: 22px;
}

.score-icon-thumb.icon-action svg,
.score-icon-thumb.icon-skill svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.score-icon-thumb.icon-ability svg,
.score-icon-thumb.icon-item svg,
.score-icon-thumb.icon-resource svg {
  fill: currentColor;
  stroke: none;
}

.score-icon-thumb.tone-str {
  --score-icon-color: #ffd08a;
  --score-icon-soft: rgba(216, 157, 74, 0.14);
}

.score-icon-thumb.tone-dex {
  --score-icon-color: #91d8ca;
  --score-icon-soft: rgba(89, 179, 160, 0.14);
}

.score-icon-thumb.tone-con {
  --score-icon-color: #d9d3c7;
  --score-icon-soft: rgba(210, 205, 196, 0.12);
}

.score-icon-thumb.tone-int {
  --score-icon-color: #c9c2ff;
  --score-icon-soft: rgba(155, 145, 238, 0.16);
}

.score-icon-thumb.tone-wis {
  --score-icon-color: #aee2b9;
  --score-icon-soft: rgba(85, 184, 120, 0.14);
}

.score-icon-thumb.tone-cha {
  --score-icon-color: #ffb1ba;
  --score-icon-soft: rgba(var(--accent-rgb), 0.14);
}

.score-row div {
  display: grid;
  gap: 2px;
}

.score-row strong,
.equipment-row strong {
  overflow-wrap: anywhere;
}

.score-row strong {
  align-items: center;
  display: flex;
  gap: 6px;
}

.score-row span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.score-row em {
  color: var(--accent);
  font-size: 16px;
  font-style: normal;
  font-weight: 950;
}

.score-row.proficient {
  background: rgba(216, 157, 74, 0.08);
  border-color: rgba(216, 157, 74, 0.82);
  border-width: 2px;
  box-shadow: inset 0 0 0 1px rgba(216, 157, 74, 0.28);
}

.score-row.expertise {
  background: rgba(155, 145, 238, 0.13);
  border-color: rgba(185, 177, 255, 0.9);
  border-width: 2px;
  box-shadow: inset 0 0 0 1px rgba(185, 177, 255, 0.32), 0 0 18px rgba(155, 145, 238, 0.1);
}

.score-row.expertise em {
  color: #c7c1ff;
}

.prof-pips {
  align-items: center;
  display: inline-flex;
  flex: 0 0 auto;
  gap: 3px;
}

.prof-pips i {
  background: var(--gold);
  border-radius: 999px;
  box-shadow: 0 0 10px rgba(216, 157, 74, 0.26);
  height: 7px;
  width: 7px;
}

.score-row.expertise .prof-pips i {
  background: #c7c1ff;
  box-shadow: 0 0 10px rgba(185, 177, 255, 0.36);
}

.equipment-row {
  grid-template-columns: 38px minmax(86px, .25fr) minmax(0, 1fr) minmax(72px, auto);
}

.equipment-row:not(.empty) {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.105), rgba(255, 243, 231, 0) 42%, rgba(255, 250, 242, 0.02)) padding-box,
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(135deg, #f2c76f, #6e5030 32%, #d7a754 66%, #3a2a21) border-box;
  border-color: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(255, 238, 184, 0.08),
    inset 3px 0 0 rgba(216, 157, 74, 0.46),
    0 10px 22px rgba(0, 0, 0, 0.16);
  isolation: isolate;
  overflow: hidden;
}

.equipment-row span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.equipment-row.empty strong {
  color: var(--muted);
  font-weight: 750;
}

.equipment-row strong {
  min-width: 0;
  overflow: visible;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.2;
}

.equipment-item-link,
.item-name-link {
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  font-weight: 950;
  min-width: 0;
  padding: 0;
  text-align: left;
  text-decoration: underline;
  text-decoration-color: rgba(216, 157, 74, 0.48);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.equipment-item-link {
  display: block;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.equipment-item-link:hover,
.item-name-link:hover:not(:disabled) {
  color: #fffaf2;
  text-decoration-color: var(--gold);
}

.item-name-link:disabled {
  cursor: not-allowed;
  opacity: 0.58;
  text-decoration-color: rgba(255, 250, 242, 0.22);
}

.equipment-item-link:focus-visible,
.item-name-link:focus-visible {
  border-radius: 4px;
  color: #fffaf2;
  outline: 2px solid rgba(216, 157, 74, 0.58);
  outline-offset: 2px;
  text-decoration-color: var(--gold);
}

.equipment-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
  justify-self: end;
}

.equipment-row .btn {
  justify-self: end;
  min-height: 30px;
  padding: 5px 9px;
}

.equipment-row .item-thumb {
  height: 34px;
  width: 34px;
}

.inventory-row.rarity-common,
.rarity-link.rarity-common {
  --item-rarity: #9aa0a6;
  --item-rarity-border: rgba(154, 160, 166, 0.32);
  --item-rarity-hover: rgba(154, 160, 166, 0.58);
  --item-rarity-ink: #d7dce1;
  --item-rarity-soft: rgba(154, 160, 166, 0.09);
}

.inventory-row.rarity-uncommon,
.rarity-link.rarity-uncommon {
  --item-rarity: #22c55e;
  --item-rarity-border: rgba(34, 197, 94, 0.34);
  --item-rarity-hover: rgba(34, 197, 94, 0.62);
  --item-rarity-ink: #8ff0b0;
  --item-rarity-soft: rgba(34, 197, 94, 0.095);
}

.inventory-row.rarity-rare,
.rarity-link.rarity-rare {
  --item-rarity: #3b82f6;
  --item-rarity-border: rgba(59, 130, 246, 0.36);
  --item-rarity-hover: rgba(59, 130, 246, 0.64);
  --item-rarity-ink: #9fc4ff;
  --item-rarity-soft: rgba(59, 130, 246, 0.1);
}

.inventory-row.rarity-very-rare,
.rarity-link.rarity-very-rare {
  --item-rarity: #a855f7;
  --item-rarity-border: rgba(168, 85, 247, 0.38);
  --item-rarity-hover: rgba(168, 85, 247, 0.66);
  --item-rarity-ink: #d3b0ff;
  --item-rarity-soft: rgba(168, 85, 247, 0.105);
}

.inventory-row.rarity-legendary,
.rarity-link.rarity-legendary {
  --item-rarity: #f59e0b;
  --item-rarity-border: rgba(245, 158, 11, 0.4);
  --item-rarity-hover: rgba(245, 158, 11, 0.7);
  --item-rarity-ink: #ffd98d;
  --item-rarity-soft: rgba(245, 158, 11, 0.115);
}

.inventory-row.rarity-artifact,
.rarity-link.rarity-artifact {
  --item-rarity: #ef4444;
  --item-rarity-border: rgba(239, 68, 68, 0.42);
  --item-rarity-hover: rgba(239, 68, 68, 0.72);
  --item-rarity-ink: #ffaaa5;
  --item-rarity-soft: rgba(239, 68, 68, 0.115);
}

.inventory-row {
  align-items: center;
  --item-rarity: #9aa0a6;
  --item-rarity-border: rgba(154, 160, 166, 0.28);
  --item-rarity-hover: rgba(154, 160, 166, 0.54);
  --item-rarity-ink: #d7dce1;
  --item-rarity-soft: rgba(154, 160, 166, 0.08);
  background:
    linear-gradient(90deg, var(--item-rarity-soft), rgba(255, 243, 231, 0) 62%),
    var(--surface-2);
  border: 1px solid var(--item-rarity-border);
  border-radius: 8px;
  box-shadow: inset 3px 0 0 var(--item-rarity);
  display: grid;
  gap: 9px;
  grid-template-columns: 44px minmax(0, 1fr);
  padding: 8px;
  position: relative;
  scroll-margin-block-start: 12px;
}

.inventory-row.has-equip-action {
  border-color: var(--item-rarity-border);
  box-shadow:
    inset 3px 0 0 var(--item-rarity),
    0 0 0 1px rgba(216, 157, 74, 0.1);
}

.inventory-row.is-equipped {
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.105), rgba(255, 243, 231, 0) 42%, rgba(255, 250, 242, 0.02)) padding-box,
    linear-gradient(90deg, var(--item-rarity-soft), rgba(255, 243, 231, 0) 62%) padding-box,
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(135deg, #f2c76f, #6e5030 32%, #d7a754 66%, #3a2a21) border-box;
  border-color: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(255, 238, 184, 0.08),
    inset 3px 0 0 var(--item-rarity),
    0 10px 24px rgba(0, 0, 0, 0.18);
  isolation: isolate;
  overflow: hidden;
}

.inventory-row.is-equipped > *,
.equipment-row:not(.empty) > *,
.companion-equipment-row.equipped:not(.unavailable) > * {
  position: relative;
  z-index: 1;
}

.inventory-row.is-equipped::after,
.equipment-row:not(.empty)::after,
.companion-equipment-row.equipped:not(.unavailable)::after {
  background:
    linear-gradient(90deg, #ffe3a0, #c58b35 58%, transparent) top left / 38px 3px no-repeat,
    linear-gradient(180deg, #ffe3a0, #c58b35 58%, transparent) top left / 3px 32px no-repeat,
    linear-gradient(90deg, rgba(255, 237, 176, 0.54), transparent) top 6px left 6px / 18px 1px no-repeat,
    linear-gradient(180deg, rgba(255, 237, 176, 0.54), transparent) top 6px left 6px / 1px 18px no-repeat,
    linear-gradient(270deg, #f0c46d, #9b6d2b 58%, transparent) top right / 38px 3px no-repeat,
    linear-gradient(180deg, #f0c46d, #9b6d2b 58%, transparent) top right / 3px 32px no-repeat,
    linear-gradient(270deg, rgba(255, 237, 176, 0.4), transparent) top 6px right 6px / 18px 1px no-repeat,
    linear-gradient(180deg, rgba(255, 237, 176, 0.4), transparent) top 6px right 6px / 1px 18px no-repeat,
    linear-gradient(90deg, rgba(197, 139, 53, 0.55), transparent) bottom left / 28px 2px no-repeat,
    linear-gradient(0deg, rgba(197, 139, 53, 0.55), transparent) bottom left / 2px 22px no-repeat,
    linear-gradient(270deg, rgba(197, 139, 53, 0.48), transparent) bottom right / 28px 2px no-repeat,
    linear-gradient(0deg, rgba(197, 139, 53, 0.48), transparent) bottom right / 2px 22px no-repeat;
  border-radius: 7px;
  content: "";
  inset: 4px;
  opacity: 0.9;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.inventory-row.is-equipped .action-state {
  color: #e8c47a;
}

.inventory-row.is-attuned,
.equipment-row.attuned:not(.empty) {
  background:
    linear-gradient(90deg, rgba(134, 225, 255, 0.055), rgba(255, 243, 231, 0) 50%) padding-box,
    linear-gradient(180deg, rgba(255, 250, 242, 0.035), rgba(255, 250, 242, 0)) padding-box,
    linear-gradient(var(--surface-2), var(--surface-2)) padding-box,
    linear-gradient(135deg, #8ee6ff, #6d5ac9 36%, #f6d365 72%, #2e2446) border-box;
  border-color: transparent;
  box-shadow:
    inset 0 0 0 1px rgba(134, 225, 255, 0.18),
    inset 3px 0 0 rgba(134, 225, 255, 0.78),
    0 10px 22px rgba(0, 0, 0, 0.19),
    0 0 0 1px rgba(134, 225, 255, 0.16);
  isolation: isolate;
  overflow: hidden;
}

.inventory-row.is-attuned > *,
.equipment-row.attuned:not(.empty) > * {
  position: relative;
  z-index: 1;
}

.inventory-row.is-attuned::before,
.equipment-row.attuned:not(.empty)::before {
  content: none;
}

.inventory-row.is-attuned::after,
.equipment-row.attuned:not(.empty)::after {
  background:
    linear-gradient(90deg, #9eeeff, #a79cff 54%, transparent) top left / 44px 3px no-repeat,
    linear-gradient(180deg, #9eeeff, #a79cff 54%, transparent) top left / 3px 36px no-repeat,
    linear-gradient(90deg, #f6d365, rgba(246, 211, 101, 0.18), transparent) top 7px left 7px / 22px 2px no-repeat,
    linear-gradient(180deg, #f6d365, rgba(246, 211, 101, 0.18), transparent) top 7px left 7px / 2px 22px no-repeat,
    linear-gradient(270deg, #f6d365, #a79cff 56%, transparent) top right / 44px 3px no-repeat,
    linear-gradient(180deg, #f6d365, #a79cff 56%, transparent) top right / 3px 36px no-repeat,
    linear-gradient(270deg, #9eeeff, rgba(158, 238, 255, 0.16), transparent) top 7px right 7px / 22px 2px no-repeat,
    linear-gradient(180deg, #9eeeff, rgba(158, 238, 255, 0.16), transparent) top 7px right 7px / 2px 22px no-repeat,
    linear-gradient(90deg, rgba(158, 238, 255, 0.62), transparent) bottom left / 32px 2px no-repeat,
    linear-gradient(0deg, rgba(158, 238, 255, 0.62), transparent) bottom left / 2px 26px no-repeat,
    linear-gradient(270deg, rgba(246, 211, 101, 0.58), transparent) bottom right / 32px 2px no-repeat,
    linear-gradient(0deg, rgba(246, 211, 101, 0.58), transparent) bottom right / 2px 26px no-repeat;
  border-radius: 7px;
  content: "";
  inset: 4px;
  opacity: 0.95;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.inventory-row.is-attuned .action-state {
  color: var(--attuned-cyan);
}

.inventory-row.has-use-action {
  border-color: var(--item-rarity-border);
  box-shadow:
    inset 3px 0 0 var(--item-rarity),
    0 0 0 1px rgba(79, 74, 143, 0.1);
}

.inventory-row.is-unidentified {
  --unidentified-gold: #f5c86d;
  background:
    linear-gradient(112deg, rgba(245, 200, 109, 0.18), rgba(136, 124, 255, 0.13) 44%, rgba(255, 243, 231, 0.02) 74%),
    repeating-linear-gradient(135deg, rgba(255, 250, 242, 0.04) 0 1px, transparent 1px 8px),
    var(--surface-2);
  border-color: rgba(245, 200, 109, 0.72);
  box-shadow:
    inset 3px 0 0 var(--unidentified-gold),
    0 0 0 1px rgba(136, 124, 255, 0.22),
    0 10px 24px rgba(0, 0, 0, 0.16),
    0 0 18px rgba(245, 200, 109, 0.13);
  isolation: isolate;
  overflow: hidden;
}

.inventory-row.is-unidentified::before {
  background:
    radial-gradient(circle at 18% 20%, rgba(245, 200, 109, 0.2), transparent 34%),
    linear-gradient(90deg, rgba(136, 124, 255, 0.13), transparent 58%);
  border-radius: 7px;
  content: "";
  inset: 1px;
  opacity: 0.64;
  pointer-events: none;
  position: absolute;
  z-index: 0;
}

.inventory-row.is-unidentified > * {
  position: relative;
  z-index: 1;
}

.inventory-row.is-unidentified:hover,
.inventory-row.is-unidentified.is-open {
  border-color: rgba(255, 220, 142, 0.86);
  box-shadow:
    inset 3px 0 0 var(--unidentified-gold),
    0 0 0 1px rgba(136, 124, 255, 0.3),
    0 12px 28px rgba(0, 0, 0, 0.2),
    0 0 24px rgba(245, 200, 109, 0.18);
}

.inventory-row:hover,
.inventory-row.is-open {
  border-color: var(--item-rarity-hover);
}

.equipment-row:hover {
  border-color: rgba(216, 157, 74, 0.5);
}

.item-thumb {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--accent);
  display: grid;
  font-size: 12px;
  font-weight: 950;
  height: 44px;
  object-fit: cover;
  place-items: center;
  width: 44px;
}

.inventory-row .item-thumb {
  background:
    linear-gradient(135deg, var(--item-rarity-soft), rgba(255, 243, 231, 0.02)),
    var(--surface-3);
  border-color: var(--item-rarity-border);
  color: var(--item-rarity-ink);
}

.inventory-row.is-unidentified .item-thumb {
  background:
    radial-gradient(circle at 50% 45%, rgba(245, 200, 109, 0.2), transparent 54%),
    linear-gradient(135deg, rgba(136, 124, 255, 0.18), rgba(245, 200, 109, 0.12)),
    var(--surface-3);
  border-color: rgba(245, 200, 109, 0.68);
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 242, 0.09),
    0 0 15px rgba(245, 200, 109, 0.14);
  color: #ffe3a3;
}

.inventory-row.is-unidentified .item-art-thumb {
  filter: grayscale(0.36) saturate(0.62) brightness(0.82) contrast(1.08);
}

.item-art-thumb {
  display: block;
}

.item-icon-thumb {
  --item-icon-color: var(--item-rarity-ink, var(--gold));
  --item-icon-soft: var(--item-rarity-soft, rgba(216, 157, 74, 0.12));
  background:
    radial-gradient(circle at 30% 24%, rgba(255, 250, 242, 0.16), transparent 36%),
    linear-gradient(135deg, var(--item-icon-soft), rgba(255, 250, 242, 0.035)),
    var(--surface-3);
  color: var(--item-icon-color);
}

.item-icon-thumb svg {
  display: block;
  fill: currentColor;
  height: 27px;
  stroke: none;
  width: 27px;
}

.item-icon-thumb.icon-weapon {
  --item-icon-color: #ffd08a;
  --item-icon-soft: rgba(216, 157, 74, 0.15);
}

.item-icon-thumb.icon-ranged {
  --item-icon-color: #91d8ca;
  --item-icon-soft: rgba(89, 179, 160, 0.14);
}

.item-icon-thumb.icon-armor {
  --item-icon-color: #d9d3c7;
  --item-icon-soft: rgba(210, 205, 196, 0.12);
}

.item-icon-thumb.icon-consumable {
  --item-icon-color: #ff9fa9;
  --item-icon-soft: rgba(var(--accent-rgb), 0.14);
}

.item-icon-thumb.icon-magic {
  --item-icon-color: #c9c2ff;
  --item-icon-soft: rgba(155, 145, 238, 0.16);
}

.item-icon-thumb.icon-arcane {
  --item-icon-color: #c7f0ff;
  --item-icon-soft: rgba(89, 179, 220, 0.14);
}

.item-icon-thumb.icon-tool {
  --item-icon-color: #ead0a9;
  --item-icon-soft: rgba(216, 157, 74, 0.11);
}

.item-icon-thumb.icon-container,
.item-icon-thumb.icon-document,
.item-icon-thumb.icon-key,
.item-icon-thumb.icon-currency,
.item-icon-thumb.icon-generic {
  --item-icon-color: var(--muted-strong);
  --item-icon-soft: rgba(255, 250, 242, 0.08);
}

.inventory-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.item-heading {
  align-items: flex-start;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  justify-content: flex-start;
  min-width: 0;
}

.item-heading strong {
  font-size: 15px;
  font-weight: 950;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-row .item-name-link {
  flex: 1 1 220px;
  font-size: 15px;
  line-height: 1.22;
  overflow-wrap: anywhere;
}

.inventory-row.is-unidentified .item-name-link:disabled,
.inventory-row.is-unidentified .item-heading strong {
  color: #ffe6a6;
  opacity: 1;
  text-decoration-color: rgba(245, 200, 109, 0.72);
}

.inventory-row .item-heading .unidentified-mark {
  align-items: center;
  aspect-ratio: 1;
  background:
    radial-gradient(circle at 35% 26%, rgba(255, 250, 242, 0.34), transparent 38%),
    linear-gradient(135deg, rgba(245, 200, 109, 0.96), rgba(136, 124, 255, 0.74));
  border: 1px solid rgba(255, 250, 242, 0.42);
  border-radius: 999px;
  box-shadow:
    0 0 14px rgba(245, 200, 109, 0.35),
    inset 0 0 0 1px rgba(22, 15, 13, 0.24);
  color: #170f0a;
  display: inline-grid;
  flex: 0 0 22px;
  font-size: 14px;
  font-weight: 950;
  height: 22px;
  letter-spacing: 0;
  line-height: 1;
  padding: 0;
  place-items: center;
  text-shadow: 0 1px 0 rgba(255, 250, 242, 0.42);
  width: 22px;
}

.item-heading span {
  background: rgba(var(--accent-rgb), 0.14);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 999px;
  color: var(--accent);
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  padding: 4px 6px;
}

.item-traits,
.property-list,
.effect-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.property-list {
  align-items: flex-start;
}

.item-traits span,
.property-list span {
  background: rgba(255, 243, 231, 0.05);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted);
  display: block;
  font-size: 10px;
  font-weight: 850;
  line-height: 1.2;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  overflow-wrap: anywhere;
  padding: 4px 6px;
  white-space: normal;
  word-break: break-word;
}

.item-traits span {
  flex: 0 1 auto;
}

.item-traits span[data-item-trait="rarity"] {
  background: var(--item-rarity-soft);
  border-color: var(--item-rarity-border);
  color: var(--item-rarity-ink);
}

.item-traits span[data-item-trait="attunement"] {
  background: rgba(125, 211, 252, 0.12);
  border-color: rgba(125, 211, 252, 0.42);
  color: #c7ecff;
  text-transform: uppercase;
}

.inventory-row.is-attuned .item-traits span[data-item-trait="attunement"] {
  background:
    linear-gradient(135deg, rgba(125, 211, 252, 0.22), rgba(196, 181, 253, 0.16));
  border-color: rgba(196, 181, 253, 0.62);
  box-shadow: 0 0 14px rgba(125, 211, 252, 0.12);
  color: #f5fbff;
}

.inventory-row.is-unidentified .item-traits span[data-item-trait="identity"] {
  background: rgba(245, 200, 109, 0.18);
  border-color: rgba(245, 200, 109, 0.58);
  box-shadow: inset 0 0 0 1px rgba(136, 124, 255, 0.12);
  color: #ffe3a3;
  text-transform: uppercase;
}

.property-list span {
  flex: 0 1 auto;
  width: fit-content;
}

.inventory-row .effect-list .tag {
  align-items: flex-start;
  border-radius: 7px;
  display: block;
  flex: 0 1 auto;
  line-height: 1.35;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  overflow: hidden;
  padding: 6px 8px;
  white-space: normal;
  word-break: break-word;
}

.item-description {
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.42;
  overflow-wrap: anywhere;
}

.inventory-actions {
  align-items: center;
  align-self: center;
  background: transparent;
  border: 0;
  border-top: 1px solid rgba(226, 195, 151, 0.12);
  border-radius: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-start;
  margin-top: 1px;
  max-width: none;
  min-width: 0;
  padding: 6px 0 0;
}

.inventory-actions .action-state {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  max-width: 180px;
  overflow: hidden;
  padding: 0 4px 0 0;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.inventory-actions strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inventory-actions.note {
  align-self: center;
}

.use-control {
  display: grid;
  gap: 5px;
  grid-template-columns: 50px auto;
}

.use-control .input {
  min-height: 30px;
  padding: 5px 7px;
}

.item-action {
  box-shadow: none;
  font-size: 12px;
  min-height: 28px;
  padding: 4px 9px;
  width: auto;
}

.inventory-actions .item-action {
  background: rgba(255, 250, 242, 0.075);
  border-color: rgba(255, 250, 242, 0.2);
}

.inventory-actions .item-action:hover:not(:disabled) {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(var(--accent-rgb), 0.52);
}

.inventory-actions .item-action.use-action,
.inventory-actions .item-action.equip-action,
.inventory-actions .item-action.unequip-action,
.inventory-actions .item-action.sell-action {
  border-color: rgba(216, 157, 74, 0.38);
}

.inventory-actions .item-action.use-action,
.inventory-actions .item-action.waterskin-action {
  color: #fffaf2;
}

.inventory-actions .item-action.waterskin-action {
  background: rgba(79, 143, 216, 0.18);
  border-color: rgba(89, 179, 160, 0.48);
}

.inventory-actions .item-action.waterskin-action:hover:not(:disabled) {
  background: rgba(89, 179, 160, 0.26);
  border-color: rgba(89, 179, 160, 0.7);
  color: #fffaf2;
}

.inventory-actions .item-action.equip-action {
  background: rgba(216, 157, 74, 0.18);
  border-color: rgba(216, 157, 74, 0.52);
  color: #fffaf2;
}

.inventory-actions .item-action.equip-action:hover:not(:disabled) {
  background: rgba(var(--accent-rgb), 0.28);
  border-color: rgba(216, 157, 74, 0.72);
  color: #fffaf2;
}

.inventory-actions .item-action.attune-action {
  background:
    linear-gradient(135deg, rgba(125, 211, 252, 0.22), rgba(196, 181, 253, 0.18));
  border-color: rgba(125, 211, 252, 0.56);
  color: #f8fcff;
}

.inventory-actions .item-action.attune-action:hover:not(:disabled) {
  background:
    linear-gradient(135deg, rgba(125, 211, 252, 0.32), rgba(196, 181, 253, 0.28));
  border-color: rgba(196, 181, 253, 0.78);
  color: #ffffff;
}

.inventory-actions .item-action.unattune-action {
  background: rgba(196, 181, 253, 0.12);
  border-color: rgba(196, 181, 253, 0.46);
  color: #f4efff;
}

.inventory-actions .item-action.unequip-action {
  color: #fffaf2;
}

.inventory-actions .item-action.sell-action {
  background: rgba(71, 177, 104, 0.16);
  border-color: rgba(71, 177, 104, 0.5);
  color: #fffaf2;
}

.inventory-actions .item-action.sell-action:hover:not(:disabled) {
  background: rgba(71, 177, 104, 0.26);
  border-color: rgba(141, 218, 157, 0.68);
}

.inventory-actions .item-action.discard-action {
  background: rgba(216, 88, 82, 0.12);
  border-color: rgba(216, 88, 82, 0.42);
  color: #fffaf2;
}

.inventory-actions .item-action.discard-action:hover:not(:disabled) {
  background: rgba(216, 88, 82, 0.22);
  border-color: rgba(255, 160, 154, 0.62);
}

.inventory-expanded {
  background: rgba(18, 13, 17, 0.34);
  border: 1px solid var(--item-rarity-border, rgba(216, 157, 74, 0.32));
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  padding: 11px;
}

.inventory-expanded-title {
  align-items: baseline;
  display: flex;
  gap: 10px;
  justify-content: space-between;
}

.inventory-expanded-title strong {
  font-size: 14px;
  font-weight: 950;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attunement-summary {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(125, 211, 252, 0.13), rgba(196, 181, 253, 0.09));
  border: 1px solid rgba(125, 211, 252, 0.38);
  border-radius: 8px;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
  padding: 8px 10px;
}

.attunement-summary span {
  color: #c7ecff;
  font-size: 10px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.attunement-summary strong {
  color: #fff;
  font-size: 12px;
  font-weight: 950;
  overflow: hidden;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attunement-summary.attuned {
  background:
    linear-gradient(135deg, rgba(125, 211, 252, 0.2), rgba(196, 181, 253, 0.16));
  border-color: rgba(196, 181, 253, 0.62);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.14);
}

.item-property-grid {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.item-property-grid div {
  background: rgba(255, 243, 231, 0.045);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 4px;
  padding: 8px;
}

.item-property-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.item-property-grid strong {
  font-size: 13px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.send-item-grid {
  align-items: end;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(220px, 1fr) minmax(92px, 120px) auto;
}

.item-manage-grid {
  align-items: end;
  display: grid;
  gap: 9px;
  grid-template-columns: minmax(92px, 120px) minmax(180px, 1fr) auto;
}

.item-manage-grid .item-description {
  margin: 0;
}

.send-confirm-btn,
.manage-confirm-btn {
  min-width: 86px;
}

.equip-action {
  background: linear-gradient(180deg, #c88f3c, #9b641c);
  border-color: rgba(255, 221, 154, 0.45);
  color: #160f0d;
}

.equip-action:hover {
  background: linear-gradient(180deg, #e0a550, #ac7024);
}

.use-action {
  background: linear-gradient(180deg, #625ad0, #473f9c);
  border-color: rgba(190, 184, 255, 0.38);
  color: #fffaf2;
}

.use-action:hover {
  background: linear-gradient(180deg, #7169df, #5148ad);
}

.unequip-action {
  background: rgba(255, 250, 242, 0.08);
  border-color: rgba(255, 250, 242, 0.18);
  color: var(--muted-strong);
}

.unequip-action:hover {
  background: rgba(255, 250, 242, 0.13);
  color: #fffaf2;
}

.qty-input {
  min-height: 34px;
  padding: 6px 8px;
}

.slot-row,
.resource-card {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(150px, .9fr) minmax(120px, 1fr) auto;
  padding: 10px 11px;
}

.resource-list.class-resource-grid {
  align-items: stretch;
  grid-template-columns: repeat(var(--class-resource-columns, 1), minmax(0, 1fr));
}

.attunement-tracker-block {
  background:
    radial-gradient(circle at 18px 18px, rgba(128, 222, 255, 0.13), transparent 25px),
    linear-gradient(135deg, rgba(110, 81, 154, 0.14), transparent 42%),
    var(--surface-1);
  border-color: rgba(220, 180, 99, 0.35);
  box-shadow:
    inset 0 0 0 1px rgba(255, 246, 216, 0.035),
    0 10px 28px rgba(0, 0, 0, 0.2);
  overflow: hidden;
  position: relative;
}

.attunement-tracker-block::before {
  background: linear-gradient(90deg, rgba(120, 222, 255, 0.7), rgba(222, 179, 91, 0.78), rgba(156, 116, 236, 0.62));
  content: "";
  height: 1px;
  left: 16px;
  opacity: 0.58;
  position: absolute;
  right: 16px;
  top: 43px;
}

.attunement-tracker-block .section-title span {
  color: #8ee7ff;
}

.attunement-tracker-block .section-title strong {
  color: #f5e0ad;
}

.attunement-tracker-list {
  gap: 10px;
}

.attunement-resource-card.has-resource-icon {
  background:
    linear-gradient(180deg, rgba(255, 246, 216, 0.045), rgba(0, 0, 0, 0)),
    linear-gradient(90deg, rgba(83, 194, 233, 0.12), rgba(183, 145, 74, 0.08) 52%, rgba(138, 103, 217, 0.1)),
    var(--surface-2);
  border-color: rgba(224, 184, 103, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(255, 247, 225, 0.04),
    inset 0 -18px 26px rgba(0, 0, 0, 0.16);
  gap: 8px 12px;
  grid-template-columns: 42px minmax(0, 1fr) minmax(104px, auto) auto;
  min-height: 84px;
  padding: 11px 12px;
  position: relative;
}

.attunement-resource-card.has-resource-icon::before,
.attunement-resource-card.has-resource-icon::after {
  border-color: rgba(236, 194, 107, 0.74);
  border-style: solid;
  content: "";
  height: 18px;
  pointer-events: none;
  position: absolute;
  width: 18px;
}

.attunement-resource-card.has-resource-icon::before {
  border-width: 1px 0 0 1px;
  left: 5px;
  top: 5px;
}

.attunement-resource-card.has-resource-icon::after {
  border-width: 0 1px 1px 0;
  bottom: 5px;
  right: 5px;
}

.attunement-resource-card.has-resource-icon .resource-icon-thumb {
  background:
    radial-gradient(circle at 50% 45%, rgba(148, 238, 255, 0.2), transparent 58%),
    rgba(31, 42, 46, 0.92);
  border-color: rgba(142, 231, 255, 0.46);
  color: #a8f0ff;
  grid-column: 1;
  grid-row: 1 / 3;
  height: 42px;
  width: 42px;
}

.attunement-resource-card.has-resource-icon .resource-icon-thumb svg {
  height: 28px;
  width: 28px;
}

.attunement-resource-card.has-resource-icon .resource-copy {
  grid-column: 2;
  grid-row: 1 / 3;
  min-width: 0;
}

.attunement-resource-card .resource-copy strong {
  color: #fff4dc;
}

.attunement-resource-card .resource-meta {
  color: #8ee7ff;
  font-weight: 850;
  text-transform: uppercase;
}

.attunement-resource-card.has-resource-icon .pip-meter {
  grid-column: 3;
  grid-row: 1 / 3;
  justify-content: center;
}

.attunement-resource-card.has-resource-icon .resource-status,
.attunement-resource-card.has-resource-icon .btn {
  align-self: center;
  grid-column: 4;
  grid-row: 1 / 3;
  justify-self: end;
}

.attunement-resource-card.has-resource-icon .resource-actions {
  align-self: center;
  grid-column: 4;
  grid-row: 1 / 3;
  justify-self: end;
}

.attunement-resource-card.has-resource-icon .resource-actions .btn,
.attunement-resource-card.has-resource-icon .resource-actions .resource-status {
  grid-column: auto;
  grid-row: auto;
  justify-self: auto;
}

.class-resource-block {
  justify-self: stretch;
  min-width: 0;
}

.class-resource-column {
  align-content: start;
  display: grid;
  gap: 7px;
  min-width: 0;
}

.class-resource-column header {
  align-items: end;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
  padding: 0 2px 5px;
  position: relative;
}

.class-resource-column header::after {
  background: linear-gradient(90deg, rgba(var(--accent-rgb), 0.56), rgba(var(--accent-rgb), 0));
  bottom: 0;
  content: "";
  height: 1px;
  left: 0;
  position: absolute;
  right: 0;
}

.class-resource-column header strong {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.class-resource-column header span {
  color: var(--muted);
  flex: 0 0 auto;
  font-size: 11px;
  font-weight: 900;
}

.class-resource-column > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.class-resource-column .resource-card {
  align-items: center;
  gap: 8px 12px;
  grid-template-columns: minmax(160px, 1.35fr) minmax(86px, .75fr) auto;
  min-height: 72px;
  padding: 9px 10px;
}

.class-resource-column .resource-card.has-resource-icon {
  gap: 5px 9px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  min-height: 0;
  padding: 8px 9px;
}

.class-resource-column .resource-card.has-resource-icon .resource-icon-thumb {
  grid-column: 1;
  grid-row: 1 / 3;
}

.class-resource-column .resource-card.has-resource-icon .resource-copy {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.class-resource-column .resource-card.has-resource-icon .pip-meter {
  grid-column: 2;
  grid-row: 2;
}

.class-resource-column .resource-card.has-resource-icon .resource-status,
.class-resource-column .resource-card.has-resource-icon .btn {
  align-self: center;
  grid-column: 3;
  grid-row: 1 / 3;
  justify-self: end;
}

.resource-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: flex-end;
  justify-self: end;
  min-width: 0;
}

.resource-actions .btn.small {
  min-height: 28px;
  padding: 5px 8px;
  white-space: nowrap;
}

.resource-actions .resource-status {
  align-self: center;
}

.resource-details-action {
  background: rgba(255, 250, 242, 0.075);
  border-color: rgba(255, 250, 242, 0.18);
  color: rgba(255, 250, 242, 0.82);
}

.resource-table-action {
  background: rgba(89, 179, 160, 0.15);
  border-color: rgba(89, 179, 160, 0.44);
  color: #eafff8;
}

.class-resource-card.expanded {
  align-items: start;
}

.resource-details-panel {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.08), rgba(89, 179, 160, 0.04)),
    rgba(18, 13, 17, 0.46);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  padding: 10px;
}

.resource-details-copy {
  display: grid;
  gap: 7px;
}

.resource-details-copy p {
  color: rgba(255, 250, 242, 0.82);
  font-size: 13px;
  line-height: 1.48;
  margin: 0;
  overflow-wrap: anywhere;
}

.resource-details-facts {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  margin: 0;
}

.resource-details-facts div {
  background: rgba(255, 250, 242, 0.045);
  border: 1px solid rgba(255, 250, 242, 0.08);
  border-radius: 7px;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 7px;
}

.resource-details-facts dt {
  color: var(--accent);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.resource-details-facts dd {
  color: #fffaf2;
  font-size: 12px;
  font-weight: 850;
  line-height: 1.28;
  margin: 0;
  overflow-wrap: anywhere;
}

.class-resource-column .resource-card.has-resource-icon .resource-actions {
  align-self: center;
  grid-column: 3;
  grid-row: 1 / 3;
  justify-self: end;
}

.class-resource-column .resource-card.has-resource-icon.expanded .resource-actions {
  align-self: start;
}

.class-resource-column .resource-card.has-resource-icon .resource-actions .btn,
.class-resource-column .resource-card.has-resource-icon .resource-actions .resource-status {
  grid-column: auto;
  grid-row: auto;
  justify-self: auto;
}

.class-resource-column .pip-meter {
  justify-content: flex-start;
  justify-self: stretch;
}

.class-resource-column .resource-card.has-resource-icon .pip-meter {
  gap: 5px;
}

.class-resource-column .resource-card.has-resource-icon .pip-meter i {
  height: 11px;
  width: 11px;
}

.class-resource-column .resource-status,
.class-resource-column .resource-card .btn {
  justify-self: start;
}

.ability-luck-block .resource-card.has-resource-icon {
  align-items: center;
  gap: 5px 9px;
  grid-template-columns: 36px minmax(0, 1fr) auto;
  min-height: 0;
  padding: 8px 9px;
}

.ability-luck-block .resource-card.has-resource-icon .resource-icon-thumb {
  grid-column: 1;
  grid-row: 1 / 3;
}

.ability-luck-block .resource-card.has-resource-icon .resource-copy {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
}

.ability-luck-block .resource-card.has-resource-icon .pip-meter {
  gap: 5px;
  grid-column: 2;
  grid-row: 2;
  justify-content: flex-start;
}

.ability-luck-block .resource-card.has-resource-icon .pip-meter i {
  height: 11px;
  width: 11px;
}

.ability-luck-block .resource-card.has-resource-icon .resource-status,
.ability-luck-block .resource-card.has-resource-icon .btn {
  align-self: center;
  grid-column: 3;
  grid-row: 1 / 3;
  justify-self: end;
}

.ability-luck-block .resource-card.has-resource-icon .resource-actions {
  align-self: center;
  grid-column: 3;
  grid-row: 1 / 3;
  justify-self: end;
}

.ability-luck-block .resource-card.has-resource-icon .resource-actions .btn,
.ability-luck-block .resource-card.has-resource-icon .resource-actions .resource-status {
  grid-column: auto;
  grid-row: auto;
  justify-self: auto;
}

.initiative-tracker {
  min-width: 0;
}

.initiative-shell {
  display: grid;
  gap: 10px;
}

.initiative-dashboard {
  gap: 12px;
}

.initiative-controls,
.initiative-summary,
.initiative-status-card {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.09), rgba(71, 177, 104, 0.06)),
    var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-height: 62px;
  padding: 10px;
}

.initiative-controls,
.initiative-status-card {
  background:
    linear-gradient(135deg, rgba(155, 145, 238, 0.12), rgba(216, 157, 74, 0.06)),
    var(--surface);
}

.initiative-dashboard.joined .initiative-status-card {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.105), rgba(216, 157, 74, 0.05)),
    var(--surface-2);
}

.initiative-shell.your-turn .initiative-summary {
  border-color: rgba(255, 215, 128, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 128, 0.18);
}

.initiative-shell.your-turn .initiative-status-card {
  border-color: rgba(255, 215, 128, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255, 215, 128, 0.16);
}

.initiative-control-copy,
.initiative-current {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.initiative-control-copy span,
.initiative-current span,
.initiative-row span,
.initiative-stat span,
.initiative-joined {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.initiative-control-copy strong {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.initiative-control-copy em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.initiative-current strong {
  color: var(--ink);
  font-size: 24px;
  font-weight: 950;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.initiative-shell.your-turn .initiative-current strong {
  color: #fff5cf;
}

.initiative-round {
  background: rgba(255, 250, 242, 0.06);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 950;
  justify-self: end;
  min-height: 32px;
  padding: 9px 11px;
  text-transform: uppercase;
}

.initiative-actions {
  align-items: center;
  display: flex;
  justify-content: flex-end;
  min-width: 0;
}

.initiative-action-grid {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: auto minmax(98px, 130px) auto;
}

.initiative-manual {
  min-width: 0;
}

.initiative-manual .input {
  min-height: 34px;
}

.initiative-joined {
  background: rgba(255, 250, 242, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 32px;
  padding: 9px 11px;
}

.initiative-turn-strip {
  align-items: center;
  background: rgba(5, 7, 10, 0.46);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  display: flex;
  gap: 6px;
  justify-self: stretch;
  margin: 0;
  max-width: 100%;
  min-width: 0;
  overflow-x: auto;
  padding: 6px;
  scroll-padding-inline: 0;
  scroll-snap-type: none;
  scrollbar-width: none;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

.initiative-turn-strip::-webkit-scrollbar {
  display: none;
}

.initiative-turn-strip .portal-map-turn-card {
  background: rgba(16, 20, 25, 0.92);
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  grid-template-columns: 42px;
  height: 48px;
  justify-content: center;
  min-width: 48px;
  padding: 3px;
  scroll-snap-align: none;
  transition:
    opacity 0.22s ease,
    transform 0.22s ease,
    width 0.24s ease,
    min-width 0.24s ease,
    height 0.24s ease,
    background 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease;
  width: 48px;
}

.initiative-turn-strip .portal-map-turn-card.current {
  background: rgba(16, 20, 25, 0.96);
  border-color: rgba(245, 214, 107, 0.72);
  border-radius: 999px;
  box-shadow: 0 0 0 2px rgba(245, 214, 107, 0.18), 0 18px 42px rgba(0, 0, 0, 0.42);
  gap: 9px;
  grid-template-columns: 42px minmax(122px, 1fr) auto;
  height: 64px;
  min-width: min(280px, calc(100vw - 188px));
  padding: 3px 8px 3px 3px;
  width: min(300px, 34vw);
}

.initiative-turn-strip .portal-map-turn-card.enemy.current {
  border-color: rgba(211, 74, 91, 0.95);
  box-shadow: 0 0 0 2px rgba(211, 74, 91, 0.22), 0 18px 42px rgba(0, 0, 0, 0.42);
}

.initiative-turn-strip .portal-map-turn-card.past:not(.current) {
  opacity: 0.36;
  transform: scale(0.92);
}

.initiative-turn-strip .portal-map-turn-card.future:not(.current) {
  opacity: 0.9;
}

.initiative-turn-strip .portal-map-turn-card.current .portal-map-turn-main {
  display: grid;
}

.initiative-turn-strip .portal-map-turn-card.current .portal-map-turn-index {
  background: rgba(245, 214, 107, 0.14);
  border-color: rgba(245, 214, 107, 0.42);
  font-size: 11px;
  min-width: 38px;
  padding: 6px 8px;
  position: static;
}

.initiative-map-preview {
  appearance: none;
  background:
    radial-gradient(circle at 50% 45%, rgba(245, 214, 107, 0.1), transparent 42%),
    rgba(5, 7, 10, 0.38);
  border: 1px solid rgba(240, 198, 106, 0.24);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.025);
  color: var(--ink);
  cursor: pointer;
  display: block;
  min-height: clamp(220px, 34vw, 380px);
  overflow: hidden;
  padding: 0;
  position: relative;
  text-align: left;
  transition: border-color 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
  width: 100%;
}

.initiative-map-preview.ready:hover {
  border-color: rgba(245, 214, 107, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(245, 214, 107, 0.12),
    0 16px 36px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.initiative-map-preview:disabled {
  cursor: default;
  opacity: .82;
}

.initiative-map-preview-canvas {
  height: 100%;
  inset: 0;
  min-height: inherit;
  pointer-events: none;
  position: absolute;
  width: 100%;
}

.initiative-map-preview-canvas .plume-map-canvas {
  pointer-events: none;
}

.initiative-map-preview.loading .initiative-map-preview-canvas {
  background:
    linear-gradient(90deg, rgba(255, 250, 242, 0.035) 1px, transparent 1px),
    linear-gradient(rgba(255, 250, 242, 0.035) 1px, transparent 1px),
    linear-gradient(135deg, rgba(115, 208, 255, 0.08), rgba(216, 157, 74, 0.06)),
    #111418;
  background-size: 32px 32px, 32px 32px, auto, auto;
}

.initiative-map-preview::after {
  background: linear-gradient(180deg, rgba(5, 7, 10, 0.08), rgba(5, 7, 10, 0.66));
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.initiative-map-preview-overlay {
  align-items: center;
  display: flex;
  inset: auto 0 14px;
  justify-content: center;
  pointer-events: none;
  position: absolute;
  z-index: 2;
}

.initiative-map-preview-overlay span {
  animation: initiativeMapPreviewHint 2.4s ease-in-out infinite;
  color: rgba(255, 243, 231, 0.82);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: .08em;
  line-height: 1;
  padding: 0;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.76), 0 0 18px rgba(240, 198, 106, 0.28);
  text-transform: uppercase;
}

@keyframes initiativeMapPreviewHint {
  0%,
  100% {
    opacity: .2;
  }

  50% {
    opacity: .8;
  }
}

.initiative-rows {
  display: grid;
  gap: 7px;
}

.initiative-row {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px minmax(0, 1fr) repeat(3, minmax(64px, 76px));
  min-height: 58px;
  padding: 8px 10px;
}

.initiative-row.current {
  border-color: rgba(216, 157, 74, 0.58);
  box-shadow: inset 3px 0 0 rgba(216, 157, 74, 0.78);
}

.initiative-row.self {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), transparent 62%),
    var(--surface-2);
}

.initiative-row.enemy {
  background:
    linear-gradient(135deg, rgba(216, 88, 82, 0.07), transparent 54%),
    var(--surface-2);
}

.initiative-order {
  align-items: center;
  background: rgba(255, 250, 242, 0.05);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted-strong);
  display: inline-flex;
  font-size: 11px;
  font-weight: 950;
  justify-content: center;
  min-height: 34px;
  text-transform: uppercase;
}

.initiative-row.current .initiative-order {
  background: rgba(216, 157, 74, 0.18);
  border-color: rgba(216, 157, 74, 0.44);
  color: #fff5cf;
}

.initiative-name {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.initiative-name strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.initiative-name span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.initiative-stat {
  display: grid;
  gap: 3px;
  min-width: 0;
  text-align: right;
}

.initiative-stat strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.initiative-stat.hp strong {
  font-size: 13px;
}

.weapon-list {
  align-items: stretch;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
}

.movement-list {
  align-items: start;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.weapon-card,
.movement-card,
.feature-card {
  align-content: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 10px;
}

.weapon-card {
  align-items: center;
  align-self: stretch;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 8px;
  justify-self: stretch;
  max-width: 100%;
  min-height: 0;
  min-width: 0;
  padding: 8px;
  width: auto;
}

.weapon-card.empty {
  opacity: .72;
}

.weapon-card .item-thumb {
  align-self: center;
  height: 40px;
  width: 40px;
}

.weapon-card .item-icon-thumb {
  --item-icon-color: rgba(255, 250, 242, 0.88);
  --item-icon-soft: rgba(255, 250, 242, 0.055);
  background: rgba(255, 243, 231, 0.055);
  border-color: rgba(255, 243, 231, 0.16);
  color: var(--item-icon-color);
}

.weapon-card .item-icon-thumb svg {
  height: 25px;
  width: 25px;
}

.weapon-card-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.weapon-slot-label,
.movement-card span,
.feature-card span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.weapon-card strong,
.movement-card strong,
.feature-card strong {
  font-weight: 950;
  overflow-wrap: anywhere;
}

.weapon-card em,
.movement-card em,
.feature-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 850;
}

.weapon-tags,
.feature-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.weapon-tags {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  justify-content: start;
  margin-top: 1px;
  max-width: 100%;
  overflow: visible;
}

.weapon-tags .tag {
  align-content: center;
  border-left-width: 1px;
  border-radius: 7px;
  flex: 0 1 auto;
  justify-content: center;
  line-height: 1.1;
  max-width: min(150px, 100%);
  min-height: 22px;
  min-width: 0;
  overflow-wrap: anywhere;
  padding: 3px 7px;
  text-align: center;
}

.movement-card {
  align-items: center;
  grid-template-columns: 38px minmax(0, 1fr);
  min-height: 70px;
  width: 160px;
}

.movement-card-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.movement-card strong {
  font-size: 22px;
}

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

.feature-card {
  align-content: start;
}

.feature-card div:first-child {
  display: grid;
  gap: 2px;
}

.feature-card p {
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.profile-detail-list {
  align-items: start;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.profile-detail-list.compact {
  grid-template-columns: 1fr;
}

.profile-detail-card {
  gap: 0;
  min-width: 0;
}

.profile-detail-card summary {
  cursor: pointer;
  display: grid;
  gap: 2px;
  list-style: none;
  min-width: 0;
  padding-right: 24px;
  position: relative;
}

.profile-detail-card summary::-webkit-details-marker {
  display: none;
}

.profile-detail-card summary::after {
  background:
    linear-gradient(currentColor, currentColor) center / 8px 2px no-repeat,
    linear-gradient(currentColor, currentColor) center / 2px 8px no-repeat;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  content: "";
  display: block;
  font-weight: 950;
  height: 18px;
  line-height: 1;
  position: absolute;
  right: 0;
  top: 1px;
  width: 18px;
}

.profile-detail-card[open] summary::after {
  background: linear-gradient(currentColor, currentColor) center / 8px 2px no-repeat;
}

.profile-detail-body {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 7px;
  margin-top: 9px;
  padding-top: 9px;
}

.profile-detail-body p {
  margin: 0;
}

.profile-detail-choices {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.action-panel-list {
  align-items: start;
  display: grid;
  gap: 9px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.action-panel-list.has-action-spill {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.action-lane {
  align-content: start;
  display: grid;
  gap: 10px;
  min-width: 0;
}

.action-lane.spill {
  min-width: 0;
}

.action-group {
  align-content: start;
  display: grid;
  gap: 7px;
  min-width: 0;
}

.action-group header {
  border-bottom: 1px solid var(--line);
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  padding-bottom: 5px;
  text-transform: uppercase;
}

.action-entry {
  align-items: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px 7px;
  grid-template-columns: 36px minmax(0, 1fr);
  min-height: 0;
  padding: 8px 9px;
}

.action-entry.empty {
  display: block;
  opacity: .72;
}

.action-icon-thumb {
  align-self: start;
  background: rgba(255, 243, 231, 0.055);
  border: 1px solid rgba(255, 243, 231, 0.16);
  border-radius: 8px;
  color: rgba(255, 250, 242, 0.86);
  display: grid;
  height: 36px;
  place-items: center;
  width: 36px;
}

.action-icon-thumb svg {
  display: block;
  fill: none;
  height: 24px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 24px;
}

.resource-icon-thumb {
  align-self: center;
  background: rgba(255, 243, 231, 0.055);
  border: 1px solid rgba(255, 243, 231, 0.16);
  border-radius: 8px;
  color: rgba(255, 250, 242, 0.86);
  display: grid;
  height: 36px;
  place-items: center;
  width: 36px;
}

.resource-icon-thumb svg {
  display: block;
  fill: currentColor;
  height: 24px;
  stroke: none;
  width: 24px;
}

.movement-icon-thumb {
  align-self: center;
  background: rgba(255, 243, 231, 0.055);
  border: 1px solid rgba(255, 243, 231, 0.16);
  border-radius: 8px;
  color: rgba(255, 250, 242, 0.86);
  display: grid;
  height: 38px;
  place-items: center;
  width: 38px;
}

.movement-icon-thumb svg {
  display: block;
  fill: currentColor;
  height: 25px;
  stroke: none;
  width: 25px;
}

.action-entry-main {
  align-items: start;
  display: grid;
  gap: 5px 7px;
  grid-template-columns: minmax(0, 1fr) auto;
  min-width: 0;
}

.action-entry-head {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.action-entry-body {
  align-items: start;
  display: grid;
  gap: 6px;
  justify-items: end;
}

.action-entry strong {
  font-weight: 950;
  overflow-wrap: anywhere;
}

.action-entry-head span,
.action-entry p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.38;
  overflow-wrap: anywhere;
}

.action-entry p {
  color: var(--muted-strong);
}

.action-detail-btn {
  min-height: 24px;
}

.weapon-roll-actions {
  display: grid;
  gap: 5px;
  grid-template-columns: 1fr;
  margin-top: 2px;
}

.weapon-roll-actions.two-rolls {
  grid-template-columns: minmax(58px, 0.62fr) minmax(0, 1.38fr);
}

.weapon-roll-actions:empty {
  display: none;
}

.weapon-roll-btn {
  align-items: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.065);
  border: 1px solid rgba(226, 195, 151, 0.22);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  display: flex;
  gap: 8px;
  justify-content: space-between;
  min-height: 34px;
  min-width: 0;
  padding: 6px 8px;
  text-align: left;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}

.weapon-roll-btn.damage {
  background: rgba(216, 157, 74, 0.08);
}

.weapon-roll-btn.tutorial-target-active,
.weapon-roll-btn.damage.tutorial-target-active {
  background: rgba(var(--tutorial-highlight-rgb), 0.18) !important;
  border-color: rgba(var(--tutorial-highlight-rgb), 0.96) !important;
  color: #f3fff8 !important;
  overflow: visible;
}

.weapon-roll-btn:hover,
.weapon-roll-btn:focus-visible {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(216, 157, 74, 0.56);
}

.weapon-roll-btn:active {
  transform: translateY(1px);
}

.weapon-roll-btn strong {
  color: var(--gold);
  flex: 0 1 auto;
  font-size: 12px;
  justify-self: end;
  line-height: 1.1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: right;
  white-space: nowrap;
}

.weapon-roll-btn span {
  color: var(--muted);
  font-size: 10px;
  flex: 0 0 auto;
  font-weight: 950;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.action-detail {
  border-top: 1px solid var(--line);
  grid-column: 1 / -1;
  padding-top: 8px;
}

.action-detail .spell-detail {
  background: transparent;
  border: 0;
  padding: 0;
}

.action-reminders {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  grid-column: 1 / -1;
}

.spell-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  overflow: hidden;
  touch-action: manipulation;
}

.spell-level-group {
  display: grid;
  gap: 8px;
}

.spell-level-group + .spell-level-group {
  margin-top: 8px;
}

.spell-level-header {
  align-items: center;
  color: #fffaf2;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(24px, 1fr) auto;
  padding: 2px 1px 1px;
}

.spell-level-header::after {
  background: linear-gradient(90deg, rgba(155, 145, 238, 0.72), rgba(216, 157, 74, 0.28) 48%, transparent);
  content: "";
  grid-column: 2;
  grid-row: 1;
  height: 1px;
  min-width: 24px;
}

.spell-level-header span {
  color: #fffaf2;
  font-size: 12px;
  font-weight: 950;
  grid-column: 1;
  grid-row: 1;
  text-transform: uppercase;
}

.spell-level-header small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 850;
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
}

.spell-card.expanded {
  border-color: rgba(155, 145, 238, 0.48);
}

.spell-card:hover {
  background: rgba(255, 243, 231, 0.035);
}

.spell-toggle {
  align-items: center;
  appearance: none;
  background: transparent;
  border: 0;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 11px;
  text-align: left;
  width: 100%;
}

.spell-toggle:hover {
  background: rgba(255, 243, 231, 0.04);
}

.spell-toggle span {
  display: grid;
  gap: 2px;
}

.spell-toggle strong {
  font-size: 15px;
  font-weight: 950;
  overflow-wrap: anywhere;
}

.spell-toggle em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.spell-toggle b {
  background: rgba(155, 145, 238, 0.12);
  border: 1px solid rgba(155, 145, 238, 0.28);
  border-radius: 999px;
  color: var(--arcane);
  font-size: 11px;
  font-weight: 950;
  padding: 5px 9px;
  text-transform: uppercase;
}

.spell-detail {
  border-top: 1px solid var(--line);
  display: grid;
  gap: 10px;
  padding: 0 11px 12px;
}

.magic-page {
  --magic-gold: #f0c66f;
  --magic-teal: #7cd9d0;
  --magic-ember: #e69062;
  --magic-violet: #a59df4;
}

.magic-page-head {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(124, 217, 208, 0.13), rgba(165, 157, 244, 0.12) 44%, rgba(240, 198, 111, 0.1)),
    linear-gradient(180deg, rgba(255, 250, 242, 0.055), rgba(255, 250, 242, 0.018)),
    var(--surface);
  border: 1px solid rgba(240, 198, 111, 0.24);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 242, 0.04),
    0 18px 36px rgba(0, 0, 0, 0.24);
  gap: 9px;
  grid-template-columns: 46px minmax(0, 1fr);
  justify-items: stretch;
  overflow: hidden;
  padding: 14px;
  position: relative;
  text-align: left;
}

.magic-page-head::before,
.magic-page-head::after {
  content: "";
  pointer-events: none;
  position: absolute;
}

.magic-page-head::before {
  background: linear-gradient(90deg, var(--magic-teal), var(--magic-violet), var(--magic-gold), var(--magic-ember));
  height: 2px;
  inset: 0 0 auto;
  opacity: .72;
}

.magic-page-head::after {
  border: 1px solid rgba(255, 250, 242, 0.08);
  border-radius: 6px;
  inset: 7px;
}

.magic-page-head .kicker,
.magic-page-head h2,
.magic-page-subtitle,
.magic-hero-icon,
.magic-overview {
  position: relative;
  z-index: 1;
}

.magic-page-head .kicker {
  color: var(--magic-teal);
  font-size: 11px;
  font-weight: 950;
  grid-column: 2;
  line-height: 1;
  text-transform: uppercase;
}

.magic-page-head h2 {
  color: #fffaf2;
  font-size: 30px;
  grid-column: 2;
  line-height: .95;
  margin: 0;
}

.magic-page-subtitle {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  grid-column: 2;
  line-height: 1.28;
  margin: -2px 0 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.magic-hero-icon {
  align-self: center;
  background:
    linear-gradient(135deg, rgba(124, 217, 208, 0.24), rgba(165, 157, 244, 0.18)),
    rgba(12, 12, 18, 0.84);
  border: 1px solid rgba(240, 198, 111, 0.34);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 242, 0.06),
    0 10px 24px rgba(0, 0, 0, 0.24);
  display: grid;
  grid-column: 1;
  grid-row: 1 / 4;
  height: 46px;
  place-items: center;
  width: 46px;
}

.magic-hero-icon::before,
.magic-hero-icon::after {
  content: "";
  position: absolute;
}

.magic-hero-icon::before {
  border: 2px solid currentColor;
  border-radius: 50%;
  color: var(--magic-gold);
  height: 24px;
  transform: rotate(45deg);
  width: 24px;
}

.magic-hero-icon::after {
  background:
    linear-gradient(currentColor, currentColor) center / 3px 28px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) center / 28px 3px no-repeat;
  color: var(--magic-teal);
  height: 30px;
  width: 30px;
}

.magic-overview {
  display: grid;
  gap: 8px;
  grid-column: 1 / -1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 4px;
}

.magic-overview-card {
  align-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--magic-card-color, var(--magic-violet)) 16%, transparent), transparent 68%),
    rgba(255, 250, 242, 0.045);
  border: 1px solid color-mix(in srgb, var(--magic-card-color, var(--magic-violet)) 34%, rgba(255, 250, 242, 0.1));
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: 32px minmax(0, 1fr);
  min-height: 66px;
  min-width: 0;
  padding: 8px;
}

.magic-overview-attack,
.magic-overview-cantrips {
  --magic-card-color: var(--magic-ember);
}

.magic-overview-dc,
.magic-overview-prepared {
  --magic-card-color: var(--magic-gold);
}

.magic-overview-slots,
.magic-overview-learned {
  --magic-card-color: var(--magic-teal);
}

.magic-overview-icon {
  align-items: center;
  background: color-mix(in srgb, var(--magic-card-color, var(--magic-violet)) 18%, rgba(7, 9, 14, 0.72));
  border: 1px solid color-mix(in srgb, var(--magic-card-color, var(--magic-violet)) 46%, rgba(255, 250, 242, 0.1));
  border-radius: 8px;
  color: var(--magic-card-color, var(--magic-violet));
  display: inline-grid;
  height: 32px;
  justify-content: center;
  width: 32px;
}

.magic-overview-icon svg {
  display: block;
  height: 19px;
  width: 19px;
}

.magic-overview-card div {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.magic-overview-card small,
.magic-overview-card em {
  color: var(--muted);
  font-size: 10px;
  font-style: normal;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.magic-overview-card strong {
  color: #fffaf2;
  font-size: 17px;
  font-weight: 950;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.magic-block {
  --magic-section-color: var(--magic-violet);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--magic-section-color) 12%, transparent), transparent 54%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.035), rgba(255, 250, 242, 0.012)),
    var(--surface);
  border-color: color-mix(in srgb, var(--magic-section-color) 28%, var(--line));
  overflow: hidden;
  position: relative;
}

.magic-block::before {
  background: linear-gradient(180deg, var(--magic-section-color), transparent);
  content: "";
  inset: 0 auto 0 0;
  opacity: .72;
  position: absolute;
  width: 3px;
}

.magic-block-slots {
  --magic-section-color: var(--magic-teal);
}

.magic-summary-block {
  --magic-section-color: var(--magic-teal);
}

.magic-summary-block .magic-overview {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 0;
}

.magic-page .magic-block:not(.magic-summary-block) .section-title strong {
  display: none;
}

.magic-block-cantrips {
  --magic-section-color: var(--magic-ember);
}

.magic-block-prepared,
.magic-block-known {
  --magic-section-color: var(--magic-gold);
}

.magic-block-wild {
  --magic-section-color: #77c88d;
}

.magic-block-invocations {
  --magic-section-color: #b58cff;
}

.magic-block-metamagic {
  --magic-section-color: #ff9ec7;
}

.magic-block .section-title {
  align-items: center;
  display: grid;
  gap: 8px 10px;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  position: relative;
}

.magic-block .section-title::before {
  align-items: center;
  background: color-mix(in srgb, var(--magic-section-color) 18%, rgba(7, 9, 14, 0.72));
  border: 1px solid color-mix(in srgb, var(--magic-section-color) 44%, rgba(255, 250, 242, 0.12));
  border-radius: 8px;
  color: var(--magic-section-color);
  content: "";
  display: grid;
  height: 30px;
  justify-content: center;
  width: 30px;
}

.magic-block .section-title::after {
  background:
    linear-gradient(currentColor, currentColor) center / 3px 18px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) center / 18px 3px no-repeat;
  color: var(--magic-section-color);
  content: "";
  grid-column: 1;
  grid-row: 1;
  height: 30px;
  justify-self: center;
  pointer-events: none;
  width: 30px;
}

.magic-block .section-title span {
  color: var(--magic-section-color);
  grid-column: 2;
  min-width: 0;
}

.magic-block .section-title strong {
  color: rgba(255, 250, 242, 0.72);
  grid-column: 3;
  min-width: 0;
}

.magic-stack {
  align-items: start;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.magic-wide {
  grid-column: 1 / -1;
}

.magic-block .feature-list {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.magic-block .feature-card {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--magic-section-color) 12%, transparent), transparent 56%),
    rgba(255, 250, 242, 0.045);
  border-color: color-mix(in srgb, var(--magic-section-color) 24%, var(--line));
}

.magic-block .empty-card,
.magic-block .empty-inline {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--magic-section-color) 9%, transparent), transparent),
    rgba(255, 250, 242, 0.035);
  border-color: color-mix(in srgb, var(--magic-section-color) 24%, var(--line));
}

.magic-block-slots .spell-slots {
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(258px, 1fr));
}

.magic-slot-card {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(124, 217, 208, 0.13), rgba(165, 157, 244, 0.08) 56%, rgba(240, 198, 111, 0.08)),
    rgba(255, 250, 242, 0.042);
  border-color: rgba(124, 217, 208, 0.26);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.035);
  gap: 8px 10px;
  grid-template-areas:
    "orb label spend"
    "orb mid spend";
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  min-height: 86px;
  padding: 10px;
}

.magic-slot-orb {
  align-items: center;
  background:
    linear-gradient(135deg, rgba(124, 217, 208, 0.22), rgba(165, 157, 244, 0.18)),
    rgba(7, 9, 14, 0.8);
  border: 1px solid rgba(124, 217, 208, 0.48);
  border-radius: 50%;
  color: #e9ffff;
  display: inline-grid;
  grid-area: orb;
  height: 42px;
  justify-content: center;
  width: 42px;
}

.magic-slot-orb b {
  font-size: 17px;
  font-weight: 950;
}

.magic-slot-card .meter-copy {
  grid-area: label;
  min-width: 0;
}

.magic-slot-card .meter-copy strong {
  color: #fffaf2;
  font-size: 15px;
}

.magic-slot-mid {
  align-items: center;
  display: grid;
  gap: 5px;
  grid-area: mid;
  justify-items: start;
  min-width: 0;
}

.magic-slot-count {
  align-items: baseline;
  color: rgba(196, 244, 238, 0.78);
  display: inline-flex;
  gap: 3px;
  font-weight: 850;
}

.magic-slot-count b,
.magic-slot-count em {
  font: inherit;
}

.magic-slot-count em {
  font-style: normal;
}

.magic-slot-bar {
  background: rgba(255, 250, 242, 0.08);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 999px;
  grid-column: 2 / 4;
  grid-row: 2;
  height: 9px;
  overflow: hidden;
}

.magic-slot-bar i {
  background: linear-gradient(90deg, var(--magic-teal), var(--magic-violet), var(--magic-gold));
  display: block;
  height: 100%;
  width: var(--slot-fill, 0%);
}

.magic-slot-card .pip-meter {
  justify-content: start;
}

.magic-slot-spend {
  align-items: center;
  display: inline-flex;
  gap: 6px;
  grid-area: spend;
  justify-content: center;
}

.magic-slot-spend svg {
  display: block;
  height: 14px;
  width: 14px;
}

.spell-card {
  --spell-color: var(--magic-violet);
  --spell-soft: rgba(165, 157, 244, 0.12);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--spell-color) 14%, transparent), transparent 60%),
    linear-gradient(180deg, rgba(255, 250, 242, 0.04), rgba(255, 250, 242, 0.015)),
    var(--surface-2);
  border-color: color-mix(in srgb, var(--spell-color) 26%, var(--line));
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.025);
}

.spell-school-abjuration {
  --spell-color: #76c7ff;
}

.spell-school-conjuration {
  --spell-color: #7cd9d0;
}

.spell-school-divination {
  --spell-color: #f0c66f;
}

.spell-school-enchantment {
  --spell-color: #ff9ec7;
}

.spell-school-evocation {
  --spell-color: #e69062;
}

.spell-school-illusion {
  --spell-color: #b58cff;
}

.spell-school-necromancy {
  --spell-color: #9bd78f;
}

.spell-school-transmutation {
  --spell-color: #8fd6a3;
}

.spell-card.expanded {
  border-color: color-mix(in srgb, var(--spell-color) 56%, rgba(255, 250, 242, 0.16));
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--spell-color) 18%, transparent),
    0 10px 24px rgba(0, 0, 0, 0.16);
}

.spell-card:hover {
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--spell-color) 18%, transparent), transparent 62%),
    rgba(255, 250, 242, 0.048);
}

.spell-toggle {
  gap: 10px;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  min-height: 66px;
  padding: 10px;
}

.spell-toggle:hover {
  background: color-mix(in srgb, var(--spell-color) 7%, rgba(255, 250, 242, 0.025));
}

.spell-toggle:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--spell-color) 72%, #fffaf2);
  outline-offset: -2px;
}

.spell-toggle .spell-card-icon {
  align-items: center;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--spell-color) 22%, transparent), transparent),
    rgba(7, 9, 14, 0.78);
  border: 1px solid color-mix(in srgb, var(--spell-color) 50%, rgba(255, 250, 242, 0.12));
  border-radius: 8px;
  color: var(--spell-color);
  display: grid;
  height: 42px;
  justify-content: center;
  position: relative;
  width: 42px;
}

.spell-card-icon::before,
.spell-card-icon::after {
  content: "";
  pointer-events: none;
  position: absolute;
}

.spell-card-icon::before {
  border: 1px solid currentColor;
  border-radius: 50%;
  height: 24px;
  opacity: .42;
  width: 24px;
}

.spell-card-icon::after {
  background:
    linear-gradient(currentColor, currentColor) center / 2px 26px no-repeat,
    linear-gradient(90deg, currentColor, currentColor) center / 26px 2px no-repeat;
  height: 28px;
  opacity: .38;
  width: 28px;
}

.spell-toggle .spell-card-icon b {
  background: transparent;
  border: 0;
  border-radius: 0;
  color: #fffaf2;
  font-size: 16px;
  font-weight: 950;
  line-height: 1;
  padding: 0;
  position: relative;
  text-transform: uppercase;
  z-index: 1;
}

.spell-toggle .spell-toggle-main {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.spell-toggle .spell-toggle-head {
  align-items: baseline;
  display: flex;
  gap: 8px;
  min-width: 0;
}

.spell-toggle-head strong {
  color: #fffaf2;
  font-size: 15px;
  line-height: 1.15;
  min-width: 0;
}

.spell-toggle-head small {
  background: color-mix(in srgb, var(--spell-color) 14%, rgba(255, 250, 242, 0.055));
  border: 1px solid color-mix(in srgb, var(--spell-color) 26%, rgba(255, 250, 242, 0.1));
  border-radius: 999px;
  color: color-mix(in srgb, var(--spell-color) 78%, #fffaf2);
  flex: 0 0 auto;
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  padding: 4px 7px;
  text-transform: uppercase;
}

.spell-toggle .spell-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.spell-toggle .spell-chip-row em {
  background: rgba(255, 250, 242, 0.055);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 7px;
  color: var(--muted-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1;
  max-width: 100%;
  overflow-wrap: anywhere;
  padding: 5px 7px;
}

.spell-toggle .spell-detail-pill {
  align-items: center;
  background: color-mix(in srgb, var(--spell-color) 14%, rgba(255, 250, 242, 0.05));
  border: 1px solid color-mix(in srgb, var(--spell-color) 30%, rgba(255, 250, 242, 0.12));
  border-radius: 999px;
  color: color-mix(in srgb, var(--spell-color) 80%, #fffaf2);
  display: inline-flex;
  font-size: 11px;
  font-weight: 950;
  gap: 4px;
  justify-content: center;
  line-height: 1;
  min-width: 86px;
  padding: 7px 9px;
  text-transform: uppercase;
}

.spell-toggle .spell-detail-pill span {
  display: inline;
}

.spell-detail-pill svg {
  display: block;
  height: 14px;
  width: 14px;
}

.spell-card .spell-detail {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--spell-color) 8%, transparent), transparent),
    rgba(5, 7, 11, 0.24);
  border-color: color-mix(in srgb, var(--spell-color) 22%, var(--line));
  padding: 0 12px 12px;
}

.spell-card .spell-facts span,
.spell-card .spell-inline-facts span {
  background: color-mix(in srgb, var(--spell-color) 10%, rgba(255, 250, 242, 0.045));
  border-color: color-mix(in srgb, var(--spell-color) 25%, var(--line));
}

.spell-card .spell-facts small,
.spell-card .spell-inline-facts small,
.spell-card .spell-text-heading,
.spell-card .spell-higher strong,
.spell-card .spell-text-list li::marker {
  color: var(--spell-color);
}

@media (max-width: 1100px) {
  .magic-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 920px) {
  .magic-stack {
    grid-template-columns: 1fr;
  }

  .magic-wide {
    grid-column: auto;
  }
}

@media (max-width: 640px) {
  .magic-page-head {
    gap: 8px;
    grid-template-columns: 40px minmax(0, 1fr);
    padding: 12px;
  }

  .magic-page-head h2 {
    font-size: 24px;
  }

  .magic-page-subtitle {
    font-size: 11px;
    white-space: normal;
  }

  .magic-hero-icon {
    height: 40px;
    width: 40px;
  }

  .magic-overview {
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .magic-overview-card {
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 60px;
    padding: 7px;
  }

  .magic-overview-icon {
    height: 28px;
    width: 28px;
  }

  .magic-block .section-title {
    align-items: start;
    grid-template-columns: 30px minmax(0, 1fr);
  }

  .magic-block .section-title strong {
    grid-column: 2;
    text-align: left;
  }

  .magic-block-slots .spell-slots {
    grid-template-columns: 1fr;
  }

  .magic-slot-card {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .magic-slot-orb {
    height: 38px;
    width: 38px;
  }

  .magic-slot-spend {
    grid-area: spend;
    justify-self: stretch;
  }

  .magic-slot-bar {
    grid-column: 2;
  }

  .magic-slot-card .pip-meter {
    justify-content: start;
  }

  .spell-toggle {
    align-items: start;
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .spell-toggle .spell-card-icon {
    height: 38px;
    width: 38px;
  }

  .spell-toggle .spell-toggle-head {
    align-items: start;
    flex-direction: column;
    gap: 5px;
  }

  .spell-toggle .spell-detail-pill {
    grid-column: 1 / -1;
    justify-self: stretch;
    min-width: 0;
  }
}

@media (max-width: 420px) {
  .magic-overview {
    grid-template-columns: 1fr;
  }
}

.magic-page {
  --magic-gold: #d7b46d;
  --magic-teal: #8fd3cc;
  --magic-ember: #cf8f68;
  --magic-violet: #aca6d9;
}

.magic-page-head {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.045), rgba(255, 250, 242, 0.018)),
    var(--surface);
  border-color: rgba(226, 195, 151, 0.18);
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 242, 0.026),
    0 14px 28px rgba(0, 0, 0, 0.2);
  gap: 8px;
  padding: 12px 14px;
}

.magic-page-head::before {
  background: linear-gradient(90deg, rgba(143, 211, 204, 0.42), rgba(215, 180, 109, 0.36), transparent 82%);
  height: 1px;
  opacity: .54;
}

.magic-page-head::after {
  display: none;
}

.magic-page-head .kicker {
  color: rgba(143, 211, 204, 0.82);
}

.magic-hero-icon {
  background: rgba(255, 250, 242, 0.045);
  border-color: rgba(226, 195, 151, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.025);
}

.magic-hero-icon::before {
  border-width: 1px;
  color: rgba(215, 180, 109, 0.76);
  transform: none;
}

.magic-hero-icon::after {
  background: currentColor;
  border-radius: 50%;
  color: rgba(143, 211, 204, 0.82);
  height: 7px;
  width: 7px;
}

.magic-overview-card {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.04), rgba(255, 250, 242, 0.016)),
    var(--surface-2);
  border-color: rgba(226, 195, 151, 0.14);
  min-height: 58px;
}

.magic-overview-icon {
  background: rgba(255, 250, 242, 0.045);
  border-color: color-mix(in srgb, var(--magic-card-color, var(--magic-teal)) 30%, rgba(255, 250, 242, 0.12));
  color: color-mix(in srgb, var(--magic-card-color, var(--magic-teal)) 74%, #fffaf2);
}

.magic-overview-card small,
.magic-overview-card em {
  color: rgba(248, 239, 228, 0.58);
}

.magic-block {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.028), rgba(255, 250, 242, 0.01)),
    var(--surface);
  border-color: rgba(226, 195, 151, 0.14);
}

.magic-block::before {
  background: color-mix(in srgb, var(--magic-section-color) 42%, rgba(226, 195, 151, 0.28));
  opacity: .34;
  width: 2px;
}

.magic-block .section-title {
  align-items: baseline;
  display: flex;
  gap: 10px;
  grid-template-columns: none;
  justify-content: space-between;
}

.magic-block .section-title::before,
.magic-block .section-title::after {
  display: none;
}

.magic-block .section-title span {
  color: color-mix(in srgb, var(--magic-section-color) 64%, #fffaf2);
  grid-column: auto;
}

.magic-block .section-title strong {
  color: rgba(248, 239, 228, 0.68);
  grid-column: auto;
}

.magic-stack {
  align-items: start;
}

.magic-stack > .magic-block {
  align-self: start;
}

.magic-block .feature-card {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.035), rgba(255, 250, 242, 0.014)),
    var(--surface-2);
  border-color: rgba(226, 195, 151, 0.14);
}

.magic-block .empty-card,
.magic-block .empty-inline {
  background: rgba(255, 250, 242, 0.035);
  border-color: rgba(226, 195, 151, 0.14);
}

.magic-slot-card {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.038), rgba(255, 250, 242, 0.014)),
    var(--surface-2);
  border-color: rgba(143, 211, 204, 0.18);
  grid-template-areas:
    "orb label spend"
    "orb mid spend";
  grid-template-columns: 42px minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  min-height: 74px;
}

.magic-slot-count {
  color: rgba(143, 211, 204, 0.74);
}

.magic-slot-bar {
  display: none;
}

.magic-slot-card .pip-meter {
  padding-top: 2px;
}

.magic-slot-spend {
  grid-area: spend;
}

.magic-slot-spend span {
  display: none;
}

.spell-card {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.035), rgba(255, 250, 242, 0.012)),
    var(--surface-2);
  border-color: color-mix(in srgb, var(--spell-color) 18%, rgba(226, 195, 151, 0.12));
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.018);
}

.spell-card.expanded {
  border-color: color-mix(in srgb, var(--spell-color) 34%, rgba(226, 195, 151, 0.18));
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 242, 0.025),
    0 8px 18px rgba(0, 0, 0, 0.14);
}

.spell-card:hover {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.048), rgba(255, 250, 242, 0.018)),
    var(--surface-2);
}

.spell-toggle:hover {
  background: rgba(255, 250, 242, 0.026);
}

.spell-toggle .spell-card-icon {
  background: rgba(255, 250, 242, 0.04);
  border-color: color-mix(in srgb, var(--spell-color) 34%, rgba(255, 250, 242, 0.1));
  color: color-mix(in srgb, var(--spell-color) 76%, #fffaf2);
}

.spell-card-icon::before {
  opacity: .34;
}

.spell-card-icon::after {
  background: none;
  border: 1px solid currentColor;
  border-left-color: transparent;
  border-radius: 50%;
  height: 28px;
  opacity: .22;
  transform: rotate(38deg);
  width: 28px;
}

.spell-toggle-head small,
.spell-toggle .spell-detail-pill {
  background: rgba(255, 250, 242, 0.055);
  border-color: color-mix(in srgb, var(--spell-color) 22%, rgba(255, 250, 242, 0.12));
  color: color-mix(in srgb, var(--spell-color) 70%, #fffaf2);
}

.spell-toggle .spell-chip-row em {
  background: rgba(255, 250, 242, 0.045);
  border-color: rgba(255, 250, 242, 0.09);
}

.spell-card .spell-detail {
  background: rgba(5, 7, 11, 0.18);
  border-color: rgba(226, 195, 151, 0.12);
}

.spell-card .spell-facts span,
.spell-card .spell-inline-facts span {
  background: rgba(255, 250, 242, 0.04);
  border-color: rgba(226, 195, 151, 0.12);
}

.magic-page .magic-page-head,
.magic-page .magic-block {
  background: var(--surface);
  border-color: var(--line);
  box-shadow: var(--soft-shadow);
}

.magic-page .magic-page-head::before {
  background: linear-gradient(90deg, rgba(143, 211, 204, 0.48), rgba(215, 180, 109, 0.34), transparent 78%);
  opacity: .5;
}

.magic-page .magic-hero-icon,
.magic-page .magic-overview-icon,
.magic-page .magic-block .section-title::before {
  background: rgba(255, 243, 231, 0.055);
  border-color: rgba(255, 243, 231, 0.16);
  box-shadow: none;
}

.magic-page .magic-overview-card,
.magic-page .magic-slot-card,
.magic-page .spell-card,
.magic-page .magic-block .feature-card {
  background: var(--surface-2);
  border-color: var(--line);
  box-shadow: none;
}

.magic-page .magic-block .empty-card,
.magic-page .magic-block .empty-inline {
  background: rgba(255, 243, 231, 0.04);
  border-color: var(--line);
}

.magic-page .magic-block::before {
  background: var(--magic-section-color);
  opacity: .42;
  width: 2px;
}

.magic-page .magic-block .section-title span,
.magic-page .magic-overview-card small,
.magic-page .magic-overview-card em {
  color: var(--muted);
}

.magic-page .magic-block .section-title strong,
.magic-page .magic-slot-count {
  color: var(--muted);
}

.magic-page .magic-overview-card strong,
.magic-page .magic-slot-card .meter-copy strong {
  color: var(--ink);
}

.magic-page .magic-slot-orb {
  background: rgba(255, 243, 231, 0.055);
  border-color: rgba(255, 243, 231, 0.16);
  color: color-mix(in srgb, var(--magic-teal) 72%, #fffaf2);
}

.magic-page .spell-card.expanded {
  border-color: color-mix(in srgb, var(--spell-color) 34%, var(--line));
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--spell-color) 52%, transparent);
}

.magic-page .spell-card:hover {
  background: var(--surface-2);
  border-color: color-mix(in srgb, var(--spell-color) 26%, var(--line));
}

.magic-page .spell-card .spell-detail {
  background: rgba(255, 243, 231, 0.035);
  border-color: var(--line);
}

@media (max-width: 640px) {
  .magic-page .magic-block {
    gap: 8px;
    padding: 10px;
  }

  .magic-page .magic-summary-block {
    display: grid;
  }

  .magic-page .magic-summary-block .magic-overview {
    gap: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .magic-page .magic-overview-card {
    gap: 6px;
    grid-template-columns: 24px minmax(0, 1fr);
    min-height: 44px;
    padding: 6px;
  }

  .magic-page .magic-overview-icon {
    border-radius: 6px;
    height: 24px;
    width: 24px;
  }

  .magic-page .magic-overview-icon svg {
    height: 14px;
    width: 14px;
  }

  .magic-page .magic-overview-card small {
    font-size: 9px;
  }

  .magic-page .magic-overview-card strong {
    font-size: 14px;
  }

  .magic-page .magic-overview-card em {
    display: none;
  }

  .magic-page .magic-block .section-title {
    align-items: baseline;
    display: flex;
    gap: 8px;
    justify-content: space-between;
  }

  .magic-page .magic-block .section-title span,
  .magic-page .magic-block .section-title strong {
    line-height: 1.1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .magic-page .magic-block .section-title span {
    flex: 1 1 auto;
    font-size: 11px;
  }

  .magic-page .magic-block .section-title strong {
    flex: 0 1 auto;
    font-size: 12px;
    text-align: right;
  }

  .magic-block-slots .spell-slots,
  .magic-page .spell-list {
    gap: 6px;
  }

  .magic-slot-card {
    gap: 8px;
    grid-template-areas: "level mid spend";
    grid-template-columns: minmax(78px, 1fr) max-content minmax(78px, 1fr);
    grid-template-rows: auto;
    min-height: 0;
    padding: 8px;
  }

  .magic-slot-orb {
    display: none;
  }

  .magic-slot-card .meter-copy {
    display: block;
    grid-area: level;
    justify-self: start;
    min-width: 0;
  }

  .magic-slot-card .meter-copy strong {
    font-size: 13px;
    line-height: 1.05;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .magic-slot-mid {
    align-self: center;
    gap: 4px;
    grid-area: mid;
    justify-items: center;
    justify-self: center;
  }

  .magic-slot-count {
    font-size: 11px;
    line-height: 1.1;
    white-space: nowrap;
  }

  .magic-slot-count em {
    display: none;
  }

  .magic-slot-card .pip-meter {
    align-self: center;
    gap: 4px;
    justify-content: center;
    padding-top: 0;
  }

  .magic-slot-card .pip-meter .pip,
  .magic-slot-card .pip-meter i {
    height: 9px;
    width: 9px;
  }

  .magic-slot-spend {
    align-self: center;
    grid-area: spend;
    justify-self: end;
    min-height: 30px;
    padding: 0 12px;
  }

  .spell-level-group {
    gap: 6px;
  }

  .spell-level-group + .spell-level-group {
    margin-top: 6px;
  }

  .spell-level-header {
    padding: 0;
  }

  .spell-toggle {
    align-items: center;
    gap: 8px;
    grid-template-columns: 32px minmax(0, 1fr) 32px;
    min-height: 0;
    padding: 8px;
  }

  .spell-toggle .spell-card-icon {
    border-radius: 7px;
    height: 32px;
    width: 32px;
  }

  .spell-card-icon::before {
    height: 20px;
    width: 20px;
  }

  .spell-card-icon::after {
    height: 23px;
    width: 23px;
  }

  .spell-toggle .spell-card-icon b {
    font-size: 13px;
  }

  .spell-toggle .spell-toggle-main {
    gap: 4px;
  }

  .spell-toggle .spell-toggle-head {
    align-items: center;
    flex-direction: row;
    gap: 6px;
  }

  .spell-toggle-head strong {
    font-size: 14px;
    line-height: 1.1;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .spell-toggle-head small {
    font-size: 9px;
    padding: 3px 6px;
  }

  .spell-toggle .spell-chip-row {
    flex-wrap: nowrap;
    gap: 4px;
    overflow: hidden;
  }

  .spell-toggle .spell-chip-row em {
    font-size: 10px;
    overflow: hidden;
    padding: 3px 6px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .spell-toggle .spell-detail-pill {
    border-radius: 7px;
    grid-column: auto;
    height: 32px;
    justify-self: end;
    min-width: 0;
    padding: 0;
    width: 32px;
  }

  .spell-toggle .spell-detail-pill span {
    display: none;
  }

  .spell-detail-pill svg {
    height: 16px;
    width: 16px;
  }

  .spell-card .spell-detail {
    gap: 8px;
    padding: 0 8px 8px;
  }
}

.section-actions {
  display: flex;
  justify-content: flex-end;
}

.prepared-actions {
  justify-content: center;
  padding-top: 4px;
}

.prepared-actions .btn {
  min-width: min(260px, 100%);
}

.prepared-panel {
  max-width: min(920px, 100vw);
  width: 920px;
}

.prepared-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.prepared-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 22px;
}

.prepared-modal-summary {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 12px 14px;
}

.prepared-modal-summary strong {
  font-size: 13px;
  font-weight: 950;
  text-transform: uppercase;
}

.prepared-modal-summary span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  text-align: right;
}

.prepared-modal-list {
  display: grid;
  gap: 8px;
}

.prepared-option {
  align-items: center;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 11px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 58px;
  padding: 10px 12px;
}

.prepared-option.selected {
  background: rgba(155, 145, 238, 0.15);
  border-color: rgba(155, 145, 238, 0.52);
}

.prepared-option.expanded {
  align-items: start;
}

.prepared-option.disabled {
  cursor: not-allowed;
  opacity: .5;
}

.prepared-option input {
  accent-color: var(--arcane);
  height: 16px;
  width: 16px;
}

.prepared-option span {
  display: grid;
  gap: 2px;
}

.prepared-option strong {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 14px;
  font-weight: 950;
  gap: 8px;
  overflow-wrap: anywhere;
}

.prepared-option em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

.prepared-option .spell-detail {
  padding: 8px 0 0;
}

.wild-shape-panel {
  width: 860px;
}

.wild-shape-body {
  padding-bottom: 20px;
}

.wild-shape-modal-list {
  display: grid;
  gap: 10px;
}

.wild-shape-option {
  background:
    linear-gradient(135deg, rgba(96, 149, 118, 0.16), rgba(186, 121, 82, 0.08)),
    var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 0;
  overflow: hidden;
}

.wild-shape-option.active {
  border-color: rgba(113, 176, 132, 0.62);
  box-shadow: inset 0 0 0 1px rgba(113, 176, 132, 0.18);
}

.wild-shape-option-main {
  align-items: center;
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 10px 12px;
}

.wild-shape-select {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.wild-shape-select:focus-visible,
.wild-shape-details-btn:focus-visible {
  outline: 2px solid rgba(113, 176, 132, 0.7);
  outline-offset: 3px;
}

.wild-shape-select strong {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 950;
  gap: 8px;
  overflow-wrap: anywhere;
}

.wild-shape-select strong em {
  background: rgba(113, 176, 132, 0.16);
  border: 1px solid rgba(113, 176, 132, 0.42);
  border-radius: 999px;
  color: rgba(221, 255, 231, 0.9);
  font-size: 10px;
  font-style: normal;
  font-weight: 950;
  padding: 3px 7px;
  text-transform: uppercase;
}

.wild-shape-select span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 820;
  overflow-wrap: anywhere;
}

.wild-shape-detail {
  border-top: 1px solid rgba(255, 250, 242, 0.1);
  display: grid;
  gap: 12px;
  padding: 12px;
}

.wild-shape-detail-copy {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 720;
  line-height: 1.55;
}

.wild-shape-detail-facts {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin: 0;
}

.wild-shape-detail-facts div {
  background: rgba(255, 243, 231, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 0;
  padding: 8px;
}

.wild-shape-detail-facts dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.wild-shape-detail-facts dd {
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  margin: 3px 0 0;
  overflow-wrap: anywhere;
}

.spell-facts {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 11px;
}

.spell-facts span {
  background: rgba(255, 243, 231, 0.05);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-strong);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 2px;
  min-height: 46px;
  overflow-wrap: anywhere;
  padding: 8px;
}

.spell-facts small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.spell-description,
.spell-higher {
  color: var(--muted-strong);
  display: grid;
  gap: 8px;
  font-size: 13px;
  line-height: 1.48;
  overflow-wrap: anywhere;
}

.spell-text-heading {
  color: var(--arcane);
  font-size: 12px;
  font-weight: 950;
  letter-spacing: 0;
  margin: 4px 0 0;
  text-transform: uppercase;
}

.spell-text-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 18px;
}

.spell-text-list li::marker {
  color: var(--arcane);
}

.spell-inline-facts {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.spell-inline-facts span {
  background: rgba(155, 145, 238, 0.08);
  border: 1px solid rgba(155, 145, 238, 0.22);
  border-radius: 8px;
  color: var(--muted-strong);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 2px;
  min-height: 42px;
  overflow-wrap: anywhere;
  padding: 7px 8px;
}

.spell-inline-facts small {
  color: var(--arcane);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.spell-table-wrap {
  border: 1px solid rgba(155, 145, 238, 0.24);
  border-radius: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.spell-markdown-table {
  background: rgba(13, 11, 15, 0.38);
  border-collapse: collapse;
  font-size: 12px;
  line-height: 1.35;
  min-width: min(520px, 100%);
  width: 100%;
}

.spell-markdown-table th,
.spell-markdown-table td {
  border-bottom: 1px solid rgba(255, 243, 231, 0.09);
  padding: 8px 9px;
  text-align: left;
  vertical-align: top;
}

.spell-markdown-table th {
  background: rgba(155, 145, 238, 0.16);
  color: var(--ink);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.spell-markdown-table tr:nth-child(even) td {
  background: rgba(255, 243, 231, 0.025);
}

.spell-markdown-table tr:last-child td {
  border-bottom: 0;
}

.spell-table-empty {
  color: var(--muted);
  font-weight: 950;
}

.spell-higher {
  border-top: 1px solid var(--line);
  padding-top: 10px;
}

.spell-higher strong {
  color: var(--arcane);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.meter-copy,
.resource-copy {
  display: grid;
  gap: 2px;
}

.meter-copy strong,
.resource-copy strong {
  font-weight: 950;
  overflow-wrap: anywhere;
}

.meter-copy span,
.resource-copy span {
  color: var(--muted);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.resource-copy small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.resource-status {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
  justify-self: end;
}

.pip-meter {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pip-meter .pip,
.pip-meter i {
  background: linear-gradient(180deg, var(--gold), #9e6b34);
  border: 1px solid rgba(255, 243, 231, 0.22);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(216, 157, 74, 0.18);
  height: 13px;
  width: 13px;
}

.pip-meter.spell .pip,
.pip-meter.spell i {
  background: linear-gradient(180deg, var(--arcane), #4f4a8f);
  box-shadow: 0 0 12px rgba(155, 145, 238, 0.2);
}

.pip-meter .pip.spent,
.pip-meter i.spent {
  background: var(--surface-3);
  border-color: var(--line);
  box-shadow: none;
  opacity: .58;
}

.pip-meter span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.pip-meter.empty i {
  opacity: .32;
}

.mini-meter {
  background: var(--surface-3);
  border: 1px solid var(--line);
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.mini-meter div {
  background: linear-gradient(90deg, var(--accent), var(--gold));
  height: 100%;
  min-width: 3px;
}

.detail-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.summary-cell strong {
  font-size: 16px;
  white-space: normal;
}

.summary-cell.wide {
  grid-column: 1 / -1;
}

@media (min-width: 921px) {
  .profile-identity-block {
    gap: 14px;
  }

  .profile-identity-block #profileSummary {
    gap: 8px;
    grid-template-columns: repeat(12, minmax(0, 1fr));
  }

  .profile-identity-block #profileSummary .summary-cell {
    align-content: center;
    background:
      linear-gradient(135deg, rgba(255, 250, 242, 0.035), transparent 64%),
      var(--surface-2);
    grid-column: span 3;
    min-height: 64px;
    padding: 10px 11px;
  }

  .profile-identity-block #profileSummary .summary-cell[data-summary-field="classes"] {
    grid-column: span 9;
  }

  .profile-identity-block #profileSummary .summary-cell[data-summary-field="visibility"] {
    grid-column: span 3;
  }

  .profile-identity-block #profileSummary .summary-cell strong {
    font-size: 15px;
    line-height: 1.24;
  }

  .profile-identity-block #profileText {
    max-width: 96ch;
  }
}

@media (min-width: 1221px) {
  .profile-identity-block {
    gap: 14px 16px;
    grid-template-areas:
      "title title"
      "summary summary"
      "story avatar";
    grid-template-columns: minmax(0, 1fr) minmax(250px, 330px);
  }

  .profile-identity-block .section-title {
    grid-area: title;
  }

  .profile-identity-block #profileSummary {
    grid-area: summary;
  }

  .profile-identity-block #profileText {
    align-self: start;
    grid-area: story;
    padding-right: 4px;
  }

  .profile-identity-block #avatarEditor {
    align-self: start;
    border-left: 1px solid rgba(255, 250, 242, 0.08);
    border-top: 0;
    gap: 10px;
    grid-area: avatar;
    grid-template-columns: 72px minmax(0, 1fr);
    margin-top: 0;
    padding: 2px 0 0 16px;
  }

  .profile-identity-block .avatar-editor-preview {
    height: 72px;
    width: 72px;
  }

  .profile-identity-block .avatar-shape-toggle,
  .profile-identity-block .avatar-link-panel {
    max-width: none;
  }
}

.profile-lists {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.empty-state {
  align-content: center;
  background:
    linear-gradient(135deg, rgba(124, 217, 208, 0.1), rgba(240, 198, 111, 0.08) 48%, rgba(230, 144, 98, 0.08)),
    linear-gradient(180deg, rgba(255, 250, 242, 0.055), rgba(255, 250, 242, 0.018)),
    var(--surface);
  border: 1px solid rgba(240, 198, 111, 0.24);
  border-radius: 8px;
  box-shadow:
    inset 0 0 0 1px rgba(255, 250, 242, 0.035),
    0 24px 54px rgba(0, 0, 0, 0.34);
  display: grid;
  gap: 10px;
  justify-items: center;
  margin: clamp(28px, 9vh, 92px) auto 0;
  max-width: 760px;
  overflow: hidden;
  padding: clamp(20px, 4vw, 34px);
  position: relative;
  text-align: center;
}

.empty-state::before {
  background: linear-gradient(90deg, #7cd9d0, #f0c66f, #e69062);
  content: "";
  height: 2px;
  inset: 0 0 auto;
  opacity: .72;
  position: absolute;
}

.empty-state::after {
  border: 1px solid rgba(255, 250, 242, 0.07);
  border-radius: 6px;
  content: "";
  inset: 8px;
  pointer-events: none;
  position: absolute;
}

.empty-visual,
.empty-kicker,
.empty-state h1,
.empty-state p,
.empty-actions {
  position: relative;
  z-index: 1;
}

.empty-visual {
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.08), rgba(124, 217, 208, 0.08)),
    rgba(7, 9, 14, 0.36);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.035);
  display: grid;
  margin-bottom: 4px;
  max-width: min(420px, 100%);
  overflow: hidden;
  width: 100%;
}

.empty-visual img {
  display: block;
  height: auto;
  width: 100%;
}

.empty-kicker {
  color: #7cd9d0;
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.empty-state h1 {
  color: #fffaf2;
  font-size: 38px;
  font-weight: 950;
  line-height: .98;
  margin: 0;
}

.empty-state p {
  color: var(--muted-strong);
  font-size: 15px;
  line-height: 1.55;
  margin: 0;
  max-width: 560px;
}

.empty-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}

.empty-actions .btn {
  margin-top: 0;
  min-width: min(240px, 100%);
}

@media (max-width: 640px) {
  .empty-state {
    margin-top: 18px;
    padding: 18px;
  }

  .empty-state h1 {
    font-size: 28px;
  }

  .empty-actions {
    width: 100%;
  }

  .empty-actions .btn {
    width: 100%;
  }
}

.modal-open {
  overflow: hidden;
}

.icon-btn {
  align-items: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.08);
  border: 1px solid rgba(255, 250, 242, 0.16);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: inline-grid;
  font-size: 0;
  font-weight: 950;
  height: 38px;
  justify-content: center;
  line-height: 0;
  overflow: hidden;
  padding: 0;
  place-items: center;
  position: relative;
  text-align: center;
  width: 38px;
}

.icon-btn::before,
.icon-btn::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 2px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  width: 15px;
}

.icon-btn::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

button > svg,
[role="button"] > svg,
.btn > svg {
  display: block;
  flex: 0 0 auto;
  margin: 0;
}

.hero-settings-button > svg,
.support-fab > svg,
.battle-map-fab > svg,
.portal-map-icon-btn > svg {
  margin: auto;
}

.support-widget {
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: grid;
  gap: 10px;
  justify-items: end;
  position: fixed;
  right: calc(18px + env(safe-area-inset-right));
  z-index: 900;
}

.battle-map-shortcut {
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: none;
  left: calc(var(--portal-sidebar-width) + 18px + env(safe-area-inset-left));
  position: fixed;
  z-index: 900;
}

.battle-map-shortcut:not(.hidden) {
  display: grid;
}

.portal-shell.sidebar-collapsed ~ .battle-map-shortcut {
  left: calc(18px + env(safe-area-inset-left));
}

body.portal-map-open .support-widget,
body.portal-map-open .battle-map-shortcut {
  z-index: 2500;
}

body.portal-map-open .support-dialog {
  z-index: 2600;
}

.support-widget.creation-active {
  bottom: calc(86px + env(safe-area-inset-bottom));
  z-index: 1250;
}

.support-fab,
.battle-map-fab {
  align-items: center;
  appearance: none;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.94), rgba(216, 157, 74, 0.9)),
    var(--accent);
  border: 1px solid rgba(255, 250, 242, 0.28);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.38);
  color: #fffaf2;
  cursor: pointer;
  display: inline-flex;
  font-size: 25px;
  font-weight: 950;
  height: 52px;
  justify-content: center;
  line-height: 1;
  width: 52px;
}

.battle-map-fab {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 250, 242, 0.28), transparent 30%),
    linear-gradient(135deg, rgba(213, 39, 53, 0.98), rgba(244, 151, 55, 0.96) 58%, rgba(86, 40, 31, 0.98)),
    #a92230;
  border-color: rgba(255, 228, 159, 0.62);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.42),
    0 0 0 1px rgba(255, 250, 242, 0.08) inset,
    0 0 24px rgba(213, 39, 53, 0.38);
  position: relative;
}

.battle-map-fab::before,
.battle-map-fab::after {
  content: "";
  pointer-events: none;
  position: absolute;
}

.battle-map-fab::before {
  animation: battleMapPulse 1.65s ease-out infinite;
  border: 1px solid rgba(255, 80, 80, 0.56);
  border-radius: inherit;
  inset: -6px;
}

.battle-map-fab::after {
  background: #fff1a8;
  border: 2px solid rgba(68, 20, 24, 0.72);
  border-radius: 999px;
  box-shadow: 0 0 12px rgba(255, 221, 104, 0.86);
  height: 10px;
  right: 2px;
  top: 2px;
  width: 10px;
}

.support-fab:hover,
.support-fab[aria-expanded="true"],
.battle-map-fab:hover {
  border-color: rgba(255, 250, 242, 0.58);
  transform: translateY(-1px);
}

.support-fab:focus-visible,
.battle-map-fab:focus-visible,
.support-menu-item:focus-visible {
  outline: 2px solid rgba(216, 157, 74, 0.78);
  outline-offset: 3px;
}

.battle-map-fab:disabled {
  cursor: progress;
  opacity: .7;
  transform: none;
}

.battle-map-fab:disabled::before {
  animation: none;
}

.battle-map-exit-fab {
  background:
    radial-gradient(circle at 32% 26%, rgba(255, 250, 242, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(29, 36, 44, 0.98), rgba(104, 54, 57, 0.96) 58%, rgba(26, 17, 20, 0.98)),
    #1d242c;
  border-color: rgba(255, 250, 242, 0.5);
  box-shadow:
    0 16px 36px rgba(0, 0, 0, 0.46),
    0 0 0 1px rgba(255, 250, 242, 0.1) inset,
    0 0 24px rgba(255, 94, 110, 0.24);
}

.battle-map-exit-fab::before {
  animation: none;
  border-color: rgba(255, 250, 242, 0.3);
  inset: -5px;
  opacity: 0.55;
}

.battle-map-exit-fab::after {
  background:
    linear-gradient(45deg, transparent calc(50% - 1px), #fffaf2 calc(50% - 1px), #fffaf2 calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(-45deg, transparent calc(50% - 1px), #fffaf2 calc(50% - 1px), #fffaf2 calc(50% + 1px), transparent calc(50% + 1px)),
    #ff6574;
  border-color: rgba(45, 14, 18, 0.82);
  box-shadow: 0 0 12px rgba(255, 101, 116, 0.66);
  content: "";
  display: block;
  height: 14px;
  right: -1px;
  top: -1px;
  width: 14px;
}

.battle-map-icon {
  display: block;
  height: 31px;
  width: 31px;
  z-index: 1;
}

.battle-map-exit-icon {
  display: block;
  height: 30px;
  width: 30px;
  z-index: 1;
}

.battle-map-icon-map {
  fill: rgba(22, 14, 14, 0.38);
  stroke: rgba(255, 250, 242, 0.86);
  stroke-linejoin: round;
  stroke-width: 1.25;
}

.battle-map-icon-grid {
  fill: none;
  stroke: rgba(255, 232, 173, 0.62);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 0.82;
}

.battle-map-icon-route {
  fill: none;
  stroke: #ffd76f;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.25;
}

.battle-map-icon-hotspot {
  fill: #fff1a8;
  stroke: rgba(77, 24, 27, 0.74);
  stroke-width: 0.55;
}

.battle-map-icon-sword {
  fill: none;
  stroke: #fffaf2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.55;
}

.battle-map-exit-sheet {
  fill: rgba(255, 250, 242, 0.16);
  stroke: rgba(255, 250, 242, 0.86);
  stroke-linejoin: round;
  stroke-width: 1.35;
}

.battle-map-exit-fold,
.battle-map-exit-line {
  fill: none;
  stroke: rgba(255, 232, 173, 0.74);
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.12;
}

.battle-map-exit-arrow {
  fill: none;
  stroke: #fffaf2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2.25;
}

@keyframes battleMapPulse {
  0% {
    opacity: 0.74;
    transform: scale(0.9);
  }

  100% {
    opacity: 0;
    transform: scale(1.22);
  }
}

.support-menu {
  background: rgba(21, 17, 18, 0.96);
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 6px;
  min-width: 168px;
  padding: 8px;
}

.support-menu-item {
  appearance: none;
  background: rgba(255, 250, 242, 0.075);
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 7px;
  color: var(--ink);
  cursor: pointer;
  font-size: 13px;
  font-weight: 900;
  min-height: 38px;
  padding: 8px 10px;
  text-align: left;
}

.support-menu-item:hover {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(216, 157, 74, 0.48);
}

.support-menu-item.repair {
  background: rgba(85, 184, 120, 0.12);
  border-color: rgba(85, 184, 120, 0.28);
}

.support-menu-item.repair:hover {
  background: rgba(85, 184, 120, 0.22);
  border-color: rgba(85, 184, 120, 0.52);
}

.support-menu-item.danger:hover {
  background: rgba(216, 88, 82, 0.2);
  border-color: rgba(216, 88, 82, 0.52);
}

.support-dialog {
  inset: 0;
  overflow: hidden;
  padding: 20px;
  position: fixed;
  z-index: 1400;
}

.support-panel {
  background: #171116;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin: min(8vh, 72px) auto 0;
  max-height: calc(100dvh - 40px);
  max-width: 540px;
  overflow: hidden;
  position: relative;
  width: min(100%, 540px);
  z-index: 1;
}

.support-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.support-body {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 20px;
}

.support-body .textarea {
  min-height: 132px;
}

.support-error {
  background: rgba(216, 88, 82, 0.18);
  border: 1px solid rgba(216, 88, 82, 0.58);
  border-radius: 8px;
  color: #ffd2cc;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  padding: 10px 12px;
}

.support-context {
  background: rgba(255, 250, 242, 0.055);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-strong);
  display: grid;
  gap: 4px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.35;
  padding: 10px;
}

.support-context strong {
  color: var(--gold);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.support-context span {
  overflow-wrap: anywhere;
}

.creation-dialog {
  inset: 0;
  overflow: hidden;
  position: fixed;
  z-index: 1200;
}

.creation-idle-dialog {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 1300;
}

.creation-idle-backdrop {
  background: rgba(9, 7, 10, 0.82);
  inset: 0;
  position: absolute;
}

.creation-idle-panel {
  background:
    linear-gradient(180deg, rgba(32, 24, 31, 0.98), rgba(23, 17, 22, 0.98)),
    #171116;
  border: 1px solid rgba(216, 157, 74, 0.42);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  max-width: min(420px, 100%);
  padding: 22px;
  position: relative;
  width: 420px;
}

.creation-idle-panel h2 {
  font-size: 28px;
  font-weight: 950;
  line-height: 1.05;
}

.creation-idle-panel p {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.creation-idle-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 4px;
}

.creation-backdrop {
  background: rgba(9, 7, 10, 0.78);
  inset: 0;
  position: absolute;
}

.creation-panel {
  background: #171116;
  border-left: 1px solid var(--line-dark);
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.48);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  height: 100%;
  margin-left: auto;
  max-width: min(820px, 100vw);
  position: relative;
  width: 820px;
}

.portal-action-panel {
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  box-shadow: var(--shadow);
  height: auto;
  margin: min(8vh, 56px) auto;
  max-height: calc(100dvh - 28px);
  max-width: min(760px, calc(100vw - 28px));
  overflow: hidden;
  width: min(760px, calc(100vw - 28px));
}

.portal-action-body {
  min-height: 0;
  overflow: auto;
  padding: 18px;
}

.feedback-dialog {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 1280;
}

.feedback-backdrop {
  background: rgba(9, 7, 10, 0.78);
  inset: 0;
  position: absolute;
}

.feedback-panel {
  background:
    linear-gradient(180deg, rgba(38, 30, 37, 0.99), rgba(15, 11, 15, 0.99)),
    #100b0f;
  border: 1px solid rgba(216, 157, 74, 0.5);
  border-radius: 8px;
  box-shadow: var(--shadow);
  color: #fffaf2;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: min(700px, calc(100dvh - 36px));
  max-width: min(680px, calc(100vw - 28px));
  overflow: hidden;
  position: relative;
  width: min(680px, calc(100vw - 28px));
}

.feedback-head {
  align-items: center;
  border-bottom: 1px solid rgba(255, 250, 242, 0.14);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 18px;
}

.feedback-head .kicker {
  color: #f0c66f;
}

.feedback-head h2 {
  color: #fffaf2;
  font-size: 28px;
  font-weight: 950;
  line-height: 1.05;
  margin: 0;
  overflow-wrap: anywhere;
}

.feedback-body {
  display: grid;
  gap: 16px;
  overflow-y: auto;
  padding: 18px;
}

.feedback-face-row {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
}

.feedback-face {
  appearance: none;
  background: rgba(255, 250, 242, 0.09);
  border: 1px solid rgba(255, 250, 242, 0.18);
  border-radius: 8px;
  color: #fffaf2;
  cursor: pointer;
  display: grid;
  font-size: 34px;
  height: 76px;
  line-height: 1;
  min-width: 0;
  place-items: center;
  transition: border-color .16s ease, background .16s ease, transform .16s ease;
  width: 100%;
}

.feedback-face:hover,
.feedback-face:focus-visible {
  background: rgba(255, 250, 242, 0.14);
  border-color: rgba(255, 250, 242, 0.38);
  outline: 0;
  transform: translateY(-1px);
}

.feedback-face.selected {
  background: color-mix(in srgb, var(--feedback-color, var(--gold)) 28%, rgba(255, 250, 242, 0.09));
  border-color: color-mix(in srgb, var(--feedback-color, var(--gold)) 82%, rgba(255, 250, 242, 0.22));
  box-shadow: inset 0 0 0 1px rgba(255, 250, 242, 0.05), 0 14px 28px rgba(0, 0, 0, 0.22);
}

.feedback-face.very-unhappy {
  --feedback-color: #ef6f6c;
}

.feedback-face.unhappy {
  --feedback-color: #e69a62;
}

.feedback-face.neutral {
  --feedback-color: #d8b96f;
}

.feedback-face.happy {
  --feedback-color: #7cd9d0;
}

.feedback-face.very-happy {
  --feedback-color: #8bd17c;
}

.feedback-details {
  display: grid;
  gap: 10px;
}

.feedback-details .field span {
  color: #fffaf2;
  font-weight: 950;
}

.feedback-textarea {
  background: rgba(5, 6, 9, 0.82);
  border-color: rgba(255, 250, 242, 0.2);
  color: #fffaf2;
  font-size: 15px;
  line-height: 1.42;
  min-height: 116px;
  resize: vertical;
}

.feedback-textarea::placeholder {
  color: rgba(255, 250, 242, 0.62);
}

.feedback-actions {
  border-top: 1px solid rgba(255, 250, 242, 0.14);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px 18px;
}

.feedback-actions .btn {
  min-width: 128px;
}

body.feedback-open {
  overflow: hidden;
}

@media (max-width: 620px) {
  .feedback-dialog {
    padding: 10px;
  }

  .feedback-panel {
    max-height: calc(100dvh - 20px);
    width: calc(100vw - 20px);
  }

  .feedback-head,
  .feedback-body {
    padding: 14px;
  }

  .feedback-head h2 {
    font-size: 23px;
  }

  .feedback-face-row {
    gap: 8px;
    grid-template-columns: repeat(auto-fit, minmax(68px, 1fr));
  }

  .feedback-face {
    font-size: 30px;
    height: 62px;
  }

  .feedback-actions {
    padding: 12px 14px;
  }
}

@media (max-width: 390px) {
  .feedback-face-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .feedback-actions .btn {
    flex: 1 1 100%;
  }
}

.hero-settings-dialog {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 1210;
}

.hero-settings-backdrop {
  background:
    radial-gradient(circle at 50% 16%, rgba(var(--accent-rgb), 0.16), transparent 42%),
    rgba(9, 7, 10, 0.78);
  inset: 0;
  position: absolute;
}

.hero-settings-panel {
  background:
    linear-gradient(180deg, rgba(32, 24, 31, 0.98), rgba(18, 13, 17, 0.98)),
    #171116;
  border: 1px solid rgba(216, 157, 74, 0.38);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  max-height: min(760px, calc(100dvh - 36px));
  max-width: min(720px, calc(100vw - 28px));
  min-height: min(560px, calc(100dvh - 36px));
  overflow: hidden;
  position: relative;
  width: min(720px, calc(100vw - 28px));
}

.hero-settings-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  min-height: 0;
}

.hero-settings-body {
  display: grid;
  gap: 14px;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

.settings-modal-section {
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.09), rgba(255, 250, 242, 0.025)),
    var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  padding: 14px;
}

.settings-modal-section.read-only-public p {
  color: var(--muted-strong);
  font-size: 14px;
  font-weight: 750;
  line-height: 1.45;
}

.settings-tab-rail {
  background: rgba(255, 250, 242, 0.05);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding: 6px;
}

.settings-tab {
  appearance: none;
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted-strong);
  cursor: pointer;
  font-size: 13px;
  font-weight: 950;
  min-height: 38px;
  padding: 8px 10px;
}

.settings-tab.active,
.settings-tab:hover,
.settings-tab:focus-visible {
  background: rgba(var(--accent-rgb), 0.16);
  border-color: rgba(216, 157, 74, 0.42);
  color: var(--ink);
  outline: 0;
}

.settings-modal-title {
  display: grid;
  gap: 4px;
}

.settings-modal-title span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 950;
  letter-spacing: 0;
  text-transform: uppercase;
}

.settings-modal-title strong {
  color: var(--ink);
  font-size: 18px;
  font-weight: 950;
  line-height: 1.08;
}

.privacy-option-list {
  display: grid;
  gap: 8px;
}

.privacy-option,
.public-panel-option {
  align-items: start;
  background: rgba(255, 250, 242, 0.06);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  padding: 11px;
}

.privacy-option.selected,
.privacy-option:focus-within,
.public-panel-option.selected,
.public-panel-option:focus-within {
  background: rgba(var(--accent-rgb), 0.13);
  border-color: rgba(216, 157, 74, 0.52);
}

.privacy-option input,
.public-panel-option input {
  margin-top: 3px;
}

.privacy-option span,
.public-panel-option span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.privacy-option strong,
.public-panel-option strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.privacy-option em,
.public-panel-option em {
  color: var(--muted-strong);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
  line-height: 1.35;
}

.public-panel-list {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.public-panel-categories {
  display: grid;
  gap: 10px;
}

.public-panel-category {
  background: rgba(255, 250, 242, 0.045);
  border: 1px solid rgba(255, 250, 242, 0.11);
  border-radius: 8px;
  overflow: hidden;
}

.public-panel-category.selected {
  border-color: rgba(216, 157, 74, 0.42);
}

.public-panel-category summary {
  align-items: center;
  cursor: pointer;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  list-style: none;
  padding: 12px;
}

.public-panel-category summary::-webkit-details-marker {
  display: none;
}

.public-panel-category summary::before {
  align-self: center;
  border: solid var(--gold);
  border-width: 0 2px 2px 0;
  content: "";
  height: 7px;
  justify-self: end;
  order: 3;
  transform: rotate(45deg);
  transition: transform 160ms ease;
  width: 7px;
}

.public-panel-category[open] summary::before {
  transform: rotate(-135deg);
}

.public-panel-category summary span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.public-panel-category summary strong {
  color: var(--ink);
  font-size: 15px;
  font-weight: 950;
}

.public-panel-category summary em {
  color: var(--muted-strong);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

.public-panel-category summary b {
  color: var(--gold);
  font-size: 12px;
  font-weight: 950;
  white-space: nowrap;
}

.public-panel-category .public-panel-list {
  border-top: 1px solid rgba(255, 250, 242, 0.08);
  padding: 10px;
}

.public-panel-option:has(input:disabled) {
  opacity: 0.58;
}

.management-section {
  border-color: rgba(216, 88, 82, 0.38);
}

.management-warning {
  background: rgba(216, 88, 82, 0.10);
  border: 1px solid rgba(216, 88, 82, 0.36);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  padding: 12px;
}

.management-warning strong {
  color: #ffb7af;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
}

.management-warning p {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 750;
  line-height: 1.42;
}

.management-warning.severe {
  background: rgba(216, 88, 82, 0.16);
  border-color: rgba(216, 88, 82, 0.58);
}

.management-warning.severe strong {
  color: #ff6f67;
}

.management-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.transfer-recipient-field {
  position: relative;
}

.transfer-recipient-field > label,
.transfer-recipient-field > small {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
  line-height: 1.25;
}

.transfer-recipient-field > small {
  color: #ffb7af;
  font-weight: 750;
}

.transfer-recipient-results {
  display: grid;
  gap: 7px;
  max-height: 250px;
  overflow-y: auto;
}

.transfer-recipient-empty {
  background: rgba(255, 250, 242, 0.055);
  border: 1px solid rgba(255, 250, 242, 0.11);
  border-radius: 8px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
  padding: 10px;
}

.transfer-recipient-empty.error {
  background: rgba(216, 88, 82, 0.12);
  border-color: rgba(216, 88, 82, 0.38);
  color: #ffb7af;
}

.transfer-recipient-option {
  align-items: center;
  appearance: none;
  background: rgba(255, 250, 242, 0.06);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr);
  min-height: 54px;
  padding: 8px;
  text-align: left;
}

.transfer-recipient-option:hover,
.transfer-recipient-option:focus-visible {
  background: rgba(var(--accent-rgb), 0.13);
  border-color: rgba(216, 157, 74, 0.52);
  outline: 0;
}

.transfer-recipient-option img,
.transfer-recipient-avatar {
  align-items: center;
  aspect-ratio: 1;
  background: rgba(var(--accent-rgb), 0.18);
  border: 1px solid rgba(216, 157, 74, 0.36);
  border-radius: 50%;
  color: var(--ink);
  display: flex;
  font-size: 12px;
  font-weight: 950;
  justify-content: center;
  object-fit: cover;
  width: 38px;
}

.transfer-recipient-option span:last-child {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.transfer-recipient-option strong,
.transfer-recipient-option em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.transfer-recipient-option strong {
  font-size: 14px;
  font-weight: 950;
}

.transfer-recipient-option em {
  color: var(--muted-strong);
  font-size: 12px;
  font-style: normal;
  font-weight: 750;
}

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

.settings-wide {
  grid-column: 1 / -1;
}

.settings-preference-row {
  align-items: center;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) minmax(180px, auto);
}

.settings-preference-row > span {
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 900;
}

.settings-segmented-control {
  background: rgba(255, 250, 242, 0.055);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 5px;
}

.settings-segment {
  border-radius: 6px;
  color: var(--muted-strong);
  cursor: pointer;
  display: grid;
  font-size: 13px;
  font-weight: 950;
  min-height: 34px;
  place-items: center;
  position: relative;
}

.settings-segment input {
  opacity: 0;
  pointer-events: none;
  position: absolute;
}

.settings-segment.selected,
.settings-segment:focus-within,
.settings-segment:hover {
  background: rgba(var(--accent-rgb), 0.16);
  color: var(--ink);
}

.dice-style-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
}

.dice-style-card {
  align-items: center;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.115), rgba(255, 250, 242, 0.045)),
    rgba(30, 23, 24, 0.86);
  border: 1px solid rgba(226, 195, 151, 0.3);
  border-radius: 8px;
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 250, 242, 0.09);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 6px 12px;
  grid-template-columns: 88px minmax(0, 1fr);
  min-height: 116px;
  padding: 10px;
  text-align: left;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, transform .16s ease;
}

.dice-style-card:hover,
.dice-style-card:focus-visible,
.dice-style-card.selected {
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.2), rgba(var(--accent-rgb), 0.075)),
    rgba(32, 23, 24, 0.92);
  border-color: rgba(216, 157, 74, 0.68);
  box-shadow:
    0 14px 26px rgba(0, 0, 0, 0.28),
    0 0 0 1px rgba(var(--accent-rgb), 0.22),
    inset 0 1px 0 rgba(255, 250, 242, 0.12);
  transform: translateY(-1px);
}

.dice-style-card strong {
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
  overflow-wrap: normal;
  word-break: normal;
}

.dice-style-tag {
  align-self: start;
  background: rgba(255, 250, 242, 0.045);
  border: 1px solid rgba(255, 250, 242, 0.13);
  border-radius: 999px;
  color: var(--muted);
  cursor: default;
  display: inline-block;
  font-size: 10px;
  font-weight: 850;
  justify-self: start;
  line-height: 1.1;
  max-width: 100%;
  overflow-wrap: break-word;
  padding: 4px 7px;
  pointer-events: none;
  text-transform: uppercase;
  word-break: normal;
}

.dice-style-action {
  align-self: start;
  background:
    linear-gradient(180deg, rgba(255, 218, 151, 0.24), rgba(216, 157, 74, 0.14));
  border: 1px solid rgba(216, 157, 74, 0.68);
  border-radius: 6px;
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 250, 242, 0.16);
  color: #ffe8b8;
  display: inline-block;
  font-size: 10px;
  font-weight: 950;
  justify-self: start;
  line-height: 1;
  padding: 7px 9px;
  text-transform: uppercase;
}

.dice-style-card.selected .dice-style-action {
  background: rgba(83, 190, 136, 0.16);
  border-color: rgba(83, 190, 136, 0.52);
  color: #9df0bc;
}

.token-border-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.token-border-card {
  align-items: center;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.1), rgba(255, 250, 242, 0.04)),
    rgba(29, 23, 26, 0.88);
  border: 1px solid rgba(226, 195, 151, 0.28);
  border-radius: 8px;
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 6px 12px;
  grid-template-columns: 104px minmax(0, 1fr);
  min-height: 126px;
  padding: 12px;
  text-align: left;
  transition: background .16s ease, border-color .16s ease, box-shadow .16s ease, opacity .16s ease, transform .16s ease;
}

.token-border-card:hover:not(:disabled),
.token-border-card:focus-visible,
.token-border-card.selected {
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.18), rgba(var(--accent-rgb), 0.065)),
    rgba(32, 23, 26, 0.94);
  border-color: rgba(216, 157, 74, 0.68);
  box-shadow:
    0 14px 26px rgba(0, 0, 0, 0.26),
    0 0 0 1px rgba(var(--accent-rgb), 0.2),
    inset 0 1px 0 rgba(255, 250, 242, 0.1);
  transform: translateY(-1px);
}

.token-border-card:disabled {
  cursor: default;
  opacity: .54;
}

.token-border-card strong {
  font-size: 12px;
  font-weight: 950;
  line-height: 1.2;
}

.token-border-tag,
.token-border-action {
  border-radius: 999px;
  display: inline-block;
  font-size: 10px;
  font-weight: 900;
  justify-self: start;
  line-height: 1;
  max-width: 100%;
  overflow-wrap: break-word;
  padding: 5px 7px;
  text-transform: uppercase;
}

.token-border-tag {
  background: rgba(255, 250, 242, 0.045);
  border: 1px solid rgba(255, 250, 242, 0.13);
  color: var(--muted);
}

.token-border-action {
  background: rgba(216, 157, 74, 0.14);
  border: 1px solid rgba(216, 157, 74, 0.56);
  color: #ffe8b8;
}

.token-border-card.selected .token-border-action {
  background: rgba(83, 190, 136, 0.16);
  border-color: rgba(83, 190, 136, 0.52);
  color: #9df0bc;
}

.token-border-card.locked .token-border-action {
  background: rgba(255, 250, 242, 0.055);
  border-color: rgba(255, 250, 242, 0.16);
  color: var(--muted);
}

.token-border-preview {
  --token-border-primary: #050505;
  --token-border-secondary: #1a1a1a;
  --token-border-accent: #000000;
  align-items: center;
  background:
    radial-gradient(circle at 35% 26%, color-mix(in srgb, var(--token-border-secondary), transparent 25%), transparent 16%),
    conic-gradient(from 18deg, var(--token-border-accent), var(--token-border-primary), var(--token-border-secondary), var(--token-border-primary), var(--token-border-accent));
  border: 7px solid color-mix(in srgb, var(--token-border-primary), #ffffff 12%);
  border-radius: 50%;
  box-shadow:
    0 14px 24px rgba(0,0,0,.34),
    0 0 18px color-mix(in srgb, var(--token-border-primary), transparent 46%),
    inset 0 0 0 4px color-mix(in srgb, var(--token-border-accent), transparent 18%),
    inset 0 0 0 9px rgba(0,0,0,.34);
  display: grid;
  grid-row: span 3;
  height: 92px;
  justify-items: center;
  overflow: visible;
  place-items: center;
  position: relative;
  width: 92px;
}

.token-border-preview::before,
.token-border-preview::after {
  content: "";
  position: absolute;
}

.token-border-preview::before {
  background:
    repeating-conic-gradient(from 4deg, rgba(0,0,0,.28) 0 4deg, transparent 4deg 12deg),
    radial-gradient(circle, transparent 0 50%, color-mix(in srgb, var(--token-border-secondary), transparent 54%) 51% 56%, transparent 57%);
  border-radius: inherit;
  inset: -3px;
  opacity: .72;
}

.token-border-preview::after {
  border: 2px solid var(--token-border-accent);
  border-radius: inherit;
  box-shadow:
    0 0 0 2px rgba(0,0,0,.34),
    inset 0 0 0 2px color-mix(in srgb, var(--token-border-secondary), transparent 38%);
  inset: 10px;
  opacity: .9;
}

.token-border-preview i {
  background:
    radial-gradient(circle at 40% 28%, rgba(255,255,255,.18), transparent 25%),
    linear-gradient(145deg, rgba(22, 18, 17, .98), rgba(8, 8, 10, .98));
  border: 2px solid rgba(0,0,0,.72);
  border-radius: 50%;
  box-shadow:
    inset 0 0 0 2px color-mix(in srgb, var(--token-border-primary), transparent 70%),
    0 0 0 1px color-mix(in srgb, var(--token-border-secondary), transparent 26%);
  display: block;
  height: 52px;
  position: relative;
  width: 52px;
  z-index: 3;
}

.token-border-preview img {
  height: calc(100% * var(--token-border-image-scale, 1.5));
  left: calc(50% + var(--token-border-image-offset-x, 0%));
  object-fit: contain;
  pointer-events: none;
  position: absolute;
  top: calc(50% + var(--token-border-image-offset-y, 0%));
  transform: translate(-50%, -50%);
  width: calc(100% * var(--token-border-image-scale, 1.5));
  z-index: 5;
}

.token-border-effect-image {
  background: transparent;
  border-color: transparent;
  box-shadow: none;
}

.token-border-effect-image::before,
.token-border-effect-image::after {
  content: none;
}

.token-border-effect-image i {
  background: rgba(0,0,0,.72);
  border-color: rgba(255,255,255,.12);
  box-shadow: inset 0 0 0 2px rgba(0,0,0,.72);
}

.dice-style-preview {
  --dice-body: #b63f4d;
  --dice-edge: #ffdeb0;
  --dice-accent: #d8843f;
  --dice-deep: #35101a;
  align-items: center;
  display: grid;
  grid-row: span 3;
  height: 88px;
  justify-items: center;
  place-items: center;
  position: relative;
  width: 86px;
}

.dice-style-preview::before,
.dice-style-preview::after {
  content: "";
  position: absolute;
}

.dice-style-preview::before {
  background:
    radial-gradient(circle at 34% 22%, rgba(255, 255, 255, .32), transparent 28%),
    linear-gradient(145deg, color-mix(in srgb, var(--dice-body), #ffffff 20%), rgba(255, 255, 255, .02) 45%, color-mix(in srgb, var(--dice-deep), #000000 12%)),
    var(--dice-texture, linear-gradient(145deg, var(--dice-body), var(--dice-deep)));
  background-blend-mode: screen, multiply, normal;
  background-position: center;
  background-size: 100% 100%, 100% 100%, cover;
  box-shadow:
    0 18px 26px rgba(0, 0, 0, .34),
    0 0 22px color-mix(in srgb, var(--dice-accent), transparent 48%),
    inset 0 0 0 2px color-mix(in srgb, var(--dice-edge), transparent 18%);
  clip-path: polygon(50% 0%, 68% 7%, 88% 19%, 100% 43%, 92% 70%, 70% 92%, 50% 100%, 30% 92%, 8% 70%, 0% 43%, 12% 19%, 32% 7%);
  inset: 4px 7px;
}

.dice-style-preview::after {
  background:
    radial-gradient(circle at 50% 48%, transparent 0 25%, color-mix(in srgb, var(--dice-edge), transparent 80%) 26% 27%, transparent 28%),
    linear-gradient(90deg, transparent 48%, color-mix(in srgb, var(--dice-edge), transparent 70%) 49% 51%, transparent 52%),
    linear-gradient(38deg, transparent 48%, color-mix(in srgb, var(--dice-edge), transparent 78%) 49% 51%, transparent 52%),
    linear-gradient(-38deg, transparent 48%, color-mix(in srgb, var(--dice-edge), transparent 78%) 49% 51%, transparent 52%);
  clip-path: polygon(50% 0%, 68% 7%, 88% 19%, 100% 43%, 92% 70%, 70% 92%, 50% 100%, 30% 92%, 8% 70%, 0% 43%, 12% 19%, 32% 7%);
  inset: 4px 7px;
  opacity: .4;
}

.dice-style-preview .facet {
  background: linear-gradient(135deg, color-mix(in srgb, var(--dice-edge), transparent 68%), transparent 72%);
  clip-path: polygon(50% 0, 100% 100%, 0 100%);
  height: 24px;
  opacity: .32;
  position: absolute;
  width: 26px;
  z-index: 1;
}

.dice-style-preview .facet-top {
  left: 25px;
  top: 9px;
}

.dice-style-preview .facet-left {
  left: 13px;
  top: 30px;
  transform: rotate(224deg);
}

.dice-style-preview .facet-right {
  right: 13px;
  top: 30px;
  transform: rotate(136deg);
}

.dice-style-preview .facet-bottom {
  bottom: 10px;
  left: 25px;
  transform: rotate(180deg);
}

.dice-style-preview b {
  color: var(--dice-edge);
  font-family: var(--font-display);
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
  position: relative;
  text-shadow: 0 2px 5px rgba(0, 0, 0, .78), 0 0 12px color-mix(in srgb, var(--dice-accent), transparent 42%);
  z-index: 2;
}

.dice-style-preview.has-rendered-model::before {
  background: var(--dice-render) center / contain no-repeat;
  box-shadow: none;
  clip-path: none;
  filter: drop-shadow(0 16px 18px rgba(0, 0, 0, .36)) drop-shadow(0 0 14px color-mix(in srgb, var(--dice-accent), transparent 46%));
  inset: -10px -12px;
}

.dice-style-preview.has-rendered-model::after,
.dice-style-preview.has-rendered-model .facet {
  display: none;
}

.dice-style-preview.has-rendered-model b {
  color: var(--dice-edge);
  display: block;
  font-size: 25px;
  transform: translateY(-2px);
  z-index: 3;
}

.dice-style-preview em,
.dice-style-preview em::before,
.dice-style-preview em::after {
  background: var(--dice-edge);
  border-radius: 999px;
  content: "";
  display: block;
  position: absolute;
  z-index: 3;
}

.dice-style-preview em {
  bottom: 18px;
  height: 3px;
  opacity: .82;
  width: 23px;
}

.flair-ember em {
  box-shadow: 0 0 10px var(--dice-accent);
  transform: rotate(-10deg);
}

.flair-ember em::before {
  height: 13px;
  left: 10px;
  top: -15px;
  transform: rotate(22deg);
  width: 3px;
}

.flair-lunar em {
  background: transparent;
  border: 3px solid var(--dice-edge);
  border-left-color: transparent;
  border-radius: 50%;
  height: 18px;
  width: 18px;
}

.flair-arcane em,
.flair-wild em {
  height: 22px;
  transform: rotate(45deg);
  width: 3px;
}

.flair-arcane em::before,
.flair-wild em::before {
  height: 3px;
  left: -9px;
  top: 9px;
  width: 21px;
}

.flair-frost em {
  height: 26px;
  transform: rotate(30deg);
  width: 3px;
}

.flair-frost em::before,
.flair-frost em::after {
  height: 3px;
  left: -8px;
  top: 8px;
  width: 19px;
}

.flair-frost em::after {
  top: 15px;
  transform: rotate(90deg);
}

.flair-thorn em,
.flair-leaf em {
  background: transparent;
  border: 3px solid var(--dice-edge);
  border-radius: 80% 0 80% 0;
  height: 18px;
  transform: rotate(-34deg);
  width: 14px;
}

.flair-void em {
  background: transparent;
  border: 2px solid var(--dice-edge);
  height: 19px;
  transform: rotate(45deg);
  width: 19px;
}

.flair-claw em,
.flair-dagger em {
  transform: rotate(-70deg);
}

.flair-claw em::before,
.flair-claw em::after {
  height: 3px;
  left: 0;
  width: 23px;
}

.flair-claw em::before { top: -8px; }
.flair-claw em::after { top: 8px; }

.flair-steel em {
  height: 30px;
  transform: rotate(45deg);
  width: 4px;
}

.flair-steel em::before {
  height: 4px;
  left: -10px;
  top: 12px;
  width: 24px;
}

.flair-sanctuary em {
  height: 28px;
  width: 4px;
}

.flair-sanctuary em::before {
  height: 4px;
  left: -9px;
  top: 10px;
  width: 22px;
}

.settings-avatar-editor {
  border-top: 0;
  margin-top: 0;
  padding-top: 0;
}

.profile-privacy-quick {
  align-items: center;
  border-top: 1px solid rgba(255, 250, 242, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
}

.profile-privacy-chip {
  background: rgba(255, 250, 242, 0.06);
  border: 1px solid rgba(255, 250, 242, 0.12);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  padding: 8px 10px;
}

.profile-privacy-chip span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 950;
  text-transform: uppercase;
}

.profile-privacy-chip strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.profile-privacy-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-settings-actions {
  background: rgba(18, 13, 17, 0.96);
  border-top: 1px solid var(--line-dark);
}

.hero-settings-logout {
  margin-right: auto;
}

.avatar-crop-dialog {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 18px;
  position: fixed;
  z-index: 1220;
}

.avatar-crop-panel {
  background:
    linear-gradient(180deg, rgba(32, 24, 31, 0.98), rgba(18, 13, 17, 0.98)),
    #171116;
  border: 1px solid rgba(216, 157, 74, 0.38);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  max-height: calc(100dvh - 36px);
  max-width: min(620px, calc(100vw - 28px));
  overflow: hidden;
  position: relative;
  width: min(620px, calc(100vw - 28px));
}

.avatar-crop-body {
  display: grid;
  gap: 14px;
  justify-items: center;
  min-height: 0;
  overflow-y: auto;
  padding: 18px;
}

.avatar-crop-frame {
  aspect-ratio: 1;
  background: rgba(0, 0, 0, 0.28);
  border: 1px solid var(--line);
  border-radius: 8px;
  max-width: min(100%, 430px);
  overflow: hidden;
  position: relative;
  touch-action: none;
  width: 100%;
}

.avatar-crop-frame.avatar-shape-circle {
  border-radius: 50%;
}

.avatar-crop-frame canvas {
  cursor: grab;
  display: block;
  height: 100%;
  transition: opacity 0.16s ease;
  width: 100%;
}

.avatar-crop-frame canvas:active {
  cursor: grabbing;
}

.avatar-crop-frame.loading canvas {
  cursor: wait;
  opacity: 0.2;
}

.avatar-crop-loading {
  align-items: center;
  background: rgba(17, 12, 16, 0.72);
  color: var(--text);
  display: none;
  font-family: var(--font-display);
  font-size: 0.92rem;
  inset: 0;
  justify-content: center;
  letter-spacing: 0;
  pointer-events: none;
  position: absolute;
  text-align: center;
}

.avatar-crop-frame.loading .avatar-crop-loading {
  display: flex;
}

.avatar-crop-controls {
  display: grid;
  gap: 12px;
  max-width: 430px;
  width: 100%;
}

.avatar-crop-controls .avatar-shape-toggle {
  justify-self: center;
  width: min(230px, 100%);
}

.avatar-crop-zoom-row {
  align-items: end;
  display: grid;
  gap: 8px;
  grid-template-columns: 42px minmax(0, 1fr) 42px auto;
}

.avatar-crop-zoom-field {
  min-width: 0;
}

.avatar-crop-zoom-btn {
  height: 42px;
  min-height: 42px;
  min-width: 42px;
}

.avatar-crop-zoom-value {
  align-items: center;
  background: rgba(255, 250, 242, 0.07);
  border: 1px solid rgba(226, 195, 151, 0.16);
  border-radius: 8px;
  color: var(--muted-strong);
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  height: 42px;
  justify-content: center;
  min-width: 58px;
  padding: 0 9px;
}

.avatar-crop-controls input[type="range"] {
  align-self: center;
  min-height: 42px;
  cursor: pointer;
  padding-inline: 4px;
}

.avatar-crop-actions {
  background: rgba(18, 13, 17, 0.96);
  border-top: 1px solid var(--line-dark);
}

@media (max-width: 720px) {
  .hero-settings-dialog {
    padding: 12px;
  }

  .hero-settings-panel {
    max-height: calc(100dvh - 24px);
    min-height: 0;
  }

  .settings-field-grid,
  .settings-preference-row,
  .theme-picker,
  .dice-style-grid,
  .token-border-grid,
  .public-panel-list,
  .settings-tab-rail {
    grid-template-columns: 1fr;
  }

  .theme-custom {
    justify-self: stretch;
    width: auto;
  }

  .hero-settings-actions {
    grid-template-columns: 1fr;
  }

  .hero-settings-logout {
    margin-right: 0;
  }

  .avatar-crop-dialog {
    align-items: end;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .avatar-crop-panel {
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
  }

  .avatar-crop-zoom-row {
    grid-template-columns: 40px minmax(0, 1fr) 40px;
  }

  .avatar-crop-zoom-value {
    grid-column: 1 / -1;
    justify-self: center;
    min-width: 76px;
  }

  .avatar-crop-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.portal-action-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.portal-action-card {
  align-content: start;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.1), rgba(255, 243, 231, 0.025)),
    var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 15px;
}

.portal-action-card.disabled {
  opacity: .68;
}

.portal-action-card > span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.portal-action-card > strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 950;
  line-height: 1;
}

.portal-action-card p {
  color: var(--muted-strong);
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}

.portal-action-target {
  margin-top: 4px;
}

#creationDialog .creation-panel {
  background:
    radial-gradient(circle at top left, rgba(216, 157, 74, 0.06), transparent 34rem),
    linear-gradient(180deg, #171116 0%, #120d11 100%);
  border-left: 0;
  box-shadow: none;
  height: 100dvh;
  margin: 0;
  max-height: 100dvh;
  max-width: none;
  width: 100vw;
}

#companionDialog .companion-request-panel {
  background:
    radial-gradient(circle at top left, rgba(216, 157, 74, 0.06), transparent 34rem),
    linear-gradient(180deg, #171116 0%, #120d11 100%);
  border-left: 0;
  box-shadow: none;
  height: 100dvh;
  margin: 0;
  max-height: 100dvh;
  max-width: none;
  width: 100vw;
}

#creationDialog .creation-head,
#companionDialog .creation-head {
  padding: 18px clamp(20px, 4vw, 56px);
}

.creation-head {
  align-items: center;
  border-bottom: 1px solid var(--line-dark);
  display: flex;
  justify-content: space-between;
  padding: 18px 20px;
}

.creation-head h2 {
  font-size: 26px;
  font-weight: 950;
  line-height: 1;
  margin-top: 4px;
}

.creation-form {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}

.creation-body {
  align-content: start;
  display: block;
  gap: 16px;
  height: 100%;
  min-height: 0;
  overscroll-behavior: contain;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 16px clamp(16px, 3vw, 42px) clamp(24px, 3vw, 40px);
  scrollbar-gutter: stable;
}

.creation-edit-banner {
  align-items: center;
  background: rgba(216, 157, 74, 0.14);
  border: 1px solid rgba(216, 157, 74, 0.42);
  border-radius: 8px;
  color: var(--ink);
  display: flex;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin: 0 auto 14px;
  max-width: 1520px;
  padding: 10px 12px;
}

.creation-edit-banner strong {
  font-size: 13px;
  font-weight: 950;
}

.creation-edit-banner span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
}

.creation-wizard-body {
  align-content: start;
  align-items: start;
  display: grid;
  grid-template-areas:
    "steps"
    "main"
    "preview";
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: auto auto auto;
  gap: 14px;
  min-height: 0;
  max-width: 1520px;
  overflow: visible;
  width: 100%;
  margin: 0 auto;
}

.creation-stepper {
  display: flex;
  gap: 10px;
  align-self: start;
  grid-area: steps;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
  padding-right: 0;
  scrollbar-gutter: stable;
  width: 100%;
}

.creation-step-tab {
  appearance: none;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-strong);
  cursor: pointer;
  display: grid;
  gap: 4px;
  flex: 1 1 0;
  min-height: 54px;
  min-width: 132px;
  padding: 10px 12px;
  text-align: left;
  transition: background-color .16s ease, border-color .16s ease, color .16s ease;
}

.creation-step-tab span {
  color: var(--accent);
  font-size: 11px;
  font-weight: 950;
}

.creation-step-tab strong {
  font-size: 13px;
  font-weight: 900;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.creation-step-tab.active {
  background: rgba(var(--accent-rgb), 0.18);
  border-color: rgba(216, 157, 74, 0.58);
  color: var(--ink);
}

.creation-step-tab:hover {
  border-color: rgba(216, 157, 74, 0.42);
}

.creation-step-tab.complete {
  border-color: rgba(89, 179, 160, 0.42);
}

.creation-step-content {
  align-content: start;
  align-items: start;
  display: grid;
  gap: 12px;
  grid-area: main;
  min-width: 0;
  overflow: visible;
  padding-right: 0;
}

.creation-step-heading {
  align-items: baseline;
  border-bottom: 1px solid var(--line);
  display: none;
  gap: 12px;
  justify-content: flex-start;
  min-height: 0;
  padding: 4px 2px 11px;
}

.creation-step-heading span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.creation-step-heading h3 {
  font-size: 24px;
  font-weight: 950;
  order: 2;
}

.creation-benefit-panel {
  align-content: start;
  align-items: start;
  display: grid;
  gap: 12px;
  grid-area: preview;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  min-width: 0;
  overflow: visible;
  padding-right: 0;
}

.creation-preview-card {
  align-self: start;
  background: linear-gradient(180deg, rgba(37, 29, 36, 0.96), rgba(32, 24, 31, 0.96));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
}

.creation-preview-card.empty {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.creation-preview-title {
  display: grid;
  gap: 4px;
}

.creation-preview-title span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.creation-preview-title p {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.creation-preview-list {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr));
}

.creation-preview-line {
  align-self: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  display: grid;
  gap: 4px;
  min-height: 50px;
  padding: 9px 10px;
}

.creation-preview-line.choice,
.creation-preview-line.bonus {
  border-color: rgba(216, 157, 74, 0.42);
}

.creation-preview-line.defense {
  border-color: rgba(89, 179, 160, 0.34);
}

.creation-preview-line span,
.creation-review-cell span,
.creation-review-list span,
.creation-ability-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.creation-preview-line strong,
.creation-preview-value {
  color: var(--ink);
  font-size: 13px;
  font-weight: 850;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.creation-preview-value p + p {
  margin-top: 7px;
}

.creation-preview-value p {
  margin-bottom: 0;
  margin-top: 0;
}

.creation-preview-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.creation-section,
.creation-loading {
  background: linear-gradient(180deg, rgba(34, 27, 33, 0.94), rgba(29, 23, 29, 0.94));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 16px;
}

.creation-loading {
  margin: 20px;
}

.creation-loading strong {
  font-size: 18px;
}

.creation-loading span {
  color: var(--muted);
}

.creation-section-title,
.starter-title {
  align-items: start;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: space-between;
}

.creation-section-title span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.creation-section.is-invalid {
  border-color: rgba(184, 66, 60, 0.78);
  box-shadow: inset 0 0 0 1px rgba(184, 66, 60, 0.18), var(--soft-shadow);
}

.creation-section.is-invalid .creation-section-title span,
.starter-group.is-invalid .starter-title strong {
  color: #ffb7af;
}

.creation-section-title strong,
.starter-title span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
  line-height: 1.3;
  max-width: 100%;
  overflow-wrap: anywhere;
  text-align: right;
}

.creation-grid {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.creation-wide {
  margin-top: 2px;
}

.textarea {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 86px;
  padding: 10px;
  resize: vertical;
  width: 100%;
}

.ability-entry-grid {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.ability-entry {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 10px;
}

.ability-entry-input {
  display: grid;
  gap: 8px;
}

.ability-entry span {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
}

.ability-roll-btn {
  width: 100%;
}

.ability-roll-btn[data-point-buy-delta] {
  font-size: 0;
  padding: 0;
}

.ability-roll-btn[data-point-buy-delta]:not(.is-working)::before,
.ability-roll-btn[data-point-buy-delta="1"]:not(.is-working)::after {
  background: currentColor;
  border-radius: 999px;
  content: "";
  height: 2px;
  left: 50%;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 12px;
}

.ability-roll-btn[data-point-buy-delta="1"]:not(.is-working)::after {
  height: 12px;
  width: 2px;
}

.point-buy-summary {
  background: rgba(255, 250, 242, 0.06);
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 12px 14px;
}

.point-buy-summary-top,
.point-buy-summary-bottom {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
  min-width: 0;
}

.point-buy-summary strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
}

.point-buy-summary span {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 750;
  line-height: 1.35;
}

.point-buy-summary-top span {
  color: var(--accent);
  font-size: 14px;
  font-weight: 950;
  white-space: nowrap;
}

.point-buy-summary-bottom span:last-child {
  text-align: right;
}

.point-buy-meter {
  background: rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.point-buy-meter span {
  background: linear-gradient(90deg, var(--accent), #5fbe85);
  border-radius: inherit;
  display: block;
  height: 100%;
  transition: width 140ms ease;
}

.point-buy-summary.valid {
  border-color: rgba(95, 190, 133, 0.42);
}

.point-buy-summary.invalid {
  border-color: rgba(216, 88, 82, 0.52);
}

.point-buy-controls {
  align-items: center;
  display: grid;
  gap: 6px;
  grid-template-columns: 34px minmax(0, 1fr) 34px;
}

.point-buy-controls em {
  color: var(--muted-strong);
  font-size: 11px;
  font-style: normal;
  font-weight: 850;
  line-height: 1.25;
  text-align: center;
}

.point-buy-controls .btn:disabled {
  cursor: not-allowed;
  opacity: 0.42;
}

.choice-list {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.choice-list.compact {
  grid-template-columns: 1fr;
}

.choice-option {
  align-items: start;
  align-self: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  display: grid;
  gap: 10px;
  grid-template-columns: auto minmax(0, 1fr);
  min-height: 48px;
  padding: 10px;
}

.choice-option.selected {
  background: rgba(var(--accent-rgb), 0.22);
  border-color: rgba(216, 157, 74, 0.58);
}

.choice-option.disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.choice-option input {
  accent-color: var(--accent);
  margin-top: 3px;
}

.choice-option > span {
  display: grid;
  gap: 3px;
}

.choice-option > span > strong {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  font-size: 13px;
  font-weight: 900;
  gap: 8px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.choice-details-btn {
  align-items: center;
  appearance: none;
  background: rgba(255, 243, 231, 0.06);
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted-strong);
  cursor: pointer;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  justify-content: center;
  line-height: 1;
  padding: 5px 8px;
  text-align: center;
}

.choice-details-btn:hover {
  border-color: rgba(216, 157, 74, 0.54);
  color: var(--ink);
}

.choice-details {
  border-top: 1px solid var(--line);
  color: var(--muted-strong);
  display: grid;
  font-size: 12px;
  font-weight: 650;
  gap: 8px;
  line-height: 1.45;
  margin-top: 6px;
  overflow-wrap: anywhere;
  padding-top: 8px;
}

.choice-details p {
  margin: 0;
}

.choice-details strong {
  display: inline;
  font-size: inherit;
  font-weight: 950;
  line-height: inherit;
  overflow-wrap: anywhere;
}

.choice-option em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.choice-option i {
  display: flex;
  flex-wrap: wrap;
  font-style: normal;
  gap: 5px;
  margin-top: 3px;
}

.levelup-panel {
  max-width: min(760px, 100vw);
  width: 760px;
}

.levelup-content {
  display: grid;
  grid-template-rows: minmax(0, 1fr);
  min-height: 0;
}

.levelup-body {
  display: grid;
  gap: 12px;
  min-height: 0;
  overflow-y: auto;
  padding: 16px 20px 22px;
}

.levelup-stage {
  align-items: start;
  background:
    linear-gradient(135deg, rgba(var(--accent-rgb), 0.18), transparent 55%),
    var(--surface);
  border: 1px solid rgba(216, 157, 74, 0.34);
  border-radius: 8px;
  display: flex;
  gap: 14px;
  justify-content: space-between;
  padding: 14px;
}

.levelup-stage h3 {
  font-size: 22px;
  font-weight: 950;
  line-height: 1.1;
  margin-top: 3px;
}

.levelup-stage span,
.levelup-stage strong {
  color: var(--gold);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.levelup-stage p {
  color: var(--muted);
  line-height: 1.4;
  margin-top: 6px;
}

.levelup-stage.review {
  border-color: rgba(85, 184, 120, 0.46);
}

.levelup-choice-list {
  grid-template-columns: 1fr;
}

.levelup-option {
  min-height: 62px;
}

.levelup-option-top {
  align-items: start;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.levelup-detail-toggle {
  align-items: center;
  appearance: none;
  background: rgba(155, 145, 238, 0.12);
  border: 1px solid rgba(155, 145, 238, 0.32);
  border-radius: 999px;
  color: var(--arcane);
  cursor: pointer;
  display: inline-flex;
  font-size: 10px;
  font-weight: 950;
  justify-content: center;
  line-height: 1;
  padding: 6px 8px;
  text-align: center;
  text-transform: uppercase;
  white-space: nowrap;
}

.levelup-detail-toggle:hover {
  background: rgba(155, 145, 238, 0.2);
  border-color: rgba(155, 145, 238, 0.52);
}

.levelup-option-details {
  background: rgba(255, 243, 231, 0.035);
  border: 1px solid rgba(216, 157, 74, 0.24);
  border-radius: 8px;
  color: var(--muted-strong);
  display: grid;
  gap: 8px;
  line-height: 1.45;
  margin-top: 8px;
  padding: 10px;
}

.levelup-option-details p {
  margin: 0;
}

.levelup-review-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.levelup-review-cell {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 5px;
  padding: 12px;
}

.levelup-review-cell span,
.levelup-review-list > strong {
  color: var(--accent);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.levelup-review-cell strong {
  font-size: 14px;
  overflow-wrap: anywhere;
}

.levelup-review-cell em {
  color: var(--muted-strong);
  font-style: normal;
  overflow-wrap: anywhere;
}

.levelup-review-list {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  padding: 12px;
}

.levelup-review-list div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.levelup-review-list div span {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 800;
  padding: 6px 8px;
}

.character-repair-panel {
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  box-shadow: var(--shadow);
  height: auto;
  margin: min(6vh, 48px) auto;
  max-height: calc(100dvh - 32px);
  max-width: min(960px, calc(100vw - 28px));
  overflow: hidden;
  width: min(960px, calc(100vw - 28px));
}

.character-repair-content {
  grid-template-rows: minmax(0, 1fr) auto;
}

.character-repair-body {
  align-content: start;
  grid-auto-rows: max-content;
}

.character-repair-stage {
  background:
    linear-gradient(135deg, rgba(85, 184, 120, 0.18), transparent 55%),
    var(--surface);
}

.character-repair-ability-grid {
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.character-repair-ability-entry {
  gap: 10px;
  min-width: 0;
  padding: 12px;
}

.character-repair-ability-head {
  align-items: start;
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
}

.character-repair-ability-head > div {
  align-items: end;
  display: grid;
  gap: 3px;
  justify-items: end;
  min-width: 52px;
}

.character-repair-ability-head small,
.character-repair-ability-stats dt {
  color: var(--muted);
  font-size: 10px;
  font-weight: 950;
  line-height: 1;
  text-transform: uppercase;
}

.character-repair-ability-head strong {
  color: var(--ink);
  font-size: 26px;
  font-weight: 950;
  line-height: 0.95;
}

.character-repair-ability-input {
  align-self: start;
  max-width: 104px;
}

.character-repair-ability-input .input {
  font-size: 16px;
  font-weight: 850;
  min-height: 40px;
  padding: 8px 10px;
  text-align: center;
}

.character-repair-point-buy-controls {
  gap: 8px;
  grid-template-columns: 40px minmax(82px, 1fr) 40px;
}

.character-repair-point-buy-controls .ability-roll-btn {
  height: 36px;
}

.character-repair-point-buy-controls em {
  background: rgba(255, 250, 242, 0.055);
  border: 1px solid rgba(255, 250, 242, 0.11);
  border-radius: 8px;
  color: var(--ink);
  display: block;
  font-size: 12px;
  line-height: 1;
  padding: 10px 8px;
  white-space: nowrap;
}

.character-repair-ability-stats {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
}

.character-repair-ability-stats div {
  background: rgba(255, 250, 242, 0.045);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 7px;
  display: grid;
  gap: 4px;
  min-width: 0;
  padding: 8px;
}

.character-repair-ability-stats dd {
  color: var(--ink);
  font-size: 14px;
  font-weight: 950;
  line-height: 1;
  margin: 0;
}

.character-repair-character-list {
  align-content: start;
  gap: 10px;
  grid-auto-rows: max-content;
}

.character-repair-character-list .character-repair-option {
  min-height: 72px;
}

.character-repair-summary-grid {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.character-repair-ready,
.character-repair-cooldown {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 950;
  line-height: 1;
  padding: 6px 8px;
  white-space: nowrap;
}

.character-repair-ready {
  background: rgba(85, 184, 120, 0.16);
  color: #9af1b5;
}

.character-repair-cooldown {
  background: rgba(216, 88, 82, 0.16);
  color: #ffb2aa;
}

.character-repair-list.warning {
  border-color: rgba(216, 88, 82, 0.36);
}

.character-repair-list.warning > strong {
  color: #ff9b92;
}

@media (min-width: 760px) {
  .character-repair-character-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .character-repair-ability-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.fixed-strip {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.fixed-strip > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  line-height: 1.25;
  overflow-wrap: anywhere;
  text-transform: uppercase;
}

.creation-review-grid,
.creation-review-lists,
.creation-ability-summary {
  align-items: start;
  display: grid;
  gap: 8px;
}

.creation-review-grid {
  grid-template-columns: repeat(auto-fit, minmax(min(240px, 100%), 1fr));
}

.creation-review-lists {
  grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr));
}

.creation-review-cell,
.creation-review-list,
.creation-ability-summary div {
  align-self: start;
  background:
    linear-gradient(135deg, rgba(255, 250, 242, 0.04), transparent 58%),
    var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 4px 10px;
  grid-template-columns: 34px minmax(0, 1fr);
  min-height: 58px;
  padding: 10px;
}

.creation-review-cell span:not(.creation-review-icon),
.creation-review-list span:not(.creation-review-icon),
.creation-ability-summary div > span:not(.creation-review-icon) {
  align-self: end;
  grid-column: 2;
}

.creation-review-cell strong,
.creation-review-list strong,
.creation-ability-summary strong {
  color: var(--ink);
  grid-column: 2;
  font-size: 13px;
  font-weight: 900;
  line-height: 1.32;
  overflow-wrap: anywhere;
}

.creation-ability-summary {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.creation-review-hero {
  background:
    radial-gradient(circle at top left, rgba(var(--accent-rgb), 0.13), transparent 28rem),
    linear-gradient(180deg, rgba(38, 29, 36, 0.98), rgba(27, 22, 28, 0.98));
  border-color: rgba(var(--accent-rgb), 0.3);
}

.creation-review-cell .creation-review-icon,
.creation-review-list .creation-review-icon,
.creation-ability-summary .creation-review-icon {
  align-items: center;
  align-self: center;
  background: rgba(var(--accent-rgb), 0.12);
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  border-radius: 8px;
  color: var(--accent);
  display: inline-grid;
  grid-column: 1;
  grid-row: 1 / span 2;
  height: 34px;
  justify-items: center;
  line-height: 1;
  text-transform: none;
  width: 34px;
}

.creation-review-cell .creation-review-icon svg,
.creation-review-list .creation-review-icon svg,
.creation-ability-summary .creation-review-icon svg {
  fill: none;
  height: 18px;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
  width: 18px;
}

.creation-review-cell .creation-review-icon.ability svg,
.creation-review-list .creation-review-icon.ability svg,
.creation-ability-summary .creation-review-icon.ability svg {
  fill: currentColor;
  stroke: none;
}

.creation-ability-card.tone-str .creation-review-icon { color: #ffd08a; }
.creation-ability-card.tone-dex .creation-review-icon { color: #91d8ca; }
.creation-ability-card.tone-con .creation-review-icon { color: #d9d3c7; }
.creation-ability-card.tone-int .creation-review-icon { color: #c9c2ff; }
.creation-ability-card.tone-wis .creation-review-icon { color: #aee2b9; }
.creation-ability-card.tone-cha .creation-review-icon { color: #ffb1ba; }

.creation-ability-card strong {
  font-size: 20px;
  line-height: 1;
}

.creation-gear-mode {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.creation-gear-mode label {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--muted-strong);
  cursor: pointer;
  display: inline-flex;
  font-size: 13px;
  font-weight: 850;
  gap: 8px;
  line-height: 1.3;
  min-height: 38px;
  overflow-wrap: anywhere;
  padding: 9px 11px;
}

.starter-group {
  display: grid;
  gap: 8px;
}

.starter-group.is-invalid {
  background: rgba(184, 66, 60, 0.08);
  border: 1px solid rgba(184, 66, 60, 0.46);
  border-radius: 8px;
  padding: 10px;
}

.starter-title strong {
  font-size: 14px;
  font-weight: 950;
}

.starter-group p {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.creation-actions {
  background: rgba(18, 13, 17, 0.98);
  border-top: 1px solid var(--line-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-end;
  padding: 14px clamp(16px, 3vw, 42px);
}

#creationDialog .creation-actions {
  padding: 13px clamp(20px, 4vw, 56px);
}

.creation-step-status {
  color: var(--muted);
  font-size: 12px;
  font-weight: 950;
  margin-left: auto;
}

.roll-overlay {
  --roll-die-body: #b63f4d;
  --roll-die-edge: #ffdeb0;
  --roll-die-accent: #d8843f;
  --roll-die-deep: #35101a;
  --roll-die-texture: linear-gradient(142deg, #b63f4d, #35101a);
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 24px;
  position: fixed;
  z-index: 3300;
}

.roll-backdrop {
  background: rgba(8, 5, 8, 0.76);
  backdrop-filter: blur(7px);
  inset: 0;
  position: absolute;
}

.roll-panel {
  --roll-die-size: 118px;
  --roll-winner-shift: 68px;
  background:
    linear-gradient(135deg, rgba(216, 157, 74, 0.13), transparent 30%),
    linear-gradient(180deg, #21191b 0%, #130f14 100%);
  border: 1px solid rgba(226, 195, 151, 0.46);
  border-radius: 8px;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(255, 250, 242, 0.06);
  color: var(--ink);
  display: grid;
  gap: 12px;
  max-width: calc(100vw - 32px);
  max-height: calc(100dvh - 32px);
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 20px;
  position: relative;
  transform-origin: center;
  width: min(520px, 100%);
}

.roll-panel::before,
.roll-panel::after {
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

.roll-panel::before {
  background: conic-gradient(from 12deg at 50% 40%, transparent, rgba(216, 157, 74, 0.24), transparent, rgba(89, 179, 160, 0.16), transparent);
  opacity: .28;
}

.roll-panel::after {
  background:
    linear-gradient(90deg, transparent 0 18%, rgba(255, 250, 242, 0.06) 18% 18.5%, transparent 18.5% 100%),
    linear-gradient(0deg, transparent 0 28%, rgba(216, 157, 74, 0.08) 28% 28.5%, transparent 28.5% 100%);
  background-size: 74px 74px;
  opacity: .32;
}

.roll-overlay.is-open .roll-panel {
  animation: rollPanelIn .18s ease-out both;
}

.roll-overlay.is-closing .roll-panel {
  animation: rollPanelOut .16s ease-in both;
}

.roll-close {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
}

.roll-header {
  align-items: start;
  display: grid;
  gap: 4px;
  padding-right: 48px;
  position: relative;
  z-index: 1;
}

.roll-header h2 {
  font-size: clamp(24px, 5vw, 34px);
  font-weight: 950;
  line-height: 1.04;
}

.roll-header small {
  color: var(--muted-strong);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.roll-stage {
  align-items: center;
  display: grid;
  justify-items: center;
  min-height: 144px;
  perspective: 680px;
  position: relative;
  z-index: 1;
}

.roll-flare {
  background:
    radial-gradient(circle, color-mix(in srgb, var(--roll-die-accent), transparent 46%) 0 18%, transparent 62%),
    conic-gradient(from 18deg, transparent 0 12deg, color-mix(in srgb, var(--roll-die-edge), transparent 78%) 12deg 15deg, transparent 15deg 36deg);
  border: 0;
  border-radius: 50%;
  filter: blur(.4px);
  height: calc(var(--roll-die-size) + 34px);
  opacity: .24;
  position: absolute;
  width: calc(var(--roll-die-size) + 34px);
}

.roll-overlay.is-rolling .roll-flare {
  animation: rollSigilSpin 1.7s linear infinite;
}

.roll-dice {
  align-items: center;
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(2, var(--roll-die-size));
  justify-content: center;
  min-height: calc(var(--roll-die-size) + 16px);
  opacity: 1;
  position: relative;
  transform: scale(1);
  transition: opacity .18s ease, transform .28s ease;
  width: 100%;
  z-index: 1;
}

.roll-dice[data-roll-mode="normal"],
.roll-dice[data-roll-mode="damage"] {
  grid-template-columns: var(--roll-die-size);
}

.roll-die-shell {
  display: grid;
  justify-items: center;
  opacity: 1;
  transform: translateX(0) scale(1);
  transition: opacity .34s ease, transform .42s cubic-bezier(.18, .9, .2, 1), filter .34s ease;
}

.roll-die-shell.is-hidden {
  display: none;
}

.roll-overlay.is-settled.mode-advantage .roll-die-shell.primary.is-winner,
.roll-overlay.is-settled.mode-disadvantage .roll-die-shell.primary.is-winner {
  transform: translateX(var(--roll-winner-shift)) scale(1.06);
}

.roll-overlay.is-settled.mode-advantage .roll-die-shell.secondary.is-winner,
.roll-overlay.is-settled.mode-disadvantage .roll-die-shell.secondary.is-winner {
  transform: translateX(calc(var(--roll-winner-shift) * -1)) scale(1.06);
}

.roll-overlay.is-settled .roll-die-shell.is-loser {
  filter: blur(2px);
  opacity: 0;
  transform: translateY(12px) scale(.74);
}

.roll-die-face {
  align-items: center;
  aspect-ratio: 1;
  background: none;
  border: 0;
  box-shadow: none;
  clip-path: none;
  color: var(--roll-die-edge);
  display: grid;
  font-size: calc(var(--roll-die-size) * .38);
  filter:
    drop-shadow(0 22px 28px rgba(0, 0, 0, 0.52))
    drop-shadow(0 0 24px color-mix(in srgb, var(--roll-die-accent), transparent 58%));
  font-weight: 950;
  height: var(--roll-die-size);
  justify-items: center;
  line-height: 1;
  overflow: visible;
  position: relative;
  isolation: isolate;
  transform-style: preserve-3d;
  width: var(--roll-die-size);
  text-shadow:
    0 2px 8px rgba(0, 0, 0, 0.62),
    0 0 12px color-mix(in srgb, var(--roll-die-accent), transparent 42%);
}

.roll-overlay.mode-advantage .roll-die-face {
  filter:
    drop-shadow(0 22px 28px rgba(0, 0, 0, 0.52))
    drop-shadow(0 0 28px rgba(85, 184, 120, 0.42));
}

.roll-overlay.mode-disadvantage .roll-die-face {
  filter:
    drop-shadow(0 22px 28px rgba(0, 0, 0, 0.52))
    drop-shadow(0 0 28px rgba(216, 88, 82, 0.4));
}

.roll-overlay.mode-damage .roll-die-face {
  filter:
    drop-shadow(0 22px 28px rgba(0, 0, 0, 0.52))
    drop-shadow(0 0 28px rgba(216, 157, 74, 0.42));
}

.roll-d20-svg {
  height: 100%;
  inset: 0;
  overflow: visible;
  position: absolute;
  width: 100%;
  z-index: 1;
}

.roll-d20-back {
  fill: color-mix(in srgb, var(--roll-die-deep), #000000 22%);
}

.roll-d20-facet {
  stroke: color-mix(in srgb, var(--roll-die-edge), transparent 68%);
  stroke-linejoin: round;
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}

.roll-d20-facet-a { fill: color-mix(in srgb, var(--roll-die-body), #ffffff 30%); }
.roll-d20-facet-b { fill: color-mix(in srgb, var(--roll-die-body), #ffffff 12%); }
.roll-d20-facet-c { fill: color-mix(in srgb, var(--roll-die-body), var(--roll-die-deep) 20%); }
.roll-d20-facet-d { fill: color-mix(in srgb, var(--roll-die-deep), var(--roll-die-body) 28%); }
.roll-d20-facet-e { fill: color-mix(in srgb, var(--roll-die-deep), #ffffff 8%); }
.roll-d20-facet-f { fill: color-mix(in srgb, var(--roll-die-deep), #000000 10%); }
.roll-d20-facet-g { fill: color-mix(in srgb, var(--roll-die-body), #000000 18%); }
.roll-d20-facet-h { fill: color-mix(in srgb, var(--roll-die-body), #ffffff 4%); }
.roll-d20-facet-i { fill: color-mix(in srgb, var(--roll-die-body), var(--roll-die-accent) 18%); }

.roll-d20-ridges,
.roll-d20-outline {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.roll-d20-ridges {
  opacity: .78;
  stroke: color-mix(in srgb, var(--roll-die-edge), transparent 44%);
  stroke-width: 1.35;
}

.roll-d20-outline {
  opacity: .92;
  stroke: color-mix(in srgb, var(--roll-die-edge), transparent 16%);
  stroke-width: 2.2;
}

.roll-die-art {
  border-radius: 6px;
  display: block;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  position: relative;
  user-select: none;
  width: 100%;
  z-index: 2;
}

.roll-die-value {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  z-index: -1;
}

.roll-stage-score {
  color: #fff4d7;
  font-size: clamp(58px, 15vw, 96px);
  font-weight: 950;
  line-height: .86;
  opacity: 0;
  position: absolute;
  text-shadow:
    0 0 22px rgba(216, 157, 74, 0.42),
    0 5px 20px rgba(0, 0, 0, 0.56);
  transform: scale(.38);
  z-index: 4;
}

.roll-overlay.is-settled .roll-dice {
  opacity: 0;
  transform: scale(.56);
}

.roll-overlay.is-settled .roll-stage-score {
  animation: rollStageScoreIn .42s cubic-bezier(.16, 1.06, .22, 1.18) both;
}

.roll-overlay.critical .roll-stage-score {
  color: #fff0bc;
  text-shadow:
    0 0 18px rgba(255, 213, 111, 0.72),
    0 0 42px rgba(255, 194, 74, 0.38),
    0 5px 20px rgba(0, 0, 0, 0.58);
}

.roll-overlay.fumble .roll-stage-score {
  color: #ffe1e1;
  text-shadow:
    0 0 18px rgba(255, 82, 92, 0.78),
    0 0 42px rgba(255, 48, 67, 0.44),
    0 5px 20px rgba(0, 0, 0, 0.6);
}

.roll-overlay.is-rolling .roll-die-shell {
  animation: rollDieHop .16s ease-in-out infinite;
}

.roll-overlay.is-rolling .roll-die-shell.secondary,
.roll-overlay.is-rolling .roll-die-shell.secondary .roll-die-face {
  animation-delay: -.2s;
}

.roll-overlay.is-rolling .roll-die-face {
  animation: rollDieTumble .82s cubic-bezier(.22, .02, .86, .42) both;
}

.roll-overlay.is-rolling .roll-die-art {
  animation: rollDieImageRush .82s ease-in both;
}

.roll-overlay.is-settled .roll-die-face {
  animation: rollDieLand .34s cubic-bezier(.18, .9, .22, 1.15) both;
}

.roll-breakdown {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  justify-content: center;
  position: relative;
  z-index: 1;
}

.roll-breakdown span {
  background: rgba(89, 179, 160, 0.12);
  border: 1px solid rgba(89, 179, 160, 0.28);
  border-radius: 999px;
  color: #bfeee4;
  cursor: default;
  font-size: 10px;
  font-weight: 900;
  line-height: 1.1;
  min-height: 22px;
  overflow-wrap: anywhere;
  padding: 5px 9px;
  text-align: center;
}

.roll-breakdown span:nth-child(2) {
  background: rgba(216, 157, 74, 0.12);
  border-color: rgba(216, 157, 74, 0.3);
  color: #f1d29e;
}

.roll-breakdown span:nth-child(3) {
  background: rgba(155, 145, 238, 0.11);
  border-color: rgba(155, 145, 238, 0.28);
  color: #d7d1ff;
}

.roll-options {
  display: grid;
  gap: 10px;
  position: relative;
  z-index: 1;
}

.roll-option-group {
  display: grid;
  gap: 7px;
}

.roll-option-group > span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 950;
  text-transform: uppercase;
}

.roll-option-row {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.roll-presentation-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.roll-option-row.boosts {
  grid-template-columns: repeat(auto-fit, minmax(124px, 1fr));
  max-height: 128px;
  overflow-y: auto;
  padding-right: 2px;
}

.roll-option-row.damage-options {
  grid-template-columns: repeat(auto-fit, minmax(132px, 1fr));
}

.roll-option-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
  padding: 8px 0;
}

.roll-option-btn {
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.12), rgba(255, 250, 242, 0.05));
  border: 1px solid rgba(226, 195, 151, 0.34);
  border-radius: 7px;
  box-shadow:
    0 7px 14px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 250, 242, 0.09);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 2px;
  min-height: 40px;
  padding: 7px 9px;
  text-align: center;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.roll-option-btn:hover:not(:disabled),
.roll-option-btn.active {
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.24), rgba(var(--accent-rgb), 0.1));
  border-color: rgba(216, 157, 74, 0.64);
  box-shadow:
    0 9px 18px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(var(--accent-rgb), 0.16),
    inset 0 1px 0 rgba(255, 250, 242, 0.12);
}

.roll-option-btn:active:not(:disabled) {
  transform: translateY(1px);
}

.roll-option-btn:disabled {
  cursor: default;
  opacity: .62;
}

.roll-option-btn strong {
  font-size: 13px;
  font-weight: 950;
  line-height: 1.05;
}

.roll-option-btn span {
  color: var(--muted-strong);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.15;
}

.roll-dice-style-group {
  border-top: 1px solid rgba(226, 195, 151, 0.16);
  padding-top: 2px;
}

.roll-dice-style-trigger {
  align-items: center;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.12), rgba(255, 250, 242, 0.045));
  border: 1px solid rgba(226, 195, 151, 0.34);
  border-radius: 8px;
  box-shadow:
    0 10px 18px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 250, 242, 0.09);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 3px 10px;
  grid-template-columns: 54px minmax(0, 1fr) max-content;
  grid-template-rows: auto auto;
  min-height: 62px;
  overflow: hidden;
  padding: 7px 9px;
  text-align: left;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.roll-dice-style-trigger:hover:not(:disabled),
.roll-dice-style-group.open .roll-dice-style-trigger {
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.22), rgba(var(--accent-rgb), 0.08));
  border-color: rgba(216, 157, 74, 0.62);
  box-shadow:
    0 12px 22px rgba(0, 0, 0, 0.26),
    0 0 0 1px rgba(var(--accent-rgb), 0.18),
    inset 0 1px 0 rgba(255, 250, 242, 0.12);
  transform: translateY(-1px);
}

.roll-dice-style-trigger:disabled {
  cursor: default;
  opacity: .66;
}

.roll-dice-style-trigger .dice-style-preview,
.roll-dice-style-card .dice-style-preview {
  align-self: center;
  justify-self: center;
  margin: 0;
  overflow: hidden;
}

.roll-dice-style-trigger .dice-style-preview {
  grid-column: 1;
  grid-row: 1 / span 2;
  height: 48px;
  width: 48px;
}

.roll-dice-style-card .dice-style-preview {
  grid-column: 1;
  grid-row: 1 / span 2;
  height: 40px;
  width: 40px;
}

.roll-dice-style-trigger .dice-style-preview::before,
.roll-dice-style-trigger .dice-style-preview::after {
  inset: 3px 5px;
}

.roll-dice-style-card .dice-style-preview::before,
.roll-dice-style-card .dice-style-preview::after {
  inset: 2px 4px;
}

.roll-dice-style-trigger .dice-style-preview .facet,
.roll-dice-style-card .dice-style-preview .facet {
  height: 17px;
  width: 18px;
}

.roll-dice-style-trigger .dice-style-preview .facet-top,
.roll-dice-style-card .dice-style-preview .facet-top {
  left: 17px;
  top: 8px;
}

.roll-dice-style-trigger .dice-style-preview .facet-left,
.roll-dice-style-card .dice-style-preview .facet-left {
  left: 9px;
  top: 22px;
}

.roll-dice-style-trigger .dice-style-preview .facet-right,
.roll-dice-style-card .dice-style-preview .facet-right {
  right: 9px;
  top: 22px;
}

.roll-dice-style-trigger .dice-style-preview .facet-bottom,
.roll-dice-style-card .dice-style-preview .facet-bottom {
  bottom: 8px;
  left: 17px;
}

.roll-dice-style-trigger .dice-style-preview b,
.roll-dice-style-card .dice-style-preview b {
  font-size: 17px;
}

.roll-dice-style-trigger .dice-style-preview.has-rendered-model::before,
.roll-dice-style-card .dice-style-preview.has-rendered-model::before {
  inset: -7px -9px;
}

.roll-dice-style-card .dice-style-preview.has-rendered-model::before {
  inset: -3px -5px;
}

.roll-dice-style-trigger .dice-style-preview.has-rendered-model b,
.roll-dice-style-card .dice-style-preview.has-rendered-model b {
  font-size: 18px;
}

.roll-dice-style-trigger .dice-style-preview em,
.roll-dice-style-card .dice-style-preview em {
  bottom: 13px;
  transform: scale(.72);
}

.roll-dice-style-trigger > strong {
  align-self: end;
  grid-column: 2;
  grid-row: 1;
  font-size: 13px;
  font-weight: 950;
  line-height: 1.1;
  min-width: 0;
  overflow-wrap: normal;
}

.roll-dice-style-trigger > .dice-style-tag {
  align-self: start;
  grid-column: 2;
  grid-row: 2;
  min-width: 0;
}

.roll-dice-style-action {
  align-self: center;
  background:
    linear-gradient(180deg, rgba(255, 218, 151, 0.24), rgba(216, 157, 74, 0.14));
  border: 1px solid rgba(216, 157, 74, 0.68);
  border-radius: 6px;
  box-shadow:
    0 5px 12px rgba(0, 0, 0, 0.22),
    inset 0 1px 0 rgba(255, 250, 242, 0.16);
  color: #ffe8b8;
  font-size: 11px;
  font-weight: 950;
  grid-column: 3;
  grid-row: 1 / span 2;
  justify-self: end;
  line-height: 1;
  padding: 7px 9px;
  text-transform: uppercase;
  white-space: nowrap;
}

.roll-dice-style-menu {
  display: none;
  gap: 6px;
  grid-template-columns: 1fr;
  max-height: min(310px, 42dvh);
  overflow-y: auto;
  padding-right: 2px;
}

.roll-dice-style-group.open .roll-dice-style-menu {
  display: grid;
}

.roll-dice-style-card {
  align-items: center;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.105), rgba(255, 250, 242, 0.045));
  border: 1px solid rgba(226, 195, 151, 0.3);
  border-radius: 8px;
  box-shadow:
    0 8px 16px rgba(0, 0, 0, 0.2),
    inset 0 1px 0 rgba(255, 250, 242, 0.08);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  gap: 8px;
  grid-template-columns: 44px minmax(0, 1fr) max-content;
  grid-template-rows: auto auto;
  min-height: 58px;
  overflow: hidden;
  padding: 7px;
  text-align: left;
  transition: background .14s ease, border-color .14s ease, box-shadow .14s ease, transform .14s ease;
}

.roll-dice-style-card:hover,
.roll-dice-style-card.active {
  background:
    linear-gradient(180deg, rgba(var(--accent-rgb), 0.21), rgba(var(--accent-rgb), 0.08));
  border-color: rgba(216, 157, 74, 0.58);
  box-shadow:
    0 10px 20px rgba(0, 0, 0, 0.24),
    0 0 0 1px rgba(var(--accent-rgb), 0.14),
    inset 0 1px 0 rgba(255, 250, 242, 0.11);
  transform: translateY(-1px);
}

.roll-dice-style-card-body {
  align-content: center;
  display: grid;
  gap: 3px;
  grid-column: 2;
  grid-row: 1 / span 2;
  min-width: 0;
}

.roll-dice-style-card strong {
  font-size: 12px;
  font-weight: 950;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.roll-dice-style-card-action {
  align-self: center;
  background: rgba(216, 157, 74, 0.14);
  border: 1px solid rgba(216, 157, 74, 0.42);
  border-radius: 6px;
  color: #ffe8b8;
  display: inline-flex;
  font-size: 9px;
  font-weight: 950;
  grid-column: 3;
  grid-row: 1 / span 2;
  height: 24px;
  align-items: center;
  justify-content: center;
  justify-self: end;
  line-height: 1;
  padding: 6px 7px;
  text-transform: uppercase;
  white-space: nowrap;
}

.roll-action {
  justify-self: stretch;
  min-height: 46px;
  position: relative;
  z-index: 1;
}

.roll-overlay.has-inline-result .roll-breakdown,
.roll-overlay.has-inline-result .roll-result,
.roll-overlay.has-inline-result .roll-options,
.roll-overlay.has-inline-result .roll-action {
  display: none;
}

.roll-inline-result {
  position: relative;
  z-index: 1;
}

.roll-inline-card {
  background: rgba(16, 11, 14, 0.84);
  border: 1px solid rgba(226, 195, 151, 0.48);
  border-radius: 8px;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38), inset 0 0 0 1px rgba(255, 250, 242, 0.06);
  color: var(--ink);
  display: grid;
  gap: 10px;
  opacity: 0;
  padding: 14px 16px 15px;
  text-align: center;
  transform: translateY(10px) scale(.97);
}

.roll-overlay.is-settled .roll-inline-card {
  animation: rollInlineResultIn .22s cubic-bezier(.18, .9, .22, 1.08) .08s both;
}

.roll-inline-card.critical {
  background:
    linear-gradient(145deg, rgba(37, 29, 13, 0.96), rgba(16, 11, 14, 0.88)),
    rgba(16, 11, 14, 0.84);
  border-color: rgba(255, 218, 128, 0.8);
  box-shadow:
    0 22px 62px rgba(0, 0, 0, 0.48),
    0 0 44px rgba(255, 194, 74, 0.22),
    inset 0 0 0 1px rgba(255, 250, 242, 0.08);
}

.roll-inline-card.fumble {
  background:
    linear-gradient(145deg, rgba(60, 9, 17, 0.96), rgba(17, 9, 13, 0.9)),
    rgba(16, 11, 14, 0.84);
  border-color: rgba(255, 82, 92, 0.86);
  box-shadow:
    0 22px 62px rgba(0, 0, 0, 0.5),
    0 0 46px rgba(255, 48, 67, 0.28),
    inset 0 0 0 1px rgba(255, 196, 196, 0.08);
}

.roll-inline-card .dice-tray-result-banner {
  margin-right: 0;
}

.roll-inline-card .dice-tray-result-heading {
  padding-right: 0;
}

.roll-result {
  align-content: center;
  display: grid;
  gap: 4px;
  justify-items: center;
  min-height: 68px;
  opacity: 0;
  position: relative;
  transform: translateY(8px) scale(.96);
  transition: opacity .18s ease, transform .22s ease;
  z-index: 1;
}

.roll-overlay.is-settled .roll-result {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.roll-result span {
  color: var(--gold);
  font-size: 12px;
  font-weight: 950;
  text-transform: uppercase;
}

.roll-result strong {
  color: #fff4d7;
  font-size: clamp(48px, 12vw, 76px);
  font-weight: 950;
  line-height: .88;
  text-shadow: 0 0 18px rgba(216, 157, 74, 0.34), 0 4px 16px rgba(0, 0, 0, 0.52);
}

.roll-overlay.critical .roll-panel {
  border-color: rgba(255, 221, 139, 0.86);
  box-shadow: 0 30px 96px rgba(0, 0, 0, 0.66), 0 0 54px rgba(216, 157, 74, 0.3);
}

.roll-overlay.critical .roll-result strong,
.roll-overlay.critical .roll-result span {
  color: #ffdd8b;
}

.roll-overlay.fumble .roll-panel {
  border-color: rgba(216, 88, 82, 0.72);
}

.roll-overlay.fumble .roll-die-face {
  filter:
    drop-shadow(0 22px 28px rgba(0, 0, 0, 0.54))
    drop-shadow(0 0 30px rgba(255, 82, 92, 0.46));
}

.roll-overlay.fumble .roll-result strong,
.roll-overlay.fumble .roll-result span {
  color: #ffaaa3;
}

.dice-tray-overlay {
  display: grid;
  inset: 0;
  isolation: isolate;
  overflow: hidden;
  pointer-events: none;
  position: fixed;
  z-index: 9990;
}

.dice-tray-canvas,
.dice-tray-surface {
  height: 100%;
  inset: 0;
  position: absolute;
  width: 100%;
}

.dice-tray-canvas {
  opacity: 0;
  transition: filter .68s ease, opacity .72s ease;
  z-index: 1;
}

.dice-tray-overlay.is-live .dice-tray-canvas {
  opacity: 1;
}

.dice-tray-surface {
  background:
    linear-gradient(180deg, rgba(255, 250, 242, 0.04), rgba(8, 5, 8, 0.13)),
    linear-gradient(90deg, transparent 0 18%, rgba(255, 250, 242, 0.04) 18% 18.35%, transparent 18.35% 100%);
  background-size: auto, 86px 86px;
  opacity: 0;
  transition: opacity .18s ease;
  z-index: 0;
}

.dice-tray-overlay.is-live .dice-tray-surface {
  opacity: .66;
}

.dice-tray-overlay.dice-tray-vanishing .dice-tray-canvas {
  filter: saturate(1.28) drop-shadow(0 0 22px rgba(255, 221, 139, 0.28));
}

.dice-tray-result {
  --dice-tray-result-x: 0px;
  --dice-tray-result-y: 0px;
  background: rgba(16, 11, 14, 0.84);
  border: 1px solid rgba(226, 195, 151, 0.48);
  border-radius: 8px;
  bottom: max(22px, env(safe-area-inset-bottom));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.46), inset 0 0 0 1px rgba(255, 250, 242, 0.06);
  color: var(--ink);
  display: grid;
  gap: 10px;
  left: 50%;
  margin: 0;
  max-width: calc(100vw - 36px);
  opacity: 0;
  padding: 14px 16px 15px;
  pointer-events: auto;
  position: fixed;
  text-align: center;
  transform: translate(calc(-50% + var(--dice-tray-result-x)), calc(14px + var(--dice-tray-result-y))) scale(.97);
  transition: opacity .18s ease, transform .22s cubic-bezier(.18, .9, .22, 1.08);
  width: min(430px, calc(100vw - 36px));
  z-index: 3;
}

.dice-tray-result.is-draggable {
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.dice-tray-result.is-dragging {
  cursor: grabbing;
  transition: opacity .18s ease;
}

.dice-tray-result.critical {
  background:
    linear-gradient(145deg, rgba(37, 29, 13, 0.96), rgba(16, 11, 14, 0.88)),
    rgba(16, 11, 14, 0.84);
  border-color: rgba(255, 218, 128, 0.8);
  box-shadow:
    0 22px 62px rgba(0, 0, 0, 0.54),
    0 0 44px rgba(255, 194, 74, 0.22),
    inset 0 0 0 1px rgba(255, 250, 242, 0.08);
}

.dice-tray-result.fumble {
  background:
    linear-gradient(145deg, rgba(60, 9, 17, 0.96), rgba(17, 9, 13, 0.9)),
    rgba(16, 11, 14, 0.84);
  border-color: rgba(255, 82, 92, 0.86);
  box-shadow:
    0 22px 62px rgba(0, 0, 0, 0.58),
    0 0 46px rgba(255, 48, 67, 0.28),
    inset 0 0 0 1px rgba(255, 196, 196, 0.08);
}

.dice-tray-overlay.is-settled .dice-tray-result {
  opacity: 1;
  transform: translate(calc(-50% + var(--dice-tray-result-x)), var(--dice-tray-result-y)) scale(1);
}

.dice-tray-overlay.dice-tray-result-dismissed .dice-tray-result {
  opacity: 0;
  pointer-events: none;
  transform: translate(calc(-50% + var(--dice-tray-result-x)), calc(10px + var(--dice-tray-result-y))) scale(.98);
  transition: opacity .08s ease, transform .12s ease;
}

.dice-tray-overlay.dice-tray-result-hover-held .dice-tray-result {
  opacity: 1;
  pointer-events: auto;
  transform: translate(calc(-50% + var(--dice-tray-result-x)), var(--dice-tray-result-y)) scale(1);
}

.dice-tray-dismiss {
  align-items: center;
  background: rgba(255, 244, 215, 0.16);
  border: 1px solid rgba(255, 244, 215, 0.46);
  border-radius: 7px;
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.32), inset 0 0 0 1px rgba(255, 250, 242, 0.08);
  color: #fff4d7;
  cursor: pointer;
  display: inline-flex;
  gap: 8px;
  font-size: 11px;
  font-weight: 950;
  height: 34px;
  justify-content: center;
  line-height: 1;
  padding: 0 7px 0 11px;
  position: absolute;
  right: 10px;
  text-transform: uppercase;
  top: 10px;
}

.dice-tray-dismiss:hover,
.dice-tray-dismiss:focus-visible {
  background: rgba(216, 157, 74, 0.32);
  border-color: rgba(255, 228, 166, 0.78);
  color: #fff4d7;
  outline: none;
}

.dice-tray-dismiss b {
  align-items: center;
  background: rgba(255, 250, 242, 0.12);
  border: 1px solid rgba(255, 250, 242, 0.26);
  border-radius: 5px;
  display: inline-grid;
  font-size: 13px;
  height: 22px;
  place-items: center;
  width: 22px;
}

.dice-tray-result-banner {
  border-radius: 7px;
  color: #fff4d7;
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0;
  line-height: 1;
  margin-right: 104px;
  padding: 8px 10px;
  text-align: left;
  text-transform: uppercase;
}

.dice-tray-result.critical .dice-tray-result-banner,
.roll-inline-card.critical .dice-tray-result-banner {
  background: rgba(255, 194, 74, 0.18);
  border: 1px solid rgba(255, 220, 142, 0.44);
  color: #ffe6a5;
  text-shadow: 0 0 18px rgba(255, 194, 74, 0.38);
}

.dice-tray-result.fumble .dice-tray-result-banner,
.roll-inline-card.fumble .dice-tray-result-banner {
  background: rgba(255, 48, 67, 0.24);
  border: 1px solid rgba(255, 104, 113, 0.52);
  color: #ffd7d7;
  text-shadow: 0 0 18px rgba(255, 48, 67, 0.42);
}

.dice-tray-result-heading {
  display: grid;
  gap: 3px;
  padding-right: 108px;
  text-align: left;
}

.dice-tray-result-heading span,
.dice-tray-result-heading em,
.dice-tray-score small,
.dice-tray-score b,
.dice-tray-breakdown dt,
.dice-tray-breakdown dd,
.dice-tray-breakdown small {
  font-weight: 950;
  line-height: 1.1;
}

.dice-tray-result-heading span {
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
}

.dice-tray-result-heading em {
  color: var(--muted);
  font-size: 11px;
  font-style: normal;
  overflow-wrap: anywhere;
}

.dice-tray-score {
  align-items: end;
  display: grid;
  gap: 2px 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  text-align: left;
}

.dice-tray-score small {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.dice-tray-score strong {
  color: #fff4d7;
  font-size: clamp(52px, 12vw, 82px);
  font-weight: 950;
  grid-row: span 2;
  line-height: .9;
  text-shadow: 0 0 18px rgba(216, 157, 74, 0.28), 0 4px 16px rgba(0, 0, 0, 0.52);
}

.dice-tray-result.critical .dice-tray-score small,
.dice-tray-result.critical .dice-tray-score b,
.dice-tray-result.critical .dice-tray-breakdown .tone-total dt,
.dice-tray-result.critical .dice-tray-breakdown .tone-total dd,
.roll-inline-card.critical .dice-tray-score small,
.roll-inline-card.critical .dice-tray-score b,
.roll-inline-card.critical .dice-tray-breakdown .tone-total dt,
.roll-inline-card.critical .dice-tray-breakdown .tone-total dd {
  color: #ffd56f;
}

.dice-tray-result.critical .dice-tray-score strong,
.roll-inline-card.critical .dice-tray-score strong {
  color: #fff0bc;
  text-shadow:
    0 0 16px rgba(255, 213, 111, 0.62),
    0 0 34px rgba(255, 194, 74, 0.32),
    0 4px 16px rgba(0, 0, 0, 0.56);
}

.dice-tray-result.fumble .dice-tray-score small,
.dice-tray-result.fumble .dice-tray-score b,
.dice-tray-result.fumble .dice-tray-breakdown .tone-total dt,
.dice-tray-result.fumble .dice-tray-breakdown .tone-total dd,
.roll-inline-card.fumble .dice-tray-score small,
.roll-inline-card.fumble .dice-tray-score b,
.roll-inline-card.fumble .dice-tray-breakdown .tone-total dt,
.roll-inline-card.fumble .dice-tray-breakdown .tone-total dd {
  color: #ff8790;
}

.dice-tray-result.fumble .dice-tray-score strong,
.roll-inline-card.fumble .dice-tray-score strong {
  color: #ffe1e1;
  text-shadow:
    0 0 16px rgba(255, 82, 92, 0.72),
    0 0 38px rgba(255, 48, 67, 0.38),
    0 4px 16px rgba(0, 0, 0, 0.58);
}

.dice-tray-score b {
  color: var(--muted-strong);
  font-size: 13px;
}

.dice-tray-equation {
  background: rgba(255, 244, 215, 0.06);
  border: 1px solid rgba(226, 195, 151, 0.2);
  border-radius: 7px;
  color: #fff4d7;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.25;
  margin: 0;
  overflow-wrap: anywhere;
  padding: 7px 9px;
  text-align: left;
}

.dice-tray-result.critical .dice-tray-equation,
.roll-inline-card.critical .dice-tray-equation {
  background: rgba(255, 194, 74, 0.1);
  border-color: rgba(255, 220, 142, 0.32);
}

.dice-tray-result.fumble .dice-tray-equation,
.roll-inline-card.fumble .dice-tray-equation {
  background: rgba(255, 48, 67, 0.12);
  border-color: rgba(255, 104, 113, 0.34);
}

.dice-tray-breakdown {
  display: grid;
  gap: 5px;
  margin: 0;
}

.dice-tray-breakdown div {
  align-items: center;
  border-top: 1px solid rgba(226, 195, 151, 0.14);
  display: grid;
  gap: 2px 8px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding-top: 5px;
  text-align: left;
}

.dice-tray-breakdown dt {
  color: var(--ink);
  font-size: 12px;
  overflow-wrap: anywhere;
}

.dice-tray-breakdown dd {
  color: #fff4d7;
  font-size: 14px;
  margin: 0;
}

.dice-tray-breakdown small {
  color: var(--muted);
  font-size: 11px;
  grid-column: 1 / -1;
  overflow-wrap: anywhere;
}

.dice-tray-breakdown .tone-muted {
  opacity: .58;
}

.dice-tray-breakdown .tone-bonus dd {
  color: #ffe1a1;
}

.dice-tray-breakdown .tone-total {
  border-color: rgba(216, 157, 74, 0.4);
}

.dice-tray-breakdown .tone-total dt,
.dice-tray-breakdown .tone-total dd {
  color: var(--gold);
}

.dice-tray-result-actions {
  display: flex;
  gap: 8px;
  justify-content: stretch;
}

.dice-tray-roll-again,
.dice-tray-roll-dismiss {
  appearance: none;
  border-radius: 7px;
  cursor: pointer;
  flex: 1;
  font-size: 12px;
  font-weight: 950;
  min-height: 38px;
  padding: 10px 12px;
  text-transform: uppercase;
  transition: background .14s ease, border-color .14s ease, transform .14s ease;
}

.dice-tray-roll-again {
  background:
    linear-gradient(180deg, rgba(255, 218, 151, 0.28), rgba(216, 157, 74, 0.16));
  border: 1px solid rgba(255, 218, 128, 0.72);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 250, 242, 0.14);
  color: #fff4d7;
}

.dice-tray-roll-dismiss {
  background: rgba(255, 250, 242, 0.08);
  border: 1px solid rgba(255, 250, 242, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 250, 242, 0.08);
  color: var(--muted-strong);
}

.dice-tray-roll-again:hover,
.dice-tray-roll-again:focus-visible {
  background:
    linear-gradient(180deg, rgba(255, 218, 151, 0.38), rgba(216, 157, 74, 0.22));
  border-color: rgba(255, 232, 184, 0.92);
  outline: none;
}

.dice-tray-roll-dismiss:hover,
.dice-tray-roll-dismiss:focus-visible {
  background: rgba(255, 250, 242, 0.13);
  border-color: rgba(255, 250, 242, 0.42);
  color: #fff4d7;
  outline: none;
}

.dice-tray-roll-again:active,
.dice-tray-roll-dismiss:active {
  transform: translateY(1px);
}

.dice-tray-overlay.is-closing .dice-tray-canvas,
.dice-tray-overlay.is-closing .dice-tray-surface,
.dice-tray-overlay.is-closing .dice-tray-result {
  opacity: 0;
}

.dice-tray-overlay.dice-tray-dice-done .dice-tray-canvas {
  filter: blur(8px);
}

.dice-tray-overlay.dice-tray-dice-done .dice-tray-canvas,
.dice-tray-overlay.dice-tray-dice-done .dice-tray-surface {
  opacity: 0;
}

.dice-tray-overlay.is-closing .dice-tray-result {
  transform: translate(calc(-50% + var(--dice-tray-result-x)), calc(10px + var(--dice-tray-result-y))) scale(.98);
}

.toast {
  background: #1b151a;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  bottom: 18px;
  box-shadow: var(--shadow);
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
  max-width: min(420px, calc(100vw - 32px));
  padding: 11px 13px;
  position: fixed;
  right: 18px;
  z-index: 1000;
}

.toast.error {
  background: var(--danger);
  border-color: var(--danger);
}

.install-guide {
  align-items: center;
  display: grid;
  inset: 0;
  justify-items: center;
  padding: 20px;
  position: fixed;
  z-index: 1200;
}

.install-guide-backdrop {
  background: rgba(8, 5, 8, 0.74);
  inset: 0;
  position: absolute;
}

.install-guide-panel {
  background: #1b151a;
  border: 1px solid var(--line-dark);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  max-width: 430px;
  padding: 18px;
  position: relative;
  width: min(100%, 430px);
}

.install-guide-panel .icon-btn {
  position: absolute;
  right: 12px;
  top: 12px;
}

.install-guide-panel h2 {
  font-size: 24px;
  font-weight: 950;
  line-height: 1.1;
  padding-right: 42px;
}

.install-guide-panel p {
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.45;
}

.install-steps {
  counter-reset: install-step;
  display: grid;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.install-steps li {
  align-items: start;
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 10px;
  grid-template-columns: 28px minmax(0, 1fr);
  line-height: 1.35;
  padding: 10px;
}

.install-steps li::before {
  align-items: center;
  background: rgba(var(--accent-rgb), 0.22);
  border: 1px solid rgba(var(--accent-rgb), 0.5);
  border-radius: 999px;
  color: var(--ink);
  content: counter(install-step);
  counter-increment: install-step;
  display: inline-flex;
  font-size: 12px;
  font-weight: 950;
  height: 28px;
  justify-content: center;
  width: 28px;
}

.install-guide-actions {
  display: flex;
  justify-content: end;
}

.hidden { display: none !important; }

@keyframes spin {
  to { transform: rotate(360deg); }
}

@keyframes portalLoadingMark {
  to { transform: rotate(360deg); }
}

@keyframes portalLoadingSheen {
  to { transform: translateX(100%); }
}

@keyframes sheetPageInNext {
  from {
    opacity: .72;
    transform: translateX(18px) scale(.992);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes sheetPageInPrev {
  from {
    opacity: .72;
    transform: translateX(-18px) scale(.992);
  }
  to {
    opacity: 1;
    transform: translateX(0) scale(1);
  }
}

@keyframes rollPanelIn {
  from {
    opacity: 0;
    transform: translateY(12px) scale(.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes rollPanelOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
  to {
    opacity: 0;
    transform: translateY(8px) scale(.97);
  }
}

@keyframes rollSigilSpin {
  to { transform: rotate(360deg); }
}

@keyframes rollDieHop {
  0%, 100% { transform: translate(0, 3px) rotate(-1deg) scale(.99); }
  25% { transform: translate(-4px, -4px) rotate(-4deg) scale(1.02); }
  50% { transform: translate(3px, -7px) rotate(3deg) scale(1.04); }
  75% { transform: translate(4px, -2px) rotate(5deg) scale(1.01); }
}

@keyframes rollDieTumble {
  0% { opacity: 1; transform: rotateZ(-14deg) scale(1); }
  20% { opacity: 1; transform: rotateZ(74deg) scale(1.07); }
  48% { opacity: 1; transform: rotateZ(418deg) scale(1.02); }
  76% { opacity: .88; transform: rotateZ(1120deg) scale(.9); }
  100% { opacity: 0; transform: rotateZ(1840deg) scale(.36); }
}

@keyframes rollDieImageRush {
  0% { filter: blur(0) saturate(1); opacity: 1; }
  42% { filter: blur(.5px) saturate(1.22); opacity: 1; }
  74% { filter: blur(2.4px) saturate(1.48); opacity: .82; }
  100% { filter: blur(8px) saturate(1.8); opacity: 0; }
}

@keyframes rollDieLand {
  0% { transform: translateY(-9px) rotateZ(-14deg) scale(1.08); }
  65% { transform: translateY(2px) rotateZ(5deg) scale(.97); }
  100% { transform: translateY(0) rotateZ(0) scale(1); }
}

@keyframes rollStageScoreIn {
  0% { opacity: 0; transform: scale(.36); }
  62% { opacity: 1; transform: scale(1.16); }
  100% { opacity: 1; transform: scale(1); }
}

@keyframes rollInlineResultIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  .portal-loading-screen,
  .portal-loading-mark::after,
  .portal-loading-track i,
  .portal-loading-track i::after,
  .rollable-card,
  .roll-panel,
  .roll-flare,
  .roll-die-shell,
  .roll-die-face,
  .roll-die-art,
  .roll-stage-score,
  .roll-inline-card,
  .roll-result,
  .dice-tray-canvas,
  .dice-tray-surface,
  .dice-tray-result,
  .world-atlas-map-frame::before,
  .world-atlas-stage::before,
  .battle-map-fab::before {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 1220px) {
  :root {
    --portal-sidebar-width: 270px;
  }

  .portal-shell {
    grid-template-columns: var(--portal-active-sidebar-width) minmax(0, 1fr);
  }

  .panel-scroll-rail {
    --panel-scroll-sidebar: 270px;
  }

  .sheet-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .hero-side {
    grid-column: 1 / -1;
    padding-left: 0;
  }

  .ability-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .initiative-row {
    grid-template-columns: 40px minmax(0, 1fr) repeat(3, minmax(58px, 1fr));
  }

  .link-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .detail-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1120px) and (min-width: 921px) {
  .creation-wizard-body {
    align-content: start;
    gap: 14px;
    grid-template-areas:
      "steps"
      "main"
      "preview";
    grid-template-columns: minmax(0, 1fr);
    grid-template-rows: auto auto auto;
  }

  .creation-stepper {
    display: flex;
    grid-area: steps;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    padding-right: 0;
    position: static;
  }

  .creation-step-tab {
    flex: 0 0 122px;
    min-height: 50px;
    min-width: 122px;
  }

  .creation-step-content {
    grid-area: main;
  }

  .creation-benefit-panel {
    grid-area: preview;
    grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  }
}

@media (max-width: 920px) {
  .sidebar-toggle {
    display: none;
  }

  .portal-shell {
    display: block;
    padding-bottom: calc(72px + env(safe-area-inset-bottom));
  }

  .play-sheet {
    padding-bottom: 14px;
  }

  .sheet-page.codex-page {
    min-height: calc(100dvh - 86px - env(safe-area-inset-bottom));
    padding-bottom: clamp(28px, 7vh, 70px);
    padding-top: clamp(24px, 6vh, 58px);
  }

  .character-sidebar > .field.compact,
  #characterRoster,
  #characterRail,
  #vendorShelf,
  #vehicleShelf,
  #sidebarResourceHub {
    display: none;
  }

  .character-sidebar {
    display: none;
  }

  body.install-prompt-visible .character-sidebar {
    align-self: stretch;
    border-bottom: 1px solid var(--line-dark);
    border-right: 0;
    display: flex;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    position: static;
  }

  body.install-prompt-visible .character-sidebar .brand {
    display: none;
  }

  body.install-prompt-visible .sidebar-footer {
    margin-top: 0;
  }

  .hero-copy {
    padding-right: 48px;
  }

  .mobile-hero-bar {
    align-items: end;
    background:
      linear-gradient(180deg, rgba(18, 13, 17, 0), rgba(18, 13, 17, 0.93) 30%, rgba(18, 13, 17, 0.98)),
      #120d11;
    backdrop-filter: blur(18px);
    border: 0;
    border-top: 1px solid rgba(255, 250, 242, 0.11);
    border-radius: 0;
    bottom: 0;
    box-shadow: 0 -18px 38px rgba(0, 0, 0, 0.42);
    display: grid;
    gap: 7px;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    left: 0;
    padding: 7px max(12px, env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(12px, env(safe-area-inset-left));
    position: fixed;
    right: 0;
    touch-action: manipulation;
    transform: none;
    width: 100%;
    z-index: 860;
  }

  .mobile-hero-action {
    align-items: center;
    appearance: none;
    background:
      linear-gradient(180deg, rgba(255, 250, 242, 0.075), rgba(255, 250, 242, 0.035)),
      rgba(255, 250, 242, 0.04);
    border: 1px solid rgba(255, 250, 242, 0.11);
    border-radius: 8px;
    box-shadow: inset 0 1px 0 rgba(255, 250, 242, 0.08);
    color: #fffaf2;
    cursor: pointer;
    display: grid;
    gap: 2px;
    grid-template-rows: 20px auto;
    min-height: 48px;
    min-width: 0;
    padding: 6px 7px 5px;
    place-items: center;
    position: relative;
    text-align: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    -webkit-user-select: none;
    user-select: none;
  }

  .mobile-hero-action::before {
    background: transparent;
    border-radius: 3px;
    content: "";
    height: 3px;
    left: 50%;
    opacity: 0;
    position: absolute;
    bottom: 3px;
    transform: translateX(-50%);
    width: 20px;
  }

  .mobile-hero-icon {
    color: rgba(255, 250, 242, 0.78);
    display: block;
    fill: none;
    height: 19px;
    stroke: currentColor;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-width: 2;
    width: 19px;
  }

  .mobile-hero-action .mobile-hero-label {
    color: rgba(255, 250, 242, 0.62);
    font-size: 8px;
    font-weight: 950;
    line-height: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    white-space: nowrap;
    width: 100%;
  }

  .mobile-hero-action strong {
    align-items: center;
    background: rgba(255, 250, 242, 0.09);
    border: 1px solid rgba(255, 250, 242, 0.12);
    border-radius: 7px;
    color: #fffaf2;
    display: inline-flex;
    font-size: 11px;
    font-weight: 950;
    height: 18px;
    justify-content: center;
    line-height: 1;
    min-width: 22px;
    padding: 0 6px;
    position: absolute;
    right: 8px;
    top: 5px;
  }

  .mobile-hero-action[data-mobile-codex] strong {
    display: none;
  }

  .mobile-hero-action[data-mobile-codex].has-notification strong:not(.hidden) {
    background: #d5283f;
    border: 2px solid rgba(255, 244, 224, 0.92);
    border-radius: 999px;
    box-shadow: 0 7px 15px rgba(0, 0, 0, 0.34), 0 0 0 2px rgba(213, 40, 63, 0.18);
    color: #fffaf0;
    display: inline-flex;
    font-size: 10px;
    height: 20px;
    min-width: 20px;
    padding: 0 5px;
    right: 7px;
    top: 4px;
  }

  .mobile-hero-action.active,
  .mobile-hero-action:focus-visible {
    background:
      linear-gradient(180deg, rgba(var(--accent-rgb), 0.24), rgba(var(--accent-rgb), 0.08)),
      rgba(255, 250, 242, 0.055);
    border-color: rgba(216, 157, 74, 0.48);
    outline: none;
  }

  .mobile-hero-action[data-mobile-drawer="characters"].active,
  .mobile-hero-action[data-mobile-drawer="characters"]:focus-visible {
    background:
      linear-gradient(180deg, rgba(var(--accent-rgb), 0.42), rgba(216, 157, 74, 0.12)),
      rgba(255, 250, 242, 0.075);
    border-color: rgba(255, 209, 128, 0.68);
  }

  .mobile-hero-action.active .mobile-hero-icon,
  .mobile-hero-action:focus-visible .mobile-hero-icon {
    color: #fff5cf;
  }

  .mobile-hero-action.active::before,
  .mobile-hero-action:focus-visible::before {
    background: var(--gold);
    opacity: 1;
  }

  .mobile-hero-action:disabled {
    cursor: not-allowed;
    opacity: 0.42;
  }

  .mobile-hero-drawer {
    align-items: end;
    display: grid;
    inset: 0;
    padding: max(12px, env(safe-area-inset-top)) 0 calc(66px + env(safe-area-inset-bottom));
    position: fixed;
    z-index: 840;
  }

  .mobile-hero-drawer-backdrop {
    background: rgba(0, 0, 0, 0.42);
    inset: 0;
    position: absolute;
  }

  .mobile-hero-drawer-panel {
    background:
      linear-gradient(180deg, rgba(var(--accent-rgb), 0.12), transparent 36%),
      rgba(20, 15, 18, 0.98);
    border: 1px solid rgba(255, 250, 242, 0.17);
    border-bottom: 0;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 -22px 56px rgba(0, 0, 0, 0.5);
    display: grid;
    grid-template-rows: auto minmax(0, 1fr);
    justify-self: center;
    max-height: min(72dvh, 660px);
    overflow: hidden;
    position: relative;
    width: min(100%, 560px);
  }

  .mobile-hero-drawer-head {
    align-items: center;
    border-bottom: 1px solid rgba(255, 250, 242, 0.12);
    display: flex;
    gap: 12px;
    justify-content: space-between;
    padding: 12px;
  }

  .mobile-hero-drawer-head h2 {
    font-size: 20px;
    font-weight: 950;
    line-height: 1.1;
  }

  .mobile-hero-drawer-body {
    display: grid;
    gap: 8px;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px 12px 12px;
  }

  .mobile-drawer-card-stack {
    display: grid;
    gap: 8px;
    min-width: 0;
  }

  .mobile-drawer-card-stack.character-priority-list {
    grid-auto-flow: row;
    overflow: visible;
  }

  .mobile-drawer-card-stack.character-strip,
  .mobile-character-owner-list {
    grid-auto-columns: minmax(228px, 82vw);
    grid-auto-flow: column;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 3px;
    scroll-snap-type: x proximity;
  }

  .mobile-character-owner-group {
    background: rgba(255, 250, 242, 0.045);
    border: 1px solid rgba(255, 250, 242, 0.08);
    border-radius: 8px;
    padding: 10px;
  }

  .mobile-character-card {
    align-items: center;
    appearance: none;
    background:
      linear-gradient(135deg, rgba(var(--accent-rgb), 0.12), transparent 54%),
      rgba(255, 250, 242, 0.07);
    border: 1px solid rgba(255, 250, 242, 0.13);
    border-radius: 8px;
    color: #fffaf2;
    cursor: pointer;
    display: grid;
    gap: 10px;
    grid-template-columns: 54px minmax(0, 1fr);
    min-height: 88px;
    min-width: 0;
    padding: 10px;
    position: relative;
    scroll-snap-align: start;
    text-align: left;
    width: 100%;
  }

  .mobile-character-card.active,
  .mobile-character-card:hover,
  .mobile-character-card:focus-visible {
    background:
      linear-gradient(135deg, rgba(var(--accent-rgb), 0.25), rgba(216, 157, 74, 0.08)),
      rgba(255, 250, 242, 0.09);
    border-color: rgba(216, 157, 74, 0.52);
    outline: none;
  }

  .mobile-character-card.discord-active {
    box-shadow: inset 0 0 0 1px rgba(85, 184, 120, 0.45);
  }

  .mobile-character-card.is-working {
    opacity: 0.72;
    pointer-events: none;
  }

  .mobile-character-avatar {
    background: rgba(0, 0, 0, 0.24);
    border: 1px solid rgba(255, 250, 242, 0.18);
    border-radius: 8px;
    height: 54px;
    object-fit: cover;
    width: 54px;
  }

  .mobile-character-avatar.avatar-shape-circle {
    border-radius: 50%;
  }

  .mobile-character-avatar.fallback {
    align-items: center;
    color: var(--gold);
    display: inline-flex;
    font-size: 24px;
    font-weight: 950;
    justify-content: center;
  }

  .mobile-character-copy {
    display: grid;
    gap: 3px;
    min-width: 0;
  }

  .mobile-character-copy strong,
  .mobile-character-copy em,
  .mobile-character-copy small,
  .mobile-character-server {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-character-copy strong {
    font-size: 15px;
    font-weight: 950;
    line-height: 1.1;
  }

  .mobile-character-copy em,
  .mobile-character-copy small,
  .mobile-character-server {
    color: rgba(255, 250, 242, 0.64);
    font-size: 11px;
    font-style: normal;
    font-weight: 760;
    line-height: 1.2;
  }

  .mobile-character-server {
    background: rgba(255, 250, 242, 0.07);
    border: 1px solid rgba(255, 250, 242, 0.1);
    border-radius: 999px;
    grid-column: 1 / -1;
    justify-self: start;
    max-width: 100%;
    padding: 4px 8px;
  }

  .mobile-character-card.pending-card {
    border-color: rgba(216, 157, 74, 0.42);
    cursor: default;
  }

  .mobile-character-card.editable-pending-card {
    cursor: pointer;
  }

  .mobile-character-card.rejected-pending-card {
    border-color: rgba(216, 88, 82, 0.58);
  }

  .mobile-hero-drawer .character-owner-group {
    display: grid;
  }

  .mobile-hero-drawer .character-card {
    min-height: 70px;
  }

  .mobile-hero-drawer .character-card.create-card {
    align-items: center;
    column-gap: 10px;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 66px;
  }

  .mobile-hero-drawer .character-card.create-card strong {
    grid-row: 1 / 3;
    height: 32px;
    width: 32px;
  }

  .support-widget {
    bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .battle-map-shortcut:not(.hidden) {
    bottom: calc(68px + env(safe-area-inset-bottom));
    display: grid;
    left: calc(14px + env(safe-area-inset-left));
  }

  .hero-settings {
    display: block;
    position: absolute;
    right: 10px;
    top: 10px;
    z-index: 6;
  }

  .vendor-mode .hero-settings,
  .vehicle-mode .hero-settings,
  .codex-mode .hero-settings {
    display: none;
  }

  .hero-settings-button {
    align-items: center;
    appearance: none;
    background: rgba(255, 250, 242, 0.14);
    border: 1px solid rgba(255, 250, 242, 0.24);
    border-radius: 999px;
    color: #fffaf2;
    cursor: pointer;
    display: inline-flex;
    font-size: 17px;
    font-weight: 950;
    height: 36px;
    justify-content: center;
    line-height: 1;
    overflow: hidden;
    padding: 0;
    width: 36px;
  }

  .hero-settings-icon {
    display: block;
    height: 18px;
    width: 18px;
  }

  .hero-settings-button:hover,
  .hero-settings-button[aria-expanded="true"],
  .hero-settings-button:focus-visible {
    background: rgba(255, 250, 242, 0.22);
    border-color: rgba(255, 250, 242, 0.46);
    outline: none;
  }

  .hero-settings-menu {
    background: rgba(20, 15, 18, 0.98);
    border: 1px solid rgba(255, 250, 242, 0.18);
    border-radius: 8px;
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.42);
    display: grid;
    min-width: 132px;
    overflow: hidden;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
  }

  .hero-settings-item {
    color: #fffaf2;
    font-size: 13px;
    font-weight: 900;
    padding: 12px 13px;
    text-decoration: none;
    white-space: nowrap;
  }

  .hero-settings-item:hover,
  .hero-settings-item:focus-visible {
    background: rgba(var(--accent-rgb), 0.24);
    outline: none;
  }

  .sheet-hero.portal-return-swipe::after {
    border-right: 2px solid rgba(255, 250, 242, 0.58);
    border-top: 2px solid rgba(255, 250, 242, 0.58);
    content: "";
    height: 10px;
    left: 13px;
    opacity: 0.82;
    position: absolute;
    top: 50%;
    transform: translateY(-50%) rotate(45deg);
    width: 10px;
  }

  .sheet-hero.portal-return-swipe .return-character-btn:not(.hidden) {
    align-items: center;
    appearance: none;
    background: rgba(255, 250, 242, 0.13);
    border: 1px solid rgba(255, 250, 242, 0.24);
    border-radius: 999px;
    color: #fffaf2;
    cursor: pointer;
    display: inline-flex;
    font-size: 12px;
    font-weight: 950;
    gap: 6px;
    grid-column: 1 / -1;
    justify-self: start;
    line-height: 1;
    max-width: 100%;
    min-height: 34px;
    overflow: hidden;
    padding: 8px 11px;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .sheet-hero.portal-return-swipe .return-character-btn::before {
    border-bottom: 2px solid currentColor;
    border-left: 2px solid currentColor;
    content: "";
    height: 7px;
    transform: rotate(45deg);
    width: 7px;
  }

  .sheet-hero.portal-return-swipe .return-character-btn:hover,
  .sheet-hero.portal-return-swipe .return-character-btn:focus-visible {
    background: rgba(255, 250, 242, 0.2);
    border-color: rgba(255, 250, 242, 0.42);
    outline: none;
  }

  .panel-scroll-rail {
    --panel-scroll-gutter: 22px;
    --panel-scroll-sidebar: 0px;
    --panel-scroll-drag-scale: 1.78;
    --panel-scroll-drag-shift: 4px;
    --panel-scroll-track-height: clamp(116px, 34vh, 272px);
    --panel-scroll-width: 18px;
    background: rgba(13, 10, 14, 0.42);
    border-color: rgba(226, 195, 151, 0.1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.22);
    left: max(4px, env(safe-area-inset-left));
    padding: 6px 0;
  }

  body.panel-scroll-right .panel-scroll-rail {
    left: auto;
    right: max(4px, env(safe-area-inset-right));
  }

  .panel-scroll-rail:hover,
  .panel-scroll-rail.is-expanded {
    background: rgba(13, 10, 14, 0.68);
    border-color: rgba(226, 195, 151, 0.2);
  }

  .panel-scroll-rail.is-dragging {
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34), 0 0 24px rgba(216, 157, 74, 0.2);
  }

  .panel-scroll-thumb {
    width: 6px;
  }

  .panel-scroll-rail:hover .panel-scroll-thumb,
  .panel-scroll-rail.is-expanded .panel-scroll-thumb {
    width: 8px;
  }

  .panel-scroll-rail.is-dragging .panel-scroll-thumb {
    width: 13px;
  }

  .sheet-page > .page-head,
  .sheet-page > .sheet-block,
  .sheet-page > .page-grid,
  .sheet-page > .magic-stack,
  .sheet-page > .profile-lists {
    margin-left: 9px;
    margin-right: 9px;
  }

  .character-sidebar {
    align-self: stretch;
    border-bottom: 1px solid var(--line-dark);
    border-right: 0;
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
    position: static;
  }

  .character-stack {
    display: grid;
    flex: initial;
    gap: 8px;
    max-height: none;
    overscroll-behavior: auto;
    overflow: visible;
    padding: 0;
    scrollbar-gutter: auto;
  }

  .vendor-shelf {
    max-height: none;
  }

  .vendor-stack {
    display: grid;
    max-height: none;
    overflow: visible;
    padding: 0;
  }

  .character-stack > .character-card,
  .character-stack > .character-owner-group {
    width: 100%;
  }

  .character-owner-group {
    display: none;
  }

  .character-stack > .character-card:not(.create-card),
  .character-stack > .pending-card {
    display: none;
  }

  .character-stack > .pending-card.dismissible-pending-card {
    display: grid;
  }

  .character-card.create-card {
    align-items: center;
    column-gap: 10px;
    grid-template-columns: 38px minmax(0, 1fr);
    grid-template-rows: auto auto;
    min-height: 64px;
  }

  .character-card.create-card strong {
    grid-row: 1 / 3;
    height: 32px;
    width: 32px;
  }

  .sidebar-footer {
    margin-top: 0;
  }

  .install-prompt {
    align-items: center;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sheet-compass {
    grid-template-columns: 38px minmax(0, 1fr) 38px;
    gap: 5px;
    padding: 5px;
  }

  .sheet-tab {
    flex-basis: min(56vw, 208px);
  }

  .sheet-tabs {
    min-height: 46px;
  }

  .sheet-tab-selector {
    width: min(56vw, 208px);
  }

  .portal-action-grid {
    grid-template-columns: 1fr;
  }

  .sheet-arrow {
    height: 38px;
    width: 38px;
  }

  .sheet-progress {
    display: flex;
  }

  .page-grid,
  .page-grid.split-wide,
  .combat-top-grid,
  .combat-loadout-grid,
  .companion-overview-grid,
  .profile-lists {
    grid-template-columns: 1fr;
  }

  .companion-hero {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .companion-hero-side,
  .companion-vital-card {
    grid-column: 1 / -1;
  }

  .companion-request-body {
    grid-template-columns: 1fr;
    max-height: none;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .movement-block {
    justify-self: stretch;
    width: 100%;
  }

  .condition-controls {
    grid-template-columns: 1fr 1fr auto;
  }

  .resource-list.class-resource-grid {
    grid-template-columns: 1fr;
  }

  .weight-load-block {
    padding: 12px;
  }

  .weight-load-bar {
    gap: 9px 10px;
    grid-template-columns: 34px minmax(0, 1fr) auto;
    grid-template-rows: auto auto auto auto;
  }

  .weight-load-kicker {
    grid-column: 1 / -1;
  }

  .weight-load-icon {
    grid-column: 1;
    grid-row: 2 / 4;
  }

  .weight-load-amount {
    grid-column: 2;
    grid-row: 2;
    white-space: normal;
  }

  .weight-load-percent,
  .weight-load-state {
    justify-self: end;
  }

  .weight-load-percent {
    grid-column: 3;
    grid-row: 2;
  }

  .weight-load-state {
    grid-column: 2 / -1;
    grid-row: 4;
  }

  .weight-load-track {
    grid-column: 2 / -1;
    grid-row: 3;
  }

  .condition-list {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  }

  .equipment-list {
    grid-template-columns: 1fr;
  }

  .weapon-list,
  .action-panel-list,
  .feature-list,
  .profile-detail-list {
    grid-template-columns: 1fr;
  }

  .action-panel-list.has-action-spill {
    grid-template-columns: 1fr;
  }

  .movement-card {
    flex: 1 1 150px;
    min-height: 64px;
  }

  .movement-icon-thumb {
    height: 34px;
    width: 34px;
  }

  .movement-icon-thumb svg {
    height: 22px;
    width: 22px;
  }

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

  .creation-panel {
    max-width: 100vw;
    width: 100vw;
  }

  .creation-wizard-body {
    align-content: start;
    gap: 14px;
    height: auto;
    min-height: 0;
    grid-template-areas:
      "steps"
      "main"
      "preview";
    grid-template-columns: 1fr;
    overflow: visible;
  }

  .creation-stepper {
    display: flex;
    min-height: auto;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 4px;
    position: static;
  }

  .creation-step-tab {
    flex: 0 0 132px;
    min-width: 132px;
  }

  .creation-step-content,
  .creation-benefit-panel {
    min-height: auto;
    overflow: visible;
  }

  .creation-benefit-panel {
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  }

  .ability-entry-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .character-sidebar,
  .play-sheet {
    padding: 12px;
  }

  .wild-shape-option-main {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .wild-shape-detail-facts {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .codex-card-grid,
  .codex-classes-shell .codex-card-grid,
  .codex-options-shell.codex-list-shell .codex-card-grid,
  .codex-vehicle-grid {
    gap: 9px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    justify-content: stretch;
  }

  .codex-card-grid .codex-tile,
  .codex-vehicle-grid .codex-vehicle-tile,
  .codex-card-grid .codex-lore-tile.has-image {
    min-height: 0;
    padding: 10px;
  }

  .codex-card-grid .codex-tile.has-image::after {
    height: 64px;
  }

  .codex-card-grid .codex-tile-kicker {
    font-size: 9px;
  }

  .codex-card-grid .codex-tile strong {
    font-size: 15px;
    line-height: 1.06;
  }

  .codex-card-grid .codex-tile em {
    font-size: 10.5px;
    line-height: 1.22;
    -webkit-line-clamp: 2;
  }

  .codex-card-grid .codex-tile small {
    font-size: 9px;
  }

  .support-widget {
    bottom: calc(68px + env(safe-area-inset-bottom));
    right: calc(14px + env(safe-area-inset-right));
  }

  .battle-map-shortcut:not(.hidden) {
    bottom: calc(68px + env(safe-area-inset-bottom));
    left: calc(14px + env(safe-area-inset-left));
  }

  .support-fab,
  .battle-map-fab {
    height: 48px;
    width: 48px;
  }

  .battle-map-icon,
  .battle-map-exit-icon {
    height: 27px;
    width: 27px;
  }

  .roll-overlay {
    align-items: center;
    padding: max(8px, env(safe-area-inset-top)) 10px max(8px, env(safe-area-inset-bottom));
  }

  .roll-panel {
    --roll-die-size: 92px;
    --roll-winner-shift: 55px;
    gap: 9px;
    max-height: calc(100dvh - 16px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
    min-height: 0;
    padding: 12px;
    width: min(100%, 420px);
  }

  .roll-header {
    gap: 2px;
    padding-right: 38px;
  }

  .roll-header h2 {
    font-size: 23px;
    line-height: 1.06;
  }

  .roll-header small,
  .roll-header .kicker {
    font-size: 10px;
  }

  .roll-stage {
    min-height: 112px;
  }

  .roll-flare {
    height: 116px;
    width: 116px;
  }

  .roll-dice {
    gap: 14px;
    min-height: 104px;
  }

  .roll-die-face {
    font-size: 35px;
  }

  .roll-stage-score {
    font-size: 58px;
  }

  .roll-breakdown {
    gap: 4px;
  }

  .roll-breakdown span {
    font-size: 9px;
    min-height: 20px;
    padding: 4px 7px;
  }

  .roll-options {
    gap: 8px;
  }

  .roll-option-group {
    gap: 5px;
  }

  .roll-option-row {
    gap: 5px;
  }

  .roll-option-btn {
    min-height: 36px;
    padding: 6px 7px;
  }

  .roll-option-btn strong {
    font-size: 12px;
  }

  .roll-option-btn span {
    font-size: 10px;
  }

  .roll-dice-style-trigger {
    gap: 2px 8px;
    grid-template-columns: 50px minmax(0, 1fr) auto;
    min-height: 56px;
    padding: 6px 7px;
  }

  .roll-dice-style-trigger .dice-style-preview,
  .roll-dice-style-card .dice-style-preview {
    height: 42px;
    width: 40px;
  }

  .roll-dice-style-trigger .dice-style-preview b,
  .roll-dice-style-card .dice-style-preview b {
    font-size: 17px;
  }

  .roll-dice-style-trigger > strong {
    font-size: 12px;
  }

  .roll-dice-style-trigger > .dice-style-tag,
  .roll-dice-style-action {
    font-size: 10px;
  }

  .roll-dice-style-action {
    padding: 6px 7px;
  }

  .roll-dice-style-menu {
    grid-template-columns: 1fr;
    max-height: min(280px, 40dvh);
  }

  .roll-dice-style-card {
    grid-template-columns: 40px minmax(0, 1fr) auto;
    min-height: 54px;
    padding: 6px;
  }

  .roll-dice-style-card .dice-style-tag {
    font-size: 9px;
    max-width: 100%;
    padding: 3px 6px;
  }

  .roll-dice-style-card-action {
    font-size: 9px;
    padding: 6px;
  }

  .roll-option-row.boosts {
    display: flex;
    max-height: none;
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 2px;
    padding-right: 0;
  }

  .roll-option-row.boosts .roll-option-btn {
    flex: 0 0 min(148px, 48vw);
  }

  .roll-result {
    min-height: 58px;
  }

  .roll-result strong {
    font-size: 48px;
  }

  .roll-inline-card {
    gap: 8px;
    padding: 12px;
  }

  .roll-inline-card .dice-tray-score strong {
    font-size: 52px;
  }

  .roll-action {
    min-height: 40px;
  }

  .support-dialog {
    align-items: end;
    display: grid;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .support-panel {
    margin: 0;
    max-height: calc(100dvh - 24px - env(safe-area-inset-bottom));
    width: 100%;
  }

  .character-sidebar {
    gap: 12px;
  }

  .character-owner-toggle {
    grid-template-columns: minmax(0, 1fr) 26px;
  }

  .character-owner-icon {
    height: 26px;
    width: 26px;
  }

  .character-owner-icon::before {
    left: 50%;
    top: 50%;
  }

  .character-owner-group.is-collapsed .character-owner-icon::before {
    transform: translate(-42%, -50%) rotate(-45deg);
  }

  .character-card {
    min-height: 74px;
    padding: 10px;
  }

  .support-body {
    padding: 14px 12px 16px;
  }

  .sheet-hero {
    gap: 12px;
    grid-template-columns: 72px minmax(0, 1fr);
    padding: 12px;
  }

  .portrait-frame {
    height: 72px;
    width: 72px;
  }

  .hero-copy h1 {
    font-size: 30px;
  }

  .hero-stats {
    grid-template-columns: var(--hero-control-grid);
  }

  .hero-trackers {
    grid-template-columns: var(--hero-control-grid);
  }

  .hero-tracker {
    align-content: center;
    gap: 2px 4px;
    min-height: 40px;
    padding: 5px 6px;
  }

  .hero-tracker span {
    font-size: 9px;
  }

  .hero-tracker strong {
    font-size: 14px;
  }

  .hero-tracker .btn.micro {
    min-height: 22px;
    padding-inline: 6px;
  }

  .hero-condition-controls {
    grid-template-columns: var(--hero-control-grid);
  }

  .condition-popover {
    left: 0;
    right: 0;
    width: auto;
  }

  .condition-popover-head {
    align-items: start;
    display: grid;
  }

  .death-save-strip {
    grid-template-columns: auto minmax(max-content, 1fr) auto;
  }

  .death-save-popover {
    width: min(310px, calc(100vw - 24px));
  }

  .death-save-menu-actions {
    gap: 5px;
  }

  .death-save-menu-actions .btn {
    font-size: 11px;
    padding-inline: 6px;
  }

  .hero-side {
    --hero-control-gap: 6px;
    justify-self: center;
    margin-right: 0;
    width: min(100%, 430px);
  }

  .hero-stats,
  .hero-trackers,
  .hero-condition-controls {
    margin-inline: auto;
    width: 100%;
  }

  .sheet-hero .hero-stat {
    justify-items: center;
    text-align: center;
  }

  .sheet-hero .hero-combat-stat {
    justify-items: stretch;
    text-align: left;
  }

  .sheet-hero .hero-combat-stat-item {
    justify-items: center;
    text-align: center;
  }

  .vendor-mode .hero-side,
  .vehicle-mode .hero-side,
  .codex-mode .hero-side {
    width: min(100%, 430px);
  }

  .vendor-mode .hero-stats,
  .vehicle-mode .hero-stats,
  .codex-mode .hero-stats {
    gap: 6px;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .vendor-mode #playerHpWrap,
  .vendor-mode .hero-ac-stat {
    order: initial;
  }

  .vendor-mode .hero-level-stat,
  .vehicle-mode #playerHpWrap,
  .vehicle-mode .hero-ac-stat,
  .vehicle-mode .hero-level-stat,
  .codex-mode #playerHpWrap,
  .codex-mode .hero-ac-stat,
  .codex-mode .hero-level-stat {
    grid-column: auto;
    order: initial;
  }

  .vendor-mode .sheet-hero .hero-stat,
  .vehicle-mode .sheet-hero .hero-stat,
  .codex-mode .sheet-hero .hero-stat {
    align-content: center;
    gap: 3px;
    min-height: 54px;
    padding: 7px 6px;
  }

  .vendor-mode .hero-stat strong,
  .vehicle-mode .hero-stat strong,
  .codex-mode .hero-stat strong {
    font-size: clamp(15px, 4.1vw, 18px);
    line-height: 1.05;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .vendor-mode #playerHpWrap .hero-stat strong,
  .vehicle-mode .hero-ac-stat strong,
  .codex-mode #playerHpWrap .hero-stat strong,
  .codex-mode .hero-ac-stat strong {
    font-size: clamp(15px, 4.1vw, 18px);
  }

  .vendor-mode .hero-stat small,
  .vehicle-mode .hero-stat small,
  .codex-mode .hero-stat small {
    font-size: 9px;
    line-height: 1.15;
    max-width: 100%;
    overflow-wrap: anywhere;
    white-space: normal;
  }

  .hp-trigger {
    text-align: center;
  }

  .page-head h2 {
    font-size: 24px;
  }

  .sheet-compass {
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    padding: 4px;
  }

  .panel-scroll-rail {
    --panel-scroll-gutter: 22px;
    --panel-scroll-track-height: clamp(108px, 34vh, 250px);
    --panel-scroll-width: 18px;
  }

  .panel-scroll-dot {
    height: 5px;
    width: 5px;
  }

  .panel-scroll-arrow {
    height: 13px;
  }

  .sheet-page > .sheet-block,
  .sheet-page > .page-grid,
  .sheet-page > .magic-stack,
  .sheet-page > .profile-lists {
    margin-left: 9px;
    margin-right: 9px;
  }

  .sheet-tabs::before,
  .sheet-tabs::after {
    width: 34px;
  }

  .sheet-tab {
    flex-basis: min(58vw, 178px);
    min-height: 40px;
  }

  .sheet-tabs {
    min-height: 44px;
  }

  .sheet-tab-selector {
    width: min(58vw, 178px);
  }

  .sheet-arrow {
    height: 36px;
    width: 36px;
  }

  .sheet-block {
    padding: 12px;
  }

  .section-title {
    align-items: start;
    display: grid;
    gap: 3px;
  }

  .section-title strong {
    text-align: left;
    white-space: normal;
  }

  .initiative-controls,
  .initiative-summary,
  .initiative-status-card {
    align-items: stretch;
    grid-template-columns: 1fr;
  }

  .initiative-round {
    justify-self: stretch;
    text-align: center;
  }

  .initiative-actions {
    justify-content: stretch;
  }

  .initiative-actions > .btn {
    width: 100%;
  }

  .initiative-action-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .initiative-turn-strip .portal-map-turn-card.current {
    min-width: min(238px, calc(100vw - 132px));
    width: min(250px, 70vw);
  }

  .initiative-map-preview {
    min-height: 230px;
  }

  .initiative-map-preview-overlay {
    align-items: center;
    inset: auto 0 12px;
    justify-content: center;
  }

  .initiative-row {
    align-items: stretch;
    grid-template-columns: 34px repeat(3, minmax(0, 1fr));
  }

  .initiative-name {
    grid-column: 2 / -1;
  }

  .initiative-stat {
    background: rgba(255, 250, 242, 0.045);
    border-radius: 7px;
    padding: 6px;
    text-align: left;
  }

  .initiative-stat strong,
  .initiative-stat.hp strong {
    font-size: 13px;
  }

  .weapon-list {
    gap: 7px;
  }

  .weapon-card {
    align-items: center;
    gap: 5px 7px;
    grid-template-columns: 34px minmax(0, 1fr);
    padding: 6px;
  }

  .weapon-card .item-thumb {
    border-radius: 7px;
    height: 32px;
    width: 32px;
  }

  .weapon-card .item-icon-thumb svg {
    height: 21px;
    width: 21px;
  }

  .weapon-card-main {
    gap: 2px;
  }

  .weapon-slot-label {
    font-size: 10px;
    line-height: 1.1;
  }

  .weapon-card strong {
    font-size: 15px;
    line-height: 1.12;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .weapon-card em {
    font-size: 11px;
    line-height: 1.15;
  }

  .weapon-roll-actions {
    gap: 4px;
  }

  .weapon-roll-actions.two-rolls {
    grid-template-columns: minmax(54px, 0.6fr) minmax(0, 1.4fr);
  }

  .weapon-roll-btn {
    gap: 6px;
    min-height: 32px;
    padding: 5px 7px;
  }

  .weapon-roll-btn strong {
    font-size: 11px;
  }

  .weapon-roll-btn span {
    font-size: 9px;
  }

  .weapon-tags {
    gap: 4px;
  }

  .weapon-tags .tag {
    border-radius: 7px;
    font-size: 10px;
    line-height: 1.1;
    min-height: 20px;
    min-width: 0;
    padding: 3px 6px;
    white-space: nowrap;
  }

  .overview-grid,
  .detail-grid,
  .companion-stat-grid,
  .tracker-grid,
  .condition-controls,
  .action-entry,
  .slot-row,
  .resource-card,
  .class-resource-column .resource-card {
    grid-template-columns: 1fr;
  }

  .profile-identity-block {
    gap: 9px;
  }

  .profile-identity-block #profileSummary {
    gap: 7px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .profile-identity-block #profileSummary .summary-cell {
    align-content: center;
    gap: 3px;
    min-height: 50px;
    padding: 8px;
  }

  .profile-identity-block #profileSummary .summary-cell span {
    font-size: 9px;
    line-height: 1.05;
  }

  .profile-identity-block #profileSummary .summary-cell strong {
    font-size: clamp(12px, 3.35vw, 14px);
    line-height: 1.14;
    overflow-wrap: break-word;
    white-space: normal;
    word-break: normal;
  }

  .profile-identity-block #profileSummary .summary-cell[data-summary-field="classes"] {
    grid-column: 1 / -1;
  }

  .action-panel-list,
  .action-lane {
    gap: 7px;
  }

  .action-group {
    gap: 5px;
  }

  .action-group header {
    font-size: 11px;
    padding-bottom: 4px;
  }

  .action-entry {
    align-items: center;
    gap: 5px 7px;
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 6px;
  }

  .action-entry.expanded {
    align-items: start;
  }

  .action-icon-thumb {
    border-radius: 7px;
    height: 32px;
    width: 32px;
  }

  .action-icon-thumb svg {
    height: 20px;
    width: 20px;
  }

  .action-entry-main {
    align-items: stretch;
    gap: 4px 7px;
    grid-template-columns: minmax(0, 1fr) minmax(84px, auto);
  }

  .action-entry-head {
    align-self: center;
    gap: 1px;
  }

  .action-entry strong {
    font-size: 15px;
    line-height: 1.12;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .action-entry-head span {
    font-size: 11px;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .action-entry-body {
    align-items: stretch;
    align-self: stretch;
    justify-items: stretch;
  }

  .action-detail-btn {
    align-self: stretch;
    border-radius: 8px;
    font-size: 12px;
    min-height: 42px;
    min-width: 84px;
    padding: 0 10px;
    width: 100%;
  }

  .action-detail {
    margin-top: 2px;
    padding-top: 7px;
  }

  .class-resource-column {
    gap: 5px;
  }

  .class-resource-column header {
    align-items: center;
    gap: 8px;
    padding: 0 1px 4px;
  }

  .class-resource-column header strong {
    font-size: 11px;
    line-height: 1.15;
  }

  .class-resource-column header span {
    font-size: 10px;
  }

  .class-resource-column > div {
    gap: 6px;
  }

  .class-resource-block,
  .class-resource-block .resource-list,
  .class-resource-column,
  .class-resource-column > div,
  .class-resource-column .resource-card {
    max-width: 100%;
    min-width: 0;
  }

  .class-resource-column .resource-card.has-resource-icon {
    gap: 4px 7px;
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 6px;
  }

  .class-resource-column .resource-card.has-resource-icon .resource-icon-thumb {
    border-radius: 7px;
    height: 32px;
    width: 32px;
  }

  .class-resource-column .resource-card.has-resource-icon .resource-icon-thumb svg {
    height: 21px;
    width: 21px;
  }

  .class-resource-column .resource-card.has-resource-icon .resource-copy {
    gap: 1px;
  }

  .class-resource-column .resource-card.has-resource-icon .resource-copy strong {
    font-size: 15px;
    line-height: 1.12;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .class-resource-column .resource-card.has-resource-icon .resource-copy span {
    font-size: 11px;
    line-height: 1.2;
  }

  .class-resource-column .resource-card.has-resource-icon .resource-copy .resource-remaining {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .class-resource-column .resource-card.has-resource-icon .resource-copy .resource-meta {
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .class-resource-column .resource-card.has-resource-icon .resource-copy small {
    display: none;
  }

  .class-resource-column .resource-card.has-resource-icon .pip-meter {
    gap: 4px;
    grid-column: 2;
    grid-row: 2;
    max-width: 100%;
    min-width: 0;
  }

  .class-resource-column .resource-card.has-resource-icon .pip-meter i {
    height: 10px;
    width: 10px;
  }

  .class-resource-column .resource-card.has-resource-icon .resource-status,
  .class-resource-column .resource-card.has-resource-icon .btn {
    align-items: center;
    align-self: stretch;
    border-radius: 8px;
    display: inline-flex;
    font-size: 12px;
    grid-column: 1 / -1;
    grid-row: 3;
    justify-content: center;
    justify-self: stretch;
    line-height: 1.15;
    min-height: 42px;
    min-width: 0;
    padding: 0 10px;
    width: 100%;
    white-space: normal;
  }

  .class-resource-column .resource-card.has-resource-icon .resource-actions {
    align-self: stretch;
    display: grid;
    gap: 6px;
    grid-column: 1 / -1;
    grid-row: 3;
    grid-template-columns: repeat(auto-fit, minmax(84px, 1fr));
    justify-self: stretch;
    width: 100%;
  }

  .class-resource-column .resource-card.has-resource-icon .resource-actions .btn,
  .class-resource-column .resource-card.has-resource-icon .resource-actions .resource-status {
    grid-column: auto;
    grid-row: auto;
  }

  .resource-details-panel {
    gap: 8px;
    padding: 9px;
  }

  .resource-details-facts {
    grid-template-columns: minmax(0, 1fr);
  }

  .ability-luck-block .resource-card.has-resource-icon {
    gap: 4px 7px;
    grid-template-columns: 32px minmax(0, 1fr) minmax(82px, auto);
    padding: 6px;
  }

  .ability-luck-block .resource-card.has-resource-icon .resource-icon-thumb {
    border-radius: 7px;
    height: 32px;
    width: 32px;
  }

  .ability-luck-block .resource-card.has-resource-icon .resource-icon-thumb svg {
    height: 21px;
    width: 21px;
  }

  .ability-luck-block .resource-card.has-resource-icon .resource-copy {
    gap: 1px;
  }

  .ability-luck-block .resource-card.has-resource-icon .btn {
    align-self: stretch;
    border-radius: 8px;
    font-size: 12px;
    min-height: 42px;
    min-width: 82px;
    padding: 0 10px;
    width: 100%;
  }

  .ability-luck-block .resource-card.has-resource-icon .resource-actions {
    align-self: stretch;
    grid-column: 3;
    grid-row: 1 / 3;
    justify-self: stretch;
  }

  .ability-luck-block .resource-card.has-resource-icon .resource-actions .btn,
  .ability-luck-block .resource-card.has-resource-icon .resource-actions .resource-status {
    grid-column: auto;
    grid-row: auto;
    min-width: 82px;
  }

  .attunement-tracker-block::before {
    left: 10px;
    right: 10px;
    top: 39px;
  }

  .attunement-resource-card.has-resource-icon {
    gap: 5px 8px;
    grid-template-columns: 34px minmax(0, 1fr) minmax(76px, auto);
    min-height: 0;
    padding: 8px;
  }

  .attunement-resource-card.has-resource-icon .resource-icon-thumb {
    border-radius: 7px;
    grid-column: 1;
    grid-row: 1 / 3;
    height: 34px;
    width: 34px;
  }

  .attunement-resource-card.has-resource-icon .resource-icon-thumb svg {
    height: 23px;
    width: 23px;
  }

  .attunement-resource-card.has-resource-icon .resource-copy {
    gap: 1px;
    grid-column: 2;
    grid-row: 1;
  }

  .attunement-resource-card.has-resource-icon .resource-copy small {
    display: none;
  }

  .attunement-resource-card.has-resource-icon .pip-meter {
    gap: 4px;
    grid-column: 2;
    grid-row: 2;
    justify-content: flex-start;
  }

  .attunement-resource-card.has-resource-icon .pip-meter i {
    height: 10px;
    width: 10px;
  }

  .attunement-resource-card.has-resource-icon .btn,
  .attunement-resource-card.has-resource-icon .resource-status {
    align-self: stretch;
    grid-column: 3;
    grid-row: 1 / 3;
    justify-self: stretch;
  }

  .attunement-resource-card.has-resource-icon .btn {
    border-radius: 8px;
    font-size: 12px;
    min-height: 42px;
    min-width: 76px;
    padding: 0 10px;
    width: 100%;
  }

  .attunement-resource-card.has-resource-icon .resource-actions {
    align-self: stretch;
    grid-column: 3;
    grid-row: 1 / 3;
    justify-self: stretch;
  }

  .attunement-resource-card.has-resource-icon .resource-actions .btn,
  .attunement-resource-card.has-resource-icon .resource-actions .resource-status {
    grid-column: auto;
    grid-row: auto;
    min-width: 76px;
  }

  .condition-list:not(.compact) {
    grid-template-columns: 1fr;
  }

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

  .hp-controls.action-row {
    align-items: end;
    grid-template-columns: minmax(78px, .72fr) repeat(2, minmax(0, 1fr));
  }

  .hp-controls.action-row .btn {
    min-height: 40px;
    padding: 7px 8px;
  }

  .condition-controls .btn {
    width: 100%;
  }

  .death-save-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .death-save-row > div {
    grid-column: 1 / -1;
  }

  .death-save-row .btn {
    min-height: 36px;
    width: 100%;
  }

  .avatar-editor {
    align-items: stretch;
    grid-template-columns: 56px minmax(0, 1fr);
  }

  .avatar-editor-preview {
    height: 56px;
    width: 56px;
  }

  .avatar-editor-actions {
    display: grid;
    grid-column: 1 / -1;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .avatar-shape-toggle,
  .avatar-link-panel {
    max-width: none;
  }

  .avatar-link-controls {
    grid-template-columns: 1fr;
  }

  .companion-hero {
    grid-template-columns: 72px minmax(0, 1fr);
  }

  .companion-portrait,
  .companion-portrait-fallback {
    height: 72px;
  }

  .companion-hero-copy h3 {
    font-size: 24px;
  }

  .companion-ability-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .companion-equipment-row {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .companion-slot-action {
    grid-column: 1 / -1;
    justify-self: stretch;
  }

  .companion-search-card {
    grid-template-areas:
      "thumb title"
      "thumb meta"
      "thumb slots";
    grid-template-columns: 42px minmax(0, 1fr);
    min-height: 86px;
  }

  .companion-search-card img,
  .companion-search-card > span {
    height: 42px;
    width: 42px;
  }

  .companion-search-card small {
    justify-self: start;
    max-width: 100%;
    text-align: left;
  }

  .inventory-row {
    align-items: center;
    gap: 6px;
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 6px;
  }

  .inventory-row.is-open {
    align-items: start;
  }

  .inventory-row .item-thumb {
    height: 32px;
    width: 32px;
  }

  .inventory-row .item-icon-thumb svg {
    height: 22px;
    width: 22px;
  }

  .inventory-row .inventory-main {
    gap: 4px;
  }

  .inventory-row .item-heading {
    align-items: center;
    display: grid;
    gap: 6px;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .inventory-row .item-name-link {
    flex: 1 1 auto;
    font-size: 14px;
    line-height: 1.15;
    min-width: 0;
  }

  .inventory-row:not(.is-inspecting) .item-name-link {
    display: block;
    overflow: hidden;
    overflow-wrap: normal;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .inventory-row.is-inspecting .item-name-link {
    white-space: normal;
  }

  .inventory-row .item-heading span {
    font-size: 10px;
    padding: 3px 6px;
  }

  .inventory-row .item-heading .unidentified-mark {
    flex-basis: 20px;
    font-size: 12px;
    height: 20px;
    padding: 0;
    width: 20px;
  }

  .inventory-row:not(.is-inspecting) .item-traits,
  .inventory-row:not(.is-inspecting) .inventory-actions .action-state {
    display: none;
  }

  .inventory-row .inventory-actions {
    border-top: 0;
    gap: 4px;
    margin-top: 0;
    padding: 1px 0 0;
  }

  .inventory-row.is-inspecting .inventory-actions {
    border-top: 1px solid rgba(226, 195, 151, 0.12);
    padding-top: 5px;
  }

  .inventory-row .item-action {
    border-radius: 7px;
    font-size: 11px;
    min-height: 25px;
    padding: 3px 7px;
  }

  .vendor-store-grid {
    grid-template-columns: 1fr;
  }

  .vendor-search-row {
    grid-template-columns: 1fr;
  }

  .vendor-search-clear {
    justify-self: start;
  }

  .vendor-stock-block {
    padding: 10px;
  }

  .vendor-store-card,
  .vendor-sell-row {
    grid-template-columns: 32px minmax(0, 1fr);
    padding: 7px;
  }

  .vendor-store-card .item-thumb,
  .vendor-sell-row .item-thumb {
    height: 32px;
    width: 32px;
  }

  .vendor-store-card .item-heading strong,
  .vendor-sell-row .item-heading strong {
    font-size: 13px;
  }

  .vendor-store-head {
    align-items: start;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .vendor-heading-inspect {
    min-height: 30px;
    min-width: 70px;
    padding: 3px 7px;
  }

  .vendor-store-card .item-description {
    font-size: 11px;
  }

  .vendor-sell-row .vendor-store-actions {
    grid-column: 1 / -1;
  }

  .vendor-store-actions {
    grid-template-columns: 70px minmax(0, auto);
  }

  .vendor-store-card .vendor-store-actions {
    grid-template-columns: 70px auto;
  }

  .vendor-store-card .vendor-store-actions-secondary {
    grid-template-columns: auto;
  }

  .vehicle-cargo-actions {
    grid-template-columns: 70px repeat(3, minmax(0, auto));
  }

  .item-thumb {
    height: 34px;
    width: 34px;
  }

  .inventory-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
    min-width: 0;
  }

  .inventory-expanded {
    grid-column: 1 / -1;
  }

  .inventory-actions .btn {
    width: auto;
  }

  .item-property-grid,
  .send-item-grid,
  .item-manage-grid {
    grid-template-columns: 1fr;
  }

  .use-control {
    gap: 4px;
    grid-template-columns: 42px auto;
  }

  .use-control .input {
    min-height: 25px;
    padding: 3px 5px;
  }

  .equipment-row {
    gap: 7px;
    grid-template-columns: 34px minmax(70px, .3fr) minmax(0, 1fr) minmax(64px, auto);
  }

  .link-grid {
    grid-template-columns: 1fr;
  }

  .journal-meta-grid,
  .journal-fact-grid,
  .journal-card-grid {
    grid-template-columns: 1fr;
  }

  .journal-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    margin: 0;
    overflow: visible;
    padding: 0;
    scroll-snap-type: none;
  }

  .journal-tab {
    grid-template-areas:
      "icon count"
      "label label";
    grid-template-columns: 28px minmax(0, 1fr);
    min-height: 74px;
    padding: 10px;
  }

  .journal-tab > span:not(.journal-nav-icon) {
    display: none;
    font-size: 9px;
  }

  .journal-nav-icon {
    display: grid;
    height: 28px;
    width: 28px;
  }

  .journal-nav-icon svg {
    height: 17px;
    width: 17px;
  }

  .journal-tab strong {
    font-size: 13px;
  }

  .journal-tab em {
    font-size: 11px;
  }

  .journal-meta-grid.primary {
    grid-template-columns: 1fr;
  }

  .journal-codex-grid {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .journal-entry-form,
  .journal-entry-card,
  .journal-quest-card,
  .journal-whisper-card {
    padding: 11px;
  }

  .journal-meta-card {
    min-height: 62px;
  }

  .journal-entry-card > header,
  .journal-quest-card > header,
  .journal-whisper-card > header,
  .journal-section-head {
    display: grid;
  }

  .journal-card-actions,
  .journal-section-actions,
  .journal-form-actions {
    justify-content: flex-start;
  }

  .journal-sent-whisper-log > header,
  .journal-sent-whisper-row > header {
    display: grid;
  }

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

  .ability-card {
    gap: 7px;
    min-height: 104px;
    overflow: hidden;
    padding: 9px 10px;
    position: relative;
  }

  .ability-top {
    align-items: start;
    gap: 2px 6px;
    grid-template-columns: minmax(0, 1fr) auto;
    padding-right: 0;
    position: static;
  }

  .ability-top div {
    gap: 0;
    grid-column: 1;
    grid-row: 1;
    position: relative;
    z-index: 1;
  }

  .ability-top strong {
    font-size: 17px;
    line-height: 1;
  }

  .ability-top span {
    font-size: 11px;
    line-height: 1.12;
    max-width: 100%;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
  }

  .ability-top em {
    align-self: start;
    font-size: 18px;
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    line-height: 1;
    position: relative;
    z-index: 1;
  }

  .ability-icon-thumb {
    background: transparent;
    border-color: transparent;
    border-radius: 8px;
    bottom: 8px;
    height: 34px;
    opacity: .26;
    pointer-events: none;
    position: absolute;
    right: 10px;
    top: auto;
    width: 34px;
    z-index: 0;
  }

  .ability-icon-thumb svg {
    height: 30px;
    width: 30px;
  }

  .ability-score {
    font-size: 28px;
    line-height: .9;
    margin-top: 2px;
    position: relative;
    z-index: 1;
  }

  .passive-check-grid {
    grid-template-columns: 1fr;
  }

  .passive-check-card {
    min-height: 52px;
  }

  .spell-facts {
    grid-template-columns: 1fr;
  }

  .creation-head,
  .creation-body,
  .levelup-body,
  .prepared-body,
  .creation-actions {
    padding-left: 12px;
    padding-right: 12px;
  }

  .prepared-modal-summary {
    align-items: start;
    display: grid;
  }

  .prepared-modal-summary span {
    text-align: left;
  }

  .creation-grid,
  .ability-entry-grid,
  .theme-picker,
  .levelup-review-grid,
  .character-repair-summary-grid,
  .creation-review-grid,
  .creation-review-lists,
  .creation-ability-summary,
  .choice-list {
    grid-template-columns: 1fr;
  }

  .theme-custom {
    justify-self: stretch;
    width: 100%;
  }

  .hero-actions,
  .hero-actions .btn {
    width: 100%;
  }

  .install-prompt {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .install-actions {
    grid-template-columns: minmax(0, 1fr) minmax(72px, auto);
  }

  .install-guide {
    align-items: end;
    padding: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }

  .install-guide-panel {
    padding: 16px;
  }

  .creation-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .creation-step-status {
    margin-left: 0;
    text-align: center;
  }

  .creation-actions .btn {
    width: 100%;
  }

  #creationDialog .creation-actions,
  #companionDialog .creation-actions {
    display: grid;
    gap: 7px;
    grid-template-columns: minmax(58px, .8fr) auto minmax(52px, .72fr) minmax(64px, .9fr);
    padding: 8px 10px calc(8px + env(safe-area-inset-bottom));
  }

  #creationDialog .creation-step-status,
  #companionDialog .creation-step-status {
    font-size: 11px;
    line-height: 1;
    margin-left: 0;
    min-width: 34px;
    text-align: center;
    white-space: nowrap;
  }

  #creationDialog .creation-actions .btn,
  #companionDialog .creation-actions .btn {
    border-radius: 8px;
    font-size: 13px;
    min-height: 36px;
    padding: 7px 8px;
    width: auto;
  }

  #creationDialog .creation-actions .btn.primary,
  #companionDialog .creation-actions .btn.primary {
    min-width: 62px;
  }
}
.initiative-map-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

@media (max-width: 640px) {
  .initiative-map-actions {
    justify-content: stretch;
    width: 100%;
  }

  .initiative-map-actions .btn {
    flex: 1 1 128px;
  }
}

.portal-map-dialog {
  position: fixed;
  inset: 0;
  z-index: 2400;
}

.portal-map-dialog.hidden {
  display: none;
}

.portal-map-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.78);
}

.portal-map-panel {
  background:
    linear-gradient(135deg, rgba(240, 198, 106, 0.10), transparent 28%),
    #101419;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  inset: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
  position: absolute;
  transform: translateY(var(--portal-map-swipe-y, 0));
  transition: transform 0.18s ease;
}

.map-activity-toast-stack {
  bottom: 18px;
  display: grid;
  gap: 8px;
  left: 18px;
  max-width: min(390px, calc(100vw - 36px));
  pointer-events: none;
  position: absolute;
  width: max-content;
  z-index: 26;
}

.map-activity-toast {
  align-items: center;
  background: rgba(12, 16, 21, 0.94);
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-left: 3px solid #73d0ff;
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.34);
  color: var(--ink);
  display: grid;
  gap: 10px;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  max-width: min(390px, calc(100vw - 36px));
  opacity: 0;
  padding: 8px 10px 8px 8px;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.map-activity-toast.show {
  opacity: 1;
  transform: translateY(0);
}

.map-activity-toast.tone-danger { border-left-color: #d95f5f; }
.map-activity-toast.tone-success { border-left-color: #63d7b0; }
.map-activity-toast.tone-magic { border-left-color: #9c7cff; }
.map-activity-toast.tone-resource { border-left-color: var(--gold); }

.map-activity-avatar {
  align-items: center;
  background: #080b10;
  border: 2px solid rgba(255, 250, 242, 0.18);
  border-radius: 9px;
  display: flex;
  height: 38px;
  justify-content: center;
  overflow: hidden;
  width: 38px;
}

.map-activity-avatar.avatar-shape-circle {
  border-radius: 999px;
}

.map-activity-avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.map-activity-avatar b {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.map-activity-copy {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.map-activity-copy strong,
.map-activity-copy span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-activity-copy strong {
  color: var(--ink);
  font-size: 13px;
  font-weight: 950;
}

.map-activity-copy span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.map-activity-toast em {
  color: var(--gold);
  font-size: 12px;
  font-style: normal;
  font-weight: 950;
  white-space: nowrap;
}

.portal-map-panel.is-swiping {
  transition: none;
}

.portal-map-head {
  align-items: center;
  background: rgba(16,20,25,.96);
  border-bottom: 1px solid rgba(240, 198, 106, 0.2);
  box-shadow: 0 14px 30px rgba(0,0,0,.24);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto 38px;
  padding: 10px 12px;
  position: relative;
}

.portal-map-head h2 {
  margin: 0;
}

.portal-map-title-block {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portal-map-title-block h2 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-map-pull-handle {
  display: none;
}

.portal-map-actions {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  justify-content: flex-end;
}

.portal-map-tool,
.portal-map-icon-btn {
  align-items: center;
  appearance: none;
  background: rgba(255,255,255,.06);
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 7px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  height: 36px;
  justify-content: center;
  padding: 0;
  position: relative;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
  width: 36px;
}

.portal-map-tool svg,
.portal-map-icon-btn svg {
  display: block;
  height: 20px;
  pointer-events: none;
  width: 20px;
}

.portal-map-tool-label {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

.portal-map-tool.active {
  background: rgba(115,208,255,.16);
  border-color: rgba(115,208,255,.85);
  color: #f7fbff;
}

.portal-map-tool:hover,
.portal-map-icon-btn:hover {
  background: rgba(255,255,255,.11);
  border-color: rgba(240, 198, 106, 0.46);
  transform: translateY(-1px);
}

.portal-map-tool:focus-visible,
.portal-map-icon-btn:focus-visible {
  outline: 2px solid rgba(240, 198, 106, 0.74);
  outline-offset: 2px;
}

.portal-map-tool:disabled,
.portal-map-tool[aria-disabled="true"] {
  cursor: not-allowed;
  opacity: .38;
  transform: none;
}

.portal-map-close-btn {
  color: #ffb2b9;
}

.portal-map-initiative-strip {
  align-items: center;
  background: rgba(5, 7, 10, 0.46);
  backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 999px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.32);
  display: flex;
  gap: 6px;
  justify-self: center;
  margin: 8px auto 0;
  max-width: min(980px, calc(100% - 28px));
  min-width: 0;
  overflow-x: auto;
  padding: 6px;
  scrollbar-width: none;
  width: max-content;
  z-index: 5;
  -webkit-overflow-scrolling: touch;
}

.portal-map-initiative-strip::-webkit-scrollbar {
  display: none;
}

.portal-map-initiative-strip.is-auto-centering {
  scroll-behavior: auto;
  scroll-snap-type: none !important;
}

.portal-map-turn-card {
  align-items: center;
  appearance: none;
  background: rgba(16, 20, 25, 0.92);
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 999px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.32);
  color: var(--ink);
  cursor: pointer;
  display: grid;
  flex: 0 0 auto;
  gap: 8px;
  grid-template-columns: 42px;
  height: 48px;
  justify-content: center;
  min-width: 48px;
  padding: 3px;
  position: relative;
  text-align: left;
  transition: border-color 0.14s ease, box-shadow 0.14s ease, transform 0.14s ease;
  width: 48px;
}

.portal-map-turn-card:hover {
  border-color: rgba(240, 198, 106, 0.42);
  transform: translateY(-1px);
}

.portal-map-turn-card.current {
  background: rgba(16, 20, 25, 0.96);
  border-color: rgba(245, 214, 107, 0.72);
  gap: 9px;
  grid-template-columns: 42px minmax(122px, 1fr) auto;
  height: 64px;
  min-width: min(280px, calc(100vw - 188px));
  padding: 3px 8px 3px 3px;
  box-shadow: 0 0 0 2px rgba(245, 214, 107, 0.18), 0 18px 42px rgba(0, 0, 0, 0.42);
  width: min(300px, 34vw);
}

.portal-map-turn-card.enemy.current {
  border-color: rgba(211, 74, 91, 0.95);
  box-shadow: 0 0 0 2px rgba(211, 74, 91, 0.22), 0 18px 42px rgba(0, 0, 0, 0.42);
}

.portal-map-turn-card.self:not(.current) {
  border-color: rgba(var(--accent-rgb), 0.46);
}

.portal-map-turn-card.no-token {
  opacity: 0.72;
}

.portal-map-turn-card.past:not(.current) {
  opacity: 0.36;
  transform: scale(0.92);
}

.portal-map-turn-card.past:not(.current):hover {
  opacity: 0.52;
  transform: scale(0.92) translateY(-1px);
}

.portal-map-turn-card.future:not(.current) {
  opacity: 0.9;
}

.portal-map-turn-portrait {
  align-items: center;
  aspect-ratio: 1;
  background: #080b10;
  border: 2px solid var(--turn-color, #73d0ff);
  border-radius: 10px;
  display: flex;
  height: 42px;
  justify-content: center;
  overflow: hidden;
  width: 42px;
}

.portal-map-turn-portrait.avatar-shape-circle {
  border-radius: 999px;
}

.portal-map-turn-portrait img {
  background: #080b10;
  display: block;
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.portal-map-turn-portrait b {
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
}

.portal-map-turn-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portal-map-turn-card:not(.current) .portal-map-turn-main {
  display: none;
}

.portal-map-turn-card-empty .portal-map-turn-main {
  display: grid;
}

.portal-map-turn-main strong {
  color: var(--ink);
  font-size: 14px;
  font-weight: 900;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-map-turn-main span {
  color: var(--muted);
  font-size: 10.5px;
  font-weight: 800;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-map-turn-movement {
  align-items: center;
  display: grid;
  font-style: normal;
  gap: 5px;
  grid-template-columns: minmax(52px, 1fr) auto;
  margin-top: 0;
  min-width: 0;
}

.portal-map-turn-movement.hidden {
  display: none;
}

.portal-map-turn-movement i {
  background: rgba(255, 250, 242, 0.12);
  border-radius: 999px;
  display: block;
  height: 5px;
  overflow: hidden;
  position: relative;
}

.portal-map-turn-movement i::after {
  background: linear-gradient(90deg, #63d7b0, var(--gold));
  border-radius: inherit;
  content: "";
  display: block;
  height: 100%;
  width: var(--movement-progress, 0%);
}

.portal-map-turn-movement.over i::after {
  background: linear-gradient(90deg, var(--gold), #d95f5f);
}

.portal-map-turn-movement small {
  color: #d8e1eb;
  font-size: 9.5px;
  font-weight: 900;
  line-height: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-map-turn-index {
  align-items: center;
  background: rgba(5, 7, 10, 0.86);
  border: 1px solid rgba(255, 250, 242, 0.16);
  border-radius: 999px;
  color: var(--gold);
  display: flex;
  font-size: 9px;
  font-weight: 900;
  justify-content: center;
  min-width: 19px;
  padding: 3px 5px;
  position: absolute;
  right: -4px;
  top: -3px;
}

.portal-map-turn-card.current .portal-map-turn-index {
  background: rgba(245, 214, 107, 0.14);
  border-color: rgba(245, 214, 107, 0.42);
  font-size: 11px;
  min-width: 38px;
  padding: 6px 8px;
  position: static;
}

.portal-map-turn-card-empty {
  gap: 8px;
  grid-template-columns: minmax(150px, 1fr);
  min-width: 220px;
  padding: 7px 14px;
  width: auto;
}

.portal-map-quick-drawer {
  align-items: flex-start;
  display: flex;
  gap: 0;
  max-height: calc(100% - 144px);
  max-width: calc(100% - 24px);
  position: absolute;
  right: 0;
  top: var(--portal-map-quick-y, 116px);
  z-index: 15;
}

.portal-map-quick-tab {
  align-items: center;
  appearance: none;
  background:
    linear-gradient(180deg, rgba(245, 214, 107, 0.18), rgba(16, 20, 25, 0.96)),
    rgba(16, 20, 25, 0.94);
  border: 1px solid rgba(245, 214, 107, 0.46);
  border-radius: 14px 0 0 14px;
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
  color: var(--gold);
  cursor: grab;
  display: flex;
  height: 48px;
  justify-content: center;
  padding: 0;
  touch-action: none;
  width: 42px;
}

.portal-map-quick-tab svg {
  display: block;
  height: 22px;
  width: 22px;
}

.portal-map-quick-drawer.is-open .portal-map-quick-tab {
  background:
    linear-gradient(180deg, rgba(115, 208, 255, 0.2), rgba(16, 20, 25, 0.96)),
    rgba(16, 20, 25, 0.94);
  border-color: rgba(115, 208, 255, 0.68);
  color: #bfeeff;
}

.portal-map-quick-panel {
  background:
    linear-gradient(180deg, rgba(25, 31, 39, 0.96), rgba(12, 15, 20, 0.94));
  border: 1px solid rgba(255, 250, 242, 0.14);
  border-radius: 8px;
  box-shadow: 0 24px 62px rgba(0, 0, 0, 0.45);
  display: grid;
  gap: 10px;
  left: var(--portal-map-quick-panel-x, -368px);
  max-height: var(--portal-map-quick-panel-max-height, calc(100vh - 172px));
  overflow: auto;
  padding: 10px;
  position: absolute;
  top: var(--portal-map-quick-panel-y, 0);
  width: min(360px, calc(100vw - 78px));
}

.portal-map-quick-drawer.edge-left {
  left: 0;
  right: auto;
}

.portal-map-quick-drawer.edge-right {
  left: auto;
  right: 0;
}

.portal-map-quick-drawer.edge-left .portal-map-quick-tab {
  border-radius: 0 14px 14px 0;
}

.portal-map-quick-drawer.edge-left .portal-map-quick-tab svg {
  transform: rotate(180deg);
}

.portal-map-quick-drawer.is-dragging .portal-map-quick-tab {
  border-color: rgba(115, 208, 255, 0.82);
  cursor: grabbing;
  transform: scale(1.04);
}

.portal-map-quick-drawer.is-collapsed .portal-map-quick-panel {
  display: none;
}

.portal-map-quick-head,
.portal-map-quick-section-head {
  align-items: center;
  display: flex;
  gap: 10px;
  justify-content: space-between;
  min-width: 0;
}

.portal-map-quick-head {
  border-bottom: 1px solid rgba(255, 250, 242, 0.12);
  padding: 0 2px 8px;
}

.portal-map-quick-head span,
.portal-map-quick-section-head span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.portal-map-quick-head strong,
.portal-map-quick-section-head strong {
  color: var(--ink);
  font-size: 13px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-map-quick-section {
  background: rgba(255, 250, 242, 0.045);
  border: 1px solid rgba(255, 250, 242, 0.1);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  padding: 9px;
}

.portal-map-hp-actions,
.portal-map-condition-add {
  display: grid;
  gap: 6px;
  grid-template-columns: 74px 1fr 1fr;
}

.portal-map-condition-add {
  grid-template-columns: minmax(0, 1fr) auto;
}

.portal-map-hp-actions .input,
.portal-map-condition-add .input {
  background: rgba(5, 7, 10, 0.72);
  border-radius: 7px;
  min-height: 36px;
}

.portal-map-quick-chip,
.portal-map-condition-pill,
.portal-map-resource-chip,
.portal-map-slot-chip,
.portal-map-roll-btn {
  appearance: none;
  border: 1px solid rgba(255, 250, 242, 0.13);
  color: var(--ink);
  cursor: pointer;
  font: inherit;
  transition: background 0.14s ease, border-color 0.14s ease, color 0.14s ease, transform 0.14s ease;
}

.portal-map-quick-chip {
  background: rgba(255, 250, 242, 0.06);
  border-radius: 7px;
  font-size: 12px;
  font-weight: 900;
  min-height: 36px;
  padding: 0 10px;
}

.portal-map-quick-chip.danger {
  border-color: rgba(216, 88, 82, 0.42);
  color: #ffb8b8;
}

.portal-map-quick-chip.success {
  border-color: rgba(85, 184, 120, 0.42);
  color: #bdf5cb;
}

.portal-map-combat-section {
  background:
    linear-gradient(135deg, rgba(216, 88, 82, 0.1), rgba(115, 208, 255, 0.055)),
    rgba(255, 250, 242, 0.04);
}

.portal-map-roll-list {
  display: grid;
  gap: 7px;
}

.portal-map-roll-card {
  background: rgba(5, 7, 10, 0.5);
  border: 1px solid rgba(255, 250, 242, 0.11);
  border-radius: 8px;
  display: grid;
  gap: 7px;
  padding: 8px;
}

.portal-map-roll-card.spell {
  border-color: rgba(115, 208, 255, 0.24);
}

.portal-map-roll-main {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.portal-map-roll-main span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  overflow: hidden;
  text-overflow: ellipsis;
  text-transform: uppercase;
  white-space: nowrap;
}

.portal-map-roll-main strong {
  color: var(--ink);
  font-size: 13px;
  line-height: 1.1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-map-roll-actions {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-map-roll-actions.single {
  grid-template-columns: 1fr;
}

.portal-map-roll-btn {
  align-items: center;
  background: rgba(255, 250, 242, 0.055);
  border-radius: 7px;
  display: flex;
  gap: 6px;
  justify-content: space-between;
  min-height: 34px;
  min-width: 0;
  padding: 0 9px;
}

.portal-map-roll-btn span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.portal-map-roll-btn strong {
  color: var(--ink);
  font-size: 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-map-roll-btn.damage {
  border-color: rgba(245, 214, 107, 0.34);
}

.portal-map-roll-btn.damage strong {
  color: var(--gold);
}

.portal-map-roll-btn.spell {
  border-color: rgba(115, 208, 255, 0.36);
}

.portal-map-roll-btn.spell strong {
  color: #bfeeff;
}

.portal-map-condition-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.portal-map-condition-row.active-list {
  min-height: 30px;
}

.portal-map-condition-pill {
  align-items: center;
  background: rgba(255, 250, 242, 0.055);
  border-radius: 999px;
  display: inline-flex;
  font-size: 11px;
  font-weight: 850;
  gap: 5px;
  min-height: 28px;
  padding: 0 9px;
}

.portal-map-condition-pill.active {
  background: rgba(211, 74, 91, 0.18);
  border-color: rgba(211, 74, 91, 0.54);
  color: #ffd7d9;
}

.portal-map-condition-pill b {
  background:
    linear-gradient(45deg, transparent calc(50% - 1px), currentColor calc(50% - 1px), currentColor calc(50% + 1px), transparent calc(50% + 1px)),
    linear-gradient(-45deg, transparent calc(50% - 1px), currentColor calc(50% - 1px), currentColor calc(50% + 1px), transparent calc(50% + 1px));
  color: #ffb2b9;
  display: inline-block;
  flex: 0 0 12px;
  font-size: 0;
  height: 12px;
  line-height: 1;
  width: 12px;
}

.portal-map-resource-grid,
.portal-map-slot-grid {
  display: grid;
  gap: 7px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.portal-map-resource-chip,
.portal-map-slot-chip {
  background: rgba(5, 7, 10, 0.48);
  border-radius: 8px;
  display: grid;
  gap: 2px;
  min-height: 52px;
  padding: 7px 8px;
  text-align: left;
}

.portal-map-slot-chip {
  min-height: 46px;
}

.portal-map-resource-chip span,
.portal-map-slot-chip span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-map-resource-chip strong,
.portal-map-slot-chip strong {
  color: var(--ink);
  font-size: 14px;
}

.portal-map-resource-chip em {
  color: var(--gold);
  font-size: 9px;
  font-style: normal;
  font-weight: 850;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.portal-map-quick-chip:hover:not(:disabled),
.portal-map-condition-pill:hover:not(:disabled),
.portal-map-resource-chip:hover:not(:disabled),
.portal-map-slot-chip:hover:not(:disabled),
.portal-map-roll-btn:hover:not(:disabled),
.portal-map-quick-tab:hover {
  border-color: rgba(115, 208, 255, 0.62);
  transform: translateY(-1px);
}

.portal-map-quick-chip:disabled,
.portal-map-condition-pill:disabled,
.portal-map-resource-chip:disabled,
.portal-map-slot-chip:disabled,
.portal-map-roll-btn:disabled {
  cursor: not-allowed;
  opacity: .44;
}

.portal-map-quick-muted,
.portal-map-quick-empty {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.portal-map-canvas-host {
  background: #111418;
  border: 1px solid rgba(240, 198, 106, 0.14);
  margin: 8px;
  min-height: 0;
  overflow: hidden;
  position: relative;
}

.plume-map-canvas {
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: grab;
}

.plume-map-shape-toolbar {
  display: none;
}

@media (min-width: 921px) {
  body.portal-map-open .portal-map-dialog {
    left: var(--portal-sidebar-width);
  }

  body.portal-map-open.sidebar-collapsed .portal-map-dialog {
    left: 0;
  }

  body.portal-map-open .sidebar-toggle {
    z-index: 2450;
  }

  body.portal-map-open .portal-map-head {
    grid-template-columns: minmax(170px, 1fr) auto minmax(170px, 1fr);
    padding: 8px 10px;
  }

  body.portal-map-open .portal-map-actions {
    background: rgba(5, 7, 10, 0.42);
    border: 1px solid rgba(255, 250, 242, 0.1);
    border-radius: 999px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.28);
    justify-self: center;
    padding: 4px 6px;
  }

  body.portal-map-open .portal-map-close-btn {
    justify-self: end;
  }

  body.portal-map-open .portal-map-initiative-strip {
    border-left: 0;
    border-radius: 0;
    border-right: 0;
    justify-self: stretch;
    margin: 0;
    max-width: none;
    padding: 6px max(18px, calc(50% - 150px));
    scroll-padding-inline: max(18px, calc(50% - 150px));
    width: 100%;
  }
}

@media (max-width: 920px) {
  body.portal-map-open {
    overflow: hidden;
    overscroll-behavior: none;
  }

  body.portal-map-open .portal-map-dialog {
    height: 100dvh;
    max-width: 100dvw;
    overflow: hidden;
    width: 100dvw;
  }

  body.portal-map-open .portal-map-panel {
    inset: env(safe-area-inset-top) 0 calc(62px + env(safe-area-inset-bottom)) 0;
    max-width: 100dvw;
    overflow: hidden;
    width: 100dvw;
  }

  body.portal-map-open .portal-map-backdrop {
    bottom: calc(62px + env(safe-area-inset-bottom));
  }

  body.portal-map-open .mobile-hero-drawer:not(.hidden) {
    z-index: 2440;
  }

  body.portal-map-open .mobile-hero-bar:not(.hidden) {
    z-index: 2450;
  }
}

@media (max-width: 920px) {
  .portal-map-head {
    gap: 4px 8px;
    grid-template-columns: 36px minmax(0, 1fr) 36px;
    justify-items: center;
    max-width: 100%;
    overflow: hidden;
    padding: 10px 8px 4px;
    touch-action: none;
  }

  .portal-map-pull-handle {
    background: rgba(255, 250, 242, 0.38);
    border-radius: 999px;
    display: block;
    height: 3px;
    left: 50%;
    position: absolute;
    top: 4px;
    transform: translateX(-50%);
    width: 44px;
  }

  .portal-map-title-block {
    grid-column: 2;
    grid-row: 1;
    justify-items: center;
    gap: 0;
    min-height: 0;
    padding-left: 0;
    text-align: center;
    width: 100%;
  }

  .portal-map-title-block .kicker {
    font-size: 8px;
    line-height: 1.1;
  }

  .portal-map-head h2 {
    font-size: 16px;
    line-height: 1;
  }

  .portal-map-actions {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    gap: 12px;
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
    justify-self: center;
    max-width: min(100%, 430px);
    overflow-x: auto;
    padding: 0;
    scrollbar-width: none;
    width: auto;
    -webkit-overflow-scrolling: touch;
  }

  .portal-map-actions::-webkit-scrollbar {
    display: none;
  }

  .portal-map-tool,
  .portal-map-icon-btn {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    flex: 0 0 auto;
    height: 36px;
    width: 36px;
  }

  .portal-map-tool.active {
    background: transparent;
    color: #9edfff;
    filter: drop-shadow(0 0 10px rgba(115, 208, 255, 0.42));
  }

  .portal-map-tool:hover,
  .portal-map-icon-btn:hover {
    background: transparent;
    transform: none;
  }

  .portal-map-close-btn {
    grid-column: 3;
    grid-row: 1;
    position: relative;
    justify-self: end;
    z-index: 2;
  }

  .portal-map-initiative-strip,
  .initiative-turn-strip {
    background: transparent;
    backdrop-filter: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    gap: 14px;
    justify-self: stretch;
    margin: 2px 0 0;
    max-width: none;
    padding: 3px max(14px, calc(50% - 136px));
    scroll-padding-inline: max(14px, calc(50% - 136px));
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    width: 100%;
  }

  .initiative-turn-strip .portal-map-turn-card,
  .portal-map-turn-card {
    background: transparent;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    grid-template-columns: 46px;
    height: 46px;
    min-width: 46px;
    padding: 0;
    scroll-snap-align: center;
    transition:
      opacity 0.22s ease,
      transform 0.22s ease,
      width 0.24s ease,
      min-width 0.24s ease,
      height 0.24s ease,
      background 0.22s ease,
      border-color 0.22s ease,
      box-shadow 0.22s ease;
    width: 46px;
  }

  .initiative-turn-strip .portal-map-turn-card.current,
  .portal-map-turn-card.current {
    background:
      linear-gradient(135deg, rgba(245, 214, 107, 0.16), rgba(115, 208, 255, 0.08)),
      rgba(16, 20, 25, 0.9);
    border: 1px solid rgba(245, 214, 107, 0.46);
    border-radius: 14px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34), 0 0 22px rgba(245, 214, 107, 0.12);
    gap: 9px;
    grid-template-columns: 46px minmax(112px, 1fr);
    height: 64px;
    min-width: min(272px, calc(100vw - 112px));
    padding: 4px 30px 4px 4px;
    width: min(292px, calc(100vw - 96px));
  }

  .initiative-turn-strip .portal-map-turn-card.enemy.current,
  .initiative-turn-strip .portal-map-turn-card.self:not(.current),
  .portal-map-turn-card.enemy.current,
  .portal-map-turn-card.self:not(.current) {
    border: 0;
    box-shadow: none;
  }

  .initiative-turn-strip .portal-map-turn-card.enemy.current,
  .portal-map-turn-card.enemy.current {
    border: 1px solid rgba(211, 74, 91, 0.58);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.34), 0 0 22px rgba(211, 74, 91, 0.12);
  }

  .initiative-turn-strip .portal-map-turn-card.past:not(.current),
  .portal-map-turn-card.past:not(.current) {
    opacity: 0.36;
    transform: scale(0.92);
  }

  .initiative-turn-strip .portal-map-turn-card.future:not(.current),
  .portal-map-turn-card.future:not(.current) {
    opacity: 0.9;
  }

  .initiative-turn-strip .portal-map-turn-card-empty,
  .portal-map-turn-card-empty {
    min-width: 200px;
    width: auto;
  }

  .portal-map-turn-portrait {
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.34);
    height: 42px;
    width: 42px;
  }

  .initiative-turn-strip .portal-map-turn-card.current .portal-map-turn-main,
  .portal-map-turn-card.current .portal-map-turn-main {
    display: grid;
  }

  .initiative-turn-strip .portal-map-turn-card.current .portal-map-turn-index,
  .portal-map-turn-card.current .portal-map-turn-index {
    background: rgba(5, 7, 10, 0.86);
    border-color: rgba(255, 250, 242, 0.16);
    font-size: 9px;
    min-width: 19px;
    padding: 3px 5px;
    position: absolute;
    right: -4px;
    top: -3px;
  }

  .portal-map-turn-main strong {
    font-size: 13px;
  }

  .portal-map-turn-main span {
    font-size: 10px;
  }

  .portal-map-quick-drawer {
    display: block;
    height: 58px;
    left: auto;
    max-height: none;
    max-width: none;
    overflow: visible;
    right: 0;
    top: var(--portal-map-quick-y, 112px);
    width: 42px;
  }

  .portal-map-quick-tab {
    border-radius: 14px 0 0 14px;
    cursor: grab;
    height: 58px;
    touch-action: none;
    width: 42px;
  }

  .portal-map-quick-drawer.is-mobile-positioned.edge-right {
    left: auto;
    right: 0;
  }

  .portal-map-quick-drawer.is-mobile-positioned.edge-left {
    left: 0;
    right: auto;
  }

  .portal-map-quick-drawer.edge-left .portal-map-quick-tab {
    border-radius: 0 14px 14px 0;
  }

  .portal-map-quick-drawer.edge-left .portal-map-quick-tab svg {
    transform: rotate(180deg);
  }

  .portal-map-quick-drawer.is-dragging .portal-map-quick-tab {
    border-color: rgba(115, 208, 255, 0.82);
    cursor: grabbing;
    transform: scale(1.04);
  }

  .portal-map-quick-panel {
    left: var(--portal-map-quick-panel-x, -344px);
    max-height: var(--portal-map-quick-panel-max-height, calc(100dvh - 176px));
    overscroll-behavior: contain;
    position: absolute;
    right: auto;
    top: var(--portal-map-quick-panel-y, 0);
    touch-action: pan-y;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    width: min(336px, calc(100vw - 58px));
  }

  .portal-map-canvas-host {
    align-self: stretch;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    height: auto;
    margin: 4px 0 0;
    max-width: 100%;
    min-height: 0;
    width: 100%;
  }
}

@media (max-width: 420px) {
  .initiative-turn-strip {
    gap: 12px;
    padding-inline: max(12px, calc(50% - 126px));
    scroll-padding-inline: max(12px, calc(50% - 126px));
  }

  .initiative-turn-strip .portal-map-turn-card {
    grid-template-columns: 44px;
    height: 44px;
    min-width: 44px;
    width: 44px;
  }

  .initiative-turn-strip .portal-map-turn-card.current {
    grid-template-columns: 44px minmax(104px, 1fr);
    height: 62px;
    min-width: min(252px, calc(100vw - 96px));
    width: min(268px, calc(100vw - 84px));
  }

  .portal-map-head {
    padding-top: 9px;
    padding-bottom: 4px;
    padding-left: 6px;
    padding-right: 6px;
  }

  .portal-map-initiative-strip {
    gap: 12px;
    padding-inline: max(12px, calc(50% - 126px));
    scroll-padding-inline: max(12px, calc(50% - 126px));
  }

  .portal-map-turn-card {
    grid-template-columns: 44px;
    height: 44px;
    min-width: 44px;
    width: 44px;
  }

  .portal-map-turn-card.current {
    grid-template-columns: 44px minmax(104px, 1fr);
    height: 62px;
    min-width: min(252px, calc(100vw - 96px));
    width: min(268px, calc(100vw - 84px));
  }

  .portal-map-turn-card-empty {
    min-width: min(196px, calc(100vw - 34px));
    width: auto;
  }

  .portal-map-turn-portrait {
    height: 38px;
    width: 38px;
  }

  .portal-map-quick-drawer {
    right: 0;
    top: var(--portal-map-quick-y, 108px);
  }

  .portal-map-quick-drawer.is-mobile-positioned.edge-left {
    left: 0;
    right: auto;
    top: var(--portal-map-quick-y, 108px);
  }

  .portal-map-quick-drawer.is-mobile-positioned.edge-right {
    left: auto;
    right: 0;
    top: var(--portal-map-quick-y, 108px);
  }

  .portal-map-quick-panel {
    padding: 8px;
    width: calc(100vw - 52px);
  }

  .portal-map-hp-actions {
    grid-template-columns: 62px 1fr 1fr;
  }

  .portal-map-resource-grid {
    grid-template-columns: 1fr;
  }
}

.tutorial-dialog {
  inset: 0;
  position: fixed;
  z-index: 3600;
}

.tutorial-backdrop {
  background: rgba(9, 7, 10, 0.72);
  inset: 0;
  position: absolute;
}

.tutorial-panel {
  background: linear-gradient(180deg, rgba(32, 26, 32, 0.98), rgba(24, 17, 22, 0.98));
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  left: 50%;
  max-height: min(780px, calc(100dvh - 40px));
  max-width: min(980px, calc(100vw - 36px));
  overflow: hidden;
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
}

.tutorial-head {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
}

.tutorial-head h2 {
  font-size: 1.35rem;
  letter-spacing: 0;
  margin: 2px 0 0;
}

.tutorial-body {
  display: grid;
  gap: 16px;
  overflow: auto;
  padding: 18px;
}

.tutorial-intro {
  align-items: center;
  background: rgba(216, 157, 74, 0.08);
  border: 1px solid rgba(216, 157, 74, 0.22);
  border-radius: 8px;
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(180px, 0.35fr) minmax(0, 1fr);
  padding: 14px;
}

.tutorial-intro span,
.tutorial-chapter-card span,
.tutorial-coach-main span {
  color: var(--gold);
  display: block;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tutorial-intro strong {
  display: block;
  font-size: 1.05rem;
}

.tutorial-intro p,
.tutorial-chapter-card p,
.tutorial-coach-main p {
  color: var(--muted);
  margin: 0;
}

.tutorial-chapter-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.tutorial-chapter-card {
  background: rgba(255, 243, 231, 0.045);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 14px;
  grid-template-rows: minmax(0, 1fr) auto;
  padding: 14px;
  position: relative;
}

.tutorial-chapter-card.complete {
  background:
    linear-gradient(145deg, rgba(85, 184, 120, 0.16), rgba(255, 243, 231, 0.035) 58%),
    rgba(255, 243, 231, 0.045);
  border-color: rgba(85, 184, 120, 0.74);
  box-shadow: inset 0 0 0 1px rgba(216, 255, 229, 0.08), 0 0 18px rgba(85, 184, 120, 0.12);
}

.tutorial-chapter-card.active {
  border-color: rgba(var(--accent-rgb), 0.62);
  box-shadow: 0 0 0 1px rgba(var(--accent-rgb), 0.2);
}

.tutorial-chapter-card.complete.active {
  border-color: rgba(85, 184, 120, 0.86);
  box-shadow: inset 0 0 0 1px rgba(216, 255, 229, 0.12), 0 0 0 1px rgba(85, 184, 120, 0.24), 0 0 22px rgba(85, 184, 120, 0.16);
}

.tutorial-chapter-card.complete .tutorial-chapter-state {
  color: #9be2b0;
}

.tutorial-chapter-state {
  align-items: center;
  display: flex !important;
  gap: 7px;
}

.tutorial-chapter-check,
.codex-complete-badge {
  align-items: center;
  background: rgba(85, 184, 120, 0.22);
  border: 1px solid rgba(155, 226, 176, 0.74);
  border-radius: 999px;
  color: #dffff0;
  display: inline-grid;
  font-size: 0.72rem;
  font-weight: 950;
  height: 22px;
  line-height: 1;
  place-items: center;
  text-shadow: 0 0 10px rgba(85, 184, 120, 0.5);
  width: 22px;
}

.tutorial-chapter-card strong {
  display: block;
  font-size: 1rem;
  margin-top: 4px;
}

.tutorial-hub-actions {
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
  padding-top: 14px;
}

.tutorial-coach {
  background: rgba(24, 17, 22, 0.97);
  border: 1px solid rgba(216, 157, 74, 0.34);
  border-radius: 8px;
  bottom: max(18px, env(safe-area-inset-bottom));
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  left: 50%;
  max-width: min(720px, calc(100vw - 32px));
  padding: 14px;
  position: fixed;
  transform: translateX(-50%);
  width: max-content;
  z-index: 2500;
}

.tutorial-coach-main strong {
  display: block;
  font-size: 1rem;
  margin: 2px 0 4px;
}

.tutorial-coach-tab {
  appearance: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  display: grid;
  gap: 2px;
  justify-items: start;
  min-width: 0;
  padding: 0;
  text-align: left;
}

.tutorial-coach-tab strong {
  display: block;
  font-size: 0.95rem;
  line-height: 1.15;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  width: 100%;
}

.tutorial-coach-tab em {
  color: var(--gold);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.tutorial-coach-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.tutorial-target-active {
  box-shadow:
    inset 0 0 0 3px rgba(var(--tutorial-highlight-rgb), 0.82),
    0 0 0 2px rgba(236, 255, 244, 0.34),
    0 0 0 7px rgba(var(--tutorial-highlight-rgb), 0.16),
    0 0 24px rgba(var(--tutorial-highlight-rgb), 0.38) !important;
  outline: 2px solid rgba(var(--tutorial-highlight-rgb), 0.92) !important;
  outline-offset: 5px;
  position: relative;
  z-index: 12;
}

.sheet-tab.tutorial-target-active,
.sheet-arrow.tutorial-target-active {
  background: rgba(var(--tutorial-highlight-rgb), 0.1) !important;
  border-color: rgba(var(--tutorial-highlight-rgb), 0.9) !important;
  box-shadow:
    inset 0 0 0 2px rgba(var(--tutorial-highlight-rgb), 0.74),
    0 0 0 1px rgba(236, 255, 244, 0.42),
    0 0 18px rgba(var(--tutorial-highlight-rgb), 0.45) !important;
  color: #f3fff8 !important;
  outline: none !important;
  text-shadow: 0 0 10px rgba(var(--tutorial-highlight-rgb), 0.42);
}

.world-atlas-zones .tutorial-target-active {
  fill: rgba(var(--tutorial-highlight-rgb), 0.28) !important;
  filter: drop-shadow(0 0 10px rgba(var(--tutorial-highlight-rgb), 0.76));
  stroke: rgba(236, 255, 244, 0.95) !important;
  stroke-width: 1.4px !important;
}

.world-atlas-marker.tutorial-target-active {
  transform: translate(-50%, -50%) scale(1.08);
}

body.tutorial-mode #supportWidget {
  z-index: 2600;
}

@media (max-width: 760px) {
  .tutorial-panel {
    border-radius: 8px 8px 0 0;
    bottom: 0;
    left: 0;
    max-height: min(88dvh, 760px);
    max-width: 100%;
    top: auto;
    transform: none;
  }

  .tutorial-head,
  .tutorial-body {
    padding-left: max(14px, env(safe-area-inset-left));
    padding-right: max(14px, env(safe-area-inset-right));
  }

  .tutorial-intro {
    grid-template-columns: 1fr;
  }

  .tutorial-chapter-grid {
    grid-template-columns: 1fr;
  }

  .tutorial-hub-actions {
    justify-content: stretch;
  }

  .tutorial-hub-actions .btn,
  .tutorial-chapter-card .btn {
    width: 100%;
  }

  .tutorial-coach {
    bottom: auto;
    grid-template-columns: 1fr;
    left: 50%;
    max-height: min(44dvh, calc(100dvh - var(--tutorial-coach-mobile-top, calc(92px + env(safe-area-inset-top))) - 88px));
    max-width: calc(100vw - 20px);
    overflow: auto;
    right: auto;
    top: var(--tutorial-coach-mobile-top, calc(92px + env(safe-area-inset-top)));
    transform: translateX(-50%);
    width: min(720px, calc(100vw - 20px));
  }

  .tutorial-coach.is-expanded {
    backdrop-filter: blur(18px);
    padding: 12px;
  }

  .tutorial-coach.is-collapsed {
    align-items: center;
    bottom: auto;
    gap: 10px;
    grid-template-columns: minmax(0, 1fr) auto;
    left: 50%;
    max-height: none;
    max-width: calc(100vw - 20px);
    overflow: hidden;
    padding: 8px 9px;
    right: auto;
    top: var(--tutorial-coach-mobile-top, calc(92px + env(safe-area-inset-top)));
    transform: translateX(-50%);
    width: min(720px, calc(100vw - 20px));
  }

  .tutorial-coach.is-collapsed .tutorial-coach-actions {
    flex-wrap: nowrap;
  }

  .tutorial-coach.is-collapsed .tutorial-coach-actions .btn {
    flex: 0 0 auto;
    min-height: 34px;
    padding-left: 10px;
    padding-right: 10px;
  }

  .tutorial-coach.is-collapsed .tutorial-coach-tab strong {
    font-size: 0.88rem;
  }

  body.tutorial-mode #supportWidget {
    display: none;
  }

  body.tutorial-mode .sheet-compass.page-menu-open {
    z-index: 2700;
  }

  body.tutorial-mode .sheet-compass.page-menu-open .sheet-page-menu:not(.hidden) {
    z-index: 1;
  }

  body.tutorial-mode .codex-sticky-header:has(#codexQuickMenu:not(.hidden)) {
    z-index: 2700;
  }

  body.tutorial-mode #codexQuickMenu:not(.hidden) {
    z-index: 1;
  }

  body.tutorial-mode #conditionsWrap:has(#conditionMenu:not(.hidden)) {
    z-index: 2700;
  }

  body.tutorial-mode #conditionMenu:not(.hidden) {
    z-index: 1;
  }

  body.tutorial-mode #codexLoreDialog:not(.hidden) {
    z-index: 2800;
  }

  .tutorial-coach-actions {
    justify-content: stretch;
  }

  .tutorial-coach-actions .btn {
    flex: 1 1 96px;
  }
}
