#diagnostic-dialog {
  color: var(--ink);
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 22px 72px #281a204d;
  padding: 0;
  width: min(100% - 28px, 660px);
  max-height: calc(100vh - 28px);
  max-height: calc(100dvh - 28px);
}

#diagnostic-dialog::backdrop {
  background: #281a2082;
}

.diagnostic-header,
.diagnostic-body,
.diagnostic-footer {
  padding-inline: clamp(17px, 5vw, 34px);
}

.diagnostic-header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 12px;
  background: var(--sand);
  padding-block: 22px 18px;
}

.diagnostic-header h2 {
  margin-block-start: 4px;
  color: var(--brand);
  font-size: clamp(1.5rem, 4vw, 2.2rem);
  line-height: 1.12;
  letter-spacing: -.03em;
}

.diagnostic-header h2:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 5px;
}

.diagnostic-close.button {
  padding: 0;
  flex: 0 0 44px;
  min-height: 44px;
  font-size: 1.6rem;
  line-height: 1;
}

.diagnostic-progress {
  display: block;
  appearance: none;
  width: 100%;
  height: 5px;
  border: 0;
  color: var(--rose);
  background: var(--pale-rose);
}

.diagnostic-progress::-webkit-progress-bar { background: var(--pale-rose); }
.diagnostic-progress::-webkit-progress-value { background: var(--rose); }
.diagnostic-progress::-moz-progress-bar { background: var(--rose); }

.diagnostic-body {
  padding-block: 21px 24px;
  line-height: 1.55;
}

.diagnostic-choices {
  min-width: 0;
  border: 0;
  margin: 15px 0 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.diagnostic-choices:first-child { margin-top: 0; }

.diagnostic-choices legend {
  margin-bottom: 12px;
  padding: 0;
  font-weight: 700;
}

.diagnostic-choice {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  align-items: start;
  gap: 12px;
  min-height: 48px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  cursor: pointer;
}

.diagnostic-choice:hover,
.diagnostic-choice:has(input:checked) {
  background: var(--pale-rose);
  border-color: var(--rose);
}

.diagnostic-choice:focus-within {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.diagnostic-choice input {
  accent-color: var(--brand);
  margin: .29rem 0 0;
  inline-size: 16px;
  block-size: 16px;
}

.diagnostic-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
  border-top: 1px solid var(--line);
  padding-block: 14px 18px;
}

.diagnostic-footer .button { font-size: .875rem; }
.diagnostic-footer .diagnostic-skip { margin-inline-end: auto; }

.diagnostic-suggestion {
  margin-block: 16px;
  padding: 17px;
  border-inline-start: 3px solid var(--gold);
  border-radius: 0 13px 13px 0;
  background: var(--sand);
}

.diagnostic-suggestion h3 {
  margin-block: 4px;
  color: var(--brand);
  font-size: 1.2rem;
}

.diagnostic-review {
  font-size: .94rem;
}

.diagnostic-review summary {
  display: list-item;
  padding-block: 5px;
  cursor: pointer;
  color: var(--brand);
  font-weight: 700;
}

.diagnostic-review ol {
  padding-inline-start: 23px;
  margin-bottom: 0;
}

.diagnostic-review li {
  padding-block: 12px;
  border-top: 1px solid var(--line);
}

.diagnostic-review p + p { margin-top: 5px; }
.diagnostic-review-label { font-weight: 700; }

@media (max-width: 520px) {
  #diagnostic-dialog {
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: 100%;
    margin: 0;
    border-radius: 0;
  }

  #diagnostic-content {
    min-height: 100%;
    display: flex;
    flex-direction: column;
  }

  .diagnostic-footer {
    margin-top: auto;
  }

  .diagnostic-footer .button {
    flex: 1 1 auto;
  }
}
