:root {
  color-scheme: dark;
  --bg: #080a0d;
  --surface: #101419;
  --surface-raised: #151b21;
  --surface-soft: #0d1116;
  --line: #29323a;
  --line-strong: #46525d;
  --text: #edf1f3;
  --muted: #97a3ad;
  --dim: #68747e;
  --moon: #e8e2d3;
  --cyan: #59c3c3;
  --red: #d45c5c;
  --amber: #d2a64f;
  --green: #75ad7d;
  --blue: #6b9fd1;
  --active-category: #e8e2d3;
  --active-category-soft: #1b1c1e;
  --drawer-width: min(760px, 68vw);
  font-family: "Microsoft YaHei UI", "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  background: var(--bg);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--bg);
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 2px;
}

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

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px 18px 20px;
  border-right: 1px solid var(--line);
  background: #0b0e12;
  z-index: 10;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 13px;
  min-height: 62px;
  padding: 0 8px 22px;
  border-bottom: 1px solid var(--line);
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  border: 1px solid var(--moon);
  color: var(--moon);
  font-family: Georgia, serif;
  font-size: 32px;
  line-height: 1;
}

.brand-mark img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.brand-kicker,
.section-kicker,
.record-label {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0;
  text-transform: uppercase;
}

.brand-block h1 {
  margin: 4px 0 0;
  font-family: Georgia, "Microsoft YaHei", serif;
  font-size: 23px;
  font-weight: 700;
  letter-spacing: 0;
}

.category-nav {
  display: grid;
  gap: 6px;
  margin-top: 24px;
}

.category-button {
  --category-color: var(--cyan);
  --category-soft: var(--surface-raised);
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
  transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, box-shadow 160ms ease;
}

.category-button > span:first-child::before {
  display: inline-block;
  width: 6px;
  height: 6px;
  margin-right: 9px;
  background: var(--category-color);
  box-shadow: 0 0 8px color-mix(in srgb, var(--category-color) 52%, transparent);
  content: "";
  vertical-align: 1px;
}

.category-button:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--category-color) 48%, var(--line));
  background: color-mix(in srgb, var(--category-soft) 55%, var(--surface));
}

.category-button.is-active {
  border-color: color-mix(in srgb, var(--category-color) 72%, var(--line));
  color: var(--text);
  background: color-mix(in srgb, var(--category-soft) 76%, var(--surface-raised));
  box-shadow: inset 3px 0 0 var(--category-color);
}

.category-count {
  min-width: 24px;
  color: color-mix(in srgb, var(--category-color) 62%, var(--dim));
  font-family: Consolas, monospace;
  font-size: 12px;
  text-align: right;
}

.category-button.is-active .category-count {
  color: var(--category-color);
}

.sidebar-note {
  position: absolute;
  right: 18px;
  bottom: 20px;
  left: 18px;
  display: grid;
  grid-template-columns: 8px 1fr;
  gap: 9px;
  align-items: start;
  padding: 14px 12px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.sidebar-note p {
  margin: 0;
  color: var(--dim);
  font-size: 12px;
  line-height: 1.7;
}

.status-light {
  width: 7px;
  height: 7px;
  margin-top: 5px;
  background: var(--green);
  box-shadow: 0 0 10px rgba(117, 173, 125, 0.55);
}

.main-content {
  min-width: 0;
  padding: 0 36px 64px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  min-height: 112px;
  border-bottom: 1px solid var(--line);
}

.topbar h2 {
  margin: 7px 0 0;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: 0;
}

.search-box {
  display: grid;
  grid-template-columns: 18px minmax(160px, 360px) 24px;
  align-items: center;
  gap: 10px;
  width: min(440px, 48vw);
  height: 44px;
  padding: 0 11px;
  border: 1px solid var(--line-strong);
  border-radius: 4px;
  background: var(--surface-soft);
}

.search-icon {
  position: relative;
  width: 13px;
  height: 13px;
  border: 1.5px solid var(--muted);
  border-radius: 50%;
}

.search-icon::after {
  position: absolute;
  right: -5px;
  bottom: -3px;
  width: 6px;
  height: 1.5px;
  background: var(--muted);
  content: "";
  transform: rotate(45deg);
  transform-origin: left center;
}

.search-box input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
}

.search-box input::placeholder {
  color: var(--dim);
}

.search-box kbd {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--dim);
  background: #090c10;
  font-family: Consolas, monospace;
  font-size: 11px;
}

.featured-record {
  position: relative;
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr) auto;
  gap: 28px;
  align-items: center;
  min-height: 236px;
  margin: 28px 0 42px;
  padding: 28px 30px;
  overflow: hidden;
  border-top: 1px solid var(--red);
  border-bottom: 1px solid var(--line-strong);
  background: #141416;
}

.featured-record::after {
  position: absolute;
  right: 23%;
  bottom: 0;
  width: 1px;
  height: 100%;
  background: var(--line);
  content: "";
  transform: rotate(16deg);
}

.featured-code {
  display: grid;
  align-content: center;
  min-height: 156px;
  padding: 16px;
  border: 1px solid #714141;
  background: #0d0d0f;
  text-align: center;
}

.featured-code span {
  color: var(--red);
  font-family: Consolas, monospace;
  font-size: 15px;
  font-weight: 700;
}

.featured-code strong {
  margin: -2px 0 2px;
  color: var(--moon);
  font-family: Georgia, serif;
  font-size: 64px;
  line-height: 1;
}

.featured-code small {
  color: var(--dim);
  font-family: Consolas, monospace;
  font-size: 9px;
}

.featured-copy {
  position: relative;
  z-index: 1;
  max-width: 700px;
}

.featured-copy h3 {
  margin: 8px 0 12px;
  font-size: 29px;
  letter-spacing: 0;
}

.featured-copy > p:not(.record-label) {
  margin: 0;
  color: #bac2c8;
  font-size: 15px;
  line-height: 1.8;
}

.record-label {
  color: var(--red);
}

.featured-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 20px;
  color: var(--muted);
  font-size: 12px;
}

.featured-meta span::before {
  color: var(--red);
  content: "▸ ";
}

.featured-action {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 18px;
  min-width: 164px;
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--moon);
  border-radius: 3px;
  color: #111317;
  background: var(--moon);
  cursor: pointer;
  font-weight: 700;
  transition: background-color 160ms ease, color 160ms ease;
}

.featured-action:hover {
  color: var(--moon);
  background: transparent;
}

.archive-section {
  min-width: 0;
}

.archive-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
  padding: 14px 16px 13px;
  border-left: 3px solid var(--active-category);
  border-bottom: 1px solid color-mix(in srgb, var(--active-category) 38%, var(--line));
  background: color-mix(in srgb, var(--active-category-soft) 72%, transparent);
}

.archive-heading .section-kicker {
  color: var(--active-category);
}

.archive-heading h3 {
  margin: 6px 0 0;
  font-size: 21px;
}

.result-count {
  margin: 0;
  color: var(--dim);
  font-family: Consolas, monospace;
  font-size: 12px;
}

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

.archive-card {
  position: relative;
  display: grid;
  grid-template-rows: 132px minmax(168px, auto);
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: inherit;
  background: var(--surface);
  cursor: pointer;
  isolation: isolate;
  text-align: left;
  transition: border-color 160ms ease, transform 160ms ease, background-color 160ms ease;
}

.archive-card:hover {
  border-color: var(--card-accent, var(--line-strong));
  background: var(--surface-raised);
  transform: translateY(-2px);
}

.card-visual {
  position: relative;
  display: grid;
  place-items: center;
  height: 132px;
  min-height: 0;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #0a0d11;
}

.card-visual::after {
  position: absolute;
  right: 12px;
  bottom: 10px;
  color: rgba(255, 255, 255, 0.14);
  font-family: Consolas, monospace;
  font-size: 10px;
  content: attr(data-code);
}

.card-visual::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  z-index: 3;
  height: 3px;
  background: var(--category-accent, var(--card-accent));
  content: "";
}

.card-visual img {
  display: block;
  width: auto;
  height: auto;
  max-width: 84px;
  max-height: 84px;
  padding: 0;
  object-fit: contain;
  filter: saturate(0.82) contrast(1.05);
  transition: transform 180ms ease, filter 180ms ease;
}

