/* Reusable editorial template for detailed product case studies. */
.case-study-page {
  --case-content-width: 780px;
  --case-muted: #58616e;
  --case-rule: #dedfdc;
  font-size: 17px;
  line-height: 1.75;
}

.case-study-page main {
  min-width: 0;
}

.case-skip-link {
  position: fixed;
  z-index: 100;
  left: 16px;
  top: 12px;
  padding: 10px 16px;
  background: var(--ink);
  color: #fff;
  transform: translateY(-160%);
}

.case-skip-link:focus {
  transform: translateY(0);
}

.case-study-page a:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 5px;
  border-radius: 3px;
}

.case-overview,
.case-layout,
.case-footer {
  width: min(1180px, calc(100% - 64px));
  margin-inline: auto;
}

.case-overview {
  padding-block: 76px 48px;
  scroll-margin-top: 100px;
}

.case-coupon-redesign .case-overview,
.coupon-navigation-page .case-overview {
  padding-top: 32px;
}

.case-eyebrow {
  margin: 0 0 18px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.case-overview-visual {
  margin: 0 0 40px;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
}

.case-overview-visual img {
  display: block;
  width: 100%;
  height: auto;
}

.case-overview h1 {
  max-width: 900px;
  margin-bottom: 22px;
  font-size: clamp(36px, 4.7vw, 58px);
  font-weight: 600;
  line-height: 1.13;
  letter-spacing: -.045em;
  text-wrap: balance;
}

.case-intro {
  max-width: 720px;
  color: var(--case-muted);
  font-size: 19px;
  line-height: 1.7;
}

.case-intro-wide {
  max-width: none;
}

.case-intro a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.case-highlights {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  font-weight: 500;
}

.case-highlights li {
  display: flex;
  gap: 8px;
  align-items: baseline;
}

.case-highlights li::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  flex: 0 0 5px;
  align-self: center;
  border-radius: 50%;
  background: var(--accent);
}

.case-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 28px;
  margin-top: 44px;
  padding-block: 24px;
  border-block: 1px solid var(--case-rule);
}

.case-meta dt,
.concept-facts dt {
  margin-bottom: 7px;
  color: var(--case-muted);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
}

.case-meta dd {
  font-size: 14px;
  font-weight: 500;
  line-height: 1.65;
}

.case-layout {
  display: grid;
  grid-template-columns: 225px minmax(0, var(--case-content-width));
  justify-content: space-between;
  align-items: start;
  gap: 64px;
  padding-top: 14px;
}

