:root {
  --ink: #17110d;
  --soft-ink: #3c3028;
  --paper: #f1eadb;
  --paper-deep: #ded0b6;
  --page: #fbf7eb;
  --line: #2a211d;
  --hairline: #b9aa92;
  --red: #8c1720;
  --red-bright: #b9272e;
  --bone: #fff8e8;
  --gold: #b28a42;
  --shadow: 0 18px 42px rgba(0, 0, 0, 0.46);
  --sans: "Arial Narrow", "Franklin Gothic Condensed", Arial, Helvetica, sans-serif;
  --serif: Georgia, "Times New Roman", serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--ink);
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.86)),
    #15110f;
  font-family: var(--serif);
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  content: "";
  background:
    radial-gradient(circle at 18% 12%, rgba(149, 21, 30, 0.34), transparent 24rem),
    radial-gradient(circle at 92% 18%, rgba(178, 138, 66, 0.16), transparent 22rem),
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.025) 0 1px, transparent 1px 5px);
  opacity: 0.95;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.chronicle-shell {
  width: min(1760px, 100%);
  margin: 0 auto;
}

.masthead {
  position: relative;
  min-height: 460px;
  padding: 22px clamp(18px, 4vw, 62px) 34px;
  color: var(--bone);
  overflow: hidden;
  border-bottom: 10px solid #050505;
  background:
    linear-gradient(90deg, rgba(8, 8, 8, 0.94), rgba(24, 14, 13, 0.84) 58%, rgba(9, 8, 8, 0.95)),
    linear-gradient(135deg, transparent 0 62%, rgba(140, 23, 32, 0.45) 62% 66%, transparent 66%),
    #111;
}

.masthead::before,
.masthead::after {
  position: absolute;
  pointer-events: none;
  content: "";
}

.masthead::before {
  inset: 28px;
  border: 1px solid rgba(255, 248, 232, 0.22);
  box-shadow:
    inset 0 0 0 8px rgba(0, 0, 0, 0.34),
    inset 0 0 0 10px rgba(255, 248, 232, 0.07);
}

.masthead::after {
  right: clamp(20px, 5vw, 74px);
  bottom: -40px;
  width: min(34vw, 460px);
  aspect-ratio: 1;
  border: 20px solid rgba(255, 248, 232, 0.09);
  border-radius: 50%;
  transform: rotate(-18deg);
  box-shadow: inset 0 0 0 18px rgba(140, 23, 32, 0.2);
}

.utility-nav,
.masthead-grid {
  position: relative;
  z-index: 1;
}

.utility-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 68px;
  font-family: var(--sans);
  text-transform: uppercase;
}

.utility-nav a {
  min-height: 34px;
  padding: 8px 12px;
  border: 1px solid rgba(255, 248, 232, 0.34);
  color: var(--bone);
  background: #080808;
  text-decoration: none;
  letter-spacing: 0.08em;
}

.utility-nav a.active,
.utility-nav a:hover {
  border-color: var(--red-bright);
  background: var(--red);
}

.masthead-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 390px);
  gap: 34px;
  align-items: end;
}

