/* ═══════════════════════════════════════════════════════════
   R36 — زیرمنوی چندستونه و اسکرول بدون فلش
   ═══════════════════════════════════════════════════════════ */

/* زیرمنوی هدر */
.header__menu-group {
  position: relative;
  display: flex;
  align-items: center;
}
.header__submenu-toggle {
  display: inline-flex;
  align-items: center;
  gap: .32rem;
  border: 0;
  background: transparent;
  font-family: inherit;
  cursor: pointer;
}
.header__submenu-toggle svg {
  width: .9rem;
  height: .9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .28s var(--ease-out);
}
.header__menu-group.is-open .header__submenu-toggle svg { transform: rotate(180deg); }
.header__submenu {
  position: absolute;
  z-index: 110;
  top: calc(100% + .72rem);
  right: 50%;
  width: max-content;
  min-width: 12.5rem;
  max-height: min(30rem, calc(100vh - var(--header-h) - 2rem));
  padding: .45rem;
  border: 1px solid var(--line-strong);
  border-radius: 1rem;
  background: var(--glass-bg);
  box-shadow: 0 1.1rem 3.4rem rgba(0,0,0,.24);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  overflow-y: auto;
  opacity: 0;
  visibility: hidden;
  transform: translate(50%, -.45rem) scale(.97);
  transform-origin: top center;
  pointer-events: none;
  transition: opacity .25s, visibility .25s, transform .3s var(--ease-out);
}
.header__menu-group.is-open .header__submenu {
  opacity: 1;
  visibility: visible;
  transform: translate(50%, 0) scale(1);
  pointer-events: auto;
}
.header__submenu a {
  display: block;
  padding: .68rem .85rem;
  border-radius: .68rem;
  color: var(--text-dim);
  font-size: .84rem;
  white-space: nowrap;
  transition: color .22s, background-color .22s, padding .22s;
}
.header__submenu a:hover,
.header__submenu a:focus-visible {
  color: var(--c-gold);
  background: var(--bg-soft);
  padding-inline-start: 1.05rem;
}

/* حذف Scrollbar بومی؛ کنترل اختصاصی جایگزین آن است. */
html { scrollbar-width: none; }
html::-webkit-scrollbar,
body::-webkit-scrollbar { width: 0; height: 0; display: none; }

.custom-scroll {
  position: fixed;
  z-index: 920;
  top: calc(var(--header-h) + .7rem);
  right: .32rem;
  bottom: .7rem;
  width: 1.28rem;
  display: grid;
  grid-template-rows: 1.45rem minmax(3rem, 1fr) 1.45rem;
  justify-items: center;
  gap: .25rem;
  direction: ltr;
  pointer-events: none;
}
.custom-scroll__arrow,
.custom-scroll__rail { pointer-events: auto; }
.custom-scroll__arrow {
  display: grid;
  place-items: center;
  width: 1.28rem;
  height: 1.45rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: color-mix(in srgb, var(--text-dim) 82%, transparent);
  cursor: pointer;
  transition: color .22s, transform .22s;
}
.custom-scroll__arrow:hover { color: var(--c-gold); transform: scale(1.12); }
.custom-scroll.is-at-start .custom-scroll__arrow--up,
.custom-scroll.is-at-end .custom-scroll__arrow--down { opacity: .28; }
.custom-scroll__arrow svg {
  width: .9rem;
  height: .9rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.custom-scroll__rail {
  position: relative;
  width: .72rem;
  height: 100%;
  background: transparent;
  cursor: pointer;
  touch-action: none;
  outline: none;
}
.custom-scroll__rail:focus-visible { outline: 1px solid var(--c-gold); outline-offset: 2px; border-radius: 999px; }
.custom-scroll__thumb {
  position: absolute;
  top: 0;
  left: 50%;
  width: .34rem;
  min-height: 1.9rem;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-dim) 72%, transparent);
  box-shadow: 0 0 .7rem rgba(240,180,41,.08);
  transform: translate(-50%, 0);
  transform-origin: top center;
  cursor: grab;
  transition: width .22s, background-color .22s, box-shadow .22s;
  will-change: transform, height;
}
.custom-scroll__rail:hover .custom-scroll__thumb,
.custom-scroll__rail:focus-visible .custom-scroll__thumb,
.custom-scroll-dragging .custom-scroll__thumb {
  width: .43rem;
  background: var(--c-gold);
  box-shadow: 0 0 .9rem rgba(240,180,41,.22);
}
.custom-scroll-dragging { user-select: none; cursor: grabbing; }

