@import url("https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700&family=Inter:wght@400;500;600&display=swap");

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html,
body {
  min-height: 100%;
  margin: 0;
  background: #ffffff;
  color: #111827;
  font-family: Inter, sans-serif;
  font-size: 16px;
}

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

a {
  color: inherit;
}

svg {
  display: block;
  flex-shrink: 0;
}

.brand-logo {
  display: block;
  width: auto;
  object-fit: contain;
}

/* Shared progress bar, copied from React ProgressBar structure */
.progress-bar {
  flex-shrink: 0;
  padding: 16px 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
}

.progress-inner {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

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

.progress-brand,
.progress-actions,
.timer-pill,
.restart-button {
  display: flex;
  align-items: center;
}

.progress-brand {
  gap: 8px;
}

.progress-logo {
  max-width: 280px;
  height: 28px;
}

.progress-brand-icon {
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #ffffff;
  background: #111827;
}

.progress-brand span {
  color: #111827;
  font-family: Outfit, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
}

.progress-actions {
  gap: 12px;
}

.timer-pill {
  gap: 8px;
  padding: 6px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #374151;
  background: #f9fafb;
  font-size: 0.75rem;
  font-weight: 500;
  user-select: none;
}

.timer-pill.critical {
  border-color: #d1d5db;
  color: #dc2626;
  background: #f3f4f6;
}

.timer-pill strong {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.timer-pill small {
  color: currentColor;
  font-size: 10px;
  opacity: 0.7;
}

.language-toggle {
  display: flex;
  overflow: hidden;
  align-items: center;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
}

.language-toggle a {
  padding: 6px 12px;
  color: #6b7280;
  background: #ffffff;
  font-family: Outfit, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  text-decoration: none;
}

.language-toggle a.active {
  color: #ffffff;
  background: #111827;
}

.restart-button {
  border: 2px solid #e5e7eb;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 12px;
  color: #6b7280;
  background: #ffffff;
  font-family: Outfit, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
}

.step-of {
  color: #9ca3af;
  font-size: 0.75rem;
}

.step-progress {
  display: flex;
  gap: 6px;
}

.step-progress-item {
  display: flex;
  min-width: 0;
  flex: 1;
  flex-direction: column;
  gap: 4px;
}

.step-progress-line {
  height: 6px;
  border-radius: 999px;
  background: #e5e7eb;
}

.step-progress-line.done {
  background: #111827;
}

.step-progress-line.current {
  background: #6b7280;
}

.step-progress-item span {
  overflow: hidden;
  color: #9ca3af;
  font-size: 10px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.step-progress-item span.current {
  color: #111827;
  font-weight: 500;
}

/* WelcomeStep */
.welcome-screen {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: #ffffff;
}

.welcome-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
}

.welcome-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.welcome-brand {
  display: flex;
  align-items: center;
}

.welcome-logo {
  max-width: 300px;
  height: 36px;
}

.welcome-brand-icon {
  display: flex;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #ffffff;
  background: #111827;
}

.welcome-brand span {
  color: #6b7280;
  font-family: Outfit, sans-serif;
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.welcome-container h1 {
  margin: 0 0 12px;
  color: #111827;
  font-family: Outfit, sans-serif;
  font-size: 2.15rem;
  font-weight: 700;
  line-height: 1.1;
  white-space: pre-line;
}

.welcome-intro {
  margin: 0 0 24px;
  color: #6b7280;
  font-size: 1rem;
  line-height: 1.625;
}

.welcome-bullets {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  margin-bottom: 24px;
}

.welcome-bullet {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
}

.welcome-bullet-icon {
  display: flex;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #374151;
  background: #e5e7eb;
}

.welcome-bullet p {
  margin: 0;
  color: #374151;
  font-size: 0.875rem;
  line-height: 1.35;
}

.welcome-footer {
  margin: 0 0 20px;
  color: #9ca3af;
  font-size: 0.875rem;
}

.welcome-start,
.download-button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: #111827;
  color: #ffffff;
  cursor: pointer;
  font-family: Outfit, sans-serif;
  font-weight: 600;
  text-decoration: none;
}

.welcome-start {
  padding: 16px 32px;
}

/* StepLayout + FormFields */
.step-scroll {
  flex: 1;
  overflow-y: auto;
}

.step-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 32px 24px;
}

.step-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 32px;
}

