/* Decorative SVG lettering only. Original bitmap, logos and UI remain intact. */
@media (min-width:960px) {
  body.fidelity-2026 .ekts-book-lettering[data-book-mode="desktop"] {
    pointer-events:none;
    user-select:none;
  }
}
@media (max-width:700px) {
  body.fidelity-2026 .ekts-book-lettering[data-book-mode="mobile"] {
    pointer-events:none;
    user-select:none;
  }
}
/* A defensive visibility boundary while the coordinated media listeners run. */
@media (max-width:959px) {
  body.fidelity-2026 .ekts-book-lettering[data-book-mode="desktop"] { display:none; }
}
@media (min-width:701px) {
  body.fidelity-2026 .ekts-book-lettering[data-book-mode="mobile"] { display:none; }
}

/* Append after the existing mobile/desktop CSS. No DOM or content changes.
   The ID-scoped selectors restore inset only on actual framed/filled surfaces;
   plain section headings, source notes and already-padded paper panels stay put. */
@media (max-width:700px) {
  body.mobile-reference-shell #page-content :is(
    .mobile-section-fold,.a-fold,.contact-card,.schedule-demo,
    .conform-living-fold,.oct-detail,.faq-item,.details-list>details
  )>summary,
  body.mobile-reference-shell #page-content .conform-program-fold>summary {
    box-sizing:border-box;
    min-height:48px;
    padding:14px 16px!important;
  }

  /* The same old details>div reset removed the inner gutter of document lists
     and form labels. Restore the content surface, not padding on every label. */
  body.mobile-reference-shell #page-content .mobile-section-fold>.fold-content,
  body.mobile-reference-shell #page-content .a-fold>.a-fold-body,
  body.mobile-reference-shell #page-content .schedule-demo>.demo-inner,
  body.mobile-reference-shell #page-content .contact-card>div,
  body.mobile-reference-shell #page-content .oct-detail>div,
  body.mobile-reference-shell #page-content .faq-item>div,
  body.mobile-reference-shell #page-content .details-list>details>div {
    box-sizing:border-box;
    padding:12px 16px 16px!important;
    min-width:0;
  }

  /* These plain meta boxes retain their side borders. The fact-cards variant
     is deliberately a flat, separated-row presentation and is excluded. */
  body.mobile-reference-page #page-content .meta-box:not(.fact-cards)>.meta-row {
    padding:14px 16px;
  }

  /* Preserve list markers and form-label/input separation within a narrow
     content column; no extra padding is placed on the enclosing paper sheet. */
  body.mobile-reference-shell #page-content :is(.a-fold-body,.fold-content)>.check,
  body.mobile-reference-shell #page-content :is(.a-fold-body,.fold-content) .field {
    min-width:0;
    max-width:100%;
  }
  body.mobile-reference-shell #page-content :is(.a-fold-body,.fold-content) .field {
    row-gap:8px;
  }
}

/* The existing desktop tabbar already has sufficient insets. Mobile/tablet
   gain three equal tabs; very narrow screens scroll this bar, never the page. */
@media (max-width:959px) {
  body.fidelity-2026.composition-04-media #page-content .a-media-tabs {
    display:grid;
    grid-template-columns:repeat(3,minmax(96px,1fr));
    width:100%;
    max-width:100%;
    min-width:0;
    gap:0;
    margin:0 0 24px;
    padding:0;
    overflow-x:auto;
    overscroll-behavior-x:contain;
    scroll-padding-inline:12px;
    border:1px solid #b9d0e7;
    border-radius:3px;
    background:#f5f9fd;
  }
  body.fidelity-2026.composition-04-media #page-content .a-media-tabs>.chip {
    box-sizing:border-box;
    display:flex;
    align-items:center;
    justify-content:center;
    width:100%;
    min-width:0;
    min-height:48px;
    margin:0;
    padding:12px;
    border:0;
    border-bottom:3px solid transparent;
    border-radius:0;
    background:transparent;
    color:#174b82;
    font:500 16px/1.25 "ECTS Condensed",sans-serif;
    white-space:nowrap;
    text-align:center;
  }
  body.fidelity-2026.composition-04-media #page-content .a-media-tabs>.chip+ .chip {
    border-left:1px solid #d3e0ee;
  }
  body.fidelity-2026.composition-04-media #page-content .a-media-tabs>.chip:is(.active,[aria-pressed="true"]) {
    color:#0b3d73;
    background:#fff;
    border-bottom-color:#0e3480;
  }
  body.fidelity-2026.composition-04-media #page-content .a-media-tabs>.chip:focus-visible {
    outline:2px solid #1856a4;
    outline-offset:-4px;
  }
}

