:root {
  --bg: #151a1f;
  --panel: #1d252b;
  --panel-2: #283238;
  --surface: rgba(29,37,43,.9);
  --surface-soft: rgba(39,49,55,.74);
  --surface-strong: rgba(18,24,29,.93);
  --ink: #ecefed;
  --muted: #aeb6b5;
  --line: #3a4549;
  --rust: #bf806d;
  --amber: #c2a46d;
  --teal: #8bb8b3;
  --graphite: #11161b;
}

* {
  box-sizing: border-box;
}

img {
  max-width: 100%;
  height: auto;
}

p,
li,
a,
code {
  overflow-wrap: anywhere;
  word-break: break-word;
}

pre {
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.mermaid {
  width: 100%;
  margin: 18px 0 0;
  padding: 18px;
  overflow-x: auto;
  border: 1px solid rgba(139,184,179,.22);
  border-radius: 8px;
  background: rgba(17,22,27,.62);
}

.mermaid svg {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
}

.mermaid-error {
  color: #ffd1c5;
  white-space: pre-wrap;
}

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 280px 1fr;
  background:
    radial-gradient(circle at 22% 0%, rgba(139,184,179,.08), transparent 31%),
    radial-gradient(circle at 88% 8%, rgba(191,128,109,.055), transparent 25%),
    linear-gradient(180deg, #20292f 0%, var(--bg) 44%, #11161a 100%);
  color: var(--ink);
  font-family: "Segoe UI", Arial, sans-serif;
}

body[data-lang="zh"] .en,
body[data-lang="en"] .zh {
  display: none;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 24px 18px;
  background:
    linear-gradient(180deg, rgba(24,32,38,.98), rgba(13,18,22,.98)),
    var(--graphite);
  color: var(--ink);
  border-right: 1px solid rgba(139,184,179,.14);
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 1px solid rgba(237,243,236,.12);
}

.brand img {
  width: 46px;
  height: 46px;
  object-fit: cover;
  border-radius: 6px;
}

.brand strong,
.brand span {
  display: block;
}

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

.brand span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

nav {
  display: grid;
  gap: 4px;
  margin-top: 22px;
}

nav a {
  min-height: 38px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  border-radius: 6px;
  color: #d7e2ec;
  text-decoration: none;
  font-size: 14px;
}

nav a:hover,
nav a.active {
  background: rgba(139,184,179,.12);
  color: #ffffff;
}

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

.topbar,
.forum-hero,
.layout {
  max-width: 1220px;
  margin-right: auto;
  margin-left: auto;
}

.topbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.searchbox {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
}

.searchbox input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: inherit;
}

.language-switch {
  display: flex;
  gap: 8px;
}

.language-switch button,
.tabs button,
.primary-action {
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.language-switch button {
  min-width: 82px;
}

.language-switch button.active,
.tabs button.active,
.primary-action {
  border-color: var(--rust);
  background: linear-gradient(180deg, #c99180, var(--rust));
  color: #fff4ee;
}

.forum-hero {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(115deg, rgba(191,128,109,.09), transparent 44%),
    linear-gradient(25deg, rgba(139,184,179,.1), transparent 56%),
    var(--panel);
}

.primary-action {
  min-width: 112px;
  padding: 0 16px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--rust);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 780px;
  margin-bottom: 12px;
  font-size: clamp(26px, 3.2vw, 36px);
  line-height: 1.12;
}

h2 {
  margin-bottom: 0;
  font-size: 22px;
}

h3 {
  margin-bottom: 6px;
  font-size: 17px;
}

.lede {
  max-width: 840px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: clamp(15px, 1.35vw, 17px);
  line-height: 1.58;
}

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

.main-column,
.right-column {
  display: grid;
  gap: 18px;
  align-content: start;
}

.panel {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  box-shadow: 0 18px 40px rgba(0,0,0,.18);
  min-width: 0;
}

.panel.compact {
  padding: 18px;
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid rgba(139,184,179,.14);
  }

  nav {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 4px;
  }

  nav a {
    flex: 0 0 auto;
    min-width: 136px;
  }

  main {
    padding: 18px 16px 28px;
  }
}