.step-heading h1 {
  margin: 0 0 8px;
  color: #111827;
  font-family: Outfit, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.5;
}

.step-heading p {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.625;
}

.step-form {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.custom-page-text {
  margin: 0 0 20px;
  color: #374151;
  font-size: 0.9375rem;
  line-height: 1.6;
}

.question-block {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.question-block.compact {
  gap: 8px;
}

.question-block label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: #111827;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.35;
  white-space: pre-line;
}

.question-block > label span {
  color: #ef4444;
}

.question-block > label small {
  margin-top: 2px;
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 400;
}

.text-input,
.text-area {
  width: 100%;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  color: #111827;
  font-size: 0.875rem;
  outline: none;
  padding: 12px 16px;
  transition: border-color 150ms ease;
}

.text-area {
  resize: none;
}

.text-input:focus,
.text-area:focus {
  border-color: #111827;
}

.text-input::placeholder,
.text-area::placeholder {
  color: #9ca3af;
}

.step-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 16px;
  flex-shrink: 0;
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
  padding-bottom: 2px;
}

.step-actions p {
  margin: 0;
  color: #9ca3af;
  font-size: 0.75rem;
}

.step-next {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: #e5e7eb;
  color: #111827;
  cursor: pointer;
  font-family: Outfit, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 24px;
  text-decoration: none;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

.step-next:not(:disabled):hover {
  background: #d1d5db;
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.08);
}

.step-next:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.form-card,
.section-card {
  display: flex;
  flex-direction: column;
  gap: 24px;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 24px;
}

