/* Final shared desktop composition layer. It is enqueued by WordPress after
   desktop-shell.css so it remains reliable even when scripts are deferred. */
@media (min-width:1024px) {
  html body.heichal-desktop-presentation {
    --hx-canvas:#fbf7ed;
    --hx-content-width:min(1280px,calc(100vw - 120px));
  }

  html body.heichal-desktop-presentation :is(.heichal-home-desktop,.heichal-inner-site) {
    min-height:calc(100dvh - var(--hx-adminbar-offset,0px))!important;
    display:flex!important;
    flex-direction:column!important;
    background:var(--hx-canvas) url('../mockup/site-background.png') center top / 100% auto repeat-y!important;
  }

  /* The legacy stylesheet later narrows this to one 300px illustration.
     Match its template specificity so the parchment remains continuous. */
  html body.heichal-desktop-presentation:is(.hx-template-home,.hx-template-category,.hx-template-reader) :is(.heichal-home-desktop,.heichal-inner-site) {
    background-color:var(--hx-canvas)!important;
    background-image:url('../mockup/site-background.png')!important;
    background-repeat:repeat-y!important;
    background-position:center top!important;
    background-size:100% auto!important;
    background-attachment:scroll!important;
  }

  /* Remove a legacy decorative pseudo-element that appeared as an isolated square. */
  html body.heichal-desktop-presentation :is(.heichal-home-desktop,.heichal-inner-site)::before,
  html body.heichal-desktop-presentation :is(.heichal-home-desktop,.heichal-inner-site)::after {
    background-image:none!important;
    content:none!important;
  }

  /* The header and primary nav are one full-width visual system on every page. */
  html body.heichal-desktop-presentation :is(.dedication-hero,.inner-dedication),
  html body.heichal-desktop-presentation :is(.main-nav,.inner-nav) {
    box-sizing:border-box!important;
    width:100vw!important;
    max-width:100vw!important;
    margin-inline:calc(50% - 50vw)!important;
  }
  html body.heichal-desktop-presentation :is(.dedication-hero,.inner-dedication) { min-height:112px!important; }
  html body.heichal-desktop-presentation :is(.main-nav,.inner-nav) {
    min-height:58px!important;
    padding-inline:max(36px,calc((100vw - var(--hx-content-width))/2))!important;
  }
  html body.heichal-desktop-presentation :is(.main-nav__inner,.inner-nav__inner,.inner-nav) {
    min-height:58px!important;
    align-items:center!important;
  }
  html body.heichal-desktop-presentation :is(.main-nav__links,.inner-nav__links,.main-nav__menu,.inner-nav__menu) {
    align-items:center!important;
    justify-content:center!important;
    gap:clamp(26px,3vw,52px)!important;
  }

  /* Reader keeps its compact logo inside the nav, never a second brand block. */
  html body.heichal-desktop-presentation.hx-template-reader :is(.inner-brand,.heichal-app__brand) { display:none!important; }
  html body.heichal-desktop-presentation.hx-template-reader .hx-reader-nav-brand {
    display:flex!important;
    align-items:center;
    justify-content:center;
    width:138px!important;
    height:50px!important;
    overflow:hidden;
  }
  html body.heichal-desktop-presentation.hx-template-reader .hx-reader-nav-brand img {
    width:132px!important;
    max-height:47px!important;
    object-fit:contain;
  }

  /* Keep all real zmanim visible while giving the panel enough reading space. */
  html body.heichal-desktop-presentation.hx-template-home .zmanim-card {
    min-height:292px!important;
    box-sizing:border-box!important;
  }
  html body.heichal-desktop-presentation .zmanim-card :is(li,.zmanim-row,.hx-zmanim-row) {
    min-height:39px;
    display:flex;
    align-items:center;
  }

  /* Stable card rhythm: title and description share one baseline, not a table-like row. */
  html body.heichal-desktop-presentation :is(.category-card,.hx-category-card,.hx-home-category-card,.heichal-category-card) {
    min-height:64px!important;
    padding:9px 18px!important;
    box-sizing:border-box!important;
  }
  html body.heichal-desktop-presentation :is(.category-card,.hx-category-card,.hx-home-category-card,.heichal-category-card) :is(.category-card__content,.hx-category-card__content,.card-content,.category-copy,.hx-category-card__copy) {
    min-width:0;
    display:flex!important;
    flex-direction:column;
    justify-content:center;
    gap:3px;
  }
  html body.heichal-desktop-presentation :is(.category-card,.hx-category-card,.hx-home-category-card,.heichal-category-card) :is(h2,h3,h4,.category-card__title,.hx-category-card__title) {
    margin:0!important;
    line-height:1.2!important;
    text-align:right!important;
  }
  html body.heichal-desktop-presentation :is(.category-card,.hx-category-card,.hx-home-category-card,.heichal-category-card) :is(p,small,.category-card__description,.hx-category-card__description) {
    margin:0!important;
    line-height:1.25!important;
    text-align:right!important;
    white-space:nowrap;
    overflow:hidden;
    text-overflow:ellipsis;
  }
  html body.heichal-desktop-presentation :is(.category-card,.hx-category-card,.hx-home-category-card,.heichal-category-card) :is(img,svg,.category-card__icon,.hx-category-card__icon) {
    flex:0 0 auto;
    align-self:center;
  }

  html body.heichal-desktop-presentation .hx-category-heading {
    width:min(1120px,calc(100% - 32px));
    margin:10px auto 12px;
    display:flex;
    align-items:baseline;
    justify-content:space-between;
    gap:16px;
    color:#08263a;
  }
  html body.heichal-desktop-presentation .hx-category-heading h1 {
    margin:0;
    color:#a97719;
    font-size:clamp(27px,2vw,38px);
    line-height:1;
  }
  html body.heichal-desktop-presentation .hx-category-heading p {
    margin:0;
    color:#667182;
    font-size:14px;
  }

  /* Footer follows content, with no leftover canvas after it. */
  html body.heichal-desktop-presentation :is(.heichal-home-footer,.home-footer,.inner-footer,.hx-unified-footer) {
    margin-top:auto!important;
    flex:0 0 auto;
  }
}

