@import url("https://fonts.googleapis.com/css2?family=Cinzel+Decorative:wght@400;700;900&family=Cormorant+Garamond:wght@400;500;600;700&family=EB+Garamond:wght@400;500;600;700&display=swap");

:root {
  --ink: #2b2118;
  --coal: #1b1612;
  --ash: #343535;
  --muted: #5b4d3f;
  --paper: #e7d7b8;
  --paper-2: #f1dfbf;
  --line: #8f7550;
  --blood: #8a2b24;
  --blood-2: #a33a2f;
  --green: #5d7450;
  --gold: #a98a5d;
  --blue: #345f89;
  --shadow: 0 16px 32px rgba(43, 33, 24, 0.16);
  --site-width: 100vw;
  --frame: #4a382c;
  --frame-soft: rgba(74, 56, 44, 0.42);
  --panel-fill: rgba(231, 215, 184, 0.94);
  --map-cell-size: 45px;
  --admin-font: 15px;
  --admin-compact-gap: 8px;
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
}

.app-boot-screen {
  display: none;
}

html.app-loading body {
  min-height: 100vh;
  overflow: hidden;
  background: #17110d;
}

html.app-loading body > :not(.app-boot-screen) {
  visibility: hidden;
}

html.app-loading .app-boot-screen {
  position: fixed;
  z-index: 100000;
  inset: 0;
  display: grid;
  place-items: center;
  visibility: visible;
  padding: 24px;
  background:
    radial-gradient(circle at 50% 38%, rgba(121, 73, 42, 0.22), transparent 32%),
    linear-gradient(180deg, #1c1510, #100c09);
}

.app-boot-card {
  display: grid;
  justify-items: center;
  gap: 10px;
  color: #f3dfb2;
  text-align: center;
}

.app-boot-card i {
  width: 38px;
  height: 38px;
  border: 3px solid rgba(243, 223, 178, 0.22);
  border-top-color: #bc8c4e;
  border-radius: 50%;
  animation: app-boot-spin 0.85s linear infinite;
}

.app-boot-card strong {
  font-family: "Marcellus SC", Georgia, serif;
  font-size: clamp(1.25rem, 3vw, 1.8rem);
  letter-spacing: 0.04em;
}

.app-boot-card span {
  color: rgba(243, 223, 178, 0.72);
  font-size: 0.95rem;
}

@keyframes app-boot-spin {
  to { transform: rotate(360deg); }
}

/* Market board redesign */
.market-page {
  gap: 16px;
  padding-inline: clamp(12px, 2vw, 40px);
}

.market-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(169, 138, 93, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(255, 252, 235, 0.92), rgba(225, 202, 151, 0.64));
}

.market-hero-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.market-hero-panel > div:first-child p:not(.eyebrow) {
  max-width: min(980px, 68vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
  max-width: 420px;
}

.market-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(98, 73, 42, 0.22);
  background: rgba(255, 252, 238, 0.7);
  color: rgba(43, 33, 24, 0.76);
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-weight: 800;
  white-space: nowrap;
}

.market-stats b {
  margin-right: 0.28em;
  color: #7b2b24;
}

.market-board {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(98, 73, 42, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 252, 238, 0.78), rgba(226, 205, 156, 0.44)),
    rgba(231, 215, 184, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.market-tabs,
.market-view-switch,
.market-form-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.market-tabs button,
.market-view-switch button,
.market-form-steps button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(98, 73, 42, 0.32);
  background: rgba(255, 252, 238, 0.58);
  color: #4a382c;
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 rgba(98, 73, 42, 0.12);
}

.market-tabs button.active,
.market-view-switch button.active,
.market-form-steps button.active {
  color: #fff2d2;
  border-color: rgba(201, 164, 93, 0.7);
  background: linear-gradient(180deg, rgba(118, 45, 38, 0.96), rgba(75, 31, 25, 0.96));
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.market-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px auto auto;
  gap: 10px;
  align-items: end;
}

.market-filter-type-label {
  display: none !important;
}

.market-filters label {
  display: grid;
  gap: 4px;
  color: #7b2b24;
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-weight: 900;
}

.market-filters input,
.market-filters select {
  min-height: 36px;
  border: 1px solid rgba(78, 56, 35, 0.34);
  background: rgba(255, 250, 231, 0.86);
  color: #2b2118;
  font: 700 1rem var(--body-font, "EB Garamond", serif);
  padding: 6px 9px;
}

.market-form {
  display: grid;
  gap: 10px;
  padding: 0;
  overflow: hidden;
}

.market-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 13px 16px;
  border-bottom: 1px solid rgba(98, 73, 42, 0.18);
  background:
    linear-gradient(90deg, rgba(138, 43, 36, 0.12), transparent 44%),
    rgba(255, 252, 238, 0.6);
}

.market-form-head h3 {
  margin: 2px 0 0;
  color: #2b2118;
  font-size: 1.25rem;
  line-height: 1.05;
}

.market-form-section {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 14px 16px 16px;
  border: 0;
  border-bottom: 1px solid rgba(98, 73, 42, 0.18);
}

.market-form-section[data-market-step="deal"] {
  padding-top: 18px;
}

.market-form-section.active {
  background: rgba(255, 252, 238, 0.22);
}

.market-form-section legend {
  padding: 0;
  color: #7b2b24;
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.market-mode-toggle {
  width: auto;
}

.market-mode-toggle label span {
  min-width: 112px;
  padding-inline: 12px;
  white-space: nowrap;
}

.market-listings {
  grid-template-columns: repeat(auto-fit, minmax(520px, 1fr));
  align-items: start;
}

.market-card-listing {
  border-left: 4px solid rgba(138, 43, 36, 0.74);
}

.market-card-listing header {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: stretch;
}

.market-card-listing .market-kind,
.market-card-listing .market-status {
  align-self: start;
}

.market-list-items {
  padding: 10px;
  border: 1px solid rgba(98, 73, 42, 0.16);
  background: rgba(255, 252, 238, 0.32);
}

.market-list-item-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(150px, auto);
  gap: 8px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(98, 73, 42, 0.14);
  background: rgba(255, 252, 238, 0.54);
}

.market-list-item-row .market-list-row-runes {
  grid-column: 1 / -1;
}

.market-list-row-price {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
  justify-content: flex-end;
  color: #2b2118;
  font-weight: 800;
}

.market-list-row-price b,
.market-rune-list > b {
  color: #7b2b24;
}

.market-rune-list {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
  padding: 10px;
  border: 1px solid rgba(98, 73, 42, 0.14);
  background: rgba(255, 252, 238, 0.44);
}

.market-rune-list > span,
.market-list-row-runes {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.market-card footer button[data-market-copy-nick] {
  border: 1px solid rgba(98, 73, 42, 0.25);
  background: rgba(255, 252, 238, 0.62);
  padding: 3px 8px;
}

.market-listings-compact {
  grid-template-columns: 1fr;
}

.market-listings-compact .market-card-listing {
  padding: 10px;
}

.market-listings-compact .market-card-listing header {
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
}

.market-listings-compact .market-item-card {
  grid-template-columns: 44px minmax(0, 1fr);
  padding: 7px 9px;
}

.market-listings-compact .market-item-card-icon {
  width: 44px;
  height: 44px;
}

.market-listings-compact .market-item-card-body strong {
  font-size: 1.04rem;
}

.market-listings-compact .market-card-grid,
.market-listings-compact .market-rune-list {
  margin-block: 8px;
}

.market-listings-compact .market-list-items {
  gap: 6px;
  padding: 8px;
}

@media (max-width: 900px) {
  .market-hero-panel,
  .market-form-head {
    grid-template-columns: 1fr;
    display: grid;
  }

  .market-hero-side {
    justify-items: stretch;
  }

  .market-stats {
    justify-content: flex-start;
  }

  .market-filters {
    grid-template-columns: 1fr 1fr;
  }

  .market-listings {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .market-page {
    padding-inline: 10px;
  }

  .market-tabs,
  .market-view-switch,
  .market-form-steps {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 2px;
  }

  .market-filters,
  .market-card-grid,
  .market-list-item-row {
    grid-template-columns: 1fr;
  }

  .market-card-listing header {
    grid-template-columns: 1fr;
  }

  .market-kind,
  .market-status {
    width: max-content;
  }

  .market-card footer {
    display: grid;
  }

  .market-card footer div,
  .market-list-row-price {
    justify-content: flex-start;
  }
}

.market-page {
  display: grid;
  gap: 18px;
  padding: 18px clamp(14px, 2vw, 34px) 42px;
}

.market-heading,
.market-toolbar,
.market-form,
.market-card,
.market-admin-panel {
  background: linear-gradient(135deg, rgba(255, 249, 225, 0.88), rgba(229, 207, 156, 0.56));
  border: 1px solid rgba(98, 73, 42, 0.32);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.24), 0 12px 28px rgba(66, 45, 24, 0.12);
}

.market-heading {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  padding: 13px 18px;
}

.market-heading > div {
  min-width: 0;
}

.market-heading .eyebrow {
  margin-bottom: 4px;
  font-size: 0.82rem;
}

.market-heading h2 {
  margin: 0 0 4px;
  color: #251b13;
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1;
}

.market-heading p {
  max-width: 760px;
  margin: 0;
  color: rgba(43, 33, 24, 0.82);
  font-size: 1.02rem;
  line-height: 1.18;
}

#marketCreateToggle,
.market-form button[type="submit"] {
  flex: 0 0 auto;
  min-height: 46px;
  padding: 10px 20px;
  border: 1px solid rgba(201, 164, 93, 0.62);
  background:
    linear-gradient(180deg, rgba(148, 53, 43, 0.98), rgba(93, 31, 27, 0.98)),
    #7b2b24;
  color: #fff2d2;
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-size: 1.08rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.45);
  box-shadow:
    inset 0 1px 0 rgba(255, 239, 184, 0.24),
    inset 0 -2px 0 rgba(54, 19, 17, 0.55),
    0 10px 22px rgba(77, 33, 24, 0.24);
  white-space: nowrap;
}

#marketCreateToggle:hover,
.market-form button[type="submit"]:hover {
  color: #fff8df;
  border-color: rgba(218, 186, 111, 0.9);
  filter: brightness(1.06);
  transform: translateY(-1px);
}

.market-form {
  display: grid;
  gap: 14px;
  padding: 16px;
}

.market-honeypot {
  position: absolute;
  left: -10000px;
  opacity: 0;
  pointer-events: none;
}

.market-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 10px;
  align-items: end;
  padding: 14px;
}

.market-toolbar label,
.market-form label,
.market-admin-panel label {
  display: grid;
  gap: 5px;
  color: #7b2b24;
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-weight: 700;
}

.market-toolbar input,
.market-toolbar select,
.market-form input,
.market-form select,
.market-form textarea,
.market-admin-panel select {
  width: 100%;
  min-height: 38px;
  border: 1px solid rgba(78, 56, 35, 0.34);
  background: rgba(255, 250, 231, 0.82);
  color: #2b2118;
  font: 600 1rem var(--body-font, "EB Garamond", serif);
  padding: 7px 9px;
}

.market-message {
  min-height: 24px;
  color: #6f1d18;
  font-weight: 700;
}

.market-message a {
  color: #6f1d18;
  text-decoration: underline;
  word-break: break-all;
}

.market-mode-toggle {
  display: inline-flex;
  width: max-content;
  max-width: 100%;
  gap: 0;
  align-items: center;
  padding: 3px;
  border: 1px solid rgba(117, 86, 48, 0.28);
  background: rgba(255, 252, 238, 0.58);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32);
}

.market-mode-toggle label {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  min-height: 32px;
  min-width: 126px;
  padding: 7px 14px;
  border: 1px solid transparent;
  background: transparent;
  color: #2b2118;
  cursor: pointer;
  white-space: nowrap;
}

.market-mode-toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.market-mode-toggle span {
  white-space: nowrap;
  line-height: 1;
}

.market-mode-toggle label:has(input:checked) {
  border-color: rgba(138, 43, 36, 0.62);
  background: linear-gradient(135deg, rgba(255, 247, 221, 0.92), rgba(222, 194, 137, 0.48));
  color: #7b2b24;
  box-shadow:
    inset 0 -2px 0 rgba(138, 43, 36, 0.42),
    0 6px 14px rgba(77, 33, 24, 0.1);
}

.market-item-picker,
.market-rune-picker {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(117, 86, 48, 0.22);
  background: rgba(255, 249, 224, 0.54);
}

.market-picker-filters,
.market-rune-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
}

.market-form-top-fields {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.market-choice-field {
  display: grid;
  gap: 5px;
  width: max-content;
  max-width: 100%;
  color: #7b2b24;
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-weight: 700;
}

.market-choice-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: max-content;
  max-width: 100%;
}

.market-choice-row button {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid rgba(98, 73, 42, 0.32);
  background: rgba(255, 252, 238, 0.68);
  color: #4a382c;
  font: 800 0.92rem var(--ui-font, "Marcellus SC", serif);
  white-space: nowrap;
  cursor: pointer;
}

.market-choice-row button.active {
  border-color: rgba(201, 164, 93, 0.7);
  background: linear-gradient(180deg, rgba(118, 45, 38, 0.96), rgba(75, 31, 25, 0.96));
  color: #fff2d2;
}

.market-compact-field {
  width: min(230px, 100%);
}

.market-tier-field {
  width: min(160px, 100%);
}

.market-form-top-fields .market-compact-field > input,
.market-form-top-fields .market-compact-field > select {
  box-sizing: border-box;
  height: 38px;
  min-height: 38px;
}

.market-picker-filters {
  grid-template-columns: auto auto;
  justify-content: start;
  align-items: end;
}

.market-form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: end;
}

.market-antispam-field {
  display: flex !important;
  flex-direction: row;
  align-items: center;
  gap: 8px !important;
  width: max-content;
  max-width: 100%;
}

.market-antispam-field input {
  width: 78px;
}

.market-selected-item {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-height: 58px;
  padding: 9px 11px;
  border: 1px solid rgba(138, 43, 36, 0.28);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--quality-bg, #cdb48a) 28%, transparent), transparent 62%),
    rgba(255, 252, 236, 0.8);
  box-shadow: inset 4px 0 0 var(--quality-bg, rgba(117, 86, 48, 0.34));
  color: #2d2118;
}

.market-selected-item.muted {
  display: block;
  background: rgba(255, 252, 236, 0.8);
  box-shadow: none;
  color: rgba(58, 44, 32, 0.62);
}

.market-selected-item strong,
.market-selected-item em,
.market-rune-picker strong,
.market-rune-picker span {
  display: block;
}

.market-rune-picker span,
.market-selected-item em {
  font-size: 0.9rem;
  font-style: normal;
  color: rgba(58, 44, 32, 0.72);
}

.market-selected-icon,
.market-listing-icon {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(67, 50, 34, 0.28);
  background-color: var(--quality-bg, rgba(222, 207, 174, 0.82));
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.market-item-results {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  max-height: 360px;
  overflow: auto;
}

.market-list-controls {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 10px;
  align-items: end;
  padding: 10px;
  border: 1px solid rgba(117, 86, 48, 0.18);
  background: rgba(255, 252, 238, 0.58);
}

.market-list-draft {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(117, 86, 48, 0.22);
  background: rgba(255, 248, 222, 0.64);
}

.market-list-controls {
  align-items: end;
}

.market-list-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.market-list-actions .ghost-btn,
.market-mode-toggle span {
  white-space: nowrap;
}

.market-list-controls p {
  grid-column: 1 / -1;
  margin: -2px 0 0;
  color: rgba(43, 33, 24, 0.62);
  font-size: 0.95rem;
  line-height: 1.25;
}

.market-list-draft-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px;
  color: #7b2b24;
  font-weight: 800;
}

.market-list-draft-head span {
  color: rgba(43, 33, 24, 0.68);
}

.market-list-draft-row,
.market-list-item-row {
  display: grid;
  grid-template-columns: minmax(280px, 1fr) minmax(180px, 0.46fr) auto;
  gap: 8px;
  align-items: center;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(98, 73, 42, 0.2);
  background:
    linear-gradient(135deg, rgba(255, 252, 238, 0.78), rgba(232, 213, 169, 0.34));
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

.market-list-draft-row-compact {
  grid-template-columns: minmax(380px, 1fr) minmax(230px, 290px) auto;
  align-items: start;
  gap: 12px;
  padding: 10px;
}

.market-list-draft-main {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.market-list-draft-icon {
  width: 72px;
  height: 72px;
  border: 1px solid rgba(67, 50, 34, 0.28);
  background:
    radial-gradient(circle, rgba(255, 247, 206, 0.2), transparent 58%),
    var(--quality-bg, rgba(222, 207, 174, 0.82));
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.market-list-draft-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.market-list-draft-main strong,
.market-list-draft-main small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-list-draft-main strong {
  color: #7b2b24;
  font-size: 1.04rem;
  line-height: 1.1;
}

.market-list-draft-main small {
  color: rgba(43, 33, 24, 0.7);
  font-weight: 800;
  line-height: 1.15;
}

.market-list-draft-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
  margin-top: 2px;
}

.market-list-draft-stats > span {
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid rgba(92, 71, 45, 0.18);
  background: rgba(255, 250, 230, 0.72);
  color: #4a382c;
  font-size: 0.84rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.market-list-draft-stats b {
  color: #7b2b24;
}

.market-list-draft-details {
  grid-column: 1 / -1;
  min-width: 0;
}

.market-list-draft-details summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(122, 43, 36, 0.24);
  color: #7b2b24;
  background: rgba(255, 252, 238, 0.66);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}

.market-list-draft-details summary::-webkit-details-marker {
  display: none;
}

.market-list-draft-details summary span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(122, 43, 36, 0.24);
  background: rgba(255, 248, 222, 0.72);
  line-height: 1;
}

.market-list-draft-details[open] summary span {
  font-size: 0;
}

.market-list-draft-details[open] summary span::before {
  content: "−";
  font-size: 1rem;
}

.market-list-draft-details .market-list-row-rune-picker,
.market-list-draft-details .market-list-row-runes,
.market-list-draft-details .market-empty-line,
.market-list-draft-properties {
  margin-top: 8px;
}

.market-list-draft-properties .market-item-card-lines {
  margin-top: 0;
  padding: 8px 10px;
  border: 1px solid rgba(98, 73, 42, 0.16);
  background: rgba(255, 252, 238, 0.54);
}

.market-list-draft-properties .market-item-card-lines > span {
  grid-template-columns: minmax(112px, 150px) minmax(0, 1fr);
  padding: 5px 0;
  font-size: 0.96rem;
}

.market-list-row-price,
.market-list-row-runes {
  min-width: 0;
  color: #2b2118;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.market-list-draft-row .market-list-row-price {
  justify-self: end;
  width: min(290px, 100%);
  display: grid;
  grid-template-columns: auto minmax(140px, 1fr);
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 1px solid rgba(122, 43, 36, 0.24);
  background: linear-gradient(135deg, rgba(255, 252, 238, 0.92), rgba(235, 219, 181, 0.62));
  box-shadow: 0 4px 12px rgba(76, 52, 28, 0.08), inset 3px 0 0 rgba(122, 43, 36, 0.62);
}

.market-list-draft-row .market-list-row-price > span {
  display: grid;
  line-height: 1.05;
}

.market-list-draft-row .market-list-row-price b {
  color: #7b2b24;
}

.market-list-draft-row .market-list-row-price small {
  color: rgba(43, 33, 24, 0.62);
  font-size: 0.72rem;
  font-weight: 700;
  white-space: nowrap;
}

.market-list-draft-row .market-list-row-price input {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(98, 73, 42, 0.22);
  background: rgba(255, 252, 238, 0.76);
  color: #2b2118;
  font: inherit;
}

.market-list-row-runes {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.market-list-row-runes i {
  border: 1px solid rgba(67, 50, 34, 0.24);
  background: rgba(222, 207, 174, 0.82) center / contain no-repeat;
}

.market-list-row-rune-picker {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto repeat(3, minmax(160px, 1fr));
  gap: 7px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(98, 73, 42, 0.16);
  background: rgba(255, 252, 238, 0.5);
}

.market-list-row-rune-picker > b {
  color: #7b2b24;
}

.market-list-row-rune-picker label {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.market-list-row-rune-picker label span {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  flex: 0 0 22px;
  border: 1px solid rgba(98, 73, 42, 0.2);
  background: rgba(255, 248, 222, 0.68);
  color: #7b2b24;
  font-weight: 900;
}

.market-list-row-rune-picker select {
  width: 100%;
  min-width: 0;
  padding: 5px 7px;
  border: 1px solid rgba(98, 73, 42, 0.22);
  background: rgba(255, 252, 238, 0.76);
  color: #2b2118;
  font: inherit;
}

.market-pick-card {
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(98, 73, 42, 0.28);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--quality-bg, #cdb48a) 30%, transparent), transparent 68%),
    rgba(255, 252, 235, 0.84);
  box-shadow: inset 4px 0 0 var(--quality-bg, rgba(117, 86, 48, 0.34));
  color: #2b2118;
  text-align: left;
  cursor: pointer;
}

.market-pick-card.active,
.market-pick-card:hover {
  border-color: rgba(138, 43, 36, 0.64);
  box-shadow: 0 0 0 2px rgba(138, 43, 36, 0.08);
}

.market-pick-icon {
  width: 50px;
  height: 50px;
  border: 1px solid rgba(67, 50, 34, 0.28);
  background-color: var(--quality-bg, rgba(222, 207, 174, 0.82));
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.market-pick-card strong,
.market-pick-card small {
  min-width: 0;
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
  line-height: 1.15;
}

.market-pick-card strong {
  display: block;
  font-size: 1.08rem;
}

@media (max-width: 1400px) {
  .market-item-results {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .market-item-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .market-picker-filters {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .market-item-results {
    grid-template-columns: 1fr;
  }
}

.market-rune-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(117, 86, 48, 0.18);
  background: rgba(255, 250, 229, 0.58);
}

.market-rune-list > span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.market-rune-list b {
  color: #7b2b24;
}

.market-rune-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 240px;
  max-width: 360px;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(117, 86, 48, 0.24);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--quality-bg, #cdb48a) 26%, transparent), transparent 72%),
    rgba(255, 252, 238, 0.88);
  color: #2b2118;
  text-decoration: none;
  box-shadow: inset 3px 0 0 var(--quality-bg, rgba(117, 86, 48, 0.34));
}

.market-rune-chip i {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(67, 50, 34, 0.25);
  background-color: var(--quality-bg, rgba(222, 207, 174, 0.82));
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.market-rune-chip span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.market-rune-chip strong,
.market-rune-chip small {
  min-width: 0;
  line-height: 1.08;
  overflow-wrap: anywhere;
}

.market-rune-chip strong {
  color: #7b2b24;
  font-size: 1.04rem;
}

.market-rune-chip small {
  color: rgba(43, 33, 24, 0.68);
  font-size: 0.82rem;
  font-weight: 700;
}

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

.market-admin-list {
  display: grid;
  gap: 12px;
}

.market-card {
  min-width: 0;
  position: relative;
  overflow: hidden;
  padding: 13px;
  border-color: rgba(98, 73, 42, 0.38);
  background:
    radial-gradient(circle at 12% 0%, rgba(201, 164, 93, 0.22), transparent 34%),
    linear-gradient(180deg, rgba(255, 252, 235, 0.86), rgba(224, 202, 151, 0.42)),
    linear-gradient(135deg, rgba(255, 249, 225, 0.88), rgba(229, 207, 156, 0.56));
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.22),
    0 14px 24px rgba(65, 45, 18, 0.1);
}

.market-card header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding-bottom: 11px;
  border-bottom: 1px solid rgba(98, 73, 42, 0.2);
}

.market-list-summary {
  display: grid;
  gap: 3px;
  min-height: 64px;
  padding: 10px 12px 10px 14px;
  border: 1px solid rgba(117, 86, 48, 0.24);
  background:
    linear-gradient(90deg, rgba(138, 43, 36, 0.12), transparent 42%),
    rgba(255, 252, 238, 0.72);
  box-shadow: inset 4px 0 0 rgba(138, 43, 36, 0.5);
}

.market-list-summary strong {
  color: #7b2b24;
  font-size: 1.18rem;
  line-height: 1.05;
}

.market-list-summary small {
  color: rgba(43, 33, 24, 0.68);
  font-weight: 800;
}

.market-list-items {
  display: grid;
  gap: 9px;
  margin-top: 12px;
}

.market-listing-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-width: 0;
}

.market-listing-icon {
  width: 56px;
  height: 56px;
}

.market-item-card {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 11px;
  align-items: center;
  min-width: 0;
  padding: 9px 10px;
  border: 1px solid rgba(117, 86, 48, 0.26);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--quality-bg, #cdb48a) 30%, transparent), transparent 56%),
    linear-gradient(135deg, rgba(255, 252, 238, 0.92), rgba(232, 213, 169, 0.56));
  color: #2b2118;
  text-decoration: none;
  box-shadow:
    inset 4px 0 0 var(--quality-bg, rgba(117, 86, 48, 0.34)),
    inset 0 0 0 1px rgba(255, 255, 255, 0.22);
}

.market-item-card:hover {
  border-color: rgba(138, 43, 36, 0.58);
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.24),
    0 0 0 2px rgba(138, 43, 36, 0.08);
}

.market-item-card-icon {
  width: 60px;
  height: 60px;
  border: 1px solid rgba(67, 50, 34, 0.28);
  background-color: var(--quality-bg, rgba(222, 207, 174, 0.82));
  background-position: center;
  background-size: contain;
  background-repeat: no-repeat;
}

.market-item-card-body {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.market-item-card-body strong {
  color: #7b2b24;
  font-size: 1.18rem;
  line-height: 1.05;
  overflow-wrap: anywhere;
}

.market-item-card-body small,
.market-item-card-body em {
  color: rgba(43, 33, 24, 0.72);
  font-style: normal;
  font-weight: 700;
  line-height: 1.15;
  overflow-wrap: anywhere;
}

.market-card h3 {
  margin: 0;
  color: #2b2118;
  font-size: 1.45rem;
}

.market-card header p,
.market-card footer,
.market-comment {
  margin: 0;
  color: rgba(43, 33, 24, 0.78);
}

.market-kind,
.market-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 8px;
  border: 1px solid rgba(111, 29, 24, 0.25);
  color: #7b2b24;
  background: rgba(255, 245, 210, 0.7);
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
}

.market-card-pending .market-status {
  color: #7a5a1f;
}

.market-card-hidden .market-status,
.market-card-deleted .market-status,
.market-card-expired .market-status {
  color: #6c6256;
}

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

.market-card-grid span {
  min-width: 0;
  padding: 8px 10px;
  background: rgba(255, 252, 238, 0.64);
  border: 1px solid rgba(98, 73, 42, 0.16);
  overflow-wrap: anywhere;
}

.market-card-grid b {
  color: #7b2b24;
}

.market-comment {
  padding: 9px 11px;
  background: rgba(255, 252, 238, 0.58);
  border-left: 3px solid rgba(122, 43, 36, 0.5);
  line-height: 1.28;
}

.market-card footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  margin-top: 12px;
}

.market-card footer div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.market-card a,
.market-card button,
.market-page button,
.market-admin-panel button {
  color: #6f1d18;
  font-weight: 800;
}

.market-report-box {
  display: grid;
  gap: 7px;
  padding: 10px;
  border: 1px solid rgba(123, 43, 36, 0.25);
  background: rgba(255, 235, 205, 0.44);
  color: #2b2118;
}

.market-report-box > b {
  color: #7b2b24;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.market-report-item {
  display: grid;
  gap: 2px;
  padding: 7px 9px;
  border-left: 3px solid rgba(123, 43, 36, 0.45);
  background: rgba(255, 252, 238, 0.58);
}

.market-report-item strong,
.market-report-item em,
.market-report-item small {
  min-width: 0;
  overflow-wrap: anywhere;
}

.market-report-item em {
  font-style: normal;
}

.market-report-item small {
  color: rgba(43, 33, 24, 0.62);
}

.market-empty {
  padding: 22px;
  text-align: center;
  border: 1px dashed rgba(98, 73, 42, 0.35);
  background: rgba(255, 250, 231, 0.58);
  color: rgba(43, 33, 24, 0.75);
}

.market-admin-panel {
  padding: 16px;
}

.market-admin-settings {
  margin: 0 0 14px;
  padding: 10px;
  border: 1px solid rgba(98, 73, 42, 0.22);
  background: rgba(255, 248, 222, 0.5);
}

.market-admin-settings summary {
  cursor: pointer;
  color: #7b2b24;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

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

.market-admin-settings-grid label {
  display: grid;
  gap: 5px;
  color: #7b2b24;
  font-weight: 800;
}

.market-admin-panel input,
.market-admin-panel textarea,
.market-admin-panel select,
.market-admin-settings input {
  width: 100%;
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(98, 73, 42, 0.28);
  background: rgba(255, 252, 238, 0.72);
  color: #2b2118;
  font: inherit;
}

.market-admin-edit {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(122, 43, 36, 0.28);
  background: rgba(255, 248, 222, 0.62);
  box-shadow: inset 4px 0 0 rgba(122, 43, 36, 0.45);
}

.market-admin-edit-grid,
.market-admin-edit-item {
  display: grid;
  grid-template-columns: repeat(2, minmax(180px, 1fr));
  gap: 10px;
}

.market-admin-edit-items {
  display: grid;
  gap: 8px;
}

.market-admin-edit-item {
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.25fr) minmax(200px, 0.55fr);
  padding: 10px;
  border: 1px solid rgba(98, 73, 42, 0.18);
  background: rgba(255, 252, 238, 0.54);
}

.market-admin-edit label {
  display: grid;
  gap: 5px;
}

.market-admin-edit-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.market-admin-settings p {
  margin: 8px 0 0;
  color: rgba(43, 33, 24, 0.68);
}

.market-admin-panel > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.market-admin-panel h3 {
  margin: 0;
}

@media (max-width: 760px) {
  .market-heading {
    align-items: stretch;
    flex-direction: column;
  }

  #marketCreateToggle {
    width: 100%;
  }

  .market-listings,
  .market-toolbar,
  .market-card-grid,
  .market-card header,
  .market-list-controls,
  .market-list-draft-row,
  .market-list-item-row,
  .market-list-row-rune-picker,
  .market-admin-settings-grid {
    grid-template-columns: 1fr;
  }

  .market-mode-toggle {
    width: 100%;
  }

  .market-mode-toggle label {
    flex: 1 1 0;
    min-width: 0;
    padding-inline: 10px;
  }

  .market-card footer,
  .market-admin-panel > header {
    align-items: stretch;
    flex-direction: column;
  }

  .market-card footer div {
    justify-content: flex-start;
  }
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  overflow-x: hidden;
  color: var(--ink);
  font-size: 19px;
  font-weight: 500;
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  background:
    linear-gradient(rgba(239, 222, 188, 0.28), rgba(239, 222, 188, 0.28)),
    url("assets/parchment-texture.png") center top / 760px auto repeat,
    #eadcc2;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 18%, rgba(255, 248, 226, 0.3), transparent 32%),
    linear-gradient(90deg, rgba(43, 33, 24, 0.08), transparent 12%, transparent 88%, rgba(43, 33, 24, 0.1)),
    linear-gradient(180deg, rgba(43, 33, 24, 0.07), transparent 18%, transparent 86%, rgba(43, 33, 24, 0.1));
  z-index: -1;
}

a {
  color: #345f89;
  font-weight: 650;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

h1,
h2,
h3,
.article-card h2,
.article-full h2,
.feature-card h2,
.panel-title {
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.eyebrow,
.main-nav a,
.action-btn,
.ghost-btn,
.tool-btn,
.guide-tabs button,
.admin-tabs button,
.map-tools button,
label,
.article-meta,
.panel-title {
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  font-weight: 600;
}

.site-header {
  position: relative;
  top: 0;
  z-index: 20;
  width: min(calc(var(--site-width) + 10px), calc(100% - 18px));
  aspect-ratio: 1976 / 540;
  border-bottom: 1px solid rgba(130, 105, 65, 0.42);
  background:
    linear-gradient(rgba(222, 196, 143, 0.3), rgba(222, 196, 143, 0.3)),
    #d9c69b;
  box-shadow: 0 10px 30px rgba(65, 49, 30, 0.12);
  margin: 12px auto 0;
}

.header-art {
  position: absolute;
  inset: 0;
  height: 100%;
  background:
    url("assets/header-2.png") center center / contain no-repeat;
  filter: saturate(1.02) contrast(0.98) brightness(1.02);
}

.header-frame {
  aspect-ratio: 1976 / 540;
  max-width: calc(var(--site-width) + 10px);
  margin: 0 auto;
}

.top-bar {
  display: flex;
  align-items: stretch;
  justify-content: space-between;
  gap: 14px;
  width: min(var(--site-width), calc(100% - 28px));
  margin: 0 auto;
  padding: 10px 12px;
  border: 1px solid rgba(74, 56, 44, 0.2);
  border-top: 0;
  background:
    linear-gradient(90deg, rgba(74, 56, 44, 0.18), transparent 22%, transparent 78%, rgba(74, 56, 44, 0.18)),
    radial-gradient(circle at 50% 0, rgba(255, 248, 220, 0.62), transparent 42%),
    linear-gradient(#eadbbc, #d7c199);
  box-shadow: 0 10px 24px rgba(65, 49, 30, 0.1);
}

.main-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.nav-item {
  position: relative;
  display: inline-flex;
}

.main-nav a,
.action-btn,
.ghost-btn,
.rail-link,
.guide-tabs button {
  border-radius: 0;
  clip-path: polygon(10px 0, calc(100% - 10px) 0, 100% 50%, calc(100% - 10px) 100%, 10px 100%, 0 50%);
}

.main-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 15px;
  border: 2px solid rgba(74, 56, 44, 0.68);
  color: #3a2c20;
  background:
    linear-gradient(90deg, rgba(43, 33, 24, 0.12), transparent 14%, transparent 86%, rgba(43, 33, 24, 0.12)),
    linear-gradient(90deg, rgba(74, 56, 44, 0.16), transparent 20%, transparent 80%, rgba(74, 56, 44, 0.14)),
    linear-gradient(#f0dfbd, #cdb287);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 210, 0.42),
    inset 0 1px rgba(255, 248, 226, 0.75),
    0 2px 0 rgba(71, 50, 31, 0.32),
    0 5px 12px rgba(65, 49, 30, 0.16);
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 900;
  transition: transform 140ms ease, filter 140ms ease, box-shadow 140ms ease;
}

.main-nav a:hover {
  filter: brightness(1.04) saturate(1.04);
  transform: translateY(-1px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 210, 0.64),
    inset 0 1px rgba(255, 248, 226, 0.9),
    0 3px 0 rgba(71, 50, 31, 0.34),
    0 8px 16px rgba(65, 49, 30, 0.2),
    0 0 0 2px rgba(169, 138, 93, 0.12);
}

.main-nav a.active {
  color: #fff4d9;
  background:
    linear-gradient(90deg, rgba(27, 22, 18, 0.24), transparent 25%, transparent 75%, rgba(27, 22, 18, 0.22)),
    linear-gradient(#9d3b2f, #64231d);
  border-color: rgba(194, 160, 109, 0.88);
  box-shadow:
    inset 0 0 0 1px rgba(255, 229, 175, 0.18),
    inset 0 0 18px rgba(27, 22, 18, 0.24),
    0 2px 0 rgba(71, 50, 31, 0.3);
}

.nav-dropdown {
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  z-index: 80;
  display: grid;
  min-width: 210px;
  max-width: min(280px, calc(100vw - 28px));
  padding: 9px;
  border: 2px solid rgba(74, 56, 44, 0.68);
  background:
    radial-gradient(circle at 50% 0, rgba(255, 248, 220, 0.62), transparent 44%),
    linear-gradient(rgba(236, 221, 190, 0.98), rgba(204, 181, 135, 0.98));
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 210, 0.35),
    0 14px 28px rgba(43, 33, 24, 0.24);
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
  transition: opacity 140ms ease, transform 140ms ease;
}

.nav-item::after {
  content: "";
  position: absolute;
  right: -8px;
  bottom: -12px;
  left: -8px;
  height: 14px;
}

.nav-item:nth-last-child(-n + 3) .nav-dropdown {
  right: 0;
  left: auto;
}

.nav-item:nth-child(5n) .nav-dropdown {
  right: 0;
  left: auto;
}

.nav-item:hover .nav-dropdown,
.nav-item:focus-within .nav-dropdown {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown button {
  min-height: 32px;
  padding: 7px 10px;
  border: 0;
  border-bottom: 1px solid rgba(74, 56, 44, 0.18);
  background: transparent;
  color: #3a2c20;
  cursor: pointer;
  font-weight: 800;
  text-align: left;
}

.nav-dropdown button:hover {
  color: #fff4d9;
  background: linear-gradient(90deg, #8f3329, #63231d);
}

.subline {
  position: relative;
  min-height: 31px;
  padding: 7px 20px 8px;
  background: linear-gradient(90deg, #efe4c6, #fbf2dc 52%, #e6d8b6);
  color: #6f2b24;
  text-align: center;
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  font-weight: 900;
  letter-spacing: 0;
}

.page-shell {
  display: block;
  width: min(var(--site-width), calc(100% - 28px));
  max-width: var(--site-width);
  margin: 0 auto;
  padding: 18px 0 46px;
}

.sidebar {
  display: grid;
  align-content: start;
  gap: 16px;
}

.left-rail {
  position: sticky;
  top: 16px;
}

.panel,
.article-card,
.feature-card,
.admin-form,
.admin-list,
.admin-preview,
.import-panel,
.map-card,
.article-full,
.codex-widget {
  position: relative;
  border: 1px solid var(--frame-soft);
  background:
    linear-gradient(rgba(255, 253, 244, 0.94), rgba(244, 234, 207, 0.92)),
    radial-gradient(circle at 8% 12%, rgba(255, 255, 255, 0.62), transparent 18%),
    var(--paper);
  box-shadow: var(--shadow);
}

.panel::before,
.article-card::after,
.feature-card::after,
.admin-form::before,
.admin-list::before,
.admin-preview::before,
.import-panel::before,
.map-card::before,
.article-full::before,
.codex-widget::before {
  content: "";
  position: absolute;
  inset: 6px;
  pointer-events: none;
  border: 1px solid rgba(107, 76, 42, 0.22);
}

.panel::after,
.feature-card::before,
.admin-form::after,
.admin-list::after,
.admin-preview::after,
.import-panel::after,
.map-card::after,
.article-full::after,
.codex-widget::after {
  content: "";
  position: absolute;
  right: -1px;
  bottom: -1px;
  width: 30px;
  height: 30px;
  pointer-events: none;
  background:
    linear-gradient(135deg, transparent 0 47%, rgba(107, 76, 42, 0.55) 48% 52%, transparent 53%),
    linear-gradient(135deg, transparent 0 64%, rgba(107, 76, 42, 0.26) 65% 70%, transparent 71%);
}

.panel {
  padding: 12px;
  border-radius: 0;
}

.codex-rail {
  position: sticky;
  top: 16px;
}

.codex-widget {
  padding: 12px;
}

.panel::before,
.article-card::after,
.feature-card::after,
.admin-form::before,
.admin-list::before,
.admin-preview::before,
.import-panel::before,
.map-card::before,
.article-full::before,
.codex-widget::before {
  inset: 9px;
  border: 1px solid rgba(74, 56, 44, 0.34);
  box-shadow:
    inset 0 0 0 1px rgba(194, 160, 109, 0.22),
    0 0 0 1px rgba(194, 160, 109, 0.12);
}

.article-card,
.feature-card,
.admin-form,
.admin-list,
.admin-preview,
.import-panel,
.map-card,
.article-full,
.codex-widget,
.panel {
  border: 2px solid rgba(74, 56, 44, 0.52);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 244, 217, 0.55), transparent 34%),
    linear-gradient(rgba(231, 215, 184, 0.96), rgba(220, 201, 165, 0.94)),
    repeating-linear-gradient(12deg, rgba(43, 33, 24, 0.022) 0 1px, transparent 1px 8px);
}

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

.codex-list {
  margin: 0;
  padding-left: 18px;
  color: #4f4538;
  line-height: 1.45;
}

.mini-map {
  min-height: 120px;
  border: 1px solid rgba(107, 76, 42, 0.28);
  background:
    radial-gradient(circle at 30% 42%, rgba(138, 43, 36, 0.34) 0 4px, transparent 5px),
    radial-gradient(circle at 62% 58%, rgba(52, 95, 137, 0.28) 0 4px, transparent 5px),
    url("assets/patrons-background.png") center / cover;
  filter: sepia(0.35) saturate(0.78);
}

.artifact-widget {
  display: grid;
  gap: 5px;
  text-align: center;
}

.artifact-rune {
  display: grid;
  width: 58px;
  height: 58px;
  place-items: center;
  margin: 0 auto 4px;
  border: 1px solid rgba(107, 76, 42, 0.4);
  background: radial-gradient(circle, rgba(194, 160, 109, 0.38), rgba(74, 56, 44, 0.18));
  color: #8a2b24;
  font-size: 2rem;
}

.panel-title {
  position: relative;
  z-index: 1;
  margin: 0 0 11px;
  padding: 8px 9px;
  border: 0;
  background: transparent;
  color: #6f1d18;
  text-align: left;
  font-family: "Cormorant Garamond", "EB Garamond", Georgia, serif;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.panel-title::after,
.eyebrow::after {
  content: "";
  display: block;
  height: 1px;
  margin-top: 7px;
  background: linear-gradient(90deg, transparent, rgba(74, 56, 44, 0.55), transparent);
}

.rail-link {
  position: relative;
  z-index: 1;
  display: block;
  width: 100%;
  margin-top: 8px;
  padding: 9px 12px;
  border: 1px solid rgba(74, 56, 44, 0.38);
  border-radius: 0;
  clip-path: polygon(13px 0, calc(100% - 13px) 0, 100% 50%, calc(100% - 13px) 100%, 13px 100%, 0 50%);
  cursor: pointer;
  background:
    linear-gradient(90deg, rgba(74, 56, 44, 0.08), transparent 22%, transparent 78%, rgba(74, 56, 44, 0.08)),
    linear-gradient(#eadcc2, #d6c097);
  color: #3a2c20;
  font-weight: 850;
  text-align: left;
}

.rail-link.active,
.rail-link:hover {
  background:
    linear-gradient(90deg, rgba(27, 22, 18, 0.18), transparent 25%, transparent 75%, rgba(27, 22, 18, 0.18)),
    linear-gradient(#7d3a2b, #3f2b21);
  color: #fff1d1;
}

.content-stage {
  min-width: 0;
  width: 100%;
}

.toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
  padding: 14px 16px;
  position: relative;
  border: 1px solid var(--frame-soft);
  background:
    linear-gradient(rgba(231, 215, 184, 0.94), rgba(220, 201, 165, 0.9)),
    url("assets/patrons-background.png") center / cover;
  background-blend-mode: normal, luminosity;
  box-shadow: 0 12px 34px rgba(73, 56, 34, 0.1);
}

.toolbar::before {
  content: "";
  position: absolute;
  inset: 6px;
  border: 1px solid rgba(107, 76, 42, 0.18);
  pointer-events: none;
}

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

.subgroup-tabs {
  display: none !important;
  flex-wrap: wrap;
  gap: 6px;
  margin: -4px 0 14px;
  padding: 8px;
  border: 1px solid rgba(147, 124, 84, 0.24);
  background:
    linear-gradient(rgba(255, 253, 244, 0.78), rgba(244, 234, 207, 0.74)),
    rgba(255, 250, 235, 0.62);
}

.subgroup-tabs.active {
  display: flex;
}

.subgroup-tabs button {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(92, 74, 48, 0.22);
  background: rgba(255, 248, 229, 0.82);
  color: #5a4430;
  cursor: pointer;
  font-size: 0.8rem;
  font-weight: 850;
}

.subgroup-tabs button.active,
.subgroup-tabs button:hover {
  color: #fff5de;
  background: #9d3b2f;
}

.eyebrow {
  margin: 0 0 5px;
  color: var(--blood);
  font-size: 0.73rem;
  font-weight: 950;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

h1 {
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.35rem, 2.1vw, 2.05rem);
  color: #2d241b;
}

h2 {
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
  font-size: 1.08rem;
}

.search-box {
  display: grid;
  gap: 6px;
  min-width: min(310px, 100%);
  color: #5f5649;
  font-size: 0.75rem;
  font-weight: 900;
  text-transform: uppercase;
}

.nav-search {
  flex: 0 0 min(310px, 34%);
  align-self: center;
  min-width: 230px;
}

.nav-search span {
  display: none;
}

.search-box input,
.admin-form input,
.admin-form select,
.admin-form textarea {
  width: 100%;
  border: 1px solid rgba(43, 33, 24, 0.5);
  border-radius: 0;
  background:
    linear-gradient(rgba(255, 248, 226, 0.9), rgba(231, 215, 184, 0.72));
  color: var(--ink);
  outline: none;
}

.search-box input:focus,
.admin-form input:focus,
.admin-form select:focus,
.admin-form textarea:focus {
  border-color: #8a2b24;
  box-shadow: 0 0 0 2px rgba(138, 43, 36, 0.14);
}

.search-box input {
  min-height: 42px;
  padding: 10px 12px;
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.feature-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  min-height: 170px;
  margin-bottom: 16px;
  padding: 18px;
  background:
    linear-gradient(90deg, rgba(231, 215, 184, 0.98), rgba(231, 215, 184, 0.82) 58%, rgba(231, 215, 184, 0.58)),
    url("assets/patrons-background.png") center / cover;
  background-blend-mode: normal, luminosity;
}

.feature-card p:not(.eyebrow) {
  max-width: 690px;
  margin: 10px 0 0;
  color: #322920;
  font-weight: 650;
  line-height: 1.55;
}

.action-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid rgba(74, 56, 44, 0.58);
  cursor: pointer;
  text-decoration: none;
  font-weight: 950;
}

.action-btn {
  color: #fff2d6;
  background:
    linear-gradient(90deg, rgba(27, 22, 18, 0.12), transparent 25%, transparent 75%, rgba(27, 22, 18, 0.12)),
    linear-gradient(#a33a2f, #6f1d18);
  box-shadow: inset 0 1px 0 rgba(255, 244, 217, 0.18), 0 8px 18px rgba(89, 43, 25, 0.16);
}

.ghost-btn {
  color: #352b21;
  background:
    linear-gradient(90deg, rgba(74, 56, 44, 0.08), transparent 22%, transparent 78%, rgba(74, 56, 44, 0.08)),
    linear-gradient(#eadcc2, #d6c097);
}

.ghost-btn:disabled,
.action-btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.card-undo-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(92, 70, 48, 0.28);
  background: rgba(255, 248, 223, 0.48);
}

.card-undo-panel div {
  display: grid;
  gap: 2px;
}

.card-undo-panel strong {
  color: #7b2c24;
  font-size: 0.92rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.card-undo-panel span {
  color: rgba(43, 33, 24, 0.72);
  font-size: 0.95rem;
}

.article-list {
  display: grid;
  gap: 14px;
}

.article-card {
  position: relative;
  padding: 13px;
  transition:
    transform 160ms ease,
    box-shadow 160ms ease,
    border-color 160ms ease;
}

.article-card > * {
  position: relative;
  z-index: 1;
}

.article-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: var(--blood);
  z-index: 1;
}

.article-preview-card {
  cursor: pointer;
}

.article-preview-card:hover,
.article-preview-card:focus {
  transform: translateY(-2px);
  border-color: rgba(157, 59, 47, 0.45);
  box-shadow: 0 20px 48px rgba(82, 62, 36, 0.18);
  outline: none;
}

.article-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 7px 10px;
  border-bottom: 1px solid rgba(63, 51, 37, 0.24);
  background: rgba(255, 248, 224, 0.56);
  font-weight: 950;
}

.tag {
  color: #6d241d;
  text-transform: uppercase;
  font-size: 0.75rem;
}

.article-card time {
  white-space: nowrap;
  color: #544839;
}

.article-card h3 {
  color: #263f53;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
  font-size: 1.04rem;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.article-card p {
  color: #312920;
  line-height: 1.58;
}

.article-body {
  display: grid;
  gap: 8px;
  margin-top: 12px;
  line-height: 1.55;
  min-width: 0;
}

.article-body p,
.content-text {
  margin: 0;
  white-space: pre-line;
  overflow-wrap: break-word;
  word-break: normal;
}

.article-teaser {
  display: grid;
  gap: 12px;
}

.article-teaser span {
  color: #5e5548;
}

.article-teaser button {
  justify-self: start;
  min-height: 36px;
  padding: 7px 12px;
  border: 1px solid rgba(89, 67, 42, 0.35);
  background: rgba(255, 248, 229, 0.9);
  color: #6f2b24;
  cursor: pointer;
  font-weight: 900;
}

.article-full {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid rgba(147, 124, 84, 0.34);
  background:
    linear-gradient(rgba(255, 253, 244, 0.96), rgba(246, 237, 214, 0.94)),
    var(--paper-2);
  box-shadow: var(--shadow);
}

.article-full h2 {
  font-size: clamp(1.6rem, 3vw, 2.5rem);
}

.article-lead {
  max-width: 900px;
  margin: 0;
  color: #4b4237;
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.6;
}

.article-body h4,
.content-anchor-target {
  margin: 8px 0 0;
  scroll-margin-top: 92px;
}

.article-body h4 {
  color: #6d241d;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
  font-size: 25px;
}

.article-toc {
  display: grid;
  gap: 4px;
  justify-self: start;
  min-width: min(620px, 100%);
  max-width: min(760px, 100%);
  padding: 10px 12px;
  border: 1px solid rgba(79, 63, 43, 0.34);
  background: rgba(255, 250, 232, 0.72);
  color: #2b2118;
}

.article-toc > strong {
  color: #6d241d;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
  font-size: 1.08rem;
  line-height: 1.15;
  text-transform: uppercase;
}

.article-toc ul {
  display: grid;
  gap: 1px;
  margin: 0;
  padding-left: 54px;
  color: #7b2b24;
  font-size: 0.96rem;
  line-height: 1.15;
}

.article-toc li {
  margin-left: 8px;
  padding: 0;
}

.article-toc a {
  color: #6f2b24;
  font-weight: 400;
  text-decoration: underline;
  text-decoration-skip-ink: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

.article-toc a:hover {
  color: #a3201a;
}

.article-body ul {
  margin: 0;
  padding-left: 1.25rem;
}

.content-table-wrap {
  display: grid;
  gap: 8px;
  max-width: 100%;
  overflow: visible;
}

.content-table {
  width: 100%;
  table-layout: fixed;
  border-collapse: collapse;
  margin-top: 6px;
  background: rgba(255, 249, 229, 0.72);
  font-size: 19px;
  max-width: 100%;
}

.content-table th,
.content-table td {
  padding: 8px 10px;
  border: 1px solid rgba(87, 70, 48, 0.32);
  text-align: left;
  white-space: pre-line;
  overflow-wrap: break-word;
  word-break: normal;
}

.table-collapse-toggle {
  justify-self: start;
  min-height: 32px;
  border: 1px solid rgba(92, 71, 45, 0.42);
  background: rgba(255, 246, 221, 0.9);
  color: #6d241d;
  cursor: pointer;
  font-family: var(--aaa-ui);
  font-weight: 800;
}

.content-table th {
  background:
    linear-gradient(90deg, rgba(107, 76, 42, 0.22), rgba(194, 160, 109, 0.18));
  color: #5c261f;
}

.content-table tr:nth-child(even) td {
  background: rgba(220, 201, 165, 0.22);
}

.content-image {
  margin: 6px 0;
}

.content-image img {
  display: block;
  max-width: 100%;
  border: 1px solid rgba(68, 55, 39, 0.42);
  background: rgba(255, 250, 232, 0.68);
}

.content-image figcaption {
  margin-top: 5px;
  color: #665b4d;
  font-size: 0.86rem;
  font-weight: 750;
}

.inline-content-image {
  display: block;
  width: auto;
  max-width: min(320px, 100%);
  max-height: 320px;
  margin: 8px 0;
  vertical-align: initial;
  border: 1px solid rgba(68, 55, 39, 0.32);
  background: rgba(255, 250, 232, 0.72);
}

.table-cell-image {
  display: block;
  width: auto;
  max-width: min(320px, 100%);
  max-height: 320px;
  margin: 4px auto;
  border: 1px solid rgba(68, 55, 39, 0.32);
  background: rgba(255, 250, 232, 0.72);
}

.article-body blockquote {
  margin: 4px 0;
  padding: 10px 14px;
  border-left: 4px solid #9a3a2f;
  background: rgba(255, 246, 221, 0.72);
  color: #4c4034;
  font-family: "Cormorant Garamond", Georgia, serif;
  white-space: pre-line;
}

.article-body hr {
  width: 100%;
  height: 1px;
  border: 0;
  background: linear-gradient(90deg, transparent, rgba(99, 75, 48, 0.55), transparent);
}

.content-callout {
  padding: 12px 14px;
  border: 1px solid rgba(139, 96, 51, 0.38);
  background: rgba(255, 238, 191, 0.74);
  min-width: 0;
  width: 100%;
  overflow-wrap: normal;
  word-break: normal;
}

.content-callout > strong {
  display: block;
  margin-bottom: 4px;
  color: #7b2b24;
}

.content-callout p {
  white-space: pre-line;
  width: 100%;
  max-width: none;
  overflow-wrap: normal;
  word-break: normal;
}

.faq-list {
  display: grid;
  gap: 8px;
  width: min(760px, 100%);
}

.faq-item {
  border: 1px solid rgba(79, 63, 43, 0.34);
  background: rgba(255, 250, 232, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 221, 0.5);
}

.faq-item summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  color: #6d241d;
  cursor: pointer;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.08rem;
  font-weight: 900;
  list-style: none;
}

.faq-item summary::-webkit-details-marker {
  display: none;
}

.faq-item summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(109, 36, 29, 0.35);
  color: #8b2e2e;
  font-family: "Marcellus SC", Georgia, serif;
  line-height: 1;
}

.faq-item[open] summary::before {
  content: "-";
}

.faq-answer {
  padding: 0 14px 12px 40px;
  color: #352b21;
  line-height: 1.55;
  overflow-wrap: break-word;
}

.item-card {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 10px;
  border: 1px solid rgba(79, 63, 43, 0.34);
  background: rgba(255, 250, 232, 0.72);
}

.item-card > div,
.item-card .item-content {
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.item-card.item-icon-top {
  align-items: start;
}

.item-card.item-icon-center {
  align-items: center;
}

.item-card.item-icon-bottom {
  align-items: end;
}

.item-icon {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(68, 55, 39, 0.42);
  background:
    radial-gradient(circle, rgba(186, 151, 82, 0.7), transparent 58%),
    rgba(44, 39, 31, 0.22);
  background-size: cover;
  background-position: center;
}

.item-card strong,
.item-card span {
  display: block;
  white-space: normal;
  overflow-wrap: break-word;
  word-break: normal;
}

.item-card span {
  color: #716759;
  font-size: 0.85rem;
  font-weight: 850;
}

.item-card p,
.item-description {
  margin: 4px 0 0;
  white-space: normal;
  width: 100%;
  max-width: none;
  overflow-wrap: normal;
  word-break: normal;
  color: #352b21;
  font-family: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  font-weight: 400;
  line-height: 1.55;
}

.item-description > * {
  max-width: none;
}

.item-description p,
.item-description div {
  margin: 0;
  width: auto;
  max-width: none;
  font-weight: inherit;
  line-height: inherit;
}

.item-description strong,
.item-description b {
  font-weight: 700;
}

.bestiary-filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: end;
  margin: 16px 0 20px;
  padding: 12px;
  border: 1px solid rgba(92, 71, 45, 0.32);
  background:
    linear-gradient(135deg, rgba(255, 251, 233, 0.86), rgba(229, 213, 177, 0.68)),
    radial-gradient(circle at 0 0, rgba(123, 43, 36, 0.1), transparent 30%);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 219, 0.55);
}

.bestiary-filter-title {
  grid-column: 1 / -1;
  display: grid;
  gap: 1px;
  color: #7b2b24;
  font-family: "Marcellus SC", serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.bestiary-filter-title span {
  color: #6f6558;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.96rem;
  letter-spacing: 0;
  text-transform: none;
}

.bestiary-filter-fields {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr));
  gap: 8px;
}

.bestiary-filter-fields label,
.bulk-monster-filters label {
  display: grid;
  gap: 4px;
}

.bestiary-filter-fields span {
  color: #7b2b24;
  font-size: 0.86rem;
  font-weight: 800;
}

.bulk-monster-filters {
  display: contents;
}

.database-card {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  align-content: start;
  width: 100%;
  max-width: 100%;
  padding: 16px;
  border: 1px solid rgba(92, 71, 45, 0.36);
  background:
    linear-gradient(135deg, rgba(255, 251, 233, 0.88), rgba(235, 221, 185, 0.68)),
    radial-gradient(circle at 0 0, rgba(166, 122, 61, 0.14), transparent 34%);
  color: #352b21;
  font-weight: 600;
  box-shadow: inset 0 0 0 1px rgba(255, 247, 219, 0.62), 0 8px 22px rgba(61, 43, 24, 0.08);
}

.database-card[hidden] {
  display: none !important;
}

.database-card-image {
  align-self: start;
  width: var(--card-image-size, 76px);
  height: var(--card-image-size, 76px);
  border: 1px solid rgba(68, 55, 39, 0.42);
  background:
    radial-gradient(circle, rgba(255, 247, 206, 0.2), transparent 58%),
    var(--quality-bg, rgba(44, 39, 31, 0.16));
  background-position: var(--card-image-object-x, 50%) var(--card-image-object-y, 50%);
  background-repeat: no-repeat;
  background-size: var(--card-image-object-scale, 100%) auto;
}

.card-image-controls input {
  min-width: 0;
}

.database-card-content {
  display: grid;
  gap: 7px;
  align-content: start;
  align-items: start;
  min-width: 0;
}

.database-card-content > strong {
  color: #2b2118;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: var(--card-title-size, 1.22rem);
  font-weight: 900;
  line-height: 1.05;
}

.database-card-content > span {
  color: #716759;
  font-size: var(--card-meta-size, 0.86rem);
  font-weight: 800;
}

.database-card-content > p {
  margin: 0;
  color: #352b21;
  line-height: 1.5;
  white-space: pre-line;
}

.database-card-lines {
  display: grid;
  gap: 0;
  margin-top: 5px;
  border-top: 1px solid rgba(92, 71, 45, 0.14);
}

.database-card-lines > div {
  display: grid;
  grid-template-columns: minmax(120px, 176px) minmax(0, 1fr);
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(92, 71, 45, 0.11);
  font-size: var(--card-line-font-size, 1rem);
  color: #30261d;
}

.database-card-elixir-link {
  display: grid;
  grid-template-columns: minmax(120px, 176px) minmax(0, 1fr);
  gap: 14px;
  width: 100%;
  padding: 7px 0;
  border: 0;
  border-bottom: 1px solid rgba(92, 71, 45, 0.11);
  background: transparent;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.database-card-elixir-link > b {
  color: #7b2b24;
  line-height: 1.35;
}

.database-card-elixir-body {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.database-card-elixir-body i {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border: 1px solid rgba(92, 71, 45, 0.22);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-color: rgba(255, 253, 242, 0.65);
}

.database-card-elixir-body span {
  display: grid;
  gap: 1px;
  min-width: 0;
}

.database-card-elixir-body strong {
  color: #352b21;
  font-weight: 800;
  line-height: 1.2;
}

.database-card-elixir-body small {
  color: #716759;
  font-size: 0.82em;
  line-height: 1.2;
}

.database-card-elixir-link:hover .database-card-elixir-body strong {
  color: #8a2b24;
}

.database-card-lines > div > b {
  color: #7b2b24;
  line-height: 1.35;
}

.database-card-lines > div > span {
  min-width: 0;
  white-space: pre-line;
  overflow-wrap: break-word;
  display: block;
  line-height: 1.45;
}

.elite-stat {
  color: #4b53bd;
  font-style: normal;
  font-weight: 900;
}

.database-card-type-abilities,
.database-card-type-combo {
  grid-template-columns: 96px minmax(0, 1fr);
  max-width: none;
}

.database-card-type-abilities .database-card-image,
.database-card-type-combo .database-card-image {
  width: 92px;
  height: 92px;
}

.database-card-type-abilities .database-card-lines > div,
.database-card-type-combo .database-card-lines > div {
  grid-template-columns: minmax(150px, 230px) minmax(0, 1fr);
  padding: 9px 0;
}

.database-card-type-abilities .database-card-lines > div > span,
.database-card-type-combo .database-card-lines > div > span {
  font-size: 1.08em;
  line-height: 1.45;
}

.combo-finisher {
  display: grid;
  gap: 10px;
}

.combo-sequence {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.combo-sequence i {
  color: rgba(82, 61, 40, 0.58);
  font-style: normal;
  font-weight: 900;
}

.combo-zone {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 10px;
  border: 1px solid rgba(123, 43, 36, 0.25);
  background: rgba(255, 253, 242, 0.78);
  color: #7b2b24;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.combo-zone-final {
  border-color: rgba(75, 83, 189, 0.38);
  background: rgba(75, 83, 189, 0.12);
  color: #424bbb;
}

.combo-steps {
  display: grid;
  gap: 1px;
  margin: 0;
  padding-left: 24px;
  line-height: 1.28;
}

.combo-steps li {
  margin: 0;
  padding: 1px 0;
  background: transparent;
}

.database-card-compact {
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  background:
    linear-gradient(135deg, rgba(255, 249, 228, 0.94), rgba(231, 215, 184, 0.64)),
    radial-gradient(circle at 0 0, rgba(123, 43, 36, 0.08), transparent 28%);
}

.database-card-compact .database-card-image {
  grid-row: 1 / span 2;
  width: var(--card-image-size, 52px);
  height: var(--card-image-size, 52px);
}

.database-card-compact:not(.database-card-set) .database-card-content {
  display: contents;
}

.database-card-compact:not(.database-card-set) .database-card-content > strong,
.database-card-compact:not(.database-card-set) .database-card-content > span {
  grid-column: 2;
}

.database-card-compact:not(.database-card-set) .database-card-lines {
  grid-column: 1 / -1;
  margin-top: 8px;
}

.database-card-compact.database-card-set .database-card-content {
  gap: 4px;
}

.database-card-compact .database-card-content > strong {
  font-size: var(--card-title-size, 1.12rem);
}

.database-card-compact .database-card-content > span {
  font-size: var(--card-meta-size, 0.88rem);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.database-card-lines-row .database-card-lines,
.database-card-compact.database-card-lines-row .database-card-lines {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 3px;
  border-top: 0;
}

.database-card-lines-row .database-card-lines > div,
.database-card-compact.database-card-lines-row .database-card-lines > div,
.database-card-lines-row .database-card-elixir-link,
.database-card-compact.database-card-lines-row .database-card-elixir-link {
  display: inline-flex;
  align-items: baseline;
  gap: 4px;
  max-width: 100%;
  padding: 3px 7px;
  border: 1px solid rgba(92, 71, 45, 0.16);
  background: rgba(255, 253, 242, 0.58);
  font-size: var(--card-line-font-size, 0.95rem);
  line-height: 1.28;
}

.database-card-lines-row .database-card-lines > div > b,
.database-card-compact.database-card-lines-row .database-card-lines > div > b {
  color: #7b2b24;
  white-space: nowrap;
}

.database-card-lines-row .database-card-lines > div > span,
.database-card-compact.database-card-lines-row .database-card-lines > div > span {
  display: inline;
  max-width: none;
  overflow: visible;
  line-height: 1.28;
  text-overflow: clip;
  white-space: pre-line;
}

.database-card-lines-column .database-card-lines {
  display: grid;
  gap: 5px;
  border-top: 0;
}

.database-card-lines-column .database-card-lines > div {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: baseline;
  gap: 4px 8px;
  padding: 5px 8px;
  border: 1px solid rgba(92, 71, 45, 0.16);
  background: rgba(255, 253, 242, 0.58);
  font-size: var(--card-line-font-size, 0.95rem);
}

.database-card-lines-column .database-card-elixir-link {
  grid-template-columns: max-content minmax(0, 1fr);
  align-items: center;
  gap: 4px 8px;
  padding: 5px 8px;
  border: 1px solid rgba(92, 71, 45, 0.16);
  background: rgba(255, 253, 242, 0.58);
  font-size: var(--card-line-font-size, 0.95rem);
}

.database-card-lines-column .database-card-lines > div > b {
  white-space: nowrap;
}

.database-card-lines-column .database-card-lines > div > span {
  min-width: 0;
  white-space: pre-line;
}

.database-card-monster {
  display: grid;
  grid-template-columns: minmax(150px, 210px) minmax(0, 1fr);
  gap: 12px 14px;
  align-items: start;
  align-content: start;
  min-width: 0;
  overflow: hidden;
  width: 100%;
  max-width: none;
  background:
    linear-gradient(135deg, rgba(255, 251, 233, 0.9), rgba(229, 213, 177, 0.7)),
    radial-gradient(circle at 12% 16%, rgba(91, 46, 35, 0.2), transparent 32%);
}

.database-card-monster .database-card-image {
  grid-column: 1;
  grid-row: 1;
  float: none;
  width: 100%;
  height: var(--monster-image-height, 330px);
  margin: 0;
  border-color: rgba(74, 56, 39, 0.55);
  background:
    radial-gradient(circle at 50% 24%, rgba(255, 238, 177, 0.22), transparent 35%),
    linear-gradient(180deg, rgba(47, 38, 30, 0.18), rgba(47, 38, 30, 0.36)),
    var(--quality-bg, rgba(44, 39, 31, 0.16));
  background-position: var(--card-image-object-x, 50%) var(--card-image-object-y, 50%);
  background-repeat: no-repeat;
  background-size: var(--card-image-object-scale, 100%) auto;
  box-shadow: inset 0 0 0 1px rgba(255, 246, 216, 0.35), 0 10px 24px rgba(46, 32, 18, 0.14);
}

.database-card-monster .database-card-content,
.database-card-monster.database-card-compact:not(.database-card-set) .database-card-content {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  align-content: start;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.database-card-monster .database-card-content > strong,
.database-card-monster.database-card-compact:not(.database-card-set) .database-card-content > strong,
.database-card-monster.database-card-compact:not(.database-card-set) .database-card-content > span,
.database-card-monster .database-card-content > span {
  min-width: 0;
}

.database-card-monster .database-card-content > span {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

.database-card-monster .database-card-lines,
.database-card-monster.database-card-compact:not(.database-card-set) .database-card-lines {
  display: grid;
  gap: 6px;
  margin-top: 0;
  border-top: 0;
  min-width: 0;
}

/* Appearance cards use the free column beside the portrait instead of
   pushing short bonuses and acquisition details below the image. */
.database-card-appearance .database-card-lines {
  align-content: start;
  grid-template-columns: 1fr;
  margin-top: 4px;
}

.database-card-appearance .database-card-lines > div {
  min-height: 0;
}

/* Monster cards stay one readable characteristic list inside each card.
   The bestiary itself remains a two-card grid on laptop screens. */
.database-card-monster .database-card-lines > div:not(.database-card-lines-side) {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  gap: 4px 8px;
  min-width: 0;
  max-width: 100%;
  padding: 6px 7px;
  overflow: hidden;
  border: 1px solid rgba(92, 71, 45, 0.16);
  background: rgba(255, 253, 242, 0.54);
}

.database-card-monster .database-card-lines > div:not(.database-card-lines-side) > b {
  color: #7b2b24;
  white-space: nowrap;
}

.database-card-monster .database-card-lines > div:not(.database-card-lines-side) > b::after { content: ":"; }

.database-card-monster .database-card-lines > div:not(.database-card-lines-side) > span {
  min-width: 0;
  max-width: 100%;
  overflow-wrap: anywhere;
  white-space: normal;
}

.database-card-monster .database-card-lines-side,
.database-card-monster .database-card-monster-bottom {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.database-card-monster .database-card-lines-side {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.database-card-monster .database-card-monster-bottom {
  grid-column: 1 / -1;
  grid-row: 2;
  grid-template-columns: 1fr;
}

.database-card-monster .database-card-lines-side > div,
.database-card-monster .database-card-monster-bottom > div,
.database-card-monster .database-card-elixir-link,
.database-card-monster.database-card-compact:not(.database-card-set) .database-card-elixir-link {
  display: grid;
  grid-template-columns: minmax(0, max-content) minmax(0, 1fr);
  gap: 4px 8px;
  min-height: 0;
  min-width: 0;
  max-width: 100%;
  overflow: hidden;
  padding: 6px 7px;
  border: 1px solid rgba(92, 71, 45, 0.16);
  background: rgba(255, 253, 242, 0.54);
  font-family: var(--body-font);
  font-size: var(--card-line-font-size, 0.98rem);
  line-height: 1.28;
}

.database-card-monster .database-card-lines-side > div > b,
.database-card-monster .database-card-monster-bottom > div > b {
  color: #7b2b24;
  white-space: nowrap;
  font-size: 1em;
  line-height: inherit;
}

.database-card-monster .monster-field-pair b,
.database-card-monster .database-card-elixir-link > b {
  color: #7b2b24;
  font-size: 1em;
  line-height: inherit;
  white-space: nowrap;
}

.database-card-monster .database-card-lines-side > div > b::after,
.database-card-monster .database-card-monster-bottom > div > b::after,
.database-card-monster .database-card-elixir-link > b::after {
  content: ":";
}

.database-card-monster .database-card-lines-side > div > span,
.database-card-monster .database-card-monster-bottom > div > span,
.database-card-monster .database-card-elixir-link > span {
  min-width: 0;
  line-height: 1.28;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: normal;
  max-width: 100%;
  overflow: hidden;
}

.database-card-monster .monster-field-wide {
  grid-column: 1 / -1;
}

.database-card-monster .monster-summary-wide {
  grid-column: 1 / -1;
}

.database-card-monster .database-card-elixir-link {
  grid-column: 1 / -1;
}

.database-card-monster .database-card-monster-bottom > div > span {
  max-height: 5.2em;
  overflow: hidden;
}

.content-column > .database-card-compact {
  height: auto;
  align-self: start;
}

.database-card-set {
  display: block;
  padding: 18px;
}

.database-card-set.database-card-compact {
  padding: 12px;
}

.database-card-set > .database-card-image {
  display: none;
}

.database-card-set .database-card-content {
  gap: 10px;
}

.database-card-set .database-card-content > strong {
  font-size: clamp(1.45rem, 2vw, 2.1rem);
  letter-spacing: 0.01em;
}

.database-card-set.database-card-compact .database-card-content > strong {
  font-size: 1.2rem;
}

.database-card-set .database-card-content > span {
  width: fit-content;
  padding: 3px 9px;
  border: 1px solid rgba(123, 43, 36, 0.2);
  background: rgba(123, 43, 36, 0.07);
  color: #6f2a23;
}

.set-composition {
  display: grid;
  grid-column: 1 / -1;
  gap: 12px;
  margin-top: 4px;
  padding-top: 10px;
  border-top: 1px solid rgba(92, 71, 45, 0.18);
}

.set-composition-head,
.set-tier summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.set-composition-head b {
  color: #7b2b24;
  font-size: 1.08rem;
}

.set-composition-head span,
.set-tier summary span {
  color: #756653;
  font-size: 0.88rem;
  font-weight: 800;
}

.set-filters {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(92, 71, 45, 0.18);
  background: rgba(255, 250, 230, 0.38);
}

.set-filters label {
  display: grid;
  gap: 4px;
  color: #6f2a23;
  font-size: 0.86rem;
  font-weight: 900;
}

.set-filters select {
  min-width: 0;
  padding: 6px 8px;
  border: 1px solid rgba(92, 71, 45, 0.28);
  background: rgba(255, 253, 241, 0.74);
  color: #2b2118;
  font: inherit;
}

.set-filter-actions {
  display: flex;
  align-items: end;
  gap: 6px;
  flex-wrap: wrap;
  grid-column: 1 / -1;
}

.set-filter-actions button {
  min-height: 34px;
  padding: 5px 10px;
  border: 1px solid rgba(92, 71, 45, 0.32);
  background: rgba(255, 253, 241, 0.7);
  color: #6f2a23;
  font: inherit;
  font-weight: 900;
  cursor: pointer;
}

.set-quality-filter,
.set-tier-filter,
.set-slot-filter {
  grid-column: 1 / -1;
  display: grid;
  gap: 6px;
}

.set-quality-filter strong,
.set-tier-filter strong,
.set-slot-filter strong {
  color: #6f2a23;
  font-size: 0.86rem;
}

.set-quality-filter div,
.set-tier-filter div,
.set-slot-filter div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.set-quality-filter label,
.set-tier-filter label,
.set-slot-filter label {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 7px;
  border: 1px solid rgba(92, 71, 45, 0.18);
  background: rgba(255, 253, 241, 0.58);
  color: #4a382c;
}

.set-tier {
  border: 1px solid rgba(92, 71, 45, 0.2);
  background: rgba(255, 250, 230, 0.5);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 219, 0.48);
}

.set-tier summary {
  cursor: pointer;
  padding: 8px 12px;
  color: #2b2118;
  font-weight: 900;
  list-style: none;
  justify-content: flex-start;
}

.set-tier summary::-webkit-details-marker {
  display: none;
}

.set-tier summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  border: 1px solid rgba(123, 43, 36, 0.28);
  color: #7b2b24;
  font-size: 0.9rem;
  line-height: 1;
}

.set-tier[open] summary::before {
  content: "-";
}

.set-tier summary b {
  margin-right: auto;
  color: #2b2118;
}

.set-quality-group {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.set-quality-title {
  color: #7b2b24;
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.set-slot-group {
  display: grid;
  gap: 7px;
}

.set-slot-group h4 {
  margin: 0;
  padding: 4px 8px;
  border-left: 3px solid rgba(123, 43, 36, 0.45);
  background: rgba(255, 253, 241, 0.4);
  color: #4a382c;
  font-size: 0.92rem;
}

.set-items-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 10px;
}

.set-mini-item {
  position: relative;
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(92, 71, 45, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 253, 241, 0.82), rgba(239, 227, 194, 0.52));
  align-content: start;
}

.set-mini-item::after {
  content: "Тир " attr(data-set-tier);
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 1px 6px;
  border: 1px solid rgba(92, 71, 45, 0.18);
  background: rgba(255, 250, 230, 0.72);
  color: #7b2b24;
  font-size: 0.72rem;
  font-weight: 900;
}

.set-mini-image {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(68, 55, 39, 0.32);
  background:
    radial-gradient(circle, rgba(255, 244, 194, 0.22), transparent 58%),
    var(--quality-bg, rgba(44, 39, 31, 0.12));
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.set-mini-body {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.set-mini-body strong {
  color: #2b2118;
  line-height: 1.05;
  overflow-wrap: break-word;
}

.set-mini-body span {
  color: #756653;
  font-size: 0.82rem;
  font-weight: 800;
}

.set-mini-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.set-mini-stats span {
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid rgba(92, 71, 45, 0.16);
  background: rgba(255, 250, 230, 0.58);
  color: #4a382c;
  font-size: 0.78rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.set-mini-stats .comparison-better,
.set-detail-chip-row .comparison-better {
  border-color: rgba(45, 120, 61, 0.48);
  background: rgba(75, 151, 84, 0.16);
  color: #245e2f;
}

.set-mini-stats .comparison-worse,
.set-detail-chip-row .comparison-worse {
  border-color: rgba(150, 49, 39, 0.48);
  background: rgba(164, 58, 47, 0.15);
  color: #812a23;
}

.item-comparison-difference {
  margin-left: 5px;
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 900;
}

.set-mini-details {
  margin-top: 2px;
  border-top: 1px solid rgba(92, 71, 45, 0.12);
  padding-top: 4px;
}

.set-mini-details summary {
  width: fit-content;
  cursor: pointer;
  color: #7b2b24;
  font-size: 0.82rem;
  font-weight: 900;
}

.set-mini-body dl {
  display: grid;
  gap: 4px;
  margin: 6px 0 0;
}

.set-mini-body dl div {
  display: grid;
  gap: 4px;
  border: 0;
  padding: 4px 0;
}

.set-mini-body dt,
.set-mini-body dd {
  margin: 0;
  min-width: 0;
  line-height: 1.25;
}

.set-mini-body dt {
  color: #7b2b24;
  font-weight: 900;
}

.set-mini-body dd {
  overflow-wrap: break-word;
  word-break: normal;
  hyphens: auto;
  white-space: pre-line;
}

.set-detail-chip-row dd {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.set-detail-chip-row dd span {
  max-width: 100%;
  padding: 2px 7px;
  border: 1px solid rgba(92, 71, 45, 0.16);
  background: rgba(255, 250, 230, 0.58);
  color: #4a382c;
  font-size: 0.78rem;
  line-height: 1.25;
  overflow-wrap: break-word;
}

.rune-calculator {
  display: grid;
  gap: 18px;
  padding: clamp(16px, 2vw, 24px);
  --rune-table-width: 460px;
  --rune-row-height: 42px;
  border: 1px solid rgba(92, 71, 45, 0.38);
  background:
    linear-gradient(rgba(255, 250, 232, 0.9), rgba(232, 217, 181, 0.82)),
    radial-gradient(circle at 50% 0, rgba(163, 58, 47, 0.12), transparent 36%);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 219, 0.72), 0 12px 28px rgba(61, 43, 24, 0.1);
}

.rune-calculator-head,
.rune-calculator-target {
  display: flex;
  align-items: end;
  justify-content: stretch;
  gap: 10px;
  flex-wrap: wrap;
}

.rune-calculator h3 {
  margin: 0;
  color: #2b2118;
  font-family: var(--aaa-title);
  font-size: clamp(1.45rem, 2.6vw, 2.05rem);
}

.rune-calculator-head > span {
  color: #7b2b24;
  font-family: var(--aaa-ui);
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rune-calculator-main {
  display: grid;
  gap: 14px;
}

.rune-calculator.result-right .rune-calculator-main {
  grid-template-columns: minmax(220px, var(--rune-table-width)) minmax(260px, 1fr);
  align-items: start;
}

.rune-calculator-panel {
  display: grid;
  gap: 12px;
  width: min(100%, var(--rune-table-width));
}

.rune-calculator-table-wrap {
  overflow-x: auto;
  width: min(100%, var(--rune-table-width));
}

.rune-calculator-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  background: rgba(255, 250, 232, 0.5);
}

.rune-calculator-table th,
.rune-calculator-table td {
  border: 1px solid rgba(92, 71, 45, 0.18);
  height: var(--rune-row-height);
  padding: 4px 8px;
  text-align: left;
}

.rune-calculator-table thead th {
  color: #7b2b24;
  background: rgba(166, 122, 61, 0.12);
  font-family: var(--aaa-ui);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rune-calculator-table tbody th {
  width: 42%;
  color: #2b2118;
  font-family: var(--aaa-body);
  font-size: 1.05rem;
}

.rune-calculator-table td {
  width: 29%;
  vertical-align: middle;
}

.rune-calculator label {
  display: grid;
  gap: 4px;
  color: #5b4a38;
  font-size: 0.96rem;
  font-weight: 800;
}

.rune-calculator-target label {
  flex: 1 1 180px;
  color: #7b2b24;
  font-family: var(--aaa-ui);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rune-calculator input,
.rune-calculator select {
  min-height: var(--rune-row-height);
  border: 1px solid rgba(92, 71, 45, 0.34);
  background: rgba(255, 252, 240, 0.74);
  color: #2b2118;
  font: inherit;
}

.rune-calculator-target input,
.rune-calculator-target select {
  height: var(--rune-row-height);
  font-family: var(--aaa-body);
  font-size: 1.05rem;
}

.rune-calculator-table input {
  width: 100%;
  height: calc(var(--rune-row-height) - 10px);
  min-height: 26px;
}

.rune-calculator-result {
  display: grid;
  gap: 12px;
  padding: 0;
  border-left: 0;
  background: rgba(255, 250, 232, 0.58);
}

.weapon-mastery {
  display: grid;
  gap: 14px;
  padding: clamp(14px, 2vw, 22px);
  border: 1px solid rgba(92, 71, 45, 0.38);
  background:
    linear-gradient(rgba(255, 250, 232, 0.88), rgba(232, 217, 181, 0.78)),
    radial-gradient(circle at 50% 0, rgba(163, 58, 47, 0.1), transparent 38%);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 219, 0.7), 0 12px 28px rgba(61, 43, 24, 0.08);
}

.weapon-mastery-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  border-bottom: 1px solid rgba(92, 71, 45, 0.2);
  padding-bottom: 10px;
}

.weapon-mastery h3 {
  margin: 0;
  color: #2b2118;
  font-family: var(--aaa-title);
  font-size: clamp(1.35rem, 2.4vw, 1.95rem);
}

.weapon-mastery-status {
  color: #7b2b24;
  font-family: var(--aaa-ui);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  white-space: nowrap;
}

.weapon-mastery-body {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.weapon-mastery-accordion {
  display: grid;
  gap: 10px;
}

.weapon-mastery-group {
  border: 1px solid rgba(92, 71, 45, 0.26);
  background: rgba(255, 250, 232, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 219, 0.58);
}

.weapon-mastery-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  padding: 10px 12px;
  color: #6d241d;
  font-family: var(--aaa-ui);
  font-size: 0.92rem;
  font-weight: 900;
  letter-spacing: 0.035em;
  list-style: none;
  text-transform: uppercase;
}

.weapon-mastery-group summary::-webkit-details-marker {
  display: none;
}

.weapon-mastery-group summary::before {
  content: "+";
  display: inline-grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(123, 43, 36, 0.28);
  background: rgba(255, 250, 232, 0.8);
  color: #7b2b24;
  font-family: var(--aaa-title);
  font-size: 1.05rem;
  line-height: 1;
}

.weapon-mastery-group[open] summary::before {
  content: "-";
}

.weapon-mastery-group summary span {
  flex: 1;
  min-width: 0;
}

.weapon-mastery-group summary em {
  color: rgba(58, 44, 32, 0.72);
  font-family: var(--aaa-body);
  font-size: 0.95rem;
  font-style: normal;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: none;
  white-space: nowrap;
}

.weapon-mastery-group-body {
  max-width: 100%;
  overflow-x: auto;
  border-top: 1px solid rgba(92, 71, 45, 0.18);
}

.weapon-mastery-table {
  width: 100%;
  min-width: 880px;
  border-collapse: collapse;
  background: rgba(255, 250, 232, 0.62);
  font-size: 17px;
}

.weapon-mastery-table th,
.weapon-mastery-table td {
  border: 1px solid rgba(92, 71, 45, 0.22);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.weapon-mastery-table thead th {
  background:
    linear-gradient(90deg, rgba(107, 76, 42, 0.25), rgba(194, 160, 109, 0.18));
  color: #6d241d;
  font-family: var(--aaa-ui);
  font-size: 0.78rem;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.weapon-mastery-table tbody th {
  color: #2b2118;
  font-family: var(--aaa-title);
}

.weapon-mastery-table tbody tr:nth-child(even) td,
.weapon-mastery-table tbody tr:nth-child(even) th {
  background: rgba(220, 201, 165, 0.2);
}

.weapon-mastery-elite-level,
.weapon-mastery-elite-gain {
  display: inline-block;
  margin-left: 5px;
  color: #3f6c38;
  font-size: 0.78em;
  font-weight: 900;
  line-height: 1.2;
  white-space: nowrap;
}

.weapon-mastery-elite-row td,
.weapon-mastery-elite-row th {
  background: rgba(221, 235, 202, 0.42) !important;
}

.weapon-mastery-elite-row > :first-child {
  box-shadow: inset 3px 0 #50723f;
}

.rune-result-summary {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-left: 3px solid #8a2b24;
  background: rgba(255, 250, 232, 0.72);
}

.rune-result-summary.enough {
  border-left-color: #50723f;
}

.rune-result-summary span,
.rune-result-summary em {
  color: #76654e;
  font-family: var(--aaa-ui);
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rune-result-summary strong {
  color: #2b2118;
  font-family: var(--aaa-ui);
}

.rune-result-section {
  padding: 0 14px 14px;
}

.rune-result-section h4 {
  margin: 0 0 8px;
  color: #7b2b24;
  font-family: var(--aaa-ui);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.rune-recipe-details {
  color: #3a2c20;
}

.rune-recipe-details summary {
  margin: 0 0 8px;
  color: #7b2b24;
  cursor: pointer;
  font-family: var(--aaa-ui);
  font-size: 0.95rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  list-style: none;
  text-transform: uppercase;
}

.rune-recipe-details summary::-webkit-details-marker {
  display: none;
}

.rune-recipe-details summary::before {
  content: "+";
  display: inline-block;
  width: 18px;
  color: #8a2b24;
}

.rune-recipe-details[open] summary::before {
  content: "-";
}

.rune-missing-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rune-missing-list li {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 2px 8px;
  padding: 8px 10px;
  border: 1px solid rgba(92, 71, 45, 0.16);
  background: rgba(255, 252, 240, 0.58);
}

.rune-missing-list b {
  grid-row: span 2;
  color: #8a2b24;
  font-size: 1.35rem;
  line-height: 1;
}

.rune-missing-list span {
  color: #2b2118;
  font-weight: 800;
}

.rune-missing-list em {
  color: #75644d;
  font-style: normal;
}

.rune-result-ok {
  margin: 0;
  color: #50723f;
  font-weight: 800;
}

.rune-buy-note {
  max-width: 560px;
  margin: 0 0 8px;
  color: #6b5a43;
  font-size: 0.95rem;
  font-weight: 800;
}

.rune-buy-table {
  width: 100%;
  max-width: 520px;
  border-collapse: collapse;
  background: rgba(255, 252, 240, 0.58);
}

.rune-buy-table th,
.rune-buy-table td {
  padding: 7px 9px;
  border: 1px solid rgba(92, 71, 45, 0.16);
  text-align: left;
}

.rune-buy-table thead th {
  color: #7b2b24;
  font-family: var(--aaa-ui);
  font-size: 0.8rem;
  text-transform: uppercase;
}

.rune-recipe-list {
  display: grid;
  gap: 6px;
  margin: 0;
  padding-left: 22px;
  color: #3a2c20;
}

.content-columns {
  display: grid;
  grid-template-columns: repeat(var(--columns-count, 2), minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.bestiary-filter-results {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin: 0 0 18px;
}

.bestiary-masonry {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
  margin: 0 0 18px;
}

.bestiary-filter-result {
  display: grid;
  width: 100%;
  min-width: 0;
  margin: 0;
  break-inside: avoid;
}

.bestiary-masonry-item {
  display: grid;
  width: 100%;
  min-width: 0;
  margin: 0;
  break-inside: avoid;
}

.bestiary-filter-result > .database-card,
.bestiary-masonry-item > .database-card {
  height: auto;
  min-width: 0;
  max-width: none;
  align-self: start;
}

.content-columns[hidden],
.content-column[hidden],
.bestiary-masonry[hidden],
.bestiary-masonry-item[hidden],
.database-card[hidden],
.content-column:has(> .database-card[hidden]:only-child) {
  display: none !important;
}

.content-column {
  display: grid;
  gap: 12px;
  min-width: 0;
  align-content: stretch;
}

.content-column > .database-card,
.content-column > .item-card,
.content-column > .content-callout,
.content-column > blockquote,
.content-column > .content-table,
.content-column > .content-image {
  height: 100%;
  align-self: stretch;
}

.content-column > .database-card-monster {
  height: auto;
  align-self: start;
}

.content-columns:has(.database-card-monster) {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  align-items: start;
}

.content-columns:has(.database-card-monster) > .content-column {
  display: block;
  width: 100%;
  margin: 0;
  break-inside: avoid;
}

@media (max-width: 860px) {
  .bestiary-filter-results,
  .bestiary-masonry,
  .content-columns:has(.database-card-monster) {
    grid-template-columns: 1fr;
  }
}

@media (min-width: 2350px) {
  .bestiary-filter-results,
  .bestiary-masonry,
  .content-columns:has(.database-card-monster) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 3300px) {
  .bestiary-filter-results,
  .bestiary-masonry,
  .content-columns:has(.database-card-monster) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

.columns-editor-grid {
  display: grid;
  grid-template-columns: repeat(var(--editor-columns-count, 2), minmax(180px, 1fr));
  gap: 12px;
}

.column-editor-panel {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(79, 63, 43, 0.26);
  background: rgba(255, 250, 232, 0.48);
}

.column-block-editor {
  display: grid;
  gap: 10px;
  min-width: 0;
}

@media (max-width: 720px) {
  .bestiary-filter-panel {
    grid-template-columns: 1fr;
  }

  .bestiary-filter-fields {
    grid-template-columns: 1fr;
  }

  .bestiary-filter-results {
    grid-template-columns: 1fr;
  }

  .database-card {
    grid-template-columns: 56px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

  .database-card-image {
    width: 56px;
    height: 56px;
  }

  .database-card-lines div {
    grid-template-columns: 1fr;
    gap: 2px;
  }

  .database-card-monster {
    grid-template-columns: 1fr;
  }

  .database-card-monster .database-card-image,
  .database-card-monster .database-card-content,
  .database-card-monster .database-card-monster-bottom {
    grid-column: 1;
  }

  .database-card-monster .database-card-image {
    height: 300px;
  }

  .database-card-monster .database-card-lines-side,
  .database-card-monster .database-card-monster-bottom {
    grid-template-columns: 1fr;
  }

  .rune-result-summary {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .rune-calculator.result-right .rune-calculator-main {
    grid-template-columns: 1fr;
  }

  .content-columns,
  .columns-editor-grid {
    grid-template-columns: 1fr;
  }
}

.card-dynamic-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(79, 63, 43, 0.28);
  background: rgba(255, 250, 232, 0.42);
}

.card-dynamic-fields,
#cardDynamicFields {
  display: grid;
  gap: 10px;
}

.card-dynamic-field {
  display: grid;
  gap: 6px;
}

.card-dynamic-field-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  color: #4a382c;
  font-weight: 800;
}

.card-field-label-editor {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.card-field-label-editor span {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}

.card-field-label-editor small {
  color: rgba(74, 56, 44, 0.66);
  font-size: 0.78rem;
  font-weight: 700;
}

.card-field-label-editor input {
  min-width: 0;
}

.card-field-order-controls {
  display: inline-flex;
  gap: 4px;
}

.card-field-order-controls button {
  width: 28px;
  height: 26px;
  padding: 0;
  border: 1px solid rgba(74, 56, 44, 0.34);
  background: rgba(231, 215, 184, 0.72);
  color: #4a382c;
  cursor: pointer;
}

.card-field-order-controls button:disabled {
  cursor: default;
  opacity: 0.35;
}

.card-dynamic-field textarea {
  min-height: 58px;
  resize: vertical;
}

.card-dynamic-field textarea[data-card-field="contains"],
.card-dynamic-field textarea[data-card-field="setBonuses"] {
  min-height: 76px;
  max-height: 180px;
  overflow: auto;
  font-size: 0.92rem;
  line-height: 1.35;
}

.card-bulk-editor {
  display: grid;
  gap: 10px;
}

.bulk-options {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
  gap: 8px;
}

.bulk-options label {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 7px 9px;
  border: 1px solid rgba(92, 71, 45, 0.18);
  background: rgba(255, 253, 241, 0.46);
  color: #4a382c;
  font-weight: 800;
}

.card-picker-search {
  width: 100%;
}

.card-image-dropzone {
  display: grid;
  gap: 4px;
  min-height: 92px;
  place-items: center;
  padding: 14px;
  border: 1px dashed rgba(109, 36, 29, 0.45);
  background:
    radial-gradient(circle at 50% 0%, rgba(255, 244, 217, 0.58), transparent 42%),
    rgba(255, 250, 232, 0.62);
  color: #5b5042;
  text-align: center;
  transition: border-color 160ms ease, background 160ms ease, box-shadow 160ms ease;
}

.card-image-dropzone strong {
  color: #6d241d;
  font-family: "Marcellus SC", Georgia, serif;
  font-weight: 900;
}

.card-image-dropzone span {
  font-size: 0.9rem;
  font-weight: 750;
}

.card-image-dropzone.drag-over {
  border-color: rgba(139, 46, 46, 0.8);
  background: rgba(255, 238, 191, 0.84);
  box-shadow: inset 0 0 0 1px rgba(139, 46, 46, 0.18);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.home-info-panel,
.player-lookup-panel,
.world-status-panel,
.chaos-status-panel,
.rating-page {
  border: 1px solid rgba(70, 57, 41, 0.46);
  background:
    linear-gradient(135deg, rgba(250, 242, 218, 0.92), rgba(222, 207, 173, 0.82)),
    var(--paper);
  box-shadow: 4px 4px 0 rgba(36, 28, 21, 0.12);
}

.home-info-panel,
.player-lookup-panel,
.world-status-panel,
.chaos-status-panel {
  min-width: 0;
  min-height: 112px;
  padding: 8px 10px;
  overflow: hidden;
}

.world-status-panel {
  background:
    linear-gradient(135deg, rgba(248, 241, 216, 0.94), rgba(211, 211, 169, 0.78)),
    var(--paper);
}

.chaos-status-panel {
  background:
    linear-gradient(135deg, rgba(250, 241, 214, 0.94), rgba(224, 199, 157, 0.82)),
    var(--paper);
}

.home-top-panels {
  display: grid;
  grid-template-columns: minmax(340px, 1.45fr) minmax(300px, 1fr) minmax(230px, 0.78fr) minmax(340px, 1.2fr);
  align-items: stretch;
  gap: 14px;
  margin: 0 0 14px;
}

.player-lookup-panel {
  display: grid;
  align-content: start;
  gap: 7px;
  width: 100%;
  margin: 0;
  box-shadow: 2px 2px 0 rgba(36, 28, 21, 0.1);
}

.player-lookup-heading,
.player-lookup-form {
  width: 100%;
}

.world-status-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-content: start;
  align-items: end;
  gap: 8px 10px;
  width: 100%;
  margin: 0;
  box-shadow: 2px 2px 0 rgba(36, 28, 21, 0.1);
}

.chaos-status-panel {
  display: grid;
  align-content: start;
  gap: 6px;
  width: 100%;
  margin: 0;
  box-shadow: 2px 2px 0 rgba(36, 28, 21, 0.1);
}

.home-info-heading,
.player-lookup-heading,
.world-status-heading,
.chaos-status-heading {
  min-height: 0;
  padding-bottom: 5px;
  border-bottom: 1px solid rgba(111, 38, 31, 0.2);
}

.home-info-heading,
.player-lookup-heading,
.world-status-heading,
.chaos-status-heading > div {
  display: grid;
  align-content: start;
  min-width: 0;
}

.chaos-status-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.chaos-status-heading > div {
  flex: 1 1 auto;
}

.chaos-tracker-refresh {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  min-height: 32px;
  padding: 0;
  border: 1px solid rgba(111, 38, 31, 0.28);
  background: rgba(255, 250, 234, 0.6);
  color: #6f261f;
  cursor: pointer;
  font-family: var(--aaa-ui);
  font-size: 1.15rem;
  font-weight: 850;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  transition: border-color 160ms ease, background-color 160ms ease, color 160ms ease;
}

.chaos-tracker-refresh:hover:not(:disabled),
.chaos-tracker-refresh:focus-visible {
  border-color: rgba(111, 38, 31, 0.58);
  background: rgba(255, 250, 234, 0.94);
}

.chaos-tracker-refresh:disabled {
  color: #81776a;
  cursor: wait;
  opacity: 0.72;
}

.chaos-tracker-refresh.is-loading > span:first-child {
  animation: chaos-refresh-spin 900ms linear infinite;
}

@keyframes chaos-refresh-spin {
  to { transform: rotate(360deg); }
}

.world-status-online {
  display: grid;
  align-content: start;
  gap: 7px;
  min-width: 0;
}

.chaos-tracker {
  position: relative;
  display: grid;
  align-content: center;
  min-width: 0;
  min-height: 64px;
  padding: 5px 52px 5px 8px;
  border: 1px solid rgba(70, 57, 41, 0.16);
  color: #2b2118;
  background: rgba(255, 250, 234, 0.36);
  font-family: var(--aaa-ui);
  text-decoration: none;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.chaos-status-panel .chaos-tracker {
  width: 100%;
}

.chaos-tracker-emblem {
  position: absolute;
  top: 50%;
  right: 8px;
  width: 40px;
  height: 40px;
  object-fit: contain;
  opacity: 0.9;
  filter: drop-shadow(0 2px 3px rgba(32, 22, 27, 0.3));
  transform: translateY(-50%);
  pointer-events: none;
}

.chaos-tracker[href] {
  cursor: pointer;
}

.chaos-tracker[href]:hover,
.chaos-tracker[href]:focus-visible {
  border-color: rgba(122, 50, 39, 0.64);
  background: rgba(255, 250, 234, 0.9);
  transform: translateY(-1px);
}

.chaos-tracker-dot {
  flex: 0 0 auto;
  width: 13px;
  height: 13px;
  border-radius: 999px;
  background: #8f8778;
  box-shadow: 0 0 0 2px rgba(70, 57, 41, 0.12);
}

.chaos-tracker.is-present .chaos-tracker-dot {
  background: radial-gradient(circle at 35% 30%, #d6ffd1, #3ccb5e 42%, #118537 100%);
  box-shadow: 0 0 0 2px rgba(27, 115, 45, 0.18), 0 0 11px rgba(38, 214, 87, 0.68);
}

.chaos-tracker.is-absent .chaos-tracker-dot {
  background: radial-gradient(circle at 35% 30%, #fff0be, #c88a36 46%, #86531f 100%);
  box-shadow: 0 0 0 2px rgba(134, 83, 31, 0.14), 0 0 8px rgba(190, 124, 43, 0.32);
}

.chaos-tracker.is-stale .chaos-tracker-dot,
.chaos-tracker.is-loading .chaos-tracker-dot {
  background: radial-gradient(circle at 35% 30%, #eee8dc, #9b9182 48%, #655d52 100%);
  box-shadow: 0 0 0 2px rgba(70, 57, 41, 0.12);
}

.chaos-tracker-copy {
  display: grid;
  justify-items: start;
  gap: 3px;
  min-width: 0;
  line-height: 1.2;
}

.chaos-tracker-main {
  display: flex;
  align-items: center;
  gap: 9px;
  min-width: 0;
}

.chaos-tracker-copy small {
  margin: 0;
  color: #4e4438;
  font-family: var(--aaa-body);
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  font-weight: 800;
  line-height: 1.25;
}

.chaos-tracker-schedule,
.chaos-tracker-summon {
  display: block;
  margin: 0;
  color: #6a5d4c;
  font-family: var(--aaa-body);
  font-size: clamp(0.88rem, 0.95vw, 0.98rem);
  font-weight: 750;
  line-height: 1.25;
}

.chaos-tracker-schedule {
  color: #55483a;
}

.chaos-tracker-summon {
  width: max-content;
  max-width: 100%;
  padding: 3px 8px 4px;
  border: 1px solid rgba(111, 38, 31, 0.24);
  background: rgba(144, 54, 42, 0.08);
  color: #6f261f;
  font-weight: 850;
}

.chaos-tracker.is-summon-ready .chaos-tracker-summon {
  border-color: rgba(27, 115, 45, 0.24);
  background: rgba(38, 142, 61, 0.09);
  color: #2d6f39;
}

.chaos-tracker.is-stale .chaos-tracker-summon,
.chaos-tracker.is-loading .chaos-tracker-summon {
  border-color: rgba(70, 57, 41, 0.18);
  background: rgba(70, 57, 41, 0.05);
  color: #6e655a;
}

.home-info-panel.hidden + .player-lookup-panel {
  grid-column: 1 / 2;
}

.home-info-panel.hidden + .player-lookup-panel + .world-status-panel {
  grid-column: 2 / 3;
}

.home-info-panel.hidden + .player-lookup-panel + .world-status-panel + .chaos-status-panel {
  grid-column: 3 / -1;
}

@media (min-width: 901px) and (max-width: 1400px) {
  .home-top-panels {
    grid-template-columns: minmax(260px, 0.9fr) minmax(360px, 1.1fr);
  }

  .home-top-panels:has(.home-info-panel.hidden) {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .home-info-panel,
  .player-lookup-panel,
  .world-status-panel,
  .chaos-status-panel,
  .home-info-panel.hidden + .player-lookup-panel,
  .home-info-panel.hidden + .player-lookup-panel + .world-status-panel,
  .home-info-panel.hidden + .player-lookup-panel + .world-status-panel + .chaos-status-panel {
    grid-column: auto;
  }
}

.home-info-panel .eyebrow,
.player-lookup-panel .eyebrow,
.world-status-panel .eyebrow,
.chaos-status-panel .eyebrow {
  margin: 0;
  font-size: clamp(0.72rem, 0.82vw, 0.84rem);
  line-height: 1.15;
}

.home-info-panel .eyebrow::after,
.player-lookup-panel .eyebrow::after,
.world-status-panel .eyebrow::after,
.chaos-status-panel .eyebrow::after {
  display: none;
}

.home-info-panel h2,
.player-lookup-panel h2,
.world-status-panel h2,
.chaos-status-panel h2,
.rating-heading h2 {
  margin: 0;
  color: #2b2118;
  font-family: var(--aaa-title);
  font-size: clamp(1.4rem, 2.5vw, 2.05rem);
  letter-spacing: 0.02em;
}

.home-info-panel h2,
.player-lookup-panel h2,
.world-status-panel h2,
.chaos-status-panel h2 {
  font-size: clamp(0.98rem, 1.12vw, 1.2rem);
  line-height: 1.08;
}

.world-status-panel h2 {
  margin: 0;
  color: #2b2118;
  font-family: var(--aaa-title);
  white-space: nowrap;
}

.home-info-panel {
  display: grid;
  align-content: start;
  gap: 8px;
  width: 100%;
  max-width: none;
}

.home-info-panel .eyebrow {
  color: #8a2b24;
}

.home-info-panel #homeInfoText {
  display: grid;
  gap: 4px;
}

.home-info-panel span {
  position: relative;
  display: block;
  padding-left: 12px;
  color: #2b2118;
  font-family: var(--aaa-body);
  font-size: clamp(0.9rem, 0.92vw, 1rem);
  font-weight: 650;
  line-height: 1.25;
  white-space: normal;
}

.home-info-panel span::before {
  content: "";
  position: absolute;
  top: 0.5em;
  left: 0;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #8a2b24;
  box-shadow: 0 0 0 2px rgba(201, 164, 93, 0.18);
}

.player-lookup-form,
.rating-search-form {
  display: flex;
  align-items: end;
  gap: 10px;
}

.player-lookup-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  width: 100%;
}

.player-lookup-form label {
  display: grid;
  gap: 3px;
  min-width: 0;
  color: #7e2d25;
  font-family: var(--aaa-ui);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
}

.player-lookup-form input,
.rating-search-form input {
  min-height: 40px;
  border: 1px solid rgba(70, 57, 41, 0.42);
  color: #2b2118;
  background: rgba(255, 250, 234, 0.76);
  font-family: var(--aaa-body);
  font-size: 1.05rem;
}

.player-lookup-form input {
  min-height: 38px;
  padding: 6px 10px;
  font-size: 0.98rem;
}

.player-lookup-form button,
.rating-search-form button,
.rating-controls button,
.rating-actions button,
.rating-actions a {
  min-height: 40px;
  padding: 8px 16px;
  border: 1px solid rgba(122, 50, 39, 0.48);
  color: #f7e8c8;
  background: linear-gradient(180deg, #8a332a, #5b221d);
  box-shadow: 2px 2px 0 rgba(36, 28, 21, 0.16);
  font-family: var(--aaa-ui);
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.player-lookup-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-height: 38px;
  padding: 6px 14px;
  font-size: 0.72rem;
}

.player-lookup-form button > span:first-child {
  font-size: 1.65rem;
  line-height: 0.7;
}

.player-online-panel {
  display: grid;
  grid-template-columns: auto auto;
  align-items: center;
  justify-content: center;
  gap: 2px 10px;
  width: 100%;
  min-width: 0;
  min-height: 70px;
  padding: 8px 12px;
  border: 1px solid rgba(70, 57, 41, 0.14);
  color: #2b2118;
  background: rgba(255, 250, 234, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 216, 0.35);
  font-family: var(--aaa-ui);
  text-decoration: none;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.player-online-panel:hover,
.player-online-panel:focus-visible {
  border-color: rgba(122, 50, 39, 0.66);
  background: rgba(255, 250, 234, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 216, 0.55), 0 3px 10px rgba(72, 43, 28, 0.16);
  transform: translateY(-1px);
}

.player-online-panel:focus-visible {
  outline: 2px solid rgba(122, 50, 39, 0.42);
  outline-offset: 2px;
}

.player-online-panel span {
  color: #675b4e;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.player-online-panel strong {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #2b2118;
  font-family: var(--aaa-title);
  font-size: clamp(1.8rem, 2.2vw, 2.25rem);
  line-height: 1;
}

.player-online-panel strong::after {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: radial-gradient(circle at 35% 30%, #d6ffd1, #3ccb5e 42%, #118537 100%);
  box-shadow: 0 0 0 2px rgba(27, 115, 45, 0.18), 0 0 12px rgba(38, 214, 87, 0.72);
}

.rating-page {
  padding: 16px;
}

.rating-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.rating-search-form input {
  width: min(280px, 42vw);
  padding: 8px 11px;
}

.rating-search-form button:last-child,
.rating-actions a {
  color: #6d241d;
  background: rgba(255, 247, 226, 0.6);
}

.rating-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.rating-controls button {
  color: #6d241d;
  background: rgba(255, 247, 226, 0.68);
}

.rating-controls button.active {
  color: #f7e8c8;
  background: linear-gradient(180deg, #8a332a, #5b221d);
}

.rating-status {
  margin-bottom: 10px;
  color: #6d241d;
  font-family: var(--aaa-ui);
  font-weight: 900;
  text-transform: uppercase;
}

.rating-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(70, 57, 41, 0.28);
  background: rgba(255, 250, 234, 0.46);
}

.rating-table {
  width: 100%;
  border-collapse: collapse;
  color: #2b2118;
}

.rating-table th,
.rating-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(70, 57, 41, 0.18);
  text-align: left;
  white-space: nowrap;
}

.rating-table th {
  color: #7e2d25;
  font-family: var(--aaa-ui);
  font-size: 0.86rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.rating-table td {
  font-size: 1.05rem;
  font-weight: 700;
}

.rating-player-link {
  display: block;
  padding: 0;
  border: 0;
  color: #2b2118;
  background: transparent;
  font-family: var(--aaa-title);
  font-size: 1.08rem;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.rating-player-link:hover {
  color: #8a2b24;
  text-decoration: underline;
}

.rating-table small {
  display: block;
  margin-top: 2px;
  color: rgba(43, 33, 24, 0.68);
  font-size: 0.82rem;
}

.rating-online {
  display: inline-block;
  padding: 2px 7px;
  color: #224b2c;
  background: rgba(93, 145, 78, 0.18);
  border: 1px solid rgba(93, 145, 78, 0.38);
  font-family: var(--aaa-ui);
  font-size: 0.76rem;
  text-transform: uppercase;
}

.rating-location {
  display: block;
  color: #2b2118;
  font-weight: 800;
}

.rating-location small {
  margin-top: 1px;
  color: rgba(43, 33, 24, 0.64);
}

.online-locator-page .rating-heading {
  align-items: center;
}

.online-locator-page .rating-heading p:not(.eyebrow) {
  max-width: 760px;
  margin: 5px 0 0;
  color: rgba(43, 33, 24, 0.72);
}

.online-location-name {
  color: #7e2d25;
}

.online-locator-table thead th {
  border-bottom: 2px solid rgba(111, 44, 35, 0.48);
  background: linear-gradient(180deg, rgba(126, 45, 37, 0.14), rgba(126, 45, 37, 0.07));
  color: #6f241e;
  font-size: 0.76rem;
  letter-spacing: 0.09em;
  box-shadow: inset 0 1px 0 rgba(255, 251, 233, 0.78);
}

.online-locator-table th button {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.online-locator-table th button::after {
  content: "↕";
  opacity: 0.38;
  font-size: 0.8em;
}

.online-locator-table th button.active[data-sort-direction="asc"]::after {
  content: "▲";
  opacity: 1;
}

.online-locator-table th button.active[data-sort-direction="desc"]::after {
  content: "▼";
  opacity: 1;
}

.admin-history-dialog {
  width: min(680px, calc(100vw - 28px));
  max-height: min(720px, calc(100vh - 40px));
  padding: 18px;
  border: 1px solid rgba(83, 46, 30, 0.54);
  background: #f8efd4;
  color: #2b2118;
  box-shadow: 0 24px 70px rgba(35, 20, 12, 0.38);
}

.admin-history-dialog::backdrop {
  background: rgba(28, 20, 14, 0.62);
}

.admin-history-head,
.admin-history-row,
.data-health-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.admin-history-head h2,
.admin-history-head p {
  margin: 0;
}

.admin-history-list,
.data-health-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.admin-history-row {
  padding: 11px 12px;
  border: 1px solid rgba(83, 60, 35, 0.22);
  background: rgba(255, 250, 232, 0.72);
}

.admin-history-row span {
  display: block;
  margin-top: 3px;
  color: rgba(43, 33, 24, 0.66);
  font-size: 0.88rem;
}

.data-health-summary {
  padding: 12px 14px;
  border: 1px solid rgba(83, 60, 35, 0.24);
  background: rgba(255, 249, 228, 0.68);
}

.data-health-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(83, 60, 35, 0.22);
  background: rgba(255, 251, 236, 0.72);
  color: #2b2118;
  text-align: left;
  cursor: pointer;
}

.data-health-row span {
  color: #7b2b24;
  font-size: 0.76rem;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.data-health-row.error {
  border-left: 4px solid #9a3028;
}

.data-health-row.warning {
  border-left: 4px solid #b87b25;
}

.article-status-field {
  display: grid;
  gap: 6px;
  color: #6d241d;
  font-weight: 800;
}

.article-publishing-settings {
  display: grid;
  gap: 10px;
  margin-top: 2px;
  padding: 12px 14px 14px;
  border: 1px solid rgba(95, 65, 37, 0.24);
  background: rgba(255, 250, 232, 0.48);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.42);
}

.article-publishing-settings h3 {
  margin: 0;
  color: var(--accent);
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 0.9rem;
  letter-spacing: 0.04em;
}

.article-publishing-grid {
  display: grid;
  grid-template-columns: 250px minmax(280px, 370px) minmax(280px, 370px);
  gap: 10px;
  align-items: stretch;
}

.article-feature-toggle {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
  min-width: 0;
  padding: 9px 11px;
  border: 1px solid rgba(95, 65, 37, 0.2);
  background: rgba(255, 252, 239, 0.72);
  color: var(--ink);
  cursor: pointer;
}

.article-feature-toggle input {
  width: 17px;
  height: 17px;
  margin: 0;
}

.article-feature-toggle span {
  display: grid;
  gap: 2px;
}

.article-feature-toggle strong { font-size: 0.88rem; }
.article-feature-toggle small { color: var(--muted); font-size: 0.72rem; line-height: 1.25; }

@media (max-width: 1050px) {
  .article-publishing-grid { grid-template-columns: 1fr; }
}

.related-cards-section {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(94, 61, 34, 0.28);
}

.related-cards-section h3 {
  margin: 0 0 12px;
  color: #742920;
}

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

.related-card-link {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 9px;
  border: 1px solid rgba(92, 58, 31, 0.28);
  background: rgba(255, 248, 222, 0.72);
  color: #2b2118;
  text-align: left;
  cursor: pointer;
}

.related-card-link:hover {
  border-color: #7b2b24;
  background: #fff7db;
}

.related-card-link > span:last-child {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.related-card-link strong,
.related-card-link small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-card-icon {
  width: 48px;
  height: 48px;
  border: 1px solid rgba(92, 58, 31, 0.24);
  background: rgba(111, 79, 43, 0.1) center / contain no-repeat;
}

.card-hover-popover {
  position: fixed;
  z-index: 10000;
  width: min(360px, calc(100vw - 24px));
  max-height: min(560px, calc(100vh - 24px));
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(80, 43, 26, 0.52);
  background: #f8efd4;
  box-shadow: 0 18px 48px rgba(38, 23, 12, 0.38);
  pointer-events: none;
}

.card-hover-popover .database-card,
.card-hover-preview-demo .database-card {
  width: 100%;
  margin: 0;
}

.card-hover-popover:has(.database-card-type-combo) {
  width: min(390px, calc(100vw - 24px));
}

.card-hover-popover .database-card-type-combo,
.card-hover-preview-demo .database-card-type-combo {
  gap: 7px;
  padding: 8px;
}

.card-hover-popover .database-card-type-combo .database-card-lines,
.card-hover-preview-demo .database-card-type-combo .database-card-lines {
  gap: 3px;
  margin-top: 4px;
}

.card-hover-popover .database-card-type-combo .database-card-lines > div,
.card-hover-preview-demo .database-card-type-combo .database-card-lines > div {
  padding: 3px 5px;
  font-size: 0.88rem;
  line-height: 1.22;
}

.card-hover-popover .database-card-type-combo .database-card-lines > div > span,
.card-hover-preview-demo .database-card-type-combo .database-card-lines > div > span {
  font-size: 0.96em;
  line-height: 1.25;
}

.card-hover-popover .combo-finisher,
.card-hover-preview-demo .combo-finisher {
  gap: 6px;
}

.card-hover-popover .combo-zone,
.card-hover-preview-demo .combo-zone {
  min-height: 22px;
  padding: 2px 7px;
  font-size: 0.82rem;
}

.card-hover-popover .combo-steps,
.card-hover-preview-demo .combo-steps {
  padding-left: 18px;
}

.card-hover-preview-demo {
  width: min(360px, 100%);
  margin-top: 10px;
  padding: 8px;
  border: 1px dashed rgba(92, 58, 31, 0.35);
  background: rgba(255, 248, 222, 0.55);
}

.import-diff-preview {
  display: grid;
  gap: 12px;
  margin-top: 12px;
  padding: 14px;
  border: 1px solid rgba(91, 57, 31, 0.32);
  background: rgba(255, 248, 222, 0.58);
}

.import-diff-summary {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.import-diff-summary strong {
  flex-basis: 100%;
}

.import-diff-summary span {
  padding: 4px 8px;
  border: 1px solid rgba(91, 57, 31, 0.22);
  background: rgba(255, 255, 255, 0.44);
}

.import-diff-summary .added,
.import-diff-row.added > span {
  color: #35613d;
}

.import-diff-summary .updated,
.import-diff-row.updated > span {
  color: #8a5a10;
}

.import-diff-summary .conflict,
.import-diff-row.conflict > span {
  color: #912e27;
}

.import-diff-list {
  display: grid;
  max-height: 360px;
  overflow: auto;
  border-top: 1px solid rgba(91, 57, 31, 0.2);
}

.import-diff-row {
  display: grid;
  grid-template-columns: 92px minmax(180px, 1fr) minmax(180px, 1fr);
  gap: 10px;
  padding: 8px 4px;
  border-bottom: 1px solid rgba(91, 57, 31, 0.15);
}

.import-diff-row small {
  overflow-wrap: anywhere;
}

@media (max-width: 700px) {
  .card-hover-popover {
    display: none !important;
  }

  .import-diff-row {
    grid-template-columns: 1fr;
    gap: 3px;
  }
}

.rating-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
}

.rating-actions a {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.category-card {
  min-height: 104px;
  padding: 12px;
  border: 1px solid rgba(70, 57, 41, 0.56);
  background:
    linear-gradient(rgba(247, 239, 216, 0.9), rgba(223, 209, 176, 0.86)),
    var(--paper);
  box-shadow: 4px 4px 0 rgba(36, 28, 21, 0.13);
  clip-path: polygon(12px 0, 100% 0, 100% calc(100% - 12px), calc(100% - 12px) 100%, 0 100%, 0 12px);
  cursor: pointer;
  text-align: left;
}

.category-card strong {
  display: block;
  margin-bottom: 9px;
  color: #6d241d;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
  font-size: 1.08rem;
}

.category-card strong::after {
  content: "";
  display: block;
  width: 82px;
  height: 1px;
  margin-top: 10px;
  background: linear-gradient(90deg, rgba(43, 33, 24, 0.58), transparent);
}

.category-card.no-divider strong::after {
  display: none;
}

.category-card em {
  display: block;
  margin-top: 10px;
  color: #826345;
  font-size: 0.8rem;
  font-style: normal;
  font-weight: 900;
}

.category-card span {
  color: #5b5042;
  font-weight: 700;
}

.guide-layout {
  display: grid;
  gap: 16px;
}

.guide-tabs {
  display: none;
  flex-wrap: wrap;
  gap: 8px;
}

.guide-tabs button {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid rgba(56, 45, 32, 0.5);
  cursor: pointer;
  background: rgba(244, 235, 211, 0.9);
  font-weight: 900;
}

.guide-tabs button.active {
  color: #fff0d0;
  background: linear-gradient(#8f6f45, #6e5234);
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.hidden {
  display: none !important;
}

.auth-panel {
  display: grid;
  place-items: start center;
}

.login-form {
  width: min(520px, 100%);
}

.admin-session {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.admin-session span,
.form-message {
  color: #6f1d18;
  font-weight: 800;
}

.form-message {
  min-height: 1.2em;
  margin: 0;
}

.admin-tabs button,
.map-tools button {
  min-height: 40px;
  padding: 9px 13px;
  border: 1px solid rgba(72, 55, 35, 0.44);
  background: rgba(255, 244, 217, 0.86);
  color: #4b321d;
  cursor: pointer;
  font-weight: 950;
  text-transform: uppercase;
  clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px);
}

.admin-tabs button.active,
.map-tools button.active {
  color: #fff3d8;
  background: linear-gradient(#b24a39, #853026);
}

.admin-content {
  margin: -10px -12px 0;
}

.admin-workspace {
  display: grid;
  grid-template-columns: 230px minmax(0, 1fr);
  min-height: calc(100vh - 92px);
  font-size: var(--admin-font);
  border: 1px solid rgba(55, 38, 25, 0.26);
  background:
    linear-gradient(90deg, rgba(28, 22, 17, 0.96) 0 230px, rgba(237, 221, 184, 0.48) 230px),
    var(--paper);
  box-shadow: 0 22px 60px rgba(40, 26, 15, 0.18);
}

.admin-content.sidebar-collapsed .admin-workspace {
  grid-template-columns: minmax(0, 1fr);
  background: var(--paper);
}

.admin-content.sidebar-collapsed .admin-sidebar {
  display: none;
}

.admin-sidebar-reveal {
  display: none;
  margin-bottom: 8px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(74, 56, 44, 0.38);
  background: rgba(255, 250, 232, 0.82);
  color: #6d241d;
  cursor: pointer;
  font-weight: 900;
}

.admin-content.sidebar-collapsed .admin-sidebar-reveal {
  display: inline-flex;
}

.admin-sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  display: grid;
  gap: 10px;
  min-height: calc(100vh - 92px);
  padding: 12px 10px;
  color: #f4e4c4;
  background:
    linear-gradient(180deg, rgba(21, 17, 14, 0.98), rgba(38, 29, 22, 0.96)),
    #1b1612;
}

.admin-sidebar-brand {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 26px;
  gap: 8px;
  align-items: center;
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(201, 164, 93, 0.24);
}

.admin-sidebar-toggle {
  width: 26px;
  height: 26px;
  border: 1px solid rgba(201, 164, 93, 0.35);
  color: #f4e4c4;
  background: rgba(255, 244, 217, 0.08);
  cursor: pointer;
  font-weight: 900;
}

.admin-sidebar-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(201, 164, 93, 0.55);
  color: #d8ba78;
  background: radial-gradient(circle, rgba(201, 164, 93, 0.18), rgba(18, 15, 13, 0.92));
  font-family: "Cinzel Decorative", Georgia, serif;
  font-weight: 900;
}

.admin-sidebar-brand strong {
  display: block;
  color: #f7e7c8;
  font-family: "Marcellus SC", Georgia, serif;
  letter-spacing: 0.02em;
  font-size: 0.88rem;
}

.admin-sidebar-brand small,
.admin-session span {
  color: rgba(245, 230, 200, 0.72);
  font-size: 0.78rem;
  font-weight: 750;
}

.admin-sidebar .admin-session {
  display: grid;
  justify-content: stretch;
  gap: 6px;
  margin: 0;
  padding: 8px;
  border: 1px solid rgba(201, 164, 93, 0.18);
  background: rgba(255, 244, 217, 0.04);
}

.admin-sidebar .admin-session .ghost-btn {
  min-height: 32px;
  color: #f4e4c4;
  border-color: rgba(201, 164, 93, 0.34);
  background: rgba(255, 244, 217, 0.08);
}

.admin-tabs {
  display: grid;
  gap: 5px;
  margin: 0;
}

.admin-tabs button {
  justify-content: flex-start;
  min-height: 34px;
  width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(201, 164, 93, 0.18);
  clip-path: none;
  color: rgba(245, 230, 200, 0.78);
  background: rgba(255, 244, 217, 0.04);
  text-align: left;
  text-transform: none;
  transition: background 160ms ease, color 160ms ease, border-color 160ms ease;
}

.admin-tabs button:hover {
  border-color: rgba(201, 164, 93, 0.42);
  color: #fff2d6;
  background: rgba(201, 164, 93, 0.1);
}

.admin-tabs button.active {
  color: #fff3d8;
  border-color: rgba(201, 164, 93, 0.55);
  background:
    linear-gradient(90deg, rgba(139, 46, 46, 0.42), rgba(201, 164, 93, 0.1)),
    rgba(255, 244, 217, 0.08);
}

.admin-main {
  min-width: 0;
  padding: 12px;
}

.admin-topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  padding: 10px 12px;
  border: 1px solid rgba(70, 57, 41, 0.32);
  background:
    linear-gradient(90deg, rgba(255, 250, 232, 0.94), rgba(230, 211, 171, 0.88)),
    var(--paper);
  box-shadow: 0 14px 30px rgba(63, 47, 27, 0.11);
}

.admin-topbar h2 {
  margin: 0;
  color: #33261a;
  font-size: 1.05rem;
}

.admin-topbar span {
  color: #665646;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.admin-stats {
  padding: 7px 10px;
  border: 1px solid rgba(70, 57, 41, 0.24);
  background: rgba(255, 252, 239, 0.54);
  color: #6d241d !important;
  font-family: "Marcellus SC", Georgia, serif;
}

.admin-sidebar-context {
  display: grid;
  gap: 7px;
  min-height: 0;
  max-height: calc(100vh - 292px);
  overflow: hidden;
  padding-top: 8px;
  border-top: 1px solid rgba(201, 164, 93, 0.18);
}

.admin-sidebar-context-details {
  display: grid;
  gap: 7px;
  min-height: 0;
}

.admin-sidebar-context-title {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #d8ba78;
  cursor: pointer;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
  list-style: none;
}

.admin-sidebar-context-title::-webkit-details-marker {
  display: none;
}

.admin-sidebar-context-title::before {
  content: "+";
  display: inline-grid;
  width: 16px;
  height: 16px;
  place-items: center;
  border: 1px solid rgba(201, 164, 93, 0.26);
}

.admin-sidebar-context-details[open] > .admin-sidebar-context-title::before {
  content: "-";
}

.admin-sidebar-list {
  display: grid;
  gap: 5px;
  max-height: calc(100vh - 330px);
  overflow: auto;
  padding-right: 2px;
}

.admin-sidebar-search {
  width: 100%;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(201, 164, 93, 0.22);
  background: rgba(255, 244, 217, 0.07);
  color: #fff0d0;
  font: 800 0.78rem "Cormorant Garamond", Georgia, serif;
  outline: none;
}

.admin-sidebar-search::placeholder {
  color: rgba(245, 230, 200, 0.42);
}

.admin-sidebar-search:focus {
  border-color: rgba(201, 164, 93, 0.58);
  background: rgba(139, 46, 46, 0.18);
}

.admin-sidebar-entry {
  display: grid;
  gap: 2px;
  padding: 7px 8px;
  border: 1px solid rgba(201, 164, 93, 0.14);
  background: rgba(255, 244, 217, 0.045);
  color: rgba(245, 230, 200, 0.84);
  cursor: pointer;
  text-align: left;
}

.admin-sidebar-entry:hover,
.admin-sidebar-entry.active {
  border-color: rgba(201, 164, 93, 0.42);
  background: rgba(139, 46, 46, 0.2);
}

.admin-sidebar-entry strong,
.admin-sidebar-entry span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.admin-sidebar-entry strong {
  color: #fff0d0;
  font-size: 0.82rem;
}

.admin-sidebar-entry span,
.admin-sidebar-note {
  color: rgba(245, 230, 200, 0.62);
  font-size: 0.72rem;
  font-weight: 750;
}

.admin-sections {
  min-width: 0;
}

.admin-section {
  display: none;
}

.admin-section.active {
  display: block;
}

.admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.8fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.article-admin-layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas:
    "editor"
    "preview";
}

.article-admin-layout > .admin-form,
.article-admin-layout > .admin-side,
#cardsAdmin .admin-form,
#cardsAdmin .admin-side {
  border-color: rgba(72, 55, 35, 0.32);
  box-shadow: 0 16px 40px rgba(63, 47, 27, 0.08);
}

.article-admin-picker,
.article-preview-panel {
  width: 100%;
}

#contentForm {
  grid-area: editor;
  min-width: 0;
}

.article-preview-panel {
  grid-area: preview;
  min-width: 0;
}

.article-preview-panel .admin-preview,
.article-preview {
  width: 100%;
  min-width: 0;
}

.article-picker-details {
  display: grid;
  gap: 10px;
}

.article-picker-details summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 9px 12px;
  border: 1px solid rgba(79, 63, 43, 0.34);
  background: rgba(255, 250, 232, 0.72);
  color: #6d241d;
  cursor: pointer;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.08rem;
  font-weight: 900;
  list-style: none;
}

.article-picker-details summary::-webkit-details-marker {
  display: none;
}

.article-picker-details summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(109, 36, 29, 0.35);
  color: #8b2e2e;
  font-family: "Marcellus SC", Georgia, serif;
  line-height: 1;
}

.article-picker-details[open] summary::before {
  content: "-";
}

.article-picker-details #adminEntries {
  display: grid;
  gap: 8px;
  padding-top: 10px;
}

.admin-form,
.admin-list,
.admin-preview {
  padding: 11px;
}

.admin-form > *,
.admin-list > *,
.admin-preview > *,
.import-panel > *,
.map-card > *,
.feature-card > *,
.article-full > * {
  position: relative;
  z-index: 1;
}

.admin-side {
  display: grid;
  align-content: start;
  gap: 10px;
  min-width: 0;
  max-width: 100%;
}

.card-admin-side {
  grid-template-rows: auto minmax(0, 1fr);
}

.admin-list,
.admin-preview {
  min-width: 0;
  max-width: 100%;
  overflow: visible;
}

.card-admin-list {
  min-height: 0;
}

.card-cleanup {
  border: 1px solid rgba(123, 43, 36, 0.22);
  background: rgba(123, 43, 36, 0.06);
  padding: 8px;
}

.card-cleanup summary {
  cursor: pointer;
  color: #7b2b24;
  font-weight: 900;
}

.card-cleanup-advanced {
  display: grid;
  gap: 6px;
  margin-top: 8px;
}

.card-cleanup-advanced strong {
  color: #7b2b24;
}

.card-template-type-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 6px;
  min-width: 0;
  max-height: 178px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(70, 57, 41, 0.2);
  background: rgba(255, 250, 232, 0.46);
}

.card-template-editor .form-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
}

.card-template-editor .form-row:nth-of-type(3) {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.card-template-editor .form-row:last-child {
  grid-template-columns: minmax(190px, 1fr) auto auto;
  align-items: end;
}

.card-template-editor label {
  min-width: 0;
  align-self: start;
}

.card-template-editor input,
.card-template-editor select {
  width: 100%;
  height: 34px;
  min-height: 34px;
  box-sizing: border-box;
}

.card-template-editor .ghost-btn {
  min-height: 34px;
  padding: 6px 12px;
  white-space: nowrap;
}

.compact-check-row {
  gap: 6px !important;
  min-width: 0;
  font-size: 0.9rem;
}

.compact-check-row input {
  width: 15px;
  height: 15px;
}

.card-template-type-grid .editor-hint {
  grid-column: 1 / -1;
  margin: 2px 0 0;
}

.card-admin-list #cardEntries {
  display: grid;
  gap: 8px;
  max-height: min(760px, 58vh);
  overflow: auto;
  padding-right: 4px;
}

.card-catalog-row {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(180px, 1.35fr) minmax(95px, 0.68fr) minmax(110px, 0.76fr) minmax(80px, 0.52fr) minmax(90px, 0.62fr) minmax(78px, 0.55fr);
  gap: 8px;
  align-items: center;
  margin-top: 0;
  padding: 6px 8px;
  font-size: 0.86rem;
}

.quest-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 12px;
  align-items: start;
  min-width: 0;
}

.quest-catalog-row {
  display: grid;
  grid-template-columns: minmax(100px, 0.65fr) minmax(180px, 1.5fr) minmax(100px, 0.65fr) minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
  margin-top: 0;
  padding: 7px 8px;
  font-size: 0.86rem;
  text-align: left;
}

.quest-catalog-row strong,
.quest-catalog-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-preview-panel {
  margin-top: 0;
}

.quest-block {
  margin: 18px 0;
  min-width: 0;
}

.quest-block-title {
  margin: 0 0 12px;
  color: #7b2b24;
  font-family: "Cinzel Decorative", Georgia, serif;
  font-size: 1.32rem;
  letter-spacing: 0.02em;
}

.quest-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
  gap: 14px;
  align-items: start;
}

.quest-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid rgba(117, 86, 48, 0.34);
  background:
    linear-gradient(135deg, rgba(255, 252, 234, 0.98), rgba(230, 207, 150, 0.72)),
    var(--paper-texture, none);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.45),
    inset 0 0 0 4px rgba(170, 137, 82, 0.08),
    0 12px 24px rgba(64, 45, 18, 0.1);
}

.quest-card-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding-bottom: 12px;
  margin-bottom: 12px;
  border-bottom: 2px double rgba(117, 86, 48, 0.22);
}

.quest-npc-avatar {
  flex: 0 0 62px;
  width: 62px;
  height: 62px;
  border: 1px solid rgba(67, 50, 34, 0.32);
  background: rgba(222, 207, 174, 0.82) center / cover no-repeat;
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
}

.quest-card-head h4 {
  margin: 0;
  color: #241b13;
  font-family: "Cinzel Decorative", Georgia, serif;
  font-size: 1.22rem;
  line-height: 1.16;
}

.quest-card-head p {
  margin: 4px 0 0;
  color: rgba(58, 44, 32, 0.72);
  font-weight: 760;
}

.quest-description {
  margin: 0 0 14px;
  padding: 12px 14px;
  border-left: 3px solid rgba(138, 43, 36, 0.55);
  background: rgba(255, 244, 203, 0.48);
  color: #2f251c;
  font-size: 1.03rem;
  line-height: 1.46;
}

.quest-linked-section {
  margin: 12px 0;
}

.quest-linked-section h5 {
  margin: 0 0 7px;
  color: #8a2b24;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 0.94rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.quest-linked-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.quest-link-card {
  display: inline-grid;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: center;
  gap: 9px;
  min-width: min(100%, 220px);
  max-width: 100%;
  padding: 7px 9px;
  border: 1px solid rgba(117, 86, 48, 0.3);
  background: rgba(255, 251, 230, 0.78);
  color: #2d2118;
  text-align: left;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.45);
}

.quest-link-card-muted {
  cursor: default;
}

.quest-link-card-icon {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(67, 50, 34, 0.28);
  background:
    radial-gradient(circle, rgba(201, 164, 93, 0.18), rgba(74, 56, 44, 0.12)),
    rgba(230, 217, 184, 0.8);
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.quest-link-card strong,
.quest-link-card small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-link-card strong {
  color: #2d2118;
  font-size: 0.98rem;
}

.quest-link-card small {
  color: rgba(58, 44, 32, 0.68);
  font-size: 0.82rem;
  font-weight: 760;
}

.quest-link-card:hover {
  border-color: rgba(138, 43, 36, 0.48);
  box-shadow: 0 8px 18px rgba(80, 48, 18, 0.12);
}

.quest-reward-text {
  margin: 12px 0;
  padding: 9px 11px;
  border: 1px solid rgba(117, 86, 48, 0.18);
  background: rgba(255, 250, 229, 0.58);
  color: #35281d;
}

.quest-reward-text strong {
  color: #8a2b24;
}

.quest-tips {
  margin: 12px 0;
  padding: 10px 13px;
  border: 1px solid rgba(138, 43, 36, 0.18);
  background: rgba(255, 238, 184, 0.42);
}

.quest-tips strong {
  color: #8a2b24;
}

.quest-tips ul {
  margin: 6px 0 0;
  padding-left: 22px;
}

.quest-fields {
  display: grid;
  grid-template-columns: minmax(110px, max-content) minmax(0, 1fr);
  gap: 0;
  margin: 12px 0 0;
  border-top: 1px solid rgba(117, 86, 48, 0.18);
}

.quest-fields dt {
  padding: 8px 12px 8px 0;
  border-bottom: 1px solid rgba(117, 86, 48, 0.13);
  color: #8a2b24;
  font-weight: 820;
}

.quest-fields dd {
  min-width: 0;
  margin: 0;
  padding: 8px 0;
  border-bottom: 1px solid rgba(117, 86, 48, 0.13);
  overflow-wrap: anywhere;
}

.quest-needed-editor {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(117, 86, 48, 0.22);
  background: rgba(255, 249, 224, 0.46);
}

.quest-needed-list {
  display: grid;
  gap: 8px;
}

.quest-needed-row {
  display: grid;
  grid-template-columns: 42px minmax(140px, 1fr) 90px minmax(160px, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 7px;
  border: 1px solid rgba(117, 86, 48, 0.18);
  background: rgba(255, 252, 236, 0.68);
}

.quest-needed-icon {
  width: 42px;
  height: 42px;
  border: 1px solid rgba(67, 50, 34, 0.28);
  background: rgba(222, 207, 174, 0.82) center / contain no-repeat;
}

.quest-needed-row strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quest-needed-row input {
  min-width: 0;
}

@media (max-width: 900px) {
  .quest-needed-row {
    grid-template-columns: 42px minmax(0, 1fr);
  }

  .quest-needed-row input,
  .quest-needed-row button {
    grid-column: 1 / -1;
  }
}

.quest-picker-list {
  display: grid;
  gap: 6px;
  max-height: 320px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(87, 67, 42, 0.2);
  background: rgba(255, 248, 222, 0.48);
}

.quest-picker-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 7px;
  border: 1px solid rgba(87, 67, 42, 0.16);
  background: rgba(255, 255, 255, 0.22);
}

.quest-picker-row span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.quest-picker-row small {
  color: rgba(58, 44, 32, 0.68);
  overflow-wrap: anywhere;
}

.card-catalog-row strong,
.card-catalog-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-catalog-id {
  color: #6d241d;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.78rem;
}

.image-ok,
.image-missing {
  justify-self: start;
  padding: 3px 7px;
  border: 1px solid rgba(70, 57, 41, 0.2);
  font-size: 0.78rem !important;
}

.image-ok {
  color: #305f3c !important;
  background: rgba(101, 150, 92, 0.13);
}

.image-missing {
  color: #8b2e2e !important;
  background: rgba(139, 46, 46, 0.1);
}

.card-admin-side .admin-preview #cardPreview {
  max-height: min(620px, 54vh);
  overflow: auto;
  padding-right: 4px;
}

.form-head,
.form-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.admin-form {
  display: grid;
  gap: 9px;
  font-size: var(--admin-font);
}

.admin-form label {
  display: grid;
  gap: 6px;
  color: #5b5042;
  font-weight: 900;
}

.admin-form input,
.admin-form select,
.admin-form textarea {
  padding: 7px 9px;
  font-size: var(--admin-font);
}

.admin-form textarea {
  resize: vertical;
  line-height: 1.48;
}

.block-editor {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  grid-template-areas:
    "outline toolbar"
    "outline blocks";
  gap: 8px;
  align-items: start;
}

.editor-outline-panel {
  position: sticky;
  top: 140px;
  grid-area: outline;
  display: grid;
  gap: 10px;
  max-height: calc(100vh - 160px);
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(70, 57, 41, 0.28);
  background: rgba(255, 250, 232, 0.72);
}

.editor-outline-list {
  display: grid;
  gap: 6px;
}

.editor-outline-item {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 2px 8px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(70, 57, 41, 0.18);
  background: rgba(255, 253, 241, 0.62);
  color: #352b21;
  cursor: pointer;
  text-align: left;
}

.editor-outline-item:hover {
  border-color: rgba(139, 46, 46, 0.32);
  background: rgba(255, 246, 221, 0.9);
}

.editor-outline-item span {
  grid-row: span 2;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border: 1px solid rgba(109, 36, 29, 0.26);
  color: #8b2e2e;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 0.78rem;
  font-weight: 900;
}

.editor-outline-item strong {
  overflow: hidden;
  color: #2b2118;
  font-size: 0.9rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.editor-outline-item small {
  color: #746452;
  font-weight: 800;
}

.compact-empty {
  padding: 10px;
  font-size: 0.9rem;
}

.editor-toolbar {
  grid-area: toolbar;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 7px;
  border: 1px solid rgba(70, 57, 41, 0.36);
  background:
    linear-gradient(90deg, rgba(255, 246, 222, 0.92), rgba(238, 222, 184, 0.72)),
    rgba(255, 246, 222, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 252, 235, 0.7), 0 8px 20px rgba(67, 48, 27, 0.08);
}

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

.tool-btn,
.block-controls button {
  min-height: 30px;
  border: 1px solid rgba(62, 44, 31, 0.55);
  border-radius: 0;
  background: rgba(250, 238, 205, 0.92);
  color: #352b21;
  cursor: pointer;
  font-weight: 900;
}

.tool-btn {
  padding: 5px 8px;
  font-size: 0.86rem;
}

.template-picker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 34px;
  padding-left: 8px;
  border-left: 1px solid rgba(62, 44, 31, 0.28);
  color: #6d241d;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.template-picker select {
  min-height: 34px;
  border: 1px solid rgba(62, 44, 31, 0.4);
  background: rgba(250, 238, 205, 0.92);
  color: #352b21;
  font-weight: 900;
}

.bulk-card-insert {
  min-height: 34px;
  border-left: 1px solid rgba(62, 44, 31, 0.28);
  padding-left: 8px;
}

.bulk-card-insert summary {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6d241d;
  cursor: pointer;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bulk-card-insert summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(109, 36, 29, 0.34);
  color: #8b2e2e;
  line-height: 1;
}

.bulk-card-insert[open] summary::before {
  content: "-";
}

.bulk-card-insert-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 8px;
  width: min(920px, 100%);
  margin-top: 8px;
  padding: 10px;
  border: 1px solid rgba(62, 44, 31, 0.28);
  background: rgba(255, 246, 222, 0.88);
}

.bulk-card-insert-panel label {
  display: grid;
  gap: 4px;
  color: #6d241d;
  font-size: 0.78rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bulk-card-insert-panel select,
.bulk-card-insert-panel input {
  min-height: 34px;
  border: 1px solid rgba(62, 44, 31, 0.4);
  background: rgba(250, 238, 205, 0.92);
  color: #352b21;
  font: inherit;
}

.bulk-card-insert-panel span {
  align-self: center;
  color: #4a382c;
  font-weight: 900;
}

.bulk-card-delete summary {
  color: #7b2b24;
}

.danger-panel {
  border-color: rgba(123, 43, 36, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 246, 222, 0.92), rgba(248, 224, 208, 0.78)),
    rgba(255, 246, 222, 0.88);
}

.danger-btn {
  color: #fff2d6;
  border-color: rgba(111, 29, 24, 0.5);
  background: linear-gradient(#9d3b2f, #6f1d18);
}

.editor-blocks {
  grid-area: blocks;
  display: grid;
  gap: 8px;
}

.editor-block {
  border: 1px solid rgba(64, 50, 35, 0.38);
  background:
    linear-gradient(rgba(255, 251, 236, 0.82), rgba(240, 224, 190, 0.5)),
    rgba(255, 251, 236, 0.72);
  box-shadow: inset 0 0 0 1px rgba(255, 246, 221, 0.56);
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.editor-block.collapsed {
  background: rgba(255, 246, 222, 0.66);
}

.editor-block.collapsed .editor-block-head {
  border-bottom: 0;
}

.editor-block:hover {
  border-color: rgba(139, 46, 46, 0.42);
}

.editor-block-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 6px 8px;
  border-bottom: 1px solid rgba(64, 50, 35, 0.2);
  background: rgba(129, 109, 78, 0.12);
  color: #6d241d;
  font-size: 0.84rem;
  text-transform: uppercase;
}

.block-toggle {
  flex: 0 0 auto;
  width: 26px;
  min-height: 26px;
  border: 1px solid rgba(62, 44, 31, 0.45);
  background: rgba(250, 238, 205, 0.94);
  color: #6d241d;
  cursor: pointer;
  font-weight: 950;
}

.block-title-stack {
  display: grid;
  gap: 2px;
  min-width: 0;
  margin-right: auto;
}

.block-title-stack strong {
  color: #6d241d;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 0.84rem;
  letter-spacing: 0;
}

.block-title-stack span {
  max-width: min(760px, 66vw);
  overflow: hidden;
  color: #5b5042;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 0.92rem;
  font-weight: 700;
  text-overflow: ellipsis;
  text-transform: none;
  white-space: nowrap;
}

.block-controls {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
}

.block-controls button {
  width: 28px;
  padding: 0;
}

.block-controls select {
  min-height: 30px;
  border: 1px solid rgba(62, 44, 31, 0.4);
  background: rgba(250, 238, 205, 0.92);
  color: #352b21;
  font-weight: 900;
}

.editor-block-body {
  display: grid;
  gap: 7px;
  padding: 8px;
}

.editor-block-body[hidden] {
  display: none;
}

.toc-controls {
  display: grid;
  order: 30;
  gap: 6px;
  padding: 6px 8px;
  border: 1px dashed rgba(79, 63, 43, 0.28);
  background: rgba(255, 250, 232, 0.44);
}

.toc-items-manager {
  display: grid;
  gap: 8px;
}

.toc-items-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.toc-size-control {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 34px;
  padding: 4px 7px;
  border: 1px solid rgba(79, 63, 43, 0.18);
  background: rgba(255, 253, 241, 0.52);
  color: #6f2b24;
  font-size: 0.82rem;
  font-weight: 900;
}

.toc-size-control input {
  width: 68px;
  min-height: 26px;
  padding: 3px 5px;
}

.toc-items-list {
  display: grid;
  gap: 6px;
  max-height: 360px;
  overflow: auto;
}

.toc-item-row {
  display: grid;
  grid-template-columns: 22px minmax(180px, 1fr) minmax(120px, 0.45fr);
  gap: 7px;
  align-items: center;
  padding: 6px;
  border: 1px solid rgba(79, 63, 43, 0.18);
  background: rgba(255, 253, 241, 0.52);
}

.toc-item-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
}

.toc-item-row input:not([type]),
.toc-item-row input[type="text"] {
  min-height: 32px;
  padding: 5px 7px;
}

.toc-item-row span {
  color: #6f6251;
  font-size: 0.82rem;
  font-weight: 800;
}

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

.rich-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
  padding: 8px;
  border: 1px solid rgba(74, 56, 44, 0.22);
  background: rgba(232, 217, 181, 0.62);
}

.rich-tools button {
  min-width: 34px;
  min-height: 32px;
  border: 1px solid rgba(62, 44, 31, 0.45);
  background: rgba(250, 238, 205, 0.95);
  color: #2b2118;
  cursor: pointer;
  font-weight: 900;
}

.rich-tools select {
  min-height: 32px;
  border: 1px solid rgba(62, 44, 31, 0.45);
  background: rgba(255, 248, 228, 0.95);
  color: #2b2118;
  font: inherit;
  font-weight: 800;
}

.rich-tools label {
  display: inline-flex;
  grid-auto-flow: column;
  align-items: center;
  gap: 6px;
}

.rich-tools input[type="number"] {
  width: 76px;
  padding: 6px 8px;
}

.rich-tools input[type="color"] {
  width: 42px;
  height: 32px;
  padding: 2px;
}

.quick-actions {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 40;
  display: none;
  grid-auto-flow: column;
  align-items: center;
  gap: 8px;
}

.quick-actions.active {
  display: grid;
}

.quick-action-btn {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid rgba(201, 164, 93, 0.72);
  background:
    linear-gradient(rgba(78, 38, 31, 0.92), rgba(48, 29, 23, 0.96));
  color: #f5e6c8;
  box-shadow: 0 10px 24px rgba(26, 18, 13, 0.28);
  cursor: pointer;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 0.78rem;
  font-weight: 900;
}

.quick-action-btn.admin-only {
  display: none;
}

.quick-actions.admin-mode .quick-action-btn.admin-only {
  display: inline-grid;
  place-items: center;
}

.scroll-top-btn {
  width: 44px;
  padding: 0;
  font-size: 1.25rem;
}

.quick-action-btn:hover {
  border-color: rgba(214, 185, 122, 0.95);
  background:
    linear-gradient(rgba(126, 48, 40, 0.94), rgba(62, 34, 27, 0.96));
}

.rich-field {
  min-height: 132px;
  padding: 13px 14px;
  border: 1px solid rgba(62, 44, 31, 0.34);
  background: rgba(255, 252, 239, 0.86);
  color: #2b2118;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.55;
  outline: none;
  white-space: pre-wrap;
}

.rich-heading {
  min-height: 62px;
  font-family: var(--aaa-title);
  font-size: 25px;
  line-height: 1.25;
  text-transform: uppercase;
}

.rich-field:focus {
  border-color: rgba(139, 46, 46, 0.6);
  box-shadow: 0 0 0 2px rgba(139, 46, 46, 0.08);
}

.editor-block-body label {
  display: grid;
  gap: 4px;
}

.field-wrap {
  display: grid;
  gap: 6px;
  color: #5b5042;
  font-weight: 900;
}

.editor-advanced {
  display: grid;
  order: 30;
  gap: 6px;
  padding: 6px 8px;
  border: 1px dashed rgba(79, 63, 43, 0.28);
  background: rgba(255, 250, 232, 0.44);
}

.editor-advanced summary {
  cursor: pointer;
  color: #6d241d;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 0.76rem;
  font-weight: 950;
  text-transform: uppercase;
}

.home-hero-buttons {
  gap: 10px;
}

.home-hero-button-list {
  display: grid;
  gap: 8px;
}

.home-hero-button-row {
  display: grid;
  grid-template-columns: minmax(140px, 0.42fr) minmax(190px, 0.72fr) minmax(280px, 1.4fr);
  gap: 10px;
  align-items: end;
  padding: 9px 10px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  background: rgba(255, 250, 232, 0.58);
}

.home-hero-button-row > strong {
  align-self: center;
  color: var(--accent);
}

.home-hero-button-row label {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.home-hero-button-row input,
.home-hero-button-row select {
  width: 100%;
  min-width: 0;
}

.editor-block-body > :not(.toc-controls):not(.editor-advanced) {
  order: 1;
}

.editor-block-body > .field-wrap,
.editor-block-body > label {
  min-width: 0;
}

.width-preset-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.width-preset-buttons button {
  min-height: 28px;
  padding: 3px 8px;
  border: 1px solid rgba(79, 63, 43, 0.38);
  background: rgba(255, 246, 221, 0.84);
  color: #4c3525;
  cursor: pointer;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 0.76rem;
  font-weight: 900;
}

.width-preset-buttons button:hover {
  border-color: rgba(139, 46, 46, 0.55);
  color: #7b2b24;
}

.permission-editor {
  display: grid;
  gap: 10px;
}

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

.permission-card {
  display: grid !important;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 8px !important;
  padding: 9px 10px;
  border: 1px solid rgba(79, 63, 43, 0.26);
  background: rgba(255, 250, 232, 0.55);
  color: #3c3126;
  font-weight: 700 !important;
}

.permission-card input {
  width: 16px;
  height: 16px;
  margin-top: 2px;
}

.permission-card span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.permission-card strong {
  color: #6d241d;
  line-height: 1.1;
}

.permission-card small {
  color: #655849;
  font-size: 0.82rem;
  font-weight: 650;
  line-height: 1.25;
}

.asset-upload-result {
  display: grid;
  gap: 6px;
  max-height: 260px;
  overflow: auto;
  padding: 10px;
  border: 1px solid rgba(79, 63, 43, 0.22);
  background: rgba(255, 250, 232, 0.5);
}

.asset-upload-result:empty {
  display: none;
}

.asset-upload-result code {
  display: block;
  overflow-wrap: break-word;
  color: #6d241d;
}

#assetsAdmin {
  display: none;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

#assetsAdmin.active {
  display: grid;
}

.asset-browser-panel {
  display: grid;
  gap: 12px;
}

.asset-browser-tools {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.4fr);
  gap: 8px;
}

.asset-browser-tools input,
.asset-browser-tools select {
  min-height: 38px;
  padding: 8px 10px;
}

.asset-browser-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
  gap: 8px;
  max-height: min(720px, 64vh);
  overflow: auto;
  padding-right: 4px;
}

.asset-tile {
  display: grid;
  gap: 4px;
  padding: 6px;
  border: 1px solid rgba(70, 57, 41, 0.22);
  background: rgba(255, 253, 241, 0.62);
  color: #352b21;
  cursor: pointer;
  text-align: left;
}

.asset-tile:hover {
  border-color: rgba(139, 46, 46, 0.36);
  box-shadow: 0 10px 20px rgba(63, 47, 27, 0.1);
}

.asset-tile img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
  border: 1px solid rgba(70, 57, 41, 0.16);
  background: rgba(238, 222, 184, 0.54);
}

.asset-tile strong,
.asset-tile span,
.asset-tile code {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.asset-tile span {
  color: #746452;
  font-size: 0.74rem;
  font-weight: 800;
}

.asset-tile code {
  color: #6d241d;
  font-size: 0.66rem;
}

.asset-delete-btn {
  justify-self: stretch;
  padding: 5px 7px;
  border: 1px solid rgba(139, 46, 46, 0.36);
  background: rgba(139, 46, 46, 0.08);
  color: #7b2b24;
  cursor: pointer;
  font-family: var(--aaa-ui);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.asset-delete-btn:hover {
  background: rgba(139, 46, 46, 0.16);
  border-color: rgba(139, 46, 46, 0.55);
}

.table-image-tools {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
  gap: 8px;
  align-items: end;
  padding: 10px;
  border: 1px dashed rgba(79, 63, 43, 0.3);
  background: rgba(255, 250, 232, 0.5);
}

.table-image-tools strong {
  align-self: center;
  color: #6d241d;
}

.table-image-tools summary {
  grid-column: 1 / -1;
}

.table-tools-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.faq-editor-list {
  display: grid;
  gap: 10px;
}

.faq-editor-item {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px dashed rgba(79, 63, 43, 0.28);
  background: rgba(255, 250, 232, 0.44);
}

.table-image-tools label {
  gap: 4px;
}

.table-image-tools button {
  min-height: 38px;
  border: 1px solid rgba(62, 44, 31, 0.48);
  background: rgba(250, 238, 205, 0.94);
  color: #352b21;
  cursor: pointer;
  font-weight: 900;
}

.table-grid-editor {
  display: grid;
  gap: 8px;
  padding: 10px;
  border: 1px solid rgba(79, 63, 43, 0.26);
  background: rgba(255, 250, 232, 0.56);
}

.table-grid-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.table-grid-toolbar strong {
  margin-right: auto;
  color: #6d241d;
}

.table-grid-toolbar button {
  min-height: 32px;
  border: 1px solid rgba(62, 44, 31, 0.45);
  background: rgba(250, 238, 205, 0.94);
  color: #352b21;
  cursor: pointer;
  font-weight: 900;
}

.table-quick-tools {
  position: sticky;
  top: 0;
  z-index: 2;
  display: grid;
  grid-template-columns: auto repeat(6, minmax(96px, max-content)) auto;
  gap: 8px;
  align-items: end;
  padding: 8px;
  border: 1px solid rgba(62, 44, 31, 0.22);
  background:
    linear-gradient(rgba(255, 250, 232, 0.96), rgba(239, 224, 190, 0.92));
  box-shadow: 0 6px 18px rgba(61, 43, 24, 0.08);
}

.table-selected-cell {
  align-self: center;
  color: #6d241d;
  font-family: "Marcellus SC", Georgia, serif;
  font-weight: 900;
  white-space: nowrap;
}

.table-quick-tools label {
  display: grid;
  gap: 3px;
  color: #5b5042;
  font-size: 0.82rem;
  font-weight: 900;
}

.table-quick-tools input,
.table-quick-tools select {
  min-height: 32px;
  padding: 4px 7px;
}

.table-quick-tools input[type="color"] {
  width: 54px;
  padding: 2px;
}

.table-quick-tools input[type="number"] {
  width: 72px;
}

.table-quick-tools button {
  min-height: 32px;
  border: 1px solid rgba(62, 44, 31, 0.42);
  background: rgba(250, 238, 205, 0.94);
  color: #352b21;
  cursor: pointer;
  font-weight: 900;
}

.table-recent-palette {
  display: flex;
  grid-column: span 4;
  gap: 5px;
  align-items: center;
  min-height: 30px;
}

.table-batch-cells {
  grid-column: span 3;
  min-width: 280px;
}

.table-batch-cells input {
  width: 100%;
}

.table-batch-actions {
  display: flex;
  grid-column: span 4;
  gap: 6px;
  align-items: end;
  flex-wrap: wrap;
}

.table-recent-palette span {
  color: #6d241d;
  font-size: 0.78rem;
  font-weight: 900;
}

.table-recent-palette button {
  width: 28px;
  min-height: 28px;
  padding: 0;
  border: 1px solid rgba(62, 44, 31, 0.45);
  box-shadow: inset 0 0 0 1px rgba(255, 250, 232, 0.52);
}

.table-grid-scroll {
  max-width: 100%;
  overflow: auto;
  border: 1px solid rgba(62, 44, 31, 0.24);
  background: rgba(255, 252, 239, 0.86);
}

.table-grid-editor-table {
  width: max-content;
  min-width: 100%;
  border-collapse: collapse;
}

.table-grid-editor-table th,
.table-grid-editor-table td {
  border: 1px solid rgba(62, 44, 31, 0.16);
  vertical-align: top;
}

.table-grid-editor-table th {
  width: 42px;
  padding: 8px;
  background: rgba(129, 109, 78, 0.12);
  color: #6d241d;
  font-family: "Marcellus SC", Georgia, serif;
  text-align: center;
}

.table-grid-editor-table td {
  position: relative;
  min-width: 180px;
  background: rgba(255, 252, 239, 0.72);
}

.table-grid-editor-table td[data-merge-hint]::after {
  content: attr(data-merge-hint);
  position: absolute;
  right: 4px;
  top: 3px;
  padding: 1px 4px;
  background: rgba(139, 46, 46, 0.12);
  color: #7b2b24;
  font-size: 0.68rem;
  font-weight: 900;
}

.table-grid-editor-table td[data-selected-cell="true"] {
  outline: 2px solid rgba(139, 46, 46, 0.36);
  outline-offset: -2px;
  background: rgba(255, 246, 221, 0.96);
}

.table-grid-editor-table textarea {
  display: block;
  width: 100%;
  min-height: 64px;
  border: 0;
  background: transparent;
  color: #2b2118;
  resize: vertical;
}

.article-preview {
  display: block;
  min-height: 260px;
  max-height: none;
  overflow: visible;
  min-width: 0;
  padding: 10px;
  background: rgba(255, 250, 232, 0.58);
}

.map-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  gap: 16px;
  align-items: start;
}

#mapsAdmin .admin-form,
#mapsAdmin .admin-side,
#mapsAdmin .admin-list,
#mapsAdmin .admin-preview {
  min-width: 0;
  max-width: 100%;
}

#mapsAdmin .map-admin-form {
  align-content: start;
  gap: 10px;
}

#mapsAdmin .map-form-head {
  align-items: flex-start;
}

#mapsAdmin .form-head-actions {
  flex-wrap: wrap;
  justify-content: flex-end;
}

#mapsAdmin .admin-form label {
  align-content: start;
}

#mapsAdmin .admin-form input,
#mapsAdmin .admin-form select {
  min-height: 36px;
  height: 36px;
}

#mapsAdmin #mapSearch {
  width: 100%;
  min-height: 36px;
  margin: 8px 0 10px;
  border: 1px solid rgba(92, 71, 45, 0.28);
  background: rgba(255, 253, 241, 0.72);
}

#mapsAdmin .admin-form textarea {
  min-height: 96px;
}

#mapsAdmin #mapPublicId {
  height: 36px;
  min-height: 36px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
}

#mapsAdmin #mapGrid {
  justify-self: start;
}

#mapsAdmin .admin-side {
  grid-template-rows: auto auto;
}

#mapsAdmin #adminMaps {
  display: grid;
  gap: 8px;
  max-height: 340px;
  overflow: auto;
  padding-right: 4px;
}

.menu-admin-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(320px, 0.75fr);
  gap: 16px;
}

#cardsAdmin .menu-admin-grid {
  grid-template-columns: minmax(0, 1fr);
  align-items: start;
}

#cardsAdmin .admin-form .form-row {
  gap: 10px;
}

#cardsAdmin .card-admin-side {
  position: static;
  display: grid;
  gap: 10px;
}

#cardsAdmin .admin-preview,
#cardsAdmin .card-admin-list {
  padding: 12px;
}

#cardsAdmin .card-preview-top {
  margin-bottom: 14px;
}

#cardsAdmin .card-preview-top #cardPreview {
  display: grid;
  max-width: 100%;
}

#cardsAdmin .card-admin-side .admin-preview,
#cardsAdmin .card-admin-side .admin-list,
#cardsAdmin .admin-form {
  width: 100%;
}

.check-row {
  display: flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 9px !important;
}

.check-row input {
  width: 18px;
  height: 18px;
}

.menu-entry {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  margin-bottom: 8px;
}

.menu-entry-main {
  margin: 0;
}

.menu-entry-controls {
  display: flex;
  gap: 4px;
}

.menu-entry-controls button {
  width: 31px;
  border: 1px solid rgba(62, 44, 31, 0.48);
  background: rgba(250, 238, 205, 0.92);
  color: #352b21;
  cursor: pointer;
  font-weight: 900;
}

.menu-entry-controls button:disabled {
  opacity: 0.35;
  cursor: default;
}

.map-tools {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.map-floor-controls,
.map-rect-controls {
  align-items: end;
}

.map-template-panel,
.map-paste-panel {
  padding: 10px;
  border: 1px solid rgba(92, 71, 45, 0.25);
  background: rgba(245, 229, 190, 0.28);
}

.map-paste-panel textarea {
  width: 100%;
  min-height: 112px;
  margin-top: 8px;
  resize: vertical;
  font-family: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
  font-size: 0.86rem;
}

.map-template-actions,
.map-trace-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: end;
  margin-top: 8px;
}

.map-template-actions button {
  min-height: 34px;
  padding: 7px 11px;
  border: 1px solid rgba(92, 71, 45, 0.42);
  background: rgba(255, 244, 217, 0.86);
  color: #5a261f;
  cursor: pointer;
  font-family: var(--aaa-ui);
  font-weight: 850;
}

.map-rect-controls label,
.map-trace-panel label {
  min-width: 110px;
}

.map-grid-editor,
.map-grid {
  display: grid;
  grid-template-columns: repeat(var(--map-width), var(--map-cell-size));
  gap: 2px;
  width: max-content;
  max-width: 100%;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(70, 57, 41, 0.34);
  background: rgba(255, 250, 232, 0.54);
}

.map-grid-frame {
  display: grid;
  place-items: center;
  width: 100%;
  height: var(--map-frame-height, 430px);
  min-height: 0;
  overflow: hidden;
  padding: 8px;
  border: 1px solid rgba(70, 57, 41, 0.22);
  background: rgba(255, 250, 232, 0.26);
}

.map-grid-scale {
  width: var(--map-fit-width);
  height: var(--map-fit-height);
  display: grid;
  place-items: start;
  overflow: visible;
}

.map-grid-scale > .map-grid {
  width: var(--map-natural-width);
  max-width: none;
  transform: scale(var(--map-scale, 1));
  transform-origin: left top;
  overflow: visible;
}

.map-grid-editor.has-map-trace {
  position: relative;
  background-color: rgba(255, 250, 232, 0.42);
}

.map-grid-editor.has-map-trace::before {
  content: "";
  position: absolute;
  inset: 8px;
  pointer-events: none;
  background-image: var(--map-trace-image, none);
  background-position: center;
  background-repeat: no-repeat;
  background-size: 100% 100%;
  opacity: var(--map-trace-opacity, 0.45);
}

.map-grid-editor.has-map-trace .map-cell {
  background-color: rgba(255, 250, 232, 0.16);
  z-index: 1;
}

.map-cell {
  aspect-ratio: 1;
  width: var(--map-cell-size);
  min-width: 0;
  border: 0;
  position: relative;
  background: url("assets/map-frame.png") center / contain no-repeat;
  color: #4b321d;
  display: grid;
  place-items: center;
  overflow: hidden;
  font-weight: 950;
  text-indent: -999px;
}

button.map-cell {
  cursor: pointer;
}

.map-cell::after {
  content: "";
  position: absolute;
  inset: 2px;
  background: var(--map-icon, none) center / contain no-repeat;
}

.content-map {
  display: inline-grid;
  gap: 10px;
  width: max-content;
  max-width: 100%;
  overflow-x: auto;
  padding: 12px;
  border: 1px solid rgba(79, 63, 43, 0.28);
  background: rgba(255, 250, 232, 0.48);
}

.content-map-row {
  width: 100%;
}

.content-map-layout {
  display: grid;
  gap: 12px;
}

.content-map-layout-row {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: start;
  width: 100%;
}

.map-article-filter {
  display: grid;
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto auto;
  align-items: end;
  gap: 8px;
  width: 100%;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(79, 63, 43, 0.22);
  background: rgba(255, 248, 223, 0.42);
}

.map-article-filter > strong {
  grid-column: 1 / -1;
  color: #7b2b24;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
  font-size: 0.9rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.map-filter-field {
  display: grid;
  gap: 3px;
  margin: 0;
  min-width: 0;
}

.map-filter-field span,
.map-filter-count {
  color: #7b2b24;
  font-family: "Marcellus SC", "Cormorant Garamond", Georgia, serif;
  font-size: 0.82rem;
  font-weight: 700;
}

.map-filter-field select {
  min-width: 0;
}

.map-filter-count {
  align-self: center;
  white-space: nowrap;
}

.map-filter-reset {
  align-self: end;
}

.map-filter-empty {
  grid-column: 1 / -1;
}

.map-variant {
  display: grid;
  gap: 10px;
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(79, 63, 43, 0.2);
  background: rgba(255, 252, 238, 0.34);
}

.map-floors {
  display: grid;
  gap: 12px;
}

.map-floors-row {
  grid-template-columns: repeat(auto-fit, minmax(min(420px, 100%), max-content));
  align-items: start;
  overflow-x: auto;
  padding-bottom: 4px;
}

.map-floors-row .map-floor {
  width: max-content;
  max-width: 100%;
}

.map-variant h5 {
  margin: 0;
  color: #7b2b24;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
  font-size: 1rem;
}

.map-variant-description {
  max-width: 620px;
  margin: 0;
  color: #46392c;
  line-height: 1.5;
  white-space: pre-line;
}

.map-description {
  max-width: min(620px, 80vw);
  margin: 0;
  color: #46392c;
  line-height: 1.55;
  white-space: pre-line;
}

.map-cell.path {
  opacity: 1;
}

.map-cell.boss {
  --map-icon: url("assets/map-boss.png");
}

.map-cell.entrance,
.map-cell.exit {
  --map-icon: url("assets/map-exit.png");
}

.map-cell.down {
  --map-icon: url("assets/map-stairs.png");
}

.map-cell.chest {
  --map-icon: url("assets/map-box.png");
}

.map-cell.empty {
  opacity: 0.2;
}

.map-showcase,
.public-maps {
  display: grid;
  gap: 16px;
}

.map-card {
  padding: 16px;
}

.map-card-head {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 12px;
}

.map-card-head p {
  max-width: 680px;
  margin: 0;
  color: #625644;
  font-weight: 700;
}

.map-floor {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.map-floor-fit {
  align-content: start;
}

.map-floor h4 {
  margin: 0;
  color: #7b2b24;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
}

.map-block-picker,
.map-variant-editor {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.map-picker-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

.map-picker-search {
  min-width: 0;
}

.map-selected-panel {
  display: grid;
  gap: 7px;
  max-height: 210px;
  overflow: auto;
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(79, 63, 43, 0.22);
  background: rgba(255, 248, 223, 0.34);
}

.map-selected-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(120px, 1.2fr) auto;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid rgba(79, 63, 43, 0.18);
  background: rgba(255, 252, 235, 0.62);
}

.map-selected-row strong,
.map-selected-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.map-selected-row span {
  color: rgba(43, 33, 24, 0.7);
  font-size: 0.9em;
}

.admin-check-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  margin: 0;
}

.map-block-picker {
  max-height: 180px;
  overflow: auto;
  padding: 8px;
  border: 1px solid rgba(79, 63, 43, 0.24);
  background: rgba(255, 248, 223, 0.4);
  min-width: 0;
}

.map-block-picker-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.map-block-picker-row span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (max-width: 900px) {
  .map-article-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .map-filter-count,
  .map-filter-reset {
    justify-self: start;
  }

  .map-selected-row {
    grid-template-columns: minmax(0, 1fr);
    align-items: start;
  }

  .map-selected-row strong,
  .map-selected-row span {
    white-space: normal;
  }

  .content-map-layout-row {
    grid-template-columns: 1fr;
  }

  .map-grid-frame {
    height: auto;
    overflow-x: auto;
    justify-content: start;
  }

  .map-grid-scale {
    width: min(var(--map-fit-width), 100%);
    height: auto;
    min-height: min(var(--map-fit-height), 62vw);
    place-items: start;
  }

  .map-grid-scale > .map-grid {
    --map-cell-size: clamp(22px, 6vw, 34px);
    width: max-content;
    transform-origin: left top;
    transform: none;
  }
}

.import-panel {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.import-panel p {
  max-width: 900px;
  margin: 0;
  line-height: 1.6;
}

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

.sheet-grid span {
  padding: 10px 12px;
  border: 1px solid rgba(84, 66, 45, 0.28);
  background: rgba(255, 248, 226, 0.72);
  font-weight: 900;
}

.sheet-import-preview {
  min-height: 44px;
  color: #625644;
  font-weight: 800;
}

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

.db-preview-card {
  min-width: 0;
}

.db-preview-card h3 {
  margin: 0 0 8px;
  color: #7b2b24;
  font-family: "Cinzel Decorative", "Cormorant Garamond", Georgia, serif;
}

.db-preview-card .content-table {
  font-size: 0.82rem;
}

.db-preview-card .content-table th,
.db-preview-card .content-table td {
  padding: 6px 7px;
}

.editor-hint {
  margin: 0;
  color: #716759;
  font-weight: 750;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 180px;
  gap: 12px;
}

.article-meta-row {
  grid-template-columns: minmax(260px, 1.6fr) minmax(150px, 0.75fr) minmax(150px, 0.75fr) 150px minmax(190px, 0.8fr);
  gap: 8px;
  align-items: end;
}

.article-meta-row label {
  gap: 4px;
  font-size: 0.78rem;
}

.article-meta-row input,
.article-meta-row select {
  min-height: 36px;
  padding: 7px 9px;
}

.admin-entry {
  width: 100%;
  margin-top: 9px;
  padding: 10px;
  border: 1px solid rgba(67, 53, 37, 0.34);
  background: rgba(248, 240, 218, 0.86);
  cursor: pointer;
  text-align: left;
}

.admin-entry strong {
  display: block;
  color: #263f53;
}

.admin-entry span {
  color: #665b4d;
  font-size: 0.84rem;
  font-weight: 800;
}

.link-list {
  margin: 0;
  padding: 0 0 0 18px;
  line-height: 1.75;
}

.link-list li::marker {
  color: #211b16;
}

.empty-state {
  padding: 18px;
  border: 1px dashed rgba(71, 57, 39, 0.45);
  background: rgba(250, 243, 222, 0.72);
  color: #655a4b;
  font-weight: 800;
}

@media (max-width: 1120px) {
  .category-grid,
  .admin-grid,
  .map-admin-grid,
  .menu-admin-grid,
  #cardsAdmin .menu-admin-grid,
  .admin-workspace,
  .article-admin-layout,
  .block-editor,
  #assetsAdmin.active {
    grid-template-columns: 1fr;
  }

  .block-editor {
    grid-template-areas:
      "outline"
      "toolbar"
      "blocks";
  }

  .article-admin-layout {
    grid-template-areas:
      "picker"
      "editor"
      "preview";
  }

  .admin-sidebar,
  .article-admin-picker,
  .editor-outline-panel,
  #cardsAdmin .card-admin-side {
    position: static;
    max-height: none;
  }

  #cardsAdmin .card-admin-side {
    position: static;
  }
}

@media (max-width: 800px) {
  .site-header {
    position: static;
    width: calc(100% - 12px);
    aspect-ratio: 1976 / 540;
    margin-top: 8px;
  }

  .page-shell {
    width: calc(100% - 16px);
    padding: 14px 0 34px;
  }

  .main-nav {
    width: auto;
  }

  .top-bar {
    flex-direction: column;
    width: calc(100% - 16px);
  }

  .nav-search {
    flex-basis: auto;
    width: 100%;
    min-width: 0;
  }

  .toolbar,
  .feature-card,
  .form-head,
  .form-actions,
  .table-image-tools {
    align-items: stretch;
    flex-direction: column;
  }

  .table-image-tools {
    grid-template-columns: 1fr;
  }

  .category-grid,
  .admin-grid,
  .map-admin-grid,
  .form-row {
    grid-template-columns: 1fr;
  }

  .home-hero-button-row {
    grid-template-columns: 1fr;
  }

  .sheet-grid {
    grid-template-columns: 1fr 1fr;
  }

  .database-preview {
    grid-template-columns: 1fr;
  }

  .article-meta {
    align-items: flex-start;
    flex-direction: column;
  }
}

/* AAA fantasy codex redesign */
:root {
  --aaa-bg: #120f0d;
  --aaa-bg-2: #1b1612;
  --aaa-bg-3: #221b17;
  --aaa-gold: #c9a45d;
  --aaa-gold-bright: #d6b97a;
  --aaa-text: #f5e6c8;
  --aaa-red: #8b2e2e;
  --aaa-paper: #e8d9b5;
  --aaa-border: rgba(201, 164, 93, 0.35);
  --aaa-deep-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
  --aaa-title: "Cinzel Decorative", "Cinzel", Georgia, serif;
  --aaa-body: "EB Garamond", "Cormorant Garamond", Georgia, serif;
  --aaa-ui: "Cormorant Garamond", "EB Garamond", Georgia, serif;
}

html {
  scroll-behavior: smooth;
}

body {
  color: var(--aaa-text);
  background:
    radial-gradient(circle at 50% -12%, rgba(201, 164, 93, 0.12), transparent 34rem),
    linear-gradient(180deg, rgba(18, 15, 13, 0.86), rgba(18, 15, 13, 0.92)),
    url("assets/parchment-texture.png") center top / 760px auto repeat,
    var(--aaa-bg);
}

body::before {
  z-index: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.34), transparent 14%, transparent 86%, rgba(0, 0, 0, 0.36)),
    radial-gradient(circle at 50% 0, rgba(214, 185, 122, 0.12), transparent 38rem);
}

.codex-navbar,
.hero-shell,
.page-shell {
  position: relative;
  z-index: 1;
}

.site-header,
.top-bar {
  display: none;
}

.codex-navbar {
  position: sticky;
  top: 0;
  z-index: 120;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 24px;
  min-height: 64px;
  padding: 0 38px;
  border-bottom: 1px solid rgba(201, 164, 93, 0.62);
  background:
    linear-gradient(180deg, rgba(34, 27, 23, 0.94), rgba(18, 15, 13, 0.9)),
    rgba(18, 15, 13, 0.84);
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.34);
  backdrop-filter: blur(14px);
}

.codex-navbar::before {
  content: "";
  position: absolute;
  inset: 5px 18px;
  pointer-events: none;
  border: 1px solid rgba(201, 164, 93, 0.2);
}

.brand {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--aaa-text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  --brand-icon-size: 42px;
  width: var(--brand-icon-size);
  height: var(--brand-icon-size);
  min-width: var(--brand-icon-size);
  place-items: center;
  border: 1px solid rgba(214, 185, 122, 0.76);
  border-radius: 999px;
  background:
    radial-gradient(circle, rgba(201, 164, 93, 0.16), transparent 65%),
    rgba(8, 7, 6, 0.56);
  box-shadow: inset 0 0 18px rgba(201, 164, 93, 0.12), 0 0 18px rgba(201, 164, 93, 0.08);
}

.brand-mark svg {
  width: calc(var(--brand-icon-size) * 0.64);
  height: calc(var(--brand-icon-size) * 0.64);
  fill: none;
  stroke: var(--aaa-gold-bright);
  stroke-width: 2.1;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.brand-mark img {
  display: none;
  width: calc(var(--brand-icon-size) * 0.74);
  height: calc(var(--brand-icon-size) * 0.74);
  object-fit: contain;
}

.brand-mark img.active {
  display: block;
}

.brand-text {
  max-width: 210px;
  color: #f8e8c5;
  font-family: var(--aaa-title);
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.2;
  text-transform: uppercase;
  text-shadow: 0 1px 0 #000, 0 0 14px rgba(201, 164, 93, 0.14);
}

.codex-navbar .main-nav {
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  gap: 2px;
}

.codex-navbar .main-nav a {
  min-height: 62px;
  padding: 0 15px;
  border: 0;
  clip-path: none;
  color: rgba(245, 230, 200, 0.82);
  background: transparent;
  box-shadow: none;
  font-family: var(--aaa-title);
  font-size: 0.82rem;
  letter-spacing: 0.085em;
  text-shadow: 0 1px 0 #000;
}

.codex-navbar .main-nav a::after {
  content: "";
  position: absolute;
  right: 13px;
  bottom: 12px;
  left: 13px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--aaa-gold-bright), transparent);
  opacity: 0;
  transform: scaleX(0.35);
  transition: opacity 220ms ease, transform 220ms ease;
}

.codex-navbar .main-nav a:hover,
.codex-navbar .main-nav a.active {
  color: var(--aaa-gold-bright);
  filter: none;
  transform: none;
  background: radial-gradient(circle at 50% 100%, rgba(201, 164, 93, 0.15), transparent 64%);
  box-shadow: none;
}

.codex-navbar .main-nav a:hover::after,
.codex-navbar .main-nav a.active::after {
  opacity: 1;
  transform: scaleX(1);
}

.codex-navbar .nav-dropdown {
  top: calc(100% - 6px);
  min-width: 230px;
  padding: 10px;
  border: 1px solid rgba(201, 164, 93, 0.52);
  background:
    linear-gradient(rgba(34, 27, 23, 0.94), rgba(18, 15, 13, 0.98)),
    var(--aaa-bg-2);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42);
}

.codex-navbar .nav-dropdown button {
  border-bottom: 1px solid rgba(201, 164, 93, 0.13);
  color: rgba(245, 230, 200, 0.82);
  font-family: var(--aaa-ui);
  font-size: 1rem;
}

.codex-navbar .nav-dropdown button:hover {
  color: var(--aaa-gold-bright);
  background: linear-gradient(90deg, rgba(139, 46, 46, 0.34), transparent);
}

.nav-search {
  position: relative;
  z-index: 1;
  flex: 0 0 auto;
  min-width: 0;
}

.site-search-results {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 40;
  display: grid;
  width: min(430px, calc(100vw - 24px));
  max-height: min(620px, calc(100vh - 96px));
  overflow-y: auto;
  border: 1px solid rgba(201, 164, 93, 0.58);
  background:
    linear-gradient(rgba(31, 25, 21, 0.98), rgba(17, 14, 12, 0.99)),
    var(--aaa-bg-2);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.46);
}

.site-search-group-title {
  padding: 9px 12px 5px;
  color: var(--aaa-gold-bright);
  font-family: var(--aaa-ui);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-search-result {
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 12px 14px;
  border: 0;
  border-top: 1px solid rgba(201, 164, 93, 0.13);
  color: var(--aaa-text);
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.site-search-result:hover,
.site-search-result:focus-visible {
  background: linear-gradient(90deg, rgba(139, 46, 46, 0.42), transparent);
  outline: 0;
}

.site-search-result span {
  color: #f2dfb8;
  font-family: var(--aaa-title);
  font-size: 1.05rem;
  line-height: 1.25;
  white-space: normal;
  overflow-wrap: anywhere;
}

.site-search-result small {
  color: rgba(245, 230, 200, 0.82);
  font-size: 0.86rem;
  line-height: 1.25;
}

.site-search-empty {
  padding: 16px 12px;
  color: rgba(245, 230, 200, 0.7);
  text-align: center;
}

.nav-search::before {
  content: "⌕";
  position: absolute;
  top: 50%;
  left: 14px;
  z-index: 1;
  color: var(--aaa-gold-bright);
  font-size: 1.4rem;
  line-height: 1;
  transform: translateY(-50%);
}

.nav-search input {
  width: 122px;
  height: 42px;
  padding: 0 14px 0 40px;
  border: 1px solid rgba(201, 164, 93, 0.48);
  color: var(--aaa-text);
  background: rgba(8, 7, 6, 0.34);
  box-shadow: inset 0 0 0 1px rgba(255, 238, 190, 0.04);
  font-family: var(--aaa-title);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  transition: width 240ms ease, border-color 180ms ease, background 180ms ease;
}

.nav-search input::placeholder {
  color: rgba(245, 230, 200, 0.78);
}

.nav-search input:focus {
  width: 240px;
  border-color: rgba(214, 185, 122, 0.9);
  background: rgba(8, 7, 6, 0.58);
  outline: 0;
}

.nav-toggle {
  display: none;
}

.hero-shell {
  width: 100%;
  min-height: 340px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid rgba(201, 164, 93, 0.52);
  background: var(--aaa-bg-2);
  box-shadow: var(--aaa-deep-shadow);
  transition: min-height 320ms ease, background 320ms ease, border-color 320ms ease;
}

.hero-shell::before {
  content: "";
  position: absolute;
  inset: 7px;
  z-index: 4;
  pointer-events: none;
  border: 1px solid rgba(214, 185, 122, 0.28);
}

.hero-backdrop {
  position: absolute;
  inset: 0;
  background: url("assets/header-landscape-latest.png") center center / cover no-repeat;
  filter: saturate(0.9) contrast(1.05) brightness(0.86);
  transform: scale(1.01);
  transition: opacity 320ms ease, transform 320ms ease;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(20, 15, 10, 0.88) 0%, rgba(20, 15, 10, 0.55) 35%, rgba(20, 15, 10, 0) 100%),
    linear-gradient(180deg, rgba(18, 15, 13, 0.26), rgba(18, 15, 13, 0.24));
  transition: opacity 320ms ease;
}

.hero-content {
  position: relative;
  z-index: 5;
  display: flex;
  min-height: 340px;
  max-width: 560px;
  flex-direction: column;
  justify-content: center;
  padding: 46px 56px;
  transition: min-height 320ms ease, max-width 320ms ease, padding 320ms ease;
}

.hero-kicker {
  margin: 0 0 12px;
  color: rgba(214, 185, 122, 0.9);
  font-family: var(--aaa-ui);
  font-size: 0.86rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero-content h1 {
  margin: 0;
  color: #f8e8c5;
  font-family: var(--aaa-title);
  font-size: clamp(2.5rem, 5vw, 3.35rem);
  line-height: 1.02;
  letter-spacing: 0.055em;
  text-transform: uppercase;
  text-shadow:
    0 2px 0 #0b0908,
    0 0 24px rgba(201, 164, 93, 0.26),
    0 14px 36px rgba(0, 0, 0, 0.55);
}

.hero-content p {
  color: #f4dfb7;
}

#heroSubtitle {
  margin: 16px 0 0;
  font-family: var(--aaa-ui);
  font-size: clamp(1.16rem, 2vw, 1.46rem);
  font-weight: 700;
  letter-spacing: 0.045em;
  text-shadow: 0 1px 0 #000;
}

.hero-actions {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin-top: 30px;
}

.hero-btn {
  display: inline-flex;
  flex: 0 0 auto;
  min-height: 46px;
  min-width: 180px;
  align-items: center;
  justify-content: center;
  padding: 0 18px;
  border: 1px solid rgba(214, 185, 122, 0.68);
  color: var(--aaa-text);
  font-family: var(--aaa-ui);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

.hero-btn-primary {
  background: linear-gradient(#9c3a32, #641f1d);
  box-shadow: inset 0 1px rgba(255, 240, 196, 0.14), 0 12px 28px rgba(139, 46, 46, 0.2);
}

.hero-btn-secondary {
  background: rgba(8, 7, 6, 0.22);
}

.hero-btn:hover {
  color: #fff3d8;
  transform: translateY(-2px);
  box-shadow: 0 0 0 1px rgba(214, 185, 122, 0.24), 0 0 22px rgba(201, 164, 93, 0.22);
}

.hero-breadcrumb {
  display: none;
  margin: 28px 0 0;
  color: rgba(43, 33, 24, 0.78) !important;
  font-family: var(--aaa-ui);
  font-size: 1.25rem;
  font-weight: 700;
}

.is-inner .hero-shell {
  display: none;
}

.page-shell {
  width: 100%;
  padding: 38px clamp(24px, 3vw, 48px) 56px;
  background:
    linear-gradient(180deg, rgba(232, 217, 181, 0.96), rgba(209, 184, 137, 0.94)),
    url("assets/parchment-texture.png") center / 760px auto repeat;
  box-shadow: inset 0 18px 34px rgba(0, 0, 0, 0.16);
}

.toolbar {
  display: none;
}

.content-stage {
  color: var(--ink);
}

.codex-category-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-bottom: 34px;
}

.category-card {
  position: relative;
  min-height: 158px;
  padding: 22px 24px 22px;
  overflow: hidden;
  border: 1px solid rgba(201, 164, 93, 0.46);
  background:
    linear-gradient(rgba(232, 217, 181, 0.95), rgba(218, 196, 154, 0.92)),
    url("assets/parchment-texture.png") center / 520px auto repeat;
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 210, 0.28),
    0 18px 36px rgba(0, 0, 0, 0.2);
  color: #2b2118;
  text-align: left;
  transition: transform 190ms ease, border-color 190ms ease, box-shadow 190ms ease;
}

.category-card::before {
  content: "";
  position: absolute;
  inset: 7px;
  pointer-events: none;
  border: 1px solid rgba(74, 56, 44, 0.22);
}

.category-card:hover {
  border-color: rgba(214, 185, 122, 0.85);
  transform: translateY(-3px);
  box-shadow:
    inset 0 0 0 1px rgba(255, 245, 210, 0.34),
    0 22px 42px rgba(0, 0, 0, 0.24),
    0 0 28px rgba(201, 164, 93, 0.18);
}

.category-card-head {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.category-card strong {
  display: block;
  color: #1b1612;
  font-family: var(--aaa-title);
  font-size: clamp(1.1rem, 1.6vw, 1.48rem);
  letter-spacing: 0.045em;
  line-height: 1.05;
  text-transform: uppercase;
  text-shadow: 0 1px rgba(255, 245, 210, 0.8);
}

.category-card span:not(.category-icon) {
  display: block;
}

.category-links {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 4px;
  margin: 14px 0 0 62px;
}

.category-links button {
  position: relative;
  width: fit-content;
  border: 0;
  padding: 0;
  color: #211a14;
  background: transparent;
  cursor: pointer;
  font-family: var(--aaa-body);
  font-size: clamp(1.08rem, 1.45vw, 1.32rem);
  line-height: 1.08;
  text-align: left;
  text-shadow: 0 1px rgba(255, 245, 210, 0.74);
  transition: color 160ms ease, transform 160ms ease;
}

.category-links button::before {
  content: var(--card-bullet, "•");
  position: absolute;
  left: -18px;
  color: #8b2e2e;
}

.category-links button:hover {
  color: #8b2e2e;
  transform: translateX(4px);
}

.category-icon {
  position: relative;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  color: #8a663a;
  filter: drop-shadow(0 1px rgba(255, 245, 210, 0.62));
}

.category-icon::before {
  font-size: 1.85rem;
  line-height: 1;
}

.category-icon.custom-icon {
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.category-icon.custom-icon::before {
  content: "";
}

.category-icon.scroll::before { content: "▰"; transform: rotate(-8deg); }
.category-icon.helm::before { content: "♜"; }
.category-icon.rune::before { content: "♦"; }
.category-icon.shield::before { content: "⌂"; }
.category-icon.flask::before { content: "♢"; }
.category-icon.coin::before { content: "◉"; }

.feature-card,
.article-card,
.admin-form,
.admin-list,
.admin-preview,
.import-panel,
.map-card,
.article-full {
  color: #2b2118;
  border-color: rgba(201, 164, 93, 0.42);
  background:
    linear-gradient(rgba(232, 217, 181, 0.96), rgba(219, 199, 160, 0.94)),
    url("assets/parchment-texture.png") center / 620px auto repeat;
}

.article-card h3,
.feature-card h2,
.article-full h2,
.admin-form h2,
.import-panel h2 {
  color: #241b15;
  font-family: var(--aaa-title);
}

.article-card p,
.feature-card p,
.article-full p,
.import-panel p,
.map-card-head p {
  color: #43362a;
  font-size: 1.1rem;
}

.action-btn,
.ghost-btn,
.tool-btn,
.admin-tabs button,
.map-tools button,
.guide-tabs button {
  border-color: rgba(201, 164, 93, 0.52);
  font-family: var(--aaa-ui);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.action-btn {
  color: #fff0d0;
  background: linear-gradient(#973831, #67211e);
}

.ghost-btn,
.tool-btn {
  color: #2b2118;
  background: rgba(232, 217, 181, 0.72);
}

.entry-subgroup-field {
  display: none !important;
}

.is-inner .page-shell {
  padding-top: 34px;
}

.admin-content,
.auth-panel {
  width: 100%;
}

.admin-content.hidden {
  display: none;
}

.analytics-panel {
  width: 100%;
}

.analytics-days-label {
  min-width: 150px;
}

.analytics-dashboard {
  display: grid;
  gap: 14px;
}

.armory-page {
  display: grid;
  gap: 14px;
}

.armory-tabs {
  display: flex;
  gap: 7px;
  padding: 6px;
  border: 1px solid rgba(97, 69, 37, 0.26);
  background: rgba(255, 249, 229, 0.62);
  box-shadow: 0 5px 16px rgba(76, 52, 29, 0.08);
}

.armory-tabs button {
  flex: 0 1 220px;
  min-height: 48px;
  padding: 10px 18px;
  border: 1px solid rgba(123, 50, 39, 0.24);
  background: linear-gradient(180deg, rgba(255, 251, 237, 0.96), rgba(232, 211, 165, 0.46));
  color: var(--accent);
  cursor: pointer;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 1.06rem;
  font-weight: 900;
}

.armory-tabs button:hover {
  border-color: rgba(123, 50, 39, 0.52);
  background: rgba(255, 250, 232, 0.96);
}

.armory-tabs button.active {
  border-color: #6f211c;
  background: linear-gradient(180deg, #87342d, #6f211c);
  box-shadow: inset 0 0 0 1px rgba(255, 224, 174, 0.18), 0 5px 12px rgba(78, 32, 25, 0.18);
  color: #fff4d7;
}

.armory-tabs button small {
  display: inline-grid;
  min-width: 24px;
  min-height: 24px;
  margin-left: 6px;
  place-items: center;
  border: 1px solid rgba(123, 50, 39, 0.22);
  background: rgba(255, 249, 229, 0.72);
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 0.84rem;
}

.armory-tabs button.active small {
  border-color: rgba(255, 244, 215, 0.36);
  background: rgba(255, 244, 215, 0.12);
  color: #fff4d7;
}

.armory-mode-actions {
  min-width: 0;
}

.armory-mode-actions > .armory-actions {
  min-height: 68px;
  padding: 11px 13px;
  border: 1px solid rgba(97, 69, 37, 0.22);
  background: linear-gradient(135deg, rgba(255, 250, 232, 0.78), rgba(226, 203, 148, 0.24));
  justify-content: flex-start;
}

.armory-mode-copy {
  display: grid;
  gap: 3px;
  flex: 0 1 560px;
  margin-right: 8px;
  color: var(--muted);
}

.armory-mode-copy strong {
  color: var(--text);
  font-size: 1.02rem;
}

.armory-mode-copy small {
  font-size: 0.9rem;
  line-height: 1.35;
}

.armory-heading,
.armory-editor-head,
.armory-selected-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.armory-heading h2,
.armory-editor-head h3,
.armory-loadout h3,
.armory-summary h3 {
  margin: 0;
}

.armory-actions {
  display: flex;
  align-items: end;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 7px;
}

.armory-import-field {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 800;
}

.armory-import-field input {
  width: clamp(210px, 18vw, 280px);
  min-height: 40px;
  padding: 8px 11px;
  font-size: 0.95rem;
}

.armory-mode-actions .action-btn,
.armory-mode-actions .ghost-btn {
  min-height: 40px;
  padding: 8px 12px;
  font-size: 0.84rem;
  white-space: nowrap;
}

.armory-heading p:not(.eyebrow) {
  max-width: 720px;
  margin: 7px 0 0;
}

.armory-workspace {
  min-width: 0;
}

.armory-page .rating-status:empty { display: none; }

.armory-layout {
  display: grid;
  grid-template-columns: minmax(540px, 1.35fr) minmax(480px, 1.3fr);
  gap: 14px;
  align-items: start;
}

.armory-layout.armory-layout-compare {
  display: block;
}

.armory-layout-compare .armory-compare {
  width: 100%;
}

.armory-mode-section-head {
  display: flex;
  gap: 22px;
  align-items: end;
  justify-content: space-between;
  margin-bottom: 14px;
  padding-bottom: 13px;
  border-bottom: 1px solid rgba(97, 69, 37, 0.2);
}

.armory-mode-section-head h3 {
  margin: 2px 0 0;
  font-size: 1.42rem;
}

.armory-mode-section-head > p {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 0.96rem;
  line-height: 1.42;
  text-align: right;
  white-space: nowrap;
}

.armory-loadout,
.armory-summary,
.armory-editor,
.armory-compare,
.armory-manual-builder {
  border: 1px solid rgba(97, 69, 37, 0.28);
  background: linear-gradient(135deg, rgba(255, 248, 224, 0.74), rgba(226, 203, 148, 0.28));
  padding: 15px;
  min-width: 0;
}

.armory-summary {
  grid-column: 1 / -1;
}

.armory-compare { grid-column: 1 / -1; }

.armory-workbench {
  grid-column: 1 / -1;
  min-width: 0;
}

.armory-workbench > details > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 58px;
  padding: 14px 16px;
  border: 1px solid rgba(97, 69, 37, 0.28);
  background: linear-gradient(135deg, rgba(255, 248, 224, 0.82), rgba(226, 203, 148, 0.34));
  color: var(--accent);
  cursor: pointer;
  font-family: "Marcellus SC", serif;
  font-size: 1.18rem;
  font-weight: 900;
  list-style: none;
}

.armory-workbench > details > summary::-webkit-details-marker { display: none; }
.armory-workbench > details > summary::before { content: "+"; font-family: Georgia, serif; font-size: 1.35rem; }
.armory-workbench > details[open] > summary::before { content: "−"; }
.armory-workbench > details > summary small { margin-left: auto; color: var(--muted); font-family: inherit; font-size: 0.86rem; }

.armory-workbench-body {
  display: grid;
  grid-template-columns: minmax(540px, 1.35fr) minmax(480px, 1.3fr);
  gap: 14px;
  align-items: start;
  margin-top: 0;
}

.armory-mode-toolbar {
  display: flex;
  grid-column: 1 / -1;
  gap: 9px;
  align-items: center;
  padding: 10px 12px;
  border: 1px solid rgba(97, 69, 37, 0.24);
  background: rgba(255, 250, 232, 0.68);
  box-shadow: 0 4px 12px rgba(76, 52, 29, 0.08);
}

.armory-mode-toolbar > div { display: grid; gap: 2px; margin-right: auto; }
.armory-mode-toolbar small { color: var(--muted); font-size: 0.76rem; }

.armory-workbench.focus-mode .armory-manual-builder,
.armory-workbench.focus-mode .armory-editor {
  display: none;
}

.armory-workbench.focus-mode .armory-loadout,
.armory-workbench.focus-mode .armory-summary {
  grid-column: auto;
}

.armory-workbench.focus-mode .armory-workbench-body {
  grid-template-columns: minmax(430px, 0.78fr) minmax(650px, 1.5fr);
}

.armory-workbench.focus-mode .armory-doll {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.armory-workbench.focus-mode .armory-figure {
  display: none;
}

.armory-workbench.appearance-hidden:not(.focus-mode) .armory-workbench-body {
  grid-template-columns: minmax(460px, 0.84fr) minmax(650px, 1.48fr);
}

.armory-workbench > details:not([open]) > .armory-workbench-body { display: none; }

.armory-manual-builder {
  grid-column: 1 / -1;
  padding: 0;
}

.armory-manual-builder > details > summary {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 11px 14px;
  color: var(--accent);
  cursor: pointer;
  font-family: "Marcellus SC", serif;
  font-size: 1.18rem;
  font-weight: 900;
  list-style: none;
}

.armory-manual-builder > details > summary::-webkit-details-marker { display: none; }
.armory-manual-builder > details > summary::before { content: "+"; font-family: Georgia, serif; font-size: 1.35rem; }
.armory-manual-builder > details[open] > summary::before { content: "−"; }
.armory-manual-builder > details > summary small {
  margin-left: auto;
  color: var(--muted);
  font-family: inherit;
  font-size: 0.86rem;
  text-align: right;
}

.armory-manual-content {
  display: grid;
  gap: 10px;
  padding: 0 12px 12px;
}

.armory-manual-requirements {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.armory-manual-requirements strong,
.armory-manual-requirements small { margin: 0; }

.armory-manual-requirements small {
  display: block;
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.armory-manual-pool {
  display: grid;
  grid-template-columns: auto auto;
  align-items: baseline;
  min-width: 0;
  padding: 7px 10px;
  border: 1px solid rgba(63, 108, 56, 0.34);
  background: rgba(221, 235, 202, 0.62);
  color: #35613d;
}

.armory-manual-pool span { font-size: 0.82rem; font-weight: 900; text-transform: uppercase; }
.armory-manual-pool strong { margin-left: auto; font-size: 1.28rem; }
.armory-manual-pool small { grid-column: 1 / -1; color: var(--muted); font-size: 0.75rem; }
.armory-manual-pool.negative { border-color: rgba(163, 68, 54, 0.46); background: rgba(243, 210, 198, 0.55); color: #a34436; }

.armory-manual-toolbar {
  display: grid;
  grid-template-columns: auto minmax(240px, 0.8fr) repeat(2, minmax(145px, 0.42fr));
  gap: 8px;
  align-items: end;
  padding: 9px;
  border: 1px solid rgba(97, 69, 37, 0.18);
  background: rgba(255, 250, 232, 0.48);
}

.armory-manual-mode {
  align-self: center;
  padding: 6px 9px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
  white-space: nowrap;
}

.armory-manual-controls {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 7px;
}

.armory-manual-controls label,
.armory-manual-glory {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 0.92rem;
  font-weight: 900;
}

.armory-manual-glory {
  grid-template-rows: auto 1fr;
}

.armory-manual-glory strong {
  display: flex;
  align-items: center;
  min-height: 37px;
  padding: 6px 8px;
  border: 1px solid rgba(97, 69, 37, 0.22);
  background: rgba(232, 217, 181, 0.56);
  color: var(--accent);
  font-size: 0.95rem;
}

.armory-manual-controls input,
.armory-manual-controls select {
  width: 100%;
  min-height: 37px;
  padding: 6px 8px;
  border: 1px solid rgba(97, 69, 37, 0.3);
  background: rgba(255, 250, 232, 0.82);
  color: var(--ink);
  font: inherit;
  font-size: 0.95rem;
  font-weight: 800;
}

.armory-manual-stats {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 6px;
}

.armory-manual-stat {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(97, 69, 37, 0.23);
  background: rgba(255, 252, 240, 0.54);
}

.armory-manual-stat.unmet {
  border-color: rgba(163, 68, 54, 0.58);
  background: rgba(249, 226, 211, 0.72);
  box-shadow: inset 3px 0 #a34436;
}

.armory-manual-stat > span { min-width: 0; }
.armory-manual-stat > span strong { display: block; color: var(--accent); font-size: 0.94rem; }
.armory-manual-stat > span small { display: block; margin-top: 3px; color: var(--muted); font-size: 0.8rem; line-height: 1.3; }
.armory-manual-stat.unmet > span small { color: #923b31; font-weight: 800; }

.armory-manual-stat > div {
  display: grid;
  grid-template-columns: 32px minmax(42px, 1fr) 32px minmax(54px, auto);
  align-items: center;
  gap: 5px;
}

.armory-manual-total {
  display: grid;
  place-items: center;
  min-height: 33px;
  padding: 4px 9px;
  border: 1px solid rgba(63, 108, 56, 0.38);
  background: rgba(221, 235, 202, 0.72);
  color: #35613d;
  font-size: 1rem;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.armory-manual-stat button {
  min-height: 33px;
  padding: 0;
  border: 1px solid rgba(97, 69, 37, 0.3);
  background: rgba(255, 247, 219, 0.9);
  color: var(--accent);
  font: inherit;
  font-size: 1.12rem;
  font-weight: 900;
  cursor: pointer;
}

.armory-manual-stat button:disabled { opacity: 0.35; cursor: default; }
.armory-manual-stat input[type="number"] {
  width: 100%;
  min-width: 0;
  min-height: 33px;
  padding: 4px 3px;
  border: 1px solid rgba(97, 69, 37, 0.28);
  background: rgba(255, 252, 239, 0.92);
  color: var(--ink);
  font: inherit;
  font-size: 1rem;
  font-weight: 900;
  text-align: center;
}

.armory-manual-mastery {
  display: grid;
  gap: 7px;
}

.armory-allocation-section > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 2px;
}

.armory-allocation-section > header h3 {
  margin: 0;
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 1rem;
}

.armory-allocation-section > header small {
  color: var(--muted);
  font-size: 0.76rem;
  text-align: right;
}

.armory-manual-mastery-stats {
  grid-template-columns: repeat(6, minmax(140px, 1fr));
}

.armory-manual-requirements {
  justify-content: flex-start;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid rgba(97, 69, 37, 0.18);
  background: rgba(255, 250, 232, 0.5);
}

.armory-manual-requirements strong { color: var(--accent); font-size: 0.9rem; white-space: nowrap; }
.armory-manual-requirements.unmet { border-color: rgba(163, 68, 54, 0.42); background: rgba(249, 226, 211, 0.52); }
.armory-manual-requirements.met strong { color: #35613d; }

.armory-requirement-line {
  display: block;
  color: #476a3e !important;
  font-size: 0.72rem !important;
  font-weight: 800;
  line-height: 1.25;
}

.armory-requirement-line.unmet { color: #a34436 !important; }
.armory-requirement-line em { font-style: normal; }
.armory-requirement-line .missing { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
.armory-slot > .armory-requirement-line {
  grid-column: 1 / -1;
  margin-top: 3px;
  padding: 4px 6px;
  border: 1px solid rgba(163, 68, 54, 0.26);
  background: rgba(249, 226, 211, 0.62);
  font-size: 0.76rem !important;
  text-align: left;
}
.armory-slot > .armory-requirement-line .missing {
  text-decoration: none;
}
.armory-slot.requirement-unmet,
.armory-catalog-card.requirement-unmet { border-color: rgba(163, 68, 54, 0.68); box-shadow: inset 4px 0 #a34436; }

.armory-loadout h3,
.armory-summary h3,
.armory-editor h3 {
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 1rem;
}

.armory-loadout-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.armory-loadout-head h3 {
  margin: 0;
}

.armory-doll {
  display: grid;
  grid-template-columns: minmax(175px, 1.08fr) minmax(190px, 0.92fr) minmax(175px, 1.08fr);
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}

.armory-loadout .armory-doll.armory-figure-hidden {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.armory-doll.armory-figure-hidden .armory-figure {
  display: none;
}

.armory-slot-column {
  display: grid;
  gap: 7px;
}

.armory-slot-wrap {
  display: grid;
  min-width: 0;
}

.armory-quick-item-controls {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3px;
  padding: 4px 5px 5px;
  border: 1px solid rgba(97, 69, 37, 0.24);
  border-top: 0;
  background: rgba(229, 209, 164, 0.48);
}

.armory-quick-item-controls button {
  display: grid;
  min-width: 0;
  min-height: 34px;
  padding: 2px 3px;
  place-items: center;
  border: 1px solid rgba(97, 69, 37, 0.25);
  background: rgba(255, 248, 225, 0.88);
  color: var(--accent);
  cursor: pointer;
  font: inherit;
  font-size: 1.12rem;
  font-weight: 900;
  line-height: 1;
}

.armory-quick-item-controls button small {
  color: var(--muted);
  font-size: 0.68rem;
  font-weight: 800;
  line-height: 1;
}

.armory-quick-item-controls button.variant { font-size: 0.86rem; }
.armory-quick-item-controls button:hover:not(:disabled) { background: #fff3cd; border-color: var(--accent); }
.armory-quick-item-controls button:disabled { opacity: 0.25; cursor: default; }

.armory-active-buffs {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid rgba(97, 69, 37, 0.25);
  background: rgba(255, 248, 224, 0.58);
  box-shadow: inset 0 1px rgba(255, 255, 255, 0.58), 0 5px 14px rgba(79, 53, 29, 0.08);
}

.armory-buffs-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.armory-buffs-heading h4,
.armory-buffs-heading p { margin: 0; }
.armory-buffs-heading h4 { color: var(--accent); font-family: "Marcellus SC", serif; font-size: 1.02rem; }
.armory-buffs-heading > span {
  padding: 4px 8px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  background: rgba(255, 250, 232, 0.72);
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

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

.armory-buff-card {
  position: relative;
  display: grid;
  grid-template-columns: 50px minmax(0, 1fr);
  gap: 9px;
  min-width: 0;
  min-height: 76px;
  padding: 8px 9px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  border-left: 4px solid var(--armory-quality, rgba(97, 69, 37, 0.3));
  background: rgba(255, 252, 238, 0.74);
}

.armory-buff-icon {
  display: grid;
  width: 50px;
  height: 56px;
  place-items: center;
  border: 1px solid var(--armory-quality, rgba(97, 69, 37, 0.25));
  background: var(--armory-quality, rgba(231, 215, 177, 0.5));
  color: var(--accent);
  font-size: 1.3rem;
}

.armory-buff-icon img { width: 100%; height: 100%; object-fit: contain; }
.armory-buff-body { display: grid; align-content: start; min-width: 0; }
.armory-buff-body > span { color: var(--muted); font-size: 0.7rem; font-weight: 800; text-transform: uppercase; }
.armory-buff-body strong { overflow: hidden; color: var(--ink); font-size: 0.9rem; text-overflow: ellipsis; white-space: nowrap; }
.armory-buff-body small { color: var(--muted); font-size: 0.72rem; line-height: 1.25; }
.armory-buff-card time {
  position: absolute;
  right: 7px;
  bottom: 5px;
  color: #3f6c38;
  font-size: 0.68rem;
  font-weight: 900;
}
.armory-buff-remove {
  position: absolute;
  top: 4px;
  right: 5px;
  display: grid;
  width: 23px;
  height: 23px;
  padding: 0 0 2px;
  place-items: center;
  border: 1px solid rgba(126, 55, 42, 0.28);
  border-radius: 50%;
  background: rgba(255, 248, 229, 0.9);
  color: #8a3029;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.armory-buff-remove:hover { background: #8a3029; color: #fff8e5; }
.armory-buffs-empty { grid-column: 1 / -1; margin: 0; padding: 13px; color: var(--muted); text-align: center; }

.armory-buff-picker {
  margin-top: 11px;
  padding: 0 10px 10px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  background: rgba(255, 248, 224, 0.48);
}

.armory-buff-picker > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 2px 2px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 900;
  list-style: none;
}
.armory-buff-picker > summary::-webkit-details-marker { display: none; }
.armory-buff-picker > summary::before { content: "+"; width: 18px; font-size: 1.2rem; }
.armory-buff-picker[open] > summary::before { content: "−"; }
.armory-buff-picker > summary small { margin-left: auto; color: var(--muted); font-size: 0.72rem; }
.armory-buff-picker-body { padding-top: 10px; }

.armory-buff-presets {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
  margin-bottom: 10px;
  padding: 9px;
  border: 1px solid rgba(97, 69, 37, 0.18);
  background: rgba(255, 252, 238, 0.62);
}
.armory-buff-presets > div {
  display: grid;
  gap: 2px;
  min-width: 0;
}
.armory-buff-presets strong {
  color: var(--accent);
  font-size: 0.9rem;
}
.armory-buff-presets small {
  color: var(--muted);
  font-size: 0.75rem;
  line-height: 1.25;
}
.armory-buff-presets button {
  flex: 0 0 auto;
  min-height: 32px;
  padding: 5px 11px;
  border: 1px solid rgba(120, 75, 43, 0.28);
  background: rgba(247, 233, 197, 0.75);
  color: var(--accent);
  cursor: pointer;
  font-weight: 900;
}
.armory-buff-presets button:hover { border-color: var(--accent); background: #fff8df; }

.armory-buff-filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(120px, 0.32fr);
  gap: 8px;
  margin-bottom: 9px;
}
.armory-buff-filters label { display: grid; gap: 4px; color: var(--muted); font-size: 0.73rem; font-weight: 800; }
.armory-buff-filters input,
.armory-buff-filters select { min-height: 38px; }

.armory-buff-catalog {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
}

.armory-buff-option {
  display: grid;
  grid-template-columns: 45px minmax(0, 1fr);
  gap: 8px;
  min-width: 0;
  padding: 7px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  border-left: 4px solid var(--armory-quality, rgba(97, 69, 37, 0.3));
  background: rgba(255, 252, 238, 0.7);
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}
.armory-buff-option:hover,
.armory-buff-option.selected { border-color: var(--accent); background: rgba(255, 245, 211, 0.95); }
.armory-buff-option .armory-buff-icon { width: 45px; height: 49px; }
.armory-buff-option > span:last-child { display: grid; min-width: 0; align-content: start; }
.armory-buff-option small { color: var(--muted); font-size: 0.65rem; text-transform: uppercase; }
.armory-buff-option strong { overflow: hidden; font-size: 0.8rem; text-overflow: ellipsis; white-space: nowrap; }
.armory-buff-option em { color: var(--muted); font-size: 0.68rem; font-style: normal; line-height: 1.2; }
.armory-buff-more { grid-column: 1 / -1; margin: 3px 0 0; color: var(--muted); font-size: 0.72rem; text-align: center; }
.armory-editor .armory-buff-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.armory-figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) max-content;
  justify-items: center;
  min-height: 540px;
  height: 100%;
  overflow: hidden;
  border: 1px solid rgba(123, 86, 45, 0.28);
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 252, 230, 0.96) 0 20%, rgba(231, 210, 163, 0.62) 58%, rgba(184, 150, 104, 0.28) 100%),
    linear-gradient(180deg, #f5e8c5, #d8bd87);
  box-shadow: inset 0 0 28px rgba(109, 74, 39, 0.14), 0 7px 18px rgba(82, 57, 33, 0.09);
  position: relative;
  isolation: isolate;
}

.armory-figure-stage {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 0;
  overflow: hidden;
  contain: paint;
}

.armory-figure-stage img {
  position: absolute;
  left: var(--armory-image-x, 50%);
  top: var(--armory-image-y, 50%);
  width: auto;
  height: var(--armory-image-height, 96%);
  max-width: none;
  max-height: none;
  padding: 0;
  object-fit: contain;
  object-position: center;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 7px 11px rgba(0, 0, 0, 0.52));
  -webkit-mask-image: none;
  mask-image: none;
}

.armory-figure-canvas {
  display: block;
  width: 96%;
  height: 96%;
  object-fit: contain;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.48));
}

.armory-figure-stage img.armory-figure-fallback {
  width: auto;
  height: var(--armory-image-height, 96%);
  transform: translate(-50%, -50%);
}

.armory-figure-nav {
  position: absolute;
  z-index: 4;
  top: 48%;
  display: grid;
  width: 46px;
  height: 82px;
  padding: 0 0 5px;
  place-items: center;
  border: 1px solid rgba(101, 65, 35, 0.34);
  background: rgba(255, 247, 220, 0.82);
  color: var(--accent);
  box-shadow: 0 5px 16px rgba(70, 45, 25, 0.18);
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 3rem;
  line-height: 1;
  transform: translateY(-50%);
  transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.16s ease;
}

.armory-figure-nav:hover,
.armory-figure-nav:focus-visible {
  background: #fff3cf;
  box-shadow: 0 6px 18px rgba(70, 45, 25, 0.28);
  transform: translateY(-50%) scale(1.05);
}

.armory-figure-nav-prev { left: 8px; }
.armory-figure-nav-next { right: 8px; }

.armory-appearance-info {
  position: relative;
  z-index: 2;
  display: grid;
  gap: 4px;
  width: 100%;
  padding: 9px 10px 11px;
  border-top: 1px solid rgba(111, 76, 38, 0.2);
  background: #fff4d6;
  box-shadow: 0 -5px 12px rgba(82, 57, 33, 0.08);
}

.armory-appearance-info strong,
.armory-appearance-info small {
  color: var(--ink);
  text-align: center;
  text-shadow: none;
}

.armory-appearance-info small { font-size: 0.78rem; }

.armory-figure.empty .armory-figure-stage {
  background: radial-gradient(circle at 50% 45%, rgba(255, 250, 226, 0.58), rgba(217, 190, 139, 0.14) 72%);
}

.armory-slot {
  display: grid;
  grid-template-columns: 56px 1fr;
  column-gap: 9px;
  align-items: center;
  width: 100%;
  min-height: 80px;
  padding: 7px 9px;
  border: 1px solid rgba(97, 69, 37, 0.24);
  border-left: 5px solid rgba(97, 69, 37, 0.24);
  background: rgba(255, 250, 232, 0.7);
  color: var(--ink);
  text-align: left;
}

.armory-slot > img {
  grid-row: 1 / span 2;
  width: 55px;
  height: 61px;
  object-fit: contain;
  border: 1px solid var(--armory-quality, rgba(97, 69, 37, 0.28));
  background: var(--armory-quality, rgba(255, 248, 226, 0.72));
  box-shadow: inset 0 0 12px rgba(255, 255, 255, 0.12);
}

.armory-slot-placeholder {
  display: grid;
  grid-row: 1 / span 2;
  width: 55px;
  height: 61px;
  place-items: center;
  border: 1px dashed rgba(121, 80, 45, 0.38);
  background: rgba(255, 250, 231, 0.55);
  color: rgba(121, 80, 45, 0.62);
  font-size: 1.1rem;
  font-style: normal;
  font-weight: 500;
}

.armory-slot strong {
  min-width: 0;
  font-size: 0.96rem;
  line-height: 1.12;
  overflow-wrap: anywhere;
}

.armory-slot.empty {
  border-left-color: rgba(121, 80, 45, 0.22);
  background: rgba(255, 250, 232, 0.44);
}

.armory-slot.empty strong {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

.armory-slot span,
.armory-catalog-card small,
.armory-custom-field small {
  color: var(--muted);
  font-size: 0.82rem;
}

.armory-slot-label {
  display: flex;
  gap: 7px;
  align-items: center;
  justify-content: space-between;
  min-width: 0;
}

.armory-slot-tier {
  flex: 0 0 auto;
  padding: 2px 5px;
  border: 1px solid rgba(110, 72, 39, 0.22);
  background: rgba(255, 247, 219, 0.78);
  color: var(--accent);
  font-size: 0.66rem;
  font-style: normal;
  font-weight: 900;
  line-height: 1;
  white-space: nowrap;
}

.armory-slot.active {
  border-color: var(--accent);
  box-shadow: inset 3px 0 0 var(--accent);
}

.armory-slot.filled strong {
  color: var(--ink);
}

.armory-rune-icons {
  grid-column: 1 / -1;
  display: flex;
  gap: 3px;
  min-height: 23px;
  margin-top: 2px;
}

.armory-rune-icons i {
  display: grid;
  width: 23px;
  height: 23px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--rune-quality, rgba(97, 69, 37, 0.45));
  background: color-mix(in srgb, var(--rune-quality, #8a7355) 21%, #fff7df);
  color: var(--rune-quality, var(--accent));
  font-size: 0.78rem;
  font-style: normal;
}

.armory-rune-icons img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.armory-stat-list {
  display: grid;
  gap: 0;
  margin-top: 12px;
}

.armory-stat-groups {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 12px;
}

.armory-build-overview {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  margin-top: 12px;
}

.armory-build-overview span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 44px;
  padding: 9px 13px;
  border: 1px solid rgba(97, 69, 37, 0.18);
  background: rgba(255, 250, 232, 0.52);
  color: var(--muted);
  font-size: 1rem;
  box-shadow: 0 3px 9px rgba(79, 53, 29, 0.07);
}

.armory-summary > h3 { font-size: 1.42rem; }

.armory-build-overview small { color: var(--muted); font: inherit; }
.armory-build-overview b { color: var(--accent); font-size: 1.05rem; }
.armory-build-overview .armory-overview-player {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 0;
}
.armory-build-overview .armory-overview-player small { font-size: 0.8rem; }
.armory-build-overview .armory-overview-mastery {
  border-color: rgba(73, 111, 58, 0.38);
  background: rgba(221, 235, 202, 0.62);
  box-shadow: 0 4px 12px rgba(63, 108, 56, 0.12);
}
.armory-build-overview .armory-overview-mastery b { color: var(--accent); }
.armory-build-overview .armory-overview-mastery strong {
  min-width: 30px;
  color: #35613d;
  font-size: 1.18rem;
  text-align: right;
}
.armory-build-overview .armory-overview-damage {
  border-color: rgba(73, 111, 58, 0.38);
  background: rgba(221, 235, 202, 0.62);
  box-shadow: 0 4px 12px rgba(63, 108, 56, 0.12);
}
.armory-build-overview .armory-overview-damage b {
  color: #3f6c38;
  font-size: 1.18rem;
}
.armory-build-overview .armory-change-legend {
  margin-left: 0;
  white-space: nowrap;
}
.armory-build-overview .armory-change-legend b { color: #3f6c38; }
.armory-build-overview .armory-change-legend em { color: #a34436; font-style: normal; font-weight: 900; }

.armory-set-bonus {
  display: grid;
  gap: 10px;
  margin-top: 12px;
  padding: 12px 14px;
  border: 1px solid rgba(97, 69, 37, 0.26);
  border-left: 5px solid rgba(97, 69, 37, 0.34);
  background: linear-gradient(135deg, rgba(255, 250, 232, 0.82), rgba(226, 203, 148, 0.26));
  box-shadow: 0 4px 12px rgba(76, 52, 29, 0.07);
}

.armory-set-bonus.active {
  border-left-color: #527b45;
  background: linear-gradient(135deg, rgba(245, 251, 224, 0.88), rgba(199, 220, 158, 0.3));
}

.armory-set-bonus > header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.armory-set-bonus > header > div {
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.armory-set-bonus h4,
.armory-set-bonus p {
  margin: 0;
}

.armory-set-bonus h4 {
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 1.08rem;
}

.armory-set-bonus > header small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.armory-set-bonus > header > span {
  display: grid;
  justify-items: end;
  text-align: right;
}

.armory-set-bonus > header > span strong {
  color: var(--ink);
  font-size: 1rem;
}

.armory-set-bonus > p {
  color: var(--muted);
  font-size: 0.92rem;
  line-height: 1.4;
}

.armory-set-bonus-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 7px;
}

.armory-set-bonus-stats > span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 8px 10px;
  border: 1px solid rgba(78, 111, 62, 0.22);
  background: rgba(255, 253, 238, 0.72);
}

.armory-set-bonus-stats small {
  color: var(--ink);
  font-size: 0.88rem;
  font-weight: 700;
}

.armory-set-bonus-stats strong {
  flex: 0 0 auto;
  color: #3f6f38;
  font-size: 1rem;
}

.armory-key-dashboard {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-items: stretch;
  gap: 14px;
  margin-top: 16px;
}

.armory-key-card {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  border: 1px solid rgba(91, 57, 31, 0.3);
  background: rgba(255, 250, 231, 0.7);
  box-shadow: 0 7px 18px rgba(79, 53, 29, 0.11), inset 0 1px rgba(255, 255, 255, 0.58);
}

.armory-key-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 58px;
  padding: 10px 15px;
  border-bottom: 1px solid rgba(91, 57, 31, 0.2);
  background: linear-gradient(110deg, rgba(121, 72, 42, 0.15), rgba(255, 248, 224, 0.38));
}

.armory-key-card-head p {
  margin: 0 0 3px;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.055em;
  text-transform: uppercase;
}

.armory-key-card-head h4 {
  margin: 0;
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 1.26rem;
  line-height: 1.25;
}

.armory-key-card-head h4 small {
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.035em;
  text-transform: uppercase;
}

.armory-key-card-head > strong,
.armory-key-hero-value > strong {
  color: #35613d;
  font-family: "Marcellus SC", serif;
  font-size: clamp(1.5rem, 2.4vw, 2.15rem);
  white-space: nowrap;
}

.armory-key-hero-value {
  display: grid;
  gap: 2px;
  justify-items: end;
  text-align: right;
}

.armory-key-hero-value > small {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.armory-key-stat-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  align-content: start;
  flex: 1;
  padding: 5px 12px 10px;
}

.armory-key-stat-list > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  min-height: 62px;
  padding: 10px 7px;
  border-bottom: 1px solid rgba(97, 69, 37, 0.15);
}

.armory-key-stat-list > div:nth-child(odd) {
  padding-right: 14px;
  border-right: 1px solid rgba(97, 69, 37, 0.12);
}

.armory-key-stat-list > div:nth-child(even) { padding-left: 14px; }

.armory-key-subhead {
  grid-column: 1 / -1;
  margin: 8px 7px 0;
  padding: 10px 0 7px;
  border-bottom: 1px solid rgba(97, 69, 37, 0.2);
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 1rem;
  letter-spacing: 0.02em;
}

.armory-key-stat-list .armory-stat-name { font-size: 0.96rem; }
.armory-key-stat-list .armory-stat-name > small { font-size: 0.72rem; }
.armory-key-stat-list > div > strong {
  margin-left: auto;
  color: var(--accent);
  font-size: 1.08rem;
  white-space: nowrap;
}
.armory-key-stat-list strong small { display: block; margin-top: 2px; font-size: 0.78rem; }
.armory-key-stat-list small.up { color: #3f6c38; }
.armory-key-stat-list small.down { color: #a34436; }

.armory-key-card-damage .armory-key-stat-list {
  grid-template-columns: 1fr;
  grid-auto-rows: 1fr;
}
.armory-key-card-damage .armory-key-stat-list > div {
  padding-right: 7px;
  padding-left: 7px;
  border-right: 0;
}

.armory-damage-formula {
  margin: 0 12px 12px;
  border: 1px solid rgba(91, 57, 31, 0.2);
  background: rgba(255, 252, 239, 0.65);
}
.armory-damage-formula > summary {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 8px 11px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 900;
}
.armory-damage-formula > summary small { margin-left: auto; color: var(--muted); font-size: 0.78rem; }
.armory-damage-formula > div { display: grid; gap: 9px; padding: 0 11px 11px; }
.armory-damage-formula section { padding-top: 9px; border-top: 1px solid rgba(91, 57, 31, 0.14); }
.armory-damage-formula h5,
.armory-damage-formula p { margin: 0; }
.armory-damage-formula h5 { margin-bottom: 5px; color: var(--accent); font-size: 0.9rem; }
.armory-damage-formula p { color: var(--muted); font-size: 0.86rem; line-height: 1.45; }
.armory-damage-formula p strong { color: #35613d; }
.armory-damage-total { padding-top: 8px; border-top: 1px solid rgba(91, 57, 31, 0.2); }

.armory-key-card-defense { grid-column: 1 / -1; }

.armory-armor-zones {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 7px;
  padding: 12px 12px 5px;
}

.armory-armor-zones span {
  display: grid;
  min-width: 0;
  place-items: center;
  gap: 2px;
  padding: 9px 5px;
  border: 1px solid rgba(91, 57, 31, 0.18);
  background: rgba(135, 105, 70, 0.08);
}

.armory-armor-zones small { color: var(--muted); font-size: 0.75rem; font-weight: 800; }
.armory-armor-zones b { color: var(--accent); font-size: 1.18rem; }
.armory-key-card-defense h5 {
  margin: 9px 18px 0;
  color: var(--muted);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.armory-key-empty { margin: 10px 7px; color: var(--muted); }

.armory-stat-details {
  margin-top: 16px;
  border: 1px solid rgba(91, 57, 31, 0.25);
  background: rgba(255, 248, 224, 0.45);
}

.armory-stat-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 15px;
  color: var(--accent);
  cursor: pointer;
  font-size: 1rem;
  font-weight: 900;
}

.armory-stat-details > summary small { color: var(--muted); font-size: 0.78rem; font-weight: 700; }
.armory-stat-details[open] > summary { border-bottom: 1px solid rgba(91, 57, 31, 0.2); }
.armory-stat-details .armory-stat-groups { margin: 12px; }

.armory-stat-group {
  min-width: 0;
  padding: 8px;
  border: 1px solid rgba(105, 72, 38, 0.22);
  background: rgba(255, 250, 231, 0.48);
  box-shadow: 0 5px 13px rgba(79, 53, 29, 0.1), inset 0 1px rgba(255, 255, 255, 0.46);
}

.armory-stat-group h4 {
  margin: 0;
  padding: 9px 11px;
  background: rgba(129, 79, 50, 0.12);
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 0.95rem;
  letter-spacing: 0.015em;
}

.armory-stat-list > div {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  min-height: 52px;
  padding: 10px 5px;
  border-bottom: 1px solid rgba(97, 69, 37, 0.16);
}

.armory-stat-name {
  min-width: 0;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.25;
}

.armory-info-button {
  display: inline-grid;
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  margin: 0 0 0 2px;
  padding: 0;
  place-items: center;
  align-self: center;
  border: 1px solid rgba(105, 65, 39, 0.38);
  border-radius: 50%;
  background: rgba(255, 249, 229, 0.74);
  color: var(--accent);
  cursor: pointer;
  font-family: Georgia, serif;
  font-size: 0.82rem;
  font-style: italic;
  font-weight: 900;
  line-height: 1;
}
.armory-info-button:hover,
.armory-info-button:focus-visible {
  border-color: var(--accent);
  background: #fff8dc;
  box-shadow: 0 0 0 3px rgba(123, 50, 39, 0.1);
  outline: 0;
}
.armory-stat-source-overlay {
  position: fixed;
  inset: 0;
  z-index: 10020;
  background: rgba(37, 24, 16, 0.12);
}
.armory-stat-source-popover {
  position: fixed;
  z-index: 1;
  width: min(540px, calc(100vw - 24px));
  max-height: min(520px, calc(100vh - 24px));
  overflow: auto;
  border: 1px solid rgba(82, 49, 28, 0.58);
  background: #fff7dd;
  color: var(--ink);
  box-shadow: 0 18px 45px rgba(38, 24, 15, 0.34);
}
.armory-stat-source-popover > header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 10px;
  align-items: center;
  padding: 11px 12px;
  border-bottom: 1px solid rgba(91, 57, 31, 0.22);
  background: #ead8ad;
}
.armory-stat-source-popover > header div { display: grid; }
.armory-stat-source-popover > header small { color: var(--muted); font-size: 0.7rem; font-weight: 900; text-transform: uppercase; }
.armory-stat-source-popover > header strong { font-size: 1.05rem; }
.armory-stat-source-popover > header > b { color: #35613d; font-size: 1.15rem; }
.armory-stat-source-popover > header button {
  width: 30px;
  height: 30px;
  border: 1px solid rgba(91, 57, 31, 0.25);
  background: rgba(255,255,255,.5);
  cursor: pointer;
  font-size: 1.25rem;
}
.armory-stat-source-popover > div { display: grid; gap: 6px; padding: 8px; }
.armory-stat-source-entry {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  min-height: 54px;
  padding: 6px 8px;
  border: 1px solid rgba(91, 57, 31, 0.18);
  background: rgba(255,255,255,.42);
  color: inherit;
  text-align: left;
}
.armory-stat-source-entry[data-armory-source-slot]:not([data-armory-source-slot=""]) { cursor: pointer; }
.armory-stat-source-entry:hover { border-color: var(--accent); }
.armory-stat-source-entry img,
.armory-stat-source-entry > i { width: 42px; height: 42px; object-fit: contain; }
.armory-stat-source-entry > i { display: grid; place-items: center; color: var(--accent); }
.armory-stat-source-entry > .armory-source-icon {
  position: relative;
  border: 1px solid var(--source-icon-border, rgba(102, 66, 119, 0.62));
  background: var(--source-icon-background, linear-gradient(145deg, #71507e, #3d294c));
  color: var(--source-icon-color, #ffe6a0);
  box-shadow:
    inset 0 0 0 3px rgba(255, 244, 202, 0.13),
    0 3px 8px var(--source-icon-shadow, rgba(60, 35, 70, 0.24));
  font-size: 1.45rem;
  font-style: normal;
  font-weight: 800;
  text-shadow: 0 0 7px var(--source-icon-glow, rgba(255, 223, 124, 0.9));
}
.armory-source-icon-enchant {
  --source-icon-background:
    radial-gradient(circle at 50% 45%, rgba(255, 245, 177, 0.94) 0 9%, transparent 10%),
    linear-gradient(145deg, #71507e, #3d294c);
}
.armory-source-icon-base {
  --source-icon-border: rgba(128, 68, 49, 0.66);
  --source-icon-background: linear-gradient(145deg, #9a5b45, #5f3029);
  --source-icon-color: #ffe4ae;
  --source-icon-shadow: rgba(83, 39, 30, 0.24);
}
.armory-source-icon-profile {
  --source-icon-border: rgba(60, 91, 117, 0.68);
  --source-icon-background: linear-gradient(145deg, #6388a0, #344f65);
  --source-icon-color: #e9f6ff;
  --source-icon-shadow: rgba(36, 65, 84, 0.25);
  --source-icon-glow: rgba(186, 229, 255, 0.7);
  font-size: 1.65rem !important;
}
.armory-source-icon-mastery {
  --source-icon-border: rgba(131, 99, 37, 0.7);
  --source-icon-background: linear-gradient(145deg, #b18a42, #655020);
  --source-icon-color: #fff0b4;
  --source-icon-shadow: rgba(88, 65, 24, 0.26);
}
.armory-source-icon-set {
  --source-icon-border: rgba(55, 103, 70, 0.7);
  --source-icon-background: linear-gradient(145deg, #628e69, #31553b);
  --source-icon-color: #e5ffd9;
  --source-icon-shadow: rgba(35, 76, 46, 0.25);
  --source-icon-glow: rgba(199, 255, 176, 0.72);
}
.armory-source-icon-calculation {
  --source-icon-border: rgba(100, 89, 73, 0.58);
  --source-icon-background: linear-gradient(145deg, #8e806d, #554a3e);
  --source-icon-color: #fff5d8;
  --source-icon-shadow: rgba(62, 54, 44, 0.23);
}
.armory-stat-source-entry span { display: grid; min-width: 0; }
.armory-stat-source-entry span small { color: var(--muted); font-size: .68rem; text-transform: uppercase; }
.armory-stat-source-entry span strong {
  overflow-wrap: anywhere;
  line-height: 1.18;
}
.armory-stat-source-entry > b { color: #35613d; white-space: nowrap; }
.armory-stat-source-popover > footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 12px;
  border-top: 1px solid rgba(91, 57, 31, 0.22);
  background: #ead8ad;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 900;
}
.armory-stat-source-popover > footer b { color: #35613d; font-size: 0.9rem; white-space: nowrap; }
.armory-stat-source-popover > footer.warning,
.armory-stat-source-popover > footer.warning b { color: #9a3f32; }
.armory-source-highlight { animation: armory-source-highlight 1.1s ease-in-out 2; outline: 4px solid #d9a928; outline-offset: 2px; }
@keyframes armory-source-highlight { 50% { filter: brightness(1.18); transform: scale(1.025); } }

.armory-calculation-warning {
  margin: 10px 0;
  border: 1px solid rgba(111, 89, 44, 0.28);
  background: rgba(255, 248, 218, 0.72);
}
.armory-calculation-warning.warning { border-color: rgba(156, 74, 45, 0.46); background: rgba(255, 235, 211, 0.72); }
.armory-calculation-warning > summary { padding: 9px 12px; color: var(--accent); cursor: pointer; font-weight: 900; }
.armory-calculation-warning > summary small { margin-left: 6px; color: var(--muted); }
.armory-calculation-warning > div { padding: 0 12px 10px; }
.armory-calculation-warning p { margin: 6px 0; }
.armory-calculation-warning p small { display: block; color: var(--muted); }


.armory-stat-name > small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
  line-height: 1.35;
}

.armory-stat-list strong {
  margin-left: auto;
  color: var(--accent);
  font-size: 1.05rem;
  line-height: 1.25;
  white-space: nowrap;
}

.armory-stat-list strong small {
  display: block;
  margin-top: 2px;
  font-family: inherit;
  font-size: 0.8rem;
}

.armory-stat-group-wide {
  grid-column: 1 / -1;
}

.armory-stat-group-wide .armory-stat-list {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0 18px;
}

.armory-stat-group-wide .armory-stat-list > div {
  min-height: 48px;
}

.armory-stat-list small.up { color: #3f6c38; }
.armory-stat-list small.down { color: #a34436; }

.armory-stat-list p,
.armory-catalog > p {
  color: var(--muted);
  font-size: 0.86rem;
}

.armory-editor {
  display: grid;
  gap: 14px;
}

.armory-picker-section {
  min-width: 0;
}

.armory-picker-section > summary {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--accent);
  font-weight: 900;
  list-style: none;
}

.armory-picker-section > summary::-webkit-details-marker { display: none; }
.armory-picker-section > summary::before { content: "+"; font-size: 1.2rem; line-height: 1; }
.armory-picker-section[open] > summary::before { content: "−"; }
.armory-picker-section > summary small { margin-left: auto; color: var(--muted); font-size: 0.75rem; }

.armory-picker-body {
  display: grid;
  gap: 14px;
  margin-top: 12px;
}

.armory-filter-bar {
  display: grid;
  grid-template-columns: repeat(4, minmax(90px, 1fr));
  gap: 8px;
  align-items: end;
}

.armory-set-actions {
  display: grid;
  grid-column: 1 / -1;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.armory-set-action-group {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px;
  padding: 6px;
  border: 1px solid rgba(97, 69, 37, 0.2);
}

.armory-set-build-actions {
  border-color: rgba(123, 50, 39, 0.28);
  background: linear-gradient(135deg, rgba(150, 74, 53, 0.1), rgba(225, 197, 139, 0.2));
  box-shadow: inset 3px 0 rgba(123, 50, 39, 0.58);
}

.armory-set-utility-actions {
  background: rgba(255, 250, 232, 0.42);
}

.armory-set-action-group button {
  min-width: 0;
  min-height: 44px;
  padding: 8px 10px;
  font-size: 0.94rem;
  line-height: 1.2;
}

.armory-set-actions .armory-fit-stats-btn {
  border-color: rgba(123, 50, 39, 0.38);
  background: linear-gradient(180deg, rgba(255, 248, 226, 0.94), rgba(226, 203, 148, 0.55));
  color: var(--accent);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.42);
  font-weight: 900;
}

.armory-set-actions .armory-fit-stats-btn:not(:disabled):hover {
  border-color: rgba(123, 50, 39, 0.62);
  background: linear-gradient(180deg, rgba(255, 250, 233, 1), rgba(218, 187, 127, 0.68));
}

.armory-filter-bar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 800;
}

.armory-filter-bar select,
.armory-filter-bar button {
  min-height: 43px;
  font-size: 0.9rem;
}

.armory-editor-head label {
  display: grid;
  gap: 4px;
  min-width: min(330px, 58%);
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 800;
}

.armory-editor-head input {
  min-height: 44px;
  padding: 8px 11px;
  font-size: 0.95rem;
}

.armory-catalog {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 535px;
  overflow: auto;
  padding-right: 2px;
}

.armory-catalog-card {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  min-width: 0;
  min-height: 88px;
  padding: 9px;
  border: 1px solid rgba(97, 69, 37, 0.23);
  border-left: 5px solid rgba(97, 69, 37, 0.23);
  background: rgba(255, 250, 232, 0.7);
  color: var(--ink);
  text-align: left;
}

.armory-catalog-entry {
  position: relative;
  min-width: 0;
}

.armory-catalog-entry .armory-catalog-card {
  width: 100%;
  height: 100%;
  padding-right: 38px;
}

.armory-favorite-toggle {
  position: absolute;
  z-index: 2;
  top: 7px;
  right: 7px;
  display: grid;
  width: 28px;
  height: 28px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(121, 80, 45, 0.24);
  background: rgba(255, 250, 232, 0.88);
  color: #9a7a43;
  font-size: 1.1rem;
  line-height: 1;
}
.armory-favorite-toggle.active { color: #a56a16; background: #fff0b9; }

.armory-catalog-section-title {
  grid-column: 1 / -1;
  margin: 5px 0 0;
  padding: 8px 9px 5px;
  border-bottom: 1px solid rgba(97, 69, 37, 0.2);
  color: var(--accent);
  font-size: 0.9rem;
}

.armory-catalog-card.selected {
  border-color: var(--accent);
  background: rgba(155, 112, 61, 0.13);
}

.armory-more-results {
  grid-column: 1 / -1;
}

.armory-catalog-card img {
  width: 64px;
  height: 64px;
  flex: 0 0 64px;
  object-fit: contain;
  border: 1px solid var(--armory-quality, rgba(97, 69, 37, 0.28));
  background: var(--armory-quality, rgba(255, 248, 226, 0.72));
  box-shadow: inset 0 0 14px rgba(255, 255, 255, 0.12);
}

.armory-catalog-card > span {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.armory-catalog-card .armory-requirement-line.compact {
  display: block;
  margin-top: 2px;
  overflow: hidden;
  font-size: 0.78rem !important;
  line-height: 1.3;
  text-overflow: ellipsis;
}

.armory-catalog-card .armory-requirement-line.compact b {
  font-weight: 900;
}

.armory-catalog-card .armory-requirement-line.compact .missing {
  text-decoration: none;
  white-space: nowrap;
}

.armory-catalog-card strong {
  display: -webkit-box;
  overflow: hidden;
  font-size: 0.94rem;
  line-height: 1.15;
  text-overflow: ellipsis;
  white-space: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.armory-selected-editor {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  border-top: 1px solid rgba(97, 69, 37, 0.2);
  padding-top: 12px;
}

.armory-hover-delta-popup {
  position: fixed;
  z-index: 2000;
  display: grid;
  width: min(350px, calc(100vw - 20px));
  max-height: min(480px, calc(100vh - 20px));
  gap: 8px;
  overflow: auto;
  padding: 12px 14px;
  border: 1px solid rgba(91, 116, 63, 0.48);
  background: rgba(255, 250, 231, 0.98);
  box-shadow: 0 12px 32px rgba(64, 43, 23, 0.25);
  pointer-events: none;
  backdrop-filter: blur(9px);
}

.armory-hover-delta-popup > strong {
  color: var(--accent);
  font-size: 0.96rem;
  font-weight: 900;
  letter-spacing: 0.015em;
  text-transform: uppercase;
}

.armory-hover-delta-popup > div {
  display: grid;
  gap: 5px;
}

.armory-hover-delta-popup span {
  display: grid;
  grid-template-columns: minmax(56px, auto) minmax(0, 1fr);
  gap: 9px;
  align-items: baseline;
  padding-top: 7px;
  border-top: 1px solid rgba(97, 69, 37, 0.14);
  color: var(--ink);
  font-size: 0.94rem;
  font-weight: 700;
  line-height: 1.3;
}

.armory-hover-delta-popup span b {
  font-size: 0.98rem;
  font-weight: 900;
  white-space: nowrap;
}
.armory-hover-delta-popup .up,
.armory-hover-delta-popup .up b { color: #3e713e; }
.armory-hover-delta-popup .down,
.armory-hover-delta-popup .down b { color: #a34436; }

.armory-build-library {
  margin: 10px 0 14px;
  border: 1px solid rgba(97, 69, 37, 0.22);
  background: rgba(255, 249, 229, 0.55);
  box-shadow: 0 5px 14px rgba(76, 52, 29, 0.08);
}

.armory-build-library > summary {
  padding: 10px 12px;
  color: var(--accent);
  cursor: pointer;
  font-weight: 900;
}

.armory-build-library > summary small { margin-left: 6px; color: var(--muted); }
.armory-build-save-row {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
}
.armory-build-save-row input { min-width: 220px; flex: 1 1 300px; }
.armory-build-list { display: grid; gap: 7px; padding: 0 12px 12px; }
.armory-build-list article {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 8px;
  border: 1px solid rgba(97, 69, 37, 0.16);
  background: rgba(255, 252, 239, 0.68);
}
.armory-build-list article > div:first-child { display: grid; gap: 2px; }
.armory-build-list article > div:first-child { grid-template-columns: auto minmax(0, 1fr); align-items: center; }
.armory-build-list article > div:first-child > span { display: grid; gap: 2px; }
.armory-build-list article small { color: var(--muted); }
.armory-build-list article > div:last-child { display: flex; gap: 5px; flex-wrap: wrap; justify-content: flex-end; }

.armory-build-color-dot {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 2px solid rgba(72, 48, 26, 0.25);
  border-radius: 50%;
  background: var(--build-label, #b88b37);
  box-shadow: 0 2px 6px rgba(60, 40, 20, 0.18);
}
.armory-build-label { border-left: 6px solid var(--build-label, #b88b37) !important; }
.armory-build-label-red { --build-label: #a34436; }
.armory-build-label-green { --build-label: #4f7c48; }
.armory-build-label-blue { --build-label: #496f91; }
.armory-build-label-gold { --build-label: #b88b37; }
.armory-build-label-violet { --build-label: #74598d; }

.armory-item-details {
  padding: 11px;
  border: 1px solid rgba(97, 69, 37, 0.24);
  background: rgba(255, 249, 229, 0.7);
  box-shadow: 0 6px 15px rgba(76, 52, 29, 0.1);
}

@media (max-width: 720px) {
  .armory-build-library-page {
    padding: 12px;
  }

  .armory-build-library-page .armory-build-save-row {
    grid-template-columns: 1fr;
  }

  .armory-build-library-page .armory-build-label {
    align-items: stretch;
    flex-direction: column;
  }

  .armory-build-identity input {
    width: 100%;
  }

  .armory-build-save-row,
  .armory-build-list article { align-items: stretch; flex-direction: column; }
  .armory-build-save-row input { min-width: 0; width: 100%; }
  .armory-build-list article > div:last-child { justify-content: flex-start; }
  .armory-mode-toolbar { align-items: stretch; flex-direction: column; }
  .armory-mode-toolbar > div { margin-right: 0; }
}

@media (hover: none) {
  .armory-hover-delta-popup { display: none; }
}

.armory-item-details-body { margin-top: 12px; }

.armory-item-requirement-warning {
  margin: 10px 0;
  padding: 9px 11px;
  border: 1px solid rgba(163, 68, 54, 0.42);
  background: rgba(163, 68, 54, 0.08);
}

.armory-item-requirement-warning > strong {
  display: block;
  margin-bottom: 4px;
  color: #a34436;
}

.armory-item-details-head {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) auto;
  gap: 11px;
  align-items: center;
}

.armory-item-details-head img {
  width: 68px;
  height: 68px;
  object-fit: contain;
  border: 1px solid var(--armory-quality, rgba(97, 69, 37, 0.28));
  background: var(--armory-quality, rgba(255, 248, 226, 0.72));
}

.armory-item-details-placeholder {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  border: 1px dashed var(--armory-quality, rgba(97, 69, 37, 0.28));
  color: var(--armory-quality, var(--accent));
  font-style: normal;
}

.armory-item-details-head > div { display: grid; gap: 3px; min-width: 0; }
.armory-item-details-head strong { color: var(--accent); font-size: 1.05rem; }
.armory-item-details-head small,
.armory-item-details-head span { color: var(--muted); font-size: 0.76rem; }

.armory-weapon-guidance {
  display: grid;
  grid-template-columns: minmax(130px, 0.55fr) minmax(240px, 1.45fr);
  gap: 8px;
  margin-top: 11px;
}

.armory-weapon-guidance > span {
  display: grid;
  gap: 3px;
  padding: 9px 10px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  background: linear-gradient(135deg, rgba(255, 250, 232, 0.75), rgba(231, 208, 161, 0.25));
}

.armory-weapon-guidance small {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 800;
}

.armory-weapon-guidance strong {
  color: var(--accent);
  font-size: 1rem;
}

.armory-weapon-guidance em {
  color: #35613d;
  font-size: 0.84rem;
  font-style: normal;
  font-weight: 800;
}

.armory-item-details dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 7px;
  margin: 11px 0 0;
}

.armory-item-details dl > div {
  padding: 7px 8px;
  border: 1px solid rgba(97, 69, 37, 0.16);
  background: rgba(255, 250, 232, 0.5);
}

.armory-item-details dt { color: var(--accent); font-size: 0.74rem; font-weight: 900; }
.armory-item-details dd { margin: 3px 0 0; color: var(--ink); font-size: 0.82rem; line-height: 1.3; white-space: pre-line; }

.armory-customization {
  display: grid;
  gap: 12px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 11px;
}

.armory-custom-field {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.armory-custom-section {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.armory-custom-field > div {
  display: grid;
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.armory-rune-picker {
  min-width: 0;
}

.armory-rune-picker-body {
  gap: 6px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.armory-rune-choice {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.armory-rune-choice i {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--rune-quality, rgba(97, 69, 37, 0.42));
  background: color-mix(in srgb, var(--rune-quality, #8a7355) 19%, #fff7df);
  color: var(--rune-quality, var(--accent));
  font-size: 1rem;
  font-style: normal;
}

.armory-rune-choice img { width: 100%; height: 100%; object-fit: contain; }

.armory-rune-choice-body {
  display: grid;
  gap: 5px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.armory-rune-choice-body select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.armory-rune-effect {
  display: block;
  padding: 5px 7px;
  border-left: 3px solid var(--accent);
  background: rgba(255, 250, 232, 0.62);
  color: var(--ink) !important;
  font-size: 0.76rem !important;
  line-height: 1.3;
}

.armory-rune-copy {
  display: grid;
  gap: 8px;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin-top: 4px;
  padding: 8px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  background: rgba(255, 250, 232, 0.46);
}

.armory-rune-memory-actions,
.armory-rune-equipped-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  align-items: center;
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.armory-rune-equipped-actions {
  grid-template-columns: minmax(0, 1fr) auto;
}

.armory-rune-copy select,
.armory-rune-copy button {
  width: 100%;
  max-width: 100%;
  min-width: 0;
}

.armory-rune-copy button {
  min-height: 38px;
  padding: 7px 12px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.armory-custom-field select {
  width: 100%;
}

.armory-enchant-choice {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px auto;
  gap: 7px;
}

.armory-enchant-choice input { min-width: 0; }
.armory-enchant-unit {
  align-self: center;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 700;
  line-height: 1.1;
  min-width: 4.5rem;
}

@media (max-width: 680px) {
  .armory-enchant-choice {
    grid-template-columns: minmax(0, 1fr) auto;
  }

  .armory-enchant-choice input {
    grid-column: 1;
  }

  .armory-enchant-unit {
    grid-column: 2;
    grid-row: 2;
  }
}

.armory-appearance-field {
  margin-top: 12px;
  border-top: 1px solid rgba(97, 69, 37, 0.18);
  padding-top: 12px;
}

.armory-appearance-field details { display: grid; gap: 8px; }

.armory-appearance-field summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  color: var(--accent);
  font-weight: 900;
  list-style: none;
}

.armory-appearance-field summary::-webkit-details-marker { display: none; }
.armory-appearance-field summary::before { content: "+"; margin-right: 7px; font-size: 1.2rem; }
.armory-appearance-field details[open] summary::before { content: "−"; }
.armory-appearance-field summary small { margin-left: auto; color: var(--muted); font-weight: 700; }

.armory-appearance-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  max-height: 440px;
  overflow: auto;
  padding: 2px;
}

.armory-appearance-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-template-rows: auto 1fr;
  gap: 7px 12px;
  min-height: 142px;
  padding: 10px;
  border: 1px solid rgba(97, 69, 37, 0.25);
  background: linear-gradient(145deg, rgba(255, 252, 236, 0.78), rgba(226, 202, 154, 0.24));
  color: var(--ink);
  text-align: left;
}

.armory-appearance-card img {
  grid-row: 1 / span 2;
  width: 112px;
  height: 122px;
  padding: 2px;
  object-fit: contain;
  object-position: center;
  background: transparent;
}

.armory-appearance-empty {
  display: grid;
  grid-row: 1 / span 2;
  width: 112px;
  height: 122px;
  place-items: center;
  border: 1px dashed rgba(97, 69, 37, 0.32);
  color: var(--muted);
  font-size: 2rem;
  font-style: normal;
}

.armory-appearance-card span { align-self: end; font-weight: 900; font-size: 1rem; }
.armory-appearance-card small { align-self: start; color: var(--muted); font-size: 0.82rem; line-height: 1.35; }
.armory-appearance-card.selected { border-color: var(--accent); box-shadow: inset 0 0 0 2px rgba(132, 70, 43, 0.21); background: rgba(155, 112, 61, 0.14); }


.armory-appearance-field small {
  color: var(--muted);
  font-size: 0.75rem;
}

.armory-settings-admin {
  width: 100%;
}

.armory-settings-fields,
.armory-settings-options {
  display: grid;
  gap: 12px;
  width: min(100%, 720px);
}

.armory-settings-fields label {
  display: grid;
  gap: 5px;
}

.armory-settings-options {
  gap: 9px;
  margin-top: 2px;
}

.armory-settings-options .check-row {
  justify-content: flex-start;
  width: fit-content;
}

.armory-diagnostics-admin {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 15px;
  border: 1px solid rgba(93, 60, 31, 0.25);
  background: rgba(255, 248, 224, 0.5);
}
.armory-diagnostics-admin h3,
.armory-diagnostics-admin p { margin: 0; }
.armory-diagnostics-report {
  grid-column: 1 / -1;
  padding: 12px;
  border: 1px solid rgba(91, 57, 31, 0.25);
  background: rgba(255,255,255,.38);
}
.armory-diagnostics-report.ok { border-color: rgba(58, 112, 62, 0.48); }
.armory-diagnostics-report.warning { border-color: rgba(177, 122, 32, 0.55); }
.armory-diagnostics-report.error { border-color: rgba(158, 54, 42, 0.62); }
.armory-diagnostics-report > header {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
}
.armory-diagnostics-report > header > div { display: grid; min-width: min(100%, 380px); margin-right: auto; }
.armory-diagnostics-report > header small { color: var(--muted); }
.armory-diagnostics-report > header > span {
  padding: 4px 7px;
  border: 1px solid currentColor;
  font-size: .76rem;
  font-weight: 900;
}
.armory-diagnostics-report > header .error { color: #9b352e; }
.armory-diagnostics-report > header .warning { color: #916315; }
.armory-diagnostics-report > header .info { color: #4c6483; }
.armory-diagnostics-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 7px;
  margin-bottom: 10px;
}
.armory-diagnostics-totals span { padding: 8px; border: 1px solid rgba(91,57,31,.16); background: rgba(255,255,255,.35); }
.armory-diagnostics-totals b { float: right; color: var(--accent); }
.armory-diagnostics-report details > summary { padding: 8px 0; cursor: pointer; font-weight: 900; }
.armory-diagnostics-issues { display: grid; gap: 5px; max-height: 430px; overflow: auto; }
.armory-diagnostics-issues article {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
  gap: 3px 10px;
  padding: 7px 9px;
  border-left: 4px solid #667;
  background: rgba(255,255,255,.36);
}
.armory-diagnostics-issues article.error { border-left-color: #9b352e; }
.armory-diagnostics-issues article.warning { border-left-color: #b77b1e; }
.armory-diagnostics-issues article.info { border-left-color: #4c6483; }
.armory-diagnostics-issues article small { grid-column: 2; color: var(--muted); }
.armory-diagnostics-clean { margin: 8px 0 0; color: #35613d; font-weight: 900; }

.armory-settings-subhead {
  margin-top: 8px;
  padding-top: 16px;
  border-top: 1px solid rgba(97, 69, 37, 0.2);
}

.armory-settings-bulk {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 230px;
  gap: 22px;
  align-items: start;
  width: min(100%, 820px);
  padding: 14px;
  border: 1px solid rgba(97, 69, 37, 0.24);
  background: rgba(255, 249, 230, 0.62);
  box-shadow: 0 4px 12px rgba(82, 57, 33, 0.07);
}

.armory-settings-bulk h4 {
  margin: 0 0 5px;
  color: var(--accent);
  font-size: 1rem;
}

.armory-settings-bulk-fields {
  display: grid;
  gap: 9px;
}

.armory-settings-bulk-fields label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 86px;
  gap: 9px;
  align-items: center;
  font-size: 0.82rem;
}

.armory-settings-bulk-fields input {
  min-width: 0;
}

.armory-appearance-settings-list {
  display: grid;
  grid-template-columns: minmax(0, 820px);
  gap: 14px;
}

.armory-appearance-setting {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(97, 69, 37, 0.25);
  background: rgba(255, 249, 230, 0.62);
  box-shadow: 0 4px 12px rgba(82, 57, 33, 0.08);
}

.armory-admin-appearance-stage {
  position: relative;
  height: 230px;
  overflow: hidden;
  border: 1px solid rgba(123, 86, 45, 0.28);
  background: radial-gradient(circle at 50% 38%, #fff9df, #ddc28f);
}

.armory-admin-appearance-stage img {
  position: absolute;
  left: var(--armory-image-x, 50%);
  top: var(--armory-image-y, 50%);
  width: auto;
  height: var(--armory-image-height, 96%);
  max-width: none;
  max-height: none;
  object-fit: contain;
  transform: translate(-50%, -50%);
  filter: drop-shadow(0 7px 10px rgba(0, 0, 0, 0.35));
}

.armory-admin-appearance-stage i {
  display: grid;
  height: 100%;
  place-items: center;
  color: var(--muted);
  font-style: normal;
}

.armory-appearance-setting-body {
  display: grid;
  align-content: start;
  gap: 12px;
  min-width: 0;
}

.armory-appearance-setting-body > div:first-child {
  display: grid;
  gap: 3px;
}

.armory-appearance-setting-body strong { font-size: 1.05rem; }
.armory-appearance-setting-body small { color: var(--muted); }

.armory-appearance-setting-controls {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}

.armory-appearance-setting-controls label {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 92px;
  gap: 5px;
  align-items: center;
  font-size: 0.78rem;
}

.armory-appearance-setting-controls input {
  min-width: 0;
}

.armory-compare > details > summary {
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 1.18rem;
  font-weight: 900;
  list-style: none;
}

.armory-compare > details > summary::-webkit-details-marker { display: none; }
.armory-compare > details > summary::before { content: "+"; margin-right: 8px; font-family: Georgia, serif; font-size: 1.25rem; }
.armory-compare > details[open] > summary::before { content: "−"; }

.armory-compare-content {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  margin-top: 16px;
}

.armory-compare > details:not([open]) > .armory-compare-content { display: none; }

.armory-compare-content > section {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  background: rgba(255, 250, 232, 0.46);
}

.armory-compare-panel {
  box-shadow: 0 6px 16px rgba(76, 52, 29, 0.08);
}

.armory-compare-content h4 { margin: 0 0 13px; color: var(--accent); font-size: 1.28rem; }
.armory-compare-content p { margin: 0 0 14px; color: var(--muted); font-size: 1.02rem; line-height: 1.5; }

.armory-compare-player-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(97, 69, 37, 0.18);
  background: rgba(255, 252, 240, 0.52);
}

.armory-compare-player-fields label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 800;
}

.armory-compare-player-fields input { min-height: 46px; font-size: 1.05rem; }
.armory-compare-player-fields button {
  grid-column: 1 / -1;
  min-width: 210px;
  min-height: 44px;
  justify-self: start;
  font-size: 1.02rem;
}

.armory-compare-build-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(97, 69, 37, 0.18);
  background: rgba(255, 252, 240, 0.52);
}

.armory-shared-results-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 14px;
  padding: 15px 17px;
  border: 1px solid rgba(97, 69, 37, 0.24);
  background: linear-gradient(120deg, rgba(255, 250, 232, 0.88), rgba(224, 196, 132, 0.26));
  box-shadow: 0 6px 18px rgba(76, 52, 29, 0.1);
}

.armory-shared-results-head p,
.armory-shared-results-head h3 { margin: 0; }
.armory-shared-results-head h3 {
  margin-top: 3px;
  color: var(--accent);
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 1.45rem;
}
.armory-shared-results-head > span {
  color: var(--muted);
  font-size: 0.94rem;
  font-weight: 800;
}
.armory-shared-results .armory-workbench-body {
  grid-template-columns: 1fr;
}
.armory-shared-results .armory-loadout,
.armory-shared-results .armory-summary { grid-column: 1; }
.armory-shared-results .armory-loadout {
  width: min(100%, 1040px);
  justify-self: center;
}
.armory-shared-results .armory-loadout-head .ghost-btn,
.armory-shared-results .armory-quick-item-controls,
.armory-shared-results .armory-figure-nav,
.armory-shared-results .armory-buff-remove {
  display: none;
}
.armory-shared-results .armory-slot { cursor: default; }

.armory-compare-build-actions > div {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.armory-compare-build-actions select {
  min-width: 0;
  min-height: 44px;
  font-size: 0.98rem;
}

.armory-compare-build-actions span {
  overflow: hidden;
  color: var(--muted);
  font-size: 1rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.armory-compare-error { margin-top: 8px !important; color: #a34436 !important; font-weight: 800; }

[data-armory-player-comparison]:not(:empty),
[data-armory-build-comparison]:not(:empty) {
  margin-top: 11px;
  overflow-x: auto;
}

.armory-compare-table-head,
.armory-compare-rows > div {
  display: grid;
  grid-template-columns: minmax(110px, 0.8fr) minmax(230px, 1.7fr) minmax(110px, 0.8fr) minmax(120px, 0.86fr);
  align-items: center;
  min-width: 760px;
}

.armory-compare-table-head {
  background: rgba(129, 79, 50, 0.14);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 800;
}

.armory-compare-table-head > *,
.armory-compare-rows > div > * {
  padding: 13px 14px;
  border-right: 1px solid rgba(97, 69, 37, 0.13);
}

.armory-compare-rows > div { min-height: 54px; border-bottom: 1px solid rgba(97, 69, 37, 0.14); font-size: 1.08rem; line-height: 1.3; }
.armory-compare-group {
  position: sticky;
  left: 0;
  margin: 12px 0 0;
  padding: 12px 14px;
  border-top: 1px solid rgba(97, 69, 37, 0.2);
  border-bottom: 1px solid rgba(97, 69, 37, 0.2);
  background: rgba(129, 79, 50, 0.11);
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 1.08rem;
  letter-spacing: 0.02em;
}
.armory-compare-group:first-child { margin-top: 0; }
.armory-compare-rows strong { color: var(--accent); }
.armory-compare-rows em { font-style: normal; font-weight: 900; }
.armory-compare-rows em.up { color: #3f6c38; }
.armory-compare-rows em.down { color: #a34436; }

.armory-compare-rows > .armory-compare-total-damage {
  min-height: 72px;
  background: linear-gradient(110deg, rgba(221, 235, 202, 0.65), rgba(255, 248, 224, 0.56));
  box-shadow: inset 4px 0 #4f7545;
}

.armory-compare-total-damage > strong {
  color: #35613d;
  font-size: 1.42rem;
}

.armory-compare-total-damage > span {
  color: var(--accent);
  font-size: 1.16rem;
  font-weight: 900;
}

.armory-compare-loadouts {
  min-width: 760px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 2px solid rgba(97, 69, 37, 0.2);
}

.armory-compare-loadouts > h4 {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 1.18rem;
}

.armory-compare-loadouts > div {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.armory-compare-loadout {
  min-width: 0;
  padding: 10px;
  border: 1px solid rgba(97, 69, 37, 0.25);
  background: rgba(255, 249, 229, 0.58);
  box-shadow: 0 5px 14px rgba(74, 48, 27, 0.08);
}

.armory-compare-loadout > h5 {
  margin: 0 0 9px;
  padding: 9px 10px;
  background: rgba(129, 79, 50, 0.12);
  color: var(--accent);
  font-size: 1.05rem;
}

.armory-compare-loadout > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 6px;
}

.armory-compare-gear {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 7px;
  align-items: center;
  min-height: 65px;
  padding: 6px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  border-left: 4px solid var(--armory-quality, rgba(97, 69, 37, 0.24));
  background: rgba(255, 251, 236, 0.72);
}

.armory-compare-gear > img,
.armory-compare-gear > i {
  display: grid;
  width: 46px;
  height: 50px;
  place-items: center;
  object-fit: contain;
  border: 1px solid var(--armory-quality, rgba(97, 69, 37, 0.22));
  background: var(--armory-quality, rgba(255, 248, 226, 0.68));
  color: var(--muted);
  font-style: normal;
}

.armory-compare-gear > span { min-width: 0; }
.armory-compare-gear span > small { display: block; color: var(--muted); font-size: 0.7rem; }
.armory-compare-gear span > strong { display: block; margin-top: 2px; font-size: 0.86rem; line-height: 1.15; overflow-wrap: anywhere; }
.armory-compare-gear span > em { display: flex; gap: 2px; margin-top: 4px; font-style: normal; }
.armory-compare-gear span > em i {
  display: grid;
  width: 21px;
  height: 21px;
  place-items: center;
  overflow: hidden;
  border: 1px solid var(--rune-quality, rgba(97, 69, 37, 0.35));
  background: var(--rune-quality, rgba(255, 248, 226, 0.68));
  font-size: 0.68rem;
}
.armory-compare-gear span > em img { width: 100%; height: 100%; object-fit: contain; }
.armory-compare-gear.empty { opacity: 0.58; }

/* The armory is a calculation tool: its values and source breakdowns must stay
   readable on laptop screens even when several columns are visible. */
.armory-summary > h3 { font-size: 1.68rem; }
.armory-build-overview span { font-size: 1.1rem; }
.armory-build-overview b { font-size: 1.18rem; }
.armory-build-overview .armory-overview-player small { font-size: 0.94rem; }
.armory-build-overview .armory-overview-damage b { font-size: 1.3rem; }
.armory-key-card-head p { font-size: 0.88rem; }
.armory-key-card-head h4 { font-size: 1.42rem; }
.armory-key-stat-list .armory-stat-name { font-size: 1.08rem; line-height: 1.32; }
.armory-key-stat-list .armory-stat-name > small { margin-top: 5px; font-size: 0.88rem; line-height: 1.4; }
.armory-key-stat-list > div > strong { font-size: 1.22rem; }
.armory-key-stat-list strong small { font-size: 0.9rem; }
.armory-armor-zones small { font-size: 0.9rem; }
.armory-armor-zones b { font-size: 1.3rem; }
.armory-key-card-defense h5 { font-size: 0.92rem; }
.armory-stat-details > summary { min-height: 58px; font-size: 1.16rem; }
.armory-stat-details > summary small { font-size: 0.92rem; }
.armory-stat-group h4 { font-size: 1.08rem; }
.armory-stat-name { font-size: 1.1rem; line-height: 1.32; }
.armory-stat-name > small { margin-top: 5px; font-size: 0.9rem; line-height: 1.4; }
.armory-stat-list strong { font-size: 1.2rem; }
.armory-stat-list strong small { font-size: 0.9rem; }
.armory-stat-list > div { min-height: 60px; padding: 12px 7px; }
.armory-slot strong { font-size: 1.05rem; line-height: 1.2; }
.armory-slot.empty strong { font-size: 0.98rem; }
.armory-slot span,
.armory-catalog-card small,
.armory-custom-field small { font-size: 0.92rem; }
.armory-slot-tier { padding: 3px 6px; font-size: 0.78rem; }
.armory-catalog-card strong { font-size: 1.05rem; }
.armory-picker-section > summary { font-size: 1.08rem; }
.armory-picker-section > summary small { font-size: 0.9rem; }
.armory-filter-bar label,
.armory-editor-head label { font-size: 0.98rem; }
.armory-filter-bar select,
.armory-filter-bar button,
.armory-editor-head input { font-size: 1rem; }
.armory-item-details-head strong { font-size: 1.18rem; }
.armory-item-details-head small,
.armory-item-details-head span { font-size: 0.9rem; }
.armory-item-details dt { font-size: 0.9rem; }
.armory-item-details dd { font-size: 1rem; line-height: 1.4; }
.armory-rune-effect { font-size: 0.92rem !important; line-height: 1.4; }
.armory-buff-body > span { font-size: 0.82rem; }
.armory-buff-body strong { font-size: 1.02rem; }
.armory-buff-body small { font-size: 0.88rem; line-height: 1.38; }
.armory-buff-option small { font-size: 0.78rem; }
.armory-buff-option strong { font-size: 0.94rem; }
.armory-buff-option em { font-size: 0.82rem; line-height: 1.3; }
.armory-appearance-card small { font-size: 0.92rem; line-height: 1.42; }

/* All collapsible armory panels use one visual language. The boxed sign is the
   primary affordance; the title and its context remain readable at a glance. */
.armory-build-library > summary,
.armory-compare > details > summary,
.armory-workbench > details > summary,
.armory-manual-builder > details > summary,
.armory-picker-section > summary,
.armory-appearance-field details > summary,
.armory-buff-picker > summary,
.armory-stat-details > summary {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr) auto;
  align-items: center;
  justify-content: initial;
  gap: 10px;
  min-height: 56px;
  padding: 10px 13px;
  border: 1px solid rgba(97, 69, 37, 0.24);
  background: linear-gradient(135deg, rgba(255, 250, 232, 0.9), rgba(226, 203, 148, 0.3));
  box-shadow: 0 4px 12px rgba(76, 52, 29, 0.07);
  color: var(--accent);
  cursor: pointer;
  font-family: "Marcellus SC", Georgia, serif;
  font-size: 1.08rem;
  font-weight: 900;
  line-height: 1.25;
  list-style: none;
}

.armory-build-library > summary::-webkit-details-marker,
.armory-compare > details > summary::-webkit-details-marker,
.armory-workbench > details > summary::-webkit-details-marker,
.armory-manual-builder > details > summary::-webkit-details-marker,
.armory-picker-section > summary::-webkit-details-marker,
.armory-appearance-field details > summary::-webkit-details-marker,
.armory-buff-picker > summary::-webkit-details-marker,
.armory-stat-details > summary::-webkit-details-marker {
  display: none;
}

.armory-build-library > summary::marker,
.armory-compare > details > summary::marker,
.armory-workbench > details > summary::marker,
.armory-manual-builder > details > summary::marker,
.armory-picker-section > summary::marker,
.armory-appearance-field details > summary::marker,
.armory-buff-picker > summary::marker,
.armory-stat-details > summary::marker {
  content: "";
}

.armory-build-library > summary::before,
.armory-compare > details > summary::before,
.armory-workbench > details > summary::before,
.armory-manual-builder > details > summary::before,
.armory-picker-section > summary::before,
.armory-appearance-field details > summary::before,
.armory-buff-picker > summary::before,
.armory-stat-details > summary::before {
  content: "+";
  display: grid;
  width: 30px;
  height: 30px;
  margin: 0;
  place-items: center;
  border: 1px solid rgba(123, 50, 39, 0.34);
  background: rgba(255, 249, 229, 0.82);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.48);
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 1.35rem;
  font-weight: 700;
  line-height: 1;
}

.armory-build-library[open] > summary::before,
.armory-compare > details[open] > summary::before,
.armory-workbench > details[open] > summary::before,
.armory-manual-builder > details[open] > summary::before,
.armory-picker-section[open] > summary::before,
.armory-appearance-field details[open] > summary::before,
.armory-buff-picker[open] > summary::before,
.armory-stat-details[open] > summary::before {
  content: "−";
  border-color: rgba(123, 50, 39, 0.52);
  background: rgba(226, 203, 148, 0.54);
}

.armory-build-library > summary:hover,
.armory-compare > details > summary:hover,
.armory-workbench > details > summary:hover,
.armory-manual-builder > details > summary:hover,
.armory-picker-section > summary:hover,
.armory-appearance-field details > summary:hover,
.armory-buff-picker > summary:hover,
.armory-stat-details > summary:hover {
  border-color: rgba(123, 50, 39, 0.4);
  background: linear-gradient(135deg, rgba(255, 252, 239, 0.98), rgba(226, 203, 148, 0.44));
}

.armory-build-library > summary small,
.armory-workbench > details > summary small,
.armory-manual-builder > details > summary small,
.armory-picker-section > summary small,
.armory-appearance-field details > summary small,
.armory-buff-picker > summary small,
.armory-stat-details > summary small {
  margin: 0;
  color: var(--muted);
  font-family: Georgia, serif;
  font-size: 0.9rem;
  font-weight: 700;
  line-height: 1.3;
  text-align: right;
}

.armory-heading h2 { font-size: 1.72rem; }
.armory-heading p:not(.eyebrow) { font-size: 1.04rem; line-height: 1.45; }
.armory-page .rating-status {
  font-size: 1rem;
  line-height: 1.45;
}

.armory-page #armoryStatus:not(:empty) {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 1200;
  width: min(520px, calc(100vw - 32px));
  margin: 0;
  padding: 13px 16px;
  border: 1px solid rgba(109, 36, 29, 0.42);
  background: rgba(255, 248, 224, 0.97);
  box-shadow: 0 12px 34px rgba(47, 31, 17, 0.24);
  text-transform: none;
}
.armory-mode-toolbar strong { font-size: 1.08rem; }
.armory-mode-toolbar small { font-size: 0.9rem; line-height: 1.35; }

/* Keep the collapsible rows on one baseline. Nested tools must not add a
   second decorative frame around the same interactive header. */
.armory-build-library,
.armory-compare {
  border: 0;
  background: transparent;
  box-shadow: none;
}

.armory-compare { padding: 0; }

.armory-item-details {
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.armory-buff-picker {
  padding: 0;
  border: 0;
  background: transparent;
}

.armory-item-details-body,
.armory-buff-picker-body {
  margin-top: 8px;
  padding: 12px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  background: rgba(255, 249, 229, 0.58);
}

.armory-buff-pagination {
  display: grid;
  grid-template-columns: minmax(110px, auto) 1fr minmax(110px, auto);
  gap: 10px;
  align-items: center;
  margin-top: 12px;
}

.armory-buff-pagination span {
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.armory-buff-pagination button {
  min-height: 38px;
}

.armory-build-save-row {
  margin: 8px 0 0;
  padding: 10px 12px 12px;
  border: 1px solid rgba(97, 69, 37, 0.2);
  background: rgba(255, 249, 229, 0.58);
}

.armory-build-list {
  padding: 0 12px 12px;
  border-right: 1px solid rgba(97, 69, 37, 0.2);
  border-bottom: 1px solid rgba(97, 69, 37, 0.2);
  border-left: 1px solid rgba(97, 69, 37, 0.2);
  background: rgba(255, 249, 229, 0.58);
}

.armory-build-list > .editor-hint {
  margin: 0;
  padding-top: 2px;
  font-size: 0.9rem;
}

.armory-build-library-page {
  margin: 0;
  padding: 18px;
  border: 1px solid rgba(97, 69, 37, 0.26);
  background: linear-gradient(135deg, rgba(255, 249, 229, 0.78), rgba(226, 203, 148, 0.25));
  box-shadow: 0 7px 18px rgba(76, 52, 29, 0.09);
}

.armory-build-library-page .armory-build-save-row {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 150px auto auto;
  gap: 9px;
  margin: 0 0 14px;
  padding: 13px;
}

.armory-build-library-page .armory-build-list {
  gap: 10px;
  padding: 0;
  border: 0;
  background: transparent;
}

.armory-build-library-page .armory-build-label {
  min-height: 78px;
  padding: 12px 13px;
  box-shadow: 0 4px 10px rgba(76, 52, 29, 0.06);
}

.armory-shared-links {
  margin-top: 14px;
  padding: 16px 18px;
  border: 1px solid rgba(97, 69, 37, 0.24);
  background: rgba(255, 249, 229, 0.58);
}

.armory-shared-link-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.armory-shared-link-list article {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid rgba(97, 69, 37, 0.16);
  background: rgba(255, 252, 239, 0.76);
}

.armory-shared-link-list article > div:first-child {
  display: grid;
  min-width: 0;
  gap: 3px;
}

.armory-shared-link-list small {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.armory-shared-link-list article > div:last-child {
  display: flex;
  flex: 0 0 auto;
  gap: 6px;
}

@media (max-width: 720px) {
  .armory-shared-link-list article {
    align-items: stretch;
    flex-direction: column;
  }
}

.armory-build-identity {
  flex: 1 1 340px;
}

.armory-build-identity input {
  width: min(100%, 460px);
  min-height: 38px;
  padding: 6px 9px;
  border-color: transparent;
  background: transparent;
  color: var(--text);
  font-family: Georgia, serif;
  font-size: 1.04rem;
  font-weight: 900;
}

.armory-build-identity input:hover,
.armory-build-identity input:focus {
  border-color: rgba(97, 69, 37, 0.3);
  background: rgba(255, 252, 239, 0.82);
}

.armory-build-controls {
  align-items: center;
}

.armory-build-controls .ghost-btn,
.armory-build-controls .action-btn {
  min-height: 38px;
  padding: 7px 11px;
}

.armory-build-controls .danger {
  border-color: rgba(163, 68, 54, 0.32);
  color: #8e352d;
}

.armory-build-empty {
  display: grid;
  min-height: 180px;
  place-content: center;
  padding: 28px;
  border: 1px dashed rgba(97, 69, 37, 0.32);
  background: rgba(255, 252, 239, 0.48);
  text-align: center;
}

.armory-build-empty strong {
  color: var(--accent);
  font-size: 1.18rem;
}

.armory-build-empty p {
  max-width: 560px;
  margin: 7px auto 0;
  color: var(--muted);
  line-height: 1.45;
}

/* Armory actions are compact tool controls, not the large hexagonal calls to
   action used elsewhere on the public site. */
.armory-mode-toolbar .ghost-btn,
.armory-loadout-head .ghost-btn,
.armory-set-actions .ghost-btn {
  min-height: 36px;
  padding: 6px 10px;
  border: 1px solid rgba(97, 69, 37, 0.3);
  border-radius: 3px;
  clip-path: none;
  background: linear-gradient(180deg, rgba(255, 250, 234, 0.96), rgba(226, 207, 164, 0.72));
  box-shadow: 0 2px 5px rgba(76, 52, 29, 0.08);
  color: var(--accent);
  font-family: Georgia, serif;
  font-size: 0.84rem;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.15;
  text-transform: none;
}

.armory-mode-toolbar .ghost-btn:not(:disabled):hover,
.armory-loadout-head .ghost-btn:not(:disabled):hover,
.armory-set-actions .ghost-btn:not(:disabled):hover {
  border-color: rgba(123, 50, 39, 0.52);
  background: linear-gradient(180deg, #fffaf0, rgba(218, 190, 135, 0.76));
  box-shadow: 0 3px 8px rgba(76, 52, 29, 0.13);
}

.armory-mode-toolbar .ghost-btn {
  width: auto;
  max-width: 240px;
}

.armory-loadout-head .ghost-btn {
  width: auto;
  min-width: 132px;
}

.armory-workbench.appearance-hidden:not(.focus-mode) .armory-slot-column {
  gap: 9px;
}

.armory-workbench.appearance-hidden:not(.focus-mode) .armory-slot {
  grid-template-columns: 64px minmax(0, 1fr);
  min-height: 92px;
  padding: 9px 10px;
}

.armory-workbench.appearance-hidden:not(.focus-mode) .armory-slot > img,
.armory-workbench.appearance-hidden:not(.focus-mode) .armory-slot-placeholder {
  width: 63px;
  height: 70px;
}

.armory-workbench.appearance-hidden:not(.focus-mode) .armory-slot strong {
  font-size: 1.1rem;
}

.armory-workbench.appearance-hidden:not(.focus-mode) .armory-slot span {
  font-size: 0.9rem;
}

.armory-workbench.appearance-hidden:not(.focus-mode) .armory-rune-icons {
  min-height: 27px;
}

.armory-workbench.appearance-hidden:not(.focus-mode) .armory-rune-icons i {
  width: 27px;
  height: 27px;
}

.armory-workbench.appearance-hidden:not(.focus-mode) .armory-quick-item-controls button {
  min-height: 40px;
  font-size: 1.22rem;
}

.armory-workbench.appearance-hidden:not(.focus-mode) .armory-quick-item-controls button small {
  font-size: 0.74rem;
}

.armory-workbench.appearance-hidden:not(.focus-mode) .armory-quick-item-controls button.variant {
  font-size: 0.94rem;
}

.armory-set-actions {
  gap: 7px;
}

.armory-set-action-group {
  gap: 5px;
  padding: 4px;
  border-radius: 4px;
}

.armory-set-action-group button {
  min-height: 36px;
  padding: 6px 8px;
}

.armory-set-actions .armory-fit-stats-btn {
  border-color: rgba(123, 50, 39, 0.42);
  background: linear-gradient(180deg, rgba(246, 230, 194, 0.96), rgba(218, 188, 128, 0.74));
  box-shadow: inset 3px 0 rgba(123, 50, 39, 0.55), 0 2px 5px rgba(76, 52, 29, 0.08);
}

@media (max-width: 1100px) {
  .armory-appearance-settings-list { grid-template-columns: 1fr; }

  .armory-layout {
    grid-template-columns: minmax(360px, 1fr) minmax(240px, 0.8fr);
  }

  .armory-workbench-body {
    grid-template-columns: minmax(360px, 1fr) minmax(240px, 0.8fr);
  }

  .armory-workbench.appearance-hidden:not(.focus-mode) .armory-workbench-body {
    grid-template-columns: minmax(370px, 0.82fr) minmax(430px, 1.18fr);
  }

  .armory-editor {
    grid-column: auto;
  }

  .armory-stat-groups { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .armory-key-stat-list { grid-template-columns: 1fr; }
  .armory-key-stat-list > div,
  .armory-key-stat-list > div:nth-child(odd),
  .armory-key-stat-list > div:nth-child(even) { padding-right: 7px; padding-left: 7px; border-right: 0; }
  .armory-buffs-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .armory-buff-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .armory-catalog { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .armory-manual-stats { grid-template-columns: repeat(3, minmax(150px, 1fr)); }
  .armory-stat-group-wide .armory-stat-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .armory-compare-content { grid-template-columns: 1fr; }
}

@media (max-width: 680px) {
  .armory-tabs {
    display: grid;
    grid-template-columns: 1fr;
  }

  .armory-tabs button {
    width: 100%;
    max-width: none;
  }

  .armory-mode-actions > .armory-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .armory-mode-actions .armory-import-field,
  .armory-mode-actions .armory-import-field input,
  .armory-mode-actions .action-btn,
  .armory-mode-actions .ghost-btn {
    width: 100%;
  }

  .armory-mode-section-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .armory-mode-section-head > p {
    text-align: left;
    white-space: normal;
  }

  .armory-settings-bulk { grid-template-columns: 1fr; }

  .armory-heading,
  .armory-editor-head {
    flex-direction: column;
  }

  .armory-layout {
    grid-template-columns: 1fr;
  }

  .armory-workbench-body { grid-template-columns: 1fr; }
  .armory-workbench.appearance-hidden:not(.focus-mode) .armory-workbench-body { grid-template-columns: 1fr; }

  .armory-manual-head,
  .armory-manual-mastery-head,
  .armory-manual-requirements { align-items: stretch; flex-direction: column; }
  .armory-manual-toolbar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .armory-manual-mode,
  .armory-manual-toolbar .armory-manual-controls { grid-column: 1 / -1; }
  .armory-allocation-section > header { align-items: flex-start; flex-direction: column; }
  .armory-allocation-section > header small { text-align: left; }
  .armory-manual-pool { width: 100%; }
  .armory-manual-controls { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .armory-manual-stats { grid-template-columns: 1fr; }

  .armory-editor {
    grid-column: auto;
  }

  .armory-summary { grid-column: auto; }

  .armory-editor-head label {
    min-width: 100%;
    width: 100%;
  }

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

  .armory-filter-bar {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .armory-set-actions { grid-template-columns: 1fr; }
  .armory-set-action-group { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .armory-actions {
    justify-content: flex-start;
  }

  .armory-doll { grid-template-columns: minmax(135px, 1fr) minmax(150px, 0.9fr) minmax(135px, 1fr); }
  .armory-buffs-grid { grid-template-columns: 1fr; }
  .armory-buff-catalog,
  .armory-buff-filters { grid-template-columns: 1fr; }
  .armory-weapon-guidance { grid-template-columns: 1fr; }
  .armory-key-hero-value > small { white-space: normal; }
  .armory-figure { min-height: 470px; }
  .armory-appearance-grid { grid-template-columns: 1fr; }
  .armory-appearance-setting { grid-template-columns: 130px minmax(0, 1fr); }
  .armory-admin-appearance-stage { height: 190px; }
  .armory-appearance-setting-controls { grid-template-columns: 1fr; }
  .armory-stat-groups { grid-template-columns: 1fr; }
  .armory-key-dashboard { grid-template-columns: 1fr; }
  .armory-key-stat-list { grid-template-columns: 1fr; }
  .armory-build-library > summary,
  .armory-workbench > details > summary,
  .armory-manual-builder > details > summary,
  .armory-picker-section > summary,
  .armory-appearance-field details > summary,
  .armory-buff-picker > summary,
  .armory-stat-details > summary {
    grid-template-columns: 32px minmax(0, 1fr);
  }
  .armory-build-library > summary small,
  .armory-workbench > details > summary small,
  .armory-manual-builder > details > summary small,
  .armory-picker-section > summary small,
  .armory-appearance-field details > summary small,
  .armory-buff-picker > summary small,
  .armory-stat-details > summary small {
    grid-column: 2;
    text-align: left;
  }
  .armory-stat-group-wide { grid-column: auto; }
  .armory-stat-group-wide .armory-stat-list { grid-template-columns: 1fr; }
  .armory-compare-player-fields,
  .armory-compare-build-actions { grid-template-columns: 1fr; }
  .armory-compare-player-fields button { min-width: 0; justify-self: stretch; }
  .armory-shared-results-head { align-items: flex-start; flex-direction: column; }
}

.enchantments-admin-panel {
  width: 100%;
}

.enchantments-admin-panel .form-head {
  align-items: flex-start;
}

.enchantment-scan-limit {
  display: grid;
  gap: 5px;
  min-width: 148px;
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
}

.enchantment-scan-limit select {
  min-height: 38px;
}

.enchantments-admin-content {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.enchantment-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 10px;
}

.enchantment-summary-grid article,
.enchantment-scan-status,
.enchantment-group {
  border: 1px solid rgba(97, 69, 37, 0.28);
  background: linear-gradient(135deg, rgba(255, 248, 224, 0.74), rgba(226, 203, 148, 0.28));
}

.enchantment-summary-grid article {
  padding: 13px 15px;
}

.enchantment-summary-grid span,
.enchantment-group summary small,
.enchantment-scan-status span,
.enchantment-stats-table small {
  display: block;
  color: var(--muted);
  font-size: 0.76rem;
}

.enchantment-summary-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-family: "Cinzel Decorative", serif;
  font-size: 1.55rem;
}

.enchantment-scan-status {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 14px;
}

.enchantment-scan-status strong {
  color: var(--ink);
}

.enchantment-scan-status progress {
  width: min(260px, 32vw);
  accent-color: var(--accent);
}

.enchantment-groups {
  display: grid;
  gap: 8px;
}

.enchantment-group summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  cursor: pointer;
  color: var(--ink);
}

.enchantment-group summary strong {
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  text-transform: uppercase;
}

.enchantment-group summary > span:last-child {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-align: right;
}

.enchantment-stats-table-wrap {
  overflow-x: auto;
  border-top: 1px solid rgba(97, 69, 37, 0.2);
}

.enchantment-stats-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
}

.enchantment-stats-table th,
.enchantment-stats-table td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(97, 69, 37, 0.14);
  text-align: left;
  vertical-align: top;
}

.enchantment-stats-table th {
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.enchantment-value {
  display: inline-block;
  margin: 0 4px 4px 0;
  padding: 2px 6px;
  border: 1px solid rgba(111, 72, 38, 0.2);
  background: rgba(255, 250, 232, 0.6);
  white-space: nowrap;
}

@media (max-width: 760px) {
  .enchantment-summary-grid {
    grid-template-columns: repeat(2, minmax(120px, 1fr));
  }

  .enchantment-scan-status,
  .enchantment-group summary {
    align-items: flex-start;
    flex-direction: column;
  }

  .enchantment-scan-status progress {
    width: 100%;
  }
}

.analytics-summary-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(130px, 1fr));
  gap: 10px;
}

.analytics-summary-grid article,
.analytics-card {
  border: 1px solid rgba(97, 69, 37, 0.28);
  background:
    linear-gradient(135deg, rgba(255, 248, 224, 0.74), rgba(226, 203, 148, 0.28)),
    rgba(244, 229, 188, 0.55);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.36), 0 10px 26px rgba(78, 55, 28, 0.08);
}

.analytics-summary-grid article {
  padding: 14px 16px;
}

.analytics-summary-grid span,
.analytics-card h3 {
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.analytics-summary-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--ink);
  font-family: "Cinzel Decorative", serif;
  font-size: clamp(1.45rem, 2.2vw, 2.15rem);
  line-height: 1;
}

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

.analytics-card {
  min-width: 0;
  padding: 16px;
}

.analytics-card-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: flex-start;
}

.analytics-card h3 {
  margin: 0 0 12px;
  font-size: 1rem;
}

.analytics-card-head h3 {
  margin-bottom: 4px;
}

.analytics-online-card {
  grid-column: 1 / -1;
}

.analytics-online-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 10px;
  margin: 12px 0;
}

.analytics-online-summary article {
  border: 1px solid rgba(97, 69, 37, 0.22);
  background: rgba(255, 248, 224, 0.45);
  padding: 10px 12px;
}

.analytics-online-summary span {
  display: block;
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 0.78rem;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.analytics-online-summary strong {
  display: block;
  margin-top: 2px;
  color: var(--ink);
  font-family: "Cinzel Decorative", serif;
  font-size: 1.45rem;
  line-height: 1;
}

.analytics-location-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 14px;
}

.analytics-location-tags span {
  border: 1px solid rgba(132, 88, 47, 0.24);
  background: rgba(255, 248, 224, 0.55);
  color: rgba(43, 33, 24, 0.88);
  padding: 6px 9px;
  font-weight: 650;
}

.analytics-location-tags strong {
  display: inline-flex;
  min-width: 1.5em;
  justify-content: center;
  margin-left: 5px;
  color: var(--accent);
}

.analytics-table-wrap {
  overflow-x: auto;
}

.analytics-online-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.95rem;
}

.analytics-online-table th,
.analytics-online-table td {
  border-bottom: 1px solid rgba(93, 64, 31, 0.14);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
}

.analytics-online-table th {
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  white-space: nowrap;
}

.analytics-online-table a {
  color: var(--accent);
  font-weight: 700;
}

.analytics-same-account {
  display: block;
  margin-top: 3px;
  color: rgba(75, 59, 42, 0.72);
  font-size: 0.78rem;
  line-height: 1.25;
}

.analytics-ability-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  max-width: 560px;
}

.analytics-ability-list span {
  border: 1px solid rgba(132, 88, 47, 0.24);
  background: rgba(255, 248, 224, 0.58);
  color: rgba(43, 33, 24, 0.9);
  padding: 3px 7px;
  font-size: 0.83rem;
  font-weight: 650;
  line-height: 1.2;
}

.analytics-history-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
  margin-top: 16px;
}

.analytics-history-grid article {
  border: 1px solid rgba(97, 69, 37, 0.18);
  background: rgba(255, 248, 224, 0.35);
  padding: 12px;
}

.analytics-history-grid h4 {
  margin: 0 0 10px;
  color: var(--accent);
  font-family: "Marcellus SC", serif;
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.analytics-history-table {
  font-size: 0.86rem;
}

.analytics-ranking {
  display: grid;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.analytics-ranking li {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-bottom: 1px solid rgba(93, 64, 31, 0.14);
  padding: 6px 0;
}

.analytics-ranking span {
  min-width: 0;
  overflow: hidden;
  color: rgba(43, 33, 24, 0.9);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.analytics-ranking strong {
  color: var(--accent);
  font-family: "Marcellus SC", serif;
}

.analytics-bars {
  display: flex;
  align-items: end;
  min-height: 180px;
  gap: 5px;
  border-left: 1px solid rgba(90, 64, 31, 0.2);
  border-bottom: 1px solid rgba(90, 64, 31, 0.2);
  padding: 12px 6px 0;
}

.analytics-bars span {
  position: relative;
  flex: 1 1 8px;
  min-width: 6px;
  height: var(--bar-height);
  background: linear-gradient(180deg, rgba(159, 54, 43, 0.9), rgba(92, 38, 28, 0.9));
  box-shadow: 0 0 0 1px rgba(97, 69, 37, 0.22), 0 4px 12px rgba(103, 40, 31, 0.16);
}

.analytics-bars em {
  position: absolute;
  right: 50%;
  bottom: calc(100% + 4px);
  display: none;
  transform: translateX(50%);
  color: var(--ink);
  font-style: normal;
  font-size: 0.72rem;
  white-space: nowrap;
}

.analytics-bars span:hover em {
  display: block;
}

@media (max-width: 900px) {
  .analytics-summary-grid,
  .analytics-grid,
  .analytics-online-summary {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 1040px) {
  .codex-navbar {
    grid-template-columns: auto auto;
    justify-content: space-between;
    padding: 0 16px;
  }

  .codex-navbar::before {
    inset-inline: 8px;
  }

  .nav-toggle {
    position: relative;
    z-index: 2;
    display: grid;
    width: 44px;
    height: 42px;
    place-items: center;
    border: 1px solid rgba(201, 164, 93, 0.5);
    background: rgba(8, 7, 6, 0.34);
    cursor: pointer;
  }

  .nav-toggle span {
    display: block;
    width: 22px;
    height: 1px;
    background: var(--aaa-gold-bright);
  }

  .codex-navbar .main-nav,
  .codex-navbar .nav-search {
    position: absolute;
    top: 64px;
    right: 14px;
    left: 14px;
    display: none;
    background: rgba(18, 15, 13, 0.97);
  }

  .codex-navbar .main-nav {
    padding: 12px;
    border: 1px solid rgba(201, 164, 93, 0.36);
  }

  .nav-open .codex-navbar .main-nav {
    display: grid;
  }

  .nav-open .codex-navbar .nav-search {
    top: auto;
    right: 14px;
    bottom: -118px;
    left: 14px;
    display: block;
    padding: 12px;
    border: 1px solid rgba(201, 164, 93, 0.36);
    border-top: 0;
  }

  .codex-navbar .main-nav a {
    min-height: 44px;
    justify-content: flex-start;
  }

  .codex-navbar .nav-dropdown {
    position: static;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .nav-search input,
  .nav-search input:focus {
    width: 100%;
  }

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

  .admin-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .brand-text {
    max-width: 170px;
    font-size: 0.7rem;
  }

  .hero-shell {
    width: 100%;
    min-height: 420px;
    margin-top: 0;
  }

  .hero-backdrop {
    background-position: 58% center;
  }

  .hero-shade {
    background:
      linear-gradient(90deg, rgba(20, 15, 10, 0.9), rgba(20, 15, 10, 0.58) 62%, rgba(20, 15, 10, 0.2)),
      linear-gradient(180deg, rgba(18, 15, 13, 0.2), rgba(18, 15, 13, 0.44));
  }

  .hero-content {
    min-height: 420px;
    padding: 38px 24px;
  }

  .hero-content h1 {
    font-size: clamp(2.05rem, 13vw, 3.1rem);
  }

  .hero-actions {
    align-items: stretch;
    flex-wrap: wrap;
    flex-direction: column;
  }

  .page-shell {
    width: 100%;
    padding: 22px 12px 36px;
  }

  .codex-category-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .category-card {
    min-height: 160px;
    padding: 22px;
  }

  .category-card-head {
    grid-template-columns: 40px minmax(0, 1fr);
    gap: 10px;
  }

  .category-icon {
    width: 40px;
    height: 40px;
  }

  .category-links {
    margin-left: 56px;
  }

  .category-card span:not(.category-icon) {
    font-size: 1.16rem;
  }

  .is-inner .hero-shell {
    display: none;
  }
}

.menu-section-builder {
  display: grid;
  gap: 6px;
}

.menu-section-row {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) minmax(105px, 0.62fr) minmax(105px, 0.62fr) minmax(170px, 1fr) auto;
  gap: 6px;
  align-items: end;
  padding: 6px;
  border: 1px solid rgba(79, 63, 43, 0.24);
  background: rgba(255, 250, 232, 0.48);
}

.menu-section-actions {
  display: flex;
  gap: 4px;
  align-items: center;
}

.compact-btn {
  min-height: 30px;
  padding: 5px 8px;
  font-size: 0.8rem;
}

.content-table {
  max-width: 100%;
}

@media (max-width: 900px) {
  .home-top-panels {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .player-lookup-panel,
  .world-status-panel,
  .rating-heading,
  .player-lookup-form,
  .rating-search-form {
    align-items: stretch;
    flex-direction: column;
  }

  .player-lookup-form label,
  .rating-search-form input,
  .home-info-panel,
  .player-online-panel,
  .chaos-tracker {
    width: 100%;
    max-width: none;
    min-width: 0;
  }

  .player-lookup-form {
    grid-template-columns: 1fr;
  }


  .world-status-panel {
    grid-template-columns: 1fr;
  }

  .world-status-panel h2 {
    white-space: normal;
  }

  .home-info-panel.hidden + .player-lookup-panel,
  .home-info-panel.hidden + .player-lookup-panel + .world-status-panel,
  .home-info-panel.hidden + .player-lookup-panel + .world-status-panel + .chaos-status-panel {
    grid-column: auto;
  }

  .permission-grid {
    grid-template-columns: 1fr;
  }

  .menu-section-row {
    grid-template-columns: 1fr;
  }
}

.set-compare-page {
  display: grid;
  gap: 16px;
}

.set-compare-heading p {
  max-width: 760px;
  margin-bottom: 0;
}

.set-compare-set-picker {
  grid-column: 1 / -1;
  display: grid;
  gap: 7px;
}

.set-compare-set-picker > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.set-compare-set-picker label {
  display: inline-flex;
  grid-template-columns: none;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border: 1px solid rgba(92, 71, 45, 0.22);
  background: rgba(255, 253, 241, 0.68);
  color: #4a382c;
}

.set-compare-profile-picker {
  grid-column: 1 / -1;
  display: grid;
  gap: 8px;
}

.set-compare-profile-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.set-compare-profile-head button,
.set-compare-profile > button {
  min-height: 32px;
  padding: 5px 9px;
  border: 1px solid rgba(92, 71, 45, 0.28);
  background: rgba(255, 253, 241, 0.7);
  color: #6f2a23;
  cursor: pointer;
  font: inherit;
  font-weight: 900;
}

[data-compare-profiles] {
  display: grid;
  gap: 6px;
}

.set-compare-profile {
  display: grid;
  grid-template-columns: minmax(180px, 1.2fr) repeat(3, minmax(120px, 0.7fr)) auto;
  gap: 6px;
  align-items: end;
  padding: 7px;
  border: 1px solid rgba(92, 71, 45, 0.18);
  background: rgba(255, 253, 241, 0.48);
}

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

.set-compare-column {
  min-width: 0;
  padding: 12px;
  border: 1px solid rgba(92, 71, 45, 0.28);
  background: rgba(255, 250, 230, 0.56);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 219, 0.58);
}

.set-compare-column > header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(92, 71, 45, 0.18);
}

.set-compare-column h3 {
  margin: 0;
  color: #60261f;
  font-size: 1.2rem;
}

.set-compare-column header span {
  color: #756653;
  font-weight: 800;
  white-space: nowrap;
}

.set-compare-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 9px 0;
}

.set-compare-summary span {
  display: inline-flex;
  gap: 5px;
  padding: 4px 7px;
  border: 1px solid rgba(92, 71, 45, 0.16);
  background: rgba(255, 253, 241, 0.65);
}

.set-compare-summary b {
  color: #7b2b24;
}

.set-compare-summary em {
  font-style: normal;
  font-weight: 900;
}

.set-compare-summary .comparison-better {
  border-color: rgba(45, 120, 61, 0.42);
  background: rgba(75, 151, 84, 0.15);
  color: #245e2f;
}

.set-compare-summary .comparison-worse {
  border-color: rgba(150, 49, 39, 0.42);
  background: rgba(164, 58, 47, 0.14);
  color: #812a23;
}

.set-compare-items {
  display: grid;
  gap: 8px;
}

.site-footer {
  position: relative;
  z-index: 1;
  display: flex;
  width: 100%;
  min-height: 58px;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 38px;
  border-top: 1px solid rgba(201, 164, 93, 0.48);
  background: rgba(24, 19, 16, 0.95);
  color: #d9c69d;
  font-size: 0.92rem;
}

.site-footer > div {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 18px;
}

.site-footer strong {
  color: #f2dfb8;
}

.site-footer a {
  color: #d6b97a;
}

@media (max-width: 1100px) {
  .set-compare-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .set-compare-results {
    grid-template-columns: 1fr;
  }

  .site-footer {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 18px;
  }

  .set-compare-profile {
    grid-template-columns: 1fr;
  }
}

/* Public typography balance: readable, but not over-bold. */
.main-nav a {
  font-weight: 700;
}

.nav-dropdown button,
.action-btn,
.ghost-btn,
.article-teaser button,
.set-filter-actions button,
.set-tier summary,
.set-mini-details summary {
  font-weight: 650;
}

.article-meta,
.tag,
.bestiary-filter-fields span,
.set-filters label,
.set-quality-title,
.set-mini-item::after,
.rune-calculator label {
  font-weight: 650;
}

.database-card {
  font-weight: 500;
}

.database-card-content > strong,
.database-card-set .database-card-content > strong,
.set-mini-body strong,
.set-compare-column h3 {
  font-weight: 700;
}

.database-card-content > span,
.database-card-elixir-body strong,
.set-composition-head span,
.set-tier summary span,
.set-mini-body span,
.set-compare-column header span {
  font-weight: 600;
}

.database-card-lines > div > b,
.database-card-lines-row .database-card-lines > div > b,
.database-card-compact.database-card-lines-row .database-card-lines > div > b,
.database-card-lines-column .database-card-lines > div > b,
.database-card-monster .database-card-lines-side > div > b,
.database-card-monster .database-card-monster-bottom > div > b,
.database-card-monster .monster-field-pair b,
.database-card-monster .database-card-elixir-link > b,
.set-mini-body dt {
  font-weight: 700;
}

.database-card-lines > div > span,
.database-card-lines-row .database-card-lines > div > span,
.database-card-compact.database-card-lines-row .database-card-lines > div > span,
.database-card-lines-column .database-card-lines > div > span,
.database-card-monster .database-card-lines-side > div > span,
.database-card-monster .database-card-monster-bottom > div > span,
.database-card-monster .database-card-elixir-link > span,
.set-mini-body dd,
.set-mini-stats span,
.set-detail-chip-row dd span,
.set-compare-summary span,
.set-compare-summary b {
  font-weight: 500;
}

.database-card-type-abilities .database-card-lines > div > span,
.database-card-type-combo .database-card-lines > div > span,
.combo-steps li {
  font-weight: 500;
}

.combo-zone,
.combo-sequence i,
.elite-stat,
.item-comparison-difference,
.set-compare-summary em {
  font-weight: 700;
}

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

  .quest-catalog-row {
    grid-template-columns: 1fr;
  }

  .quest-fields {
    grid-template-columns: 1fr;
    gap: 3px 0;
  }
}

@media (max-width: 720px) {
  html,
  body {
    min-height: 100%;
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .page-shell,
  .content-stage,
  .article-full,
  .article-body {
    max-width: 100%;
    overflow-x: clip;
    overflow-y: visible;
  }

  .article-full {
    padding-inline: 14px;
  }

  .article-body {
    font-size: 1.08rem;
  }

  .article-body > *,
  .article-body [style*="width"],
  .article-body [style*="max-width"],
  .content-callout,
  .item-card,
  .faq-list,
  .content-image,
  .content-map,
  .rune-calculator,
  .weapon-mastery,
  .article-toc,
  .database-card:not(.database-card-monster) {
    width: 100% !important;
    max-width: 100% !important;
    justify-self: stretch !important;
  }

  .content-columns {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .content-column > .database-card,
  .content-column > .item-card,
  .content-column > .content-callout,
  .content-column > blockquote,
  .content-column > .content-table,
  .content-column > .content-image {
    height: auto;
  }

  .content-table-wrap {
    width: 100% !important;
    max-width: 100% !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .content-table {
    width: max-content;
    min-width: 100%;
    table-layout: auto;
    font-size: 1rem;
  }

  .content-table th,
  .content-table td {
    min-width: 96px;
    padding: 7px 8px;
    overflow-wrap: normal;
    word-break: normal;
  }

  .content-callout,
  .item-card,
  .article-toc {
    padding: 12px;
  }

  .weapon-mastery {
    padding: 12px;
  }

  .weapon-mastery-head {
    align-items: start;
    flex-direction: column;
  }

  .weapon-mastery-table {
    min-width: 760px;
    font-size: 1rem;
  }

  .article-toc ul {
    padding-left: 24px;
    font-size: 1rem;
  }

  .item-card {
    grid-template-columns: 52px minmax(0, 1fr);
    align-items: start;
  }

  .bestiary-filter-results,
  .bestiary-masonry,
  .content-columns:has(.database-card-monster) {
    grid-template-columns: 1fr !important;
    gap: 12px;
  }

  .database-card-monster {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "image"
      "content"
      "bottom" !important;
    gap: 10px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 12px !important;
    overflow: visible !important;
    align-items: start !important;
    align-content: start !important;
  }

  .database-card-monster .database-card-image {
    grid-area: image !important;
    grid-column: 1 !important;
    grid-row: auto !important;
    position: static !important;
    z-index: auto !important;
    float: none !important;
    display: block !important;
    width: 100% !important;
    height: clamp(300px, 88vw, 430px) !important;
    min-height: 300px;
    max-height: 430px;
    opacity: 1 !important;
    background-size: contain !important;
    background-position: var(--card-image-object-x, 50%) var(--card-image-object-y, 50%);
    background-repeat: no-repeat !important;
  }

  .database-card-monster .database-card-content,
  .database-card-monster.database-card-compact:not(.database-card-set) .database-card-content {
    grid-area: content !important;
    grid-column: 1 !important;
    grid-row: auto !important;
    position: relative !important;
    z-index: 1 !important;
    display: grid !important;
    gap: 8px !important;
    overflow: visible !important;
    min-width: 0 !important;
    background: transparent !important;
  }

  .database-card-monster .database-card-content > strong {
    font-size: 1.35rem !important;
    line-height: 1.05;
  }

  .database-card-monster .database-card-content > span {
    font-size: 0.95rem !important;
    line-height: 1.25;
  }

  .database-card-monster .database-card-lines,
  .database-card-monster .database-card-lines-side,
  .database-card-monster .database-card-monster-bottom {
    display: grid !important;
    grid-template-columns: 1fr !important;
    gap: 6px !important;
    width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  .database-card-monster .database-card-monster-bottom {
    grid-area: bottom !important;
    grid-column: 1 !important;
    grid-row: auto !important;
    position: relative !important;
    z-index: 1 !important;
  }

  .database-card-monster .database-card-lines-side > div,
  .database-card-monster .database-card-monster-bottom > div,
  .database-card-monster .database-card-elixir-link {
    display: grid !important;
    grid-template-columns: max-content minmax(0, 1fr) !important;
    align-items: start !important;
    gap: 6px 8px !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    padding: 8px 9px !important;
    overflow: visible !important;
    font-size: 1rem !important;
    line-height: 1.32 !important;
  }

  .database-card-monster .database-card-lines-side > div > b,
  .database-card-monster .database-card-monster-bottom > div > b,
  .database-card-monster .database-card-elixir-link > b {
    white-space: normal !important;
    color: #7b2b24 !important;
    font-size: 1rem !important;
    line-height: 1.25 !important;
  }

  .database-card-monster .database-card-lines-side > div > span,
  .database-card-monster .database-card-monster-bottom > div > span,
  .database-card-monster .database-card-elixir-link > span {
    min-width: 0 !important;
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
    text-align: left !important;
    line-height: 1.35 !important;
    overflow: visible !important;
    max-height: none !important;
  }

  .database-card-elixir-body {
    grid-template-columns: 34px minmax(0, 1fr);
    display: grid;
    align-items: center;
  }

  .combo-finisher {
    gap: 8px;
  }

  .combo-sequence {
    gap: 5px;
  }

  .combo-zone {
    min-height: 24px;
    padding: 2px 8px;
    font-size: 0.92rem;
  }

  .combo-steps {
    padding-left: 20px;
    font-size: 1rem;
    line-height: 1.35;
  }
}

/* Final market board overrides: keep these at EOF so they win over older market rules. */
.market-hero-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  background:
    radial-gradient(circle at 100% 0%, rgba(169, 138, 93, 0.28), transparent 34%),
    linear-gradient(135deg, rgba(255, 252, 235, 0.92), rgba(225, 202, 151, 0.64));
}

.market-hero-side {
  display: grid;
  justify-items: end;
  gap: 10px;
}

.market-hero-panel > div:first-child p:not(.eyebrow) {
  max-width: min(980px, 68vw);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.market-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: flex-end;
}

.market-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid rgba(98, 73, 42, 0.22);
  background: rgba(255, 252, 238, 0.7);
  color: rgba(43, 33, 24, 0.76);
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-weight: 800;
  white-space: nowrap;
}

.market-stats b {
  color: #7b2b24;
}

.market-board {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid rgba(98, 73, 42, 0.28);
  background:
    linear-gradient(180deg, rgba(255, 252, 238, 0.78), rgba(226, 205, 156, 0.44)),
    rgba(231, 215, 184, 0.88);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.18);
}

.market-tabs,
.market-view-switch,
.market-form-steps {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  align-items: center;
}

.market-tabs button,
.market-view-switch button,
.market-form-steps button {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid rgba(98, 73, 42, 0.32);
  background: rgba(255, 252, 238, 0.58);
  color: #4a382c;
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-weight: 900;
  white-space: nowrap;
  box-shadow: inset 0 -1px 0 rgba(98, 73, 42, 0.12);
}

.market-tabs button.active,
.market-view-switch button.active,
.market-form-steps button.active {
  color: #fff2d2;
  border-color: rgba(201, 164, 93, 0.7);
  background: linear-gradient(180deg, rgba(118, 45, 38, 0.96), rgba(75, 31, 25, 0.96));
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

.market-filters {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 180px auto auto;
  gap: 10px;
  align-items: end;
}

.market-filter-type-label {
  display: none !important;
}

.market-filters label {
  display: grid;
  gap: 4px;
  color: #7b2b24;
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-weight: 900;
}

.market-filters input,
.market-filters select {
  min-height: 36px;
  border: 1px solid rgba(78, 56, 35, 0.34);
  background: rgba(255, 250, 231, 0.86);
  color: #2b2118;
  font: 700 1rem var(--body-font, "EB Garamond", serif);
  padding: 6px 9px;
}

.market-form {
  display: grid;
  gap: 18px;
  padding: 0;
  overflow: hidden;
}

.market-form-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px 16px 18px;
  border-bottom: 1px solid rgba(98, 73, 42, 0.18);
  background:
    linear-gradient(90deg, rgba(138, 43, 36, 0.12), transparent 44%),
    rgba(255, 252, 238, 0.6);
}

.market-form-head h3 {
  margin: 2px 0 0;
  color: #2b2118;
  font-size: 1.25rem;
  line-height: 1.05;
}

.market-form-section {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 18px 16px 16px;
  border: 0;
  border-bottom: 1px solid rgba(98, 73, 42, 0.18);
}

.market-form-section.active {
  background: rgba(255, 252, 238, 0.22);
}

.market-form-section legend {
  padding: 0;
  color: #7b2b24;
  font-family: var(--ui-font, "Marcellus SC", serif);
  font-size: 1rem;
  font-weight: 900;
  text-transform: uppercase;
}

.market-mode-toggle {
  width: auto;
}

.market-mode-toggle label span {
  min-width: 112px;
  padding-inline: 12px;
  white-space: nowrap;
}

/* Final market card skin: match database cards. Keep this block at EOF. */
.market-listings {
  grid-template-columns: 1fr;
  gap: 18px;
  align-items: start;
}

.market-listings.market-listings-compact {
  grid-template-columns: 1fr;
}

.market-card-listing {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(92, 71, 45, 0.36);
  border-left: 0;
  background:
    linear-gradient(135deg, rgba(255, 251, 233, 0.88), rgba(235, 221, 185, 0.68)),
    radial-gradient(circle at 0 0, rgba(166, 122, 61, 0.14), transparent 34%);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 219, 0.62), 0 8px 22px rgba(61, 43, 24, 0.08);
}

.market-card-listing header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
}

.market-seller {
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(92, 71, 45, 0.24);
  background: rgba(255, 252, 238, 0.64);
  color: #332820;
  font-weight: 800;
}

.market-seller b {
  color: #7b2b24;
}

.market-item-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 16px;
  align-items: start;
  padding: 0;
  border: 0;
  background: transparent;
  color: #352b21;
  text-decoration: none;
  box-shadow: none;
}

.market-item-card:hover {
  border-color: transparent;
  box-shadow: none;
}

.market-item-card-icon {
  width: 86px;
  height: 86px;
  border: 1px solid rgba(68, 55, 39, 0.42);
  background:
    radial-gradient(circle, rgba(255, 247, 206, 0.2), transparent 58%),
    var(--quality-bg, rgba(44, 39, 31, 0.16));
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.market-item-card-body {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.market-item-card-body strong {
  color: #2b2118;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.42rem;
  font-weight: 900;
  line-height: 1.05;
  overflow-wrap: break-word;
}

.market-item-card-body small,
.market-item-card-body em {
  color: #716759;
  font-size: 0.92rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.2;
}

.market-item-card-lines {
  display: grid;
  gap: 0;
  margin-top: 6px;
  border-top: 1px solid rgba(92, 71, 45, 0.14);
}

.market-item-card-lines > span {
  display: grid;
  grid-template-columns: minmax(130px, 190px) minmax(0, 1fr);
  gap: 14px;
  padding: 7px 0;
  border-bottom: 1px solid rgba(92, 71, 45, 0.11);
  color: #30261d;
  font-size: 1rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.market-item-card-lines b,
.market-card-grid b,
.market-rune-list > b {
  color: #7b2b24;
}

.market-kind,
.market-status {
  min-height: 30px;
  padding: 6px 10px;
  border-color: rgba(92, 71, 45, 0.24);
  background: rgba(255, 252, 238, 0.64);
}

.market-card-grid {
  display: none;
}

.market-rune-list {
  margin: 0;
  border-color: rgba(92, 71, 45, 0.18);
  background: rgba(255, 252, 238, 0.38);
}

.market-comment {
  border: 1px solid rgba(92, 71, 45, 0.16);
  border-left: 3px solid rgba(122, 43, 36, 0.48);
  background: rgba(255, 252, 238, 0.5);
}

.market-card footer {
  margin-top: 0;
  padding-top: 10px;
  border-top: 1px solid rgba(92, 71, 45, 0.14);
}

.market-list-items {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 12px;
  padding: 12px;
  border-color: rgba(92, 71, 45, 0.18);
  background: rgba(255, 252, 238, 0.28);
}

.market-list-items-many,
.market-list-single-item {
  display: grid;
  grid-template-columns: repeat(2, minmax(360px, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid rgba(92, 71, 45, 0.18);
  background: rgba(255, 252, 238, 0.28);
}

.market-list-single-item {
  grid-template-columns: minmax(360px, 1fr);
}

.market-list-item-card {
  display: grid;
  gap: 10px;
  align-content: start;
  min-width: 0;
  padding: 12px;
  border-color: rgba(92, 71, 45, 0.16);
  border: 1px solid rgba(92, 71, 45, 0.22);
  background:
    linear-gradient(135deg, rgba(255, 252, 238, 0.72), rgba(239, 226, 193, 0.54)),
    radial-gradient(circle at 0 0, rgba(255, 249, 220, 0.8), transparent 34%);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 219, 0.42);
}

.market-list-item-card.market-list-item-with-runes {
  grid-template-columns: minmax(0, 1fr) minmax(220px, 0.74fr);
  grid-template-areas:
    "head runes"
    "price runes"
    "details details";
}

.market-list-item-with-runes .market-list-item-head {
  grid-area: head;
}

.market-list-item-with-runes .market-list-item-price {
  grid-area: price;
}

.market-list-item-with-runes .market-list-item-runes {
  grid-area: runes;
}

.market-list-item-with-runes .market-list-item-details {
  grid-area: details;
}

.market-list-item-head {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.market-list-item-art {
  width: 72px;
  height: 72px;
  border: 1px solid rgba(68, 55, 39, 0.42);
  background:
    radial-gradient(circle, rgba(255, 247, 206, 0.22), transparent 58%),
    var(--quality-bg, rgba(44, 39, 31, 0.16));
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.market-list-item-main {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.market-list-item-main strong {
  color: #2b2118;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.34rem;
  font-weight: 900;
  line-height: 1.05;
  overflow-wrap: break-word;
}

.market-list-item-main small {
  color: #716759;
  font-size: 0.9rem;
  font-weight: 800;
  line-height: 1.2;
}

.market-list-item-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 2px;
}

.market-list-item-badges span,
.market-list-item-price,
.market-list-item-runes {
  border: 1px solid rgba(92, 71, 45, 0.14);
  background: rgba(255, 252, 238, 0.56);
}

.market-list-item-badges span {
  padding: 3px 7px;
  color: #6e2b24;
  font-size: 0.88rem;
  font-weight: 900;
}

.market-list-item-price {
  padding: 7px 9px;
  color: #332820;
  font-size: 1rem;
}

.market-list-item-price b,
.market-list-item-runes > b {
  color: #7b2b24;
}

.market-list-item-runes {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
  align-items: start;
  padding: 8px 9px;
}

.market-list-item-runes > span {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  min-width: 0;
}

.market-list-item-details {
  border-top: 1px solid rgba(92, 71, 45, 0.14);
  padding-top: 8px;
}

.market-list-item-details summary {
  display: inline-flex;
  gap: 10px;
  align-items: center;
  color: #7b2b24;
  cursor: pointer;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.12rem;
  font-weight: 900;
  list-style: none;
}

.market-list-item-details summary::-webkit-details-marker {
  display: none;
}

.market-list-item-details summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid rgba(122, 43, 36, 0.28);
  background: rgba(255, 252, 238, 0.62);
  color: #7b2b24;
  line-height: 1;
}

.market-list-item-details[open] summary::before {
  content: "-";
}

.market-list-item-details .market-item-card-lines {
  margin-top: 8px;
}

.market-list-item-details .market-item-card-lines > span {
  grid-template-columns: minmax(116px, 152px) minmax(0, 1fr);
}

.market-empty-line {
  display: block;
  margin-top: 8px;
  color: #716759;
  font-style: italic;
}

.market-listings-compact .market-card-listing {
  padding: 12px;
}

.market-listings-compact .market-item-card-lines {
  display: none;
}

.market-listings-compact .market-list-item-details .market-item-card-lines {
  display: grid;
}

.market-listings-compact .market-list-items,
.market-listings-compact .market-list-items-many,
.market-listings-compact .market-list-single-item {
  grid-template-columns: repeat(2, minmax(360px, 1fr));
}

.market-listings-compact .market-list-single-item {
  grid-template-columns: minmax(360px, 1fr);
}

.market-card-listing.market-card-highlight {
  outline: 2px solid rgba(201, 164, 93, 0.9);
  box-shadow:
    0 0 0 4px rgba(122, 43, 36, 0.12),
    0 18px 42px rgba(71, 42, 17, 0.2),
    inset 0 0 0 1px rgba(255, 252, 238, 0.5);
}

@media (max-width: 1300px) {
  .market-listings {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .market-hero-panel > div:first-child p:not(.eyebrow) {
    max-width: none;
    white-space: normal;
  }

  .market-card-listing header,
  .market-item-card,
  .market-list-draft-row-compact,
  .market-list-item-row,
  .market-list-item-head,
  .market-list-item-runes,
  .market-list-item-card.market-list-item-with-runes {
    grid-template-columns: 1fr;
    grid-template-areas: none;
  }

  .market-list-item-with-runes .market-list-item-head,
  .market-list-item-with-runes .market-list-item-price,
  .market-list-item-with-runes .market-list-item-runes,
  .market-list-item-with-runes .market-list-item-details {
    grid-area: auto;
  }

  .market-list-items,
  .market-list-items-many,
  .market-list-single-item,
  .market-listings-compact .market-list-items,
  .market-listings-compact .market-list-items-many,
  .market-listings-compact .market-list-single-item {
    grid-template-columns: 1fr;
    padding: 8px;
  }

  .market-item-card-icon {
    width: 74px;
    height: 74px;
  }

  .market-item-card-lines > span,
  .market-list-item-details .market-item-card-lines > span {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

/* Final mobile polish: keep this block last so it wins over older responsive rules. */
@media (max-width: 1040px) {
  .codex-navbar {
    grid-template-columns: minmax(0, 1fr) 52px !important;
    align-items: center;
    gap: 8px 12px;
    min-height: 72px;
    padding: 8px 12px !important;
  }

  .codex-navbar::before {
    inset: 6px !important;
  }

  .brand {
    min-width: 0;
  }

  .brand-mark {
    --brand-icon-size: 46px;
  }

  .brand-text {
    max-width: min(56vw, 250px);
    font-size: clamp(0.68rem, 2.7vw, 0.82rem);
    line-height: 1.12;
    overflow-wrap: normal;
  }

  .nav-toggle {
    justify-self: end;
  }

  .codex-navbar .main-nav,
  .codex-navbar .nav-search {
    position: static !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    box-sizing: border-box;
  }

  .nav-open .codex-navbar .main-nav {
    display: grid !important;
    grid-template-columns: 1fr;
    gap: 4px;
    max-height: min(62vh, 520px);
    margin-top: 6px;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 10px;
    border: 1px solid rgba(201, 164, 93, 0.42);
    background:
      linear-gradient(180deg, rgba(34, 27, 23, 0.98), rgba(18, 15, 13, 0.98)),
      rgba(18, 15, 13, 0.96);
    box-shadow: 0 18px 36px rgba(0, 0, 0, 0.32);
  }

  .nav-open .codex-navbar .nav-search {
    display: grid !important;
    margin-top: 0;
    padding: 10px;
    border: 1px solid rgba(201, 164, 93, 0.42);
    border-top: 0;
    background:
      linear-gradient(180deg, rgba(34, 27, 23, 0.98), rgba(18, 15, 13, 0.98)),
      rgba(18, 15, 13, 0.96);
  }

  .codex-navbar .nav-item {
    display: grid;
    width: 100%;
    min-width: 0;
  }

  .codex-navbar .nav-item::after {
    display: none;
  }

  .codex-navbar .main-nav a {
    width: 100%;
    min-height: 40px;
    justify-content: flex-start;
    padding: 8px 12px;
    font-size: 0.84rem;
  }

  .codex-navbar .nav-dropdown {
    position: static !important;
    right: auto !important;
    left: auto !important;
    display: none;
    min-width: 0;
    max-width: 100%;
    margin: 0 0 7px 12px;
    padding: 6px;
    border-width: 1px;
    opacity: 1 !important;
    pointer-events: auto !important;
    transform: none !important;
    box-shadow: none;
  }

  .codex-navbar .nav-item.mobile-expanded .nav-dropdown,
  .codex-navbar .nav-item:focus-within .nav-dropdown {
    display: grid;
  }

  .codex-navbar .nav-item.mobile-expanded > a {
    color: var(--aaa-gold-bright);
    background: radial-gradient(circle at 50% 100%, rgba(201, 164, 93, 0.16), transparent 64%);
  }

  .codex-navbar .nav-dropdown button {
    min-height: 34px;
    padding: 7px 9px;
    font-size: 0.95rem;
  }

  .site-search-results {
    position: static;
    width: 100%;
    max-height: min(46vh, 420px);
    margin-top: 8px;
  }
}

@media (min-width: 861px) and (max-width: 2399px) {
  .bestiary-filter-results,
  .bestiary-masonry,
  .content-columns:has(.database-card-monster) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 2400px) and (max-width: 3399px) {
  .bestiary-filter-results,
  .bestiary-masonry,
  .content-columns:has(.database-card-monster) {
    grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  }
}

@media (min-width: 3400px) {
  .bestiary-filter-results,
  .bestiary-masonry,
  .content-columns:has(.database-card-monster) {
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
  }
}

@media (max-width: 720px) {
  html,
  body {
    width: 100%;
    overflow-x: hidden;
    overflow-y: auto;
  }

  body.nav-open {
    overflow-y: auto;
  }

  .page-shell {
    width: 100%;
    padding-inline: 8px;
  }

  .content-stage,
  .article-page,
  .article-full,
  .article-body,
  .view,
  .home-top-panels,
  .player-lookup-panel {
    width: 100%;
    max-width: 100%;
    min-width: 0;
    overflow-x: clip;
  }

  .article-page {
    padding: 12px 0 36px;
  }

  .article-full {
    padding: 12px 10px;
  }

  .article-body {
    font-size: 1rem;
    line-height: 1.48;
  }

  .article-body h1,
  .article-body h2,
  .article-body h3,
  #pageTitle {
    max-width: 100%;
    overflow-wrap: anywhere;
  }

  .article-body > *,
  .article-body [style*="width"],
  .article-body [style*="max-width"],
  .content-callout,
  .content-note,
  .content-image,
  .content-map,
  .content-table-wrap,
  .content-table,
  .item-card,
  .article-toc,
  .faq-list,
  .rune-calculator,
  .weapon-mastery,
  .database-card,
  .map-card,
  .map-variant {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    justify-self: stretch !important;
  }

  .content-columns,
  .content-map-layout,
  .content-map-layout-row,
  .map-floors-row,
  .bestiary-filter-results,
  .bestiary-masonry,
  .content-columns:has(.database-card-monster) {
    grid-template-columns: 1fr !important;
    overflow: visible !important;
  }

  .content-column {
    min-width: 0;
  }

  .content-table-wrap,
  .table-wrap,
  .database-table-wrap,
  .weapon-mastery-table-wrap {
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
  }

  .content-table {
    width: max-content !important;
    min-width: 100% !important;
    table-layout: auto !important;
  }

  .content-table th,
  .content-table td {
    min-width: 92px;
    white-space: normal;
    overflow-wrap: normal;
    word-break: normal;
  }

  .content-map {
    display: grid;
    justify-items: center;
    overflow-x: auto !important;
    overflow-y: visible !important;
    padding: 10px;
  }

  .map-grid-frame {
    max-width: 100%;
    overflow-x: auto !important;
    overflow-y: visible !important;
    justify-content: start;
  }

  .map-grid-scale {
    width: max-content !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    transform: none !important;
  }

  .map-grid-scale > .map-grid,
  .content-map .map-grid {
    --map-cell-size: clamp(21px, 8.5vw, 34px);
    width: max-content;
  }

  .database-card-monster,
  .database-card-monster.database-card-compact:not(.database-card-set) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "image"
      "content"
      "bottom" !important;
    gap: 10px !important;
    padding: 12px !important;
    overflow: visible !important;
  }

  .database-card-monster .database-card-image {
    grid-area: image !important;
    width: 100% !important;
    height: clamp(270px, 86vw, 410px) !important;
    min-height: 270px !important;
    max-height: 410px !important;
    background-size: contain !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
  }

  .database-card-monster .database-card-content,
  .database-card-monster.database-card-compact:not(.database-card-set) .database-card-content {
    grid-area: content !important;
    grid-column: auto !important;
    grid-row: auto !important;
    overflow: visible !important;
  }

  .database-card-monster .database-card-lines-side,
  .database-card-monster .database-card-monster-bottom {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .database-card-monster .database-card-monster-bottom {
    grid-area: bottom !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .database-card-monster .database-card-lines-side > div,
  .database-card-monster .database-card-monster-bottom > div,
  .database-card-monster .database-card-elixir-link {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    grid-template-columns: none !important;
    min-width: 0 !important;
    overflow: visible !important;
    font-size: 0.98rem !important;
    gap: 3px 8px !important;
  }

  .database-card-monster .database-card-lines-side > div > b,
  .database-card-monster .database-card-monster-bottom > div > b,
  .database-card-monster .database-card-elixir-link > b {
    white-space: normal !important;
    flex: 0 0 auto !important;
    width: auto !important;
  }

  .database-card-monster .database-card-lines-side > div > span,
  .database-card-monster .database-card-monster-bottom > div > span,
  .database-card-monster .database-card-elixir-link > span {
    max-height: none !important;
    overflow: visible !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    white-space: normal !important;
    flex: 1 1 9rem !important;
    width: auto !important;
    min-width: min(100%, 7rem) !important;
  }

  .database-card-monster .database-card-elixir-link > span {
    display: flex !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 7px !important;
  }

  .bestiary-filter-panel,
  .map-article-filter,
  .set-filters,
  .market-hero-panel {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 1100px) and (pointer: coarse) {
  .bestiary-filter-results,
  .bestiary-masonry,
  .content-columns:has(.database-card-monster) {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }

  .database-card-monster,
  .database-card-monster.database-card-compact:not(.database-card-set) {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-areas:
      "image"
      "content"
      "bottom" !important;
    gap: 10px !important;
    overflow: visible !important;
  }

  .database-card-monster .database-card-image {
    grid-area: image !important;
    width: 100% !important;
    height: clamp(240px, 68vw, 410px) !important;
    min-height: 240px !important;
    max-height: 410px !important;
    background-size: contain !important;
    background-position: center bottom !important;
    background-repeat: no-repeat !important;
  }

  .database-card-monster .database-card-content,
  .database-card-monster.database-card-compact:not(.database-card-set) .database-card-content {
    grid-area: content !important;
    grid-column: auto !important;
    grid-row: auto !important;
    overflow: visible !important;
  }

  .database-card-monster .database-card-lines-side,
  .database-card-monster .database-card-monster-bottom {
    grid-template-columns: 1fr !important;
    width: 100% !important;
    overflow: visible !important;
  }

  .database-card-monster .database-card-monster-bottom {
    grid-area: bottom !important;
    grid-column: auto !important;
    grid-row: auto !important;
  }

  .database-card-monster .database-card-lines-side > div,
  .database-card-monster .database-card-monster-bottom > div,
  .database-card-monster .database-card-elixir-link {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: baseline !important;
    grid-template-columns: none !important;
    gap: 3px 8px !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  .database-card-monster .database-card-lines-side > div > b,
  .database-card-monster .database-card-monster-bottom > div > b,
  .database-card-monster .database-card-elixir-link > b {
    flex: 0 0 auto !important;
    width: auto !important;
    white-space: normal !important;
  }

  .database-card-monster .database-card-lines-side > div > span,
  .database-card-monster .database-card-monster-bottom > div > span,
  .database-card-monster .database-card-elixir-link > span {
    flex: 1 1 9rem !important;
    min-width: min(100%, 7rem) !important;
    width: auto !important;
    max-width: 100% !important;
    overflow: visible !important;
    overflow-wrap: break-word !important;
    word-break: normal !important;
    white-space: normal !important;
  }
}

/* Market ledger view: one shared row list instead of seller cards. Keep after old market rules. */
.market-listings.market-listings-table,
.market-listings-compact.market-listings-table {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: start;
}

.market-listings-table .market-table-row {
  display: block;
  border: 1px solid rgba(92, 71, 45, 0.3);
  background:
    linear-gradient(135deg, rgba(255, 252, 238, 0.86), rgba(236, 222, 189, 0.62)),
    radial-gradient(circle at 0 0, rgba(166, 122, 61, 0.12), transparent 34%);
  box-shadow: inset 0 0 0 1px rgba(255, 247, 219, 0.55);
}

.market-listings-table .market-table-row[open] {
  border-color: rgba(122, 43, 36, 0.36);
  box-shadow:
    inset 0 0 0 1px rgba(255, 247, 219, 0.62),
    0 10px 26px rgba(67, 45, 22, 0.08);
}

.market-table-row-summary {
  display: grid;
  grid-template-columns: minmax(280px, 1.25fr) minmax(180px, 0.72fr) minmax(126px, 0.3fr) minmax(150px, 0.4fr) minmax(128px, 0.34fr) 176px;
  gap: 8px;
  align-items: center;
  min-height: 84px;
  padding: 8px 10px;
  cursor: pointer;
  list-style: none;
}

.market-table-row-summary::-webkit-details-marker {
  display: none;
}

.market-table-deal,
.market-table-seller,
.market-table-price,
.market-table-details-label {
  min-width: 0;
  padding: 7px 9px;
  border: 1px solid rgba(92, 71, 45, 0.16);
  background: rgba(255, 252, 238, 0.62);
  color: #332820;
  font-weight: 900;
  font-family: inherit;
  font-size: 0.94rem;
  line-height: 1.18;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-table-deal b,
.market-table-seller b,
.market-table-price b,
.market-table-details-label {
  color: #7b2b24;
}

.market-table-deal {
  overflow: visible;
  text-overflow: clip;
}

.market-table-product {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.market-table-art {
  width: 66px;
  height: 66px;
  border: 1px solid rgba(68, 55, 39, 0.42);
  background:
    radial-gradient(circle, rgba(255, 247, 206, 0.22), transparent 58%),
    var(--quality-bg, rgba(44, 39, 31, 0.16));
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
}

.market-table-product-text {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.market-table-product-text strong {
  color: #2b2118;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: 1.22rem;
  font-weight: 900;
  line-height: 1.05;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-table-product-text small,
.market-table-product-text em {
  color: #716759;
  font-size: 0.9rem;
  font-style: normal;
  font-weight: 800;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-table-runes {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  align-items: center;
  min-width: 0;
  overflow: hidden;
}

.market-table-runes .market-rune-chip {
  grid-template-columns: 34px minmax(0, 1fr);
  min-width: 0;
  max-width: 180px;
  min-height: 44px;
  padding: 4px 6px;
}

.market-table-runes .market-rune-chip i {
  width: 34px;
  height: 34px;
}

.market-table-runes .market-rune-chip strong,
.market-table-runes .market-rune-chip small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-table-empty {
  color: #716759;
  font-style: italic;
  font-weight: 800;
}

.market-table-details-label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 154px;
  text-align: center;
  overflow: visible;
  text-overflow: clip;
}

.market-table-details-label i {
  position: relative;
  display: block;
  flex: 0 0 22px;
  width: 22px;
  height: 22px;
  border: 1px solid rgba(122, 43, 36, 0.28);
  background: rgba(255, 252, 238, 0.7);
  font-style: normal;
  line-height: 1;
}

.market-table-details-label i::before {
  content: "+";
  position: absolute;
  left: 50%;
  top: 50%;
  line-height: 1;
  transform: translate(-50%, -54%);
}

.market-table-row[open] .market-table-details-label i::before {
  content: "-";
}

.market-table-details-panel {
  display: grid;
  gap: 10px;
  padding: 12px;
  border-top: 1px solid rgba(92, 71, 45, 0.16);
  background: rgba(255, 252, 238, 0.3);
}

.market-table-details-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.market-table-details-grid h4 {
  margin: 0 0 8px;
  color: #2b2118;
  font-size: 1.35rem;
  line-height: 1.1;
}

.market-table-details-grid aside {
  display: grid;
  grid-template-columns: repeat(5, minmax(145px, 1fr));
  gap: 8px;
  align-content: start;
}

.market-table-details-grid aside span {
  padding: 7px 9px;
  border: 1px solid rgba(92, 71, 45, 0.14);
  background: rgba(255, 252, 238, 0.58);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.market-table-details-grid aside b {
  color: #7b2b24;
}

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

.market-table-actions a,
.market-table-actions button {
  padding: 6px 10px;
  border: 1px solid rgba(122, 43, 36, 0.24);
  background: rgba(255, 252, 238, 0.7);
  color: #7b2b24;
  font: inherit;
  font-weight: 900;
  text-decoration: none;
  cursor: pointer;
}

.market-table-row.market-card-highlight {
  outline: 2px solid rgba(201, 164, 93, 0.92);
  box-shadow:
    0 0 0 4px rgba(122, 43, 36, 0.12),
    0 18px 42px rgba(71, 42, 17, 0.2),
    inset 0 0 0 1px rgba(255, 252, 238, 0.5);
}

@media (max-width: 1220px) {
  .market-table-row-summary {
    grid-template-columns: minmax(230px, 1fr) minmax(160px, 0.68fr) minmax(112px, 0.28fr) minmax(128px, 0.36fr) 164px;
  }

  .market-table-price {
    display: none;
  }

  .market-table-details-grid aside {
    grid-template-columns: repeat(3, minmax(145px, 1fr));
  }
}

@media (max-width: 760px) {
  .market-table-row-summary {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 10px;
  }

  .market-table-product {
    grid-template-columns: 58px minmax(0, 1fr);
  }

  .market-table-art {
    width: 58px;
    height: 58px;
  }

  .market-table-product-text strong,
  .market-table-product-text small,
  .market-table-product-text em,
  .market-table-deal,
  .market-table-seller,
  .market-table-price,
  .market-table-details-label {
    white-space: normal;
  }

  .market-table-price {
    display: block;
  }

  .market-table-runes {
    flex-wrap: wrap;
    overflow: visible;
  }

  .market-table-runes .market-rune-chip {
    max-width: 100%;
  }

  .market-table-details-grid {
    grid-template-columns: 1fr;
  }

  .market-table-actions {
    justify-content: flex-start;
  }

  .market-admin-edit-grid,
  .market-admin-edit-item {
    grid-template-columns: 1fr;
  }

  .market-table-details-grid aside {
    grid-template-columns: 1fr;
  }

  .market-table-details-grid aside span {
    white-space: normal;
  }
}
.database-safety-status {
  position: sticky;
  top: 0;
  z-index: 10000;
  display: grid;
  gap: 0.25rem;
  padding: 0.9rem 1.2rem;
  border-bottom: 2px solid #7c2d22;
  background: #fff2d7;
  color: #4b231c;
  box-shadow: 0 4px 16px rgb(52 29 18 / 22%);
}

.database-safety-status strong {
  color: #7c2d22;
}

.database-safety-status small {
  opacity: 0.75;
}

.bugs-page {
  display: grid;
  gap: 1rem;
}

.game-market-page {
  display: grid;
  gap: 1rem;
}

.game-market-hero,
.game-market-controls {
  border: 1px solid rgb(126 89 45 / 28%);
  background: linear-gradient(135deg, rgb(255 249 229 / 94%), rgb(232 210 160 / 72%));
  box-shadow: 0 12px 28px rgb(55 34 15 / 10%);
}

.game-market-controls {
  overflow: hidden;
}

.game-market-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
}

.game-market-hero h2 {
  margin: 0;
}

.game-market-hero-content {
  min-width: 0;
  flex: 1;
}

.game-market-hero-side {
  display: grid;
  justify-items: end;
  gap: 0.6rem;
}

.game-market-hero-toggle {
  white-space: nowrap;
  font-size: 0.75rem;
}

.game-market-hero.is-collapsed {
  align-items: center;
  padding-block: 0.55rem;
}

.game-market-hero.is-collapsed .game-market-hero-content {
  display: none;
}

.game-market-hero.is-collapsed .game-market-hero-side {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.game-market-hero p:not(.eyebrow) {
  margin: 0.35rem 0 0;
}

.game-market-hero-description.is-single-line {
  white-space: nowrap;
}

.game-market-hero-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(260px, 1fr));
  gap: 0.45rem 0.75rem;
  max-width: 1080px;
  margin: 0.8rem 0 0;
  padding: 0;
  list-style: none;
}

.game-market-hero-rules li {
  position: relative;
  padding: 0.5rem 0.65rem 0.5rem 1.65rem;
  border: 1px solid rgba(126, 89, 45, 0.18);
  background: rgba(255, 252, 240, 0.52);
  color: #5e5040;
  font-size: 0.78rem;
  font-weight: 700;
  line-height: 1.3;
}

.game-market-hero-rules li::before {
  position: absolute;
  top: 0.48rem;
  left: 0.62rem;
  color: #8a3327;
  content: "◆";
  font-size: 0.65rem;
}

.game-market-stats {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
  min-width: 230px;
}

.game-market-stats span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgb(126 89 45 / 22%);
  background: rgb(255 252 240 / 72%);
}

.game-market-toolbar {
  display: grid;
  grid-template-columns: auto minmax(260px, 1fr) auto;
  align-items: end;
  gap: 0.75rem;
  padding: 0.85rem 1rem;
  border-bottom: 1px solid rgba(126, 89, 45, 0.18);
}

.game-market-tabs {
  display: flex;
  gap: 0.4rem;
}

.game-market-tabs button {
  min-height: 38px;
  padding: 7px 14px;
  border: 1px solid rgba(98, 73, 42, 0.32);
  background: rgba(255, 252, 238, 0.72);
  color: #4a382c;
  font-family: var(--aaa-ui);
  font-weight: 900;
  cursor: pointer;
}

.game-market-tabs button.active {
  color: #fff2d2;
  border-color: rgba(201, 164, 93, 0.7);
  background: linear-gradient(180deg, rgba(118, 45, 38, 0.96), rgba(75, 31, 25, 0.96));
}

.game-market-search {
  display: grid;
  gap: 0.25rem;
  color: #7b2b24;
  font-family: var(--aaa-ui);
  font-weight: 900;
}

.game-market-search input {
  width: 100%;
  min-height: 38px;
}

.game-market-filter-panel {
  display: grid;
  grid-template-columns: minmax(360px, 1fr) minmax(145px, 190px) minmax(210px, 260px) minmax(125px, 155px) auto;
  align-items: end;
  gap: 0.75rem;
  padding: 0.8rem 1rem;
}

.game-market-category-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.game-market-category-filters button {
  min-height: 36px;
  padding: 6px 12px;
  border: 1px solid rgba(98, 73, 42, 0.3);
  background: rgba(255, 252, 238, 0.7);
  color: #4a382c;
  font-family: var(--aaa-ui);
  font-weight: 900;
  cursor: pointer;
}

.game-market-category-filters button.active {
  color: #fff2d2;
  background: linear-gradient(180deg, rgba(118, 45, 38, 0.96), rgba(75, 31, 25, 0.96));
}

.game-market-filter-panel > label {
  display: grid;
  gap: 0.25rem;
  color: #7b2b24;
  font-family: var(--aaa-ui);
  font-weight: 900;
}

.game-market-filter-panel select {
  width: 100%;
  min-height: 36px;
}

.game-market-status {
  color: #6d241d;
  font-family: var(--aaa-ui);
  font-weight: 900;
}

.game-market-status.is-error {
  color: #8a2b24;
}

.game-market-status-badge {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 1.12rem;
  height: 1.12rem;
  margin-left: 0.25rem;
  padding: 0;
  border: 1px solid rgba(154, 105, 25, 0.35);
  border-radius: 50%;
  background: rgba(232, 184, 77, 0.16);
  color: #765119;
  font-family: Georgia, serif;
  font-size: 0.72em;
  font-style: italic;
  font-weight: 800;
  line-height: 1;
  vertical-align: middle;
  cursor: help;
}

.game-market-status-badge::after {
  content: attr(data-tooltip);
  position: absolute;
  z-index: 30;
  left: 50%;
  bottom: calc(100% + 0.55rem);
  width: max-content;
  max-width: min(320px, 80vw);
  padding: 0.45rem 0.6rem;
  transform: translateX(-50%) translateY(0.2rem);
  border: 1px solid rgba(109, 36, 29, 0.24);
  border-radius: 4px;
  background: #fff8e3;
  box-shadow: 0 5px 16px rgba(64, 44, 25, 0.18);
  color: #4d4033;
  font-family: var(--aaa-ui);
  font-size: 0.78rem;
  font-style: normal;
  font-weight: 700;
  line-height: 1.35;
  text-align: left;
  white-space: normal;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 120ms ease, transform 120ms ease, visibility 120ms ease;
}

.game-market-status-badge:hover::after,
.game-market-status-badge:focus-visible::after {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  visibility: visible;
}

.game-market-status-badge:focus-visible {
  outline: 2px solid rgba(109, 36, 29, 0.45);
  outline-offset: 2px;
}

.game-market-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(70, 57, 41, 0.28);
  background: rgba(255, 250, 234, 0.46);
}

.game-market-table {
  min-width: 1180px;
}

.game-market-table th:first-child,
.game-market-table td:first-child {
  width: 25%;
}

.game-market-table th:nth-child(2),
.game-market-table td:nth-child(2) {
  width: 6%;
}

.game-market-table th:nth-child(3),
.game-market-table td:nth-child(3) {
  width: 30%;
}

.game-market-row {
  cursor: pointer;
  transition: background 140ms ease;
}

.game-market-sort-button {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-transform: inherit;
  cursor: pointer;
}

.game-market-sort-button span {
  color: #967153;
  font-size: 0.9em;
}

.game-market-sort-button.active span {
  color: #7c2d22;
}

.game-market-sort-button:hover,
.game-market-sort-button:focus-visible {
  color: #5f211c;
  outline: none;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.game-market-row:hover,
.game-market-row:focus-visible,
.game-market-row[aria-expanded="true"] {
  outline: none;
  background: rgba(126, 45, 37, 0.07);
}

.game-market-item-cell {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 320px;
}

.game-market-item-visual {
  display: grid;
  justify-items: center;
  flex: 0 0 52px;
  gap: 3px;
}

.game-market-item-art {
  display: block;
  width: 50px;
  height: 50px;
  border: 1px solid rgba(70, 57, 41, 0.3);
  background-color: var(--quality-bg, rgba(255, 252, 240, 0.7));
  box-shadow: inset 0 0 12px rgb(255 248 219 / 22%);
}

.game-market-item-art img,
.game-market-rune-icon img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.game-market-item-name {
  flex: 1 1 auto;
  min-width: 0;
}

.game-market-item-name strong {
  overflow-wrap: anywhere;
}

.game-market-offer-badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-top: 0.3rem;
  padding: 0.18rem 0.42rem;
  border: 1px solid rgba(135, 78, 24, 0.35);
  background: rgba(210, 152, 54, 0.16);
  color: #7a351f;
  font-family: var(--aaa-ui);
  font-size: 0.67rem;
  font-weight: 900;
  letter-spacing: 0.025em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.game-market-row.has-multiple-offers .game-market-item-cell {
  box-shadow: inset 4px 0 0 rgba(190, 119, 34, 0.72);
}

.game-market-tier {
  color: #6d241d;
  font-family: var(--aaa-ui);
  font-weight: 900 !important;
  text-align: center;
}

.game-market-summary-cell {
  min-width: 320px;
  max-width: 520px;
  overflow: hidden;
  white-space: normal !important;
}

.game-market-summary-cell > * {
  max-width: 100%;
}

.game-market-compact-chips {
  display: grid;
  grid-template-columns: repeat(2, minmax(120px, 1fr));
  gap: 3px 7px;
}

.game-market-compact-chips > span {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  min-width: 0;
  color: #675a49;
}

.game-market-compact-chips small {
  overflow: hidden;
  font-size: 0.73rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.game-market-compact-chips b {
  flex: 0 0 auto;
  color: #5a2923;
  font-size: 0.78rem;
  white-space: nowrap;
}

.game-market-compact-chips .is-enchant {
  color: #6c407a;
}

.game-market-compact-effect {
  display: -webkit-box;
  overflow: hidden;
  overflow-wrap: anywhere;
  color: #5f5242;
  font-size: 0.8rem;
  font-weight: 700;
  line-height: 1.25;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.game-market-compact-empty {
  color: #8a7c69;
  font-size: 0.78rem;
  font-style: italic;
}

.game-market-rune-icons {
  display: flex;
  justify-content: center;
  gap: 2px;
}

.game-market-rune-icon {
  display: block;
  width: 15px;
  height: 15px;
  border: 1px solid rgba(70, 57, 41, 0.32);
  background-color: var(--quality-bg, rgba(255, 252, 240, 0.72));
}

.game-market-item-cell strong {
  display: block;
}

.game-market-item-cell strong {
  color: #2c2118;
  font-family: var(--aaa-title);
  font-size: 1.08rem;
  font-weight: 900;
}

.game-market-price {
  color: #7b2b24;
  font-weight: 900 !important;
}

.game-market-price-value {
  display: block;
  white-space: nowrap;
}

.game-market-price small {
  display: block;
  margin-top: 0.15rem;
  color: #806d59;
  font-size: 0.68rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
}

.game-market-toggle-cell {
  width: 54px;
  min-width: 54px;
  padding-right: 0.7rem !important;
  padding-left: 0.35rem !important;
  text-align: center;
}

.game-market-row-toggle {
  display: inline-grid;
  width: 32px;
  height: 32px;
  padding: 0;
  place-items: center;
  border: 1px solid rgba(126, 45, 37, 0.38);
  background: rgba(255, 250, 232, 0.78);
  color: #7e2d25;
  font-family: var(--aaa-ui);
  font-size: 1.15rem;
  font-weight: 900;
  line-height: 1;
  cursor: pointer;
}

.game-market-row-toggle:hover,
.game-market-row-toggle:focus-visible {
  outline: 2px solid rgba(126, 45, 37, 0.24);
  background: rgba(126, 45, 37, 0.1);
}

.game-market-row-toggle.has-alternatives {
  position: relative;
  border-color: rgba(156, 87, 24, 0.7);
  background: rgba(220, 167, 71, 0.2);
  box-shadow: 0 0 0 2px rgba(220, 167, 71, 0.1);
}

.game-market-row-toggle.has-alternatives > span {
  position: absolute;
  top: -8px;
  right: -8px;
  display: grid;
  min-width: 18px;
  height: 18px;
  padding: 0 4px;
  place-items: center;
  border: 1px solid rgba(255, 248, 224, 0.85);
  border-radius: 999px;
  background: #8b3525;
  color: #fff9e9;
  font-size: 0.62rem;
  line-height: 1;
}

.game-market-detail td {
  padding: 0;
  white-space: normal;
  background: rgba(255, 252, 240, 0.72);
}

.game-market-detail-body {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.8rem;
  padding: 0.9rem 1.1rem 1rem 4.9rem;
}

.game-market-detail-body section {
  min-width: 0;
  padding: 0.75rem;
  border: 1px solid rgba(126, 89, 45, 0.2);
  background: rgba(255, 249, 229, 0.58);
}

.game-market-detail-body .game-market-offers {
  grid-column: 1 / -1;
  padding: 0;
  overflow: hidden;
}

.game-market-detail-body .game-market-offers h4 {
  margin: 0;
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid rgba(126, 89, 45, 0.2);
  background: rgba(126, 45, 37, 0.06);
}

.game-market-offer-list {
  display: grid;
}

.game-market-offer {
  display: grid;
  grid-template-columns: 2rem minmax(100px, 0.55fr) minmax(80px, 0.38fr) minmax(110px, 0.48fr) minmax(320px, 2fr);
  align-items: center;
  gap: 0.65rem;
  min-width: 0;
  padding: 0.55rem 0.7rem;
  border-top: 1px solid rgba(126, 89, 45, 0.14);
}

.game-market-offer:first-child {
  border-top: 0;
}

.game-market-offer.is-cheapest {
  background: rgba(102, 133, 61, 0.08);
}

.game-market-offer-number {
  display: inline-grid;
  width: 1.7rem;
  height: 1.7rem;
  place-items: center;
  border: 1px solid rgba(126, 89, 45, 0.24);
  color: #7c2d22;
  font-family: var(--aaa-ui);
  font-weight: 900;
}

.game-market-offer > span:not(.game-market-offer-number) {
  display: grid;
  min-width: 0;
  gap: 0.1rem;
}

.game-market-offer > span > small {
  color: #806f5b;
  font-size: 0.67rem;
  text-transform: uppercase;
}

.game-market-offer > span > strong {
  color: #5a2923;
  white-space: nowrap;
}

.game-market-offer > span > em {
  color: #5c762f;
  font-size: 0.68rem;
  font-style: normal;
  font-weight: 900;
  text-transform: uppercase;
}

.game-market-offer-summary {
  padding-left: 0.65rem;
  border-left: 1px solid rgba(126, 89, 45, 0.18);
}

.game-market-detail-body h4 {
  margin: 0 0 0.55rem;
  color: #7c2d22;
  font-family: var(--aaa-ui);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.game-market-detail-body small {
  margin: 0;
  overflow-wrap: anywhere;
}

.game-market-stat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0.35rem;
}

.game-market-stat-grid > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.4rem;
  padding: 0.38rem 0.45rem;
  border: 1px solid rgba(126, 89, 45, 0.16);
  background: rgba(255, 252, 240, 0.65);
}

.game-market-stat-grid strong {
  color: #7c2d22;
  font-family: var(--aaa-ui);
  white-space: nowrap;
}

.game-market-stat-grid em {
  grid-column: 1 / -1;
  color: #766958;
  font-size: 0.72rem;
  font-style: normal;
}

.game-market-enchants .game-market-stat-grid > span {
  box-shadow: inset 3px 0 0 rgba(108, 64, 122, 0.6);
}

.game-market-rune-list > div {
  display: grid;
  gap: 0.4rem;
}

.game-market-effect {
  grid-column: 1 / -1;
}

.game-market-effect p {
  margin: 0;
  overflow-wrap: anywhere;
  white-space: pre-line;
  color: #4d4033;
  font-weight: 700;
  line-height: 1.45;
}

.game-market-rune-list > div > span {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  padding: 0.35rem 0.45rem;
  border: 1px solid rgba(126, 89, 45, 0.16);
  background: rgba(255, 252, 240, 0.65);
}

.game-market-rune-list .game-market-rune-icon {
  width: 26px;
  height: 26px;
}

.game-market-rune-list strong {
  font-size: 0.88rem;
}

.game-market-detail-empty,
.game-market-detail-body small {
  color: #766958;
}

.game-market-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
}

.game-market-settings-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.game-market-settings-grid .wide {
  grid-column: 1 / -1;
}

.game-market-settings-grid textarea {
  resize: vertical;
}

.game-market-empty {
  padding: 1rem;
  border: 1px solid rgb(126 89 45 / 22%);
  background: rgb(255 252 240 / 72%);
  color: #6f6251;
  font-weight: 800;
}

.bugs-hero,
.bugs-form,
.bug-card,
.bug-admin-panel {
  border: 1px solid rgb(126 89 45 / 28%);
  background: linear-gradient(135deg, rgb(255 249 229 / 94%), rgb(232 210 160 / 72%));
  box-shadow: 0 12px 28px rgb(55 34 15 / 10%);
}

.bugs-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem;
}

.bugs-hero h2,
.bugs-form h3,
.bug-card h3 {
  margin: 0;
}

.bugs-hero p {
  max-width: 760px;
  margin: 0.35rem 0 0;
}

.bugs-status {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  justify-content: flex-end;
  min-width: 240px;
}

.bugs-status span,
.bug-status {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.65rem;
  border: 1px solid rgb(126 89 45 / 22%);
  background: rgb(255 252 240 / 72%);
}

.bugs-form {
  padding: 0;
  overflow: hidden;
}

.bugs-form summary {
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.9rem 1.15rem;
  list-style: none;
}

.bugs-form summary::-webkit-details-marker {
  display: none;
}

.bugs-form summary::before {
  content: "+";
  display: inline-grid;
  place-items: center;
  flex: 0 0 2rem;
  width: 2rem;
  height: 2rem;
  border: 1px solid rgb(126 89 45 / 26%);
  background: rgb(255 252 240 / 78%);
  color: #7c2d22;
  font-size: 1.35rem;
  font-weight: 900;
}

.bugs-form[open] summary::before {
  content: "−";
}

.bugs-form summary > div {
  flex: 1 1 auto;
}

.bugs-form-body {
  display: grid;
  gap: 0.8rem;
  max-width: 920px;
  padding: 0 1.15rem 1.15rem 4.15rem;
}

.bugs-form-body label {
  display: grid;
  gap: 0.25rem;
}

.bugs-form-body input,
.bugs-form-body textarea {
  width: 100%;
}

.bugs-form-body textarea {
  min-height: 170px;
  resize: vertical;
}

.bugs-submit-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.bugs-message {
  color: #7c2d22;
  font-weight: 700;
}

.bug-admin-list {
  display: grid;
  gap: 0.45rem;
}

.bugs-table-wrap {
  overflow-x: auto;
  border: 1px solid rgba(70, 57, 41, 0.28);
  background: rgba(255, 250, 234, 0.46);
}

.bugs-table {
  min-width: 780px;
}

.bugs-table th:first-child,
.bugs-table td:first-child {
  width: 140px;
}

.bugs-table th:nth-child(3),
.bugs-table td:nth-child(3),
.bugs-table th:nth-child(4),
.bugs-table td:nth-child(4) {
  width: 155px;
}

.bugs-table th:last-child,
.bugs-table td:last-child {
  width: 180px;
}

.bug-table-row {
  cursor: pointer;
  transition: background 140ms ease;
}

.bug-table-row:hover,
.bug-table-row:focus-visible,
.bug-table-row[aria-expanded="true"] {
  outline: none;
  background: rgba(126, 45, 37, 0.07);
}

.bug-table-row .bug-title::after {
  content: "＋";
  float: right;
  margin-left: 0.75rem;
  color: #7e2d25;
  font-family: var(--aaa-ui);
  font-size: 0.9rem;
}

.bug-table-row[aria-expanded="true"] .bug-title::after {
  content: "−";
}

.bug-table-detail td {
  padding: 0;
  white-space: normal;
  background: rgba(255, 252, 240, 0.72);
}

.bug-title {
  min-width: 280px;
  font-family: var(--aaa-title);
  font-size: 1.05rem;
  font-weight: 800;
  color: #2c2118;
}

.bug-meta {
  color: #6f6251;
  font-weight: 700;
  white-space: nowrap;
}

.bug-status {
  color: #7c2d22;
  min-height: 0;
  padding: 2px 7px;
  background: rgba(126, 45, 37, 0.08);
  border: 1px solid rgba(126, 45, 37, 0.25);
  font-family: var(--aaa-ui);
  font-size: 0.76rem;
  font-weight: 900;
  text-transform: uppercase;
}

.bug-status::before {
  content: "";
  width: 0.42rem;
  height: 0.42rem;
  margin-right: 0.35rem;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 2px color-mix(in srgb, currentColor 18%, transparent);
}

.bug-status-done {
  color: #25623a;
  background: rgb(222 241 212 / 72%);
  border-color: rgba(93, 145, 78, 0.38);
}

.bug-status-pending {
  color: #8a5a11;
  background: rgba(224, 171, 62, 0.12);
  border-color: rgba(138, 90, 17, 0.28);
}

.bug-status-approved {
  color: #765000;
  background: rgba(232, 183, 48, 0.28);
  border-color: rgba(168, 116, 0, 0.46);
}

.bug-status-hidden {
  color: #6f6251;
  background: rgba(111, 98, 81, 0.1);
  border-color: rgba(111, 98, 81, 0.28);
}

.bug-status-deleted {
  color: #8a2b24;
  background: rgba(138, 43, 36, 0.1);
  border-color: rgba(138, 43, 36, 0.28);
}

.bug-card-body {
  display: grid;
  gap: 0.7rem;
  padding: 1rem 1.15rem 1.1rem;
  border-top: 1px solid rgba(70, 57, 41, 0.12);
}

.bug-card-body p {
  margin: 0;
  line-height: 1.5;
}

.bug-description {
  display: grid;
  gap: 0.3rem;
}

.bug-description h4 {
  margin: 0;
  color: #7c2d22;
  font-family: var(--aaa-ui);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.bug-card-footer {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  color: #6f6251;
  font-weight: 700;
}

.bug-admin-card {
  overflow: hidden;
  border: 1px solid rgb(126 89 45 / 25%);
  background: rgba(255, 252, 240, 0.68);
}

.bug-admin-summary {
  display: grid;
  grid-template-columns: 135px minmax(260px, 1fr) auto auto auto;
  align-items: center;
  gap: 0.75rem;
  padding: 0.55rem 0.7rem;
  cursor: pointer;
  list-style: none;
}

.bug-admin-summary::-webkit-details-marker {
  display: none;
}

.bug-admin-summary::after {
  content: "+";
  display: grid;
  place-items: center;
  width: 1.65rem;
  height: 1.65rem;
  border: 1px solid rgba(126, 89, 45, 0.28);
  color: #7c2d22;
  background: rgba(255, 252, 240, 0.82);
  font-weight: 900;
}

.bug-admin-card[open] .bug-admin-summary::after {
  content: "−";
}

.bug-admin-title {
  overflow: hidden;
  font-family: var(--aaa-title);
  font-size: 1rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bug-admin-meta,
.bug-admin-open-label {
  color: #6f6251;
  font-family: var(--aaa-ui);
  font-size: 0.78rem;
  font-weight: 800;
  white-space: nowrap;
}

.bug-admin-open-label {
  color: #7c2d22;
}

.bug-admin-content {
  padding: 0.75rem;
  border-top: 1px solid rgba(126, 89, 45, 0.2);
  background: rgba(255, 249, 229, 0.66);
}

.bug-card-head {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  align-items: flex-start;
}

.bug-card-head p {
  margin: 0;
  color: #6f6251;
  font-size: 0.9rem;
  font-weight: 700;
}

.bug-admin-actions {
  display: flex;
  gap: 0.35rem;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.bug-admin-edit {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(180px, 0.8fr) minmax(160px, 0.6fr);
  gap: 0.55rem;
  margin-top: 0.65rem;
}

.bug-admin-edit .wide {
  grid-column: 1 / -1;
}

.bug-admin-edit textarea {
  min-height: 78px;
  resize: vertical;
}

.bug-empty {
  padding: 1rem;
  border: 1px solid rgb(126 89 45 / 22%);
  background: rgb(255 252 240 / 72%);
  color: #6f6251;
  font-weight: 800;
}

@media (max-width: 1180px) {
  .game-market-filter-panel {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .game-market-category-filters {
    grid-column: 1 / -1;
  }

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

  .game-market-rune-list {
    grid-column: 1 / -1;
  }

}

@media (max-width: 760px) {
  .game-market-hero {
    flex-direction: column;
  }

  .game-market-hero-description.is-single-line {
    white-space: normal;
  }

  .game-market-hero-rules {
    grid-template-columns: 1fr;
  }

  .game-market-toolbar,
  .game-market-filter-panel {
    grid-template-columns: 1fr;
  }

  .game-market-category-filters,
  .game-market-rune-list {
    grid-column: auto;
  }

  .game-market-stats {
    justify-content: flex-start;
  }

  .game-market-detail-body {
    grid-template-columns: 1fr;
    padding-left: 1rem;
  }

  .game-market-offer {
    grid-template-columns: 2rem repeat(3, minmax(80px, 1fr));
  }

  .game-market-offer-summary {
    grid-column: 2 / -1;
    padding: 0.45rem 0 0;
    border-top: 1px solid rgba(126, 89, 45, 0.18);
    border-left: 0;
  }

  .game-market-settings-grid {
    grid-template-columns: 1fr;
  }

  .game-market-settings-grid .wide {
    grid-column: auto;
  }

  .bugs-hero,
  .bug-card-head {
    flex-direction: column;
  }

  .bug-admin-edit {
    grid-template-columns: 1fr;
  }

  .bug-admin-summary {
    grid-template-columns: auto minmax(0, 1fr) auto;
  }

  .bug-admin-meta,
  .bug-admin-open-label {
    display: none;
  }

  .bugs-form summary {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .bugs-form-body {
    max-width: none;
    padding: 0 1rem 1rem;
  }

  .bugs-status,
  .bug-admin-actions {
    justify-content: flex-start;
  }

  .bug-meta {
    white-space: normal;
  }
}