.single-select {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.single-select.two-columns {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.single-select label,
.choice-card {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 2px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
  padding: 12px 16px;
  text-align: left;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.single-select label.selected,
.choice-card.selected {
  border-color: #111827;
  background: #f3f4f6;
}

.single-select input,
.choice-card input {
  display: none;
}

.radio-dot,
.choice-dot {
  display: flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border: 2px solid #d1d5db;
  border-radius: 999px;
}

.selected .radio-dot,
.selected .choice-dot {
  border-color: #111827;
  background: #111827;
}

.selected .radio-dot::after,
.selected .choice-dot::after {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: #ffffff;
}

.single-select strong,
.choice-card strong {
  font-size: 0.875rem;
  font-weight: 500;
}

.choice-card strong {
  font-family: Outfit, sans-serif;
}

.solution-toggle {
  display: flex;
  gap: 12px;
}

.solution-toggle .choice-card {
  flex: 1;
  padding: 16px 20px;
  border-radius: 16px;
}

.note-box {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  padding: 16px 20px;
}

.note-box p {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
}

.other-field {
  margin-top: 4px;
  border-color: #9ca3af;
}

.compact-select {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  border-radius: 12px;
}

.compact-chip {
  position: relative;
  display: inline-flex;
  align-items: center;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #374151;
  cursor: pointer;
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 7px 12px;
  transition: border-color 150ms ease, background-color 150ms ease, box-shadow 150ms ease;
  user-select: none;
}

.compact-chip:hover {
  border-color: #4b5563;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.06);
}

.compact-chip input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.compact-chip.is-selected,
.compact-chip.selected {
  border-color: #111827;
  background: #111827;
  color: #ffffff;
  box-shadow: 0 1px 2px rgba(17, 24, 39, 0.1);
}

.compact-other {
  margin-top: 0;
}

/* PrioritizeStep */
.prioritize-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 720px;
}

.drag-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  color: #9ca3af;
  font-size: 0.75rem;
}

.priority-card {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 72px;
  border: 2px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  cursor: grab;
  padding: 16px 22px;
  transition: all 150ms ease;
  user-select: none;
}

.priority-card:active {
  cursor: grabbing;
}

.priority-card.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

.priority-card.top {
  border-color: #111827;
  background: #f3f4f6;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.priority-rank {
  display: flex;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #f3f4f6;
  color: #6b7280;
  font-family: Outfit, sans-serif;
  font-size: 0.875rem;
  font-weight: 700;
}

.priority-card.top .priority-rank {
  background: #111827;
  color: #ffffff;
}

.priority-content {
  min-width: 0;
  flex: 1;
}

.priority-content p {
  margin: 0 0 2px;
  color: #6b7280;
  font-family: Outfit, sans-serif;
  font-size: 0.75rem;
  font-weight: 600;
}

.priority-card.top .priority-content p {
  color: #111827;
}

.priority-content strong {
  display: block;
  overflow: hidden;
  color: #111827;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.priority-content span {
  display: inline-block;
  margin-top: 4px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 10px;
  padding: 2px 8px;
}

.priority-grip {
  color: #d1d5db;
}

/* SummaryStep */
.section-card {
  gap: 0;
}

.section-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.section-card-header h2 {
  margin: 0;
  color: #111827;
  font-family: Outfit, sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.edit-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #6b7280;
  font-size: 0.75rem;
  text-decoration: none;
}

.info-row {
  display: flex;
  flex-direction: column;
  gap: 2px;
  border-bottom: 1px solid #f3f4f6;
  padding: 8px 0;
}

.info-row:last-child {
  border-bottom: 0;
}

.info-row span {
  color: #9ca3af;
  font-size: 0.75rem;
}

.info-row strong {
  color: #111827;
  font-size: 0.875rem;
  font-weight: 400;
  white-space: pre-wrap;
}

.summary-challenge {
  border-bottom: 1px solid #f3f4f6;
  padding: 12px 0;
}

.summary-challenge:last-child {
  border-bottom: 0;
}

.summary-challenge > div:first-child {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 4px;
}

.summary-challenge p {
  margin: 0;
  color: #6b7280;
  font-family: Outfit, sans-serif;
  font-size: 0.75rem;
  font-weight: 500;
}

.summary-challenge strong,
.summary-text {
  color: #111827;
  font-size: 0.875rem;
  font-weight: 400;
}

.summary-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 4px;
}

.summary-tags span {
  display: inline-block;
  border-radius: 999px;
  background: #f3f4f6;
  color: #6b7280;
  font-size: 0.75rem;
  padding: 2px 8px;
}

.summary-muted {
  margin: 0;
  color: #9ca3af;
  font-size: 0.875rem;
  font-style: italic;
}

/* ThankYouStep */
.thankyou-screen {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: #111827;
}

.thankyou-container {
  width: 100%;
  max-width: 32rem;
  text-align: center;
}

.thankyou-icon {
  display: flex;
  width: 64px;
  height: 64px;
  align-items: center;
  justify-content: center;
  margin: 0 auto 24px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.15);
}

.thankyou-container h1 {
  margin: 0 0 16px;
  color: #ffffff;
  font-family: Outfit, sans-serif;
  font-size: 2rem;
  font-weight: 700;
}

.thankyou-container > p {
  margin: 0 0 32px;
  color: rgba(255, 255, 255, 0.75);
  line-height: 1.625;
}

.thankyou-summary {
  margin-bottom: 24px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.1);
  padding: 24px;
  text-align: left;
}

.thankyou-summary p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.6);
  font-family: Outfit, sans-serif;
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.thankyou-summary div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  font-size: 0.875rem;
}

.thankyou-summary span {
  color: rgba(255, 255, 255, 0.6);
}

.thankyou-summary strong {
  color: #ffffff;
  font-weight: 500;
}

