:root {
  --primary: #2563eb;
  --primary-soft: rgba(37, 99, 235, 0.08);
  --primary-strong: #1d4ed8;
  --accent: #f97316;
  --bg: #f1f5f9;
  --border-subtle: #e2e8f0;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --card-bg: #ffffff;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius-xl: 18px;
  --radius-2xl: 22px;
  --radius-full: 999px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

html,
body {
  width: 100%;
  max-width: 100%;
  /* overflow-x: hidden; */
  overflow-x: clip !important;   
}


.container,
.innercontent,
.layout {
  max-width: 100%;
}

/* === Global font size override (Chrome-safe) === */

/* Base font size for the whole page */
html,
body {
  font-size: 18px !important;   /* clearly larger */
  line-height: 1.7;
}

/* Main content boost – applies even if containers set their own font-size */
.main-content,
.container {
  font-size: 1rem !important;
}

.innercontent {
  font-size: .6rem !important;
}

/* Make text elements clearly larger */
p,
li,
td,
th,
summary,
.details,
.exercise,
.summary-card,
.lang-block,
.design-block {
  font-size: 1.06rem !important;
}

/* Headings slightly larger too (optional) */
h2 {
  font-size: 1.5rem !important;
}

h3 {
  font-size: 1.22rem !important;
}


body.coursenotes {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 20px !important; /* larger base font */
  color: var(--text-main);
  background:
    radial-gradient(circle at 0 0, rgba(37, 99, 235, 0.07), transparent 55%),
    radial-gradient(circle at 100% 100%, rgba(14, 165, 233, 0.06), transparent 50%),
    var(--bg);
  animation: backgroundShift 18s ease-in-out infinite alternate;

}

@keyframes backgroundShift {
  0% {
    background-position: 0 0, 100% 100%;
  }
  50% {
    background-position: 10% 8%, 90% 90%;
  }
  100% {
    background-position: 4% 12%, 96% 80%;
  }
}

.container {
  max-width: 80%;
  /* max-width: 1420px; */
  margin: 0 auto;
  /* padding: 28px 16px 96px; */
}

.innercontent {
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(16px);
  border-radius: 28px;
  box-shadow: var(--shadow-soft);
  padding: 28px 24px 44px;
}

@media (min-width: 992px) {
  .innercontent {
    padding: 32px 32px 48px;
  }
}



/* ---- Side nav + main content layout ---- */
.layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr); /* nav + main */
  gap: 24px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .side-nav {
    position: static;
    max-height: none;
    margin-bottom: 18px;
  }
}


/* Layout: side navigation + main content */
.layout {
  display: grid;
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 26px;
}

@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }
  .side-nav {
    position: static;
    max-height: none;
    margin-bottom: 18px;
  }
}

.side-nav {
  position: sticky;
  top: 18px;
  align-self: flex-start;
  background: linear-gradient(135deg, #eff6ff, #f9fafb);
  border-radius: 24px;
  padding: 16px 14px 18px;
  border: 1px solid #dbeafe;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.05);
  font-size: 0.95rem;
  /* make nav scrollable by itself */
  max-height: 120vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.side-nav::-webkit-scrollbar {
  width: 6px;
}
.side-nav::-webkit-scrollbar-track {
  background: transparent;
}
.side-nav::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.7);
  border-radius: 999px;
}

.side-nav-title {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin: 0 0 4px;
  display: flex;
  align-items: center;
  gap: 6px;
  color: #0f172a;
}

.side-nav-badge {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.07);
  color: #1d4ed8;
  border: 1px solid rgba(37, 99, 235, 0.18);
}

.side-nav-subtitle {
  margin: 0 0 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.side-nav ul {
  list-style: none;
  padding-left: 0;
  margin: 0;
}

.side-nav li {
  margin-bottom: 6px;
}

.side-nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  border-bottom: none;
  color: var(--text-muted);
  font-weight: 500;
  padding: 7px 9px;
  border-radius: 999px;
  text-decoration: none;
  transition: background 0.18s ease, color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
  position: relative;
  overflow: hidden;
}

.side-nav a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.7);
  transition: background 0.18s ease, transform 0.18s ease;
}

.side-nav a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.25), transparent 60%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.side-nav a:hover {
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary-strong);
  transform: translateX(2px);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.12);
}

.side-nav a:hover::before {
  background: var(--primary);
  transform: scale(1.35);
}

.side-nav a:hover::after {
  opacity: 1;
}

.side-nav {
      height: calc(100vh - 160px);   /* adjust number if needed */
      overflow-y: auto;
    }

/* Header */
.page-header {
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-subtle);
}

.page-kicker {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--accent);
  font-weight: 600;
  margin-bottom: 4px;
}

.page-title {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: clamp(2.0rem, 3vw, 2.4rem);
  margin: 0;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
}

.page-title span {
  font-size: 1rem;
  font-weight: 500;
  color: var(--primary-strong);
  background: rgba(37, 99, 235, 0.08);
  border-radius: 999px;
  padding: 4px 10px;
}

.page-subtitle {
  margin: 10px 0 0;
  font-size: 1.02rem;
  color: var(--text-muted);
  max-width: 750px;
  line-height: 1.7;
}

.page-meta {
  margin-top: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.meta-pill {
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.5);
}

/* Content */
.main-content {
  padding-top: 4px;
  font-size: 1.02rem;
}

h2 {
  font-family: "Outfit", system-ui, sans-serif;
  font-size: 1.4rem;
  margin-top: 30px;
  margin-bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  scroll-margin-top: 80px;
}

h2 .section-tag {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  color: var(--primary-strong);
}

h3 {
  font-size: 1.16rem;
  margin-top: 24px;
  margin-bottom: 8px;
}

