/* Scoped to the HEOM tutorial; does not change the other site pages. */
.heom-page .deep-dive-hero { padding: 3.6rem 0 3rem; }
.heom-page .deep-dive-hero-grid { grid-template-columns: minmax(0,1.55fr) minmax(250px,.85fr); gap: 3rem; align-items: center; }
.heom-page .deep-dive-hero h1 { font-size: clamp(2.5rem,4.2vw,4.5rem); line-height:1.05; letter-spacing:-.045em; }
.heom-page .note-lead { font-size:1.22rem; line-height:1.55; max-width:42rem; }
.heom-page .heom-paper-title { font-size:1rem; font-weight:600; line-height:1.6; margin:1.15rem 0 .4rem; }
.heom-page .deep-dive-meta { font-size:.88rem; line-height:1.6; }
.heom-page .deep-dive-art { margin:0; max-width:360px; justify-self:end; width:100%; }
.heom-page .deep-dive-art img { width:100%; height:100%; object-fit:contain; }
.heom-page .deep-dive-actions { gap:.65rem; }
.heom-page .deep-dive-actions a { font-size:.9rem; min-height:44px; display:inline-flex; align-items:center; }
.heom-page .reading-tools { flex-wrap:wrap; }
.heom-page .reading-tools a, .heom-page .reading-tools button { font-size:.86rem; min-height:42px; }
.heom-page .heom-reading-section { padding-top:2.7rem; }
.heom-page .deep-dive-layout { grid-template-columns:225px minmax(0,1fr); gap:clamp(2rem,4vw,3.5rem); }
.heom-page .deep-dive-content { min-width:0; font-size:1.06rem; line-height:1.8; }
.heom-page .deep-dive-content > section { margin:0 0 4.5rem; padding-bottom:1.5rem; border-bottom:1px solid var(--line); scroll-margin-top:105px; }
.heom-page .deep-dive-content h2 { font-size:clamp(1.75rem,2.6vw,2.5rem); line-height:1.2; margin:0 0 1.25rem; }
.heom-page .deep-dive-content h3 { font-size:1.45rem; line-height:1.35; margin:1.8rem 0 .8rem; }
.heom-page .deep-dive-content p { margin:0 0 1.15rem; }
.heom-page .deep-dive-content a { text-underline-offset:.2em; }
.heom-page .deep-dive-toc { font-size:.84rem; scrollbar-width:thin; }
.heom-page .deep-dive-toc summary { cursor:pointer; font-size:.98rem; font-weight:700; padding:0 .3rem 1rem 0; }
.heom-page .deep-dive-toc summary span { display:block; font-size:.73rem; font-weight:400; margin:.25rem 0 0 1rem; }
.heom-page .deep-dive-toc ol { margin:0; padding-left:1.6rem; }
.heom-page .deep-dive-toc li { padding-left:.15rem; margin-bottom:.2rem; }
.heom-page .deep-dive-toc a { display:block; line-height:1.4; padding:.34rem .2rem; text-decoration:none; border-bottom:0; }
.heom-page .deep-dive-toc a[aria-current="location"] { font-weight:700; color:var(--ink); text-decoration:underline; text-decoration-thickness:2px; text-underline-offset:.23em; }
.heom-page .heom-orientation { padding:1.4rem 1.5rem; border:1px solid var(--line); border-left:3px solid var(--teal); border-radius:6px; margin-bottom:3rem; background:var(--surface); }
.heom-page .heom-orientation p:last-child { margin-bottom:0; }
.heom-page .heom-label { font-size:.74rem; text-transform:uppercase; font-weight:700; letter-spacing:.12em; }
.heom-page .heom-guide { font-size:.85rem; line-height:1.6; }
.heom-page .source-note { font-size:.83rem; line-height:1.65; padding-top:.8rem; margin-top:1.5rem; border-top:1px solid var(--line); }
.heom-page .worked-example { padding:1.3rem 1.5rem; margin:1.8rem 0; border-left:3px solid var(--teal); border-radius:0 8px 8px 0; background:var(--surface); min-width:0; }
.heom-page .worked-example h3 { margin-top:0; font-size:1.3rem; }
.heom-page .worked-example p:last-child { margin-bottom:0; }
.heom-page .heom-equation { max-width:100%; min-width:0; margin:1.3rem 0 1.6rem; scroll-margin-top:110px; }
.heom-page .heom-equation mjx-container[display="true"] { display:block; max-width:100%; width:100%; box-sizing:border-box; overflow-x:auto; overflow-y:hidden; padding:.65rem .1rem; margin:0!important; font-size:1.02em!important; }
.heom-page mjx-container:not([display="true"]) { font-size:1.02em!important; }
.heom-page .heom-equation mjx-container > svg { max-width:none; }
.heom-page .table-scroll { width:100%; max-width:100%; overflow-x:auto; margin:1.5rem 0; border:1px solid var(--line); border-radius:6px; }
.heom-page table { border-collapse:collapse; width:100%; margin:0; font-size:.92rem; line-height:1.55; }
.heom-page th, .heom-page td { padding:.85rem .9rem; text-align:left; vertical-align:top; border-bottom:1px solid var(--line); }
.heom-page thead { background:var(--surface); }
.heom-page tr:last-child td, .heom-page tr:last-child th { border-bottom:0; }
.heom-page th { font-weight:600; }
.heom-page code { font-size:.86em; overflow-wrap:anywhere; }
.heom-page pre { max-width:100%; overflow-x:auto; white-space:pre; line-height:1.65; padding:1.2rem; border:1px solid var(--line); border-radius:6px; background:var(--surface); font-size:.86rem; }
.heom-page pre code { overflow-wrap:normal; }
.heom-page .heom-explorer { border:1px solid var(--line); border-top:3px solid var(--teal); border-radius:8px; padding:1.4rem; margin:1.8rem 0; background:var(--surface); }
.heom-page .heom-controls { display:grid; grid-template-columns:minmax(0,1.5fr) minmax(0,.6fr) auto; gap:.8rem; align-items:end; }
.heom-page .heom-controls label { display:flex; flex-direction:column; gap:.4rem; font-size:.86rem; font-weight:600; }
.heom-page .heom-controls input { width:100%; min-width:0; padding:.7rem; border:1px solid var(--line); border-radius:5px; background:var(--paper); color:var(--ink); font:inherit; }
.heom-page .heom-controls button { min-height:44px; border:0; border-radius:5px; padding:.8rem 1rem; background:#1f5f61; color:#fff; font:inherit; font-size:.9rem; cursor:pointer; }
.heom-page .heom-controls button:hover { background:#15484a; }
.heom-page #heom-count-help { font-size:.8rem; line-height:1.55; margin:.8rem 0; }
.heom-page #heom-count-output { font-size:.9rem; line-height:1.6; overflow-wrap:anywhere; }
.heom-page #heom-count-output table { font-variant-numeric:tabular-nums; }
.heom-page #heom-count-output td { word-break:break-all; }
.heom-page #heom-count-output .heom-count-summary { font-weight:600; margin:1rem 0 .5rem; }
.heom-page .heom-download { font-weight:600; }
.heom-page .heom-solution { border:1px solid var(--line); border-radius:6px; padding:1rem 1.15rem; margin:1rem 0; background:var(--surface); }
.heom-page .heom-solution summary { cursor:pointer; font-weight:600; line-height:1.5; padding:.2rem; }
.heom-page .heom-solution[open] summary { margin-bottom:1rem; }
.heom-page .heom-solution p:last-child { margin-bottom:0; }
.heom-page .heom-closing { font-family:"Source Serif 4",Georgia,serif; font-size:1.3rem; line-height:1.65; border-left:3px solid var(--teal); padding-left:1.1rem; }
.heom-page .footer-inner { flex-wrap:wrap; }
.heom-page .footer-links { display:flex; gap:1rem; flex-wrap:wrap; }
.heom-page :is(a,button,input,summary,[tabindex]):focus-visible { outline:2px solid var(--teal); outline-offset:4px; }
@media (max-width:1050px) { .heom-page .deep-dive-layout { grid-template-columns:190px minmax(0,1fr); gap:2rem; } }
@media (max-width:820px) {
 .heom-page .deep-dive-hero { padding:2.5rem 0; }
 .heom-page .deep-dive-hero-grid { grid-template-columns:1fr; gap:1.8rem; }
 .heom-page .deep-dive-art { max-width:280px; justify-self:start; }
 .heom-page .deep-dive-layout { grid-template-columns:minmax(0,1fr); gap:2rem; }
 .heom-page .deep-dive-toc { position:static; max-height:none; overflow:visible; border:1px solid var(--line); border-radius:6px; padding:.95rem 1.1rem; }
 .heom-page .deep-dive-toc summary { padding-bottom:0; }
 .heom-page .deep-dive-toc summary span { display:inline; margin-left:.6rem; }
 .heom-page .deep-dive-toc details[open] summary { padding-bottom:1rem; }
 .heom-page .deep-dive-toc ol { columns:2; column-gap:1.7rem; }
 .heom-page .deep-dive-toc li { break-inside:avoid; }
 .heom-page .deep-dive-content { font-size:1rem; }
 .heom-page .deep-dive-content > section { margin-bottom:3.2rem; }
 .heom-page .worked-example { padding:1rem; }
 .heom-page .heom-orientation { padding:1.1rem; }
}
@media (max-width:520px) {
 .heom-page main .container { width:calc(100% - 36px); }
 .heom-page .deep-dive-hero h1 { font-size:2.6rem; }
 .heom-page .note-lead { font-size:1.09rem; }
 .heom-page .deep-dive-content h2 { font-size:1.8rem; }
 .heom-page .deep-dive-toc ol { columns:1; }
 .heom-page .heom-controls { grid-template-columns:minmax(0,1fr) minmax(0,.5fr); }
 .heom-page .heom-controls button { grid-column:1 / -1; }
 .heom-page .heom-explorer { padding:1rem; }
 .heom-page th, .heom-page td { padding:.7rem; }
 .heom-page .table-scroll table { min-width:420px; }
 .heom-page #heom-count-output table { min-width:0; }
 .heom-page .heom-closing { font-size:1.16rem; }
}
@media print {
 @page { margin:17mm 16mm; }
 .heom-page { color:#111!important; background:#fff!important; }
 .heom-page .site-header,.heom-page .site-footer,.heom-page .deep-dive-toc,.heom-page .reading-tools,.heom-page .deep-dive-actions,.heom-page .heom-controls { display:none!important; }
 .heom-page main .container { width:100%; max-width:none; }
 .heom-page .deep-dive-layout { display:block; }
 .heom-page .deep-dive-content { font-size:10.5pt; line-height:1.55; }
 .heom-page .deep-dive-hero { padding:0 0 1rem; }
 .heom-page .deep-dive-hero-grid { display:block; }
 .heom-page .deep-dive-art { display:none; }
 .heom-page .deep-dive-hero h1 { font-size:26pt; }
 .heom-page .deep-dive-content h2 { font-size:19pt; break-after:avoid; }
 .heom-page .deep-dive-content h3 { font-size:14pt; break-after:avoid; }
 .heom-page .deep-dive-content > section { margin-bottom:1.5rem; }
 .heom-page .heom-equation { break-inside:avoid; }
 .heom-page .heom-equation mjx-container[display="true"] { overflow:visible; font-size:.9em!important; }
 .heom-page .worked-example,.heom-page .heom-solution,.heom-page .heom-explorer,.heom-page .heom-orientation { background:#fff!important; box-shadow:none; }
 .heom-page .table-scroll { overflow:visible; }
 .heom-page .table-scroll table { min-width:0; }
 .heom-page a { color:#111!important; }
}
/* Override MathJax's intrinsic min-width rather than allowing page overflow. */
.heom-page.deep-dive-page main .container { width:min(1180px,calc(100% - 48px)); max-width:1180px; }
.heom-page .heom-equation mjx-container[display="true"] { min-width:0!important; width:100%!important; max-width:100%!important; }
.heom-page .heom-count-exact { margin:.8rem 0; font-size:.82rem; }
.heom-page .heom-count-exact summary { cursor:pointer; font-weight:600; }
.heom-page .heom-count-exact pre { white-space:pre-wrap; word-break:break-all; font-size:.78rem; }
@media (max-width:520px) { .heom-page.deep-dive-page main .container { width:calc(100% - 36px); } }
@media print { .heom-page.deep-dive-page main .container { width:100%; max-width:none; } }
/* Keep screen-reader MathML available without increasing the page's scroll width. */
.heom-page mjx-assistive-mml { width:1px!important; height:1px!important; overflow:hidden!important; clip-path:inset(50%); }

/* Separate and style the HEOM reading controls. */
.heom-page .reading-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 1rem;
}

.heom-page .reading-tools a,
.heom-page .reading-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.6rem 0.85rem;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 0.86rem;
  line-height: 1.35;
  text-decoration: none;
  cursor: pointer;
}

.heom-page .reading-tools a:hover,
.heom-page .reading-tools button:hover {
  background: var(--teal-soft);
}

/* Keep all contents links reachable on desktop. */
@media screen and (min-width: 821px) {
  .heom-page .deep-dive-toc {
    max-height: calc(100vh - 125px);
    overflow-y: auto;
  }
}

/* Print with dark ink even when the screen theme is dark. */
@media print {
  html {
    background: #ffffff !important;
    color-scheme: light !important;
  }

  .heom-page {
    --paper: #ffffff;
    --paper-soft: #ffffff;
    --surface: #ffffff;
    --surface-raised: #ffffff;
    --ink: #111111;
    --ink-soft: #222222;
    --muted: #444444;
    --teal: #1f5f61;
    --teal-deep: #1f5f61;
    --teal-soft: #f3f6f6;
    --copper: #8a452a;
    --line: #cccccc;
    --line-strong: #aaaaaa;
    color-scheme: light !important;
  }
}