/* Only the phone path tab uses a landscape viewport. Other tabs keep their DOM layout. */
html.path-landscape-active,
body.path-landscape-active {
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden !important;
  overscroll-behavior: none;
  touch-action: pan-x pan-y;
}

#path-landscape-stage {
  position: fixed;
  top: 0;
  left: 0;
  width: var(--path-landscape-width);
  height: var(--path-landscape-height);
  overflow: hidden;
  transform: translateZ(0);
  transform-origin: 0 0;
  background: #f4f5f8;
  isolation: isolate;
}

html[data-path-rotated="true"] #path-landscape-stage {
  left: var(--path-landscape-physical-width);
  transform: rotate(90deg);
}

#path-landscape-scroll {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  overflow-x: hidden;
  overflow-y: auto;
  overscroll-behavior: contain;
  overflow-anchor: none;
  -webkit-overflow-scrolling: touch;
}

.path-landscape-locked #path-landscape-scroll { overflow: hidden; }
#path-landscape-scroll > .site-header,
#path-landscape-scroll > .site-footer { flex-shrink: 0; }
#path-landscape-scroll > .study-app-view { flex: 1 0 auto; }
body.path-landscape-active { --site-header-h: 56px; }
body.path-landscape-active .site-header { height: 56px; }
body.path-landscape-active .header-inner { gap: 12px; padding: 0 24px; }
body.path-landscape-active .logo img { height: 30px; }
body.path-landscape-active .main-nav,
body.path-landscape-active .site-header .login-btn,
body.path-landscape-active .site-header .user-pill { display: none !important; }
body.path-landscape-active .menu-toggle { display: inline-flex; margin-left: auto; }
/* The remaining menu button floats over the pinned table; the empty header is inert. */
body.path-landscape-active.is-scrolled .site-header {
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  pointer-events: none;
}
body.path-landscape-active.is-scrolled .site-header .logo { display: none; }
body.path-landscape-active.is-scrolled .menu-toggle { pointer-events: auto; }
body.path-landscape-active.menu-open .site-header,
body.path-landscape-active.practice-open .site-header { background: #fff; }
body.path-landscape-active .mobile-menu-panel {
  top: 0;
  height: var(--path-landscape-height);
  max-height: var(--path-landscape-height);
  padding-top: calc(var(--site-header-h) + 12px);
  border: 0;
  background: #fff;
}
body.path-landscape-active .mobile-menu-backdrop { background: transparent; pointer-events: none; }
body.path-landscape-active .practice-panel-wrap,
body.path-landscape-active .practice-panel-wrap.is-open {
  top: var(--site-header-h);
  left: 0;
  right: 0;
  width: 100%;
  max-width: none;
  transform: none;
}
body.path-landscape-active .practice-panel {
  height: calc(var(--path-landscape-height) - var(--site-header-h));
  max-height: calc(var(--path-landscape-height) - var(--site-header-h));
  overflow-y: auto;
  border-radius: 0;
}
body.path-landscape-active #view-path { padding: 20px 24px 28px; }
body.path-landscape-active .study-startup-state { min-height: 0; }
/* The page is already landscape; physical portrait media queries must not stack the footer. */
body.path-landscape-active .site-footer { padding: 28px 0 20px; }
body.path-landscape-active .site-footer .footer-inner { padding: 0 24px; }
body.path-landscape-active .site-footer .footer-top {
  grid-template-columns: minmax(140px, 1fr) minmax(230px, 1.1fr);
  gap: 20px;
  padding-bottom: 22px;
}
body.path-landscape-active .site-footer .footer-brand,
body.path-landscape-active .site-footer .footer-contact-col { grid-column: auto; }
body.path-landscape-active .site-footer .footer-logo { padding: 6px 9px; border-radius: 9px; }
body.path-landscape-active .site-footer .footer-logo img { height: 24px; }
body.path-landscape-active .site-footer .footer-brand p { margin-top: 12px; font-size: 12px; line-height: 1.7; }
body.path-landscape-active .site-footer .footer-col b { margin-bottom: 12px; }
body.path-landscape-active .site-footer .footer-col :is(a, button) { margin-top: 9px; font-size: 12px; }
body.path-landscape-active .site-footer .footer-wecom { gap: 12px; padding: 12px; border-radius: 14px; }
body.path-landscape-active .site-footer .footer-col .footer-wecom-label { font-size: 13px; }
body.path-landscape-active .site-footer .footer-col .footer-wecom-code { margin-top: 9px; padding: 4px 6px; font-size: 9px; }
body.path-landscape-active .site-footer .footer-wecom-qr { width: 82px; height: 82px; padding: 4px; border-radius: 10px; }
body.path-landscape-active .site-footer .footer-bottom {
  flex-direction: row;
  align-items: baseline;
  gap: 16px;
  padding-top: 14px;
  font-size: 10px;
}
body.path-landscape-active .site-footer .footer-legal { gap: 4px 10px; }
@media (max-width: 660px) and (max-height: 660px) {
  body.path-landscape-active .site-footer .footer-top { grid-template-columns: minmax(0, 1fr) 230px; gap: 18px 24px; }
  body.path-landscape-active .site-footer .footer-contact-col { grid-column: 2; grid-row: 1; }
  body.path-landscape-active .site-footer .footer-top > .footer-col:not(.footer-contact-col) { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px 14px; }
  body.path-landscape-active .site-footer .footer-col b { width: 100%; margin: 0; }
  body.path-landscape-active .site-footer .footer-col :is(a, button) { margin-top: 0; }
  body.path-landscape-active .site-footer .footer-bottom { flex-direction: column; gap: 6px; }
}
body.path-landscape-active #plan-onboarding-modal > div {
  max-height: calc(var(--path-landscape-height) - 32px);
  overflow-y: auto;
  overscroll-behavior: contain;
}
