/* KAVIREN phone build 5e (v=20261005e) */
/* KAVIREN PHONE EXPERIENCE v1
   PHONE ONLY (max-width:720px). Every rule below sits inside that media query, so laptop/desktop and
   tablet (>=721px) are not affected. Linked last on each page so it is the final authority at phone width. */
@media (max-width:720px){
  .kaviren-smart-discovery-parent~.shell .scene{padding-top:calc(var(--kv-master-header-h,96px) - var(--head,64px) + 12px)!important}


/* ---------- SMART TOPICS (discover/*.html topic pages) ---------- */
.kaviren-smart-discovery-parent~.shell .orientation{white-space:normal!important;flex-wrap:wrap!important;gap:2px 10px!important;min-height:0!important;}
.kaviren-smart-discovery-parent~.shell .orientation .topicName{font-size:15px!important;}
.kaviren-smart-discovery-parent~.shell .orientation .chapterNo{margin-left:0!important;width:100%!important;font-size:12px!important;letter-spacing:.07em!important;}

/* 360 connection: a clean orbit card (hub + chips) instead of absolutely positioned labels that collide */
.kaviren-smart-discovery-parent~.shell .scene .viz{
  position:relative!important;height:auto!important;min-height:0!important;max-height:none!important;
  display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:10px!important;
  padding:18px 14px 16px!important;border-radius:24px!important;overflow:hidden!important;
}
.kaviren-smart-discovery-parent~.shell .scene .viz .vizLabel{
  grid-column:1/-1!important;position:static!important;transform:none!important;margin:0!important;text-align:center!important;
}
.kaviren-smart-discovery-parent~.shell .scene .viz .orb{
  grid-column:1/-1!important;position:relative!important;inset:auto!important;left:auto!important;top:auto!important;right:auto!important;bottom:auto!important;
  transform:none!important;width:132px!important;height:132px!important;margin:4px auto 8px!important;
  display:grid!important;place-items:center!important;text-align:center!important;border-radius:50%!important;padding:14px!important;
}
.kaviren-smart-discovery-parent~.shell .scene .viz .orb strong{font-size:14px!important;line-height:1.12!important;}
.kaviren-smart-discovery-parent~.shell .scene .viz .node{
  position:static!important;inset:auto!important;left:auto!important;right:auto!important;top:auto!important;bottom:auto!important;transform:none!important;
  width:auto!important;max-width:none!important;margin:0!important;
  display:flex!important;align-items:center!important;gap:9px!important;
  padding:12px 12px!important;border:1px solid rgba(232,203,115,.22)!important;border-radius:14px!important;
  background:rgba(255,255,255,.03)!important;font-size:14px!important;line-height:1.15!important;white-space:normal!important;
}
.kaviren-smart-discovery-parent~.shell .scene .viz .node span{display:block!important;width:auto!important;max-width:none!important;text-align:left!important;overflow-wrap:normal!important;}
.kaviren-smart-discovery-parent~.shell .scene .viz .node.on{border-color:rgba(52,245,138,.65)!important;background:rgba(52,245,138,.09)!important;}
.kaviren-smart-discovery-parent~.shell .scene .viz .node:nth-last-child(2):nth-child(odd){grid-column:1/-1!important;}
.kaviren-smart-discovery-parent~.shell .scene .viz .vizInsight{
  grid-column:1/-1!important;position:static!important;inset:auto!important;transform:none!important;width:auto!important;max-width:none!important;
  margin:4px 0 0!important;min-height:0!important;text-align:left!important;
}

/* Completed-topic screen: fits the phone, buttons never leave the screen */
.kaviren-smart-discovery-parent~.done{inset:var(--kv-master-header-h,96px) 0 0!important;padding:20px 16px 28px!important;overflow-y:auto!important;align-items:start!important;justify-items:stretch!important;grid-template-columns:minmax(0,1fr)!important;}
.kaviren-smart-discovery-parent~.done .doneBox{width:100%!important;max-width:100%!important;padding-top:6vh;}
.kaviren-smart-discovery-parent~.done h2{font-size:clamp(30px,9.4vw,42px)!important;line-height:1.06!important;text-wrap:balance;overflow-wrap:normal;}
.kaviren-smart-discovery-parent~.done p{font-size:16px!important;line-height:1.5!important;}
.kaviren-smart-discovery-parent~.done .doneActions{flex-direction:column!important;align-items:stretch!important;gap:10px!important;}
.kaviren-smart-discovery-parent~.done .doneActions a{display:flex!important;justify-content:center!important;align-items:center!important;text-align:center!important;white-space:normal!important;box-sizing:border-box!important;width:100%!important;line-height:1.25!important;padding:14px 16px!important;}
/* the static "Next" link and the script-created one are identical; show one */
.kaviren-smart-discovery-parent~.done .doneActions a[data-next-topic]~a.primary{display:none!important;}
}

