/* ════════════════════════════════════════════════════════
   PRESIDIUM — Mobile & Tablet Responsive Styles
   Breakpoints:
     ≤1024px  Tablet landscape
     ≤768px   Tablet portrait / large phone
     ≤480px   Phone
     ≤360px   Small phone
════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════
   GLOBAL MOBILE BASE — applies at all sizes ≤1024px
   Hides desktop chrome, shows hamburger, full-width content
════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {

  /* ── NAV ── */
  .nav-pills        { display: none !important; }
  .nav-hamburger    { display: flex !important; }
  .sidebar-rail     { display: none !important; }
  .sidebar-panel    { display: none !important; }

  /* ── Layout shell ── */
  .app-shell { display: block; }

  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    /* Prevent horizontal overflow from any child */
    overflow-x: hidden !important;
  }

  /* ── Padding base ── */
  .container-full   { padding: 12px 20px; }
  .home-body        { padding: 16px 24px 48px; }
  .home-raze-row    { padding: 0 20px 20px; }

  /* ── HOME intro ── */
  .home-intro-inner {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
    padding: 0 24px;
  }
  .home-intro-stats { align-self: flex-start; }

  /* ── HOME entry grid → single col ── */
  .home-entry-grid {
    grid-template-columns: 1fr;
    padding: 16px 20px 14px;
    gap: 12px;
  }

  /* ── Section layout: drop right sidebar ── */
  .section-layout          { grid-template-columns: 1fr !important; }
  .section-sidebar         { display: none !important; }

  /* ── Lifecycle sections: guaranteed full-width ── */
  .section--lifecycle .section-layout   { grid-template-columns: 1fr !important; }
  .section--lifecycle .section-main     { width: 100%; min-width: 0; max-width: 100%; }
  .section--lifecycle .section-body     { padding-left: 0; padding-right: 0; }

  /* ── Section hero ── */
  .section-hero-content { padding: 0 24px; }

  /* ── Module grid: 2 cols on tablet ── */
  .module-grid { grid-template-columns: repeat(2, 1fr); }

  /* ── Module cards: ensure tappable ── */
  .module-card,
  .module-card--clickable {
    cursor: pointer;
    -webkit-tap-highlight-color: rgba(255,255,255,.06);
    touch-action: manipulation;
    user-select: none;
  }
  .module-card--clickable {
    /* Make the entire card a tap target */
    position: relative;
  }
  .module-card--clickable::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
  }

  /* ── RAZE ── */
  .raze-capabilities-grid { grid-template-columns: repeat(2, 1fr); }
  .raze-info-grid          { grid-template-columns: repeat(2, 1fr); }
  .raze-stats-row          { flex-wrap: wrap; gap: 12px; }
  .raze-stat               { flex: 1 1 calc(50% - 6px); min-width: 0; }

  /* ── RAZE carousel: full-width, hide info panel ── */
  .section--raze .carousel-slide { grid-template-columns: 1fr !important; }
  .section--raze .cs-info        { display: none !important; }

  /* ── Metrics ── */
  .metrics-primary-row { grid-template-columns: repeat(2, 1fr); }
  .metrics-roi-row     { grid-template-columns: repeat(2, 1fr); }
  .metrics-depth-row   { grid-template-columns: repeat(2, 1fr); }
  .metrics-market-bar  { flex-wrap: wrap; gap: 12px; padding: 16px 18px; }
  .mmbar-item          { flex: 1 1 calc(50% - 6px); padding: 0; min-width: 0; }
  .mmbar-divider       { display: none; }
  .metrics-hero-statement { padding: 6px 0 20px; margin-bottom: 20px; }
  .metrics-section-label  { margin-top: 4px; }

  /* ── Team ── */
  .team-grid-3x3           { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .team-page-header-inner  { padding: 0 20px; }
  .metrics-page-header-inner { padding: 0 20px; }
  .section--team  .section-body.container-full,
  .section--metrics .section-body.container-full { padding: 20px 20px 40px; }

  /* ── Slide detail panel: single col ── */
  .sdp-inner  { grid-template-columns: 1fr; }
  .sdp-left   {
    border-right: none;
    border-bottom: 1px solid rgba(255,255,255,.07);
    padding: 18px 20px;
  }
  .sdp-right  { padding: 18px 20px; }

  /* ── Loan types: 3 col ── */
  .ov-loan-types { grid-template-columns: repeat(3, 1fr); }

  /* ── Touch tap targets ── */
  .snav-btn     { min-height: 44px; }
  .carousel-btn { width: 32px; height: 32px; }
  .mtab         {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    /* Make tabs easy to tap on touch */
    padding: 8px 12px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .fsp-step {
    min-height: 40px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }

  /* ── Scroll snap on strip elements ── */
  .monitoring-tabs,
  .raze-module-tabs,
  .km-strip {
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x mandatory;
  }
  .fsp-steps {
    -webkit-overflow-scrolling: touch;
    /* No snap — we want free scroll on the step strip */
  }
  .carousel-track { touch-action: pan-y pinch-zoom; }

  /* ─────────────────────────────────────────────────────
     FSP (Feature Spotlight) — CORE MOBILE FIXES

     Root causes:
     ① .fsp-wrap has min-height:460px + max-height:68vh →
        the 68vh cap clips the image on short viewports.
     ② .fsp-body is a 65%/35% grid → on narrow screens the
        right callout column overflows off-screen.
     ③ .fsp-screen-img uses height:100% which fills an
        unconstrained flex container → image is too tall,
        thumb-row gets pushed outside the box.

     Fix strategy:
     — Remove the min/max-height constraints from fsp-wrap.
     — Switch fsp-body from grid → flex column.
     — Give .fsp-screen-img a fixed aspect-ratio (not height:100%).
     — Clamp callout height so it never pushes content off screen.
  ───────────────────────────────────────────────────── */
  .fsp-wrap {
    min-height: 0 !important;
    max-height: none !important;
    height: auto !important;
    /* Allow natural height growth on mobile */
    overflow: visible !important;
  }

  .fsp-body {
    display: flex !important;
    flex-direction: column !important;
    overflow: visible !important;
    flex: none !important;
    /* Do NOT clip — let callout show fully */
  }

  .fsp-screen {
    border-right: none !important;
    border-bottom: 1px solid rgba(255,255,255,.07);
    display: flex !important;
    flex-direction: column !important;
    min-height: 0 !important;
    height: auto !important;
    width: 100%;
    flex-shrink: 0;
    overflow: hidden;
    /* Remove zoom cursor; use tap instead */
    cursor: default;
  }

  /*
   * KEY FIX: aspect-ratio drives height, not height:100%.
   * The image takes the full width and sets its own height
   * via aspect-ratio, so the thumb-row sits correctly below.
   */
  .fsp-screen-img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 16 / 9 !important;
    object-fit: contain !important;
    object-position: center center !important;
    flex: none !important;
    /* Prevent accidental stretch */
    max-height: none !important;
    min-height: 0 !important;
  }

  /* Callout panel: natural height, scrollable if tall */
  .fsp-callout {
    max-height: none !important;
    overflow-y: visible !important;
    flex: none !important;
    padding: 14px 16px 12px;
    gap: 6px;
  }

  /* Steps strip: horizontal scroll, no wrap */
  .fsp-steps {
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    flex-wrap: nowrap;
    /* Add bottom padding to avoid clipping the active indicator */
    padding-bottom: 2px;
  }
  .fsp-step    { flex-shrink: 0; }
  .fsp-nav-btn { width: 40px; height: 40px; font-size: 15px; }

  /* Thumb row: compress images */
  .fsp-thumb-img  { width: 72px; height: 42px; }
  .fsp-thumb-name { max-width: 130px; }

  /* ─────────────────────────────────────────────────────
     LIGHTBOX — CORE MOBILE FIXES
  ───────────────────────────────────────────────────── */
  .lightbox-overlay { padding: 12px; }
  .lightbox-container {
    border-radius: 12px;
    max-height: 95vh;
    display: flex;
    flex-direction: column;
  }
  .lightbox-image-wrap {
    flex: 1 1 auto;
    max-height: 50vh;
    min-height: 140px;
    overflow: hidden;
  }
  .lightbox-image-wrap img { max-height: 50vh; }
  .lightbox-info {
    flex-shrink: 0;
    padding: 12px 16px 16px;
    overflow-y: auto;
    max-height: 40vh;
  }
  .lightbox-info h3 { font-size: 14px; margin-bottom: 4px; }
  .lightbox-info p  { font-size: 12px; margin-bottom: 10px; line-height: 1.5; }
  .lightbox-meta-value { font-size: 12px; line-height: 1.6; }
}