.case-toc {
  position: sticky;
  top: 96px;
  max-height: calc(100dvh - 124px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px 10px 12px 0;
  scrollbar-width: thin;
  scroll-margin-top: 92px;
}

.case-toc-title {
  margin-bottom: 18px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .07em;
  text-transform: uppercase;
}

.case-toc-list,
.case-toc-list ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

.case-toc-list > li + li {
  margin-top: 6px;
}

.case-toc-list a {
  display: block;
  padding: 5px 10px;
  border-left: 2px solid transparent;
  color: var(--case-muted);
  font-size: 13px;
  line-height: 1.5;
  transition: color .15s ease, border-color .15s ease;
}

.case-toc-list ol {
  margin: 3px 0 8px 12px;
}

.case-toc-list ol a {
  padding-block: 4px;
  font-size: 12px;
}

.case-toc a:hover,
.case-toc a[aria-current] {
  color: var(--accent);
  border-left-color: var(--accent);
}

.case-toc a[aria-current] {
  font-weight: 600;
}

.case-story {
  min-width: 0;
  overflow-wrap: break-word;
}

.case-section,
.case-subsection,
.case-part,
.case-challenge,
.case-role {
  scroll-margin-top: 100px;
}

.case-section {
  padding-bottom: 78px;
}

.case-section + .case-section {
  padding-top: 38px;
  border-top: 1px solid var(--case-rule);
}

.case-section h2 {
  display: flex;
  align-items: baseline;
  gap: 15px;
  margin-bottom: 28px;
  font-size: clamp(27px, 3vw, 34px);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -.035em;
}

.section-number {
  flex-shrink: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: .025em;
}

.case-story p {
  margin-bottom: 18px;
}

.case-story ul,
.case-story ol {
  margin: 18px 0 26px;
  padding-left: 24px;
}

.case-story li {
  padding-left: 3px;
  margin-bottom: 10px;
}

.case-story strong {
  font-weight: 600;
}

.case-story blockquote {
  margin: 26px 0;
  padding: 18px 24px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  font-size: 19px;
  line-height: 1.65;
}

.case-story h3 {
  margin: 34px 0 16px;
  font-size: 23px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: -.02em;
}

.case-story h4 {
  margin-bottom: 20px;
  font-size: 22px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.02em;
}

.case-story h5 {
  margin-bottom: 16px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.015em;
}

.case-story h6 {
  margin: 26px 0 10px;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
}

.case-story .case-problem-label {
  margin: 26px 0 10px;
  font-size: 15px;
  line-height: 1.5;
  letter-spacing: normal;
}

.case-story a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.case-role + .case-role {
  margin-top: 34px;
}

.case-role h3 {
  font-size: 20px;
}

.case-questions {
  margin-block: 24px;
  padding: 2px 0 2px 22px;
  border-left: 2px solid var(--accent);
}

.case-questions ul {
  margin-block: 10px;
}

.case-part {
  margin-top: 44px;
}

.case-part + .case-part {
  margin-top: 88px;
  padding-top: 46px;
  border-top: 1px solid var(--case-rule);
}

.case-part-heading {
  margin-bottom: 44px;
}

.case-part-heading .case-eyebrow {
  margin-bottom: 12px;
}

.case-part-heading h3 {
  margin: 0 0 18px;
  font-size: clamp(28px, 3vw, 36px);
  line-height: 1.2;
  letter-spacing: -.03em;
}

.case-subsection + .case-subsection {
  margin-top: 60px;
}

.case-note,
.case-draft {
  margin-block: 24px;
  padding: 15px 18px;
  color: var(--case-muted);
  font-size: 14px;
  line-height: 1.7;
}

.case-note {
  border-left: 2px solid #bdc6d3;
  background: #f0f2f3;
}

.case-draft {
  border: 1px dashed #c5c8c6;
  border-radius: 6px;
  background: #f6f6f3;
}

.case-note p:last-child,
.case-draft p:last-child {
  margin-bottom: 0;
}

.case-figure {
  margin: 32px 0;
}

.case-figure img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.case-figure--white img {
  background: #fff;
}

.case-figure figcaption {
  max-width: 680px;
  margin-top: 12px;
  color: var(--case-muted);
  font-size: 12px;
  line-height: 1.7;
}

.case-impact-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-block: 30px;
}

.case-impact-grid--two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.case-impact-grid article {
  min-width: 0;
  padding: 24px;
  border: 1px solid var(--case-rule);
  border-radius: 12px;
  background: #fff;
}

.case-impact-grid strong {
  display: block;
  margin-bottom: 12px;
  color: var(--accent);
  font-size: 18px;
  line-height: 1.35;
}

.case-impact-grid p {
  margin: 0;
  color: var(--case-muted);
  font-size: 14px;
  line-height: 1.65;
}

.case-impact-metrics {
  display: grid;
  gap: 16px;
  margin: 0;
}

.case-impact-metrics div {
  padding-top: 14px;
  border-top: 1px solid var(--case-rule);
}

.case-impact-metrics dt {
  color: var(--ink);
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -.025em;
}

.case-impact-metrics dd {
  margin: 5px 0 0;
  color: var(--case-muted);
  font-size: 13px;
  line-height: 1.5;
}

.case-result-note {
  margin-top: 24px;
  color: var(--case-muted);
  font-size: 12px;
  line-height: 1.7;
}

.case-result-highlight {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  align-items: baseline;
  margin: 20px 0 24px;
  padding: 22px 0;
  border-top: 1px solid var(--case-rule);
}

.case-result-highlight strong {
  color: var(--accent);
  font-size: clamp(34px, 4.4vw, 48px);
  font-weight: 600;
  line-height: 1;
  letter-spacing: -.04em;
}

.case-result-highlight span {
  color: var(--ink);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
}

@media (max-width: 760px) {
  .case-impact-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}