/* فهرست سکشن‌ها، کنار اسکرول اختصاصی */
.section-index {
  position: fixed;
  z-index: 910;
  top: 50%;
  right: 1.95rem;
  width: min(10.5rem, 18vw);
  max-height: calc(100vh - var(--header-h) - 4rem);
  transform: translateY(-50%);
  direction: rtl;
  overflow: hidden auto;
  scrollbar-width: none;
  transition: opacity .3s, transform .35s var(--ease-out), visibility .3s;
}
.section-index::-webkit-scrollbar { display: none; }
[data-section-nav-visible="false"] .section-index {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translate(1rem, -50%);
}
.section-index__list { display: grid; gap: .16rem; margin: 0; padding: 0; list-style: none; }
.section-index a {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: .42rem;
  min-height: 1.48rem;
  padding: .12rem 0;
  color: color-mix(in srgb, var(--text-faint) 76%, transparent);
  font-size: clamp(.62rem, .68vw, .73rem);
  font-weight: 620;
  white-space: nowrap;
  transition: color .22s, transform .24s;
}
.section-index a:hover,
.section-index a.is-active { color: var(--text); transform: translateX(-.14rem); }
.section-index__dot {
  flex: 0 0 auto;
  width: .34rem;
  height: .34rem;
  border: 1px solid currentColor;
  border-radius: 50%;
  background: transparent;
  transition: transform .24s, background-color .24s, box-shadow .24s;
}
.section-index a.is-active .section-index__dot {
  background: var(--c-gold);
  border-color: var(--c-gold);
  transform: scale(1.35);
  box-shadow: 0 0 .7rem rgba(240,180,41,.45);
}

@media (max-width: 820px), (hover:none) and (pointer:coarse) {
  .header__nav { padding-bottom: 2rem; }
  .header__nav > .header__link,
  .header__nav > .header__menu-group { opacity: 0; transform: translateX(1rem); transition: opacity .35s var(--ease-out), transform .4s var(--ease-out); }
  .header__nav.is-open > .header__link,
  .header__nav.is-open > .header__menu-group { opacity: 1; transform: none; }
  .header__nav:not(.is-open) > .header__menu-group { pointer-events: none; }
  .header__menu-group { display: block; border-bottom: 1px solid var(--line); }
  .header__submenu-toggle { width: 100%; justify-content: space-between; padding: 1rem 1.25rem; color: var(--text); font-size: 1.05rem; font-weight: 600; }
  .header__submenu-toggle::after { display: none; }
  .header__submenu {
    position: static;
    width: auto;
    min-width: 0;
    max-height: 0;
    margin: 0;
    padding: 0 1.1rem;
    border: 0;
    border-radius: 0;
    background: var(--bg-soft);
    box-shadow: none;
    opacity: 1;
    visibility: visible;
    transform: none;
    overflow: hidden;
    pointer-events: none;
    transition: max-height .38s var(--ease-out), padding .3s;
  }
  .header__menu-group.is-open .header__submenu { max-height: 33rem; padding-block: .35rem .6rem; pointer-events: auto; transform: none; }
  .header__submenu a { padding: .68rem .85rem; font-size: .92rem; }
  .section-index { right: 1.62rem; width: 7.1rem; }
  .section-index a { font-size: .62rem; }
}

@media (max-width: 520px) {
  .section-index { right: 1.55rem; width: 5.7rem; }
  .section-index__label { max-width: 4.8rem; overflow: hidden; text-overflow: ellipsis; }
  .custom-scroll { right: .18rem; }
}

.site-settings__panel {
  max-height: calc(100vh - 6.2rem);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: color-mix(in srgb, var(--c-gold) 65%, transparent) transparent;
}
.site-settings__panel::-webkit-scrollbar { width: .28rem; }
.site-settings__panel::-webkit-scrollbar-track { background: transparent; }
.site-settings__panel::-webkit-scrollbar-thumb { border-radius: 999px; background: color-mix(in srgb, var(--c-gold) 65%, transparent); }