p {
  line-height: 1.75;
  font-size: 1.02rem;
  color: var(--text-main);
}

.muted {
  color: var(--text-muted);
}

ul, ol {
  padding-left: 1.2rem;
  line-height: 1.7;
  font-size: 1rem;
}

dfn {
  font-style: normal;
  background: rgba(251, 191, 36, 0.12);
  border-radius: 999px;
  padding: 0 6px;
}

code {
  font-size: 0.95rem;
  background: rgba(15, 23, 42, 0.04);
  padding: 2px 5px;
  border-radius: 6px;
}

pre.prettyprint {
  border-radius: 12px !important;
  padding: 10px 12px !important;
  background: #020617 !important;
  color: #e5e7eb;
  font-size: 0.9rem;
}

/* Concept + animation bits */
.concept-grid {
  display: grid;
  /* grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); */
  grid-template-columns: repeat(2, minmax(0, 1fr)); /* exactly two per row */
  gap: 14px;
  margin: 10px 0 4px;
}
/* On small screens, fall back to one per row */
@media (max-width: 720px) {
  .concept-grid {
    grid-template-columns: 1fr;
  }
}
.concept-card {
  background: var(--card-bg);
  border-radius: 18px;
  padding: 12px 13px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.03);
  position: relative;
  overflow: hidden;
  transform-origin: center;
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.concept-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.18), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.concept-card:hover {
  transform: translateY(-3px) scale(1.015);
  box-shadow: 0 16px 34px rgba(15, 23, 42, 0.09);
  border-color: rgba(37, 99, 235, 0.55);
}

.concept-card:hover::before {
  opacity: 1;
}

.concept-label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.concept-title {
  font-weight: 600;
  font-size: 1rem;
  margin-bottom: 4px;
}

.concept-text {
  font-size: 0.95rem;
  color: var(--text-muted);
}

/* Fancy 2-per-row concept cards */
.fancy-two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.fancy-card {
  position: relative;
  border-radius: 22px;
  padding: 18px 20px;
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.08),
    rgba(14, 165, 233, 0.06)
  );
  border: 1px solid rgba(37, 99, 235, 0.28);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  overflow: hidden;
}

.fancy-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    circle at top left,
    rgba(59, 130, 246, 0.18),
    transparent 65%
  );
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.fancy-card:hover {
  transform: translateY(-4px) scale(1.015);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

.fancy-card:hover::before {
  opacity: 1;
}

.concept-icon {
  font-size: 1.75rem;
  margin-bottom: 6px;
  opacity: 0.9;
}

.fancy-card .concept-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 6px;
}

/* “Timeline” visualization */
.timeline {
  margin: 10px 0;
  padding: 12px 16px;
  border-radius: 20px;
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.08), rgba(56, 189, 248, 0.05));
  border: 1px solid rgba(37, 99, 235, 0.28);
  position: relative;
  overflow: hidden;
}

.timeline-list {
  list-style: none;
  margin: 0;
  padding-left: 0;
}

.timeline-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  align-items: start;
  gap: 14px;
  padding: 6px 0;
  position: relative;
}

.timeline-year {
  font-weight: 600;
  color: var(--primary-strong);
}

.timeline-dot {
  position: absolute;
  left: 82px;
  top: 17px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: var(--primary-strong);
  box-shadow: 0 0 0 7px rgba(37, 99, 235, 0.15);
}

.timeline-line {
  position: absolute;
  left: 85px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: linear-gradient(to bottom, rgba(148, 163, 184, 0), rgba(148, 163, 184, 0.9));
}

/* Key concept “pulse” animation */
.key-concept {
  position: relative;
  margin: 16px 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: linear-gradient(120deg, rgba(37, 99, 235, 0.08), rgba(56, 189, 248, 0.05));
  border: 1px solid rgba(37, 99, 235, 0.28);
  overflow: hidden;
}

.key-concept::before {
  content: "";
  position: absolute;
  width: 260px;
  height: 260px;
  background: radial-gradient(circle, rgba(59, 130, 246, 0.4), transparent 65%);
  top: -140px;
  left: -120px;
  opacity: 0.4;
  animation: conceptPulse 7s infinite ease-in-out alternate;
  pointer-events: none;
}

@keyframes conceptPulse {
  0%   { transform: translate3d(0,0,0) scale(1); opacity: 0.4; }
  50%  { transform: translate3d(12px,8px,0) scale(1.08); opacity: 0.6; }
  100% { transform: translate3d(8px,10px,0) scale(1.02); opacity: 0.45; }
}

.key-concept h3 {
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 1.1rem;
}

.key-concept h3 span {
  font-size: 0.8rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.15);
  color: #e5e7eb;
  text-transform: uppercase;
  letter-spacing: 0.14em;
}

.key-concept p {
  margin-bottom: 4px;
  position: relative;
  z-index: 1;
}

/* Simple diagram boxes */
.diagram-row {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin: 10px 0;
}

.diagram-box {
  flex: 1 1 190px;
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  padding: 10px 12px;
  background: rgba(248, 250, 252, 0.9);
  position: relative;
  overflow: hidden;
}

.diagram-box-title {
  font-weight: 600;
  font-size: 0.98rem;
  margin-bottom: 4px;
}

.diagram-arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

/* Images & videos */
.media-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 12px 0 4px;
  align-items: start;
}

.media-card {
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  padding: 10px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
  position: relative;
  overflow: hidden;
}

.media-card img {
  max-width: 100%;
  border-radius: 14px;
  display: block;
}

.media-caption {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-top: 6px;
  text-align: center;
}

.video-wrapper {
  position: relative;
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
  background: #020617;
  box-shadow: 0 14px 38px rgba(15, 23, 42, 0.45);
}