.kicker {
  margin: 0 0 8px;
  color: var(--red-bright);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.site-logo {
  display: block;
  width: min(520px, 100%);
  height: auto;
  margin: 0 0 18px;
  filter: drop-shadow(0 12px 22px rgba(0, 0, 0, 0.68));
}

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

h1 {
  max-width: 980px;
  font-family: Impact, "Arial Black", var(--sans);
  font-size: clamp(46px, 8.5vw, 116px);
  font-weight: 900;
  letter-spacing: 0.01em;
  text-transform: uppercase;
  text-shadow: 4px 4px 0 #000;
}

.deck {
  max-width: 760px;
  margin: 18px 0 0;
  color: #eadfcc;
  font-size: clamp(18px, 2.3vw, 25px);
  line-height: 1.32;
}

.scope-card {
  position: relative;
  padding: 22px 18px 20px;
  border: 1px solid rgba(255, 248, 232, 0.42);
  color: var(--bone);
  background:
    linear-gradient(180deg, rgba(140, 23, 32, 0.22), transparent 42%),
    #080808;
  box-shadow: var(--shadow);
}

.scope-card::before {
  display: block;
  width: 74px;
  height: 6px;
  margin-bottom: 15px;
  background: var(--red-bright);
  content: "";
}

.scope-card span {
  display: block;
  color: var(--gold);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.scope-card strong {
  display: block;
  margin-top: 5px;
  font-family: Impact, "Arial Black", var(--sans);
  font-size: 30px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.scope-card p {
  margin: 12px 0 0;
  color: #e7dac4;
  line-height: 1.42;
}

.foreword {
  margin: 22px clamp(14px, 3vw, 38px) 0;
  border: 1px solid #111;
  border-top: 12px solid #0a0a0a;
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.48), transparent 4%, transparent 96%, rgba(0, 0, 0, 0.12)),
    var(--page);
  box-shadow: var(--shadow);
}

.foreword-rule {
  height: 9px;
  width: 38%;
  min-width: 230px;
  background: var(--red);
}

.foreword-layout {
  display: grid;
  grid-template-columns: minmax(230px, 0.42fr) minmax(0, 1fr);
  gap: clamp(22px, 4vw, 54px);
  padding: clamp(22px, 4vw, 44px);
}

.foreword-title {
  position: sticky;
  top: 18px;
  align-self: start;
}

.foreword-title h2 {
  max-width: 420px;
  font-family: Impact, "Arial Black", var(--sans);
  font-size: clamp(42px, 5.5vw, 76px);
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
}

.foreword-title::after {
  display: block;
  width: 112px;
  height: 9px;
  margin-top: 22px;
  background: #111;
  content: "";
  box-shadow: 0 13px 0 var(--red);
}

.foreword-copy {
  column-count: 2;
  column-gap: clamp(24px, 4vw, 46px);
  column-rule: 1px solid var(--hairline);
  color: var(--soft-ink);
  font-size: 17px;
  line-height: 1.52;
}

.foreword-copy p {
  margin: 0 0 0.86em;
}

.foreword-copy p:first-child::first-letter {
  float: left;
  margin: 0.07em 0.12em 0 0;
  color: var(--red);
  font-family: Impact, "Arial Black", var(--sans);
  font-size: 5.4em;
  line-height: 0.78;
}

.foreword-copy p:nth-child(5),
.foreword-copy p:nth-child(6),
.foreword-copy p:nth-child(8),
.foreword-copy p:nth-child(10),
.foreword-copy p:nth-child(15),
.foreword-copy p:nth-child(17),
.foreword-copy p:nth-child(19),
.foreword-copy p:nth-child(21),
.foreword-copy p:nth-child(24) {
  color: #17110d;
  font-family: var(--sans);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.25;
  text-transform: uppercase;
}

.domain-map-section {
  display: grid;
  grid-template-columns: minmax(260px, 0.34fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 32px);
  margin: 22px clamp(14px, 3vw, 38px) 0;
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid #111;
  border-top: 12px solid #0a0a0a;
  color: var(--bone);
  background:
    linear-gradient(90deg, rgba(140, 23, 32, 0.2), transparent 44%),
    #0d0c0b;
  box-shadow: var(--shadow);
}

.domain-map-copy h2 {
  font-family: Impact, "Arial Black", var(--sans);
  font-size: clamp(42px, 6vw, 84px);
  font-weight: 900;
  line-height: 0.95;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #000;
}

.domain-map-deck {
  margin: 16px 0 0;
  color: #dccdb4;
  font-size: 18px;
  line-height: 1.45;
}

.domain-map-frame {
  position: relative;
  min-height: clamp(360px, 45vw, 620px);
  overflow: hidden;
  border: 2px solid #0a0a0a;
  outline: 1px solid rgba(255, 248, 232, 0.2);
  background:
    linear-gradient(12deg, transparent 0 46%, rgba(183, 137, 57, 0.2) 46% 47%, transparent 47%),
    linear-gradient(-18deg, transparent 0 53%, rgba(183, 137, 57, 0.16) 53% 54%, transparent 54%),
    radial-gradient(circle at 24% 36%, rgba(183, 137, 57, 0.24), transparent 20rem),
    radial-gradient(circle at 58% 58%, rgba(83, 136, 160, 0.18), transparent 22rem),
    radial-gradient(circle at 70% 74%, rgba(84, 134, 59, 0.24), transparent 20rem),
    repeating-linear-gradient(0deg, rgba(255, 248, 232, 0.05) 0 1px, transparent 1px 19px),
    repeating-linear-gradient(90deg, rgba(255, 248, 232, 0.04) 0 1px, transparent 1px 24px),
    #090a09;
}

.domain-map-art-frame {
  min-height: 0;
  background: #050505;
}

.domain-map-image {
  display: block;
  width: 100%;
  height: auto;
  min-height: 260px;
  object-fit: cover;
}

.domain-map-frame::before,
.domain-map-frame::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
}

