:root {
  color-scheme: dark;
  --bg: #151514;
  --bg-rail: #10100f;
  --surface: #20201d;
  --surface-2: #282722;
  --line: #3a3830;
  --line-soft: rgba(228, 218, 196, 0.13);
  --text: #f1eadc;
  --muted: #a99f8d;
  --muted-2: #756e61;
  --accent: #b63c32;
  --accent-2: #d1a451;
  --ok: #74a879;
  --warn: #d1a451;
  --shadow: 0 18px 46px rgba(0, 0, 0, 0.32);
  --radius: 8px;
  --font: "Inter", "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    linear-gradient(120deg, rgba(182, 60, 50, 0.08), transparent 35%),
    radial-gradient(circle at top right, rgba(209, 164, 81, 0.12), transparent 34%),
    var(--bg);
  color: var(--text);
  font-family: var(--font);
  letter-spacing: 0;
}

button,
input {
  font: inherit;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 22px 18px;
  background: rgba(16, 16, 15, 0.94);
  border-right: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand {
  display: grid;
  grid-template-columns: 46px 1fr;
  align-items: center;
  gap: 12px;
  color: var(--text);
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  height: 46px;
  border: 1px solid rgba(209, 164, 81, 0.55);
  background: #231d17;
  color: var(--accent-2);
  font-weight: 800;
  border-radius: 6px;
}

.brand strong {
  display: block;
  font-size: 15px;
  line-height: 1.15;
}

.brand small,
.sidebar-note span,
.topbar p,
.meta,
.muted {
  color: var(--muted);
}

.nav-group {
  display: grid;
  gap: 6px;
}

.nav-link,
.compact-button {
  min-height: 38px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--muted);
  border-radius: 6px;
  text-align: left;
  padding: 9px 11px;
  cursor: pointer;
}

.nav-link:hover,
.compact-button:hover {
  color: var(--text);
  background: rgba(241, 234, 220, 0.06);
}

.nav-link.active {
  color: var(--text);
  background: rgba(182, 60, 50, 0.16);
  border-color: rgba(182, 60, 50, 0.38);
}

.sidebar-note {
  margin-top: auto;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.03);
  display: grid;
  gap: 6px;
  font-size: 13px;
  line-height: 1.45;
}

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

.topbar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 420px);
  gap: 24px;
  align-items: end;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 5px;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1;
}

h2 {
  font-size: 24px;
  margin-bottom: 12px;
}

h3 {
  font-size: 15px;
  margin-bottom: 8px;
}

.search {
  display: grid;
  gap: 7px;
}

.search span {
  font-size: 12px;
  color: var(--muted);
  text-transform: uppercase;
}

.search input {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #0f0f0e;
  color: var(--text);
  padding: 0 14px;
  outline: none;
}

.search input:focus {
  border-color: var(--accent-2);
}

.view-root {
  padding-top: 22px;
}

.grid {
  display: grid;
  gap: 16px;
}

.dashboard-grid {
  grid-template-columns: minmax(0, 1.25fr) minmax(340px, 0.75fr);
  align-items: start;
}

.metrics {
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
}

.panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(32, 32, 29, 0.86);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.panel-body {
  padding: 18px;
}

.metric {
  min-height: 118px;
  padding: 16px;
  display: grid;
  align-content: space-between;
}

.metric strong {
  font-size: 32px;
  line-height: 1;
}

.metric span {
  color: var(--muted);
  font-size: 13px;
}

.status {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 0 9px;
  font-size: 12px;
  color: #161411;
  background: var(--accent-2);
  white-space: nowrap;
}

.status.ok {
  background: var(--ok);
}

.status.draft {
  color: var(--text);
  background: rgba(182, 60, 50, 0.32);
}

.phase-list,
.entity-list,
.chapter-list,
.search-list {
  display: grid;
  gap: 9px;
}

.row {
  width: 100%;
  border: 1px solid var(--line-soft);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.025);
  color: inherit;
  text-align: left;
  padding: 12px;
  display: grid;
  gap: 6px;
}

button.row {
  cursor: pointer;
}

button.row:hover {
  border-color: rgba(209, 164, 81, 0.44);
  background: rgba(209, 164, 81, 0.06);
}

.row-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.row-title {
  font-weight: 700;
}

.row-summary {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.45;
}

.split {
  display: grid;
  grid-template-columns: minmax(280px, 0.46fr) minmax(0, 0.54fr);
  gap: 16px;
  align-items: start;
}

