/* ====================================================
                 ✦ CHARACTER MASTERLISTS
===================================================== */

.masterlist-page {
  color: var(--text);
  font-family: var(--font);
}

.masterlist-breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 14px;
  color: var(--rose);
  font-size: 0.72rem;
}

#page-content .masterlist-breadcrumb a {
  color: var(--rose);
  text-decoration: none;
}

#page-content .masterlist-breadcrumb a:hover,
#page-content .masterlist-breadcrumb a:focus-visible {
  color: var(--brown);
  text-decoration: underline dotted;
}

.masterlist-page-header {
  position: relative;
  display: flex;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 18px;
  padding: 20px 22px;
  background: var(--white);
  border: 2px solid var(--pink2);
  border-radius: 16px;
  text-align: center;
}

.masterlist-page-header > div {
  display: flex;
  width: 100%;
  align-items: center;
  flex-direction: column;
}


.masterlist-page-header.is-official {
  background: linear-gradient(110deg, var(--white), var(--surface));
}

.masterlist-page-header.is-resident {
  background: var(--blue2);
}

.masterlist-eyebrow {
  margin: 0 0 2px;
  color: var(--rose);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.masterlist-page-header h1 {
  margin: 0 0 5px;
  color: var(--brown2);
  font-size: 1.55rem;
  font-weight: 900;
  text-align: center;
}

.masterlist-page-header p:last-child {
  width: min(100%, 680px);
  margin: 0 auto;
  font-size: 0.82rem;
  line-height: 1.55;
  text-align: center;
}

/* ================= SEARCH PANEL ================= */

.masterlist-search-panel {
  margin-bottom: 14px;
  padding: 16px;
  background: var(--white);
  border: 2px dashed var(--pink2);
  border-radius: 14px;
}

.masterlist-search-panel label {
  color: var(--rose);
  font-size: 0.72rem;
  font-weight: 800;
}

.masterlist-search-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  margin-top: 5px;
}

.masterlist-search-line input,
.masterlist-filter-grid select {
  width: 100%;
  min-width: 0;
  padding: 8px 11px;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--pink2);
  border-radius: 10px;
  font: inherit;
  font-size: 0.8rem;
  outline-offset: 2px;
}

.masterlist-search-line input:focus,
.masterlist-filter-grid select:focus {
  border-color: var(--rose);
}

.masterlist-search-button,
.masterlist-reset-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 14px;
  color: var(--white);
  background: var(--pink);
  border: 0;
  border-radius: 10px;
  font-family: var(--font);
  font-size: 0.78rem;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.masterlist-search-button:hover,
.masterlist-search-button:focus-visible,
.masterlist-reset-button:hover,
.masterlist-reset-button:focus-visible {
  background: var(--rose);
  transform: translateY(-1px);
}

.masterlist-filter-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr)) auto;
  align-items: end;
  gap: 10px;
  margin-top: 12px;
}

.masterlist-filter-grid label {
  display: grid;
  gap: 5px;
}

.masterlist-reset-button {
  color: var(--rose);
  background: var(--surface);
  border: 1px solid var(--pink2);
}

.masterlist-reset-button:hover,
.masterlist-reset-button:focus-visible {
  color: var(--white);
  background: var(--rose);
}

/* ================= RESULT TOOLBAR ================= */

.masterlist-result-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin: 8px 0;
}

.masterlist-result-toolbar p {
  margin: 0;
  color: var(--rose);
  font-size: 0.74rem;
  font-weight: 800;
}

.masterlist-view-buttons {
  display: inline-flex;
  overflow: hidden;
  border: 1px solid var(--pink2);
  border-radius: 10px;
}

.masterlist-view-buttons button {
  width: 38px;
  height: 34px;
  color: var(--rose);
  background: var(--white);
  border: 0;
  border-right: 1px solid var(--pink2);
  cursor: pointer;
}

.masterlist-view-buttons button:last-child {
  border-right: 0;
}

