/* Cross-device layout refinements — all ECP pages */

html {
  overflow-x: clip;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  overflow-x: clip;
}

main,
.wrap,
.section,
.split,
.hero-grid,
.booking-layout,
.explorer,
.demo-panels,
.proof-grid,
.footer-top,
.dash-shell {
  min-width: 0;
}

h1,
h2,
.section-heading h2 {
  text-wrap: balance;
}

p,
.lead,
.faqs details p {
  overflow-wrap: anywhere;
}

.site-header .wrap.nav {
  padding-inline: max(0px, env(safe-area-inset-left)) max(0px, env(safe-area-inset-right));
}

/* Elite Professionals Clinics header lockup */
.site-header .brand {
  width: auto;
  max-width: min(260px, 52vw);
}
.site-header .brand img {
  width: 100%;
  height: auto;
  max-height: 52px;
  object-fit: contain;
  object-position: left center;
}
.site-footer .brand {
  display: none;
}

@media (max-width: 680px) {
  .site-header .brand {
    max-width: min(200px, 58vw);
  }
  .site-header .brand img {
    max-height: 44px;
  }
}

.skip {
  left: max(12px, env(safe-area-inset-left));
}

.menu-toggle,
.nav nav a,
.journey-tabs button,
.time-slots button,
.calendar-days button,
.icon-button {
  min-height: 44px;
}

.journey-tabs {
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  overscroll-behavior-x: contain;
}

/* Hero film overlay — full-bleed; play bottom-centre on desktop */
.hero-visual .film-play{
  inset:0;
  width:100%;
  height:100%;
  padding:28px 20px 26px;
  justify-content:flex-end;
  align-items:center;
  text-align:center;
  background:linear-gradient(180deg,transparent 48%,#062f32aa 100%);
}
.hero-visual .film-play .play{margin-bottom:10px}

/* IVY chip: kit bottom-right on desktop (bottom:215px), clear of play */
.hero-visual .floating-status{
  top:auto;
  right:18px;
  bottom:215px;
  left:auto;
}

@media (max-width:680px){
  .home-hero .hero-visual,
  .hero-visual{
    height:clamp(210px,56vw,248px);
    max-height:248px;
    min-height:0;
    margin-bottom:18px;
  }
  .hero-visual>img{
    object-position:70% 18%;
  }
  /* Mobile: play bottom-left */
  .hero-visual .film-play{
    inset:0;
    padding:16px 14px 18px;
    justify-content:flex-end;
    align-items:flex-start;
    text-align:left;
  }
  .hero-visual .film-play .play{
    width:56px;
    height:56px;
    font-size:20px;
    margin-bottom:6px;
  }
  .hero-visual .film-play > span:last-child{
    font-size:.9rem;
    line-height:1.25;
  }
  /* Mobile: chip top-left — play stays bottom-left; avoids covering the face */
  .hero-visual .floating-status{
    top:12px;
    left:max(10px, env(safe-area-inset-left));
    right:auto;
    bottom:auto;
    max-width:min(150px,52%);
    padding:10px;
    gap:6px;
    font-size:.72rem;
    align-items:flex-start;
    text-align:left;
  }
  .hero-visual .floating-status .ivy-mark{
    font-size:1rem;
    align-self:flex-start;
  }
  .hero-visual .floating-status small{font-size:.62rem}
}

.visually-hidden{
  position:absolute!important;
  width:1px!important;
  height:1px!important;
  padding:0!important;
  margin:-1px!important;
  overflow:hidden!important;
  clip:rect(0,0,0,0)!important;
  white-space:nowrap!important;
  border:0!important;
}
/* Film modal — video only, floating close */
#film-dialog {
  position: fixed;
  inset: 0;
  width: min(1120px, calc(100% - 24px));
  max-width: none;
  max-height: none;
  margin: auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #fff;
  box-shadow: none;
  overflow: visible;
}
#film-dialog::backdrop {
  background: #041a1ccc;
  backdrop-filter: blur(8px);
}
#film-dialog > .eyebrow,
#film-dialog > h2,
#film-dialog > .button,
#film-dialog #film-content > p,
#film-dialog #film-content > a {
  display: none !important;
}
#film-dialog #film-content {
  margin: 0;
  line-height: 0;
}
#film-dialog video {
  display: block;
  width: 100%;
  max-height: min(86dvh, 820px);
  height: auto;
  border-radius: 14px;
  background: #000;
  box-shadow: 0 24px 80px #0008;
}
#film-dialog .dialog-close {
  position: fixed;
  top: max(14px, env(safe-area-inset-top));
  right: max(14px, env(safe-area-inset-right));
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  background: rgba(250, 248, 242, 0.92);
  color: var(--petrol, #062f32);
  font-size: 1.7rem;
  line-height: 1;
  box-shadow: 0 8px 28px #0005;
}
#film-dialog .dialog-close:hover {
  background: #fff;
}