.domain-map-frame::before {
  background:
    radial-gradient(circle at 18% 30%, transparent 0 16rem, rgba(0, 0, 0, 0.18) 16.1rem),
    repeating-linear-gradient(27deg, transparent 0 22px, rgba(255, 248, 232, 0.06) 22px 23px, transparent 23px 42px);
  mix-blend-mode: screen;
  opacity: 0.58;
}

.domain-map-frame::after {
  border: 16px solid rgba(0, 0, 0, 0.42);
  box-shadow: inset 0 0 0 1px rgba(255, 248, 232, 0.16);
}

.domain-map-art-frame .map-zone,
.domain-map-art-frame .map-label,
.domain-map-art-frame .map-road,
.domain-map-art-frame .map-compass,
.domain-map-art-frame .map-legend {
  display: none;
}

.map-zone {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 16px;
  border: 2px solid currentColor;
  color: var(--bone);
  opacity: 0.86;
  text-align: center;
  text-shadow: 2px 2px 0 #000;
  clip-path: polygon(5% 14%, 48% 2%, 95% 12%, 100% 62%, 72% 96%, 20% 88%, 0 54%);
}

.map-zone span {
  position: relative;
  z-index: 1;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(18px, 2vw, 30px);
  font-weight: 700;
  line-height: 1.1;
}

.map-zone-npm {
  left: 2%;
  top: 8%;
  width: 62%;
  height: 39%;
  color: #d6a632;
  background: rgba(151, 101, 0, 0.52);
}

.map-zone-camarilla {
  left: 10%;
  top: 37%;
  width: 62%;
  height: 31%;
  color: #79b8d4;
  background: rgba(28, 82, 112, 0.48);
  clip-path: polygon(0 0, 72% 0, 100% 24%, 84% 100%, 18% 88%, 4% 62%);
}

.map-zone-sabbat {
  left: 13%;
  top: 45%;
  width: 24%;
  height: 24%;
  color: #e54f3d;
  background: rgba(119, 22, 13, 0.68);
  clip-path: polygon(8% 8%, 72% 0, 100% 42%, 86% 98%, 18% 86%, 0 46%);
}

.map-zone-giovanni {
  left: 49%;
  top: 53%;
  width: 37%;
  height: 41%;
  color: #8ac45e;
  background: rgba(45, 96, 32, 0.58);
  clip-path: polygon(10% 0, 100% 10%, 88% 100%, 6% 88%, 0 28%);
}

.map-label {
  position: absolute;
  z-index: 3;
  color: #d8c49a;
  font-size: clamp(13px, 1.4vw, 21px);
  text-shadow: 2px 2px 0 #000;
}