.masterlist-view-buttons button.is-active,
.masterlist-view-buttons button:hover,
.masterlist-view-buttons button:focus-visible {
  color: var(--white);
  background: var(--pink);
}

.masterlist-pagination {
  justify-content: center;
  margin: 12px 0;
}

/* ================= CARD GRID ================= */

.character-masterlist-results.is-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 13px;
}

.masterlist-character-card {
  position: relative;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  color: var(--text);
  background: var(--white);
  border: 2px solid var(--pink2);
  border-radius: 13px;
  box-shadow: 0 4px 10px rgba(118, 87, 94, 0.09);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.masterlist-character-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 16px rgba(118, 87, 94, 0.14);
}

.masterlist-character-card.is-resident {
  border-color: var(--lavender);
}

.masterlist-card-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  padding: 7px 10px;
  color: var(--white);
  background: var(--pink);
}

.masterlist-character-card.is-resident .masterlist-card-header {
  color: var(--text);
  background: var(--lavender);
}

.masterlist-type-icon,
.masterlist-card-heart {
  font-size: 0.75rem;
}

.masterlist-card-code {
  min-width: 0;
  overflow: hidden;
  font-size: 0.88rem;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.masterlist-card-image {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  aspect-ratio: 1 / 1;
  background: linear-gradient(145deg, var(--surface), var(--pink2));
}

.masterlist-character-card.is-resident .masterlist-card-image {
  background: linear-gradient(145deg, var(--surface), var(--blue));
}

.masterlist-card-image img {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 8px;
}

.masterlist-card-image.has-image .masterlist-card-fallback {
  display: none;
}

.masterlist-card-fallback {
  position: relative;
  z-index: 2;
  display: grid;
  justify-items: center;
  gap: 7px;
  padding: 20px;
  color: var(--rose);
  font-size: 0.68rem;
  text-align: center;
}

.masterlist-card-fallback i {
  font-size: 2rem;
}

.masterlist-card-body {
  position: relative;
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  padding: 11px 10px 9px;
  text-align: center;
}

.masterlist-card-name {
  width: 100%;
  margin: 0 0 2px;
  overflow: hidden;
  color: var(--rose);
  font-size: 0.88rem;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.masterlist-card-identity {
  min-height: 32px;
  margin: 0 0 7px;
  color: var(--text);
  font-size: 0.67rem;
  font-weight: 700;
  line-height: 1.35;
}

.masterlist-card-status {
  position: absolute;
  top: -13px;
  right: 8px;
  padding: 3px 7px;
  color: var(--rose);
  background: var(--white);
  border: 1px solid var(--pink2);
  border-radius: 20px;
  font-size: 0.58rem;
  font-weight: 900;
  text-transform: uppercase;
}

#page-content .masterlist-card-view {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  margin-top: auto;
  padding: 7px 10px;
  color: var(--white);
  background: var(--pink);
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 800;
  text-decoration: none;
}

.masterlist-character-card.is-resident #page-content .masterlist-card-view,
#page-content .masterlist-character-card.is-resident .masterlist-card-view {
  color: var(--text);
  background: var(--lavender);
}

#page-content .masterlist-card-view:hover,
#page-content .masterlist-card-view:focus-visible {
  color: var(--white);
  background: var(--rose);
  text-decoration: none;
}

#page-content .masterlist-card-view.is-disabled {
  color: var(--muted, var(--text));
  background: var(--surface);
  cursor: default;
  opacity: 0.72;
}

.masterlist-card-owner {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 4px;
  width: 100%;
  margin-top: 7px;
  min-height: 18px;
  font-size: 0.65rem;
}

.masterlist-owner-label {
  color: var(--text);
  opacity: 0.75;
}

.masterlist-unowned {
  color: var(--rose);
  font-weight: 800;
}

.masterlist-card-credits {
  display: flex;
  justify-content: center;
  gap: 5px;
  min-height: 18px;
  margin-top: 5px;
  color: var(--rose);
}

.masterlist-card-credits > * {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--surface);
  border-radius: 50%;
  cursor: help;
  font-size: 0.58rem;
}

