:root {
  --pd-blue: #a5aeb9;
  --pd-blue-dark: #80878f;
  --pd-yellow: #caa53b;
  --pd-yellow-dark: #a88522;
  --pd-ink: #6a6a6a;
  --pd-muted: #6a6a6a;
  --pd-rule: #d9dde2;
  --pd-soft: #f7f5ef;
  --pd-white: #fff;
  --pd-good: #23724a;
  --pd-bad: #b5473f;
  --pd-focus: #ffdd00;
  --pd-rail-width: 0px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body.pd-legal-detective {
  margin: 0;
  color: var(--pd-ink);
  background: var(--pd-white);
  font-family: "IBM Plex Sans", Arial, sans-serif;
  font-size: 19px;
  line-height: 1.32;
}

.pd-detective-topbar,
.pd-detective-breadcrumbs,
.pd-legal-detective > main,
.pd-detective-footer {
  margin-left: var(--pd-rail-width);
}

.pd-detective-topbar {
  border-bottom: 1px solid var(--pd-rule);
  background: var(--pd-white);
}

.pd-detective-topbar-inner,
.pd-detective-wrap {
  width: min(100% - 64px, 1480px);
  margin-inline: auto;
}

.pd-detective-topbar-inner {
  width: 100%;
  max-width: none;
  min-height: 80px;
  padding-inline: 48px;
  display: flex;
  align-items: center;
  gap: 42px;
}

.pd-detective-brand {
  display: block;
  flex: 0 0 58px;
  width: 58px;
  height: 64px;
  overflow: hidden;
  align-items: center;
  color: var(--pd-ink);
  text-decoration: none;
  font-weight: 700;
  letter-spacing: -.02em;
}

.pd-detective-brand img {
  display: block;
  width: 128px;
  max-width: none;
  height: 64px;
  object-fit: contain;
  object-position: left center;
}

.pd-detective-nav {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 42px;
  font-size: 16px;
  line-height: 1.25;
  font-weight: 500;
  letter-spacing: .01em;
}

.pd-detective-nav a {
  position: relative;
  color: #404348;
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
}

.pd-detective-nav a[aria-current="page"] {
  color: #404348;
}

.pd-detective-nav a[aria-current="page"]::after {
  position: absolute;
  right: 0;
  bottom: -29px;
  left: 0;
  height: 3px;
  background: var(--pd-yellow);
  content: "";
}

.pd-nav-arrow {
  display: inline-block;
  margin-left: 7px;
  color: var(--pd-yellow);
  font-size: 22px;
  line-height: .5;
  transform: translateY(-1px);
}

.pd-detective-search {
  display: grid;
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  margin-left: auto;
  place-items: center;
  color: var(--pd-yellow);
}

.pd-detective-search svg { width: 24px; height: 24px; }

.pd-detective-breadcrumbs {
  border-bottom: 1px solid var(--pd-rule);
  background: var(--pd-white);
  font-size: 16px;
}

.pd-detective-breadcrumbs ol {
  display: flex;
  gap: 10px;
  margin: 0;
  padding: 13px 0;
  list-style: none;
}

.pd-detective-breadcrumbs li + li::before {
  content: "›";
  margin-right: 10px;
  color: var(--pd-muted);
}

.pd-detective-breadcrumbs a { color: var(--pd-blue-dark); }

.pd-detective-hero {
  padding: 58px 0 48px;
  border-bottom: 1px solid var(--pd-rule);
}

.pd-kicker {
  margin: 0 0 14px;
  color: var(--pd-yellow-dark);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.pd-detective-hero h1 {
  max-width: 820px;
  margin: 0 0 20px;
  color: var(--pd-yellow);
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.02;
  letter-spacing: -.04em;
  font-weight: 300;
}

.pd-detective-hero .pd-lead {
  max-width: 760px;
  margin: 0;
  color: var(--pd-muted);
  font-size: 24px;
  line-height: 1.3;
}

.pd-detective-intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(280px, .75fr);
  gap: 42px;
  padding-block: 44px;
}

.pd-detective-intro-grid h2,
.pd-start h2,
.pd-result h2 {
  margin: 0 0 18px;
  font-size: 36px;
  line-height: 1.12;
  letter-spacing: -.025em;
  color: var(--pd-blue-dark);
  font-weight: 500;
}

.pd-detective-intro-grid p { max-width: 700px; }

.pd-principles {
  margin: 24px 0 0;
  padding-left: 26px;
}

.pd-principles li { margin-bottom: 10px; }

.pd-note {
  align-self: start;
  padding: 24px;
  border-left: 6px solid var(--pd-yellow);
  background: #f3efe7;
  font-size: 16px;
  line-height: 1.45;
}

.pd-note strong {
  display: block;
  margin-bottom: 8px;
  font-size: 19px;
}

.pd-tool-shell {
  padding: 44px 0 72px;
  border-top: 1px solid var(--pd-rule);
  background: var(--pd-soft);
}

.pd-tool-panel {
  max-width: 860px;
  min-height: 530px;
  padding: 42px;
  border: 1px solid var(--pd-rule);
  background: var(--pd-white);
  box-shadow: none;
}

.pd-step-label {
  margin: 0 0 12px;
  color: var(--pd-muted);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 600;
}

.pd-start > p {
  max-width: 690px;
  margin: 0 0 28px;
}

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

button,
.pd-button {
  font: inherit;
}

.pd-module-button {
  min-height: 112px;
  padding: 20px;
  border: 2px solid var(--pd-rule);
  background: var(--pd-white);
  color: var(--pd-ink);
  text-align: left;
  cursor: pointer;
}

.pd-module-button:hover {
  border-color: var(--pd-blue);
  background: #f8fafc;
}

.pd-module-button strong {
  display: block;
  margin-bottom: 6px;
  color: var(--pd-blue-dark);
  font-size: 20px;
  line-height: 1.2;
}

.pd-module-button span {
  color: var(--pd-muted);
  font-size: 16px;
  line-height: 1.35;
}

.pd-button-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  margin-top: 28px;
}