.panel-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 16px;
}

.small-action {
  align-self: center;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: linear-gradient(180deg, #c99180, var(--rust));
  color: #fff4ee;
  text-decoration: none;
  font-weight: 700;
  white-space: nowrap;
}

.pinned-panel {
  margin-bottom: 18px;
}

.pinned-panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.pin-clear {
  cursor: pointer;
}

.pinned-feed {
  display: grid;
  gap: 10px;
  margin-top: 12px;
}

.pinned-empty {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.pinned-item {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px 10px 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.pinned-item a {
  min-width: 0;
  color: inherit;
  text-decoration: none;
}

.pinned-item span,
.pinned-item p {
  display: block;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.pinned-item strong {
  display: block;
  margin-top: 2px;
  font-size: 14px;
  line-height: 1.35;
}

.pinned-item p {
  display: -webkit-box;
  margin: 5px 0 0;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.pin-remove,
.pin-toggle {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.04);
  color: var(--muted);
  cursor: pointer;
}

.pin-remove {
  width: 28px;
  height: 28px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.pin-toggle {
  padding: 7px 11px;
  font-size: 13px;
}

.pin-toggle.is-pinned {
  border-color: rgba(215,169,71,.42);
  color: var(--amber);
  background: rgba(215,169,71,.12);
}

.page-pin-actions {
  margin: 10px 0 14px;
}

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

.tabs button {
  padding: 0 12px;
}

.thread {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}

.thread:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.thread-icon {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--rust);
  font-weight: 800;
  font-size: 13px;
}

.thread.pinned .thread-icon {
  background: rgba(139,184,179,.12);
  color: var(--teal);
}

.thread-title {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.thread-body p {
  margin-bottom: 10px;
  color: var(--muted);
  line-height: 1.52;
}

.thread-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 12px;
}

.badge {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  white-space: nowrap;
}

.badge.current {
  background: rgba(139,184,179,.13);
  color: var(--teal);
}

.badge.validation {
  background: rgba(215,169,71,.18);
  color: var(--amber);
}

.badge.durable {
  background: rgba(191,128,109,.13);
  color: var(--rust);
}

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

.board-grid article,
.stat-list div {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.board-grid strong,
.board-grid span,
.stat-list span,
.stat-list strong {
  display: block;
}

.board-grid span,
.stat-list span {
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.4;
}

.rule-list {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding-left: 18px;
}

.rule-list li {
  line-height: 1.48;
}

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

.framework-card,
.module-row {
  color: inherit;
  text-decoration: none;
}

.framework-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.framework-card:hover,
.module-row:hover {
  transform: translateY(-2px);
  border-color: rgba(139,184,179,.28);
  box-shadow: 0 14px 30px rgba(0,0,0,.2);
}

.card-kicker {
  color: var(--rust);
  font-size: 12px;
  font-weight: 700;
}

.framework-card strong {
  margin: 18px 0 10px;
  font-size: 18px;
  line-height: 1.3;
}

.framework-card p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.module-row {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 14px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.module-row:first-of-type {
  border-top: 0;
  padding-top: 0;
}

.module-code {
  width: 52px;
  height: 52px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--panel-2);
  color: var(--rust);
  font-weight: 800;
}

.module-title {
  display: flex;
  gap: 12px;
  align-items: start;
  justify-content: space-between;
}

.module-body p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.52;
}

.step-list {
  display: grid;
  gap: 12px;
  margin: 14px 0 0;
  padding-left: 20px;
  color: var(--muted);
  line-height: 1.5;
}

.detail-page {
  display: block;
}

.detail-main {
  max-width: 900px;
  margin: 0 auto;
  padding: 34px 22px;
}

.detail-main.wide {
  max-width: 1180px;
}

.back-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  margin-bottom: 16px;
}

.back-link {
  display: inline-flex;
  color: var(--rust);
  text-decoration: none;
  font-weight: 700;
}

.detail {
  padding: 32px;
}

.stat-list {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

code {
  padding: 2px 5px;
  border-radius: 4px;
  background: #223047;
  color: #dcebf4;
  font-family: Consolas, "Courier New", monospace;
  font-size: .93em;
}

.guard-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.guard-line code {
  padding: 8px 10px;
  border: 1px solid var(--line);
}

@media (max-width: 1060px) {
  body {
    display: block;
  }

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

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

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

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

@media (max-width: 720px) {
  main {
    padding: 16px;
  }

  .topbar,
  .forum-hero,
  .panel-head,
  .thread-title {
    align-items: stretch;
    flex-direction: column;
  }

  .topbar {
    display: grid;
  }

  .forum-hero {
    display: grid;
  }

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

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

  .framework-grid,
  .module-row {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding: 18px 16px;
  }

  .brand {
    margin-bottom: 18px;
  }

  h1 {
    font-size: 30px;
  }
}

/* AAA production wiki layout overrides */
.project-hero,
.archive-panel {
  max-width: 1220px;
  margin-right: auto;
  margin-left: auto;
}

.project-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
  align-items: stretch;
  min-height: 360px;
  padding: 46px;
  border: 1px solid rgba(139,184,179,.18);
  border-radius: 8px;
  background:
    linear-gradient(90deg, rgba(13,21,33,.88) 0%, rgba(20,31,47,.72) 43%, rgba(20,31,47,.46) 70%, rgba(13,21,33,.76) 100%),
    linear-gradient(180deg, rgba(25,38,57,.1), rgba(9,15,23,.64)),
    url("assets/ashveil-map-hero.jpg") center / cover no-repeat;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

.hero-copy {
  position: relative;
  z-index: 1;
  align-self: center;
}

.project-hero .eyebrow {
  color: #f1b39f;
}

.project-hero h1 {
  color: #fffaf0;
  text-shadow: 0 2px 18px rgba(0,0,0,.42);
}

.project-hero .lede {
  color: rgba(237,243,248,.84);
  text-shadow: 0 1px 12px rgba(0,0,0,.34);
}

.production-brief {
  position: relative;
  z-index: 1;
  display: grid;
  gap: 10px;
  align-content: center;
}

.production-brief div {
  min-width: 0;
  padding: 15px;
  border: 1px solid rgba(139,184,179,.18);
  border-radius: 8px;
  background: rgba(25,33,38,.72);
  box-shadow: 0 12px 28px rgba(0,0,0,.18);
  backdrop-filter: blur(5px);
}

.production-brief span,
.production-brief strong {
  display: block;
}

.production-brief span {
  margin-bottom: 6px;
  color: rgba(255,250,240,.7);
  font-size: 12px;
}

.production-brief strong {
  color: #fffaf0;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.project-hero .lede,
.section-subtitle,
.reader-map-card p,
.discipline-card p,
.module-row p {
  overflow-wrap: anywhere;
}

.section-subtitle {
  max-width: 900px;
  margin: 9px 0 0;
  color: var(--muted);
  line-height: 1.58;
}

#map,
#disciplines {
  max-width: 1220px;
  margin-right: auto;
  margin-left: auto;
}

.reader-map {
  margin-top: 18px;
}

.reader-map-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.reader-map-card {
  min-height: 132px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 8px 12px;
  align-content: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: inherit;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.reader-map-card:hover {
  transform: translateY(-2px);
  border-color: rgba(139,184,179,.28);
  box-shadow: 0 14px 30px rgba(0,0,0,.2);
}

.reader-map-card.is-primary {
  grid-column: span 2;
  border-color: rgba(139,184,179,.24);
  background:
    linear-gradient(135deg, rgba(139,184,179,.13), rgba(39,49,55,.84) 58%),
    var(--surface-soft);
}

.reader-map-card.is-primary strong {
  font-size: 19px;
}

.reader-map-card > span {
  grid-row: 1 / span 2;
  width: 36px;
  height: 36px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.reader-map-card strong {
  min-width: 0;
  font-size: 17px;
  line-height: 1.32;
}

.reader-map-card p {
  min-width: 0;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.46;
}

.discipline-groups {
  display: grid;
  gap: 20px;
}

.discipline-group {
  display: grid;
  gap: 14px;
  padding-top: 18px;
  border-top: 1px solid rgba(139,184,179,.12);
}

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

.group-header {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.group-header > span {
  width: 38px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(139,184,179,.1);
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
}

.group-header h3 {
  margin: 0;
  font-size: 17px;
  line-height: 1.28;
}

.group-header p {
  max-width: 760px;
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

.discipline-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 14px;
}

.discipline-group .discipline-grid {
  align-items: start;
  grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
}

.discipline-card {
  min-height: 138px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  grid-template-rows: auto minmax(0, 1fr);
  column-gap: 14px;
  row-gap: 10px;
  align-items: start;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(45,56,62,.86), rgba(28,37,43,.88)),
    var(--panel);
  color: inherit;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.discipline-card.is-featured {
  min-height: 166px;
  padding: 20px;
  border-color: rgba(139,184,179,.24);
  background:
    linear-gradient(135deg, rgba(139,184,179,.11), rgba(45,56,62,.9) 58%, rgba(28,37,43,.92)),
    var(--panel);
}

.discipline-card.is-featured h3 {
  font-size: 20px;
}

.discipline-card.is-featured p {
  font-size: 15px;
}

.discipline-card:hover,
.archive-item:hover,
.module-row:hover {
  transform: translateY(-2px);
  border-color: rgba(139,184,179,.28);
  box-shadow: 0 14px 30px rgba(0,0,0,.2);
}

.discipline-card > span {
  min-width: 42px;
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--rust);
  font-size: 12px;
  font-weight: 800;
  line-height: 1;
}

.discipline-card h3 {
  margin-bottom: 0;
  font-size: 18px;
  line-height: 1.25;
}

.discipline-card p {
  grid-column: 2;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.5;
}

@media (min-width: 1061px) {
  .discipline-group .discipline-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .discipline-card {
    grid-column: span 1;
  }

  #dossier-gameplay .discipline-card,
  #dossier-interface .discipline-card,
  .discipline-card.is-featured {
    grid-column: span 2;
  }

  #dossier-interface .discipline-card.is-featured {
    grid-column: span 3;
  }

  #dossier-interface .discipline-card:not(.is-featured) {
    grid-column: span 1;
  }

  .discipline-card.is-wide {
    grid-column: span 4;
    min-height: 112px;
  }
}

.badge.draft {
  background: rgba(237,243,236,.09);
  color: var(--muted);
}

.archive-panel {
  margin-top: 18px;
}

.archive-feed {
  display: grid;
  gap: 18px;
}

.compact-feed .archive-date-group:nth-child(n+8) {
  display: none;
}

.archive-tools {
  display: grid;
  gap: 12px;
  margin-bottom: 18px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-row button {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  cursor: pointer;
}

.filter-row button.active {
  border-color: var(--rust);
  background: linear-gradient(180deg, #c99180, var(--rust));
  color: #fff4ee;
}

.archive-date-group {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 16px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.archive-date-group:first-child {
  padding-top: 0;
  border-top: 0;
}

.date-rail {
  position: sticky;
  top: 14px;
  align-self: start;
}

.date-rail time,
.date-rail span {
  display: block;
}

.date-rail time {
  color: var(--rust);
  font-weight: 800;
}

.date-rail span {
  width: fit-content;
  margin-top: 8px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.archive-list {
  display: grid;
  gap: 10px;
}

.archive-item {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
  color: inherit;
  text-decoration: none;
  transition: transform .16s ease, border-color .16s ease, box-shadow .16s ease;
}

.record-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 8px;
}

.record-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
}

.archive-item h3 {
  margin-bottom: 6px;
}

.archive-item p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.capability-list {
  display: grid;
  gap: 16px;
}

.capability-card {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.capability-card h2 {
  margin-bottom: 8px;
  font-size: 24px;
}

.capability-card h3 {
  margin: 14px 0 8px;
  font-size: 15px;
  color: var(--rust);
}

.capability-card p,
.capability-card li {
  color: var(--muted);
  line-height: 1.55;
}

.capability-card ol,
.capability-card ul {
  padding-left: 20px;
}

.capability-card a {
  color: var(--rust);
  text-decoration: none;
  font-weight: 700;
}

.capability-status {
  color: #fff4ee !important;
  background: linear-gradient(180deg, #c99180, var(--rust)) !important;
}

.capability-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.capability-tags span {
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.module-log {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.module-section {
  margin-top: 24px;
}

.module-section h2 {
  font-size: 22px;
}

.report-detail {
  max-width: 1080px;
}

.report-detail h2,
.report-detail h3,
.report-detail h4 {
  margin-top: 26px;
}

.report-detail p,
.report-detail li {
  line-height: 1.68;
}

.report-table-wrap {
  width: 100%;
  margin: 16px 0 22px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(17,22,27,.42);
}

.report-table-wrap table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.report-table-wrap th,
.report-table-wrap td {
  padding: 10px 12px;
  border: 1px solid rgba(58,69,73,.82);
  vertical-align: top;
  text-align: left;
  line-height: 1.55;
}

.report-table-wrap th {
  color: #f3ead6;
  background: rgba(194,164,109,.12);
}

.report-table-wrap td {
  color: var(--ink);
}

.module-status-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.module-status-strip article {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.module-status-strip span,
.module-status-strip strong {
  display: block;
}

.module-status-strip span {
  margin-bottom: 6px;
  color: var(--rust);
  font-size: 12px;
  font-weight: 800;
}

.module-status-strip strong {
  line-height: 1.35;
}

.module-log-entry {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
  gap: 14px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.module-log-entry time {
  color: var(--rust);
  font-weight: 800;
}

.module-log-entry h3 {
  margin-bottom: 6px;
}

.module-log-entry p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.module-rule-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.module-rule-grid article,
.module-rule-grid .coverage-card {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.module-rule-grid h3,
.module-rule-grid strong {
  margin-bottom: 6px;
}

.module-rule-grid p,
.module-rule-grid span {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.5;
}

.module-rule-grid strong,
.module-rule-grid span {
  display: block;
}

.source-note {
  margin: 22px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 14px;
}

.source-note a {
  color: var(--rust);
  text-decoration: none;
  font-weight: 700;
}

.source-ref-list {
  display: grid;
  gap: 8px;
  margin: 14px 0 0;
  padding-left: 22px;
}

.source-ref-list li {
  color: var(--muted);
  line-height: 1.5;
}

.source-ref-list code {
  overflow-wrap: anywhere;
  color: var(--text);
}

.record-evidence-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.record-evidence-strip span {
  padding: 3px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255,255,255,.025);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.record-compact-details {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.record-compact-details summary {
  width: fit-content;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.record-compact-details summary span {
  font-weight: 600;
}

.record-machine-details {
  margin-top: 10px;
}

.compact-machine-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.compact-machine-grid article {
  padding: 9px 10px;
  border-radius: 6px;
}

.compact-machine-grid h3 {
  margin-bottom: 3px;
  font-size: 12px;
}

.compact-machine-grid p {
  font-size: 12px;
  line-height: 1.4;
}

.record-detail {
  max-width: 980px;
  margin-right: auto;
  margin-left: auto;
}

.record-section {
  margin-top: 22px;
}

.record-backfill-note {
  margin-top: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(194,164,109,.36);
  border-radius: 8px;
  background: rgba(194,164,109,.1);
  color: #dfcfa7;
  font-size: 14px;
  line-height: 1.5;
}

.record-h2 {
  margin: 0 0 12px;
  font-size: 20px;
  letter-spacing: 0;
}

.record-narrative {
  display: grid;
  gap: 12px;
}

.record-paragraph-block {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.record-paragraph-block h3 {
  margin-bottom: 8px;
  font-size: 17px;
}

.record-paragraph-block p {
  margin-bottom: 0;
  color: var(--muted);
  line-height: 1.6;
}

.record-figures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 10px;
}

.record-figure {
  margin: 0;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.record-figure-link {
  display: block;
  border-radius: 6px;
  overflow: hidden;
}

.record-figure-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 6px;
  border: 1px solid rgba(255,255,255,.06);
}

.record-figure-caption {
  margin-top: 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

@media (max-width: 1060px) {
  .project-hero {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .project-hero {
    min-height: auto;
    padding: 28px;
    background-position: center;
  }

  .discipline-grid,
  .archive-date-group,
  .module-log-entry,
  .module-rule-grid,
  .module-status-strip {
    grid-template-columns: 1fr;
  }

  .record-figures {
    grid-template-columns: 1fr;
  }

  .date-rail {
    position: static;
  }
}

@media (max-width: 520px) {
  .group-header {
    grid-template-columns: 1fr;
  }

  .group-header > span {
    width: 44px;
  }

  .discipline-card p {
    grid-column: 1 / -1;
  }
}

/* Design / Art separation */
.dual-feature {
  max-width: 1220px;
  margin: 18px auto;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.feature-panel {
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
}

.feature-panel p {
  color: var(--muted);
  line-height: 1.58;
}

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

.subtopic-grid a {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-soft);
  color: inherit;
  text-decoration: none;
  font-size: 14px;
}

.subtopic-grid a:hover {
  border-color: rgba(139,184,179,.28);
  color: var(--rust);
}

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

.coverage-table div,
.coverage-card {
  padding: 13px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface-soft);
}

.coverage-table strong,
.coverage-table span,
.coverage-table em {
  display: block;
}

.coverage-table span {
  margin-top: 5px;
  color: var(--muted);
  line-height: 1.45;
}

.coverage-card {
  color: inherit;
  text-decoration: none;
}

.coverage-card em {
  display: none;
}

.coverage-card.active em {
  background: rgba(139,184,179,.13);
  color: var(--teal);
}

.coverage-card.watch em {
  background: rgba(215,169,71,.18);
  color: var(--amber);
}

.coverage-card.gap em {
  background: rgba(191,128,109,.13);
  color: var(--rust);
}

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

@media (max-width: 1060px) {
  .dual-feature,
  .reader-map-grid,
  .production-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .dual-feature,
  .subtopic-grid,
  .coverage-table,
  .reader-map-grid,
  .production-grid {
    grid-template-columns: 1fr;
  }

  .reader-map-card.is-primary,
  .discipline-card,
  .discipline-card.is-featured,
  .discipline-card.is-wide {
    grid-column: auto;
  }
}


/* Public sanitized mirror */
.brand,
.brand:visited {
  color: var(--ink);
  text-decoration: none;
}
.topbar-actions,
.detail-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
}
.detail-toolbar {
  justify-content: space-between;
  margin-bottom: 14px;
}
.detail-toolbar .back-link {
  margin: 0;
}
.site-return {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 0 15px;
  border: 1px solid rgba(191,128,109,.48);
  border-radius: 8px;
  background: rgba(30,37,42,.92);
  color: #f0c1b2;
  text-decoration: none;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
  white-space: nowrap;
}
.site-return:hover {
  border-color: var(--rust);
  background: rgba(191,128,109,.16);
  color: #fff4ee;
}
.sidebar-home {
  margin-top: 12px;
  border: 1px solid rgba(191,128,109,.28);
  color: #efb6a4;
}
.sidebar-home:hover {
  border-color: var(--rust);
  background: rgba(191,128,109,.13);
}
.public-mirror-note {
  display: flex;
  gap: 14px;
  align-items: baseline;
  margin: 0 0 18px;
  padding: 14px 18px;
  border: 1px solid rgba(126, 171, 181, 0.22);
  border-radius: 10px;
  background: rgba(26, 42, 47, 0.76);
  color: #aebbc0;
  font-size: 0.82rem;
  line-height: 1.65;
}
.public-mirror-note strong {
  flex: 0 0 auto;
  color: #d59884;
  font-size: 0.68rem;
  letter-spacing: 0.12em;
}
.public-home-note { margin: 18px 0 22px; }
.public-visual-section { margin-top: 22px; }
.public-visual-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}
.public-visual-grid figure { margin: 0; }
.public-visual-grid img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border: 1px solid rgba(126, 171, 181, 0.18);
  border-radius: 10px;
}
.public-visual-grid figcaption {
  padding-top: 10px;
  color: #7f9298;
  font-size: 0.7rem;
  letter-spacing: 0.12em;
}
.public-dossiers { margin-top: 22px; }
.public-archive-search { margin: 26px 0; }
.empty-state { color: #84969c; }

/* Monochrome public theme */
:root {
  --bg: #080808;
  --panel: #101010;
  --panel-2: #171717;
  --surface: rgba(14, 14, 14, .96);
  --surface-soft: rgba(22, 22, 22, .94);
  --surface-strong: rgba(7, 7, 7, .98);
  --ink: #f1f1ef;
  --muted: #9b9b98;
  --line: #2b2b2b;
  --rust: #d8d8d4;
  --amber: #b8b8b4;
  --teal: #aaa;
  --graphite: #050505;
}
body {
  background: #080808;
}
.sidebar {
  background: #090909;
  border-right-color: #202020;
}
.brand {
  border-bottom-color: #242424;
}
nav a {
  color: #bdbdb9;
}
nav a:hover,
nav a.active {
  background: #181818;
  color: #fff;
}
.searchbox,
.language-switch button,
.tabs button,
.primary-action,
.panel,
.feature-panel,
.reader-map-card,
.reader-map-card.is-primary,
.module-row,
.coverage-card,
.subtopic-grid a {
  border-color: #2b2b2b;
  background: #111;
  box-shadow: none;
}
.language-switch button.active,
.tabs button.active,
.primary-action,
.small-action {
  border-color: #e2e2de;
  background: #e2e2de;
  color: #090909;
}
.reader-map-card:hover,
.module-row:hover,
.subtopic-grid a:hover {
  border-color: #565656;
  background: #171717;
}
.project-hero::before {
  background: linear-gradient(90deg, rgba(0, 0, 0, .92) 0%, rgba(0, 0, 0, .68) 58%, rgba(0, 0, 0, .5) 100%);
}
.project-hero .hero-stat {
  border-color: #303030;
  background: rgba(8, 8, 8, .82);
}
.eyebrow,
.project-hero .eyebrow {
  color: #bdbdb8;
}
.site-return {
  border-color: #454545;
  background: #0c0c0c;
  color: #e7e7e3;
}
.site-return:hover {
  border-color: #e2e2de;
  background: #e2e2de;
  color: #090909;
}
.sidebar-home {
  border-color: #303030;
  color: #d4d4d0;
}
.sidebar-home:hover {
  border-color: #666;
  background: #171717;
}
.public-mirror-note {
  border-color: #2b2b2b;
  background: #0e0e0e;
  color: #999;
}
.public-mirror-note strong {
  color: #d6d6d2;
}
.public-visual-grid img {
  border-color: #292929;
  filter: saturate(.72) contrast(1.04);
}
.public-visual-grid figcaption,
.empty-state {
  color: #858582;
}
@media (min-width: 1181px) {
  body {
    grid-template-columns: 248px minmax(0, 1fr);
  }
  .sidebar {
    padding: 22px 16px;
  }
  main {
    padding: 22px 28px 48px;
  }
  .topbar,
  .project-hero,
  .archive-panel,
  #map,
  .dual-feature,
  .layout,
  .public-visual-section {
    max-width: 1320px;
  }
  .project-hero {
    min-height: 300px;
    grid-template-columns: minmax(0, 1fr) 290px;
    padding: 36px 40px;
  }
  .reader-map-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .reader-map-card,
  .reader-map-card.is-primary {
    grid-column: auto;
    min-height: 138px;
  }
  .reader-map-card.is-primary strong {
    font-size: 17px;
  }
}
@media (max-width: 1180px) and (min-width: 721px) {
  .reader-map-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .reader-map-card,
  .reader-map-card.is-primary {
    grid-column: auto;
  }
}
@media (max-width: 760px) {
  .topbar-actions {
    justify-content: space-between;
  }
  .topbar .site-return {
    flex: 1;
  }
  .detail-toolbar {
    align-items: stretch;
    flex-direction: column;
  }
  .detail-toolbar .site-return,
  .detail-toolbar .back-link {
    width: 100%;
  }
  .public-mirror-note { align-items: flex-start; flex-direction: column; }
  .public-visual-grid { grid-template-columns: 1fr; }
}
