/* ═══════════════════════════════════════════════════════════════
   DETAIL-SHARED.CSS  —  World-Class Detail Page Foundation
   Canonical styles shared across: Blog · Case Study · Solution
   (Playbook has its own app-shell layout – see playbook.css)
   ═══════════════════════════════════════════════════════════════ */

/* ── LOCAL TOKENS ─────────────────────────────────────────────── */
:root {
  --ds-accent:       var(--clr-accent-primary, #3B82F6);
  --ds-accent-rgb:   59, 130, 246;
  --ds-cyan:         var(--clr-accent-cyan, #22D3EE);
  --ds-easing:       cubic-bezier(0.16, 1, 0.3, 1);
  --ds-article-max:  72ch;
  --ds-col-gap:      5rem;
  --ds-sidebar-w:    300px;
  /* Mobile-first layout tokens */
  --ds-page-pad:     1rem;
  --ds-section-gap:  2rem;
  --ds-img-radius:   10px;
  --ds-img-margin:   1.25rem;
  --ds-table-pad:    0.75rem 1rem;
  --ds-table-font:   0.8125rem;
  --ds-bp-tablet:    768px;
  --ds-bp-desktop:   1025px;
  /* Inline diagram showcase — ~75% of prior max for readable page flow; click opens full lightbox */
  --ds-diagram-showcase-scale: 0.75;
  --ds-diagram-showcase-max: min(840px, calc((100vw - 2rem) * var(--ds-diagram-showcase-scale)));
  --ds-diagram-lightbox-max: min(96vw, 1920px);
  --ds-diagram-lightbox-max-h: min(92vh, 92dvh);
}

/* ── REVEAL ANIMATION ─────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.65s var(--ds-easing), transform 0.65s var(--ds-easing);
  will-change: transform, opacity;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ── TWO-COLUMN LAYOUT GRID (mobile-first) ────────────────────── */
.surgical-container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: max(var(--ds-page-pad), env(safe-area-inset-left, 0px))
                   max(var(--ds-page-pad), env(safe-area-inset-right, 0px));
  box-sizing: border-box;
}
.surgical-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--ds-section-gap);
  padding-block: 2.5rem 3.5rem;
  align-items: start;
}
.surgical-sidebar { display: none; }

/* ── MOBILE TOC DRAWER TRIGGER ────────────────────────────────── */
.ds-toc-mobile-btn {
  display: flex;
  position: fixed;
  bottom: max(1.25rem, env(safe-area-inset-bottom, 0px));
  right: max(1rem, env(safe-area-inset-right, 0px));
  z-index: 1200;
  background: var(--ds-accent);
  color: #fff;
  border: none;
  border-radius: 100px;
  padding: 0.65rem 1.2rem;
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  cursor: pointer;
  box-shadow: 0 8px 24px rgba(var(--ds-accent-rgb), 0.4);
  transition: transform 0.3s var(--ds-easing), box-shadow 0.3s;
  gap: 8px;
  align-items: center;
}
@media (hover: hover) {
  .ds-toc-mobile-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 14px 32px rgba(var(--ds-accent-rgb), 0.5);
  }
}

/* Mobile TOC drawer */
.ds-toc-drawer {
  position: fixed;
  inset: 0;
  z-index: 1300;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.ds-toc-drawer.is-open { pointer-events: all; opacity: 1; }
.ds-toc-drawer-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(6px);
}
.ds-toc-drawer-panel {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--clr-surface, #fff);
  border-radius: 24px 24px 0 0;
  padding: 2rem 1.5rem 3rem;
  max-height: 70vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s var(--ds-easing);
}
.ds-toc-drawer.is-open .ds-toc-drawer-panel { transform: translateY(0); }
.ds-toc-drawer-handle {
  width: 40px;
  height: 4px;
  border-radius: 2px;
  background: var(--clr-border, rgba(0,0,0,.1));
  margin: 0 auto 1.5rem;
}

/* ── BREADCRUMB ───────────────────────────────────────────────── */
.breadcrumb-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--clr-text-faint);
  margin-bottom: 2rem;
}
.breadcrumb-nav a { color: inherit; transition: color 0.2s; }
.breadcrumb-nav a:hover { color: var(--clr-heading); }
.breadcrumb-nav .sep { opacity: 0.35; }
.breadcrumb-nav .current { color: var(--ds-accent); }

/* ── HERO META AXIS ───────────────────────────────────────────── */
.hero-meta-axis {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.5rem;
  margin-bottom: 2rem;
}
.meta-item { display: flex; flex-direction: column; gap: 4px; }
.meta-label {
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: 9px;
  font-weight: 800;
  color: var(--clr-text-faint);
  letter-spacing: 0.25em;
  text-transform: uppercase;
}
.meta-value {
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: 13px;
  font-weight: 700;
  color: var(--clr-heading);
  letter-spacing: -0.01em;
}
.meta-divider { width: 1px; height: 24px; background: var(--clr-border); opacity: 0.4; }
@media (max-width: 640px) {
  .meta-divider { display: none; }
  .hero-meta-axis { gap: 0.75rem 1.5rem; }
}

/* ── TAG CLOUD ────────────────────────────────────────────────── */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 2rem; }
.tag-item {
  font-size: 12px;
  padding: 5px 16px;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 100px;
  color: var(--clr-text-faint);
  transition: all 0.3s var(--ds-easing);
}
.tag-item:hover {
  background: var(--clr-bg-alt);
  border-color: var(--ds-accent);
  color: var(--clr-heading);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(var(--ds-accent-rgb), 0.15);
}