.video-wrapper::before {
  content: "";
  display: block;
  padding-bottom: 56.25%; /* 16:9 */
}

.video-wrapper iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

.video-fallback {
  margin-top: 6px;
  font-size: 0.9rem;
  text-align: center;
}

.video-fallback a {
  color: var(--primary-strong);
  text-decoration: none;
  font-weight: 500;
}

.video-fallback a:hover {
  text-decoration: underline;
}

/* Exercises */
.exercise-section-title {
  margin-top: 26px;
  font-size: 1.15rem;
  font-weight: 600;
}

.exercise {
  margin: 12px 0 14px;
  padding: 12px 13px;
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: #f9fafb;
  position: relative;
  overflow: hidden;
}

.exercise::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 0 0, rgba(59, 130, 246, 0.18), transparent 55%);
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.exercise:hover::before {
  opacity: 1;
}

.exercise-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 6px;
}

.exercise-title {
  font-weight: 600;
  font-size: 1rem;
}

.difficulty-pill {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 2px 8px;
  border-radius: 999px;
  border: 1px solid transparent;
}

.difficulty-easy .difficulty-pill {
  background: rgba(34, 197, 94, 0.1);
  border-color: rgba(22, 163, 74, 0.5);
  color: #166534;
}

.difficulty-medium .difficulty-pill {
  background: rgba(234, 179, 8, 0.12);
  border-color: rgba(202, 138, 4, 0.7);
  color: #854d0e;
}

.difficulty-hard .difficulty-pill {
  background: rgba(239, 68, 68, 0.12);
  border-color: rgba(220, 38, 38, 0.7);
  color: #991b1b;
}

.exercise p {
  font-size: 0.98rem;
  margin: 4px 0 6px;
}

.example-frame {
  margin-top: 12px;
  padding: 12px 16px;
  border: 2px solid #d0d0e0;
  border-radius: 8px;
  background: #fafbff;
  box-shadow: 0 2px 4px rgba(0,0,0,0.05);
}

.example-frame h4 {
  margin-top: 0;
  font-size: 1rem;
  font-weight: 600;
  color: #334;
}

details.hint,
details.answer {
  margin-top: 4px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.03);
  padding: 4px 10px 6px;
}

details summary {
  list-style: none;
  cursor: pointer;
  font-size: 0.94rem;
  color: var(--primary-strong);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

details summary::before {
  content: "▶";
  font-size: 0.7rem;
  transition: transform 0.18s ease;
}

details[open] summary::before {
  transform: rotate(90deg);
}

details p {
  font-size: 0.94rem;
  margin-top: 4px;
}

/* Summary section */
/* === Updated Summary Section (Readable Light Theme) === */
.summary-card {
  margin-top: 32px;
  padding: 22px 24px;
  border-radius: 22px;

  /* new light, readable background */
  background: linear-gradient(135deg, #eef6ff 0%, #f8fbff 50%, #ffffff 100%);
  border: 1px solid rgba(148, 163, 184, 0.35);

  /* text color becomes dark for contrast */
  color: var(--text-main);

  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.summary-card h2 {
  color: var(--text-main);
  margin-top: 0;
}

.summary-card ul {
  color: var(--text-main);
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-top: 12px;
}

/* Chips updated for readability */
.summary-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.summary-chip {
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
  border: 1px solid rgba(37, 99, 235, 0.35);
  color: var(--primary-strong);
  font-size: 0.85rem;
  font-weight: 500;
}

/* Back to top button */
#myBtn {
  position: fixed;
  bottom: 18px;
  right: 18px;
  z-index: 50;
  background: #0f172a;
  color: #e5e7eb;
  border: none;
  border-radius: 999px;
  padding: 8px 11px;
  font-size: 0.9rem;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.45);
  opacity: 0.9;
}

#myBtn:hover {
  opacity: 1;
  transform: translateY(-1px);
}

/* Fancy styling just for the data examples block */
#data-examples {
  margin-top: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.data-category-block {
  background: radial-gradient(circle at top left, #f5fbff 0, #fdfdff 40%, #f8f9ff 100%);
  border: 1px solid rgba(80, 120, 255, 0.18);
  border-radius: 18px;
  padding: 1.4rem 1.6rem;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
  position: relative;
  overflow: hidden;
}

.data-category-block::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(circle at top right, rgba(129, 140, 248, 0.12), transparent 60%);
  opacity: 0.9;
}

.data-category-inner {
  position: relative; /* keep content above ::before */
  z-index: 1;
}

.data-category-header {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 0.35rem;
}

.data-category-pill {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
  padding: 0.1rem 0.5rem;
  border-radius: 999px;
  background: rgba(79, 70, 229, 0.06);
  color: #4f46e5;
}

.data-category-title {
  font-size: 1.08rem;
  font-weight: 650;
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.data-category-title-icon {
  font-size: 1.1rem;
}

.data-category-block p {
  margin: 0.35rem 0 0.65rem;
  line-height: 1.5;
}

.data-category-block strong {
  display: inline-block;
  margin-bottom: 0.35rem;
}

.example-unstructured,
.example-json {
  background: #0b1020;
  color: #e5e7eb;
  border-radius: 12px;
  padding: 0.7rem 0.85rem;
  font-size: 0.8rem;
  line-height: 1.5;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.45);
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.4);
}

.example-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 0.35rem;
  font-size: 0.8rem;
  background: #ffffff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 1px 0 rgba(148, 163, 184, 0.35);
}

