* {
  box-sizing: border-box;
}

:root {
  --bg: #090907;
  --surface: #11120f;
  --surface-soft: #171912;
  --panel: rgba(18, 19, 15, 0.86);
  --panel-strong: rgba(22, 23, 18, 0.94);
  --panel-border: rgba(238, 232, 215, 0.12);
  --text: #f6f2e8;
  --muted: #afa99b;
  --soft: #e8dfcb;
  --accent: #c8b98b;
  --accent-blue: #8fa2ff;
  --accent-gold: #e7cd74;
  --glow: rgba(130, 150, 255, 0.16);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 50% 0%, rgba(118, 135, 255, 0.11), transparent 32%),
    radial-gradient(circle at 20% 18%, rgba(219, 190, 118, 0.09), transparent 28%),
    linear-gradient(135deg, #080906, #10120d 52%, #090a08);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select {
  font: inherit;
}

button {
  -webkit-tap-highlight-color: transparent;
}

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

.state-page {
  min-height: 100vh;
  padding: 14px;
}

.state-shell {
  width: 100%;
  max-width: 1480px;
  margin: 0 auto;
  overflow: hidden;
  border: 1px solid var(--panel-border);
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(21, 23, 18, 0.92), rgba(10, 11, 9, 0.94));
  backdrop-filter: blur(18px);
  box-shadow:
    0 24px 80px rgba(0, 0, 0, 0.48),
    inset 0 1px 0 rgba(255, 255, 255, 0.04);
}

.state-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  padding: 24px;
  border-bottom: 1px solid rgba(238, 232, 215, 0.08);
}