.article {
  padding: 22px;
  line-height: 1.62;
}

.article h1 {
  font-size: 30px;
  line-height: 1.1;
  margin-bottom: 14px;
}

.article h2 {
  margin-top: 26px;
  padding-top: 16px;
  border-top: 1px solid var(--line-soft);
  font-size: 18px;
}

.article ul {
  padding-left: 20px;
}

.article li {
  margin: 5px 0;
}

.article a {
  color: #e8c57c;
  text-decoration: none;
}

.article a:hover {
  text-decoration: underline;
}

.article .template {
  border: 1px solid rgba(209, 164, 81, 0.32);
  background: rgba(209, 164, 81, 0.06);
  border-radius: 6px;
  padding: 12px;
  color: var(--muted);
  font-size: 13px;
  white-space: pre-wrap;
}

.search-results {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #10100f;
}

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

.filter-chip {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.035);
  color: var(--muted);
  border-radius: 999px;
  min-height: 32px;
  padding: 0 12px;
  cursor: pointer;
}

.filter-chip.active {
  color: var(--text);
  border-color: var(--accent-2);
}

.standards {
  columns: 2 360px;
  column-gap: 18px;
}

.standards .panel {
  break-inside: avoid;
  margin-bottom: 18px;
}

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

  .sidebar {
    position: static;
    height: auto;
  }

  .topbar,
  .dashboard-grid,
  .split {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 560px) {
  .main,
  .sidebar {
    padding: 16px;
  }

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

  .row-main,
  .panel-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.metric-warn { border-color: rgba(182, 60, 50, 0.7); }
.metric-warn strong { color: #e98a7e; }


/* Site Update 004: core character integration */

.character-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.character-list .row-title {
  letter-spacing: 0.01em;
}

.page-character {
  position: relative;
  border-color: rgba(209, 164, 81, 0.22);
}

.page-character h1 {
  color: #f4c542;
}

.page-character h3 {
  color: var(--text);
  margin-top: 18px;
  margin-bottom: 8px;
  font-size: 16px;
}

.character-carl {
  border-color: rgba(255, 159, 28, 0.34);
}

.character-princess-donut {
  border-color: rgba(155, 93, 229, 0.42);
}

.character-princess-donut h1 {
  color: #d7b7ff;
}

.character-mordecai {
  border-color: rgba(94, 224, 194, 0.32);
}

.character-system-ai {
  border-color: rgba(230, 57, 70, 0.44);
}

.character-odette {
  border-color: rgba(143, 124, 255, 0.38);
}

.character-zev {
  border-color: rgba(0, 194, 255, 0.38);
}

.character-agatha {
  border-color: rgba(147, 161, 161, 0.36);
}

.character-mongo {
  border-color: rgba(255, 107, 53, 0.38);
}

.infobox {
  float: right;
  width: min(320px, 100%);
  margin: 0 0 18px 22px;
  border: 1px solid rgba(209, 164, 81, 0.32);
  border-radius: var(--radius);
  background: rgba(16, 16, 15, 0.92);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.infobox-kicker {
  padding: 10px 12px;
  background: rgba(209, 164, 81, 0.12);
  color: var(--accent-2);
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  border-bottom: 1px solid rgba(209, 164, 81, 0.22);
  font-size: 12px;
}

.infobox-row {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 10px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.06);
  font-size: 12px;
}

.infobox-row span {
  color: var(--muted);
  text-transform: uppercase;
}

.infobox-row strong {
  color: var(--text);
  font-weight: 600;
  overflow-wrap: anywhere;
}

.infobox a {
  color: #e8c57c;
  text-decoration: none;
}

@media (max-width: 780px) {
  .infobox {
    float: none;
    width: 100%;
    margin: 0 0 18px 0;
  }
}


/* Site Update 010: achievement integration */

.achievement-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-achievement {
  border-color: rgba(244, 197, 66, 0.34);
  box-shadow: var(--shadow), 0 0 28px rgba(244, 197, 66, 0.08);
}

.page-achievement h1 {
  color: #f4c542;
}

.page-achievement h2::before {
  content: "ACH ";
  color: #e63946;
  font-weight: 800;
  margin-right: 6px;
}

.achievement-list .row-title {
  letter-spacing: 0.01em;
}

.achievement-list .status.ok {
  background: linear-gradient(180deg, rgba(244,197,66,0.95), rgba(255,159,28,0.95));
  color: #171006;
}

.achievement-list .status.draft {
  background: rgba(0, 194, 255, 0.14);
  border-color: rgba(0, 194, 255, 0.24);
}


/* Site Update 011: system integration */

.system-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-system {
  border-color: rgba(0, 194, 255, 0.34);
  box-shadow: var(--shadow), 0 0 28px rgba(0, 194, 255, 0.08);
}

.page-system h1 {
  color: #00c2ff;
}

.page-system h2::before {
  content: "SYS ";
  color: #00c2ff;
  font-weight: 800;
  margin-right: 6px;
}

.system-list .row-title {
  letter-spacing: 0.01em;
}

.system-list .status.ok {
  background: linear-gradient(180deg, rgba(0,194,255,0.86), rgba(79,140,255,0.86));
  color: #06111a;
}

.system-list .status.draft {
  background: rgba(244, 197, 66, 0.14);
  border-color: rgba(244, 197, 66, 0.24);
}


/* Site Update 012: reward integration */

.reward-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-reward {
  border-color: rgba(244, 197, 66, 0.42);
  box-shadow: var(--shadow), 0 0 28px rgba(244, 197, 66, 0.10);
}

.page-reward h1 {
  color: #f4c542;
}

.page-reward h2::before {
  content: "LOOT ";
  color: #f4c542;
  font-weight: 800;
  margin-right: 6px;
}

.reward-list .row-title {
  letter-spacing: 0.01em;
}

.reward-list .status.ok {
  background: linear-gradient(180deg, rgba(244,197,66,0.94), rgba(255,159,28,0.92));
  color: #171006;
}

.reward-list .status.draft {
  background: rgba(155, 93, 229, 0.16);
  border-color: rgba(155, 93, 229, 0.26);
}


/* Site Update 013: mechanics integration */

.mechanic-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-mechanic {
  border-color: rgba(114, 191, 68, 0.38);
  box-shadow: var(--shadow), 0 0 28px rgba(114, 191, 68, 0.08);
}

.page-mechanic h1 {
  color: #72bf44;
}

.page-mechanic h2::before {
  content: "MECH ";
  color: #72bf44;
  font-weight: 800;
  margin-right: 6px;
}

.mechanic-list .row-title {
  letter-spacing: 0.01em;
}

.mechanic-list .status.ok {
  background: linear-gradient(180deg, rgba(114,191,68,0.92), rgba(0,194,255,0.68));
  color: #06110a;
}

.mechanic-list .status.draft {
  background: rgba(114, 191, 68, 0.14);
  border-color: rgba(114, 191, 68, 0.24);
}


/* Site Update 014: skills integration */

.skill-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-skill {
  border-color: rgba(255, 159, 28, 0.40);
  box-shadow: var(--shadow), 0 0 28px rgba(255, 159, 28, 0.08);
}

.page-skill h1 {
  color: #ff9f1c;
}

.page-skill h2::before {
  content: "SKILL ";
  color: #ff9f1c;
  font-weight: 800;
  margin-right: 6px;
}

.skill-list .row-title {
  letter-spacing: 0.01em;
}

.skill-list .status.ok {
  background: linear-gradient(180deg, rgba(255,159,28,0.92), rgba(244,197,66,0.82));
  color: #171006;
}

.skill-list .status.draft {
  background: rgba(255, 159, 28, 0.14);
  border-color: rgba(255, 159, 28, 0.24);
}


/* Site Update 015: spells integration */

.spell-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-spell {
  border-color: rgba(155, 93, 229, 0.42);
  box-shadow: var(--shadow), 0 0 28px rgba(155, 93, 229, 0.10);
}

.page-spell h1 {
  color: #b277ff;
}

.page-spell h2::before {
  content: "MAGIC ";
  color: #b277ff;
  font-weight: 800;
  margin-right: 6px;
}

.spell-list .row-title {
  letter-spacing: 0.01em;
}

.spell-list .status.ok {
  background: linear-gradient(180deg, rgba(155,93,229,0.92), rgba(0,194,255,0.72));
  color: #080a0d;
}

.spell-list .status.draft {
  background: rgba(155, 93, 229, 0.14);
  border-color: rgba(155, 93, 229, 0.24);
}


/* Site Update 016: progression integration */

.progression-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-progression {
  border-color: rgba(0, 194, 255, 0.40);
  box-shadow: var(--shadow), 0 0 28px rgba(0, 194, 255, 0.09);
}

.page-progression h1 {
  color: #00c2ff;
}

.page-progression h2::before {
  content: "PATH ";
  color: #00c2ff;
  font-weight: 800;
  margin-right: 6px;
}

.progression-list .row-title {
  letter-spacing: 0.01em;
}

.progression-list .status.ok {
  background: linear-gradient(180deg, rgba(0,194,255,0.92), rgba(155,93,229,0.72));
  color: #080a0d;
}

.progression-list .status.draft {
  background: rgba(0, 194, 255, 0.14);
  border-color: rgba(0, 194, 255, 0.24);
}


/* Site Update 017: equipment integration */

.equipment-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-equipment {
  border-color: rgba(244, 197, 66, 0.45);
  box-shadow: var(--shadow), 0 0 28px rgba(244, 197, 66, 0.10);
}

.page-equipment h1 {
  color: #f4c542;
}

.page-equipment h2::before {
  content: "GEAR ";
  color: #f4c542;
  font-weight: 800;
  margin-right: 6px;
}

.equipment-list .row-title {
  letter-spacing: 0.01em;
}

.equipment-list .status.ok {
  background: linear-gradient(180deg, rgba(244,197,66,0.94), rgba(255,159,28,0.86));
  color: #171006;
}

.equipment-list .status.draft {
  background: rgba(244, 197, 66, 0.14);
  border-color: rgba(244, 197, 66, 0.24);
}


/* Site Update 022: monsters integration */

.monster-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-monster {
  border-color: rgba(230, 57, 70, 0.42);
  box-shadow: var(--shadow), 0 0 28px rgba(230, 57, 70, 0.10);
}

.page-monster h1 {
  color: #e63946;
}

.page-monster h2::before {
  content: "THREAT ";
  color: #e63946;
  font-weight: 800;
  margin-right: 6px;
}

.monster-list .row-title {
  letter-spacing: 0.01em;
}

.monster-list .status.ok {
  background: linear-gradient(180deg, rgba(230,57,70,0.92), rgba(255,159,28,0.82));
  color: #120607;
}

.monster-list .status.draft {
  background: rgba(230, 57, 70, 0.14);
  border-color: rgba(230, 57, 70, 0.24);
}


/* Site Update 026: locations integration */

.location-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-location {
  border-color: rgba(0, 194, 255, 0.42);
  box-shadow: var(--shadow), 0 0 28px rgba(0, 194, 255, 0.10);
}

.page-location h1 {
  color: #00c2ff;
}

.page-location h2::before {
  content: "LOC ";
  color: #00c2ff;
  font-weight: 800;
  margin-right: 6px;
}

.location-list .row-title {
  letter-spacing: 0.01em;
}

.location-list .status.ok {
  background: linear-gradient(180deg, rgba(0,194,255,0.88), rgba(114,191,68,0.72));
  color: #06111a;
}

.location-list .status.draft {
  background: rgba(0, 194, 255, 0.14);
  border-color: rgba(0, 194, 255, 0.24);
}


/* Site Update 029: organizations integration */

.organization-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-organization {
  border-color: rgba(155, 93, 229, 0.42);
  box-shadow: var(--shadow), 0 0 28px rgba(155, 93, 229, 0.10);
}

.page-organization h1 {
  color: #b277ff;
}

.page-organization h2::before {
  content: "ORG ";
  color: #b277ff;
  font-weight: 800;
  margin-right: 6px;
}

.organization-list .row-title {
  letter-spacing: 0.01em;
}

.organization-list .status.ok {
  background: linear-gradient(180deg, rgba(155,93,229,0.90), rgba(0,194,255,0.70));
  color: #090710;
}

.organization-list .status.draft {
  background: rgba(155, 93, 229, 0.14);
  border-color: rgba(155, 93, 229, 0.24);
}


/* Site Update 030: relationships integration */

.relationship-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-relationship {
  border-color: rgba(244, 197, 66, 0.45);
  box-shadow: var(--shadow), 0 0 28px rgba(244, 197, 66, 0.10);
}

.page-relationship h1 {
  color: #f4c542;
}

.page-relationship h2::before {
  content: "BOND ";
  color: #f4c542;
  font-weight: 800;
  margin-right: 6px;
}

.relationship-list .row-title {
  letter-spacing: 0.01em;
}

.relationship-list .status.ok {
  background: linear-gradient(180deg, rgba(244,197,66,0.94), rgba(155,93,229,0.74));
  color: #12080a;
}

.relationship-list .status.draft {
  background: rgba(244, 197, 66, 0.14);
  border-color: rgba(244, 197, 66, 0.24);
}


/* Site Update 031: media integration */

.media-split {
  grid-template-columns: minmax(280px, 0.38fr) minmax(0, 0.62fr);
}

.page-media {
  border-color: rgba(0, 194, 255, 0.42);
  box-shadow: var(--shadow), 0 0 28px rgba(0, 194, 255, 0.10);
}

.page-media h1 {
  color: #00c2ff;
}

.page-media h2::before {
  content: "FEED ";
  color: #00c2ff;
  font-weight: 800;
  margin-right: 6px;
}

.media-list .row-title {
  letter-spacing: 0.01em;
}

.media-list .status.ok {
  background: linear-gradient(180deg, rgba(0,194,255,0.90), rgba(155,93,229,0.72));
  color: #06111a;
}

.media-list .status.draft {
  background: rgba(0, 194, 255, 0.14);
  border-color: rgba(0, 194, 255, 0.24);
}


/* Site Update 032: timeline integration */

.timeline-split {
  grid-template-columns: minmax(280px, 0.36fr) minmax(0, 0.64fr);
}

.page-timeline {
  border-color: rgba(244, 197, 66, 0.48);
  box-shadow: var(--shadow), 0 0 28px rgba(244, 197, 66, 0.10);
}

.page-timeline h1 {
  color: #f4c542;
}

.page-timeline h2::before {
  content: "TIME ";
  color: #f4c542;
  font-weight: 800;
  margin-right: 6px;
}

.timeline-list .row-title {
  letter-spacing: 0.01em;
}

.timeline-list .status.ok {
  background: linear-gradient(180deg, rgba(244,197,66,0.94), rgba(0,194,255,0.76));
  color: #120f06;
}

.timeline-event {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(244, 197, 66, 0.18);
  border-radius: 14px;
  background: rgba(244, 197, 66, 0.06);
}

.timeline-event-kicker {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.timeline-event h3 {
  margin: 6px 0;
}

.timeline-event p {
  margin: 0 0 6px;
}

.timeline-event-list {
  margin-top: 28px;
}


/* Site Update 033: QA integration */

.qa-split {
  grid-template-columns: minmax(280px, 0.36fr) minmax(0, 0.64fr);
}

.page-qa {
  border-color: rgba(114, 191, 68, 0.48);
  box-shadow: var(--shadow), 0 0 28px rgba(114, 191, 68, 0.10);
}

.page-qa h1 {
  color: #72bf44;
}

.page-qa h2::before {
  content: "QA ";
  color: #72bf44;
  font-weight: 800;
  margin-right: 6px;
}

.qa-list .row-title {
  letter-spacing: 0.01em;
}

.qa-list .status.ok {
  background: linear-gradient(180deg, rgba(114,191,68,0.94), rgba(0,194,255,0.76));
  color: #06110a;
}

.qa-issue {
  margin: 12px 0;
  padding: 12px;
  border: 1px solid rgba(114, 191, 68, 0.18);
  border-radius: 14px;
  background: rgba(114, 191, 68, 0.06);
}

.qa-issue h3 {
  margin: 6px 0;
}

.qa-issue p {
  margin: 0;
}

.qa-issue-list {
  margin-top: 28px;
}

/* Site Update 034: Phase 33 editorial cleanup */

.category-pill {
  display: inline-flex;
  align-items: center;
  margin: 0 3px 3px 0;
  padding: 2px 7px;
  border: 1px solid rgba(244, 197, 66, 0.22);
  border-radius: 999px;
  background: rgba(244, 197, 66, 0.08);
  color: var(--muted);
  font-size: 0.82em;
  line-height: 1.35;
}

/* Restored Crawl Archive HUD visual layer */
:root {
  --bg: #050604;
  --bg-rail: #080806;
  --surface: rgba(10, 11, 9, 0.94);
  --surface-2: rgba(18, 17, 13, 0.92);
  --line: rgba(178, 119, 31, 0.48);
  --line-soft: rgba(232, 158, 42, 0.22);
  --text: #f4efe4;
  --muted: #b8b1a4;
  --muted-2: #777064;
  --accent: #f0a014;
  --accent-2: #ffb21e;
  --cyan: #35d7f4;
  --green: #47db68;
  --red: #ff4e3d;
  --violet: #9b6cff;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.64);
  --radius: 2px;
  --font: "Arial Narrow", "Roboto Condensed", "Bahnschrift", "Segoe UI Condensed", "Segoe UI", Arial, sans-serif;
}

body {
  background:
    linear-gradient(rgba(255, 255, 255, 0.018) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.014) 1px, transparent 1px),
    radial-gradient(circle at 76% 8%, rgba(35, 215, 244, 0.11), transparent 25%),
    radial-gradient(circle at 24% 16%, rgba(240, 160, 20, 0.13), transparent 28%),
    #050604;
  background-size: 26px 26px, 26px 26px, auto, auto, auto;
  color: var(--text);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    repeating-linear-gradient(0deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 4px),
    radial-gradient(circle at center, transparent 45%, rgba(0, 0, 0, 0.48));
  mix-blend-mode: overlay;
  opacity: 0.24;
  z-index: 5;
}

.app-shell {
  grid-template-columns: 230px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
}

.sidebar,
.topbar,
.panel,
.search-results,
.crawl-hero,
.archive-card,
.crawlfeed {
  position: relative;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(255, 178, 30, 0.08), transparent 16px) top left / 42px 42px no-repeat,
    linear-gradient(225deg, rgba(255, 178, 30, 0.08), transparent 16px) top right / 42px 42px no-repeat,
    linear-gradient(315deg, rgba(255, 178, 30, 0.08), transparent 16px) bottom right / 42px 42px no-repeat,
    linear-gradient(45deg, rgba(255, 178, 30, 0.08), transparent 16px) bottom left / 42px 42px no-repeat,
    rgba(7, 8, 6, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255, 178, 30, 0.06), var(--shadow);
}

.sidebar {
  height: calc(100vh - 36px);
  padding: 18px 14px;
  gap: 18px;
  overflow: auto;
}

.brand {
  display: block;
  min-height: 226px;
  padding: 12px;
  border: 1px solid rgba(255, 178, 30, 0.62);
  color: var(--accent-2);
  text-align: center;
  text-transform: uppercase;
  background: rgba(8, 8, 6, 0.94);
}

.brand-mark {
  width: 112px;
  height: 98px;
  margin: 0 auto 8px;
  border: 0;
  background: url("images/dcc-gold-skull-logo.png") center / contain no-repeat;
  filter: drop-shadow(0 0 14px rgba(255, 178, 30, 0.28));
}

.brand strong {
  font-size: 31px;
  line-height: 0.92;
  letter-spacing: 0.02em;
}

.brand small {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 18px;
  color: #0a0804;
  background: var(--accent-2);
  font-size: 15px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.nav-group {
  gap: 0;
  border: 1px solid rgba(255, 178, 30, 0.36);
}

.nav-link,
.compact-button {
  min-height: 52px;
  border-radius: 0;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.025);
  color: #c8c3b8;
  padding: 0 18px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-size: 18px;
  font-weight: 800;
}

.nav-link:hover,
.compact-button:hover {
  color: var(--accent-2);
  background: rgba(255, 178, 30, 0.08);
}

.nav-link.active {
  color: var(--accent-2);
  background: rgba(255, 178, 30, 0.11);
  border-left: 4px solid var(--accent-2);
}

.system-status,
.viewer-warning {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(71, 219, 104, 0.45);
  background: rgba(4, 21, 10, 0.72);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.04em;
}

.system-status strong {
  color: var(--green);
  font-size: 16px;
}

.system-status span {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #b8c8b9;
}

.system-status b {
  color: var(--green);
}

.viewer-warning {
  border-color: rgba(255, 78, 61, 0.65);
  background: rgba(37, 7, 5, 0.72);
  color: #ff786d;
}

.viewer-warning strong {
  color: var(--red);
}

.main {
  padding: 0;
}

.topbar {
  grid-template-columns: auto minmax(360px, 1fr);
  align-items: center;
  min-height: 82px;
  margin-bottom: 18px;
  padding: 14px 20px;
  border-bottom: 1px solid var(--line);
}

.topbar h1 {
  margin: 0;
  color: var(--accent-2);
  text-transform: uppercase;
  font-size: 32px;
  line-height: 1;
  letter-spacing: 0.04em;
}

.topbar p {
  display: none;
}

.search {
  position: relative;
  justify-self: end;
  width: min(100%, 850px);
}

.search span {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
}

.search input {
  height: 54px;
  border: 2px solid rgba(53, 215, 244, 0.75);
  border-radius: 2px;
  background: rgba(0, 18, 21, 0.86);
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 18px;
  box-shadow: inset 0 0 24px rgba(53, 215, 244, 0.08), 0 0 18px rgba(53, 215, 244, 0.12);
}

.search input::placeholder {
  color: rgba(89, 222, 242, 0.72);
}

.view-root {
  padding-top: 0;
}

.crawl-hero {
  min-height: 388px;
  display: grid;
  grid-template-columns: minmax(420px, 1fr) minmax(460px, 0.82fr);
  gap: 28px;
  padding: 36px 58px;
  overflow: hidden;
}

.crawl-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(5, 6, 4, 0.22), rgba(5, 6, 4, 0.7) 52%, rgba(5, 6, 4, 0.86)),
    url("images/dcc-hero-corridor.png") center / cover no-repeat;
  opacity: 0.88;
}