/* ═══════════════════════════════════════════════════════════
   R36 — اصلاح نهایی زیرمنو و Scrollbar
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 821px) {
  .header__submenu {
    display: grid;
    grid-auto-flow: column;
    grid-template-rows: repeat(3, minmax(0, auto));
    grid-auto-columns: minmax(10.5rem, max-content);
    gap: .18rem .62rem;
    min-width: 0;
    max-width: calc(100vw - 2rem);
    max-height: none;
    padding: .62rem;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
  }
  .header__submenu::-webkit-scrollbar { display: none; }
  .header__submenu a {
    display: flex;
    align-items: center;
    min-height: 2.45rem;
  }
}

.custom-scroll {
  top: .38rem;
  right: .22rem;
  bottom: .38rem;
  width: 1.05rem;
  display: block;
  pointer-events: none;
}
.custom-scroll__arrow { display: none !important; }
.custom-scroll__rail {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
}
.custom-scroll__thumb {
  width: .34rem;
}

@media (max-width: 820px), (hover:none) and (pointer:coarse) {
  .header__submenu {
    display: block;
    grid-template-rows: none;
    grid-auto-flow: row;
    grid-auto-columns: auto;
    overflow: hidden;
  }
  .custom-scroll {
    top: .3rem;
    right: .14rem;
    bottom: .3rem;
  }
}

@media (min-width: 821px) {
  .header__submenu a:hover,
  .header__submenu a:focus-visible {
    padding-inline-start: .85rem;
    transform: translateX(-.08rem);
  }
}


/* ═══════════════════════════════════════════════════════════
   R37 — هم‌ترازی دقیق زیرمنو + رنگ هوشمند Scrollbar
   ═══════════════════════════════════════════════════════════ */
@media (min-width: 821px) {
  .header__menu-group > .header__submenu {
    right: 0;
    left: auto;
    transform: translateY(-.45rem) scale(.97);
    transform-origin: top right;
  }
  .header__menu-group.is-open > .header__submenu {
    transform: translateY(0) scale(1);
  }
}

.custom-scroll {
  --smart-scroll-rgb: 240, 86, 61;
}
.custom-scroll__rail:focus-visible {
  outline-color: rgb(var(--smart-scroll-rgb));
}
.custom-scroll__thumb {
  background: rgb(var(--smart-scroll-rgb));
  box-shadow: 0 0 .72rem rgba(var(--smart-scroll-rgb), .16);
  transition: width .22s, box-shadow .22s;
}
.custom-scroll__rail:hover .custom-scroll__thumb,
.custom-scroll__rail:focus-visible .custom-scroll__thumb,
.custom-scroll-dragging .custom-scroll__thumb {
  width: .43rem;
  background: rgb(var(--smart-scroll-rgb));
  box-shadow: 0 0 .95rem rgba(var(--smart-scroll-rgb), .28);
}

/* R206 — پل تعاملی و پایداری زیرمنو در Hover/Click */
@media (min-width: 821px) {
  .header__menu-group::before {
    content: "";
    position: absolute;
    z-index: 109;
    top: 100%;
    right: -1rem;
    left: -1rem;
    height: .9rem;
    background: transparent;
    pointer-events: none;
  }
  .header__menu-group.is-open::before { pointer-events: auto; }
  .header__submenu { top: calc(100% + .48rem); }
  .header__menu-group.is-open .header__submenu,
  .header__menu-group.is-pinned .header__submenu { pointer-events: auto; }
}

/* R254 — canonical phone side-drawer rows. Keep this in the navigation bundle so
 * no later navigation rule can regress the real mobile-menu structure. */