/* Gentle hub pulse, only when the phone allows motion */
@media (max-width:720px) and (prefers-reduced-motion:no-preference){
  .kaviren-smart-discovery-parent~.shell .scene .viz .orb{animation:kvOrbPulse 4.2s ease-in-out infinite;}
  @keyframes kvOrbPulse{0%,100%{box-shadow:0 0 0 0 rgba(52,245,138,.16)}50%{box-shadow:0 0 0 14px rgba(52,245,138,0)}}
}

/* ===== v2 phone fixes (all phone-only) ===== */
@media (max-width:720px){
  /* opaque header + rail: no content bleeding through */
  html body > header.kv-master-header{background:#020805!important}
  #journeyRail{background:#020805!important;box-shadow:0 -14px 0 #020805!important}
  /* Discover index: heading clears the 96px header */
  main.hub{padding-top:calc(var(--kv-master-header-h,96px) + 18px)!important}
  /* Your 360 Discovery: label clears header */
  main.discovery{padding-top:84px!important}
  /* Wealth Lens: story spine gets a solid backing so cards never show through it */
  html body #m5WealthLens .m5-lens-story-spine,
  html body #m6FinancialLifeMap .m6-story-spine{background:#030a06!important;z-index:30!important;top:-18px!important;box-shadow:-24px 0 0 #030a06,24px 0 0 #030a06,0 1px 0 rgba(232,203,115,.16)!important}
  /* Who We Are: chapter CTA always owns the bottom of the visible screen */
  html body section.who-chapter.who-chapter.who-chapter:is(#who-story,#who-philosophy,#who-different,#who-journey,#who-family,#who-people,#who-community,#who-approach,#who-conversation)>.who-section-nav{position:sticky!important;bottom:0!important;z-index:40!important;transform:none!important;left:auto!important;justify-self:stretch!important;width:calc(100% - 28px)!important;max-width:none!important;margin:auto auto 0!important;gap:10px!important;padding:12px 0 calc(12px + env(safe-area-inset-bottom,0px))!important;background:linear-gradient(180deg,rgba(2,8,5,0),#020805 28%)!important;border-top:0!important}
  html body .hero.who-chapter#who-intro>.who-section-nav{position:absolute!important;left:14px!important;right:14px!important;bottom:calc(10px + env(safe-area-inset-bottom,0px))!important;transform:none!important;width:auto!important;max-width:none!important;padding:0!important;background:none!important}
  html body #who-intro.hero.who-chapter>.who-section-nav{display:flex!important;border-top:0!important}
  html body #who-intro.hero.who-chapter>.who-section-nav a[href="#who-story"]{flex:1 1 auto!important;width:100%!important;justify-content:center!important;min-height:46px!important;border:1px solid #e8cb73!important;border-radius:999px!important;background:linear-gradient(180deg,#f5dfa0,#e8cb73)!important;color:#10140f!important;font-size:12px!important}
  html body .who-chapter .who-section-nav>span:empty{display:none!important}
  html body section.who-chapter.who-chapter.who-chapter:is(#who-story,#who-philosophy,#who-different,#who-journey,#who-family,#who-people,#who-community,#who-approach,#who-conversation)>.who-section-nav a{flex:1 1 0!important;justify-content:center!important;text-align:center!important;min-height:46px!important;border:1px solid rgba(232,203,115,.38)!important;border-radius:999px!important;background:#06120c!important;color:#f1d996!important;font-size:12px!important}
  html body section.who-chapter.who-chapter.who-chapter:is(#who-story,#who-philosophy,#who-different,#who-journey,#who-family,#who-people,#who-community,#who-approach,#who-conversation)>.who-section-nav a:last-child{background:linear-gradient(180deg,#f5dfa0,#e8cb73)!important;color:#10140f!important}
}
/* Areas of Guidance: phone version of the misty "doorways" hub */
@media (max-width:720px){
  html body #familiar-needs .living-map{overflow-x:clip!important}
  html body #familiar-needs .living-map>.map-core{display:flex!important;order:-1!important;position:relative!important;left:auto!important;top:auto!important;transform:none!important;margin:78px auto 74px!important;width:150px!important;height:150px!important}
  html body #familiar-needs .living-map>.map-core .kv-energy-field{transform:scale(.78)!important}
  html body #familiar-needs .living-map>.map-core strong{font-size:1.2rem!important}
}
@media (max-width:720px) and (prefers-reduced-motion:no-preference){
  @supports (animation-timeline:view()){
    @keyframes kvPhoneDoorway{from{opacity:.15;filter:blur(5px);transform:translateY(14px) scale(.985)}to{opacity:1;filter:none;transform:none}}
    html body #familiar-needs .map-territory{animation:kvPhoneDoorway linear both;animation-timeline:view();animation-range:entry 0% entry 55%}
  }
}

/* ===== v3 phone fixes: scenes, rails, gateway, back ===== */
@media (max-width:720px){
  /* nothing from the page behind may show above full-screen wealth scenes or in rail gaps */
  html body .m4-journey,html body #journeyRail{background:#020805!important;box-shadow:0 -26px 0 #020805!important}
  html body .m8-gateway,html body .m9-gateway,html body .m5-lens-scene,html body .m6-map-scene,html body .m7-scene,html body .kfi-scene{box-shadow:0 -64px 0 #020805!important}
  /* gateway: response view must never exceed the screen width */
  html body .m8-gateway.response-mode .m8-lead{white-space:normal!important}
  html body .m8-gateway .m8-top,html body .m8-gateway .m8-top>div{min-width:0!important;max-width:100%!important}
  html body .m8-gateway .m8-close{min-height:46px!important;padding:12px 20px!important;font-size:12px!important}
  /* page sub-menus: reserve room so the last item is never clipped, with a soft edge cue */
  html body .m4-journey-inner,html body #journeyRail .journey-inner{padding-right:34px!important;scroll-padding-inline:16px!important}
  html body .m4-journey-inner,html body #journeyRail .journey-inner{-webkit-mask-image:linear-gradient(90deg,#000 0,#000 90%,transparent 100%);mask-image:linear-gradient(90deg,#000 0,#000 90%,transparent 100%)}
  /* Ecosystem two-worlds chooser: breathing room under the Back button */
  html body .kv-wealth-back{margin-bottom:18px!important}
}

@media (max-width:720px){html body #m6FinancialLifeMap .m6-story-spine{top:-14px!important}}

/* "View above" floating button: solid pill so page text never shows through it (phone only) */
@media (max-width:720px){
  html body .k93-view-above{background:rgba(3,10,6,.97)!important;border-radius:999px!important;padding:3px 5px 3px 16px!important;box-shadow:0 0 0 1px rgba(232,203,115,.34),0 8px 24px rgba(0,0,0,.65)!important;-webkit-backdrop-filter:blur(6px);backdrop-filter:blur(6px)}
}