.download-button {
  justify-content: center;
  width: 100%;
  padding: 16px 32px;
  background: #ffffff;
  color: #111827;
  box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

/* ChallengeStep */
.challenge-form {
  margin: 0;
}

.challenge-page {
  display: flex;
  min-height: calc(100vh - 101px);
  flex: 1;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
  padding-bottom: 72px;
  background: #ffffff;
}

.challenge-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding-bottom: 48px;
}

.challenge-container {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  padding: 20px 24px 28px;
}

.challenge-titlebar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.challenge-titlebar h1 {
  margin: 0;
  color: #111827;
  font-family: Outfit, sans-serif;
  font-size: 1.6rem;
  font-weight: 700;
  line-height: 1.25;
}

.challenge-titlebar p {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.6;
}

.challenge-continue {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 12px;
  background: #e5e7eb;
  color: #111827;
  cursor: pointer;
  font-family: Outfit, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 24px;
  transition: background-color 150ms ease, box-shadow 150ms ease;
}

.challenge-continue:not(:disabled):hover {
  background: #d1d5db;
  box-shadow: 0 4px 10px rgba(17, 24, 39, 0.08);
}

.challenge-continue:disabled {
  background: #f3f4f6;
  color: #9ca3af;
  cursor: not-allowed;
}

.challenge-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  overflow-x: auto;
  margin-bottom: 16px;
  padding-bottom: 2px;
}