.map-label-la {
  left: 27%;
  top: 32%;
  font-size: clamp(22px, 2.5vw, 34px);
  font-weight: 700;
}

.map-label-sfv {
  left: 4%;
  top: 17%;
}

.map-label-sb {
  right: 11%;
  top: 22%;
  font-size: clamp(18px, 2vw, 29px);
}

.map-label-oc {
  left: 54%;
  bottom: 29%;
}

.map-label-lb {
  left: 28%;
  bottom: 27%;
}

.map-road {
  position: absolute;
  z-index: 2;
  height: 3px;
  border-top: 1px solid rgba(255, 248, 232, 0.46);
  border-bottom: 1px solid rgba(0, 0, 0, 0.72);
  background: rgba(183, 137, 57, 0.58);
  transform-origin: left center;
}

.road-10 {
  left: 16%;
  top: 41%;
  width: 70%;
  transform: rotate(-2deg);
}

.road-405 {
  left: 30%;
  top: 31%;
  width: 36%;
  transform: rotate(84deg);
}

.road-91 {
  left: 36%;
  top: 62%;
  width: 43%;
  transform: rotate(-10deg);
}

.map-compass {
  position: absolute;
  z-index: 4;
  right: 28px;
  top: 24px;
  display: grid;
  place-items: center;
  width: 78px;
  height: 78px;
  border: 2px solid rgba(214, 166, 50, 0.76);
  border-radius: 50%;
  color: #d6a632;
  font-family: Impact, "Arial Black", var(--sans);
  font-size: 28px;
  text-shadow: 2px 2px 0 #000;
}

.map-legend {
  position: absolute;
  z-index: 5;
  left: 24px;
  bottom: 24px;
  display: grid;
  gap: 7px;
  width: min(360px, calc(100% - 48px));
}

.map-legend span {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border: 1px solid rgba(214, 166, 50, 0.5);
  color: #ead8b6;
  background: rgba(0, 0, 0, 0.68);
  font-weight: 700;
}

.map-legend i {
  display: inline-block;
  flex: 0 0 auto;
  width: 24px;
  height: 14px;
  border: 1px solid currentColor;
}