@media (max-width: 1100px) {
  .features {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  }

  .features article {
    border-right: 0 !important;
    padding-inline: 0 !important;
    padding-block: 4px 8px;
  }

  .four-outcomes {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  }

  .journey-cards {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr));
  }
}

@media (max-width: 820px) {
  .hero-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .ivy-word {
    flex-wrap: wrap;
    gap: 14px 18px;
  }

  .ivy-word span {
    border-left: 0;
    padding-left: 0;
    max-width: none;
    flex: 1 1 100%;
  }

  .page-hero .hero-art {
    height: clamp(220px, 42vw, 360px);
  }

  .proof-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 900px) and (min-width: 681px) {
  .nav {
    flex-wrap: wrap;
    row-gap: 8px;
  }

  .nav nav {
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 12px 18px;
  }

  .booking-aside {
    display: block;
  }

  .booking-aside .photo {
    height: clamp(200px, 35vw, 320px);
    margin-bottom: 24px;
  }

  .demo-controls {
    flex-wrap: wrap;
    gap: 12px;
  }

  .demo-controls .button {
    flex: 1 1 auto;
  }
}

@media (max-width: 390px) {
  .wrap {
    width: calc(100% - 28px);
  }

  h1,
  .hero-copy h1,
  .page-hero h1 {
    font-size: clamp(1.32rem, 5.8vw, 1.55rem);
  }

  h2,
  .section-heading h2 {
    font-size: clamp(1.08rem, 4.1vw, 1.26rem);
  }

  .hero-copy .actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-copy .actions .button,
  .actions .button,
  .explorer .button,
  .closing .button {
    width: 100%;
  }

  .footer-top nav {
    grid-template-columns: 1fr;
  }

  .record-row {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .record-row strong {
    max-width: 100%;
    text-align: left;
  }

  .booking-progress {
    flex-wrap: wrap;
    row-gap: 10px;
    justify-content: flex-start;
  }

  .copy-row {
    flex-direction: column;
  }

  .copy-row .button {
    width: 100%;
  }

  .stage-number {
    float: none;
    display: inline-block;
    margin-bottom: 8px;
  }
}

@media (max-width: 900px) and (orientation: landscape) {
  .home-hero .hero-grid {
    min-height: 0;
  }

  .hero-copy {
    padding-block: 28px 20px;
  }

  .home-hero .hero-visual,
  .hero-visual {
    height: clamp(200px, 48vh, 260px);
    max-height: 260px;
    min-height: 0;
  }

  .page-hero .split {
    grid-template-columns: 1fr 1fr;
    align-items: center;
  }

  .section {
    padding-block: clamp(36px, 6vh, 56px);
  }
}

@media (max-height: 520px) and (max-width: 900px) {
  .section {
    padding-block: 36px;
  }

  .page-hero .split > div:first-child {
    padding-block: 28px 16px;
  }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .nav nav {
    gap: 14px;
  }

  .nav nav a {
    white-space: normal;
    text-align: center;
    line-height: 1.25;
    max-width: 8.5rem;
  }
}

@media (min-width: 1200px) {
  .reading,
  .section-heading {
    max-width: min(800px, 100%);
  }
}

/* Supporting copy — global p reset clears margin-top */
p.fine {
  margin-top: 1.125rem;
}

.home-hero .hero-copy > p.fine {
  margin-top: 0;
}

/* —— Mobile site pass (≤680px) —— */
@media (max-width: 680px) {
  /* Sitewide headings — compact mobile scale (both basecamps, all pages) */
  h1,
  .hero-copy h1,
  .page-hero h1,
  .closing h2 {
    font-size: clamp(1.42rem, 6vw, 1.72rem);
    line-height: 1.1;
    margin-bottom: 14px;
  }

  h2,
  .section-heading h2 {
    font-size: clamp(1.16rem, 4.4vw, 1.38rem);
    line-height: 1.14;
    margin-bottom: 12px;
  }

  h3 {
    font-size: 0.94rem;
    line-height: 1.22;
    margin-bottom: 8px;
  }

  .demo-stage > h2,
  .explorer h2,
  .booking-aside h2,
  .roadmap li h3,
  .dash-main h3 {
    font-size: clamp(1.16rem, 4.4vw, 1.38rem);
  }

  .features h3,
  .four-outcomes h3,
  .journey-cards h3 {
    font-size: 0.9rem;
  }

  html {
    scroll-padding-top: 82px;
  }

  body {
    padding-bottom: calc(76px + env(safe-area-inset-bottom, 0px));
  }

  .site-header .nav {
    min-height: 72px;
  }

  .section {
    padding-block: clamp(38px, 11vw, 46px);
  }

  .section-heading {
    margin-bottom: 22px;
  }

  .section-heading .lead {
    font-size: 0.98rem;
  }

  .lead {
    font-size: 1rem;
  }

  /* Home hero (default kit pages): eyebrow → headline → image → body → CTAs */
  .home-hero .hero-grid {
    padding-top: 8px;
    min-height: 0;
  }

  .home-hero .hero-copy h1 {
    max-width: none;
    font-size: clamp(1.42rem, 6vw, 1.72rem);
  }

  .home-hero .hero-copy .lead {
    font-size: 0.88rem;
    line-height: 1.48;
    margin-bottom: 12px;
    color: var(--muted);
  }

  .home-hero .hero-copy .actions {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    margin: 8px 0 12px;
    gap: 10px;
  }

  .home-hero .hero-copy .actions .button {
    width: 100%;
    flex: none;
    min-width: 0;
  }

  .home-hero .hero-copy > p.fine {
    font-size: 0.82rem;
    line-height: 1.45;
  }

  /* Hero film + IVY — override kit partial-width film strip */
  .home-hero .hero-visual .film-play {
    width: 100%;
    inset: 0;
    padding: 10px 12px 12px;
    background: linear-gradient(180deg, transparent 42%, #062f32b8 100%);
  }

  .home-hero .hero-visual .film-play .play {
    width: 50px;
    height: 50px;
  }

  .home-hero .hero-visual .film-play .play svg {
    width: 20px;
    height: 24px;
  }

  .home-hero .hero-visual .film-play > span:last-child {
    font-size: 0.78rem;
    max-width: 11.5rem;
  }

  .home-hero .hero-visual .film-play small {
    font-size: 0.62rem;
    margin-top: 4px;
    opacity: 0.92;
  }

  .home-hero .hero-visual .floating-status {
    padding: 8px 9px;
    gap: 4px;
    max-width: min(138px, 48%);
  }

  .home-hero .hero-visual .floating-status strong {
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.25;
  }

  .territory-promise {
    margin-top: 14px;
    padding: 14px 0;
    font-size: 0.82rem;
  }

  /* Inner pages */
  .page-hero .split > div:first-child {
    padding: 28px 0 18px;
  }

  .page-hero .hero-art {
    height: clamp(200px, 52vw, 270px);
    margin-bottom: 18px;
  }

  .page-hero .hero-art img {
    border-radius: 16px;
  }

  .product-showcase .photo {
    max-height: min(52vh, 300px);
    aspect-ratio: 16 / 11;
  }

  .benefit-row {
    margin: 18px 0;
    padding-block: 16px;
  }

  .ivy-word {
    font-size: clamp(1.65rem, 7.2vw, 1.95rem);
  }

  .phone {
    width: min(100%, 340px);
  }

  .roadmap > img {
    max-height: 200px;
    object-fit: cover;
  }

  .roadmap ol {
    padding: 16px;
    gap: 12px;
  }

  .roadmap li {
    padding: 18px 16px;
  }

  .explorer {
    padding: 18px 16px;
    gap: 20px;
  }

  .demo-stage {
    padding: 18px 16px;
  }

  .booking-panel {
    padding: 20px 16px;
  }

  .mobile-sticky {
    padding: 10px 16px max(10px, env(safe-area-inset-bottom));
  }

  .footer-top nav {
    gap: 14px 16px;
  }

  /* Territory checker (Next) — shared booking / review blocks */
  #territory-review.booking-layout,
  #territory-review .booking-layout {
    margin-top: 8px;
  }

  #territory-review .booking-aside .photo {
    height: clamp(180px, 48vw, 220px);
  }

  #territory-review .booking-panel {
    padding: 18px 16px;
  }

  #territory-review .calendar-days button,
  #territory-review .time-slots button {
    min-height: 44px;
  }
}