@media (max-width: 820px), (hover:none) and (pointer:coarse) {
  .header__nav {
    padding-inline:0;
    padding-bottom:max(1.1rem,env(safe-area-inset-bottom));
  }
  .header__nav > .header__link,
  .header__nav > .header__menu-group > .header__submenu-toggle,
  .header__nav > .header__join-cta {
    box-sizing:border-box;
    width:100%;
    min-height:3.35rem;
    display:flex;
    align-items:center;
    justify-content:space-between;
    margin:0!important;
    padding:.72rem 1rem!important;
    border:0!important;
    border-bottom:1px solid color-mix(in srgb,var(--line) 82%,transparent)!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
    color:var(--text)!important;
    font:inherit;
    font-size:.92rem!important;
    font-weight:720!important;
    line-height:1.7;
    text-align:right;
  }
  .header__nav > .header__join-cta {
    justify-content:center;
    color:var(--c-gold)!important;
    border-top:1px solid color-mix(in srgb,var(--line) 72%,transparent)!important;
    border-bottom:0!important;
    margin-top:.45rem!important;
  }
  .header__nav > .header__link:hover,
  .header__nav > .header__link:focus-visible,
  .header__nav > .header__menu-group > .header__submenu-toggle:hover,
  .header__nav > .header__menu-group > .header__submenu-toggle:focus-visible,
  .header__nav > .header__menu-group.is-open > .header__submenu-toggle,
  .header__nav > .header__join-cta:hover,
  .header__nav > .header__join-cta:focus-visible {
    outline:0;
    background:var(--bg-soft)!important;
    color:var(--c-gold)!important;
  }
  .header__nav > .header__menu-group {
    width:100%;
    margin:0;
    padding:0;
    border:0!important;
  }
  .header__nav > .header__menu-group > .header__submenu-toggle svg {
    flex:0 0 auto;
    width:1rem;
    height:1rem;
    margin-inline-start:.7rem;
  }
  .header__nav .header__submenu {
    position:static!important;
    width:100%!important;
    min-width:0!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
    border-bottom:1px solid var(--line)!important;
    border-radius:0!important;
    background:color-mix(in srgb,var(--bg-soft) 65%,var(--bg))!important;
    box-shadow:none!important;
  }
  .header__nav .header__menu-group.is-open > .header__submenu {
    padding:.2rem 0!important;
  }
  .header__nav .header__submenu a {
    box-sizing:border-box;
    width:100%;
    min-height:3.05rem;
    display:flex;
    align-items:center;
    margin:0!important;
    padding:.62rem 1.35rem!important;
    border:0!important;
    border-bottom:1px solid color-mix(in srgb,var(--line) 58%,transparent)!important;
    border-radius:0!important;
    background:transparent!important;
    color:var(--text-dim)!important;
    font-size:.86rem!important;
    font-weight:580!important;
    line-height:1.7;
    text-align:right;
  }
  .header__nav .header__submenu a:last-child { border-bottom:0!important; }
  .header__nav .header__submenu a:hover,
  .header__nav .header__submenu a:focus-visible {
    outline:0;
    padding-inline-start:1.35rem!important;
    transform:none!important;
    color:var(--c-gold)!important;
    background:var(--bg-soft)!important;
  }
}

