/* Shared diagnostic runtime — calm editorial worksheet, light-first and theme-aware. */
.play-diagnostic {
  width: min(1040px, calc(100% - 32px));
  margin: 0 auto;
  padding: 40px 0 96px;
  color: var(--play-text);
  font-family: "Pretendard", "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  line-height: 1.65;
}

.play-diagnostic [hidden] { display: none !important; }
.play-diagnostic * { box-sizing: border-box; }

.pd-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.pd-eyebrow,
.pd-card__kicker {
  margin: 0;
  color: var(--play-accent-ink);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.pd-intro,
.pd-quiz,
.pd-loading,
.pd-result {
  border: 1px solid var(--play-border-strong);
  background: var(--play-surface-solid);
  box-shadow: 10px 10px 0 rgba(16, 19, 29, 0.1);
}

html[data-theme="dark"] .pd-intro,
html[data-theme="dark"] .pd-quiz,
html[data-theme="dark"] .pd-loading,
html[data-theme="dark"] .pd-result {
  box-shadow: 10px 10px 0 rgba(0, 0, 0, 0.34);
}

.pd-intro {
  position: relative;
  min-height: 610px;
  padding: clamp(38px, 7vw, 84px);
  overflow: hidden;
  isolation: isolate;
}

.pd-intro::before,
.pd-intro::after {
  content: "";
  position: absolute;
  z-index: -1;
  pointer-events: none;
}

.pd-intro::before {
  width: 420px;
  height: 420px;
  right: -190px;
  top: -190px;
  border: 1px solid var(--play-accent);
  border-radius: 50%;
}

.pd-intro::after {
  width: 1px;
  height: 100%;
  left: 34%;
  top: 0;
  background: var(--play-border);
  opacity: 0.45;
}

.pd-intro__marker,
.pd-result__icon {
  display: grid;
  width: 62px;
  height: 62px;
  place-items: center;
  margin-bottom: 34px;
  border: 1px solid var(--play-accent);
  border-radius: 50%;
  color: var(--play-accent-ink);
  background: var(--play-surface-solid);
}

.pd-intro__marker svg,
.pd-result__icon svg { width: 27px; height: 27px; }

.pd-intro h1 {
  max-width: 800px;
  margin: 18px 0 20px;
  font-size: clamp(42px, 6.4vw, 76px);
  font-weight: 950;
  letter-spacing: -0.055em;
  line-height: 1.04;
  text-wrap: balance;
}

.pd-intro__lead {
  max-width: 620px;
  margin: 0 0 26px;
  color: var(--play-muted);
  font-size: clamp(16px, 2vw, 19px);
}

.pd-duration {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}

.pd-duration > * {
  min-height: 34px;
  padding: 6px 12px;
  border: 1px solid var(--play-border);
  border-radius: 999px;
  background: var(--play-chip-bg);
  font-size: 13px;
}

.pd-duration strong {
  border-color: var(--play-text);
  color: var(--play-surface-solid);
  background: var(--play-text);
}

.pd-axis-list {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  padding: 0;
  margin: 0 0 38px;
  list-style: none;
}

.pd-axis-list li {
  color: var(--play-muted);
  font-size: 13px;
  font-weight: 750;
}

.pd-axis-list li:not(:last-child)::after {
  content: " /";
  color: var(--play-accent-ink);
}

.pd-button {
  display: inline-flex;
  min-height: 48px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border: 1px solid var(--play-border-strong);
  border-radius: 4px;
  color: var(--play-text);
  background: var(--play-surface-solid);
  font: inherit;
  font-size: 14px;
  font-weight: 850;
  text-decoration: none;
  cursor: pointer;
  transition: transform 160ms ease, background-color 160ms ease, color 160ms ease, box-shadow 160ms ease;
}

.pd-button:focus-visible,
.pd-option:focus-visible,
.pd-feedback__choices button:focus-visible,
.pd-evidence summary:focus-visible {
  outline: 3px solid var(--play-accent-fill);
  outline-offset: 3px;
}

.pd-button:disabled { cursor: not-allowed; opacity: 0.45; }
.pd-button svg { width: 17px; height: 17px; }

.pd-button--primary {
  border-color: var(--play-accent-solid);
  color: var(--play-on-accent);
  background: var(--play-accent-fill);
  box-shadow: 5px 5px 0 var(--play-warm);
}

.pd-button--link { border-color: transparent; text-decoration: underline; text-underline-offset: 4px; }

.pd-disclaimer {
  max-width: 660px;
  margin: 22px 0 0;
  color: var(--play-muted);
  font-size: 12px;
}

.pd-quiz { padding: clamp(24px, 5vw, 58px); }

.pd-quiz__header {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--play-border);
}