.example-table thead {
  background: linear-gradient(to right, #eef2ff, #e0f2fe);
}

.example-table th,
.example-table td {
  padding: 0.5rem 0.6rem;
  text-align: left;
  border-bottom: 1px solid #e5e7eb;
  white-space: nowrap;
}

.example-table tbody tr:last-child td {
  border-bottom: none;
}

.example-table th {
  font-weight: 600;
  font-size: 0.78rem;
  color: #4b5563;
}

.example-table td {
  font-size: 0.78rem;
  color: #111827;
}

@media (max-width: 768px) {
  .example-table {
    display: block;
    overflow-x: auto;
  }
}
/* Force 2 cards per row for the advantages section */
.advantages-two-col {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

/* On small screens, auto-switch to 1 column */
@media (max-width: 700px) {
  .advantages-two-col {
    grid-template-columns: 1fr;
  }
}



.three-level-diagram {
  margin: 14px 0 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}

/* Top blue rectangle */
.three-level-view-layer {
  background: #e0f2fe;
  border-radius: 10px;
  border: 1px solid #bfdbfe;
  padding: 14px 18px 16px;
  min-width: min(100%, 520px);
  position: relative;
}

.three-level-view-title {
  text-align: center;
  font-size: 0.96rem;
  font-weight: 600;
  color: #0f172a;
  margin-bottom: 8px;
}

.three-level-view-row {
  display: flex;
  align-items: center;
  justify-content: space-evenly;
  gap: 14px;
}

.three-level-view-box {
  background: #f8fafc;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 18px;
  font-size: 0.95rem;
  color: #0f172a;
}

.three-level-view-dots {
  font-size: 1.4rem;
  color: #0f172a;
}

/* Middle + bottom boxes with vertical line */
/* Middle + bottom boxes with vertical line BEHIND */
.three-level-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  padding-top: 4px;
  z-index: 0; /* ensure the line stays behind, boxes stay above */
}

/* vertical connector line BEHIND boxes */
.three-level-stack::before {
  content: "";
  position: absolute;
  top: -18px;
  bottom: 16px;
  width: 2px;
  background: #94a3b8;
  z-index: -1;  /* <-- critical: put line behind everything */
}

/* logical + physical boxes ABOVE the line */
.three-level-box {
  background: #e5f0fb;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 6px 18px;
  font-size: 0.95rem;
  color: #0f172a;
  text-align: center;
  min-width: 130px;
  position: relative;
  z-index: 1; /* keep boxes above the connector line */
}


.data-model-examples {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 22px;
  margin-top: 16px;
}

.data-model-card {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 18px 20px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.data-model-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
}

.data-model-title {
  margin-top: 0;
  font-weight: 600;
  margin-bottom: 8px;
}

.data-model-visual {
  margin: 10px 0;
  text-align: center;
}

.data-model-visual img {
  max-width: 100%;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.4);
}

.example-snippet {
  background: #0b1020;
  color: #e5e7eb;
  border-radius: 10px;
  padding: 10px 12px;
  font-size: 0.85rem;
  overflow-x: auto;
  white-space: pre;
  line-height: 1.4;
}

/* Container for all four examples */
.data-model-examples-inline {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
  margin-top: 16px;
}

/* Card style (reuses your aesthetic) */
.data-model-card {
  background: var(--card-bg);
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  padding: 16px 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.04);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.data-model-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.10);
}

.data-model-title {
  margin-top: 0;
  margin-bottom: 6px;
  font-size: 1.05rem;
  font-weight: 600;
}

.data-model-visual {
  margin-top: 8px;
}

.dm-caption {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 4px 0;
}

/* Smaller tables for relational example */
.dm-small-table {
  margin-top: 4px;
  margin-bottom: 8px;
}

/* Code-style block for JSON etc. */
.dm-code-block {
  background: #0b1020;
  color: #e5e7eb;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.82rem;
  line-height: 1.45;
  overflow-x: auto;
  border: 1px solid rgba(148, 163, 184, 0.45);
}

/* Key–value visualization */
.dm-kv-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 6px;
}

.dm-kv-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 2fr);
  gap: 6px;
  align-items: center;
  font-size: 0.86rem;
}

.dm-kv-key {
  padding: 4px 6px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.06);
  border: 1px solid rgba(37, 99, 235, 0.3);
  font-family: "Inter", system-ui, sans-serif;
}

.dm-kv-arrow {
  text-align: center;
  font-size: 1rem;
}

.dm-kv-value {
  padding: 4px 6px;
  border-radius: 10px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(148, 163, 184, 0.6);
  font-family: "Inter", system-ui, sans-serif;
}

/* Inline SVG graph styling */
.dm-graph-svg {
  width: 100%;
  max-width: 260px;
  display: block;
  margin: 4px auto 0;
}

.dm-graph-edge {
  stroke: #94a3b8;
  stroke-width: 2;
}

.dm-graph-node circle {
  fill: #e0f2fe;
  stroke: #60a5fa;
  stroke-width: 1.5;
}

.dm-graph-node text {
  font-size: 0.78rem;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: #0f172a;
}

.dm-graph-node-sub {
  font-size: 0.7rem;
  fill: #6b7280;
}

.dm-graph-edge-label {
  font-size: 0.7rem;
  fill: #475569;
}

/* Wrapper ensures styles do NOT affect other tables */
#summary-table-wrapper {
  margin-top: 18px;
}

/* Entire table fits page */
#summary-table-wrapper .summary-table {
  width: 100%;
  table-layout: fixed;         /* forces fixed column layout */
  border-collapse: collapse;
  font-size: 0.92rem;
  background: white;
}

/* Column widths */
#summary-table-wrapper .summary-table th:nth-child(1),
#summary-table-wrapper .summary-table td:nth-child(1) {
  width: 18%;
}

#summary-table-wrapper .summary-table th:nth-child(2),
#summary-table-wrapper .summary-table td:nth-child(2) {
  width: 52%;
}