/* ================= LIST VIEW ================= */

.character-masterlist-results.is-list {
  display: grid;
  gap: 9px;
}

.character-masterlist-results.is-list .masterlist-character-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  min-height: 120px;
}

.character-masterlist-results.is-list .masterlist-card-header {
  position: absolute;
  z-index: 5;
  top: 0;
  left: 0;
  width: 120px;
  min-height: 32px;
  border-radius: 11px 0 10px 0;
}

.character-masterlist-results.is-list .masterlist-card-image {
  grid-row: 1;
  aspect-ratio: auto;
  min-height: 120px;
  border-right: 1px solid var(--pink2);
}

.character-masterlist-results.is-list .masterlist-card-body {
  grid-column: 2;
  align-items: flex-start;
  justify-content: center;
  padding: 14px 16px;
  text-align: left;
}

.character-masterlist-results.is-list .masterlist-card-name {
  font-size: 1rem;
}

.character-masterlist-results.is-list .masterlist-card-identity {
  min-height: 0;
}

.character-masterlist-results.is-list .masterlist-card-status {
  top: 10px;
}

.character-masterlist-results.is-list .masterlist-card-view {
  width: auto;
  margin-top: 3px;
  padding-inline: 17px;
}

.character-masterlist-results.is-list .masterlist-card-owner {
  justify-content: flex-start;
  width: auto;
}

.character-masterlist-results.is-list .masterlist-card-credits {
  position: absolute;
  right: 13px;
  bottom: 10px;
}

/* ================= RESPONSIVE ================= */

@media (max-width: 850px) {
  .character-masterlist-results.is-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .masterlist-page-header {
    grid-template-columns: 1fr;
  }

  .masterlist-heading-icon {
    width: 48px;
    height: 48px;
  }

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

  .character-masterlist-results.is-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 480px) {
  .masterlist-search-line,
  .masterlist-filter-grid {
    grid-template-columns: 1fr;
  }

  .character-masterlist-results.is-grid {
    grid-template-columns: 1fr;
  }

  .character-masterlist-results.is-list .masterlist-character-card {
    grid-template-columns: 96px 1fr;
  }

  .character-masterlist-results.is-list .masterlist-card-header {
    width: 96px;
  }

  .character-masterlist-results.is-list .masterlist-card-body {
    padding: 12px;
  }

  .character-masterlist-results.is-list .masterlist-card-credits {
    position: static;
    justify-content: flex-start;
  }
}

/* ====================================================
                 ✦ VOIDED MASTERLIST CARDS
===================================================== */

.masterlist-character-card.is-voided {
  border-color: #a9828e;
  background: #efe7ea;
  opacity: 0.88;
}

.masterlist-character-card.is-voided .masterlist-card-image {
  position: relative;
  filter: grayscale(0.82) saturate(0.42) contrast(0.94);
}

.masterlist-character-card.is-voided .masterlist-card-image::after {
  content: '';
  position: absolute;
  z-index: 3;
  inset: 0;

  background: repeating-linear-gradient(
    -45deg,
    rgba(104, 76, 85, 0.1) 0,
    rgba(104, 76, 85, 0.1) 6px,
    transparent 6px,
    transparent 14px
  );
  pointer-events: none;
}

.masterlist-void-seal {
  position: absolute;
  z-index: 5;
  top: 50%;
  left: 50%;

  display: inline-flex;
  align-items: center;
  gap: 6px;

  padding: 7px 11px;

  color: #fffafa;
  background: rgba(104, 76, 85, 0.92);
  border: 1px solid rgba(255, 250, 250, 0.75);

  font-size: 0.64rem;
  font-weight: 900;
  letter-spacing: 0.13em;

  transform: translate(-50%, -50%) rotate(-8deg);
  pointer-events: none;
}

.masterlist-character-card.is-voided .masterlist-card-header,
.masterlist-character-card.is-voided .masterlist-card-name,
.masterlist-character-card.is-voided .masterlist-card-status {
  color: #76525e;
}