.pd-quiz__hint { margin: 4px 0 0; color: var(--play-muted); font-size: 13px; }
.pd-quiz__header > strong { font-size: 18px; font-variant-numeric: tabular-nums; }

.pd-progress {
  height: 4px;
  margin: 0 0 clamp(38px, 7vw, 72px);
  overflow: hidden;
  background: var(--play-surface-2);
}

.pd-progress span {
  display: block;
  width: 100%;
  height: 100%;
  background: var(--play-accent-fill);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 200ms cubic-bezier(.23, 1, .32, 1);
}

.pd-progress span.is-progress-static { transition: none; }

.pd-question { min-width: 0; padding: 0; margin: 0; border: 0; }
.pd-question h2 {
  max-width: 860px;
  min-height: 2.5em;
  margin: 0 0 36px;
  font-size: clamp(30px, 5vw, 52px);
  font-weight: 950;
  letter-spacing: -0.045em;
  line-height: 1.16;
  text-wrap: balance;
}

.pd-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pd-option {
  position: relative;
  min-height: 82px;
  padding: 18px 52px 18px 20px;
  border: 1px solid var(--play-border-strong);
  border-radius: 4px;
  color: var(--play-text);
  background: var(--play-surface-solid);
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  line-height: 1.45;
  text-align: left;
  cursor: pointer;
  transition: border-color 160ms ease, background-color 160ms ease, transform 160ms ease;
}

.pd-option::after {
  content: "";
  position: absolute;
  width: 17px;
  height: 17px;
  right: 19px;
  top: 50%;
  border: 1px solid var(--play-border-strong);
  border-radius: 50%;
  transform: translateY(-50%);
}

.pd-option.is-selected { border-color: var(--play-accent); background: var(--play-accent-soft); }
.pd-option.is-selected::after { border: 5px solid var(--play-accent-fill); background: var(--play-text); }

.pd-actions,
.pd-result__actions {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 34px;
}
.pd-share-status { min-height: 1.5em; margin: 10px 0 0; color: var(--play-muted); font-size: 12px; text-align: right; }

.pd-loading {
  display: grid;
  min-height: 440px;
  place-items: center;
  align-content: center;
  gap: 18px;
  padding: 48px;
  text-align: center;
}

.pd-loader {
  width: 48px;
  height: 48px;
  border: 2px solid var(--play-border);
  border-top-color: var(--play-accent-ink);
  border-radius: 50%;
  animation: pd-spin 900ms linear infinite;
}

@keyframes pd-spin { to { transform: rotate(360deg); } }

.pd-result { padding: clamp(24px, 5.5vw, 64px); }
.pd-result__hero {
  position: relative;
  min-height: 420px;
  padding: clamp(22px, 5vw, 54px);
  border: 1px solid var(--play-accent);
  background: var(--play-surface-solid);
  overflow: hidden;
}

.pd-result__hero::after {
  content: "";
  position: absolute;
  width: 300px;
  height: 300px;
  right: -120px;
  bottom: -160px;
  border: 1px solid var(--play-accent);
  border-radius: 50%;
}

.pd-result__hero h1 {
  position: relative;
  z-index: 1;
  max-width: 780px;
  margin: 18px 0 8px;
  font-size: clamp(46px, 7vw, 82px);
  font-weight: 950;
  letter-spacing: -0.06em;
  line-height: 1;
}

.pd-result__label { margin: 0 0 26px; color: var(--play-accent-ink); font-weight: 850; font-size: 18px; }
.pd-result__summary { position: relative; z-index: 1; max-width: 680px; margin: 0; color: var(--play-muted); font-size: 17px; }
.pd-result__secondary { display: inline-flex; margin: 24px 0 0; padding: 7px 12px; border-radius: 999px; background: var(--play-accent-soft); font-size: 13px; font-weight: 800; }