.case-user-flow-figure {
  margin: 32px 0;
}

.case-user-flow {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 28px minmax(0, 1fr) 44px minmax(0, 1fr) 28px minmax(0, 1fr);
  align-items: stretch;
}

.case-flow-step {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 14px 12px;
  border: 1px solid #aeb8f9;
  border-radius: 10px;
  background: #fff;
}

.case-flow-step--risk {
  border-color: #df6258;
  background: #fff9f8;
}

.case-flow-step > img {
  width: 52px;
  height: 76px;
  object-fit: contain;
}

.case-flow-step-number {
  display: inline-block;
  margin-bottom: 7px;
  padding: 3px 7px;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .05em;
  text-transform: uppercase;
}

.case-flow-step--risk .case-flow-step-number {
  background: #cf463c;
}

.case-editorial .case-story .case-flow-step h4 {
  margin: 0 0 5px;
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -.01em;
}

.case-story .case-flow-step p {
  margin: 0;
  color: var(--case-muted);
  font-size: 11px;
  line-height: 1.45;
}

.case-flow-connector {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.case-flow-arrow {
  font-size: 20px;
  line-height: 1;
}

.case-flow-connector--risk {
  color: #cf463c;
}

.case-flow-connector-label {
  position: absolute;
  top: calc(50% + 16px);
  left: 50%;
  width: 72px;
  transform: translateX(-50%);
  font-size: 8px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: .04em;
  text-align: center;
  text-transform: uppercase;
}

.case-evidence-summary {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--case-rule);
  font-size: 18px;
  line-height: 1.65;
}

.case-survey-chart {
  margin: 32px 0 0;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}

.case-editorial .case-story .case-survey-chart h4 {
  margin: 0 0 4px;
  color: var(--ink);
  font-size: 20px;
  line-height: 1.35;
}

.case-story .case-survey-chart-header p {
  margin: 0;
  color: var(--case-muted);
  font-size: 13px;
  line-height: 1.5;
}

.case-story .case-survey-list {
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.case-story .case-survey-item {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(150px, 1fr) 92px;
  gap: 14px;
  align-items: center;
  margin: 0;
  padding: 12px 0;
  border-top: 1px solid #eceef1;
}

.case-survey-reason {
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.45;
}

.case-survey-opportunity {
  display: inline-block;
  margin: 4px 0 0 5px;
  padding: 2px 6px;
  border-radius: 999px;
  background: #fff1ef;
  color: #a63a32;
  font-size: 8px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: .04em;
  text-transform: uppercase;
  vertical-align: middle;
}

.case-survey-bar {
  display: block;
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #eef0f5;
}

.case-survey-bar > span {
  display: block;
  height: 100%;
  border-radius: inherit;
}

.case-survey-item--leading .case-survey-bar > span {
  width: 100%;
  background: var(--accent);
}

.case-survey-item--often .case-survey-bar > span {
  width: 64%;
  background: #7385f7;
}

.case-survey-item--less .case-survey-bar > span {
  width: 34%;
  background: #aeb8f9;
}

.case-survey-item--least .case-survey-bar > span {
  width: 16%;
  background: #d7dcfc;
}

.case-survey-tier {
  color: var(--case-muted);
  font-size: 10px;
  font-weight: 600;
  line-height: 1.4;
  text-align: right;
}

.case-survey-chart figcaption {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid #eceef1;
  color: var(--case-muted);
  font-size: 11px;
  line-height: 1.6;
}

.concept-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 30px;
  margin-block: 24px;
}

.concept-facts > div {
  padding-block: 20px;
  border-top: 1px solid var(--case-rule);
}

.concept-facts dt {
  color: var(--ink);
  font-size: 14px;
}

.concept-facts dd {
  color: var(--case-muted);
  font-size: 15px;
  line-height: 1.7;
}

.journey-columns,
.case-comparison {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 30px;
  margin-block: 28px;
}

.journey-columns > section,
.case-comparison > div {
  padding-top: 22px;
  border-top: 1px solid var(--case-rule);
}

.journey-columns h5 {
  font-size: 17px;
}

.journey-columns ol {
  margin-block: 12px 0;
  font-size: 15px;
}