.hero-copy,
.broadcast-panel {
  position: relative;
  z-index: 1;
}

.hero-copy h2 {
  margin: 0 0 22px;
  max-width: 610px;
  color: #f5f0e8;
  text-transform: uppercase;
  font-size: clamp(52px, 4.8vw, 72px);
  line-height: 0.96;
  letter-spacing: 0.035em;
  text-shadow: 0 4px 0 rgba(255, 255, 255, 0.08), 0 0 18px rgba(0, 0, 0, 0.7);
}

.hero-copy h2::after {
  content: "";
  display: block;
  width: 270px;
  height: 3px;
  margin-top: 18px;
  background: var(--accent-2);
}

.hero-copy p {
  max-width: 430px;
  margin-bottom: 22px;
  color: #d8d4cb;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 19px;
  line-height: 1.45;
}

.hero-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 690px;
  border: 1px solid rgba(255, 178, 30, 0.36);
  background: rgba(0, 0, 0, 0.58);
}

.hero-stats button {
  min-height: 62px;
  padding: 12px 14px;
  border: 0;
  border-right: 1px solid rgba(255, 178, 30, 0.26);
  background: transparent;
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.hero-stats span {
  display: block;
  color: #c9b890;
  text-transform: uppercase;
  font-size: 12px;
}

.hero-stats strong {
  display: block;
  margin-top: 3px;
  color: #fff;
  font-size: 22px;
  line-height: 1;
}

.broadcast-panel {
  align-self: center;
  min-height: 286px;
  padding: 22px 24px 18px;
  border: 1px solid rgba(53, 215, 244, 0.36);
  background: rgba(0, 11, 14, 0.86);
  box-shadow: inset 0 0 36px rgba(53, 215, 244, 0.08), 0 0 24px rgba(0, 0, 0, 0.55);
  color: var(--cyan);
  text-transform: uppercase;
  overflow: hidden;
}

.broadcast-head,
.broadcast-foot {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  letter-spacing: 0.08em;
}

.broadcast-head b {
  display: inline-block;
  width: 12px;
  height: 12px;
  margin-right: 8px;
  border-radius: 50%;
  background: var(--red);
  box-shadow: 0 0 12px var(--red);
}

.broadcast-panel img {
  display: block;
  width: 100%;
  height: 184px;
  object-fit: cover;
  margin: 8px 0 0;
  opacity: 0.96;
}

.broadcast-caption {
  margin-top: -28px;
  text-align: center;
  font-size: 19px;
  line-height: 1.12;
  letter-spacing: 0.08em;
  text-shadow: 0 0 12px rgba(53, 215, 244, 0.7);
}

.broadcast-foot {
  margin-top: 18px;
  color: var(--red);
}

.feature-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
  margin-top: 18px;
}

