:root {
  --bg: #f4f4f1;
  --panel: #fbfbf8;
  --card: #ffffff;
  --ink: #111111;
  --muted: #5f5f58;
  --line: #171717;
  --soft-line: #d6d6cf;
  --shadow: 0 20px 40px rgba(17, 17, 17, 0.06);
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  max-width: 100%;
  overflow-x: clip;
}

body {
  min-height: 100vh;
  font-family: "Manrope", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(17, 17, 17, 0.06), transparent 32%),
    linear-gradient(180deg, #ffffff 0%, var(--bg) 100%);
  color: var(--ink);
}

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

h1,
h2,
h3,
h4,
p {
  margin: 0;
}

.page-shell {
  width: min(1360px, calc(100% - 32px));
  margin: 0 auto;
  padding: 28px 0 48px;
}

.hero {
  margin-bottom: 20px;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4.8rem);
  line-height: 0.95;
}

.app-shell {
  display: grid;
  gap: 20px;
}

.panel {
  border: 1.5px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  min-width: 0;
}

.panel-heading {
  display: flex;
  justify-content: space-between;
  align-items: end;
  gap: 12px;
  flex-wrap: wrap;
  padding: 24px 24px 0;
}

.panel-kicker {
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  font-weight: 800;
}

.step-indicator,
#statusBadge {
  border: 1px solid var(--line);
  padding: 7px 11px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  white-space: nowrap;
}

.wizard-progress {
  height: 8px;
  margin: 20px 24px 0;
  border: 1px solid var(--soft-line);
  background: #ecece6;
}

.wizard-progress-bar {
  height: 100%;
  width: 12.5%;
  background: var(--ink);
  transition: width 160ms ease;
}

.wizard-form {
  padding: 24px;
}

.wizard-step {
  display: grid;
  gap: 18px;
  min-height: 360px;
  align-content: start;
}

.wizard-step.is-active {
  animation: stepFade 160ms ease;
}

.question-label {
  text-transform: uppercase;
  letter-spacing: 0.14em;
  font-size: 0.72rem;
  font-weight: 800;
  color: var(--muted);
}

.question-help {
  max-width: 58ch;
  color: var(--muted);
  line-height: 1.6;
}

.question-grid,
.question-stack-grid {
  display: grid;
  gap: 14px;
}

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

.question-grid--triple {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

label,
fieldset {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.92rem;
  font-weight: 700;
  min-width: 0;
}

.question-stack {
  max-width: 760px;
}

input,
select,
textarea {
  width: 100%;
  border: 1.5px solid var(--line);
  padding: 13px 14px;
  background: var(--card);
  color: var(--ink);
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  box-shadow: 0 0 0 4px rgba(17, 17, 17, 0.08);
}

textarea {
  resize: vertical;
}

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

legend {
  padding: 0 8px;
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

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

.mode-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
  min-height: 116px;
  padding: 12px;
  border: 1.5px solid var(--line);
  background: var(--card);
}

.mode-card input {
  width: auto;
  margin: 0;
}

.mode-card small {
  color: var(--muted);
  line-height: 1.5;
  font-weight: 600;
}

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

.checkbox-group label {
  flex-direction: row;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.checkbox-group input {
  width: auto;
}

.wizard-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--soft-line);
}

.wizard-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: end;
}

button {
  border: 1.5px solid var(--line);
  background: var(--ink);
  color: #ffffff;
  padding: 14px 18px;
  font-weight: 800;
  cursor: pointer;
  max-width: 100%;
}

button:disabled {
  opacity: 0.45;
  cursor: default;
}

.secondary-button,
.ghost-button {
  background: var(--card);
  color: var(--ink);
}

.output-panel {
  padding-bottom: 24px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  padding: 24px;
}

.result-card {
  border: 1px solid var(--soft-line);
  background: var(--card);
  min-width: 0;
}

.result-card--wide {
  grid-column: span 2;
}

.result-card h3 {
  padding: 18px 18px 0;
}

.result-content,
.copy-grid {
  padding: 18px;
}

.result-content {
  display: grid;
  gap: 16px;
}

.result-content section {
  display: grid;
  gap: 10px;
}

.result-content p {
  color: var(--muted);
  line-height: 1.65;
}

.result-content strong,
.result-content h4 {
  color: var(--ink);
}

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

.stat-card {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid var(--soft-line);
  background: #f9f9f6;
}

.stat-label {
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
}

.stat-value {
  font-size: 1rem;
}

.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.pill {
  border: 1px solid var(--line);
  padding: 8px 10px;
  font-size: 0.8rem;
  font-weight: 700;
  max-width: 100%;
  overflow-wrap: anywhere;
}

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

.copy-block {
  display: grid;
  gap: 10px;
  min-width: 0;
  border: 1px solid var(--soft-line);
  padding: 14px;
}

.copy-block p {
  color: var(--muted);
  line-height: 1.65;
}

.copy-label {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.technical-stack {
  gap: 12px;
}

.disclosure {
  border: 1px solid var(--soft-line);
  background: #fafaf7;
}

.disclosure summary {
  cursor: pointer;
  list-style: none;
  padding: 14px 16px;
  font-weight: 800;
}

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

.disclosure[open] summary {
  border-bottom: 1px solid var(--soft-line);
}

.code-block {
  margin: 0;
  padding: 18px;
  overflow-x: auto;
  background: #111111;
  color: #f4f4f1;
  line-height: 1.55;
  font-size: 0.88rem;
  max-width: 100%;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}

@keyframes stepFade {
  from {
    opacity: 0;
    transform: translateY(6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1180px) {
  .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats-grid,
  .copy-grid,
  .checkbox-group,
  .mode-options {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .page-shell {
    width: min(100% - 20px, 100%);
    padding-top: 20px;
  }

  .question-grid,
  .question-grid--triple,
  .question-stack-grid,
  .results-grid,
  .stats-grid,
  .copy-grid,
  .checkbox-group,
  .mode-options {
    grid-template-columns: 1fr;
  }

  .result-card--wide {
    grid-column: span 1;
  }

  .wizard-step {
    min-height: auto;
  }

  .wizard-controls {
    flex-direction: column;
    align-items: stretch;
  }

  .wizard-actions {
    justify-content: stretch;
  }

  .wizard-actions button,
  .wizard-controls > button {
    width: 100%;
  }
}
