:root {
  --primary: #2e2340;
  --primary-dark: #1d1629;
  --accent: #f28d2c;
}

.skills-intro,
.skills-summary {
  display: grid;
  gap: 20px;
  padding: 20px;
}

.skills-intro h2,
.skills-summary h2 {
  margin: 0;
  font-size: 1.65rem;
  line-height: 1.2;
}

.skills-intro p,
.email-panel p {
  margin: 0;
}

.answer-scale {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.scale-item {
  --tone: #7a8494;
  display: grid;
  grid-template-columns: 42px 1fr;
  align-items: stretch;
  overflow: hidden;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-left: 7px solid var(--tone);
  border-radius: 8px;
}

.scale-item > span {
  display: grid;
  place-items: center;
  padding: 8px;
  color: #fff;
  background: var(--tone);
  font-weight: 800;
}

.scale-item strong {
  padding: 8px 12px;
}

.tone-1,
.answer-option.tone-1 { --tone: #d92d20; --tone-bg: #fff1f0; }
.tone-2,
.answer-option.tone-2 { --tone: #f59c76; --tone-bg: #fff4ee; }
.tone-3,
.answer-option.tone-3 { --tone: #7a8494; --tone-bg: #f1f3f5; }
.tone-4,
.answer-option.tone-4 { --tone: #8bcf3f; --tone-bg: #f0fbe7; }
.tone-5,
.answer-option.tone-5 { --tone: #2f9e44; --tone-bg: #eaf8ed; }

.scale-item.tone-2 > span {
  color: #18202b;
}

.scale-item.tone-4 > span {
  color: #18202b;
}

.privacy-note {
  display: grid;
  gap: 5px;
  padding: 14px 16px;
  background: #fff8f1;
  border-left: 6px solid var(--accent);
  border-radius: 6px;
}

.privacy-note span,
.saved-progress,
.form-hint,
.review-note {
  color: var(--muted);
}

.intro-actions {
  display: grid;
  gap: 10px;
}

.skills-answer-list {
  display: grid;
  gap: 10px;
}

.summary-question-meta {
  color: var(--muted);
  font-size: .86rem;
}

.skills-summary .summary-stats {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 0;
}

.summary-filter {
  padding-top: 4px;
}

.skills-summary-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
  padding: 13px;
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.skills-summary-row.missing {
  background: #fff8f1;
  border-color: #f3c99f;
}

.skills-summary-row > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.skills-summary-row button {
  min-height: 40px;
}

.all-complete {
  margin: 0;
  padding: 14px;
  color: var(--muted);
  text-align: center;
  background: #f8fafc;
  border-radius: 8px;
}

.email-panel {
  display: grid;
  gap: 10px;
  margin-top: 4px;
  padding: 18px;
  background: #fff8f1;
  border: 1px solid #f3c99f;
  border-radius: 8px;
}

.email-panel h3 {
  margin: 0;
  font-size: 1.2rem;
}

.email-form {
  display: grid;
  gap: 8px;
}

.email-form label {
  font-weight: 700;
}

.email-actions {
  display: grid;
  gap: 10px;
}

.email-actions input {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
}

.email-actions input:focus {
  border-color: var(--primary);
  outline: 3px solid rgba(46, 35, 64, .18);
}

.form-error {
  margin: 0;
  padding: 10px 12px;
  color: #8f1d18;
  background: #fff1f0;
  border: 1px solid #f3aaa5;
  border-radius: 6px;
}

.sending-overlay {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(18, 24, 33, .72);
}

.sending-overlay[hidden] {
  display: none;
}

.sending-dialog {
  display: grid;
  justify-items: center;
  gap: 10px;
  width: min(100%, 390px);
  padding: 28px;
  text-align: center;
  background: #fff;
  border-top: 7px solid var(--accent);
  border-radius: 8px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, .25);
}

.sending-dialog span:last-child {
  color: var(--muted);
}

.sending-spinner {
  width: 42px;
  height: 42px;
  border: 5px solid #e4e7ec;
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: skills-spin .85s linear infinite;
}

.is-sending {
  overflow: hidden;
}

.success-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.success-mark {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  color: #fff;
  background: #167847;
  border-radius: 50%;
  font-size: 2rem;
  font-weight: 800;
}

@keyframes skills-spin {
  to { transform: rotate(360deg); }
}

@media (min-width: 720px) {
  .skills-intro,
  .skills-summary {
    padding: 30px;
  }

  .email-actions {
    grid-template-columns: minmax(240px, 1fr) auto;
  }

  .intro-actions {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 560px) {
  .skills-intro,
  .skills-summary {
    gap: 16px;
    padding: 17px;
  }

  .skills-intro h2,
  .skills-summary h2 {
    font-size: 1.4rem;
  }

  .skills-summary-row {
    grid-template-columns: 1fr;
  }

  .skills-summary-row button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sending-spinner { animation-duration: 1.8s; }
}