/* ═══════════════════════════════════════════════════════════
   R266 — professional mobile hamburger grid
   Header + CTA are fixed rows; only menu options scroll.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 820px), (hover:none) and (pointer:coarse) {
  html[data-mobile-webapp="true"] .header__nav,
  html.hasht-real-mobile-r260 .header__nav {
    display:grid!important;
    grid-template-rows:auto minmax(0,1fr) auto!important;
    align-items:stretch!important;
    gap:0!important;
    padding:0!important;
    overflow:hidden!important;
    overscroll-behavior:none!important;
  }
  html[data-mobile-webapp="true"] .header__nav-top,
  html.hasht-real-mobile-r260 .header__nav-top {
    grid-row:1!important;
    position:relative!important;
    top:auto!important;
    z-index:4!important;
    min-height:4.35rem!important;
    padding:max(.75rem,env(safe-area-inset-top)) 1rem .75rem!important;
    border:0!important;
    border-bottom:1px solid color-mix(in srgb,var(--line) 72%,transparent)!important;
    background:var(--bg)!important;
  }
  html[data-mobile-webapp="true"] .header__nav-brand,
  html.hasht-real-mobile-r260 .header__nav-brand {
    min-width:0!important;
    display:grid!important;
    grid-template-columns:auto minmax(0,1fr)!important;
    align-items:center!important;
    gap:.65rem!important;
  }
  html[data-mobile-webapp="true"] .header__nav-logo,
  html.hasht-real-mobile-r260 .header__nav-logo { width:2rem!important;height:2rem!important;object-fit:contain!important; }
  html[data-mobile-webapp="true"] .header__nav-identity,
  html.hasht-real-mobile-r260 .header__nav-identity { min-width:0!important;display:grid!important;gap:.05rem!important;line-height:1.45!important; }
  html[data-mobile-webapp="true"] .header__nav-identity strong,
  html.hasht-real-mobile-r260 .header__nav-identity strong { color:var(--text)!important;font-size:.92rem!important;font-weight:900!important; }
  html[data-mobile-webapp="true"] .header__nav-identity small,
  html.hasht-real-mobile-r260 .header__nav-identity small { color:var(--text-faint)!important;font-size:.64rem!important;font-weight:620!important;white-space:nowrap!important;overflow:hidden!important;text-overflow:ellipsis!important; }
  html[data-mobile-webapp="true"] .header__nav-close,
  html.hasht-real-mobile-r260 .header__nav-close {
    width:2.35rem!important;height:2.35rem!important;border:0!important;border-radius:.7rem!important;background:transparent!important;box-shadow:none!important;
  }

  html[data-mobile-webapp="true"] .header__nav-scroll,
  html.hasht-real-mobile-r260 .header__nav-scroll {
    grid-row:2!important;
    min-height:0!important;
    display:grid!important;
    grid-auto-flow:row!important;
    grid-auto-rows:max-content!important;
    align-content:start!important;
    gap:.12rem!important;
    padding:.55rem .55rem .8rem!important;
    overflow-y:auto!important;
    overflow-x:hidden!important;
    overscroll-behavior:contain!important;
    -webkit-overflow-scrolling:touch!important;
    scrollbar-width:thin!important;
    scrollbar-color:color-mix(in srgb,var(--c-gold) 38%,transparent) transparent!important;
  }
  html[data-mobile-webapp="true"] .header__nav-scroll::-webkit-scrollbar,
  html.hasht-real-mobile-r260 .header__nav-scroll::-webkit-scrollbar { width:.22rem!important; }
  html[data-mobile-webapp="true"] .header__nav-scroll::-webkit-scrollbar-thumb,
  html.hasht-real-mobile-r260 .header__nav-scroll::-webkit-scrollbar-thumb { background:color-mix(in srgb,var(--c-gold) 38%,transparent)!important;border-radius:999px!important; }

  html[data-mobile-webapp="true"] .header__nav-scroll > .header__link,
  html[data-mobile-webapp="true"] .header__nav-scroll > .header__menu-group > .header__submenu-toggle,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__link,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__menu-group > .header__submenu-toggle {
    width:100%!important;
    min-height:3.15rem!important;
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    margin:0!important;
    padding:.68rem .75rem!important;
    border:0!important;
    border-bottom:0!important;
    border-radius:.72rem!important;
    background:transparent!important;
    box-shadow:none!important;
    color:var(--text)!important;
    font-size:.9rem!important;
    font-weight:720!important;
    line-height:1.7!important;
    text-align:right!important;
    opacity:1!important;
    transform:none!important;
  }
  html[data-mobile-webapp="true"] .header__nav-scroll > .header__link:hover,
  html[data-mobile-webapp="true"] .header__nav-scroll > .header__link:focus-visible,
  html[data-mobile-webapp="true"] .header__nav-scroll > .header__menu-group > .header__submenu-toggle:hover,
  html[data-mobile-webapp="true"] .header__nav-scroll > .header__menu-group > .header__submenu-toggle:focus-visible,
  html[data-mobile-webapp="true"] .header__nav-scroll > .header__menu-group.is-open > .header__submenu-toggle,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__link:hover,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__link:focus-visible,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__menu-group > .header__submenu-toggle:hover,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__menu-group > .header__submenu-toggle:focus-visible,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__menu-group.is-open > .header__submenu-toggle {
    outline:0!important;
    background:var(--bg-soft)!important;
    color:var(--c-gold)!important;
  }
  html[data-mobile-webapp="true"] .header__nav-scroll > .header__menu-group,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__menu-group { width:100%!important;margin:0!important;padding:0!important;border:0!important;border-bottom:0!important; }
  html[data-mobile-webapp="true"] .header__nav-scroll .header__submenu,
  html.hasht-real-mobile-r260 .header__nav-scroll .header__submenu {
    width:100%!important;
    margin:0!important;
    padding:0 .45rem!important;
    border:0!important;
    border-bottom:0!important;
    border-radius:0!important;
    background:transparent!important;
    box-shadow:none!important;
  }
  html[data-mobile-webapp="true"] .header__nav-scroll .header__menu-group.is-open > .header__submenu,
  html.hasht-real-mobile-r260 .header__nav-scroll .header__menu-group.is-open > .header__submenu { padding:.12rem .45rem .35rem!important; }
  html[data-mobile-webapp="true"] .header__nav-scroll .header__submenu a,
  html.hasht-real-mobile-r260 .header__nav-scroll .header__submenu a {
    width:100%!important;
    min-height:2.75rem!important;
    display:flex!important;
    align-items:center!important;
    margin:0!important;
    padding:.52rem .75rem!important;
    border:0!important;
    border-bottom:0!important;
    border-radius:.65rem!important;
    background:transparent!important;
    color:var(--text-dim)!important;
    font-size:.84rem!important;
    font-weight:580!important;
    text-align:right!important;
  }
  html[data-mobile-webapp="true"] .header__nav-scroll .header__submenu a:hover,
  html[data-mobile-webapp="true"] .header__nav-scroll .header__submenu a:focus-visible,
  html.hasht-real-mobile-r260 .header__nav-scroll .header__submenu a:hover,
  html.hasht-real-mobile-r260 .header__nav-scroll .header__submenu a:focus-visible {
    outline:0!important;
    padding-inline-start:.75rem!important;
    transform:none!important;
    background:var(--bg-soft)!important;
    color:var(--c-gold)!important;
  }

  html[data-mobile-webapp="true"] .header__nav > .header__join-cta,
  html.hasht-real-mobile-r260 .header__nav > .header__join-cta {
    grid-row:3!important;
    position:relative!important;
    z-index:4!important;
    width:auto!important;
    min-height:3.05rem!important;
    display:flex!important;
    align-items:center!important;
    justify-content:center!important;
    margin:.6rem .85rem max(.7rem,env(safe-area-inset-bottom))!important;
    padding:.6rem 1rem!important;
    border:1px solid var(--c-gold)!important;
    border-radius:.85rem!important;
    background:color-mix(in srgb,var(--c-gold) 8%,var(--bg))!important;
    box-shadow:none!important;
    color:var(--c-gold)!important;
    font-size:.9rem!important;
    font-weight:850!important;
    opacity:1!important;
    transform:none!important;
  }

  /* Settings is a separate floating utility and must disappear while the drawer
     owns the interaction layer. */
  html.hasht-drawer-open #site-settings.site-settings,
  body.drawer-open #site-settings.site-settings {
    opacity:0!important;
    visibility:hidden!important;
    pointer-events:none!important;
    transform:scale(.96)!important;
  }
}