/* ── ARTICLE BODY ─────────────────────────────────────────────── */
.article-body {
  font-size: 1rem;
  line-height: 1.75;
  color: var(--clr-text);
  font-family: var(--ff-sans, 'Outfit', sans-serif);
  min-width: 0; /* Prevent grid blowout */
  overflow-wrap: break-word;
}

/* Headings */
.article-body h2 {
  font-size: clamp(1.6rem, 3vw, 2.1rem);
  font-weight: 800;
  color: var(--clr-heading);
  margin: 4rem 0 1.25rem;
  letter-spacing: -0.03em;
  scroll-margin-top: 120px;
  display: flex;
  align-items: center;
  gap: 12px;
}
.article-body h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.65rem);
  font-weight: 700;
  color: var(--clr-heading);
  margin: 3rem 0 1rem;
  letter-spacing: -0.02em;
  scroll-margin-top: 120px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.article-body h4 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--clr-heading);
  margin: 2rem 0 0.75rem;
  scroll-margin-top: 120px;
}

/* Heading anchor link */
.heading-anchor {
  display: inline-flex;
  align-items: center;
  opacity: 0;
  color: var(--ds-accent);
  border: none !important;
  background: none !important;
  padding: 0 !important;
  margin-left: 4px;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.article-body h2:hover .heading-anchor,
.article-body h3:hover .heading-anchor,
.article-body h4:hover .heading-anchor { opacity: 0.6; }
.heading-anchor:hover { opacity: 1 !important; }

/* Paragraphs */
.article-body p { margin-bottom: 1.75rem; }
.article-body p:last-child { margin-bottom: 0; }

/* Links */
.article-body a:not(.heading-anchor) {
  color: var(--ds-accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(var(--ds-accent-rgb), 0.3);
  transition: border-color 0.2s, color 0.2s;
}
.article-body a:not(.heading-anchor):hover {
  border-bottom-color: var(--ds-accent);
}
.article-body a.seo-auto-link {
  color: var(--clr-heading);
  font-weight: 600;
  border-bottom: 1px dashed var(--ds-cyan);
  background: linear-gradient(120deg, transparent, rgba(34, 211, 238, 0.08)) no-repeat;
  background-size: 0% 100%;
  transition: background-size 0.3s var(--ds-easing), color 0.2s;
}
.article-body a.seo-auto-link:hover {
  color: var(--ds-cyan);
  background-size: 100% 100%;
  border-bottom-style: solid;
}

/* Blockquote */
.article-body blockquote {
  border-left: 3px solid var(--ds-accent);
  background: linear-gradient(to right, rgba(var(--ds-accent-rgb), 0.04), transparent);
  padding: 1.5rem 2rem;
  margin: 2.5rem 0;
  border-radius: 0 12px 12px 0;
  font-style: italic;
  font-size: 1.1rem;
  color: var(--clr-text-muted);
}
.article-body blockquote p { margin-bottom: 0.75rem; }
.article-body blockquote p:last-child { margin-bottom: 0; }

/* Lists */
.article-body ul {
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  list-style: disc;
}
.article-body ol {
  padding-left: 1.5rem;
  margin: 1.5rem 0;
  list-style: decimal;
}
.article-body li { margin-bottom: 0.6rem; line-height: 1.7; }
.article-body li:last-child { margin-bottom: 0; }

/* Checklist items from markdown [ ] / [x] */
.article-body li.za-checklist-item {
  list-style: none;
  padding-left: 0.25rem;
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.article-body li.za-checklist-item input[type="checkbox"] {
  margin-top: 4px;
  flex-shrink: 0;
  accent-color: var(--ds-accent);
}

/* Tables */
.article-body table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  margin: 2.5rem 0;
  border: 1px solid var(--clr-border);
  border-radius: 12px;
  overflow: hidden;
  font-size: 0.9rem;
  line-height: 1.55;
  box-shadow: var(--shadow-sm);
}
.article-body thead tr { background: var(--clr-gray-900, #0F172A); }
.article-body th {
  padding: 1rem 1.25rem;
  font-weight: 700;
  text-align: left;
  color: #fff;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  border-bottom: 2px solid rgba(255,255,255,0.08);
}
.article-body table:not(.za-luxury-table) td {
  padding: 0.9rem 1.25rem;
  border-bottom: 1px solid var(--clr-border);
  color: var(--clr-text);
  vertical-align: top;
}
.article-body tbody tr:last-child td { border-bottom: none; }
.article-body table:not(.za-luxury-table) tbody tr:nth-child(even) td { background: rgba(0,0,0,0.02); }
.article-body table:not(.za-luxury-table) tr:hover td { background: rgba(var(--ds-accent-rgb), 0.03); }
[data-theme="dark"] .article-body table:not(.za-luxury-table) tbody tr:nth-child(even) td { background: rgba(255,255,255,0.02); }

/* Dark comparison tables — mobile: stacked cards · desktop: full grid */
.article-body .za-table-container {
  margin: 1.5rem 0;
  border-radius: var(--ds-img-radius);
  border: 1px solid var(--clr-border);
  box-shadow: var(--shadow-sm);
  overflow: visible;
}
.article-body .za-luxury-table {
  width: 100%;
  min-width: 0;
  border-collapse: collapse;
  font-size: var(--ds-table-font);
  line-height: 1.5;
}
/* Mobile: card stack (no horizontal scroll) */
.article-body .za-luxury-table thead {
  display: none;
}
.article-body .za-luxury-table tbody {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.article-body .za-luxury-table tbody tr {
  display: block;
  border-radius: var(--ds-img-radius);
  overflow: hidden;
  border: 1px solid #334155 !important;
  background: #1e293b !important;
}
.article-body .za-luxury-table tbody td {
  display: block;
  padding: var(--ds-table-pad) !important;
  border: none !important;
  color: #e2e8f0 !important;
  text-align: left;
}
.article-body .za-luxury-table tbody td:first-child {
  background: #0f172a !important;
  color: #f8fafc !important;
  font-weight: 700;
  font-size: 0.8rem;
  border-bottom: 1px solid #334155 !important;
}
.article-body .za-luxury-table tbody td:not(:first-child)::before {
  display: block;
  font-size: 0.62rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #94a3b8;
  margin-bottom: 0.35rem;
  content: attr(data-label);
}
.article-body .za-luxury-table tbody td[style*="color: #00ffcc"],
.article-body .za-luxury-table tbody td[style*="color:#00ffcc"] {
  color: #2dd4bf !important;
}
.article-body .za-luxury-table tbody td[style*="color: #ff9900"],
.article-body .za-luxury-table tbody td[style*="color:#ff9900"] {
  color: #fbbf24 !important;
}
.article-body .za-luxury-table tbody td[style*="color: #ff3333"],
.article-body .za-luxury-table tbody td[style*="color:#ff3333"] {
  color: #f87171 !important;
}

/* Horizontal rule */
.article-body hr { border: none; border-top: 1px solid var(--clr-border); margin: 3rem 0; }

/* Strikethrough */
.article-body del { color: var(--clr-text-faint); text-decoration: line-through; }

.article-body ol li > .code-block-wrapper,
.za-pb-chapter-body ol li > .code-block-wrapper {
  margin: 1rem 0 0.75rem;
}
.article-body figure.md-image,
.article-body .md-image:where(figure, div),
.article-body figure.md-image-showcase,
.za-pb-chapter-body figure.md-image,
.za-pb-chapter-body .md-image:where(figure, div) {
  display: block;
  position: relative;
  width: min(100%, calc(100% * var(--ds-diagram-showcase-scale, 0.75)));
  max-width: var(--ds-diagram-showcase-max);
  margin: var(--ds-img-margin) auto;
  aspect-ratio: auto;
  border-radius: 16px;
  overflow: visible;
  border: 1px solid rgba(var(--ds-accent-rgb), 0.14);
  box-shadow:
    0 4px 6px rgba(15, 23, 42, 0.04),
    0 20px 48px rgba(15, 23, 42, 0.08);
  background: var(--clr-surface);
  transition: transform 0.35s var(--ds-easing), box-shadow 0.35s var(--ds-easing), border-color 0.35s var(--ds-easing);
}

.article-body figure.md-image::after,
.article-body .md-image:where(figure, div)::after,
.za-pb-chapter-body figure.md-image::after,
.za-pb-chapter-body .md-image:where(figure, div)::after {
  content: none !important;
  display: none !important;
}

.article-body .md-image-media,
.za-pb-chapter-body .md-image-media {
  position: relative;
  overflow: hidden;
  line-height: 0;
  border-radius: 14px;
  padding: 0.65rem;
  background: linear-gradient(160deg, #0b1220 0%, #111827 55%, #0f172a 100%);
  cursor: zoom-in;
}

.article-body figure.md-image:has(.md-image-caption) .md-image-media,
.article-body figure.md-image:has(figcaption) .md-image-media,
.za-pb-chapter-body figure.md-image:has(.md-image-caption) .md-image-media,
.za-pb-chapter-body figure.md-image:has(figcaption) .md-image-media {
  border-radius: 14px 14px 0 0;
}

.article-body .md-image-media img,
.za-pb-chapter-body .md-image-media img {
  border-radius: 10px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
}
[data-theme="dark"] .article-body figure.md-image,
[data-theme="dark"] .article-body .md-image:where(figure, div),
[data-theme="dark"] .za-pb-chapter-body figure.md-image,
[data-theme="dark"] .za-pb-chapter-body .md-image:where(figure, div) {
  background: rgba(255, 255, 255, 0.03);
}
/* Zoom affordance — image frame only, never on figure/caption */
.article-body .md-image-media::after,
.article-body figure.md-image:not(:has(.md-image-media))::after,
.article-body .md-image:where(figure, div):not(:has(.md-image-media))::after,
.za-pb-chapter-body .md-image-media::after,
.za-pb-chapter-body figure.md-image:not(:has(.md-image-media))::after,
.za-pb-chapter-body .md-image:where(figure, div):not(:has(.md-image-media))::after {
  content: '⤢ Zoom';
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 2;
  padding: 0.4rem 0.75rem;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: none;
  color: #fff;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  pointer-events: none;
  backdrop-filter: blur(6px);
  opacity: 0.92;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.article-body .md-image-media:hover::after,
.za-pb-chapter-body .md-image-media:hover::after {
  opacity: 1;
  transform: scale(1.03);
}
.article-body figure.md-image img,
.article-body .md-image img,
.article-body figure.md-image-showcase img,
.za-pb-chapter-body figure.md-image img,
.za-pb-chapter-body .md-image img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  max-height: none;
  margin-inline: auto;
  vertical-align: top;
  background: #f8fafc;
  cursor: zoom-in;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  object-fit: contain;
  object-position: center;
}
.article-body figure.md-image figcaption,
.article-body .md-image-caption,
.za-pb-chapter-body figure.md-image figcaption,
.za-pb-chapter-body .md-image-caption {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin: 0;
  padding: 1.15rem 1.35rem 1.25rem 1.5rem;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--clr-text);
  text-align: left;
  border-top: 1px solid rgba(var(--ds-accent-rgb), 0.12);
  background: linear-gradient(180deg, var(--clr-surface) 0%, rgba(var(--ds-accent-rgb), 0.035) 100%);
  border-radius: 0 0 16px 16px;
  border-left: 3px solid var(--ds-accent);
}

.md-caption-kicker {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  gap: 0.35rem;
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: 0.6875rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ds-accent);
  padding: 0.25rem 0.55rem;
  border-radius: 999px;
  background: rgba(var(--ds-accent-rgb), 0.08);
  border: 1px solid rgba(var(--ds-accent-rgb), 0.18);
}

.md-caption-text {
  display: block;
  font-size: 0.9375rem;
  line-height: 1.6;
  color: var(--clr-text);
  font-weight: 400;
  text-transform: none;
  letter-spacing: -0.01em;
  max-width: 68ch;
}

/* Legacy cached markup: title attr overlay — disable */
.article-body figure.md-image[title]::after {
  content: none !important;
  display: none !important;
}
/* Legacy: figcaption still outside figure until page cache is purged */
.article-body .md-image + figcaption {
  display: block;
  max-width: 100%;
  margin: -0.75rem 0 1.25rem;
  padding: 0.55rem 0.75rem 0.7rem;
  font-size: 0.72rem;
  line-height: 1.45;
  color: var(--clr-text-muted);
  text-align: center;
  border: 1px solid var(--clr-border);
  border-top: none;
  border-radius: 0 0 12px 12px;
  background: var(--clr-surface);
  box-shadow: var(--shadow-md);
}

/* Legacy sibling figcaption (pre-cache-purge) */
.ds-diagram-lightbox {
  display: flex;
  position: fixed;
  inset: 0;
  z-index: 99999;
  padding:
    max(0.75rem, env(safe-area-inset-top, 0px))
    max(0.75rem, env(safe-area-inset-right, 0px))
    max(5.5rem, calc(env(safe-area-inset-bottom, 0px) + 4rem))
    max(0.75rem, env(safe-area-inset-left, 0px));
  background: rgba(2, 6, 23, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  align-items: center;
  justify-content: center;
  cursor: zoom-out;
  overscroll-behavior: contain;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.28s var(--ds-easing), visibility 0.28s var(--ds-easing);
}
.ds-diagram-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}
.ds-diagram-lightbox-panel {
  display: flex;
  flex-direction: column;
  max-width: min(96vw, 1920px);
  max-height: min(94vh, 94dvh);
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: default;
}
.ds-diagram-lightbox-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  padding: 1rem 1rem 0.75rem;
  background: #0f172a;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}
.ds-diagram-lightbox img {
  display: block;
  width: auto;
  height: auto;
  max-width: min(calc(96vw - 2rem), 1920px);
  max-height: min(calc(88vh - 12rem), 80dvh);
  object-fit: contain;
  border-radius: 10px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.65);
  touch-action: pan-x pan-y pinch-zoom;
  cursor: default;
  transform: scale(0.94);
  opacity: 0;
  transition: transform 0.32s var(--ds-easing), opacity 0.32s var(--ds-easing);
}
.ds-diagram-lightbox.is-open img {
  transform: scale(1);
  opacity: 1;
}
body.ds-lightbox-open {
  overflow: hidden !important;
}

.ds-diagram-lightbox-close {
  position: absolute;
  top: max(0.65rem, env(safe-area-inset-top, 0px));
  right: max(0.65rem, env(safe-area-inset-right, 0px));
  width: 48px;
  height: 48px;
  min-width: 48px;
  min-height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.9);
  color: #fff;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  touch-action: manipulation;
}
.ds-diagram-lightbox-hint {
  display: none;
}
.ds-diagram-lightbox-footer {
  display: flex;
  flex: 0 0 auto;
  flex-shrink: 0;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
  box-sizing: border-box;
  padding:
    1rem 1.25rem
    max(1rem, calc(env(safe-area-inset-bottom, 0px) + 0.65rem));
  background: #334155;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  overflow: visible;
}
.ds-diagram-lightbox-caption {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: 0.8125rem;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.92);
  letter-spacing: normal;
  text-transform: none;
  text-align: left;
  overflow: visible;
  overflow-wrap: anywhere;
  word-break: break-word;
  hyphens: auto;
  padding-bottom: 0.12em;
}
.ds-diagram-lightbox-meta {
  flex-shrink: 0;
  align-self: flex-start;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.6;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.55);
  white-space: nowrap;
  padding-top: 0.12em;
  padding-bottom: 0.12em;
}