/* ====================================================
               ✦ INDIVIDUAL DIVINE RECORDS
===================================================== */

.divine-profile-page {
  color: var(--text);
  font-family: var(--font);
}

.divine-record {
  --record-accent: var(--rose);
  --record-soft: var(--pink2);
  overflow: hidden;
  background: var(--white);
  border: 2px solid var(--record-soft);
  border-radius: 18px;
}

.divine-record.is-resident {
  --record-accent: #9ca8c7;
  --record-soft: var(--lavender);
}

/* ================= RECORD HEADER ================= */

.divine-record-header {
  position: relative;
  overflow: hidden;
  padding: 22px 25px;
  color: var(--text);
  background: var(--record-soft);
  border-bottom: 1px solid var(--record-soft);
}

.divine-record-header-text {
  position: relative;
  z-index: 1;
}

.divine-record-code-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--record-accent);
  font-size: 0.75rem;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.divine-record-type,
.divine-record-status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 9px;
  border-radius: 999px;
}

.divine-record-type {
  color: var(--white);
  background: var(--record-accent);
}

.divine-record-status {
  color: var(--record-accent);
  background: var(--white);
  border: 1px solid var(--record-soft);
}

.divine-record-name {
  margin: 9px 0 2px;
  color: var(--brown2);
  font-size: clamp(1.75rem, 5vw, 2.65rem);
  font-weight: 900;
  line-height: 1.08;
}

.divine-record-subtitle {
  margin: 0;
  color: var(--record-accent);
  font-family: var(--decorf);
  font-size: 0.82rem;
  font-weight: 700;
}

/* ================= MAIN RECORD ================= */

.divine-record-layout {
  display: grid;
  grid-template-columns: minmax(250px, 0.82fr) minmax(0, 1.18fr);
  gap: 18px;
  padding: 20px;
}

.divine-record-portrait-column,
.divine-record-information {
  min-width: 0;
}

.divine-profile-image {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 590px;
  margin: 0;
  background: linear-gradient(145deg, var(--surface), var(--record-soft));
  border: 1px solid var(--record-soft);
  border-radius: 18px;
}

.divine-profile-image-halo {
  position: absolute;
  width: 72%;
  aspect-ratio: 1;
  border: 2px dashed var(--record-accent);
  border-radius: 50%;
  opacity: 0.28;
  animation: divine-profile-halo 28s linear infinite;
}

@keyframes divine-profile-halo {
  to {
    transform: rotate(360deg);
  }
}

.divine-profile-character-image {
  position: relative;
  z-index: 2;
  display: block;
  width: 100%;
  height: 100%;
  max-height: 610px;
  padding: 16px;
  object-fit: contain;
}

.divine-profile-image-fallback {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 10px;
  color: var(--record-accent);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
}

.divine-profile-image-fallback i {
  font-size: 2.4rem;
}

.divine-profile-image.has-image .divine-profile-image-fallback {
  display: none;
}

.divine-record-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}

#page-content .divine-record-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 8px 12px;
  color: var(--white);
  background: var(--record-accent);
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 800;
  text-decoration: none;
}

#page-content .divine-record-action:hover,
#page-content .divine-record-action:focus-visible {
  color: var(--white);
  filter: brightness(0.94);
  text-decoration: none;
}

/* ================= INFORMATION PANELS ================= */

.divine-record-information {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.divine-record-panel {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--record-soft);
  border-radius: 14px;
}

.divine-record-panel-title,
.divine-record-section-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  color: var(--record-accent);
  font-size: 0.9rem;
  font-weight: 900;
  text-transform: uppercase;
}

.divine-record-panel-title {
  padding: 12px 14px;
  background: var(--white);
  border-bottom: 1px solid var(--record-soft);
}

.divine-record-fields {
  margin: 0;
  padding: 4px 14px;
}

.divine-record-field {
  display: grid;
  grid-template-columns: minmax(105px, 0.42fr) minmax(0, 1fr);
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--record-soft);
}

.divine-record-field:last-child {
  border-bottom: 0;
}