/* R266 mobile drawer fallback: mobile-app-r266 owns colors; navigation must not reintroduce separators. */
@media (max-width: 820px), (hover:none) and (pointer:coarse) {
  .header__nav > .header__link,
  .header__nav > .header__menu-group,
  .header__nav > .header__menu-group > .header__submenu-toggle,
  .header__nav .header__submenu,
  .header__nav .header__submenu a { border-bottom: 0 !important; }
}

/* ═══════════════════════════════════════════════════════════
   R267 — authoritative hamburger parent-row contrast contract
   This file is loaded after mobile-app.css, therefore the final cascade must
   own parent-row color/background. Parent rows are never transparent.
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 820px), (hover:none) and (pointer:coarse) {
  html[data-mobile-webapp="true"],
  html.hasht-real-mobile-r260 {
    --mwa-parent-row-fg:#171512;
    --mwa-parent-row-bg:#f1efe9;
    --mwa-parent-row-open-fg:#6b4319;
    --mwa-parent-row-open-bg:#fff0da;
    --mwa-submenu-fg:#555149;
  }
  html[data-theme="dark"][data-mobile-webapp="true"],
  html[data-theme="dark"].hasht-real-mobile-r260 {
    --mwa-parent-row-fg:#f7f3eb;
    --mwa-parent-row-bg:#252a33;
    --mwa-parent-row-open-fg:#ffd6a2;
    --mwa-parent-row-open-bg:#3b3025;
    --mwa-submenu-fg:#d1cabf;
  }

  html[data-mobile-webapp="true"] .header__nav-scroll > .header__menu-group > .header__submenu-toggle,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__menu-group > .header__submenu-toggle,
  html[data-mobile-webapp="true"] .header__nav > .header__menu-group > .header__submenu-toggle,
  html.hasht-real-mobile-r260 .header__nav > .header__menu-group > .header__submenu-toggle {
    color:var(--mwa-parent-row-fg)!important;
    -webkit-text-fill-color:var(--mwa-parent-row-fg)!important;
    background-color:var(--mwa-parent-row-bg)!important;
    background-image:none!important;
    opacity:1!important;
    visibility:visible!important;
    mix-blend-mode:normal!important;
    filter:none!important;
    text-shadow:none!important;
    border:0!important;
    border-radius:.82rem!important;
    box-shadow:none!important;
  }
  html[data-mobile-webapp="true"] .header__nav-scroll > .header__menu-group > .header__submenu-toggle > span,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__menu-group > .header__submenu-toggle > span,
  html[data-mobile-webapp="true"] .header__nav > .header__menu-group > .header__submenu-toggle > span,
  html.hasht-real-mobile-r260 .header__nav > .header__menu-group > .header__submenu-toggle > span {
    display:inline-block!important;
    color:inherit!important;
    -webkit-text-fill-color:currentColor!important;
    opacity:1!important;
    visibility:visible!important;
    mix-blend-mode:normal!important;
    filter:none!important;
  }
  html[data-mobile-webapp="true"] .header__nav-scroll > .header__menu-group > .header__submenu-toggle svg,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__menu-group > .header__submenu-toggle svg,
  html[data-mobile-webapp="true"] .header__nav > .header__menu-group > .header__submenu-toggle svg,
  html.hasht-real-mobile-r260 .header__nav > .header__menu-group > .header__submenu-toggle svg {
    color:inherit!important;
    stroke:currentColor!important;
    fill:none!important;
    opacity:1!important;
    visibility:visible!important;
    filter:none!important;
  }
  html[data-mobile-webapp="true"] .header__nav-scroll > .header__menu-group.is-open > .header__submenu-toggle,
  html.hasht-real-mobile-r260 .header__nav-scroll > .header__menu-group.is-open > .header__submenu-toggle,
  html[data-mobile-webapp="true"] .header__nav > .header__menu-group.is-open > .header__submenu-toggle,
  html.hasht-real-mobile-r260 .header__nav > .header__menu-group.is-open > .header__submenu-toggle {
    color:var(--mwa-parent-row-open-fg)!important;
    -webkit-text-fill-color:var(--mwa-parent-row-open-fg)!important;
    background-color:var(--mwa-parent-row-open-bg)!important;
    background-image:none!important;
  }
  html[data-mobile-webapp="true"] .header__nav .header__submenu a,
  html.hasht-real-mobile-r260 .header__nav .header__submenu a {
    color:var(--mwa-submenu-fg)!important;
    -webkit-text-fill-color:var(--mwa-submenu-fg)!important;
    opacity:1!important;
    visibility:visible!important;
    border:0!important;
    border-bottom:0!important;
  }
}

/* R267 hard-stop fallback — viewport is the source of truth.
   Do not depend on a JS-added mobile marker to make submenu parents readable. */