/* The four existing admission links stay in the same DOM/order. Explicit
   foreground colors beat legacy generic-link colors on the navy surface. */
body.fidelity-2026.composition-20-apply #page-content .a-route-four {
  box-sizing:border-box;
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  min-width:0;
  max-width:100%;
  gap:16px;
  padding:20px;
  border:1px solid #214971;
  border-radius:4px;
  background:#0b2448;
  color:#f7fbff;
}
body.fidelity-2026.composition-20-apply #page-content .a-route-four>a {
  display:grid;
  grid-template-columns:36px minmax(0,1fr);
  align-items:center;
  min-width:0;
  min-height:64px;
  gap:12px;
  padding:12px 8px;
  color:#f7fbff!important;
  text-decoration:none;
}
body.fidelity-2026.composition-20-apply #page-content .a-route-four>a>span {
  display:block;
  min-width:0;
  color:#f7fbff!important;
  font:500 18px/1.35 "ECTS Condensed",sans-serif;
}
body.fidelity-2026.composition-20-apply #page-content .a-route-four>a>b {
  display:grid;
  place-items:center;
  width:36px;
  height:36px;
  margin:0;
  border:1px solid #9bbce0;
  border-radius:50%;
  background:#173c68;
  color:#fff!important;
  font:500 18px/1 "ECTS Condensed",sans-serif;
}
body.fidelity-2026.composition-20-apply #page-content .a-route-four>a:hover {
  background:#183d6b;
}
body.fidelity-2026.composition-20-apply #page-content .a-route-four>a:focus-visible {
  outline:3px solid #ffd099;
  outline-offset:2px;
}
@media (max-width:959px) {
  body.fidelity-2026.composition-20-apply #page-content .a-route-four {
    grid-template-columns:minmax(0,1fr);
    gap:0;
    padding:12px 16px;
  }
  body.fidelity-2026.composition-20-apply #page-content .a-route-four>a {
    min-height:68px;
    padding:14px 4px;
    border-bottom:1px solid #7796b64d;
  }
  body.fidelity-2026.composition-20-apply #page-content .a-route-four>a:last-child {
    border-bottom:0;
  }
}

/* Clip position measured from approved 780px mobile PNGs: ~4px inside
   the paper edge, 3px above its top at a 390px viewport. */
@media(max-width:700px){
 body.mobile-reference-page #page-content .mobile-exact-panel.mobile-exact-paper:after{
  left:4px;top:-3px;width:14px;height:37px;border:0;border-radius:0;
  background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='5 -1 14 37'%3E%3Cpath d='M7 21v-14q0-7 5-7t5 7v23q0 5-4 5t-4-5V13' fill='none' stroke='%237f9fba' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E") center/contain no-repeat;
 }
}

/* A single uninterrupted page illustration, not independently backed blocks. */
.ekts-unified-canvas{display:none}
@media(min-width:960px){
 body.unified-canvas-ready #app{position:relative;isolation:isolate;background:transparent}
 body.unified-canvas-ready .ekts-unified-canvas{display:block;position:absolute;inset:0 0 auto;z-index:-1;pointer-events:none;overflow:hidden;width:100%}
 body.unified-canvas-ready .ekts-unified-canvas>svg{display:block;width:100%}
 body.unified-canvas-ready :is(.design-header,.composition-main,.design-footer,.design-copyright,.design-closing-line,.approved-cta),
 body.unified-canvas-ready #page-content,
 body.unified-canvas-ready #page-content>.section{background:transparent!important;background-image:none!important}
 body.unified-canvas-ready :is(.composition-hero,#page-content) .composition-scene{visibility:hidden!important}
 body.unified-canvas-ready.composition-05-contacts #page-content>#section-4{display:none}
 body.unified-canvas-ready.composition-05-contacts #section-2>.section-inner>.source-disclosure{margin:24px 0 0;background:transparent;border:0}
 body.unified-canvas-ready.composition-05-contacts #section-2>.section-inner>.source-disclosure>summary{padding:12px 0;min-height:44px}
 body.unified-canvas-ready.composition-05-contacts .fidelity-contact-map{--scene-ratio:.379746835443!important;min-height:37.9746835443cqw!important}
 body.unified-canvas-ready .student-events>.section-inner>p:last-child{position:static;background:transparent!important;margin:24px 0 0;padding:0;line-height:1.4}
 body.unified-canvas-ready .student-study .study-notebook{left:13%!important;top:34cqw!important;width:19%!important;font-size:1.1cqw;line-height:1.08;transform:rotate(-11deg)!important}
 body.unified-canvas-ready.high-contrast .ekts-unified-canvas{display:none}
 body.unified-canvas-ready.high-contrast #app{background:#fff!important}
}