.pd-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 11px 20px;
  border: 2px solid var(--pd-blue-dark);
  border-radius: 0;
  background: var(--pd-blue-dark);
  color: var(--pd-white);
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.pd-button:hover { background: var(--pd-blue); }

.pd-button-secondary {
  border-color: var(--pd-blue-dark);
  background: var(--pd-white);
  color: var(--pd-blue-dark);
}

.pd-button-secondary:hover { background: #edf2f7; }

.pd-button-quiet {
  padding-inline: 0;
  border-color: transparent;
  background: transparent;
  color: var(--pd-blue-dark);
  text-decoration: underline;
  text-underline-offset: 4px;
}

.pd-button-quiet:hover { background: transparent; }

.pd-mode-option {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-top: 26px;
  padding: 18px;
  border-left: 4px solid var(--pd-rule);
  background: var(--pd-soft);
  cursor: pointer;
}

.pd-mode-option input {
  width: 22px;
  height: 22px;
  margin: 2px 0 0;
  accent-color: var(--pd-blue-dark);
}

.pd-mode-option strong { display: block; }
.pd-mode-option span { display: block; margin-top: 4px; color: var(--pd-muted); font-size: 16px; }

.pd-progress {
  margin-bottom: 32px;
}

.pd-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 9px;
  color: var(--pd-muted);
  font-size: 16px;
  font-weight: 600;
}

.pd-progress-track {
  height: 8px;
  overflow: hidden;
  background: var(--pd-rule);
}

.pd-progress-bar {
  height: 100%;
  width: 0;
  background: var(--pd-yellow);
  transition: width .2s ease;
}

.pd-case-module {
  margin: 0 0 12px;
  color: var(--pd-yellow-dark);
  font-size: 16px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.pd-case-title,
.pd-question legend {
  max-width: 760px;
  margin: 0;
  color: var(--pd-blue-dark);
  font-size: 36px;
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.025em;
}

.pd-scenario {
  margin: 24px 0;
  padding: 24px;
  border-left: 4px solid var(--pd-yellow);
  background: #f3efe7;
  font-size: 20px;
  line-height: 1.4;
}

.pd-source-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 24px 0 32px;
}