.case-comparison h6 {
  margin-top: 0;
}

.case-comparison p,
.case-comparison ul {
  font-size: 15px;
}

.case-challenge {
  margin-top: 38px;
  padding-top: 28px;
  border-top: 1px solid var(--case-rule);
}

.case-challenge + .case-challenge {
  margin-top: 52px;
}

.challenge-number {
  display: block;
  margin-bottom: 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .035em;
}

.case-story .case-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px 32px;
  margin-block: 24px;
}

.case-options li {
  margin-bottom: 0;
  font-size: 15px;
}

.case-options strong {
  display: block;
  margin-bottom: 7px;
}

.case-options p {
  margin-bottom: 0;
  color: var(--case-muted);
}

.case-stat-line {
  display: flex;
  flex-wrap: wrap;
  gap: 20px 30px;
  margin-block: 28px 34px;
  padding-block: 22px;
  border-block: 1px solid var(--case-rule);
}

.case-stat-line > span {
  color: var(--case-muted);
  font-size: 13px;
}

.case-stat-line strong {
  display: block;
  color: var(--ink);
  font-size: 19px;
  line-height: 1.4;
}

.case-findings article {
  padding-block: 28px 8px;
  border-top: 1px solid var(--case-rule);
}

.case-findings h6 {
  margin-top: 0;
  font-size: 18px;
}

.finding-response {
  padding-left: 18px;
  border-left: 2px solid #b8c2ff;
  color: var(--case-muted);
  font-size: 15px;
}

.design-placeholder {
  display: flex;
  min-height: 230px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-block: 28px;
  padding: 36px 28px;
  border: 1px dashed #bdc2c7;
  border-radius: 8px;
  background: #f3f4f2;
  text-align: center;
}

