@import url("https://fonts.googleapis.com/css2?family=Noto+Kufi+Arabic:wght@400;600;700&display=swap");

@font-face {
  font-family: "Alkatip Basma";
  src: url("/fonts/alkatip-basma.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

html {
  scroll-padding-top: 104px;
}

body.article-enhanced {
  position: relative;
  isolation: isolate;
  font-family: "Alkatip Basma", "Noto Kufi Arabic", "Cairo", "Amiri", serif !important;
  --reader-font-scale: 1.1;
  --reader-bg: #eef3f9;
  --reader-surface: rgba(255, 255, 255, 0.94);
  --reader-surface-alt: rgba(248, 250, 252, 0.86);
  --reader-text: #0f172a;
  --reader-heading: #020617;
  --reader-muted: #475569;
  --reader-border: rgba(148, 163, 184, 0.24);
  --reader-shadow: rgba(15, 23, 42, 0.12);
}

body.article-enhanced :is(button, input, textarea, select) {
  font: inherit;
}

body[data-reader-theme="light"] {
  color-scheme: light;
}

body[data-reader-theme="dark"] {
  color-scheme: dark;
  --reader-bg: #0a0f1a;
  --reader-surface: rgba(20, 30, 50, 0.95);
  --reader-surface-alt: rgba(30, 45, 70, 0.9);
  --reader-text: #f1f5f9;
  --reader-heading: #ffffff;
  --reader-muted: #94a3b8;
  --reader-border: rgba(148, 163, 184, 0.25);
  --reader-shadow: rgba(0, 0, 0, 0.4);
}

body[data-reader-theme="light"],
body[data-reader-theme="dark"] {
  background: var(--reader-bg) !important;
  color: var(--reader-text) !important;
}

/* Dark mode specific overrides for better visibility */
body[data-reader-theme="dark"] .info-card,
body[data-reader-theme="dark"] .model-card,
body[data-reader-theme="dark"] .safety-card,
body[data-reader-theme="dark"] .compare-card,
body[data-reader-theme="dark"] .cmp-card,
body[data-reader-theme="dark"] .cc,
body[data-reader-theme="dark"] .pipe-card,
body[data-reader-theme="dark"] .wide-card,
body[data-reader-theme="dark"] .concept-card,
body[data-reader-theme="dark"] .tl-card,
body[data-reader-theme="dark"] .timeline-item,
body[data-reader-theme="dark"] .timeline-event,
body[data-reader-theme="dark"] .highlight,
body[data-reader-theme="dark"] .category-section,
body[data-reader-theme="dark"] .cat-section,
body[data-reader-theme="dark"] .chapter {
  background: rgba(25, 35, 55, 0.95) !important;
  border-color: rgba(100, 130, 180, 0.3) !important;
}

body[data-reader-theme="dark"] h1,
body[data-reader-theme="dark"] h2,
body[data-reader-theme="dark"] h3,
body[data-reader-theme="dark"] h4,
body[data-reader-theme="dark"] .section-title,
body[data-reader-theme="dark"] .chapter-title,
body[data-reader-theme="dark"] .chap-title,
body[data-reader-theme="dark"] .model-name,
body[data-reader-theme="dark"] .service-name,
body[data-reader-theme="dark"] .concept-title,
body[data-reader-theme="dark"] .cmp-title,
body[data-reader-theme="dark"] .c-title,
body[data-reader-theme="dark"] .tn,
body[data-reader-theme="dark"] .tu {
  color: #ffffff !important;
}

body[data-reader-theme="dark"] p,
body[data-reader-theme="dark"] li,
body[data-reader-theme="dark"] .section-desc,
body[data-reader-theme="dark"] .chapter-desc,
body[data-reader-theme="dark"] .chap-desc,
body[data-reader-theme="dark"] .model-desc,
body[data-reader-theme="dark"] .service-desc,
body[data-reader-theme="dark"] .concept-desc,
body[data-reader-theme="dark"] .cmp-item,
body[data-reader-theme="dark"] .c-desc,
body[data-reader-theme="dark"] .c-en,
body[data-reader-theme="dark"] .td,
body[data-reader-theme="dark"] .ctag,
body[data-reader-theme="dark"] .tag {
  color: #c8d4e6 !important;
}

body[data-reader-theme="dark"] :is(.t1, .t2, .t3, .t4, .t5, .t6) {
  background: rgba(251, 146, 60, 0.16) !important;
  border: 1px solid rgba(251, 146, 60, 0.28) !important;
}

body[data-reader-theme="dark"] :is(.tg-g, .tg-y, .tg-r, .tg-p) {
  border: 1px solid rgba(148, 163, 184, 0.18) !important;
}

/* Dark mode table fixes */
body[data-reader-theme="dark"] table {
  background: rgba(20, 30, 50, 0.9) !important;
  border-color: rgba(100, 130, 180, 0.3) !important;
}

body[data-reader-theme="dark"] table th,
body[data-reader-theme="dark"] table thead th {
  background: rgba(40, 60, 90, 0.95) !important;
  color: #ffffff !important;
  border-color: rgba(100, 130, 180, 0.4) !important;
}

body[data-reader-theme="dark"] table td {
  background: rgba(25, 40, 60, 0.85) !important;
  color: #e2e8f0 !important;
  border-color: rgba(100, 130, 180, 0.25) !important;
}

body[data-reader-theme="dark"] table tr:nth-child(even) td {
  background: rgba(30, 45, 70, 0.85) !important;
}

body[data-reader-theme="dark"] table tr:hover td {
  background: rgba(50, 70, 100, 0.9) !important;
}

.article-progress {
  position: fixed;
  inset: 0 0 auto;
  height: 4px;
  z-index: 1400;
  background: rgba(255, 255, 255, 0.06);
  pointer-events: none;
}

.article-progress__bar {
  width: 100%;
  height: 100%;
  transform-origin: right center;
  transform: scaleX(var(--article-scroll-progress, 0));
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--article-accent, #7c3aed) 70%, white 30%),
    color-mix(in srgb, var(--article-accent, #7c3aed) 92%, white 8%)
  );
  box-shadow: 0 0 24px color-mix(in srgb, var(--article-accent, #7c3aed) 52%, transparent);
}

.article-ambient {
  position: fixed;
  inset: auto;
  width: 34rem;
  height: 34rem;
  border-radius: 999px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.42;
  filter: blur(70px);
  mix-blend-mode: screen;
  animation: articleAmbientFloat 18s ease-in-out infinite;
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--article-accent, #7c3aed) 34%, white 8%) 0%,
    transparent 70%
  );
}

.article-ambient--a {
  top: 8vh;
  right: -10rem;
}

.article-ambient--b {
  bottom: 8vh;
  left: -12rem;
  animation-delay: -9s;
}

.article-hero-orb {
  position: absolute;
  display: block;
  border-radius: 999px;
  pointer-events: none;
  opacity: 0.5;
  filter: blur(0);
  background: radial-gradient(
    circle,
    color-mix(in srgb, var(--article-accent, #7c3aed) 34%, white 8%) 0%,
    transparent 72%
  );
  animation: articleOrbFloat 12s ease-in-out infinite;
}

.article-hero-orb--a {
  top: 14%;
  right: 8%;
  width: 10rem;
  height: 10rem;
}

.article-hero-orb--b {
  bottom: 14%;
  left: 10%;
  width: 7rem;
  height: 7rem;
  animation-delay: -6s;
}

.site-header {
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  background: color-mix(in srgb, #0e0c15 84%, transparent);
}

[data-header-motion] {
  animation: articleHeaderDockIn 820ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

[data-header-motion-item] {
  opacity: 0;
  transform: translate3d(0, -0.8rem, 0);
  animation: articleHeaderItemIn 700ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--article-header-delay, 0ms);
}

.site-header-back {
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.18);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease,
    background-color 220ms ease;
}

.site-header-back:hover {
  transform: translateY(-0.15rem);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.22);
}

.hero {
  isolation: isolate;
  box-shadow: 0 26px 80px rgba(2, 6, 23, 0.16);
}

.article-enhanced .hero h1 {
  display: inline-block;
  max-width: min(100%, 13ch);
  line-height: 1.28 !important;
  padding-top: 0.18em;
  padding-bottom: 0.1em;
  overflow: visible;
  text-wrap: balance;
}

.article-enhanced .hero h2 {
  line-height: 1.5 !important;
  padding-top: 0.06em;
}

.article-enhanced .hero-badge {
  line-height: 1.55;
  padding-top: 0.48rem;
  padding-bottom: 0.36rem;
}

[data-hero-motion] {
  opacity: 0;
  transform: translate3d(0, 1.35rem, 0) scale(0.985);
  filter: saturate(0.9);
  animation: articleHeroRise 820ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--article-hero-delay, 0ms);
}

[data-hero-pill] {
  opacity: 0;
  transform: translate3d(0, 0.9rem, 0) scale(0.96);
  animation: articleHeroPillIn 680ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
  animation-delay: var(--article-hero-delay, 0ms);
}

[data-hero-motion] :is(img, svg) {
  will-change: transform, opacity;
}

.article-shell {
  position: relative;
  z-index: 1;
  max-width: 1720px;
  margin: -3.5rem auto 0;
  padding: 0 clamp(1rem, 2vw, 1.8rem) 5rem;
}

.article-shell__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) 17rem;
  gap: 1.5rem;
  align-items: start;
}

.article-shell__main {
  min-width: 0;
  font-size: calc(1rem * var(--reader-font-scale)) !important;
}

.article-shell__aside {
  position: sticky;
  top: 6rem;
  display: grid;
  gap: 1rem;
}

.article-shell__main > :is(
  .page,
  .section,
  .intro-section,
  .timeline,
  .container,
  .category-section,
  .cat-section,
  .compare-section,
  .chapter
) {
  width: 100% !important;
  max-width: min(100%, 1480px) !important;
  margin-inline: auto !important;
}

.article-shell__main .container {
  width: 100% !important;
  max-width: none !important;
  padding-inline: clamp(1rem, 2vw, 1.8rem) !important;
}

.article-shell__main > .page {
  width: 100% !important;
  max-width: min(100%, 1500px) !important;
}

.article-overview,
.article-sidebar-card,
.article-back-card,
.article-table-wrap {
  position: relative;
  overflow: hidden;
  border: 1px solid color-mix(in srgb, var(--article-accent, #7c3aed) 18%, rgba(148, 163, 184, 0.22));
  border-radius: 1.6rem;
  background: color-mix(in srgb, var(--card, rgba(255, 255, 255, 0.08)) 92%, transparent);
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.14);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.article-overview::before,
.article-sidebar-card::before,
.article-back-card::before,
.article-table-wrap::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--article-accent, #7c3aed) 12%, transparent), transparent 52%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--article-accent, #7c3aed) 14%, white 3%), transparent 38%);
  pointer-events: none;
}

.article-overview {
  display: grid;
  gap: 1.4rem;
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}

.article-overview__eyebrow,
.article-sidebar-card__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  width: fit-content;
  padding: 0.45rem 0.8rem;
  border-radius: 999px;
  border: 1px solid color-mix(in srgb, var(--article-accent, #7c3aed) 22%, transparent);
  background: color-mix(in srgb, var(--article-accent, #7c3aed) 9%, transparent);
  color: inherit;
  font-size: 0.78rem;
  font-weight: 700;
}

.article-overview__title {
  margin-top: 0.9rem;
  font-size: clamp(1.5rem, 2vw, 2.25rem);
  line-height: 1.25;
}

.article-overview__lead {
  margin-top: 0.65rem;
  opacity: 0.82;
  font-size: 1rem;
}

.article-overview__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.85rem;
}

.article-overview__stat {
  position: relative;
  display: grid;
  align-content: start;
  gap: 0.35rem;
  min-height: 6.4rem;
  padding: 1.15rem 1rem 1rem;
  border-radius: 1.2rem;
  border: 1px solid color-mix(in srgb, var(--article-accent, #7c3aed) 14%, rgba(148, 163, 184, 0.22));
  background: color-mix(in srgb, var(--article-accent, #7c3aed) 6%, transparent);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease,
    border-color 220ms ease;
}

.article-overview__stat:hover {
  transform: translateY(-0.24rem);
  box-shadow: 0 20px 38px rgba(15, 23, 42, 0.12);
  border-color: color-mix(in srgb, var(--article-accent, #7c3aed) 28%, var(--reader-border));
}

.article-overview__value {
  display: block;
  font-size: 1.2rem;
  font-weight: 800;
  line-height: 1.32;
  padding-top: 0.12rem;
  padding-bottom: 0.08rem;
  overflow: visible;
  font-family: "Cairo", "JetBrains Mono", "ALKATIP Basma", "Amiri", serif;
}

.article-overview__label {
  display: block;
  margin-top: 0;
  line-height: 1.5;
  font-size: 0.82rem;
  opacity: 0.72;
}

.article-sidebar-card,
.article-back-card {
  padding: 1.1rem;
}

.article-reader-card {
  position: relative;
  overflow: hidden;
  padding: 1.1rem;
  border-radius: 1.6rem;
  border: 1px solid var(--reader-border, rgba(148, 163, 184, 0.24));
  background: var(--reader-surface, rgba(255, 255, 255, 0.94));
  box-shadow: 0 24px 60px var(--reader-shadow, rgba(15, 23, 42, 0.12));
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.article-reader-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--article-accent, #7c3aed) 12%, transparent), transparent 55%),
    radial-gradient(circle at top right, color-mix(in srgb, var(--article-accent, #7c3aed) 10%, white 5%), transparent 38%);
  pointer-events: none;
}

.article-reader-card h2 {
  margin-top: 0.85rem;
  font-size: 1rem;
  color: var(--reader-heading, #020617);
}

.article-reader-meta {
  margin-top: 0.45rem;
  font-size: 0.88rem;
  color: var(--reader-muted, #475569);
}

.article-reader-group + .article-reader-group {
  margin-top: 1rem;
}

.article-reader-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.8rem;
  margin-bottom: 0.65rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--reader-muted, #475569);
}

.article-reader-size-value {
  color: var(--reader-heading, #020617);
}

.article-reader-buttons {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.55rem;
}

.article-reader-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 2.7rem;
  padding: 0.7rem 0.85rem;
  border: 1px solid var(--reader-border, rgba(148, 163, 184, 0.24));
  border-radius: 1rem;
  background: var(--reader-surface-alt, rgba(248, 250, 252, 0.86));
  color: var(--reader-heading, #020617);
  font: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    opacity 180ms ease;
}

.article-reader-button:hover {
  transform: translateY(-0.1rem);
  border-color: color-mix(in srgb, var(--article-accent, #7c3aed) 34%, var(--reader-border));
}

.article-reader-button.is-active {
  background: color-mix(in srgb, var(--article-accent, #7c3aed) 16%, var(--reader-surface-alt));
  border-color: color-mix(in srgb, var(--article-accent, #7c3aed) 34%, var(--reader-border));
}

.article-reader-button--wide {
  grid-column: 1 / -1;
}

.article-reader-share-note {
  margin-top: 0.7rem;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--reader-muted, #475569);
}

.article-sidebar-card h2 {
  margin-top: 0.85rem;
  font-size: 1rem;
}

.article-sidebar-card__progress {
  margin-top: 0.45rem;
  font-size: 0.88rem;
  opacity: 0.72;
}

.article-toc {
  display: grid;
  gap: 0.45rem;
  max-height: min(70vh, 40rem);
  margin-top: 0.95rem;
  padding-right: 0.2rem;
  overflow: auto;
}

.article-toc a {
  display: block;
  padding: 0.7rem 0.8rem;
  border-radius: 1rem;
  text-decoration: none;
  color: inherit;
  line-height: 1.55;
  font-size: 0.9rem;
  border: 1px solid transparent;
  transition:
    transform 180ms ease,
    border-color 180ms ease,
    background-color 180ms ease,
    opacity 180ms ease;
  opacity: 0.72;
}

.article-toc a:hover,
.article-toc a.is-active {
  opacity: 1;
  transform: translateX(-0.2rem);
  border-color: color-mix(in srgb, var(--article-accent, #7c3aed) 26%, transparent);
  background: color-mix(in srgb, var(--article-accent, #7c3aed) 10%, transparent);
}

.article-back-card__link {
  position: relative;
  overflow: hidden;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  width: 100%;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  text-decoration: none;
  color: #ffffff;
  font-weight: 700;
  background: linear-gradient(
    135deg,
    color-mix(in srgb, var(--article-accent, #7c3aed) 88%, black 12%),
    color-mix(in srgb, var(--article-accent, #7c3aed) 54%, white 16%)
  );
  box-shadow: 0 16px 32px color-mix(in srgb, var(--article-accent, #7c3aed) 24%, transparent);
  transition:
    transform 220ms ease,
    box-shadow 220ms ease;
}

.article-back-card__link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    115deg,
    transparent 12%,
    rgba(255, 255, 255, 0.16) 46%,
    transparent 76%
  );
  transform: translateX(120%);
  animation: articleShimmerSweep 5.2s linear infinite;
  pointer-events: none;
}

.article-back-card__link:hover {
  transform: translateY(-0.16rem);
  box-shadow: 0 20px 36px color-mix(in srgb, var(--article-accent, #7c3aed) 30%, transparent);
}

.article-back-card__hint {
  margin-top: 0.75rem;
  font-size: 0.85rem;
  opacity: 0.72;
}

.article-shell__main :is(
  .section,
  .intro-section,
  .timeline,
  .page,
  .chapter,
  .category-section,
  .cat-section,
  .compare-section,
  .section-title,
  .chapter-title,
  .chap-title,
  .category-title-wrap > h2,
  .cat-info > h2
) {
  color: var(--reader-heading) !important;
  scroll-margin-top: 7rem;
}

.article-shell__main :is(
  .info-card,
  .model-card,
  .safety-card,
  .compare-card,
  .cmp-card,
  .pipe-card,
  .wide-card,
  .concept-card,
  .tl-card,
  .timeline-item,
  .timeline-event,
  .highlight,
  .category-section,
  .cat-section,
  .compare-section,
  .chapter
) {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  transition:
    transform 260ms ease,
    box-shadow 260ms ease,
    border-color 260ms ease;
}

.article-shell__main :is(
  .info-card,
  .model-card,
  .safety-card,
  .compare-card,
  .cmp-card,
  .pipe-card,
  .wide-card,
  .concept-card,
  .tl-card,
  .timeline-item,
  .timeline-event,
  .highlight
)::after {
  content: "";
  position: absolute;
  inset: 1px;
  border-radius: inherit;
  background: radial-gradient(
    380px circle at var(--article-pointer-x, 50%) var(--article-pointer-y, 50%),
    color-mix(in srgb, var(--article-accent, #7c3aed) 20%, transparent),
    transparent 44%
  );
  opacity: 0;
  transition: opacity 220ms ease;
  pointer-events: none;
}

.article-shell__main :is(
  .info-card,
  .model-card,
  .safety-card,
  .compare-card,
  .cmp-card,
  .pipe-card,
  .wide-card,
  .concept-card,
  .tl-card,
  .timeline-item,
  .timeline-event,
  .highlight
):hover {
  transform: translateY(-0.35rem);
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.16);
}

.article-shell__main :is(
  .info-card,
  .model-card,
  .safety-card,
  .compare-card,
  .cmp-card,
  .pipe-card,
  .wide-card,
  .concept-card,
  .tl-card,
  .timeline-item,
  .timeline-event,
  .highlight
):hover::after {
  opacity: 1;
}

.article-overview,
.article-sidebar-card,
.article-back-card,
.article-table-wrap,
.article-reader-card,
.article-shell__main :is(
  .info-card,
  .model-card,
  .safety-card,
  .compare-card,
  .cmp-card,
  .cc,
  .pipe-card,
  .concept-card,
  .tl-card,
  .timeline-item,
  .highlight
) {
  background: var(--reader-surface) !important;
  border-color: var(--reader-border) !important;
  box-shadow: 0 24px 60px var(--reader-shadow) !important;
}

.article-shell__main :is(
  p,
  li,
  .section-sub,
  .section-desc,
  .chapter-desc,
  .chapter-en,
  .wc-desc,
  .concept-desc,
  .info-card p,
  .model-desc,
  .safety-card p,
  .svc-desc,
  .service-desc,
  .cmp-desc,
  .cmp-item,
  .c-desc,
  .c-en,
  .t-desc,
  .tl-event,
  .td,
  .td-desc,
  .ctag,
  .tag,
  .pipe-ug,
  .cat-info p,
  .category-title-wrap p
) {
  color: var(--reader-muted) !important;
  font-size: calc(0.98rem * var(--reader-font-scale)) !important;
  line-height: 1.92 !important;
}

.article-enhanced :is(
  pre,
  pre *,
  code,
  code *,
  .code-wrap,
  .code-header,
  .code-lang,
  .code-file
) {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate !important;
}

.article-enhanced pre {
  direction: ltr !important;
  text-align: left !important;
  unicode-bidi: isolate !important;
  writing-mode: horizontal-tb !important;
}

.article-enhanced .code-header {
  justify-content: space-between;
}

.article-shell__main :is(
  .section-title,
  .chapter-title,
  .chap-title,
  .category-title-wrap > h2,
  .cat-info > h2
) {
  position: relative;
  font-size: clamp(2rem, calc(1.95rem * var(--reader-font-scale)), 3rem) !important;
  line-height: 1.22 !important;
}

.article-shell__main :is(
  .section-title,
  .chapter-title,
  .chap-title,
  .category-title-wrap > h2,
  .cat-info > h2
)::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.42rem;
  width: min(11rem, 44%);
  max-width: 100%;
  height: 0.22rem;
  border-radius: 999px;
  opacity: 0.7;
  background: linear-gradient(
    90deg,
    color-mix(in srgb, var(--article-accent, #7c3aed) 86%, white 14%),
    transparent 82%
  );
  transform-origin: right center;
  animation: articleHeadingLine 3.6s ease-in-out infinite;
}

.article-shell__main .chap-hdr {
  position: relative;
  overflow: visible;
}

.article-shell__main .chap-hdr::after {
  content: "";
  position: absolute;
  inset: auto 0 -2px;
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent,
    color-mix(in srgb, var(--article-accent, #7c3aed) 70%, white 10%) 40%,
    transparent
  );
  transform-origin: right center;
  animation: articleChapterSweep 4.2s ease-in-out infinite;
  pointer-events: none;
  opacity: 0.75;
}

.article-shell__main .chap-num {
  box-shadow: 0 14px 26px color-mix(in srgb, var(--article-accent, #7c3aed) 16%, transparent);
  animation: articleBadgePulse 3.8s ease-in-out infinite;
}

.article-shell__main :is(
  h3,
  h4,
  .wc-title,
  .concept-title,
  .model-name,
  .service-name,
  .svc-name,
  .t-name,
  .cmp-title,
  .c-title,
  .tn,
  .tu,
  .td-name,
  .cmp-name,
  .pipe-name
) {
  color: var(--reader-heading) !important;
}

.article-shell__main :is(
  .service-uyghur,
  .svc-ug,
  .t-ug,
  .td-ug,
  .cmp-ug,
  .model-ug,
  .chapter-en,
  .chap-en
) {
  color: color-mix(in srgb, var(--article-accent, #7c3aed) 62%, var(--reader-muted) 38%) !important;
}

.article-shell__main table {
  color: var(--reader-text) !important;
}

.article-shell__main :is(th, td) {
  border-color: var(--reader-border) !important;
  font-size: calc(0.9rem * var(--reader-font-scale)) !important;
  line-height: 1.8 !important;
}

.article-shell__main thead th {
  background: color-mix(in srgb, var(--reader-surface) 84%, var(--article-accent, #7c3aed) 16%) !important;
  color: var(--reader-heading) !important;
}

.article-table-wrap {
  margin: 1.8rem 0;
  padding: 0.35rem;
  overflow: auto;
}

.article-table-wrap table {
  width: 100%;
  min-width: 42rem;
  margin: 0;
  border-radius: 1.2rem;
  overflow: hidden;
}

.article-table-wrap thead th {
  position: sticky;
  top: 0;
  z-index: 1;
}

.article-table-wrap tbody tr {
  transition:
    background-color 180ms ease,
    transform 180ms ease;
}

.article-table-wrap tbody tr:hover {
  background: color-mix(in srgb, var(--article-accent, #7c3aed) 9%, transparent);
}

[data-reveal] {
  opacity: 0;
  transform: translate3d(0, 1.35rem, 0) scale(0.985);
  transition:
    opacity 560ms ease,
    transform 560ms ease;
  transition-delay: var(--article-reveal-delay, 0ms);
}

[data-reveal].is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.footer {
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 -18px 36px rgba(15, 23, 42, 0.08);
}

.footer::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--article-accent, #7c3aed) 8%, transparent),
    transparent 40%
  );
  pointer-events: none;
}

.footer,
.footer p {
  color: var(--reader-muted) !important;
}

.footer {
  background: var(--reader-surface-alt) !important;
  border-top-color: var(--reader-border) !important;
}

.footer strong {
  color: color-mix(in srgb, var(--article-accent, #7c3aed) 62%, var(--reader-heading) 38%) !important;
}

.article-toast {
  position: fixed;
  left: 50%;
  bottom: 1.25rem;
  z-index: 1500;
  min-width: min(92vw, 22rem);
  max-width: 26rem;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  border: 1px solid var(--reader-border);
  background: var(--reader-surface);
  color: var(--reader-heading);
  box-shadow: 0 20px 40px var(--reader-shadow);
  transform: translate(-50%, 1rem);
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.article-toast.is-visible {
  opacity: 1;
  transform: translate(-50%, 0);
}

@keyframes articleAmbientFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -2rem, 0) scale(1.08);
  }
}

@keyframes articleOrbFloat {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -1.2rem, 0) scale(1.12);
  }
}

@keyframes articleHeaderDockIn {
  from {
    opacity: 0;
    transform: translate3d(0, -1rem, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes articleHeaderItemIn {
  from {
    opacity: 0;
    transform: translate3d(0, -0.9rem, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

@keyframes articleHeroRise {
  from {
    opacity: 0;
    transform: translate3d(0, 1.35rem, 0) scale(0.985);
    filter: blur(6px) saturate(0.86);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
    filter: blur(0) saturate(1);
  }
}

@keyframes articleHeroPillIn {
  from {
    opacity: 0;
    transform: translate3d(0, 0.9rem, 0) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

@keyframes articleHeadingLine {
  0%,
  100% {
    transform: scaleX(0.3);
    opacity: 0.45;
  }
  50% {
    transform: scaleX(1);
    opacity: 0.95;
  }
}

@keyframes articleChapterSweep {
  0%,
  100% {
    transform: scaleX(0.28);
    opacity: 0.35;
  }
  55% {
    transform: scaleX(1);
    opacity: 0.9;
  }
}

@keyframes articleBadgePulse {
  0%,
  100% {
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    transform: translate3d(0, -0.08rem, 0) scale(1.04);
  }
}

@keyframes articleShimmerSweep {
  0% {
    transform: translateX(120%);
  }
  100% {
    transform: translateX(-130%);
  }
}

@media (max-width: 1100px) {
  .article-shell {
    margin-top: -2rem;
  }

  .article-shell__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .article-shell__aside {
    position: static;
    order: -1;
  }
}

@media (max-width: 760px) {
  .article-shell {
    padding: 0 1rem 4rem;
  }

  .article-overview {
    padding: 1.1rem;
  }

  .article-overview__stats {
    grid-template-columns: 1fr;
  }

  .article-reader-buttons {
    grid-template-columns: 1fr 1fr;
  }

  .article-toc {
    max-height: none;
  }

  .article-ambient {
    width: 22rem;
    height: 22rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .article-ambient,
  .article-hero-orb,
  .article-shell__main .chap-num,
  .article-back-card__link::after,
  .article-shell__main .chap-hdr::after,
  .article-shell__main :is(
    .section-title,
    .chapter-title,
    .chap-title,
    .category-title-wrap > h2,
    .cat-info > h2
  )::after {
    animation: none;
  }

  [data-header-motion-item],
  [data-hero-motion],
  [data-hero-pill],
  [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
    filter: none;
  }

  .article-progress__bar,
  .article-toc a,
  .article-reader-button,
  .site-header-back,
  .article-overview__stat,
  .article-back-card__link,
  .article-shell__main :is(
    .info-card,
    .model-card,
    .safety-card,
    .compare-card,
    .cmp-card,
    .pipe-card,
    .wide-card,
    .concept-card,
    .tl-card,
    .timeline-item,
    .timeline-event,
    .highlight
  ) {
    transition: none;
  }
}
