/* Endo-e / Prisma final. Shared light theme, promoted from approved revision 03. */
body.prisma-site,
body.prisma-course {
  /* Brand and light-only surfaces. Keep the established typeface. */
  --prisma-white: #ffffff;
  --prisma-brand: #1b1464;
  --prisma-blue: #214d9f;
  --prisma-light: #2966d8;
  --prisma-ink: #182047;
  --prisma-muted: #455b7b;
  --prisma-canvas: #f4f8ff;
  --prisma-edge: #c4d5ed;
  --prisma-glass: rgba(255, 255, 255, .80);
  --prisma-glass-dense: rgba(255, 255, 255, .94);
  --prisma-glass-blue: rgba(228, 239, 255, .82);
  --prisma-reflection: rgba(255, 255, 255, .98);
  --prisma-outline: 1px solid rgba(152, 180, 221, .55);
  --prisma-bevel: inset 0 1px 0 var(--prisma-reflection),
    inset 1px 0 0 rgba(255, 255, 255, .76),
    inset 0 -1px 0 rgba(154, 183, 225, .23);
  --prisma-shadow-control: 0 4px 12px rgba(27, 20, 100, .08);
  --prisma-shadow-panel: 0 12px 36px -14px rgba(33, 77, 159, .24);
  --prisma-shadow-float: 0 24px 60px -20px rgba(27, 20, 100, .27);
  --prisma-blur: 20px;
  --prisma-radius-control: 14px;
  --prisma-radius-panel: 26px;
  --prisma-radius-large: 34px;
  --prisma-space-1: 4px;
  --prisma-space-2: 8px;
  --prisma-space-3: 12px;
  --prisma-space-4: 16px;
  --prisma-space-5: 24px;
  --prisma-space-6: 32px;
  --prisma-space-7: 48px;
  --prisma-space-8: 72px;
  --prisma-time: 180ms;
  --prisma-layer-header: 10;
  --prisma-layer-preview: 30;
  --prisma-layer-progress: 50;
  --prisma-font: Arial, Helvetica, sans-serif;
  --prisma-type-home: clamp(28px, calc(3.8vw + 10px), 54px);
  --prisma-type-chapter: clamp(28px, 3.25vw, 48px);
  --prisma-type-section: clamp(25px, 2.35vw, 32px);
  --prisma-type-control: 14px;
  --prisma-weight-title: 700;
  --prisma-chapter-inset: clamp(18px, 2vw, 30px);
  font-family: var(--prisma-font);
  color: var(--prisma-ink);
  color-scheme: light;
  background: radial-gradient(ellipse at 94% 1%, #c9ddff 0, transparent 34rem),
    radial-gradient(ellipse at 1% 15%, #e1ecff 0, transparent 32rem),
    linear-gradient(180deg, #f4f8ff, #ffffff 60rem);
}

/* The floating functional layer uses the same bevel and material everywhere. */
.prisma-site > header {
  z-index: var(--prisma-layer-header);
  background: var(--prisma-glass);
  border-bottom: var(--prisma-outline);
  box-shadow: var(--prisma-bevel), 0 8px 28px rgba(33, 77, 159, .07);
  -webkit-backdrop-filter: blur(var(--prisma-blur)) saturate(140%);
  backdrop-filter: blur(var(--prisma-blur)) saturate(140%);
}
.prisma-site .mast > a:first-child { min-width: 0; }
.prisma-site .mast .logo { max-width: 100%; }
.prisma-site .mast .tools { flex-shrink: 0; }
.prisma-site .ribbon {
  height: 3px;
  background: linear-gradient(90deg, var(--prisma-brand), var(--prisma-light) 70%, #c4dcff);
}
.prisma-site :is(.nav, .btn, .languages summary, .reader-controls) {
  color: var(--prisma-brand);
  background: linear-gradient(145deg, var(--prisma-glass-dense), var(--prisma-glass-blue));
  border: var(--prisma-outline);
  box-shadow: var(--prisma-bevel), var(--prisma-shadow-control);
}
.prisma-site .nav { border-radius: 24px; }
.prisma-site :is(.btn, .languages summary) { border-radius: var(--prisma-radius-control); }
.prisma-site .nav a { border-radius: 18px; }
.prisma-site .nav a[aria-current] {
  color: var(--prisma-brand);
  background: #dceaff;
  box-shadow: inset 0 1px 0 #ffffff, 0 2px 5px #214d9f12;
}
.prisma-site .languages > div,
.prisma-site #mobile:not([hidden]) {
  background: var(--prisma-glass-dense);
  border-color: var(--prisma-edge);
  box-shadow: var(--prisma-bevel), var(--prisma-shadow-panel);
}
.prisma-site .contact-cta,
.prisma-site a.primary {
  border: 1px solid #443d8b;
  border-radius: var(--prisma-radius-control);
  background: linear-gradient(145deg, #3b4096, var(--prisma-brand) 66%, var(--prisma-blue));
  box-shadow: inset 0 1px 0 #ffffff70, 0 5px 14px #1b146426;
  color: #ffffff;
}
.prisma-site :is(button, a, summary, input):focus-visible {
  outline: 3px solid var(--prisma-blue);
  outline-offset: 4px;
}
.prisma-site :is(.btn, .languages summary, .row button, .contact-cta, a.primary) {
  transition: background var(--prisma-time), box-shadow var(--prisma-time),
    border-color var(--prisma-time), transform var(--prisma-time);
}

/* HOME: an open editorial introduction beside a luminous search instrument. */
.prisma-home .intro {
  position: relative;
  isolation: isolate;
  grid-template-columns: minmax(0, 1.4fr) minmax(280px, .8fr);
  align-items: center;
  gap: clamp(28px, 4vw, 64px);
  padding-block: clamp(32px, 4vw, 56px) clamp(28px, 3vw, 42px);
}
.prisma-home .intro::before {
  content: '';
  position: absolute;
  z-index: -1;
  pointer-events: none;
  width: 28%;
  height: 120px;
  right: 5%;
  top: 50%;
  transform: translateY(-50%) rotate(-12deg);
  border: 1px solid #ffffff;
  border-radius: var(--prisma-radius-large);
  background: linear-gradient(130deg, #ffffffb3, #b9d4ff45 68%, #ffffffbf);
  box-shadow: inset 0 2px 0 #ffffff, 12px 24px 48px -26px #214d9f40;
}
.prisma-home .intro h1 {
  color: var(--prisma-brand);
  background: none;
  -webkit-text-fill-color: currentColor;
  font-size: var(--prisma-type-home);
  font-weight: var(--prisma-weight-title);
  line-height: 1.02;
  letter-spacing: -.055em;
  overflow-wrap: break-word;
  text-wrap: balance;
}
.prisma-home .intro p {
  max-width: 48ch;
  margin-top: var(--prisma-space-5);
  color: var(--prisma-muted);
  font-size: clamp(16px, 1.4vw, 19px);
  line-height: 1.65;
}
.prisma-home .search {
  position: relative;
  display: flex;
  gap: 14px;
  align-items: center;
  min-height: 86px;
  padding: 20px 22px;
  border: 1px solid #ffffff;
  border-radius: var(--prisma-radius-panel);
  color: var(--prisma-brand);
  background: linear-gradient(135deg, #fffffff0, #eef5ffbc 70%, #ffffffd9);
  box-shadow: var(--prisma-bevel), 0 0 0 1px #acc7ef70, var(--prisma-shadow-float);
  -webkit-backdrop-filter: blur(var(--prisma-blur));
  backdrop-filter: blur(var(--prisma-blur));
}
.prisma-home .search > svg { width: 26px; height: 26px; flex: none; }
.prisma-home .search > span {
  flex: 1;
  min-width: 0;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.025em;
  overflow-wrap: break-word;
}
.prisma-home .search .key { color: var(--prisma-muted); background: #ffffffc9; }
.prisma-home .heading {
  position: relative;
  gap: 24px;
  padding: 23px 28px;
  border: 1px solid #4b62ae;
  border-radius: 22px;
  background: linear-gradient(115deg, #1b1464, #244b9d);
  box-shadow: inset 0 1px 0 #ffffff70, 0 10px 24px -12px #1b146450;
}
.prisma-home .heading h2 { font-size: var(--prisma-type-section); }
.prisma-home .heading p { max-width: 40ch; font-size: 14px; }
.prisma-home .columns { align-items: start; gap: var(--prisma-space-5); }
.prisma-home .chapter-group {
  border: var(--prisma-outline);
  border-radius: var(--prisma-radius-panel);
  background: linear-gradient(155deg, #fffffff2, #f0f6ffd9);
  box-shadow: var(--prisma-bevel), var(--prisma-shadow-panel);
}
.prisma-home .group-title {
  min-height: 70px;
  padding: 18px 20px;
  margin-bottom: 0;
  border-radius: 0;
  border-bottom: 1px solid #bdcfee;
  background: linear-gradient(110deg, #edf4ff, #ffffffcc);
  color: var(--prisma-brand);
  font-size: clamp(16.5px, 1.38vw, 19px);
  line-height: 1.3;
}
.prisma-home .row {
  min-height: 108px;
  padding: 14px 14px 14px 20px;
  gap: 10px;
  border-bottom-color: #d6e2f1;
}
.prisma-home .row:last-child { border-bottom: 0; }
.prisma-home .row::before { display: none; }
.prisma-home .row strong {
  color: var(--prisma-brand);
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: -.025em;
  overflow-wrap: break-word;
}
.prisma-home .row small { font-size: 13px; line-height: 1.5; color: var(--prisma-muted); }
.prisma-home .row img { width: 74px; height: 62px; background: #ffffff; border-radius: 8px; }
.prisma-home .row button {
  width: 44px;
  min-height: 44px;
  border: 1px solid #c4d5ed;
  border-radius: var(--prisma-radius-control);
  background: linear-gradient(145deg, #ffffff, #eaf2ff);
  box-shadow: var(--prisma-bevel), 0 3px 7px #214d9f0a;
}
.prisma-home .sections { margin-top: 12px; padding-top: 40px; border-top-color: #c6d7ee; }
.prisma-home .sections h2 { font-size: clamp(26px, 2.55vw, 34px); }
.prisma-home .sections details {
  border: var(--prisma-outline);
  border-radius: 18px;
  background: #ffffffc9;
  box-shadow: var(--prisma-bevel), 0 5px 16px -9px #214d9f28;
}
.prisma-home .sections details[open] { background: linear-gradient(135deg, #f0f6fff0, #ffffff); }
.prisma-home .sections summary { min-height: 62px; padding: 17px 18px; font-size: 16px; }
.prisma-home .sections .links a { min-height: 48px; font-size: 15px; }
.prisma-home .sections .links.support a { padding-block: 13px; }
.prisma-home .site-footer .foot { max-width: 1440px; }

/* CHAPTER: unchanged grid; the reading panel fills its existing column. */
.prisma-chapter > header .wrap,
.prisma-chapter .site-footer .wrap {
  max-width: 1600px;
  padding-inline: clamp(18px, 3.1vw, 48px);
}
.prisma-chapter .chapter-heading {
  padding-block: clamp(20px, 2.5vw, 36px);
  padding-inline: var(--prisma-chapter-inset);
  border: var(--prisma-outline);
  border-radius: var(--prisma-radius-panel);
  background: linear-gradient(120deg, #ffffffeb, #eaf3ffbf 80%, #ffffffed);
  box-shadow: var(--prisma-bevel), var(--prisma-shadow-panel);
}
.prisma-site:is(.topic-preview, .institutional-about, .institutional-contact) .chapter-heading {
  width: 100%;
  max-width: 1180px;
  margin-inline: auto;
}
.prisma-chapter .chapter-heading h1 {
  max-width: 100%;
  font-size: var(--prisma-type-chapter);
  line-height: 1.13;
  color: var(--prisma-brand);
  overflow-wrap: break-word;
}
.prisma-chapter .chapter-heading .back-link { color: var(--prisma-blue); }
.prisma-chapter .chapter-meta { gap: 18px; margin-top: 20px; }
.prisma-chapter .chapter-meta > span { color: var(--prisma-muted); font-size: 15px; }
.prisma-chapter .reader-controls { padding: 5px; border-radius: 18px; }
.prisma-chapter .reader-controls button { border-radius: 12px; }
.prisma-chapter .chapter-toc {
  border: var(--prisma-outline);
  border-radius: 22px;
  background: var(--prisma-glass-dense);
  box-shadow: var(--prisma-bevel), var(--prisma-shadow-panel);
  -webkit-backdrop-filter: blur(var(--prisma-blur));
  backdrop-filter: blur(var(--prisma-blur));
}
.prisma-chapter .chapter-toc summary { font-size: 16px; padding: 19px 16px; }
.prisma-chapter .chapter-toc nav a { font-size: 14px; line-height: 1.45; }
.prisma-chapter .chapter-toc nav a.active {
  border-left-color: var(--prisma-light);
  background: #e5efff;
  box-shadow: inset 0 1px 0 #ffffff;
}
.prisma-chapter .chapter-article {
  /* Cancel the inherited TCFC 1080px cap for Prisma chapters, so the panel's
     right edge meets the title panel. The narrower reader-mode rule still wins. */
  max-width: none;
  padding-block: clamp(16px, 2vw, 30px);
  padding-inline: var(--prisma-chapter-inset);
  border: 1px solid #dce6f3;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 36px -24px #214d9f40;
}
.prisma-chapter.reader-mode .chapter-heading {
  max-width: 980px;
  margin-inline: auto;
}
.prisma-chapter .chapter-article p {
  text-align: justify;
  text-align-last: start;
  text-justify: inter-word;
  -webkit-hyphens: auto;
  hyphens: auto;
}
.prisma-chapter .chapter-article h2:where(:not(.case-answer-heading):not(.cell-label)) {
  font-size: clamp(18px, 1.7vw, 23.5px);
  color: var(--prisma-brand);
  border-bottom-color: #cfddf1;
}
.prisma-chapter .chapter-article h3 { font-size: 1.02em; }
.prisma-chapter .chapter-article .study-highlight,
.prisma-chapter .desob-editorial {
  border-left-color: #527dbd;
  background: linear-gradient(110deg, #edf4ff, #f9fbff);
  box-shadow: none;
}
.prisma-chapter .chapter-article .study-highlight:hover { box-shadow: none; }
.prisma-chapter .chapter-article figure.tcfc-figure {
  background: #fbfdff;
  border-color: #d6e2f1;
  box-shadow: inset 0 1px 0 #ffffff;
}
/* Never use backdrop, opacity or colour filters on scientific figures/captions. */
.prisma-chapter .chapter-article .related {
  background: #f4f8ff;
  border-color: var(--prisma-edge);
}
.prisma-chapter .reading-progress {
  z-index: var(--prisma-layer-progress);
  background: linear-gradient(90deg, var(--prisma-brand), var(--prisma-light));
}

/* Transient tools share the material; promotional art keeps its original colours. */
.prisma-site dialog,
.prisma-site .preview {
  background: var(--prisma-glass-dense);
  border: var(--prisma-outline);
  border-radius: var(--prisma-radius-panel);
  box-shadow: var(--prisma-bevel), var(--prisma-shadow-float);
  -webkit-backdrop-filter: blur(var(--prisma-blur));
  backdrop-filter: blur(var(--prisma-blur));
}
.prisma-site .preview { z-index: var(--prisma-layer-preview); }
.prisma-site dialog::backdrop { background: #1820474d; -webkit-backdrop-filter: blur(5px); backdrop-filter: blur(5px); }
.prisma-site .dialog-head { border-color: #cfddf1; }
.prisma-site .campaign { margin-top: var(--prisma-space-6); }
.prisma-site .chapter-shell { padding-bottom: 16px; }
.prisma-site .campaign { margin-bottom: 12px; }
.prisma-site .site-footer { margin-top: 24px; }
.prisma-site .partner-banner {
  background: #f7faff;
  border-color: #d5e1f0;
  box-shadow: none;
}
.prisma-site .site-footer {
  background: linear-gradient(145deg, #f7faff, #e9f1fd);
  border-color: #ccdcf2;
}
.prisma-site .footer-connect {
  background: #ffffffe0;
  border: var(--prisma-outline);
  box-shadow: var(--prisma-bevel), var(--prisma-shadow-control);
}

@media (hover: hover) and (pointer: fine) {
  .prisma-site :is(.btn, .languages summary, .row button):hover {
    background: #ffffff;
    border-color: #93b0da;
    box-shadow: var(--prisma-bevel), 0 6px 16px #214d9f1f;
  }
  .prisma-home .search:hover {
    background: linear-gradient(135deg, #ffffff, #e9f2ffed);
    box-shadow: var(--prisma-bevel), 0 0 0 1px #91b3e9, 0 28px 60px -22px #1b146450;
    transform: translateY(-2px);
  }
  .prisma-home .row:hover { background: #eaf2ffa6; box-shadow: inset 3px 0 0 #5f8acb; }
}
.prisma-site :is(.btn, .row button, .contact-cta):active { transform: translateY(1px); }
.prisma-home .row:focus-within { background: #edf4ff; box-shadow: inset 3px 0 0 #5f8acb; }

@media (max-width: 1100px) {
  .prisma-home .columns { gap: 16px; }
  .prisma-home .row { padding-inline: 14px 10px; gap: 8px; }
  .prisma-home .row strong { font-size: 16px; }
  .prisma-home .row img { width: 58px; height: 52px; }
}
@media (max-width: 980px) {
  .prisma-home .intro { grid-template-columns: minmax(0, 1fr); gap: 24px; padding-block: 36px 30px; }
  .prisma-home .intro::before { width: 32%; height: 86px; top: auto; bottom: 24px; right: 6%; transform: rotate(-8deg); }
  .prisma-home .search { min-height: 72px; padding: 16px 18px; gap: 14px; }
}
@media (max-width: 820px) {
  .prisma-home .chapter-group:last-child { grid-column: 1 / -1; }
  .prisma-chapter > header .wrap,
  .prisma-chapter .site-footer .wrap { padding-inline: clamp(15px, 3.7vw, 27px); }
  .prisma-chapter .chapter-heading { padding-block: 24px; }
  .prisma-chapter .chapter-heading h1 { font-size: clamp(28px, 5.1vw, 40px); }
  .prisma-chapter .chapter-toc { border-radius: 18px; }
  .prisma-chapter .chapter-article { padding-block: 22px; border-radius: 20px; }
}
@media (max-width: 530px) {
  .prisma-home .intro { padding-block: 28px 24px; gap: 20px; }
  .prisma-home .intro::before { display: none; }
  .prisma-home .intro h1 { font-size: clamp(28px, 7.6vw, 32px); line-height: 1.05; letter-spacing: -.048em; }
  .prisma-home .intro p { font-size: 16px; margin-top: 16px; }
  .prisma-home .search { min-height: 62px; padding: 13px 16px; gap: 12px; border-radius: 20px; }
  .prisma-home .search > svg { width: 22px; height: 22px; }
  .prisma-home .heading { padding: 20px; border-radius: 18px; }
  .prisma-home .columns { gap: 18px; }
  .prisma-home .chapter-group { border-radius: 22px; }
  .prisma-home .chapter-group:last-child { grid-column: auto; }
  .prisma-home .group-title { min-height: 62px; padding: 17px 18px; font-size: 18px; }
  .prisma-home .row { min-height: 104px; padding: 14px 12px 14px 18px; gap: 10px; }
  .prisma-home .row strong { font-size: 17px; }
  .prisma-home .row img { width: 62px; height: 54px; }
  .prisma-home .sections { padding-top: 30px; }
  .prisma-chapter .chapter-heading { padding-block: 20px; border-radius: 22px; }
  .prisma-chapter .chapter-heading h1 { font-size: clamp(28px, 7.1vw, 36px); }
  .prisma-chapter .chapter-meta { align-items: flex-start; gap: 14px; }
  .prisma-chapter .chapter-article { padding-block: 16px; border-radius: 18px; }
}
@media (max-width: 360px) {
  .prisma-home .row { padding-inline: 12px 8px; gap: 7px; }
  .prisma-home .row img { width: 52px; height: 46px; }
  .prisma-home .row strong { font-size: 16px; }
}

/* Enhancement only. Older browsers retain the bevel, light fill and hierarchy. */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .prisma-site > header,
  .prisma-site .chapter-toc,
  .prisma-site dialog,
  .prisma-site .preview { background: #f8fbff; }
}
@media (prefers-reduced-transparency: reduce), (prefers-contrast: more) {
  .prisma-site { --prisma-glass: #ffffff; --prisma-glass-dense: #ffffff; --prisma-glass-blue: #edf4ff; }
  .prisma-site > header,
  .prisma-site .chapter-toc,
  .prisma-site dialog,
  .prisma-site .preview,
  .prisma-home .search { -webkit-backdrop-filter: none; backdrop-filter: none; background: #ffffff; }
  .prisma-home .intro::before { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .prisma-site *, .prisma-site *::before, .prisma-site *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
  .prisma-site :is(.btn, .row button, .contact-cta):active,
  .prisma-home .search:hover { transform: none; }
}
@media (forced-colors: active) {
  body.prisma-site { background: Canvas; color: CanvasText; }
  .prisma-site :is(header, .search, .chapter-group, .chapter-heading, .chapter-toc, .chapter-article, dialog) {
    border: 1px solid CanvasText;
    background: Canvas;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .prisma-home .intro::before { display: none; }
  .prisma-home .intro h1 { color: CanvasText; }
}
@media print {
  body.prisma-site { background: #ffffff; }
  .prisma-site .intro::before { display: none; }
  .prisma-site :is(.chapter-heading, .chapter-article, .chapter-group, .search) {
    background: #ffffff;
    border: 0;
    box-shadow: none;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
  .prisma-chapter .chapter-article { padding: 0; }
}
