:root {
  --bg-main: #0e0f12;
  --bg-card: #16181d;
  --bg-soft: #1f232b;
  --line: #2a2d35;
  --text: #e5e7eb;
  --muted: #9ca3af;
  --gold: #d4af37;
  --gold-soft: rgba(212, 175, 55, 0.2);
  --good: #2ecc71;
  --warn: #f39c12;
  --bad: #e74c3c;
}

* {
  box-sizing: border-box;
  font-family: "Inter", "Poppins", system-ui, sans-serif;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(1200px 520px at 50% -20%, rgba(212, 175, 55, 0.14), transparent 60%),
    var(--bg-main);
}

.dna-page {
  width: min(1180px, 95vw);
  margin: 22px auto 46px;
  display: grid;
  gap: 14px;
}

.dna-header,
.card {
  background: linear-gradient(180deg, rgba(20, 24, 32, 0.92), rgba(15, 18, 24, 0.9));
  border: 1px solid rgba(212, 175, 55, 0.2);
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.35);
}

.back-link {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--gold);
  text-decoration: none;
  font-weight: 700;
}

.back-link:hover {
  text-decoration: underline;
}

.dna-header h1 {
  margin: 0;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
}

.subtitle,
.muted {
  color: var(--muted);
}

.subtitle {
  margin: 6px 0 0;
}

.period-row {
  margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.period-row strong {
  min-width: 160px;
}

.btn {
  border-radius: 10px;
  padding: 10px 12px;
  border: 0;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  filter: brightness(1.04);
}

.btn.primary {
  background: linear-gradient(135deg, var(--gold), #b8962e);
  color: #141414;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--line);
}

.hidden {
  display: none !important;
}

.dna-guest {
  border: 1px solid rgba(212, 175, 55, 0.22);
}

.dna-guest-eyebrow {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.dna-guest h2 {
  margin: 0 0 10px;
}

.dna-guest-lead {
  margin: 0 0 14px;
  color: #ced5df;
  line-height: 1.45;
}

.dna-guest-list {
  margin: 0 0 14px;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #c0c8d5;
}

.dna-guest-cta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notice {
  margin: 0;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(231, 76, 60, 0.3);
  background: rgba(231, 76, 60, 0.1);
  color: #ffc8c3;
}

h2 {
  margin: 0 0 10px;
  font-size: 1.03rem;
}

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

.metric-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 11px;
  background: rgba(255, 255, 255, 0.02);
  display: grid;
  gap: 4px;
}

.metric-title {
  color: #cad1de;
  font-size: 0.84rem;
}

.metric-value {
  font-size: 1.08rem;
  font-weight: 700;
}

.metric-delta {
  font-size: 0.8rem;
}

.metric-delta.good {
  color: var(--good);
}

.metric-delta.bad {
  color: var(--bad);
}

.metric-delta.stable {
  color: var(--warn);
}

.metric-note {
  font-size: 0.78rem;
  color: var(--muted);
  margin-top: 2px;
}

.profile-box {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.profile-box strong {
  font-size: 1.08rem;
}

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

.zone {
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 12px;
  background: rgba(255, 255, 255, 0.02);
}

.zone h3 {
  margin: 0 0 8px;
  font-size: 0.93rem;
}

.zone-control {
  border-color: rgba(46, 204, 113, 0.32);
}

.zone-instability {
  border-color: rgba(243, 156, 18, 0.32);
}

.zone-critical {
  border-color: rgba(231, 76, 60, 0.32);
}

.clean-list {
  margin: 0;
  padding-left: 18px;
  display: grid;
  gap: 6px;
  color: #d6dbe4;
  font-size: 0.88rem;
}

.level-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.level-track {
  height: 10px;
  background: #1d212a;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.level-fill {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, rgba(212, 175, 55, 0.35), rgba(212, 175, 55, 0.95));
}

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

.projection-item {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
  display: grid;
  gap: 4px;
}

.projection-item span {
  color: var(--muted);
  font-size: 0.82rem;
}

.projection-item strong {
  font-size: 1.04rem;
}

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

label {
  display: grid;
  gap: 6px;
  font-size: 0.89rem;
}

input[type="number"] {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--bg-soft);
  color: #fff;
  padding: 10px 11px;
}

input[type="number"]:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 2px var(--gold-soft);
}

.toggle-row {
  display: flex;
  align-items: center;
  gap: 9px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.02);
  padding: 10px;
}

.toggle-row input {
  width: 16px;
  height: 16px;
}

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

.plan-card {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.02);
  padding: 12px;
  display: grid;
  gap: 6px;
}

.plan-card h3 {
  margin: 0;
  font-size: 0.94rem;
}

.plan-card p {
  margin: 0;
  color: #d7dce6;
  font-size: 0.87rem;
}

.challenge-card {
  border-color: rgba(212, 175, 55, 0.4);
  background: rgba(212, 175, 55, 0.08);
}

.challenge-card.challenge-card-lost {
  border-color: rgba(255, 120, 120, 0.6);
  background: rgba(255, 120, 120, 0.12);
}

.challenge-card.challenge-card-completed {
  border-color: rgba(130, 230, 130, 0.6);
  background: rgba(130, 230, 130, 0.12);
}

.challenge-card-active {
  border-color: rgba(212, 175, 55, 0.68);
  background: rgba(212, 175, 55, 0.14);
}

.challenge-activate-btn {
  margin-top: 4px;
}

.btn.challenge-activate-btn.challenge-activate-btn-lost {
  background: #b43a3a;
  border-color: #d95b5b;
  color: #fff;
}

.btn.challenge-activate-btn.challenge-activate-btn-completed {
  background: #2f8f4e;
  border-color: #57b875;
  color: #fff;
}

.plan-card p.challenge-violation-text {
  margin-top: 4px;
  color: #ffb4ad;
  font-weight: 700;
}

.plan-card p.challenge-completed-text {
  margin-top: 4px;
  color: #8be28b;
  font-weight: 700;
}

@media (max-width: 900px) {
  .metric-grid,
  .projection-grid,
  .identity-grid,
  .zones-grid,
  .plan-grid {
    grid-template-columns: 1fr;
  }

  .period-row {
    align-items: stretch;
  }

  .period-row .btn {
    width: 100%;
  }

  .period-row strong {
    min-width: 0;
  }

  .dna-guest-cta {
    flex-direction: row;
    flex-wrap: wrap;
  }
}