.hero-block h1 {
  margin-bottom: 8px;
  font-size: clamp(34px, 4vw, 58px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-copy {
  max-width: 560px;
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  gap: 10px;
}

.ghost-btn,
.primary-btn,
.secondary-action {
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    opacity 0.18s ease,
    background 0.18s ease;
}

.ghost-btn:hover,
.primary-btn:hover,
.secondary-action:hover {
  transform: translateY(-2px);
}

.ghost-btn {
  padding: 12px 16px;
  border-radius: 999px;
  border: 1px solid rgba(238, 232, 215, 0.12);
  background: rgba(255, 255, 255, 0.035);
  color: var(--text);
}

.ghost-btn:hover {
  border-color: rgba(231, 205, 116, 0.46);
  background: rgba(231, 205, 116, 0.06);
}

.compass-section {
  padding: 24px 22px 8px;
}

.state-compass {
  position: relative;
  width: 700px;
  height: 700px;
  margin: 0 auto;
  border-radius: 50%;
  border: 1px solid rgba(238, 232, 215, 0.14);
  background:
    radial-gradient(circle at center, rgba(14, 16, 13, 0.10) 0 30%, transparent 31%),
    repeating-radial-gradient(circle, rgba(238, 232, 215, 0.052) 0 1px, transparent 1px 78px),
    conic-gradient(
      from -90deg,
      rgba(118, 135, 255, 0.34),
      rgba(129, 122, 172, 0.25),
      rgba(214, 185, 110, 0.38),
      rgba(147, 157, 108, 0.31),
      rgba(93, 132, 154, 0.31),
      rgba(118, 135, 255, 0.34)
    );
  box-shadow:
    inset 0 0 90px rgba(0, 0, 0, 0.62),
    0 0 76px rgba(120, 140, 255, 0.08);
}

.state-compass::before {
  content: "";
  position: absolute;
  inset: 28px;
  border-radius: 50%;
  border: 1px solid rgba(238, 232, 215, 0.08);
  pointer-events: none;
}

.state-compass::after {
  content: "";
  position: absolute;
  inset: 92px;
  border-radius: 50%;
  border: 1px solid rgba(238, 232, 215, 0.10);
  background: radial-gradient(circle at top, rgba(34, 35, 28, 0.62), rgba(9, 10, 8, 0.97));
  box-shadow: inset 0 0 44px rgba(0, 0, 0, 0.58);
}

.center-state {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  width: 310px;
  height: 310px;
  padding: 28px;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  background: radial-gradient(circle at top, rgba(118, 135, 255, 0.18), rgba(14, 15, 12, 0.98));
  border: 1px solid rgba(231, 205, 116, 0.26);
  text-align: center;
}

.center-state span {
  order: 1;
  margin: 0 0 8px;
  color: var(--accent-gold);
  font-size: 36px;
  font-weight: 850;
  line-height: 1;
}

.center-state p {
  order: 2;
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.center-state h2 {
  order: 3;
  max-width: 220px;
  margin: 0 0 12px;
  font-size: 30px;
  line-height: 0.98;
  letter-spacing: -0.05em;
  overflow-wrap: anywhere;
}

.center-state small {
  order: 4;
  max-width: 210px;
  color: #d0c8b8;
  font-size: 13px;
  line-height: 1.4;
}

.node {
  position: absolute;
  z-index: 5;
  width: 140px;
  min-height: 82px;
  padding: 14px;
  border-radius: 20px;
  border: 1px solid rgba(238, 232, 215, 0.10);
  background: linear-gradient(145deg, rgba(23, 24, 20, 0.94), rgba(9, 10, 8, 0.84));
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease,
    background 0.18s ease;
}

.node:hover {
  border-color: rgba(231, 205, 116, 0.44);
  transform: scale(1.03);
}

.node.active,
.input-tile.active,
.context-chip.active {
  border-color: rgba(231, 205, 116, 0.62);
  background: linear-gradient(145deg, rgba(33, 32, 24, 0.96), rgba(14, 16, 13, 0.94));
}

.node span {
  display: block;
  color: #c0b9ac;
  font-size: 10px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.node strong {
  display: block;
  margin-top: 7px;
  font-size: 24px;
}

.node-time { top: 26px; left: 50%; transform: translateX(-50%); }
.node-body { top: 116px; right: 36px; }
.node-mind { top: 50%; right: -2px; transform: translateY(-50%); }
.node-work { right: 36px; bottom: 116px; }
.node-environment { bottom: 26px; left: 50%; transform: translateX(-50%); }
.node-money { left: 36px; bottom: 116px; }
.node-social { top: 50%; left: -2px; transform: translateY(-50%); }
.node-direction { top: 116px; left: 36px; }

.inputs-panel,
.report-card,
.modal-card {
  border: 1px solid rgba(238, 232, 215, 0.10);
  border-radius: 24px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.043), rgba(255, 255, 255, 0.024));
  backdrop-filter: blur(18px);
}

.inputs-panel {
  margin: 0 22px 20px;
  padding: 18px;
}

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

.panel-heading h2 {
  margin-bottom: 0;
  font-size: 20px;
  letter-spacing: -0.03em;
}

.panel-heading p {
  margin: 0;
  max-width: 520px;
  color: var(--muted);
  line-height: 1.5;
}

.input-tile-grid,
.context-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.input-tile,
.context-chip {
  min-height: 78px;
  padding: 10px;
  border-radius: 16px;
  border: 1px solid rgba(238, 232, 215, 0.09);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.016));
  color: var(--text);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  cursor: pointer;
  transition:
    transform 0.18s ease,
    border-color 0.18s ease;
}

.input-tile:hover,
.context-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(231, 205, 116, 0.42);
}

.input-tile span,
.context-chip span {
  display: block;
  color: var(--muted);
  font-size: 9px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.input-tile strong,
.context-chip strong {
  display: block;
  margin-top: 4px;
  font-size: 24px;
  line-height: 1;
}

.report-panel {
  padding: 0 22px 22px;
}

.report-card {
  padding: 24px;
}

.report-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 14px;
}

