:root {
  --services-panel: rgba(183, 200, 225, 0.045);
  --services-panel-strong: rgba(7, 20, 42, 0.36);
  --services-accent-soft: rgba(0, 209, 255, 0.075);
  --services-danger: #ffb4a8;
  --services-max: 1120px;
}

button,
input {
  font: inherit;
}

button {
  color: inherit;
}

.services-intro {
  padding-bottom: clamp(44px, 7vw, 72px);
}

.services-intro h1 {
  max-width: 14ch;
}

.services-intro .lead {
  max-width: 760px;
}

.services-flow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.services-flow li {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-bright);
  font-size: 14px;
  font-weight: 700;
}

.services-flow li + li::before {
  content: none;
}

.tool-section {
  padding-top: clamp(40px, 7vw, 76px);
}

.tool-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: clamp(18px, 4vw, 28px);
  align-items: start;
}

.selector-panel,
.questions-panel,
.result-panel {
  min-width: 0;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--services-panel);
}

.selector-panel,
.questions-panel {
  padding: clamp(18px, 3vw, 24px);
}

.result-panel {
  min-height: 260px;
  padding: clamp(18px, 3vw, 28px);
}

.panel-head {
  display: flex;
  gap: 14px;
  align-items: flex-start;
  margin-bottom: 18px;
}

.step-label {
  display: grid;
  flex: none;
  width: 30px;
  height: 30px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--navy);
  font-size: 14px;
  font-weight: 800;
}

.panel-head h2,
.empty-result h2 {
  color: var(--text-strong);
  font-size: 20px;
  line-height: 1.2;
}

.panel-head p,
.empty-result p,
.state-message,
.quiz-empty p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
}

.state-message {
  margin-bottom: 12px;
}

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

.need-card {
  display: grid;
  width: 100%;
  min-height: 180px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 20, 42, 0.28);
  color: var(--text);
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background 0.16s ease,
    transform 0.16s ease;
}

.need-card:hover,
.need-card.is-selected {
  border-color: var(--accent);
  background: var(--services-accent-soft);
}

.need-card:hover {
  transform: translateY(-1px);
}

.need-card.is-selected {
  box-shadow: inset 0 0 0 1px rgba(0, 209, 255, 0.22);
}

.need-visual {
  display: grid;
  width: 100%;
  height: 96px;
  margin-bottom: 12px;
  place-items: center;
  border: 1px solid rgba(183, 200, 225, 0.1);
  border-radius: var(--radius);
  background: rgba(183, 200, 225, 0.035);
}

.need-visual img {
  display: block;
  width: 100%;
  max-width: 150px;
  height: 72px;
  object-fit: contain;
}

.need-card strong {
  display: block;
  align-self: end;
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.need-detail-panel {
  margin-top: 16px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 20, 42, 0.32);
}

.need-detail-panel h3 {
  color: var(--text-strong);
  font-size: 15px;
  line-height: 1.35;
}

.need-detail-panel p {
  max-width: 820px;
  margin-top: 8px;
  color: var(--text);
  overflow-wrap: anywhere;
}

#services-form,
#questions-list {
  min-width: 0;
}

.quiz-empty {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 20, 42, 0.26);
}

.question-group {
  min-width: 0;
  max-width: 760px;
  margin: 0 auto;
  padding: clamp(18px, 3vw, 24px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 20, 42, 0.3);
}

.quiz-progress {
  display: flex;
  margin-bottom: 12px;
}

.quiz-progress span {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 10px;
  border: 1px solid rgba(0, 209, 255, 0.28);
  border-radius: var(--radius);
  background: rgba(0, 209, 255, 0.055);
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.question-title {
  display: block;
  max-width: 54ch;
  color: var(--text-strong);
  font-size: clamp(18px, 2.3vw, 24px);
  font-weight: 800;
  line-height: 1.25;
}

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

.option-label {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  min-height: 46px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 20, 42, 0.35);
  cursor: pointer;
  overflow-wrap: anywhere;
}

.option-label:has(input:checked) {
  border-color: rgba(0, 209, 255, 0.5);
  background: rgba(0, 209, 255, 0.07);
}

.option-label input {
  flex: none;
  width: 18px;
  height: 18px;
  margin: 3px 0 0;
  accent-color: var(--accent);
}

.selection-summary {
  margin-top: 18px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(183, 200, 225, 0.035);
}

.selection-summary strong {
  display: block;
  color: var(--text-strong);
  font-size: 13px;
}

.selection-summary p {
  margin-top: 4px;
  color: var(--muted);
  font-size: 14px;
  overflow-wrap: anywhere;
}

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

.primary-action,
.ghost-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
}

.primary-action {
  border: 0;
  padding: 0 20px;
  background: var(--accent);
  color: var(--navy);
}

.ghost-action {
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  background: transparent;
  color: var(--text-strong);
}

.result-header,
.empty-result {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.result-header {
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.result-eyebrow {
  color: var(--accent);
  font-size: 13px;
  font-weight: 800;
}

.result-header h2 {
  margin-top: 2px;
  color: var(--text-strong);
  font-size: clamp(20px, 3vw, 28px);
  line-height: 1.2;
}

.result-reading {
  max-width: 760px;
  padding: 22px 0;
}

.result-reading h3,
.result-card h3 {
  color: var(--text-strong);
  font-size: 18px;
  line-height: 1.3;
}

.result-reading p,
.result-card p {
  margin-top: 8px;
  color: var(--text);
  overflow-wrap: anywhere;
}

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

.result-card {
  min-width: 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 20, 42, 0.26);
}

.continuity-card {
  border-color: rgba(0, 209, 255, 0.32);
  background: rgba(0, 209, 255, 0.055);
}

.result-list {
  display: grid;
  gap: 9px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}

.result-item {
  position: relative;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(7, 20, 42, 0.34);
  overflow-wrap: anywhere;
}

.is-sequence {
  counter-reset: result-step;
}

.is-sequence .result-item {
  padding-left: 48px;
  counter-increment: result-step;
}

.is-sequence .result-item::before {
  content: counter(result-step);
  position: absolute;
  left: 14px;
  top: 12px;
  display: grid;
  width: 22px;
  height: 22px;
  place-items: center;
  border-radius: var(--radius);
  background: var(--accent);
  color: var(--navy);
  font-size: 12px;
  font-weight: 800;
}

.result-item strong {
  display: block;
  color: var(--text-strong);
}

.result-item span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
}

.result-cta {
  display: flex;
  margin-top: 20px;
}

.error-message {
  border-color: rgba(255, 180, 168, 0.5);
  color: var(--services-danger);
}

[hidden] {
  display: none !important;
}

@media (max-width: 900px) {
  .site-header {
    gap: 16px;
  }

  .header-nav {
    gap: 18px;
  }

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

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

@media (max-width: 560px) {
  .services-intro h1 {
    max-width: 12ch;
  }

  .services-flow {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .services-flow li {
    justify-content: center;
    padding-inline: 10px;
  }

  .services-flow li + li::before {
    content: none;
  }

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

  .need-card {
    min-height: 156px;
  }

  .result-header,
  .empty-result {
    display: block;
  }

  .result-header .step-label,
  .empty-result .step-label {
    margin-bottom: 12px;
  }

  .form-actions .primary-action,
  .form-actions .ghost-action,
  .result-cta .primary-action {
    width: 100%;
  }
}