.divine-record-field dt,
.divine-record-field dd {
  margin: 0;
}

.divine-record-field dt {
  color: var(--record-accent);
  font-size: 0.7rem;
  font-weight: 900;
  text-transform: uppercase;
}

.divine-record-field dd {
  overflow-wrap: anywhere;
  font-size: 0.8rem;
  line-height: 1.45;
}

.divine-record-archive-owner {
  color: var(--rose);
  font-weight: 800;
}

/* ================= LOWER SECTIONS ================= */

.divine-record-section {
  margin: 0 20px 16px;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--record-soft);
  border-radius: 14px;
}

.divine-record-section-title {
  margin-bottom: 11px;
}

.divine-trait-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.divine-trait-chip {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: var(--record-accent);
  background: var(--white);
  border: 1px solid var(--record-soft);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
}

.divine-trait-chip::before {
  content: '✦';
  margin-right: 5px;
  font-size: 0.62rem;
}

.divine-record-prose {
  font-size: 0.84rem;
  line-height: 1.7;
}

.divine-record-prose p {
  margin: 0 0 12px;
}

.divine-record-prose p:last-child {
  margin-bottom: 0;
}

/* ================= PREVIOUS / NEXT ================= */

.divine-record-navigation {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 0 20px 14px;
}

#page-content .divine-record-nav-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  padding: 10px 12px;
  color: var(--text);
  background: var(--white);
  border: 1px solid var(--record-soft);
  border-radius: 12px;
  text-decoration: none;
  transition: background 0.2s ease, transform 0.2s ease;
}

#page-content .divine-record-nav-link.is-next {
  justify-content: flex-end;
  text-align: right;
}

#page-content .divine-record-nav-link:hover,
#page-content .divine-record-nav-link:focus-visible {
  color: var(--text);
  background: var(--surface);
  text-decoration: none;
  transform: translateY(-1px);
}

.divine-record-nav-link span {
  min-width: 0;
}

.divine-record-nav-link small,
.divine-record-nav-link strong {
  display: block;
}

.divine-record-nav-link small {
  color: var(--record-accent);
  font-size: 0.63rem;
  font-weight: 900;
  text-transform: uppercase;
}

.divine-record-nav-link strong {
  overflow: hidden;
  font-size: 0.75rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.divine-record-nav-link > i {
  color: var(--record-accent);
}

#page-content .divine-record-return {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  width: max-content;
  max-width: calc(100% - 40px);
  margin: 0 auto 20px;
  padding: 8px 13px;
  color: var(--record-accent);
  background: var(--surface);
  border: 1px solid var(--record-soft);
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 800;
  text-decoration: none;
}

#page-content .divine-record-return:hover,
#page-content .divine-record-return:focus-visible {
  color: var(--white);
  background: var(--record-accent);
  text-decoration: none;
}

/* ================= MOBILE ================= */

@media (max-width: 760px) {
  .divine-record-layout {
    grid-template-columns: 1fr;
  }

  .divine-profile-image {
    min-height: 380px;
  }
}