.report-top h2 {
  margin-bottom: 6px;
  font-size: clamp(32px, 4vw, 52px);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.report-score {
  color: var(--accent-gold);
  font-size: clamp(34px, 5vw, 58px);
  font-weight: 850;
  line-height: 0.95;
}

.report-description {
  margin-bottom: 18px;
  color: #d1caba;
  font-size: 18px;
  line-height: 1.5;
}

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

.report-meta-grid,
.report-readout-grid {
  grid-template-columns: 1fr;
}

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

.domain-summary-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 12px;
}

.report-item,
.domain-summary-item {
  padding: 16px;
  border-radius: 18px;
  border: 1px solid rgba(238, 232, 215, 0.08);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(255, 255, 255, 0.018));
}

.report-meta-grid .report-item,
.report-readout-grid .report-item {
  min-height: 74px;
}

.domain-summary-item {
  min-height: 86px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.metric-report-grid .report-item {
  min-height: 86px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.report-item span,
.domain-summary-item span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.domain-summary-item span,
.metric-report-grid .report-item span {
  font-size: 9px;
  letter-spacing: 0.14em;
}

.report-item strong,
.domain-summary-item strong {
  display: block;
  margin-top: 7px;
  color: var(--text);
  font-size: 20px;
}

.metric-report-grid .report-item strong,
.domain-summary-item strong {
  margin-top: 5px;
  font-size: 24px;
  line-height: 1;
}

.domain-summary-item small {
  display: block;
  margin-top: 5px;
  color: #d0c8b8;
  font-size: 12px;
  line-height: 1.25;
}

.report-subsection {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid rgba(238, 232, 215, 0.08);
}

.report-subhead {
  margin-bottom: 12px;
}

.report-subhead h3 {
  margin: 0;
  font-size: 22px;
  letter-spacing: -0.03em;
}

.driver {
  padding: 14px 0;
  border-bottom: 1px solid rgba(238, 232, 215, 0.07);
  color: #d0c8b8;
  line-height: 1.45;
}

.driver:last-child {
  border-bottom: 0;
}

.driver strong {
  display: block;
  margin-bottom: 4px;
  color: var(--text);
  font-size: 18px;
}

.snapshot-card,
.scoring-note,
.disclaimer-note {
  margin-top: 20px;
  padding: 18px;
  border-radius: 18px;
  border: 1px solid rgba(238, 232, 215, 0.08);
  background: rgba(255, 255, 255, 0.025);
}

#snapshotText {
  margin: 0;
  color: #d0c8b8;
  line-height: 1.55;
}

.scoring-note p,
.disclaimer-note p {
  margin-bottom: 0;
  color: #d0c8b8;
  line-height: 1.45;
}

.modal {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: none;
  place-items: center;
  padding: 18px;
  background: rgba(0, 0, 0, 0.72);
}

.modal.active {
  display: grid;
}

.modal-card {
  width: min(560px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 22px;
  background: linear-gradient(180deg, rgba(24, 25, 21, 0.96), rgba(10, 11, 9, 0.96));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.55);
}

.modal-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
}

.modal-copy {
  margin-bottom: 20px;
  color: var(--muted);
  line-height: 1.55;
}

.close-btn {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 24px;
  cursor: pointer;
}

.range-row {
  display: block;
  margin-bottom: 22px;
}

.range-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.range-value {
  color: var(--accent-gold);
  font-weight: 850;
}

.range-row input[type="range"] {
  width: 100%;
  accent-color: var(--accent-gold);
}

.modal-actions {
  position: sticky;
  bottom: 0;
  display: flex;
  gap: 10px;
  margin-top: 22px;
  padding-top: 12px;
  background: linear-gradient(180deg, transparent, rgba(10, 11, 9, 0.96) 25%);
}

.primary-btn,
.secondary-action {
  flex: 1;
  padding: 14px 16px;
  border-radius: 999px;
}

.primary-btn {
  border: 0;
  color: #16150f;
  background: linear-gradient(135deg, #e7cd74, #c8b98b);
  box-shadow: 0 10px 28px rgba(231, 205, 116, 0.16);
  font-weight: 800;
}

.secondary-action {
  border: 1px solid rgba(238, 232, 215, 0.10);
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
}

input,
select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(238, 232, 215, 0.12);
  background: rgba(0, 0, 0, 0.24);
  color: var(--text);
  outline: none;
}