#summary-table-wrapper .summary-table th:nth-child(3),
#summary-table-wrapper .summary-table td:nth-child(3) {
  width: 30%;
}

/* Header cells */
#summary-table-wrapper .summary-table th {
  background: #eef2ff;
  border-bottom: 1px solid #cbd5e1;
  padding: 10px;
  text-align: left;
}

/* Data cells */
#summary-table-wrapper .summary-table td {
  padding: 8px 10px;
  vertical-align: top;

  /* THE CRITICAL WRAPPING FIX */
  white-space: normal !important;   /* forces wrapping */
  word-break: break-word;           /* breaks long items */
  overflow-wrap: anywhere;          /* if needed, break anywhere */

  line-height: 1.45;
  border-bottom: 1px solid #e5e7eb;
}

.lang-block {
  background: linear-gradient(145deg, #f8fafc, #ffffff);
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  padding: 20px 22px;
  margin-top: 26px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.lang-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.lang-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.lang-icon {
  font-size: 1.35rem;
}

.lang-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.22rem;
  font-weight: 600;
  color: #1e3a8a;
}

.fancy-list {
  padding-left: 20px;
  line-height: 1.65;
  font-size: 1rem;
}

.fancy-list li {
  margin-bottom: 4px;
}


.design-block {
  background: linear-gradient(145deg, #f8fafc, #ffffff);
  border: 1px solid #dbe3ee;
  border-radius: 16px;
  padding: 22px 24px;
  margin-top: 28px;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.design-block:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.12);
}

.design-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.design-icon {
  font-size: 1.4rem;
}

.design-title {
  font-family: "Outfit", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  color: #1d4ed8;
}

.design-highlight {
  background: rgba(59, 130, 246, 0.05);
  padding: 12px 16px;
  border-left: 4px solid #3b82f6;
  border-radius: 10px;
  margin-top: 12px;
}

.design-highlight ul {
  margin-top: 6px;
  padding-left: 20px;
  line-height: 1.65;
}

/* === Fancy "Go to Top" Button === */
#backToTop {
  position: fixed;
  bottom: 22px;
  right: 22px;

  width: 48px;
  height: 48px;
  border-radius: var(--radius-full);
  border: 1px solid rgba(37, 99, 235, 0.35);

  background: linear-gradient(145deg, #ffffff, #eef2ff);
  color: var(--primary-strong);
  font-weight: 700;
  font-size: 1.1rem;

  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.18);
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  opacity: 0;
  pointer-events: none;
  transition:
    opacity 0.25s ease,
    transform 0.25s ease,
    box-shadow 0.25s ease,
    background 0.25s ease;
}

#backToTop:hover {
  transform: translateY(-4px) scale(1.06);
  background: linear-gradient(145deg, #eef6ff, #ffffff);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.28);
}


/* ======================================= */


.schema-grid {
  display: flex;
  align-items: center;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.schema-box {
  background: #f8fafc;
  border-radius: 14px;
  padding: 0.9rem 1.1rem;
  min-width: 160px;
}

.schema-box.highlight {
  background: #ecfeff;
  border: 2px solid #67e8f9;
}

.schema-title {
  font-weight: 600;
  margin-bottom: 0.4rem;
}

.schema-box ul {
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: 0.9rem;
}

.schema-arrow {
  font-size: 1.6rem;
  animation: pulseArrow 2s infinite;
}
.table-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.2rem;
}

.table-label {
  font-weight: 600;
  margin-bottom: 0.3rem;
}

.link-row {
  animation: rowHighlight 2.8s infinite;
}