.design-placeholder > span {
  color: var(--case-muted);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.design-placeholder > strong {
  font-size: 18px;
  font-weight: 500;
}

.design-placeholder p {
  max-width: 440px;
  margin: 0;
  color: var(--case-muted);
  font-size: 14px;
}

.case-story .case-learning {
  padding-left: 25px;
}

.case-learning li {
  padding-left: 8px;
  margin-bottom: 22px;
}

.case-learning li::marker {
  color: var(--accent);
  font-size: 14px;
  font-weight: 600;
}

.case-footer {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-top: 12px;
  padding-block: 28px 64px;
  border-top: 1px solid var(--case-rule);
  font-size: 14px;
}

.case-footer a:hover {
  color: var(--accent);
}

.case-story .case-footer {
  width: 100%;
}

.case-back-to-contents {
  position: fixed;
  right: 22px;
  bottom: 20px;
  z-index: 40;
  padding: 9px 13px;
  border: 1px solid #d4d8df;
  border-radius: 6px;
  background: rgba(251, 251, 249, .97);
  color: var(--case-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.5;
  box-shadow: 0 2px 8px rgb(20 23 28 / 5%);
}

.case-back-to-contents:hover {
  color: var(--accent);
  border-color: var(--accent);
}

@media (max-width: 1099px) {
  .case-layout {
    max-width: var(--case-content-width);
    grid-template-columns: minmax(0, 1fr);
    gap: 48px;
    padding-top: 0;
  }

  .case-overview,
  .case-footer {
    max-width: var(--case-content-width);
  }

  .case-toc {
    position: static;
    max-height: none;
    overflow: visible;
    padding: 0 0 28px;
    border-bottom: 1px solid var(--case-rule);
  }

  .case-toc-list {
    columns: 2;
    column-gap: 28px;
  }

  .case-toc-list > li {
    break-inside: avoid;
  }

  .case-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 24px 32px;
  }
}

@media (max-width: 639px) {
  .case-overview,
  .case-layout,
  .case-footer {
    width: calc(100% - 40px);
  }

  .case-overview {
    padding-block: 46px 32px;
  }

  .case-coupon-redesign .case-overview,
  .coupon-navigation-page .case-overview {
    padding-top: 28px;
  }

  .case-overview-visual {
    margin-bottom: 28px;
    border-radius: 10px;
  }

  .case-overview h1 {
    font-size: clamp(32px, 8.6vw, 46px);
  }

  .case-intro {
    font-size: 17px;
  }

  .case-highlights {
    column-gap: 16px;
    font-size: 12px;
  }

  .case-meta {
    gap: 22px 20px;
    margin-top: 32px;
  }

  .case-meta dd {
    font-size: 13px;
  }

  .case-toc-list {
    columns: 1;
  }

  .case-toc-list a {
    padding-block: 7px;
    font-size: 14px;
  }

  .case-toc-list ol a {
    padding-block: 6px;
    font-size: 13px;
  }

  .case-section {
    padding-bottom: 52px;
  }

  .case-section + .case-section {
    padding-top: 30px;
  }

  .case-section h2 {
    gap: 12px;
    margin-bottom: 24px;
  }

  .case-part-heading h3 {
    font-size: 28px;
  }

  .case-subsection + .case-subsection {
    margin-top: 44px;
  }

  .case-part + .case-part {
    margin-top: 62px;
    padding-top: 36px;
  }

  .journey-columns,
  .case-comparison,
  .concept-facts,
  .case-story .case-options {
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
  }

  .concept-facts {
    gap: 0;
  }

  .case-stat-line {
    gap: 20px 28px;
  }

  .case-stat-line > span {
    flex-basis: calc(50% - 14px);
  }

  .case-figure {
    margin-block: 26px;
  }

  .case-user-flow-figure {
    margin-block: 26px;
  }

  .case-user-flow {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }

  .case-flow-step {
    grid-template-columns: 76px minmax(0, 1fr);
    min-height: 128px;
    padding: 18px;
  }

  .case-flow-step > img {
    width: 72px;
    height: 88px;
  }

  .case-editorial .case-story .case-flow-step h4 {
    font-size: 15px;
  }

  .case-story .case-flow-step p {
    font-size: 12px;
  }

  .case-flow-connector {
    min-height: 42px;
  }

  .case-flow-arrow {
    transform: rotate(90deg);
  }

  .case-flow-connector-label {
    top: 50%;
    left: calc(50% + 58px);
    width: 94px;
    transform: translate(-50%, -50%);
    font-size: 8px;
  }

  .case-evidence-summary {
    font-size: 17px;
  }

  .case-survey-chart {
    padding: 20px;
  }

  .case-story .case-survey-item {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 9px 12px;
    padding: 14px 0;
  }

  .case-survey-reason {
    grid-column: 1 / -1;
    font-size: 13px;
  }

  .case-survey-tier {
    min-width: 82px;
  }

  .design-placeholder {
    padding: 30px 20px;
  }

  .case-footer {
    padding-bottom: 86px;
  }

  .case-back-to-contents {
    right: 14px;
    bottom: 14px;
  }

  .case-study-page .nav-inner {
    padding-inline: 20px;
  }

  .case-study-page .nav-links {
    gap: 14px;
    font-size: 13px;
  }
}

/* Shared 780-unit white canvas: 40-unit top/bottom padding and a 60-unit
   main-node icon diameter. Source-specific offsets preserve the original art.
   Every canvas scales together with the article width, including on mobile. */
.case-hierarchy .case-figure {
  margin-block: 28px;
}

.case-hierarchy .case-image-canvas {
  position: relative;
  width: 100%;
  aspect-ratio: 780 / var(--canvas-height);
  overflow: hidden;
  background: #fff;
}

.case-hierarchy .case-image-canvas img {
  position: absolute;
  display: block;
  width: calc(100% * var(--image-width) / 780);
  max-width: none;
  height: auto;
  left: calc(100% * var(--image-left) / 780);
  top: calc(100% * var(--image-top) / var(--canvas-height));
  border: 0;
  border-radius: 0;
  background: #fff;
}

.case-hierarchy .case-journey-details {
  margin-block: 24px;
  border-block: 1px solid var(--case-rule);
}

.case-hierarchy .case-journey-details > summary {
  display: list-item;
  padding: 14px 0;
  cursor: pointer;
  color: var(--accent);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
  list-style: disclosure-closed inside;
}

.case-hierarchy .case-journey-details[open] > summary {
  list-style-type: disclosure-open;
}

.case-hierarchy .case-journey-details > summary:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.case-hierarchy .case-journey-details > summary:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* Gift Voucher: each heading level keeps the same visual rank throughout. */
.case-hierarchy .case-story h2 {
  margin-bottom: 36px;
  font-size: clamp(30px, 3vw, 36px);
  font-weight: 700;
  line-height: 1.25;
}

.case-hierarchy .case-story h3 {
  margin: 40px 0 20px;
  font-size: clamp(24px, 2.4vw, 27px);
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -.025em;
}

.case-hierarchy .case-story h4 {
  margin: 28px 0 12px;
  font-size: clamp(20px, 2vw, 21px);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.015em;
}

.case-hierarchy .case-story h5 {
  margin: 24px 0 8px;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: normal;
}

.case-hierarchy .case-story h6,
.case-hierarchy .case-story .case-problem-label {
  margin: 24px 0 8px;
  color: var(--case-muted);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .02em;
}

.case-hierarchy .case-part-heading {
  margin-bottom: 28px;
}

.case-hierarchy .case-part-heading h3,
.case-hierarchy .case-role > h5,
.case-hierarchy .case-challenge > :first-child,
.case-hierarchy .journey-columns h5 {
  margin-top: 0;
}

.case-hierarchy .case-problem-perspectives {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 40px;
  margin-top: 28px;
}

.case-hierarchy .case-problem-perspectives h4,
.case-hierarchy .case-role-summary > h4,
.case-hierarchy .case-role-beyond > h4 {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: normal;
}

.case-hierarchy .case-problem-perspectives p,
.case-hierarchy .case-role-summary p,
.case-hierarchy .case-role-description > :last-child {
  margin-bottom: 0;
}

.case-hierarchy .case-problem-perspectives h4 {
  margin-bottom: 20px;
}

.case-perspective-icon {
  display: block;
  width: 56px;
  height: 56px;
  object-fit: contain;
}

.case-hierarchy .case-role-summary {
  margin-top: 28px;
}

.case-hierarchy .case-role-beyond {
  margin-top: 40px;
}

.case-hierarchy .case-role-group {
  margin-top: 24px;
}

.case-hierarchy .case-role {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2fr);
  align-items: baseline;
  column-gap: 36px;
  padding-top: 24px;
  border-top: 1px solid var(--case-rule);
}

