.census-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 34px 28px 60px;
}

.census-hero,
.census-search,
.profile-results,
.census-panel,
.census-status,
.raw-panel {
  background: rgba(10, 16, 30, 0.84);
  border: 1px solid rgba(34, 197, 94, 0.18);
  border-radius: 8px;
  padding: 22px;
}

.census-hero,
.census-search,
.profile-results,
.census-status {
  margin-bottom: 18px;
}

.census-kicker,
.profile-kicker {
  color: #93c5fd;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 8px;
  text-transform: uppercase;
}

.census-hero h1,
.section-head h2,
.profile-head h2 {
  color: #22c55e;
  margin-bottom: 8px;
}

.census-hero p,
.section-head p,
.profile-head p,
.census-status,
.empty-census {
  color: #94a3b8;
  line-height: 1.55;
}

.census-search {
  align-items: end;
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto;
}

.census-search label {
  display: grid;
  gap: 8px;
}

.census-search span {
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 900;
}

.census-search input,
.census-search select {
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  color: #e5e7eb;
  min-height: 44px;
  padding: 11px 13px;
}

.census-search button,
.secondary-link {
  align-items: center;
  background: linear-gradient(135deg, #22c55e, #10b981);
  border: 0;
  border-radius: 8px;
  color: #03120a;
  cursor: pointer;
  display: inline-flex;
  font-weight: 900;
  justify-content: center;
  min-height: 44px;
  padding: 11px 16px;
  text-decoration: none;
}

.secondary-link {
  background: rgba(96, 165, 250, 0.12);
  border: 1px solid rgba(96, 165, 250, 0.28);
  color: #bfdbfe;
}

.census-status[data-type="ok"] {
  border-color: rgba(34, 197, 94, 0.28);
}

.census-status[data-type="warn"] {
  border-color: rgba(245, 158, 11, 0.34);
  color: #fcd34d;
}

.census-status[data-type="error"] {
  border-color: rgba(248, 113, 113, 0.34);
  color: #fecaca;
}

.section-head,
.profile-head {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  margin-bottom: 16px;
}

.equipment-list,
.stats-grid,
.facts-grid {
  display: grid;
  gap: 12px;
}

.facts-grid article,
.stats-grid article,
.equipment-list article,
.guild-card {
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 8px;
  padding: 14px;
}

.equipment-list span,
.guild-card p {
  color: #94a3b8;
}

.facts-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  margin-bottom: 16px;
}

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

.facts-grid span,
.stats-grid span,
.guild-card span {
  color: #93c5fd;
  display: block;
  font-size: 12px;
  font-weight: 900;
  margin-bottom: 6px;
  text-transform: uppercase;
}

.facts-grid strong,
.stats-grid strong,
.guild-card strong {
  color: #f8fafc;
  font-size: clamp(18px, 2.4vw, 28px);
}

.profile-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.75fr);
  margin-bottom: 16px;
}

.equipment-list {
  grid-template-columns: 1fr;
}

.equipment-group {
  display: grid;
  gap: 10px;
}

.equipment-group h3 {
  color: #93c5fd;
  font-size: 15px;
  margin-top: 4px;
  text-transform: uppercase;
}

.equipment-group h3 span {
  color: #94a3b8;
  font-size: 12px;
}

.equipment-group article {
  min-width: 0;
}

.equipment-list strong {
  color: #e5e7eb;
  display: block;
  margin-bottom: 6px;
}

.guild-roster {
  display: grid;
  gap: 8px;
  list-style: none;
  margin-top: 12px;
  padding: 0;
}

.guild-roster li {
  background: rgba(96, 165, 250, 0.08);
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 8px;
  color: #dbeafe;
  display: flex;
  justify-content: space-between;
  padding: 9px 10px;
}

.guild-roster span {
  color: #93c5fd;
  font-size: 12px;
}

.raw-panel {
  margin-top: 16px;
}

.raw-panel summary {
  color: #93c5fd;
  cursor: pointer;
  font-weight: 900;
}

.raw-panel pre {
  background: rgba(2, 6, 23, 0.72);
  border-radius: 8px;
  color: #cbd5e1;
  margin-top: 12px;
  max-height: 360px;
  overflow: auto;
  padding: 14px;
  white-space: pre-wrap;
}

body.light-mode .census-hero,
body.light-mode .census-search,
body.light-mode .profile-results,
body.light-mode .census-panel,
body.light-mode .census-status,
body.light-mode .raw-panel,
body.light-mode .facts-grid article,
body.light-mode .stats-grid article,
body.light-mode .equipment-list article,
body.light-mode .guild-card {
  background: rgba(255, 255, 255, 0.92);
  border-color: rgba(15, 23, 42, 0.1);
}

body.light-mode .census-search input,
body.light-mode .census-search select {
  background: #ffffff;
  color: #111827;
}

body.light-mode .facts-grid strong,
body.light-mode .stats-grid strong,
body.light-mode .equipment-list strong,
body.light-mode .guild-card strong {
  color: #111827;
}

@media (max-width: 760px) {
  .census-shell {
    padding: 10px 10px 82px;
  }

  .census-search,
  .facts-grid,
  .stats-grid,
  .profile-grid,
  .equipment-list {
    grid-template-columns: 1fr;
  }

  .section-head,
  .profile-head,
  .profile-head {
    align-items: stretch;
    flex-direction: column;
  }
}