@media (max-width: 520px) {
  .divine-record-header {
    padding: 18px;
  }

  .divine-record-layout {
    padding: 13px;
  }

  .divine-profile-image {
    min-height: 320px;
  }

  .divine-record-field {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .divine-record-section {
    margin-right: 13px;
    margin-left: 13px;
  }

  .divine-record-navigation {
    grid-template-columns: 1fr;
    margin-right: 13px;
    margin-left: 13px;
  }

  .divine-record-nav-spacer {
    display: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .divine-profile-image-halo {
    animation: none;
  }
}

/* ================= GLOBAL PROFILE WATERMARK ================= */

.divine-profile-watermark {
  position: absolute;
  z-index: 4;
  display: block;
  width: var(--watermark-size, 70%);
  max-width: 94%;
  height: auto;
  max-height: 94%;
  padding: 0;
  object-fit: contain;
  opacity: var(--watermark-opacity, 0.18);
  pointer-events: none;
  user-select: none;
}

.divine-profile-watermark.is-center {
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.divine-profile-watermark.is-top-left {
  top: 3%;
  left: 3%;
}

.divine-profile-watermark.is-top-right {
  top: 3%;
  right: 3%;
}

.divine-profile-watermark.is-bottom-left {
  bottom: 3%;
  left: 3%;
}

.divine-profile-watermark.is-bottom-right {
  right: 3%;
  bottom: 3%;
}

.divine-record-panel-empty {
  margin: 0;
  padding: 14px;
  color: var(--text);
  font-size: 0.76rem;
  font-style: italic;
}

/* ================= ARCHIVE RECORD TABS ================= */

.divine-archive-tabs {
  min-height: 218px;
}

.divine-archive-tab-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  background: var(--white);
  border-bottom: 1px solid var(--record-soft);
}

.divine-archive-tab {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  min-width: 0;
  padding: 12px 10px;
  color: var(--record-accent);
  background: transparent;
  border: 0;
  font-family: var(--font);
  font-size: 0.72rem;
  font-weight: 900;
  line-height: 1.2;
  text-transform: uppercase;
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease;
}

.divine-archive-tab + .divine-archive-tab {
  border-left: 1px solid var(--record-soft);
}

.divine-archive-tab:hover,
.divine-archive-tab:focus-visible {
  color: var(--record-accent);
  background: var(--record-soft);
}

.divine-archive-tab.is-active {
  color: var(--white);
  background: var(--record-accent);
}

.divine-archive-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  color: var(--record-accent);
  background: var(--white);
  border: 1px solid var(--record-soft);
  border-radius: 999px;
  font-size: 0.62rem;
  line-height: 1;
}

.divine-archive-tab:not(.is-active) .divine-archive-tab-count {
  background: var(--surface);
}

.divine-archive-tab-panel {
  background: var(--surface);
}

.divine-archive-tab-panel[hidden] {
  display: none;
}

.divine-archive-tab-panel > .divine-record-fields {
  min-height: 164px;
}

/* ================= MOVING HOUSES SCROLLBOX ================= */

.divine-moving-houses-list {
  max-height: 210px;
  overflow-y: auto;
  padding: 5px 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--record-soft) transparent;
}

.divine-moving-houses-list::-webkit-scrollbar {
  width: 7px;
}

.divine-moving-houses-list::-webkit-scrollbar-track {
  background: transparent;
}

.divine-moving-houses-list::-webkit-scrollbar-thumb {
  background: var(--record-soft);
  border-radius: 999px;
}

.divine-moving-houses-empty {
  margin: 0;
  padding: 22px 4px;
  color: var(--text);
  font-size: 0.76rem;
  font-style: italic;
  text-align: center;
}

.divine-moving-house-entry {
  padding: 11px 0;
  border-bottom: 1px dashed var(--record-soft);
}

.divine-moving-house-entry:last-child {
  border-bottom: 0;
}

.divine-moving-house-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 7px;
}

.divine-moving-house-top time {
  color: var(--record-accent);
  font-size: 0.66rem;
  font-weight: 900;
  text-transform: uppercase;
}

.divine-moving-house-type {
  padding: 2px 7px;
  color: var(--record-accent);
  background: var(--white);
  border: 1px solid var(--record-soft);
  border-radius: 999px;
  font-size: 0.62rem;
  font-weight: 900;
  text-transform: uppercase;
}

.divine-moving-house-route {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  font-size: 0.76rem;
}

.divine-moving-house-route > i {
  color: var(--record-accent);
  font-size: 0.7rem;
}

.divine-house-person {
  min-width: 0;
  overflow-wrap: anywhere;
}

.divine-moving-house-route > :last-child {
  text-align: right;
}

#page-content .divine-house-person.is-external {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--record-accent);
  font-weight: 800;
  text-decoration: none;
}

#page-content .divine-house-person.is-external:hover,
#page-content .divine-house-person.is-external:focus-visible {
  color: var(--brown);
  text-decoration: underline dotted;
}