input:focus,
select:focus {
  border-color: rgba(231, 205, 116, 0.48);
  box-shadow: 0 0 0 3px rgba(231, 205, 116, 0.10);
}

@media print {
  body {
    background: #fff;
    color: #111;
  }

  .state-header,
  .compass-section,
  .inputs-panel,
  .modal {
    display: none !important;
  }

  .state-page,
  .state-shell,
  .report-panel {
    padding: 0;
    margin: 0;
  }

  .state-shell,
  .report-card {
    border: 0;
    box-shadow: none;
    background: #fff;
    color: #111;
  }

  .report-description,
  #snapshotText,
  .driver,
  .domain-summary-item small,
  .scoring-note p,
  .disclaimer-note p {
    color: #333;
  }
}

@media (max-width: 920px) {
  .state-compass {
    width: 620px;
    height: 620px;
  }

  .state-compass::after {
    inset: 82px;
  }

  .report-grid,
  .metric-report-grid,
  .domain-summary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-meta-grid,
  .report-readout-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .state-page {
    padding: 8px;
  }

  .state-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 18px;
  }

  .header-actions {
    width: 100%;
  }

  .ghost-btn {
    flex: 1;
  }

  .compass-section {
    padding: 10px 8px 0;
  }

  .state-compass {
    width: 100%;
    max-width: 420px;
    height: 420px;
  }

  .state-compass::after {
    inset: 60px;
  }

  .center-state {
    width: 192px;
    height: 192px;
    padding: 16px;
  }

  .center-state span {
    font-size: 25px;
  }

  .center-state p {
    font-size: 9px;
  }

  .center-state h2 {
    max-width: 142px;
    font-size: 20px;
  }

  .center-state small {
    max-width: 140px;
    font-size: 11px;
    line-height: 1.32;
  }

  .node {
    width: 96px;
    min-height: 64px;
    padding: 10px;
    border-radius: 16px;
  }

  .node strong {
    font-size: 18px;
  }

  .node span {
    font-size: 9px;
  }

  .node-time { top: 10px; }
  .node-body { top: 68px; right: 8px; }
  .node-mind { right: -10px; }
  .node-work { right: 8px; bottom: 68px; }
  .node-environment { bottom: 10px; }
  .node-money { left: 8px; bottom: 68px; }
  .node-social { left: -10px; }
  .node-direction { top: 68px; left: 8px; }

  .inputs-panel,
  .report-panel {
    margin-left: 8px;
    margin-right: 8px;
    padding-left: 0;
    padding-right: 0;
  }

  .inputs-panel {
    padding: 16px;
  }

  .compact-heading {
    display: block;
  }

  .compact-heading p {
    margin-top: 8px;
  }

  .input-tile-grid,
  .context-grid,
  .metric-report-grid,
  .domain-summary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-meta-grid,
  .report-readout-grid {
    grid-template-columns: 1fr;
  }

  .report-card {
    padding: 18px;
  }

  .report-description {
    font-size: 16px;
  }

  .modal-actions {
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .report-grid {
    grid-template-columns: 1fr;
  }

  .input-tile-grid,
  .context-grid,
  .metric-report-grid,
  .domain-summary-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .report-meta-grid,
  .report-readout-grid {
    grid-template-columns: 1fr;
  }

  .state-compass {
    max-width: 360px;
    height: 360px;
  }

  .state-compass::after {
    inset: 52px;
  }

  .center-state {
    width: 166px;
    height: 166px;
    padding: 14px;
  }

  .center-state span {
    font-size: 22px;
  }

  .center-state h2 {
    max-width: 120px;
    font-size: 17px;
  }

  .center-state small {
    display: none;
  }

  .node {
    width: 84px;
    min-height: 56px;
    padding: 8px;
  }

  .node strong {
    font-size: 15px;
  }
}