:root {
  color-scheme: dark;
  --bg: #0c1015;
  --bg-2: #111820;
  --panel: rgba(25, 31, 40, 0.88);
  --panel-strong: #1d242e;
  --panel-soft: rgba(255, 255, 255, 0.055);
  --line: rgba(255, 255, 255, 0.11);
  --line-strong: rgba(255, 255, 255, 0.2);
  --text: #f4efe4;
  --muted: #aeb5bd;
  --dim: #6f7781;
  --gold: #d7a84f;
  --feat-title-yellow: #ffd86a;
  --teal: #49b6aa;
  --red: #b95748;
  --ink: #17120d;
  --paper: #d8c19c;
  --paper-2: #eadbbf;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.42);
  --radius: 8px;
  --sidebar: 124px;
  --font-body: "Segoe UI Variable Text", "Segoe UI", "Noto Sans", "Liberation Sans", Arial, sans-serif;
  --font-display: Georgia, "Times New Roman", "Noto Serif", serif;
  font-family: var(--font-body);
  font-size: 16px;
  letter-spacing: 0;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  font-family: var(--font-body);
  background:
    linear-gradient(110deg, rgba(12, 16, 21, 0.96), rgba(12, 16, 21, 0.74)),
    url("./assets/worlds/vandrya-banners-sheet.jpg") center / cover fixed;
}

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

body.builder-modal-open {
  overflow: hidden;
}

body.auth-open {
  overflow: hidden;
}

body.auth-open .app-shell {
  visibility: hidden;
  pointer-events: none;
}

.auth-screen[hidden] {
  display: none;
}

.auth-screen {
  position: fixed;
  inset: 0;
  z-index: 500;
  display: grid;
  grid-template-columns: minmax(420px, 54vw) minmax(420px, 1fr);
  min-height: 100vh;
  padding: 14px;
  color: #f7f1ea;
  background: #151823;
  isolation: isolate;
  overflow: hidden;
}

.auth-screen::before {
  content: "";
  position: absolute;
  z-index: -2;
  inset: -28px;
  background: url("./assets/Themes/login-page.png") center / cover no-repeat;
  filter: blur(18px);
  transform: scale(1.04);
  opacity: 0.72;
  pointer-events: none;
}

.auth-screen::after {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(9, 12, 20, 0.1), rgba(9, 12, 20, 0.58) 54%, rgba(8, 11, 18, 0.82)),
    radial-gradient(circle at 70% 74%, rgba(154, 144, 104, 0.2), transparent 28%);
  pointer-events: none;
}

.auth-art-panel {
  position: relative;
  overflow: hidden;
  min-height: calc(100vh - 28px);
  border-radius: 18px;
  background: #232b3c;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.38);
}

.auth-art-panel img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.auth-art-panel::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10, 14, 24, 0.01), rgba(10, 14, 24, 0.08));
  pointer-events: none;
}

.auth-form-panel {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  min-height: calc(100vh - 28px);
  padding: 40px;
}

.auth-logo {
  position: absolute;
  top: 30px;
  left: 50%;
  width: 86px;
  height: 86px;
  object-fit: contain;
  transform: translateX(-50%);
  filter:
    drop-shadow(0 0 18px rgba(255, 236, 180, 0.32))
    drop-shadow(0 8px 18px rgba(0, 0, 0, 0.42));
}

.auth-card {
  width: min(430px, 100%);
  display: grid;
  gap: 13px;
  padding: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 26px 70px rgba(0, 0, 0, 0.18);
  backdrop-filter: blur(16px);
  animation: authCardIn 240ms ease-out;
}

.forced-password-layer {
  width: 100%;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
}

.forced-password-card {
  position: relative;
  width: min(460px, 100%);
  display: grid;
  gap: 14px;
  padding: 116px 30px 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 24px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.07), rgba(255, 255, 255, 0.025));
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.08),
    0 26px 70px rgba(0, 0, 0, 0.2);
  backdrop-filter: blur(16px);
}

.forced-password-card .auth-logo {
  top: 26px;
}

.forced-password-card h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1;
}

.forced-password-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.66);
  font-size: 13px;
  line-height: 1.55;
}

.forced-password-card form {
  display: grid;
  gap: 12px;
}

@keyframes authCardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-card h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1;
  letter-spacing: -0.03em;
}

.auth-card > p {
  margin: 0 0 6px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 13px;
  line-height: 1.55;
}

.auth-notice {
  padding: 10px 12px;
  border: 1px solid rgba(255, 190, 120, 0.28);
  border-radius: 12px;
  background: rgba(255, 190, 120, 0.12);
  color: #ffe0ad;
  font-size: 12px;
  line-height: 1.4;
}

.auth-notice.is-info,
.auth-notice.is-success {
  border-color: rgba(180, 220, 255, 0.28);
  background: rgba(130, 170, 220, 0.14);
  color: #dcecff;
}

.auth-maintenance-banner {
  padding: 11px 13px;
  border: 1px solid rgba(215, 168, 79, 0.34);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(215, 168, 79, 0.2), rgba(100, 70, 30, 0.08)),
    rgba(9, 12, 18, 0.34);
  color: #ffe6ad;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.auth-field {
  display: grid;
  gap: 7px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.auth-field input {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  padding: 0 14px;
  outline: none;
}

.auth-field input:focus {
  border-color: rgba(255, 255, 255, 0.52);
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

.auth-primary-button,
.auth-provider-stack button {
  min-height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-weight: 800;
}

.auth-primary-button {
  margin-top: 4px;
  background: rgba(255, 255, 255, 0.28);
}

.auth-provider-stack {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.auth-provider-option {
  display: grid;
  gap: 4px;
}

.auth-provider-stack button {
  border-color: rgba(196, 83, 83, 0.34);
  background: linear-gradient(180deg, rgba(117, 45, 50, 0.3), rgba(66, 25, 30, 0.34));
  color: rgba(255, 222, 222, 0.62);
}

.auth-provider-stack button:disabled {
  opacity: 1;
  cursor: not-allowed;
}

.auth-provider-option small {
  color: #d98282;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-align: center;
  text-transform: uppercase;
}

.auth-primary-button:hover,
.auth-provider-stack button:not(:disabled):hover {
  background: rgba(255, 255, 255, 0.3);
}

.auth-switch {
  text-align: center;
  color: rgba(255, 255, 255, 0.66);
}

.auth-switch button {
  color: #fff;
  background: transparent;
  font-weight: 900;
}

.auth-footer {
  position: absolute;
  bottom: 22px;
  color: rgba(255, 255, 255, 0.62);
  font-size: 12px;
}

.auth-footer span {
  margin: 0 8px;
  opacity: 0.45;
}

@media (min-width: 821px) and (max-width: 1180px) {
  .auth-logo {
    top: 24px;
    width: 76px;
    height: 76px;
  }
}

@media (max-width: 820px) {
  body.auth-open {
    overflow: hidden;
  }

  .auth-screen {
    display: block;
    min-height: 100dvh;
    padding: 0;
    overflow-x: hidden;
    overflow-y: auto;
  }

  .auth-screen::before {
    inset: -24px;
    filter: blur(14px);
    transform: scale(1.08);
    opacity: 0.58;
  }

  .auth-screen::after {
    background:
      linear-gradient(180deg, rgba(7, 10, 17, 0.64), rgba(7, 10, 17, 0.86)),
      radial-gradient(circle at 50% 30%, rgba(167, 142, 188, 0.2), transparent 42%);
  }

  .auth-art-panel {
    display: none;
  }

  .auth-form-panel {
    display: flex;
    min-height: 100dvh;
    align-items: center;
    justify-content: center;
    padding: 88px 18px 72px;
  }

  .auth-logo {
    position: fixed;
    top: 18px;
    width: 72px;
    height: 72px;
  }

  .auth-card {
    width: min(430px, 100%);
    padding: 22px;
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(15, 18, 28, 0.76);
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.48);
    backdrop-filter: blur(18px);
  }

  .auth-card h1 {
    font-size: clamp(30px, 10vw, 40px);
  }

  .auth-footer {
    position: absolute;
    bottom: 20px;
    left: 50%;
    width: max-content;
    max-width: calc(100vw - 24px);
    transform: translateX(-50%);
    text-align: center;
  }
}

@media (max-width: 420px) {
  .auth-form-panel {
    align-items: flex-start;
    padding: 94px 12px 70px;
  }

  .auth-logo {
    top: 14px;
    width: 66px;
    height: 66px;
  }

  .auth-card {
    padding: 18px;
    border-radius: 19px;
  }

  .auth-field input,
  .auth-primary-button,
  .auth-provider-stack button {
    min-height: 46px;
  }

  .auth-footer {
    font-size: 10px;
  }
}

.auth-user-panel {
  display: flex;
  align-items: center;
}

.auth-user-chip {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  max-width: 260px;
  padding: 7px 8px;
  border: 1px solid rgba(215, 168, 79, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.055);
}

.auth-user-chip > span {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  color: #2c2111;
  background: linear-gradient(135deg, #f0d58f, #bd8d3b);
  font-weight: 900;
}

.auth-user-chip strong,
.auth-user-chip small {
  display: block;
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.auth-user-chip strong {
  color: var(--text);
  font-size: 12px;
}

.auth-user-chip small {
  color: var(--muted);
  font-size: 10px;
}

.auth-user-chip button {
  padding: 7px 9px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.admin-access-panel {
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid rgba(215, 168, 79, 0.2);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(215, 168, 79, 0.14), transparent 32%),
    linear-gradient(135deg, rgba(18, 23, 32, 0.94), rgba(8, 12, 18, 0.9));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06), 0 18px 45px rgba(0, 0, 0, 0.26);
}

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

.admin-access-grid label {
  display: grid;
  gap: 8px;
  color: rgba(244, 239, 228, 0.82);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-access-grid textarea {
  min-height: 112px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 13px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  outline: none;
}

.admin-access-grid textarea:focus {
  border-color: rgba(215, 168, 79, 0.48);
  box-shadow: 0 0 0 3px rgba(215, 168, 79, 0.1);
}

.admin-access-summary {
  display: grid;
  align-content: start;
  gap: 8px;
  min-height: 112px;
  padding: 14px;
  border: 1px solid rgba(73, 182, 170, 0.2);
  border-radius: 13px;
  background: rgba(73, 182, 170, 0.07);
}

.admin-access-summary span,
.admin-access-summary small {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.admin-access-summary strong {
  color: var(--gold);
  font-size: 18px;
  letter-spacing: 0.03em;
}

.admin-access-summary p {
  margin: 0;
  color: rgba(244, 239, 228, 0.72);
  font-size: 13px;
  line-height: 1.45;
}

.admin-access-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 14px;
}

.settings-users-panel {
  display: grid;
  gap: 16px;
}

.settings-user-search {
  min-width: min(320px, 100%);
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-user-search input,
.settings-user-password input {
  min-height: 42px;
  border: 1px solid rgba(215, 168, 79, 0.18);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
  color: var(--text);
  padding: 0 12px;
}

.settings-user-notice {
  padding: 10px 12px;
  border: 1px solid rgba(91, 164, 255, 0.22);
  border-radius: 10px;
  color: #d7e8ff;
  background: rgba(91, 164, 255, 0.08);
  font-size: 12px;
}

.settings-user-notice.is-error {
  border-color: rgba(255, 120, 120, 0.28);
  color: #ffd0d0;
  background: rgba(255, 120, 120, 0.08);
}

.settings-user-notice.is-success {
  border-color: rgba(102, 197, 184, 0.28);
  color: #d5fff8;
  background: rgba(102, 197, 184, 0.08);
}

.settings-users-grid {
  display: grid;
  gap: 12px;
}

.settings-user-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(91, 164, 255, 0.18);
  border-radius: 12px;
  background: rgba(4, 9, 15, 0.62);
}

.settings-user-card > header {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.settings-user-card h3 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 18px;
}

.settings-user-card header span {
  color: var(--muted);
  font-size: 12px;
}

.settings-user-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.settings-user-badges span {
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  padding: 0 9px;
  border: 1px solid rgba(215, 168, 79, 0.22);
  border-radius: 999px;
  color: #ffe7b0;
  background: rgba(215, 168, 79, 0.08);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-user-badges .is-warning {
  border-color: rgba(255, 160, 95, 0.32);
  color: #ffd8b8;
  background: rgba(255, 160, 95, 0.1);
}

.settings-user-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  margin: 0;
}

.settings-user-meta div {
  display: grid;
  gap: 3px;
}

.settings-user-meta dt {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-user-meta dd {
  min-width: 0;
  margin: 0;
  color: #cbd8ea;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.settings-user-password {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: end;
}

.settings-user-password label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-user-characters {
  display: grid;
  gap: 8px;
}

.settings-user-characters h4 {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.settings-user-character-list {
  display: grid;
  gap: 7px;
}

.settings-user-character-list article,
.settings-user-empty {
  margin: 0;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.settings-user-character-list article {
  display: grid;
  gap: 2px;
}

.settings-user-character-list strong {
  color: var(--text);
  font-size: 13px;
}

.settings-user-character-list span,
.settings-user-empty {
  color: var(--muted);
  font-size: 12px;
}

@media (max-width: 980px) {
  .admin-access-grid {
    grid-template-columns: 1fr;
  }

  .settings-user-card > header,
  .settings-user-password,
  .settings-user-meta {
    grid-template-columns: 1fr;
  }

  .settings-user-card > header {
    display: grid;
  }

  .settings-user-badges {
    justify-content: flex-start;
  }
}

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

button {
  border: 0;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

img {
  display: block;
  max-width: 100%;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 16px 10px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  background: rgba(10, 14, 19, 0.86);
  border-right: 1px solid var(--line);
  backdrop-filter: blur(22px);
  z-index: 20;
}

.brand {
  width: 68px;
  min-height: 76px;
  display: grid;
  place-items: center;
  gap: 6px;
  color: var(--text);
  background: transparent;
  text-align: center;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 168, 79, 0.52);
  border-radius: 8px;
  color: var(--gold);
  background: linear-gradient(145deg, rgba(215, 168, 79, 0.14), rgba(73, 182, 170, 0.08));
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.brand-logo {
  width: 42px;
  height: 42px;
  flex: 0 0 auto;
  object-fit: contain;
  filter: drop-shadow(0 0 10px rgba(215, 168, 79, 0.22));
}

.mobile-menu-toggle,
.mobile-nav-backdrop,
.mobile-nav-logout {
  display: none;
}

.brand strong,
.brand small {
  display: none;
}

.main-nav {
  width: 100%;
  display: grid;
  gap: 8px;
}

.nav-button {
  width: 100%;
  min-height: 58px;
  display: grid;
  place-items: center;
  gap: 4px;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  padding: 6px 4px;
  overflow: hidden;
}

.nav-button span:last-child {
  font-size: 10px;
  line-height: 1.2;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  text-transform: uppercase;
}

.nav-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 22px;
  line-height: 1;
  color: var(--dim);
  font-size: 18px;
}

.nav-icon-sheet {
  width: 18px;
  height: 22px;
  border-radius: 3px;
  background:
    url("./assets/icons/ficha-menu.svg") center / contain no-repeat;
  border: none;
  box-shadow: none;
}

.nav-button:hover,
.nav-button.is-active {
  color: var(--text);
  background: rgba(255, 255, 255, 0.07);
  border-color: var(--line);
}

.nav-button.is-active .nav-icon {
  color: var(--gold);
}

.nav-button:hover .nav-icon-sheet,
.nav-button.is-active .nav-icon-sheet {
  filter: drop-shadow(0 0 8px rgba(216, 176, 106, 0.24));
}

.sidebar-footer {
  margin-top: auto;
  width: 100%;
  color: var(--dim);
  font-size: 10px;
  text-align: center;
  text-transform: uppercase;
}

.sidebar-footer strong {
  display: block;
  margin-top: 5px;
  color: var(--gold);
  font-size: 11px;
}

.workspace {
  min-width: 0;
  padding: 28px;
}

.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 24px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
}

.topbar .eyebrow {
  margin-bottom: 4px;
  font-size: 10px;
}

h1,
h2,
h3,
p {
  overflow-wrap: anywhere;
}

h1 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 4vw, 54px);
  font-weight: 600;
  line-height: 1;
}

h2,
h3 {
  margin: 0;
  line-height: 1.1;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.workspace.is-bestiary .topbar .search-field {
  display: none;
}

.search-field {
  width: min(340px, 42vw);
  min-width: 210px;
  display: grid;
  gap: 6px;
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
}

.search-field input,
select,
input,
textarea {
  width: 100%;
  color: var(--text);
  background: rgba(19, 25, 33, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  outline: 0;
}

.search-field input,
select,
input {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 112px;
  padding: 12px;
  resize: vertical;
}

label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.primary-button,
.accent-button,
.danger-button,
.ghost-button,
.icon-button,
.filter-pill {
  min-height: 42px;
  padding: 0 14px;
  border-radius: var(--radius);
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.07);
}

.primary-button {
  background: linear-gradient(135deg, #e4bf6e, #9c6930);
  color: #17120d;
  border-color: rgba(255, 224, 152, 0.42);
  font-weight: 800;
}

.accent-button {
  background: linear-gradient(135deg, #49b6aa, #286f75);
  color: #071314;
  border-color: rgba(95, 228, 214, 0.34);
  font-weight: 800;
}

.danger-button {
  background: linear-gradient(135deg, #c64a4a, #702323);
  color: #fff4ef;
  border-color: rgba(255, 132, 112, 0.34);
  font-weight: 800;
}

.danger-button:hover {
  border-color: rgba(255, 166, 146, 0.52);
  filter: brightness(1.08);
}

.ghost-button:hover,
.ghost-button.is-active,
.icon-button:hover,
.filter-pill:hover {
  background: rgba(255, 255, 255, 0.11);
}

.ghost-button.is-active {
  border-color: rgba(215, 168, 79, 0.42);
  color: var(--gold);
}

.icon-button {
  width: 42px;
  padding: 0;
  display: grid;
  place-items: center;
  font-size: 18px;
}

.view {
  display: none;
}

.view.is-active {
  display: block;
}

.library-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
}

.filter-rail {
  display: grid;
  align-content: start;
  gap: 10px;
}

.filter-pill {
  justify-content: center;
  text-transform: uppercase;
  color: rgba(244, 239, 228, 0.72);
  min-height: 50px;
  font-weight: 700;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.05);
}

.filter-pill.is-active {
  color: var(--text);
  background: linear-gradient(180deg, rgba(215, 168, 79, 0.16), rgba(255, 255, 255, 0.04));
  border-color: rgba(215, 168, 79, 0.36);
  box-shadow: inset 0 0 0 1px rgba(255, 214, 133, 0.08);
}

.filter-panel {
  display: grid;
  gap: 12px;
  padding: 18px 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.filter-panel h2 {
  color: var(--text);
  font-size: 13px;
  margin: 0;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.radio-line {
  display: flex;
  align-items: center;
  gap: 8px;
  text-transform: none;
}

.radio-line input {
  width: 16px;
  min-height: 16px;
}

.character-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 18px;
}

.character-card {
  position: relative;
  min-height: 318px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.character-card button {
  width: 100%;
  height: 100%;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.character-card img,
.character-card .portrait-placeholder {
  width: 100%;
  height: 100%;
  min-height: 318px;
  object-fit: cover;
  object-position: top center;
  filter: saturate(0.92) contrast(1.05);
}

.card-fade {
  position: absolute;
  inset: auto 0 0;
  padding: 64px 16px 16px;
  background: linear-gradient(transparent, rgba(0, 0, 0, 0.92));
}

.card-fade h2 {
  margin-bottom: 4px;
  font-size: 18px;
  text-transform: uppercase;
}

.card-fade small {
  display: block;
  margin: -1px 0 5px;
  color: rgba(226, 235, 245, 0.68);
  font-size: 11px;
  letter-spacing: 0.05em;
}

.card-fade p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.card-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 10px;
}

.tag {
  display: inline-flex;
  min-height: 24px;
  align-items: center;
  padding: 0 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.07);
  font-size: 11px;
  text-transform: uppercase;
}

.add-card {
  min-height: 318px;
  display: grid;
  place-items: center;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.add-card button {
  width: calc(100% - 26px);
  min-height: 292px;
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
}

.add-card strong {
  display: block;
  color: var(--text);
  font-size: 38px;
  font-weight: 300;
}

.builder-layout {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr) 340px;
  gap: 22px;
  align-items: start;
}

.builder-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: clamp(10px, 2vh, 20px);
  z-index: 120;
}

.builder-modal.is-open {
  display: flex;
}

.builder-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(10px);
}

.builder-modal-shell {
  position: relative;
  z-index: 1;
  width: min(98vw, 1540px);
  height: min(92dvh, 900px);
  max-height: calc(100dvh - 20px);
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.96), rgba(7, 10, 15, 0.94));
  box-shadow: 0 32px 100px rgba(0, 0, 0, 0.56);
}

.builder-modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  color: transparent;
  background: rgba(8, 11, 16, 0.72);
  z-index: 3;
  font-size: 0;
  line-height: 1;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.builder-modal-close::before,
.builder-modal-close::after,
.class-detail-close::before,
.class-detail-close::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 2px;
  border-radius: 999px;
  background: rgba(232, 238, 247, 0.76);
  transform-origin: center;
  transition: background-color 180ms ease, transform 180ms ease;
}

.builder-modal-close::before,
.class-detail-close::before {
  transform: rotate(45deg);
}

.builder-modal-close::after,
.class-detail-close::after {
  transform: rotate(-45deg);
}

.builder-modal-close:hover,
.class-detail-close:hover {
  transform: translateY(-1px);
  border-color: rgba(221, 191, 112, 0.45);
  background: rgba(221, 191, 112, 0.12);
}

.builder-modal-close:hover::before,
.builder-modal-close:hover::after,
.class-detail-close:hover::before,
.class-detail-close:hover::after {
  background: #fff5d2;
}

.builder-editor-toggle {
  position: absolute;
  top: 68px;
  right: 18px;
  min-height: 28px;
  padding: 0 10px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: rgba(232, 238, 247, 0.72);
  background: rgba(8, 11, 16, 0.72);
  z-index: 3;
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.builder-editor-toggle:hover {
  transform: translateY(-1px);
  border-color: rgba(221, 191, 112, 0.42);
  color: #fff5d2;
  background: rgba(221, 191, 112, 0.12);
}

.builder-editor-toggle.is-active {
  border-color: rgba(221, 191, 112, 0.55);
  color: #fff5d2;
  background: rgba(221, 191, 112, 0.16);
}

.builder-modal-progress {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(var(--step-count, 9), minmax(0, 1fr));
  gap: 0;
  padding: 26px 42px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  background: linear-gradient(180deg, rgba(10, 14, 20, 1), rgba(9, 13, 19, 0.98));
}

.builder-modal-progress::before {
  content: "";
  position: absolute;
  left: 62px;
  right: 62px;
  top: 75px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.23) 5%, rgba(255, 255, 255, 0.23) 95%, transparent);
  pointer-events: none;
}

.builder-modal-stage {
  position: relative;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  overflow: hidden;
}

.builder-modal-shell.is-theme-step {
  grid-template-rows: auto minmax(0, 1fr);
}

.builder-modal-shell.is-theme-step .builder-modal-stage {
  grid-template-columns: minmax(0, 1fr);
}

.builder-modal-shell.is-theme-step .builder-stage-preview,
.builder-modal-shell.is-theme-step .builder-modal-actions {
  display: none;
}

.builder-stage-card {
  min-height: 0;
  padding: 38px 40px 28px;
  overflow: auto;
  background:
    linear-gradient(90deg, rgba(5, 9, 14, 0.9), rgba(5, 9, 14, 0.68) 38%, rgba(5, 9, 14, 0.5)),
    var(--builder-stage-image, url("./assets/worlds/lumina.jpg")) center / cover;
}

.builder-modal-shell.is-theme-step .builder-stage-card {
  height: 100%;
  padding: 14px;
  overflow: hidden;
  background: #05080d;
}

.builder-stage-preview {
  display: grid;
  gap: 18px;
  align-content: start;
  padding: 32px 26px;
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(7, 10, 15, 0.82);
  backdrop-filter: blur(14px);
  overflow: auto;
}

.builder-modal-actions {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 28px 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  background: linear-gradient(180deg, rgba(11, 15, 22, 0.92), rgba(8, 11, 16, 0.96));
}

.builder-modal-actions .primary-button,
.builder-modal-actions .accent-button,
.builder-modal-actions .ghost-button {
  min-width: 180px;
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) .builder-modal-actions {
  padding: 12px 28px 18px;
  border-top: 0;
  background: transparent;
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #prevStepButton,
.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #nextStepButton {
  position: relative;
  min-width: 178px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--text);
  background: rgba(18, 23, 31, 0.74);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.34), inset 0 0 18px rgba(255, 255, 255, 0.07);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 900;
  transition: transform 180ms ease, box-shadow 260ms ease, background-color 260ms ease, border-color 260ms ease, opacity 260ms ease;
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #prevStepButton {
  padding: 0 28px 0 12px;
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #nextStepButton {
  padding: 0 12px 0 28px;
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #prevStepButton::before,
.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #nextStepButton::after {
  content: "";
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  transition: transform 180ms ease, background-color 260ms ease;
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #prevStepButton::after,
.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #nextStepButton::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #prevStepButton::after {
  left: 27px;
  transform: rotate(-135deg);
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #nextStepButton::before {
  right: 28px;
  transform: rotate(45deg);
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #prevStepButton:hover:not(:disabled),
.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #nextStepButton:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4), inset 0 0 18px rgba(255, 255, 255, 0.1);
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #nextStepButton:hover:not(:disabled)::after {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.2);
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #prevStepButton:hover:not(:disabled)::before {
  transform: translateX(-2px);
  background: rgba(255, 255, 255, 0.2);
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #prevStepButton:disabled,
.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) #nextStepButton:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  filter: grayscale(0.35);
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(18, 23, 31, 0.42);
}

.builder-modal-shell.is-class-step .builder-modal-stage {
  grid-template-columns: minmax(0, 1fr);
}

.builder-modal-shell:is(.is-class-step, .is-race-step, .is-background-step, .is-origin-step, .is-morality-step) {
  height: min(92dvh, 860px);
  max-height: calc(100dvh - 40px);
}

.builder-modal-shell.is-class-step .builder-stage-preview {
  display: none;
}

.builder-modal-shell.is-race-step .builder-modal-stage {
  grid-template-columns: minmax(0, 1fr);
}

.builder-modal-shell.is-race-step .builder-stage-preview {
  display: none;
}

.builder-modal-shell.is-race-step .builder-stage-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4, 8, 13, 0.98), rgba(7, 12, 18, 0.72) 44%, rgba(5, 9, 14, 0.96)),
    linear-gradient(180deg, rgba(5, 9, 14, 0.2), rgba(5, 9, 14, 0.88)),
    var(--builder-stage-image, url("./assets/worlds/vandrya-realms-sheet-v2.jpg")) center / cover;
}

.builder-modal-shell.is-background-step .builder-modal-stage {
  grid-template-columns: minmax(0, 1fr);
}

.builder-modal-shell.is-background-step .builder-stage-preview {
  display: none;
}

.builder-modal-shell.is-background-step .builder-stage-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4, 8, 13, 0.98), rgba(7, 12, 18, 0.7) 44%, rgba(5, 9, 14, 0.96)),
    linear-gradient(180deg, rgba(5, 9, 14, 0.34), rgba(5, 9, 14, 0.9)),
    #04080d;
}

.builder-modal-shell.is-origin-step .builder-modal-stage {
  grid-template-columns: minmax(0, 1fr);
}

.builder-modal-shell.is-origin-step .builder-stage-preview {
  display: none;
}

.builder-modal-shell.is-origin-step .builder-stage-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4, 8, 13, 0.98), rgba(6, 10, 16, 0.72) 42%, rgba(4, 8, 13, 0.96)),
    linear-gradient(180deg, rgba(5, 9, 14, 0.24), rgba(5, 9, 14, 0.92)),
    #04080d;
}

.builder-modal-shell.is-morality-step .builder-modal-stage {
  grid-template-columns: minmax(0, 1fr);
}

.builder-modal-shell.is-morality-step .builder-stage-preview {
  display: none;
}

.builder-modal-shell.is-morality-step .builder-stage-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(180deg, rgba(5, 9, 14, 0.18), rgba(5, 9, 14, 0.92)),
    #04080d;
}

.builder-modal-shell.is-class-step .builder-stage-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(4, 8, 13, 0.97), rgba(5, 10, 16, 0.76) 38%, rgba(4, 8, 13, 0.98)),
    linear-gradient(180deg, rgba(5, 9, 14, 0.6), rgba(5, 9, 14, 0.92)),
    url("./assets/worlds/velkar.jpg") center / cover;
}

.origin-select-screen {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr) 378px;
  gap: 18px;
  padding: 18px 22px 14px;
  overflow: hidden;
  color: var(--text);
  --race-tone: var(--origin-tone, #66dfff);
}

.origin-screen-bg {
  z-index: 0;
}

.origin-screen-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 56% 24%, color-mix(in srgb, var(--origin-tone, #66dfff) 24%, transparent), transparent 28%),
    linear-gradient(90deg, rgba(4, 8, 13, 0.96), rgba(6, 10, 16, 0.58) 44%, rgba(4, 8, 13, 0.92));
  pointer-events: none;
}

.origin-select-screen::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), transparent 26%),
    radial-gradient(circle at 84% 50%, transparent 0 20%, rgba(5, 9, 14, 0.28) 62%);
}

.origin-list-panel,
.origin-main-panel,
.origin-story-panel {
  position: relative;
  z-index: 1;
  min-width: 0;
  min-height: 0;
}

.origin-list-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
}

.origin-heading h3 {
  max-width: 240px;
}

.origin-option {
  min-height: 72px;
  padding: 10px 12px;
}

.origin-option-sigil {
  width: 44px;
  height: 44px;
  font-size: 21px;
}

.origin-list-scroll {
  padding-right: 4px;
}

.origin-empty-state {
  padding: 14px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  color: rgba(232, 238, 247, 0.66);
  font-size: 12px;
  line-height: 1.4;
  background: rgba(6, 10, 16, 0.36);
}

.origin-main-panel {
  overflow: auto;
  padding: 2px 4px 10px;
}

.origin-hero-card {
  display: grid;
  align-content: start;
  gap: 14px;
}

.origin-hero-banner,
.origin-description-card,
.origin-idea-card,
.origin-story-panel,
.origin-advice-card,
.origin-question-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.origin-hero-banner {
  position: relative;
  width: 100%;
  min-height: 492px;
  margin: 0;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(8, 12, 18, 0.66);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.38);
}

.origin-hero-banner img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: translate(var(--race-surface-x, 0px), var(--race-surface-y, 0px)) scale(var(--race-surface-scale, 1));
  transform-origin: center center;
  filter: saturate(1.03);
  transition: transform 260ms ease, filter 260ms ease, opacity 260ms ease;
}

.origin-hero-banner.is-editing {
  cursor: grab;
  outline: 1px solid color-mix(in srgb, var(--origin-tone, #66dfff) 68%, white 10%);
}

.origin-hero-banner.is-editing.is-dragging {
  cursor: grabbing;
}

.origin-hero-banner .race-editor-micro {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  max-width: 360px;
  justify-content: flex-end;
}

.origin-hero-copy {
  position: absolute;
  inset: 28px 28px 28px;
  z-index: 1;
  display: grid;
  align-content: space-between;
  gap: 24px;
  pointer-events: none;
}

.origin-hero-mark {
  width: min(620px, 100%);
  max-width: min(620px, 100%);
  padding: 4px 0;
  text-shadow: 0 3px 10px rgba(0, 0, 0, 0.82), 0 10px 32px rgba(0, 0, 0, 0.48);
}

.origin-hero-mark p,
.origin-hero-mark span,
.origin-hero-short {
  margin: 0;
}

.origin-hero-mark p {
  margin-bottom: 6px;
  color: color-mix(in srgb, var(--origin-tone, #66dfff) 84%, white 12%);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.88), 0 0 18px rgba(0, 0, 0, 0.42);
}

.origin-hero-mark h3 {
  margin: 0;
  color: #eff7ff;
  font-size: clamp(30px, 2.5vw, 30px);
  line-height: 0.96;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-shadow: 0 4px 14px rgba(0, 0, 0, 0.92), 0 0 26px rgba(0, 0, 0, 0.44);
}

.origin-hero-mark span {
  display: block;
  margin-top: 8px;
  color: rgba(232, 238, 247, 0.82);
  font-size: 16px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.88), 0 0 16px rgba(0, 0, 0, 0.4);
}

.origin-hero-short {
  max-width: 620px;
  padding: 18px 20px;
  border: 1px solid color-mix(in srgb, var(--origin-tone, #66dfff) 26%, rgba(255, 255, 255, 0.08));
  border-radius: 15px;
  color: rgba(240, 245, 255, 0.94);
  background: linear-gradient(180deg, rgba(5, 9, 14, 0.8), rgba(5, 9, 14, 0.58));
  backdrop-filter: blur(8px);
  font-size: 14px;
  line-height: 1.6;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.84), 0 0 14px rgba(0, 0, 0, 0.36);
}

.origin-description-card {
  padding: 18px 20px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.84), rgba(7, 10, 16, 0.7));
}

.origin-description-card p {
  margin: 0;
  color: rgba(232, 238, 247, 0.86);
  font-size: 14px;
  line-height: 1.62;
}

.origin-ideas-panel {
  display: grid;
  gap: 12px;
}

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

.origin-idea-card {
  min-height: 170px;
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(7, 11, 17, 0.78), rgba(5, 9, 14, 0.58));
}

.origin-idea-card h4 {
  margin: 0 0 10px;
  color: color-mix(in srgb, var(--origin-tone, #66dfff) 80%, white 14%);
  font-size: 12px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.origin-idea-card p {
  margin: 0;
  color: rgba(232, 238, 247, 0.76);
  font-size: 12.5px;
  line-height: 1.55;
}

.origin-story-panel {
  display: grid;
  align-content: start;
  gap: 14px;
  overflow: auto;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(9, 13, 19, 0.9), rgba(6, 10, 16, 0.82));
  backdrop-filter: blur(12px);
}

.origin-story-head h3 {
  margin: 0 0 10px;
  color: #eef5ff;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.origin-story-head p {
  margin: 0;
  color: rgba(232, 238, 247, 0.72);
  font-size: 12.5px;
  line-height: 1.55;
}

.origin-question-list {
  display: grid;
  gap: 7px;
}

.origin-question-card {
  width: 100%;
  min-height: 42px;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 11px;
  border-radius: 10px;
  color: rgba(241, 246, 255, 0.92);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--origin-tone, #66dfff) 9%, transparent), transparent 52%),
    rgba(255, 255, 255, 0.025);
}

.origin-question-index {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--origin-tone, #66dfff) 34%, transparent);
  border-radius: 50%;
  color: color-mix(in srgb, var(--origin-tone, #66dfff) 78%, white 14%);
  background: color-mix(in srgb, var(--origin-tone, #66dfff) 9%, rgba(5, 9, 14, 0.7));
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.origin-question-card p {
  margin: 0;
  color: rgba(238, 243, 251, 0.8);
  font-size: 10.5px;
  font-weight: 700;
  line-height: 1.35;
}

.origin-story-editor {
  display: grid;
  gap: 8px;
}

.origin-story-editor > span {
  color: color-mix(in srgb, var(--origin-tone, #66dfff) 84%, white 12%);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.origin-story-editor textarea {
  min-height: 232px;
  resize: vertical;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  color: rgba(240, 245, 255, 0.92);
  background: rgba(3, 7, 12, 0.56);
  font-size: 13px;
  line-height: 1.6;
}

.origin-story-count {
  margin-top: -4px;
  color: rgba(232, 238, 247, 0.5);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-align: right;
  text-transform: uppercase;
}

.origin-advice-card {
  padding: 16px;
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(8, 12, 18, 0.82), rgba(6, 10, 16, 0.68));
}

.origin-advice-card h4 {
  margin: 0 0 8px;
  color: color-mix(in srgb, var(--origin-tone, #66dfff) 82%, white 12%);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.origin-advice-card p {
  margin: 0;
  color: rgba(232, 238, 247, 0.74);
  font-size: 12.5px;
  line-height: 1.55;
}

.morality-screen {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr) 320px;
  gap: 18px;
  min-height: 100%;
  padding: 22px 18px 12px;
  color: var(--text);
  background:
    radial-gradient(circle at 52% 18%, rgba(213, 170, 95, 0.12), transparent 26%),
    linear-gradient(180deg, rgba(5, 8, 13, 0.94), rgba(4, 8, 13, 0.98));
}

.morality-side,
.morality-main {
  min-height: 0;
}

.morality-side {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.morality-left h3,
.morality-result-card h3 {
  margin: 0;
  font-size: clamp(28px, 3vw, 40px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.morality-left > p:not(.eyebrow) {
  margin: 0;
  color: rgba(233, 235, 241, 0.78);
  line-height: 1.7;
}

.morality-panel-card,
.morality-deco-card,
.morality-scene-card,
.morality-result-card {
  border: 1px solid rgba(215, 181, 109, 0.18);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(9, 13, 19, 0.92), rgba(7, 11, 16, 0.96));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.34);
}

.morality-panel-card {
  padding: 18px;
}

.morality-panel-card > span {
  display: block;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(238, 223, 186, 0.84);
}

.morality-progress-track {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 7px;
  margin-top: 14px;
}

.morality-progress-dot {
  height: 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.morality-progress-dot.is-complete {
  background: linear-gradient(90deg, rgba(219, 184, 104, 0.92), rgba(255, 234, 176, 0.96));
  box-shadow: 0 0 16px rgba(219, 184, 104, 0.28);
}

.morality-progress-dot.is-active {
  background: rgba(255, 255, 255, 0.5);
}

.morality-deco-card {
  padding: 12px;
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.morality-deco-card img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
  opacity: 0.72;
  filter: saturate(0.82) brightness(0.82);
}

.morality-deco-card strong,
.morality-panel-card h4,
.morality-scene-copy h3,
.morality-answer-card strong,
.morality-result-card span {
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.morality-panel-card h4 {
  margin: 0 0 14px;
  font-size: 12px;
  color: rgba(238, 223, 186, 0.92);
}

.morality-deco-card strong {
  display: block;
  margin-bottom: 6px;
  font-size: 12px;
  color: rgba(238, 223, 186, 0.92);
}

.morality-deco-card span {
  color: rgba(233, 235, 241, 0.72);
  line-height: 1.6;
  font-size: 13px;
}

.morality-main {
  display: flex;
}

.morality-scene-card,
.morality-result-card {
  position: relative;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.morality-scene-card {
  display: grid;
  grid-template-rows: auto 1fr auto;
  padding: 28px;
  background:
    linear-gradient(180deg, rgba(4, 7, 12, 0.16), rgba(4, 7, 12, 0.94)),
    var(--morality-image) center / cover no-repeat;
}

.morality-scene-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 8, 13, 0.88), rgba(5, 8, 13, 0.28) 42%, rgba(5, 8, 13, 0.88)),
    linear-gradient(180deg, rgba(5, 8, 13, 0.12), rgba(5, 8, 13, 0.92));
  pointer-events: none;
}

.morality-scene-frame {
  position: absolute;
  inset: 14px;
  border-radius: 16px;
  border: 1px solid rgba(215, 181, 109, 0.16);
  box-shadow: inset 0 0 28px rgba(255, 255, 255, 0.025), 0 0 32px rgba(215, 181, 109, 0.08);
  pointer-events: none;
}

.morality-scene-copy,
.morality-answer-grid {
  position: relative;
  z-index: 1;
}

.morality-scene-copy {
  max-width: 620px;
}

.morality-scene-copy h3 {
  margin: 10px 0 12px;
  font-size: clamp(30px, 3.2vw, 46px);
}

.morality-scene-copy p:last-child {
  margin: 0;
  max-width: 720px;
  font-size: 16px;
  line-height: 1.78;
  color: rgba(236, 239, 244, 0.86);
}

.morality-answer-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-self: end;
  margin-top: 26px;
}

.morality-answer-card,
.morality-manual-pill {
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(10, 14, 20, 0.76);
  color: var(--text);
  transition: border-color 180ms ease, background-color 220ms ease, transform 180ms ease, box-shadow 220ms ease;
}

.morality-answer-card {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  grid-template-areas: "letter title";
  gap: 2px 12px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
  padding: 16px 18px;
  border-radius: 16px;
  text-align: left;
}

.morality-answer-card:hover:not(:disabled),
.morality-manual-pill:hover {
  transform: translateY(-2px);
  border-color: rgba(219, 184, 104, 0.44);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.3);
}

.morality-answer-card:disabled {
  cursor: default;
  opacity: 0.86;
}

.morality-answer-card.is-selected {
  border-color: rgba(219, 184, 104, 0.68);
  background: linear-gradient(180deg, rgba(219, 184, 104, 0.18), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 24px rgba(219, 184, 104, 0.16);
}

.morality-answer-letter {
  grid-area: letter;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.18em;
  background: rgba(255, 255, 255, 0.08);
  color: rgba(245, 233, 202, 0.92);
}

.morality-answer-card strong {
  grid-area: title;
  display: block;
  min-width: 0;
  font-size: 13px;
  line-height: 1.5;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.morality-answer-card small {
  grid-area: subtitle;
  color: rgba(233, 235, 241, 0.68);
  line-height: 1.55;
  font-size: 12px;
}

.morality-info-stack {
  display: grid;
  gap: 14px;
}

.morality-info-stack article {
  padding: 12px 0 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.morality-info-stack article:first-child {
  padding-top: 0;
  border-top: 0;
}

.morality-info-stack strong {
  display: block;
  margin-bottom: 6px;
  font-size: 11px;
  color: rgba(238, 223, 186, 0.86);
}

.morality-info-stack p,
.morality-panel-card p,
.morality-result-card p {
  margin: 0;
  line-height: 1.72;
  color: rgba(233, 235, 241, 0.8);
}

.morality-panel-card blockquote {
  margin: 18px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 13px;
  line-height: 1.7;
  color: rgba(240, 226, 190, 0.9);
}

.morality-panel-card.is-consequence {
  display: grid;
  gap: 14px;
}

.morality-panel-card.is-consequence small {
  color: rgba(238, 223, 186, 0.76);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.morality-result-card {
  display: grid;
  align-content: center;
  gap: 14px;
  padding: 34px;
  text-align: center;
}

.morality-result-card span {
  display: inline-flex;
  align-self: center;
  justify-self: center;
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid rgba(219, 184, 104, 0.26);
  color: rgba(246, 235, 205, 0.94);
  background: rgba(219, 184, 104, 0.08);
  font-size: 12px;
  font-weight: 800;
}

.morality-result-actions,
.morality-manual-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.morality-manual-grid {
  margin-top: 6px;
}

.morality-manual-pill {
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.morality-manual-pill.is-selected {
  border-color: rgba(219, 184, 104, 0.62);
  background: linear-gradient(180deg, rgba(219, 184, 104, 0.22), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 22px rgba(219, 184, 104, 0.14);
}

.morality-screen {
  position: relative;
  isolation: isolate;
  height: 100%;
  grid-template-columns: minmax(235px, 0.78fr) minmax(600px, 2.55fr) minmax(270px, 0.9fr);
  gap: 16px;
  padding: 18px 20px 10px;
  overflow: hidden;
  background: #05090e;
}

.morality-screen-bg {
  position: absolute;
  z-index: -2;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
}

.morality-screen-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: blur(var(--race-surface-blur, 0px)) saturate(0.84);
}

.morality-screen-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 7, 12, 0.82), rgba(4, 8, 13, 0.42) 44%, rgba(3, 7, 12, 0.78)),
    linear-gradient(180deg, rgba(3, 7, 12, 0.3), rgba(3, 7, 12, 0.68)),
    rgba(0, 0, 0, var(--race-surface-overlay, 0.22));
}

.morality-screen-bg.is-editing {
  box-shadow: inset 0 0 0 2px rgba(218, 178, 91, 0.74);
}

.morality-side,
.morality-main {
  position: relative;
  z-index: 1;
}

.morality-left {
  padding: 22px 18px 14px 6px;
}

.morality-left h3 {
  max-width: 250px;
  font-size: clamp(24px, 2.15vw, 34px);
  line-height: 1.08;
}

.morality-left > p:not(.eyebrow) {
  max-width: 245px;
  font-size: 13px;
}

.morality-progress-block {
  margin-top: 10px;
  padding: 18px 0 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.morality-progress-block > span {
  display: block;
  color: rgba(233, 235, 241, 0.62);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.morality-progress-track {
  gap: 10px;
  align-items: center;
}

.morality-progress-dot {
  position: relative;
  height: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 2px;
  background: rgba(6, 10, 15, 0.82);
  transform: rotate(45deg);
}

.morality-progress-dot.is-complete,
.morality-progress-dot.is-active {
  border-color: rgba(240, 198, 105, 0.84);
  background: #e8b95d;
  box-shadow: 0 0 14px rgba(232, 185, 93, 0.48);
}

.morality-left-seal {
  display: grid;
  justify-items: center;
  gap: 9px;
  margin-top: auto;
  padding: 22px 8px 8px;
  text-align: center;
}

.morality-left-seal > span {
  position: relative;
  width: 112px;
  height: 112px;
  border: 1px solid rgba(218, 178, 91, 0.26);
  border-radius: 50%;
  background:
    linear-gradient(90deg, transparent 49%, rgba(218, 178, 91, 0.48) 50%, transparent 51%),
    linear-gradient(transparent 49%, rgba(218, 178, 91, 0.48) 50%, transparent 51%),
    radial-gradient(circle, rgba(218, 178, 91, 0.16) 0 5%, transparent 6% 42%, rgba(218, 178, 91, 0.18) 43% 44%, transparent 45%);
  box-shadow: inset 0 0 28px rgba(218, 178, 91, 0.08), 0 0 30px rgba(0, 0, 0, 0.38);
}

.morality-left-seal > span::before,
.morality-left-seal > span::after {
  content: "";
  position: absolute;
  inset: 18px 48px;
  background: linear-gradient(#e1b45e, rgba(225, 180, 94, 0.12));
  clip-path: polygon(50% 0, 100% 100%, 50% 78%, 0 100%);
}

.morality-left-seal > span::after {
  transform: rotate(180deg);
}

.morality-left-seal strong {
  color: rgba(239, 213, 155, 0.82);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.morality-left-seal small {
  max-width: 220px;
  color: rgba(233, 235, 241, 0.52);
  font-size: 11px;
  line-height: 1.5;
}

.morality-main {
  min-width: 0;
}

.morality-scene-card {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100%;
  padding: 36px 38px 20px;
  border-radius: 18px;
  background: #080c12;
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.38);
}

.morality-scene-card::before {
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(3, 7, 12, 0.62), rgba(3, 7, 12, 0.04) 35%, rgba(3, 7, 12, 0.18) 55%, rgba(3, 7, 12, 0.8)),
    linear-gradient(90deg, rgba(3, 7, 12, 0.54), transparent 58%);
}

.morality-scene-card.is-editing {
  outline: 2px solid rgba(218, 178, 91, 0.78);
  outline-offset: -2px;
  cursor: grab;
}

.morality-scene-card.is-dragging {
  cursor: grabbing;
}

.morality-scene-image {
  position: absolute;
  z-index: 0;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: translate(var(--race-surface-x, 0px), var(--race-surface-y, 0px)) scale(var(--race-surface-scale, 1));
  transform-origin: center;
  user-select: none;
  pointer-events: none;
}

.morality-scene-frame {
  z-index: 2;
  inset: 0;
  border-radius: 18px;
  border-color: rgba(218, 178, 91, 0.12);
}

.morality-scene-copy,
.morality-answer-grid,
.morality-quick-guide {
  z-index: 3;
}

.morality-scene-copy {
  max-width: 690px;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.96), 0 0 22px rgba(0, 0, 0, 0.72);
}

.morality-scene-copy h3 {
  margin: 8px 0 10px;
  font-size: clamp(27px, 2.45vw, 39px);
}

.morality-scene-copy p:last-child {
  max-width: 610px;
  font-size: 14px;
  line-height: 1.65;
}

.morality-quick-guide {
  align-self: end;
  display: grid;
  gap: 4px;
  width: min(100%, 640px);
  margin-top: 18px;
  padding: 13px 16px;
  border: 1px solid rgba(218, 178, 91, 0.18);
  border-radius: 15px;
  background: rgba(5, 9, 15, 0.68);
  box-shadow: 0 16px 34px rgba(0, 0, 0, 0.34), inset 0 0 24px rgba(218, 178, 91, 0.035);
  backdrop-filter: blur(10px);
}

.morality-quick-guide strong {
  color: #deb25d;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.morality-quick-guide span {
  color: rgba(238, 242, 248, 0.8);
  font-size: 12px;
  line-height: 1.45;
}

.morality-answer-grid {
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  margin: 0;
  overflow: visible;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.morality-answer-card {
  --answer-tone: #dcb35f;
  grid-template-columns: 38px minmax(0, 1fr);
  grid-template-areas: "letter title";
  min-height: 76px;
  padding: 11px 13px;
  border: 1px solid color-mix(in srgb, var(--answer-tone) 28%, rgba(255, 255, 255, 0.08));
  border-radius: 15px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--answer-tone) 14%, rgba(4, 8, 13, 0.82)), rgba(5, 9, 14, 0.66)),
    rgba(5, 9, 14, 0.78);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--answer-tone) 72%, transparent), 0 12px 24px rgba(0, 0, 0, 0.22);
}

.morality-answer-card:last-child {
  border-bottom: 1px solid color-mix(in srgb, var(--answer-tone) 28%, rgba(255, 255, 255, 0.08));
}

.morality-answer-card:hover:not(:disabled) {
  transform: none;
  border-color: color-mix(in srgb, var(--answer-tone) 58%, rgba(255, 255, 255, 0.12));
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--answer-tone) 23%, rgba(4, 8, 13, 0.74)), rgba(5, 9, 14, 0.58)),
    rgba(5, 9, 14, 0.68);
  box-shadow: inset 3px 0 0 color-mix(in srgb, var(--answer-tone) 92%, white 4%), 0 14px 30px rgba(0, 0, 0, 0.34);
}

.morality-answer-card.is-selected {
  border-color: color-mix(in srgb, var(--answer-tone) 74%, white 8%);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--answer-tone) 28%, rgba(4, 8, 13, 0.62)), rgba(5, 9, 14, 0.58)),
    rgba(5, 9, 14, 0.7);
  box-shadow: inset 3px 0 0 var(--answer-tone), 0 0 24px color-mix(in srgb, var(--answer-tone) 22%, transparent);
}

.morality-answer-letter {
  width: 34px;
  height: 34px;
  border: 1px solid color-mix(in srgb, var(--answer-tone) 72%, transparent);
  border-radius: 50%;
  background: color-mix(in srgb, var(--answer-tone) 9%, transparent);
  color: color-mix(in srgb, var(--answer-tone) 82%, white 18%);
  box-shadow: 0 0 14px color-mix(in srgb, var(--answer-tone) 13%, transparent);
  font-size: 12px;
}

.morality-answer-card strong {
  align-self: center;
  display: block;
  min-width: 0;
  font-size: 11px;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
  overflow-wrap: anywhere;
  word-break: normal;
  hyphens: auto;
}

.morality-answer-card small {
  align-self: start;
  font-size: 10px;
  line-height: 1.4;
}

.morality-right {
  padding: 16px 0 12px 2px;
}

.morality-right .morality-panel-card {
  padding: 24px 22px;
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(7, 12, 18, 0.9);
  backdrop-filter: blur(12px);
}

.morality-right .morality-answer-panel {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
}

.morality-right .morality-skip-card {
  flex: 0 0 auto;
  padding: 16px 18px;
}

.morality-right .morality-panel-card h4 {
  color: #deb25d;
  font-size: 15px;
}

.morality-skip-card {
  gap: 14px;
}

.morality-side-actions {
  justify-content: flex-start;
  margin-top: 4px;
}

.morality-skip-card .morality-manual-grid {
  justify-content: flex-start;
  margin-top: 2px;
}

.morality-info-stack {
  gap: 8px;
}

.morality-info-stack article {
  position: relative;
  min-height: 70px;
  padding: 14px 0 10px 52px;
}

.morality-info-stack article::before {
  content: "";
  position: absolute;
  left: 0;
  top: 12px;
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(218, 178, 91, 0.24);
  border-radius: 50%;
  color: #deb25d;
  background: rgba(218, 178, 91, 0.06);
}

.morality-info-stack article::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 25px;
  width: 9px;
  height: 9px;
  border: 1px solid #deb25d;
  transform: rotate(45deg);
}

.morality-info-stack strong {
  color: rgba(242, 244, 248, 0.9);
  font-size: 12px;
}

.morality-info-stack p {
  font-size: 11px;
}

.morality-editor {
  z-index: 8;
  top: 10px;
  right: 10px;
  left: auto;
  bottom: auto;
  max-width: 330px;
}

.morality-editor > small {
  color: rgba(233, 235, 241, 0.68);
  font-size: 10px;
  line-height: 1.45;
}

.morality-screen:not(.is-showing-consequence) .morality-screen-bg img {
  animation: morality-background-enter 620ms ease both;
}

.morality-screen:not(.is-showing-consequence) .morality-scene-image {
  animation: morality-scene-enter 560ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.morality-screen:not(.is-showing-consequence) .morality-scene-copy {
  animation: morality-copy-enter 460ms 90ms ease both;
}

.morality-screen:not(.is-showing-consequence) .morality-answer-grid {
  animation: morality-copy-enter 500ms 150ms ease both;
}

.morality-screen.is-showing-skip-selector .morality-left,
.morality-screen.is-showing-skip-selector .morality-main,
.morality-screen.is-showing-skip-selector .morality-right {
  filter: blur(2px);
}

.morality-skip-layer {
  position: absolute;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 16px;
  animation: morality-layer-enter 220ms ease both;
}

.morality-skip-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(2, 5, 10, 0.82);
  backdrop-filter: blur(10px);
}

.morality-skip-dialog {
  position: relative;
  width: min(760px, calc(100% - 20px));
  max-height: calc(100% - 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 34px 36px 30px;
  border: 1px solid rgba(225, 180, 94, 0.34);
  border-radius: 22px;
  background:
    radial-gradient(circle at 50% 0, rgba(225, 180, 94, 0.12), transparent 32%),
    linear-gradient(180deg, rgba(14, 18, 26, 0.98), rgba(6, 10, 16, 0.99));
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), 0 0 34px rgba(225, 180, 94, 0.1);
  text-align: center;
  animation: morality-dialog-enter 300ms cubic-bezier(0.2, 0.86, 0.24, 1) both;
}

.morality-skip-dialog h3 {
  margin: 8px 0 10px;
  color: rgba(245, 239, 224, 0.96);
  font-size: clamp(24px, 2vw, 32px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.morality-skip-dialog > p:not(.eyebrow) {
  margin: 0 auto;
  max-width: 560px;
  color: rgba(226, 229, 236, 0.74);
  font-size: 14px;
  line-height: 1.65;
}

.morality-skip-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 24px;
}

.morality-skip-pill {
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid rgba(225, 180, 94, 0.18);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 236, 216, 0.92);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background 180ms ease,
    box-shadow 180ms ease;
}

.morality-skip-pill:hover {
  transform: translateY(-1px);
  border-color: rgba(225, 180, 94, 0.42);
  background: linear-gradient(180deg, rgba(225, 180, 94, 0.16), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 18px rgba(225, 180, 94, 0.12);
}

.morality-skip-pill.is-selected {
  border-color: rgba(225, 180, 94, 0.56);
  background: linear-gradient(180deg, rgba(225, 180, 94, 0.22), rgba(255, 255, 255, 0.05));
  box-shadow: 0 0 24px rgba(225, 180, 94, 0.14);
}

.morality-skip-cancel {
  margin-top: 22px;
}

.morality-consequence-layer {
  position: absolute;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  min-height: 0;
  padding: 16px;
  animation: morality-layer-enter 260ms ease both;
}

.morality-consequence-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 8, 0.78);
  backdrop-filter: blur(7px);
}

.morality-consequence-dialog {
  position: relative;
  width: min(620px, calc(100% - 20px));
  max-height: calc(100% - 12px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 34px 38px 30px;
  border: 1px solid rgba(225, 180, 94, 0.38);
  border-radius: 18px;
  background:
    radial-gradient(circle at 50% 0, rgba(225, 180, 94, 0.1), transparent 38%),
    linear-gradient(180deg, rgba(15, 20, 28, 0.98), rgba(7, 11, 17, 0.99));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.66), 0 0 36px rgba(225, 180, 94, 0.11);
  text-align: center;
  animation: morality-dialog-enter 360ms cubic-bezier(0.2, 0.86, 0.24, 1) both;
}

.morality-consequence-dialog .eyebrow {
  color: #dfb45e;
}

.morality-consequence-copy {
  margin: 18px 0 20px;
  color: rgba(246, 239, 223, 0.94);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  line-height: 1.55;
  text-align: left;
  overflow-wrap: anywhere;
}

.morality-consequence-copy p {
  margin: 0;
}

.morality-consequence-copy p + p {
  margin-top: 18px;
}

.morality-consequence-effect {
  color: rgba(239, 226, 192, 0.9);
  font-size: 15px;
  line-height: 1.65;
}

.morality-consequence-effect strong {
  color: #dfb45e;
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.morality-consequence-dialog small {
  display: block;
  margin-bottom: 22px;
  color: rgba(237, 218, 174, 0.62);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.morality-consequence-dialog button {
  min-width: 180px;
  padding: 13px 24px;
  border: 1px solid rgba(255, 221, 143, 0.64);
  border-radius: 12px;
  color: #171109;
  background: linear-gradient(135deg, #f2d78f, #c9953f);
  box-shadow: 0 10px 28px rgba(205, 154, 66, 0.24), inset 0 1px rgba(255, 255, 255, 0.42);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.morality-consequence-dialog button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 15px 34px rgba(205, 154, 66, 0.32), inset 0 1px rgba(255, 255, 255, 0.5);
}

.morality-consequence-layer.is-leaving {
  animation: morality-layer-exit 220ms ease both;
}

.morality-consequence-layer.is-leaving .morality-consequence-dialog {
  animation: morality-dialog-exit 220ms ease both;
}

@keyframes morality-background-enter {
  from {
    opacity: 0.34;
  }
  to {
    opacity: 1;
  }
}

@keyframes morality-scene-enter {
  from {
    opacity: 0;
    transform: translate(var(--race-surface-x, 0px), calc(var(--race-surface-y, 0px) + 8px)) scale(calc(var(--race-surface-scale, 1) * 1.015));
  }
  to {
    opacity: 1;
    transform: translate(var(--race-surface-x, 0px), var(--race-surface-y, 0px)) scale(var(--race-surface-scale, 1));
  }
}

@keyframes morality-copy-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes morality-layer-enter {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes morality-dialog-enter {
  from {
    opacity: 0;
    transform: translateY(14px) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes morality-layer-exit {
  to {
    opacity: 0;
  }
}

@keyframes morality-dialog-exit {
  to {
    opacity: 0;
    transform: translateY(-8px) scale(0.985);
  }
}

@media (prefers-reduced-motion: reduce) {
  .morality-screen-bg img,
  .morality-scene-image,
  .morality-scene-copy,
  .morality-answer-grid,
  .morality-consequence-layer,
  .morality-consequence-dialog {
    animation: none !important;
  }
}

@media (max-height: 820px) and (min-width: 1221px) {
  .morality-screen {
    grid-template-columns: 220px minmax(0, 1fr) 280px;
    gap: 12px;
    padding: 10px 16px 8px;
  }

  .morality-side {
    gap: 8px;
  }

  .morality-left {
    padding: 8px 8px 4px 2px;
  }

  .morality-left h3 {
    max-width: 215px;
    font-size: clamp(21px, 1.8vw, 27px);
  }

  .morality-left > p:not(.eyebrow) {
    max-width: 215px;
    font-size: 11px;
    line-height: 1.48;
  }

  .morality-progress-block {
    margin-top: 3px;
    padding: 10px 0 12px;
  }

  .morality-progress-track {
    gap: 7px;
    margin-top: 10px;
  }

  .morality-progress-dot {
    height: 6px;
  }

  .morality-left-seal {
    gap: 5px;
    padding: 8px 4px 2px;
  }

  .morality-left-seal > span {
    width: 76px;
    height: 76px;
  }

  .morality-left-seal > span::before,
  .morality-left-seal > span::after {
    inset: 12px 32px;
  }

  .morality-left-seal small {
    max-width: 190px;
    font-size: 9px;
    line-height: 1.35;
  }

  .morality-scene-card {
    padding: 22px 26px 14px;
  }

  .morality-scene-copy h3 {
    font-size: clamp(23px, 2.1vw, 32px);
  }

  .morality-scene-copy p:last-child {
    font-size: 12px;
    line-height: 1.5;
  }

  .morality-answer-grid {
    width: 100%;
    margin: 0;
  }

  .morality-answer-card {
    min-height: 58px;
    padding: 8px 11px;
  }

  .morality-answer-letter {
    width: 30px;
    height: 30px;
  }

  .morality-right {
    display: grid;
    grid-template-rows: minmax(0, 1fr) auto;
    gap: 8px;
    min-height: 0;
    padding: 6px 0 4px 2px;
  }

  .morality-right .morality-panel-card {
    min-height: 0;
    padding: 14px 15px;
  }

  .morality-right > .morality-panel-card:first-child {
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .morality-right .morality-panel-card h4 {
    margin-bottom: 8px;
    font-size: 12px;
  }

  .morality-info-stack {
    gap: 2px;
  }

  .morality-info-stack article {
    min-height: 48px;
    padding: 8px 0 7px 40px;
  }

  .morality-info-stack article::before {
    top: 8px;
    width: 27px;
    height: 27px;
  }

  .morality-info-stack article::after {
    left: 10px;
    top: 18px;
    width: 7px;
    height: 7px;
  }

  .morality-info-stack strong {
    margin-bottom: 3px;
    font-size: 10px;
  }

  .morality-info-stack p {
    font-size: 9px;
    line-height: 1.35;
  }

  .morality-skip-card {
    flex: none !important;
    gap: 6px;
  }

  .morality-skip-card > p {
    font-size: 10px;
    line-height: 1.4;
  }

  .morality-side-actions .ghost-button {
    min-height: 34px;
    padding: 8px 12px;
    font-size: 9px;
  }

  .morality-skip-dialog {
    padding: 22px 26px 20px;
  }

  .morality-skip-dialog h3 {
    font-size: 23px;
  }

  .morality-skip-dialog > p:not(.eyebrow) {
    font-size: 12px;
  }

  .morality-skip-grid {
    gap: 9px;
    margin-top: 16px;
  }

  .morality-skip-pill {
    min-height: 46px;
    padding: 10px 12px;
    font-size: 9px;
  }

  .morality-skip-cancel {
    margin-top: 14px;
  }
}

@media (max-height: 680px) and (min-width: 1221px) {
  .morality-left-seal {
    grid-template-columns: 58px minmax(0, 1fr);
    justify-items: start;
    align-items: center;
    text-align: left;
  }

  .morality-left-seal > span {
    grid-row: span 2;
    width: 58px;
    height: 58px;
  }

  .morality-left-seal > span::before,
  .morality-left-seal > span::after {
    inset: 9px 24px;
  }

  .morality-left-seal small,
  .morality-info-stack p,
  .morality-skip-card > p {
    display: none;
  }

  .morality-info-stack article {
    min-height: 34px;
    padding-top: 7px;
    padding-bottom: 6px;
  }
}

@media (max-width: 760px) {
  .morality-skip-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 520px) {
  .morality-skip-layer,
  .morality-consequence-layer {
    padding: 8px;
  }

  .morality-skip-dialog,
  .morality-consequence-dialog {
    width: 100%;
    max-height: 100%;
    padding: 20px 16px 16px;
  }

  .morality-skip-grid {
    grid-template-columns: 1fr;
  }
}

.race-select-screen {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) minmax(360px, 430px);
  gap: 20px;
  padding: 18px 22px 14px;
  overflow: hidden;
  color: var(--text);
  background:
    linear-gradient(90deg, rgba(4, 8, 13, 0.98), rgba(4, 8, 13, 0.58) 52%, rgba(4, 8, 13, 0.96)),
    radial-gradient(circle at 52% 18%, color-mix(in srgb, var(--race-tone, #d8b56d) 24%, transparent), transparent 34%);
}

.race-screen-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  z-index: 0;
}

.race-screen-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, var(--race-surface-overlay, 0.22));
  pointer-events: none;
}

.race-screen-bg img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  transform: translate(var(--race-surface-x, 0px), var(--race-surface-y, 0px)) scale(var(--race-surface-scale, 1));
  transform-origin: center center;
  filter: saturate(1.02) blur(var(--race-surface-blur, 0px));
  transition: transform 260ms ease, filter 260ms ease;
  animation: race-background-fade 420ms ease;
}

.race-select-screen::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 28%),
    radial-gradient(circle at 72% 50%, transparent 0 26%, rgba(5, 9, 14, 0.34) 68%);
}

.race-list-panel,
.race-detail-panel,
.race-rules-panel {
  position: relative;
  z-index: 1;
  min-height: 0;
  min-width: 0;
}

.race-list-panel {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 12px;
}

.race-heading h3 {
  margin: 0;
  color: #f4f7ff;
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.race-heading p:not(.eyebrow) {
  margin: 6px 0 12px;
  color: rgba(232, 238, 247, 0.76);
  font-size: 12px;
  line-height: 1.35;
}

.race-search {
  display: grid;
  gap: 5px;
  color: rgba(232, 238, 247, 0.5);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.race-search input {
  min-height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  color: rgba(244, 247, 255, 0.92);
  background: rgba(5, 9, 14, 0.56);
}

.race-list-scroll {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  overflow: auto;
  padding-right: 4px;
}

.race-option {
  min-height: 58px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  color: rgba(244, 247, 255, 0.88);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.05), rgba(255, 255, 255, 0.018));
  text-align: left;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}

.race-option.is-active {
  border-color: color-mix(in srgb, var(--race-tone, #d8b56d) 78%, white 6%);
  background: linear-gradient(90deg, color-mix(in srgb, var(--race-tone, #d8b56d) 24%, transparent), rgba(255, 255, 255, 0.035));
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--race-tone, #d8b56d) 34%, transparent), 0 0 30px color-mix(in srgb, var(--race-tone, #d8b56d) 22%, transparent);
}

.race-option-sigil,
.race-main-sigil {
  display: grid;
  place-items: center;
  border: 1px solid color-mix(in srgb, var(--race-tone, #d8b56d) 48%, transparent);
  border-radius: 50%;
  color: color-mix(in srgb, var(--race-tone, #d8b56d) 80%, white 20%);
  background: radial-gradient(circle, color-mix(in srgb, var(--race-tone, #d8b56d) 16%, transparent), rgba(5, 9, 14, 0.68));
  box-shadow: 0 0 18px color-mix(in srgb, var(--race-tone, #d8b56d) 26%, transparent);
  font-weight: 900;
}

.race-option-sigil {
  width: 40px;
  height: 40px;
  font-size: 20px;
}

.race-option strong,
.race-option small {
  display: block;
}

.race-option strong {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.race-option small {
  margin-top: 3px;
  color: rgba(232, 238, 247, 0.62);
  font-size: 11px;
}

.race-detail-panel {
  display: grid;
  align-content: start;
  gap: 12px;
  overflow: auto;
  padding: 6px 6px 10px;
}

.race-title-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(10, 15, 22, 0.78), rgba(7, 10, 15, 0.66));
  backdrop-filter: blur(14px);
  animation: race-panel-fade 320ms ease;
}

.race-main-sigil {
  width: 72px;
  height: 72px;
  font-size: 34px;
}

.race-title-card h3 {
  margin: 0;
  color: color-mix(in srgb, var(--race-tone, #d8b56d) 72%, white 18%);
  font-size: clamp(26px, 2.5vw, 40px);
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.race-title-card span:not(.race-main-sigil) {
  display: block;
  margin-top: 4px;
  color: rgba(232, 238, 247, 0.72);
  font-size: 13px;
}

.race-lore-copy {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(5, 9, 14, 0.46);
  animation: race-panel-fade 360ms ease;
}

.race-lore-copy p,
.race-trait-card p,
.race-rule-card p,
.race-rule-card li,
.race-choice-panel p {
  margin: 0 0 8px;
  color: rgba(232, 238, 247, 0.78);
  font-size: 12.5px;
  line-height: 1.45;
}

.race-lore-copy p:last-child,
.race-trait-card p:last-child,
.race-rule-card p:last-child {
  margin-bottom: 0;
}

.race-section-title {
  display: grid;
  grid-template-columns: minmax(24px, 1fr) auto minmax(24px, 1fr);
  gap: 12px;
  align-items: center;
  color: color-mix(in srgb, var(--race-tone, #d8b56d) 76%, white 18%);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.race-section-title span {
  height: 1px;
  background: linear-gradient(90deg, transparent, color-mix(in srgb, var(--race-tone, #d8b56d) 36%, transparent), transparent);
}

.race-trait-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.race-trait-card,
.race-choice-panel,
.race-rule-card,
.race-rule-grid article,
.race-rules-panel blockquote {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  background: rgba(6, 10, 16, 0.58);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.race-trait-card {
  min-height: 92px;
  padding: 12px;
  animation: race-panel-fade 400ms ease;
}

.race-trait-card.has-choice {
  border-color: color-mix(in srgb, var(--race-tone, #d8b56d) 42%, transparent);
  background: color-mix(in srgb, var(--race-tone, #d8b56d) 8%, rgba(6, 10, 16, 0.58));
}

.race-trait-card.is-required {
  box-shadow: 0 0 24px color-mix(in srgb, var(--race-tone, #d8b56d) 14%, transparent), inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.race-trait-card h4,
.race-choice-panel h4,
.race-rule-card h4 {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
  color: color-mix(in srgb, var(--race-tone, #d8b56d) 78%, white 16%);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.race-trait-card h4 span {
  padding: 3px 6px;
  border-radius: 999px;
  color: #ffe2dc;
  background: rgba(185, 87, 72, 0.44);
  font-size: 8px;
}

.race-trait-card.has-choice h4 span {
  color: #ffe6a2;
  background: rgba(221, 191, 112, 0.2);
}

.race-choice-panel {
  padding: 12px;
  animation: race-panel-fade 440ms ease;
}

.race-choice-panel.has-missing {
  border-color: color-mix(in srgb, var(--race-tone, #d8b56d) 58%, transparent);
  box-shadow: 0 0 28px color-mix(in srgb, var(--race-tone, #d8b56d) 18%, transparent), inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.race-choice-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 8px;
}

.race-choice-panel header h4 {
  margin-bottom: 0;
}

.race-choice-panel header > span {
  flex: 0 0 auto;
  padding: 5px 8px;
  border-radius: 999px;
  color: #ffe6a2;
  background: rgba(221, 191, 112, 0.16);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.race-choice-checks,
.race-choice-grid,
.race-choice-pills {
  display: grid;
  gap: 8px;
}

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

.race-choice-checks {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  margin-bottom: 10px;
}

.race-choice-field {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  background: rgba(5, 9, 14, 0.42);
}

.race-choice-field.is-missing {
  border-color: color-mix(in srgb, var(--race-tone, #d8b56d) 54%, transparent);
  background: color-mix(in srgb, var(--race-tone, #d8b56d) 10%, rgba(5, 9, 14, 0.5));
}

.race-choice-field.is-inline {
  margin-top: 10px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
}

.race-choice-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: rgba(244, 247, 255, 0.9);
}

.race-choice-label strong {
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.race-choice-label span,
.race-choice-label em {
  color: color-mix(in srgb, var(--race-tone, #d8b56d) 74%, white 16%);
  font-size: 9px;
  font-style: normal;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.race-choice-field p,
.race-choice-note {
  margin: 0;
  color: rgba(232, 238, 247, 0.62);
  font-size: 10.5px;
  line-height: 1.35;
}

.race-choice-pills {
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
}

.race-choice-pills.is-compact-grid {
  grid-template-columns: repeat(auto-fit, minmax(176px, 1fr));
}

.choice-option-section {
  display: grid;
  gap: 10px;
}

.choice-option-section + .choice-option-section {
  margin-top: 6px;
}

.choice-option-section-title {
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 12px;
  color: rgba(241, 229, 196, 0.86);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.choice-option-section.is-slashing .choice-option-section-title {
  border-color: rgba(177, 92, 92, 0.26);
  background: linear-gradient(180deg, rgba(104, 32, 32, 0.26), rgba(16, 11, 13, 0.42));
  color: #efc0c0;
}

.choice-option-section.is-blunt .choice-option-section-title {
  border-color: rgba(176, 132, 73, 0.26);
  background: linear-gradient(180deg, rgba(94, 57, 18, 0.24), rgba(17, 13, 9, 0.42));
  color: #e7c996;
}

.choice-option-section.is-piercing .choice-option-section-title {
  border-color: rgba(94, 139, 194, 0.26);
  background: linear-gradient(180deg, rgba(20, 47, 80, 0.26), rgba(11, 14, 20, 0.42));
  color: #bddcff;
}

.choice-option-section.is-neutral .choice-option-section-title {
  border-color: rgba(152, 156, 170, 0.2);
  background: linear-gradient(180deg, rgba(44, 48, 58, 0.28), rgba(12, 14, 18, 0.4));
}

.race-choice-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  color: rgba(236, 241, 249, 0.84);
  text-align: center;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: border-color 180ms ease, background 180ms ease, color 180ms ease, transform 180ms ease;
}

.race-choice-option-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 58px;
  gap: 10px;
  align-self: stretch;
  align-items: stretch;
}

.race-choice-option-wrap .race-choice-pill {
  width: 100%;
  min-height: 50px;
}

.race-choice-detail-button {
  min-height: 50px;
  width: 58px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(216, 181, 109, 0.24);
  border-radius: 14px;
  color: #f4d987;
  background:
    radial-gradient(circle at 50% 42%, rgba(216, 181, 109, 0.14), transparent 52%),
    rgba(10, 15, 22, 0.72);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.race-choice-detail-button:hover {
  border-color: rgba(216, 181, 109, 0.58);
  background:
    radial-gradient(circle at 50% 42%, rgba(216, 181, 109, 0.24), transparent 58%),
    rgba(216, 181, 109, 0.09);
  box-shadow: 0 0 18px rgba(216, 181, 109, 0.12);
  transform: translateY(-1px);
}

.race-choice-eye-icon {
  width: 31px;
  height: 31px;
  fill: none;
  stroke: #f4d987;
  stroke-width: 5;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 0 9px rgba(216, 181, 109, 0.34));
}

.race-choice-pill.is-detailed {
  min-height: 58px;
  align-items: flex-start;
  justify-content: flex-start;
  padding: 10px 12px;
  text-align: left;
}

.race-choice-pill-copy {
  display: grid;
  gap: 3px;
}

.race-choice-pill-copy strong {
  color: rgba(244, 247, 255, 0.94);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.race-choice-pill-copy small {
  color: rgba(232, 238, 247, 0.66);
  font-size: 9.75px;
  font-weight: 600;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-transform: none;
}

.race-choice-lock {
  color: #d9a47a;
}

.race-choice-pill:hover {
  transform: translateY(-1px);
}

.race-choice-pill.is-selected {
  border-color: color-mix(in srgb, var(--race-tone, #d8b56d) 70%, transparent);
  color: #fff5d2;
  background: linear-gradient(180deg, color-mix(in srgb, var(--race-tone, #d8b56d) 26%, rgba(255, 255, 255, 0.08)), color-mix(in srgb, var(--race-tone, #d8b56d) 14%, rgba(255, 255, 255, 0.03)));
  box-shadow: 0 0 18px color-mix(in srgb, var(--race-tone, #d8b56d) 16%, transparent);
}

.race-choice-pill.is-disabled,
.race-choice-pill:disabled {
  opacity: 0.56;
  cursor: not-allowed;
  border-style: dashed;
  box-shadow: none;
}

.race-choice-pill.is-disabled:hover,
.race-choice-pill:disabled:hover {
  transform: none;
}

.race-choice-field.is-hidden-choice {
  display: none;
}

.attribute-detail-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 95;
  display: grid;
  place-items: center;
  padding: 24px;
}

.attribute-detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 5, 10, 0.72);
  backdrop-filter: blur(8px);
}

.attribute-detail-modal {
  position: relative;
  width: min(520px, 94vw);
  border: 1px solid rgba(216, 181, 109, 0.34);
  border-radius: 22px;
  padding: 22px;
  color: rgba(237, 242, 249, 0.92);
  background:
    radial-gradient(circle at top left, rgba(216, 181, 109, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(15, 22, 32, 0.98), rgba(4, 7, 12, 0.98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.5), 0 0 32px rgba(216, 181, 109, 0.1);
}

.attribute-detail-modal header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 14px;
}

.attribute-detail-modal h3 {
  margin: 0;
  color: #f4d987;
  font-size: 26px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.attribute-detail-modal header span {
  color: rgba(206, 223, 244, 0.72);
  font-weight: 800;
}

.attribute-detail-modal p {
  margin: 0;
  color: rgba(239, 244, 250, 0.82);
  line-height: 1.65;
}

.race-feat-trigger {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.025));
  color: rgba(244, 247, 255, 0.9);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.race-feat-trigger:hover {
  transform: translateY(-1px);
}

.race-feat-trigger.is-selected {
  border-color: color-mix(in srgb, var(--race-tone, #d8b56d) 68%, transparent);
  color: #fff5d2;
  background: linear-gradient(180deg, color-mix(in srgb, var(--race-tone, #d8b56d) 18%, rgba(255, 255, 255, 0.07)), rgba(255, 255, 255, 0.03));
}

.race-feat-trigger.is-secondary {
  margin-top: 10px;
  min-height: 38px;
  font-size: 9px;
  letter-spacing: 0.14em;
}

.race-feat-preview {
  margin: 8px 0 0;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.race-feat-preview strong {
  display: block;
  margin-bottom: 4px;
  color: var(--feat-title-yellow);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.race-feat-preview p {
  margin: 0;
  color: rgba(232, 238, 247, 0.78);
  font-size: 11px;
  line-height: 1.4;
}

.race-feat-choice-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.race-feat-choice-toolbar small,
.race-feat-choice-status {
  color: rgba(232, 238, 247, 0.7);
  font-size: 11px;
  line-height: 1.4;
}

.race-feat-choice-status {
  margin-top: 10px;
}

.race-feat-choice-status.is-blocked {
  color: #f2a790;
}

.race-feat-choice-status.is-muted {
  color: rgba(232, 238, 247, 0.58);
}

.race-feat-choice-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

.race-feat-choice-summary span {
  padding: 6px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: rgba(244, 247, 255, 0.84);
  font-size: 10px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.race-feat-modal-layer {
  position: absolute;
  inset: 0;
  z-index: 6;
  display: grid;
  place-items: center;
}

.race-feat-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 12, 0.76);
  backdrop-filter: blur(8px);
}

.race-feat-modal {
  position: relative;
  width: min(780px, calc(100% - 56px));
  max-height: min(76dvh, 820px);
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(7, 11, 17, 0.98), rgba(8, 12, 18, 0.95));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.44);
  animation: race-panel-fade 220ms ease;
}

.race-feat-modal-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.race-feat-modal-head h3 {
  margin: 4px 0 0;
  color: var(--feat-title-yellow);
  font-size: 24px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.race-feat-modal-close {
  width: 38px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  color: rgba(244, 247, 255, 0.72);
  background: rgba(255, 255, 255, 0.04);
  font-size: 0;
  position: relative;
}

.race-feat-modal-close::before,
.race-feat-modal-close::after {
  content: "";
  position: absolute;
  top: 18px;
  left: 10px;
  width: 16px;
  height: 1.5px;
  background: currentColor;
}

.race-feat-modal-close::before {
  transform: rotate(45deg);
}

.race-feat-modal-close::after {
  transform: rotate(-45deg);
}

.race-feat-search {
  display: grid;
  gap: 6px;
}

.race-feat-search span {
  color: rgba(232, 238, 247, 0.58);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.race-feat-search input {
  min-height: 40px;
  border: 1px solid rgba(255, 255, 255, 0.11);
  border-radius: 10px;
  color: rgba(244, 247, 255, 0.94);
  background: rgba(255, 255, 255, 0.04);
}

.race-feat-modal-body {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding-right: 4px;
}

.race-feat-option {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  text-align: left;
  background: rgba(255, 255, 255, 0.03);
  transition: border-color 180ms ease, background 180ms ease, transform 180ms ease;
}

.race-feat-option:hover {
  transform: translateY(-1px);
}

.race-feat-option.is-selected {
  border-color: color-mix(in srgb, var(--race-tone, #d8b56d) 66%, transparent);
  background: color-mix(in srgb, var(--race-tone, #d8b56d) 10%, rgba(255, 255, 255, 0.03));
}

.race-feat-option.is-disabled {
  opacity: 0.56;
  cursor: not-allowed;
  transform: none;
}

.race-feat-option.is-disabled:hover {
  transform: none;
}

.race-feat-option > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.race-feat-option strong {
  color: var(--feat-title-yellow);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.race-feat-option span,
.race-feat-option small {
  color: rgba(232, 238, 247, 0.58);
  font-size: 10px;
  letter-spacing: 0.08em;
}

.race-feat-option p {
  margin: 0;
  color: rgba(232, 238, 247, 0.8);
  font-size: 12px;
  line-height: 1.42;
}

.race-feat-empty {
  padding: 28px 18px;
  border: 1px dashed rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  text-align: center;
  color: rgba(232, 238, 247, 0.64);
}

.feat-choice-modal {
  width: min(920px, calc(100% - 56px));
}

.feat-choice-intro {
  margin: 8px 0 0;
  color: rgba(232, 238, 247, 0.74);
  font-size: 12px;
  line-height: 1.5;
}

.feat-choice-progress {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
}

.feat-choice-progress strong {
  color: #fff4cb;
  font-size: 20px;
  letter-spacing: 0.08em;
}

.feat-choice-progress span {
  color: rgba(232, 238, 247, 0.68);
  font-size: 11px;
  line-height: 1.4;
}

.feat-choice-modal-body {
  display: grid;
  align-content: start;
  gap: 16px;
}

.feat-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.feat-choice-option {
  min-height: 0;
}

.race-rules-panel {
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
  padding: 6px 4px 10px 0;
}

.race-art-card {
  position: relative;
  height: clamp(330px, 46dvh, 430px);
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(5, 9, 14, 0.5);
  animation: race-panel-fade 300ms ease;
}

.race-art-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 25%;
  transform: translate(var(--race-surface-x, 0px), var(--race-surface-y, 0px)) scale(var(--race-surface-scale, 1));
  transform-origin: 50% 25%;
  transition: transform 260ms ease;
}

.race-editor-overlay {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}

.race-editor-micro {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 6px 8px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: rgba(6, 10, 16, 0.82);
  backdrop-filter: blur(12px);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.26);
}

.race-editor-micro > span {
  color: rgba(232, 238, 247, 0.62);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.race-editor-micro .ghost-button,
.race-editor-micro .accent-button {
  min-width: 0;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 10px;
  font-size: 10px;
  letter-spacing: 0.08em;
}

.race-editor-slider {
  display: inline-grid;
  grid-template-columns: auto 88px;
  align-items: center;
  gap: 8px;
  min-height: 28px;
  padding: 0 4px 0 2px;
}

.race-editor-slider span {
  color: rgba(232, 238, 247, 0.68);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.race-editor-slider input[type="range"] {
  width: 88px;
  accent-color: color-mix(in srgb, var(--race-tone, #d8b56d) 72%, white 12%);
}

.race-editor-micro .ghost-button.is-active {
  color: #fff5d2;
  border-color: color-mix(in srgb, var(--race-tone, #d8b56d) 64%, transparent);
  background: color-mix(in srgb, var(--race-tone, #d8b56d) 16%, rgba(255, 255, 255, 0.04));
}

.race-screen-bg.is-editing,
.race-art-card.is-editing {
  cursor: grab;
  outline: 1px solid color-mix(in srgb, var(--race-tone, #d8b56d) 74%, white 8%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 26px color-mix(in srgb, var(--race-tone, #d8b56d) 26%, transparent);
}

.race-screen-bg.is-dragging,
.race-art-card.is-dragging {
  cursor: grabbing;
}

.race-screen-bg.is-dragging img,
.race-art-card.is-dragging img {
  transition: none;
}

.race-art-card.is-unavailable {
  border-style: dashed;
  background:
    radial-gradient(circle at 50% 42%, color-mix(in srgb, var(--race-tone, #d8b56d) 18%, transparent), transparent 32%),
    rgba(5, 9, 14, 0.72);
}

.race-art-missing {
  width: 100%;
  height: 100%;
  display: grid;
  place-content: center;
  gap: 8px;
  text-align: center;
  color: rgba(232, 238, 247, 0.62);
}

.race-art-missing strong {
  color: color-mix(in srgb, var(--race-tone, #d8b56d) 72%, white 18%);
  font-size: 18px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.race-rule-card,
.race-rule-grid article,
.race-rules-panel blockquote {
  animation: race-panel-fade 380ms ease;
}

@keyframes race-background-fade {
  from {
    opacity: 0.4;
    transform: translate(var(--race-surface-x, 0px), calc(var(--race-surface-y, 0px) + 10px)) scale(calc(var(--race-surface-scale, 1) * 1.015));
  }
  to {
    opacity: 1;
    transform: translate(var(--race-surface-x, 0px), var(--race-surface-y, 0px)) scale(var(--race-surface-scale, 1));
  }
}

@keyframes race-panel-fade {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.race-art-missing span {
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.race-rule-card {
  padding: 12px;
}

.race-rule-card.is-bonus p {
  color: #fff1bd;
  font-weight: 800;
}

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

.race-rule-grid article {
  padding: 10px;
}

.race-rule-grid span {
  display: block;
  color: rgba(232, 238, 247, 0.5);
  font-size: 9px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.race-rule-grid strong {
  display: block;
  margin-top: 5px;
  color: rgba(244, 247, 255, 0.9);
  font-size: 12px;
  line-height: 1.25;
}

.race-rule-card ul {
  margin: 0;
  padding-left: 18px;
}

.race-rules-panel blockquote {
  margin: 0;
  padding: 12px;
  color: #e6c87d;
  font-size: 12px;
  font-style: italic;
  line-height: 1.35;
}

.race-doc-status {
  margin: 0;
  color: rgba(232, 238, 247, 0.56);
  font-size: 11px;
}

.race-doc-status.is-error {
  color: #ffb2a5;
}

.background-select-screen {
  grid-template-columns: 300px minmax(0, 1fr) minmax(280px, 0.72fr);
}

.background-screen-bg::after {
  background:
    linear-gradient(92deg, rgba(4, 8, 13, 0.96), rgba(4, 8, 13, 0.72) 44%, rgba(4, 8, 13, 0.98)),
    radial-gradient(circle at center, transparent 54%, rgba(0, 0, 0, 0.34) 78%, rgba(0, 0, 0, 0.82) 100%),
    linear-gradient(180deg, rgba(0, 0, 0, 0.34), rgba(0, 0, 0, 0.54)),
    rgba(0, 0, 0, 0.24);
}

.background-screen-bg img {
  object-fit: cover;
  object-position: center center;
  filter: saturate(1.02) blur(var(--race-surface-blur, 0px));
}

.background-detail-panel {
  grid-column: 2 / -1;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 18px;
  padding-right: 2px;
}

.background-hero-banner {
  position: relative;
  min-height: 375px;
  height: clamp(375px, 46dvh, 480px);
  overflow: hidden;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 18px;
  background: rgba(5, 9, 14, 0.62);
  box-shadow: 0 28px 54px rgba(0, 0, 0, 0.32);
  animation: race-panel-fade 320ms ease;
}

.background-hero-banner img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 50% 25%;
  transform: translate(var(--race-surface-x, 0px), var(--race-surface-y, 0px)) scale(var(--race-surface-scale, 1));
  transform-origin: 50% 25%;
  transition: transform 260ms ease;
}

.background-hero-banner.is-unavailable {
  border-style: dashed;
  background:
    radial-gradient(circle at 50% 38%, color-mix(in srgb, var(--race-tone, #d8b56d) 18%, transparent), transparent 34%),
    rgba(5, 9, 14, 0.78);
}

.background-hero-overlay,
.background-hero-frame,
.background-hero-badge {
  position: absolute;
  pointer-events: none;
}

.background-hero-overlay {
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 26%, rgba(4, 8, 13, 0.14) 60%, rgba(4, 8, 13, 0.42)),
    linear-gradient(90deg, rgba(4, 8, 13, 0.26), transparent 20%, transparent 80%, rgba(4, 8, 13, 0.3));
}

.background-hero-frame {
  inset: 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.02);
}

.background-hero-badge {
  top: 16px;
  left: 18px;
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border: 1px solid color-mix(in srgb, var(--race-tone, #d8b56d) 34%, transparent);
  border-radius: 999px;
  color: #fff0c4;
  background: rgba(8, 13, 20, 0.48);
  backdrop-filter: blur(10px);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.background-hero-banner.is-editing {
  cursor: grab;
  outline: 1px solid color-mix(in srgb, var(--race-tone, #d8b56d) 74%, white 8%);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 0 26px color-mix(in srgb, var(--race-tone, #d8b56d) 26%, transparent);
}

.background-hero-banner.is-dragging {
  cursor: grabbing;
}

.background-hero-banner.is-dragging img {
  transition: none;
}

.background-body-grid {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(280px, 0.72fr);
  gap: 18px;
  align-items: start;
}

.background-story-column,
.background-equipment-column {
  min-width: 0;
}

.background-story-column {
  display: grid;
  align-content: start;
  gap: 14px;
}

.background-equipment-column {
  display: grid;
  align-content: start;
}

.background-detail-card {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(10, 15, 22, 0.84), rgba(7, 10, 15, 0.7)),
    rgba(7, 10, 15, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
  animation: race-panel-fade 360ms ease;
}

.background-overview-card {
  padding: 18px 20px 20px;
}

.background-overview-card h3 {
  margin: 0;
  color: color-mix(in srgb, var(--race-tone, #d8b56d) 76%, white 20%);
  font-size: clamp(28px, 2.6vw, 42px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.background-overview-card > span {
  display: block;
  margin-top: 6px;
  color: rgba(232, 238, 247, 0.7);
  font-size: 14px;
}

.background-overview-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 16px;
}

.background-overview-meta strong {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 999px;
  color: rgba(244, 247, 255, 0.86);
  background: rgba(255, 255, 255, 0.04);
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.background-lore-copy {
  display: grid;
  gap: 9px;
}

.background-lore-copy p {
  margin: 0;
}

.background-section-title {
  margin-top: 2px;
}

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

.background-info-card {
  min-height: 120px;
  padding: 14px 15px;
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(8, 12, 18, 0.72), rgba(6, 10, 16, 0.6)),
    rgba(6, 10, 16, 0.58);
}

.background-info-card.is-wide {
  grid-column: 1 / -1;
}

.class-weapon-stack-list {
  display: grid;
  gap: 8px;
}

.class-weapon-stack-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.02));
  transition: border-color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.class-weapon-stack-card.is-selected {
  border-color: color-mix(in srgb, var(--race-tone, #d8b56d) 62%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--race-tone, #d8b56d) 10%, rgba(255, 255, 255, 0.03)), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 18px color-mix(in srgb, var(--race-tone, #d8b56d) 10%, transparent);
}

.class-weapon-stack-pick {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  text-align: left;
}

.class-weapon-stack-pick:disabled {
  opacity: 1;
}

.class-weapon-stack-copy {
  display: grid;
  gap: 3px;
}

.class-weapon-stack-copy strong {
  color: rgba(244, 247, 255, 0.94);
  font-size: 10.5px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.class-weapon-stack-copy small {
  color: rgba(232, 238, 247, 0.66);
  font-size: 9.75px;
  font-weight: 600;
  line-height: 1.3;
}

.class-weapon-stack-controls {
  display: inline-grid;
  grid-template-columns: 28px 34px 28px;
  gap: 6px;
  align-items: center;
}

.class-weapon-stack-adjust {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 10px;
  color: rgba(244, 247, 255, 0.9);
  background: rgba(255, 255, 255, 0.05);
  font-size: 16px;
  font-weight: 800;
  line-height: 1;
}

.class-weapon-stack-adjust:disabled {
  opacity: 0.38;
  cursor: not-allowed;
}

.class-weapon-stack-amount {
  min-width: 34px;
  height: 28px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: #f4e7c1;
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.background-chip-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.background-chip-list span {
  min-height: 30px;
  display: inline-flex;
  align-items: center;
  padding: 0 11px;
  border: 1px solid color-mix(in srgb, var(--race-tone, #d8b56d) 30%, transparent);
  border-radius: 999px;
  color: rgba(244, 247, 255, 0.92);
  background: color-mix(in srgb, var(--race-tone, #d8b56d) 9%, rgba(255, 255, 255, 0.03));
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.background-equipment-card {
  position: relative;
  padding: 18px 18px 20px;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 12%, color-mix(in srgb, var(--race-tone, #d8b56d) 10%, transparent), transparent 34%),
    linear-gradient(180deg, rgba(12, 17, 25, 0.88), rgba(9, 13, 19, 0.74));
}

.background-equipment-card::before {
  content: "";
  position: absolute;
  inset: 12px;
  border: 1px dashed rgba(215, 168, 79, 0.16);
  border-radius: 13px;
  pointer-events: none;
}

.background-equipment-head {
  position: relative;
  padding-left: 46px;
}

.background-equipment-head::before {
  content: "\25a3";
  position: absolute;
  left: 0;
  top: 1px;
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 168, 79, 0.26);
  border-radius: 10px;
  color: #e6c87d;
  background: rgba(255, 255, 255, 0.04);
  font-size: 15px;
}

.background-equipment-head h4 {
  margin: 0;
  color: #f6ebd2;
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.background-equipment-head span {
  display: block;
  margin-top: 6px;
  color: rgba(232, 238, 247, 0.68);
  font-size: 12px;
  line-height: 1.4;
}

.background-equipment-card > .race-choice-field {
  position: relative;
  z-index: 1;
  margin-top: 16px;
}

.background-equipment-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.background-equipment-list li {
  position: relative;
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 11px 14px 11px 44px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: rgba(244, 247, 255, 0.88);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12.5px;
  line-height: 1.35;
}

.background-equipment-list li::before {
  content: "";
  position: absolute;
  left: 16px;
  width: 14px;
  height: 14px;
  border-radius: 4px;
  border: 1px solid rgba(215, 168, 79, 0.32);
  background: linear-gradient(180deg, rgba(215, 168, 79, 0.2), rgba(255, 255, 255, 0.03));
  box-shadow: 0 0 14px rgba(215, 168, 79, 0.12);
}

.background-equipment-list .background-bag-item {
  display: block;
  padding: 0;
}

.background-equipment-list .background-bag-item::before {
  display: none;
}

.background-bag-details {
  width: 100%;
}

.background-bag-details > summary {
  min-height: 48px;
  display: flex;
  align-items: center;
  padding: 11px 42px 11px 44px;
  cursor: pointer;
  list-style: none;
}

.background-bag-details > summary::-webkit-details-marker {
  display: none;
}

.background-bag-details > summary::before {
  content: "";
  position: absolute;
  left: 16px;
  width: 14px;
  height: 14px;
  border: 1px solid rgba(215, 168, 79, 0.32);
  border-radius: 4px;
  background: linear-gradient(180deg, rgba(215, 168, 79, 0.2), rgba(255, 255, 255, 0.03));
  box-shadow: 0 0 14px rgba(215, 168, 79, 0.12);
}

.background-bag-details > summary::after {
  content: "+";
  position: absolute;
  right: 16px;
  color: #e6c87d;
  font-size: 18px;
  line-height: 1;
}

.background-bag-details[open] > summary::after {
  content: "-";
}

.background-bag-details > summary span {
  display: grid;
  gap: 3px;
}

.background-bag-details > summary strong {
  color: rgba(244, 247, 255, 0.92);
  font-size: 12px;
}

.background-bag-details > summary small {
  color: rgba(232, 238, 247, 0.56);
  font-size: 9.5px;
}

.background-bag-content {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 10px 10px;
  list-style: none;
}

.background-bag-content > li {
  min-height: 42px;
  background: rgba(0, 0, 0, 0.16);
}

.background-equipment-note {
  position: relative;
  z-index: 1;
  margin: 16px 0 0;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: rgba(232, 238, 247, 0.74);
  font-size: 12px;
  line-height: 1.45;
}

.background-equipment-note strong {
  color: #f6ebd2;
}

.background-gold-wallet,
.background-equipment-placeholder {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 8px;
  margin-top: 18px;
  padding: 16px;
  border-radius: 14px;
}

.background-gold-wallet {
  border: 1px solid rgba(215, 168, 79, 0.22);
  background:
    radial-gradient(circle at 18% 18%, rgba(215, 168, 79, 0.18), transparent 40%),
    linear-gradient(180deg, rgba(56, 42, 18, 0.34), rgba(17, 13, 7, 0.18));
  box-shadow: inset 0 0 0 1px rgba(255, 243, 209, 0.04), 0 0 24px rgba(215, 168, 79, 0.1);
}

.background-gold-wallet.is-secondary {
  margin-top: 14px;
}

.background-gold-wallet span {
  color: rgba(255, 232, 181, 0.74);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.background-gold-wallet strong {
  color: #ffe9a8;
  font-size: clamp(28px, 2.2vw, 38px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.background-gold-wallet p,
.background-equipment-placeholder p {
  margin: 0;
  color: rgba(232, 238, 247, 0.74);
  font-size: 12px;
  line-height: 1.45;
}

.background-equipment-placeholder {
  border: 1px dashed rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.03);
}

.background-equipment-placeholder strong {
  color: #fff0c4;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.class-select-screen {
  position: relative;
  height: 100%;
  min-height: 0;
  display: grid;
  grid-template-columns: 260px minmax(600px, 1.08fr) minmax(560px, 0.92fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 20px;
  padding: 16px 22px 14px;
  overflow: hidden;
  color: var(--text);
}

.class-select-list,
.class-select-main {
  min-width: 0;
}

.class-progression-panel,
.class-info-card,
.class-select-option,
.class-summary-panel {
  border: 1px solid rgba(116, 167, 255, 0.13);
  background: linear-gradient(180deg, rgba(9, 15, 24, 0.64), rgba(7, 11, 18, 0.54));
  backdrop-filter: blur(14px);
}

.class-select-list {
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 8px 0 0;
  overflow: hidden;
}

.class-select-heading h3,
.class-summary-panel h3,
.class-progression-head h3 {
  margin: 0;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.class-select-heading h3 {
  color: #f4f7ff;
  font-size: 20px;
  letter-spacing: 0.06em;
  white-space: nowrap;
}

.class-select-heading p:not(.eyebrow) {
  max-width: 330px;
  margin: 5px 0 10px;
  color: rgba(232, 238, 247, 0.78);
  line-height: 1.35;
  font-size: 12px;
}

.class-select-scroll {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 0;
  overflow: auto;
  padding-right: 4px;
  border: 1px solid rgba(116, 167, 255, 0.12);
  border-radius: 10px;
  background: rgba(8, 13, 21, 0.44);
}

.class-select-option {
  min-height: 42px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  padding: 5px 9px;
  border-width: 0 0 1px;
  border-radius: 0;
  color: rgba(238, 243, 251, 0.86);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: transform 180ms ease, border-color 220ms ease, background-color 220ms ease, box-shadow 220ms ease, opacity 180ms ease;
}

.class-select-option:hover:not(.is-blocked) {
  transform: none;
  border-color: rgba(128, 170, 230, 0.38);
  background: rgba(53, 93, 154, 0.18);
}

.class-select-option.is-active {
  border-color: rgba(116, 167, 255, 0.85);
  background: linear-gradient(90deg, rgba(45, 95, 178, 0.46), rgba(255, 255, 255, 0.04));
  box-shadow: 0 0 28px rgba(83, 142, 255, 0.22), inset 0 0 0 1px rgba(154, 195, 255, 0.42);
  border-radius: 8px;
}

.class-select-option.is-blocked {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.25);
}

.class-select-icon {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border: 0;
  border-radius: 0;
  color: #efd7a5;
  background: transparent;
  font-weight: 900;
  letter-spacing: 0.05em;
  filter: drop-shadow(0 0 8px rgba(231, 204, 150, 0.28));
}

.class-select-icon img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

.class-select-icon.is-empty {
  opacity: 0;
  filter: none;
}

.class-select-icon.is-empty img {
  display: none;
}

.class-select-copy strong,
.class-select-copy small {
  display: block;
}

.class-select-copy strong {
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.class-select-copy small {
  margin-top: 2px;
  font-size: 11px;
  color: rgba(232, 238, 247, 0.62);
}

.class-lock-tag {
  padding: 3px 6px;
  border-radius: 999px;
  color: #ffe6df;
  background: rgba(185, 87, 72, 0.5);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.class-select-main {
  min-height: 0;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 8px;
  padding-top: 18px;
  overflow: hidden;
}

.class-select-main,
.class-progression-panel {
  transition: opacity 150ms ease, filter 180ms ease, transform 180ms ease;
}

.class-select-main.is-class-fading-out,
.class-progression-panel.is-class-fading-out {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(4px);
}

.class-select-main.is-class-fading-in,
.class-progression-panel.is-class-fading-in {
  animation: classPanelFadeIn 280ms ease-out both;
}

.class-hero-zone {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(270px, 0.8fr);
  gap: 14px;
  align-items: stretch;
  overflow: hidden;
}

.class-image-placeholder {
  min-height: clamp(330px, 46dvh, 430px);
  height: 100%;
  position: relative;
  display: block;
  overflow: hidden;
  border: 0;
  border-radius: 14px;
  background: rgba(5, 9, 14, 0.42);
  color: rgba(232, 238, 247, 0.5);
}

.class-art-empty,
.class-art-frame {
  width: 100%;
  height: 100%;
  min-height: 100%;
}

.class-art-empty {
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 42% 38%, rgba(70, 148, 255, 0.34), transparent 18%),
    radial-gradient(ellipse at center, rgba(70, 148, 255, 0.12), transparent 50%),
    linear-gradient(180deg, transparent, rgba(5, 9, 14, 0.2));
}

.class-art-frame {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: #05090e;
  border-radius: inherit;
}

.class-art-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center center;
  filter: none;
  transform: scale(1.2);
  transform-origin: center center;
}

.class-select-icon.is-hero {
  width: 120px;
  height: 120px;
  font-size: 0;
  filter: drop-shadow(0 0 42px rgba(82, 144, 255, 0.34));
}

.class-select-icon.is-hero.is-art-mark {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 1;
  width: 72px;
  height: 72px;
  opacity: 0.92;
  filter:
    drop-shadow(0 4px 8px rgba(0, 0, 0, 0.78))
    drop-shadow(0 0 24px rgba(231, 204, 150, 0.42));
}

.class-summary-panel {
  min-width: 0;
  display: grid;
  align-content: center;
  gap: 9px;
  padding: 12px 6px;
  border: 0;
  background: transparent;
  backdrop-filter: none;
}

.class-title-row {
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: center;
}

.class-title-row > div {
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  flex: 1 1 auto;
}

.class-select-icon.is-title {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  font-size: 13px;
  filter: drop-shadow(0 0 18px rgba(82, 144, 255, 0.42));
}

.class-summary-panel h3 {
  max-width: 100%;
  color: #b9d3ff;
  font-size: clamp(17px, 1.08vw, 21px);
  line-height: 1.05;
  letter-spacing: 0.075em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  overflow-wrap: normal;
}

.class-summary-panel p {
  max-width: 100%;
  margin: 0;
  color: rgba(232, 238, 247, 0.78);
  line-height: 1.34;
  font-size: 12px;
  overflow-wrap: anywhere;
}

.class-summary-panel .class-title-row > div > span {
  display: block;
  color: rgba(232, 238, 247, 0.72);
  font-size: 14px;
  overflow-wrap: anywhere;
}

.class-stat-grid {
  display: grid;
  gap: 7px;
  margin-top: 4px;
}

.class-stat-grid div {
  min-height: 34px;
  padding: 0 0 0 36px;
  border-left: 0;
  background: transparent;
  position: relative;
}

.class-stat-grid div::before {
  content: "";
  position: absolute;
  left: 0;
  top: 1px;
  width: 29px;
  height: 29px;
  background: center / contain no-repeat;
  filter: drop-shadow(0 0 8px rgba(111, 159, 255, 0.35));
}

.class-stat-grid .is-role::before {
  background-image: url("./Datos app/Clases/Pantalla de clase/icono-escudo.svg");
}

.class-stat-grid .is-difficulty::before {
  background-image: url("./Datos app/Clases/Pantalla de clase/icono-barras.svg");
}

.class-stat-grid .is-attribute::before {
  background-image: url("./Datos app/Clases/Pantalla de clase/icono-corazon.svg");
}

.class-playstyle-panel {
  margin-top: 2px;
  padding: 10px 12px;
  border: 1px solid rgba(116, 167, 255, 0.13);
  border-radius: 10px;
  background: rgba(5, 9, 14, 0.26);
}

.class-playstyle-panel h4 {
  margin: 0 0 5px;
  color: #8bb8ff;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.class-playstyle-panel p {
  margin: 0;
  color: rgba(232, 238, 247, 0.72);
  font-size: 11px;
  line-height: 1.24;
}

.class-detail-button {
  justify-self: start;
  min-height: 34px;
  padding: 0 18px;
  border: 1px solid rgba(139, 184, 255, 0.28);
  border-radius: 10px;
  color: #cfe0ff;
  background: rgba(27, 48, 80, 0.34);
  box-shadow: inset 0 0 16px rgba(139, 184, 255, 0.08);
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 10px;
  font-weight: 900;
  transition: transform 180ms ease, border-color 220ms ease, background-color 220ms ease;
}

.class-detail-button:hover {
  transform: translateY(-1px);
  border-color: rgba(139, 184, 255, 0.5);
  background: rgba(40, 76, 132, 0.42);
}

.class-action-row {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 0.78fr) minmax(0, 1.22fr);
  gap: 8px;
  align-items: center;
}

.class-complete-button {
  width: 100%;
  min-width: 0;
  padding-inline: 10px;
  white-space: nowrap;
  letter-spacing: 0.1em;
  font-size: 9px;
}

.class-complete-button.is-required {
  animation: classChoiceBreath 2.1s ease-in-out infinite;
}

.class-stat-grid span {
  display: block;
  color: rgba(232, 238, 247, 0.58);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.class-stat-grid strong {
  display: block;
  margin-top: 3px;
  font-size: 13px;
}

.class-bottom-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0;
  border-top: 1px solid rgba(116, 167, 255, 0.14);
  background: rgba(5, 9, 14, 0.24);
}

.class-info-card {
  min-height: 62px;
  padding: 8px 12px;
  border-width: 0 1px 0 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

.class-info-card h4 {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  color: #8bb8ff;
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.class-info-card:nth-child(1) h4 {
  color: #9adf70;
}

.class-info-card:nth-child(2) h4 {
  color: #ef6868;
}

.class-info-card:nth-child(3) h4 {
  color: #8bb8ff;
  font-size: 10px;
}

.class-info-icon {
  position: relative;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  display: inline-grid;
  place-items: center;
  background: center / contain no-repeat;
}

.class-info-icon.is-strength {
  background-image: url("./Datos app/Clases/Pantalla de clase/escudo_medieval_vandrya.svg");
  filter: hue-rotate(86deg) saturate(1.55) brightness(1.1) drop-shadow(0 0 8px rgba(154, 223, 112, 0.46));
}

.class-info-icon.is-weakness {
  background-image: url("./Datos app/Clases/Pantalla de clase/logo_espadas.svg");
  filter: drop-shadow(0 0 8px rgba(239, 104, 104, 0.42));
}

.class-info-icon.is-example {
  background-image: url("./Datos app/Clases/Pantalla de clase/hachas_vandrya.svg");
  filter: hue-rotate(160deg) saturate(1.7) brightness(1.12) drop-shadow(0 0 8px rgba(139, 184, 255, 0.45));
}

.class-info-card p,
.class-info-card li {
  color: rgba(232, 238, 247, 0.72);
  line-height: 1.22;
  font-size: 11px;
}

.class-info-card ul {
  margin: 0;
  padding-left: 18px;
}

.class-progression-panel {
  min-width: 0;
  min-height: 0;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  align-self: stretch;
  margin-top: 22px;
  padding: 10px;
  border-radius: 14px;
  overflow: hidden;
}

.class-progression-head {
  margin-bottom: 6px;
}

.class-progression-scroll {
  min-height: 0;
  overflow: auto;
  border: 1px solid rgba(135, 175, 230, 0.12);
  border-radius: 12px;
  background: rgba(5, 9, 14, 0.28);
}

.class-progression-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
  color: rgba(232, 238, 247, 0.82);
  font-size: 10px;
}

.class-progression-table th,
.class-progression-table td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.065);
  border-right: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: top;
}

.class-progression-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  color: #cfe0ff;
  background: rgba(10, 17, 27, 0.96);
  letter-spacing: 0.08em;
  line-height: 1.18;
  text-transform: uppercase;
  white-space: normal;
}

.class-progression-table td:first-child {
  color: #fff;
  font-weight: 900;
  text-align: center;
}

.class-progression-table .is-feature-cell {
  min-width: 230px;
  color: rgba(232, 238, 247, 0.76);
}

.class-progression-empty {
  min-height: 260px;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 10px;
  padding: 24px;
  border: 1px dashed rgba(185, 87, 72, 0.35);
  border-radius: 14px;
  color: rgba(232, 238, 247, 0.72);
  text-align: center;
}

.class-progression-empty strong {
  color: #ffe3dc;
}

.class-detail-layer {
  position: absolute;
  inset: 10px;
  z-index: 8;
  box-sizing: border-box;
  display: grid;
  place-items: stretch;
  padding: 0;
  background: rgba(3, 6, 10, 0.72);
  backdrop-filter: blur(12px);
  animation: classDetailLayerIn 260ms ease-out both;
}

.class-choice-layer {
  position: absolute;
  inset: 10px;
  z-index: 8;
  box-sizing: border-box;
  display: grid;
  place-items: stretch;
  padding: 0;
  background: rgba(3, 6, 10, 0.74);
  backdrop-filter: blur(12px);
  animation: classDetailLayerIn 260ms ease-out both;
}

.class-detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.class-choice-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
}

.class-detail-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(139, 184, 255, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(12, 18, 28, 0.98), rgba(6, 10, 16, 0.98)),
    radial-gradient(circle at 22% 12%, rgba(139, 184, 255, 0.18), transparent 32%);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: classDetailDialogIn 340ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: top center;
}

.class-choice-dialog {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  max-height: none;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(139, 184, 255, 0.24);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(12, 18, 28, 0.97), rgba(6, 10, 16, 0.98)),
    radial-gradient(circle at 16% 8%, rgba(139, 184, 255, 0.14), transparent 32%);
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.62), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
  animation: classDetailDialogIn 340ms cubic-bezier(0.16, 1, 0.3, 1) both;
  transform-origin: top center;
}

.class-detail-head {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(139, 184, 255, 0.14);
}

.class-choice-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 12px 18px;
  border-bottom: 1px solid rgba(139, 184, 255, 0.14);
}

.class-detail-portrait {
  height: 104px;
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(139, 184, 255, 0.16);
  border-radius: 14px;
  background:
    radial-gradient(circle at center, rgba(82, 144, 255, 0.18), transparent 44%),
    rgba(5, 9, 14, 0.78);
}

.class-detail-portrait img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center 18%;
  filter: none;
}

.class-detail-portrait .class-select-icon {
  width: 100%;
  height: 100%;
}

.class-select-icon.is-detail {
  width: 88px;
  height: 88px;
  filter: drop-shadow(0 0 26px rgba(231, 204, 150, 0.36));
}

.class-detail-head h3 {
  margin: 0;
  color: #d7e5ff;
  font-size: clamp(21px, 1.65vw, 28px);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  white-space: nowrap;
}

.class-detail-head span {
  display: block;
  margin-top: 5px;
  color: rgba(232, 238, 247, 0.7);
  font-size: 12px;
}

.class-choice-head h3 {
  margin: 0;
  color: #d7e5ff;
  font-size: clamp(20px, 1.55vw, 26px);
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.class-choice-head span {
  display: block;
  margin-top: 5px;
  color: rgba(232, 238, 247, 0.72);
  font-size: 12px;
}

.class-detail-close {
  position: relative;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 999px;
  color: transparent;
  background: rgba(255, 255, 255, 0.05);
  font-size: 0;
  line-height: 1;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.class-detail-body {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  align-content: start;
  grid-auto-rows: max-content;
  gap: 12px;
  padding: 16px 12px 22px 20px;
  overflow-x: hidden;
  overflow-y: scroll;
  overflow-anchor: none;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 184, 255, 0.72) rgba(255, 255, 255, 0.08);
  touch-action: pan-y;
  cursor: grab;
  animation: classDetailContentIn 420ms 90ms ease-out both;
}

.class-detail-body.is-dragging {
  cursor: grabbing;
  user-select: none;
}

.class-detail-body::-webkit-scrollbar {
  width: 13px;
}

.class-detail-body::-webkit-scrollbar-track {
  border-left: 1px solid rgba(139, 184, 255, 0.08);
  background: rgba(255, 255, 255, 0.055);
}

.class-detail-body::-webkit-scrollbar-thumb {
  border: 3px solid rgba(9, 14, 22, 0.95);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(190, 214, 255, 0.82), rgba(87, 136, 214, 0.82));
  box-shadow: 0 0 14px rgba(139, 184, 255, 0.3);
}

.class-detail-body::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, rgba(225, 236, 255, 0.95), rgba(111, 161, 238, 0.92));
}

.class-choice-body {
  min-height: 0;
  height: 100%;
  max-height: 100%;
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 16px 18px 28px;
  overflow-x: hidden;
  overflow-y: scroll;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  scrollbar-width: thin;
  scrollbar-color: rgba(139, 184, 255, 0.72) rgba(255, 255, 255, 0.08);
}

.class-choice-intro {
  margin: 0;
  padding: 14px 16px;
  border: 1px solid rgba(221, 191, 112, 0.16);
  border-radius: 14px;
  color: rgba(232, 238, 247, 0.78);
  line-height: 1.45;
  background: linear-gradient(180deg, rgba(23, 19, 11, 0.32), rgba(8, 12, 19, 0.18));
}

.class-choice-stack {
  display: grid;
  gap: 18px;
}

.class-choice-stack .class-choices-panel {
  gap: 14px;
  align-self: start;
}

.class-choice-stack .class-extra-header {
  margin: 0 0 12px;
}

.class-choice-stack .background-info-card {
  align-self: start;
}

.class-choice-empty {
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(6, 10, 16, 0.54);
}

.class-choice-empty h4 {
  margin: 0 0 8px;
  color: #f4e4b4;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.class-choice-empty p {
  margin: 0;
  color: rgba(232, 238, 247, 0.72);
}

.class-detail-overview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.class-detail-compact-intro {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(520px, 1.1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
}

.class-detail-compact-intro p {
  margin: 0;
}

.class-detail-compact-intro .class-detail-stats {
  grid-column: auto;
}

.class-detail-section {
  padding: 14px;
  border: 1px solid rgba(116, 167, 255, 0.12);
  border-radius: 12px;
  background: rgba(5, 9, 14, 0.28);
}

.class-detail-section h4 {
  margin: 0 0 8px;
  color: #8bb8ff;
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.class-detail-section p,
.class-detail-section li {
  margin: 0;
  color: rgba(232, 238, 247, 0.76);
  line-height: 1.42;
  font-size: 13px;
}

.class-detail-stats,
.class-detail-columns {
  display: grid;
  gap: 12px;
  grid-column: 1 / -1;
}

.class-detail-stats {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.class-detail-stats div {
  padding: 10px;
  border: 1px solid rgba(116, 167, 255, 0.12);
  border-radius: 12px;
  background: rgba(12, 19, 30, 0.52);
}

.class-detail-stats span {
  display: block;
  color: rgba(232, 238, 247, 0.56);
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.class-detail-stats strong {
  display: block;
  margin-top: 5px;
  color: rgba(244, 247, 255, 0.92);
  font-size: 13px;
}

.class-detail-columns {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.class-detail-section.is-strength h4 {
  color: #9adf70;
}

.class-detail-section.is-weakness h4 {
  color: #ef6868;
}

.class-detail-section.is-example h4 {
  color: #8bb8ff;
}

.class-detail-progression .class-progression-scroll {
  max-height: 285px;
}

.class-detail-document {
  padding: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035), transparent 50%, rgba(255, 255, 255, 0.025)),
    rgba(6, 10, 16, 0.34);
}

.class-detail-document > h4 {
  margin: 0;
  padding: 16px 20px 0;
}

.class-detail-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 14px 20px 0;
}

.class-detail-tab {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid rgba(139, 184, 255, 0.18);
  border-radius: 10px;
  color: rgba(207, 224, 255, 0.74);
  background: rgba(8, 14, 23, 0.56);
  box-shadow: inset 0 0 14px rgba(139, 184, 255, 0.035);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.class-detail-tab:hover {
  transform: translateY(-1px);
  border-color: rgba(139, 184, 255, 0.36);
  color: rgba(244, 247, 255, 0.92);
  background: rgba(27, 48, 80, 0.42);
}

.class-detail-tab.is-active {
  border-color: rgba(221, 191, 112, 0.72);
  color: #fff5d2;
  background: linear-gradient(180deg, rgba(201, 151, 63, 0.34), rgba(90, 63, 27, 0.36));
  box-shadow: inset 0 0 18px rgba(255, 220, 142, 0.13), 0 0 16px rgba(221, 191, 112, 0.15);
}

.class-detail-document.is-empty,
.class-detail-document.is-loading {
  padding: 16px;
}

.class-detail-document.is-empty > h4,
.class-detail-document.is-loading > h4 {
  padding: 0;
}

.class-detail-markdown {
  padding: 14px 20px 22px;
  display: grid;
  gap: 18px;
  color: rgba(232, 238, 247, 0.78);
  overflow-anchor: none;
}

.class-detail-markdown.is-swapping {
  animation: classDetailPagesSwap 240ms ease-out both;
}

.class-detail-page {
  position: relative;
  height: clamp(560px, 66dvh, 720px);
  padding: 42px 22px 22px;
  overflow: hidden;
  border: 1px solid rgba(139, 184, 255, 0.12);
  border-radius: 12px;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.028), transparent 50%, rgba(255, 255, 255, 0.02)),
    rgba(5, 9, 14, 0.24);
}

.class-detail-page-number {
  position: absolute;
  right: 18px;
  top: 12px;
  color: rgba(232, 238, 247, 0.42);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.class-detail-page-columns {
  height: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
}

.class-detail-page-column {
  min-width: 0;
  overflow: hidden;
}

.class-detail-page-column + .class-detail-page-column {
  padding-left: 30px;
  border-left: 1px solid rgba(139, 184, 255, 0.12);
}

.class-detail-page-columns h2,
.class-detail-page-columns h3,
.class-detail-page-columns h4 {
  margin: 20px 0 8px;
  color: #d7e5ff;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.class-detail-page-columns h2 {
  display: inline-block;
  padding: 4px 9px;
  border-left: 3px solid rgba(221, 191, 112, 0.85);
  border-radius: 8px;
  background: linear-gradient(90deg, rgba(221, 191, 112, 0.16), transparent);
  font-size: 18px;
  color: #f1d58a;
}

.class-detail-page-columns h3 {
  display: inline-block;
  padding: 3px 8px;
  border-left: 2px solid rgba(139, 184, 255, 0.65);
  border-radius: 7px;
  background: rgba(47, 91, 151, 0.13);
  font-size: 15px;
  color: #9ec1ff;
}

.class-detail-page-columns h4 {
  font-size: 12px;
  color: #8bb8ff;
}

.class-detail-page-columns p,
.class-detail-page-columns li {
  margin: 0 0 8px;
  font-size: 12.5px;
  line-height: 1.45;
}

.class-detail-page-columns li::marker {
  color: #dfbf70;
}

.class-detail-page-columns ul {
  margin: 0 0 12px;
  padding-left: 20px;
}

.class-detail-page-columns strong {
  color: #ffe3a0;
  font-weight: 900;
}

.class-detail-page-columns em {
  color: rgba(207, 224, 255, 0.88);
}

.class-detail-page-columns .is-level-heading {
  border-color: rgba(92, 169, 255, 0.9);
  color: #bcd7ff;
  background: linear-gradient(90deg, rgba(92, 169, 255, 0.2), rgba(92, 169, 255, 0.035));
  box-shadow: 0 0 18px rgba(92, 169, 255, 0.08);
}

.class-detail-page-columns hr {
  height: 1px;
  margin: 18px 0;
  border: 0;
  background: rgba(139, 184, 255, 0.14);
}

.class-detail-table-wrap {
  max-width: 100%;
  margin: 12px 0 16px;
  overflow: auto;
  border: 1px solid rgba(139, 184, 255, 0.13);
  border-radius: 12px;
  background: rgba(5, 9, 14, 0.28);
}

.class-detail-table-wrap table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: 10px;
  color: rgba(232, 238, 247, 0.82);
}

.class-detail-table-wrap th,
.class-detail-table-wrap td {
  padding: 5px 6px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  border-right: 1px solid rgba(255, 255, 255, 0.045);
  vertical-align: top;
  overflow-wrap: anywhere;
}

.class-detail-table-wrap th {
  color: #cfe0ff;
  background: rgba(10, 17, 27, 0.95);
  letter-spacing: 0.08em;
  line-height: 1.18;
  text-transform: uppercase;
  white-space: normal;
}

.class-detail-table-wrap td:first-child {
  color: #fff;
  font-weight: 900;
  text-align: center;
}

.class-detail-table-wrap tbody tr:nth-child(even) {
  background: rgba(255, 255, 255, 0.025);
}

@keyframes classDetailLayerIn {
  from {
    opacity: 0;
    backdrop-filter: blur(4px);
  }
  to {
    opacity: 1;
    backdrop-filter: blur(12px);
  }
}

@keyframes classDetailDialogIn {
  from {
    opacity: 0;
    transform: translateY(22px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes classDetailPagesSwap {
  from {
    opacity: 0.28;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes classDetailContentIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes classPanelFadeIn {
  from {
    opacity: 0;
    filter: blur(8px);
    transform: translateY(4px);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: translateY(0);
  }
}

@keyframes classChoiceBreath {
  0%,
  100% {
    transform: translateY(0) scale(1);
    border-color: rgba(139, 184, 255, 0.28);
    box-shadow: inset 0 0 16px rgba(139, 184, 255, 0.08), 0 0 0 rgba(139, 184, 255, 0);
  }
  50% {
    transform: translateY(-1px) scale(1.02);
    border-color: rgba(139, 184, 255, 0.62);
    box-shadow: inset 0 0 18px rgba(139, 184, 255, 0.14), 0 0 20px rgba(139, 184, 255, 0.24);
  }
}

.builder-stage-grid {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.builder-choice-rail,
.builder-detail-panel,
.builder-side-panel,
.builder-theme-list,
.builder-theme-stage,
.builder-empty-panel {
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  background: rgba(8, 11, 16, 0.62);
  backdrop-filter: blur(14px);
}

.builder-choice-rail,
.builder-theme-list {
  padding: 18px;
}

.builder-choice-rail h3,
.builder-detail-panel h3,
.builder-side-panel h3,
.builder-empty-panel h3,
.builder-theme-list h3 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.builder-choice-rail > p,
.builder-detail-panel > p,
.builder-side-panel > p,
.builder-empty-panel p,
.builder-theme-list > p {
  color: var(--muted);
  line-height: 1.55;
}

.builder-search-field {
  margin: 18px 0 16px;
}

.builder-search-field input {
  min-height: 50px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.builder-scroll-list {
  display: grid;
  gap: 10px;
  max-height: 620px;
  overflow: auto;
  padding-right: 4px;
}

.builder-list-button {
  min-height: 76px;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 14px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
}

.builder-list-button.is-active {
  border-color: rgba(215, 168, 79, 0.5);
  background: linear-gradient(90deg, rgba(215, 168, 79, 0.16), rgba(255, 255, 255, 0.04));
  box-shadow: inset 3px 0 0 rgba(255, 221, 155, 0.9), 0 0 26px rgba(215, 168, 79, 0.12);
}

.builder-list-button strong {
  display: block;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.builder-list-button small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

.builder-list-button.is-blocked,
.builder-list-button:disabled {
  opacity: 0.72;
  cursor: not-allowed;
  border-style: dashed;
}

.builder-status-line {
  margin-top: 8px;
}

.class-blocked-note {
  margin-top: 14px;
  padding: 10px 12px;
  border: 1px dashed rgba(185, 87, 72, 0.4);
  border-radius: 12px;
  background: rgba(185, 87, 72, 0.1);
  color: var(--ink);
  font-size: 14px;
}

.builder-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 168, 79, 0.34);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(215, 168, 79, 0.08);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.builder-detail-panel {
  min-height: 680px;
  padding: 24px;
}

.builder-detail-hero {
  min-height: 320px;
  display: grid;
  align-content: end;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(5, 9, 14, 0.1), rgba(5, 9, 14, 0.86)),
    var(--detail-image, url("./assets/worlds/vandrya-realms-sheet-v2.jpg")) center / cover;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.builder-detail-hero p:last-child {
  margin-bottom: 0;
  color: var(--text);
}

.builder-detail-copy {
  margin-top: 18px;
  display: grid;
  gap: 16px;
}

.builder-divider {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215, 168, 79, 0.42), transparent);
}

.builder-trait-list,
.builder-kv-list {
  display: grid;
  gap: 12px;
}

.builder-trait-item,
.builder-kv-item,
.builder-side-card,
.builder-summary-card {
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.04);
}

.builder-trait-item strong,
.builder-kv-item strong,
.builder-summary-card span {
  display: block;
  color: var(--gold);
  font-size: 12px;
  text-transform: uppercase;
}

.builder-trait-item p,
.builder-kv-item p {
  margin: 8px 0 0;
  color: var(--text);
  line-height: 1.5;
}

.builder-side-panel {
  display: grid;
  gap: 18px;
  padding: 20px;
}

.builder-side-card h4 {
  margin: 0 0 14px;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 18px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.builder-side-card ul {
  margin: 0;
  padding-left: 18px;
  color: var(--muted);
  line-height: 1.6;
}

.builder-side-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.builder-theme-grid,
.builder-system-grid,
.builder-summary-grid {
  display: grid;
  gap: 18px;
}

.builder-theme-grid {
  height: 100%;
  min-height: 100%;
  grid-template-columns: 350px minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 14px;
  background: #05080d;
  animation: builderStageFade 260ms ease-out;
}

.builder-system-grid {
  position: relative;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: #05080d;
  animation: builderImageFade 360ms ease-out;
}

.system-bg-layer {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(180deg, rgba(5, 9, 14, 0.02), rgba(5, 9, 14, 0.1)),
    var(--system-image) center / cover;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 560ms cubic-bezier(0.22, 0.8, 0.28, 1), transform 720ms cubic-bezier(0.22, 0.8, 0.28, 1);
  will-change: opacity, transform;
}

.system-bg-layer.is-visible {
  opacity: 1;
  transform: scale(1);
}

.builder-system-overlay {
  position: relative;
  z-index: 1;
  min-height: 100%;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding: 42px 44px 30px;
  background:
    linear-gradient(90deg, rgba(5, 9, 14, 0.2), rgba(5, 9, 14, 0.04) 45%, rgba(5, 9, 14, 0.1)),
    linear-gradient(180deg, rgba(5, 9, 14, 0.04), rgba(5, 9, 14, 0.16));
}

.system-unavailable-badge {
  position: absolute;
  top: 28px;
  right: 86px;
  z-index: 2;
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: rgba(255, 245, 224, 0.94);
  background: rgba(38, 39, 34, 0.62);
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(14px);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  animation: systemBadgeIn 260ms ease-out both;
}

.builder-system-head {
  display: grid;
  gap: 26px;
  justify-items: start;
}

.builder-system-head h3 {
  margin: 0;
  color: var(--text);
  font-family: inherit;
  font-size: 15px;
  letter-spacing: 0.32em;
  text-transform: uppercase;
}

.system-search-field {
  width: min(280px, 80vw);
  margin-bottom: 0;
}

.builder-system-options {
  width: min(920px, 82vw);
  height: min(270px, 38vh);
  position: relative;
  align-self: center;
  justify-self: center;
  perspective: 1100px;
  transform-style: preserve-3d;
  cursor: grab;
  touch-action: none;
  user-select: none;
}

.builder-system-options:active {
  cursor: grabbing;
}

.system-option {
  appearance: none;
  position: relative;
  min-height: 76px;
  display: grid;
  place-items: center;
  gap: 6px;
  padding: 14px 0;
  overflow: hidden;
  border: 0 solid #000;
  border-radius: 15px;
  outline: 0;
  outline-width: 0;
  outline-color: transparent;
  background-clip: border-box;
  color: rgba(244, 239, 228, 0.92);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.026), rgba(255, 255, 255, 0.006)),
    rgba(8, 8, 8, 0.19);
  box-shadow: none;
  backdrop-filter: blur(36px) saturate(0.28) brightness(0.86) contrast(0.94);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.32em;
  font-weight: 900;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.82), 0 0 10px rgba(255, 255, 255, 0.12);
  text-rendering: geometricPrecision;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  backface-visibility: hidden;
  transform: translate(-50%, -50%);
  transform-style: preserve-3d;
  transition: transform 320ms cubic-bezier(0.2, 0.9, 0.2, 1), top 320ms cubic-bezier(0.2, 0.9, 0.2, 1), border-color 180ms ease, box-shadow 260ms ease, background-color 220ms ease, opacity 180ms ease;
  will-change: transform;
}

.system-option::before {
  content: none;
}

.system-option span {
  position: relative;
  z-index: 1;
  color: rgba(255, 250, 238, 0.98);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.55));
  transform: translateZ(1px);
}

.system-option.is-before,
.system-option.is-after {
  position: absolute;
  left: 50%;
  top: 23%;
  z-index: 1;
  width: min(620px, 66vw);
  min-height: 70px;
  opacity: 0.82;
}

.system-option.is-after {
  top: 24%;
}

.system-option:hover {
  transform: translate(-50%, -50%);
  border-color: #000;
  box-shadow: none;
}

.system-option.is-active {
  position: absolute;
  left: 50%;
  top: 65%;
  z-index: 2;
  width: min(900px, 84vw);
  min-height: 112px;
  font-size: 23px;
  letter-spacing: 0.36em;
  font-weight: 950;
  border-color: #000;
  box-shadow: none;
  transform: translate(-50%, -50%);
  animation: systemOptionForward 320ms cubic-bezier(0.2, 0.9, 0.2, 1);
}

.system-option:focus,
.system-option:focus-visible,
.system-option:active,
.system-option.is-active:focus,
.system-option.is-active:focus-visible,
.system-option.is-active:active {
  outline: 0;
  outline-width: 0;
  outline-color: transparent;
  border-color: #000;
  box-shadow: none !important;
  -webkit-tap-highlight-color: transparent;
}

.system-option.is-blocked {
  opacity: 0.92;
}

@keyframes systemOptionForward {
  from {
    opacity: 0.76;
    transform: translate(-50%, -50%);
  }
  to {
    opacity: 1;
    transform: translate(-50%, -50%);
  }
}

@keyframes systemBadgeIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.system-next-button {
  align-self: end;
  justify-self: end;
}

.builder-theme-stage {
  position: relative;
  min-height: 100%;
  padding: 24px;
  background:
    linear-gradient(180deg, rgba(5, 9, 14, 0.08), rgba(5, 9, 14, 0.18)),
    var(--theme-image) center / cover;
  animation: builderImageFade 360ms ease-out;
}

.builder-theme-list {
  border: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 0;
  padding: 38px 34px;
  background: linear-gradient(180deg, rgba(5, 10, 15, 0.99), rgba(5, 10, 15, 0.96));
  backdrop-filter: blur(10px);
  position: relative;
  z-index: 1;
  animation: builderPanelSlide 280ms ease-out;
}

.builder-theme-list .builder-scroll-list {
  max-height: none;
  margin: 0 -18px;
  padding: 4px 18px;
  overflow: visible;
}

.builder-theme-list h3 {
  margin: 0 0 28px;
  font-family: inherit;
  font-size: 20px;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.theme-search-field {
  position: relative;
  display: block;
  margin-bottom: 34px;
}

.theme-search-field span {
  position: absolute;
  left: 42px;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(244, 239, 228, 0.62);
  pointer-events: none;
}

.theme-search-field::before {
  content: "";
  position: absolute;
  left: 18px;
  top: 50%;
  width: 13px;
  height: 13px;
  transform: translateY(-50%);
  border: 2px solid rgba(244, 239, 228, 0.62);
  border-radius: 50%;
}

.theme-search-field::after {
  content: "";
  position: absolute;
  left: 30px;
  top: calc(50% + 8px);
  width: 8px;
  height: 2px;
  transform: rotate(45deg);
  background: rgba(244, 239, 228, 0.62);
}

.theme-search-field input {
  width: 100%;
  height: 44px;
  padding: 0 18px 0 42px;
  border-radius: 20px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.theme-search-field input::placeholder {
  color: transparent;
}

.theme-option {
  min-height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 10px;
  color: rgba(244, 239, 228, 0.56);
  background: transparent;
  text-align: left;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 700;
  transition: background-color 180ms ease, color 180ms ease, box-shadow 220ms ease, transform 180ms ease;
}

.theme-option:hover {
  color: rgba(244, 239, 228, 0.92);
  background: rgba(255, 255, 255, 0.06);
  transform: translateX(2px);
}

.theme-option.is-active {
  position: relative;
  color: var(--text);
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.12), rgba(255, 255, 255, 0.04));
  box-shadow: -10px 0 24px rgba(199, 226, 255, 0.18), 10px 0 24px rgba(199, 226, 255, 0.12);
}

.theme-option.is-active::before {
  content: "";
  position: absolute;
  left: -10px;
  top: 7px;
  bottom: 7px;
  width: 4px;
  border-radius: 999px;
  background: #eaf6ff;
  box-shadow: 0 0 18px rgba(199, 226, 255, 0.82);
}

.theme-badge {
  position: absolute;
  top: 30px;
  right: 34px;
  min-width: 138px;
  padding: 12px 20px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(9, 12, 17, 0.78);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  font-weight: 800;
}

.theme-next-button {
  position: absolute;
  right: 34px;
  bottom: 34px;
  min-width: 178px;
  height: 64px;
  padding: 0 18px 0 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  color: var(--text);
  background: rgba(18, 23, 31, 0.74);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.36), inset 0 0 18px rgba(255, 255, 255, 0.07);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 900;
  opacity: 1;
  filter: grayscale(0);
  transition:
    transform 180ms ease,
    box-shadow 260ms ease,
    background-color 360ms ease,
    border-color 360ms ease,
    opacity 420ms cubic-bezier(0.22, 0.8, 0.28, 1),
    filter 420ms cubic-bezier(0.22, 0.8, 0.28, 1);
}

.theme-next-button:hover:not(:disabled) {
  transform: translateY(-2px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.42), inset 0 0 18px rgba(255, 255, 255, 0.1);
}

.theme-next-button:disabled {
  cursor: not-allowed;
  opacity: 0.44;
  filter: grayscale(0.35);
  border-color: rgba(255, 255, 255, 0.11);
  background: rgba(18, 23, 31, 0.42);
  box-shadow: 0 6px 22px rgba(0, 0, 0, 0.28), inset 0 0 14px rgba(255, 255, 255, 0.04);
}

.theme-next-button span {
  position: relative;
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  color: currentColor;
  font-size: 0;
  line-height: 0;
  transition: transform 180ms ease, background-color 360ms ease, opacity 360ms ease;
}

.theme-next-button span::before {
  content: "";
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
  transform: rotate(45deg) translate(-1px, 1px);
}

.theme-next-button:hover:not(:disabled) span {
  transform: translateX(2px);
  background: rgba(255, 255, 255, 0.2);
}

.builder-stage-cta {
  margin-top: 26px;
  display: flex;
  justify-content: flex-end;
}

.builder-stage-cta .primary-button {
  min-width: 190px;
}

.builder-empty-panel {
  max-width: 780px;
  padding: 28px;
}

.builder-inline-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

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

.builder-summary-card strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.builder-review-wrap {
  display: grid;
  gap: 20px;
  max-width: 1040px;
}

.stepper {
  display: grid;
  gap: 8px;
}

.step-button {
  position: relative;
  min-height: 62px;
  display: grid;
  grid-template-rows: 20px 26px;
  align-content: start;
  justify-items: center;
  gap: 16px;
  padding: 0;
  color: rgba(244, 239, 228, 0.54);
  background: transparent;
  border: 0;
  text-align: center;
  min-width: 0;
  transition: color 180ms ease;
}

.step-button::after {
  display: none;
}

.step-button span:first-child {
  position: relative;
  z-index: 1;
  width: 14px;
  height: 14px;
  display: grid;
  place-items: center;
  align-self: center;
  border-radius: 50%;
  color: rgba(244, 239, 228, 0.72);
  border: 0;
  background: rgba(255, 255, 255, 0.34);
  font-size: 9px;
  font-weight: 800;
  line-height: 1;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 220ms ease, width 180ms ease, height 180ms ease;
}

.step-button strong {
  order: -1;
  width: 100%;
  overflow: hidden;
  color: currentColor;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.17em;
  line-height: 20px;
  text-transform: uppercase;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: opacity 180ms ease;
}

.step-button.is-active,
.step-button.is-complete {
  color: var(--text);
}

.step-button.is-complete span:first-child {
  border-color: rgba(212, 222, 240, 0.9);
  background: linear-gradient(145deg, rgba(224, 232, 247, 0.96), rgba(163, 181, 214, 0.9));
  color: #0d1520;
  width: 18px;
  height: 18px;
}

.step-button.is-active span:first-child {
  color: transparent;
  border-color: rgba(255, 219, 130, 0.94);
  background: radial-gradient(circle at 50% 45%, rgba(255, 240, 192, 1), rgba(226, 176, 69, 0.96));
  box-shadow: 0 0 20px rgba(215, 168, 79, 0.42);
  width: 16px;
  height: 16px;
}

@keyframes builderStageFade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes builderImageFade {
  from {
    opacity: 0;
    transform: scale(1.015);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes builderPanelSlide {
  from {
    opacity: 0;
    transform: translateX(-10px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.builder-stage,
.live-preview,
.stage-card,
.sheet-toolbar,
.character-sheet,
.dm-object-sidebar,
.dm-object-list-panel,
.dm-object-detail-panel,
.dm-object-schema,
.bestiary-form,
.bestiary-card,
.rules-content {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.stage-card {
  min-height: 560px;
  padding: 22px;
}

.stage-header {
  margin-bottom: 20px;
  display: grid;
  gap: 8px;
}

.stage-header p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.builder-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(215, 168, 79, 0.42);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(215, 168, 79, 0.12);
}

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

.form-grid.three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.option-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.option-grid.compact-options {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  margin-top: 14px;
}

.option-card {
  min-height: 132px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.option-card.is-selected {
  border-color: rgba(215, 168, 79, 0.58);
  background: linear-gradient(180deg, rgba(215, 168, 79, 0.16), rgba(255, 255, 255, 0.05));
  box-shadow: inset 0 0 0 1px rgba(255, 221, 155, 0.18), 0 10px 28px rgba(0, 0, 0, 0.24);
}

.option-card input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-card:has(input:checked) {
  border-color: rgba(215, 168, 79, 0.58);
  background: rgba(215, 168, 79, 0.12);
}

.option-card h3 {
  margin-bottom: 8px;
  color: var(--text);
  font-size: 16px;
}

.option-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.compact-options .option-card {
  min-height: 104px;
  padding: 12px;
}

.compact-options .option-card h3 {
  font-size: 15px;
}

.compact-options .option-card p {
  font-size: 12px;
}

.background-spotlight {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(215, 168, 79, 0.32);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(215, 168, 79, 0.14), rgba(73, 182, 170, 0.08));
}

.background-spotlight p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.background-includes,
.background-trait {
  display: grid;
  gap: 7px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 11, 15, 0.34);
}

.background-includes span,
.background-trait span {
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
}

.background-includes strong,
.background-trait strong {
  font-size: 13px;
  line-height: 1.45;
}

.class-extra-header {
  margin: 20px 0 12px;
}

.oath-list {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
}

.class-equipment-options {
  margin-top: 14px;
}

.magic-builder-summary {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.magic-builder-summary h3 {
  margin-bottom: 8px;
  color: var(--gold);
}

.magic-builder-summary p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.builder-controls {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 14px;
  padding: 14px 18px 18px;
  flex-wrap: wrap;
}

.live-preview {
  position: sticky;
  top: 24px;
  overflow: hidden;
}

.preview-portrait {
  min-height: 250px;
  background: #111;
}

.preview-portrait img,
.preview-portrait .portrait-placeholder {
  width: 100%;
  height: 250px;
  object-fit: cover;
  object-position: top center;
}

.preview-body {
  padding: 18px;
}

.preview-body h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  text-transform: uppercase;
}

.preview-body p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.stat-mini-grid,
.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.stat-mini,
.stat-tile {
  min-height: 76px;
  display: grid;
  place-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
  text-align: center;
}

.stat-mini strong,
.stat-tile strong {
  display: block;
  color: var(--text);
  font-size: 26px;
}

.stat-mini span,
.stat-tile span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.choice-list {
  display: grid;
  gap: 10px;
}

.portrait-upload-field {
  display: grid;
  gap: 10px;
  align-content: start;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
}

.field-label {
  color: var(--muted);
}

.portrait-upload-preview {
  min-height: 168px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.22);
}

.portrait-upload-preview img,
.portrait-upload-preview .portrait-placeholder {
  width: 100%;
  height: 168px;
  object-fit: cover;
  object-position: top center;
}

.upload-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.identity-step-screen {
  display: grid;
  grid-template-columns: minmax(310px, 0.82fr) minmax(640px, 1.55fr) minmax(370px, 0.96fr);
  gap: 18px;
  min-height: 100%;
  padding: 10px 6px 0;
}

.identity-step-aside,
.identity-step-main,
.identity-step-defect {
  min-width: 0;
}

.identity-step-aside {
  display: grid;
  align-content: start;
  gap: 16px;
}

.identity-step-heading {
  display: grid;
  gap: 10px;
  padding: 14px 8px 0;
}

.identity-step-heading h3 {
  margin: 0;
  color: rgba(244, 236, 220, 0.96);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(34px, 3vw, 56px);
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.identity-step-heading p:last-child {
  margin: 0;
  max-width: 280px;
  color: rgba(226, 231, 239, 0.76);
  font-size: 14px;
  line-height: 1.72;
}

.identity-step-divider {
  width: 100%;
  max-width: 320px;
  height: 12px;
  background:
    linear-gradient(90deg, rgba(208, 164, 92, 0.4), rgba(208, 164, 92, 0.04) 82%, transparent),
    radial-gradient(circle at 50% 50%, rgba(208, 164, 92, 0.85) 0 2px, transparent 3px);
  background-repeat: no-repeat;
  background-position: center;
}

.identity-portrait-card,
.identity-field-card,
.identity-defect-card {
  position: relative;
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid rgba(214, 177, 107, 0.14);
  border-radius: 16px;
  background:
    linear-gradient(180deg, rgba(10, 15, 24, 0.96), rgba(6, 10, 16, 0.94));
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.02) inset,
    0 18px 38px rgba(0, 0, 0, 0.22);
}

.identity-portrait-frame {
  overflow: hidden;
  min-height: 350px;
  border: 1px solid rgba(214, 177, 107, 0.28);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.28);
}

.identity-portrait-frame img,
.identity-portrait-frame .portrait-placeholder {
  width: 100%;
  height: 350px;
  object-fit: cover;
  object-position: center top;
}

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

.identity-portrait-copy h4,
.identity-field-card h4,
.identity-defect-card h4 {
  margin: 0;
  color: rgba(242, 234, 214, 0.95);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.identity-portrait-copy p,
.identity-field-help,
.identity-defect-card > p,
.identity-defect-context p,
.identity-defect-panel p {
  margin: 0;
  color: rgba(221, 227, 236, 0.72);
  font-size: 13px;
  line-height: 1.7;
}

.identity-portrait-actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.identity-portrait-actions .ghost-button {
  min-height: 48px;
  padding-inline: 10px;
  font-size: 10px;
  letter-spacing: 0.12em;
}

.identity-portrait-input {
  display: none;
}

.identity-step-main {
  display: grid;
  gap: 18px;
  align-content: start;
}

.identity-top-grid,
.identity-bottom-grid {
  display: grid;
  gap: 16px;
}

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

.identity-mini-grid {
  display: grid;
  gap: 16px;
}

.identity-field-card span {
  color: rgba(214, 220, 230, 0.56);
  font-size: 0.9em;
}

.identity-field-card input,
.identity-field-card select,
.identity-field-card textarea {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(5, 10, 17, 0.82);
  color: rgba(245, 239, 228, 0.96);
  font: inherit;
  line-height: 1.45;
}

.identity-field-card input,
.identity-field-card select {
  min-height: 46px;
  padding: 12px 14px;
}

.identity-field-card textarea {
  min-height: 132px;
  padding: 14px;
  resize: vertical;
}

.identity-inline-input {
  margin-top: -2px;
}

.identity-bottom-grid {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 0.85fr);
}

.identity-story-card {
  grid-row: span 2;
}

.identity-char-count {
  justify-self: end;
  color: rgba(214, 220, 230, 0.44);
  font-size: 11px;
  letter-spacing: 0.08em;
}

.identity-step-defect {
  display: grid;
  align-content: start;
}

.identity-defect-card {
  gap: 14px;
  height: 100%;
}

.identity-defect-lead {
  color: #d9b06a;
  font-weight: 700;
}

.identity-defect-select {
  display: grid;
  gap: 8px;
}

.identity-defect-select span,
.identity-defect-context h5,
.identity-defect-panel strong {
  margin: 0;
  color: rgba(223, 185, 107, 0.96);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.identity-defect-context {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(214, 177, 107, 0.14);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.025);
}

.identity-defect-balance {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.identity-defect-panel {
  display: grid;
  gap: 8px;
  min-height: 170px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.028);
}

.identity-defect-panel.is-bad strong {
  color: #d88073;
}

.identity-defect-panel.is-good strong {
  color: #96cd81;
}

.identity-defect-random {
  justify-self: center;
  min-width: 220px;
}

@media (max-width: 1440px) {
  .identity-step-screen {
    grid-template-columns: minmax(290px, 0.8fr) minmax(0, 1.35fr);
  }

  .identity-step-defect {
    grid-column: 1 / -1;
  }
}

@media (max-width: 1040px) {
  .identity-step-screen,
  .identity-top-grid,
  .identity-bottom-grid,
  .identity-defect-balance,
  .identity-portrait-actions {
    grid-template-columns: 1fr;
  }

  .identity-story-card {
    grid-row: auto;
  }
}

.builder-modal-shell.is-identity-step {
  height: min(92dvh, 860px);
  max-height: calc(100dvh - 40px);
}

.builder-modal-shell.is-identity-step .builder-modal-stage {
  grid-template-columns: minmax(0, 1fr);
}

.builder-modal-shell.is-identity-step .builder-stage-preview {
  display: none;
}

.builder-modal-shell.is-identity-step .builder-stage-card {
  position: relative;
  padding: 0;
  overflow: hidden;
  background: #04080d;
}

.builder-modal-shell.is-identity-step .builder-modal-actions {
  padding: 12px 28px 18px;
  border-top: 0;
  background: transparent;
}

.builder-modal-shell.is-identity-step #prevStepButton,
.builder-modal-shell.is-identity-step #nextStepButton {
  position: relative;
  min-width: 178px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: var(--text);
  background: rgba(18, 23, 31, 0.74);
  box-shadow: 0 10px 34px rgba(0, 0, 0, 0.34), inset 0 0 18px rgba(255, 255, 255, 0.07);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  transition:
    transform 180ms ease,
    box-shadow 260ms ease,
    background-color 260ms ease,
    border-color 260ms ease,
    opacity 260ms ease;
}

.builder-modal-shell.is-identity-step #prevStepButton {
  padding: 0 28px 0 12px;
}

.builder-modal-shell.is-identity-step #nextStepButton {
  padding: 0 12px 0 28px;
}

.builder-modal-shell.is-identity-step #prevStepButton::before,
.builder-modal-shell.is-identity-step #nextStepButton::after {
  content: "";
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.14);
  transition: transform 180ms ease, background-color 260ms ease;
}

.builder-modal-shell.is-identity-step #prevStepButton::after,
.builder-modal-shell.is-identity-step #nextStepButton::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-top: 2px solid currentColor;
  border-right: 2px solid currentColor;
}

.builder-modal-shell.is-identity-step #prevStepButton::after {
  left: 27px;
  transform: rotate(-135deg);
}

.builder-modal-shell.is-identity-step #nextStepButton::before {
  right: 28px;
  transform: rotate(45deg);
}

.builder-modal-shell.is-identity-step #prevStepButton:hover:not(:disabled),
.builder-modal-shell.is-identity-step #nextStepButton:hover:not(:disabled) {
  transform: translateY(-2px);
  border-color: rgba(219, 179, 99, 0.42);
  box-shadow:
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 0 24px rgba(219, 179, 99, 0.1),
    inset 0 0 18px rgba(255, 255, 255, 0.1);
}

.identity-step-screen {
  isolation: isolate;
  position: relative;
  height: 100%;
  min-height: 0;
  padding: 22px 24px 18px;
  overflow: auto;
  scrollbar-color: rgba(219, 179, 99, 0.55) rgba(8, 12, 18, 0.55);
}

.identity-screen-bg,
.identity-screen-aura {
  position: absolute;
  z-index: -2;
  inset: 0;
  pointer-events: none;
}

.identity-screen-bg {
  overflow: hidden;
  background: #05090f;
}

.identity-screen-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
  filter: blur(13px) saturate(0.82) brightness(0.38);
  transform: scale(1.08);
  opacity: 0.64;
  animation: identity-backdrop-enter 900ms ease both;
}

.identity-screen-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(3, 7, 12, 0.96), rgba(5, 10, 17, 0.7) 42%, rgba(3, 7, 12, 0.94)),
    linear-gradient(180deg, rgba(4, 8, 13, 0.48), rgba(4, 8, 13, 0.92));
}

.identity-screen-aura {
  z-index: -1;
  background:
    radial-gradient(circle at 18% 28%, rgba(72, 190, 220, 0.14), transparent 24%),
    radial-gradient(circle at 76% 16%, rgba(213, 168, 82, 0.13), transparent 25%),
    radial-gradient(circle at 70% 76%, rgba(117, 91, 185, 0.1), transparent 28%);
}

.identity-step-aside,
.identity-step-main,
.identity-step-defect {
  position: relative;
  z-index: 1;
}

.identity-step-heading {
  padding-top: 4px;
}

.identity-step-heading .eyebrow {
  color: #6dd8ee;
}

.identity-step-heading h3 {
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.72), 0 0 22px rgba(85, 200, 224, 0.12);
}

.identity-step-divider {
  height: 16px;
  background:
    linear-gradient(90deg, transparent, rgba(219, 179, 99, 0.55) 14%, rgba(219, 179, 99, 0.15) 70%, transparent),
    radial-gradient(circle, #d8ad62 0 2px, transparent 3px);
  background-repeat: no-repeat;
  background-position: center;
}

.identity-portrait-card,
.identity-field-card,
.identity-defect-card {
  overflow: hidden;
  border-color: rgba(159, 194, 215, 0.15);
  background:
    linear-gradient(145deg, rgba(11, 18, 28, 0.92), rgba(6, 11, 18, 0.88));
  backdrop-filter: blur(16px);
  transition:
    transform 220ms ease,
    border-color 240ms ease,
    box-shadow 240ms ease,
    background-color 240ms ease;
}

.identity-portrait-card::before,
.identity-field-card::before,
.identity-defect-card::before {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.18), transparent);
  pointer-events: none;
}

.identity-portrait-card:hover,
.identity-field-card:focus-within,
.identity-defect-card:hover {
  transform: translateY(-2px);
  border-color: rgba(113, 206, 226, 0.28);
  box-shadow:
    0 22px 50px rgba(0, 0, 0, 0.3),
    0 0 28px rgba(69, 184, 211, 0.06);
}

.identity-portrait-card {
  border-color: rgba(219, 179, 99, 0.28);
  background:
    radial-gradient(circle at 50% 0, rgba(219, 179, 99, 0.1), transparent 34%),
    linear-gradient(145deg, rgba(11, 18, 28, 0.94), rgba(6, 11, 18, 0.9));
  animation: identity-rise 520ms 40ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.identity-portrait-frame {
  position: relative;
  min-height: 370px;
  border-color: rgba(219, 179, 99, 0.42);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.03) inset,
    0 18px 38px rgba(0, 0, 0, 0.34),
    0 0 26px rgba(219, 179, 99, 0.08);
}

.identity-portrait-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 55%, rgba(4, 8, 13, 0.62)),
    linear-gradient(90deg, rgba(75, 201, 225, 0.08), transparent 32%, transparent 68%, rgba(219, 179, 99, 0.08));
  pointer-events: none;
}

.identity-portrait-frame img,
.identity-portrait-frame .portrait-placeholder {
  height: 370px;
  transition: transform 600ms cubic-bezier(0.2, 0.78, 0.24, 1), filter 300ms ease;
}

.identity-portrait-card:hover .identity-portrait-frame img {
  transform: scale(1.025);
  filter: saturate(1.08) contrast(1.03);
}

.identity-portrait-copy h4::before {
  content: "✦";
  margin-right: 9px;
  color: #d9ad61;
}

.identity-portrait-actions .ghost-button {
  border-color: rgba(219, 179, 99, 0.2);
  background: rgba(219, 179, 99, 0.045);
}

.identity-portrait-actions .ghost-button:hover {
  border-color: rgba(219, 179, 99, 0.42);
  color: #f1d598;
  background: rgba(219, 179, 99, 0.1);
  box-shadow: 0 0 18px rgba(219, 179, 99, 0.08);
}

.identity-field-card {
  --identity-accent: 92, 207, 229;
  padding: 18px 18px 17px 58px;
  border-left-color: rgba(var(--identity-accent), 0.44);
}

.identity-field-card::after {
  content: attr(data-identity-icon);
  position: absolute;
  left: 18px;
  top: 18px;
  width: 27px;
  height: 27px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--identity-accent), 0.32);
  border-radius: 50%;
  color: rgb(var(--identity-accent));
  background: rgba(var(--identity-accent), 0.08);
  box-shadow: 0 0 18px rgba(var(--identity-accent), 0.08);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 12px;
  font-weight: 800;
}

.identity-accent-gold {
  --identity-accent: 219, 179, 99;
}

.identity-accent-blue {
  --identity-accent: 107, 157, 239;
}

.identity-accent-amber {
  --identity-accent: 226, 148, 79;
}

.identity-accent-violet {
  --identity-accent: 167, 124, 224;
}

.identity-field-card h4 {
  color: rgb(var(--identity-accent));
  text-shadow: 0 0 18px rgba(var(--identity-accent), 0.1);
}

.identity-field-card input,
.identity-field-card select,
.identity-field-card textarea {
  border-color: rgba(var(--identity-accent), 0.12);
  background:
    linear-gradient(180deg, rgba(5, 10, 17, 0.82), rgba(4, 8, 14, 0.92));
  box-shadow: inset 0 1px 12px rgba(0, 0, 0, 0.18);
  transition:
    border-color 180ms ease,
    box-shadow 220ms ease,
    background-color 180ms ease;
}

.identity-field-card input:focus,
.identity-field-card select:focus,
.identity-field-card textarea:focus {
  outline: none;
  border-color: rgba(var(--identity-accent), 0.5);
  box-shadow:
    0 0 0 3px rgba(var(--identity-accent), 0.07),
    0 0 20px rgba(var(--identity-accent), 0.07),
    inset 0 1px 12px rgba(0, 0, 0, 0.18);
}

.identity-top-grid > :nth-child(1) {
  animation: identity-rise 470ms 80ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.identity-top-grid > :nth-child(2) {
  animation: identity-rise 470ms 130ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.identity-top-grid > :nth-child(3) {
  animation: identity-rise 470ms 180ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.identity-top-grid > :nth-child(4) {
  animation: identity-rise 470ms 230ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.identity-top-grid > :nth-child(5) {
  animation: identity-rise 470ms 280ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.identity-bottom-grid {
  animation: identity-rise 520ms 270ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.identity-defect-card {
  border-color: rgba(219, 179, 99, 0.3);
  background:
    radial-gradient(circle at 80% 0, rgba(210, 74, 68, 0.09), transparent 30%),
    radial-gradient(circle at 20% 100%, rgba(95, 177, 110, 0.08), transparent 32%),
    linear-gradient(145deg, rgba(12, 18, 27, 0.96), rgba(6, 11, 18, 0.92));
  animation: identity-rise 520ms 170ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.identity-defect-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.identity-defect-title > span {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(219, 179, 99, 0.38);
  border-radius: 50%;
  color: #e3b861;
  background: rgba(219, 179, 99, 0.08);
  box-shadow: 0 0 22px rgba(219, 179, 99, 0.1);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
}

.identity-defect-title .eyebrow {
  margin-bottom: 3px;
  font-size: 9px;
}

.identity-defect-select select {
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid rgba(219, 179, 99, 0.24);
  border-radius: 10px;
  color: #f0e5cd;
  background: rgba(5, 10, 17, 0.86);
}

.identity-defect-context {
  border-color: rgba(219, 179, 99, 0.18);
  background:
    linear-gradient(135deg, rgba(219, 179, 99, 0.07), rgba(255, 255, 255, 0.018));
}

.identity-defect-panel {
  position: relative;
  overflow: hidden;
}

.identity-defect-panel::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: currentColor;
  opacity: 0.58;
}

.identity-defect-panel.is-bad {
  border-color: rgba(216, 101, 88, 0.2);
  background: linear-gradient(145deg, rgba(112, 35, 31, 0.12), rgba(255, 255, 255, 0.02));
}

.identity-defect-panel.is-good {
  border-color: rgba(116, 194, 104, 0.2);
  background: linear-gradient(145deg, rgba(45, 102, 47, 0.12), rgba(255, 255, 255, 0.02));
}

.identity-defect-random {
  border-color: rgba(219, 179, 99, 0.28);
  color: #e8c77f;
  background: rgba(219, 179, 99, 0.06);
}

.identity-defect-random:hover {
  transform: translateY(-1px);
  border-color: rgba(219, 179, 99, 0.48);
  background: rgba(219, 179, 99, 0.12);
  box-shadow: 0 0 22px rgba(219, 179, 99, 0.09);
}

@keyframes identity-backdrop-enter {
  from {
    opacity: 0;
    transform: scale(1.14);
  }
  to {
    opacity: 0.64;
    transform: scale(1.08);
  }
}

@keyframes identity-rise {
  from {
    opacity: 0;
    transform: translateY(14px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .identity-screen-bg img,
  .identity-portrait-card,
  .identity-top-grid > *,
  .identity-bottom-grid,
  .identity-defect-card {
    animation: none;
  }

  .identity-portrait-frame img,
  .identity-field-card,
  .identity-defect-card {
    transition: none;
  }
}

@media (max-width: 1440px) {
  .identity-step-screen {
    grid-template-columns: minmax(280px, 0.72fr) minmax(0, 1.28fr);
  }

  .identity-step-defect {
    grid-column: 1 / -1;
  }

  .identity-defect-card {
    height: auto;
  }
}

.identity-step-screen {
  grid-template-columns: 250px minmax(0, 1fr) 320px;
  gap: 14px;
  align-items: start;
  padding: 12px 14px 4px;
}

.identity-step-aside {
  gap: 10px;
}

.identity-step-heading {
  gap: 6px;
  padding: 2px 4px 0;
}

.identity-step-heading h3 {
  font-size: clamp(30px, 2.25vw, 40px);
  line-height: 0.96;
}

.identity-step-heading p:last-child {
  max-width: 245px;
  font-size: 12px;
  line-height: 1.48;
}

.identity-step-divider {
  height: 9px;
}

.identity-portrait-card {
  gap: 8px;
  padding: 10px;
  border-radius: 14px;
}

.identity-portrait-frame {
  min-height: 275px;
  border-radius: 11px;
}

.identity-portrait-frame img,
.identity-portrait-frame .portrait-placeholder {
  height: 275px;
}

.identity-portrait-copy {
  gap: 2px;
  padding-inline: 2px;
}

.identity-portrait-copy h4 {
  font-size: 13px;
}

.identity-portrait-copy p {
  font-size: 11px;
  line-height: 1.4;
}

.identity-portrait-actions {
  gap: 6px;
}

.identity-portrait-actions .ghost-button {
  min-height: 36px;
  padding: 7px 5px;
  font-size: 8px;
  letter-spacing: 0.08em;
}

.identity-step-main {
  gap: 12px;
}

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

.identity-span-6 {
  grid-column: span 6;
}

.identity-span-5 {
  grid-column: span 5;
}

.identity-span-2 {
  grid-column: span 2;
}

.identity-field-card {
  gap: 7px;
  min-height: 0;
  padding: 12px 12px 11px 44px;
  border-radius: 13px;
}

.identity-field-card::after {
  left: 12px;
  top: 12px;
  width: 22px;
  height: 22px;
  font-size: 10px;
}

.identity-field-card h4 {
  font-size: 12px;
  letter-spacing: 0.1em;
}

.identity-field-help {
  min-height: 0;
  font-size: 11px;
  line-height: 1.42;
}

.identity-field-card input,
.identity-field-card select {
  min-height: 38px;
  padding: 8px 11px;
  font-size: 12px;
}

.identity-field-card textarea {
  min-height: 92px;
  padding: 10px 11px;
  font-size: 12px;
  line-height: 1.45;
}

.identity-bottom-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.identity-story-card {
  grid-row: auto;
}

.identity-char-count {
  font-size: 9px;
}

.identity-step-defect {
  align-content: start;
}

.identity-defect-card {
  gap: 10px;
  height: auto;
  padding: 14px;
  border-radius: 14px;
}

.identity-defect-title {
  gap: 9px;
}

.identity-defect-title > span {
  width: 34px;
  height: 34px;
  flex-basis: 34px;
  font-size: 14px;
}

.identity-defect-title h4 {
  font-size: 14px;
}

.identity-defect-title h4 span {
  color: rgba(226, 231, 239, 0.5);
  font-size: 9px;
}

.identity-defect-card > p,
.identity-defect-context p,
.identity-defect-panel p {
  font-size: 11px;
  line-height: 1.48;
}

.identity-defect-select {
  gap: 6px;
}

.identity-defect-select select {
  min-height: 40px;
  padding: 8px 11px;
  font-size: 12px;
}

.identity-defect-details {
  display: grid;
  gap: 8px;
  animation: identity-detail-reveal 260ms cubic-bezier(0.2, 0.78, 0.24, 1) both;
}

.identity-defect-context {
  gap: 5px;
  padding: 11px;
}

.identity-defect-balance {
  grid-template-columns: 1fr;
  gap: 8px;
}

.identity-defect-panel {
  gap: 5px;
  min-height: 0;
  padding: 10px 11px;
}

.identity-defect-random {
  justify-self: stretch;
  min-width: 0;
  min-height: 38px;
}

@keyframes identity-detail-reveal {
  from {
    opacity: 0;
    transform: translateY(7px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1380px) {
  .identity-step-screen {
    grid-template-columns: 235px minmax(0, 1fr);
  }

  .identity-step-defect {
    grid-column: 1 / -1;
  }

  .identity-defect-balance {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1040px) {
  .identity-step-screen,
  .identity-bottom-grid,
  .identity-defect-balance {
    grid-template-columns: 1fr;
  }

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

  .identity-top-grid > * {
    grid-column: auto;
  }
}

.portrait-upload-field input[type="file"] {
  min-height: 42px;
  padding: 9px;
}

.portrait-upload-field small {
  color: var(--dim);
  line-height: 1.45;
  text-transform: none;
}

.portrait-placeholder {
  display: grid;
  place-items: center;
  color: rgba(244, 239, 228, 0.72);
  background:
    linear-gradient(145deg, rgba(215, 168, 79, 0.18), rgba(73, 182, 170, 0.09)),
    radial-gradient(circle at 50% 18%, rgba(255, 255, 255, 0.13), transparent 32%),
    #111820;
}

.portrait-placeholder span {
  width: 78px;
  height: 78px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 168, 79, 0.42);
  border-radius: 50%;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.24);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
}

.choice-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.ability-table {
  display: grid;
  gap: 10px;
}

.ability-row {
  display: grid;
  grid-template-columns: 1fr 92px 92px 92px;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.ability-row strong {
  font-size: 16px;
}

.ability-row small {
  display: block;
  color: var(--dim);
  font-size: 12px;
}

.roll-panel {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.sheet-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  padding: 14px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.sheet-toolbar label {
  min-width: 260px;
}

.character-sheet {
  overflow: hidden;
}

.sheet-hero {
  position: relative;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 24px;
  padding: 28px;
  background:
    linear-gradient(90deg, rgba(12, 16, 21, 0.72), rgba(12, 16, 21, 0.96)),
    url("./assets/worlds/vandrya-realms-sheet-v2.jpg") center / cover;
}

.sheet-portrait {
  overflow: hidden;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: #111;
}

.sheet-portrait img,
.sheet-portrait .portrait-placeholder {
  width: 100%;
  height: 440px;
  object-fit: cover;
  object-position: top center;
}

.sheet-identity {
  display: grid;
  align-content: start;
  gap: 18px;
}

.sheet-name-row {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
}

.sheet-identity h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(36px, 6vw, 84px);
  text-transform: uppercase;
}

.sheet-identity p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.sheet-access-notice,
.sheet-access-inline {
  display: grid;
  gap: 4px;
  padding: 12px 14px;
  border: 1px solid rgba(215, 168, 79, 0.25);
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(215, 168, 79, 0.14), transparent 42%),
    rgba(4, 8, 13, 0.62);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sheet-access-notice strong {
  color: #ffe7b0;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sheet-access-notice.is-readonly {
  border-color: rgba(91, 164, 255, 0.28);
  background:
    radial-gradient(circle at 0% 0%, rgba(91, 164, 255, 0.13), transparent 42%),
    rgba(4, 8, 13, 0.62);
}

.sheet-access-notice.is-master {
  border-color: rgba(119, 232, 185, 0.26);
  background:
    radial-gradient(circle at 0% 0%, rgba(119, 232, 185, 0.12), transparent 42%),
    rgba(4, 8, 13, 0.62);
}

.sheet-access-inline {
  margin: 0;
  color: rgba(226, 235, 245, 0.72);
}

.vital-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.vital-card {
  min-height: 104px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.28);
}

.vital-card span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.vital-card strong {
  display: block;
  margin-top: 10px;
  font-size: 36px;
}

.vital-card.is-hp {
  border-color: rgba(94, 208, 132, 0.38);
  background: linear-gradient(145deg, rgba(94, 208, 132, 0.14), rgba(0, 0, 0, 0.28));
}

.vital-card small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
}

.sheet-body {
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: 0;
  border-top: 1px solid var(--line);
}

.sheet-tabs {
  display: grid;
  align-content: start;
  background: rgba(0, 0, 0, 0.18);
}

.sheet-tab {
  min-height: 64px;
  padding: 0 18px;
  color: var(--muted);
  background: transparent;
  border-bottom: 1px solid var(--line);
  text-align: left;
  text-transform: uppercase;
}

.sheet-tab.is-active {
  color: var(--ink);
  background: var(--paper-2);
}

.sheet-panel {
  min-height: 420px;
  padding: 24px;
}

.sheet-section-head {
  display: grid;
  gap: 12px;
  margin-bottom: 16px;
}

.sheet-section-head h2,
.journal-head h2 {
  font-family: Georgia, "Times New Roman", serif;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.sheet-rules-card {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.sheet-rules-card h3 {
  margin: 0 0 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sheet-rules-card p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.sheet-score-grid {
  margin-top: 16px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 12px;
}

.detail-item {
  min-height: 78px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.detail-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.detail-item strong {
  display: block;
  margin-top: 8px;
  font-size: 19px;
}

.attribute-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 12px;
}

.attribute-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.attribute-item header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.attribute-item p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.sheet-skill-list {
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
}

.sheet-skill-card {
  --skill-tone: 142, 154, 169;
  position: relative;
  display: grid;
  gap: 10px;
  min-height: 145px;
  overflow: hidden;
  padding: 14px 15px 13px;
  border-color: rgba(var(--skill-tone), 0.28);
  background:
    linear-gradient(145deg, rgba(var(--skill-tone), 0.105), transparent 58%),
    rgba(7, 11, 17, 0.78);
  box-shadow: inset 3px 0 0 rgba(var(--skill-tone), 0.48);
}

.sheet-skill-card::after {
  content: "";
  position: absolute;
  top: -34px;
  right: -34px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: rgba(var(--skill-tone), 0.08);
  filter: blur(18px);
  pointer-events: none;
}

.sheet-skill-card.is-str { --skill-tone: 218, 92, 72; }
.sheet-skill-card.is-dex { --skill-tone: 76, 184, 140; }
.sheet-skill-card.is-con { --skill-tone: 202, 145, 62; }
.sheet-skill-card.is-int { --skill-tone: 91, 151, 235; }
.sheet-skill-card.is-wis { --skill-tone: 126, 111, 214; }
.sheet-skill-card.is-cha { --skill-tone: 211, 104, 167; }

.sheet-skill-card > header {
  position: relative;
  z-index: 1;
  align-items: center;
}

.sheet-skill-title {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.sheet-skill-title > strong {
  color: #f0f3f7;
  font-size: 15px;
  letter-spacing: 0.025em;
}

.sheet-skill-competence-mark {
  position: relative;
  width: 13px;
  height: 13px;
  flex: 0 0 13px;
  border: 1px solid rgba(var(--skill-tone), 0.9);
  border-radius: 50%;
  background: rgba(var(--skill-tone), 0.85);
  box-shadow:
    0 0 0 4px rgba(var(--skill-tone), 0.12),
    0 0 14px rgba(var(--skill-tone), 0.72);
}

.sheet-skill-competence-mark::after {
  content: "";
  position: absolute;
  inset: 3px;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.9);
}

.sheet-skill-total {
  position: relative;
  z-index: 1;
  display: grid;
  justify-items: end;
  color: rgb(var(--skill-tone));
  font-size: 21px;
  font-weight: 900;
  line-height: 1;
}

.sheet-skill-total small {
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 7px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.attribute-item .sheet-skill-description {
  position: relative;
  z-index: 1;
  margin: 0;
  color: #b8c0cb;
  font-size: 11px;
  line-height: 1.45;
}

.sheet-skill-formula {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  align-self: end;
  gap: 8px;
  padding-top: 9px;
  border-top: 1px solid rgba(var(--skill-tone), 0.18);
  color: #aab3bf;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.sheet-skill-formula strong {
  color: rgb(var(--skill-tone));
  font-size: 12px;
}

.sheet-skill-formula b {
  color: rgba(var(--skill-tone), 0.7);
}

.sheet-fixed-bar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(220px, 1.2fr) minmax(360px, 2fr) auto auto;
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid rgba(215, 168, 79, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(180deg, rgba(18, 24, 31, 0.96), rgba(11, 15, 20, 0.96)),
    rgba(12, 16, 21, 0.96);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(14px);
}

.sheet-quick-identity {
  display: grid;
  grid-template-columns: 54px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.sheet-quick-portrait {
  width: 54px;
  height: 54px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
}

.sheet-quick-portrait img,
.sheet-quick-portrait .portrait-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

.sheet-quick-identity span,
.sheet-quick-identity small,
.sheet-quick-stats span,
.sheet-quick-details small,
.sheet-fact span {
  display: block;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-quick-identity strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-quick-stats {
  display: grid;
  grid-template-columns: repeat(6, minmax(56px, 1fr));
  gap: 8px;
}

.sheet-quick-stats div,
.sheet-quick-details span,
.sheet-fact {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.sheet-quick-stats strong,
.sheet-quick-details strong,
.sheet-fact strong {
  display: block;
  overflow-wrap: anywhere;
  color: var(--text);
  font-size: 16px;
  line-height: 1.25;
}

.sheet-quick-details {
  position: relative;
}

.sheet-quick-details summary,
.sheet-mobile-more summary {
  cursor: pointer;
  list-style: none;
}

.sheet-quick-details summary::-webkit-details-marker,
.sheet-mobile-more summary::-webkit-details-marker {
  display: none;
}

.sheet-quick-details summary {
  min-height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  display: grid;
  place-items: center;
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.sheet-quick-details > div {
  position: absolute;
  right: 0;
  top: calc(100% + 8px);
  width: min(520px, 86vw);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(14, 19, 25, 0.98);
  box-shadow: 0 22px 48px rgba(0, 0, 0, 0.35);
}

.sheet-vtt-body {
  margin-top: 14px;
  grid-template-columns: 230px minmax(0, 1fr);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.025);
}

.sheet-vtt-body .sheet-tabs {
  position: sticky;
  top: 92px;
  z-index: 10;
  align-self: start;
  border-right: 1px solid var(--line);
  background: rgba(6, 10, 15, 0.72);
}

.sheet-vtt-body .sheet-tab {
  display: grid;
  gap: 3px;
  min-height: 58px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  text-transform: none;
}

.sheet-vtt-body .sheet-tab span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sheet-vtt-body .sheet-tab strong {
  color: inherit;
  font-size: 13px;
}

.sheet-vtt-body .sheet-tab.is-active {
  color: #ffe8b7;
  background: rgba(215, 168, 79, 0.11);
  box-shadow: inset 3px 0 0 rgba(215, 168, 79, 0.7);
}

.sheet-vtt-section-head {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
}

.sheet-vtt-section-head p:last-child {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.55;
}

.sheet-cover-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.78fr) minmax(0, 1.22fr);
  gap: 16px;
  align-items: start;
}

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

.sheet-cover-media-column,
.sheet-cover-main-column {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.sheet-cover-portrait {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #111;
}

.sheet-cover-portrait img,
.sheet-cover-portrait .portrait-placeholder {
  width: 100%;
  height: 100%;
  min-height: 440px;
  object-fit: cover;
  object-position: top center;
}

.sheet-cover-portrait-empty-action {
  position: absolute;
  inset: auto 18px 18px;
  display: grid;
  gap: 6px;
  padding: 14px;
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: 12px;
  background: rgba(5, 9, 14, 0.86);
  backdrop-filter: blur(10px);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
}

.sheet-cover-portrait-empty-action strong {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-cover-portrait-empty-action span {
  color: var(--muted);
  font-size: 11px;
}

.sheet-cover-portrait-empty-action .ghost-button {
  justify-self: start;
  margin-top: 4px;
}

.sheet-cover-portrait-edit {
  position: absolute;
  right: 12px;
  bottom: 12px;
  min-height: 32px;
  padding: 7px 10px;
  border: 1px solid rgba(215, 168, 79, 0.3);
  border-radius: 9px;
  color: var(--gold);
  background: rgba(5, 9, 14, 0.82);
  backdrop-filter: blur(8px);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.sheet-portrait-input {
  display: none;
}

.sheet-card,
.sheet-attack-card,
.sheet-ability-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.sheet-cover-identity {
  display: grid;
  align-content: start;
  gap: 14px;
}

.sheet-cover-identity h2 {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 42px;
  line-height: 0.95;
  text-transform: uppercase;
}

.sheet-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
  margin-bottom: 12px;
}

.sheet-card-head h3 {
  margin: 0;
  color: var(--gold);
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-card p,
.sheet-attack-card p,
.sheet-ability-card p,
.sheet-level-timeline p {
  color: var(--muted);
  line-height: 1.55;
}

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

.sheet-fact-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.sheet-fact.is-hp {
  border-color: rgba(94, 208, 132, 0.36);
  background: rgba(94, 208, 132, 0.08);
}

.sheet-checkline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-checkline input {
  width: 20px;
  height: 20px;
  accent-color: #d7a84f;
}

.sheet-narrative-card {
  grid-column: auto;
}

.sheet-story-points {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.sheet-story-points span {
  display: grid;
  gap: 4px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
}

.sheet-story-points strong {
  color: var(--text);
}

.sheet-ability-grid,
.sheet-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 12px;
}

.sheet-attack-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.sheet-characteristics-overview {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.sheet-characteristics-summary {
  display: grid;
  gap: 13px;
  padding: 14px 15px;
  border: 1px solid rgba(215, 168, 79, 0.2);
  border-radius: 10px;
  background:
    linear-gradient(135deg, rgba(215, 168, 79, 0.065), transparent 55%),
    rgba(7, 11, 17, 0.7);
}

.sheet-characteristics-summary > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.sheet-characteristics-summary h3 {
  margin: 1px 0 0;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-save-summary,
.sheet-competency-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.sheet-save-summary > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-width: 118px;
  gap: 12px;
  padding: 8px 10px;
  border: 1px solid rgba(215, 168, 79, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.sheet-save-summary small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sheet-save-summary strong {
  color: var(--gold);
  font-size: 17px;
}

.sheet-competency-summary > span {
  padding: 7px 9px;
  border: 1px solid rgba(91, 164, 255, 0.2);
  border-radius: 999px;
  color: #c6ddfb;
  background: rgba(91, 164, 255, 0.075);
  font-size: 10px;
  font-weight: 750;
}

.sheet-competency-summary > span.is-more {
  color: var(--gold);
  border-color: rgba(215, 168, 79, 0.24);
  background: rgba(215, 168, 79, 0.08);
}

.sheet-characteristics-section {
  display: grid;
  gap: 11px;
}

.sheet-characteristics-section-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.sheet-characteristics-section-title span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sheet-characteristics-section-title h2 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-ability-card header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.sheet-ability-card {
  --ability-tone: 142, 154, 169;
  position: relative;
  overflow: hidden;
  border-color: rgba(var(--ability-tone), 0.26);
  background:
    linear-gradient(145deg, rgba(var(--ability-tone), 0.095), transparent 62%),
    rgba(7, 11, 17, 0.74);
  box-shadow: inset 3px 0 0 rgba(var(--ability-tone), 0.44);
}

.sheet-ability-card.is-str { --ability-tone: 218, 92, 72; }
.sheet-ability-card.is-dex { --ability-tone: 76, 184, 140; }
.sheet-ability-card.is-con { --ability-tone: 202, 145, 62; }
.sheet-ability-card.is-int { --ability-tone: 91, 151, 235; }
.sheet-ability-card.is-wis { --ability-tone: 126, 111, 214; }
.sheet-ability-card.is-cha { --ability-tone: 211, 104, 167; }

.sheet-ability-card header h3 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-ability-card header strong {
  color: rgb(var(--ability-tone));
  font-size: 34px;
}

.sheet-ability-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
  line-height: 1.45;
}

.sheet-skill-divider {
  display: grid;
  grid-template-columns: minmax(30px, 1fr) auto minmax(30px, 1fr);
  gap: 14px;
  align-items: center;
  margin: 22px 0 13px;
}

.sheet-skill-divider span {
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(215, 168, 79, 0.38));
}

.sheet-skill-divider span:last-child {
  background: linear-gradient(90deg, rgba(215, 168, 79, 0.38), transparent);
}

.sheet-skill-divider strong {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.mobile-characteristics-panel {
  display: grid;
  gap: 14px;
}

.mobile-saves-block,
.mobile-competencies-block,
.mobile-ability-skill-row {
  border: 1px solid rgba(215, 168, 79, 0.16);
  border-radius: 8px;
  background: rgba(7, 11, 17, 0.74);
}

.mobile-saves-block {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.mobile-saves-block h3,
.mobile-competencies-block h3 {
  margin: 0;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.mobile-save-cell {
  min-height: 62px;
  display: grid;
  place-items: center;
  gap: 4px;
  padding: 8px 4px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
  text-align: center;
}

.mobile-save-cell span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.07em;
  line-height: 1.1;
  text-transform: uppercase;
}

.mobile-save-cell strong {
  color: #ffe0a0;
  font-size: 22px;
  line-height: 1;
}

.mobile-characteristics-title {
  margin: 2px 0 -2px;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 19px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mobile-ability-skill-grid {
  display: grid;
  gap: 9px;
}

.mobile-ability-skill-row {
  --mobile-ability-tone: 142, 154, 169;
  display: grid;
  grid-template-columns: minmax(92px, 0.85fr) minmax(0, 1.35fr);
  gap: 0;
  overflow: hidden;
  border-color: rgba(var(--mobile-ability-tone), 0.24);
}

.mobile-ability-skill-row.is-str { --mobile-ability-tone: 218, 92, 72; }
.mobile-ability-skill-row.is-dex { --mobile-ability-tone: 76, 184, 140; }
.mobile-ability-skill-row.is-con { --mobile-ability-tone: 202, 145, 62; }
.mobile-ability-skill-row.is-int { --mobile-ability-tone: 91, 151, 235; }
.mobile-ability-skill-row.is-wis { --mobile-ability-tone: 126, 111, 214; }
.mobile-ability-skill-row.is-cha { --mobile-ability-tone: 211, 104, 167; }

.mobile-ability-column {
  min-width: 0;
  display: grid;
  align-content: center;
  justify-items: start;
  gap: 2px;
  padding: 10px 11px;
  border-right: 1px solid rgba(var(--mobile-ability-tone), 0.18);
  background: linear-gradient(145deg, rgba(var(--mobile-ability-tone), 0.13), rgba(255, 255, 255, 0.02));
}

.mobile-ability-column span {
  color: rgba(var(--mobile-ability-tone), 0.92);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mobile-ability-column strong {
  max-width: 100%;
  color: #f4f7fb;
  font-size: 13px;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.mobile-ability-column b {
  color: rgb(var(--mobile-ability-tone));
  font-size: 29px;
  line-height: 1;
}

.mobile-ability-column small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
}

.mobile-skill-column {
  min-width: 0;
  display: grid;
  align-content: center;
}

.mobile-skill-column article {
  min-height: 42px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 10px;
}

.mobile-skill-column article + article {
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.mobile-skill-column span {
  min-width: 0;
  display: grid;
  gap: 2px;
}

.mobile-skill-column strong {
  color: #eef3fb;
  font-size: 12px;
  line-height: 1.15;
}

.mobile-skill-column small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.mobile-skill-description {
  display: block;
  color: rgba(226, 235, 245, 0.64);
  font-size: 10px;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
  line-height: 1.25;
  text-transform: none;
}

.mobile-skill-column b {
  color: rgb(var(--mobile-ability-tone));
  font-size: 17px;
}

.mobile-skill-column article.is-competent small::after {
  content: " *";
  color: rgb(var(--mobile-ability-tone));
}

.mobile-competencies-block {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.mobile-competencies-block header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-combat-panel {
  display: grid;
  gap: 12px;
}

.mobile-combat-vitals {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mobile-combat-vital {
  min-width: 0;
  min-height: 72px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 9px 6px;
  border: 1px solid rgba(215, 168, 79, 0.2);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 0%, rgba(215, 168, 79, 0.14), transparent 46%),
    rgba(7, 11, 17, 0.76);
  text-align: center;
}

.mobile-combat-vital span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-combat-vital strong {
  overflow-wrap: anywhere;
  color: #ffe0a0;
  font-size: 19px;
  line-height: 1;
}

.mobile-combat-vital small {
  color: rgba(226, 235, 245, 0.62);
  font-size: 9px;
  font-weight: 800;
}

.mobile-combat-weapons,
.mobile-combat-reference {
  display: grid;
  gap: 10px;
}

.mobile-combat-weapon-card,
.mobile-combat-reference-card,
.mobile-combat-empty {
  border: 1px solid rgba(215, 168, 79, 0.16);
  border-radius: 8px;
  background: rgba(7, 11, 17, 0.76);
}

.mobile-combat-weapon-card {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.mobile-combat-weapon-card.is-equipped {
  border-color: rgba(91, 164, 255, 0.28);
  background:
    radial-gradient(circle at 12% 0%, rgba(91, 164, 255, 0.16), transparent 34%),
    rgba(7, 11, 17, 0.8);
}

.mobile-combat-weapon-card.is-unarmed {
  border-color: rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.035);
}

.mobile-combat-weapon-card > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.mobile-combat-weapon-card > header span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mobile-combat-weapon-card > header strong {
  min-width: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 16px;
  line-height: 1.15;
  text-align: right;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mobile-combat-roll-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 8px;
}

.mobile-combat-roll {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(91, 164, 255, 0.18);
  border-radius: 8px;
  background: rgba(91, 164, 255, 0.055);
}

.mobile-combat-roll span,
.mobile-combat-weapon-meta small,
.mobile-combat-reference-card small {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mobile-combat-roll strong {
  overflow-wrap: anywhere;
  color: #9fc8ff;
  font-size: 14px;
  line-height: 1.2;
}

.mobile-combat-roll:first-child strong {
  font-size: 18px;
}

.mobile-combat-roll small {
  color: rgba(226, 235, 245, 0.68);
  font-size: 10px;
  font-weight: 700;
  line-height: 1.3;
}

.mobile-combat-weapon-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
}

.mobile-combat-weapon-meta span {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 7px;
  color: rgba(238, 243, 251, 0.86);
  font-size: 11px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.mobile-combat-weapon-card footer {
  display: flex;
  justify-content: flex-end;
}

.mobile-combat-reference-card {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.mobile-combat-reference-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-combat-reference-card h3 {
  margin: 0;
  color: var(--gold);
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.mobile-combat-reference-card header span {
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  text-transform: uppercase;
}

.mobile-combat-reference-card > div {
  display: grid;
  gap: 6px;
}

.mobile-combat-reference-card p {
  margin: 0;
  display: grid;
  grid-template-columns: minmax(82px, 0.4fr) minmax(0, 1fr);
  gap: 8px;
  align-items: baseline;
  color: rgba(238, 243, 251, 0.86);
}

.mobile-combat-reference-card strong {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: 12px;
}

.mobile-combat-empty {
  display: grid;
  gap: 4px;
  padding: 12px;
  color: var(--muted);
}

.sheet-characteristics-detail-layer {
  position: fixed;
  inset: 0;
  z-index: 270;
  display: grid;
  place-items: center;
  padding: 20px;
}

.sheet-characteristics-detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(1, 4, 8, 0.78);
  backdrop-filter: blur(10px);
}

.sheet-characteristics-detail-dialog {
  position: relative;
  width: min(720px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(215, 168, 79, 0.32);
  border-radius: 16px;
  background:
    radial-gradient(circle at 12% 0%, rgba(215, 168, 79, 0.11), transparent 34%),
    linear-gradient(180deg, rgba(11, 16, 24, 0.99), rgba(4, 8, 13, 0.99));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.68);
  animation: identityPromptIn 180ms ease-out;
}

.sheet-characteristics-detail-dialog > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(215, 168, 79, 0.17);
}

.sheet-characteristics-detail-dialog h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-save-detail-list,
.sheet-competency-detail-list {
  display: grid;
  gap: 9px;
  margin-top: 15px;
}

.sheet-save-detail-list article,
.sheet-competency-detail-list article {
  padding: 12px 13px;
  border: 1px solid rgba(91, 164, 255, 0.15);
  border-radius: 10px;
  background: rgba(91, 164, 255, 0.045);
}

.sheet-save-detail-list article > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.sheet-save-detail-list article > div > span {
  color: var(--gold);
  font-size: 20px;
  font-weight: 900;
}

.sheet-save-detail-list p,
.sheet-competency-detail-list p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

.sheet-save-detail-list p b {
  color: #dcecff;
}

.sheet-competency-detail-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
}

.sheet-competency-detail-list article > span {
  display: flex;
  align-content: start;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 280px;
}

.sheet-competency-detail-list small {
  padding: 5px 7px;
  border: 1px solid rgba(215, 168, 79, 0.18);
  border-radius: 999px;
  color: #e4c986;
  background: rgba(215, 168, 79, 0.065);
  font-size: 8px;
  font-weight: 750;
}

@media (max-width: 760px) {
  .sheet-characteristics-overview {
    grid-template-columns: 1fr;
  }

  .sheet-competency-detail-list article {
    grid-template-columns: 1fr;
  }

  .sheet-competency-detail-list article > span {
    justify-content: flex-start;
    max-width: none;
  }
}

.sheet-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 14px;
}

.sheet-list {
  display: grid;
  gap: 8px;
}

.sheet-list-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}

.sheet-list-row span {
  color: var(--muted);
  text-align: right;
}

.sheet-pill-list,
.sheet-filter-strip {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sheet-pill-list span,
.sheet-filter-strip span,
.condition-grid > span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.04);
  font-size: 12px;
}

.sheet-filter-strip {
  margin-bottom: 14px;
  overflow-x: auto;
  flex-wrap: nowrap;
  padding-bottom: 4px;
}

.sheet-magic-subtabs {
  display: inline-flex;
  gap: 6px;
  padding: 5px;
  margin: 0 0 14px;
  border: 1px solid rgba(215, 168, 79, 0.2);
  border-radius: 8px;
  background: rgba(5, 9, 14, 0.54);
}

.sheet-magic-subtabs button {
  min-width: 118px;
  min-height: 36px;
  padding: 8px 14px;
  border: 1px solid transparent;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.sheet-magic-subtabs button.is-active {
  color: #ffe8b7;
  border-color: rgba(215, 168, 79, 0.36);
  background: rgba(215, 168, 79, 0.12);
}

.tamer-pet-panel {
  display: grid;
  gap: 14px;
}

.tamer-pet-impulse-card {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border: 1px solid rgba(215, 168, 79, 0.24);
  border-radius: 8px;
  background: rgba(215, 168, 79, 0.075);
}

.tamer-pet-impulse-card div:first-child {
  display: grid;
  gap: 2px;
}

.tamer-pet-impulse-card span,
.tamer-pet-impulse-card small,
.tamer-pet-form-grid span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.tamer-pet-impulse-card strong {
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1;
}

.tamer-pet-impulse-actions {
  display: flex;
  gap: 8px;
}

.tamer-pet-impulse-actions button {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(215, 168, 79, 0.32);
  border-radius: 6px;
  color: var(--gold);
  background: rgba(0, 0, 0, 0.2);
  font-size: 18px;
  font-weight: 900;
  cursor: pointer;
}

.tamer-pet-impulse-actions button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.tamer-pet-layout {
  display: grid;
  grid-template-columns: minmax(260px, 0.85fr) minmax(0, 1.6fr);
  gap: 14px;
  align-items: start;
}

.tamer-pet-main {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.tamer-pet-photo-card {
  display: grid;
  gap: 12px;
}

.tamer-pet-photo-frame {
  overflow: hidden;
  min-height: 360px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: #0c1118;
}

.tamer-pet-photo-frame img,
.tamer-pet-photo-empty {
  width: 100%;
  height: 100%;
  min-height: 360px;
}

.tamer-pet-photo-frame img {
  display: block;
  object-fit: cover;
  object-position: center;
}

.tamer-pet-photo-empty {
  display: grid;
  place-items: center;
  align-content: center;
  gap: 6px;
  color: var(--muted);
  text-align: center;
}

.tamer-pet-photo-empty strong {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 38px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.tamer-pet-upload {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 38px;
  padding: 9px 12px;
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: 7px;
  color: var(--gold);
  background: rgba(215, 168, 79, 0.08);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  cursor: pointer;
}

.tamer-pet-upload input {
  display: none;
}

.tamer-pet-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.tamer-pet-form-grid label {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.tamer-pet-form-grid select {
  width: 100%;
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 7px;
  color: var(--text);
  background: rgba(5, 9, 14, 0.82);
}

.tamer-pet-stat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.tamer-pet-stat-grid .sheet-fact {
  min-height: 74px;
}

.tamer-pet-ability-line {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.sheet-level-timeline {
  display: grid;
  gap: 8px;
}

.sheet-level-timeline details {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.14);
}

.sheet-level-timeline summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 12px;
  cursor: pointer;
  color: var(--text);
  font-weight: 800;
}

.sheet-level-timeline details p {
  margin: 0;
  padding: 0 12px 12px;
}

.sheet-attack-card {
  --attack-tone: 91, 164, 255;
  position: relative;
  display: grid;
  gap: 12px;
  overflow: hidden;
  border-color: rgba(var(--attack-tone), 0.26);
  background:
    radial-gradient(circle at 18% 0%, rgba(var(--attack-tone), 0.18), transparent 34%),
    linear-gradient(145deg, rgba(var(--attack-tone), 0.09), transparent 62%),
    rgba(7, 11, 17, 0.78);
  box-shadow:
    inset 3px 0 0 rgba(var(--attack-tone), 0.44),
    0 14px 32px rgba(0, 0, 0, 0.18);
}

.sheet-attack-card.is-empty {
  --attack-tone: 142, 154, 169;
  opacity: 0.92;
}

.sheet-attack-card header {
  display: grid;
  gap: 5px;
}

.sheet-attack-card header span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sheet-attack-card header strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.05;
}

.sheet-attack-formulas {
  display: grid;
  gap: 8px;
}

.sheet-attack-formulas > div {
  padding: 10px;
  border: 1px solid rgba(var(--attack-tone), 0.16);
  border-radius: 10px;
  background: rgba(var(--attack-tone), 0.055);
}

.sheet-attack-formulas small,
.sheet-attack-meta small {
  display: block;
  color: rgba(226, 235, 245, 0.58);
  font-size: 8px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sheet-attack-formulas p {
  margin: 4px 0 0;
  color: #d8e3ee;
  font-size: 12px;
  line-height: 1.45;
}

.sheet-attack-formulas strong {
  color: rgb(var(--attack-tone));
  font-size: 13px;
}

.sheet-attack-meta {
  display: grid;
  grid-template-columns: 0.42fr 0.58fr;
  gap: 8px;
}

.sheet-attack-meta span {
  display: grid;
  gap: 4px;
  align-content: start;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(215, 168, 79, 0.16);
  border-radius: 9px;
  color: #dcecff;
  background: rgba(215, 168, 79, 0.045);
  font-size: 11px;
  line-height: 1.35;
}

.sheet-attack-card footer {
  display: flex;
  justify-content: flex-end;
}

.condition-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
}

.condition-grid > span.is-active {
  color: #ffe8b7;
  border-color: rgba(215, 168, 79, 0.58);
  background: rgba(215, 168, 79, 0.14);
}

.condition-card {
  display: grid;
  gap: 8px;
  min-height: 124px;
  padding: 12px;
  border: 1px solid rgba(132, 155, 178, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 10% 0%, rgba(94, 164, 255, 0.08), transparent 45%),
    rgba(6, 10, 16, 0.68);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.condition-card.is-active {
  border-color: rgba(215, 168, 79, 0.48);
  background:
    radial-gradient(circle at 12% 0%, rgba(215, 168, 79, 0.16), transparent 45%),
    rgba(16, 12, 7, 0.75);
}

.condition-card.is-persistent.is-active {
  border-color: rgba(255, 116, 83, 0.58);
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 116, 83, 0.18), transparent 48%),
    rgba(17, 8, 7, 0.78);
}

.condition-card > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.condition-card strong {
  color: var(--text);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.condition-card span {
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.condition-card p {
  margin: 0;
  color: rgba(226, 235, 245, 0.66);
  font-size: 12px;
  line-height: 1.45;
}

.condition-card .inventory-detail-button {
  justify-self: start;
}

.condition-detail-layer,
.dm-conditions-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 18px;
}

.condition-detail-backdrop,
.dm-conditions-modal-layer .dm-gift-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.condition-detail-dialog,
.dm-conditions-modal {
  position: relative;
  z-index: 1;
  width: min(760px, calc(100vw - 28px));
  max-height: min(820px, calc(100vh - 28px));
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: 22px;
  background:
    radial-gradient(circle at 0% 0%, rgba(215, 168, 79, 0.12), transparent 34%),
    linear-gradient(145deg, rgba(10, 17, 26, 0.98), rgba(5, 8, 13, 0.98));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.condition-detail-dialog.is-exhaustion,
.dm-exhaustion-control {
  border-color: rgba(255, 116, 83, 0.28);
  background:
    radial-gradient(circle at 0% 0%, rgba(255, 116, 83, 0.12), transparent 45%),
    rgba(9, 12, 18, 0.86);
}

.condition-detail-dialog header,
.dm-conditions-modal header,
.dm-exhaustion-control {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
}

.condition-detail-dialog h2,
.dm-conditions-modal h2,
.dm-exhaustion-control h3 {
  margin: 0;
  color: #ffe7ad;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.condition-detail-dialog header span,
.dm-conditions-modal header span {
  color: rgba(226, 235, 245, 0.68);
  font-size: 12px;
}

.condition-detail-dialog > p,
.dm-exhaustion-control p {
  margin: 0;
  color: rgba(226, 235, 245, 0.78);
  line-height: 1.6;
}

.condition-detail-rules {
  display: grid;
  gap: 8px;
}

.condition-detail-rules span {
  padding: 10px 12px;
  border: 1px solid rgba(215, 168, 79, 0.12);
  border-radius: 12px;
  color: #dce7f4;
  background: rgba(255, 255, 255, 0.035);
  font-size: 13px;
  line-height: 1.45;
}

.condition-exhaustion-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.condition-exhaustion-summary span {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(255, 116, 83, 0.18);
  border-radius: 14px;
  background: rgba(255, 116, 83, 0.07);
}

.condition-exhaustion-summary small {
  color: rgba(226, 235, 245, 0.58);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.condition-exhaustion-summary strong {
  color: #ffd19a;
  font-size: 18px;
}

.dm-exhaustion-control {
  padding: 14px;
  border: 1px solid rgba(255, 116, 83, 0.22);
  border-radius: 16px;
}

.dm-exhaustion-level {
  display: grid;
  grid-template-columns: 42px 70px 42px;
  gap: 8px;
  align-items: center;
  justify-content: end;
  min-width: 180px;
}

.dm-exhaustion-level strong {
  display: grid;
  place-items: center;
  min-height: 44px;
  border: 1px solid rgba(255, 116, 83, 0.3);
  border-radius: 12px;
  color: #ffe2b2;
  background: rgba(0, 0, 0, 0.24);
  font-size: 24px;
}

.dm-exhaustion-level span {
  grid-column: 1 / -1;
  color: rgba(226, 235, 245, 0.58);
  text-align: center;
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dm-condition-toggle-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.dm-condition-toggle-grid button {
  display: grid;
  gap: 6px;
  min-height: 92px;
  padding: 12px;
  border: 1px solid rgba(132, 155, 178, 0.16);
  border-radius: 14px;
  color: var(--text);
  text-align: left;
  background: rgba(255, 255, 255, 0.035);
  cursor: pointer;
}

.dm-condition-toggle-grid button.is-active {
  border-color: rgba(215, 168, 79, 0.52);
  background: rgba(215, 168, 79, 0.12);
  box-shadow: 0 0 24px rgba(215, 168, 79, 0.08);
}

.dm-condition-toggle-grid strong {
  color: #ffe7ad;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-condition-toggle-grid span {
  color: rgba(226, 235, 245, 0.66);
  font-size: 12px;
  line-height: 1.4;
}

@media (max-width: 720px) {
  .condition-detail-dialog,
  .dm-conditions-modal {
    padding: 16px;
    border-radius: 18px;
  }

  .condition-exhaustion-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dm-exhaustion-control {
    display: grid;
  }

  .dm-exhaustion-level {
    justify-content: stretch;
  }
}

.story-editor-grid label {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.story-editor-grid input,
.story-editor-grid textarea,
#journalSearchInput {
  width: 100%;
  min-height: 40px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.story-editor-grid textarea {
  min-height: 150px;
  resize: vertical;
  line-height: 1.5;
}

.sheet-mobile-nav {
  display: none;
}

.global-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 10000;
  pointer-events: none;
}

.global-modal-slot {
  display: contents;
}

.global-modal-slot:empty {
  display: none;
}

.lk-modal-layer {
  isolation: isolate;
  pointer-events: auto;
}

.lk-modal-backdrop {
  cursor: default;
  backdrop-filter: blur(10px);
}

.mobile-sheet-shell,
.mobile-character-picker-layer,
.mobile-character-picker-backdrop,
.mobile-character-picker-modal {
  display: none;
}

.dm-layout {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(300px, 440px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.dm-tabs {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  padding: 8px;
  border: 1px solid rgba(215, 168, 79, 0.16);
  border-radius: 999px;
  background: rgba(4, 8, 13, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.045);
}

.dm-tabs button {
  min-height: 38px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: var(--muted);
  background: transparent;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.dm-tabs button.is-active {
  color: #ffe7b0;
  border-color: rgba(215, 168, 79, 0.5);
  background: linear-gradient(180deg, rgba(215, 168, 79, 0.22), rgba(215, 168, 79, 0.08));
  box-shadow: 0 0 22px rgba(215, 168, 79, 0.12);
}

.dm-object-sidebar,
.dm-object-list-panel,
.dm-object-detail-panel,
.dm-object-schema,
.dm-campaign-shell,
.dm-campaign-form-panel,
.dm-campaign-drawer,
.dm-campaign-notes-panel,
.dm-character-rules-panel {
  padding: 18px;
}

.dm-object-sidebar {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 12px;
}

.dm-object-summary h2,
.dm-object-list-panel h3,
.dm-object-schema h3 {
  margin: 4px 0 8px;
  color: var(--text);
  font-size: 18px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-object-summary p,
.dm-object-schema p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.dm-filter-field {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-filter-field input,
.dm-filter-field select,
.dm-object-form input,
.dm-object-form select,
.dm-object-form textarea,
.dm-campaign-form input,
.dm-campaign-form select,
.dm-campaign-form textarea,
.dm-campaign-filters input,
.dm-campaign-filters select,
.dm-character-control select,
.dm-combat-row input {
  min-height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.055);
}

.dm-filter-field select,
.dm-object-form select,
.dm-campaign-form select,
.dm-campaign-filters select,
.dm-character-control select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  padding-right: 42px;
  color-scheme: dark;
  cursor: pointer;
  background-image:
    linear-gradient(135deg, transparent 50%, rgba(244, 239, 228, 0.76) 50%),
    linear-gradient(45deg, rgba(244, 239, 228, 0.76) 50%, transparent 50%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.015));
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 12px) 50%,
    0 0;
  background-size:
    6px 6px,
    6px 6px,
    100% 100%;
  background-repeat: no-repeat;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dm-filter-field select:focus,
.dm-filter-field input:focus,
.dm-object-form input:focus,
.dm-object-form select:focus,
.dm-object-form textarea:focus,
.dm-campaign-form input:focus,
.dm-campaign-form select:focus,
.dm-campaign-form textarea:focus,
.dm-campaign-filters input:focus,
.dm-campaign-filters select:focus,
.dm-character-control select:focus,
.dm-combat-row input:focus {
  outline: none;
  border-color: rgba(215, 168, 79, 0.56);
  box-shadow: 0 0 0 1px rgba(215, 168, 79, 0.14), 0 12px 26px rgba(0, 0, 0, 0.18);
}

.dm-filter-field select option,
.dm-object-form select option,
.dm-campaign-form select option,
.dm-campaign-filters select option,
.dm-character-control select option {
  color: var(--text);
  background: #111821;
}

.dm-sidebar-actions,
.dm-form-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.dm-sidebar-actions button,
.dm-form-actions button {
  flex: 1 1 auto;
}

.dm-object-list-panel {
  display: grid;
  gap: 12px;
}

.dm-object-list-panel header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.dm-object-list-panel header span {
  color: var(--gold);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.dm-object-list {
  max-height: calc(100vh - 220px);
  display: grid;
  align-content: start;
  gap: 8px;
  overflow: auto;
  padding-right: 4px;
}

.dm-object-row {
  display: grid;
  gap: 4px;
  min-height: 58px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  text-align: left;
  transition: border-color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.dm-object-row:hover {
  transform: translateY(-1px);
}

.dm-object-row.is-active {
  border-color: rgba(215, 168, 79, 0.54);
  background: rgba(215, 168, 79, 0.12);
}

.dm-object-row strong {
  color: var(--text);
  font-size: 13px;
}

.dm-object-row span {
  color: var(--muted);
  font-size: 11px;
}

.dm-object-detail {
  display: grid;
  gap: 16px;
}

.dm-object-detail header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.dm-object-detail h2 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: clamp(24px, 3vw, 42px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-origin-badge,
.dm-object-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: 999px;
  color: #ffe7b0;
  background: rgba(215, 168, 79, 0.1);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-object-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.dm-object-stats,
.dm-object-field-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.dm-object-stats div,
.dm-object-field-grid div,
.dm-object-source {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.045);
}

.dm-object-stats span,
.dm-object-field-grid span,
.dm-object-source span {
  display: block;
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-object-stats strong,
.dm-object-field-grid strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.4;
}

.dm-object-description,
.dm-object-source p {
  margin: 0;
  color: var(--muted);
  line-height: 1.58;
}

.dm-object-form {
  display: grid;
  gap: 16px;
}

.dm-object-form-shell {
  padding: 14px;
  border: 1px solid rgba(215, 168, 79, 0.14);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.045), rgba(255, 255, 255, 0.018)),
    rgba(8, 17, 20, 0.48);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dm-object-form-section {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.035);
}

.dm-object-form-section header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  padding-bottom: 10px;
}

.dm-object-form-section h3 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
}

.dm-object-form-grid {
  gap: 12px;
}

.dm-object-form label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-object-cost-field {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 116px;
  gap: 10px;
  align-items: end;
}

.dm-object-form textarea {
  min-height: 118px;
  resize: vertical;
  text-transform: none;
}

.dm-object-form-field {
  margin: 0;
  padding: 0;
  border: 0;
}

.dm-object-form-field legend {
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-object-property-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dm-object-property-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.055);
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: none;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.dm-object-property-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.dm-object-property-chip:hover {
  border-color: rgba(215, 168, 79, 0.34);
  color: var(--text);
  transform: translateY(-1px);
}

.dm-object-property-chip:has(input:checked),
.dm-object-property-chip.is-selected {
  border-color: rgba(73, 182, 170, 0.55);
  background: rgba(73, 182, 170, 0.15);
  color: #dcfffb;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.dm-object-type-panel[hidden] {
  display: none;
}

.dm-object-schema {
  grid-column: 1 / -1;
}

.dm-campaign-list-panel {
  min-height: 420px;
}

.dm-campaign-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.dm-campaign-row.is-active {
  border-color: rgba(215, 168, 79, 0.55);
  background: rgba(215, 168, 79, 0.1);
}

.dm-campaign-row > button {
  display: grid;
  gap: 4px;
  padding: 0;
  color: inherit;
  background: transparent;
  text-align: left;
}

.dm-campaign-row strong,
.dm-campaign-character-row strong,
.dm-combat-name strong,
.dm-monster-picker-card strong {
  color: var(--text);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.dm-campaign-row span,
.dm-campaign-row small,
.dm-campaign-character-row span,
.dm-combat-name span,
.dm-monster-picker-card span,
.dm-monster-picker-card small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dm-campaign-form-panel,
.dm-campaign-shell,
.dm-campaign-drawer,
.dm-campaign-notes-panel {
  grid-column: 1 / -1;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(8, 13, 19, 0.78);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.dm-campaign-form,
.dm-campaign-form label {
  display: grid;
  gap: 9px;
}

.dm-campaign-form label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-campaign-form textarea,
.dm-campaign-notes-panel textarea {
  min-height: 140px;
  padding-top: 12px;
  resize: vertical;
  text-transform: none;
}

.dm-campaign-header,
.dm-encounter-head,
.dm-campaign-drawer header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.dm-campaign-header h2,
.dm-encounter-head h3,
.dm-campaign-drawer h3,
.dm-campaign-notes-panel h3 {
  margin: 2px 0 0;
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-campaign-header p {
  margin: 4px 0 0;
  color: var(--muted);
}

.dm-campaign-section-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.dm-campaign-section-tabs button {
  min-height: 36px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dm-campaign-section-tabs button.is-active {
  color: #ffe7b0;
  border-color: rgba(215, 168, 79, 0.5);
  background: rgba(215, 168, 79, 0.14);
}

.dm-campaign-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.dm-campaign-character-list {
  display: grid;
  gap: 9px;
  max-height: 520px;
  overflow: auto;
  padding-right: 4px;
}

.dm-campaign-character-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.dm-campaign-character-row div {
  display: grid;
  gap: 3px;
}

.dm-campaign-character-row small {
  color: rgba(226, 235, 245, 0.62);
  font-size: 11px;
  line-height: 1.35;
}

.dm-rewards-screen {
  display: grid;
  gap: 16px;
}

.dm-reward-panel header,
.dm-reward-history-panel header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 12px;
}

.dm-reward-character-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.dm-reward-character-card {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(215, 168, 79, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(215, 168, 79, 0.1), transparent 48%),
    rgba(0, 0, 0, 0.24);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.03);
}

.dm-reward-character-main {
  display: grid;
  gap: 3px;
}

.dm-reward-character-main strong {
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-reward-character-main span,
.dm-reward-character-main small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.dm-reward-coin-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.dm-reward-coin-grid label {
  display: grid;
  gap: 5px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dm-reward-coin-grid input {
  min-width: 0;
  height: 38px;
  padding: 0 9px;
  border: 1px solid rgba(215, 168, 79, 0.22);
  border-radius: 10px;
  color: var(--text);
  background: rgba(3, 7, 12, 0.72);
  font-weight: 800;
}

.dm-reward-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dm-reward-actions button {
  flex: 1 1 140px;
}

.dm-reward-history-list {
  display: grid;
  gap: 10px;
  max-height: 480px;
  overflow: auto;
  padding-right: 4px;
}

.dm-reward-history-toolbar {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) minmax(180px, 1fr) auto;
  align-items: end;
  gap: 10px;
  margin: 12px 0;
}

.dm-reward-history-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.dm-reward-history-toolbar select {
  min-height: 38px;
  padding: 0 34px 0 11px;
  border: 1px solid rgba(215, 168, 79, 0.22);
  border-radius: 10px;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(215, 168, 79, 0.08), rgba(0, 0, 0, 0.16)),
    rgba(3, 7, 12, 0.78);
  font-weight: 800;
  appearance: none;
}

.dm-reward-history-toolbar option {
  color: #f2ead9;
  background: #0b1118;
}

.dm-reward-page-summary {
  min-height: 38px;
  display: grid;
  align-content: center;
  gap: 2px;
  padding: 6px 12px;
  border: 1px solid rgba(215, 168, 79, 0.16);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.dm-reward-page-summary strong {
  color: #ffe3a0;
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-reward-page-summary span {
  color: var(--muted);
  font-size: 11px;
}

.dm-reward-pagination {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 12px;
}

.dm-reward-history-entry {
  --reward-tone: 215, 168, 79;
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(var(--reward-tone), 0.24);
  border-radius: 13px;
  background:
    linear-gradient(135deg, rgba(var(--reward-tone), 0.14), rgba(0, 0, 0, 0.18)),
    rgba(0, 0, 0, 0.18);
}

.dm-reward-history-entry.is-source-dm-gift {
  --reward-tone: 99, 224, 213;
}

.dm-reward-history-entry.is-source-dm-gold {
  --reward-tone: 215, 168, 79;
}

.dm-reward-history-entry.is-source-shop-item {
  --reward-tone: 105, 190, 126;
}

.dm-reward-history-entry.is-source-sheet {
  --reward-tone: 220, 118, 79;
}

.dm-reward-history-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--reward-tone), 0.34);
  border-radius: 50%;
  color: rgb(var(--reward-tone));
  background: rgba(var(--reward-tone), 0.12);
  font-weight: 900;
}

.dm-reward-history-entry header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin: 0 0 4px;
}

.dm-reward-history-entry strong {
  color: #ffe3a0;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-reward-history-entry header span,
.dm-reward-history-entry small {
  color: var(--muted);
  font-size: 11px;
}

.dm-reward-history-entry p {
  margin: 0 0 5px;
  color: var(--text);
  font-size: 13px;
  line-height: 1.45;
}

.dm-campaign-character-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dm-gift-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 180;
  display: grid;
  place-items: center;
  padding: 18px;
}

.dm-gift-modal-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  background: rgba(1, 4, 8, 0.82);
  backdrop-filter: blur(10px);
}

.dm-gift-modal {
  position: relative;
  width: min(1180px, calc(100vw - 36px));
  max-height: min(860px, calc(100dvh - 36px));
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid rgba(215, 168, 79, 0.38);
  border-radius: 18px;
  background:
    radial-gradient(circle at 8% 0%, rgba(72, 132, 188, 0.12), transparent 32%),
    linear-gradient(145deg, rgba(13, 21, 30, 0.99), rgba(4, 8, 13, 0.99));
  box-shadow: 0 32px 90px rgba(0, 0, 0, 0.72), inset 0 1px 0 rgba(255, 255, 255, 0.04);
  animation: dm-gift-modal-enter 240ms ease both;
}

@keyframes dm-gift-modal-enter {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.985);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.dm-gift-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px;
  border-bottom: 1px solid rgba(215, 168, 79, 0.17);
}

.dm-gift-modal-head h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: clamp(20px, 2.4vw, 30px);
  letter-spacing: 0.05em;
}

.modal-icon-close {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 50%;
  color: rgba(236, 241, 247, 0.82);
  background: rgba(255, 255, 255, 0.045);
  font-family: Georgia, serif;
  font-size: 26px;
  line-height: 1;
}

.modal-icon-close:hover {
  color: #fff0c8;
  border-color: rgba(215, 168, 79, 0.48);
  background: rgba(215, 168, 79, 0.12);
}

.dm-gift-mode-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.dm-gift-mode-tabs button {
  min-height: 42px;
  padding: 0 18px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 11px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.025);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-gift-mode-tabs button.is-active {
  color: #ffe6ad;
  border-color: rgba(215, 168, 79, 0.46);
  background: rgba(215, 168, 79, 0.12);
  box-shadow: inset 0 0 22px rgba(215, 168, 79, 0.05);
}

.dm-gift-modal-body {
  min-height: 0;
  overflow: auto;
  padding: 16px 20px 20px;
  overscroll-behavior: contain;
}

.dm-gift-catalog-toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(180px, 0.45fr) auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.dm-gift-catalog-toolbar label,
.dm-gift-custom-grid label,
.dm-gift-quantity {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.dm-gift-visible-count {
  align-self: center;
  color: rgba(226, 235, 245, 0.62);
  font-size: 11px;
  text-align: right;
}

.dm-gift-catalog-layout {
  min-height: 460px;
  display: grid;
  grid-template-columns: minmax(300px, 0.86fr) minmax(340px, 1.14fr);
  gap: 14px;
}

.dm-gift-catalog-list {
  min-height: 0;
  max-height: 590px;
  display: grid;
  align-content: start;
  gap: 7px;
  overflow: auto;
  padding: 3px 6px 3px 3px;
  overscroll-behavior: contain;
}

.dm-gift-object-row {
  width: 100%;
  min-height: 58px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 8px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  color: inherit;
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
}

.dm-gift-object-row:hover,
.dm-gift-object-row.is-active {
  border-color: rgba(91, 164, 255, 0.48);
  background: linear-gradient(90deg, rgba(44, 102, 160, 0.2), rgba(215, 168, 79, 0.06));
}

.dm-gift-object-row[hidden] {
  display: none;
}

.dm-gift-object-row strong,
.dm-gift-object-row small {
  display: block;
}

.dm-gift-object-row strong {
  color: var(--text);
  font-size: 12px;
  letter-spacing: 0.05em;
}

.dm-gift-object-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
}

.dm-gift-object-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 168, 79, 0.25);
  border-radius: 10px;
  color: #e1bd6f;
  background: rgba(215, 168, 79, 0.08);
  font-size: 20px;
}

.dm-gift-object-detail,
.dm-gift-confirmation,
.dm-gift-custom-form,
.dm-gift-success {
  border: 1px solid rgba(215, 168, 79, 0.18);
  border-radius: 15px;
  background: rgba(0, 0, 0, 0.22);
}

.dm-gift-object-detail {
  min-height: 0;
  padding: 18px;
}

.dm-gift-object-detail > header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.dm-gift-object-detail h3,
.dm-gift-confirmation h3,
.dm-gift-custom-form h3,
.dm-gift-success h3 {
  margin: 2px 0 0;
  color: var(--text);
  font-size: 21px;
}

.dm-gift-object-detail > p,
.dm-gift-confirmation > p,
.dm-gift-custom-intro p,
.dm-gift-success p {
  color: rgba(226, 235, 245, 0.72);
  line-height: 1.55;
}

.dm-gift-detail-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 16px 0;
}

.dm-gift-detail-fields div {
  display: grid;
  gap: 4px;
  padding: 9px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
}

.dm-gift-detail-fields span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-gift-detail-fields strong {
  color: var(--text);
  font-size: 11px;
  line-height: 1.4;
}

.dm-gift-quantity {
  max-width: 150px;
  margin: 16px 0 12px;
}

.dm-gift-review-button {
  width: 100%;
  min-height: 46px;
}

.dm-gift-custom-form {
  padding: 18px;
}

.dm-gift-custom-intro {
  margin-bottom: 16px;
}

.dm-gift-custom-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.dm-gift-custom-grid .is-wide {
  grid-column: 1 / -1;
}

.dm-gift-custom-grid textarea {
  min-height: 92px;
  resize: vertical;
}

.dm-rich-editor {
  overflow: hidden;
  margin-top: 7px;
  border: 1px solid rgba(210, 171, 91, 0.22);
  border-radius: 11px;
  background: rgba(3, 8, 13, 0.72);
  box-shadow: inset 0 1px 18px rgba(0, 0, 0, 0.25);
}

.dm-rich-toolbar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px 8px;
  border-bottom: 1px solid rgba(210, 171, 91, 0.15);
  background: rgba(210, 171, 91, 0.045);
}

.dm-rich-toolbar button {
  min-width: 32px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(210, 171, 91, 0.2);
  border-radius: 7px;
  color: #dce5ee;
  background: rgba(18, 27, 37, 0.88);
  cursor: pointer;
}

.dm-rich-toolbar button:hover,
.dm-rich-toolbar button:focus-visible {
  border-color: rgba(225, 183, 95, 0.65);
  background: rgba(225, 183, 95, 0.12);
}

.dm-rich-toolbar .dm-rich-color {
  position: relative;
  width: 27px;
  min-width: 27px;
  padding: 0;
}

.dm-rich-toolbar .dm-rich-color::after {
  content: "";
  position: absolute;
  inset: 7px;
  border-radius: 50%;
  background: var(--rich-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--rich-color) 55%, transparent);
}

.dm-rich-input {
  min-height: 104px;
  max-height: 260px;
  overflow: auto;
  padding: 12px 13px;
  color: #d9e1e9;
  font: 500 13px/1.65 "Cinzel", serif;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  outline: none;
}

.dm-rich-input:empty::before {
  content: attr(data-placeholder);
  color: rgba(217, 225, 233, 0.38);
  pointer-events: none;
}

.dm-rich-input:focus {
  box-shadow: inset 0 0 0 1px rgba(225, 183, 95, 0.45);
}

.dm-rich-input p,
.dm-rich-input div,
.rich-text-output p,
.rich-text-output div {
  margin: 0 0 0.65em;
}

.dm-rich-input p:last-child,
.dm-rich-input div:last-child,
.rich-text-output p:last-child,
.rich-text-output div:last-child {
  margin-bottom: 0;
}

.dm-rich-input ul,
.dm-rich-input ol,
.rich-text-output ul,
.rich-text-output ol {
  margin: 0.45em 0 0.75em;
  padding-left: 1.5em;
}

.rich-text-output {
  color: inherit;
  line-height: 1.65;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.dm-gift-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.dm-gift-confirmation,
.dm-gift-success {
  max-width: 680px;
  margin: 20px auto;
  padding: 28px;
  text-align: center;
}

.dm-gift-confirmation-summary {
  display: grid;
  gap: 7px;
  margin-top: 18px;
  padding: 14px;
  border: 1px solid rgba(215, 168, 79, 0.22);
  border-radius: 12px;
  background: rgba(215, 168, 79, 0.07);
}

.dm-gift-confirmation-summary span {
  color: #e2bd70;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-gift-confirmation-summary small {
  color: rgba(226, 235, 245, 0.72);
  line-height: 1.5;
}

.dm-gift-success {
  align-self: center;
}

.dm-gift-success > span {
  width: 64px;
  height: 64px;
  display: grid;
  place-items: center;
  margin: 0 auto 14px;
  border: 1px solid rgba(105, 190, 126, 0.5);
  border-radius: 50%;
  color: #9ee0ae;
  background: rgba(55, 145, 82, 0.14);
  font-size: 30px;
}

@media (max-width: 820px) {
  .dm-layout,
  .dm-tabs,
  .dm-campaign-shell {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
  }

  .dm-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border-radius: 18px;
  }

  .dm-tabs button {
    min-width: 0;
    padding-inline: 12px;
  }

  .dm-campaign-content-grid,
  .dm-campaign-character-row,
  .dm-reward-character-grid,
  .dm-gift-catalog-toolbar,
  .dm-gift-catalog-layout,
  .dm-gift-custom-grid {
    grid-template-columns: 1fr;
  }

  .dm-reward-coin-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dm-campaign-character-actions {
    justify-content: stretch;
  }

  .dm-campaign-character-actions button {
    flex: 1 1 150px;
    min-height: 44px;
  }

  .dm-gift-modal-layer {
    padding: 8px;
  }

  .dm-gift-modal {
    width: calc(100vw - 16px);
    max-height: calc(100dvh - 16px);
    border-radius: 14px;
  }

  .dm-gift-modal-head,
  .dm-gift-mode-tabs,
  .dm-gift-modal-body {
    padding-left: 14px;
    padding-right: 14px;
  }

  .dm-gift-mode-tabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dm-reward-history-toolbar {
    grid-template-columns: 1fr;
  }

  .dm-reward-pagination {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dm-gift-catalog-layout {
    min-height: 0;
  }

  .dm-gift-catalog-list {
    max-height: 32dvh;
  }

  .dm-gift-visible-count {
    text-align: left;
  }

  .dm-gift-custom-grid .is-wide {
    grid-column: auto;
  }
}

@media (max-width: 520px) {
  .dm-gift-mode-tabs {
    grid-template-columns: 1fr;
  }

  .dm-gift-modal-head {
    align-items: flex-start;
  }

  .dm-gift-modal-head h2 {
    font-size: 18px;
  }

  .dm-gift-detail-fields {
    grid-template-columns: 1fr;
  }

  .dm-gift-modal-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .dm-gift-confirmation,
  .dm-gift-success {
    margin: 0;
    padding: 20px 14px;
  }
}

.dm-character-sidebar {
  align-self: start;
}

.dm-character-manager-panel {
  grid-column: span 2;
}

.dm-character-manager-list {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding-right: 4px;
}

.dm-character-manager-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr) minmax(220px, 300px);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(91, 164, 255, 0.2);
  border-radius: 16px;
  background:
    radial-gradient(circle at 0% 0%, rgba(91, 164, 255, 0.11), transparent 35%),
    rgba(3, 8, 14, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.035);
}

.dm-character-manager-card.is-locked {
  border-color: rgba(215, 168, 79, 0.28);
  background:
    radial-gradient(circle at 0% 0%, rgba(215, 168, 79, 0.12), transparent 34%),
    rgba(3, 8, 14, 0.68);
}

.dm-character-manager-card.is-selected {
  border-color: rgba(102, 197, 184, 0.5);
  box-shadow: 0 0 0 1px rgba(102, 197, 184, 0.14), inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.dm-character-manager-portrait {
  width: 82px;
  height: 104px;
  overflow: hidden;
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.38);
}

.dm-character-manager-portrait img,
.dm-character-manager-portrait .portrait-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.dm-character-manager-copy {
  display: grid;
  gap: 8px;
}

.dm-character-manager-copy h3 {
  margin: 2px 0 0;
  color: var(--text);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-character-manager-copy span,
.dm-character-manager-copy p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}

.dm-character-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dm-character-badges span {
  min-height: 23px;
  display: inline-flex;
  align-items: center;
  padding: 0 8px;
  border: 1px solid rgba(215, 168, 79, 0.22);
  border-radius: 999px;
  color: #ffe7b0;
  background: rgba(215, 168, 79, 0.08);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-character-control {
  display: grid;
  gap: 10px;
}

.dm-character-control label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-character-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.dm-character-actions button {
  flex: 1 1 120px;
}

.dm-character-config-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  margin: 14px 0;
}

.dm-campaign-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.dm-campaign-encounter {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.dm-encounter-actions,
.dm-generator-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.dm-encounter-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(145px, 1fr));
  gap: 9px;
  padding: 12px;
  border: 1px solid rgba(215, 168, 79, 0.2);
  border-radius: 16px;
  background: rgba(0, 0, 0, 0.22);
}

.dm-encounter-summary article {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.045);
}

.dm-encounter-summary span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-encounter-summary strong {
  color: var(--text);
}

.dm-encounter-warnings {
  grid-column: 1 / -1;
  padding: 10px 12px;
  border: 1px dashed rgba(215, 168, 79, 0.32);
  border-radius: 12px;
  color: var(--muted);
}

.dm-campaign-drawer {
  display: grid;
  gap: 12px;
  background: rgba(5, 9, 14, 0.88);
}

.dm-campaign-drawer.is-golden {
  border-color: rgba(215, 168, 79, 0.52);
  box-shadow: 0 0 30px rgba(215, 168, 79, 0.1), var(--shadow);
}

.dm-generated-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dm-generated-list span {
  padding: 8px 10px;
  border: 1px solid rgba(215, 168, 79, 0.25);
  border-radius: 999px;
  color: var(--text);
  background: rgba(215, 168, 79, 0.1);
}

.dm-generated-list small {
  color: var(--gold);
}

.dm-monster-picker-list {
  display: grid;
  gap: 10px;
  max-height: 430px;
  overflow: auto;
  padding-right: 4px;
}

.dm-monster-picker-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 90px auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(32, 43, 55, 0.72), rgba(7, 11, 17, 0.86));
}

.dm-monster-picker-card div,
.dm-combat-name {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.dm-monster-picker-card label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-combat-list {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 9px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  clip-path: inset(0);
  contain: paint;
  overscroll-behavior-inline: contain;
  -webkit-overflow-scrolling: touch;
}

.dm-encounter-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(330px, 0.9fr);
  gap: 14px;
  align-items: start;
  min-width: 0;
  max-width: 100%;
}

.dm-encounter-workspace > * {
  min-width: 0;
  max-width: 100%;
}

.dm-combat-row {
  display: grid;
  grid-template-columns: minmax(140px, 1.2fr) 68px 64px minmax(170px, 1fr) 34px 54px;
  grid-template-areas:
    "identity max armor conditions up active"
    "identity hp initiative conditions down remove";
  align-items: stretch;
  gap: 6px 8px;
  width: 100%;
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.dm-combat-row.is-selected {
  border-color: rgba(215, 168, 79, 0.72);
  box-shadow: 0 0 0 1px rgba(215, 168, 79, 0.18), inset 3px 0 0 rgba(215, 168, 79, 0.72);
}

.dm-combat-row.is-player {
  border-color: rgba(94, 184, 126, 0.28);
  background: linear-gradient(135deg, rgba(53, 128, 79, 0.16), rgba(255, 255, 255, 0.035));
  box-shadow: inset 3px 0 0 rgba(94, 184, 126, 0.42);
}

.dm-combat-row.is-monster {
  border-color: rgba(197, 79, 69, 0.32);
  background: linear-gradient(135deg, rgba(141, 42, 38, 0.18), rgba(255, 255, 255, 0.035));
  box-shadow: inset 3px 0 0 rgba(197, 79, 69, 0.44);
}

.dm-combat-row.is-inactive {
  opacity: 0.52;
}

.dm-combat-name {
  grid-area: identity;
  align-self: center;
  min-width: 0;
}

.dm-combat-field--max {
  grid-area: max;
}

.dm-combat-field--armor {
  grid-area: armor;
}

.dm-combat-field--hp {
  grid-area: hp;
}

.dm-combat-field--initiative {
  grid-area: initiative;
}

.dm-combat-field--conditions {
  grid-area: conditions;
  align-self: stretch;
  height: 100%;
  grid-template-rows: auto minmax(0, 1fr);
}

.dm-combat-drag {
  width: 24px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  color: var(--gold);
  cursor: grab;
  background: rgba(0, 0, 0, 0.18);
}

.dm-combat-row label {
  display: grid;
  gap: 4px;
  min-width: 0;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-combat-row label span {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.dm-combat-row input {
  min-width: 0;
  height: 34px;
  min-height: 34px;
  padding: 0 8px;
}

.dm-combat-field--conditions input {
  height: 100%;
  min-height: 72px;
  align-self: stretch;
}

.dm-combat-row input[readonly] {
  opacity: 0.7;
  cursor: not-allowed;
}

.dm-combat-select {
  display: grid;
  gap: 3px;
  align-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.dm-combat-select strong {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--gold);
}

.dm-combat-select span {
  display: block;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  color: var(--muted);
  font-size: 11px;
}

.dm-combat-select:focus-visible {
  outline: 2px solid rgba(215, 168, 79, 0.68);
  outline-offset: 4px;
  border-radius: 8px;
}

.sheet-panel input:disabled,
.sheet-panel button:disabled,
.sheet-hero button:disabled,
.dm-layout button:disabled,
.dm-layout input:disabled,
.dm-layout select:disabled {
  cursor: not-allowed;
  opacity: 0.52;
  filter: saturate(0.75);
}

.dm-combat-actions {
  display: contents;
}

.dm-combat-actions button {
  min-width: 0;
  min-height: 26px;
  padding: 0 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 9px;
}

.dm-combat-control--up {
  grid-area: up;
}

.dm-combat-control--down {
  grid-area: down;
}

.dm-combat-control--active {
  grid-area: active;
}

.dm-combat-control--remove {
  grid-area: remove;
}

.dm-encounter-context-panel {
  position: sticky;
  top: 18px;
  z-index: 2;
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 36px);
  min-width: 0;
  max-width: 100%;
  overflow: auto;
  padding-right: 4px;
}

.dm-encounter-context-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  padding: 14px;
  border: 1px solid rgba(215, 168, 79, 0.22);
  border-radius: 16px;
  background: linear-gradient(180deg, rgba(12, 18, 25, 0.95), rgba(5, 9, 14, 0.9));
  box-shadow: var(--shadow);
}

.dm-encounter-context-card > header {
  display: flex;
  justify-content: space-between;
  gap: 10px;
}

.dm-encounter-context-card > header h3 {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 18px;
}

.dm-encounter-context-card > header span {
  color: var(--muted);
  font-size: 12px;
}

.dm-context-fact-grid,
.dm-context-ability-grid,
.dm-context-attribute-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(82px, 1fr));
  gap: 8px;
}

.dm-context-attribute-grid {
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.dm-context-fact-grid.compact {
  grid-template-columns: repeat(auto-fit, minmax(110px, 1fr));
}

.dm-context-fact-grid article,
.dm-context-ability-grid article,
.dm-context-attribute-grid article {
  display: grid;
  gap: 2px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.045);
}

.dm-context-fact-grid span,
.dm-context-ability-grid span,
.dm-context-attribute-grid span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-context-fact-grid strong,
.dm-context-ability-grid strong,
.dm-context-attribute-grid strong {
  color: var(--text);
}

.dm-context-ability-grid small,
.dm-context-attribute-grid small {
  color: var(--gold);
  font-size: 12px;
}

.dm-context-section {
  display: grid;
  gap: 7px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.dm-context-section h4 {
  margin: 0;
  color: var(--gold);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.dm-context-pill-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.dm-context-pill-list span {
  padding: 6px 8px;
  border: 1px solid rgba(215, 168, 79, 0.22);
  border-radius: 999px;
  color: var(--text);
  background: rgba(215, 168, 79, 0.08);
  font-size: 12px;
}

.dm-encounter-bestiary-detail {
  min-width: 0;
}

.dm-encounter-bestiary-detail .bestiary-detail-card,
.dm-encounter-bestiary-detail .manual-card {
  box-shadow: none;
}

.dm-encounter-bestiary-detail .manual-card {
  padding: 14px;
}

@media (max-width: 1220px) {
  .dm-encounter-workspace {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 0.78fr);
  }

  .dm-combat-list {
    width: 100%;
    overflow: auto;
    clip-path: inset(0);
    contain: paint;
    overscroll-behavior-inline: contain;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }

  .dm-combat-row {
    grid-template-columns: minmax(96px, 1.05fr) 42px 42px minmax(96px, 0.9fr) 30px 44px;
    width: 100%;
    min-width: 0;
    gap: 6px;
    padding: 8px;
  }

  .dm-combat-row input {
    height: 30px;
    min-height: 30px;
    padding: 0 6px;
  }

  .dm-combat-field--conditions input {
    min-height: 64px;
  }

  .dm-combat-actions button {
    min-height: 24px;
    padding: 0 3px;
    font-size: 9px;
  }
}

@media (max-width: 860px), (max-width: 1220px) and (orientation: portrait) {
  .dm-encounter-workspace {
    grid-template-columns: minmax(0, 1fr);
  }

  .dm-encounter-context-panel {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }
}

.bestiary-layout {
  display: grid;
  grid-template-columns: minmax(280px, 346px) minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.bestiary-layout.is-creating {
  grid-template-columns: 1fr;
}

.bestiary-layout.is-creating .bestiary-form {
  display: none;
}

.bestiary-form {
  padding: 18px;
  display: grid;
  gap: 16px;
  align-content: start;
  position: sticky;
  top: 18px;
}

.bestiary-grid {
  display: grid;
  gap: 18px;
}

.bestiary-card {
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(20, 27, 35, 0.74);
}

.bestiary-card.is-selected {
  border-color: rgba(215, 168, 79, 0.64);
  box-shadow: 0 0 0 1px rgba(215, 168, 79, 0.16) inset;
}

.bestiary-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.45;
}

.bestiary-search,
.bestiary-filter-panel,
.encounter-panel,
.creature-editor {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.bestiary-search p,
.muted-copy {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.bestiary-filter-panel h2 {
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.bestiary-tactical-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
}

.bestiary-tactical-filters label {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
  font-size: 12px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.section-heading h2 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.compact-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.encounter-character-list {
  display: grid;
  gap: 8px;
  max-height: 190px;
  overflow: auto;
}

.encounter-character {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.12);
}

.encounter-character small {
  color: var(--muted);
}

.encounter-summary {
  display: grid;
  gap: 3px;
  padding: 10px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.045);
}

.encounter-summary span,
.encounter-summary small {
  color: var(--muted);
}

.encounter-easy {
  border-color: rgba(73, 182, 170, 0.55);
}

.encounter-normal {
  border-color: rgba(215, 168, 79, 0.55);
}

.encounter-hard {
  border-color: rgba(219, 126, 74, 0.6);
}

.encounter-deadly,
.encounter-lethal {
  border-color: rgba(185, 87, 72, 0.72);
}

.encounter-roster {
  display: grid;
  gap: 8px;
}

.encounter-roster-item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 72px 72px minmax(120px, 0.7fr) auto;
  align-items: center;
  gap: 8px;
}

.encounter-roster-item span {
  display: grid;
  gap: 2px;
}

.encounter-roster-item small {
  color: var(--muted);
}

.bestiary-workspace {
  display: grid;
  grid-template-columns: minmax(420px, 0.96fr) minmax(260px, 0.68fr);
  gap: 18px;
  align-items: start;
}

.bestiary-cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(390px, 1fr));
  gap: 20px;
  align-items: start;
}

.bestiary-detail-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.bestiary-selected-detail {
  min-width: 0;
}

.bestiary-detail-card .manual-card {
  box-shadow: none;
}

.creature-illustration {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.2);
}

.creature-illustration img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.creature-editor-full {
  max-width: 980px;
  margin: 0 auto;
}

.creature-image-picker {
  display: grid;
  gap: 8px;
}

.creature-image-preview {
  min-height: 210px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.16);
  color: var(--muted);
}

.creature-image-preview img {
  width: 100%;
  max-height: 340px;
  object-fit: cover;
}

.bestiary-list {
  display: grid;
  gap: 12px;
  max-height: calc(100vh - 170px);
  overflow: auto;
  padding-right: 4px;
}

.bestiary-select {
  display: grid;
  gap: 4px;
  padding: 0;
  color: var(--text);
  background: transparent;
  text-align: left;
}

.bestiary-select strong {
  color: var(--gold);
  font-size: 17px;
}

.bestiary-select span,
.bestiary-card-meta {
  color: var(--muted);
  font-size: 12px;
}

.bestiary-card-meta,
.bestiary-card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.manual-card {
  position: relative;
  overflow: hidden;
  padding: 18px;
  color: var(--text);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(27, 35, 45, 0.92), rgba(17, 24, 32, 0.88));
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
}

.manual-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  border-top: 3px solid rgba(73, 182, 170, 0.8);
  background: linear-gradient(135deg, rgba(73, 182, 170, 0.12), transparent 34%);
}

.manual-title {
  position: relative;
  z-index: 1;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line-strong);
}

.manual-title h2 {
  margin: 0;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 23px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.manual-title p {
  margin: 3px 0 0;
  color: var(--muted);
  font-style: italic;
}

.bestiary-language-toggle {
  display: inline-flex;
  gap: 4px;
  margin-top: 8px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 8px;
  background: rgba(10, 14, 20, 0.36);
}

.bestiary-language-toggle button {
  min-width: 38px;
  min-height: 30px;
  padding: 0 10px;
  border: 0;
  border-radius: 6px;
  color: var(--muted);
  background: transparent;
  font: 700 12px var(--font-body);
  letter-spacing: 0;
  cursor: pointer;
}

.bestiary-language-toggle button:hover,
.bestiary-language-toggle button:focus-visible {
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.bestiary-language-toggle button.is-active {
  color: #0e1719;
  background: var(--gold);
}

.manual-core {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.manual-core p,
.manual-lines p,
.manual-section p,
.manual-note {
  margin: 0 0 6px;
  color: var(--text);
  line-height: 1.45;
}

.manual-lines {
  position: relative;
  z-index: 1;
}

.manual-abilities {
  position: relative;
  z-index: 1;
  width: 100%;
  margin: 10px 0;
  border-collapse: separate;
  border-spacing: 0 6px;
  font-size: 13px;
}

.manual-abilities th,
.manual-abilities td {
  padding: 7px 8px;
  border: 0;
  text-align: center;
  background: rgba(255, 255, 255, 0.055);
}

.manual-abilities th:first-child,
.manual-abilities td:first-child {
  border-radius: 6px 0 0 6px;
}

.manual-abilities th:last-child,
.manual-abilities td:last-child {
  border-radius: 0 6px 6px 0;
}

.manual-abilities thead th {
  color: var(--dim);
  background: transparent;
  font-size: 11px;
  text-transform: uppercase;
}

.manual-abilities tbody th {
  color: var(--teal);
  font-weight: 800;
}

.manual-saves {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 10px 0;
}

.manual-saves span {
  padding: 6px 9px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(73, 182, 170, 0.1);
}

.manual-section {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line-strong);
}

.manual-section h3 {
  margin: 0 0 6px;
  color: var(--gold);
  font-family: var(--font-body);
  font-size: 15px;
  font-weight: 800;
  text-transform: uppercase;
}

.monster-entry-section {
  display: grid;
  gap: 8px;
}

.monster-entry {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.14);
}

.monster-entry h4 {
  margin: 0 0 4px;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.monster-entry span,
.monster-spell-grid span {
  color: var(--teal);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.monster-entry p {
  margin: 4px 0 0;
  color: var(--muted);
}

.monster-tactical-panel .bestiary-card-actions {
  margin-top: 8px;
}

.monster-spell-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0;
}

.monster-raw-text {
  position: relative;
  z-index: 1;
  margin-top: 14px;
  color: var(--muted);
}

.monster-raw-text pre {
  max-height: 260px;
  overflow: auto;
  white-space: pre-wrap;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.manual-note {
  position: relative;
  z-index: 1;
  padding: 8px;
  color: var(--muted);
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: var(--radius);
  background: rgba(215, 168, 79, 0.08);
}

.inventory-panel {
  display: grid;
  gap: 14px;
}

.inventory-dashboard {
  display: grid;
  grid-template-columns: minmax(280px, 1.1fr) minmax(260px, 0.95fr) minmax(220px, 0.75fr);
  gap: 12px;
}

.inventory-wallet-card,
.inventory-shop-card,
.inventory-bag-card {
  position: relative;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(215, 168, 79, 0.18);
  border-radius: 14px;
  background:
    radial-gradient(circle at 0% 0%, rgba(215, 168, 79, 0.16), transparent 38%),
    rgba(7, 11, 17, 0.74);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.025);
}

.inventory-shop-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
  border-color: rgba(91, 164, 255, 0.22);
  background:
    radial-gradient(circle at 0% 0%, rgba(91, 164, 255, 0.16), transparent 38%),
    rgba(7, 11, 17, 0.74);
}

.inventory-bag-card {
  border-color: rgba(80, 190, 145, 0.2);
  background:
    radial-gradient(circle at 0% 0%, rgba(80, 190, 145, 0.14), transparent 38%),
    rgba(7, 11, 17, 0.74);
}

.inventory-card-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: 12px;
  color: var(--gold);
  background: rgba(215, 168, 79, 0.09);
  font-size: 20px;
}

.inventory-dashboard h2,
.inventory-dashboard h3 {
  margin: 0;
  color: var(--text);
}

.inventory-dashboard h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1;
}

.inventory-dashboard h3 {
  font-size: 16px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.inventory-dashboard small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.inventory-money-row {
  display: grid;
}

.inventory-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.sheet-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.045);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sheet-chip small {
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.075);
  font-size: 10px;
  text-align: center;
}

.sheet-chip.is-active,
.sheet-chip:hover {
  color: var(--gold);
  border-color: rgba(215, 168, 79, 0.42);
  background: rgba(215, 168, 79, 0.12);
}

.coin-editor {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.coin-editor .field-label,
.coin-editor small {
  grid-column: 1 / -1;
}

.coin-editor label,
.shop-wallet small {
  text-transform: none;
}

.coin-editor.compact {
  grid-template-columns: repeat(4, minmax(86px, 1fr));
}

.purchased-list {
  display: grid;
  gap: 10px;
}

.purchased-list h3 {
  color: var(--gold);
  font-size: 18px;
  text-transform: uppercase;
}

.purchased-item {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.purchased-item span,
.muted-copy {
  color: var(--muted);
}

.purchased-item p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.45;
}

.level-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto 94px;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding: 16px;
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.level-panel.is-sheet-cover {
  position: relative;
  overflow: hidden;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  margin-bottom: 0;
  padding: 18px;
  border-color: rgba(92, 207, 229, 0.26);
  background:
    linear-gradient(145deg, rgba(10, 17, 24, 0.94), rgba(24, 18, 12, 0.92));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.035), 0 18px 44px rgba(0, 0, 0, 0.22);
}

.level-panel.is-sheet-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(90deg, rgba(92, 207, 229, 0.14), transparent 42%),
    linear-gradient(180deg, rgba(215, 168, 79, 0.11), transparent 48%);
}

.level-panel-copy,
.level-panel-stats,
.level-method-preview,
.level-panel.is-sheet-cover .level-actions,
.level-panel.is-sheet-cover .level-die,
.level-panel.is-sheet-cover .level-result {
  position: relative;
}

.level-panel-copy h3 {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
  line-height: 1;
}

.level-panel-stats,
.level-method-preview {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.level-panel-stats span,
.level-method-preview span {
  display: grid;
  gap: 4px;
  min-height: 70px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.052);
}

.level-panel-stats small,
.level-method-preview small {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.level-panel-stats strong,
.level-method-preview strong {
  color: var(--gold);
}

.level-panel.is-sheet-cover .level-actions {
  justify-content: stretch;
}

.level-panel.is-sheet-cover .level-actions .primary-button {
  width: 100%;
  justify-content: center;
}

.level-panel.is-sheet-cover .level-die {
  width: 94px;
  justify-self: start;
}

.level-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.level-die {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 168, 79, 0.42);
  border-radius: 12px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 238, 180, 0.22), rgba(215, 168, 79, 0.12) 42%, rgba(0, 0, 0, 0.36));
}

.level-die span,
.level-result span {
  color: var(--muted);
  font-size: 12px;
}

.level-die strong {
  font-size: 34px;
}

.level-die.is-rolling {
  animation: dieRoll 0.85s ease-in-out;
}

.level-result {
  grid-column: 1 / -1;
  display: flex;
  gap: 10px;
  align-items: center;
  color: var(--gold);
}

.level-up-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 28px;
}

.level-up-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 20%, rgba(215, 168, 79, 0.12), transparent 42%),
    rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(10px);
}

.level-up-modal {
  position: relative;
  width: min(980px, calc(100vw - 42px));
  max-height: min(820px, calc(100vh - 42px));
  overflow: auto;
  display: grid;
  gap: 16px;
  padding: 22px;
  border: 1px solid rgba(92, 207, 229, 0.32);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(10, 16, 24, 0.98), rgba(20, 15, 9, 0.97));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.55), inset 0 0 0 1px rgba(255, 255, 255, 0.04);
}

.level-up-modal-head,
.level-up-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.level-up-modal-head h3 {
  margin: 0;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--gold);
  font-size: clamp(30px, 4vw, 54px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.level-up-modal-head span {
  display: inline-block;
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.level-up-summary-grid,
.level-up-choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.level-up-summary-grid article,
.level-up-gains,
.level-up-choice-block,
.level-up-choice {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.level-up-summary-grid article {
  padding: 14px;
  border-color: rgba(92, 207, 229, 0.16);
  background: linear-gradient(145deg, rgba(92, 207, 229, 0.075), rgba(255, 255, 255, 0.035));
}

.level-up-summary-grid span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.level-up-summary-grid strong {
  display: block;
  margin-top: 8px;
  color: var(--text);
}

.level-up-gains,
.level-up-choice-block {
  padding: 16px;
}

.level-up-gains h4,
.level-up-choice-block h4 {
  margin: 0 0 10px;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.level-up-gains li,
.level-up-choice-block p {
  color: var(--muted);
  line-height: 1.5;
}

.level-up-choice {
  min-height: 96px;
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 14px;
  color: var(--text);
  text-align: left;
}

.level-up-choice small {
  color: rgba(223, 231, 238, 0.7);
  font-size: 11px;
  line-height: 1.35;
}

.level-up-choice:hover,
.level-up-choice.is-selected {
  border-color: rgba(215, 168, 79, 0.52);
  background: rgba(215, 168, 79, 0.13);
}

.level-up-choice.is-average {
  border-color: rgba(92, 207, 229, 0.28);
}

.level-up-choice.is-average:hover,
.level-up-choice.is-average.is-selected {
  border-color: rgba(92, 207, 229, 0.55);
  background: rgba(92, 207, 229, 0.12);
}

.level-up-choice span {
  color: var(--muted);
  line-height: 1.45;
}

.level-up-warning {
  padding: 12px;
  border: 1px solid rgba(215, 90, 90, 0.38);
  border-radius: var(--radius);
  color: #ffd1d1;
  background: rgba(215, 90, 90, 0.1);
}

.level-up-warning.is-confirmation {
  border-color: rgba(215, 168, 79, 0.3);
  color: rgba(246, 228, 190, 0.92);
  background: rgba(215, 168, 79, 0.09);
}

.level-up-roll-layer {
  position: fixed;
  inset: 0;
  z-index: 91;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.62);
  backdrop-filter: blur(8px);
}

.level-up-roll-animation {
  width: min(360px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 24px;
  border: 1px solid rgba(215, 168, 79, 0.38);
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(10, 16, 24, 0.98), rgba(24, 17, 10, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  text-align: center;
}

.level-up-roll-die {
  width: 108px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 168, 79, 0.56);
  border-radius: 20px;
  background: radial-gradient(circle at 30% 20%, rgba(255, 238, 180, 0.24), rgba(215, 168, 79, 0.14) 45%, rgba(0, 0, 0, 0.42));
  animation: dieRoll 0.85s ease-in-out;
}

.level-up-roll-die span {
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.level-up-roll-die strong {
  color: var(--gold);
  font-size: 30px;
}

.level-up-roll-animation h3 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 26px;
  text-transform: uppercase;
}

.level-up-roll-animation p:last-child {
  margin: 0;
  color: var(--muted);
}

.level-up-result-layer {
  position: fixed;
  inset: 0;
  z-index: 92;
  display: grid;
  place-items: center;
  padding: 24px;
}

.level-up-result-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.64);
  backdrop-filter: blur(8px);
}

.level-up-result-modal {
  position: relative;
  width: min(460px, calc(100vw - 32px));
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(92, 207, 229, 0.38);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(10, 16, 24, 0.98), rgba(22, 15, 10, 0.98));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.52), inset 0 0 0 1px rgba(255, 255, 255, 0.05);
}

.level-up-result-modal h3 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 32px;
  line-height: 1;
  text-transform: uppercase;
}

.level-up-result-modal p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.level-up-result-modal p strong {
  color: var(--text);
  font-size: 1.15em;
}

.level-up-result-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.level-up-result-grid span {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.05);
}

.level-up-result-grid small {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
}

.level-up-result-grid strong {
  color: var(--gold);
}

.hp-console {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.45fr);
  gap: 16px;
  margin-bottom: 16px;
  padding: 18px;
  border: 1px solid rgba(94, 208, 132, 0.28);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 18% 0%, rgba(94, 208, 132, 0.16), transparent 38%),
    rgba(255, 255, 255, 0.045);
}

.hp-console.is-wounded {
  border-color: rgba(215, 168, 79, 0.38);
  background:
    radial-gradient(circle at 18% 0%, rgba(215, 168, 79, 0.18), transparent 38%),
    rgba(255, 255, 255, 0.045);
}

.hp-console.is-danger {
  border-color: rgba(220, 82, 82, 0.42);
  background:
    radial-gradient(circle at 18% 0%, rgba(220, 82, 82, 0.18), transparent 38%),
    rgba(255, 255, 255, 0.045);
}

.hp-console h2 {
  font-size: clamp(34px, 5vw, 64px);
}

.hp-console p {
  margin: 10px 0 0;
  color: var(--muted);
}

.hp-bar {
  height: 12px;
  overflow: hidden;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.35);
}

.hp-bar span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #4dd67d, #d7a84f);
  box-shadow: 0 0 18px rgba(94, 208, 132, 0.28);
}

.hp-controls {
  display: grid;
  gap: 10px;
}

.hp-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

@keyframes dieRoll {
  0% { transform: rotate(0deg) scale(1); }
  35% { transform: rotate(18deg) scale(1.08); }
  70% { transform: rotate(-14deg) scale(0.96); }
  100% { transform: rotate(0deg) scale(1); }
}

.equipment-board {
  display: grid;
  grid-template-columns: minmax(260px, 0.52fr) minmax(0, 1.48fr);
  gap: 14px;
}

.equipment-board.is-style-disabled {
  grid-template-columns: 1fr;
}

.combat-style-card,
.equip-slot,
.inventory-item-card,
.spell-card,
.prepared-column,
.spell-library {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.combat-style-card {
  padding: 16px;
  border-color: rgba(215, 168, 79, 0.22);
  background:
    linear-gradient(145deg, rgba(215, 168, 79, 0.08), transparent 64%),
    rgba(7, 11, 17, 0.74);
}

.combat-style-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.equipment-message {
  padding: 10px;
  border: 1px solid rgba(215, 168, 79, 0.3);
  border-radius: var(--radius);
  color: var(--text) !important;
  background: rgba(215, 168, 79, 0.1);
}

.inventory-equipment-feedback {
  margin: 0;
  animation: inventoryEquipFeedback 720ms cubic-bezier(.2,.82,.3,1) both;
}

.equip-slot.is-just-equipped {
  animation: inventoryEquipSlot 620ms cubic-bezier(.2,.82,.3,1) both;
}

@keyframes inventoryEquipFeedback {
  0% { opacity: 0; transform: translateY(-7px); box-shadow: 0 0 0 rgba(215, 168, 79, 0); }
  45% { opacity: 1; transform: translateY(0); box-shadow: 0 0 28px rgba(215, 168, 79, 0.2); }
  100% { opacity: 1; transform: translateY(0); box-shadow: 0 0 0 rgba(215, 168, 79, 0); }
}

@keyframes inventoryEquipSlot {
  0% { border-color: rgba(91, 164, 255, 0.2); transform: scale(0.985); }
  45% { border-color: rgba(215, 168, 79, 0.72); transform: scale(1.012); box-shadow: 0 0 30px rgba(215, 168, 79, 0.22); }
  100% { border-color: rgba(91, 164, 255, 0.2); transform: scale(1); box-shadow: none; }
}

.equipment-conflict-layer {
  position: fixed;
  inset: 0;
  z-index: 275;
  display: grid;
  place-items: center;
  padding: 20px;
}

.equipment-conflict-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 42%, rgba(215, 168, 79, 0.13), transparent 34%),
    rgba(0, 0, 0, 0.78);
  backdrop-filter: blur(10px);
}

.equipment-conflict-dialog {
  position: relative;
  width: min(520px, calc(100vw - 32px));
  display: grid;
  justify-items: center;
  gap: 11px;
  padding: 25px;
  border: 1px solid rgba(215, 168, 79, 0.38);
  border-radius: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(215, 168, 79, 0.16), transparent 42%),
    linear-gradient(145deg, rgba(12, 17, 25, 0.99), rgba(5, 8, 12, 0.98));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62), 0 0 36px rgba(215, 168, 79, 0.09);
  text-align: center;
  animation: inventoryConflictIn 190ms ease-out both;
}

.equipment-conflict-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(215, 168, 79, 0.32);
  border-radius: 15px;
  color: var(--gold);
  background: rgba(215, 168, 79, 0.09);
  font-size: 24px;
}

.equipment-conflict-dialog h2 {
  margin: 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
}

.equipment-conflict-dialog > p:not(.eyebrow) {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.equipment-conflict-dialog > p strong {
  color: #f1d39c;
}

.equipment-conflict-actions {
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 5px;
}

@keyframes inventoryConflictIn {
  from { opacity: 0; transform: translateY(10px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.admin-optional-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 16px;
  padding: 15px 16px;
  border: 1px solid rgba(215, 168, 79, 0.22);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(215, 168, 79, 0.07), transparent 58%),
    rgba(255, 255, 255, 0.025);
}

.admin-optional-rule > div {
  display: grid;
  gap: 4px;
}

.admin-optional-rule span {
  color: var(--gold);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-optional-rule strong {
  color: var(--text);
  font-size: 14px;
}

.admin-optional-rule p {
  max-width: 780px;
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

@media (max-width: 700px) {
  .admin-optional-rule {
    align-items: stretch;
    flex-direction: column;
  }
}

.equip-slots {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.equip-slot {
  position: relative;
  min-height: 144px;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 12px;
  overflow: hidden;
  border-color: rgba(91, 164, 255, 0.2);
  background:
    radial-gradient(circle at 100% 0%, rgba(91, 164, 255, 0.14), transparent 38%),
    rgba(7, 11, 17, 0.74);
}

.equip-slot::after {
  content: "";
  position: absolute;
  inset: 8px;
  border: 1px dashed rgba(226, 235, 245, 0.08);
  border-radius: calc(var(--radius) - 6px);
  pointer-events: none;
}

.equip-slot-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(91, 164, 255, 0.22);
  border-radius: 10px;
  color: #9cc8ff;
  background: rgba(91, 164, 255, 0.08);
  font-size: 16px;
}

.equip-slot strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.15;
}

.equip-slot span,
.inventory-item-card span {
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
}

.equip-slot em,
.equip-slot small {
  color: var(--muted);
  line-height: 1.4;
}

.equip-slot > .ghost-button {
  justify-self: start;
  min-height: 30px;
  padding: 6px 9px;
  font-size: 9px;
}

.equip-slot-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.equip-slot-facts em {
  padding: 4px 6px;
  border: 1px solid rgba(215, 168, 79, 0.14);
  border-radius: 999px;
  background: rgba(215, 168, 79, 0.055);
  color: #dcecff;
  font-size: 9px;
  font-style: normal;
}

.inventory-browser {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(91, 164, 255, 0.16);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(91, 164, 255, 0.055), transparent 38%),
    rgba(7, 11, 17, 0.56);
}

.inventory-browser-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
  flex-wrap: wrap;
}

.inventory-browser-head h3 {
  margin: 0;
  color: var(--gold);
  font-size: 17px;
  text-transform: uppercase;
}

.inventory-subtitle {
  margin-top: 18px;
}

.inventory-item-card small {
  color: var(--muted);
}

.inventory-item-card.is-weapon {
  --item-tone: 210, 82, 82;
  border-color: rgba(var(--item-tone), 0.26);
}

.inventory-item-card.is-armor,
.inventory-item-card.is-shield {
  --item-tone: 93, 153, 220;
  border-color: rgba(var(--item-tone), 0.26);
}

.inventory-item-card.is-gear {
  --item-tone: 80, 190, 145;
}

.inventory-item-card.is-manual,
.inventory-item-card.is-manual.is-manual {
  --item-tone: 215, 168, 79;
}

.journal-panel {
  display: grid;
  grid-template-columns: minmax(260px, 0.32fr) minmax(0, 1fr);
  gap: 16px;
}

.journal-sidebar,
.journal-editor,
.journal-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.journal-sidebar {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 16px;
}

.journal-head {
  display: grid;
  gap: 10px;
}

.journal-folders,
.journal-list {
  display: grid;
  gap: 8px;
}

.journal-folder,
.journal-note-row {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.2);
  text-align: left;
}

.journal-folder.is-active,
.journal-note-row.is-active,
.journal-folder:hover,
.journal-note-row:hover {
  border-color: rgba(215, 168, 79, 0.42);
  background: rgba(215, 168, 79, 0.12);
}

.journal-folder small,
.journal-note-row small,
.journal-actions span {
  color: var(--muted);
}

.journal-notes {
  display: grid;
  grid-template-columns: minmax(220px, 0.35fr) minmax(0, 1fr);
  gap: 14px;
}

.journal-list {
  align-content: start;
  max-height: 620px;
  overflow: auto;
  padding: 12px;
}

.journal-editor {
  display: grid;
  gap: 12px;
  padding: 16px;
}

.journal-editor textarea {
  min-height: 360px;
}

.journal-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.journal-folder-name {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  text-transform: uppercase;
}

.sheet-trait-tabs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(128px, 1fr));
  gap: 8px;
  margin: 0 0 16px;
  padding: 8px;
  border: 1px solid rgba(215, 168, 79, 0.16);
  border-radius: 12px;
  background: rgba(4, 8, 13, 0.62);
}

.sheet-trait-tabs button {
  min-height: 42px;
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.035);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-trait-tabs button.is-active,
.sheet-trait-tabs button:hover {
  color: #ffe7b0;
  border-color: rgba(215, 168, 79, 0.44);
  background: linear-gradient(180deg, rgba(215, 168, 79, 0.18), rgba(73, 182, 170, 0.08));
}

.sheet-trait-panel {
  display: grid;
  gap: 14px;
}

.sheet-trait-class-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  padding: 12px 14px;
  border: 1px solid rgba(215, 168, 79, 0.18);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.2);
}

.sheet-trait-class-toolbar div {
  display: grid;
  gap: 3px;
}

.sheet-trait-class-toolbar span,
.sheet-trait-card span,
.sheet-trait-feat-item span,
.sheet-trait-choice-list span,
.sheet-trait-competency-list article span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-trait-class-toolbar strong {
  color: var(--text);
  font-size: 15px;
}

.sheet-trait-class-columns {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, 0.75fr);
  gap: 14px;
  align-items: start;
}

.sheet-trait-class-columns.is-traits-only {
  grid-template-columns: minmax(0, 1fr);
}

.sheet-trait-section-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid rgba(215, 168, 79, 0.22);
  border-radius: 10px;
  background: linear-gradient(145deg, rgba(11, 17, 26, 0.86), rgba(4, 8, 13, 0.82));
  box-shadow: inset 3px 0 0 rgba(215, 168, 79, 0.22);
}

.sheet-trait-section-card.is-spellcasting {
  border-color: rgba(73, 182, 170, 0.28);
  box-shadow: inset 3px 0 0 rgba(73, 182, 170, 0.28);
}

.sheet-trait-section-card > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
}

.sheet-trait-section-card h3,
.sheet-trait-card h4 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-trait-section-card > header p,
.sheet-trait-section-card > p,
.sheet-trait-card p {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.sheet-trait-grid,
.sheet-trait-choice-grid,
.sheet-trait-competency-grid,
.sheet-trait-feat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.sheet-trait-card,
.sheet-power-card.sheet-trait-card {
  --power-tone: 215, 168, 79;
  min-height: 0;
  grid-template-columns: minmax(0, 1fr);
  align-items: stretch;
  gap: 5px;
  padding: 9px 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--power-tone), 0.11), rgba(0, 0, 0, 0.12) 58%),
    rgba(3, 7, 12, 0.64);
  box-shadow: inset 3px 0 rgba(var(--power-tone), 0.42);
}

.sheet-trait-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.sheet-trait-card h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.25;
}

.sheet-trait-essential {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.sheet-trait-mini-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: 12px;
}

.sheet-trait-mini-facts.is-magic-data {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sheet-trait-mini-facts span {
  padding: 9px;
  border: 1px solid rgba(73, 182, 170, 0.18);
  border-radius: 8px;
  color: var(--muted);
  background: rgba(73, 182, 170, 0.07);
  font-size: 11px;
  text-transform: uppercase;
}

.sheet-trait-mini-facts strong {
  display: block;
  margin-top: 3px;
  color: #a7f0e8;
  font-size: 16px;
}

.sheet-trait-detail-button {
  --power-tone: 215, 168, 79;
  width: 28px;
  height: 28px;
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid rgba(215, 168, 79, 0.36);
  border-radius: 8px;
  color: #ffd98a;
  background: rgba(215, 168, 79, 0.12);
}

.sheet-trait-detail-button:hover,
.sheet-trait-detail-button:focus-visible {
  border-color: rgba(215, 168, 79, 0.64);
  background: rgba(215, 168, 79, 0.2);
}

.sheet-trait-feat-list,
.sheet-trait-choice-list,
.sheet-trait-competency-list {
  display: grid;
  gap: 10px;
}

.sheet-trait-feat-item,
.sheet-trait-choice-list div,
.sheet-trait-competency-list article {
  display: grid;
  gap: 6px;
  padding: 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
}

.sheet-trait-feat-item {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.sheet-trait-feat-item strong,
.sheet-trait-choice-list strong,
.sheet-trait-competency-list article strong {
  color: var(--text);
  line-height: 1.35;
}

.sheet-trait-feat-item small,
.sheet-trait-competency-list article p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sheet-trait-choice-modal-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.sheet-trait-choice-dialog {
  width: min(980px, calc(100vw - 32px));
}

.sheet-trait-detail-copy {
  overflow-wrap: anywhere;
}

@media (max-width: 900px) {
  .sheet-trait-class-columns {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .sheet-trait-tabs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
    padding: 7px;
  }

  .sheet-trait-tabs button {
    min-height: 38px;
    padding: 7px 6px;
    font-size: 10px;
    letter-spacing: 0.04em;
  }

  .sheet-trait-class-toolbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
  }

  .sheet-trait-class-toolbar .ghost-button {
    width: 100%;
  }

  .sheet-trait-grid,
  .sheet-trait-choice-grid,
  .sheet-trait-competency-grid,
  .sheet-trait-feat-grid,
  .sheet-trait-choice-modal-body {
    grid-template-columns: 1fr;
  }

  .sheet-trait-section-card {
    padding: 12px;
  }

  .sheet-trait-section-card > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .sheet-trait-card {
    min-height: 0;
  }

  .sheet-trait-choice-dialog {
    width: min(100%, calc(100vw - 16px));
  }
}

.sheet-level-choice-panel,
.sheet-progression-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 15% 0%, rgba(215, 168, 79, 0.12), transparent 34%),
    rgba(255, 255, 255, 0.045);
}

.sheet-level-choice-panel > header,
.sheet-progression-panel > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.sheet-level-choice-panel h3,
.sheet-progression-panel h3 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sheet-level-choice-block {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(0, 0, 0, 0.18);
}

.sheet-level-choice-block h4 {
  margin: 0;
  color: var(--gold);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sheet-level-choice-block p {
  margin: 0;
  color: var(--muted);
}

.sheet-level-choice-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
}

.sheet-progression-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.sheet-progression-list article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.18);
}

.sheet-progression-list span {
  display: block;
  margin-bottom: 7px;
  color: var(--gold);
  font-size: 11px;
  text-transform: uppercase;
}

.sheet-choice-current {
  padding: 8px 10px;
  border: 1px solid rgba(215, 168, 79, 0.24);
  border-radius: 10px;
  background: rgba(215, 168, 79, 0.08);
}

.sheet-feat-skill-choice {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.sheet-feat-skill-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 10px;
}

.sheet-feature-detail-panel {
  display: grid;
  gap: 14px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(91, 164, 255, 0.24);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 82% 0%, rgba(91, 164, 255, 0.11), transparent 32%),
    rgba(255, 255, 255, 0.04);
}

.sheet-class-choice-snapshot {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding: 16px;
  border: 1px solid rgba(215, 168, 79, 0.25);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 8% 0%, rgba(215, 168, 79, 0.13), transparent 32%),
    rgba(255, 255, 255, 0.035);
}

.sheet-class-choice-snapshot > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.sheet-class-choice-snapshot h3 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sheet-class-choice-pills {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.sheet-class-choice-pills article {
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 13px;
  background: rgba(0, 0, 0, 0.2);
}

.sheet-class-choice-pills span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sheet-class-choice-pills strong {
  color: var(--text);
  font-size: 13px;
  line-height: 1.35;
}

.sheet-feature-detail-panel > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
}

.sheet-feature-detail-panel h3 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.sheet-feature-detail-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 12px;
}

.sheet-feature-detail-card {
  display: grid;
  gap: 10px;
  padding: 14px;
  border: 1px solid rgba(91, 164, 255, 0.22);
  border-radius: 14px;
  background: rgba(4, 10, 17, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.sheet-feature-detail-card summary {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  cursor: pointer;
  list-style: none;
}

.sheet-feature-detail-card summary::-webkit-details-marker {
  display: none;
}

.sheet-feature-detail-card summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border: 1px solid rgba(215, 168, 79, 0.26);
  border-radius: 9px;
  color: var(--gold);
  background: rgba(255, 255, 255, 0.05);
  font-weight: 900;
}

.sheet-feature-detail-card[open] summary::after {
  content: "-";
}

.sheet-feature-detail-card.is-feature {
  border-color: rgba(215, 168, 79, 0.28);
  background: linear-gradient(135deg, rgba(215, 168, 79, 0.09), rgba(4, 10, 17, 0.62));
}

.sheet-feature-detail-card.is-subclass {
  border-color: rgba(119, 232, 185, 0.24);
  background: linear-gradient(135deg, rgba(119, 232, 185, 0.08), rgba(4, 10, 17, 0.62));
}

.sheet-feature-detail-card.is-technique {
  border-color: rgba(91, 164, 255, 0.32);
  background: linear-gradient(135deg, rgba(91, 164, 255, 0.09), rgba(4, 10, 17, 0.62));
}

.sheet-feature-detail-card summary span {
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sheet-feature-detail-card h4 {
  margin: 4px 0 0;
  color: var(--text);
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.sheet-feature-detail-copy {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.sheet-feature-detail-copy p,
.sheet-feature-detail-copy ul {
  margin: 0 0 8px;
}

.sheet-feature-detail-copy table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

.sheet-feature-detail-copy th,
.sheet-feature-detail-copy td {
  padding: 7px;
  border: 1px solid var(--line);
}

.warrior-martial-panel {
  margin-top: 18px;
  padding: 18px;
  border: 1px solid rgba(215, 168, 79, 0.3);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0%, rgba(215, 168, 79, 0.16), transparent 34%),
    linear-gradient(135deg, rgba(10, 14, 20, 0.94), rgba(5, 8, 12, 0.88));
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32), inset 0 0 24px rgba(215, 168, 79, 0.06);
}

.warrior-martial-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.warrior-martial-panel h3,
.warrior-selection-card h4 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.warrior-domain-strip {
  min-width: 190px;
  padding: 12px 16px;
  border: 1px solid rgba(215, 168, 79, 0.34);
  border-radius: 16px;
  background: rgba(10, 12, 16, 0.68);
  text-align: right;
}

.warrior-domain-strip span,
.warrior-domain-strip small,
.warrior-selection-card span,
.warrior-technique-list small {
  display: block;
  color: var(--muted);
}

.warrior-domain-strip strong {
  display: block;
  margin: 4px 0;
  color: #ffd778;
  font-size: 26px;
  letter-spacing: 0.14em;
}

.warrior-selection-grid {
  display: grid;
  grid-template-columns: minmax(220px, 0.8fr) minmax(280px, 1.2fr);
  gap: 14px;
}

.warrior-selection-card {
  min-height: 150px;
  padding: 16px;
  border: 1px solid rgba(91, 164, 255, 0.18);
  border-radius: 16px;
  background: linear-gradient(145deg, rgba(13, 20, 30, 0.78), rgba(8, 10, 15, 0.82));
}

.warrior-selection-card.is-style {
  border-color: rgba(215, 168, 79, 0.34);
  box-shadow: inset 0 0 22px rgba(215, 168, 79, 0.06);
}

.warrior-selection-card.is-techniques {
  border-color: rgba(91, 164, 255, 0.3);
  box-shadow: inset 0 0 22px rgba(91, 164, 255, 0.06);
}

.warrior-selection-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.warrior-selection-card-head > div {
  min-width: 0;
}

.warrior-technique-picker-open {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 7px 10px;
  border-color: rgba(215, 168, 79, 0.34);
  color: #ffe7b0;
  background: rgba(215, 168, 79, 0.1);
  font-size: 11px;
}

.warrior-selection-card p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

.warrior-technique-list {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.warrior-technique-list article {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(91, 164, 255, 0.16);
  border-radius: 12px;
  background: rgba(7, 11, 18, 0.58);
}

.warrior-technique-row-main {
  min-width: 0;
}

.warrior-technique-eye {
  --power-tone: 91, 164, 255;
}

.warrior-technique-picker-dialog {
  width: min(940px, calc(100vw - 32px));
}

.warrior-technique-picker-body {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.warrior-technique-picker-option {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid rgba(91, 164, 255, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(91, 164, 255, 0.1), rgba(0, 0, 0, 0.06) 62%),
    rgba(7, 11, 18, 0.62);
}

.warrior-technique-picker-option.is-selected {
  border-color: rgba(215, 168, 79, 0.44);
  box-shadow: inset 3px 0 rgba(215, 168, 79, 0.5);
}

.warrior-technique-picker-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.warrior-technique-picker-main span,
.warrior-technique-picker-main small {
  color: var(--muted);
  font-size: 11px;
}

.warrior-technique-picker-main strong {
  color: var(--text);
  font-size: 13px;
}

.warrior-technique-toggle {
  min-height: 32px;
  padding: 6px 10px;
  font-size: 11px;
}

.level-up-choice-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.level-up-choice-grid.is-two-columns {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.inventory-items {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}

.inventory-items-overview {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
}

.inventory-items.compact {
  grid-template-columns: 1fr;
}

.inventory-item-card {
  --item-tone: 142, 154, 169;
  min-height: 112px;
  display: grid;
  align-content: start;
  gap: 7px;
  padding: 12px;
  overflow: hidden;
  background:
    radial-gradient(circle at 0% 0%, rgba(var(--item-tone), 0.12), transparent 38%),
    rgba(7, 11, 17, 0.72);
  box-shadow: inset 3px 0 0 rgba(var(--item-tone), 0.32);
}

.inventory-item-card:not(.is-manual) {
  cursor: grab;
}

.inventory-item-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.inventory-category-windows {
  display: grid;
  gap: 12px;
}

.inventory-category-window {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.inventory-category-window header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.inventory-category-window h3 {
  margin: 0;
}

.custom-item-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 8px;
  align-items: end;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.inventory-notes {
  margin-top: 14px;
}

.inventory-quick-create {
  display: grid;
  grid-template-columns: minmax(180px, 0.45fr) minmax(160px, 0.7fr) minmax(180px, 1fr) auto;
  gap: 9px;
  align-items: end;
  padding-top: 12px;
  border-top: 1px solid rgba(215, 168, 79, 0.13);
}

.inventory-quick-create strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.inventory-notes-card {
  padding: 12px 14px;
  border: 1px solid rgba(215, 168, 79, 0.15);
  border-radius: 12px;
  background: rgba(7, 11, 17, 0.58);
}

.inventory-notes-card p:last-child {
  margin: 4px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.spell-prep {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 14px;
  margin-top: 16px;
}

.always-prepared-panel {
  display: grid;
  gap: 12px;
  margin-top: 16px;
  padding: 16px;
  border: 1px solid rgba(215, 168, 79, 0.32);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 12% 0%, rgba(215, 168, 79, 0.14), transparent 34%),
    linear-gradient(135deg, rgba(15, 19, 28, 0.9), rgba(5, 8, 12, 0.84));
  box-shadow: inset 0 0 24px rgba(215, 168, 79, 0.06);
}

.always-prepared-panel > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.always-prepared-panel h3 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.always-prepared-panel > p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.always-prepared-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}

.always-prepared-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(91, 164, 255, 0.2);
  border-radius: 16px;
  background: rgba(7, 11, 18, 0.58);
}

.always-prepared-group h4 {
  margin: 0;
  color: #9edbff;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.always-prepared-group > div {
  display: grid;
  gap: 8px;
}

.always-prepared-spell {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(215, 168, 79, 0.2);
  border-radius: 12px;
  background: rgba(215, 168, 79, 0.07);
}

.always-prepared-spell strong {
  color: var(--text);
}

.always-prepared-spell small {
  color: var(--muted);
}

.prepared-column,
.spell-library {
  padding: 14px;
}

.spell-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.prepared-list,
.spell-list {
  display: grid;
  gap: 10px;
}

.prepared-subsection {
  display: grid;
  gap: 8px;
  padding: 10px;
  border-radius: 13px;
  border: 1px solid rgba(91, 164, 255, 0.2);
  background:
    radial-gradient(circle at 8% 0%, rgba(91, 164, 255, 0.12), transparent 34%),
    rgba(4, 10, 18, 0.58);
}

.prepared-subsection h4 {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.prepared-subsection.is-always-prepared {
  border-color: rgba(215, 168, 79, 0.34);
  background:
    radial-gradient(circle at 8% 0%, rgba(215, 168, 79, 0.16), transparent 34%),
    rgba(20, 14, 6, 0.52);
}

.prepared-subsection.is-manifestations {
  border-color: rgba(73, 182, 170, 0.34);
  background:
    radial-gradient(circle at 8% 0%, rgba(73, 182, 170, 0.16), transparent 34%),
    rgba(4, 18, 18, 0.52);
}

.prepared-subsection.is-modules {
  border-color: rgba(77, 214, 164, 0.36);
  background:
    radial-gradient(circle at 8% 0%, rgba(77, 214, 164, 0.18), transparent 34%),
    rgba(3, 20, 14, 0.54);
}

.manifestation-strip {
  display: grid;
  gap: 10px;
  margin: 14px 0;
  padding: 12px;
  border: 1px solid rgba(73, 182, 170, 0.28);
  border-radius: var(--radius);
  background: rgba(73, 182, 170, 0.07);
}

.manifestation-strip h4 {
  color: var(--gold);
  font-size: 13px;
  text-transform: uppercase;
}

.manifestation-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.spell-library {
  display: grid;
  gap: 16px;
  max-height: 760px;
  overflow: auto;
}

.spell-library-section.is-manifestations {
  padding: 10px;
  border: 1px solid rgba(73, 182, 170, 0.25);
  border-radius: 14px;
  background:
    radial-gradient(circle at 10% 0%, rgba(73, 182, 170, 0.11), transparent 36%),
    rgba(4, 15, 18, 0.48);
}

.spell-library h3 {
  margin-bottom: 8px;
  color: var(--gold);
}

.spell-card {
  display: grid;
  gap: 8px;
  padding: 12px;
  cursor: grab;
}

.spell-card.is-prepared {
  border-color: rgba(73, 182, 170, 0.42);
  background: rgba(73, 182, 170, 0.1);
}

.spell-card.is-permanent {
  cursor: default;
}

.spell-card header {
  display: grid;
  gap: 4px;
}

.spell-card header span,
.spell-card small {
  color: var(--muted);
  line-height: 1.4;
}

.spell-card p {
  margin: 0;
  line-height: 1.45;
}

/* Compact sheet rules: readable rows instead of oversized disclosure cards. */
.sheet-class-system-overview {
  display: grid;
  gap: 8px;
  padding: 10px 12px;
  border-left: 2px solid rgba(215, 168, 79, 0.58);
  background: linear-gradient(90deg, rgba(215, 168, 79, 0.08), transparent 72%);
}

.sheet-class-system-overview section {
  display: grid;
  grid-template-columns: auto minmax(170px, 0.32fr) minmax(0, 1fr);
  gap: 10px;
  align-items: start;
}

.sheet-class-system-overview span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.sheet-class-system-overview strong {
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-class-system-overview div {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.45;
}

.sheet-class-system-overview div > :first-child,
.sheet-class-system-overview div > :last-child {
  margin-top: 0;
  margin-bottom: 0;
}

.sheet-feature-row-list {
  display: grid;
  gap: 8px;
}

.sheet-feature-row {
  display: grid;
  grid-template-columns: minmax(170px, 0.28fr) minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 11px 13px;
  border: 1px solid rgba(91, 164, 255, 0.2);
  border-radius: 11px;
  background: rgba(4, 10, 17, 0.54);
  box-shadow: inset 3px 0 rgba(91, 164, 255, 0.28);
}

.sheet-feature-row.is-feature,
.sheet-feature-row.is-feat {
  border-color: rgba(215, 168, 79, 0.22);
  box-shadow: inset 3px 0 rgba(215, 168, 79, 0.52);
}

.sheet-feature-row.is-subclass {
  border-color: rgba(119, 232, 185, 0.22);
  box-shadow: inset 3px 0 rgba(119, 232, 185, 0.46);
}

.sheet-feature-row.is-technique {
  border-color: rgba(91, 164, 255, 0.28);
  box-shadow: inset 3px 0 rgba(91, 164, 255, 0.52);
}

.sheet-feature-row-meta {
  min-width: 0;
}

.sheet-feature-row-meta span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.sheet-feature-row-meta h4 {
  margin: 0;
  color: var(--text);
  font-size: 13px;
  line-height: 1.3;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-feature-row .sheet-feature-detail-copy {
  font-size: 12px;
  line-height: 1.45;
}

.sheet-feature-row .sheet-feature-detail-copy > :last-child {
  margin-bottom: 0;
}

.sheet-compact-rule-list {
  display: grid;
  gap: 7px;
}

.sheet-compact-rule-list article {
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.18);
}

.sheet-compact-rule-list article > span {
  display: block;
  margin-bottom: 4px;
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.sheet-compact-rule-list p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.always-prepared-list {
  display: grid;
  gap: 8px;
}

.always-prepared-group {
  grid-template-columns: 170px minmax(0, 1fr);
  align-items: start;
  padding: 10px 12px;
  border-radius: 11px;
}

.always-prepared-group > div {
  gap: 6px;
}

.always-prepared-spell {
  grid-template-columns: minmax(190px, 0.34fr) minmax(0, 1fr);
  align-items: center;
  padding: 8px 10px;
  border-radius: 9px;
}

.always-prepared-spell p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.4;
}

.spell-card {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  min-height: 0;
  padding: 10px 12px;
  border-radius: 11px;
}

.spell-card.is-manifestation-library,
.spell-card.is-manifestation-prepared {
  border-color: rgba(73, 182, 170, 0.3);
  background:
    linear-gradient(90deg, rgba(73, 182, 170, 0.11), rgba(4, 9, 14, 0.64));
}

.spell-card-title {
  min-width: 0;
}

.spell-card-title strong {
  color: var(--text);
  font-size: 13px;
}

.spell-card-title span {
  font-size: 10px;
}

.spell-card-copy {
  min-width: 0;
}

.spell-card-copy p {
  color: var(--text);
  font-size: 12px;
}

.spell-card-copy small {
  display: block;
  margin-top: 3px;
  font-size: 10px;
}

.spell-card-action {
  display: flex;
  justify-content: flex-end;
}

.sheet-power-panel {
  gap: 12px;
}

.sheet-power-prep .spell-library .sheet-power-grid,
.sheet-power-prep .prepared-list .sheet-power-grid {
  grid-template-columns: 1fr;
}

.sheet-power-prep .spell-library-section {
  display: grid;
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(91, 164, 255, 0.2);
  border-radius: 14px;
  background:
    radial-gradient(circle at 10% 0%, rgba(91, 164, 255, 0.1), transparent 36%),
    rgba(4, 9, 14, 0.5);
}

.sheet-power-prep .spell-library-section.is-preparable {
  border-color: rgba(142, 118, 255, 0.25);
  background:
    radial-gradient(circle at 10% 0%, rgba(142, 118, 255, 0.13), transparent 36%),
    rgba(7, 7, 18, 0.5);
}

.sheet-power-prep .spell-library-section.is-commands,
.sheet-power-prep .spell-library-section.is-techniques {
  border-color: rgba(220, 89, 79, 0.22);
  background:
    radial-gradient(circle at 10% 0%, rgba(220, 89, 79, 0.1), transparent 36%),
    rgba(18, 5, 5, 0.42);
}

.sheet-power-prep .spell-library-section.is-modules {
  border-color: rgba(77, 214, 164, 0.3);
  background:
    radial-gradient(circle at 10% 0%, rgba(77, 214, 164, 0.15), transparent 36%),
    rgba(3, 18, 13, 0.5);
}

.sheet-power-choice-panel,
.sheet-power-library-panel {
  display: grid;
  gap: 12px;
  padding: 13px;
  border: 1px solid rgba(91, 164, 255, 0.2);
  border-radius: 14px;
  background:
    radial-gradient(circle at 16% 0%, rgba(91, 164, 255, 0.08), transparent 34%),
    rgba(3, 8, 14, 0.58);
}

.sheet-power-choice-panel.is-required {
  border-color: rgba(215, 168, 79, 0.38);
  box-shadow: inset 0 0 0 1px rgba(215, 168, 79, 0.08), 0 0 24px rgba(215, 168, 79, 0.08);
}

.sheet-power-choice-panel > header,
.sheet-power-library-panel > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 14px;
}

.sheet-power-choice-panel h3,
.sheet-power-library-panel h3 {
  margin: 0;
  color: var(--text);
  font-size: 14px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-power-choice-panel p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.sheet-power-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.sheet-power-card {
  --power-tone: 91, 164, 255;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  min-height: 72px;
  padding: 10px 11px;
  border: 1px solid rgba(var(--power-tone), 0.22);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(var(--power-tone), 0.11), rgba(0, 0, 0, 0.12) 58%),
    rgba(3, 7, 12, 0.64);
  box-shadow: inset 3px 0 rgba(var(--power-tone), 0.46);
}

.sheet-power-card.is-manifestation {
  --power-tone: 99, 224, 213;
}

.sheet-power-card.is-module {
  --power-tone: 77, 214, 164;
}

.sheet-power-card.is-formula {
  --power-tone: 215, 168, 79;
}

.sheet-power-card.is-spell {
  --power-tone: 142, 118, 255;
}

.sheet-power-card.is-command,
.sheet-power-card.is-technique {
  --power-tone: 220, 89, 79;
}

.sheet-power-card.is-selected {
  border-color: rgba(var(--power-tone), 0.58);
  background:
    linear-gradient(135deg, rgba(var(--power-tone), 0.21), rgba(0, 0, 0, 0.14) 62%),
    rgba(8, 15, 22, 0.82);
}

.sheet-power-card-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.sheet-power-card-main span,
.sheet-power-card-main small {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.sheet-power-card-main strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sheet-power-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.sheet-power-select-button {
  min-height: 28px;
  padding: 5px 8px;
  border-radius: 8px;
  font-size: 9px;
}

.sheet-power-library-group {
  display: grid;
  gap: 8px;
}

.sheet-power-library-group h4 {
  margin: 4px 0 0;
  color: var(--gold);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.mobile-magic-panel,
.mobile-martial-panel {
  display: grid;
  gap: 12px;
}

.mobile-magic-title {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
}

.mobile-magic-title h2 {
  margin: 0;
  color: var(--text);
  font-size: 18px;
  line-height: 1.15;
  letter-spacing: 0;
}

.mobile-magic-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mobile-magic-stat {
  min-width: 0;
  min-height: 68px;
  display: grid;
  align-content: center;
  gap: 4px;
  padding: 8px 6px;
  border: 1px solid rgba(215, 168, 79, 0.18);
  border-radius: 8px;
  background: rgba(9, 13, 19, 0.76);
  text-align: center;
}

.mobile-magic-stat span {
  overflow-wrap: anywhere;
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.mobile-magic-stat strong {
  color: #ffe7b0;
  font-size: 17px;
  line-height: 1.05;
}

.mobile-magic-section {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(7, 11, 17, 0.72);
}

.mobile-magic-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mobile-magic-section h3 {
  margin: 0;
  color: var(--gold);
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: 0.1em;
}

.mobile-magic-section header span {
  display: inline-block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
}

.mobile-magic-section header button {
  min-height: 34px;
  flex: 0 0 auto;
  padding: 6px 9px;
  border: 1px solid rgba(215, 168, 79, 0.34);
  border-radius: 8px;
  color: #ffe7b0;
  background: rgba(215, 168, 79, 0.12);
  font-size: 10px;
  font-weight: 900;
}

.mobile-magic-ready-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(142px, 1fr));
  gap: 8px;
}

.mobile-magic-ready-card,
.mobile-magic-empty {
  --power-tone: 91, 164, 255;
  min-width: 0;
  display: grid;
  gap: 5px;
  padding: 9px;
  border: 1px solid rgba(var(--power-tone), 0.24);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--power-tone), 0.13), rgba(0, 0, 0, 0.08) 62%),
    rgba(4, 14, 17, 0.58);
  box-shadow: inset 3px 0 rgba(var(--power-tone), 0.52);
}

.mobile-magic-ready-card.is-manifestation,
.mobile-power-picker-option.is-manifestation {
  --power-tone: 99, 224, 213;
}

.mobile-magic-ready-card.is-spell,
.mobile-power-picker-option.is-spell {
  --power-tone: 142, 118, 255;
}

.mobile-magic-ready-card.is-module,
.mobile-power-picker-option.is-module {
  --power-tone: 77, 214, 164;
}

.mobile-magic-ready-card.is-formula,
.mobile-power-picker-option.is-formula {
  --power-tone: 215, 168, 79;
}

.mobile-magic-ready-card.is-command,
.mobile-magic-ready-card.is-technique,
.mobile-power-picker-option.is-command,
.mobile-power-picker-option.is-technique {
  --power-tone: 220, 89, 79;
}

.mobile-magic-entry-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 7px;
  align-items: center;
}

.mobile-magic-ready-card strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.25;
}

.mobile-magic-entry-meta {
  color: rgba(244, 239, 228, 0.72);
  font-size: 10px;
  line-height: 1.35;
}

.mobile-magic-detail-button {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--power-tone), 0.36);
  border-radius: 8px;
  color: rgb(var(--power-tone));
  background: rgba(var(--power-tone), 0.12);
}

.mobile-magic-detail-button:hover,
.mobile-magic-detail-button:focus-visible {
  border-color: rgba(var(--power-tone), 0.64);
  background: rgba(var(--power-tone), 0.2);
}

.mobile-eye-icon {
  position: relative;
  width: 17px;
  height: 11px;
  border: 2px solid currentColor;
  border-radius: 50%;
}

.mobile-eye-icon::after {
  content: "";
  position: absolute;
  inset: 2px 5px;
  border-radius: 50%;
  background: currentColor;
}

.mobile-magic-empty {
  color: var(--muted);
  font-size: 12px;
}

.mobile-power-picker-layer {
  position: fixed;
  inset: 0;
  z-index: 275;
  display: grid;
  place-items: center;
  padding: 8px;
}

.mobile-power-picker-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(4px);
}

.mobile-power-picker-dialog {
  position: relative;
  width: min(760px, 100%);
  max-width: calc(100vw - 16px);
  max-height: min(760px, calc(100vh - 16px));
  max-height: min(760px, calc(100dvh - 16px));
  overflow: hidden;
  overflow-x: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: 10px;
  background: rgba(8, 12, 18, 0.98);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58);
}

.mobile-power-picker-dialog > header {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 10px;
  border-bottom: 1px solid rgba(215, 168, 79, 0.16);
}

.mobile-power-picker-dialog > header > div {
  min-width: 0;
}

.mobile-power-picker-dialog h2 {
  margin: 0;
  color: var(--text);
  font-size: 17px;
  line-height: 1.15;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.mobile-power-picker-columns {
  min-height: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  overflow: hidden;
}

.mobile-power-picker-column {
  min-height: 0;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 8px;
  padding: 8px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.03);
}

.mobile-power-picker-column h3 {
  position: sticky;
  top: -8px;
  z-index: 1;
  margin: -8px -8px 0;
  padding: 8px;
  color: var(--gold);
  background: rgba(8, 12, 18, 0.98);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.mobile-power-picker-option {
  --power-tone: 91, 164, 255;
  min-width: 0;
  display: grid;
  gap: 5px;
  align-items: start;
  padding: 8px;
  border: 1px solid rgba(var(--power-tone), 0.22);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(var(--power-tone), 0.1), rgba(0, 0, 0, 0.08) 62%),
    rgba(4, 14, 17, 0.48);
  box-shadow: inset 3px 0 rgba(var(--power-tone), 0.42);
}

.mobile-power-picker-option-head {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px 34px;
  gap: 7px;
  align-items: center;
}

.mobile-power-picker-option strong {
  display: block;
  color: var(--text);
  font-size: 12px;
  line-height: 1.2;
}

.mobile-power-picker-move {
  width: 34px;
  height: 34px;
  border: 1px solid rgba(215, 168, 79, 0.34);
  border-radius: 8px;
  color: #ffe7b0;
  background: rgba(215, 168, 79, 0.12);
  font-size: 18px;
  font-weight: 900;
}

.mobile-power-picker-move:disabled {
  opacity: 0.42;
}

.sheet-power-detail-layer {
  position: fixed;
  inset: 0;
  z-index: 265;
  display: grid;
  place-items: center;
  padding: 20px;
}

.sheet-power-detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(1, 4, 8, 0.78);
  backdrop-filter: blur(10px);
  cursor: default;
}

.sheet-power-detail-dialog {
  position: relative;
  width: min(820px, calc(100vw - 32px));
  max-height: min(780px, calc(100vh - 40px));
  overflow: hidden;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  padding: 20px;
  border: 1px solid rgba(215, 168, 79, 0.34);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(91, 164, 255, 0.12), transparent 38%),
    linear-gradient(180deg, rgba(11, 16, 24, 0.99), rgba(4, 8, 13, 0.99));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.68), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  animation: identityPromptIn 180ms ease-out;
}

.sheet-power-detail-dialog > header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(215, 168, 79, 0.18);
}

.sheet-power-detail-dialog h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.sheet-power-detail-dialog header span {
  display: inline-block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.sheet-power-detail-copy {
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
  color: var(--muted);
  font-size: 13px;
  line-height: 1.62;
}

.sheet-power-detail-copy p {
  margin: 0 0 10px;
}

.sheet-power-detail-copy strong {
  color: #f2d184;
}

@media (max-width: 640px) {
  .sheet-power-detail-layer {
    padding: 8px;
    place-items: center;
  }

  .sheet-power-detail-dialog {
    width: min(100%, calc(100vw - 16px));
    max-width: calc(100vw - 16px);
    height: calc(100dvh - 16px);
    max-height: calc(100dvh - 16px);
    overflow-x: hidden;
    padding: 12px;
    border-radius: 12px;
  }

  .sheet-power-detail-dialog > header {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
  }

  .sheet-power-detail-dialog > header > div,
  .sheet-power-detail-dialog h2,
  .sheet-power-detail-copy {
    min-width: 0;
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .sheet-power-detail-dialog h2 {
    font-size: 18px;
    letter-spacing: 0;
  }

  .sheet-power-detail-copy {
    padding: 10px;
  }
}

.inventory-item-card {
  min-height: 0;
  gap: 8px;
  padding: 11px;
}

.inventory-item-heading {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.inventory-item-heading > div {
  min-width: 0;
}

.inventory-item-heading-actions {
  display: flex;
  flex: 0 0 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 6px;
}

.inventory-item-icon {
  width: 34px;
  height: 34px;
  display: grid !important;
  place-items: center;
  border: 1px solid rgba(var(--item-tone), 0.22);
  border-radius: 10px;
  color: #f4ddb2 !important;
  background: rgba(var(--item-tone), 0.08);
  font-size: 16px !important;
}

.inventory-item-heading strong,
.inventory-item-heading span {
  display: block;
}

.inventory-item-quantity {
  width: fit-content;
  margin-top: 5px;
  padding: 2px 7px;
  border: 1px solid rgba(var(--item-tone), 0.2);
  border-radius: 999px;
  color: #dcecff !important;
  background: rgba(var(--item-tone), 0.08);
  font-size: 9px !important;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.inventory-detail-button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(215, 168, 79, 0.3);
  border-radius: 8px;
  color: var(--gold);
  background: rgba(215, 168, 79, 0.08);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.inventory-detail-button:hover {
  border-color: rgba(215, 168, 79, 0.58);
  background: rgba(215, 168, 79, 0.15);
}

.inventory-card-detail-button {
  justify-self: start;
  margin-top: 1px;
}

.inventory-delete-button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(220, 89, 79, 0.34);
  border-radius: 8px;
  color: #f0a29a;
  background: rgba(145, 38, 33, 0.1);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.inventory-delete-button:hover {
  border-color: rgba(240, 120, 108, 0.68);
  background: rgba(169, 48, 40, 0.2);
}

.inventory-delete-button.is-prominent {
  min-height: 36px;
  padding-inline: 14px;
}

.inventory-discard-button {
  flex: 0 0 auto;
  min-height: 28px;
  padding: 5px 8px;
  border: 1px solid rgba(215, 168, 79, 0.26);
  border-radius: 8px;
  color: #f1d39c;
  background: rgba(215, 168, 79, 0.075);
  font-size: 9px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.inventory-discard-button:hover {
  border-color: rgba(215, 168, 79, 0.58);
  background: rgba(215, 168, 79, 0.14);
}

.inventory-mechanic-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.inventory-mechanic-strip > span {
  display: grid;
  gap: 2px;
  min-width: 100px;
  padding: 6px 8px;
  border: 1px solid rgba(91, 164, 255, 0.18);
  border-radius: 8px;
  background: rgba(91, 164, 255, 0.06);
}

.inventory-mechanic-strip small {
  color: var(--muted);
  font-size: 8px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.inventory-mechanic-strip strong {
  color: #dcecff;
  font-size: 11px;
  line-height: 1.25;
}

.inventory-detail-layer {
  position: fixed;
  inset: 0;
  z-index: 260;
  display: grid;
  place-items: center;
  padding: 20px;
}

.inventory-detail-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(1, 4, 8, 0.78);
  backdrop-filter: blur(10px);
  cursor: default;
}

.inventory-detail-dialog {
  position: relative;
  width: min(760px, calc(100vw - 32px));
  max-height: min(760px, calc(100vh - 40px));
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(215, 168, 79, 0.34);
  border-radius: 18px;
  background:
    radial-gradient(circle at 12% 0%, rgba(215, 168, 79, 0.12), transparent 36%),
    linear-gradient(180deg, rgba(11, 16, 24, 0.99), rgba(4, 8, 13, 0.99));
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.68), inset 0 0 0 1px rgba(255, 255, 255, 0.035);
  animation: identityPromptIn 180ms ease-out;
}

.inventory-detail-dialog > header {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: start;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(215, 168, 79, 0.18);
}

.inventory-detail-dialog h2 {
  margin: 2px 0 0;
  color: var(--text);
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.inventory-detail-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.inventory-detail-title-line > span {
  padding: 5px 8px;
  border: 1px solid rgba(215, 168, 79, 0.3);
  border-radius: 999px;
  color: #f0cc7d;
  background: rgba(215, 168, 79, 0.09);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.inventory-detail-close {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 11px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.045);
  font-size: 23px;
  line-height: 1;
  cursor: pointer;
}

.inventory-detail-facts,
.inventory-detail-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 8px;
  margin-top: 14px;
}

.inventory-detail-facts > div,
.inventory-detail-fields > div {
  display: grid;
  gap: 4px;
  padding: 10px;
  border: 1px solid rgba(91, 164, 255, 0.16);
  border-radius: 10px;
  background: rgba(91, 164, 255, 0.055);
}

.inventory-detail-fields > div.is-full {
  grid-column: 1 / -1;
}

.inventory-detail-facts span,
.inventory-detail-fields span {
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.inventory-detail-facts strong,
.inventory-detail-fields strong {
  color: var(--text);
  font-size: 12px;
  line-height: 1.4;
}

.inventory-detail-copy {
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.22);
}

.inventory-detail-copy h3 {
  margin: 0 0 8px;
  color: var(--gold);
  font-size: 12px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.inventory-detail-copy p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.6;
}

.inventory-detail-admin-actions {
  display: flex;
  justify-content: flex-end;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid rgba(220, 89, 79, 0.16);
}

@media (max-width: 760px) {
  .sheet-class-system-overview section,
  .sheet-feature-row,
  .always-prepared-group,
  .always-prepared-spell,
  .spell-card,
  .sheet-power-card {
    grid-template-columns: 1fr;
  }

  .sheet-power-grid {
    grid-template-columns: 1fr;
  }

  .spell-card-action {
    justify-content: flex-start;
  }

  .sheet-power-actions {
    justify-content: flex-start;
  }
}

.shop-screen {
  min-height: calc(100vh - 128px);
  display: grid;
  gap: 18px;
}

.shop-hero {
  min-height: 430px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 18px;
  align-items: end;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(12, 16, 21, 0.34), rgba(12, 16, 21, 0.04)),
    url("./assets/shop/saqueo-honesto.jpg") center 46% / cover;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.shop-hero-copy {
  max-width: 560px;
  padding: 18px;
  border-left: 3px solid var(--gold);
  background: rgba(8, 11, 15, 0.5);
  backdrop-filter: blur(12px);
}

.shop-hero-copy h2 {
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 2.8vw, 40px);
  line-height: 1.02;
}

.shop-hero-copy p:last-child {
  margin: 10px 0 0;
  color: var(--text);
  font-size: 15px;
  line-height: 1.55;
}

.shop-wallet {
  display: grid;
  gap: 8px;
  padding: 16px;
  border: 1px solid rgba(215, 168, 79, 0.34);
  border-radius: var(--radius);
  background: rgba(8, 11, 15, 0.74);
  backdrop-filter: blur(12px);
}

.shop-wallet span {
  color: var(--muted);
  text-transform: uppercase;
}

.shop-wallet strong {
  font-size: 24px;
}

.shop-wallet small {
  color: var(--gold);
  font-size: 18px;
  text-transform: none;
}

.shop-grimblik-state {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid rgba(215, 168, 79, 0.25);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(215, 168, 79, 0.12), rgba(255, 255, 255, 0.035));
}

.shop-grimblik-state span,
.shop-grimblik-badges span {
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.shop-grimblik-state strong {
  color: var(--gold);
  font-size: 16px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.shop-grimblik-state small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.shop-grimblik-state.is-danger,
.shop-grimblik-state.is-hostile,
.shop-grimblik-state.is-enemy {
  border-color: rgba(215, 82, 66, 0.42);
  background: linear-gradient(135deg, rgba(160, 46, 38, 0.2), rgba(255, 255, 255, 0.035));
}

.shop-grimblik-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.shop-grimblik-badges span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.05);
}

.shop-grimblik-badges .is-danger {
  color: #ffb0a8;
  border-color: rgba(215, 82, 66, 0.34);
  background: rgba(215, 82, 66, 0.12);
}

.shop-layout {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr) 390px;
  gap: 18px;
  align-items: start;
}

.shop-categories,
.shop-catalog,
.shop-detail {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.shop-categories {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.shop-category {
  min-height: 46px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--muted);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
  text-transform: uppercase;
}

.shop-category.is-active {
  color: var(--ink);
  background: var(--gold);
}

.shop-catalog {
  min-height: 720px;
  padding: 14px;
}

.shop-catalog-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.shop-catalog-head label {
  flex: 1;
}

.shop-items {
  max-height: 690px;
  overflow: auto;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 10px;
  padding-right: 6px;
}

.shop-item {
  min-height: 86px;
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 10px;
  align-items: center;
  padding: 12px;
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
  text-align: left;
}

.shop-item.is-active,
.shop-item:hover {
  border-color: rgba(215, 168, 79, 0.48);
  background: rgba(215, 168, 79, 0.12);
}

.shop-item-icon,
.shop-big-icon {
  display: grid;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--gold);
  background: rgba(0, 0, 0, 0.24);
}

.shop-item-icon {
  width: 44px;
  height: 44px;
  font-size: 22px;
}

.shop-item small {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.35;
}

.shop-detail {
  position: sticky;
  top: 24px;
  display: grid;
  gap: 14px;
  padding: 16px;
}

.settings-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 18px;
  align-items: start;
}

.sheet-template-editor,
.sheet-property-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(16px);
}

.sheet-template-editor {
  overflow: hidden;
}

.settings-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 18px;
  border-bottom: 1px solid var(--line);
}

.settings-head p {
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.55;
}

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

.sheet-template-scroll {
  max-height: calc(100vh - 220px);
  overflow: auto;
  padding: 18px;
}

.sheet-template-canvas,
.print-sheet-page {
  position: relative;
  width: min(100%, 1040px);
  margin: 0 auto;
  background: #eadcc2;
  box-shadow: var(--shadow);
}

.sheet-template-canvas img,
.print-sheet-page img {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
}

.sheet-map-box {
  position: absolute;
  display: grid;
  align-items: center;
  padding: 1px 3px;
  border: 1px dashed rgba(22, 116, 123, 0.72);
  color: #102f32;
  line-height: 1.08;
  white-space: pre-wrap;
  overflow: hidden;
  cursor: move;
  background: rgba(73, 182, 170, 0.08);
}

.sheet-map-box.is-tick {
  place-items: center;
  padding: 0;
  font-family: Arial, sans-serif;
}

.sheet-map-box.is-selected {
  border-color: rgba(215, 168, 79, 0.95);
  background: rgba(215, 168, 79, 0.18);
  outline: 2px solid rgba(215, 168, 79, 0.28);
}

.sheet-map-box i {
  position: absolute;
  right: -4px;
  bottom: -4px;
  width: 10px;
  height: 10px;
  border: 1px solid rgba(0, 0, 0, 0.4);
  background: var(--gold);
  cursor: nwse-resize;
}

.sheet-property-panel {
  position: sticky;
  top: 18px;
  padding: 16px;
}

.property-stack {
  display: grid;
  gap: 12px;
}

.property-stack h3 {
  color: var(--gold);
  word-break: break-word;
}

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

.print-sheet {
  display: none;
}

.shop-detail-head {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
}

.shop-big-icon {
  width: 64px;
  height: 64px;
  font-size: 34px;
}

.shop-detail h2 {
  font-size: 28px;
}

.shop-summary {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.shop-price-grid,
.shop-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.shop-price-grid div,
.shop-fields div {
  min-height: 68px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.045);
}

.shop-price-grid span,
.shop-fields span {
  display: block;
  color: var(--dim);
  font-size: 11px;
  text-transform: uppercase;
}

.shop-price-grid strong,
.shop-fields strong {
  display: block;
  margin-top: 7px;
  line-height: 1.35;
}

.shop-actions {
  display: grid;
  grid-template-columns: 100px 1fr 1fr;
  gap: 10px;
  align-items: end;
}

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

.shop-secondary-actions button:last-child:nth-child(odd) {
  grid-column: 1 / -1;
}

.haggle-result,
.shop-warning {
  padding: 12px;
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: var(--radius);
  color: var(--text);
  background: rgba(215, 168, 79, 0.1);
  line-height: 1.45;
}

.shop-warning {
  border-color: rgba(185, 87, 72, 0.35);
  background: rgba(185, 87, 72, 0.1);
}

.grimblik-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 22px;
}

.grimblik-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(2, 4, 8, 0.72);
  backdrop-filter: blur(10px);
}

.grimblik-modal-dialog {
  position: relative;
  z-index: 1;
  width: min(760px, 100%);
  max-height: min(84vh, 780px);
  overflow: auto;
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(215, 168, 79, 0.38);
  border-radius: 22px;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 0%, rgba(215, 168, 79, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(10, 14, 20, 0.97), rgba(6, 8, 12, 0.96));
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.58), inset 0 0 0 1px rgba(255, 255, 255, 0.045);
  animation: grimblikModalIn 180ms ease-out both;
}

.grimblik-modal-dialog h3 {
  margin: 0;
  color: var(--gold);
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.grimblik-modal-dialog p {
  margin: 0;
  color: var(--text);
  line-height: 1.55;
}

.grimblik-modal-dialog.is-danger {
  border-color: rgba(215, 82, 66, 0.52);
  background:
    radial-gradient(circle at 18% 0%, rgba(215, 82, 66, 0.2), transparent 34%),
    linear-gradient(145deg, rgba(16, 9, 9, 0.98), rgba(6, 8, 12, 0.96));
}

.grimblik-modal-dialog.is-success {
  border-color: rgba(105, 190, 126, 0.44);
  background:
    radial-gradient(circle at 18% 0%, rgba(105, 190, 126, 0.18), transparent 34%),
    linear-gradient(145deg, rgba(8, 15, 12, 0.98), rgba(6, 8, 12, 0.96));
}

.grimblik-mechanics {
  padding: 13px 14px;
  border: 1px solid rgba(215, 168, 79, 0.3);
  border-radius: 14px;
  color: #f1dfb6;
  background: rgba(215, 168, 79, 0.09);
  line-height: 1.45;
}

.grimblik-modal-rows {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.grimblik-modal-rows div {
  min-height: 64px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.045);
}

.grimblik-modal-rows span {
  display: block;
  color: var(--dim);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.grimblik-modal-rows strong {
  display: block;
  margin-top: 6px;
  color: var(--text);
  line-height: 1.35;
}

.grimblik-modal-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: flex-end;
}

.grimblik-haggle-dialog {
  width: min(1040px, 100%);
}

.grimblik-haggle-status {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.grimblik-haggle-status span {
  padding: 8px 10px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.05);
}

.grimblik-haggle-status strong {
  color: var(--gold);
}

.grimblik-haggle-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.grimblik-haggle-card {
  display: grid;
  place-items: center;
  min-height: 64px;
  padding: 12px 14px;
  border: 1px solid rgba(215, 168, 79, 0.18);
  border-radius: 16px;
  color: var(--text);
  text-align: center;
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.018));
  transition: transform 160ms ease, border-color 160ms ease, background 160ms ease;
}

.grimblik-haggle-card:hover {
  transform: translateY(-2px);
  border-color: rgba(215, 168, 79, 0.45);
  background: linear-gradient(135deg, rgba(215, 168, 79, 0.12), rgba(255, 255, 255, 0.03));
}

.grimblik-haggle-card strong {
  color: var(--gold);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@keyframes grimblikModalIn {
  from {
    opacity: 0;
    transform: translateY(10px) scale(0.98);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (max-width: 760px) {
  .shop-secondary-actions,
  .grimblik-modal-rows,
  .grimblik-haggle-grid {
    grid-template-columns: 1fr;
  }

  .grimblik-modal-layer {
    padding: 12px;
    align-items: end;
  }

  .grimblik-modal-dialog {
    max-height: 88vh;
    padding: 16px;
    border-radius: 18px 18px 0 0;
  }

  .grimblik-modal-actions {
    justify-content: stretch;
  }

  .grimblik-modal-actions button {
    flex: 1 1 140px;
    min-height: 44px;
  }
}

.rules-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 18px;
}

.feats-layout {
  display: grid;
  grid-template-columns: 280px 320px minmax(0, 1fr);
  gap: 18px;
  min-height: 700px;
}

.feats-categories,
.feats-list-panel,
.feat-detail-panel {
  min-width: 0;
}

.feats-categories,
.feats-list-panel,
.feat-detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.035);
}

.feats-categories {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  gap: 14px;
  padding: 18px;
}

.feats-hero-card {
  padding: 18px;
  border: 1px solid rgba(215, 168, 79, 0.22);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(215, 168, 79, 0.12), rgba(255, 255, 255, 0.02));
}

.feats-hero-card h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--feat-title-yellow);
  font-size: 32px;
}

.feats-hero-card p:last-child {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.55;
}

.feats-category-list {
  display: grid;
  align-content: start;
  gap: 10px;
}

.feats-category-button {
  display: grid;
  gap: 6px;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.feats-category-button strong {
  color: var(--feat-title-yellow);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feats-category-button small {
  color: var(--muted);
  line-height: 1.4;
}

.feats-category-button span {
  justify-self: start;
  padding: 4px 8px;
  border-radius: 999px;
  color: color-mix(in srgb, var(--feat-tone, #d8b56d) 72%, white 18%);
  background: color-mix(in srgb, var(--feat-tone, #d8b56d) 14%, rgba(255, 255, 255, 0.03));
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feats-category-button.is-active {
  border-color: color-mix(in srgb, var(--feat-tone, #d8b56d) 55%, transparent);
  background: linear-gradient(180deg, color-mix(in srgb, var(--feat-tone, #d8b56d) 14%, rgba(255, 255, 255, 0.04)), rgba(255, 255, 255, 0.02));
  box-shadow: 0 0 24px color-mix(in srgb, var(--feat-tone, #d8b56d) 16%, transparent);
}

.feats-list-panel {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
}

.feats-panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 10px;
}

.feats-panel-head h3 {
  margin: 0;
  color: var(--feat-title-yellow);
  font-size: 22px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.feat-count {
  min-width: 48px;
  min-height: 48px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink);
  background: rgba(215, 168, 79, 0.92);
  font-weight: 800;
}

.feats-search {
  display: grid;
  gap: 6px;
}

.feats-search span {
  color: var(--muted);
  font-size: 10px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feats-search input {
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--ink);
  background: rgba(255, 255, 255, 0.04);
}

.feats-list-scroll {
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 10px;
  overflow: auto;
}

.feat-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  text-align: left;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  color: var(--muted);
  background: rgba(255, 255, 255, 0.03);
}

.feat-card.is-active {
  border-color: rgba(215, 168, 79, 0.4);
  background: linear-gradient(180deg, rgba(215, 168, 79, 0.12), rgba(255, 255, 255, 0.03));
}

.feat-card-type {
  color: var(--gold);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.feat-card strong {
  color: var(--feat-title-yellow);
  font-size: 15px;
}

.feat-card small,
.feat-card p {
  color: var(--muted);
  line-height: 1.45;
}

.feat-card p {
  margin: 0;
}

.feat-detail-panel {
  overflow: hidden;
}

.feat-detail-head {
  padding: 24px 24px 0;
}

.feat-detail-head h2 {
  margin: 0 0 10px;
  font-family: Georgia, "Times New Roman", serif;
  color: var(--feat-title-yellow);
  font-size: 38px;
}

.feat-detail-head p:last-child {
  color: var(--muted);
  line-height: 1.6;
}

.feat-badge-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.feat-detail-content {
  min-height: 0;
  max-height: calc(100dvh - 250px);
  overflow: auto;
  padding-top: 14px;
}

.rules-tabs {
  display: grid;
  align-content: start;
  gap: 8px;
}

.rules-tab {
  min-height: 48px;
  padding: 0 12px;
  text-align: left;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.055);
}

.rules-tab.is-active {
  color: var(--ink);
  background: var(--gold);
}

.rules-content {
  min-height: 620px;
  padding: 24px;
}

.rules-content h2 {
  margin-bottom: 14px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 40px;
}

.rules-content h3 {
  margin: 22px 0 10px;
  color: var(--gold);
}

.feat-detail-content.rules-content h2,
.feat-detail-content.rules-content h3 {
  color: var(--feat-title-yellow);
}

.rules-content p,
.rules-content li {
  color: var(--muted);
  line-height: 1.65;
}

.rules-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.rules-content th,
.rules-content td {
  padding: 11px;
  border: 1px solid var(--line);
  text-align: left;
}

.rules-content th {
  color: var(--ink);
  background: var(--paper-2);
}

.rules-callout {
  margin-bottom: 18px;
  padding: 18px 20px;
  border: 1px solid rgba(215, 168, 79, 0.28);
  border-radius: var(--radius);
  background: rgba(215, 168, 79, 0.08);
}

.rules-class-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
}

.rules-class-card {
  display: grid;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.04);
}

.rules-class-card.is-blocked {
  border-style: dashed;
  background: rgba(185, 87, 72, 0.08);
}

.rules-class-head {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: start;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.status-badge.is-live {
  color: #112124;
  background: rgba(125, 194, 137, 0.95);
}

.status-badge.is-blocked {
  color: #fff2ee;
  background: rgba(185, 87, 72, 0.92);
}

.rules-class-meta,
.rules-class-subclasses {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rules-muted,
.rules-note {
  color: var(--muted);
}

.rules-blocked {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff2ee;
  background: rgba(185, 87, 72, 0.92);
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.rules-source-doc {
  margin-top: 24px;
}

.empty-state {
  min-height: 260px;
  display: grid;
  place-items: center;
  padding: 24px;
  border: 1px dashed rgba(255, 255, 255, 0.18);
  border-radius: var(--radius);
  color: var(--muted);
  text-align: center;
}

.print-sheet {
  color: var(--ink);
  background: var(--paper);
}

@media (max-width: 1500px) {
  .morality-screen {
    grid-template-columns: 240px minmax(0, 1fr) 290px;
  }

  .race-select-screen {
    grid-template-columns: 260px minmax(0, 1fr) 310px;
    gap: 16px;
  }

  .background-body-grid {
    grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.78fr);
  }

  .race-trait-grid {
    grid-template-columns: 1fr;
  }

  .class-select-screen {
    grid-template-columns: 250px minmax(560px, 1.05fr) minmax(520px, 0.95fr);
  }

  .class-hero-zone {
    grid-template-columns: minmax(220px, 0.85fr) minmax(0, 0.85fr);
  }

  .class-select-icon.is-title {
    flex-basis: 62px;
    width: 62px;
    height: 62px;
  }

  .class-summary-panel h3 {
    font-size: clamp(16px, 1.25vw, 20px);
    letter-spacing: 0.06em;
  }

  .class-detail-dialog {
    width: 100%;
  }
}

@media (max-width: 1220px) {
  .inventory-dashboard,
  .equipment-board,
  .inventory-loadout {
    grid-template-columns: 1fr;
  }

  .equip-slots,
  .inventory-items-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .inventory-browser,
  .inventory-item-card,
  .inventory-item-heading {
    min-width: 0;
  }

  .builder-modal-stage,
  .builder-theme-grid,
  .builder-stage-grid {
    grid-template-columns: 1fr;
  }

  .class-select-screen {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .morality-screen {
    grid-template-columns: 1fr;
    overflow: auto;
  }

  .race-select-screen {
    grid-template-columns: 240px minmax(0, 1fr);
  }

  .race-rules-panel {
    grid-column: 1 / -1;
    grid-template-columns: minmax(0, 0.8fr) minmax(0, 1fr);
  }

  .background-detail-panel {
    grid-column: 2 / -1;
  }

  .background-body-grid,
  .background-benefit-grid {
    grid-template-columns: 1fr;
  }

  .class-progression-panel {
    grid-column: 1 / -1;
  }

  .class-detail-layer {
    inset: 10px;
    padding: 0;
  }

  .class-choice-layer {
    inset: 10px;
    padding: 10px;
  }

  .class-detail-dialog {
    width: 100%;
    height: 100%;
    max-height: none;
  }

  .class-choice-dialog {
    width: 100%;
    max-height: 100%;
  }

  .class-detail-head {
    grid-template-columns: 130px minmax(0, 1fr) auto;
    gap: 12px;
  }

  .class-choice-head {
    padding: 14px 16px;
  }

  .class-detail-portrait {
    height: 104px;
  }

  .class-detail-overview,
  .class-detail-compact-intro,
  .class-detail-stats,
  .class-detail-columns {
    grid-template-columns: 1fr;
  }

  .class-detail-page-columns {
    grid-template-columns: 1fr;
  }

  .class-detail-page-column + .class-detail-page-column {
    padding-left: 0;
    border-left: 0;
  }

  .builder-system-options {
    width: min(760px, 86vw);
  }

  .builder-stage-preview {
    border-left: 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
  }

  .builder-layout {
    grid-template-columns: 200px minmax(0, 1fr);
  }

  .live-preview {
    position: static;
    grid-column: 1 / -1;
  }

  .preview-portrait img,
  .preview-portrait .portrait-placeholder {
    height: 220px;
  }
}

@media (max-width: 980px) {
  :root {
    --sidebar: 100%;
  }

  .hp-console,
  .journal-panel,
  .journal-notes,
  .sheet-rules-grid,
  .level-up-summary-grid,
  .level-up-choice-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: sticky;
    height: auto;
    padding: 10px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
  }

  .brand {
    width: auto;
    min-height: 52px;
    display: flex;
    justify-content: start;
    padding: 0 8px;
  }

  .brand strong,
  .brand small {
    display: block;
  }

  .brand small {
    color: var(--muted);
    font-size: 11px;
  }

  .main-nav {
    grid-template-columns: repeat(6, minmax(44px, 1fr));
    gap: 6px;
  }

  .nav-button {
    min-height: 52px;
  }

  .nav-button span:last-child {
    display: none;
  }

  .sidebar-footer {
    display: none;
  }

  .workspace {
    padding: 18px;
  }

  .topbar {
    align-items: start;
    flex-direction: column;
  }

  .topbar-actions {
    width: 100%;
    justify-content: start;
  }

  .search-field {
    width: 100%;
  }

  .library-layout,
  .builder-layout,
  .sheet-hero,
  .sheet-body,
  .sheet-vtt-body,
  .sheet-cover-grid,
  .sheet-two-column,
  .sheet-three-column,
  .bestiary-layout,
  .rules-layout,
  .shop-hero,
  .shop-layout,
  .background-spotlight,
  .equipment-board,
  .inventory-grid,
  .spell-prep,
  .settings-layout,
  .builder-inline-grid,
  .builder-summary-grid {
    grid-template-columns: 1fr;
  }

  .builder-modal {
    padding: 10px;
  }

  .builder-modal-shell {
    width: 100%;
    min-height: calc(100vh - 20px);
    border-radius: 14px;
  }

  .builder-modal-progress {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 12px;
    padding: 22px 18px 16px;
  }

  .builder-modal-progress::before {
    display: none;
  }

  .step-button::after {
    display: none;
  }

  .builder-stage-card,
  .builder-stage-preview {
    padding: 22px 18px;
  }

  .builder-modal-shell.is-class-step .builder-stage-card {
    padding: 0;
  }

  .morality-screen {
    padding: 18px;
  }

  .morality-answer-grid {
    grid-template-columns: 1fr;
  }

  .class-select-screen {
    grid-template-columns: 1fr;
    padding: 18px;
  }

  .race-select-screen {
    grid-template-columns: 1fr;
    overflow: auto;
    padding: 18px;
  }

  .background-detail-panel {
    grid-column: auto;
  }

  .background-hero-banner {
    min-height: 210px;
    height: 210px;
  }

  .race-list-scroll {
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 280px);
    overflow-x: auto;
    overflow-y: hidden;
  }

  .race-rules-panel,
  .race-trait-grid {
    grid-template-columns: 1fr;
  }

  .background-body-grid {
    grid-template-columns: 1fr;
  }

  .class-select-scroll {
    grid-auto-flow: column;
    grid-auto-columns: minmax(230px, 280px);
    overflow-x: auto;
    overflow-y: hidden;
    padding: 0 0 8px;
  }

  .class-hero-zone,
  .class-bottom-grid {
    grid-template-columns: 1fr;
  }

  .class-progression-table {
    min-width: 720px;
  }

  .builder-modal-actions {
    flex-direction: column;
    padding: 16px 18px 18px;
  }

  .builder-system-overlay {
    padding: 30px 24px 24px;
  }

  .system-unavailable-badge {
    top: 76px;
    right: 24px;
    max-width: calc(100% - 48px);
  }

  .builder-system-options {
    width: 100%;
  }

  .builder-modal-actions .primary-button,
  .builder-modal-actions .accent-button,
  .builder-modal-actions .ghost-button {
    width: 100%;
  }

  .filter-rail {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .filter-panel {
    grid-column: 1 / -1;
  }

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

  .dm-layout {
    grid-template-columns: 1fr;
  }

  .dm-object-sidebar {
    position: static;
  }

  .dm-object-list {
    max-height: 360px;
  }

  .dm-encounter-context-panel {
    position: static;
    max-height: none;
    overflow: visible;
    padding-right: 0;
  }

  .dm-combat-list {
    width: 100%;
    overflow-x: auto;
    overflow-y: visible;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }

  .dm-combat-row {
    grid-template-columns: minmax(70px, 1fr) 34px 34px minmax(62px, 0.9fr) 28px 38px;
    width: 100%;
    min-width: 0;
    gap: 4px;
    padding: 6px;
  }

  .dm-combat-field--conditions input {
    min-height: 56px;
  }

  .dm-object-stats,
  .dm-object-field-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .sheet-fixed-bar {
    grid-template-columns: minmax(220px, 1fr) minmax(280px, 1.3fr);
  }

  .sheet-fixed-bar > .ghost-button {
    grid-column: 1 / -1;
    justify-self: start;
  }

  .sheet-quick-details {
    grid-column: 1 / -1;
  }

  .sheet-quick-details > div {
    left: 0;
    right: auto;
  }

  .sheet-vtt-body .sheet-tabs {
    position: static;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sheet-vtt-body .sheet-tab {
    min-height: 54px;
  }

  .sheet-cover-portrait,
  .sheet-cover-portrait img,
  .sheet-cover-portrait .portrait-placeholder {
    min-height: 360px;
  }

  .sheet-narrative-card {
    grid-column: auto;
  }

  .shop-detail {
    position: static;
  }

  .inventory-dashboard,
  .equipment-board,
  .inventory-loadout {
    grid-template-columns: 1fr;
  }

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

  .inventory-quick-create {
    grid-template-columns: 1fr 1fr auto;
  }

  .inventory-quick-create > div {
    grid-column: 1 / -1;
  }

  .custom-item-form {
    grid-template-columns: 1fr;
  }

  .shop-hero {
    min-height: 360px;
  }

  .shop-categories {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .level-panel {
    grid-template-columns: 1fr;
  }

  .sheet-property-panel {
    position: static;
  }
}

@media (max-width: 640px) {
  .workspace {
    padding: 14px;
  }

  .main-nav {
    grid-template-columns: repeat(3, minmax(44px, 1fr));
  }

  .character-grid {
    grid-template-columns: repeat(auto-fill, minmax(148px, 1fr));
    gap: 12px;
  }

  .character-card,
  .add-card {
    min-height: 260px;
  }

  .character-card img,
  .character-card .portrait-placeholder {
    min-height: 260px;
  }

  .filter-rail,
  .form-grid,
  .form-grid.three,
  .vital-strip,
  .stat-grid,
  .stat-mini-grid,
  .ability-row,
  .stepper,
  .coin-editor,
  .coin-editor.compact,
  .equip-slots,
  .shop-price-grid,
  .shop-fields,
  .shop-actions,
  .shop-categories,
  .inventory-dashboard,
  .inventory-quick-create,
  .builder-modal-progress {
    grid-template-columns: 1fr;
  }

  .inventory-items-overview,
  .equipment-conflict-actions {
    grid-template-columns: 1fr;
  }

  .inventory-item-heading {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .inventory-item-heading-actions {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }

  .builder-system-head {
    gap: 18px;
  }

  .builder-system-head h3 {
    font-size: 13px;
    letter-spacing: 0.22em;
  }

  .system-search-field {
    width: 100%;
  }

  .system-option {
    min-height: 64px;
    padding: 12px 0;
    border-radius: 12px;
    letter-spacing: 0.18em;
  }

  .span-2 {
    grid-column: auto;
  }

  .sheet-portrait img,
  .sheet-portrait .portrait-placeholder {
    height: 340px;
  }

  .sheet-fixed-bar {
    top: 0;
    grid-template-columns: 1fr;
    gap: 10px;
    padding: 10px;
    border-radius: 8px;
  }

  .sheet-quick-identity {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .sheet-quick-portrait {
    width: 44px;
    height: 44px;
  }

  .sheet-quick-identity small {
    display: none;
  }

  .sheet-quick-stats {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .sheet-quick-stats div:nth-child(n + 5) {
    display: none;
  }

  .sheet-quick-details > div {
    position: static;
    width: 100%;
    grid-template-columns: 1fr;
    margin-top: 8px;
  }

  .sheet-vtt-body {
    margin-bottom: 76px;
    border: 0;
    background: transparent;
  }

  .sheet-vtt-body .sheet-tabs {
    display: none;
  }

  .sheet-mobile-nav {
    position: fixed;
    left: 12px;
    right: 12px;
    bottom: 12px;
    z-index: 60;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(12, 16, 21, 0.96);
    box-shadow: 0 18px 44px rgba(0, 0, 0, 0.38);
  }

  .sheet-mobile-nav button,
  .sheet-mobile-more summary {
    min-height: 42px;
    padding: 0 6px;
    border: 1px solid transparent;
    border-radius: 8px;
    color: var(--muted);
    background: transparent;
    font-size: 11px;
    font-weight: 900;
  }

  .sheet-mobile-nav button.is-active,
  .sheet-mobile-more summary.is-active {
    color: #ffe8b7;
    border-color: rgba(215, 168, 79, 0.42);
    background: rgba(215, 168, 79, 0.12);
  }

  .sheet-mobile-more {
    position: relative;
  }

  .sheet-mobile-more > div {
    position: absolute;
    right: 0;
    bottom: calc(100% + 10px);
    width: min(260px, 86vw);
    display: grid;
    gap: 6px;
    padding: 8px;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: rgba(12, 16, 21, 0.98);
  }

  .sheet-cover-grid,
  .sheet-two-column,
  .sheet-three-column,
  .sheet-ability-grid,
  .sheet-attack-grid,
  .sheet-card-grid {
    grid-template-columns: 1fr;
  }

  .sheet-cover-identity h2 {
    font-size: 32px;
  }

  .level-panel-stats,
  .level-method-preview {
    grid-template-columns: 1fr;
  }

  .sheet-fact-grid,
  .sheet-fact-grid.compact {
    grid-template-columns: 1fr;
  }

  .sheet-list-row {
    display: grid;
  }

  .sheet-list-row span {
    text-align: left;
  }

  .sheet-hero,
  .sheet-panel,
  .stage-card,
  .rules-content,
  .shop-hero {
    padding: 16px;
  }

  .shop-hero {
    min-height: 380px;
  }

  .shop-hero-copy h2 {
    font-size: 28px;
  }

  .shop-items {
    grid-template-columns: 1fr;
    max-height: none;
  }

  .settings-head,
  .settings-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .bestiary-workspace,
  .bestiary-cards-grid,
  .compact-form-grid,
  .manual-core,
  .encounter-roster-item {
    grid-template-columns: 1fr;
  }

  .bestiary-list {
    max-height: none;
  }

  .feats-layout {
    grid-template-columns: 1fr;
  }

  .feat-detail-content {
    max-height: none;
  }
}

@media (max-width: 640px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .app-shell {
    padding-top: 68px;
  }

  .sidebar {
    position: fixed;
    inset: 0 0 auto;
    z-index: 100;
    height: 68px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid rgba(215, 168, 79, 0.2);
    background: rgba(7, 11, 17, 0.94);
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.34);
    backdrop-filter: blur(18px);
  }

  .sidebar-footer {
    display: none;
  }

  .brand {
    width: max-content;
    min-height: 52px;
    display: flex;
    justify-content: start;
    gap: 10px;
    padding: 0;
  }

  .brand-logo {
    width: 46px;
    height: 46px;
  }

  .brand strong {
    display: block;
    color: #f5ead4;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 20px;
    letter-spacing: 0.04em;
  }

  .brand small {
    display: none;
  }

  .mobile-menu-toggle {
    width: 46px;
    height: 46px;
    display: grid;
    align-content: center;
    gap: 5px;
    padding: 0 11px;
    border: 1px solid rgba(215, 168, 79, 0.24);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.045);
  }

  .mobile-menu-toggle span {
    width: 100%;
    height: 2px;
    border-radius: 2px;
    background: #ead6aa;
    transition: transform 180ms ease, opacity 180ms ease;
  }

  body.mobile-nav-open .mobile-menu-toggle span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }

  body.mobile-nav-open .mobile-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  body.mobile-nav-open .mobile-menu-toggle span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }

  .main-nav {
    position: fixed;
    z-index: 96;
    top: 68px;
    right: 0;
    bottom: auto;
    left: auto;
    width: min(330px, 86vw);
    height: calc(100dvh - 68px);
    max-height: calc(100dvh - 68px);
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
    align-content: start;
    align-self: auto;
    justify-self: auto;
    gap: 8px;
    padding: 18px 14px;
    overflow-y: auto;
    border-left: 1px solid rgba(215, 168, 79, 0.2);
    background:
      radial-gradient(circle at 100% 0%, rgba(215, 168, 79, 0.11), transparent 32%),
      rgba(8, 12, 18, 0.98);
    box-shadow: -20px 0 54px rgba(0, 0, 0, 0.48);
    transform: translateX(105%);
    visibility: hidden;
    transition: transform 220ms ease, visibility 220ms ease;
  }

  body.mobile-nav-open .main-nav {
    transform: translateX(0);
    visibility: visible;
  }

  .nav-button {
    min-height: 58px;
    display: grid;
    grid-template-columns: 42px minmax(0, 1fr);
    justify-items: start;
    padding: 8px 14px;
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.035);
  }

  .nav-button span:last-child {
    display: block;
    align-self: center;
    font-size: 13px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .mobile-nav-logout {
    position: relative;
    display: grid;
    margin-top: 8px;
    border-color: rgba(195, 86, 76, 0.26);
    color: #e9b4ad;
    background: rgba(128, 43, 39, 0.12);
  }

  .mobile-nav-logout::before {
    content: "";
    position: absolute;
    left: 14px;
    right: 14px;
    margin-top: -13px;
    border-top: 1px solid rgba(215, 168, 79, 0.14);
  }

  .mobile-nav-logout:hover,
  .mobile-nav-logout:focus-visible {
    border-color: rgba(224, 116, 104, 0.48);
    background: rgba(143, 48, 43, 0.2);
  }

  .mobile-nav-backdrop {
    position: fixed;
    z-index: 90;
    inset: 68px 0 0;
    width: 100%;
    height: auto;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.62);
    opacity: 0;
    visibility: hidden;
    backdrop-filter: blur(3px);
    transition: opacity 180ms ease, visibility 180ms ease;
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    display: block;
    opacity: 1;
    visibility: visible;
  }

  .topbar {
    display: none;
  }

  #view-sheet .sheet-toolbar,
  .sheet-fixed-bar {
    display: none;
  }

  .sheet-access-notice.is-master {
    display: none;
  }

  .mobile-sheet-shell {
    display: grid;
    gap: 12px;
    margin-bottom: 12px;
  }

  .mobile-sheet-character-header {
    display: grid;
    grid-template-columns: 92px minmax(0, 1fr);
    gap: 12px;
    align-items: stretch;
    padding: 12px;
    border: 1px solid rgba(215, 168, 79, 0.18);
    border-radius: 10px;
    background: rgba(8, 12, 18, 0.78);
  }

  .mobile-sheet-character-portrait {
    aspect-ratio: 1;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
  }

  .mobile-sheet-character-portrait img,
  .mobile-sheet-character-portrait .portrait-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }

  .mobile-sheet-character-identity {
    min-width: 0;
    display: grid;
    align-content: center;
    gap: 8px;
  }

  .mobile-sheet-character-identity span {
    color: var(--muted);
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 0.1em;
    text-transform: uppercase;
  }

  .mobile-sheet-character-identity strong {
    overflow: hidden;
    color: var(--text);
    font-size: 22px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-sheet-character-identity button {
    min-height: 42px;
    border: 1px solid rgba(215, 168, 79, 0.34);
    border-radius: 8px;
    color: #ffe7b0;
    background: rgba(215, 168, 79, 0.12);
    font-weight: 900;
  }

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

  .sheet-vtt-body {
    margin-bottom: 0;
  }

  .sheet-mobile-nav {
    position: static;
    inset: auto;
    z-index: auto;
    grid-column: 1 / -1;
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
    margin-top: 4px;
    padding: 12px 0 0;
    border: 0;
    border-top: 1px solid rgba(215, 168, 79, 0.16);
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .sheet-mobile-nav button,
  .mobile-sheet-tabs button {
    min-height: 54px;
    display: grid;
    align-content: center;
    gap: 2px;
    padding: 7px 6px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 10px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.035);
    font-weight: 900;
  }

  .sheet-mobile-nav button span,
  .mobile-sheet-tabs button span {
    color: rgba(215, 168, 79, 0.76);
    font-size: 9px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
  }

  .sheet-mobile-nav button strong,
  .mobile-sheet-tabs button strong {
    color: inherit;
    font-size: 11px;
    line-height: 1.15;
  }

  .sheet-mobile-nav button.is-active,
  .mobile-sheet-tabs button.is-active {
    color: #ffe8b7;
    border-color: rgba(215, 168, 79, 0.42);
    background:
      linear-gradient(145deg, rgba(215, 168, 79, 0.16), rgba(73, 182, 170, 0.06)),
      rgba(255, 255, 255, 0.035);
    box-shadow: inset 0 0 18px rgba(215, 168, 79, 0.05);
  }

  .mobile-character-picker-layer {
    position: fixed;
    inset: 0;
    z-index: 280;
    display: grid;
    place-items: center;
    padding: 14px;
  }

  .mobile-character-picker-backdrop {
    position: absolute;
    inset: 0;
    display: block;
    border: 0;
    border-radius: 0;
    background: rgba(0, 0, 0, 0.62);
    backdrop-filter: blur(3px);
  }

  .mobile-character-picker-modal {
    position: relative;
    z-index: 1;
    width: min(520px, 100%);
    display: grid;
    max-height: min(70dvh, 620px);
    overflow: hidden;
    border: 1px solid rgba(215, 168, 79, 0.25);
    border-radius: 12px;
    background: rgba(9, 13, 19, 0.98);
    box-shadow: 0 22px 70px rgba(0, 0, 0, 0.5);
  }

  .mobile-character-picker-modal > header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid rgba(215, 168, 79, 0.15);
  }

  .mobile-character-picker-modal > header strong {
    color: var(--gold);
    font-size: 13px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .mobile-character-picker-modal > header button {
    min-height: 34px;
    padding: 0 12px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--muted);
    background: rgba(255, 255, 255, 0.04);
    font-weight: 900;
  }

  .mobile-character-picker-list {
    max-height: calc(min(70dvh, 620px) - 59px);
    overflow-y: auto;
    padding: 8px;
  }

  .mobile-character-picker-option {
    width: 100%;
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
    padding: 8px;
    border: 1px solid transparent;
    border-radius: 10px;
    color: var(--text);
    background: transparent;
    text-align: left;
  }

  .mobile-character-picker-option + .mobile-character-picker-option {
    margin-top: 6px;
  }

  .mobile-character-picker-option.is-active {
    border-color: rgba(215, 168, 79, 0.34);
    background: rgba(215, 168, 79, 0.1);
  }

  .mobile-character-picker-portrait {
    width: 54px;
    height: 54px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.04);
  }

  .mobile-character-picker-portrait img,
  .mobile-character-picker-portrait .portrait-placeholder {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
  }

  .mobile-character-picker-copy {
    min-width: 0;
    display: grid;
    gap: 4px;
  }

  .mobile-character-picker-copy strong {
    overflow: hidden;
    font-size: 15px;
    line-height: 1.1;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .mobile-character-picker-copy small {
    color: var(--muted);
    font-size: 11px;
    line-height: 1.25;
  }
}

@media print {
  @page {
    size: A4 portrait;
    margin: 0;
  }

  body {
    background: white;
  }

  body.is-exporting-sheet .app-shell {
    display: none !important;
  }

  body.is-exporting-sheet .print-sheet {
    display: block !important;
  }

  body.is-exporting-sheet .print-sheet-page {
    width: 100vw;
    max-width: 100%;
    margin: 0;
    box-shadow: none;
  }

  body.is-exporting-sheet .sheet-map-box {
    border: 0;
    outline: 0;
    background: transparent;
    cursor: default;
  }

  body.is-exporting-sheet .sheet-map-box i {
    display: none;
  }

  .sidebar,
  .topbar,
  .sheet-toolbar,
  .view:not(#view-sheet) {
    display: none !important;
  }

  .app-shell,
  .workspace,
  #view-sheet {
    display: block;
    padding: 0;
  }

  .character-sheet {
    border: 0;
    box-shadow: none;
    color: #16110c;
    background: #eadbbf;
  }

  .sheet-hero {
    color: #16110c;
    background: #eadbbf;
  }

  .sheet-identity p,
  .detail-item span,
  .attribute-item p,
  .vital-card span {
    color: #382c20;
  }

  .sheet-tab {
    display: none;
  }

  .sheet-body {
    display: block;
  }

.sheet-panel {
    min-height: auto;
  }
}

.identity-premium-screen {
  display: block;
  padding: 18px 20px 14px;
  background:
    radial-gradient(circle at top, rgba(200, 167, 106, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(5, 7, 11, 0.98), rgba(10, 16, 24, 0.96));
  overflow: auto;
  scrollbar-gutter: stable;
}

.identity-premium-aura {
  background:
    radial-gradient(circle at 15% 20%, rgba(200, 167, 106, 0.07), transparent 24%),
    radial-gradient(circle at 82% 16%, rgba(126, 97, 55, 0.08), transparent 26%),
    radial-gradient(circle at 50% 88%, rgba(90, 65, 35, 0.08), transparent 28%);
}

.identity-premium-shell {
  position: relative;
  min-height: 100%;
  padding: 28px 30px 26px;
  border: 1px solid rgba(200, 167, 106, 0.18);
  border-radius: 22px;
  background:
    linear-gradient(180deg, rgba(8, 12, 18, 0.84), rgba(4, 7, 11, 0.9)),
    linear-gradient(135deg, rgba(200, 167, 106, 0.04), transparent 25%, transparent 75%, rgba(200, 167, 106, 0.04));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.03),
    inset 0 1px 0 rgba(255, 235, 198, 0.04),
    0 30px 90px rgba(0, 0, 0, 0.42),
    0 0 34px rgba(155, 122, 67, 0.06);
  overflow: hidden;
}

.identity-premium-shell > * {
  position: relative;
  z-index: 1;
}

.identity-premium-shell-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

.identity-premium-shell-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 24%;
  display: block;
  filter: saturate(0.84) brightness(0.38);
  transform: scale(1.015);
}

.identity-premium-shell-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 50% 18%, rgba(200, 167, 106, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(5, 8, 13, 0.18), rgba(5, 8, 13, 0.42)),
    linear-gradient(90deg, rgba(5, 8, 13, 0.14), rgba(5, 8, 13, 0.05) 24%, rgba(5, 8, 13, 0.05) 76%, rgba(5, 8, 13, 0.16));
}

.identity-premium-shell::before,
.identity-premium-shell::after {
  content: "";
  position: absolute;
  width: 92px;
  height: 92px;
  border: 1px solid rgba(200, 167, 106, 0.18);
  pointer-events: none;
}

.identity-premium-shell::before {
  top: 14px;
  left: 14px;
  border-right: 0;
  border-bottom: 0;
  clip-path: polygon(0 100%, 0 0, 100% 0, 72% 28%, 28% 28%, 28% 72%);
}

.identity-premium-shell::after {
  right: 14px;
  bottom: 14px;
  border-left: 0;
  border-top: 0;
  clip-path: polygon(100% 0, 100% 100%, 0 100%, 28% 72%, 72% 72%, 72% 28%);
}

.identity-premium-header {
  display: grid;
  grid-template-columns: minmax(90px, 1fr) auto minmax(90px, 1fr);
  align-items: center;
  gap: 18px;
  margin-bottom: 22px;
}

.identity-premium-title-block {
  display: grid;
  justify-items: center;
  text-align: center;
}

.identity-premium-title-block h2 {
  margin: 0;
  color: #c8a76a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(32px, 2.8vw, 42px);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-shadow: 0 0 18px rgba(155, 122, 67, 0.15);
}

.identity-premium-ornament {
  position: relative;
  height: 18px;
}

.identity-premium-ornament::before,
.identity-premium-ornament::after {
  content: "";
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
}

.identity-premium-ornament::before {
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(200, 167, 106, 0.7), transparent);
}

.identity-premium-ornament::after {
  left: 50%;
  width: 12px;
  height: 12px;
  border: 1px solid rgba(200, 167, 106, 0.7);
  transform: translate(-50%, -50%) rotate(45deg);
  background: rgba(5, 7, 11, 0.96);
  box-shadow: 0 0 14px rgba(200, 167, 106, 0.12);
}

.identity-premium-body {
  display: grid;
  grid-template-columns: minmax(380px, 31%) minmax(0, 1fr);
  gap: 20px;
  min-height: 0;
}

.identity-premium-portrait-panel {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(200, 167, 106, 0.14);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(10, 14, 20, 0.9), rgba(6, 9, 14, 0.88));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    inset 0 1px 0 rgba(255, 235, 198, 0.03),
    0 18px 40px rgba(0, 0, 0, 0.28);
}

.identity-premium-panel-head {
  display: grid;
  gap: 6px;
  margin-bottom: 16px;
}

.identity-premium-panel-head h3 {
  margin: 0;
  color: #c8a76a;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 17px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.identity-premium-panel-head p {
  margin: 0;
  color: rgba(217, 208, 195, 0.62);
  font-size: 12px;
  line-height: 1.55;
}

.identity-premium-portrait-panel {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
}

.identity-premium-portrait-frame {
  position: relative;
  overflow: hidden;
  min-height: 0;
  min-height: clamp(500px, 62vh, 720px);
  border: 1px solid rgba(200, 167, 106, 0.22);
  border-radius: 16px;
  background:
    radial-gradient(circle at 50% 0, rgba(200, 167, 106, 0.08), transparent 36%),
    linear-gradient(180deg, rgba(9, 13, 19, 0.94), rgba(4, 7, 11, 0.96));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.02),
    inset 0 0 34px rgba(0, 0, 0, 0.34);
}

.identity-premium-portrait-frame::before {
  content: "";
  position: absolute;
  inset: 10px;
  border: 1px solid rgba(200, 167, 106, 0.1);
  border-radius: 12px;
  pointer-events: none;
}

.identity-premium-portrait-frame img,
.identity-premium-portrait-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  display: block;
}

.identity-premium-placeholder {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 20px;
  padding: 28px;
  text-align: center;
  color: rgba(217, 208, 195, 0.72);
}

.identity-premium-placeholder strong {
  color: rgba(217, 208, 195, 0.78);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.16em;
  line-height: 1.7;
  text-transform: uppercase;
}

.identity-premium-placeholder-scene {
  position: relative;
  width: 160px;
  height: 150px;
  margin: 0 auto;
}

.identity-premium-sun {
  position: absolute;
  top: 16px;
  left: 50%;
  width: 28px;
  height: 28px;
  border: 1px solid rgba(217, 208, 195, 0.34);
  border-radius: 50%;
  transform: translateX(-50%);
  box-shadow: 0 0 18px rgba(200, 167, 106, 0.08);
}

.identity-premium-peak {
  position: absolute;
  bottom: 22px;
  width: 0;
  height: 0;
  border-left: 28px solid transparent;
  border-right: 28px solid transparent;
  border-bottom: 62px solid rgba(217, 208, 195, 0.18);
}

.identity-premium-peak::after {
  content: "";
  position: absolute;
  left: -28px;
  top: 16px;
  width: 0;
  height: 0;
  border-left: 28px solid transparent;
  border-right: 28px solid transparent;
  border-bottom: 46px solid rgba(5, 7, 11, 0.58);
}

.identity-premium-peak.is-left {
  left: 10px;
}

.identity-premium-peak.is-center {
  left: 52px;
  border-left-width: 34px;
  border-right-width: 34px;
  border-bottom-width: 80px;
}

.identity-premium-peak.is-center::after {
  left: -34px;
  top: 18px;
  border-left-width: 34px;
  border-right-width: 34px;
  border-bottom-width: 58px;
}

.identity-premium-peak.is-right {
  right: 10px;
}

.identity-premium-upload {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 30px;
  height: 42px;
  transform: translateX(-50%);
}

.identity-premium-upload::before,
.identity-premium-upload::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(217, 208, 195, 0.3);
}

.identity-premium-upload::before {
  bottom: 0;
  width: 18px;
  height: 18px;
  clip-path: polygon(50% 100%, 0 40%, 30% 40%, 30% 0, 70% 0, 70% 40%, 100% 40%);
}

.identity-premium-upload::after {
  bottom: 16px;
  width: 2px;
  height: 24px;
}

.identity-premium-portrait-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.identity-premium-portrait-actions .ghost-button {
  min-height: 46px;
  border-color: rgba(200, 167, 106, 0.12);
  color: #d9d0c3;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.015));
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

.identity-premium-portrait-actions .ghost-button:hover {
  border-color: rgba(200, 167, 106, 0.32);
  color: #f2e0b1;
  background: linear-gradient(180deg, rgba(200, 167, 106, 0.12), rgba(255, 255, 255, 0.03));
}

.identity-premium-portrait-note {
  margin: 0;
  color: rgba(217, 208, 195, 0.46);
  font-size: 11px;
  line-height: 1.65;
  text-align: left;
}

.identity-prompt-generator-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid rgba(108, 190, 228, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 20% 0, rgba(108, 190, 228, 0.12), transparent 42%),
    linear-gradient(180deg, rgba(12, 20, 30, 0.78), rgba(5, 8, 13, 0.72));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.025),
    0 14px 30px rgba(0, 0, 0, 0.2);
}

.identity-prompt-generator-card h4 {
  margin: 0 0 5px;
  color: #f1d78f;
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.identity-prompt-generator-card p {
  margin: 0;
  color: rgba(217, 208, 195, 0.66);
  font-size: 12px;
  line-height: 1.55;
}

.identity-prompt-generator-card .ghost-button {
  justify-self: stretch;
  min-height: 40px;
  border-color: rgba(108, 190, 228, 0.26);
  color: #d8f4ff;
}

.identity-prompt-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 220;
  display: grid;
  place-items: center;
  padding: 24px;
}

.identity-prompt-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background:
    radial-gradient(circle at 50% 38%, rgba(32, 82, 112, 0.18), transparent 40%),
    rgba(1, 3, 7, 0.78);
  backdrop-filter: blur(12px);
  cursor: default;
}

.identity-prompt-modal {
  position: relative;
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  width: min(1420px, calc(100vw - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid rgba(200, 167, 106, 0.28);
  border-radius: 24px;
  background:
    radial-gradient(circle at 18% 0, rgba(108, 190, 228, 0.11), transparent 36%),
    linear-gradient(180deg, rgba(10, 15, 23, 0.98), rgba(4, 7, 11, 0.98));
  box-shadow:
    0 34px 100px rgba(0, 0, 0, 0.62),
    inset 0 0 0 1px rgba(255, 255, 255, 0.035),
    0 0 40px rgba(200, 167, 106, 0.08);
  animation: identityPromptIn 180ms ease-out;
}

@keyframes identityPromptIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.identity-prompt-modal-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 18px;
  border-bottom: 1px solid rgba(200, 167, 106, 0.14);
}

.identity-prompt-modal-head h3 {
  margin: 0;
  color: #f1d78f;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.identity-prompt-modal-head p:not(.eyebrow) {
  margin: 8px 0 0;
  max-width: 780px;
  color: rgba(217, 208, 195, 0.66);
  font-size: 13px;
  line-height: 1.55;
}

.identity-prompt-warning {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 12px 24px;
  border-bottom: 1px solid rgba(205, 105, 92, 0.18);
  background: rgba(120, 44, 36, 0.18);
}

.identity-prompt-warning span {
  color: #f4b1a7;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.identity-prompt-modal-body {
  display: grid;
  grid-template-columns: minmax(290px, 0.3fr) minmax(0, 1fr);
  gap: 18px;
  min-height: 0;
  padding: 18px 22px 22px;
  overflow: auto;
}

.identity-prompt-sidebar,
.identity-prompt-main,
.identity-prompt-output,
.identity-prompt-reference {
  border: 1px solid rgba(200, 167, 106, 0.14);
  border-radius: 18px;
  background: rgba(5, 9, 14, 0.64);
}

.identity-prompt-sidebar {
  display: grid;
  align-content: start;
  gap: 12px;
  padding: 14px;
}

.identity-prompt-sidebar h4,
.identity-prompt-output h4 {
  margin: 0;
  color: #f1d78f;
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.identity-prompt-reference {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
}

.identity-prompt-reference-preview {
  overflow: hidden;
  min-height: 86px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.04);
}

.identity-prompt-reference-preview img {
  width: 100%;
  height: 100%;
  min-height: 86px;
  object-fit: cover;
  display: block;
}

.identity-prompt-reference-preview span {
  display: grid;
  place-items: center;
  min-height: 86px;
  color: rgba(217, 208, 195, 0.48);
  font-size: 11px;
  text-transform: uppercase;
}

.identity-prompt-reference h4 {
  margin: 0 0 4px;
  color: #d9d0c3;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity-prompt-reference p,
.identity-prompt-reference small {
  display: block;
  margin: 0;
  color: rgba(217, 208, 195, 0.58);
  font-size: 11px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}

.identity-prompt-reference strong {
  display: block;
  margin-top: 6px;
  color: #f4b1a7;
  font-size: 11px;
}

.identity-prompt-toggle-row {
  display: grid;
  gap: 8px;
}

.identity-prompt-main {
  display: grid;
  align-content: start;
  gap: 14px;
  padding: 14px;
  min-width: 0;
}

.identity-prompt-presets,
.identity-prompt-modifiers {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.identity-prompt-presets button,
.identity-prompt-modifiers button,
.identity-prompt-output button {
  border: 1px solid rgba(200, 167, 106, 0.18);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.055), rgba(255, 255, 255, 0.02));
  color: #d9d0c3;
  cursor: pointer;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.08em;
  padding: 9px 12px;
  text-transform: uppercase;
}

.identity-prompt-presets button:hover,
.identity-prompt-modifiers button:hover,
.identity-prompt-modifiers button.is-active,
.identity-prompt-output button:hover {
  border-color: rgba(200, 167, 106, 0.42);
  color: #ffe5a5;
}

.identity-prompt-modifiers button.is-active {
  background: linear-gradient(180deg, rgba(216, 181, 109, 0.18), rgba(216, 181, 109, 0.06));
  box-shadow: 0 0 16px rgba(216, 181, 109, 0.16);
}

.identity-prompt-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.identity-prompt-field {
  display: grid;
  gap: 7px;
  min-width: 0;
  border: 1px solid transparent;
  border-radius: 14px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.015);
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.identity-prompt-field.is-defined {
  border-color: rgba(216, 181, 109, 0.34);
  background: linear-gradient(180deg, rgba(216, 181, 109, 0.1), rgba(255, 255, 255, 0.02));
  box-shadow: inset 0 0 0 1px rgba(216, 181, 109, 0.04), 0 0 18px rgba(216, 181, 109, 0.08);
}

.identity-prompt-field span {
  color: #87d9f4;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.identity-prompt-field select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(108, 190, 228, 0.18);
  border-radius: 12px;
  background:
    linear-gradient(180deg, rgba(10, 20, 30, 0.92), rgba(4, 8, 12, 0.92));
  color: #d9d0c3;
  padding: 0 12px;
}

.identity-prompt-output {
  display: grid;
  gap: 10px;
  padding: 14px;
}

.identity-prompt-output-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.identity-prompt-output-head div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.identity-prompt-output textarea {
  min-height: 240px;
  resize: vertical;
  border: 1px solid rgba(108, 190, 228, 0.18);
  border-radius: 14px;
  background: rgba(2, 6, 10, 0.78);
  color: #dce8ef;
  font-family: "Courier New", monospace;
  font-size: 12px;
  line-height: 1.55;
  padding: 14px;
}

.identity-prompt-output details {
  color: rgba(217, 208, 195, 0.7);
  font-size: 12px;
}

.identity-prompt-output summary {
  cursor: pointer;
  color: #f1d78f;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.identity-premium-form-grid {
  display: grid;
  gap: 14px;
  align-content: start;
  min-width: 0;
}

.identity-premium-row {
  --identity-accent: #c8a76a;
  --identity-accent-rgb: 200, 167, 106;
  display: grid;
  grid-template-columns: minmax(210px, 0.32fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  position: relative;
  padding: 14px 16px;
  border: 1px solid rgba(var(--identity-accent-rgb), 0.14);
  border-radius: 16px;
  background:
    radial-gradient(circle at top left, rgba(var(--identity-accent-rgb), 0.12), transparent 38%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(7, 10, 15, 0.72);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.02),
    inset 0 0 0 1px rgba(var(--identity-accent-rgb), 0.03),
    0 0 24px rgba(var(--identity-accent-rgb), 0.04);
}

.identity-premium-row::before {
  content: "";
  position: absolute;
  left: 0;
  top: 14px;
  bottom: 14px;
  width: 2px;
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(var(--identity-accent-rgb), 0.95), rgba(var(--identity-accent-rgb), 0.18));
  box-shadow: 0 0 14px rgba(var(--identity-accent-rgb), 0.28);
}

.identity-premium-row.is-tall {
  align-items: start;
}

.identity-premium-row.is-defect {
  align-items: start;
}

.identity-premium-label {
  display: grid;
  gap: 6px;
  align-items: start;
}

.identity-premium-label h4 {
  margin: 0;
  color: var(--identity-accent);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
  letter-spacing: 0.08em;
  text-transform: none;
  text-shadow: 0 0 14px rgba(var(--identity-accent-rgb), 0.18);
}

.identity-premium-label p {
  margin: 0;
  color: rgba(217, 208, 195, 0.62);
  font-size: 12px;
  line-height: 1.55;
}

.identity-premium-control {
  display: grid;
  gap: 10px;
  min-width: 0;
}

.identity-premium-control input,
.identity-premium-control select,
.identity-premium-control textarea {
  width: 100%;
  border: 1px solid rgba(var(--identity-accent-rgb), 0.18);
  border-radius: 12px;
  color: #d9d0c3;
  background:
    linear-gradient(180deg, rgba(5, 8, 13, 0.96), rgba(10, 16, 24, 0.92));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), inset 0 0 24px rgba(0, 0, 0, 0.24);
  font-size: 13px;
  transition: border-color 180ms ease, box-shadow 200ms ease, background-color 200ms ease;
}

.identity-premium-control input,
.identity-premium-control select {
  min-height: 48px;
  padding: 0 14px;
}

.identity-premium-control textarea {
  min-height: 120px;
  padding: 14px;
  resize: vertical;
}

.identity-premium-control input::placeholder,
.identity-premium-control textarea::placeholder {
  color: rgba(217, 208, 195, 0.38);
}

.identity-premium-control input:focus,
.identity-premium-control select:focus,
.identity-premium-control textarea:focus {
  outline: none;
  border-color: rgba(var(--identity-accent-rgb), 0.46);
  box-shadow:
    0 0 0 3px rgba(var(--identity-accent-rgb), 0.08),
    0 0 24px rgba(var(--identity-accent-rgb), 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.identity-premium-control select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, #c8a76a 50%),
    linear-gradient(135deg, #c8a76a 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% - 3px),
    calc(100% - 16px) calc(50% - 3px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

.identity-premium-split-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.identity-premium-row.is-compact {
  grid-template-columns: 1fr;
  align-items: start;
}

.identity-premium-form-grid > .identity-premium-row:nth-of-type(1) {
  --identity-accent: #d7b06d;
  --identity-accent-rgb: 215, 176, 109;
}

.identity-premium-form-grid > .identity-premium-row:nth-of-type(2) {
  --identity-accent: #c98a63;
  --identity-accent-rgb: 201, 138, 99;
}

.identity-premium-form-grid > .identity-premium-row:nth-of-type(3) {
  --identity-accent: #77b7d7;
  --identity-accent-rgb: 119, 183, 215;
}

.identity-premium-split-row > .identity-premium-row:nth-of-type(1) {
  --identity-accent: #8dbf82;
  --identity-accent-rgb: 141, 191, 130;
}

.identity-premium-split-row > .identity-premium-row:nth-of-type(2) {
  --identity-accent: #84c9c3;
  --identity-accent-rgb: 132, 201, 195;
}

.identity-premium-form-grid > .identity-premium-row.is-tall:nth-of-type(4) {
  --identity-accent: #7eb2df;
  --identity-accent-rgb: 126, 178, 223;
}

.identity-premium-form-grid > .identity-premium-row.is-tall:nth-of-type(5) {
  --identity-accent: #d3a56d;
  --identity-accent-rgb: 211, 165, 109;
}

.identity-premium-form-grid > .identity-premium-row.is-tall:nth-of-type(6) {
  --identity-accent: #9cc77b;
  --identity-accent-rgb: 156, 199, 123;
}

.identity-premium-form-grid > .identity-premium-row.is-defect:nth-of-type(7) {
  --identity-accent: #c87b74;
  --identity-accent-rgb: 200, 123, 116;
}

.identity-premium-defect-toolbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.identity-choice-picker,
.identity-defect-picker {
  position: relative;
  min-width: 0;
}

.identity-choice-trigger,
.identity-defect-trigger,
.identity-premium-defect-toolbar .ghost-button {
  min-height: 52px;
  padding: 0 18px;
  border-color: rgba(200, 167, 106, 0.16);
  color: #d9d0c3;
  background: rgba(255, 255, 255, 0.03);
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.identity-choice-trigger,
.identity-defect-trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid rgba(200, 167, 106, 0.16);
  border-radius: 12px;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02), inset 0 0 24px rgba(0, 0, 0, 0.22);
  transition: border-color 180ms ease, box-shadow 180ms ease, color 180ms ease, background-color 180ms ease;
}

.identity-choice-trigger span,
.identity-defect-trigger span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.identity-choice-trigger::after,
.identity-defect-trigger::after {
  content: "";
  width: 10px;
  height: 10px;
  flex: 0 0 auto;
  border-right: 1px solid rgba(200, 167, 106, 0.78);
  border-bottom: 1px solid rgba(200, 167, 106, 0.78);
  transform: rotate(45deg) translateY(-2px);
  transition: transform 180ms ease;
}

.identity-choice-picker.is-open .identity-choice-trigger,
.identity-choice-trigger:hover,
.identity-defect-picker.is-open .identity-defect-trigger,
.identity-defect-trigger:hover,
.identity-premium-defect-toolbar .ghost-button:hover {
  border-color: rgba(200, 167, 106, 0.34);
  color: #f2e0b1;
}

.identity-choice-picker.is-open .identity-choice-trigger,
.identity-defect-picker.is-open .identity-defect-trigger {
  box-shadow:
    0 0 0 3px rgba(200, 167, 106, 0.07),
    0 0 24px rgba(155, 122, 67, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.identity-choice-picker.is-open .identity-choice-trigger::after,
.identity-defect-picker.is-open .identity-defect-trigger::after {
  transform: rotate(-135deg) translateY(-1px);
}

.identity-choice-menu,
.identity-defect-menu {
  position: absolute;
  bottom: calc(100% + 8px);
  left: 0;
  right: 0;
  z-index: 12;
  display: grid;
  gap: 6px;
  max-height: 260px;
  padding: 10px;
  overflow: auto;
  border: 1px solid rgba(200, 167, 106, 0.18);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(10, 14, 20, 0.98), rgba(6, 9, 14, 0.96));
  box-shadow:
    0 20px 44px rgba(0, 0, 0, 0.42),
    inset 0 1px 0 rgba(255, 255, 255, 0.03);
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 167, 106, 0.35) rgba(255, 255, 255, 0.03);
}

.identity-choice-option,
.identity-defect-option {
  width: 100%;
  min-height: 42px;
  padding: 10px 14px;
  border: 1px solid rgba(200, 167, 106, 0.1);
  border-radius: 10px;
  color: rgba(217, 208, 195, 0.86);
  background: rgba(255, 255, 255, 0.03);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-align: left;
  text-transform: uppercase;
  transition: border-color 180ms ease, background-color 180ms ease, color 180ms ease, transform 180ms ease;
}

.identity-choice-option:hover,
.identity-choice-option.is-selected,
.identity-defect-option:hover,
.identity-defect-option.is-selected {
  border-color: rgba(200, 167, 106, 0.32);
  color: #f2e0b1;
  background: linear-gradient(180deg, rgba(200, 167, 106, 0.12), rgba(255, 255, 255, 0.03));
}

.identity-choice-option.is-selected,
.identity-defect-option.is-selected {
  box-shadow: inset 0 0 0 1px rgba(255, 235, 198, 0.04);
}

.identity-premium-defect-toolbar .ghost-button:hover {
  background: linear-gradient(180deg, rgba(200, 167, 106, 0.12), rgba(255, 255, 255, 0.03));
}

.identity-premium-defect-details {
  gap: 12px;
}

.identity-premium-defect-copy {
  gap: 8px;
  padding: 14px 16px;
  border: 1px solid rgba(200, 167, 106, 0.12);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.identity-premium-defect-copy h5 {
  margin: 0;
  color: #c8a76a;
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.identity-premium-defect-copy p {
  color: rgba(217, 208, 195, 0.68);
}

.identity-premium-defect-balance {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.identity-premium-defect-panel {
  min-height: 0;
  padding: 13px 14px 13px 16px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.02);
}

.identity-premium-defect-panel strong {
  font-size: 11px;
}

.identity-premium-defect-panel p {
  font-size: 12px;
  line-height: 1.5;
}

.identity-premium-screen .identity-char-count {
  justify-self: end;
  color: rgba(217, 208, 195, 0.42);
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

@media (max-width: 1360px) {
  .identity-premium-body {
    grid-template-columns: minmax(320px, 0.38fr) minmax(0, 1fr);
  }

  .identity-premium-row {
    grid-template-columns: minmax(180px, 0.4fr) minmax(0, 1fr);
  }
}

@media (max-width: 1120px) {
  .identity-premium-shell {
    padding: 28px 24px 24px;
  }

  .identity-premium-body {
    grid-template-columns: 1fr;
  }

  .identity-premium-portrait-panel {
    grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
    gap: 18px;
    align-items: start;
  }

  .identity-premium-panel-head,
  .identity-premium-portrait-note {
    grid-column: 1 / -1;
  }

  .identity-premium-portrait-frame {
    min-height: clamp(420px, 56vh, 620px);
  }
}

@media (max-width: 860px) {
  .identity-premium-screen {
    padding: 12px;
  }

  .identity-premium-shell {
    padding: 22px 16px 18px;
  }

  .identity-premium-header {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .identity-premium-ornament {
    display: none;
  }

  .identity-premium-title-block h2 {
    font-size: 34px;
    letter-spacing: 0.12em;
  }

  .identity-premium-portrait-panel,
  .identity-premium-row,
  .identity-premium-split-row,
  .identity-premium-defect-balance,
  .identity-premium-defect-toolbar {
    grid-template-columns: 1fr;
  }

  .identity-premium-portrait-actions {
    grid-template-columns: 1fr;
  }

  .identity-premium-row {
    gap: 14px;
    padding: 14px;
  }

  .identity-premium-portrait-frame {
    min-height: 420px;
  }
}

/* Final creator steps: characteristics and complete review */
.builder-modal-shell:is(.is-attributes-step, .is-review-step) {
  height: min(92dvh, 860px);
  max-height: calc(100dvh - 40px);
}

.builder-modal-shell:is(.is-attributes-step, .is-review-step) .builder-modal-stage {
  grid-template-columns: minmax(0, 1fr);
}

.builder-modal-shell:is(.is-attributes-step, .is-review-step) .builder-stage-preview {
  display: none;
}

.builder-modal-shell:is(.is-attributes-step, .is-review-step) .builder-stage-card {
  padding: 0;
  background:
    radial-gradient(circle at 50% 0%, rgba(197, 154, 82, 0.08), transparent 34%),
    linear-gradient(135deg, rgba(4, 8, 13, 0.97), rgba(8, 13, 20, 0.94)),
    var(--builder-stage-image, url("./assets/worlds/lumina.jpg")) center / cover;
  scrollbar-width: thin;
  scrollbar-color: rgba(200, 167, 106, 0.42) rgba(255, 255, 255, 0.03);
}

.builder-modal-shell:is(.is-attributes-step, .is-review-step) .builder-modal-actions {
  padding: 12px 28px 18px;
  border-top: 1px solid rgba(200, 167, 106, 0.1);
  background: rgba(5, 9, 14, 0.96);
}

.builder-modal-shell:is(.is-attributes-step, .is-review-step) #prevStepButton,
.builder-modal-shell:is(.is-attributes-step, .is-review-step) #nextStepButton {
  position: relative;
  min-width: 178px;
  height: 54px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: var(--text);
  background: rgba(18, 23, 31, 0.76);
  box-shadow: 0 10px 32px rgba(0, 0, 0, 0.34), inset 0 0 18px rgba(255, 255, 255, 0.05);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.characteristics-screen,
.final-review-screen {
  width: min(100%, 1480px);
  min-height: 100%;
  margin: 0 auto;
  padding: 30px;
  color: #d9d0c3;
}

.characteristics-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: end;
  padding: 26px 28px;
  border: 1px solid rgba(200, 167, 106, 0.22);
  border-radius: 18px;
  background:
    linear-gradient(110deg, rgba(17, 24, 33, 0.96), rgba(8, 13, 20, 0.76)),
    radial-gradient(circle at 80% 0%, rgba(200, 167, 106, 0.12), transparent 44%);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.characteristics-header h2,
.final-review-identity h2 {
  margin: 4px 0 8px;
  color: #ead8ad;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(30px, 3vw, 46px);
  letter-spacing: 0.08em;
  text-shadow: 0 0 22px rgba(200, 167, 106, 0.16);
}

.characteristics-header p {
  max-width: 820px;
  margin: 0;
  color: rgba(217, 208, 195, 0.68);
  line-height: 1.65;
}

.builder-inline-note {
  grid-column: 1 / -1;
  max-width: none;
  padding: 10px 12px;
  border: 1px solid rgba(102, 197, 184, 0.28);
  border-radius: 10px;
  color: #c9f4ed;
  background: rgba(102, 197, 184, 0.08);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.characteristics-roll-button {
  min-width: 230px;
  min-height: 68px;
  display: grid;
  gap: 4px;
  place-content: center;
  border: 1px solid rgba(228, 187, 105, 0.48);
  border-radius: 14px;
  color: #181006;
  background: linear-gradient(135deg, #e0bd70, #a97c38);
  box-shadow: 0 12px 28px rgba(128, 83, 25, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.38);
  text-transform: uppercase;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.characteristics-roll-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.06);
  box-shadow: 0 16px 36px rgba(128, 83, 25, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.42);
}

.characteristics-roll-button.is-standard-array {
  border-color: rgba(102, 197, 184, 0.5);
  color: #061716;
  background: linear-gradient(135deg, #78d8c7, #3f8f84);
  box-shadow: 0 12px 28px rgba(24, 112, 104, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.34);
}

.characteristics-roll-button.is-standard-array:hover {
  box-shadow: 0 16px 36px rgba(24, 112, 104, 0.34), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.characteristics-roll-button span {
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.12em;
}

.characteristics-roll-button small {
  font-size: 10px;
  letter-spacing: 0.06em;
}

.characteristics-methods {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0;
}

.characteristics-method {
  min-height: 66px;
  display: grid;
  gap: 5px;
  align-content: center;
  padding: 12px 16px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 14px;
  color: rgba(217, 208, 195, 0.66);
  background: rgba(10, 15, 22, 0.82);
  text-align: left;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease, transform 180ms ease;
}

.characteristics-method:hover,
.characteristics-method.is-active {
  transform: translateY(-1px);
  border-color: rgba(200, 167, 106, 0.42);
  color: #f0dfb5;
  background: linear-gradient(135deg, rgba(200, 167, 106, 0.13), rgba(10, 15, 22, 0.88));
}

.characteristics-method strong {
  font-size: 13px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.characteristics-method span {
  font-size: 11px;
}

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

.characteristic-card {
  --characteristic-accent: 200, 167, 106;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(var(--characteristic-accent), 0.22);
  border-radius: 16px;
  background:
    linear-gradient(145deg, rgba(var(--characteristic-accent), 0.08), rgba(8, 13, 20, 0.92) 46%),
    rgba(8, 13, 20, 0.9);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22), inset 0 1px 0 rgba(255, 255, 255, 0.025);
}

.characteristic-card:nth-child(2) { --characteristic-accent: 101, 176, 203; }
.characteristic-card:nth-child(3) { --characteristic-accent: 122, 178, 115; }
.characteristic-card:nth-child(4) { --characteristic-accent: 151, 132, 202; }
.characteristic-card:nth-child(5) { --characteristic-accent: 204, 139, 104; }
.characteristic-card:nth-child(6) { --characteristic-accent: 195, 112, 135; }

.characteristic-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  padding: 12px 12px 10px;
  border-bottom: 1px solid rgba(var(--characteristic-accent), 0.13);
}

.characteristic-card > header > div > span {
  color: rgb(var(--characteristic-accent));
  font-size: 10px;
  font-weight: 900;
  letter-spacing: 0.2em;
}

.characteristic-card h3 {
  margin: 4px 0;
  color: #f1e7d6;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 15px;
}

.characteristic-card p {
  margin: 0;
  color: rgba(217, 208, 195, 0.55);
  font-size: 10px;
  line-height: 1.35;
}

.characteristic-total {
  min-width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--characteristic-accent), 0.4);
  border-radius: 12px;
  color: #fff5de;
  background: rgba(var(--characteristic-accent), 0.12);
  box-shadow: 0 0 24px rgba(var(--characteristic-accent), 0.1);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 20px;
}

.characteristic-calculation {
  display: grid;
  grid-template-columns: minmax(0, 86px) minmax(0, 1fr);
  gap: 8px;
  align-items: end;
  padding: 10px 12px;
}

.characteristic-calculation label {
  display: grid;
  gap: 7px;
  color: rgba(217, 208, 195, 0.58);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.characteristic-calculation input {
  width: 100%;
  min-height: 42px;
  border: 1px solid rgba(var(--characteristic-accent), 0.25);
  border-radius: 10px;
  color: #f6ead4;
  background: rgba(3, 7, 11, 0.74);
  font-size: 16px;
  font-weight: 800;
  text-align: center;
}

.characteristic-formula {
  min-height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.025);
  color: rgba(217, 208, 195, 0.7);
  font-size: 12px;
}

.characteristic-formula strong {
  color: rgb(var(--characteristic-accent));
  font-size: 15px;
}

.characteristic-modifiers {
  min-height: 76px;
  padding: 0 12px 12px;
}

.characteristic-modifiers h4 {
  margin: 0 0 6px;
  color: rgba(217, 208, 195, 0.48);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.characteristic-modifiers > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  padding: 5px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.055);
  font-size: 10px;
}

.characteristic-modifiers > div strong {
  color: rgb(var(--characteristic-accent));
}

.derived-characteristics {
  margin-top: 16px;
  padding: 22px;
  border: 1px solid rgba(200, 167, 106, 0.16);
  border-radius: 18px;
  background: rgba(8, 13, 20, 0.84);
}

.derived-characteristics > header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 28px;
  align-items: end;
  margin-bottom: 16px;
}

.derived-characteristics h3 {
  margin: 4px 0 0;
  color: #ead8ad;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.derived-characteristics > header > p {
  max-width: 760px;
  justify-self: end;
  margin: 0;
  color: rgba(217, 208, 195, 0.56);
  font-size: 12px;
  line-height: 1.55;
}

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

.derived-characteristic-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 13px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.025);
}

.derived-characteristic-score {
  min-height: 62px;
  display: grid;
  place-content: center;
  border-right: 1px solid rgba(200, 167, 106, 0.16);
  text-align: center;
}

.derived-characteristic-score strong {
  color: #d9b56d;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.derived-characteristic-score span {
  color: rgba(217, 208, 195, 0.72);
  font-size: 9px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.derived-characteristic-card p,
.derived-characteristic-card small {
  margin: 0;
  color: rgba(217, 208, 195, 0.5);
  font-size: 10px;
  line-height: 1.45;
}

.derived-formula {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 5px 0;
  color: #d8c6a2;
  font-size: 11px;
}

.characteristics-action-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: end;
  gap: 12px;
}

.characteristics-skip-button[disabled],
.characteristics-roll-button[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

.characteristics-roll-stage {
  display: grid;
  grid-template-columns: minmax(240px, 0.34fr) minmax(0, 1fr);
  gap: 16px;
  align-items: stretch;
  margin: 16px 0;
  padding: 18px 20px;
  border: 1px solid rgba(200, 167, 106, 0.16);
  border-radius: 18px;
  background: linear-gradient(145deg, rgba(8, 13, 20, 0.92), rgba(7, 11, 17, 0.82));
}

.characteristics-stage-copy h3 {
  margin: 4px 0 8px;
  color: #ead8ad;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
}

.characteristics-stage-copy p:last-child {
  margin: 0;
  color: rgba(217, 208, 195, 0.68);
  line-height: 1.55;
}

.characteristics-pool {
  min-height: 110px;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 12px;
  padding: 16px;
  border: 1px dashed rgba(200, 167, 106, 0.2);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.02);
}

.characteristics-pool-empty {
  color: rgba(217, 208, 195, 0.44);
  font-size: 12px;
}

.ability-roll-dice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 16px 0 10px;
}

.ability-roll-die {
  width: 72px;
  height: 72px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(214, 176, 98, 0.3);
  border-radius: 14px;
  color: #fbf4e2;
  background:
    linear-gradient(145deg, rgba(31, 38, 50, 0.96), rgba(11, 16, 24, 0.98)),
    rgba(11, 16, 24, 0.96);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 12px 24px rgba(0, 0, 0, 0.24);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  font-weight: 800;
}

.ability-roll-die.is-rolling {
  animation: ability-die-spin 760ms cubic-bezier(.2,.82,.22,1) infinite;
}

.ability-roll-die.is-dropped {
  opacity: 0.34;
  filter: saturate(0.35);
  text-decoration: line-through;
}

.ability-roll-caption {
  margin: 0;
  color: rgba(217, 208, 195, 0.68);
  line-height: 1.5;
}

.ability-roll-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: grid;
  place-items: center;
  padding: 24px;
}

.ability-roll-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 7, 12, 0.74);
  backdrop-filter: blur(12px);
  animation: ability-roll-fade 260ms ease both;
}

.ability-roll-modal {
  position: relative;
  width: min(760px, calc(100vw - 48px));
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(200, 167, 106, 0.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(200, 167, 106, 0.12), transparent 34%),
    linear-gradient(160deg, rgba(12, 18, 28, 0.98), rgba(6, 10, 16, 0.97));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.46);
  animation: ability-roll-pop 320ms cubic-bezier(.18,.88,.24,1) both;
}

.ability-roll-modal-head {
  display: grid;
  gap: 6px;
  text-align: center;
}

.ability-roll-modal-head h3 {
  margin: 0;
  color: #f0dfb2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.2vw, 38px);
}

.ability-roll-modal-head span {
  color: rgba(217, 208, 195, 0.66);
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.ability-roll-dice-row.is-modal {
  justify-content: center;
  margin: 4px 0;
}

.ability-roll-caption.is-modal {
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
}

.ability-roll-result-token {
  display: grid;
  place-items: center;
}

.ability-roll-result-token .ability-roll-token {
  min-width: 180px;
  justify-items: center;
  text-align: center;
}

.ability-roll-next-button {
  justify-self: center;
  min-width: 220px;
}

.ability-roll-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.ability-method-modal-layer {
  position: fixed;
  inset: 0;
  z-index: 91;
  display: grid;
  place-items: center;
  padding: 24px;
}

.ability-method-modal-backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(4, 7, 12, 0.76);
  backdrop-filter: blur(12px);
}

.ability-method-modal {
  position: relative;
  width: min(740px, calc(100vw - 48px));
  max-height: min(760px, calc(100vh - 48px));
  overflow: auto;
  display: grid;
  gap: 18px;
  padding: 24px;
  border: 1px solid rgba(200, 167, 106, 0.24);
  border-radius: 22px;
  background:
    radial-gradient(circle at top, rgba(200, 167, 106, 0.12), transparent 34%),
    linear-gradient(160deg, rgba(12, 18, 28, 0.98), rgba(6, 10, 16, 0.97));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.46);
}

.ability-method-modal.is-standard-array {
  border-color: rgba(102, 197, 184, 0.3);
  background:
    radial-gradient(circle at top, rgba(102, 197, 184, 0.12), transparent 34%),
    linear-gradient(160deg, rgba(12, 22, 28, 0.98), rgba(6, 12, 16, 0.97));
}

.ability-method-modal-head {
  display: grid;
  gap: 8px;
  text-align: center;
}

.ability-method-modal-head h3 {
  margin: 0;
  color: #f0dfb2;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(28px, 3.2vw, 38px);
}

.ability-method-modal-head p,
.ability-method-modal-copy p {
  margin: 0;
  color: rgba(217, 208, 195, 0.7);
  line-height: 1.58;
}

.ability-method-modal-copy {
  display: grid;
  gap: 12px;
}

.standard-array-values {
  display: grid;
  place-items: center;
  min-height: 54px;
  border: 1px solid rgba(102, 197, 184, 0.26);
  border-radius: 14px;
  color: #dffcf5;
  background: rgba(102, 197, 184, 0.08);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 24px;
  letter-spacing: 0.08em;
}

.ability-method-modal-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.ability-roll-token {
  min-width: 104px;
  display: grid;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid rgba(200, 167, 106, 0.2);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(255, 255, 255, 0.05), rgba(9, 13, 19, 0.92));
  box-shadow: 0 10px 22px rgba(0, 0, 0, 0.18);
  cursor: grab;
}

.ability-roll-token strong {
  color: #fff4d1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 28px;
  line-height: 1;
}

.ability-roll-token span {
  color: rgba(217, 208, 195, 0.62);
  font-size: 11px;
  line-height: 1.4;
}

.ability-roll-token.is-assigned {
  width: 100%;
  min-width: 0;
}

.ability-roll-token.is-touch-selected {
  border-color: rgba(240, 196, 103, 0.82);
  background: rgba(215, 168, 79, 0.18);
  box-shadow: 0 0 0 2px rgba(215, 168, 79, 0.12), 0 0 24px rgba(215, 168, 79, 0.22);
}

.ability-roll-token.is-fresh {
  animation: ability-roll-enter 560ms cubic-bezier(.21,.88,.27,1) both;
}

.inventory-touch-actions {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin-top: 8px;
}

.inventory-touch-actions button {
  min-height: 40px;
  padding: 7px 9px;
  font-size: 10px;
}

.dm-combat-touch-order {
  display: none;
  min-width: 42px;
  padding: 0;
  font-size: 18px;
}

@media (pointer: coarse), (max-width: 980px) {
  .inventory-touch-actions {
    display: grid;
  }

  .dm-combat-touch-order {
    display: inline-grid;
    place-items: center;
  }

  .ability-roll-token,
  .characteristic-assignment-slot {
    cursor: pointer;
    touch-action: manipulation;
  }
}

@media (pointer: coarse) {
  button,
  select,
  input:not([type="checkbox"]):not([type="radio"]),
  summary,
  [role="button"] {
    min-height: 44px;
    touch-action: manipulation;
  }

  textarea {
    touch-action: pan-y;
  }

  .race-list-scroll,
  .class-select-scroll,
  .builder-system-options,
  .sheet-tabs,
  .dm-campaign-section-tabs,
  .shop-categories {
    overscroll-behavior-x: contain;
    touch-action: pan-x;
  }

  .builder-stage-card,
  .builder-modal-body,
  .class-detail-body,
  .dm-gift-modal-body,
  .dm-gift-catalog-list,
  .dm-campaign-character-list,
  .sheet-content {
    overscroll-behavior-y: contain;
    touch-action: pan-y;
  }

  button:hover,
  [role="button"]:hover {
    transform: none;
  }
}

.characteristic-assignment-slot {
  min-height: 76px;
  margin: 0 12px;
  padding: 10px;
  border: 1px dashed rgba(var(--characteristic-accent), 0.28);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.025);
}

.characteristic-assignment-slot.is-filled {
  border-style: solid;
  background: rgba(var(--characteristic-accent), 0.08);
}

.characteristic-assignment-empty {
  min-height: 54px;
  display: grid;
  place-items: center;
  color: rgba(217, 208, 195, 0.44);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-align: center;
}

.characteristic-calculation {
  grid-template-columns: minmax(0, 86px) minmax(0, 1fr);
}

.characteristic-base-line {
  display: grid;
  gap: 7px;
  color: rgba(217, 208, 195, 0.58);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.characteristic-base-line strong {
  min-height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(var(--characteristic-accent), 0.25);
  border-radius: 10px;
  color: #f6ead4;
  background: rgba(3, 7, 11, 0.74);
  font-size: 15px;
  font-weight: 800;
}

@keyframes ability-die-spin {
  0% { transform: rotateX(0deg) rotateY(0deg) scale(0.96); }
  35% { transform: rotateX(160deg) rotateY(120deg) scale(1.06); }
  70% { transform: rotateX(310deg) rotateY(260deg) scale(0.98); }
  100% { transform: rotateX(360deg) rotateY(360deg) scale(1); }
}

@keyframes ability-roll-enter {
  0% { opacity: 0; transform: translateY(-12px) scale(0.92); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes ability-roll-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes ability-roll-pop {
  0% { opacity: 0; transform: translateY(18px) scale(0.96); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}

.final-review-screen {
  display: grid;
  gap: 16px;
}

.final-review-hero {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) minmax(240px, 0.35fr);
  gap: 24px;
  align-items: stretch;
  padding: 20px;
  border: 1px solid rgba(200, 167, 106, 0.24);
  border-radius: 20px;
  background:
    linear-gradient(110deg, rgba(18, 25, 34, 0.96), rgba(8, 13, 20, 0.82)),
    radial-gradient(circle at 70% 0%, rgba(200, 167, 106, 0.14), transparent 42%);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.03);
}

.final-review-portrait {
  min-height: 220px;
  overflow: hidden;
  border: 1px solid rgba(200, 167, 106, 0.32);
  border-radius: 14px;
  background: #070b11;
}

.final-review-portrait img,
.final-review-portrait .portrait-placeholder {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 25%;
}

.final-review-identity {
  align-self: center;
}

.final-review-identity h2 {
  font-size: clamp(28px, 2.6vw, 42px);
}

.final-review-identity > p:last-child {
  max-width: 760px;
  margin: 14px 0 0;
  color: rgba(217, 208, 195, 0.62);
  line-height: 1.6;
}

.final-review-subtitle {
  margin: 0;
  color: rgba(235, 220, 190, 0.72);
  font-size: 14px;
  letter-spacing: 0.04em;
}

.final-review-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.final-review-pills span,
.final-review-derived span {
  padding: 7px 10px;
  border: 1px solid rgba(200, 167, 106, 0.18);
  border-radius: 999px;
  color: #d8c6a2;
  background: rgba(200, 167, 106, 0.07);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.final-review-vitals {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  align-content: center;
}

.final-review-vitals > div {
  min-height: 82px;
  display: grid;
  place-content: center;
  gap: 5px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.075);
  border-radius: 12px;
  background: rgba(2, 6, 10, 0.46);
  text-align: center;
}

.final-review-vitals span {
  color: rgba(217, 208, 195, 0.5);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.final-review-vitals strong {
  color: #e4c477;
  font-size: 16px;
}

.final-review-section,
.character-visibility-section {
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.085);
  border-radius: 18px;
  background: rgba(7, 12, 18, 0.9);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

.final-review-section > header {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 16px;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(200, 167, 106, 0.12);
}

.final-review-section > header > span {
  min-width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(200, 167, 106, 0.28);
  border-radius: 50%;
  color: #e0bd70;
  background: rgba(200, 167, 106, 0.08);
  font-family: Georgia, "Times New Roman", serif;
}

.final-review-section h3,
.character-visibility-section h3 {
  margin: 0;
  color: #ead8ad;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 21px;
}

.final-review-section > header p,
.character-visibility-section > div:first-child > p:last-child {
  margin: 4px 0 0;
  color: rgba(217, 208, 195, 0.52);
  font-size: 11px;
}

.final-review-facts {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
  margin-bottom: 12px;
}

.final-review-facts article {
  min-height: 70px;
  display: grid;
  gap: 7px;
  align-content: center;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.024);
}

.final-review-facts span {
  color: rgba(217, 208, 195, 0.46);
  font-size: 9px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.final-review-facts strong {
  color: #e3d7c5;
  font-size: 12px;
}

.final-review-copy-grid,
.final-review-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.final-review-copy-grid article,
.final-review-columns article {
  min-width: 0;
  padding: 15px 16px;
  border: 1px solid rgba(255, 255, 255, 0.065);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.022);
}

.final-review-copy-grid h4,
.final-review-columns h4 {
  margin: 0 0 9px;
  color: #d6ad62;
  font-size: 10px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.final-review-copy-grid p,
.final-review-empty {
  margin: 0;
  color: rgba(217, 208, 195, 0.67);
  font-size: 11px;
  line-height: 1.6;
  white-space: pre-wrap;
}

.final-review-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.final-review-list li {
  position: relative;
  padding-left: 14px;
  color: rgba(217, 208, 195, 0.67);
  font-size: 11px;
  line-height: 1.5;
}

.final-review-list li::before {
  content: "";
  position: absolute;
  top: 0.62em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #c8a76a;
  box-shadow: 0 0 8px rgba(200, 167, 106, 0.4);
}

.final-review-abilities {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 9px;
}

.final-review-abilities article {
  min-height: 100px;
  display: grid;
  place-content: center;
  gap: 2px;
  border: 1px solid rgba(200, 167, 106, 0.16);
  border-radius: 13px;
  background: linear-gradient(180deg, rgba(200, 167, 106, 0.08), rgba(255, 255, 255, 0.018));
  text-align: center;
}

.final-review-abilities span {
  color: rgba(217, 208, 195, 0.5);
  font-size: 10px;
  letter-spacing: 0.14em;
}

.final-review-abilities strong {
  color: #e9c775;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 30px;
}

.final-review-abilities small {
  color: rgba(217, 208, 195, 0.58);
  font-size: 9px;
}

.final-review-derived {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 12px 0;
}

.character-visibility-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.7fr) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border-color: rgba(200, 167, 106, 0.24);
  background:
    linear-gradient(120deg, rgba(200, 167, 106, 0.08), rgba(7, 12, 18, 0.94) 40%),
    rgba(7, 12, 18, 0.94);
}

.character-visibility-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.character-visibility-options button {
  min-height: 92px;
  display: grid;
  gap: 7px;
  align-content: center;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 13px;
  color: rgba(217, 208, 195, 0.64);
  background: rgba(255, 255, 255, 0.025);
  text-align: left;
  transition: transform 180ms ease, border-color 180ms ease, background-color 180ms ease, color 180ms ease;
}

.character-visibility-options button:hover,
.character-visibility-options button.is-selected {
  transform: translateY(-1px);
  border-color: rgba(200, 167, 106, 0.42);
  color: #f0dfb5;
  background: rgba(200, 167, 106, 0.1);
}

.character-visibility-options strong {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 16px;
}

.character-visibility-options span {
  font-size: 10px;
  line-height: 1.45;
}

.character-visibility-policy {
  grid-column: 2;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  color: rgba(217, 208, 195, 0.5);
  font-size: 9px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.character-visibility-policy strong {
  color: #d9b56d;
}

.create-character-button {
  grid-column: 3;
  grid-row: 1 / span 2;
  min-width: 210px;
  min-height: 78px;
  border: 1px solid rgba(240, 202, 123, 0.56);
  border-radius: 15px;
  color: #1b1106;
  background: linear-gradient(135deg, #e4c477, #aa7a35);
  box-shadow: 0 18px 36px rgba(121, 78, 23, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.42);
  font-size: 13px;
  font-weight: 950;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: transform 180ms ease, filter 180ms ease, box-shadow 180ms ease;
}

.create-character-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.08);
  box-shadow: 0 22px 44px rgba(121, 78, 23, 0.38), inset 0 1px 0 rgba(255, 255, 255, 0.46);
}

@media (max-width: 1240px) {
  .characteristics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .final-review-hero {
    grid-template-columns: 160px minmax(0, 1fr);
  }

  .final-review-vitals {
    grid-column: 1 / -1;
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .final-review-facts {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .character-visibility-section {
    grid-template-columns: minmax(240px, 0.7fr) minmax(0, 1fr);
  }

  .create-character-button {
    grid-column: 1 / -1;
    grid-row: auto;
    width: 100%;
  }
}

@media (max-width: 1480px) {
  .characteristics-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1240px) {
  .characteristics-roll-stage,
  .derived-characteristics-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .characteristics-screen,
  .final-review-screen {
    padding: 16px;
  }

  .characteristics-header,
  .characteristics-roll-stage,
  .derived-characteristics > header,
  .final-review-hero,
  .character-visibility-section {
    grid-template-columns: 1fr;
  }

  .characteristics-roll-button {
    width: 100%;
  }

  .characteristics-methods,
  .characteristics-grid,
  .derived-characteristics-grid,
  .final-review-facts,
  .final-review-copy-grid,
  .final-review-columns,
  .final-review-abilities,
  .character-visibility-options {
    grid-template-columns: 1fr;
  }

  .derived-characteristics > header > p {
    justify-self: start;
  }

  .final-review-portrait {
    min-height: 380px;
  }

  .final-review-vitals {
    grid-column: auto;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .character-visibility-policy,
  .create-character-button {
    grid-column: auto;
  }

  .builder-modal-shell:is(.is-attributes-step, .is-review-step) .builder-modal-actions {
    padding: 10px 16px 14px;
  }

  .builder-modal-shell:is(.is-attributes-step, .is-review-step) #prevStepButton,
  .builder-modal-shell:is(.is-attributes-step, .is-review-step) #nextStepButton {
    min-width: 132px;
  }

  .ability-roll-modal {
    width: min(100vw - 24px, 680px);
    padding: 18px;
  }

  .ability-roll-die {
    width: 60px;
    height: 60px;
    font-size: 24px;
  }
}

/* Settings hub and database-backed class administration */
.settings-hub {
  display: grid;
  gap: 18px;
  min-height: 100%;
  padding: clamp(16px, 2.2vw, 30px);
  color: #e8e1d5;
}

.settings-hub-head,
.class-admin-editor-head,
.class-admin-collection > header,
.class-validation-panel > header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.settings-hub-head h1,
.class-admin-editor-head h2,
.class-admin-sidebar h2 {
  margin: 2px 0 6px;
  color: #f0e6d2;
  font-family: Georgia, "Times New Roman", serif;
  letter-spacing: .08em;
}

.settings-hub-head p,
.class-admin-editor-head p,
.class-admin-collection header p {
  max-width: 760px;
  margin: 0;
  color: #9fa8b4;
}

.settings-storage-badge {
  flex: 0 0 auto;
  padding: 9px 13px;
  border: 1px solid rgba(204, 168, 94, .42);
  border-radius: 10px;
  background: rgba(151, 111, 40, .12);
  color: #e4c77f;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.settings-tabs,
.class-admin-section-tabs {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  padding: 5px;
  border: 1px solid rgba(120, 143, 165, .2);
  border-radius: 14px;
  background: rgba(4, 9, 14, .76);
  scrollbar-width: thin;
}

.settings-tabs button,
.class-admin-section-tabs button {
  min-height: 42px;
  padding: 9px 15px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #929ca8;
  font-weight: 800;
  letter-spacing: .06em;
  white-space: nowrap;
}

.settings-tabs button:hover,
.class-admin-section-tabs button:hover {
  color: #e7edf4;
  background: rgba(77, 116, 151, .12);
}

.settings-tabs button.is-active,
.class-admin-section-tabs button.is-active {
  border-color: rgba(218, 177, 88, .5);
  background: linear-gradient(135deg, rgba(187, 137, 48, .25), rgba(29, 53, 72, .34));
  color: #f1d58d;
  box-shadow: inset 0 0 20px rgba(218, 177, 88, .06);
}

.settings-tab-content,
.additional-rules-panel {
  min-width: 0;
}

.additional-rules-panel {
  display: grid;
  gap: 18px;
}

.admin-optional-rule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px;
  border: 1px solid rgba(115, 140, 161, .24);
  border-radius: 14px;
  background: linear-gradient(145deg, rgba(11, 19, 27, .95), rgba(5, 10, 16, .96));
}

.admin-optional-rule span {
  color: #d7b968;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.admin-optional-rule strong {
  display: block;
  margin: 4px 0;
  color: #eef1f4;
}

.admin-optional-rule p {
  margin: 0;
  color: #98a2ad;
}

.class-admin-shell {
  display: grid;
  grid-template-columns: minmax(250px, 310px) minmax(0, 1fr);
  gap: 14px;
  min-height: 660px;
}

.content-admin-shell {
  display: grid;
  grid-template-columns: minmax(260px, 330px) minmax(0, 1fr);
  gap: 14px;
  min-height: 660px;
}

.class-admin-sidebar,
.class-admin-main {
  min-width: 0;
  border: 1px solid rgba(105, 132, 156, .25);
  border-radius: 16px;
  background:
    linear-gradient(150deg, rgba(12, 21, 30, .97), rgba(4, 9, 14, .98));
  box-shadow: 0 18px 45px rgba(0, 0, 0, .24), inset 0 1px rgba(255, 255, 255, .025);
}

.class-admin-sidebar {
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 220px);
  overflow: hidden;
}

.class-admin-sidebar > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  border-bottom: 1px solid rgba(105, 132, 156, .17);
}

.class-admin-sidebar > header h2 {
  font-size: 23px;
}

.class-admin-list {
  display: grid;
  gap: 7px;
  min-height: 190px;
  padding: 10px;
  overflow-y: auto;
}

.class-admin-list-item {
  display: grid;
  grid-template-columns: 8px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(105, 132, 156, .16);
  border-radius: 11px;
  background: rgba(7, 14, 21, .8);
  color: #dfe5eb;
  text-align: left;
}

.class-admin-list-item:hover {
  border-color: rgba(93, 163, 216, .42);
  background: rgba(21, 42, 58, .62);
}

.class-admin-list-item.is-active {
  border-color: rgba(216, 173, 78, .58);
  background: linear-gradient(120deg, rgba(139, 97, 29, .22), rgba(21, 43, 59, .64));
  box-shadow: inset 3px 0 #d5ac55;
}

.class-admin-list-item > span:nth-child(2) {
  min-width: 0;
}

.class-admin-list-item strong,
.class-admin-list-item small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-admin-list-item small {
  margin-top: 3px;
  color: #7f8b96;
}

.class-admin-list-item em {
  color: #b9a66f;
  font-size: 10px;
  font-style: normal;
  text-align: right;
}

.class-admin-list-mark {
  width: 7px;
  height: 30px;
  border-radius: 99px;
  background: #8a939c;
}

.class-admin-list-mark.is-active {
  background: #61c98b;
  box-shadow: 0 0 12px rgba(97, 201, 139, .46);
}

.class-admin-list-mark.is-blocked {
  background: #d27065;
}

.class-admin-list-mark.is-draft {
  background: #d2a952;
}

.class-admin-import {
  margin: 10px;
  padding: 11px;
  border: 1px solid rgba(204, 168, 94, .24);
  border-radius: 12px;
  background: rgba(110, 78, 25, .08);
}

.class-admin-import summary {
  cursor: pointer;
  color: #dbc078;
  font-weight: 800;
}

.class-admin-import label,
.class-admin-form-grid label {
  display: grid;
  gap: 7px;
  color: #aeb8c2;
  font-size: 11px;
  font-weight: 750;
  letter-spacing: .04em;
}

.class-admin-import textarea {
  min-height: 130px;
  margin-top: 10px;
}

.class-admin-import > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 9px;
}

.is-file-button {
  position: relative;
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.is-file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.class-import-review {
  display: grid !important;
  gap: 5px !important;
  padding: 10px;
  border-radius: 10px;
  background: rgba(28, 62, 51, .35);
}

.class-import-review.has-errors {
  background: rgba(83, 32, 32, .35);
}

.class-import-review p {
  margin: 0;
  color: #aab5bd;
  font-size: 11px;
}

.class-import-review p.is-error {
  color: #ef9287;
}

.class-admin-main {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.class-admin-notice {
  margin: 12px 12px 0;
  padding: 10px 13px;
  border: 1px solid rgba(91, 170, 129, .38);
  border-radius: 10px;
  background: rgba(34, 91, 63, .25);
  color: #aee1c1;
}

.class-admin-notice.is-error {
  border-color: rgba(210, 89, 80, .46);
  background: rgba(91, 34, 31, .28);
  color: #f3a19a;
}

.class-admin-editor-head {
  padding: 16px 18px;
  border-bottom: 1px solid rgba(105, 132, 156, .17);
}

.class-admin-editor-head h2 {
  font-size: clamp(22px, 2vw, 31px);
}

.class-admin-head-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.class-admin-head-actions button {
  min-height: 38px;
  padding-inline: 12px;
}

.class-admin-overview {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 7px;
  padding: 12px 14px 0;
}

.class-admin-overview article {
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(105, 132, 156, .17);
  border-radius: 9px;
  background: rgba(6, 13, 20, .68);
}

.class-admin-overview span,
.class-admin-overview strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-admin-overview span {
  color: #778691;
  font-size: 9px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.class-admin-overview strong {
  margin-top: 4px;
  color: #d9c38d;
  font-size: 12px;
}

.class-admin-builder-guide {
  display: grid;
  gap: 6px;
  margin: 12px 14px 0;
  padding: 14px 16px;
  border: 1px solid rgba(112, 151, 177, .24);
  border-radius: 12px;
  background: rgba(10, 20, 29, .72);
}

.class-admin-builder-guide h3 {
  margin: 0;
  color: #f0d385;
  font-size: 15px;
}

.class-admin-builder-guide p {
  margin: 0;
  color: #9da8b4;
  font-size: 13px;
  line-height: 1.5;
}

.class-admin-template-panel {
  display: grid;
  gap: 10px;
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid rgba(102, 130, 154, .2);
  border-radius: 12px;
  background: rgba(5, 12, 18, .54);
}

.class-admin-template-panel strong {
  color: #d9bc72;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.class-admin-template-panel > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.class-admin-template-panel button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(121, 148, 170, .24);
  border-radius: 999px;
  background: rgba(16, 29, 40, .74);
  color: #c8d1d9;
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
}

.class-admin-template-panel button:hover {
  border-color: rgba(215, 177, 89, .62);
  color: #f0d99a;
}

.class-admin-stack {
  display: grid;
  gap: 18px;
}

.class-admin-magic-summary {
  margin: 0;
}

.class-admin-token-picker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  padding: 12px;
  border: 1px solid rgba(102, 130, 154, .2);
  border-radius: 12px;
  background: rgba(5, 12, 18, .54);
}

.class-admin-token-picker strong {
  flex: 1 0 100%;
  color: #d9bc72;
  font-size: 11px;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.class-admin-token-picker button {
  min-height: 32px;
  padding: 6px 10px;
  border: 1px solid rgba(121, 148, 170, .24);
  border-radius: 999px;
  background: rgba(16, 29, 40, .74);
  color: #c8d1d9;
  font-size: 12px;
  font-weight: 800;
}

.class-admin-token-picker button.is-active {
  border-color: rgba(215, 177, 89, .62);
  background: rgba(161, 113, 36, .26);
  color: #f0d99a;
}

.class-admin-token-picker button:disabled {
  opacity: .55;
}

.content-admin-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  padding: 10px;
  border-bottom: 1px solid rgba(105, 132, 156, .17);
}

.content-admin-type-grid button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 38px;
  padding: 8px 10px;
  border: 1px solid rgba(105, 132, 156, .16);
  border-radius: 10px;
  background: rgba(7, 14, 21, .78);
  color: #cbd5de;
  font-weight: 800;
}

.content-admin-type-grid button.is-active {
  border-color: rgba(216, 173, 78, .58);
  background: rgba(139, 97, 29, .22);
  color: #f1d58d;
}

.content-admin-editor-grid {
  display: grid;
  gap: 14px;
  padding-top: 14px;
}

.class-admin-equipment-builder {
  display: grid;
  gap: 12px;
}

.class-admin-equipment-entry-list {
  display: grid;
  gap: 10px;
  padding: 12px;
}

.class-admin-equipment-entry {
  display: grid;
  grid-template-columns: minmax(120px, .8fr) minmax(180px, 1.4fr) minmax(90px, .45fr) minmax(160px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(102, 130, 154, .18);
  border-radius: 10px;
  background: rgba(4, 10, 15, .52);
}

.class-admin-equipment-entry label {
  min-width: 0;
}

.class-admin-equipment-entry .danger-button {
  min-height: 38px;
  padding-inline: 10px;
}

.class-admin-grant-grid {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid rgba(111, 139, 161, .2);
  border-radius: 12px;
  background: rgba(2, 8, 13, .35);
}

.class-admin-grant-grid > .is-wide,
.class-admin-grant-grid > .class-admin-token-picker {
  grid-column: 1 / -1;
}

.class-admin-section-tabs {
  margin: 12px 14px 0;
  border-radius: 11px;
}

.class-admin-section-tabs button {
  min-height: 36px;
  padding: 7px 11px;
  font-size: 11px;
}

.class-admin-editor-body {
  min-height: 0;
  padding: 14px;
  overflow-y: auto;
}

.class-admin-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.class-admin-form-grid > .is-wide {
  grid-column: 1 / -1;
}

.class-admin-form-grid input:not([type="checkbox"]),
.class-admin-form-grid textarea,
.class-admin-form-grid select,
.class-admin-import textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid rgba(112, 140, 163, .25);
  border-radius: 9px;
  background: rgba(2, 8, 13, .76);
  color: #e3e9ed;
  outline: none;
}

.class-admin-form-grid input:not([type="checkbox"]),
.class-admin-form-grid select {
  min-height: 40px;
  padding: 9px 11px;
}

.class-admin-form-grid textarea,
.class-admin-import textarea {
  min-height: 88px;
  padding: 10px 11px;
  resize: vertical;
}

.class-admin-form-grid input:focus,
.class-admin-form-grid textarea:focus,
.class-admin-form-grid select:focus,
.class-admin-import textarea:focus {
  border-color: rgba(91, 163, 215, .72);
  box-shadow: 0 0 0 2px rgba(61, 139, 194, .12);
}

.class-admin-form-grid input:disabled,
.class-admin-form-grid textarea:disabled,
.class-admin-form-grid select:disabled {
  color: #a1abb4;
  opacity: .82;
}

.class-admin-check {
  display: flex !important;
  align-items: center;
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid rgba(112, 140, 163, .2);
  border-radius: 9px;
  background: rgba(5, 11, 17, .55);
}

.class-admin-check input {
  width: 18px;
  height: 18px;
  accent-color: #d1aa56;
}

.class-admin-collection {
  display: grid;
  gap: 13px;
}

.class-admin-collection > header {
  padding: 3px 2px 10px;
  border-bottom: 1px solid rgba(105, 132, 156, .16);
}

.class-admin-collection > header h3 {
  margin: 0 0 4px;
  color: #e8d6aa;
}

.class-admin-level-grid,
.class-admin-card-list {
  display: grid;
  gap: 10px;
}

.class-admin-level-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.class-admin-level-card,
.class-admin-record-card {
  border: 1px solid rgba(110, 137, 158, .22);
  border-radius: 12px;
  background: rgba(6, 13, 20, .72);
  overflow: hidden;
}

.class-admin-level-card summary,
.class-admin-record-card > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 46px;
  padding: 10px 12px;
  background: linear-gradient(90deg, rgba(23, 47, 64, .62), rgba(13, 23, 32, .4));
  color: #e8edf1;
}

.class-admin-level-card summary {
  cursor: pointer;
}

.class-admin-level-card summary span,
.class-admin-record-card > header span {
  min-width: 0;
  overflow: hidden;
  color: #8795a1;
  font-size: 11px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.class-admin-level-card > .class-admin-form-grid,
.class-admin-record-card > .class-admin-form-grid {
  padding: 12px;
}

.class-admin-record-card > header button {
  min-height: 30px;
  border: 1px solid rgba(203, 89, 78, .35);
  border-radius: 8px;
  background: rgba(91, 30, 28, .32);
  color: #ef9c94;
}

.class-admin-record-actions {
  display: flex;
  gap: 6px;
}

.class-admin-record-actions button:first-child {
  border-color: rgba(92, 151, 194, .35);
  background: rgba(28, 62, 86, .36);
  color: #a7d4ee;
}

.class-admin-record-actions button:disabled {
  cursor: not-allowed;
  opacity: .38;
}

.class-admin-subclass-level {
  max-width: 360px;
}

.class-validation-panel {
  padding: 15px;
  border: 1px solid rgba(102, 181, 134, .38);
  border-radius: 13px;
  background: rgba(22, 69, 47, .15);
}

.class-validation-panel.has-errors {
  border-color: rgba(207, 91, 80, .44);
  background: rgba(77, 27, 25, .16);
}

.class-validation-panel h3,
.class-validation-panel h4 {
  margin: 0;
  color: #e9e1d0;
}

.class-validation-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.class-validation-columns article {
  padding: 12px;
  border: 1px solid rgba(110, 137, 158, .18);
  border-radius: 10px;
  background: rgba(2, 8, 13, .48);
}

.class-validation-columns p {
  margin: 7px 0 0;
  color: #aeb8c1;
}

.class-choice-direct-input {
  width: 100%;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(117, 144, 165, .35);
  border-radius: 10px;
  background: rgba(4, 10, 15, .78);
  color: #e8edf1;
}

.class-admin-resource-card {
  border-color: rgba(205, 167, 85, .32);
}

.class-admin-nested-editor {
  grid-column: 1 / -1;
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(103, 136, 159, .18);
  border-radius: 10px;
  background: rgba(3, 10, 16, .36);
}

.class-admin-nested-editor > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.class-admin-nested-editor h4 {
  margin: 0 0 3px;
  color: #e8d6aa;
}

.class-admin-nested-editor p {
  margin: 0;
  color: #94a3ad;
}

.class-admin-bundle-entry-list {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed rgba(132, 160, 180, .32);
  border-radius: 10px;
  background: rgba(9, 20, 29, .42);
}

.class-admin-equipment-entry.is-bundle-child {
  border-color: rgba(90, 153, 190, .22);
  background: rgba(5, 16, 24, .7);
}

.sheet-class-resource-panel,
.sheet-class-effects-panel {
  border-color: rgba(205, 167, 85, .24);
}

.sheet-class-resource-panel .sheet-trait-card,
.sheet-class-effects-panel .sheet-trait-card {
  background: rgba(8, 17, 24, .82);
}

@media (max-width: 1100px) {
  .class-admin-shell,
  .content-admin-shell {
    grid-template-columns: 230px minmax(0, 1fr);
  }

  .class-admin-level-grid {
    grid-template-columns: 1fr;
  }

  .class-admin-overview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .class-admin-editor-head {
    align-items: stretch;
    flex-direction: column;
  }

  .class-admin-head-actions {
    justify-content: flex-start;
  }
}

@media (max-width: 780px) {
  .settings-hub {
    padding: 12px;
  }

  .settings-hub-head,
  .admin-optional-rule,
  .class-admin-collection > header,
  .class-validation-panel > header {
    align-items: stretch;
    flex-direction: column;
  }

  .settings-storage-badge {
    align-self: flex-start;
  }

  .class-admin-shell,
  .content-admin-shell {
    grid-template-columns: 1fr;
  }

  .class-admin-sidebar {
    max-height: none;
  }

  .class-admin-list {
    grid-auto-flow: column;
    grid-auto-columns: minmax(220px, 78vw);
    min-height: auto;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .class-admin-main {
    min-height: 620px;
  }

  .class-admin-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .class-admin-form-grid,
  .class-validation-columns {
    grid-template-columns: 1fr;
  }

  .class-admin-equipment-entry,
  .class-admin-grant-grid {
    grid-template-columns: 1fr;
  }

  .class-admin-form-grid > .is-wide {
    grid-column: auto;
  }

  .class-admin-head-actions button,
  .settings-tabs button,
  .class-admin-section-tabs button {
    min-height: 44px;
  }
}
.race-admin-shell {
  display: grid;
  grid-template-columns: minmax(240px, 320px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.race-admin-sidebar .class-admin-list {
  max-height: min(68vh, 760px);
}

.race-admin-main {
  min-width: 0;
}

.race-admin-overview article strong {
  overflow-wrap: anywhere;
}

.race-admin-builder-guide {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 8px;
  padding: 14px 16px;
  background: rgba(15, 23, 42, 0.46);
  margin: 14px 0;
}

.race-admin-builder-guide h3 {
  margin: 0 0 6px;
  font-size: 1rem;
}

.race-admin-builder-guide p {
  margin: 0;
  color: var(--muted);
  line-height: 1.5;
}

.race-admin-image-upload {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  gap: 12px;
  align-items: stretch;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(2, 6, 23, 0.28);
}

.race-admin-image-preview {
  position: relative;
  display: grid;
  min-height: 140px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.74);
  color: var(--muted);
  font-size: 0.84rem;
}

.race-admin-image-preview img {
  width: 100%;
  height: 100%;
  min-height: 140px;
  object-fit: cover;
  display: block;
}

.race-admin-image-fields {
  display: grid;
  align-content: center;
  gap: 10px;
  min-width: 0;
}

.race-admin-image-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.86rem;
}

.race-admin-upload-button {
  display: inline-flex !important;
  width: fit-content;
  min-height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(209, 170, 86, 0.38);
  border-radius: 8px;
  padding: 8px 12px;
  background: rgba(209, 170, 86, 0.12);
  color: #f5ddb0 !important;
  cursor: pointer;
  font-weight: 700;
}

.race-admin-upload-button input {
  display: none;
}

.race-admin-upload-button.is-disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

.race-admin-image-fields small {
  color: var(--muted);
  font-size: 0.78rem;
}

.race-admin-token-picker {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 8px;
  padding: 12px;
  background: rgba(2, 6, 23, 0.28);
}

.race-admin-token-picker strong {
  width: 100%;
  font-size: 0.86rem;
}

.race-admin-token-picker button {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  padding: 7px 10px;
  font-size: 0.82rem;
}

.race-admin-token-picker button.is-active {
  border-color: var(--accent);
  background: rgba(56, 189, 248, 0.18);
}

.race-admin-markdown textarea {
  width: 100%;
  min-height: 420px;
  resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 0.86rem;
}

@media (max-width: 980px) {
  .race-admin-shell {
    grid-template-columns: 1fr;
  }

  .race-admin-image-upload {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) {
  .tamer-pet-layout,
  .tamer-pet-form-grid,
  .tamer-pet-stat-grid {
    grid-template-columns: 1fr;
  }

  .sheet-magic-subtabs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    width: 100%;
  }

  .sheet-magic-subtabs button {
    min-width: 0;
  }

  .tamer-pet-impulse-card {
    align-items: stretch;
    flex-direction: column;
  }
}