.pd-result__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.pd-card {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--play-border);
  background: var(--play-surface-solid);
}

.pd-card--wide { grid-column: 1 / -1; }
.pd-card--action { border-color: var(--play-accent); background: var(--play-accent-soft); }
.pd-card h2 { margin: 8px 0 14px; font-size: 22px; letter-spacing: -0.03em; }
.pd-card p:last-child { margin-bottom: 0; color: var(--play-muted); }

.pd-evidence { margin-top: 12px; }
.pd-evidence summary { cursor: pointer; font-size: 16px; font-weight: 900; }
.pd-evidence #evidenceList { display: grid; gap: 10px; margin-top: 22px; }
.pd-evidence article { padding-top: 14px; border-top: 1px solid var(--play-border); }
.pd-evidence article strong { color: var(--play-accent-ink); }
.pd-evidence article p { margin: 4px 0 0; }

.pd-feedback { margin-top: 12px; }
.pd-feedback__choices { display: flex; flex-wrap: wrap; gap: 8px; margin: 20px 0 16px; }
.pd-feedback__choices button {
  min-height: 44px;
  padding: 9px 15px;
  border: 1px solid var(--play-border);
  border-radius: 999px;
  color: var(--play-text);
  background: var(--play-surface-solid);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}
.pd-feedback__choices button.is-selected { border-color: var(--play-text); color: var(--play-surface-solid); background: var(--play-text); }
.play-diagnostic #feedbackStatus { min-height: 1.6em; margin: 12px 0 0; font-size: 13px; }
.play-diagnostic :is(h1, h2, [role="status"]) { scroll-margin-top: 112px; }

@media (hover: hover) and (pointer: fine) {
  .pd-button:hover:not(:disabled):not(:focus-visible) { transform: translateY(-2px); }
  .pd-button:active:not(:disabled):not(:focus-visible) { transform: translateY(1px); }
  .pd-button--quiet:hover:not(:disabled) { background: var(--play-surface-2); }
  .pd-option:hover:not(:focus-visible) { transform: translateY(-1px); border-color: var(--play-text); }
}

/* The site bottom navigation is fixed through tablet widths (<=1024px).
   Keep the active quiz controls in their own fixed lane above it and reserve
   matching space in the quiz so the final option can never sit underneath. */
@media (max-width: 1024px) {
  .pd-quiz { padding-bottom: calc(102px + env(safe-area-inset-bottom)); }
  .pd-actions {
    position: fixed;
    left: 50%;
    right: auto;
    bottom: calc(78px + env(safe-area-inset-bottom));
    z-index: 1100;
    width: min(900px, calc(100vw - 40px));
    padding: 10px;
    border: 1px solid var(--play-border);
    background: var(--play-surface);
    backdrop-filter: blur(12px);
    transform: translateX(-50%);
  }
}

@media (max-width: 720px) {
  .play-diagnostic { width: min(100% - 20px, 1040px); padding: 18px 0 72px; }
  .pd-intro,
  .pd-quiz,
  .pd-result { box-shadow: 5px 5px 0 rgba(16, 19, 29, 0.1); }
  .pd-intro { min-height: 560px; padding: 30px 22px 36px; }
  .pd-intro::after { display: none; }
  .pd-intro h1 { font-size: clamp(39px, 13vw, 58px); }
  .pd-options,
  .pd-result__grid { grid-template-columns: 1fr; }
  .pd-card--wide { grid-column: auto; }
  .pd-question h2 { min-height: 0; font-size: clamp(29px, 9vw, 42px); }
  .pd-option { min-height: 68px; padding: 14px 46px 14px 16px; }
  .pd-result__hero { min-height: 380px; padding: 28px 22px; }
  .pd-result__hero h1 { font-size: clamp(44px, 15vw, 66px); }
  .pd-result__actions { flex-direction: column; }
  .pd-result__actions .pd-button { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-button,
  .pd-option,
  .pd-progress span { transition: none; }
  .pd-loader { animation-duration: 2s; }
}