.challenge-tab,
.challenge-add {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
  border-radius: 12px;
  font-family: Outfit, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  padding: 8px 16px;
  text-decoration: none;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.challenge-tab {
  border: 1px solid #e5e7eb;
  color: #6b7280;
  background: #ffffff;
  cursor: pointer;
}

.challenge-tab.is-active {
  border-color: #111827;
  color: #ffffff;
  background: #111827;
}

.challenge-add {
  border: 2px solid #e5e7eb;
  color: #111827;
  background: #e5e7eb;
  cursor: pointer;
}

.challenge-add span {
  font-size: 1rem;
  line-height: 1;
}

.challenge-card {
  display: flex;
  flex-direction: column;
  gap: 30px;
  overflow: visible;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
  padding: 20px;
}

.challenge-sticky-question {
  position: sticky;
  top: 0;
  z-index: 10;
  margin: -20px -20px 0;
  border-bottom: 1px solid transparent;
  border-radius: 16px 16px 0 0;
  background: #ffffff;
  padding: 20px 20px 12px;
}

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

.data-known-row .compact-chip {
  justify-content: center;
  min-width: 160px;
}

.challenge-footer {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 40;
  border-top: 1px solid #e5e7eb;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(4px);
}

.challenge-footer-inner {
  display: flex;
  min-height: 76px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  padding: 12px 24px;
}

.challenge-mini {
  display: flex;
  min-width: 0;
  height: 52px;
  flex: 1 1 0;
  max-width: 220px;
  align-items: center;
  gap: 8px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  color: #6b7280;
  background: #ffffff;
  padding: 6px 10px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
  transition: border-color 150ms ease, background-color 150ms ease, color 150ms ease;
}

.challenge-mini.is-active {
  border-color: #111827;
  color: #ffffff;
  background: #111827;
}

.challenge-mini.is-active .mini-progress {
  color: #111827;
  background: conic-gradient(#ffffff calc(var(--progress) * 1%), rgba(255, 255, 255, 0.22) 0);
}

.mini-progress {
  display: flex;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: conic-gradient(#111827 calc(var(--progress) * 1%), rgba(156, 163, 175, 0.2) 0);
  color: #111827;
}

.mini-progress span {
  display: flex;
  width: 24px;
  height: 24px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: #ffffff;
  font-size: 9px;
  font-weight: 600;
}

.mini-content {
  min-width: 0;
  flex: 1;
}

.mini-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 11px;
  line-height: 1.2;
}

.mini-title > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-title strong {
  flex-shrink: 0;
  font-family: Outfit, sans-serif;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.06em;
  opacity: 0.6;
  text-transform: uppercase;
}

.mini-details {
  display: block;
  overflow: hidden;
  margin-top: 2px;
  font-size: 9px;
  line-height: 1.2;
  opacity: 0.5;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hidden-form {
  display: none;
}

.alert {
  max-width: 48rem;
  margin: 16px auto;
  border: 1px solid #fecaca;
  border-radius: 12px;
  background: #fef2f2;
  color: #7f1d1d;
  padding: 16px;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

.modal-overlay[hidden] {
  display: none;
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 24rem;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
  padding: 32px;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: flex;
  width: 28px;
  height: 28px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #9ca3af;
  cursor: pointer;
  font-size: 20px;
  line-height: 1;
}

.modal-close:hover {
  color: #111827;
  background: #f3f4f6;
}

.modal-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.modal-icon {
  display: flex;
  width: 56px;
  height: 56px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #374151;
  background: #f3f4f6;
}

.modal-content h3 {
  margin: 0;
  color: #111827;
  font-family: Outfit, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-content p {
  margin: 0;
  color: #6b7280;
  font-size: 0.875rem;
  line-height: 1.6;
}

.modal-actions {
  display: flex;
  width: 100%;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.modal-primary,
.modal-secondary {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  cursor: pointer;
  font-family: Outfit, sans-serif;
  font-weight: 600;
  padding: 12px 16px;
  text-decoration: none;
}

.modal-primary {
  border: 0;
  color: #ffffff;
  background: #111827;
}

.modal-primary.muted {
  color: #111827;
  background: #e5e7eb;
}

.modal-secondary {
  border: 2px solid #e5e7eb;
  color: #374151;
  background: #ffffff;
}

/* Admin */
.admin-body {
  min-height: 100vh;
  background: #f9fafb;
}

.admin-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  border-bottom: 1px solid #e5e7eb;
  background: #ffffff;
  padding: 14px 32px;
}

.admin-brand {
  color: #111827;
  font-family: Outfit, sans-serif;
  font-weight: 700;
  text-decoration: none;
}

.admin-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}

.admin-nav a,
.admin-link-button {
  border: 0;
  background: transparent;
  color: #4b5563;
  cursor: pointer;
  font-size: 0.875rem;
  text-decoration: none;
}

.admin-muted {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 400;
}

.admin-main {
  max-width: 1120px;
  margin: 0 auto;
  padding: 32px;
}

.admin-page-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.admin-page-title h1,
.admin-card h1,
.admin-form h2 {
  margin: 0;
  color: #111827;
  font-family: Outfit, sans-serif;
}

.admin-form h2 {
  margin-top: 28px;
  font-size: 1.1rem;
}

.admin-card,
.admin-table {
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.admin-card {
  margin-bottom: 16px;
  padding: 20px;
}

.admin-login {
  max-width: 420px;
  margin: 80px auto;
}

.admin-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

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

.admin-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  color: #374151;
  font-size: 0.875rem;
  font-weight: 600;
}

.admin-checkbox {
  flex-direction: row !important;
  align-items: center;
}

.admin-input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #ffffff;
  color: #111827;
  padding: 10px 12px;
}

.admin-code-input {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.85rem;
}

.admin-button,
.admin-small-button,
.admin-secondary-button,
.admin-remove-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  text-decoration: none;
}

.admin-button,
.admin-small-button {
  border: 0;
  background: #111827;
  color: #ffffff;
}

.admin-button {
  padding: 10px 18px;
}

.admin-small-button {
  padding: 7px 10px;
  font-size: 0.8rem;
}

.admin-secondary-button,
.admin-remove-button {
  border: 1px solid #d1d5db;
  background: #ffffff;
  color: #374151;
  padding: 9px 14px;
}

.admin-remove-button {
  width: fit-content;
  border-color: #fecaca;
  color: #991b1b;
}

.admin-form-actions,
.admin-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-form-actions {
  justify-content: flex-end;
  margin-top: 8px;
}

.admin-section-title-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.admin-dynamic-list {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.admin-dynamic-row {
  display: flex;
  flex-direction: column;
  gap: 12px;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #f9fafb;
  padding: 16px;
}

.admin-dynamic-row[hidden] {
  display: none;
}

[data-admin-items] > .admin-dynamic-row.is-dragging {
  opacity: 0.45;
  transform: scale(0.98);
}

[data-admin-items] > .admin-dynamic-row {
  transition: transform 0.15s ease;
}

.admin-text-row-label {
  margin: 0;
  color: #111827;
  font-size: 0.875rem;
  font-weight: 700;
}

.admin-drag-handle {
  display: flex;
  align-items: center;
  gap: 6px;
  align-self: flex-start;
  color: #9ca3af;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.02em;
  cursor: grab;
  user-select: none;
}

.admin-drag-handle:active {
  cursor: grabbing;
}

.admin-row-kind {
  border-radius: 999px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.admin-row-kind-text {
  background: #ede9fe;
  color: #6d28d9;
}

.admin-row-kind-field {
  background: #dbeafe;
  color: #1d4ed8;
}

.admin-locale-tabs {
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #ffffff;
  overflow: hidden;
}

.admin-locale-tab-buttons {
  display: flex;
  gap: 2px;
  background: #f3f4f6;
  padding: 4px;
}

.admin-locale-tab-button {
  flex: 1;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #6b7280;
  font-weight: 600;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  padding: 6px 10px;
  cursor: pointer;
}

.admin-locale-tab-button.is-active {
  background: #ffffff;
  color: #111827;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
}

.admin-locale-tab-panel {
  padding: 12px;
}

.admin-locale-tab-panel[hidden] {
  display: none;
}

.admin-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
}

.admin-table th,
.admin-table td {
  border-bottom: 1px solid #e5e7eb;
  padding: 12px 14px;
  text-align: left;
}

.admin-table th {
  background: #f3f4f6;
  color: #4b5563;
  font-size: 0.75rem;
  text-transform: uppercase;
}

.admin-table tr:last-child td {
  border-bottom: 0;
}

.admin-table-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.admin-flash {
  max-width: 1120px;
  margin: 16px auto 0;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  background: #f0fdf4;
  color: #166534;
  padding: 10px 14px;
}

.admin-flash-alert {
  border-color: #fecaca;
  background: #fef2f2;
  color: #991b1b;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.admin-stat-label {
  color: #6b7280;
  font-size: 0.85rem;
  font-weight: 700;
}

.admin-stat-value {
  margin-top: 4px;
  color: #111827;
  font-family: Outfit, sans-serif;
  font-size: 2rem;
  font-weight: 800;
}

.admin-log-list {
  margin-top: 12px;
  border-top: 1px solid #f3f4f6;
}

.admin-log-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid #f3f4f6;
  padding: 12px 0;
  font-size: 0.9rem;
}

.admin-log-row span,
.admin-log-row time {
  color: #6b7280;
}

.admin-danger-button {
  background: #991b1b;
}

@media (max-width: 900px) {
  .progress-top,
  .progress-actions,
  .welcome-header,
  .step-heading,
  .challenge-titlebar,
  .solution-toggle,
  .step-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .step-of {
    display: none;
  }

  .single-select.two-columns,
  .admin-grid,
  .admin-stats {
    grid-template-columns: 1fr;
  }

  .progress-logo,
  .welcome-logo {
    max-width: 220px;
  }

  .step-container,
  .challenge-container {
    padding-right: 16px;
    padding-left: 16px;
  }

  .challenge-footer-inner {
    justify-content: flex-start;
  }

  .challenge-mini {
    flex: 0 0 220px;
    max-width: 220px;
  }

  .data-known-row .compact-chip {
    flex: 1 1 100%;
  }
}
