:root {
  --bg: #f7f4ee;
  --ink: #1d2527;
  --muted: #657174;
  --panel: #ffffff;
  --line: #d7dfdd;
  --accent: #126a6f;
  --accent-dark: #0b4f55;
  --gold: #b8842f;
  --danger: #9a3a32;
  --shadow: 0 18px 45px rgba(28, 38, 40, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: linear-gradient(180deg, #eef8f5 0, var(--bg) 330px);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.55;
}

p {
  text-align: justify;
}

.shell {
  width: min(920px, 100%);
  margin: 0 auto;
  padding: 22px 14px 54px;
}

.hero {
  padding: 22px 4px 18px;
}

.brand-mark {
  align-items: center;
  display: flex;
  gap: 10px;
  margin-bottom: 8px;
}

.brand-mark img {
  height: 46px;
  width: 46px;
}

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

h1,
h2 {
  letter-spacing: 0;
  line-height: 1.15;
}

h1 {
  font-size: clamp(1.85rem, 8vw, 3.3rem);
  margin: 0;
  max-width: 760px;
}

h2 {
  font-size: 1.35rem;
  margin: 0 0 14px;
}

h3 {
  font-size: 1.05rem;
  margin: 18px 0 8px;
}

.lead {
  color: var(--muted);
  font-size: 1.05rem;
  margin: 12px 0 0;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  margin: 14px 0;
  padding: 20px;
}

.investigator {
  background: #eef8f5;
  border: 1px solid #c4dcd8;
  border-radius: 8px;
  margin-top: 18px;
  padding: 10px 12px;
}

.investigator-row {
  display: grid;
  gap: 2px;
  margin: 8px 0;
}

.investigator-row strong,
.investigator-row span {
  display: block;
}

.investigator-row span {
  color: var(--muted);
  overflow-wrap: anywhere;
}

.hidden {
  display: none !important;
}

fieldset {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 0 0 16px;
  padding: 14px;
}

legend {
  color: var(--ink);
  font-weight: 700;
  padding: 0 6px;
}

label {
  display: block;
  margin: 10px 0;
}

.field {
  font-weight: 700;
  margin: 16px 0;
}

input[type="text"],
input[type="email"] {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  font: inherit;
  margin-top: 7px;
  min-height: 46px;
  padding: 10px 12px;
  width: 100%;
}

input[type="radio"],
input[type="checkbox"] {
  min-height: 20px;
  min-width: 20px;
  vertical-align: middle;
}

.checkline {
  align-items: flex-start;
  display: flex;
  gap: 10px;
}

.checkline input {
  flex: 0 0 auto;
  margin-top: 4px;
}

.disabled {
  color: #929a9c;
}

.muted,
.hint {
  color: var(--muted);
  font-weight: 400;
}

button,
.share-button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 700;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  text-decoration: none;
}

.primary {
  background: var(--accent);
  color: #ffffff;
}

.primary:hover {
  background: var(--accent-dark);
}

.secondary {
  background: #e8eeee;
  color: var(--ink);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.sticky-progress {
  background: #e4f1ef;
  border: 1px solid #c4dcd8;
  border-radius: 8px;
  color: var(--accent-dark);
  font-weight: 700;
  margin-bottom: 14px;
  padding: 10px 12px;
  position: sticky;
  top: 10px;
  z-index: 3;
}

.question-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  margin: 14px 0;
  padding: 14px;
}

.question-card p {
  font-weight: 700;
  margin: 0 0 12px;
  text-align: left;
}

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

.scale label {
  margin: 0;
}

.scale input {
  opacity: 0;
  position: absolute;
}

.scale span {
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  font-size: 0.82rem;
  font-weight: 600;
  justify-content: center;
  min-height: 70px;
  padding: 8px 6px;
  text-align: center;
}

.scale input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
  color: #ffffff;
}

.scale input:focus + span {
  outline: 3px solid rgba(18, 106, 111, 0.25);
}

.notice {
  background: #fff8e9;
  border: 1px solid #efd6a1;
  border-radius: 8px;
  color: #614817;
  padding: 12px;
}

.structure-note {
  background: #f4fbfa;
  border: 1px solid #c4dcd8;
  border-radius: 8px;
  margin: 14px 0;
  padding: 12px 14px;
}

.structure-note h3 {
  margin-top: 0;
}

.structure-note p {
  margin-bottom: 0;
}

.result-card {
  border-left: 5px solid var(--gold);
  padding: 6px 0 6px 14px;
}

.result-card h3 {
  font-size: 1.3rem;
  margin: 0 0 8px;
}

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

.score-box {
  background: #eef8f5;
  border-radius: 8px;
  padding: 12px;
}

.score-box strong {
  display: block;
  font-size: 1.35rem;
}

.matrix-figure {
  margin: 18px 0;
}

.matrix-figure img {
  border: 1px solid var(--line);
  border-radius: 8px;
  display: block;
  height: auto;
  width: 100%;
}

.subconstruct-report {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.subconstruct-report h3 {
  margin: 0 0 4px;
}

.insight-group-heading {
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  margin: 10px 0 0;
  text-transform: uppercase;
}

.insight-card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #ffffff;
  overflow: hidden;
}

.insight-card summary {
  cursor: pointer;
  font-weight: 700;
  list-style: none;
  padding: 13px 14px;
}

.insight-card summary::-webkit-details-marker {
  display: none;
}

.insight-card summary::after {
  content: "+";
  float: right;
  font-size: 1.2rem;
}

.insight-card[open] summary::after {
  content: "-";
}

.insight-card p {
  color: var(--muted);
  margin: 0;
  padding: 0 14px 14px;
}

.share-button {
  background: #1c9e54;
  color: #ffffff;
  margin-top: 14px;
  width: 100%;
}

.modal {
  align-items: center;
  background: rgba(0, 0, 0, 0.48);
  display: flex;
  inset: 0;
  justify-content: center;
  padding: 18px;
  position: fixed;
  z-index: 20;
}

.modal-card {
  background: #ffffff;
  border-radius: 8px;
  max-width: 520px;
  padding: 20px;
  width: 100%;
}

.toast {
  background: var(--danger);
  border-radius: 8px;
  bottom: 18px;
  color: #ffffff;
  left: 50%;
  max-width: min(520px, calc(100% - 28px));
  padding: 12px 14px;
  position: fixed;
  transform: translateX(-50%);
  z-index: 30;
}

@media (max-width: 640px) {
  .panel {
    padding: 16px;
  }

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

  .scale span {
    align-items: center;
    flex-direction: row;
    justify-content: flex-start;
    min-height: 48px;
    padding: 10px 12px;
    text-align: left;
  }

  .score-row {
    grid-template-columns: 1fr;
  }

  button,
  .share-button {
    width: 100%;
  }
}