.card-visual img.is-scp-cover {
  position: absolute;
  top: 10px;
  right: 18px;
  bottom: 10px;
  left: 18px;
  width: calc(100% - 36px);
  height: calc(100% - 20px);
  max-width: none;
  max-height: none;
  padding: 0;
  object-fit: contain;
  object-position: center;
  filter: saturate(0.9) contrast(1.08) drop-shadow(0 8px 14px rgba(0, 0, 0, 0.5));
}

.archive-card:hover .card-visual img.is-scp-cover {
  filter: saturate(1) contrast(1.12) drop-shadow(0 9px 16px rgba(0, 0, 0, 0.55));
}

.archive-card:hover .card-visual img {
  filter: saturate(1) contrast(1.08);
  transform: scale(1.035);
}

.record-glyph {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border: 1px solid var(--card-accent, var(--line-strong));
  color: var(--card-accent, var(--moon));
  font-family: Georgia, serif;
  font-size: 24px;
  font-weight: 700;
}

.card-body {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 16px 15px;
  background: var(--surface);
}

.archive-card:hover .card-body {
  background: var(--surface-raised);
}

.card-category {
  margin: 0;
  color: var(--category-accent, var(--card-accent, var(--cyan)));
  font-size: 11px;
  font-weight: 700;
}

.card-body h4 {
  margin: 7px 0 8px;
  font-size: 17px;
  line-height: 1.35;
  letter-spacing: 0;
}

.card-summary {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.card-footer {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 14px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  min-width: 0;
}

.card-tags span,
.drawer-tag,
.growth-stat {
  padding: 3px 6px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--dim);
  background: #0d1115;
  font-size: 10px;
}

.card-arrow {
  flex: 0 0 auto;
  color: var(--card-accent, var(--cyan));
  font-size: 18px;
}

.empty-state {
  padding: 60px 20px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.empty-state strong {
  font-size: 18px;
}

.empty-state p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.68);
  z-index: 50;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: var(--drawer-width);
  border-left: 1px solid var(--line-strong);
  background: #0d1014;
  box-shadow: -24px 0 60px rgba(0, 0, 0, 0.4);
  opacity: 0;
  overflow-y: auto;
  pointer-events: none;
  transform: translateX(32px);
  transition: opacity 180ms ease, transform 180ms ease;
  z-index: 60;
}

.detail-drawer.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateX(0);
}

.drawer-toolbar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 58px;
  padding: 0 22px;
  border-bottom: 1px solid var(--line);
  background: rgba(13, 16, 20, 0.96);
  z-index: 3;
}

.drawer-toolbar p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.icon-button:hover {
  border-color: var(--line-strong);
  background: var(--surface-raised);
}

.drawer-content {
  min-width: 0;
  max-width: 100%;
  padding: 28px 30px 56px;
  overflow-x: hidden;
}

.drawer-header {
  position: relative;
  padding: 0 0 26px;
  border-bottom: 1px solid var(--line);
}

.drawer-index {
  margin: 0 0 8px;
  color: var(--detail-accent, var(--cyan));
  font-family: Consolas, monospace;
  font-size: 12px;
  font-weight: 700;
}

.drawer-header h2 {
  margin: 0;
  font-size: 34px;
  line-height: 1.22;
  letter-spacing: 0;
}

.drawer-subtitle {
  margin: 10px 0 0;
  color: var(--moon);
  font-size: 15px;
}

.drawer-summary {
  max-width: 680px;
  margin: 16px 0 0;
  color: #b2bbc2;
  font-size: 14px;
  line-height: 1.85;
  overflow-wrap: anywhere;
}

.drawer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 18px;
}

.drawer-tag {
  color: var(--muted);
  font-size: 11px;
}

.detail-section {
  padding: 24px 0;
  border-bottom: 1px solid var(--line);
}

.detail-section h3,
.growth-intro h3 {
  margin: 0 0 12px;
  font-size: 17px;
}

.detail-section p,
.detail-section li,
.growth-intro p {
  color: #aeb7bf;
  font-size: 13px;
  line-height: 1.8;
}

.detail-section p {
  margin: 0;
}

.detail-section ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.detail-section li {
  position: relative;
  padding-left: 18px;
}

.detail-section li::before {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--detail-accent, var(--cyan));
  content: "▸";
}

.growth-view {
  min-width: 0;
  max-width: 100%;
  padding-top: 24px;
}

.growth-intro {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--line);
}

.growth-thresholds {
  display: grid;
  grid-template-columns: repeat(var(--threshold-count, 6), minmax(72px, 1fr));
  gap: 6px;
  margin-top: 18px;
}

.threshold-cell {
  min-height: 62px;
  padding: 9px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}

.threshold-cell strong,
.threshold-cell span {
  display: block;
}

.threshold-cell strong {
  color: var(--moon);
  font-family: Consolas, monospace;
  font-size: 13px;
}

.threshold-cell span {
  margin-top: 5px;
  color: var(--dim);
  font-size: 10px;
}

.common-route {
  display: grid;
  grid-template-columns: repeat(var(--common-count, 3), minmax(0, 1fr));
  gap: 8px;
  margin: 22px 0;
}

.level-node {
  position: relative;
  min-height: 126px;
  padding: 13px;
  border: 1px solid var(--line);
  background: var(--surface);
}

.level-node:not(:last-child)::after {
  position: absolute;
  top: 50%;
  right: -9px;
  width: 9px;
  height: 1px;
  background: var(--line-strong);
  content: "";
}

.level-node small {
  color: var(--detail-accent, var(--cyan));
  font-family: Consolas, monospace;
}

.level-node strong {
  display: block;
  margin: 7px 0;
  color: var(--moon);
  font-size: 14px;
}

.level-node p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.6;
}

.branch-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 22px 0 10px;
  color: var(--muted);
  font-size: 12px;
}

.branch-label::before,
.branch-label::after {
  height: 1px;
  background: var(--line);
  content: "";
}

.branch-label::before {
  width: 18px;
}

.branch-label::after {
  flex: 1;
}

.branch-tabs {
  display: grid;
  grid-template-columns: repeat(var(--branch-count, 4), minmax(0, 1fr));
  gap: 7px;
}

.branch-tab {
  min-height: 48px;
  padding: 7px 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: var(--surface-soft);
  cursor: pointer;
  font-size: 12px;
}

.branch-tab:hover {
  border-color: var(--line-strong);
  color: var(--text);
}

.branch-tab.is-active {
  border-color: var(--detail-accent, var(--cyan));
  color: var(--text);
  background: var(--surface-raised);
}

.branch-detail {
  margin-top: 12px;
  padding: 18px;
  border-left: 2px solid var(--detail-accent, var(--cyan));
  background: var(--surface-soft);
}

.branch-detail-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.branch-detail h4 {
  margin: 0;
  font-size: 19px;
}

.branch-detail-header p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.branch-role {
  flex: 0 0 auto;
  padding: 4px 7px;
  border: 1px solid var(--line-strong);
  color: var(--detail-accent, var(--cyan));
  font-family: Consolas, monospace;
  font-size: 10px;
}

.branch-levels {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
}

.branch-level {
  min-width: 0;
  padding: 12px;
  border: 1px solid var(--line);
  background: #0a0d11;
}

.branch-level > strong {
  display: block;
  margin-bottom: 8px;
  color: var(--moon);
  font-family: Consolas, monospace;
  font-size: 12px;
}

.growth-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.growth-stat {
  color: #aab4bc;
  white-space: normal;
}