/* ═══════════════════════════════════════════════════════
   TABLET PORTRAIT / LARGE PHONE (≤768px)
════════════════════════════════════════════════════════ */
@media (max-width: 768px) {

  /* ── NAV ── */
  .nav-brand-text .nav-submark { display: none; }
  .nav-wordmark { font-size: 11px; }

  /* ── Padding reductions ── */
  .home-intro-inner  { padding: 0 16px; }
  .home-body         { padding: 14px 16px 40px; }
  .home-raze-row     { padding: 0 16px 16px; }
  .container-full    { padding: 10px 16px; }
  .section-hero-content { padding: 0 16px; }
  .section-body      { padding: 8px 0 12px; }

  /* ── Lifecycle sections ── */
  .section--lifecycle .section-body     { padding: 8px 0 12px; }
  .section--lifecycle .container-full   { padding: 10px 14px; }
  .section--lifecycle .section-main     { overflow-x: hidden; }

  /* ── Team & Metrics: align headers to match body padding ── */
  .team-page-header-inner      { padding: 0 16px; }
  .metrics-page-header-inner   { padding: 0 16px; }
  .section--team  .section-body.container-full,
  .section--metrics .section-body.container-full { padding: 14px 16px 32px; }

  /* ── HOME: hide images & RAZE desc on small screens ── */
  .entry-img-row   { display: none; }
  .home-raze-desc  { display: none; }
  .home-raze-cta   { display: none; }
  .home-entry-grid { padding: 12px 16px 10px; gap: 10px; }

  /* ── Typography ── */
  .section-title   { font-size: clamp(15px, 4vw, 20px); }
  .section-tagline { font-size: 11.5px; }

  /* ── Module grid: 1 col ── */
  .module-grid { grid-template-columns: 1fr; gap: 8px; }

  /* ── Monitoring tabs ── */
  .monitoring-tabs { padding: 0; }
  .mtab            {
    padding: 7px 10px;
    font-size: 11px;
    min-height: 44px;
  }

  /* ── Carousel header ── */
  .carousel-header      { padding: 10px 14px 8px; }
  .slide-title-label    { max-width: 200px; font-size: 11px; }

  /* ── RAZE ── */
  .raze-title             { font-size: clamp(22px, 5vw, 32px); }
  .raze-body              { padding: 24px 0 40px; }
  .raze-capabilities-grid { grid-template-columns: 1fr; }
  .raze-info-grid          { grid-template-columns: 1fr; }
  .raze-stats-row          { flex-direction: column; gap: 10px; }
  .raze-stat               { width: 100%; }
  .raze-hero-modes         { gap: 6px; }
  .raze-mode-pill          { font-size: 10px; padding: 4px 10px; }
  .raze-module-tabs        { overflow-x: auto; padding-bottom: 0; }
  .raze-mtab               { white-space: nowrap; }

  /* ── Metrics ── */
  .metrics-primary-row  { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metrics-roi-row      { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .metrics-depth-row    { grid-template-columns: 1fr; gap: 10px; }
  .metrics-hero-title   { font-size: clamp(18px, 5vw, 26px); }
  .metrics-hero-sub     { font-size: 12px; }
  .metrics-market-bar   { flex-direction: column; gap: 10px; }
  .mmbar-item           { flex: none; width: 100%; padding: 0; }
  .metrics-page-header  { padding: 18px 0 14px; }

  /* ── Team ── */
  .team-grid-3x3      { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .team-photo-wrap-lg { width: 100px; height: 100px; }
  .team-name-v2       { font-size: 13px; }
  .team-role-v2       { font-size: 11px; white-space: normal; line-height: 1.35; }
  .team-company-v2    { font-size: 10px; }
  .team-card-v2       { padding: 20px 12px 16px; gap: 0; }
  .team-card-v2--text-only .team-name-v2 { font-size: 15px; }
  .team-card-v2--text-only .team-role-v2 { font-size: 11.5px; white-space: normal; }
  .team-page-header   { padding: 18px 0 14px; }

  /* ── Loan types: 2 col ── */
  .ov-loan-types { grid-template-columns: repeat(2, 1fr); }

  /* ── Nav strip ── */
  .section-nav-strip { flex-direction: column; gap: 10px; align-items: stretch; }
  .snav-btn          { justify-content: center; }
  .snav-progress     { justify-content: center; }
  .snav-step         { width: 30px; height: 30px; font-size: 10px; }

  /* ── Cap modal ── */
  .cap-grid       { grid-template-columns: repeat(2, 1fr); }

  /* ── Cap modal: mobile stacked layout ──────────────────────────
     VERIFIED ROOT CAUSE (≤768px):
       • Base .cap-modal has overflow:hidden — must be overridden
         with !important, otherwise the responsive override is lost.
       • Base .cap-modal-body has overflow:hidden + flex:1 + min-height:0
         — keeps the body clamped; switching to display:block fixes it.
       • Base .cap-modal-why-wrap has flex:1 — causes it to stretch and
         push tags/dots/CTA out of view when parent is height-clamped.
     FIX: modal becomes a scroll container; image capped; info panel
     has natural height with no artificial clamp at any breakpoint.
  ─────────────────────────────────────────────────────────────────── */

  /* 1. Modal wrapper: scrollable column, not a fixed-height clipped box */
  .cap-modal {
    max-height: 92vh;
    overflow-y: auto   !important; /* override base overflow:hidden */
    overflow-x: hidden !important;
    display: flex;
    flex-direction: column;
  }

  /* 2. Body: simple block stacking — image on top, info below */
  .cap-modal-body {
    display: block   !important; /* kill grid; no flex clipping */
    overflow: visible !important;
    flex: none;                  /* don't stretch inside modal column */
  }

  /* 3. Image panel: capped height so it doesn't consume the viewport */
  .cap-modal-img-wrap {
    display: flex;
    max-height: 44vh;
    min-height: 180px;
    overflow: hidden;
    position: relative;
  }
  #cap-modal-img {
    width: 100%;
    height: 100%;
    max-height: 44vh;
    object-fit: contain;
  }

  /* 4. Info panel: natural height — NO max-height clamp, NO overflow:auto
        (overflow clamp was crushing bullets + tags + dots + CTA together) */
  .cap-modal-info {
    display: flex       !important;
    flex-direction: column;
    border-left: none;
    border-top: 1px solid rgba(255,255,255,.07);
    max-height: none    !important; /* kill any inherited clamp */
    height: auto        !important;
    overflow: visible   !important;
    padding: 20px 18px 24px;
    gap: 14px;
    flex-shrink: 0;               /* never compress info panel */
  }

  /* 5. Why-wrap: content height only — stop flex:1 stretch */
  .cap-modal-why-wrap {
    flex: none          !important; /* override base flex:1 */
    gap: 10px;
    overflow: visible;
  }

  /* 6. Desc container: column flow, no overflow clip.
        flex:none stops it absorbing all remaining height and
        pushing tags/dots/CTA below the visible scrollport. */
  .cap-modal-desc {
    display: flex;
    flex-direction: column;
    flex: none          !important; /* override base flex:1 */
    gap: 8px;
    overflow: visible;
    max-height: none    !important;
  }

  /* 7. Bullets: compact but readable on tablet */
  .cap-modal-bullet      { padding: 9px 11px; gap: 9px; }
  .cap-modal-bullet-icon { width: 28px; height: 28px; font-size: 11px; }
  .cap-modal-bullet-text { font-size: 12.5px; line-height: 1.45; white-space: normal; }

  /* 8. Tags: wrap cleanly on narrow screens */
  .cap-modal-tags      { gap: 6px; flex-wrap: wrap; overflow: visible; }
  .cap-modal-tags span { font-size: 10px; padding: 4px 9px; }

  /* 9. Dot nav: always visible */
  .cap-modal-dots { overflow: visible; flex-shrink: 0; }

  /* 10. Explore CTA: full-width tap target, always visible */
  .cap-modal-explore {
    font-size: 12px;
    padding: 10px 16px;
    width: 100%;
    justify-content: center;
    flex-shrink: 0;
  }

  /* ── Home intro stats ── */
  .home-istat span  { font-size: 13px; }
  .home-istat small { font-size: 7.5px; }
  .home-istat       { padding: 5px 10px; }

  /* ── FSP refined for phone ── */
  /* Keep aspect-ratio from ≤1024px block — restate for clarity */
  .fsp-screen        { aspect-ratio: unset; }  /* height is driven by the img's aspect-ratio */
  .fsp-screen-img    { aspect-ratio: 16 / 9 !important; }
  .fsp-callout       { padding: 12px 14px 10px; gap: 5px; }
  .fsp-callout-title { font-size: 13px; }
  .fsp-callout-desc  { font-size: 11px; }
  .fsp-bullets       { gap: 3px; }
  .fsp-bullet        { padding: 5px 8px; gap: 7px; }
  .fsp-bullet-icon   { width: 22px; height: 22px; font-size: 10px; }
  .fsp-bullet-kicker { font-size: 10px; }
  .fsp-bullet-text   { font-size: 9px; white-space: normal; }

  /* On narrow screens hide the thumb label text to save space */
  .fsp-thumb-info    { display: none; }
  .fsp-thumb-img     { width: 64px; height: 38px; }
  .fsp-thumb-prev,
  .fsp-thumb-next    { padding: 7px 10px; justify-content: center; flex: 0 0 auto; }

  /* Topbar: hide stage label, shrink slide name */
  .fsp-stage-label   { display: none; }
  .fsp-slide-name    { font-size: 10.5px; padding: 0 6px; }
  .fsp-topbar        { padding: 5px 12px; gap: 8px; }
  .fsp-nav-btn       { width: 36px; height: 36px; font-size: 14px; }
  .fsp-counter       { font-size: 10.5px; min-width: 32px; }

  /* FSP info strip below carousel: hide on small screens */
  .fsp-info-strip    { display: none; }

  /* ── Lightbox ── */
  .lightbox-image-wrap { max-height: 42vh; }
  .lightbox-info       { max-height: 45vh; }
}

/* ═══════════════════════════════════════════════════════
   PHONE (≤480px)
════════════════════════════════════════════════════════ */
@media (max-width: 480px) {

  /* Prevent ANY horizontal overflow */
  * {
    /* Force all boxes to respect container width */
    max-width: 100%;
  }
  .section,
  .section.active,
  .main-content,
  .app-shell,
  .fsp-wrap,
  .fsp-body,
  .fsp-screen,
  .fsp-steps {
    overflow-x: hidden !important;
  }

  /* ── NAV ── */
  .nav-brand    { padding: 0 10px; gap: 7px; }
  .nav-hex-logo { width: 24px; height: 24px; }
  .nav-wordmark { font-size: 10.5px; }

  /* ── HOME ── */
  .home-intro-inner {
    flex-direction: column;
    padding: 0 12px;
    gap: 10px;
  }
  .home-intro-stats { width: 100%; }
  .home-istat       { flex: 1; }
  .home-body        { padding: 12px 12px 32px; }
  .home-raze-row    { padding: 0 12px 12px; }

  /* ── Entry cards ── */
  .home-entry-grid  { padding: 10px 12px; gap: 8px; }
  .entry-card-body  { padding: 10px 12px 6px; }
  .entry-card-footer{ padding: 8px 12px; font-size: 11px; }
  .entry-num        { font-size: 22px; }
  .entry-title      { font-size: 13px; }
  /* No hover lift on touch devices */
  .entry-card:hover    { transform: none; }
  .ov-loan-card:hover  { transform: none; }
  .module-card:hover   { transform: none; }

  /* ── Container ── */
  .container-full       { padding: 8px 12px; }
  .section-hero-content { padding: 0 12px; }

  /* ── Section hero typography ── */
  .section-title      { font-size: clamp(14px, 4.5vw, 18px); }
  .section-tagline    { font-size: 11.5px; }
  .section-phase-label { font-size: 8.5px; padding: 2px 8px; }

  /* ── Module ── */
  .module-grid { grid-template-columns: 1fr; }
  .module-card { padding: 10px 11px; }
  /* module card CTA hint — readable on touch */
  .module-card-cta {
    font-size: 10px;
    padding: 4px 8px;
    margin-top: 6px;
  }

  /* ── Monitoring tabs ── */
  .monitoring-tabs { gap: 0; margin-bottom: 8px; }
  .mtab            { padding: 6px 9px; font-size: 10.5px; min-height: 44px; }

  /* ── Carousel ── */
  .carousel-section   { border-radius: 10px; }
  .carousel-header    { padding: 8px 12px; border-radius: 10px 10px 0 0; }
  .gallery-title      { font-size: 9.5px; }
  .slide-title-label  { max-width: 140px; font-size: 10.5px; }
  .carousel-btn       { width: 24px; height: 24px; font-size: 10px; }
  .carousel-counter   { font-size: 10px; min-width: 28px; }

  /* ── Slide detail panel ── */
  .sdp-inner    { grid-template-columns: 1fr; }
  .sdp-left     { padding: 14px; }
  .sdp-right    { padding: 14px; }
  .sdp-title    { font-size: 14px; }
  .sdp-why-text { font-size: 12px; line-height: 1.55; }
  .sdp-actions  { flex-direction: row; }
  .slide-detail-panel { overflow: hidden; }

  /* ── Team: 1 col with horizontal card layout ── */
  .team-grid-3x3 { grid-template-columns: 1fr; gap: 10px; }
  .team-card-v2  {
    flex-direction: row;
    text-align: left;
    padding: 16px 14px;
    gap: 14px;
    align-items: center;
  }
  .team-card-v2 .team-photo-wrap-lg {
    width: 80px; height: 80px;
    margin-bottom: 0;
    flex-shrink: 0;
  }
  .team-card-v2 .team-name-v2    { font-size: 13.5px; }
  .team-card-v2 .team-role-v2    { font-size: 11px; white-space: normal; }
  .team-card-v2 .team-company-v2 { font-size: 10px; }

  /* Text-only cards: keep centred */
  .team-card-v2--text-only {
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 14px;
    gap: 4px;
  }
  .team-card-v2--text-only .team-name-v2 { font-size: 14px; }
  .team-card-v2--text-only .team-role-v2 { font-size: 12px; white-space: normal; }

  .team-page-header        { padding: 16px 0 12px; }
  .team-page-header-inner  { padding: 0 12px; }
  .section--team  .section-body.container-full,
  .section--metrics .section-body.container-full { padding: 12px 12px 28px; }

  /* ── Metrics ── */
  .metrics-primary-row     { grid-template-columns: 1fr; gap: 8px; }
  .metrics-roi-row         { grid-template-columns: 1fr; gap: 8px; }
  .metrics-depth-row       { grid-template-columns: 1fr; gap: 8px; }
  .metrics-page-header     { padding: 16px 0 12px; }
  .metrics-page-header-inner { padding: 0 12px; }
  .metrics-hero-statement  { padding: 6px 0 16px; margin-bottom: 16px; }
  .metrics-hero-title      { font-size: clamp(17px, 5.5vw, 22px); }
  .metrics-primary-card    { padding: 16px 14px 14px; }
  .mpc-num                 { font-size: clamp(24px, 7vw, 32px); }
  .mroi-num                { font-size: clamp(20px, 6vw, 28px); }

  /* ── RAZE ── */
  .raze-title              { font-size: clamp(20px, 6vw, 28px); }
  .raze-cap-card           { padding: 14px; }
  .raze-capabilities-grid  { gap: 10px; }
  .raze-module-tabs        { gap: 0; }
  .raze-mtab               { padding: 9px 14px 11px; font-size: 12px; gap: 6px; }

  /* ── Loan types ── */
  .ov-loan-types  { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .ov-loan-card   { padding: 14px 12px 12px; }
  .ov-loan-name   { font-size: 12px; }
  .ov-loan-sub    { font-size: 10px; }

  /* ── Nav strip ── */
  .snav-btn  { padding: 8px 12px; font-size: 12px; }
  .snav-step { width: 28px; height: 28px; font-size: 9.5px; border-radius: 7px; }

  /* ── Cap modal (≤480px phone) ── */
  .cap-grid           { grid-template-columns: repeat(2, 1fr); gap: 8px; }
  .cap-modal          { border-radius: 12px; max-height: 95vh; }
  .cap-modal-title    { font-size: 15px; line-height: 1.2; }
  .cap-modal-header   { padding: 12px 14px 10px; gap: 10px; }
  .home-ov-label-sub  { display: none; }

  /* ── Phone: even smaller image so info panel has room ── */
  .cap-modal-img-wrap { max-height: 36vh; min-height: 140px; }
  #cap-modal-img      { max-height: 36vh !important; }

  /* ── Phone info panel: re-assert no-clamp (overrides any earlier rules) ── */
  .cap-modal-info {
    padding: 14px 14px 20px;
    gap: 12px;
    max-height: none    !important;
    height: auto        !important;
    overflow: visible   !important;
    flex-shrink: 0;
  }

  /* ── Phone why-wrap: tight but natural height ── */
  .cap-modal-why-wrap {
    flex: none          !important;
    gap: 8px;
    padding: 10px 12px 12px;
    overflow: visible;
  }
  .cap-modal-why-label { font-size: 9px; letter-spacing: 0.13em; }

  /* ── Phone desc: visible column flow, no flex stretch ── */
  .cap-modal-desc {
    flex: none          !important;
    max-height: none    !important;
    overflow: visible   !important;
    gap: 6px;
  }

  /* ── Phone bullets: compact ── */
  .cap-modal-bullet      { padding: 7px 9px; gap: 8px; }
  .cap-modal-bullet-icon { width: 24px; height: 24px; font-size: 10px; }
  .cap-modal-bullet-text { font-size: 11.5px; line-height: 1.4; white-space: normal; }

  /* ── Phone tags ── */
  .cap-modal-tags      { overflow: visible; flex-wrap: wrap; gap: 5px; }
  .cap-modal-tags span { font-size: 9.5px; padding: 3px 8px; }

  /* ── Phone dots ── */
  .cap-modal-dots       { gap: 5px; overflow: visible; flex-shrink: 0; }
  .cap-modal-dot        { width: 6px; height: 6px; }
  .cap-modal-dot.active { width: 16px; }

  /* ── Phone Explore CTA ── */
  .cap-modal-explore { font-size: 11px; padding: 9px 12px; flex-shrink: 0; }

  /* ── FSP on phone ──
     Keep aspect-ratio from ≤1024px override.
     On small phones, use 4:3 for a taller image (less blank margin).
  ── */
  .fsp-screen-img    { aspect-ratio: 4 / 3 !important; }
  .fsp-callout       { padding: 10px 12px 8px; }
  .fsp-bullets       { gap: 3px; }
  .fsp-topbar        { padding: 5px 10px; }
  .fsp-slide-name    { font-size: 10px; }
  .fsp-nav-btn       { width: 32px; height: 32px; font-size: 13px; border-radius: 8px; }
  /* Hide thumb nav row — too small to use accurately */
  .fsp-thumb-row     { display: none !important; }
  .fsp-step          { max-width: 110px; overflow: hidden; text-overflow: ellipsis; }
  /* Steps strip: compact for small screens */
  .fsp-steps         { gap: 0; padding-bottom: 0; }
  .fsp-step-num      { display: none; }   /* just show the title text */

  /* ── Lightbox on phone ── */
  .lightbox-overlay  { padding: 8px; }
  .lightbox-container { border-radius: 10px; }
  .lightbox-image-wrap { max-height: 38vh; min-height: 120px; }
  .lightbox-image-wrap img { max-height: 38vh; }
  .lightbox-info       { padding: 10px 14px 14px; max-height: 48vh; }
  .lightbox-info h3    { font-size: 13px; }
  .lightbox-info p     { font-size: 11.5px; margin-bottom: 8px; }
  .lightbox-meta-item  { padding: 10px 12px 12px; }
  .lightbox-meta-value { font-size: 11.5px; }

  /* ── AC Panel ── */
  .ac-panel        { border-radius: 12px; }
  .ac-header       { padding: 12px 14px; }
  .ac-header-title { font-size: 14px; }
  .ac-subheader    { padding: 12px 16px 10px; gap: 10px; }
  .ac-back-btn     { padding: 6px 10px; font-size: 11px; }
}

/* ═══════════════════════════════════════════════════════
   SMALL PHONE (≤360px)
════════════════════════════════════════════════════════ */
@media (max-width: 360px) {
  .nav-wordmark { display: none; }
  .nav-brand    { gap: 0; }

  .home-intro-stats { flex-wrap: wrap; }
  .home-istat-div   { display: none; }
  .home-istat       { flex: 1 1 calc(50% - 1px); border-bottom: 1px solid rgba(255,255,255,.05); }

  .container-full      { padding: 6px 10px; }
  .section-hero-content { padding: 0 10px; }
  .home-body           { padding: 10px 10px 24px; }

  .team-card-v2 { flex-direction: column; align-items: center; text-align: center; gap: 10px; }
  .team-card-v2 .team-photo-wrap-lg { margin-bottom: 0; }
  .team-grid-3x3 { gap: 8px; }

  .ov-loan-types { grid-template-columns: 1fr; }

  .monitoring-tabs { gap: 0; }
  .mtab            { padding: 6px 8px; font-size: 10px; }

  .metrics-primary-row,
  .metrics-roi-row,
  .metrics-depth-row  { gap: 6px; }

  /* FSP: even smaller image on very small phones */
  .fsp-screen-img { aspect-ratio: 4 / 3 !important; }
}

/* ═══════════════════════════════════════════════════════
   MOBILE NAV OVERLAY — slide-in drawer
════════════════════════════════════════════════════════ */
@media (max-width: 1024px) {
  .mobile-nav-overlay {
    display: none;
    position: fixed; inset: 0;
    background: rgba(0,0,0,.6);
    z-index: 1100;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
  }
  .mobile-nav-overlay.open { display: block; }

  .mobile-nav {
    position: fixed;
    top: 0; left: -300px;
    width: min(280px, 85vw);
    height: 100%;
    background: #0B1828;
    border-right: 1px solid rgba(255,255,255,.07);
    z-index: 1101;
    transition: left 0.25s cubic-bezier(.4,0,.2,1);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 40px;
    /* Prevent rubber-band scroll bleeding through to page */
    overscroll-behavior: contain;
  }
  .mobile-nav.open { left: 0; }

  .mobile-nav-close {
    width: 44px; height: 44px;   /* bigger tap target */
    border-radius: 8px;
    font-size: 15px;
    display: flex; align-items: center; justify-content: center;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
  }
  .mobile-nav-link {
    padding: 14px 16px;   /* taller for easier tapping */
    font-size: 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    /* Ensure full-width tap area */
    width: 100%;
    touch-action: manipulation;
    -webkit-tap-highlight-color: rgba(255,255,255,.04);
  }
  .mobile-nav-link.active {
    color: #fff;
    background: rgba(43,123,224,.12);
  }

  /* Hamburger button — bigger tap area */
  .nav-hamburger {
    width: 44px; height: 44px;
    touch-action: manipulation;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* ═══════════════════════════════════════════════════════
   LANDSCAPE PHONE
════════════════════════════════════════════════════════ */
@media (max-width: 768px) and (orientation: landscape) {
  /* Wider image on landscape since height is limited */
  .fsp-screen-img       { aspect-ratio: 16 / 7 !important; }
  .lightbox-image-wrap  { max-height: 50vh; }
  .lightbox-info        { max-height: 35vh; }
  /* Compact nav on landscape */
  .top-nav { min-height: 44px; }
}

/* ═══════════════════════════════════════════════════════
   RAZE MODE — mobile nav tint
════════════════════════════════════════════════════════ */
.raze-mode .mobile-nav            { background: #04080C; border-right-color: rgba(34,215,109,.1); }
.raze-mode .mobile-nav-header     { border-bottom-color: rgba(34,215,109,.1); }
.raze-mode .mobile-nav-link       { color: rgba(34,215,109,.55); }
.raze-mode .mobile-nav-link:hover { color: #22D76D; background: rgba(34,215,109,.05); }
.raze-mode .mobile-nav-link.active { color: #22D76D; background: rgba(34,215,109,.1); }
.raze-mode .mobile-nav-section-label { color: rgba(34,215,109,.28); }
.raze-mode .mobile-nav-close      { background: rgba(34,215,109,.07); color: rgba(34,215,109,.55); }

/* ═══════════════════════════════════════════════════════
   PRINT
════════════════════════════════════════════════════════ */
@media print {
  .sidebar-rail, .sidebar-panel, .top-nav,
  .mobile-nav, .mobile-nav-overlay, .nav-hamburger { display: none !important; }
  .main-content { margin-left: 0 !important; }
}