/* Tablet / small landscape — avoid 540px+ hero mins from kit */
@media (max-width: 820px) and (min-width: 681px) {
  .home-hero .hero-grid {
    min-height: 0;
    gap: 20px;
  }

  .home-hero .hero-visual {
    min-height: 0;
    height: clamp(260px, 40vw, 340px);
    max-height: 340px;
    border-radius: 18px;
  }

  .home-hero .hero-copy {
    padding-block: 40px 24px;
  }

  .home-hero .hero-copy h1 {
    font-size: clamp(2rem, 4.2vw, 2.6rem);
  }
}

/* Basecamp 1 home — recommended mobile hierarchy (mock) */
.home-hero.epc-mobile-hierarchy .hero-subline {
  display: block;
  margin-top: 12px;
  font-size: 0.72em;
  line-height: 1.2;
  color: var(--gold);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.home-hero.epc-mobile-hierarchy .hero-pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 8px 0 4px;
  text-align: center;
}

.home-hero.epc-mobile-hierarchy .hero-pillars article {
  margin: 0;
  padding: 4px 2px;
}

.home-hero.epc-mobile-hierarchy .hero-pillars .icon {
  width: 30px;
  height: 30px;
  margin: 0 auto 8px;
}

.home-hero.epc-mobile-hierarchy .hero-pillars p {
  margin: 0;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--petrol);
}