.qp-viz .qp-node{
    fill: rgba(59, 130, 246, 0.08);
    stroke: rgba(15, 23, 42, 0.35);
    stroke-width: 2;
  }
  .qp-viz .qp-text{
    font-size: 18px;
    font-weight: 800;
    fill: rgba(15, 23, 42, 0.92);
  }
  .qp-viz .qp-sub{
    font-size: 13px;
    font-weight: 600;
    fill: rgba(15, 23, 42, 0.72);
  }
  .qp-viz .qp-cap{
    font-size: 13px;
    font-weight: 700;
    fill: rgba(15, 23, 42, 0.7);
  }
  .qp-viz .qp-arrow{
    fill: none;
    stroke: rgba(15, 23, 42, 0.65);
    stroke-width: 4;
    stroke-dasharray: 10 10;
    animation: qpDash 2.2s linear infinite;
  }
  @keyframes qpDash { to { stroke-dashoffset: -40; } }

  .fade-in {
      animation: fadeInUp 0.6s ease both;
    }
    .fade-in-delay {
      animation: fadeInUp 0.8s ease both;
    }
    @keyframes fadeInUp {
      from { opacity: 0; transform: translateY(12px); }
      to   { opacity: 1; transform: translateY(0); }
    }
    .hover-lift {
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .hover-lift:hover {
      transform: translateY(-3px);
      box-shadow: 0 14px 35px rgba(15, 23, 42, 0.16);
    }
    .exercise {
      transition: transform 0.2s ease, box-shadow 0.2s ease;
    }
    .exercise:hover {
      transform: translateY(-2px);
      box-shadow: 0 12px 30px rgba(15, 23, 42, 0.14);
    }
    .subheading {
      font-weight: 600;
      margin-top: 1.2rem;
      margin-bottom: 0.35rem;
    }



/* ======================================= module 3 */ 

     .cs-arrow { font-size: 2rem; opacity: .75; }
  .mysql-cs .cs-arrow { animation: nudgeArrow 1.6s ease-in-out infinite; }
  @keyframes nudgeArrow { 0%,100%{ transform: translateX(0);} 50%{ transform: translateX(6px);} }
  @media (prefers-reduced-motion: reduce) { .mysql-cs .cs-arrow { animation: none !important; } }
  .step-pop { animation: popIn .55s ease both; }
  @keyframes popIn { from{ opacity:0; transform: translateY(8px) scale(.98);} to{ opacity:1; transform: translateY(0) scale(1);} }

    @media (prefers-reduced-motion: reduce) {
    .fade-in { animation: none !important; }
  }


  /* 1) ensure decorative layers don't capture clicks */
.exercise::before, .data-category-block::before, .fancy-card::before { pointer-events:none !important; }

/* 2) let details sit above stacking quirks */
details { position: relative; z-index: 5; }


.concept-card::before,
.concept-card::after {
  pointer-events: none !important;
}

.concept-card,
.concept-card * {
  -webkit-user-select: text;
  user-select: text;
}


.video-wrapper.limited {
  width: 50%;
  max-width: 800px;
  margin: 0 auto;
}


/* ===================================================== */
/* Footer */
/* ===================================================== */
.course-footer {
  margin-top: 48px;
  padding-top: 18px;
  border-top: 1px solid var(--border-subtle);
  text-align: center;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.course-footer .footer-note {
  margin-top: 6px;
  font-size: 0.85rem;
}

/* ===================================================== */
/* Module-specific enhancements (Document-level helpers) */
/* ===================================================== */

/* SVG stroke animations */
.nf-flow path {
  stroke-dasharray: 140;
  stroke-dashoffset: 140;
  animation: dash 2.2s ease forwards;
}

.arrow-anim path {
  stroke-dasharray: 260;
  stroke-dashoffset: 260;
  animation: dash 2.4s ease forwards;
}

@keyframes dash {
  to { stroke-dashoffset: 0; }
}

/* Responsive scroll box */
#box {
  max-width: 100%;
  height: 320px;
  overflow: auto;
  border-radius: 16px;
  border: 1px solid rgba(148,163,184,0.45);
  background: rgba(2,6,23,0.03);
  padding: 8px;
}

/* Collapsible table of contents */
details#contents > summary {
  list-style: none;
  cursor: pointer;
  font-size: 1.02rem;
  color: var(--primary-strong);
  display: flex;
  align-items: center;
  gap: 8px;
}

details#contents > summary::before {
  content: "▸";
  transition: transform 0.18s ease;
  font-size: 0.95rem;
}

details#contents[open] > summary::before {
  transform: rotate(90deg);
}

/* Subtle reveal animations */
.fade-in {
  animation: fadeInUp .65s ease both;
}

.fade-in-delay {
  animation: fadeInUp .65s ease .12s both;
}

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Ensure note title section does not add spacing */
section.notetitle {
  margin: 0;
}


/* =========================================================
   Module-specific polish (shared utilities across modules)
========================================================= */

/* Tiny "chip" row for quick facts */
.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 10px;
}
.chip {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.07);
  border: 1px solid rgba(37, 99, 235, 0.18);
  color: #1d4ed8;
  font-weight: 600;
  font-size: 0.88rem;
}

/* Simple animated arrows for diagrams */
.dash-move {
  stroke-dasharray: 8 10;
  animation: dashMove 2s linear infinite;
}
@keyframes dashMove { to { stroke-dashoffset: -52; } }

/* Active nav link highlight (works with your side-nav styling) */
.side-nav a.active {
  background: rgba(37, 99, 235, 0.10);
  color: var(--primary-strong);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.10);
}

/* Small note blocks */
.callout {
  border-radius: 18px;
  padding: 12px 14px;
  background: linear-gradient(
    120deg,
    rgba(37, 99, 235, 0.08),
    rgba(56, 189, 248, 0.05)
  );
  border: 1px solid rgba(37, 99, 235, 0.25);
  margin: 12px 0;
}
.callout b { color: #0f172a; }

/* Mini comparison table */
table.compact {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  overflow: hidden;
  border-radius: 14px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(255,255,255,0.92);
}
table.compact th, table.compact td {
  padding: 10px 10px;
  border-bottom: 1px solid rgba(148,163,184,0.28);
  vertical-align: top;
}
table.compact th {
  background: rgba(15,23,42,0.03);
  color: #0f172a;
  font-weight: 800;
}
table.compact tr:last-child td { border-bottom: 0; }

/* --- Additions not currently in main CSS --- */

/* Callout minor helper (keeps using your existing .muted color) */
.callout .muted {
  margin: 4px 0 0;
}

/* Small badges */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(255,255,255,0.8);
  color: #334155;
  font-size: 0.86rem;
  font-weight: 650;
}

/* Mini legend */
.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 8px;
  color: var(--text-muted);
  font-size: 0.92rem;
}
.legend .dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 6px;
  transform: translateY(1px);
  border: 1px solid rgba(148,163,184,0.55);
}

/* Optional: allow code blocks to scroll horizontally if needed */
pre.prettyprint {
  overflow: auto;
}

/* I/O cost card */
.io-card {
  border-radius: 18px;
  padding: 12px 14px;
  border: 1px solid rgba(148,163,184,0.35);
  background: rgba(255,255,255,0.92);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.03);
}
.io-card .muted {
  color: var(--text-muted);
  margin: 0;
}


/* =========================================================
   Extra small helpers + visual widgets (safe additions)
========================================================= */

.kbd {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
  font-size: .92rem;
  padding: 2px 6px;
  border-radius: 8px;
  background: rgba(15,23,42,.06);
  border: 1px solid rgba(148,163,184,.5);
}

.mini {
  font-size: .95rem;
  color: var(--text-muted);
}

/* --- flow diagram: query pipeline --- */
.pipe {
  display: grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  gap: 10px;
  align-items: center;
  margin: 12px 0 6px;
}
@media (max-width: 980px){ .pipe { grid-template-columns: 1fr; } }