.archive-card {
  min-height: 318px;
  padding: 24px 22px;
  color: var(--text);
  text-align: left;
  cursor: pointer;
  overflow: hidden;
}

.archive-card:hover {
  transform: translateY(-2px);
  border-color: rgba(255, 178, 30, 0.85);
}

.card-kicker,
.card-action {
  color: var(--accent-2);
  text-transform: uppercase;
  font-size: 16px;
  font-weight: 900;
  letter-spacing: 0.05em;
}

.archive-card strong {
  display: block;
  margin-top: 4px;
  color: #f4efe4;
  text-transform: uppercase;
  font-size: 31px;
  line-height: 1.04;
}

.card-visual {
  display: block;
  height: 106px;
  margin: 20px 0 18px;
  border: 1px solid rgba(255, 178, 30, 0.16);
  background:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    radial-gradient(circle, rgba(255, 178, 30, 0.44), transparent 38%),
    rgba(0, 0, 0, 0.45);
  background-size: 22px 22px, 22px 22px, auto, auto;
}

.card-green .card-visual {
  border-color: rgba(71, 219, 104, 0.22);
  background:
    linear-gradient(rgba(71, 219, 104, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(71, 219, 104, 0.09) 1px, transparent 1px),
    radial-gradient(circle, rgba(71, 219, 104, 0.35), transparent 40%),
    rgba(0, 17, 8, 0.58);
}

.card-cyan .card-visual {
  border-color: rgba(53, 215, 244, 0.28);
  background:
    linear-gradient(rgba(53, 215, 244, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(53, 215, 244, 0.09) 1px, transparent 1px),
    radial-gradient(circle, rgba(53, 215, 244, 0.34), transparent 40%),
    rgba(0, 17, 22, 0.58);
}

.card-violet .card-visual {
  border-color: rgba(155, 108, 255, 0.28);
  background:
    linear-gradient(rgba(155, 108, 255, 0.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(155, 108, 255, 0.09) 1px, transparent 1px),
    radial-gradient(circle, rgba(155, 108, 255, 0.38), transparent 40%),
    rgba(14, 7, 28, 0.58);
}

.card-summary {
  display: block;
  min-height: 66px;
  color: #c9c3b8;
  font-family: "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.45;
}

.card-action {
  display: block;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 178, 30, 0.18);
}

.crawlfeed {
  display: grid;
  grid-template-columns: 150px repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 36px;
  padding: 14px;
}

.crawlfeed button,
.feed-item {
  min-height: 66px;
  border: 1px solid rgba(53, 215, 244, 0.36);
  background: rgba(0, 18, 21, 0.42);
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.feed-item {
  display: grid;
  align-content: center;
  padding: 10px 16px;
}

.feed-item strong {
  font-size: 14px;
}

.feed-item span {
  color: #b6b9b3;
  font-size: 13px;
  text-transform: none;
}

.feed-item.alert {
  border-color: rgba(255, 78, 61, 0.45);
  color: var(--red);
}

.feed-item.loot {
  border-color: rgba(255, 178, 30, 0.45);
  color: var(--accent-2);
}

.feed-item.system {
  border-color: rgba(71, 219, 104, 0.45);
  color: var(--green);
}

.panel,
.row,
.search-results {
  border-color: rgba(255, 178, 30, 0.32);
  background-color: rgba(7, 8, 6, 0.9);
}

.panel-header {
  border-bottom-color: rgba(255, 178, 30, 0.22);
}

.panel h2,
.article h1,
.article h2 {
  text-transform: uppercase;
  color: var(--accent-2);
  letter-spacing: 0.03em;
}

.status {
  border-radius: 0;
  background: var(--accent-2);
  text-transform: uppercase;
  font-weight: 900;
}

.status.ok {
  background: var(--green);
}

.search-results {
  margin-bottom: 18px;
}

@media (max-width: 1220px) {
  .app-shell {
    grid-template-columns: 236px minmax(0, 1fr);
  }

  .crawl-hero {
    grid-template-columns: 1fr;
    padding: 38px;
  }

  .broadcast-panel {
    max-width: 680px;
  }

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

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

@media (max-width: 980px) {
  .app-shell {
    display: block;
    padding: 0;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 12px;
    border-left: 0;
    border-right: 0;
  }

  .brand {
    min-height: 138px;
    display: grid;
    grid-template-columns: 92px 1fr;
    align-items: center;
    text-align: left;
  }

  .brand-mark {
    width: 86px;
    height: 86px;
    margin: 0;
  }

  .brand strong {
    font-size: 27px;
  }

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

  .nav-link {
    min-height: 48px;
    font-size: 15px;
  }

  .system-status,
  .viewer-warning {
    display: none;
  }

  .main {
    padding: 12px;
  }

  .topbar {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 18px;
  }

  .topbar h1 {
    display: none;
  }

  .search {
    justify-self: stretch;
    width: 100%;
  }
}

@media (max-width: 640px) {
  .crawl-hero {
    min-height: auto;
    padding: 28px 18px;
  }

  .hero-copy h2 {
    font-size: 44px;
  }

  .hero-copy p {
    font-size: 17px;
  }

  .hero-stats,
  .feature-grid,
  .crawlfeed {
    grid-template-columns: 1fr;
  }

  .broadcast-panel {
    padding: 14px;
  }

  .broadcast-panel img {
    height: 170px;
  }

  .broadcast-caption {
    margin-top: -22px;
    font-size: 15px;
  }

  .archive-card {
    min-height: 300px;
  }

  .card-visual {
    height: 100px;
    margin: 18px 0;
  }
}
