/* PROXIMA // World Codex */
.cx {
  --cx-line: #353c38;
  --cx-panel: hsl(calc(var(--th-bh) + 3.6) calc(13.2% * var(--th-bs)) 10.4%);
  --cx-accent: hsl(calc(var(--th-h) + 0.7) calc(80% * var(--th-s)) calc(66% + var(--th-l)));
  --cx-muted: #a3aca7;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
.cx-muted {
  color: var(--cx-muted);
  font-size: 12px;
}
.cx-side {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 7px;
  max-height: calc(100vh - 116px);
  grid-template-rows: auto auto auto auto minmax(0, 1fr);
}
.cx-tools {
  display: flex;
  gap: 6px;
}
.cx-tools input {
  flex: 1;
  min-width: 0;
}
.cx-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.cx-cats button {
  background: none;
  border: 1px solid var(--cx-line);
  color: var(--cx-muted);
  font: 700 9.5px var(--head);
  letter-spacing: 0.06em;
  padding: 4px 7px;
  cursor: pointer;
}
.cx-cats button.on {
  border-color: var(--cx-accent);
  color: var(--cx-accent);
  background: color-mix(in srgb, var(--cx-accent) 10%, transparent);
}
.cx-cats small {
  opacity: 0.65;
}
.cx-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
}
.cx-filters select {
  font-size: 11.5px;
}
.cx-filters select:last-child {
  grid-column: 1 / -1;
}
.cx-count {
  font: 700 9px var(--head);
  letter-spacing: 0.12em;
  color: var(--cx-muted);
}
.cx-list {
  overflow: auto;
  border: 1px solid var(--cx-line);
  background: var(--cx-panel);
}
.cx-item {
  display: flex;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  border-bottom: 1px solid #ffffff0c;
  color: #dfe6e2;
  padding: 6px 8px;
  cursor: pointer;
}
.cx-item:hover {
  background: #ffffff07;
}
.cx-item.on {
  border-left-color: var(--cx-accent);
  background: color-mix(in srgb, var(--cx-accent) 9%, transparent);
}
.cx-item.src-article b,
.cx-item.src-gm b {
  color: var(--cx-accent);
}
.cx-item > span:nth-child(2) {
  flex: 1;
  min-width: 0;
}
.cx-item b {
  display: block;
  font: 700 12px var(--head);
}
.cx-item small {
  display: block;
  font-size: 10px;
  color: var(--cx-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cx-ico {
  width: 18px;
  text-align: center;
  color: var(--cx-accent);
}
.cx-item img {
  width: 18px;
  height: 18px;
  object-fit: contain;
  opacity: 0.85;
}

/* article */
.cx-main {
  min-width: 0;
}
.cx-article {
  border: 1px solid var(--cx-line);
  border-top: 3px solid hsl(calc(var(--th-h) + 0) calc(70% * var(--th-s)) calc(58% + var(--th-l)));
  background: radial-gradient(
      circle at 90% 0,
      hsl(calc(var(--th-h) + 0) calc(50% * var(--th-s)) calc(22% + var(--th-l)) / 0.35),
      transparent 50%
    ),
    var(--cx-panel);
  padding: 18px 22px 20px;
  animation: cr-rise 0.25s ease-out;
}
.cx-hero {
  display: block;
  width: 100%;
  max-height: 340px;
  object-fit: cover;
  border: 1px solid var(--cx-line);
  margin-bottom: 12px;
}
.cx-crumb {
  font: 700 10px var(--head);
  letter-spacing: 0.12em;
  color: var(--cx-muted);
}
.cx-article h2 {
  margin: 4px 0 0;
  font: 700 28px var(--head);
  color: hsl(calc(var(--th-h) + 0) calc(75% * var(--th-s)) calc(70% + var(--th-l)));
}
.cx-tagline {
  margin: 2px 0 0;
  color: #c8d0cb;
  font-style: italic;
}
.cx-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 10px 0;
}
.cx-owner {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  border: 1px solid hsl(calc(var(--th-h) + 0) calc(60% * var(--th-s)) calc(45% + var(--th-l)));
  padding: 3px 9px 3px 4px;
  font: 700 11px var(--head);
}
.cx-owner img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}
.cx-summary {
  font-size: 14px;
  line-height: 1.6;
  max-width: 80ch;
}
.cx-facts {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 4px 16px;
  margin: 12px 0;
  padding: 10px 12px;
  border: 1px solid var(--cx-line);
  background: #00000026;
  font-size: 12.5px;
}
.cx-facts dt {
  font: 700 10px var(--head);
  letter-spacing: 0.08em;
  color: var(--cx-muted);
  text-transform: uppercase;
  padding-top: 2px;
}
.cx-facts dd {
  margin: 0;
}
.cx-sec {
  margin-top: 14px;
  max-width: 82ch;
}
.cx-sec h4 {
  margin: 0 0 6px;
  font: 700 13px var(--head);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: hsl(calc(var(--th-h) + 0) calc(70% * var(--th-s)) calc(66% + var(--th-l)));
  border-bottom: 1px solid var(--cx-line);
  padding-bottom: 4px;
}
.cx-sec p {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.6;
}
.cx-sec ul {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 4px;
  font-size: 13px;
  line-height: 1.5;
}
.cx-links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.cx-links button {
  background: none;
  border: 1px solid var(--cx-line);
  color: var(--cx-accent);
  font-size: 11.5px;
  padding: 3px 9px;
  cursor: pointer;
}
.cx-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  font-size: 11px;
  color: var(--cx-muted);
}
.cx-empty {
  border: 1px dashed var(--cx-line);
  padding: 30px;
  text-align: center;
  color: var(--cx-muted);
}