.legend-npm { color: #d6a632; background: rgba(151, 101, 0, 0.8); }
.legend-camarilla { color: #79b8d4; background: rgba(28, 82, 112, 0.8); }
.legend-sabbat { color: #e54f3d; background: rgba(119, 22, 13, 0.8); }
.legend-giovanni { color: #8ac45e; background: rgba(45, 96, 32, 0.8); }

.workspace {
  display: grid;
  grid-template-columns: 304px minmax(0, 1fr) minmax(310px, 410px);
  gap: 18px;
  align-items: start;
  padding: 22px clamp(14px, 3vw, 38px) 28px;
}

.control-panel,
.timeline-panel,
.detail-panel,
.reference-band {
  background:
    linear-gradient(90deg, rgba(255, 255, 255, 0.4), transparent 4%, transparent 96%, rgba(0, 0, 0, 0.12)),
    var(--page);
  box-shadow: var(--shadow);
}

.control-panel,
.detail-panel {
  position: sticky;
  top: 14px;
}

.control-panel {
  padding: 14px;
  border: 7px solid #070707;
  outline: 1px solid rgba(255, 248, 232, 0.22);
  background:
    linear-gradient(180deg, rgba(140, 23, 32, 0.2), transparent 220px),
    #16110f;
  color: var(--bone);
}

.timeline-panel {
  border: 1px solid #111;
  border-top: 12px solid #0a0a0a;
}

.detail-panel {
  border: 7px solid #050505;
  color: var(--bone);
  background:
    linear-gradient(180deg, rgba(140, 23, 32, 0.28), transparent 260px),
    #120f0d;
}

.field-label {
  display: block;
  margin: 14px 0 6px;
  color: #d6c6a9;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.11em;
  text-transform: uppercase;
}

.search-input,
.select-input,
.year-input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #58483d;
  border-radius: 0;
  color: var(--bone);
  background: #050505;
}

.search-input,
.select-input {
  padding: 9px 10px;
}

.year-input {
  padding: 8px;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.panel-section {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 248, 232, 0.22);
}

.panel-section h2,
.section-toolbar h2,
.reference-card h3,
.detail-block h3 {
  font-family: Impact, "Arial Black", var(--sans);
  font-weight: 900;
  text-transform: uppercase;
}

.panel-section h2 {
  color: var(--bone);
  font-size: 22px;
}

.small-note {
  margin: 8px 0 0;
  color: #d2c1a6;
  font-size: 14px;
  line-height: 1.4;
}

.era-list {
  display: grid;
  gap: 7px;
  margin-top: 10px;
}

.era-button {
  width: 100%;
  padding: 10px;
  border: 1px solid #4a3a32;
  border-left: 5px solid #4a3a32;
  border-radius: 0;
  color: #ede0c8;
  background: #0a0908;
  text-align: left;
}

.era-button.active,
.era-button:hover {
  border-color: var(--red-bright);
  border-left-color: var(--red-bright);
  background: #2a0c10;
}

.era-title,
.era-range {
  display: block;
}

.era-title {
  font-weight: 700;
  line-height: 1.2;
}

.era-range {
  margin-top: 3px;
  color: #bcae95;
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.section-toolbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 20px 16px;
  border-bottom: 3px double #19120f;
  background:
    linear-gradient(90deg, rgba(140, 23, 32, 0.18), transparent 55%),
    var(--paper);
}

.section-toolbar h2 {
  color: #17110d;
  font-size: 36px;
}

.section-toolbar p {
  margin: 5px 0 0;
  color: #635446;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.text-button {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 12px;
  border: 1px solid #090909;
  border-radius: 0;
  color: var(--bone);
  background: #090909;
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.text-button:hover {
  background: var(--red);
}

.timeline-list {
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.08), transparent 18%, transparent 82%, rgba(0, 0, 0, 0.1)),
    var(--page);
}

.era-group {
  border-top: 7px solid #0b0b0b;
}

.era-group:first-child {
  border-top: 0;
}

.era-heading {
  position: relative;
  min-height: 150px;
  padding: 26px 32px 24px;
  color: var(--bone);
  overflow: hidden;
  background:
    linear-gradient(90deg, #080808, #271313 58%, #080808),
    #111;
}

.era-heading::before {
  position: absolute;
  right: -26px;
  bottom: -58px;
  width: 210px;
  height: 210px;
  border: 18px solid rgba(255, 248, 232, 0.08);
  border-radius: 50%;
  content: "";
}

.era-heading::after {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 180px;
  height: 8px;
  background: var(--red-bright);
  content: "";
}

.era-heading h3 {
  position: relative;
  z-index: 1;
  max-width: 820px;
  font-family: Impact, "Arial Black", var(--sans);
  font-size: clamp(34px, 5vw, 62px);
  font-weight: 900;
  text-transform: uppercase;
  text-shadow: 3px 3px 0 #000;
}

.era-heading p {
  position: relative;
  z-index: 1;
  max-width: 860px;
  margin: 12px 0 0;
  color: #e4d5bd;
  font-size: 17px;
  line-height: 1.45;
}

.event-card {
  border-top: 1px solid var(--hairline);
}

.event-button {
  display: grid;
  grid-template-columns: 122px minmax(0, 1fr);
  gap: 18px;
  width: 100%;
  padding: 18px 22px;
  border: 0;
  color: var(--ink);
  background: transparent;
  text-align: left;
}

.event-button:hover,
.event-card.active .event-button {
  background:
    linear-gradient(90deg, rgba(140, 23, 32, 0.15), transparent 70%),
    #f7eedc;
}

.event-date {
  padding-top: 4px;
  color: var(--red);
  font-family: Impact, "Arial Black", var(--sans);
  font-size: 20px;
  font-weight: 900;
  line-height: 1;
  text-transform: uppercase;
}

.event-body {
  min-width: 0;
}

.event-title {
  display: block;
  font-size: 22px;
  line-height: 1.1;
}

.event-summary {
  display: block;
  max-width: 86ch;
  margin-top: 7px;
  color: var(--soft-ink);
  font-size: 16px;
  line-height: 1.48;
}

.event-tags,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 11px;
}

.tag {
  display: inline-flex;
  align-items: center;
  min-height: 23px;
  padding: 3px 7px;
  border: 1px solid #3a2d26;
  border-radius: 0;
  color: #261d19;
  background: #f4ead7;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.tag.sphere {
  border-color: #405137;
  background: #dfe8d6;
}

.tag.continuity {
  border-color: #8c1720;
  color: var(--bone);
  background: var(--red);
}

.detail-card {
  padding: 18px;
}

.detail-card h2 {
  color: var(--bone);
  font-family: Impact, "Arial Black", var(--sans);
  font-size: 38px;
  font-weight: 900;
  text-transform: uppercase;
}

.detail-date {
  margin: 10px 0 0;
  color: var(--red-bright);
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.detail-summary,
.impact {
  margin: 14px 0 0;
  color: #eadcc4;
  font-size: 16px;
  line-height: 1.5;
}

.detail-block {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 248, 232, 0.23);
}

.detail-block h3 {
  color: var(--gold);
  font-size: 18px;
  letter-spacing: 0.04em;
}

.detail-list {
  margin: 8px 0 0;
  padding-left: 20px;
  color: #eadcc4;
  line-height: 1.5;
}

.detail-list a {
  color: #ffb8b8;
}

.detail-panel .tag {
  border-color: rgba(255, 248, 232, 0.26);
  color: var(--bone);
  background: #2a201b;
}

.cleaned-character-band {
  margin: 0 clamp(14px, 3vw, 38px) 38px;
  overflow: hidden;
  border: 1px solid #111;
  border-top: 12px solid #0a0a0a;
  background: var(--page);
  box-shadow: var(--shadow);
}

.cleaned-character-toolbar {
  background:
    linear-gradient(90deg, rgba(140, 23, 32, 0.22), transparent 62%),
    var(--paper);
}

.dossier-tabs-wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 0 18px 14px;
  border-bottom: 1px solid #1c1410;
  background: var(--paper);
}

.dossier-tabs-wrap > .dossier-tabs {
  flex: 1 1 100%;
}

.dossier-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.dossier-category-tabs {
  margin-bottom: -4px;
}

.dossier-category-tabs .dossier-tab {
  min-width: 168px;
}

.dossier-tab {
  min-height: 42px;
  padding: 10px 15px;
  border: 1px solid rgba(28, 20, 16, 0.72);
  border-right: 0;
  color: var(--ink);
  background: rgba(255, 248, 232, 0.5);
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  cursor: pointer;
}

.dossier-tab:last-child {
  border-right: 1px solid rgba(28, 20, 16, 0.72);
}

.dossier-tab:hover,
.dossier-tab.active {
  color: #fff8e8;
  background: var(--red);
}

.dossier-tab small {
  display: inline-block;
  margin-left: 6px;
  color: inherit;
  font-size: 0.84em;
  opacity: 0.75;
}

.dossier-count {
  margin: 0;
  color: rgba(42, 32, 27, 0.72);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.cleaned-characters-grid {
  display: grid;
  gap: 1px;
  background: #1d1511;
}

.cleaned-character-card {
  display: grid;
  grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
  gap: 0;
  background: var(--page);
}

.draft-dossier {
  background:
    linear-gradient(90deg, rgba(140, 23, 32, 0.08), transparent 36%),
    var(--page);
}

.draft-dossier .cleaned-character-main > h3::after {
  content: "Draft slot";
  display: inline-block;
  margin-left: 12px;
  transform: translateY(-0.35em);
  color: #fff8e8;
  background: var(--red);
  padding: 5px 7px;
  font-family: var(--sans);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.08em;
  line-height: 1;
  text-transform: uppercase;
}

.cleaned-character-sidebar {
  padding: 18px;
  color: var(--bone);
  background:
    linear-gradient(180deg, rgba(140, 23, 32, 0.22), transparent 320px),
    #0d0c0b;
}

.cleaned-portrait {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 310px;
  margin-bottom: 18px;
  overflow: hidden;
  border: 1px solid rgba(255, 248, 232, 0.28);
  background:
    radial-gradient(circle at 50% 34%, rgba(255, 248, 232, 0.2), transparent 8rem),
    repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.05) 0 1px, transparent 1px 7px),
    #050505;
}

