:root {
  color-scheme: dark;
  --bg: #111316;
  --panel: #1b1f25;
  --panel-strong: #242a32;
  --ink: #f4f0e8;
  --muted: #b7bdc7;
  --line: #343b46;
  --accent: #e2553d;
  --accent-2: #2db4a0;
  --accent-3: #f2bf5e;
  --complete: #fff1b8;
  --complete-strong: #f3c84f;
  --complete-ink: #241b0d;
  --complete-muted: #5d4b21;
  --danger: #ff7b72;
  --shadow: 0 18px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

.ratings-overview summary {
  cursor: pointer;
  font-weight: 700;
  line-height: 1.6;
}

.overview-hint {
  display: inline-block;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 400;
  margin-left: 0.6rem;
}

.ratings-overview[open] .overview-hint {
  display: none;
}

.overview-image-link {
  display: block;
  border-radius: 8px;
  overflow: hidden;
}

.overview-image-link img {
  display: block;
  width: 100%;
  height: auto;
}

.ratings-overview summary:focus-visible,
.overview-image-link:focus-visible {
  outline: 3px solid var(--accent-3);
  outline-offset: 5px;
}

html {
  overflow-x: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  background:
    linear-gradient(135deg, rgba(226, 85, 61, 0.2), transparent 38%),
    linear-gradient(245deg, rgba(242, 191, 94, 0.2), transparent 44%),
    linear-gradient(180deg, rgba(45, 180, 160, 0.08), transparent 58%),
    var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select,
textarea {
  font: inherit;
}

.site-header {
  padding: 42px 24px 28px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.header-inner,
.app-shell,
.site-footer {
  width: min(1160px, calc(100% - 32px));
  margin: 0 auto;
}

.header-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 190px;
  gap: 24px;
  align-items: end;
}

.header-copy {
  display: grid;
  gap: 18px;
}

.brand-lockup {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 12px;
}

.brand-logo {
  width: 58px;
  height: 58px;
  border: 2px solid rgba(242, 191, 94, 0.72);
  border-radius: 50%;
  object-fit: cover;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.brand-lockup span {
  display: block;
  color: var(--ink);
  font-size: 0.95rem;
  font-weight: 900;
}

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

h1,
h2,
h3,
h4,
p {
  margin-top: 0;
  overflow-wrap: break-word;
}

a,
strong,
span,
label,
div,
section,
article {
  min-width: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: 5rem;
  line-height: 0.94;
  letter-spacing: 0;
}

h2 {
  margin-bottom: 8px;
  font-size: 1.35rem;
  line-height: 1.2;
}

h3 {
  margin-bottom: 8px;
  font-size: 1.02rem;
  line-height: 1.25;
}

.lede {
  max-width: 740px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.08rem;
  line-height: 1.55;
}

.score-card {
  min-height: 160px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(27, 31, 37, 0.8);
  box-shadow: var(--shadow);
  border-radius: 8px;
  padding: 18px;
  display: grid;
  align-content: center;
  justify-items: start;
}

.score-card strong {
  display: block;
  margin: 4px 0;
  color: var(--accent-3);
  font-size: 3.4rem;
  line-height: 1;
}

.score-label,
.score-range,
.bonus-score,
.section-note,
.privacy-note {
  color: var(--muted);
}

.bonus-score {
  margin-top: 8px;
  font-weight: 900;
}

.app-shell {
  padding: 28px 0 42px;
}

.panel {
  margin: 18px 0;
  padding: 22px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(27, 31, 37, 0.92);
  border-radius: 8px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
}

.intro-panel {
  background: linear-gradient(135deg, rgba(36, 42, 50, 0.96), rgba(27, 31, 37, 0.92));
}

.panel-grid,
.section-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 22px;
}

.select-wrap,
.demographics-grid label {
  display: grid;
  gap: 8px;
}

.select-wrap {
  width: min(420px, 100%);
}

label span,
.select-wrap span {
  color: var(--muted);
  font-size: 0.86rem;
  font-weight: 700;
}

select,
input,
textarea {
  width: 100%;
  color: var(--ink);
  background: #101318;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  outline: none;
}

select:focus,
input:focus,
textarea:focus {
  border-color: var(--accent-2);
  box-shadow: 0 0 0 3px rgba(45, 180, 160, 0.18);
}

.source-panel {
  margin-top: 18px;
  padding: 18px;
  min-width: 0;
  border: 1px solid var(--line);
  background:
    linear-gradient(135deg, rgba(242, 191, 94, 0.12), transparent 42%),
    #14181e;
  border-radius: 8px;
}

.source-panel a {
  color: var(--accent-3);
  font-weight: 800;
  overflow-wrap: anywhere;
}

.source-body {
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.source-body > div {
  min-width: 0;
}

.source-body p,
.source-body strong {
  overflow-wrap: anywhere;
}

.guru-avatar {
  width: 164px;
  height: 164px;
  display: block;
  border: 2px solid rgba(242, 191, 94, 0.78);
  border-radius: 8px;
  background: var(--complete);
  object-fit: cover;
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.28);
}

.source-body h3 {
  font-size: 1.28rem;
}

.related-episodes {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}

.related-episodes h4 {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 0.82rem;
  text-transform: uppercase;
}

.related-episode-list {
  display: grid;
  gap: 7px;
  font-size: 0.9rem;
  line-height: 1.35;
  min-width: 0;
}

.related-episode-list a,
.related-episode-list span {
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.source-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}

.pill,
.optional-badge {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  background: #101318;
  font-size: 0.78rem;
  font-weight: 800;
}

.source-review {
  color: var(--complete-ink);
  border-color: var(--complete-strong);
  background: var(--complete);
}

.response-count {
  color: var(--ink);
  border-color: rgba(45, 180, 160, 0.42);
  background: rgba(45, 180, 160, 0.1);
}

.radio-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(154px, 1fr));
  gap: 10px;
  margin-top: 14px;
}