/* GM form */
.cx-form {
  border: 1px solid var(--cx-line);
  background: var(--cx-panel);
  padding: 14px 16px;
}
.cx-sub {
  font: 700 12px var(--head);
  letter-spacing: 0.12em;
  color: var(--cx-accent);
  margin-bottom: 10px;
}
.cx-sub small,
.cx-grid small {
  font-weight: 400;
  letter-spacing: 0;
  color: var(--cx-muted);
}
.cx-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 10px;
}
.cx-grid label {
  display: grid;
  gap: 3px;
  font: 700 9px var(--head);
  letter-spacing: 0.08em;
  color: var(--cx-muted);
}
.cx-grid .wide {
  grid-column: 1 / -1;
}
.gx-cxnote {
  border-left: 3px solid #71bad6;
  background: #71bad614;
  padding: 6px 9px;
  font-size: 12px;
}
.gx-cxnote p {
  margin: 3px 0 6px;
  color: #a9b2a8;
  font-size: 11px;
}
@media (max-width: 1000px) {
  .cx {
    grid-template-columns: 1fr;
  }
  .cx-side {
    position: static;
    max-height: none;
  }
  .cx-list {
    max-height: 320px;
  }
  .cx-grid {
    grid-template-columns: 1fr;
  }
}

/* ---------- redesigned layout: index · list · article ---------- */
.cx {
  grid-template-columns: 190px 290px minmax(0, 1fr);
  gap: 12px;
}
.cx-index {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 1px;
  align-content: start;
  max-height: calc(100vh - 116px);
  overflow: auto;
  padding-right: 2px;
}
.cx-index-group {
  margin: 12px 0 4px;
  padding: 0 8px;
  font: 700 9px var(--head);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cx-muted);
}
.cx-cat {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  border-left: 2px solid transparent;
  color: #dfe6e2;
  font: 600 12.5px var(--head);
  padding: 7px 8px;
  cursor: pointer;
  transition: background 0.12s ease;
}
.cx-cat span {
  color: var(--cx-accent);
  text-align: center;
  font-size: 14px;
}
.cx-cat small {
  font: 700 10px var(--head);
  color: var(--cx-muted);
  background: #ffffff0d;
  padding: 1px 6px;
  border-radius: 8px;
}
.cx-cat:hover {
  background: #ffffff08;
}
.cx-cat.on {
  border-left-color: var(--cx-accent);
  background: color-mix(in srgb, var(--cx-accent) 11%, transparent);
  color: #fff;
}
.cx-cat.empty {
  opacity: 0.45;
}
.cx-new {
  margin-top: 12px;
}
.cx-side {
  grid-template-rows: auto auto auto minmax(0, 1fr);
}
.cx-filters {
  grid-template-columns: 1fr 1fr;
}
.cx-count button {
  background: none;
  border: none;
  color: var(--cx-accent);
  font: inherit;
  cursor: pointer;
  padding: 0;
}
.cx-listhead {
  position: sticky;
  top: 0;
  z-index: 1;
  padding: 6px 9px;
  font: 700 9.5px var(--head);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--cx-accent);
  background: hsl(calc(var(--th-bh) + 3.6) calc(13.2% * var(--th-bs)) 13%);
  border-bottom: 1px solid var(--cx-line);
}
.cx-listhead small {
  color: var(--cx-muted);
  margin-left: 4px;
}
/* home page */
.cx-home {
  display: grid;
  gap: 16px;
}
.cx-home-head h2 {
  margin: 0;
  font: 700 26px var(--head);
  color: var(--cx-accent);
}
.cx-home-head p {
  margin: 4px 0 0;
  color: var(--cx-muted);
}
.cx-home-group h3 {
  margin: 0 0 8px;
  font: 700 11px var(--head);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--cx-muted);
  border-bottom: 1px solid var(--cx-line);
  padding-bottom: 4px;
}
.cx-home-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 8px;
}
.cx-card {
  display: grid;
  grid-template-columns: auto 1fr auto;
  grid-template-areas: 'ico name num' 'feat feat feat';
  gap: 4px 10px;
  align-items: center;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--cx-line);
  background: radial-gradient(
      circle at 100% 0,
      color-mix(in srgb, var(--cx-accent) 14%, transparent),
      transparent 60%
    ),
    var(--cx-panel);
  color: #dfe6e2;
  cursor: pointer;
  transition:
    transform 0.15s ease,
    border-color 0.15s ease;
}
.cx-card:hover {
  transform: translateY(-2px);
  border-color: var(--cx-accent);
}
.cx-card.empty {
  opacity: 0.5;
}
.cx-card-ico {
  grid-area: ico;
  font-size: 22px;
  color: var(--cx-accent);
}
.cx-card b {
  grid-area: name;
  font: 700 14px var(--head);
}
.cx-card strong {
  grid-area: num;
  font: 700 20px var(--head);
  color: var(--cx-accent);
}
.cx-card small {
  grid-area: feat;
  color: var(--cx-muted);
  font-size: 11px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
/* long spec lists in two columns */
.cx-sec ul {
  columns: 2 280px;
  column-gap: 24px;
  display: block;
}
.cx-sec li {
  break-inside: avoid;
  margin-bottom: 4px;
}
@media (max-width: 1250px) {
  .cx {
    grid-template-columns: 170px 250px minmax(0, 1fr);
  }
}
@media (max-width: 1000px) {
  .cx {
    grid-template-columns: 1fr;
  }
  .cx-index {
    position: static;
    max-height: none;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
  }
  .cx-index-group {
    display: none;
  }
  .cx-cat {
    width: auto;
    border: 1px solid var(--cx-line);
  }
}
