.mat-root {
  display: grid;
  gap: 18px;
}

.mat-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.mat-seg {
  display: inline-flex;
  align-items: center;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  padding: 3px;
  gap: 2px;
}

.mat-seg-btn {
  min-height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--muted);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.mat-seg-btn[aria-pressed="true"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

.mat-age-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  padding: 3px 4px 3px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.mat-age-input {
  width: 56px;
  height: 32px;
  padding: 0 8px;
  text-align: center;
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  -moz-appearance: textfield;
}

.mat-age-input::placeholder {
  color: var(--muted);
  opacity: 0.8;
}

.mat-age-input::-webkit-outer-spin-button,
.mat-age-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.mat-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.mat-step-num {
  font-family: var(--font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.mat-axis-badge {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  white-space: nowrap;
}

.mat-track {
  width: 100%;
  height: 4px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.mat-fill {
  width: 100%;
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
  transform-origin: left center;
  transform: scaleX(0.083);
  transition: transform 0.3s var(--ease-spring);
}

@keyframes matSlideIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mat-stage.is-animating {
  animation: matSlideIn 0.24s var(--ease-spring);
}

.mat-stage {
  display: grid;
  gap: 16px;
}

.mat-question {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.35;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.mat-choices {
  display: grid;
  gap: 10px;
}

.mat-choice {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  text-align: left;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  color: var(--ink);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  cursor: pointer;
  transition: border-color 0.16s ease, background-color 0.16s ease, box-shadow 0.16s ease, transform 0.14s var(--ease-spring);
}

.mat-choice:hover {
  border-color: var(--accent);
  background: var(--surface);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.mat-choice:active {
  transform: scale(0.985);
}

.mat-choice.is-picked {
  border-color: var(--accent);
  background: var(--accent-soft);
}

.mat-keycap {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  transition: background-color 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.mat-choice:hover .mat-keycap,
.mat-choice.is-picked .mat-keycap {
  background: #047857;
  border-color: #047857;
  color: #ffffff;
}

.mat-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 4px;
}

.mat-ghost-btn {
  background: transparent;
  border: none;
  padding: 6px 0;
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.15s ease;
}

.mat-ghost-btn:hover:not(:disabled) {
  color: var(--ink);
}

.mat-ghost-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.mat-kbd {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
}

.mat-result {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 28px;
  align-items: start;
  animation: matSlideIn 0.32s var(--ease-spring);
}

.mat-dial-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-card);
  padding: 20px 16px;
  display: grid;
  justify-items: center;
  gap: 12px;
  text-align: center;
}

.mat-dial-svg {
  width: 212px;
  height: 212px;
}

.mat-gap-pill {
  display: inline-block;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  background: var(--accent-soft);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}

.mat-legend {
  display: flex;
  justify-content: center;
  gap: 14px;
  font-size: 12px;
  color: var(--muted);
}

.mat-swatch {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 5px;
  vertical-align: middle;
}

.mat-swatch-m { background: var(--accent); }
.mat-swatch-r { background: var(--ink); }

.mat-result-main {
  display: grid;
  gap: 20px;
}

.mat-band-tag {
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}

.mat-arch-title {
  margin: 0 0 6px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--ink);
}

.mat-arch-copy {
  margin: 0;
  font-size: 15px;
  color: var(--muted);
}

.mat-axes-grid {
  display: grid;
  gap: 12px;
}

.mat-axis-item {
  display: grid;
  gap: 6px;
}

.mat-axis-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 14px;
  font-weight: 600;
  color: var(--ink);
}

.mat-axis-val {
  font-family: var(--font-mono);
  font-size: 13px;
  color: var(--accent);
}

.mat-axis-line {
  height: 5px;
  background: var(--surface-2);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.mat-axis-bar {
  height: 100%;
  background: var(--accent);
  border-radius: var(--radius-pill);
}

.mat-notes {
  margin: 0;
  padding: 14px 16px 14px 30px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-ctrl);
  display: grid;
  gap: 6px;
  font-size: 14px;
  color: var(--muted);
}

.mat-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.mat-feedback {
  margin: 0;
  min-height: 20px;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
}

.mat-fineprint {
  margin: 0;
  font-size: 12px;
  color: var(--muted);
}

@media (max-width: 720px) {
  .mat-result {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

@media (max-width: 640px) {
  .mat-root {
    gap: 14px;
  }

  .mat-toolbar {
    padding-bottom: 12px;
  }

  .mat-seg-btn {
    padding: 0 10px;
    font-size: 12px;
  }

  .mat-age-pill {
    padding: 2px 3px 2px 10px;
    font-size: 12px;
  }

  .mat-age-input {
    width: 48px;
    height: 30px;
    font-size: 13px;
  }

  .mat-question {
    font-size: 18px;
    line-height: 1.35;
  }

  .mat-choices {
    gap: 8px;
  }

  .mat-choice {
    padding: 11px 12px;
    font-size: 14px;
    min-height: 46px;
  }

  .mat-kbd {
    display: none;
  }

  .mat-actions > * {
    width: 100%;
  }
}