.divine-house-person.is-unrecorded {
  color: var(--text);
  font-style: italic;
}

.divine-moving-house-notes {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 0.7rem;
  line-height: 1.5;
}

@media (max-width: 520px) {
  .divine-archive-tab {
    gap: 5px;
    padding: 11px 6px;
    font-size: 0.65rem;
  }

  .divine-moving-house-route {
    grid-template-columns: 1fr;
  }

  .divine-moving-house-route > i {
    justify-self: center;
    transform: rotate(90deg);
  }

  .divine-moving-house-route > :last-child {
    text-align: left;
  }
}

/* ====================================================
                    ✦ VOIDED DIVINE RECORDS
===================================================== */

.divine-record.is-voided {
  --void-ink: #76525e;
  --void-soft: #eee3e7;
  --void-line: #b8949f;

  border-color: var(--void-line);
  background: repeating-linear-gradient(
      -45deg,
      rgba(118, 82, 94, 0.018) 0,
      rgba(118, 82, 94, 0.018) 8px,
      transparent 8px,
      transparent 17px
    ),
    var(--white);
}

.divine-record.is-voided .divine-record-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;

  color: #fffafa;
  background: linear-gradient(135deg, #76525e, #4f3941);
  border-bottom-color: #3c2930;
}

.divine-record.is-voided .divine-record-header::after {
  opacity: 0.08;
}

.divine-record.is-voided .divine-record-type,
.divine-record.is-voided .divine-record-status {
  color: #fffafa;
  background: rgba(255, 250, 250, 0.12);
  border-color: rgba(255, 250, 250, 0.26);
}

.divine-void-notice {
  position: relative;
  z-index: 2;

  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 330px;
  padding: 10px 13px;

  color: #fffafa;
  background: rgba(35, 22, 27, 0.34);
  border: 1px solid rgba(255, 250, 250, 0.22);
  border-radius: 10px;

  font-size: 0.72rem;
  line-height: 1.35;
}

.divine-void-notice > i {
  font-size: 1.2rem;
  opacity: 0.9;
}

.divine-void-notice span {
  display: grid;
  gap: 2px;
}