.cleaned-portrait img {
  display: block;
  width: 100%;
  height: 100%;
  min-height: 310px;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
}

.cleaned-portrait span {
  display: none;
}

.cleaned-portrait.portrait-missing span {
  display: block;
  max-width: 210px;
  color: #d7c7aa;
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: 0.08em;
  line-height: 1.35;
  text-align: center;
  text-transform: uppercase;
}

.cleaned-stat-block {
  padding-top: 14px;
  margin-top: 14px;
  border-top: 1px solid rgba(255, 248, 232, 0.2);
}

.cleaned-stat-block:first-of-type {
  padding-top: 0;
  margin-top: 0;
  border-top: 0;
}

.cleaned-stat-block h3,
.cleaned-character-main h3 {
  font-family: Impact, "Arial Black", var(--sans);
  font-size: 36px;
  font-weight: 900;
  line-height: 0.96;
  text-transform: uppercase;
}

.cleaned-stat-block h4,
.cleaned-character-main h4 {
  margin: 0 0 8px;
  color: var(--gold);
  font-family: Impact, "Arial Black", var(--sans);
  font-size: 19px;
  font-weight: 900;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.cleaned-subtitle {
  margin: 8px 0 0;
  color: #dccdb4;
  line-height: 1.35;
}

.cleaned-character-card dl {
  display: grid;
  gap: 8px;
  margin: 0;
}

.cleaned-character-card dl div {
  display: grid;
  gap: 2px;
}

.cleaned-character-card dt {
  color: var(--red-bright);
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.09em;
  text-transform: uppercase;
}

.cleaned-character-card dd {
  margin: 0;
  line-height: 1.35;
}

.cleaned-character-main {
  padding: clamp(22px, 4vw, 42px);
  color: var(--soft-ink);
}

.cleaned-character-main > h3 {
  color: var(--ink);
  font-size: clamp(44px, 6vw, 78px);
}

.cleaned-history {
  column-count: 2;
  column-gap: clamp(24px, 4vw, 42px);
  column-rule: 1px solid var(--hairline);
  margin-top: 18px;
  font-size: 17px;
  line-height: 1.52;
}

.cleaned-history p {
  margin: 0 0 0.9em;
}

.cleaned-history p:first-child::first-letter {
  float: left;
  margin: 0.07em 0.12em 0 0;
  color: var(--red);
  font-family: Impact, "Arial Black", var(--sans);
  font-size: 5em;
  line-height: 0.78;
}

.cleaned-detail-section,
.cleaned-storyteller-notes,
.cleaned-member-list {
  margin-top: 24px;
  padding-top: 18px;
  border-top: 3px double var(--hairline);
}

.cleaned-detail-section h4,
.cleaned-storyteller-notes h4,
.cleaned-member-list > h4 {
  margin: 0 0 12px;
  color: var(--red);
  font-size: 18px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.cleaned-detail-section p,
.cleaned-storyteller-notes p,
.cleaned-member-entry p {
  margin: 0 0 0.9em;
  color: var(--soft-ink);
  font-size: 16px;
  line-height: 1.5;
}

.cleaned-detail-section p:last-child,
.cleaned-storyteller-notes p:last-child,
.cleaned-member-entry p:last-child {
  margin-bottom: 0;
}

.cleaned-member-entry {
  padding: 14px 0 16px;
  border-top: 1px solid var(--hairline);
}

.cleaned-member-entry:first-of-type {
  border-top: 0;
}

.cleaned-member-entry h5 {
  margin: 0 0 7px;
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
}

.cleaned-two-column {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin-top: 22px;
  padding-top: 18px;
  border-top: 3px double var(--hairline);
}

.cleaned-two-column p {
  margin: 0 0 12px;
  line-height: 1.5;
}

.cleaned-two-column dl {
  gap: 10px;
}

.cleaned-two-column dd {
  color: var(--soft-ink);
}

.reference-band {
  margin: 0 clamp(14px, 3vw, 38px) 38px;
  overflow: hidden;
  border: 1px solid #111;
  border-top: 12px solid #0a0a0a;
}

.reference-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  padding: 0 18px 14px;
  border-bottom: 1px solid #1c1410;
  background: var(--paper);
}

.reference-tab {
  min-height: 36px;
  padding: 8px 13px;
  border: 1px solid #1c1410;
  border-radius: 0;
  color: var(--ink);
  background: var(--page);
  font-family: var(--sans);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.reference-tab + .reference-tab {
  border-left: 0;
}

.reference-tab.active,
.reference-tab:hover {
  color: var(--bone);
  background: var(--red);
}

.reference-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1px;
  background: #1d1511;
}

.reference-card {
  min-height: 210px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(140, 23, 32, 0.1), transparent 44%),
    var(--page);
}