.branch-skill {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.branch-skill strong {
  display: block;
  margin-bottom: 5px;
  color: var(--detail-accent, var(--cyan));
  font-size: 12px;
}

.branch-skill p {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.75;
}

.god-state {
  margin-top: 20px;
  padding: 17px 18px;
  border: 1px solid #8b7444;
  background: #16130d;
}

.god-state small {
  color: var(--amber);
  font-weight: 700;
}

.god-state h4 {
  margin: 6px 0 8px;
  color: var(--moon);
  font-size: 18px;
}

.god-state p {
  margin: 0;
  color: #bbb3a2;
  font-size: 12px;
  line-height: 1.75;
}

.roster-section {
  padding: 28px 0 10px;
  border-top: 1px solid var(--line-strong);
}

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

.roster-heading p {
  margin: 0;
  color: var(--detail-accent, var(--cyan));
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 700;
}

.roster-heading h3 {
  margin: 6px 0 0;
  font-size: 19px;
}

.roster-heading > span {
  color: var(--dim);
  font-family: Consolas, monospace;
  font-size: 11px;
}

.roster-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-width: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.roster-layout.is-single {
  display: block;
}

.weapon-catalog {
  min-width: 0;
  max-width: 100%;
  padding-top: 28px;
}

.weapon-catalog-toolbar {
  display: grid;
  min-width: 0;
  max-width: 100%;
  gap: 12px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.weapon-search {
  display: grid;
  gap: 6px;
}

.weapon-search span {
  color: var(--dim);
  font-size: 10px;
  font-weight: 700;
}

.weapon-search input {
  width: 100%;
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--text);
  background: #090c10;
}

.weapon-search input::placeholder {
  color: #59646d;
}

.weapon-filters {
  display: flex;
  flex-wrap: wrap;
  min-width: 0;
  max-width: 100%;
  gap: 6px;
}

.weapon-filter {
  min-height: 30px;
  padding: 0 9px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  font-size: 10px;
}

.weapon-filter span {
  margin-left: 4px;
  color: var(--dim);
  font-family: Consolas, monospace;
}

.weapon-filter:hover,
.weapon-filter.is-active {
  border-color: var(--detail-accent, var(--cyan));
  color: var(--text);
  background: color-mix(in srgb, var(--detail-accent, var(--cyan)) 10%, #090c10);
}

.weapon-catalog-layout {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  min-width: 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.weapon-catalog-list {
  max-height: 760px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #090c10;
  scrollbar-width: thin;
}

.weapon-catalog-button {
  display: block;
  width: 100%;
  min-height: 56px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.weapon-catalog-button:hover,
.weapon-catalog-button.is-active {
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: inset 3px 0 0 var(--detail-accent, var(--cyan));
}

.weapon-catalog-button span,
.weapon-catalog-button small {
  display: block;
  overflow-wrap: anywhere;
}

.weapon-catalog-button span {
  font-size: 11px;
  font-weight: 700;
}

.weapon-catalog-button small {
  margin-top: 5px;
  color: var(--dim);
  font-size: 9px;
}

.weapon-catalog-detail {
  min-width: 0;
  min-height: 420px;
  padding: 20px;
  background: var(--surface-soft);
}

.weapon-catalog-empty {
  margin: 0;
  padding: 24px 12px;
  color: var(--dim);
  font-size: 10px;
  text-align: center;
}

.weapon-parameter-list {
  margin-top: 0;
}

.member-list {
  max-height: 720px;
  overflow-y: auto;
  border-right: 1px solid var(--line);
  background: #090c10;
  scrollbar-width: thin;
}

.member-button {
  display: block;
  width: 100%;
  min-height: 58px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.member-button:hover {
  color: var(--text);
  background: var(--surface);
}

.member-button.is-active {
  color: var(--text);
  background: var(--surface-raised);
  box-shadow: inset 3px 0 0 var(--detail-accent, var(--cyan));
}

.member-button span,
.member-button small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.member-button span {
  font-size: 12px;
  font-weight: 700;
}

.member-button small {
  margin-top: 5px;
  color: var(--dim);
  font-size: 9px;
}

.member-detail {
  min-width: 0;
  padding: 20px;
  background: var(--surface-soft);
}

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

.member-header p {
  margin: 0;
  color: var(--detail-accent, var(--cyan));
  font-family: Consolas, monospace;
  font-size: 10px;
}

.member-header h4 {
  margin: 6px 0 0;
  font-size: 21px;
  line-height: 1.35;
}

.member-header > span {
  flex: 0 0 auto;
  padding: 4px 6px;
  border: 1px solid var(--line-strong);
  color: var(--dim);
  font-family: Consolas, monospace;
  font-size: 9px;
}

.member-description {
  margin: 16px 0 0;
  color: #b3bcc3;
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
}

.member-block {
  padding-top: 18px;
}

.attribute-progression {
  margin-top: 18px;
}

.attribute-source-note {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
}

.attribute-tier-list {
  display: grid;
  gap: 8px;
}

.attribute-tier {
  padding: 14px 16px;
  border: 1px solid color-mix(in srgb, var(--detail-accent, var(--green)) 40%, var(--line));
  background: color-mix(in srgb, var(--detail-accent, var(--green)) 6%, var(--surface-soft));
}

.attribute-tier-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 16px;
}

.attribute-tier-heading small {
  color: var(--dim);
  font-family: Consolas, monospace;
  font-size: 10px;
}

.attribute-tier-heading h3 {
  margin: 4px 0 0;
  color: var(--text);
  font-size: 16px;
}

.attribute-tier-heading > span {
  color: var(--detail-accent, var(--green));
  font-family: Consolas, monospace;
  font-size: 10px;
  white-space: nowrap;
}

.attribute-tier-values {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 11px;
}

.attribute-tier-values strong {
  padding: 5px 8px;
  border: 1px solid var(--line);
  color: var(--text);
  background: var(--surface);
  font-size: 12px;
  font-weight: 600;
}

.member-block h5 {
  margin: 0 0 10px;
  color: var(--moon);
  font-size: 12px;
}

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

.member-stats > div {
  min-width: 0;
  padding: 9px;
  border: 1px solid var(--line);
  background: #090c10;
}

.member-stats span,
.member-stats strong {
  display: block;
  overflow-wrap: anywhere;
}

.member-stats span {
  color: var(--dim);
  font-size: 9px;
}

.member-stats strong {
  margin-top: 5px;
  color: var(--text);
  font-family: Consolas, monospace;
  font-size: 12px;
}

.member-traits,
.equipment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.attribute-list {
  display: grid;
  gap: 6px;
  margin-bottom: 7px;
}

.attribute-entry {
  padding: 9px 10px;
  border-left: 2px solid var(--detail-accent, var(--cyan));
  background: #090c10;
}

.attribute-entry strong {
  display: block;
  color: var(--text);
  font-size: 11px;
}

.attribute-entry > div,
.parameter-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 7px;
}

.attribute-entry span,
.parameter-list span {
  max-width: 100%;
  padding: 3px 5px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #aeb8c0;
  background: var(--surface-soft);
  font-family: Consolas, monospace;
  font-size: 9px;
  overflow-wrap: anywhere;
}

.member-traits span,
.equipment-list span {
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid var(--line);
  border-radius: 3px;
  color: #aeb8c0;
  background: #090c10;
  font-size: 10px;
  overflow-wrap: anywhere;
}

.member-traits span {
  border-color: color-mix(in srgb, var(--detail-accent, var(--cyan)) 45%, var(--line));
}

.weapon-list,
.skill-list {
  display: grid;
  gap: 7px;
}

.weapon-entry,
.skill-entry {
  padding: 11px 12px;
  border-left: 2px solid var(--detail-accent, var(--cyan));
  background: #090c10;
}

.weapon-entry > div,
.skill-entry > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.weapon-entry strong,
.skill-entry strong {
  color: var(--text);
  font-size: 12px;
}

.weapon-entry small,
.skill-entry span,
.skill-entry small {
  color: var(--dim);
  font-family: Consolas, monospace;
  font-size: 9px;
}

.weapon-entry p,
.skill-entry p {
  margin: 7px 0 0;
  color: var(--muted);
  font-size: 10px;
  line-height: 1.7;
}

.weapon-effect-block {
  padding-top: 20px;
}

.weapon-effect-list {
  display: grid;
  gap: 8px;
}

.weapon-effect-list > div {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 14px;
  border: 1px solid color-mix(in srgb, var(--active-category, var(--detail-accent, var(--red))) 45%, var(--line));
  background: color-mix(in srgb, var(--active-category-soft, var(--surface-soft)) 72%, #090c10);
}

.weapon-effect-list > div > span {
  color: var(--active-category, var(--detail-accent, var(--red)));
  font-family: Consolas, monospace;
  font-size: 10px;
  line-height: 1.75;
}

.weapon-effect-list p {
  margin: 0;
  color: #c5cdd2;
  font-size: 12px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.weapon-effect-list.is-compact {
  margin-top: 10px;
}

.weapon-effect-list.is-compact > div {
  padding: 9px 10px;
}

.weapon-effect-list.is-compact p {
  font-size: 11px;
}

.equipment-source-block {
  padding-top: 20px;
}

.equipment-source-list {
  display: grid;
  gap: 8px;
}

.equipment-source-list > div {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  border: 1px solid var(--line);
  background: #090c10;
}

.equipment-source-list strong {
  display: flex;
  align-items: center;
  padding: 11px 12px;
  border-right: 1px solid var(--line);
  color: var(--active-category, var(--detail-accent, var(--red)));
  font-size: 11px;
}

.equipment-source-list p {
  margin: 0;
  padding: 11px 13px;
  color: #c5cdd2;
  font-size: 11px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.weapon-source-inline {
  display: grid !important;
  grid-template-columns: 42px minmax(0, 1fr);
  align-items: start !important;
  gap: 8px !important;
  margin-top: 9px;
  padding: 8px 9px;
  border-left: 2px solid var(--detail-accent, var(--active-category, var(--red)));
  background: var(--surface-soft);
}

.weapon-source-inline strong {
  color: var(--detail-accent, var(--active-category, var(--red)));
  font-size: 10px;
}

.weapon-source-inline span {
  color: var(--muted);
  font-size: 10px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.equipment-workflow-block {
  padding-top: 20px;
}

.equipment-workflow-list {
  display: grid;
  gap: 0;
  border-top: 1px solid var(--line);
}

.equipment-workflow-list article {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  min-width: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  border-left: 1px solid var(--line);
  background: #090c10;
}

.equipment-workflow-list article > span {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--active-category, var(--detail-accent, var(--red)));
  font-family: Consolas, monospace;
  font-size: 10px;
}

.equipment-workflow-list article > div {
  min-width: 0;
  padding: 12px 14px;
}

.equipment-workflow-list strong {
  color: var(--moon);
  font-size: 12px;
}

.equipment-workflow-list p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
  overflow-wrap: anywhere;
}

.skill-entry > small {
  display: block;
  margin-top: 6px;
}

.member-empty {
  margin: 0;
  color: var(--dim);
  font-size: 10px;
  line-height: 1.7;
}

body:not([data-active-category="all"]):not([data-active-category="scp-growth"]) .featured-record {
  display: none;
}

body:not([data-active-category="all"]):not([data-active-category="scp-growth"]) .archive-section {
  margin-top: 28px;
}

.archive-grid[data-category="special-role"],
.archive-grid[data-category="system"],
.archive-grid[data-category="event"] {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.archive-grid[data-category="weapon"],
.archive-grid[data-category="special-item"],
.archive-grid[data-category="attribute"] {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.archive-grid[data-category="weapon"] .archive-card,
.archive-grid[data-category="special-item"] .archive-card,
.archive-grid[data-category="attribute"] .archive-card {
  grid-template-rows: 104px minmax(156px, auto);
}

.archive-grid[data-category="weapon"] .card-visual,
.archive-grid[data-category="special-item"] .card-visual,
.archive-grid[data-category="attribute"] .card-visual {
  height: 104px;
}

.archive-grid[data-category="enchantment"] {
  grid-template-columns: minmax(0, 760px);
}

.archive-grid.is-directory-view {
  display: block;
}

.faction-directory {
  display: grid;
  grid-template-columns: 286px minmax(0, 1fr);
  min-width: 0;
  min-height: 760px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #090c10;
}

.faction-directory-nav {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #0b0f13;
}

.faction-directory-nav > header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 18px 16px;
  border-bottom: 1px solid var(--line);
  background: #0b0f13;
}

.faction-directory-nav > header p,
.faction-roster-heading p,
.faction-profile-copy > p {
  margin: 0;
  color: var(--active-category);
  font-family: Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.faction-directory-nav > header h4 {
  margin: 6px 0 0;
  font-size: 17px;
}

.faction-directory-nav > header span {
  display: block;
  margin-top: 8px;
  color: var(--dim);
  font-size: 10px;
}

.faction-directory-list {
  max-height: 820px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.faction-directory-button {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 24px;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 66px;
  padding: 9px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.faction-directory-button:hover {
  color: var(--text);
  background: var(--surface);
}

.faction-directory-button.is-active {
  color: var(--text);
  background: color-mix(in srgb, var(--active-category-soft) 72%, var(--surface-raised));
  box-shadow: inset 3px 0 0 var(--active-category);
}

.faction-directory-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: #080b0e;
}

.faction-directory-icon img {
  display: block;
  width: 36px;
  height: 36px;
  object-fit: contain;
}

.faction-directory-label,
.faction-directory-label strong,
.faction-directory-label small {
  display: block;
  min-width: 0;
}

.faction-directory-label strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faction-directory-label small {
  margin-top: 5px;
  overflow: hidden;
  color: var(--dim);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.faction-directory-count {
  color: var(--active-category);
  font-family: Consolas, monospace;
  font-size: 10px;
  text-align: right;
}

.faction-profile {
  --faction-accent: var(--blue);
  min-width: 0;
  padding: 24px;
  background: #0d1116;
}

.faction-profile-header {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  min-height: 190px;
  border-top: 3px solid var(--faction-accent);
  border-bottom: 1px solid var(--line);
  background: var(--surface-soft);
}

.faction-profile-visual {
  display: grid;
  place-items: center;
  min-width: 0;
  padding: 18px;
  border-right: 1px solid var(--line);
  background: #080b0e;
}

.faction-profile-visual img {
  display: block;
  width: 100%;
  height: 150px;
  object-fit: contain;
}

.faction-profile-visual > span {
  color: var(--faction-accent);
  font-family: Georgia, serif;
  font-size: 46px;
}

.faction-profile-copy {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 22px 26px;
}

.faction-profile-copy > p,
.faction-roster-heading p {
  color: var(--faction-accent);
}

.faction-profile-copy h2 {
  margin: 7px 0 0;
  font-size: 30px;
}

.faction-profile-copy > strong {
  margin-top: 7px;
  color: var(--moon);
  font-size: 13px;
}

.faction-profile-copy > span {
  margin-top: 14px;
  color: #b5bec5;
  font-size: 13px;
  line-height: 1.8;
}

.faction-profile-copy > div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 15px;
}

.faction-profile-copy small {
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--faction-accent) 48%, var(--line));
  color: var(--faction-accent);
  font-size: 10px;
}

.faction-briefing {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.faction-briefing > section {
  min-width: 0;
  padding: 18px 20px;
}

.faction-briefing > section + section {
  border-left: 1px solid var(--line);
}

.faction-briefing h4 {
  margin: 0 0 9px;
  color: var(--faction-accent);
  font-size: 12px;
}

.faction-briefing p,
.faction-briefing ul {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.faction-briefing ul {
  padding-left: 17px;
}

.faction-playbook {
  margin-top: 22px;
  border: 1px solid color-mix(in srgb, var(--faction-accent) 48%, var(--line));
  background: #090d12;
}

.faction-playbook > header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 20px;
  border-bottom: 1px solid color-mix(in srgb, var(--faction-accent) 38%, var(--line));
  background: color-mix(in srgb, var(--faction-accent) 7%, #0a0e13);
}

.faction-playbook > header p {
  margin: 0;
  color: var(--faction-accent);
  font-family: Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.faction-playbook > header h3 {
  margin: 6px 0 0;
  font-size: 19px;
}

.faction-playbook > header > span {
  color: var(--dim);
  font-family: Consolas, monospace;
  font-size: 10px;
  white-space: nowrap;
}

.faction-playbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(290px, 100%), 1fr));
}

.faction-playbook-track {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 20px;
  border-bottom: 1px solid var(--line);
}

.faction-playbook-track + .faction-playbook-track {
  border-left: 1px solid var(--line);
}

.faction-playbook-track > header span {
  color: var(--faction-accent);
  font-family: Consolas, monospace;
  font-size: 9px;
}

.faction-playbook-track > header h4 {
  margin: 7px 0 0;
  color: var(--text);
  font-size: 15px;
}

.faction-playbook-track > header p {
  margin: 10px 0 0;
  color: #b7c0c7;
  font-size: 11px;
  line-height: 1.8;
}

.faction-playbook-track ol {
  display: grid;
  gap: 9px;
  margin: 17px 0 0;
  padding: 0;
  counter-reset: faction-step;
  list-style: none;
}

.faction-playbook-track li {
  position: relative;
  min-height: 28px;
  padding-left: 35px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.75;
  counter-increment: faction-step;
}

.faction-playbook-track li::before {
  position: absolute;
  top: 0;
  left: 0;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border: 1px solid color-mix(in srgb, var(--faction-accent) 55%, var(--line));
  color: var(--faction-accent);
  font-family: Consolas, monospace;
  font-size: 9px;
  content: counter(faction-step, decimal-leading-zero);
}

.faction-playbook-track footer {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: auto;
  padding-top: 18px;
}

.faction-playbook-track footer > div {
  min-width: 0;
  padding: 12px;
  border-top: 1px solid var(--line);
  background: #0d1218;
}

.faction-playbook-track footer > div + div {
  border-left: 1px solid var(--line);
}

.faction-playbook-track footer small,
.faction-playbook-track footer strong {
  display: block;
}

.faction-playbook-track footer small {
  color: var(--faction-accent);
  font-size: 9px;
}

.faction-playbook-track footer strong {
  margin-top: 6px;
  color: #aeb7be;
  font-size: 10px;
  font-weight: 500;
  line-height: 1.7;
}

.faction-roster-page {
  padding-top: 24px;
}

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

.faction-roster-heading h3 {
  margin: 6px 0 0;
  font-size: 20px;
}

.faction-roster-heading > span {
  color: var(--dim);
  font-family: Consolas, monospace;
  font-size: 10px;
}

.faction-member-tabs {
  display: flex;
  gap: 6px;
  padding-bottom: 8px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.faction-member-tab {
  flex: 0 0 auto;
  min-width: 150px;
  min-height: 54px;
  padding: 9px 11px;
  border: 1px solid var(--line);
  color: var(--muted);
  background: #090c10;
  cursor: pointer;
  text-align: left;
}

.faction-member-tab:hover,
.faction-member-tab.is-active {
  color: var(--text);
  border-color: color-mix(in srgb, var(--faction-accent) 65%, var(--line));
}

.faction-member-tab.is-active {
  box-shadow: inset 0 3px 0 var(--faction-accent);
}

.faction-member-tab strong,
.faction-member-tab small {
  display: block;
}

.faction-member-tab strong {
  font-size: 11px;
}

.faction-member-tab small {
  margin-top: 5px;
  color: var(--dim);
  font-size: 9px;
}

.faction-page-member-detail {
  padding: 22px;
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}

.anomaly-directory {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  min-height: 720px;
  border: 1px solid color-mix(in srgb, var(--amber) 45%, var(--line));
  background: #0c0d0f;
}

.anomaly-index {
  border-right: 1px solid var(--line);
  background: #11100d;
}

.anomaly-index-button {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  width: 100%;
  min-height: 74px;
  padding: 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.anomaly-index-button > span {
  grid-row: 1 / 3;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--amber);
  color: var(--amber);
  font-family: Georgia, serif;
  font-size: 13px;
}

.anomaly-index-button strong,
.anomaly-index-button small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.anomaly-index-button strong {
  font-size: 12px;
}

.anomaly-index-button small {
  margin-top: 5px;
  color: var(--dim);
  font-size: 9px;
}

.anomaly-index-button:hover,
.anomaly-index-button.is-active {
  color: var(--text);
  background: #19160f;
}

.anomaly-index-button.is-active {
  box-shadow: inset 3px 0 0 var(--amber);
}

.anomaly-profile {
  --anomaly-accent: var(--amber);
  min-width: 0;
  padding: 28px;
}

.anomaly-profile-header {
  display: grid;
  grid-template-columns: 170px minmax(0, 1fr);
  min-height: 190px;
  border-top: 3px solid var(--anomaly-accent);
  border-bottom: 1px solid var(--line);
  background: #111216;
}

.anomaly-number {
  display: grid;
  place-items: center;
  border-right: 1px solid var(--line);
  color: var(--anomaly-accent);
  font-family: Georgia, serif;
  font-size: 50px;
}

.anomaly-profile-header > div:last-child {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  padding: 24px;
}

.anomaly-profile-header p,
.system-console-screen header p,
.event-brief header p,
.equipment-profile-header p,
.attribute-matrix-detail > header p,
.enchantment-lab header p {
  margin: 0;
  color: currentColor;
  font-family: Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.anomaly-profile-header h2,
.system-console-screen h2,
.event-brief h2,
.equipment-profile-header h2,
.attribute-matrix-detail > header h2,
.enchantment-lab header h2 {
  margin: 7px 0 0;
  font-size: 28px;
}

.anomaly-profile-header strong,
.system-console-screen header strong,
.event-brief header strong,
.equipment-profile-header strong,
.attribute-matrix-detail > header strong,
.enchantment-lab header strong {
  margin-top: 7px;
  color: var(--moon);
  font-size: 12px;
}

.anomaly-profile-header span,
.system-console-screen header > span,
.attribute-matrix-detail > header > span {
  margin-top: 13px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.anomaly-rulebook {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--line);
}

.anomaly-rulebook > section {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 10px;
  padding: 18px;
  min-width: 0;
}

.anomaly-rulebook > section + section {
  border-left: 1px solid var(--line);
}

.anomaly-rulebook > section > span {
  color: var(--anomaly-accent);
  font-family: Consolas, monospace;
  font-size: 11px;
}

.anomaly-rulebook h4,
.system-procedure h3,
.event-response-grid h3,
.enchantment-tier h3 {
  margin: 0 0 8px;
  font-size: 13px;
}

.anomaly-rulebook p,
.anomaly-rulebook ul,
.system-procedure p,
.system-procedure ul,
.event-response-grid p,
.event-response-grid ul,
.enchantment-tier p,
.enchantment-tier ul {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.8;
}

.anomaly-rulebook ul,
.system-procedure ul,
.event-response-grid ul,
.enchantment-tier ul {
  padding-left: 17px;
}

.anomaly-member-sheet {
  padding-top: 22px;
}

.anomaly-member-sheet .member-detail {
  border-top: 1px solid var(--anomaly-accent);
}

.system-console {
  border: 1px solid color-mix(in srgb, var(--cyan) 55%, var(--line));
  background: #071011;
}

.system-module-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border-bottom: 1px solid var(--cyan);
}

.system-module-button {
  min-height: 82px;
  padding: 14px 16px;
  border: 0;
  color: var(--muted);
  background: #0b1517;
  cursor: pointer;
  text-align: left;
}

.system-module-button + .system-module-button {
  border-left: 1px solid var(--line);
}

.system-module-button span,
.system-module-button strong,
.system-module-button small {
  display: block;
}

.system-module-button span {
  color: var(--cyan);
  font-family: Consolas, monospace;
  font-size: 9px;
}

.system-module-button strong {
  margin-top: 6px;
  font-size: 14px;
}

.system-module-button small {
  margin-top: 5px;
  color: var(--dim);
  font-size: 10px;
}

.system-module-button.is-active {
  color: var(--text);
  background: #102326;
  box-shadow: inset 0 3px 0 var(--cyan);
}

.system-console-screen {
  padding: 28px;
}

.system-console-screen header {
  display: flex;
  flex-direction: column;
  max-width: 820px;
  min-width: 0;
  color: var(--cyan);
}

.system-status-line {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
  padding: 10px 12px;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.system-status-line span {
  margin-right: auto;
  color: var(--cyan);
  font-family: Consolas, monospace;
  font-size: 10px;
}

.system-status-line small {
  color: var(--muted);
  font-size: 10px;
}

.system-procedures {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.system-procedure {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  gap: 12px;
  padding: 18px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: #091315;
  min-width: 0;
}

.system-procedure > div {
  min-width: 0;
}

.system-procedure > span {
  color: var(--cyan);
  font-family: Consolas, monospace;
  font-size: 12px;
}

.event-board {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  min-height: 660px;
  border: 1px solid color-mix(in srgb, var(--event-accent, #d18a62) 48%, var(--line));
  background: #110d0b;
}

.event-alert-list {
  border-right: 1px solid var(--line);
  background: #130e0c;
}

.event-alert-button {
  display: block;
  width: 100%;
  min-height: 82px;
  padding: 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.event-alert-button span,
.event-alert-button strong,
.event-alert-button small {
  display: block;
}

.event-alert-button span {
  color: var(--event-accent);
  font-family: Consolas, monospace;
  font-size: 9px;
}

.event-alert-button strong {
  margin-top: 7px;
  font-size: 13px;
}

.event-alert-button small {
  margin-top: 5px;
  color: var(--dim);
  font-size: 10px;
}

.event-alert-button:hover,
.event-alert-button.is-active {
  color: var(--text);
  background: #21140f;
}

.event-alert-button.is-active {
  box-shadow: inset 4px 0 0 var(--event-accent);
}

.event-brief {
  --event-accent: #d18a62;
  min-width: 0;
  padding: 30px;
}

.event-brief > header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--event-accent);
  color: var(--event-accent);
}

.event-brief > header > div {
  display: flex;
  flex-direction: column;
}

.event-brief > header > span {
  padding: 6px 8px;
  border: 1px solid var(--event-accent);
  color: var(--event-accent);
  font-family: Consolas, monospace;
  font-size: 10px;
  white-space: nowrap;
}

.event-summary {
  margin: 20px 0 0;
  color: #c7b7af;
  font-size: 13px;
  line-height: 1.8;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.event-tags,
.equipment-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 15px;
}

.event-tags span,
.equipment-tags span {
  padding: 5px 8px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 10px;
}

.event-response-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.event-response-grid > section {
  min-width: 0;
  padding: 20px;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.event-response-grid h3 {
  color: var(--event-accent);
}

.equipment-directory {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  min-height: 760px;
  border: 1px solid var(--line);
  background: #0b0d11;
}

.equipment-directory > aside {
  min-width: 0;
  border-right: 1px solid var(--line);
  background: #090b0f;
}

.equipment-directory > aside > header {
  position: sticky;
  top: 0;
  z-index: 2;
  padding: 18px;
  border-bottom: 1px solid var(--line);
  background: #090b0f;
}

.equipment-directory > aside > header p {
  margin: 0;
  color: var(--active-category);
  font-family: Consolas, monospace;
  font-size: 10px;
}

.equipment-directory > aside > header h3 {
  margin: 6px 0 0;
  font-size: 18px;
}

.equipment-directory > aside > header span {
  display: block;
  margin-top: 7px;
  color: var(--dim);
  font-size: 10px;
}

.equipment-index-list {
  max-height: 900px;
  overflow-y: auto;
  scrollbar-width: thin;
}

.equipment-index-button {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr);
  gap: 10px;
  width: 100%;
  min-height: 64px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  text-align: left;
}

.equipment-index-button > span {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--active-category);
  color: var(--active-category);
  font-family: Georgia, serif;
  font-size: 17px;
}

.equipment-index-button strong,
.equipment-index-button small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-index-button strong {
  font-size: 12px;
}

.equipment-index-button small {
  margin-top: 6px;
  color: var(--dim);
  font-size: 9px;
}

.equipment-index-button:hover,
.equipment-index-button.is-active {
  color: var(--text);
  background: var(--active-category-soft);
}

.equipment-index-button.is-active {
  box-shadow: inset 3px 0 0 var(--active-category);
}

.equipment-directory.is-vault {
  grid-template-columns: 430px minmax(0, 1fr);
  border-color: color-mix(in srgb, #c58b5a 52%, var(--line));
}

.equipment-directory.is-vault .equipment-index-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.equipment-directory.is-vault .equipment-index-button {
  display: block;
  min-width: 0;
  min-height: 112px;
  border-right: 1px solid var(--line);
}

.equipment-directory.is-vault .equipment-index-button > span {
  margin-bottom: 8px;
}

.equipment-profile {
  min-width: 0;
  padding: 28px;
}

.equipment-profile-header {
  display: grid;
  grid-template-columns: 104px minmax(0, 1fr);
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 2px solid var(--active-category);
}

.equipment-profile-header > span {
  display: grid;
  place-items: center;
  width: 104px;
  height: 104px;
  border: 1px solid var(--active-category);
  color: var(--active-category);
  font-family: Georgia, serif;
  font-size: 34px;
}

.equipment-profile-header > div {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
  color: var(--active-category);
}

.equipment-profile-header small {
  margin-top: 12px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.equipment-variant-switcher {
  display: grid;
  grid-template-columns: repeat(var(--variant-count), minmax(0, 1fr));
  margin-top: 18px;
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}

.equipment-variant-button {
  display: grid;
  gap: 5px;
  min-width: 0;
  min-height: 62px;
  padding: 11px 12px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #090c10;
  cursor: pointer;
  text-align: left;
}

.equipment-variant-button strong {
  color: inherit;
  font-size: 12px;
}

.equipment-variant-button small {
  overflow: hidden;
  color: var(--dim);
  font-size: 9px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.equipment-variant-button:hover,
.equipment-variant-button.is-active {
  color: var(--active-category);
  background: var(--active-category-soft);
}

.equipment-variant-button.is-active {
  box-shadow: inset 0 -2px var(--active-category);
}

.equipment-parameters {
  margin-top: 10px;
}

.attribute-matrix {
  border: 1px solid color-mix(in srgb, var(--green) 55%, var(--line));
  background: #0c100b;
}

.attribute-matrix > nav {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  border-bottom: 1px solid var(--green);
}

.attribute-matrix-button {
  min-width: 0;
  min-height: 94px;
  padding: 12px 8px;
  border: 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  background: #0d130c;
  cursor: pointer;
  text-align: center;
}

.attribute-matrix-button span,
.attribute-matrix-button strong,
.attribute-matrix-button small {
  display: block;
}

.attribute-matrix-button span {
  color: var(--green);
  font-family: Georgia, serif;
  font-size: 24px;
}

.attribute-matrix-button strong {
  margin-top: 7px;
  font-size: 11px;
}

.attribute-matrix-button small {
  margin-top: 5px;
  overflow: hidden;
  color: var(--dim);
  font-size: 8px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.attribute-matrix-button:hover,
.attribute-matrix-button.is-active {
  color: var(--text);
  background: #182215;
}

.attribute-matrix-button.is-active {
  box-shadow: inset 0 3px 0 var(--green);
}

.attribute-matrix-detail {
  padding: 28px;
}

.attribute-matrix-detail > header {
  display: flex;
  flex-direction: column;
  max-width: 780px;
  color: var(--green);
}

.enchantment-directory {
  display: grid;
  grid-template-columns: 290px minmax(0, 1fr);
  min-height: 680px;
  border: 1px solid color-mix(in srgb, #a98ac7 58%, var(--line));
  background: #100c15;
}

.enchantment-directory > aside {
  min-width: 0;
  border-right: 1px solid #3a2a47;
  background: #15101b;
}

.enchantment-directory > aside > header {
  padding: 22px 20px;
  border-bottom: 1px solid #3a2a47;
  background: #1b1323;
}

.enchantment-directory > aside > header p,
.enchantment-detail-header p {
  margin: 0;
  color: #b89ad3;
  font-family: Consolas, monospace;
  font-size: 10px;
  font-weight: 700;
}

.enchantment-directory > aside > header h3 {
  margin: 8px 0 0;
  color: #f0e8f7;
  font-size: 20px;
}

.enchantment-directory > aside > header span {
  display: block;
  margin-top: 12px;
  color: #a99ab3;
  font-size: 11px;
  line-height: 1.75;
}

.enchantment-index-list {
  max-height: 620px;
  overflow-y: auto;
}

.enchantment-index-group h4 {
  position: sticky;
  top: 0;
  z-index: 1;
  margin: 0;
  padding: 10px 16px;
  border-bottom: 1px solid #33263d;
  color: #8f7a9f;
  background: #120e17;
  font-family: Consolas, monospace;
  font-size: 9px;
}

.enchantment-index-button {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr);
  align-items: center;
  width: 100%;
  min-height: 58px;
  padding: 9px 14px;
  border: 0;
  border-bottom: 1px solid #2a2031;
  color: #c8bdcf;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.enchantment-index-button > span:first-child {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 1px solid #574064;
  color: #b89ad3;
  font-family: Georgia, serif;
  font-size: 13px;
}

.enchantment-index-button > span:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.enchantment-index-button strong {
  overflow: hidden;
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.enchantment-index-button small {
  margin-top: 4px;
  color: #82738d;
  font-size: 9px;
}

.enchantment-index-button:hover,
.enchantment-index-button.is-active {
  color: #fff;
  background: #24182e;
}

.enchantment-index-button.is-active {
  box-shadow: inset 3px 0 0 #b88ed8;
}

.enchantment-index-button.is-active > span:first-child {
  border-color: #b88ed8;
  color: #f0dcff;
  background: #34203f;
}

.enchantment-detail {
  min-width: 0;
  padding: 30px;
  background:
    linear-gradient(rgba(169, 138, 199, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(169, 138, 199, 0.035) 1px, transparent 1px),
    #100c15;
  background-size: 28px 28px;
}

.enchantment-detail-header {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding-bottom: 24px;
  border-bottom: 2px solid #a98ac7;
}

.enchantment-sigil {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border: 1px solid #6f537f;
  outline: 1px solid #33243c;
  outline-offset: -8px;
  color: #e2c8f3;
  background: #23172c;
  font-family: Georgia, serif;
  font-size: 30px;
}

.enchantment-detail-header > div:last-child {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.enchantment-detail-header h2 {
  margin: 7px 0 0;
  color: #f3edf7;
  font-size: 28px;
}

.enchantment-detail-header strong {
  margin-top: 6px;
  color: #c4a7d7;
  font-size: 12px;
}

.enchantment-detail-header span {
  margin-top: 12px;
  color: #b0a5b7;
  font-size: 12px;
  line-height: 1.8;
}

.enchantment-roll-data {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 22px;
  border-top: 1px solid #3c2c47;
  border-left: 1px solid #3c2c47;
}

.enchantment-roll-data > span {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 14px;
  border-right: 1px solid #3c2c47;
  border-bottom: 1px solid #3c2c47;
  background: rgba(27, 19, 35, 0.86);
}

.enchantment-roll-data small {
  color: #807187;
  font-size: 9px;
}

.enchantment-roll-data strong {
  margin-top: 6px;
  color: #ded2e6;
  font-size: 11px;
  line-height: 1.5;
}

.enchantment-level-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 22px;
}

.enchantment-level-card,
.enchantment-fixed-effect {
  min-width: 0;
  border: 1px solid #44334f;
  border-top: 3px solid #9c73b8;
  background: #18101f;
}

.enchantment-level-heading,
.enchantment-fixed-effect > div:first-child {
  display: flex;
  flex-direction: column;
  padding: 17px 18px 14px;
  border-bottom: 1px solid #382940;
}

.enchantment-level-heading span,
.enchantment-fixed-effect > div:first-child span {
  color: #9879ab;
  font-family: Consolas, monospace;
  font-size: 9px;
}

.enchantment-level-heading strong,
.enchantment-fixed-effect > div:first-child strong {
  margin-top: 7px;
  color: #f0e6f5;
  font-size: 15px;
}

.enchantment-level-values {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 14px 18px 0;
}

.enchantment-level-values span {
  padding: 5px 7px;
  border: 1px solid #513b5e;
  color: #d2bcdf;
  background: #24172c;
  font-size: 10px;
  line-height: 1.4;
}

.enchantment-level-card > p,
.enchantment-fixed-effect > p {
  margin: 0;
  padding: 14px 18px 18px;
  color: #a99fb0;
  font-size: 11px;
  line-height: 1.75;
}

.enchantment-fixed-effect {
  margin-top: 22px;
  border-top-color: #d4aa68;
  background: #1b141d;
}

.enchantment-fixed-effect .enchantment-level-values {
  padding-top: 18px;
}

.enchantment-notes,
.enchantment-rules {
  margin-top: 22px;
  padding: 17px 18px;
  border-left: 3px solid #85649a;
  background: #18111e;
}

.enchantment-notes h3,
.enchantment-rules strong {
  margin: 0;
  color: #dac9e5;
  font-size: 12px;
}

.enchantment-notes ul,
.enchantment-rules p {
  margin: 8px 0 0;
  color: #a99fb0;
  font-size: 11px;
  line-height: 1.8;
}

.enchantment-notes ul {
  padding-left: 18px;
}

body.drawer-open {
  overflow: hidden;
}

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

  .featured-record {
    grid-template-columns: 126px minmax(0, 1fr);
  }

  .featured-action {
    grid-column: 2;
    justify-self: start;
  }
}

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

  .sidebar {
    position: static;
    width: 100%;
    height: auto;
    padding: 16px 18px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .brand-block {
    min-height: auto;
    padding: 0 0 14px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
    flex-basis: 36px;
    font-size: 27px;
  }

  .brand-block h1 {
    font-size: 20px;
  }

  .category-nav {
    display: flex;
    gap: 7px;
    margin-top: 12px;
    padding-bottom: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
  }

  .category-button {
    flex: 0 0 auto;
    width: auto;
    min-height: 36px;
    gap: 12px;
    padding: 0 10px;
  }

  .sidebar-note {
    display: none;
  }

  .main-content {
    padding: 0 20px 50px;
  }

  .topbar {
    min-height: 96px;
  }

  .detail-drawer {
    width: min(720px, 92vw);
  }
}

@media (max-width: 640px) {
  .main-content {
    padding-right: 14px;
    padding-left: 14px;
  }

  .topbar {
    display: grid;
    gap: 14px;
    padding: 18px 0;
  }

  .topbar h2 {
    font-size: 23px;
  }

  .search-box {
    width: 100%;
    grid-template-columns: 18px minmax(0, 1fr) 24px;
  }

  .featured-record {
    grid-template-columns: 94px minmax(0, 1fr);
    gap: 16px;
    min-height: 0;
    margin: 18px 0 32px;
    padding: 18px 14px;
  }

  .featured-record::after {
    display: none;
  }

  .featured-code {
    min-height: 118px;
    padding: 10px;
  }

  .featured-code strong {
    font-size: 44px;
  }

  .featured-copy h3 {
    font-size: 20px;
  }

  .featured-copy > p:not(.record-label) {
    display: -webkit-box;
    overflow: hidden;
    font-size: 12px;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .featured-meta {
    display: none;
  }

  .featured-action {
    grid-column: 1 / -1;
    width: 100%;
    min-height: 40px;
  }

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

  .archive-card {
    grid-template-columns: 104px minmax(0, 1fr);
    grid-template-rows: minmax(174px, auto);
  }

  .card-visual {
    width: 104px;
    height: 100%;
    min-height: 174px;
    border-right: 1px solid var(--line);
    border-bottom: 0;
  }

  .card-visual img {
    max-width: 68px;
    max-height: 68px;
    padding: 0;
  }

  .record-glyph {
    width: 62px;
    height: 62px;
    font-size: 19px;
  }

  .card-body {
    min-height: 174px;
    padding: 13px;
  }

  .card-body h4 {
    font-size: 16px;
  }

  .card-summary {
    -webkit-line-clamp: 3;
  }

  .detail-drawer {
    right: 0;
    left: 0;
    width: auto;
    max-width: none;
    border-left: 0;
    overflow-x: hidden;
    transform: none;
    transition: opacity 120ms ease;
  }

  .detail-drawer.is-open {
    transform: none;
  }

  .drawer-content {
    width: 100%;
    padding: 22px 16px 50px;
  }

  .drawer-header,
  .growth-view,
  .growth-intro,
  .common-route,
  .branch-tabs,
  .branch-detail {
    min-width: 0;
    max-width: 100%;
  }

  .drawer-summary,
  .growth-intro p,
  .level-node p,
  .branch-detail p {
    overflow-wrap: anywhere;
    word-break: break-word;
  }

  .drawer-header h2 {
    font-size: 27px;
  }

  .growth-thresholds {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .common-route,
  .branch-levels {
    grid-template-columns: 1fr;
  }

  .level-node:not(:last-child)::after {
    top: auto;
    right: 50%;
    bottom: -9px;
    width: 1px;
    height: 9px;
  }

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

  .branch-detail-header {
    display: block;
  }

  .branch-role {
    display: inline-block;
    margin-top: 10px;
  }

  .roster-heading {
    display: block;
    align-items: start;
  }

  .roster-heading > span {
    display: inline-block;
    margin-top: 8px;
  }

  .roster-layout {
    display: block;
  }

  .weapon-catalog-layout {
    display: block;
  }

  .weapon-filters {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .weapon-filter {
    width: 100%;
    min-width: 0;
    padding: 0 5px;
  }

  .weapon-catalog-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 280px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .weapon-catalog-button {
    min-width: 0;
    border-right: 1px solid var(--line);
  }

  .weapon-catalog-button.is-active {
    box-shadow: inset 0 3px 0 var(--detail-accent, var(--cyan));
  }

  .weapon-catalog-detail {
    min-height: 0;
    padding: 16px 12px 20px;
  }

  .member-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 232px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .member-button {
    min-width: 0;
    border-right: 1px solid var(--line);
  }

  .member-button.is-active {
    box-shadow: inset 0 3px 0 var(--detail-accent, var(--cyan));
  }

  .member-detail {
    padding: 16px 12px 20px;
  }

  .member-header {
    display: block;
  }

  .member-header > span {
    display: inline-block;
    margin-top: 10px;
  }

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

@media (max-width: 1280px) {
  .archive-grid[data-category="weapon"],
  .archive-grid[data-category="special-item"],
  .archive-grid[data-category="attribute"] {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .faction-directory {
    grid-template-columns: 250px minmax(0, 1fr);
  }
}

@media (max-width: 1000px) {
  .archive-grid[data-category="weapon"],
  .archive-grid[data-category="special-item"],
  .archive-grid[data-category="attribute"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .faction-directory {
    display: block;
    min-height: 0;
  }

  .faction-directory-nav {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .faction-directory-nav > header {
    position: static;
  }

  .faction-directory-list {
    display: flex;
    max-height: none;
    padding-bottom: 5px;
    overflow-x: auto;
  }

  .faction-directory-button {
    flex: 0 0 230px;
    border-right: 1px solid var(--line);
  }

  .faction-directory-button.is-active {
    box-shadow: inset 0 3px 0 var(--active-category);
  }
}

@media (max-width: 640px) {
  .archive-grid[data-category="special-role"],
  .archive-grid[data-category="system"],
  .archive-grid[data-category="event"],
  .archive-grid[data-category="weapon"],
  .archive-grid[data-category="special-item"],
  .archive-grid[data-category="attribute"],
  .archive-grid[data-category="enchantment"] {
    grid-template-columns: 1fr;
  }

  .faction-profile {
    padding: 12px;
  }

  .faction-profile-header {
    grid-template-columns: 112px minmax(0, 1fr);
    min-height: 154px;
  }

  .faction-profile-visual {
    padding: 10px;
  }

  .faction-profile-visual img {
    height: 104px;
  }

  .faction-profile-copy {
    padding: 14px;
  }

  .faction-profile-copy h2 {
    font-size: 21px;
  }

  .faction-profile-copy > span {
    display: -webkit-box;
    overflow: hidden;
    font-size: 11px;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .faction-briefing {
    display: block;
  }

  .faction-briefing > section + section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .faction-playbook > header {
    display: block;
    padding: 15px 14px;
  }

  .faction-playbook > header > span {
    display: inline-block;
    margin-top: 8px;
  }

  .faction-playbook-grid {
    grid-template-columns: 1fr;
  }

  .faction-playbook-track {
    padding: 17px 14px;
  }

  .faction-playbook-track + .faction-playbook-track {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .faction-playbook-track footer {
    grid-template-columns: 1fr;
  }

  .faction-playbook-track footer > div + div {
    border-left: 0;
  }

  .faction-roster-heading {
    display: block;
  }

  .faction-roster-heading > span {
    display: inline-block;
    margin-top: 8px;
  }

  .faction-member-tab {
    min-width: 138px;
  }

  .faction-page-member-detail {
    padding: 16px 12px 20px;
  }
}

@media (max-width: 1000px) {
  .anomaly-directory,
  .event-board,
  .equipment-directory,
  .equipment-directory.is-vault {
    display: block;
  }

  .anomaly-index,
  .event-alert-list,
  .equipment-directory > aside {
    display: flex;
    overflow-x: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .anomaly-index-button,
  .event-alert-button,
  .equipment-index-button {
    flex: 0 0 230px;
    border-right: 1px solid var(--line);
  }

  .anomaly-index-button.is-active,
  .event-alert-button.is-active,
  .equipment-index-button.is-active {
    box-shadow: inset 0 3px 0 var(--active-category);
  }

  .equipment-directory > aside {
    display: block;
  }

  .equipment-directory > aside > header {
    position: static;
  }

  .equipment-index-list,
  .equipment-directory.is-vault .equipment-index-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
  }

  .equipment-directory.is-vault .equipment-index-button {
    flex: 0 0 190px;
    min-height: 104px;
  }

  .attribute-matrix > nav {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .archive-grid.is-directory-view {
    width: calc(100vw - 28px);
    min-width: 0;
    max-width: calc(100vw - 28px);
    overflow-x: hidden;
  }

  .anomaly-directory,
  .system-console,
  .event-board,
  .equipment-directory,
  .attribute-matrix,
  .enchantment-lab {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .anomaly-profile,
  .system-console-screen,
  .event-brief,
  .equipment-profile,
  .attribute-matrix-detail,
  .enchantment-lab {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 18px 14px;
    overflow-x: hidden;
  }

  .anomaly-profile-header {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    grid-template-columns: 96px minmax(0, 1fr);
    min-height: 156px;
  }

  .anomaly-number {
    font-size: 30px;
  }

  .anomaly-profile-header > div:last-child {
    width: 100%;
    max-width: 100%;
    padding: 14px;
    overflow: hidden;
  }

  .anomaly-profile-header h2,
  .system-console-screen h2,
  .event-brief h2,
  .equipment-profile-header h2,
  .attribute-matrix-detail > header h2,
  .enchantment-lab header h2 {
    font-size: 21px;
  }

  .anomaly-profile-header span {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .anomaly-rulebook,
  .system-procedures,
  .event-response-grid,
  .enchantment-lab > div {
    grid-template-columns: 1fr;
  }

  .anomaly-rulebook > section + section {
    border-top: 1px solid var(--line);
    border-left: 0;
  }

  .system-module-list {
    display: flex;
    overflow-x: auto;
  }

  .system-module-button {
    flex: 0 0 220px;
  }

  .event-brief > header,
  .enchantment-lab > header {
    display: block;
  }

  .event-brief > header > div,
  .event-summary,
  .system-console-screen header,
  .equipment-profile-header > div,
  .attribute-matrix-detail > header {
    width: 100%;
    min-width: 0;
    max-width: 100%;
  }

  .anomaly-profile-header span,
  .system-console-screen header > span,
  .event-summary,
  .equipment-profile-header small,
  .attribute-matrix-detail > header > span {
    word-break: break-all;
  }

  .event-brief > header > span,
  .enchantment-lab > header > span {
    display: inline-block;
    margin-top: 12px;
  }

  .equipment-profile-header {
    grid-template-columns: 76px minmax(0, 1fr);
    gap: 12px;
  }

  .equipment-profile-header > span {
    width: 76px;
    height: 76px;
    font-size: 25px;
  }

  .equipment-profile-header small {
    display: block;
    max-width: 100%;
    white-space: normal;
  }

  .equipment-parameters,
  .equipment-parameters .member-block,
  .equipment-parameters .member-stats {
    min-width: 0;
    max-width: 100%;
  }

  .attribute-matrix > nav {
    display: flex;
    overflow-x: auto;
  }

  .attribute-matrix-button {
    flex: 0 0 112px;
  }
}

@media (max-width: 640px) {
  .equipment-variant-switcher {
    display: flex;
    overflow-x: auto;
  }

  .equipment-variant-button {
    flex: 0 0 118px;
  }
}

@media (max-width: 1000px) {
  .enchantment-directory {
    display: block;
  }

  .enchantment-directory > aside {
    border-right: 0;
    border-bottom: 1px solid #3a2a47;
  }

  .enchantment-index-list {
    display: flex;
    max-height: none;
    overflow-x: auto;
  }

  .enchantment-index-group {
    display: flex;
    flex: 0 0 auto;
  }

  .enchantment-index-group h4 {
    position: static;
    display: grid;
    place-items: center;
    width: 52px;
    padding: 8px;
    border-right: 1px solid #33263d;
    writing-mode: vertical-rl;
  }

  .enchantment-index-button {
    width: 178px;
    border-right: 1px solid #2a2031;
  }

  .enchantment-index-button.is-active {
    box-shadow: inset 0 3px 0 #b88ed8;
  }
}

@media (max-width: 640px) {
  .enchantment-directory {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    overflow-x: hidden;
  }

  .enchantment-directory > aside > header {
    padding: 17px 14px;
  }

  .enchantment-detail {
    width: 100%;
    min-width: 0;
    max-width: 100%;
    padding: 18px 14px;
    overflow-x: hidden;
  }

  .enchantment-detail-header {
    grid-template-columns: 68px minmax(0, 1fr);
    gap: 12px;
  }

  .enchantment-sigil {
    width: 68px;
    height: 68px;
    font-size: 23px;
  }

  .enchantment-detail-header h2 {
    font-size: 21px;
  }

  .enchantment-detail-header span {
    overflow-wrap: anywhere;
  }

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

  .enchantment-level-grid {
    grid-template-columns: 1fr;
  }

  .enchantment-level-card,
  .enchantment-fixed-effect,
  .enchantment-roll-data > span {
    min-width: 0;
    max-width: 100%;
  }

  .enchantment-level-values span {
    overflow-wrap: anywhere;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