.divine-void-notice strong {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.divine-record.is-voided .divine-profile-image {
  border-color: var(--void-line);
  background: #ede5e8;
}

.divine-record.is-voided
  .divine-profile-image
  > img:not(.divine-profile-watermark) {
  filter: grayscale(0.78) saturate(0.42) contrast(0.94);
  opacity: 0.76;
}

.divine-record.is-voided .divine-profile-image::after {
  content: '';
  position: absolute;
  z-index: 5;
  inset: 0;

  background: repeating-linear-gradient(
    -45deg,
    rgba(79, 57, 65, 0.08) 0,
    rgba(79, 57, 65, 0.08) 6px,
    transparent 6px,
    transparent 15px
  );
  pointer-events: none;
}

.divine-profile-void-seal {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;

  display: grid;
  justify-items: center;
  gap: 2px;

  min-width: 150px;
  padding: 13px 18px;

  color: #fffafa;
  background: rgba(79, 57, 65, 0.9);
  border: 2px solid rgba(255, 250, 250, 0.74);
  outline: 1px solid rgba(79, 57, 65, 0.7);

  text-align: center;
  text-transform: uppercase;

  transform: translate(-50%, -50%) rotate(-8deg);
  box-shadow: 0 7px 26px rgba(44, 32, 38, 0.22);
  pointer-events: none;
}

.divine-profile-void-seal i {
  font-size: 1rem;
}

.divine-profile-void-seal strong {
  font-size: 1rem;
  letter-spacing: 0.2em;
}

.divine-profile-void-seal span {
  font-size: 0.56rem;
  letter-spacing: 0.13em;
  opacity: 0.86;
}

.divine-record.is-voided .divine-record-panel,
.divine-record.is-voided .divine-record-section {
  border-color: #d4bec5;
}

.divine-record.is-voided .divine-record-panel-title,
.divine-record.is-voided .divine-record-section-title,
.divine-record.is-voided .divine-record-field dt {
  color: var(--void-ink);
}

.divine-void-record-panel {
  background: var(--void-soft);
  border-color: var(--void-line) !important;
}

.divine-void-record-panel .divine-record-field {
  border-color: rgba(118, 82, 94, 0.18);
}

.divine-record.is-voided .divine-archive-tab.is-active {
  color: #fffafa;
  background: var(--void-ink);
}

.divine-record.is-voided .divine-archive-tab:hover,
.divine-record.is-voided .divine-archive-tab:focus-visible {
  background: #e4d3d9;
}

.divine-record.is-voided .divine-archive-tab.is-active:hover,
.divine-record.is-voided .divine-archive-tab.is-active:focus-visible {
  background: var(--void-ink);
}

@media (max-width: 700px) {
  .divine-record.is-voided .divine-record-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .divine-void-notice {
    max-width: none;
    width: 100%;
  }
}


/* ====================================================
        ✦ DIVINE FORM TABS + ARTWORK SAVE DETERRENTS
===================================================== */

/*
  Casual-save deterrents for masterlist/profile artwork.
  JavaScript also blocks dragstart and the image context menu.
*/
.masterlist-card-image img,
.divine-profile-character-image,
.divine-profile-watermark {
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

.masterlist-card-image,
.divine-profile-image {
  -webkit-touch-callout: none;
}

/* ================= PROFILE FORM TABS ================= */

/*
  The tab bar is deliberately in normal document flow ABOVE the portrait.
  It cannot be clipped by .divine-profile-image { overflow: hidden; }.
*/
.divine-profile-artwork-block {
  width: 100%;
}

#page-content .divine-profile-form-tabs,
.divine-profile-form-tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));

  width: calc(100% - 18px);
  margin: 0 auto -1px;

  overflow: hidden;

  background: var(--white);
  border: 1px solid var(--record-soft);
  border-radius: 12px 12px 0 0;
}

#page-content .divine-profile-form-tab,
.divine-profile-form-tab {
  display: flex;
  align-items: center;
  justify-content: center;

  min-width: 0;
  min-height: 36px;
  padding: 8px 11px;

  color: var(--record-accent);
  background: var(--white);
  border: 0;
  border-right: 1px solid var(--record-soft);

  font-family: var(--font);
  font-size: 0.68rem;
  font-weight: 900;
  line-height: 1.2;
  text-align: center;
  text-overflow: ellipsis;
  white-space: nowrap;

  appearance: none;
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  cursor: pointer;
}

#page-content .divine-profile-form-tab:last-child,
.divine-profile-form-tab:last-child {
  border-right: 0;
}

#page-content .divine-profile-form-tab:hover,
#page-content .divine-profile-form-tab:focus-visible,
.divine-profile-form-tab:hover,
.divine-profile-form-tab:focus-visible {
  color: var(--record-accent);
  background: var(--record-soft);
  outline: none;
}

#page-content .divine-profile-form-tab.is-active,
.divine-profile-form-tab.is-active {
  color: var(--white);
  background: var(--record-accent);
}

/*
  When tabs are present, square the portrait's top edge into the tab bar.
*/
.divine-profile-artwork-block:has(.divine-profile-form-tabs)
  .divine-profile-image {
  border-radius: 12px 12px 18px 18px;
}

/* Artwork save deterrents remain active. */
.masterlist-card-image img,
.divine-profile-character-image,
.divine-profile-watermark {
  -webkit-user-drag: none;
  -webkit-user-select: none;
  user-select: none;
}

.masterlist-card-image,
.divine-profile-image {
  -webkit-touch-callout: none;
}

@media (max-width: 520px) {
  #page-content .divine-profile-form-tabs,
  .divine-profile-form-tabs {
    width: calc(100% - 12px);
  }

  #page-content .divine-profile-form-tab,
  .divine-profile-form-tab {
    min-height: 34px;
    padding: 7px 8px;
    font-size: 0.62rem;
  }
}