.reference-card h3 {
  font-size: 25px;
  line-height: 1;
}

.reference-card p {
  margin: 11px 0 0;
  color: var(--soft-ink);
  line-height: 1.48;
}

.empty-message {
  padding: 32px;
  color: var(--soft-ink);
  font-size: 18px;
}

@media (max-width: 1180px) {
  .workspace {
    grid-template-columns: 288px minmax(0, 1fr);
  }

  .detail-panel {
    position: static;
    grid-column: 1 / -1;
  }

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

  .cleaned-character-card {
    grid-template-columns: 1fr;
  }

  .cleaned-history {
    column-count: 1;
  }
}

@media (max-width: 820px) {
  .masthead {
    min-height: 0;
  }

  .utility-nav {
    margin-bottom: 44px;
  }

  .masthead-grid,
  .foreword-layout,
  .domain-map-section,
  .workspace {
    grid-template-columns: 1fr;
  }

  .foreword-title {
    position: static;
  }

  .foreword-copy {
    column-count: 1;
  }

  .control-panel {
    position: static;
  }

  .section-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .text-button {
    width: 100%;
  }

  .event-button {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .reference-grid {
    grid-template-columns: 1fr;
  }

  .cleaned-two-column {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
  }

  body::before,
  .utility-nav,
  .control-panel,
  .detail-panel,
  .reference-tabs,
  .text-button {
    display: none !important;
  }

  .masthead,
  .foreword,
  .domain-map-section,
  .cleaned-character-band,
  .workspace,
  .reference-band {
    padding: 0;
    margin: 0;
  }

  .foreword-title {
    position: static;
  }

  .foreword-layout {
    display: block;
  }

  .foreword-copy {
    column-count: 2;
  }

  .workspace {
    display: block;
  }

  .timeline-panel,
  .reference-band {
    border: 0;
    box-shadow: none;
  }

  .event-card,
  .cleaned-character-card,
  .reference-card {
    break-inside: avoid;
  }
}
