.parts-case-kicker {
  margin-bottom: 0.45em;
  color: var(--muted);
  font-size: 0.8em;
  line-height: 1.25;
}

.parts-case h1 {
  overflow-wrap: anywhere;
}

.parts-case-section,
.parts-case-scenario {
  margin-top: calc(var(--section-space) * 1.25);
}

.parts-case-heading h2,
.parts-case-scenario h2 {
  max-width: none;
  margin-bottom: 0.45em;
  font-size: 1.8em;
  line-height: 1.05;
  letter-spacing: -0.03em;
}

.parts-case-heading p {
  max-width: 48ch;
}

.parts-case-lead {
  max-width: 48ch;
  font-size: 1.25em;
  line-height: 1.22;
  letter-spacing: -0.015em;
}

.source-figure {
  display: grid;
  place-items: center;
  margin: 2.25em 0 0;
  padding: clamp(1rem, 3vw, 3rem);
  background: rgb(247 247 244);
  border-radius: clamp(1rem, 2.5vw, 2.25rem);
}

.source-figure a {
  display: block;
  width: min(100%, 42rem);
  border: 1px solid var(--subtle-rule);
  box-shadow: 0 1.25rem 3rem rgb(20 30 50 / 9%);
}

.source-figure img {
  display: block;
  width: 100%;
  height: auto;
}

.parts-case-copy-row {
  margin-top: 1.75em;
}

.case-observations {
  display: grid;
  gap: 0.75em;
  max-width: 50ch;
  margin: 0;
  padding-left: calc(var(--text-indent) + 1.35em);
}

.case-observations li {
  padding-left: 0.25em;
  text-wrap: pretty;
}

.case-state {
  width: min(100%, 60rem);
  margin: clamp(2rem, 5vw, 4.5rem) auto 0;
}

.state-image {
  --crop-x: -6.34%;
  position: relative;
  display: block;
  overflow: hidden;
  width: 100%;
  background: rgb(248 248 246);
  border: 1px solid var(--subtle-rule);
  border-radius: clamp(0.75rem, 1.5vw, 1.5rem);
  text-decoration: none;
}

.state-image-vin {
  --crop-y: -5.18%;
  aspect-ratio: 1683 / 1340;
}

.state-image-manual {
  --crop-y: -35.31%;
  aspect-ratio: 1683 / 1520;
}

.state-image-contact {
  --crop-y: -70.87%;
  aspect-ratio: 1683 / 1420;
}

.state-image img {
  position: absolute;
  inset: 0 auto auto 0;
  display: block;
  width: 123.71%;
  max-width: none;
  height: auto;
  transform: translate(var(--crop-x), var(--crop-y));
}

.case-state figcaption {
  display: grid;
  gap: 0.3em;
  max-width: 48ch;
  margin-top: 0.8em;
  padding-left: var(--text-indent);
  text-wrap: pretty;
}

.case-state figcaption strong {
  font-weight: 700;
}

.parts-demo-section {
  margin-top: calc(var(--section-space) * 1.5);
}

.parts-demo {
  --demo-field: rgb(246 246 244);
  --demo-border: rgb(20 30 50 / 16%);
  --demo-focus: rgb(36 105 190);
  --demo-error: rgb(174 45 45);
  width: min(100%, 64rem);
  margin: 2em auto 0;
  font-size: clamp(0.9375rem, 0.84rem + 0.3vw, 1.125rem);
  line-height: 1.3;
}

.parts-demo-card,
.parts-demo-success {
  overflow: hidden;
  background: rgb(250 250 248);
  border: 1px solid var(--subtle-rule);
  border-radius: clamp(0.9rem, 2vw, 1.5rem);
}

.parts-demo-body {
  padding: clamp(1.25rem, 4vw, 3.25rem);
}

.parts-demo h3 {
  max-width: none;
  margin: 0 0 1.4em;
  font-size: clamp(1.35rem, 1.1rem + 0.6vw, 1.8rem);
  line-height: 1.08;
  letter-spacing: -0.025em;
}

.demo-field {
  display: grid;
  grid-template-columns: minmax(9.5rem, 0.8fr) minmax(14rem, 1.4fr) minmax(9rem, 1fr);
  gap: 0.65rem 1.1rem;
  align-items: start;
  margin-top: 0.8rem;
}

.demo-field-textarea {
  margin-top: 0;
}

.demo-label,
.demo-hint {
  padding-top: 0.66rem;
}

.demo-label {
  line-height: 1.2;
}

.demo-control {
  min-width: 0;
}

.demo-control input,
.demo-control textarea {
  display: block;
  width: 100%;
  min-height: 2.75rem;
  margin: 0;
  padding: 0.58rem 0.7rem;
  color: var(--ink);
  background: var(--demo-field);
  border: 1px solid var(--demo-border);
  border-radius: 0.32rem;
  font: inherit;
  line-height: 1.35;
  transition: border-color 120ms ease, background-color 120ms ease, box-shadow 120ms ease;
}

.demo-control textarea {
  min-height: 8.25rem;
  max-height: 18rem;
  resize: vertical;
}

.demo-control input::placeholder,
.demo-control textarea::placeholder {
  color: rgb(20 30 50 / 48%);
  opacity: 1;
}

.demo-control input:hover,
.demo-control textarea:hover {
  border-color: rgb(20 30 50 / 42%);
}

.demo-control input:focus,
.demo-control textarea:focus {
  background: rgb(246 249 253);
  border-color: var(--demo-focus);
  box-shadow: 0 0 0 1px var(--demo-focus);
  outline: none;
}