/* ── CODE BLOCKS ──────────────────────────────────────────────── */
.code-block-wrapper {
  margin: 2.5rem 0;
  background: #0B0E14;
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0,0,0,0.35);
}
.code-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 16px;
  background: rgba(255,255,255,0.025);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.code-lang {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: var(--ff-mono, 'JetBrains Mono', monospace);
  font-size: 10px;
  font-weight: 800;
  color: var(--ds-accent);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}
.copy-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 6px;
  color: rgba(255,255,255,0.5);
  font-family: var(--ff-mono, monospace);
  font-size: 10px;
  font-weight: 700;
  padding: 5px 12px;
  cursor: pointer;
  transition: all 0.2s ease;
}
.copy-btn:hover { background: var(--ds-accent); color: #fff; border-color: var(--ds-accent); }
.article-body pre,
.za-article pre {
  margin: 0 !important;
  padding: 1.5rem !important;
  background: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  overflow-x: auto;
}
.article-body pre code,
.za-article pre code {
  font-family: var(--ff-mono, 'JetBrains Mono', monospace);
  font-size: 13.5px;
  line-height: 1.75;
  color: #E2E8F0;
  background: none !important;
  border: none !important;
  padding: 0 !important;
}

/* ── INLINE CODE (not in code blocks) ────────────────────────── */
/* Elegant, subtle treatment — no distracting bounding box */
.article-body code:not(pre code),
.za-callout-content code:not(pre code) {
  font-family: var(--ff-mono, 'JetBrains Mono', 'Cascadia Code', 'Fira Code', monospace);
  font-size: 0.84em;
  font-weight: 500;
  color: var(--ds-accent);
  background: rgba(var(--ds-accent-rgb), 0.07);
  padding: 0.18em 0.52em;
  border-radius: 5px;
  border: none;
  letter-spacing: -0.01em;
  word-break: break-word;
}
[data-theme="dark"] .article-body code:not(pre code),
[data-theme="dark"] .za-callout-content code:not(pre code) {
  background: rgba(var(--ds-accent-rgb), 0.12);
  color: #93C5FD;
}

/* ── AI SUMMARY BOX ───────────────────────────────────────────── */
.za-pb-ai-summary {
  background: linear-gradient(135deg, rgba(var(--ds-accent-rgb), 0.05) 0%, rgba(34, 211, 238, 0.05) 100%);
  border: 1px solid rgba(var(--ds-accent-rgb), 0.12);
  border-radius: 16px;
  padding: 2rem 2.25rem;
  margin-bottom: 3rem;
  position: relative;
}
.za-pb-ai-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  color: var(--ds-accent);
  margin-bottom: 0.875rem;
}
.za-pb-ai-text {
  font-size: 1.05rem;
  line-height: 1.8;
  color: var(--clr-text-muted);
}