.pipe-step{
  border-radius: 18px;
  padding: 10px 12px;
  border: 1px solid rgba(148,163,184,.45);
  background: rgba(255,255,255,.88);
  box-shadow: 0 10px 24px rgba(15,23,42,0.03);
  position: relative;
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.pipe-step:hover{
  transform: translateY(-3px);
  box-shadow: 0 16px 34px rgba(15,23,42,0.10);
  border-color: rgba(37,99,235,.55);
}
.pipe-step b{ font-family:"Outfit", system-ui, sans-serif; }

.pipe-arrow{
  text-align:center;
  font-size: 1.5rem;
  opacity:.75;
  animation: nudge 1.7s ease-in-out infinite;
}
@keyframes nudge{
  0%,100%{ transform: translateX(0); }
  50%{ transform: translateX(6px); }
}
@media (prefers-reduced-motion: reduce){
  .pipe-arrow{ animation:none !important; }
}

/* --- operator tree visualization (SVG container) --- */
.svg-card{
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid rgba(148,163,184,0.4);
  padding: 10px;
  box-shadow: 0 10px 28px rgba(15,23,42,0.05);
  overflow: hidden;
}
.svg-card svg { width: 100%; height: auto; display:block; }
.viz-caption {
  margin: 6px 0 0;
  text-align:center;
  font-size:.9rem;
  color: var(--text-muted);
}

/* --- animation: join pipeline dots --- */
.dot { animation: moveDot 2.2s linear infinite; }
@keyframes moveDot {
  from{ transform: translateX(0); }
  to{ transform: translateX(360px); }
}
@media (prefers-reduced-motion: reduce){
  .dot{ animation:none !important; }
}

/* --- interactive cost comparison --- */
.cost-lab {
  margin-top: 10px;
  display: grid;
  grid-template-columns: 1.2fr .8fr;
  gap: 14px;
  align-items: start;
}
@media (max-width: 980px){ .cost-lab{ grid-template-columns: 1fr; } }

.control-panel{
  border-radius: 20px;
  padding: 12px 14px;
  background: rgba(255,255,255,.9);
  border: 1px solid rgba(148,163,184,.45);
}
.control-panel label{
  display:block;
  margin-top: 8px;
  font-weight:600;
}
.control-panel input[type="range"]{ width:100%; }

.metric-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0,1fr));
  gap: 10px;
  margin-top: 10px;
}
.metric{
  border-radius: 16px;
  padding: 10px 12px;
  background: linear-gradient(135deg, rgba(37,99,235,0.08), rgba(14,165,233,0.06));
  border: 1px solid rgba(37,99,235,0.28);
}
.metric .k{
  font-size:.8rem;
  letter-spacing:.12em;
  text-transform:uppercase;
  color: var(--text-muted);
}
.metric .v{
  font-family:"Outfit", system-ui, sans-serif;
  font-size:1.15rem;
  font-weight:700;
  margin-top: 2px;
}

/* --- sticky quick actions --- */
.quickbar{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top: 10px;
}

.btn{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid rgba(37,99,235,.35);
  background: linear-gradient(145deg, #ffffff, #eef2ff);
  color: var(--primary-strong);
  text-decoration:none;
  font-weight: 600;
  transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}
.btn:hover{
  transform: translateY(-2px);
  box-shadow: 0 12px 28px rgba(15,23,42,0.12);
  background: linear-gradient(145deg, #eef6ff, #ffffff);
}

/* --- collapsible “micro” subheadings --- */
.subheading{
  font-weight: 700;
  margin-top: 12px;
  margin-bottom: 6px;
}

/* Optional pipeline variants (non-conflicting) */
.pipeline-row{
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  overflow-x: auto;
}
.pipeline-step{
  background: var(--card-bg);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: 12px 14px;
  min-width: 150px;
  text-align: center;
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.pipeline-step:hover{
  transform: translateY(-4px);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.12);
}
.pipeline-title{
  font-weight: 600;
  color: var(--primary-strong);
  margin-bottom: 4px;
}
.pipeline-desc{
  font-size: 0.85rem;
  color: var(--text-muted);
}
.pipeline-arrow{
  font-size: 1.4rem;
  color: var(--accent);
  flex-shrink: 0;
}

.pipeline-row.animate-flow .pipeline-step{
  animation: pulse 3s infinite ease-in-out;
}
@keyframes pulse{
  0%{ opacity: 0.85; }
  50%{ opacity: 1; }
  100%{ opacity: 0.85; }
}

.pipe-row{
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  overflow-x: auto;
}
.pipe-row.flow-animate .pipe-step{
  animation: flowPulse 3s infinite ease-in-out;
}
@keyframes flowPulse{
  0%{ opacity: 0.85; }
  50%{ opacity: 1; }
  100%{ opacity: 0.85; }
}


/* =========================================================
   Module add-ons (safe merge): schedule player + viz widgets
   - Does NOT override existing .btn, .kbd, .chip, #backToTop
   - Does NOT redefine @keyframes dashMove (already in main CSS)
========================================================= */

/* --- Chip variants (keep your existing .chip / .chip-row) --- */
.chip.warn {
  background: rgba(249, 115, 22, 0.10);
  border-color: rgba(249, 115, 22, 0.30);
  color: #9a3412;
}
.chip.ok {
  background: rgba(34, 197, 94, 0.10);
  border-color: rgba(34, 197, 94, 0.30);
  color: #166534;
}

/* =========================================================
   “Schedule player”
   NOTE: we use .pbtn to avoid overriding your existing .btn
========================================================= */
.player {
  margin: 12px 0;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.03);
  overflow: hidden;
}

.player-controls {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 10px;
}

/* Scoped button class for the player only */
.player .pbtn {
  border: 1px solid rgba(37, 99, 235, 0.25);
  background: rgba(37, 99, 235, 0.08);
  color: #1d4ed8;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
  user-select: none;
}
.player .pbtn:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 18px rgba(15, 23, 42, 0.08);
  background: rgba(37, 99, 235, 0.11);
}
.player .pbtn.secondary {
  border-color: rgba(249, 115, 22, 0.25);
  background: rgba(249, 115, 22, 0.08);
  color: #9a3412;
}
.player .pbtn.secondary:hover {
  background: rgba(249, 115, 22, 0.11);
}