.radio-card {
  position: relative;
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #14181e;
  cursor: pointer;
}

.radio-card input {
  width: auto;
}

.radio-card span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.radio-card:has(input:checked) {
  color: var(--complete-ink);
  border-color: var(--complete-strong);
  background: var(--complete);
}

.radio-card:has(input:checked) span {
  color: var(--complete-ink);
}

.familiarity-scale {
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.familiarity-heading {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 18px;
}

.familiarity-heading h3 {
  margin-bottom: 4px;
}

.familiarity-heading output {
  min-width: 48px;
  min-height: 42px;
  display: inline-grid;
  place-items: center;
  color: #0d1117;
  background: var(--complete-strong);
  border-radius: 8px;
  font-size: 1.25rem;
  font-weight: 900;
}

.familiarity-scale input[type="range"] {
  margin: 12px 0 8px;
  padding: 0;
  accent-color: var(--complete-strong);
}

.familiarity-anchors {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
}

.familiarity-anchors span:nth-child(2) {
  text-align: center;
}

.familiarity-anchors span:last-child {
  text-align: right;
}

.familiarity-anchors strong {
  color: var(--accent-3);
}

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

.scale-key {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin: 18px 0;
}

.scale-key div {
  min-height: 58px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101318;
}

.scale-key strong {
  color: var(--accent-3);
}

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

.trait-card {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #14181e;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.trait-card-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 42px;
  gap: 12px;
  align-items: start;
}

.trait-icon {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  color: var(--accent-3);
  border: 1px solid rgba(242, 191, 94, 0.42);
  border-radius: 8px;
  background: rgba(242, 191, 94, 0.08);
}

.trait-icon svg {
  width: 25px;
  height: 25px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.trait-card.is-missing {
  border-color: var(--danger);
}

.trait-card.is-complete {
  color: var(--complete-ink);
  border-color: var(--complete-strong);
  background: linear-gradient(180deg, #fff5c9, var(--complete));
  box-shadow: 0 10px 30px rgba(242, 191, 94, 0.12);
}

.trait-card p,
.trait-card details {
  color: var(--muted);
  line-height: 1.45;
}

.trait-card.is-complete p,
.trait-card.is-complete details,
.trait-card.is-complete .eyebrow {
  color: var(--complete-muted);
}

.trait-card summary {
  color: var(--ink);
  cursor: pointer;
  font-weight: 800;
}

.trait-card.is-complete summary,
.trait-card.is-complete h3 {
  color: var(--complete-ink);
}

.trait-card.is-complete .trait-icon {
  color: var(--complete-ink);
  border-color: rgba(36, 27, 13, 0.24);
  background: rgba(255, 255, 255, 0.48);
}

.rating-buttons {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
}

.rating-button {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  background: #101318;
  cursor: pointer;
  font-weight: 900;
}

.rating-button:hover,
.rating-button:focus {
  border-color: var(--accent-3);
}

.rating-button.is-selected {
  color: #0d1117;
  background: var(--complete-strong);
  border-color: var(--complete-strong);
}

.trait-card.is-complete .rating-button {
  color: var(--complete-ink);
  border-color: rgba(36, 27, 13, 0.28);
  background: rgba(255, 255, 255, 0.45);
}

.trait-card.is-complete .rating-button.is-selected {
  color: #0d1117;
  border-color: #0d1117;
  background: var(--complete-strong);
}

.text-button,
.primary-button,
.secondary-button {
  border: 0;
  cursor: pointer;
  border-radius: 8px;
  font-weight: 900;
}

.text-button {
  color: var(--accent-3);
  background: transparent;
  padding: 8px 0;
}

.primary-button {
  min-height: 48px;
  padding: 12px 18px;
  color: #0d1117;
  background: var(--accent-3);
}

.secondary-button {
  min-height: 48px;
  padding: 12px 16px;
  color: var(--ink);
  background: #101318;
  border: 1px solid var(--line);
}

.secondary-button:hover,
.secondary-button:focus {
  border-color: var(--accent-3);
}

.primary-button:disabled {
  cursor: default;
  opacity: 0.82;
}

.primary-button.is-sent {
  background: var(--accent-2);
  color: #07110f;
}

.bonus-panel {
  background: linear-gradient(135deg, rgba(36, 42, 50, 0.98), rgba(31, 29, 23, 0.94));
}

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

.bonus-toggle {
  min-height: 92px;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  color: var(--ink);
  background: #101318;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: pointer;
  text-align: left;
}

.bonus-toggle strong,
.bonus-toggle small {
  display: block;
}

.bonus-toggle strong {
  margin-bottom: 3px;
  font-size: 0.95rem;
}

.bonus-toggle small {
  color: var(--muted);
  line-height: 1.35;
}

.bonus-toggle em {
  color: var(--accent-3);
  font-style: normal;
  font-weight: 900;
}

.lightbulb-icon {
  display: inline-grid;
  width: 32px;
  height: 32px;
  place-items: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.04);
}

.lightbulb-icon svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.bonus-toggle:hover,
.bonus-toggle:focus {
  border-color: var(--complete-strong);
}

.bonus-toggle.is-selected {
  color: var(--complete-ink);
  border-color: var(--complete-strong);
  background: var(--complete);
}

.bonus-toggle.is-selected small,
.bonus-toggle.is-selected .lightbulb-icon {
  color: var(--complete-muted);
}

.bonus-toggle.is-selected .lightbulb-icon {
  border-color: rgba(36, 27, 13, 0.24);
  background: rgba(255, 255, 255, 0.52);
}

.bonus-toggle.is-selected em {
  color: var(--complete-ink);
}

.submit-bar {
  position: sticky;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin: 18px 0;
  padding: 14px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(17, 19, 22, 0.94);
  backdrop-filter: blur(12px);
  border-radius: 8px;
}

.validation-message {
  min-height: 24px;
  margin: 0;
  color: var(--danger);
  font-weight: 800;
}

.validation-message.is-success {
  color: var(--accent-3);
}

.submit-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.results-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, 0.6fr);
  gap: 18px;
}