/* ── CALLOUTS  (World-Class 2026 Redesign) ────────────────────── */
.za-callout {
  margin: 3.5rem 0;
  border-radius: 16px;
  border: 1px solid rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.18);
  background: linear-gradient(135deg,
    rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.05) 0%,
    rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.02) 100%
  );
  overflow: hidden;
  position: relative;
  box-shadow: 0 4px 24px rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.08),
              0 1px 4px rgba(0,0,0,0.04);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.za-callout:hover {
  box-shadow: 0 8px 32px rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.14),
              0 2px 8px rgba(0,0,0,0.06);
  transform: translateY(-2px);
}

/* Left accent bar */
.za-callout::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
  background: linear-gradient(to bottom, var(--v-accent, var(--ds-accent)), rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.4));
  border-radius: 4px 0 0 4px;
}

/* Glow orb decoration */
.za-callout::after {
  content: '';
  position: absolute;
  top: -40px; right: -40px;
  width: 140px; height: 140px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.12) 0%, transparent 70%);
  pointer-events: none;
}

.za-callout-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px 14px 26px;
  background: rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.06);
  border-bottom: 1px solid rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.12);
  position: relative;
  z-index: 1;
}
.za-callout-svg { color: var(--v-accent, var(--ds-accent)); flex-shrink: 0; }
.za-callout-label {
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: 9.5px;
  font-weight: 900;
  text-transform: uppercase;
  letter-spacing: 0.22em;
  color: var(--v-accent, var(--ds-accent));
}