.home-hero.epc-mobile-hierarchy .hero-clinic-tag {
  position: absolute;
  left: auto;
  right: 14px;
  bottom: 14px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  padding: 6px 12px;
  border-radius: 999px;
  background: #062f32e0;
  color: var(--ivory);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  pointer-events: none;
  box-shadow: 0 2px 10px #062f3226;
}

.home-hero.epc-mobile-hierarchy .hero-revenue {
  grid-column: 1 / -1;
  text-align: center;
  padding: 6px 0 4px;
  border-top: 1px solid #c4a66e55;
  margin-top: 8px;
}

.home-hero.epc-mobile-hierarchy .hero-revenue-lead {
  margin: 0 0 8px;
  font-size: 1rem;
  color: var(--muted);
}

.home-hero.epc-mobile-hierarchy .hero-revenue-amount {
  margin: 0 0 6px;
  font-size: clamp(2.35rem, 10vw, 2.85rem);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.04em;
  color: var(--petrol);
}

.home-hero.epc-mobile-hierarchy .hero-revenue-label {
  margin: 0 0 10px;
  font-size: 1.05rem;
}

.home-hero.epc-mobile-hierarchy .hero-revenue-note {
  margin: 0 auto;
  max-width: 22rem;
  font-size: 0.78rem;
}

.home-hero.epc-mobile-hierarchy .territory-promise {
  font-size: 0.95rem;
  line-height: 1.45;
  padding-top: 18px;
}

@media (min-width: 681px) {
  .home-hero.epc-mobile-hierarchy .hero-pillars {
    max-width: 420px;
    margin-top: 20px;
  }

  .home-hero.epc-mobile-hierarchy .hero-revenue {
    margin-top: 18px;
    padding-top: 22px;
  }

  .home-hero.epc-mobile-hierarchy .hero-clinic-tag {
    right: 16px;
    bottom: 16px;
  }
}

