/* EB-UWF-HERMES-CSI-HOME-V3-20261115 — Home-scoped pilot fixes.
   Scope: native header menu panel geometry and the terminal tools row,
   narrow viewports only. No remote assets, no other family touched.

   FIX 1 — menu panel outside the viewport (320/390).
   Cause: assets/eb-eco-grid-v3.css sets
     html body .eb-opt-menu__panel{inset:calc(100% + .5rem) 0 auto auto;
       inline-size:min(25rem,calc(100vw - 1.5rem))}
   The panel is right-anchored and sized from 100vw, so its left edge fell
   outside: left -4.78px @320, -4.26px @390 (right edge stayed inside).

   FIX 2 — BG document wider than the viewport at 320px.
   Cause: .ebf-terminal__tools{flex:0 0 auto} inside the flex row
   .ebf-terminal cannot shrink, and .ebf-motion-toggle uses white-space:nowrap,
   so the row ended at x=333 against a 320px viewport (13px overflow, 25px in
   reduced-motion). Letting the row wrap keeps the label intact; shrinking the
   button alone would clip the Bulgarian text. */

@media (max-width: 480px) {
  html body .eb-opt-menu__panel {
    inline-size: calc(100vw - 2.75rem);
    max-inline-size: calc(100vw - 2.75rem);
  }

  .ebf-terminal {
    flex-wrap: wrap;
  }

  .ebf-terminal__tools {
    flex: 1 1 auto;
    min-width: 0;
  }

  .ebf-motion-toggle {
    max-width: 100%;
  }
}

/* V3 Home fold — keep decorative layers out of the content grid. */
@media screen {
  html body[data-ebv-family="home"] main .hero.eb30-spectacle > :is(.eg-decor,.eb-orbital-depth,.ebp01-halo) {
    position: absolute;
  }
}
@media screen and (max-width:56rem) {
  html body[data-ebv-family="home"] main .hero.eb30-spectacle > .eb30-hero-copy {
    grid-area: 1 / 1;
  }
  html body[data-ebv-family="home"] main .hero.eb30-spectacle > .eb30-orb-stage {
    grid-area: 2 / 1;
  }
}
@media screen and (min-width:56.001rem) {
  html body[data-ebv-family="home"] main .hero.eb30-spectacle {
    grid-template-columns: minmax(0, 1.22fr) minmax(0, 1fr);
  }
  html body[data-ebv-family="home"] main .hero.eb30-spectacle > .eb30-hero-copy {
    grid-area: 1 / 1;
  }
  html body[data-ebv-family="home"] main .hero.eb30-spectacle > .eb30-orb-stage {
    grid-area: 1 / 2;
  }
  html body[data-ebv-family="home"] main .hero.eb30-spectacle h1 {
    font-size: clamp(2.5rem, 3.7vw, 3.6rem);
    max-inline-size: none;
  }
}

/* Home mobile fold: keep text and both CTAs clear of the consent launcher. */
@media screen and (max-width: 480px) {
  html body[data-ebv-family="home"] main .hero.eb30-spectacle > .eb30-hero-copy { padding: .35rem !important; }
  html body[data-ebv-family="home"] main .hero.eb30-spectacle h1 { margin-block: .20em .22em; }
  html body[data-ebv-family="home"] main .hero.eb30-spectacle .lead { line-height: 1.4; margin-block: 0 .65rem; }
  html body[data-ebv-family="home"] main .hero.eb30-spectacle .hero-actions { gap: .45rem; margin-block-end: .4rem; }
  html body[data-ebv-family="home"] main .hero.eb30-spectacle .eb-journey-credibility {
    font-size: .78rem; line-height: 1.35; letter-spacing: .01em;
  }
}


/* ===== EB FACTORY r1 · energy flow legend (Home, EN/BG) =====
   Names the three stages of the existing isometric showcase so the diagram
   reads as generation -> storage -> grid without relying on animation.
   Static by design: works with reduced motion, no JS and on touch. */
.eb-flow-legend{display:flex;flex-wrap:wrap;align-items:center;gap:10px 14px;margin:14px 0 0;padding:12px 14px;border:1px solid rgba(127,228,173,.22);border-radius:14px;background:rgba(9,26,32,.55)}
.eb-flow-legend__step{display:inline-flex;align-items:baseline;gap:8px;font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:#dff3e9}
.eb-flow-legend__step b{font:700 11px/1 ui-monospace,SFMono-Regular,Menlo,monospace;color:#b7f5cd;opacity:.9}
.eb-flow-legend__arrow{font-size:14px;line-height:1;color:#7ee8e6;opacity:.8}
@media (max-width:520px){.eb-flow-legend{gap:8px 10px;padding:10px 11px}.eb-flow-legend__step{font-size:11px}}
@media (prefers-reduced-motion:reduce){.eb-flow-legend,.eb-flow-legend *{animation:none!important;transition:none!important}}
@media (max-width:360px){
  #eb16-consent .eb16-panel{max-height:34vh!important;max-height:34dvh!important}
  #eb16-consent .eb16-desc{display:none}
}
/* r2d: <=900px — the notice pushes the page down so it covers neither the
   header (menu, locale) nor the hero CTA. At 320px the CTAs sit just below
   the fold and need one short scroll; nothing is overlapped. */
@media (max-width:900px){
  body:has(#eb16-consent[data-eb16-auto]){padding-top:168px}
}
/* r2e: the fixed consent container is full-width and its box extended over the
   header, intercepting clicks on the menu at some widths. Only its children
   should take pointer events. */
@media (max-width:900px){
  #eb16-consent[data-eb16-auto]{pointer-events:none}
  #eb16-consent[data-eb16-auto] .eb16-panel,
  #eb16-consent[data-eb16-auto] .eb16-launch{pointer-events:auto}
}

/* Reading depth: native disclosure retains the full guidance without a long wall of text. */
#ebp-home details.ebp-chapter-body>summary{cursor:pointer;min-height:44px;padding:12px 0;color:#b7f5cd;font-weight:650;line-height:1.5}
#ebp-home details.ebp-chapter-body>summary:focus-visible{outline:2px solid #caff8f;outline-offset:5px;border-radius:4px}
#ebp-home details.ebp-chapter-body[open]>summary{margin-bottom:12px}

/* Home editorial index: direct access to evidence, system diagram and edition concepts. */
.eb-home-index{display:flex;flex-wrap:wrap;gap:8px 24px;align-items:center;width:min(980px,calc(100% - 32px));margin:20px auto 32px;padding:16px 0;border-block:1px solid #344c53}
.eb-home-index>span{color:#a8bdc1;font-size:12px;text-transform:uppercase;letter-spacing:.12em}
.eb-home-index a{display:inline-flex;align-items:center;min-height:44px;color:#e5f5eb;font-size:14px;text-decoration:underline;text-underline-offset:5px;text-decoration-color:#6c9283}
.eb-home-index a:hover{color:#c7ff67}
.eb-home-index a:focus-visible{outline:2px solid #c7ff67;outline-offset:5px;border-radius:3px}
@media(max-width:480px){.eb-home-index{gap:0 16px}.eb-home-index>span{flex-basis:100%;padding:8px 0}}