.za-callout-content {
  padding: 24px 28px 24px 28px;
  font-size: 1rem;
  line-height: 1.85;
  color: var(--clr-text);
  position: relative;
  z-index: 1;
}

/* Lead <strong> in first <p>: inline so patterns like **Title**: body stay one line (no orphan colon) */
.za-callout-content > p:first-child > strong:first-child {
  display: inline;
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--v-accent, var(--ds-accent));
  letter-spacing: -0.02em;
  margin-right: 0.28rem;
  line-height: 1.45;
}

.za-callout-content strong { color: var(--clr-heading); font-weight: 700; }
.za-callout-content p { margin-bottom: 1rem; }
.za-callout-content p:last-child { margin-bottom: 0; }
.za-callout-content ul { padding-left: 1.25rem; list-style: disc; margin: 0.75rem 0; }
.za-callout-content li { margin-bottom: 0.45rem; }

/* Callout color variants */
.za-callout-tip       { --v-accent: #06B6D4; --v-accent-rgb: 6, 182, 212; }
.za-callout-note,
.za-callout-info      { --v-accent: #3B82F6; --v-accent-rgb: 59, 130, 246; }
.za-callout-insight   { --v-accent: #8B5CF6; --v-accent-rgb: 139, 92, 246; }
.za-callout-important { --v-accent: #6366F1; --v-accent-rgb: 99, 102, 241; }
.za-callout-warning   { --v-accent: #F59E0B; --v-accent-rgb: 245, 158, 11; }
.za-callout-caution,
.za-callout-danger    { --v-accent: #EF4444; --v-accent-rgb: 239, 68, 68; }
.za-callout-success   { --v-accent: #10B981; --v-accent-rgb: 16, 185, 129; }

/* Special: INSIGHT gets a more dramatic treatment */
.za-callout-insight {
  border-color: rgba(139, 92, 246, 0.22);
  background: linear-gradient(135deg,
    rgba(139, 92, 246, 0.06) 0%,
    rgba(99, 102, 241, 0.04) 50%,
    rgba(59, 130, 246, 0.03) 100%
  );
}
.za-callout-insight .za-callout-header {
  background: rgba(139, 92, 246, 0.08);
  border-bottom-color: rgba(139, 92, 246, 0.15);
}
.za-callout-insight .za-callout-content > p:first-child > strong:first-child {
  color: #7C3AED;
  font-size: 1.1rem;
  background: linear-gradient(135deg, #7C3AED, #4F46E5);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .za-callout-insight .za-callout-content > p:first-child > strong:first-child {
  background: linear-gradient(135deg, #A78BFA, #818CF8);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}
[data-theme="dark"] .za-callout {
  border-color: rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.22);
  background: linear-gradient(135deg,
    rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.08) 0%,
    rgba(var(--v-accent-rgb, var(--ds-accent-rgb)), 0.04) 100%
  );
}

/* Dark theme: stacked lead title reads better on tinted panels */
[data-theme="dark"] .za-callout-content > p:first-child > strong:first-child {
  display: block;
  margin-right: 0;
  margin-bottom: 0.5rem;
}

/* ── FAQ ACCORDION ────────────────────────────────────────────── */
.za-faq-container { margin: 3.5rem 0; border-top: 1px solid var(--clr-border); }
.za-faq-accordion {
  border-bottom: 1px solid var(--clr-border);
  background: transparent;
  width: 100%;
  transition: background 0.3s ease;
}
.za-faq-accordion summary {
  list-style: none;
  padding: 20px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--clr-heading);
  outline: none;
  gap: 16px;
  line-height: 1.4;
  transition: color 0.2s;
}
.za-faq-accordion summary::-webkit-details-marker,
.za-faq-accordion summary::marker { display: none; }
.za-faq-accordion summary::after {
  content: '';
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-right: 2px solid var(--clr-text-faint);
  border-bottom: 2px solid var(--clr-text-faint);
  transform: rotate(45deg);
  transition: transform 0.35s var(--ds-easing), border-color 0.2s;
}
.za-faq-accordion[open] { background: rgba(var(--ds-accent-rgb), 0.02); }
.za-faq-accordion[open] summary { color: var(--ds-accent); }
.za-faq-accordion[open] summary::after {
  transform: rotate(-135deg) translateY(4px);
  border-color: var(--ds-accent);
}
.za-faq-content, .za-faq-accordion > p {
  padding: 0 0 20px !important;
  font-size: 1rem;
  line-height: 1.75;
  color: var(--clr-text-muted);
  margin: 0 !important;
  animation: ds-fade-down 0.35s var(--ds-easing);
}
.za-faq-content p { padding: 0 !important; margin-bottom: 0.75rem !important; }
.za-faq-content p:last-child { margin-bottom: 0 !important; }

/* ── VIRAL PULL QUOTE ─────────────────────────────────────────── */
.za-viral-quote {
  margin: 4rem 0;
  padding: 2.5rem;
  text-align: center;
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: clamp(1.35rem, 3vw, 1.75rem);
  font-weight: 800;
  line-height: 1.35;
  color: var(--clr-heading);
  letter-spacing: -0.025em;
  background: rgba(var(--ds-accent-rgb), 0.03);
  border-inline: 1px solid var(--clr-border);
  position: relative;
}
.za-viral-quote::before {
  content: '\201C';
  position: absolute;
  top: -0.5em;
  left: 50%;
  transform: translateX(-50%);
  font-size: 5rem;
  line-height: 1;
  color: var(--ds-accent);
  opacity: 0.15;
  font-family: Georgia, serif;
}

/* ── TL;DR BOX ────────────────────────────────────────────────── */
.za-tldr-box {
  margin: 3rem 0;
  padding: 2rem 2.25rem;
  background: linear-gradient(135deg, rgba(var(--ds-accent-rgb), 0.04), rgba(34,211,238,0.04));
  border: 1px solid rgba(var(--ds-accent-rgb), 0.12);
  border-radius: 16px;
  position: relative;
}
.za-tldr-box::before {
  content: 'STRATEGIC OVERVIEW';
  position: absolute;
  top: 0; left: 2rem;
  padding: 3px 10px;
  background: var(--ds-accent);
  color: #fff;
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.12em;
  border-radius: 0 0 6px 6px;
}
.za-tldr-box p { margin: 0; font-size: 1.05rem; line-height: 1.8; color: var(--clr-text); }
.za-tldr-box strong { color: var(--ds-accent); font-weight: 700; }

/* ── PHASE BADGE (h3 [Phase N: title] syntax) ────────────────── */
.za-phase-badge {
  font-size: 9px;
  font-weight: 900;
  letter-spacing: 0.15em;
  background: var(--ds-accent);
  color: #fff;
  padding: 5px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  flex-shrink: 0;
}

/* ── SIDEBAR ──────────────────────────────────────────────────── */
.surgical-sidebar { position: sticky; top: calc(72px + 2rem); }
.surgical-sticky-stack { display: flex; flex-direction: column; gap: 2.5rem; }

/* ── TOC (TABLE OF CONTENTS) ──────────────────────────────────── */
.index-nexus { }
.index-label {
  font-size: 10px;
  font-weight: 800;
  color: var(--clr-text-faint);
  text-transform: uppercase;
  letter-spacing: 0.25em;
  margin-bottom: 1.25rem;
}
.index-axis {
  position: relative;
  padding-left: 20px;
  border-left: 1px solid var(--clr-border);
}
.index-cursor {
  position: absolute;
  left: -1px;
  top: 0;
  width: 2px;
  height: 28px;
  background: var(--ds-accent);
  box-shadow: 0 0 8px rgba(var(--ds-accent-rgb), 0.4);
  transition: transform 0.4s var(--ds-easing), height 0.4s var(--ds-easing);
  will-change: transform;
  pointer-events: none;
  border-radius: 1px;
}
.toc-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 6px; }
.toc-link {
  display: block;
  font-size: 12.5px;
  font-weight: 500;
  font-family: var(--ff-head, 'Sora', sans-serif);
  color: var(--clr-text-muted);
  text-decoration: none;
  padding: 3px 0;
  transition: color 0.25s ease;
  line-height: 1.45;
}
.toc-link:hover { color: var(--clr-heading); }
.toc-link.active { color: var(--ds-accent); font-weight: 700; }
.toc-item--sub .toc-link { font-size: 11.5px; padding-left: 14px; color: var(--clr-text-faint); }

/* ── SIDEBAR UTILITIES ────────────────────────────────────────── */
.sidebar-utilities { display: flex; flex-direction: column; gap: 1.5rem; border-top: 1px solid var(--clr-border); padding-top: 1.5rem; }
.utility-card { display: flex; flex-direction: column; gap: 10px; }
.utility-label { font-size: 10px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.2em; color: var(--clr-text-faint); }
.utility-actions { display: flex; gap: 1rem; }
.utility-actions a { font-size: 13px; font-weight: 600; color: var(--clr-text-muted); transition: color 0.2s; }
.utility-actions a:hover { color: var(--ds-accent); }

/* Author mini card in sidebar */
.author-mini {
  padding: 1.25rem;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 12px;
}
.author-row { display: flex; align-items: center; gap: 12px; margin-bottom: 0.875rem; }
.author-ring { width: 42px; height: 42px; border-radius: 50%; border: 2px solid var(--clr-border); }
.author-name-sm { font-size: 14px; font-weight: 800; color: var(--clr-heading); }
.author-role-sm { font-size: 10px; color: var(--ds-accent); font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; }
.author-link { font-size: 11px; font-weight: 700; color: var(--clr-text-faint); text-transform: uppercase; letter-spacing: 0.08em; transition: color 0.2s; }
.author-link:hover { color: var(--ds-accent); }

/* ── AUTHOR NEXUS CARD ────────────────────────────────────────── */
.za-author-nexus {
  margin-top: 4rem;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  gap: 1.5rem;
  position: relative;
  overflow: hidden;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.za-author-nexus:hover { border-color: var(--ds-accent); box-shadow: var(--shadow-md); }
.za-author-nexus::before {
  content: '';
  position: absolute;
  top: 0; left: 0;
  width: 5px;
  height: 100%;
  background: linear-gradient(180deg, var(--ds-accent) 0%, #10B981 100%);
}
.za-author-avatar-wrapper {
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 50%;
  border: 1px solid var(--clr-border);
  padding: 3px;
  background: var(--clr-bg-alt);
}
.za-author-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; }
.za-author-core { flex-grow: 1; text-align: left; }
.za-author-name {
  margin: 0 0 3px;
  font-family: var(--ff-head, 'Sora', sans-serif);
  font-size: 1.15rem;
  color: var(--clr-heading);
  font-weight: 800;
  letter-spacing: -0.01em;
}
.za-author-title {
  color: var(--ds-accent);
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  display: block;
  margin-bottom: 5px;
}
.za-author-bio { color: var(--clr-text-muted); font-size: 0.82rem; line-height: 1.5; margin: 0; max-width: 480px; }
.za-author-social {
  display: flex;
  gap: 10px;
  border-left: 1px solid var(--clr-border);
  padding-left: 1.5rem;
  flex-shrink: 0;
}
.za-author-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: var(--clr-bg-alt);
  border: 1px solid var(--clr-border);
  border-radius: 50%;
  color: var(--clr-text-faint);
  transition: all 0.3s var(--ds-easing);
}
.za-author-social a:hover {
  background: var(--ds-accent);
  color: #fff;
  border-color: var(--ds-accent);
  transform: translateY(-3px) scale(1.05);
  box-shadow: 0 8px 20px rgba(var(--ds-accent-rgb), 0.3);
}

@media (max-width: 768px) {
  .za-author-nexus { flex-direction: column; text-align: center; gap: 1rem; }
  .za-author-social { border-left: none; padding-left: 0; border-top: 1px solid var(--clr-border); padding-top: 1rem; justify-content: center; }
  .za-author-bio { max-width: 100%; }
}

/* ── RELATED CONTENT GRID ─────────────────────────────────────── */
.ds-related-section {
  background: var(--clr-bg-alt);
  border-top: 1px solid var(--clr-border);
  padding-block: 5rem;
}
.ds-related-heading {
  font-size: var(--fs-2xl, 1.5rem);
  font-weight: 800;
  margin-bottom: 2.5rem;
  color: var(--clr-heading);
}
.ds-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.ds-related-card {
  display: block;
  background: var(--clr-surface);
  border: 1px solid var(--clr-border);
  border-radius: 16px;
  padding: 1.5rem;
  transition: transform 0.3s var(--ds-easing), box-shadow 0.3s, border-color 0.3s;
}
.ds-related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
  border-color: var(--ds-accent);
}
.ds-related-card-cat {
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--ds-accent);
  margin-bottom: 0.5rem;
}
.ds-related-card-title {
  font-size: var(--fs-base, 1rem);
  font-weight: 700;
  color: var(--clr-heading);
  line-height: 1.4;
  margin-bottom: 0.5rem;
}
.ds-related-card-meta { font-size: 0.75rem; color: var(--clr-text-faint); }

/* ── ANIMATIONS ───────────────────────────────────────────────── */
@keyframes ds-fade-down {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ═══════════════════════════════════════════════════════════════
   RESPONSIVE — tablet (768px+) & desktop (1025px+)
   Mobile rules are the default above.
   ═══════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {
  :root {
    --ds-page-pad:     1.5rem;
    --ds-section-gap:  3rem;
    --ds-img-radius:   12px;
    --ds-img-margin:   2rem;
    --ds-table-pad:    1rem 1.25rem;
    --ds-table-font:   0.9rem;
  }

  .article-body {
    font-size: 1.0625rem;
    line-height: 1.85;
  }

  .article-body h2 { margin: 3.5rem 0 1.25rem; scroll-margin-top: 100px; }
  .article-body h3 { margin: 2.5rem 0 1rem; scroll-margin-top: 100px; }

  /* Tablet: horizontal scroll table with sticky header */
  .article-body .za-table-container {
    margin: 2rem 0;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
  }
  .article-body .za-table-container::after {
    content: 'Scroll →';
    display: block;
    padding: 0.4rem 0.25rem 0;
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--clr-text-faint);
    text-align: right;
  }
  .article-body .za-luxury-table {
    min-width: 640px;
    font-size: var(--ds-table-font);
  }
  .article-body .za-luxury-table thead {
    display: table-header-group;
  }
  .article-body .za-luxury-table tbody {
    display: table-row-group;
  }
  .article-body .za-luxury-table tbody tr {
    display: table-row;
    border: none !important;
    border-radius: 0;
    overflow: visible;
  }
  .article-body .za-luxury-table tbody td {
    display: table-cell;
    padding: var(--ds-table-pad) !important;
  }
  .article-body .za-luxury-table tbody td:first-child {
    background: transparent !important;
    border-bottom: none !important;
    font-size: inherit;
  }
  .article-body .za-luxury-table tbody td:not(:first-child)::before {
    display: none;
  }
  .article-body .za-luxury-table thead tr {
    background: #0f172a !important;
    border-bottom: 2px solid #334155 !important;
  }
  .article-body .za-luxury-table thead th {
    padding: var(--ds-table-pad) !important;
    color: #f8fafc !important;
    font-weight: 700 !important;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    border: none !important;
  }
  .article-body .za-luxury-table tbody tr:nth-child(odd) {
    background: #1e293b !important;
  }
  .article-body .za-luxury-table tbody tr:nth-child(even) {
    background: #0f172a !important;
  }

  .article-body figure.md-image,
  .article-body .md-image:where(figure, div),
  .article-body figure.md-image-showcase,
  .za-pb-chapter-body figure.md-image,
  .za-pb-chapter-body .md-image:where(figure, div) {
    margin: var(--ds-img-margin) auto;
    max-width: 100%;
    width: min(100%, calc(100% * var(--ds-diagram-showcase-scale, 0.75)));
  }

  .ds-diagram-lightbox {
    padding: 1.25rem;
  }
  .ds-diagram-lightbox-panel {
    max-height: min(92vh, 92dvh);
  }
  .ds-diagram-lightbox img {
    max-width: var(--ds-diagram-lightbox-max);
    max-height: min(calc(88vh - 14rem), 72dvh);
    border-radius: 10px;
  }
  .ds-diagram-lightbox-footer {
    flex-direction: column;
    align-items: stretch;
    gap: 0.65rem;
    padding:
      0.9rem 1rem
      max(1rem, calc(env(safe-area-inset-bottom, 0px) + 0.75rem));
  }
  .ds-diagram-lightbox-meta {
    align-self: flex-end;
  }
  .ds-diagram-lightbox-hint {
    font-size: 0.72rem;
  }
}

@media (min-width: 1025px) {
  :root {
    --ds-page-pad:     1rem;
    --ds-section-gap:  3rem;
    --ds-img-margin:   2.5rem;
    --ds-table-font:   0.95rem;
    --ds-diagram-showcase-max: min(840px, calc((100vw - var(--ds-sidebar-w) - 4rem) * var(--ds-diagram-showcase-scale, 0.75)));
  }

  .surgical-container {
    max-width: 1480px;
  }

  .surgical-grid {
    grid-template-columns: minmax(0, 1fr) var(--ds-sidebar-w);
    padding-block: 5rem;
  }
  .surgical-sidebar {
    display: block;
  }
  .ds-toc-mobile-btn {
    display: none;
  }

  .article-body {
    font-size: 1.1rem;
    line-height: 1.9;
  }

  /* Desktop: full-width table, no scroll hint */
  .article-body .za-table-container {
    margin: 2.5rem 0;
    overflow-x: visible;
  }
  .article-body .za-table-container::after {
    display: none;
  }
  .article-body .za-luxury-table {
    min-width: 0;
    width: 100%;
  }

  @media (hover: hover) {
    .article-body figure.md-image:hover,
    .article-body .md-image:where(figure, div):hover,
    .za-pb-chapter-body figure.md-image:hover,
    .za-pb-chapter-body .md-image:where(figure, div):hover {
      transform: translateY(-4px);
      border-color: rgba(var(--ds-accent-rgb), 0.28);
      box-shadow:
        0 8px 16px rgba(15, 23, 42, 0.06),
        0 28px 56px rgba(var(--ds-accent-rgb), 0.12);
    }
  }

  .article-body .md-image-media::after,
  .za-pb-chapter-body .md-image-media::after {
    content: '⤢ Enlarge';
  }

  .article-body figure.md-image figcaption,
  .article-body .md-image-caption,
  .za-pb-chapter-body figure.md-image figcaption,
  .za-pb-chapter-body .md-image-caption {
    padding: 1.1rem 1.35rem 1.2rem;
  }

  .md-caption-text {
    font-size: 1rem;
  }

  .ds-diagram-lightbox {
    padding: 1.5rem;
  }
  .ds-diagram-lightbox img {
    max-width: var(--ds-diagram-lightbox-max);
    max-height: var(--ds-diagram-lightbox-max-h);
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  }
}

/* Hide zoom badge when lightbox open (avoid overlap) */
.ds-diagram-lightbox.is-open ~ * .article-body figure.md-image::after {
  opacity: 0;
}