.case-hierarchy .case-role > h5 {
  margin-bottom: 0;
  font-size: 16px;
  font-weight: 500;
  line-height: 1.6;
}

.case-hierarchy .case-role-description {
  min-width: 0;
}

.case-hierarchy .case-role + .case-role {
  margin-top: 28px;
}

.case-hierarchy .case-toc-list > li > a {
  color: var(--ink);
  font-weight: 600;
}

.case-hierarchy .case-toc a:hover,
.case-hierarchy .case-toc a[aria-current] {
  color: var(--accent);
}

@media (max-width: 639px) {
  .case-hierarchy .case-problem-perspectives {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }

  .case-hierarchy .case-role {
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
  }
}

/* Editorial introductions follow the author's explicit [Big Text] markers.
   They are paragraphs, so the document's heading hierarchy stays intact. */
.case-editorial .case-overview h1 {
  max-width: 1100px;
}

.case-editorial .case-story h2 {
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -.01em;
}

/* Subsection labels keep the same rank, whether or not Big Text follows. */
.case-editorial .case-subsection > h3,
.case-editorial .case-subsection > h4,
.case-editorial .case-story .case-intro-label {
  margin-bottom: 14px;
  color: var(--case-muted);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  letter-spacing: .01em;
}

.case-editorial .case-subsection > .case-problem-title {
  margin-bottom: 14px;
  color: var(--ink);
  font-size: 17px;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: normal;
}

.case-editorial .case-story .case-big-text {
  margin: 0 0 28px;
  color: var(--ink);
  font-size: clamp(28px, 3.2vw, 40px);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.03em;
  text-wrap: pretty;
}

.case-editorial .case-problem-perspectives h4 {
  margin-bottom: 20px;
}

.case-editorial .case-problem-perspectives .case-perspective-icon {
  margin-top: 0;
}