@media (max-width: 680px) {
  .home-hero.epc-mobile-hierarchy .hero-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
    padding-top: 8px;
  }

  .home-hero.epc-mobile-hierarchy .hero-copy {
    display: contents;
  }

  .home-hero.epc-mobile-hierarchy .hero-copy .eyebrow {
    order: 1;
    margin-bottom: 12px;
  }

  .home-hero.epc-mobile-hierarchy .hero-copy h1 {
    order: 2;
    margin-bottom: 16px;
  }

  .home-hero.epc-mobile-hierarchy .hero-copy .lead {
    order: 3;
    margin-bottom: 12px;
    font-size: 0.84rem;
    line-height: 1.5;
  }

  .home-hero.epc-mobile-hierarchy .hero-copy .actions {
    order: 4;
    margin: 6px 0 10px;
  }

  .home-hero.epc-mobile-hierarchy .hero-copy > .fine {
    order: 5;
    margin-bottom: 14px;
    text-align: center;
  }

  .home-hero.epc-mobile-hierarchy .hero-pillars {
    order: 6;
    margin: 0 0 18px;
  }

  .home-hero.epc-mobile-hierarchy .hero-visual {
    order: 7;
    margin-bottom: 16px;
    height: clamp(228px, 58vw, 276px);
    max-height: 276px;
    border-radius: 16px;
    overflow: hidden;
    isolation: isolate;
  }

  .home-hero.epc-mobile-hierarchy .hero-visual > img {
    object-position: 72% 22%;
  }

  .home-hero.epc-mobile-hierarchy .hero-visual .film-play {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    inset: 0;
    z-index: 2;
    padding: 12px 14px 12px;
    align-items: flex-start;
    justify-content: flex-end;
    text-align: left;
    background: linear-gradient(
      180deg,
      transparent 32%,
      #062f3288 58%,
      #062f32d4 100%
    );
  }

  .home-hero.epc-mobile-hierarchy .hero-visual .film-play .play {
    width: 52px;
    height: 52px;
    margin-bottom: 8px;
  }

  .home-hero.epc-mobile-hierarchy .hero-visual .film-play > span:last-child {
    max-width: min(11.5rem, 58vw);
    font-size: 0.8rem;
    line-height: 1.28;
  }

  .home-hero.epc-mobile-hierarchy .hero-visual .film-play small {
    display: block;
    margin-top: 4px;
    font-size: 0.62rem;
    line-height: 1.35;
    opacity: 0.95;
  }

  .home-hero.epc-mobile-hierarchy .hero-clinic-tag {
    right: max(12px, env(safe-area-inset-right));
    bottom: 12px;
    padding: 5px 11px;
    font-size: 0.67rem;
    max-width: calc(100% - 13.5rem);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .home-hero.epc-mobile-hierarchy .hero-revenue {
    order: 8;
    border-top: 0;
    margin-top: 0;
    padding: 0 0 10px;
  }

  .home-hero.epc-mobile-hierarchy .hero-revenue-amount {
    font-size: clamp(2.2rem, 9.5vw, 2.65rem);
  }

  .home-hero.epc-mobile-hierarchy .hero-pillars {
    gap: 6px;
    margin: 0 0 16px;
  }

  .home-hero.epc-mobile-hierarchy .hero-pillars .icon {
    width: 28px;
    height: 28px;
    margin-bottom: 6px;
  }

  .home-hero.epc-mobile-hierarchy .hero-pillars p {
    font-size: 0.78rem;
  }

  .home-hero.epc-mobile-hierarchy .territory-promise {
    margin-top: 6px;
    padding: 16px 0 12px;
    font-size: 0.88rem;
  }

  .home-hero.epc-mobile-hierarchy .hero-secondary-desktop {
    display: none;
  }

  .home-hero.epc-mobile-hierarchy .floating-status {
    display: none;
  }
}

@media (max-width: 680px) {
  body[data-page="index.html"] .nav nav .mobile-nav-cta,
  body[data-page="index.html"] .closing .button,
  body[data-page="index.html"] .mobile-sticky .button {
    font-size: 0.9rem;
    line-height: 1.25;
    padding: 14px 16px;
  }

  body[data-page="index.html"] .header-cta {
    font-size: 0.82rem;
    padding: 12px 14px;
    white-space: normal;
    line-height: 1.2;
    max-width: 11rem;
    text-align: center;
  }
}

@media (max-width: 390px) {
  .home-hero.epc-mobile-hierarchy .hero-copy h1 {
    font-size: clamp(1.32rem, 5.8vw, 1.55rem);
  }

  .home-hero.epc-mobile-hierarchy .hero-subline {
    font-size: 0.7em;
    margin-top: 10px;
  }

  .home-hero.epc-mobile-hierarchy .hero-copy .lead {
    font-size: 0.8rem;
  }

  .home-hero.epc-mobile-hierarchy .hero-visual .film-play > span:last-child {
    max-width: 10.25rem;
    font-size: 0.76rem;
  }

  .home-hero.epc-mobile-hierarchy .hero-clinic-tag {
    padding: 4px 9px;
    font-size: 0.64rem;
  }
}