.demo-control input[aria-invalid="true"],
.demo-control textarea[aria-invalid="true"] {
  background: rgb(255 248 246);
  border-color: var(--demo-error);
  box-shadow: 0 0 0 1px var(--demo-error);
}

.demo-hint {
  color: var(--muted);
  font-size: 0.82em;
  line-height: 1.25;
  text-wrap: pretty;
}

.demo-error,
.demo-group-error {
  margin: 0.4rem 0 0;
  color: var(--demo-error);
  font-size: 0.82em;
  line-height: 1.25;
}

.demo-field-short .demo-control {
  width: min(100%, 6rem);
}

.demo-field-checkbox {
  align-items: center;
  margin-top: 1rem;
}

.demo-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  min-height: 2.5rem;
  cursor: pointer;
  user-select: none;
}

.demo-checkbox input {
  width: 1.15rem;
  height: 1.15rem;
  margin: 0;
  accent-color: rgb(20 20 20);
}

.demo-checkbox:has(input:focus-visible) {
  outline: 2px solid var(--demo-focus);
  outline-offset: 0.25rem;
  border-radius: 0.15rem;
}

.demo-group-heading {
  margin: 1.65rem 0 0.4rem calc((100% - 2.2rem) * 0.253 + 1.1rem);
}

.demo-group-heading h4 {
  max-width: none;
  margin: 0 0 0.15rem;
  font-size: 1.22em;
  line-height: 1.15;
  letter-spacing: -0.015em;
}

.demo-group-heading p {
  margin: 0;
  font-size: 0.9em;
  line-height: 1.3;
}

.demo-group-error {
  margin-left: calc((100% - 2.2rem) * 0.253 + 1.1rem);
}

.parts-demo-footer {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 1rem;
  align-items: center;
  padding: 1rem clamp(1.25rem, 4vw, 3.25rem);
  background: rgb(234 232 229);
}

.parts-demo button {
  min-height: 2.75rem;
  padding: 0.58rem 1rem;
  color: white;
  background: rgb(20 20 20);
  border: 0;
  border-radius: 0.32rem;
  font: inherit;
  line-height: 1.2;
  cursor: pointer;
  transition: background-color 120ms ease, transform 80ms ease, box-shadow 120ms ease;
}

.parts-demo button:hover {
  background: rgb(63 63 63);
}

.parts-demo button:active {
  transform: translateY(1px);
}

.parts-demo button:focus-visible {
  outline: 2px solid var(--demo-focus);
  outline-offset: 3px;
}

.parts-demo button[data-incomplete="true"] {
  color: rgb(255 255 255 / 78%);
  background: rgb(20 20 20 / 40%);
}

.parts-demo button[data-incomplete="true"]:hover {
  background: rgb(20 20 20 / 52%);
}

.parts-demo button:disabled {
  cursor: wait;
  opacity: 0.68;
}

.parts-demo-footer p {
  max-width: 44ch;
  margin: 0;
  color: var(--muted);
  font-size: 0.82em;
  line-height: 1.3;
}

.parts-demo-success {
  padding: clamp(1.5rem, 4vw, 3.25rem);
}

.parts-demo-success h3 {
  margin-bottom: 0.45rem;
}

.parts-demo-success p {
  max-width: 50ch;
  margin-bottom: 1.25rem;
}

[hidden] {
  display: none !important;
}

@media (max-width: 820px) {
  .parts-case h1 {
    font-size: clamp(2rem, 9.2vw, 2.5rem);
    text-wrap: pretty;
  }

  .parts-case-section,
  .parts-case-scenario {
    margin-top: var(--section-space);
  }

  .parts-case-heading h2,
  .parts-case-scenario h2 {
    font-size: 1.55em;
  }

  .parts-case-lead {
    font-size: 1.12em;
  }

  .source-figure {
    margin-top: 1.5em;
    padding: 0.8rem;
    border-radius: 1rem;
  }

  .parts-case-copy-row {
    margin-top: 1.25em;
  }

  .case-observations {
    padding-left: 1.35em;
  }

  .case-state {
    margin-top: 2.5rem;
  }

  .case-state figcaption {
    margin-top: 0.65em;
  }

  .parts-demo {
    margin-top: 1.5em;
    font-size: 1rem;
  }

  .parts-demo-body {
    padding: 1.25rem 1rem 1.5rem;
  }

  .parts-demo h3 {
    margin-bottom: 1.2em;
  }

  .demo-field {
    grid-template-columns: 1fr;
    gap: 0.3rem;
    margin-top: 1rem;
  }

  .demo-label,
  .demo-hint {
    padding-top: 0;
  }

  .demo-hint {
    margin-top: 0.1rem;
  }

  .demo-field-checkbox {
    margin-top: 0.85rem;
  }

  .demo-field-checkbox .demo-label {
    display: none;
  }

  .demo-field-short .demo-control {
    width: 7rem;
  }

  .demo-group-heading,
  .demo-group-error {
    margin-left: 0;
  }

  .demo-group-heading {
    margin-top: 1.65rem;
  }

  .parts-demo-footer {
    grid-template-columns: 1fr;
    gap: 0.65rem;
    padding: 1rem;
  }

  .parts-demo-footer button {
    justify-self: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .demo-control input,
  .demo-control textarea,
  .parts-demo button {
    transition: none;
  }
}

@media print {
  .source-figure,
  .case-state,
  .parts-demo-card {
    break-inside: avoid;
  }
}