@media (max-width: 820px) {
  :root {
    --mwa-parent-row-fg:#171512;
    --mwa-parent-row-bg:#f1efe9;
    --mwa-parent-row-open-fg:#6b4319;
    --mwa-parent-row-open-bg:#fff0da;
    --mwa-submenu-fg:#555149;
  }
  html[data-theme="dark"] {
    --mwa-parent-row-fg:#f7f3eb;
    --mwa-parent-row-bg:#252a33;
    --mwa-parent-row-open-fg:#ffd6a2;
    --mwa-parent-row-open-bg:#3b3025;
    --mwa-submenu-fg:#d1cabf;
  }
  .header__nav .header__menu-group > .header__submenu-toggle {
    color:var(--mwa-parent-row-fg)!important;
    -webkit-text-fill-color:var(--mwa-parent-row-fg)!important;
    background:var(--mwa-parent-row-bg)!important;
    opacity:1!important;
    visibility:visible!important;
    mix-blend-mode:normal!important;
    filter:none!important;
    border:0!important;
    box-shadow:none!important;
  }
  .header__nav .header__menu-group > .header__submenu-toggle > span {
    color:inherit!important;
    -webkit-text-fill-color:currentColor!important;
    opacity:1!important;
    visibility:visible!important;
  }
  .header__nav .header__menu-group > .header__submenu-toggle svg {
    color:inherit!important;
    stroke:currentColor!important;
    fill:none!important;
    opacity:1!important;
    visibility:visible!important;
  }
  .header__nav .header__menu-group.is-open > .header__submenu-toggle {
    color:var(--mwa-parent-row-open-fg)!important;
    -webkit-text-fill-color:var(--mwa-parent-row-open-fg)!important;
    background:var(--mwa-parent-row-open-bg)!important;
  }
  .header__nav .header__submenu a {
    color:var(--mwa-submenu-fg)!important;
    -webkit-text-fill-color:var(--mwa-submenu-fg)!important;
    opacity:1!important;
    visibility:visible!important;
  }
}