.case-editorial .case-story .case-insight-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.case-editorial .case-insight-grid > li {
  min-width: 0;
  margin: 0;
  padding: 0;
}

.case-editorial .case-insight-icon {
  display: block;
  width: 48px;
  height: 48px;
  margin-bottom: 20px;
  object-fit: contain;
}

.case-editorial .case-insight-grid p {
  margin: 0;
}

@media (max-width: 639px) {
  .case-editorial .case-story .case-insight-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

.case-editorial .case-tradeoffs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
  margin-block: 24px 0;
}

.case-tradeoff-icon {
  display: block;
  width: 32px;
  height: 32px;
  margin-bottom: 16px;
}

.case-tradeoff-icon--pro { color: #16874b; }
.case-tradeoff-icon--con { color: #ce3b3b; }

.case-editorial .case-tradeoff > ul {
  margin: 0;
  padding-left: 20px;
}

@media (max-width: 639px) {
  .case-editorial .case-tradeoffs {
    grid-template-columns: minmax(0, 1fr);
    gap: 28px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .case-study-page *,
  .case-study-page *::before,
  .case-study-page *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Final design viewer ---------- */
.final-design-intro {
  max-width: 640px;
  color: var(--case-muted);
}

.final-design-viewer {
  margin-top: 24px;
}

.final-design-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.final-design-tab {
  min-height: 40px;
  padding: 9px 15px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--case-muted);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease;
}

.final-design-tab:hover {
  border-color: rgb(47 75 245 / 35%);
  color: var(--accent);
  transform: translateY(-1px);
}

.final-design-tab:focus-visible,
.final-design-preview:focus-visible,
.final-design-pager button:focus-visible {
  outline: 3px solid rgb(47 75 245 / 22%);
  outline-offset: 3px;
}

.final-design-tab.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.final-design-panel[hidden] {
  display: none;
}

.final-design-panel:not([hidden]) {
  animation: final-design-panel-in .24s ease both;
}

.final-design-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.final-design-preview {
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.final-design-preview:hover {
  border-color: rgb(47 75 245 / 28%);
  box-shadow: 0 14px 30px -22px rgb(21 31 64 / 45%);
  transform: translateY(-2px);
}

.final-design-preview-media {
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #f3f5fc;
}

.final-design-preview-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 43%;
  transition: transform .3s ease;
}

.final-design-preview:hover .final-design-preview-media img {
  transform: scale(1.015);
}

.final-design-preview--static {
  cursor: default;
}

.final-design-preview--static:hover {
  border-color: var(--line);
  box-shadow: none;
  transform: none;
}

.final-design-preview--static:hover .final-design-preview-media img {
  transform: none;
}

.final-design-preview--static .image-viewer-frame {
  width: 100%;
  height: 100%;
  max-width: none;
}

.final-design-preview-copy {
  display: grid;
  gap: 2px;
  padding: 14px 16px 16px;
}

.final-design-preview-copy strong {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.45;
}

.final-design-preview-copy small {
  color: var(--case-muted);
  font-size: 11.5px;
  line-height: 1.5;
}

.final-design-figure {
  margin: 0;
}

.final-design-figure img {
  display: block;
  background: #f3f5fc;
}

.final-design-pager {
  display: grid;
  grid-template-columns: minmax(96px, 1fr) auto minmax(96px, 1fr);
  align-items: center;
  gap: 12px;
  margin-top: 18px;
}

.final-design-pager[hidden] {
  display: none;
}

.final-design-pager button {
  min-height: 40px;
  padding: 9px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
}

.final-design-pager button:last-child {
  justify-self: end;
}

.final-design-pager button:disabled {
  opacity: .38;
  cursor: default;
}

.final-design-pager span {
  color: var(--case-muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

@keyframes final-design-panel-in {
  from { opacity: 0; transform: translateY(5px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 639px) {
  .final-design-tabs {
    gap: 7px;
  }

  .final-design-tab {
    min-height: 38px;
    padding-inline: 13px;
    font-size: 12px;
  }

  .final-design-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }

  .final-design-preview-media {
    aspect-ratio: 16 / 9;
  }

  .final-design-pager {
    grid-template-columns: 1fr auto 1fr;
  }
}