/* 1.9.36 — final desktop reader frame. Keep this layer desktop-only so the
   mobile app-like shell remains untouched. */
@media (min-width:1024px) {
  html body.heichal-desktop-presentation.hx-template-reader {
    --hx-desktop-side:210px;
    --hx-desktop-gap:20px;
    --hx-desktop-frame:min(1500px, calc(100vw - 64px));
  }

  html body.heichal-desktop-presentation.hx-template-reader :is(.inner-dedication,.dedication-hero) {
    position:sticky!important;
    top:0!important;
    z-index:100!important;
    min-height:96px!important;
    margin-inline:calc(50% - 50vw)!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader :is(.inner-nav,.main-nav) {
    position:sticky!important;
    top:96px!important;
    z-index:99!important;
    min-height:54px!important;
    background:rgba(255,253,248,.98)!important;
    border-bottom:1px solid rgba(169,128,34,.35)!important;
    box-shadow:0 2px 10px rgba(55,39,8,.08)!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__reader {
    width:var(--hx-desktop-frame)!important;
    max-width:var(--hx-desktop-frame)!important;
    grid-template-columns:var(--hx-desktop-side) minmax(0,1fr) var(--hx-desktop-side)!important;
    gap:var(--hx-desktop-gap)!important;
    margin:18px auto 36px!important;
    align-items:start!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader :is(.heichal-app__tools,.heichal-app__toc) {
    width:var(--hx-desktop-side)!important;
    max-width:var(--hx-desktop-side)!important;
    position:sticky!important;
    top:156px!important;
    max-height:calc(100vh - 176px)!important;
    overflow-y:auto!important;
    box-sizing:border-box!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__paper {
    min-width:0!important;
    width:100%!important;
    background:#fffdf8!important;
    color:#071d2d!important;
    border:1px solid rgba(169,128,34,.28)!important;
    box-shadow:0 8px 24px rgba(55,39,8,.09)!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__tools :is(button,a),
  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__toc :is(button,a) {
    font-size:13px!important;
    min-height:36px!important;
  }

  html.heichal-night-mode body.heichal-desktop-presentation.hx-template-reader .heichal-app__paper {
    background:#102a3b!important;
    color:#f6ead0!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__toc {
    background:rgba(255,253,248,.96)!important;
    border:1px solid rgba(169,128,34,.30)!important;
    border-radius:14px!important;
    padding:14px!important;
    box-shadow:0 6px 18px rgba(55,39,8,.08)!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__tools {
    padding:14px!important;
    border-radius:14px!important;
  }

  html.heichal-night-mode body.heichal-desktop-presentation.hx-template-reader .heichal-app__toc {
    background:#102a3b!important;
    border-color:rgba(218,181,88,.35)!important;
  }
}

/*
 * 1.7 desktop composition
 *
 * This is deliberately a final, scoped layer.  The original desktop stylesheet
 * contains the first implementation and is left intact; this layer gives the
 * three public templates one shared frame without changing mobile or the
 * dedication/application plugins that provide their data.
 */
@media (min-width:1024px) {
    html body.heichal-desktop-presentation {
        --hx-frame-width:min(1280px, calc(100vw - 48px));
        --hx-frame-padding:clamp(24px, 4vw, 72px);
    }

    /* One parchment canvas on every desktop route — never a single tile. */
    html body.heichal-desktop-presentation:is(.hx-template-home,.hx-template-category,.hx-template-reader)
    :is(.heichal-home-desktop,.heichal-inner-site) {
        width:100%!important;
        max-width:none!important;
        min-height:calc(100dvh - var(--hx-adminbar-offset, 0px))!important;
        margin:0!important;
        display:flex!important;
        flex-direction:column!important;
        overflow:visible!important;
        background-color:var(--hx-canvas)!important;
        background-image:url('../mockup/site-background.png')!important;
        background-repeat:repeat-y!important;
        background-position:center top!important;
        background-size:100% auto!important;
    }

    html body.heichal-desktop-presentation :is(.heichal-site-wrap,.site-main,.site-content) {
        background-color:transparent!important;
    }

    /* Keep the shared footer at the actual end of the template, not 100vw wide. */
    html body.heichal-desktop-presentation :is(.heichal-home-footer,.inner-footer) {
        width:100%!important;
        max-width:none!important;
        min-height:72px!important;
        margin:20px 0 0!important;
        padding:0 var(--hx-frame-padding)!important;
        align-self:stretch!important;
        flex:0 0 auto!important;
        box-sizing:border-box!important;
    }

    html body.heichal-desktop-presentation .heichal-home-footer__social,
    html body.heichal-desktop-presentation .inner-footer__social {
        justify-self:start!important;
    }

    html body.heichal-desktop-presentation .heichal-home-footer__brand,
    html body.heichal-desktop-presentation .inner-footer__brand {
        justify-self:center!important;
        text-align:center!important;
    }

    html body.heichal-desktop-presentation .heichal-home-footer__links,
    html body.heichal-desktop-presentation .inner-footer__links {
        justify-self:end!important;
    }

    /* Category pages: the category is a compact, coherent centre section. */
    html body.heichal-desktop-presentation.hx-template-category .heichal-inner-site > .inner-brand {
        width:var(--hx-frame-width)!important;
        height:116px!important;
        min-height:116px!important;
        margin:0 auto!important;
        padding:8px 0 0!important;
        place-items:center!important;
        background:transparent!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .heichal-inner-site > .inner-brand img {
        width:auto!important;
        height:106px!important;
        max-width:min(330px, 28vw)!important;
        object-fit:contain!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .heichal-app__breadcrumbs,
    html body.heichal-desktop-presentation.hx-template-category .heichal-app__title,
    html body.heichal-desktop-presentation.hx-template-category .heichal-app__description,
    html body.heichal-desktop-presentation.hx-template-category .heichal-app__nusach-wrap,
    html body.heichal-desktop-presentation.hx-template-category .heichal-app__search {
        display:none!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .heichal-app__shell {
        width:var(--hx-frame-width)!important;
        max-width:var(--hx-frame-width)!important;
        margin:0 auto!important;
        padding:0 var(--hx-frame-padding) 0!important;
        flex:1 0 auto!important;
        box-sizing:border-box!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .hx-category-showcase {
        gap:16px!important;
        align-content:start!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .hx-category-heading {
        min-height:58px!important;
        margin:0!important;
        padding:0 0 8px!important;
        display:grid!important;
        place-content:center!important;
        text-align:center!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .hx-category-heading h1 {
        margin:0!important;
        font-size:clamp(26px, 2vw, 34px)!important;
        line-height:1.15!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .hx-category-heading p {
        margin:5px 0 0!important;
        font-size:14px!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .hx-category-card-grid {
        grid-template-columns:repeat(3, minmax(0, 1fr))!important;
        gap:10px 14px!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .hx-category-card {
        min-height:70px!important;
        height:70px!important;
        padding:8px 14px!important;
        grid-template-columns:58px minmax(0, 1fr)!important;
        column-gap:12px!important;
        border-radius:15px!important;
        box-sizing:border-box!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .hx-category-card__icon {
        width:52px!important;
        height:52px!important;
        margin:0!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .hx-category-card__copy {
        min-width:0!important;
        gap:2px!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .hx-category-card__title {
        font-size:17px!important;
        line-height:1.2!important;
    }

    html body.heichal-desktop-presentation.hx-template-category .hx-category-card__description {
        font-size:12px!important;
        line-height:1.25!important;
        white-space:nowrap!important;
        overflow:hidden!important;
        text-overflow:ellipsis!important;
    }

    /* The continuation banner remains part of the page rather than floating in empty space. */
    html body.heichal-desktop-presentation.hx-template-category .hx-category-continue {
        min-height:132px!important;
        margin-top:2px!important;
    }

    /* Home: give Zmanim the visual weight to show its live list clearly. */
    html body.heichal-desktop-presentation.hx-template-home .zmanim-card {
        min-height:292px!important;
        height:auto!important;
        padding-bottom:18px!important;
    }

    html body.heichal-desktop-presentation.hx-template-home .zmanim-list {
        width:100%!important;
        display:grid!important;
        gap:0!important;
    }

    html body.heichal-desktop-presentation.hx-template-home .zmanim-row {
        min-height:36px!important;
        display:grid!important;
        grid-template-columns:56px minmax(0, 1fr) 24px!important;
        align-items:center!important;
        gap:8px!important;
        padding:0 5px!important;
        box-sizing:border-box!important;
    }

    html body.heichal-desktop-presentation.hx-template-home .zmanim-row time,
    html body.heichal-desktop-presentation.hx-template-home .zmanim-row .zmanim-time {
        direction:ltr!important;
        font-weight:800!important;
        font-variant-numeric:tabular-nums!important;
    }

    html body.heichal-desktop-presentation.hx-template-home .zmanim-row :is(.zmanim-name,.zmanim-label) {
        min-width:0!important;
        overflow:hidden!important;
        text-overflow:ellipsis!important;
        white-space:nowrap!important;
    }

    /* Reader: no duplicate masthead; the compact mark belongs inside the shared navigation. */
    html body.heichal-desktop-presentation.hx-template-reader .heichal-inner-site > .inner-brand {
        display:none!important;
    }

    html body.heichal-desktop-presentation.hx-template-reader .heichal-app__reader {
        width:var(--hx-frame-width)!important;
        max-width:var(--hx-frame-width)!important;
        margin:20px auto 0!important;
        padding:0 var(--hx-frame-padding)!important;
        box-sizing:border-box!important;
    }

    /* A 720px-tall desktop is still usable without turning cards into a table. */
    @media (max-height:900px) {
        html body.heichal-desktop-presentation.hx-template-category .heichal-inner-site > .inner-brand {
            height:94px!important;
            min-height:94px!important;
        }

        html body.heichal-desktop-presentation.hx-template-category .heichal-inner-site > .inner-brand img {
            height:88px!important;
        }

        html body.heichal-desktop-presentation.hx-template-category .hx-category-card {
            min-height:62px!important;
            height:62px!important;
        }

        html body.heichal-desktop-presentation.hx-template-category .hx-category-card__icon {
            width:46px!important;
            height:46px!important;
        }

        html body.heichal-desktop-presentation.hx-template-category .hx-category-continue {
            min-height:116px!important;
        }
    }
}
/* Live dedication text is read from the existing public memorial feed. */
.hx-has-live-memorial :is(.dedication-hero__title, strong) .hx-live-memorial__line {
  display: block;
}

.hx-has-live-memorial :is(.dedication-hero__title, strong) .hx-live-memorial__line--secondary {
  margin-top: 3px;
  font-size: .7em;
  line-height: 1.2;
  opacity: .94;
}


/* 1.8.4 — Reader scroll ownership fix.
   The desktop shell intentionally locks the page viewport; therefore the
   prayer text must be the one and only vertical scroll container.  These
   rules close the entire flex/grid min-height chain so the text receives a
   finite height instead of expanding behind an overflow:hidden ancestor. */
@media (min-width:1024px) {
  html body.heichal-desktop-presentation.hx-template-reader .heichal-inner-site {
    height:calc(100dvh - var(--hx-adminbar-offset, 0px))!important;
    min-height:0!important;
    overflow:hidden!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-inner-site > .heichal-app {
    flex:1 1 0!important;
    min-height:0!important;
    height:auto!important;
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__shell {
    flex:1 1 0!important;
    min-height:0!important;
    height:auto!important;
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__reader {
    flex:1 1 0!important;
    min-height:0!important;
    height:auto!important;
    overflow:hidden!important;
    align-items:stretch!important;
    /* desktop-layout previously adds margin-top; keep the visual gap inside
       the shell so it does not steal height from the scroll workspace. */
    margin-top:0!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__paper {
    min-width:0!important;
    min-height:0!important;
    height:100%!important;
    overflow:hidden!important;
    display:flex!important;
    flex-direction:column!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__text {
    flex:1 1 0!important;
    min-height:0!important;
    height:0!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior-y:contain!important;
    -webkit-overflow-scrolling:touch;
    scrollbar-gutter:stable;
  }

  html body.heichal-desktop-presentation.hx-template-reader :is(.heichal-app__tools,.heichal-app__toc) {
    max-height:100%!important;
    overflow-y:auto!important;
    overscroll-behavior:contain!important;
  }
}

/* 1.8.5 definitive reader scroll surface.
   Do not depend on an unresolved flex-height chain. JS assigns a concrete
   pixel height to the paper/text workspace; these rules make that surface
   the only vertical scroller on desktop. */
@media (min-width:1024px){
  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__paper{
    min-height:0!important;
    overflow:hidden!important;
  }
  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__text{
    min-height:180px!important;
    height:auto!important;
    flex:0 0 auto!important;
    overflow-y:scroll!important;
    overflow-x:hidden!important;
    overscroll-behavior-y:contain!important;
    scrollbar-gutter:stable!important;
    touch-action:pan-y!important;
  }
}

/* 1.9.7 — final desktop reader composition.
   The core reader can leave the tools and TOC as full-width grid items. Own
   the three-column geometry here so controls stay compact at the sides while
   the prayer remains the central reading surface. */
@media (min-width:1024px){
  html body.heichal-desktop-presentation.hx-template-reader .inner-dedication{
    position:sticky!important;
    top:var(--hx-adminbar-offset,0px)!important;
    z-index:30!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .inner-nav{
    position:sticky!important;
    top:calc(116px + var(--hx-adminbar-offset,0px))!important;
    z-index:29!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__reader{
    display:grid!important;
    grid-template-columns:250px minmax(0,1fr) 250px!important;
    grid-template-rows:auto!important;
    align-items:start!important;
    gap:22px!important;
    width:min(1400px,calc(100vw - 96px))!important;
    max-width:none!important;
    margin:18px auto 0!important;
    padding:0!important;
    box-sizing:border-box!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__tools{
    grid-column:1!important;
    grid-row:1!important;
    display:flex!important;
    flex-direction:column!important;
    align-items:stretch!important;
    gap:10px!important;
    width:250px!important;
    max-width:250px!important;
    max-height:calc(100vh - 160px)!important;
    margin:0!important;
    padding:16px!important;
    overflow-y:auto!important;
    position:sticky!important;
    top:160px!important;
    background:#062236!important;
    border:1px solid #c9972d!important;
    border-radius:16px!important;
    box-sizing:border-box!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__paper{
    grid-column:2!important;
    grid-row:1!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:24px 34px 40px!important;
    box-sizing:border-box!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__toc{
    grid-column:3!important;
    grid-row:1!important;
    width:250px!important;
    max-width:250px!important;
    max-height:calc(100vh - 160px)!important;
    margin:0!important;
    padding:16px!important;
    position:sticky!important;
    top:160px!important;
    overflow-y:auto!important;
    background:#fffdf8!important;
    border:1px solid rgba(201,151,45,.6)!important;
    border-radius:16px!important;
    box-sizing:border-box!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__tools > h2{
    margin:0 0 2px!important;
    color:#f2d681!important;
    font-size:20px!important;
    text-align:center!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__tools > a,
  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__tools > button{
    width:100%!important;
    min-height:38px!important;
    margin:0!important;
    padding:8px 10px!important;
    box-sizing:border-box!important;
    border:1px solid rgba(201,151,45,.7)!important;
    border-radius:10px!important;
    background:transparent!important;
    color:#fff8df!important;
    font:inherit!important;
    text-align:center!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__tools .heichal-reader-control{
    display:grid!important;
    grid-template-columns:1fr 1fr!important;
    gap:6px!important;
    padding:8px 0!important;
    border-top:1px solid rgba(255,255,255,.16)!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__tools .heichal-reader-control > :first-child{
    grid-column:1 / -1!important;
    color:#f2d681!important;
    text-align:right!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__text{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
}


/* 1.8.6 — Reader reliability fallback: document owns vertical scrolling.
   Previous releases attempted to keep the entire desktop reader viewport locked
   and make only .heichal-app__text scroll. In production that scroll surface can
   be neutralised by upstream theme/plugin layout rules. For reliability, reader
   pages now use normal document scrolling. Side tools/TOC can remain sticky,
   while the prayer content is never trapped behind overflow:hidden. */
@media (min-width:1024px){
  html:has(body.heichal-desktop-presentation.hx-template-reader),
  html body.heichal-desktop-presentation.hx-template-reader{
    height:auto!important;
    min-height:100%!important;
    max-height:none!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-inner-site,
  html body.heichal-desktop-presentation.hx-template-reader .heichal-inner-site > .heichal-app,
  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__shell,
  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__reader,
  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__paper{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__reader{
    align-items:start!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__paper{
    display:block!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__text{
    height:auto!important;
    min-height:0!important;
    max-height:none!important;
    overflow:visible!important;
    flex:none!important;
    touch-action:auto!important;
    scrollbar-gutter:auto!important;
  }

  html body.heichal-desktop-presentation.hx-template-reader :is(.heichal-app__tools,.heichal-app__toc){
    position:sticky!important;
    top:18px!important;
    max-height:calc(100vh - 36px)!important;
    overflow-y:auto!important;
  }
}

/* 1.8.8 — let the document height include the full reader content.
   The reader can arrive inside a flex chain whose zero-height app/reader
   items leave the content overflowing a short body. In that state the
   browser's document scroll root never sees the prayer height. */
@media (min-width:1024px){
  html:has(body.heichal-desktop-presentation.hx-template-reader){
    overflow-y:visible!important;
  }
  html body.heichal-desktop-presentation.hx-template-reader{
    height:auto!important;
    min-height:100vh!important;
    overflow:visible!important;
  }
  html body.heichal-desktop-presentation.hx-template-reader .heichal-inner-site{
    display:block!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }
  html body.heichal-desktop-presentation.hx-template-reader .heichal-inner-site > .heichal-app,
  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__shell,
  html body.heichal-desktop-presentation.hx-template-reader .heichal-app__reader{
    display:block!important;
    flex:none!important;
    height:auto!important;
    min-height:0!important;
    overflow:visible!important;
  }
}
/* 1.9.102 final desktop-category geometry. This file loads after the legacy
   shell, so it owns the compact semantic cards and unclipped side column. */
@media (min-width:1024px){
  html body.heichal-desktop-presentation.hx-template-category .hx-mobile-content-card{
    box-sizing:border-box!important;
    min-height:76px!important;
    height:76px!important;
    max-height:76px!important;
    grid-template-columns:minmax(0,1fr) 38px!important;
    grid-template-areas:'copy favorite'!important;
    padding:9px 12px!important;
  }
  html body.heichal-desktop-presentation.hx-template-category .hx-mobile-content-card>img{display:none!important;}
  html body.heichal-desktop-presentation.hx-template-category .hx-mobile-content-card>span{grid-area:copy!important;}
  html body.heichal-desktop-presentation.hx-template-category .hx-mobile-content-card>.hx-site-favorite{
    position:static!important;grid-area:favorite!important;place-self:center!important;transform:none!important;
  }
  html body.heichal-desktop-presentation.hx-template-category .heichal-app__recent{
    min-height:0!important;height:auto!important;max-height:none!important;overflow:visible!important;
  }
  html body.heichal-desktop-presentation.hx-template-category .heichal-app__zmanim{
    min-height:370px!important;height:auto!important;max-height:none!important;overflow:visible!important;
  }
}