.chart-card {
  min-height: 420px;
  padding: 12px;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101318;
}

.chart-card canvas {
  width: 100%;
  height: auto;
  display: block;
  aspect-ratio: 720 / 520;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  margin-top: 10px;
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 800;
}

.chart-legend-item {
  display: inline-flex;
  align-items: center;
  min-width: 0;
  gap: 8px;
}

.chart-legend-swatch {
  width: 18px;
  height: 10px;
  flex: 0 0 auto;
  border-radius: 999px;
}

.legacy-controls {
  display: flex;
  justify-content: center;
  margin-top: 10px;
}

.legacy-controls .text-button {
  font-size: 0.85rem;
  opacity: 0.9;
}

.legacy-controls .text-button[aria-pressed="true"] {
  color: #8a94a6;
  opacity: 1;
}

.result-summary {
  display: grid;
  align-content: start;
  gap: 12px;
}

.summary-stat {
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #14181e;
}

.summary-stat span {
  display: block;
  color: var(--muted);
  font-weight: 800;
}

.summary-stat strong {
  display: block;
  margin-top: 4px;
  color: var(--accent-3);
  font-size: 2rem;
}

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

.comparison-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #101318;
}

.comparison-row span,
.comparison-row strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.submission-status {
  color: var(--muted);
  line-height: 1.5;
}

.trap-field {
  position: absolute;
  left: -10000px;
  opacity: 0;
}

.site-footer {
  padding: 24px 0 40px;
  color: var(--muted);
  font-size: 0.92rem;
}

@media (max-width: 900px) {
  .header-inner,
  .panel-grid,
  .section-heading,
  .results-layout {
    display: grid;
    grid-template-columns: 1fr;
  }

  .score-card {
    min-height: 120px;
  }

  .radio-grid,
  .demographics-grid,
  .familiarity-anchors,
  .bonus-grid,
  .trait-grid {
    grid-template-columns: 1fr;
  }

  .familiarity-anchors,
  .familiarity-anchors span:nth-child(2),
  .familiarity-anchors span:last-child {
    text-align: left;
  }

  .scale-key {
    grid-template-columns: 1fr;
  }

  .source-body {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  .guru-avatar {
    width: 116px;
    height: 116px;
  }

  .chart-card {
    min-height: 0;
  }
}

@media (max-width: 560px) {
  .site-header {
    padding-top: 28px;
  }

  h1 {
    font-size: 3.1rem;
  }

  .panel {
    padding: 16px;
  }

  .source-body {
    grid-template-columns: 1fr;
  }

  .guru-avatar {
    width: 132px;
    height: 132px;
  }

  .submit-bar {
    display: grid;
  }

  .submit-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .chart-card {
    padding: 8px;
  }

  .chart-card canvas {
    aspect-ratio: 1 / 0.9;
  }

  .chart-legend {
    display: grid;
    grid-template-columns: 1fr;
    gap: 7px;
    font-size: 0.84rem;
  }

  .chart-legend-item {
    align-items: start;
    line-height: 1.25;
  }

  .site-footer {
    padding-bottom: 22px;
  }
}