.step-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
@media (max-width: 820px) {
  .step-grid { grid-template-columns: 1fr; }
}

/* =========================================================
   Lanes + operations list (for schedule / concurrency visuals)
========================================================= */
.lane {
  border-radius: 16px;
  border: 1px dashed rgba(148, 163, 184, 0.7);
  background: rgba(248, 250, 252, 0.9);
  padding: 10px 12px;
  position: relative;
  overflow: hidden;
}

.lane-title {
  font-weight: 900;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-size: 0.85rem;
  color: #334155;
  margin-bottom: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.lane-badge {
  font-size: 0.75rem;
  border-radius: 999px;
  padding: 2px 8px;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.03);
  color: #0f172a;
  font-weight: 800;
}

.op {
  border-radius: 14px;
  padding: 8px 10px;
  border: 1px solid rgba(148, 163, 184, 0.45);
  background: rgba(255, 255, 255, 0.9);
  margin-bottom: 8px;
  display: flex;
  gap: 10px;
  align-items: flex-start;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.op:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 22px rgba(15, 23, 42, 0.06);
  border-color: rgba(37, 99, 235, 0.45);
}

.op .tag {
  min-width: 56px;
  text-align: center;
  border-radius: 999px;
  padding: 2px 8px;
  font-weight: 900;
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(15, 23, 42, 0.03);
}

.op .desc {
  color: #334155;
  font-weight: 600;
  font-size: 0.95rem;
}

.op .note {
  color: #64748b;
  font-size: 0.92rem;
  margin-top: 2px;
}

.op.active {
  border-color: rgba(249, 115, 22, 0.85);
  box-shadow: 0 0 0 5px rgba(249, 115, 22, 0.12);
  transform: translateY(-1px) scale(1.01);
}

/* =========================================================
   Lock matrix table
========================================================= */
.matrix {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 16px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.03);
  background: rgba(255, 255, 255, 0.92);
}

.matrix th, .matrix td {
  padding: 10px 12px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.25);
  text-align: center;
  font-weight: 700;
}

.matrix th {
  background: rgba(37, 99, 235, 0.08);
  color: #0f172a;
}

.matrix td { font-weight: 800; }

.matrix .yes { color: #166534; background: rgba(34, 197, 94, 0.08); }
.matrix .no  { color: #991b1b; background: rgba(239, 68, 68, 0.08); }
.matrix .hdr { text-align: left; font-weight: 900; color: #0f172a; }

/* =========================================================
   Precedence graph animation (safe: uses new keyframe names)
========================================================= */
.pulse {
  animation: pulseDot 1.8s ease-in-out infinite;
  transform-origin: center;
}
@keyframes pulseDot {
  0%   { transform: scale(1); opacity: 0.85; }
  50%  { transform: scale(1.18); opacity: 1; }
  100% { transform: scale(1); opacity: 0.85; }
}

/* IMPORTANT:
   main CSS already defines @keyframes dashMove for .dash-move
   so we use a NEW keyframe name here to avoid overriding it.
*/
.dash {
  stroke-dasharray: 8 10;
  animation: dashMove44 2.2s linear infinite;
}
@keyframes dashMove44 { to { stroke-dashoffset: -44; } }

/* =========================================================
   MVCC “version chain”
========================================================= */
.version-chain {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 10px 0;
}
@media (max-width: 900px) {
  .version-chain { grid-template-columns: 1fr; }
}

.vcard {
  border-radius: 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(255, 255, 255, 0.92);
  padding: 12px 14px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.03);
  overflow: hidden;
  position: relative;
}

.vtitle { font-weight: 900; margin: 0 0 6px; }
.vmuted { color: #64748b; margin: 0 0 8px; }

.vrow {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.ver {
  border-radius: 999px;
  padding: 6px 10px;
  border: 1px solid rgba(37, 99, 235, 0.22);
  background: rgba(37, 99, 235, 0.07);
  color: #1d4ed8;
  font-weight: 900;
  position: relative;
  overflow: hidden;
}

.ver::after {
  content: "";
  position: absolute;
  inset: -30%;
  background: radial-gradient(circle at 0 0, rgba(56, 189, 248, 0.28), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.ver:hover::after { opacity: 1; }

.arrow { font-size: 1.35rem; color: #64748b; font-weight: 900; }

.snapshot {
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid rgba(249, 115, 22, 0.28);
  background: rgba(249, 115, 22, 0.08);
  color: #9a3412;
  font-weight: 900;
}

/* =========================================================
   Small “lab prompt” container
========================================================= */
.lab {
  border-radius: 20px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: linear-gradient(
    135deg,
    rgba(37, 99, 235, 0.07),
    rgba(14, 165, 233, 0.05)
  );
  padding: 14px 14px;
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.05);
  margin: 12px 0;
  overflow: hidden;
  position: relative;
}

.lab h3 { margin-top: 0; }

.lab .labtag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 900;
  color: #0f172a;
  border: 1px solid rgba(148, 163, 184, 0.6);
  background: rgba(255, 255, 255, 0.55);
}