.pd-source-card {
  min-height: 118px;
  padding: 16px;
  border: 1px solid var(--pd-rule);
  background: var(--pd-white);
}

.pd-source-card small {
  display: block;
  margin-bottom: 7px;
  color: var(--pd-yellow-dark);
  font-size: 14px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.pd-source-card strong {
  display: block;
  font-size: 17px;
  line-height: 1.25;
}

.pd-source-card span {
  display: block;
  margin-top: 6px;
  color: var(--pd-muted);
  font-size: 15px;
  line-height: 1.3;
}

.pd-question {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pd-question legend { margin-bottom: 24px; }

.pd-answer-list {
  display: grid;
  gap: 10px;
}

.pd-answer {
  position: relative;
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  min-height: 58px;
  padding: 15px 18px;
  border: 2px solid var(--pd-rule);
  background: var(--pd-white);
  cursor: pointer;
}

.pd-answer:hover { border-color: var(--pd-blue); }
.pd-answer:has(input:checked) { border-color: var(--pd-blue-dark); background: #f4f7fa; }
.pd-answer.is-correct { border-color: var(--pd-good); background: #edf7f1; }
.pd-answer.is-wrong { border-color: var(--pd-bad); background: #fff1ef; }

.pd-answer input {
  width: 22px;
  height: 22px;
  margin: 0;
  accent-color: var(--pd-blue-dark);
}

.pd-answer span {
  font-size: 19px;
  line-height: 1.35;
}

.pd-error {
  margin: 18px 0 0;
  padding-left: 14px;
  border-left: 4px solid var(--pd-bad);
  color: #822f2a;
  font-weight: 700;
}

.pd-feedback {
  margin-top: 30px;
  padding: 26px;
  border-top: 4px solid var(--pd-yellow);
  background: var(--pd-soft);
}

.pd-feedback.is-correct { border-top-color: var(--pd-good); }
.pd-feedback.is-wrong { border-top-color: var(--pd-bad); }

.pd-feedback-status {
  margin: 0 0 8px;
  color: var(--pd-muted);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .06em;
}

.pd-feedback h3 {
  margin: 0 0 14px;
  font-size: 26px;
  line-height: 1.18;
}

.pd-feedback p { max-width: 720px; }

.pd-rule-box,
.pd-discussion-box {
  margin-top: 18px;
  padding: 18px;
  border-left: 4px solid var(--pd-yellow);
  background: var(--pd-white);
}

.pd-rule-box strong,
.pd-discussion-box strong { display: block; margin-bottom: 6px; }

.pd-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin-top: 20px;
  font-size: 16px;
  font-weight: 600;
}

.pd-source-links a {
  color: var(--pd-blue-dark);
  text-underline-offset: 4px;
}

.pd-result-summary {
  margin: 22px 0 30px;
  padding: 24px;
  border-left: 6px solid var(--pd-yellow);
  background: var(--pd-soft);
}

.pd-result-number {
  display: block;
  margin-bottom: 4px;
  color: var(--pd-yellow-dark);
  font-size: 48px;
  line-height: 1;
  font-weight: 700;
}

.pd-score-list { display: grid; gap: 14px; }

.pd-score-item {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) 2fr auto;
  gap: 16px;
  align-items: center;
}

.pd-score-item strong { font-size: 16px; }

.pd-score-track { height: 10px; background: var(--pd-rule); }
.pd-score-fill { height: 100%; background: var(--pd-blue); }
.pd-score-item span { color: var(--pd-muted); font-size: 16px; }

.pd-result-next {
  margin-top: 32px;
  padding-top: 26px;
  border-top: 1px solid var(--pd-rule);
}

.pd-result-next h3 { margin: 0 0 8px; font-size: 24px; }

.pd-method {
  padding: 56px 0;
}

.pd-method h2 {
  max-width: 760px;
  margin: 0 0 24px;
  font-size: 36px;
  line-height: 1.12;
  color: var(--pd-blue-dark);
  font-weight: 500;
}

.pd-method-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.pd-method-grid article {
  padding-top: 18px;
  border-top: 4px solid var(--pd-yellow);
}

.pd-method-grid h3 { margin: 0 0 9px; font-size: 22px; }
.pd-method-grid p { margin: 0; color: var(--pd-muted); font-size: 17px; }

.pd-detective-footer {
  padding: 28px 0;
  border-top: 1px solid var(--pd-rule);
  background: var(--pd-white);
  color: var(--pd-muted);
  font-size: 16px;
}

.pd-detective-footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.pd-detective-footer a { color: var(--pd-yellow-dark); }

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

.pd-visually-hidden:focus {
  position: fixed !important;
  z-index: 1000;
  top: 12px;
  left: 12px;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  padding: 10px 14px !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  background: var(--pd-focus);
  color: var(--pd-ink);
  font-weight: 700;
}

[hidden] { display: none !important; }

a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 4px solid var(--pd-focus);
  outline-offset: 3px;
}

@media (max-width: 760px) {
  body.pd-legal-detective { font-size: 18px; }
  .pd-detective-topbar-inner,
  .pd-detective-wrap { width: min(100% - 30px, 1120px); }
  .pd-detective-topbar-inner { min-height: 68px; }
  .pd-detective-brand { flex-basis: 48px; width: 48px; height: 54px; }
  .pd-detective-brand img { width: 108px; height: 54px; }
  .pd-detective-nav a:not([aria-current="page"]) { display: none; }
  .pd-detective-hero { padding: 38px 0 34px; }
  .pd-detective-hero h1 { font-size: 40px; line-height: 1.05; }
  .pd-detective-hero .pd-lead { font-size: 21px; line-height: 1.35; }
  .pd-detective-intro-grid { grid-template-columns: 1fr; gap: 26px; padding-block: 34px; }
  .pd-detective-intro-grid h2,
  .pd-start h2,
  .pd-result h2,
  .pd-method h2 { font-size: 29px; line-height: 1.14; }
  .pd-tool-shell { padding: 28px 0 48px; }
  .pd-tool-panel { min-height: 0; padding: 24px 18px; }
  .pd-module-grid { grid-template-columns: 1fr; }
  .pd-module-button { min-height: 0; }
  .pd-case-title,
  .pd-question legend { font-size: 29px; line-height: 1.14; }
  .pd-scenario { padding: 19px; font-size: 19px; }
  .pd-source-list { grid-template-columns: 1fr; }
  .pd-source-card { min-height: 0; }
  .pd-answer { padding: 14px; }
  .pd-feedback { padding: 20px 18px; }
  .pd-score-item { grid-template-columns: 1fr auto; gap: 6px 14px; }
  .pd-score-track { grid-column: 1 / -1; grid-row: 2; }
  .pd-method-grid { grid-template-columns: 1fr; }
  .pd-detective-footer-inner { display: block; }
}

@media (max-width: 860px) {
  :root { --pd-rail-width: 0px; }
  .pd-detective-topbar,
  .pd-detective-breadcrumbs,
  .pd-legal-detective > main,
  .pd-detective-footer { margin-left: 0; }
  .pd-detective-topbar-inner { min-height: 68px; gap: 20px; }
  .pd-detective-nav { flex-wrap: nowrap; gap: 22px; overflow-x: auto; font-size: 14px; }
  .pd-nav-arrow { display: none; }
  .pd-detective-search { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .pd-progress-bar { transition: none; }
}

@media print {
  .pd-detective-topbar,
  .pd-detective-breadcrumbs,
  .pd-button,
  .pd-mode-option { display: none !important; }
  .pd-tool-shell { background: #fff; }
  .pd-tool-panel { max-width: none; padding: 0; border: 0; box-shadow: none; }
}