/* ========================================================================
   R269 — reparent-safe hamburger menu visibility contract
   syncMobileDrawerGrid() moves groups below .header__nav-scroll. Legacy rules
   animated direct children only, leaving the moved group at opacity:0 while
   still hit-testable. Drawer visibility now belongs to the drawer container;
   every reparented interactive row is explicitly visible when the drawer opens.
   ======================================================================== */
@media (max-width:820px), (hover:none) and (pointer:coarse){
  .header__nav .header__nav-scroll > .header__link,
  .header__nav .header__nav-scroll > .header__menu-group{
    opacity:1!important;
    visibility:visible!important;
    transform:none!important;
    filter:none!important;
    mix-blend-mode:normal!important;
  }
  .header__nav.is-open .header__nav-scroll > .header__link,
  .header__nav.is-open .header__nav-scroll > .header__menu-group{
    pointer-events:auto!important;
  }
  .header__nav:not(.is-open) .header__nav-scroll > .header__link,
  .header__nav:not(.is-open) .header__nav-scroll > .header__menu-group{
    pointer-events:none!important;
  }
  .header__nav .header__nav-scroll > .header__menu-group{
    display:block!important;
    width:100%!important;
    height:auto!important;
    min-height:0!important;
    margin:0!important;
    padding:0!important;
    border:0!important;
  }
  .header__nav .header__nav-scroll > .header__menu-group > .header__submenu-toggle{
    display:flex!important;
    align-items:center!important;
    justify-content:space-between!important;
    width:100%!important;
    min-height:3rem!important;
    height:auto!important;
    margin:0!important;
    padding:.78rem .9rem!important;
    color:var(--mwa-parent-row-fg,#171512)!important;
    -webkit-text-fill-color:var(--mwa-parent-row-fg,#171512)!important;
    background-color:var(--mwa-parent-row-bg,#f1efe9)!important;
    background-image:none!important;
    opacity:1!important;
    visibility:visible!important;
    font-size:.95rem!important;
    font-weight:780!important;
    line-height:1.45!important;
    border:0!important;
    border-radius:.82rem!important;
    box-shadow:none!important;
  }
  .header__nav .header__nav-scroll > .header__menu-group > .header__submenu-toggle > span{
    display:inline!important;
    flex:1 1 auto!important;
    min-width:0!important;
    color:inherit!important;
    -webkit-text-fill-color:currentColor!important;
    opacity:1!important;
    visibility:visible!important;
    font:inherit!important;
    line-height:inherit!important;
    text-indent:0!important;
    white-space:normal!important;
  }
  .header__nav .header__nav-scroll > .header__menu-group > .header__submenu-toggle svg{
    display:block!important;
    flex:0 0 1.15rem!important;
    width:1.15rem!important;
    height:1.15rem!important;
    color:inherit!important;
    stroke:currentColor!important;
    opacity:1!important;
    visibility:visible!important;
  }
  .header__nav .header__nav-scroll > .header__menu-group.is-open > .header__submenu-toggle{
    color:var(--mwa-parent-row-open-fg,#6b4319)!important;
    -webkit-text-fill-color:var(--mwa-parent-row-open-fg,#6b4319)!important;
    background-color:var(--mwa-parent-row-open-bg,#fff0da)!important;
  }
}


/* R330 — section index follows the text block only while story scenes 1..4 are active. */
.section-index.is-story-adjacent{
  position:fixed;
  right:auto;
  transform:translateY(-50%);
  max-height:min(72vh,34rem);
  background:transparent!important;
  border:0!important;
  box-shadow:none!important;
  backdrop-filter:none!important;
  -webkit-backdrop-filter:none!important;
  z-index:915;
}
.section-index.is-story-adjacent a{justify-content:flex-start}
@media (min-width:821px) and (max-width:1120px){
  .section-index.is-story-adjacent{width:min(7.2rem,15vw)!important}
  .section-index.is-story-adjacent .section-index__label{max-width:6.2rem;overflow:hidden;text-overflow:ellipsis}
  .story-scene[data-align="left"] .story-scene__content-col{max-width:calc(100vw - var(--section-index-story-reserve,9rem) - 2rem)}
  .story-scene[data-align="right"] .story-scene__content-col{max-width:calc(100vw - var(--section-index-story-reserve,9rem) - 2rem)}
}
