/* ============================================================================
   MOBILE PREMIUM CSS — v1
   Last-layer overrides loaded after styles.css + viz.css + showcase.css.
   Mobile-first. Premium feel.

   Author: Frontend Architect — Swiss Marketer
   Strategy: this file fixes the "squashed desktop" look on phones and adds
   a polished, premium card / pill / chip / footer system across all viewports.
   Where mobile fixes are needed, breakpoints layer up:
     small phones        ≤ 380px   (iPhone SE)
     phones              ≤ 480px
     large phones        ≤ 640px
     tablets portrait    ≤ 768px
     desktop reset       ≥ 769px

   No !important unless overriding a !important upstream (clearly marked).
   No layout shift. No horizontal overflow. All fixed/sticky elements respect
   safe-area-inset(*).
   ============================================================================ */


/* ────────────────────────────────────────────────────────────────────────────
   1. DESIGN TOKENS & SAFE-AREA VARS
   ──────────────────────────────────────────────────────────────────────────── */

:root {
  /* Safe-area insets — re-declared here so this file is self-contained.
     Fallback to 0px when the device has no notch / nav-bar. */
  --sa-top:    env(safe-area-inset-top, 0px);
  --sa-right:  env(safe-area-inset-right, 0px);
  --sa-bottom: env(safe-area-inset-bottom, 0px);
  --sa-left:   env(safe-area-inset-left, 0px);

  /* Premium card system tokens */
  --mp-radius-sm: 14px;
  --mp-radius:    20px;
  --mp-radius-lg: 22px;
  --mp-radius-xl: 28px;

  /* Premium shadow stack */
  --mp-shadow-card:
    0 1px 0 rgba(15, 23, 42, 0.04),
    0 12px 28px -10px rgba(15, 23, 42, 0.10),
    0 32px 64px -32px rgba(15, 23, 42, 0.18);
  --mp-shadow-card-hover:
    0 1px 0 rgba(15, 23, 42, 0.06),
    0 16px 36px -10px rgba(15, 23, 42, 0.14),
    0 40px 80px -32px rgba(15, 23, 42, 0.24);
  --mp-shadow-card-dark:
    0 1px 0 rgba(255, 255, 255, 0.06),
    0 12px 28px -10px rgba(0, 0, 0, 0.50),
    0 40px 80px -32px rgba(0, 0, 0, 0.60);
  --mp-shadow-glow-red:
    0 18px 50px -10px rgba(220, 0, 24, 0.40),
    0 0 24px rgba(220, 0, 24, 0.18);

  /* Premium easing */
  --mp-ease: cubic-bezier(0.16, 1, 0.3, 1);

  /* Navbar z-index hierarchy (so anchor scroll never sits under header) */
  --mp-z-nav:    100;
  --mp-z-drawer: 220;
  --mp-z-float:  90;
  --mp-z-chat:   95;

  /* Tuned navbar height per breakpoint */
  --mp-nav-h:    60px;
}

@media (max-width: 768px) {
  :root { --mp-nav-h: 56px; }
}
@media (max-width: 380px) {
  :root { --mp-nav-h: 54px; }
}


/* ────────────────────────────────────────────────────────────────────────────
   2. TYPOGRAPHY RHYTHM
   Clean mobile type scale w/ fluid clamps everywhere.
   Targets (mobile): h1 30-34, h2 26-30, h3 20-22, body 15.5/1.6, caption 11.5
   ──────────────────────────────────────────────────────────────────────────── */

/* Display-only smoothing on premium devices */
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

@media (max-width: 640px) {
  /* H1 — Hero & branch-hero — 30/34, tight letter-spacing
     Fluid clamp keeps the line tight & balanced through 320-640px */
  .hero-stage__title,
  .branch-hero-stage h1,
  .branch-hero-stage__title {
    font-size: clamp(30px, 7.8vw, 34px);
    line-height: 1.05;
    letter-spacing: -0.038em;
    text-wrap: balance;
  }
  /* tighten the accent gradient line so it reads as a single phrase */
  .hero-stage__title .accent,
  .branch-hero-stage h1 .accent { line-height: 1.0; }

  /* H2 — section titles — 26/30 */
  .stage__title,
  h2 {
    font-size: clamp(26px, 6.6vw, 30px);
    line-height: 1.1;
    letter-spacing: -0.03em;
    text-wrap: balance;
  }

  /* H3 — sub-titles & card titles — 20/22 */
  h3,
  .pipe-card__title,
  .iso-stack__title,
  .flow-step__title,
  .lead-form-shell__title {
    font-size: clamp(20px, 4.8vw, 22px);
    line-height: 1.22;
    letter-spacing: -0.02em;
  }

  /* H4 — sub-headers — 16/18.
     .ftr__col h4 and .mobile-menu__group-label override this further down. */
  h4 {
    font-size: clamp(16px, 3.8vw, 18px);
    line-height: 1.3;
    letter-spacing: -0.012em;
  }

  /* Body — 15.5/1.6 default */
  body,
  p,
  li {
    font-size: 15.5px;
    line-height: 1.6;
  }
  /* Legend items keep their compact mono sizing (set in section 6) */
  .pipe-legend__item,
  .net3d-legend__item {
    font-size: 9.5px;
    line-height: 1.4;
  }
  .stage__sub,
  .branch-hero-stage__lead {
    font-size: clamp(15px, 3.9vw, 16.5px);
    line-height: 1.58;
  }
  .hero-stage__lead {
    font-size: clamp(15.5px, 4vw, 17px);
    line-height: 1.55;
  }

  /* Caption — 11.5 (eyebrows, labels) */
  .stage__eyebrow,
  .hero-stage__pill,
  .ftr__col h4,
  .iso-stack__label,
  .pipe-card__num,
  .branch-hero-stage__eyebrow {
    font-size: 11.5px;
    line-height: 1.5;
    letter-spacing: 0.18em;
  }

  /* Mono — 11.5/1.5 (tabular nums, code, kbd, mono-labels) */
  code, kbd, samp,
  .hero-stat__value,
  .mini-stat__value,
  .scene3d__value,
  .net3d-stat,
  .pipe-stage__chip {
    font-variant-numeric: tabular-nums;
    font-feature-settings: 'tnum' 1;
  }
  code, kbd, samp {
    font-size: 11.5px;
    line-height: 1.5;
  }
}

/* Small phones tighten one more notch */
@media (max-width: 380px) {
  .hero-stage__title,
  .branch-hero-stage h1 { font-size: 28px; line-height: 1.06; }
  .stage__title         { font-size: 24px; line-height: 1.12; }
  body, p               { font-size: 14.5px; line-height: 1.58; }
}


/* ────────────────────────────────────────────────────────────────────────────
   3. SECTION SPACING SYSTEM
   Standardise vertical rhythm + horizontal gutters across phones.
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  .stage {
    padding: clamp(56px, 12vw, 88px) 0;
  }
  .stage__head {
    margin-bottom: clamp(28px, 7vw, 44px);
    max-width: 64ch;
  }
  .stage__inner,
  .hero-stage__inner,
  .branch-hero-stage__inner,
  .ftr__inner,
  .navbar__inner {
    padding-left:  max(20px, var(--sa-left));
    padding-right: max(20px, var(--sa-right));
  }
}

/* Smaller phones — tighten further */
@media (max-width: 480px) {
  .stage__inner,
  .hero-stage__inner,
  .ftr__inner,
  .navbar__inner {
    padding-left:  max(18px, var(--sa-left));
    padding-right: max(18px, var(--sa-right));
  }
}

/* Reinforce no-horizontal-overflow for content (body already has it). */
main, .stage, .hero-stage, .ftr, section {
  overflow-x: clip;
  max-width: 100vw;
}

/* Hero → next section: guarantee 60px+ visible separation on mobile.
   Use a min margin so the first .stage after the hero never feels stitched. */
@media (max-width: 768px) {
  .hero-stage + .stage,
  .branch-hero-stage + .stage {
    margin-top: clamp(20px, 5vw, 32px);
  }
  /* Section→section: small breathing margin to reinforce rhythm */
  .stage + .stage {
    margin-top: clamp(0px, 1vw, 8px);
  }
}


/* ────────────────────────────────────────────────────────────────────────────
   4. NAVIGATION POLISH
   Sticky header with proper z-index, premium hamburger, full-screen
   drawer with backdrop blur + fade-slide.
   ──────────────────────────────────────────────────────────────────────────── */

.navbar {
  z-index: var(--mp-z-nav);
}

/* Respect notch — push the navbar inner content below the safe-area-top */
@media (max-width: 768px) {
  .navbar {
    padding-top: var(--sa-top);
  }
  .navbar__inner {
    height: var(--mp-nav-h);
    gap: 10px;
  }
  /* Brand: keep wordmark visible but compact */
  .navbar__brand { font-size: 14px; gap: 8px; }
  .navbar__mark  { width: 20px; height: 20px; border-radius: 5px; }

  /* Burger: 44×44, subtle border, premium tap-feedback */
  .navbar__burger {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(10, 10, 10, 0.08);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: background 0.2s var(--mp-ease), transform 0.2s var(--mp-ease);
  }
  .navbar__burger:active {
    transform: scale(0.94);
    background: rgba(10, 10, 10, 0.06);
  }
}

@media (max-width: 380px) {
  .navbar__name { display: none; }            /* save width on tiny screens */
  .navbar__inner { gap: 8px; }
}

/* ─── Mobile drawer (overrides styles.css/viz.css) ───
   Slide-from-right + fade with separated curves for a refined feel.
   Tablet (640-900px): drawer caps at 360px (panel, not fullscreen). */
@media (max-width: 900px) {
  .mobile-menu {
    z-index: var(--mp-z-drawer);
    /* Premium frosted dark surface for that high-end agency feel */
    background:
      radial-gradient(circle at 15% 5%, rgba(220, 0, 24, 0.08), transparent 40%),
      radial-gradient(circle at 85% 92%, rgba(220, 0, 24, 0.06), transparent 50%),
      linear-gradient(180deg, #fbfbfd 0%, #f3f3ee 100%);
    /* Slide-from-right (off-canvas) + subtle fade-in for the body */
    transform: translateX(100%);
    opacity: 0;
    will-change: transform, opacity;
    transition:
      transform 0.46s var(--mp-ease),
      opacity 0.32s var(--mp-ease);
    padding-top: max(24px, calc(20px + var(--sa-top)));
    padding-bottom: max(24px, calc(20px + var(--sa-bottom)));
    padding-left:  max(24px, var(--sa-left));
    padding-right: max(24px, var(--sa-right));
    box-shadow:
      -24px 0 60px -8px rgba(0, 0, 0, 0.25),
      -2px  0 8px        rgba(0, 0, 0, 0.06);
  }
  .mobile-menu.open {
    transform: translateX(0);
    opacity: 1;
  }

  .mobile-menu__head {
    padding-bottom: 18px;
    border-bottom: 1px solid rgba(10, 10, 10, 0.08);
  }
  .mobile-menu__close {
    width: 44px;
    height: 44px;
    min-height: 44px;
    border-radius: 10px;
    border: 1px solid rgba(10, 10, 10, 0.08);
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  /* Nav list: large, premium tap-targets */
  .mobile-menu nav {
    margin-top: 24px;
    gap: 2px;
  }
  .mobile-menu nav > a {
    font-family: var(--font-display);
    font-size: clamp(22px, 5.6vw, 30px);
    font-weight: 700;
    letter-spacing: -0.026em;
    padding: 14px 4px;
    color: var(--ink, #0a0a0a);
    border-bottom: 1px solid rgba(10, 10, 10, 0.08);
  }

  /* Group block (Leistungen sub-list) */
  .mobile-menu__group {
    margin: 6px 0 8px;
    padding: 12px 0 8px;
    border-bottom: 1px solid rgba(10, 10, 10, 0.08);
  }
  .mobile-menu__group-label {
    display: block;
    font-family: var(--font-mono, ui-monospace, monospace);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--viz-red, #DC0018);
    padding: 6px 4px 10px;
  }
  .mobile-menu__group a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-display);
    font-size: 17px;
    font-weight: 500;
    letter-spacing: -0.012em;
    color: var(--ink-2, #1a1a1a);
    padding: 10px 4px;
    border-bottom: none;
  }

  /* Bottom CTA — premium pill, full-width */
  .mobile-menu__foot {
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid rgba(10, 10, 10, 0.08);
  }
  .mobile-menu__cta {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 16px 22px;
    border-radius: 999px;
    background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
    color: #fff;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.005em;
    box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.25);
    transition: transform 0.2s var(--mp-ease), background 0.25s;
  }
  .mobile-menu__cta:active {
    transform: scale(0.985);
    background: linear-gradient(135deg, var(--viz-red, #DC0018), #b30014);
  }
}

/* Tablet (640-900px): drawer becomes a right-side panel, not fullscreen.
   Right-anchored, fixed 360px width, with a soft scrim behind it. */
@media (min-width: 640px) and (max-width: 900px) {
  .mobile-menu {
    left: auto;
    right: 0;
    width: 360px;
    max-width: 90vw;
    border-left: 1px solid rgba(10, 10, 10, 0.08);
  }
  /* Scrim behind the panel — light, blurred, clickable through wrapper if needed */
  .mobile-menu::before {
    content: '';
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 10, 0.32);
    backdrop-filter: blur(2px);
    -webkit-backdrop-filter: blur(2px);
    z-index: -1;
    opacity: 0;
    transition: opacity 0.32s var(--mp-ease);
    pointer-events: none;
  }
  .mobile-menu.open::before { opacity: 1; }
}


/* ────────────────────────────────────────────────────────────────────────────
   5. HERO — FLOATING CARDS BENTO ON MOBILE
   Take cards OUT of absolute positioning at ≤640px and lay them out as a
   2×2 bento grid below a smaller sphere. ≤480px → 1-column stack of pills.
   ──────────────────────────────────────────────────────────────────────────── */

/* Tighten the orbit positioning between 641 → 1100px (slight) */
@media (min-width: 641px) and (max-width: 1100px) {
  .scene3d__float--tl { top: 4%;  left: 2%;  }
  .scene3d__float--tr { top: 8%;  right: 2%; }
  .scene3d__float--bl { bottom: 8%;  left: 2%; }
  .scene3d__float--br { bottom: 2%;  right: 2%; }
  .scene3d__float { padding: 11px 14px; gap: 10px; }
  .scene3d__icon { width: 32px; height: 32px; border-radius: 10px; }
  .scene3d__value { font-size: 16px; }
}

/* Mobile: convert the scene to "sphere on top → 2×2 bento below" */
@media (max-width: 640px) {
  /* Visual column: allow vertical layout, do NOT clip orbit cards */
  .hero-stage__visual { width: 100%; }

  /* Scene becomes vertical: sphere + grid stacked */
  .scene3d {
    aspect-ratio: auto;
    max-width: 100%;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 18px;
  }
  /* Sphere container — fixed compact size so it fits cleanly */
  .scene3d__canvas {
    position: relative;
    inset: auto;
    width: 100%;
    max-width: 280px;
    aspect-ratio: 1;
    margin: 0 auto;
  }

  /* Take the four floating cards out of absolute flow → 2×2 bento grid */
  .scene3d__float {
    position: static;
    width: 100%;
    /* reset any orbit-offsets in case viz.css computed them */
    top: auto; right: auto; bottom: auto; left: auto;
    animation: none;     /* no float bobbing — pure static premium tiles */
    padding: 14px 16px;
    border-radius: var(--mp-radius);
    box-shadow: var(--mp-shadow-card);
    gap: 12px;
  }
  /* Wrap all four in a grid — they're already siblings inside .scene3d */
  .scene3d {
    /* Sphere is first child; create a sub-grid for the floats via order */
  }
  /* Use a CSS grid hack: turn .scene3d into grid where canvas spans 2 cols
     and floats fall as 2×2 below. */
  .scene3d {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
    gap: 12px;
    align-items: stretch;
  }
  .scene3d__canvas {
    grid-column: 1 / -1;
    justify-self: center;
  }
  .scene3d__float--tl { grid-column: 1; grid-row: 2; }
  .scene3d__float--tr { grid-column: 2; grid-row: 2; }
  .scene3d__float--bl { grid-column: 1; grid-row: 3; }
  .scene3d__float--br { grid-column: 2; grid-row: 3; }

  /* Make sure dark + red variants keep their gloss */
  .scene3d__float--dark {
    box-shadow: var(--mp-shadow-card-dark);
  }
  .scene3d__float--red {
    box-shadow: var(--mp-shadow-glow-red);
  }

  /* Icon + value sizing */
  .scene3d__icon { width: 34px; height: 34px; border-radius: 10px; }
  .scene3d__icon svg { width: 18px; height: 18px; }
  .scene3d__label { font-size: 9.5px; letter-spacing: 0.18em; }
  .scene3d__value { font-size: 16px; }
}

/* Tiny phones: switch to a single-column stack so values never wrap */
@media (max-width: 380px) {
  .scene3d {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto auto;
  }
  .scene3d__canvas    { grid-column: 1; grid-row: 1; max-width: 240px; }
  .scene3d__float--tl { grid-column: 1; grid-row: 2; }
  .scene3d__float--tr { grid-column: 1; grid-row: 3; }
  .scene3d__float--bl { grid-column: 1; grid-row: 4; }
  .scene3d__float--br { grid-column: 1; grid-row: 5; }
}

/* Hero CTAs on mobile — full-width primary, secondary trust below */
@media (max-width: 640px) {
  .hero-stage__ctas {
    flex-direction: column;
    align-items: stretch;
    gap: 14px;
    margin-top: 28px;
  }
  /* Only the HERO primary CTA stretches full-width — not nav buttons */
  .hero-stage__ctas .btn-pill {
    width: 100%;
    min-height: 54px;
    padding: 15px 24px;
    font-size: 15px;
  }
  .hero-stage__trust {
    justify-content: flex-start;
    gap: 12px;
  }
}


/* ────────────────────────────────────────────────────────────────────────────
   6. PIPELINE (NETWORK) — HIDE NOISY 3D LABELS, STACK CHIPS
   The .net3d-label and .net3d-layer elements are dynamic projected labels
   tuned for the desktop scene. On phones they crash into legend chips and
   live-status chips — hide them entirely.
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 640px) {
  /* Kill all the dynamic 3D projected labels on mobile */
  .net3d-label,
  .net3d-layer {
    display: none;
  }

  /* Give the stage a taller portrait ratio so chips don't overlap canvas */
  .pipe-stage,
  .net3d-wrap {
    aspect-ratio: 4 / 5;
    border-radius: 22px;
  }

  /* Pipe stage top/bottom: stack wrap with breathing room */
  .pipe-stage__top,
  .pipe-stage__bot {
    padding: 0 14px;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .pipe-stage__top { top: 14px; }
  .pipe-stage__bot { bottom: 14px; }

  /* Chips: more compact, easier to read */
  .pipe-stage__chip,
  .pipe-stage__live,
  .net3d-stat {
    padding: 6px 11px;
    font-size: 9.5px;
    letter-spacing: 0.12em;
    border-radius: 999px;
  }

  /* Legend: bigger taps, more padding, wrap nicely */
  .pipe-legend,
  .net3d-legend {
    gap: 8px;
    padding: 0 8px;
  }
  .pipe-legend__item,
  .net3d-legend__item {
    padding: 7px 12px;
    font-size: 9.5px;
    letter-spacing: 0.1em;
  }

  /* Process cards under the stage: relax padding, ensure readability */
  .pipe-card {
    padding: 18px 18px 20px;
    border-radius: var(--mp-radius);
  }
  .pipe-card__sub { font-size: 11px; line-height: 1.6; }
}

@media (max-width: 380px) {
  .pipe-stage,
  .net3d-wrap { aspect-ratio: 3 / 4; }
  .pipe-stage__chip { padding: 5px 9px; font-size: 9px; }
}


/* ────────────────────────────────────────────────────────────────────────────
   7. ISO-STACK — PREMIUM CARD DEPTH ON MOBILE
   Three tiers (Marketing / CRM / Automation) get bigger labels, stronger
   borders, per-tier gradient backgrounds, larger vertical connectors,
   and an accent dot at the centre tier.
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 759px) {
  /* The .iso-stack__row is already a single column at this width via viz.css.
     Add gap between cards & connectors. */
  .iso-stack__row { gap: 14px; }

  .iso-stack__card {
    padding: 22px 22px 24px;
    border-radius: var(--mp-radius);
    border: 1px solid rgba(15, 23, 42, 0.08);
    box-shadow: var(--mp-shadow-card);
    background: #fff;
    position: relative;
    overflow: hidden;
  }
  /* Per-tier gradient backgrounds: marketing (red wash), CRM (premium dark wash),
     automation (subtle warm wash). */
  .iso-stack__card[data-tier="1"] {
    background: linear-gradient(180deg, #fff 0%, #fff4f5 100%);
    border-color: rgba(220, 0, 24, 0.16);
  }
  .iso-stack__card[data-tier="2"] {
    background: linear-gradient(180deg, #0a0a0a 0%, #1a1a1a 100%);
    border-color: rgba(255, 255, 255, 0.10);
    color: #fff;
    box-shadow:
      0 1px 0 rgba(255, 255, 255, 0.08),
      0 18px 40px -12px rgba(0, 0, 0, 0.45);
  }
  .iso-stack__card[data-tier="2"] .iso-stack__title { color: #fff; }
  .iso-stack__card[data-tier="2"] .iso-stack__label { color: #ff6b78; }
  .iso-stack__card[data-tier="2"] .iso-stack__sub   { color: rgba(255, 255, 255, 0.7); }
  /* Subtle accent dot on the centre tier */
  .iso-stack__card[data-tier="2"]::before {
    content: '';
    position: absolute;
    top: 22px;
    right: 22px;
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--viz-red, #DC0018);
    box-shadow:
      0 0 0 4px rgba(220, 0, 24, 0.18),
      0 0 16px rgba(220, 0, 24, 0.55);
  }
  .iso-stack__card[data-tier="3"] {
    background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
    border-color: rgba(15, 23, 42, 0.10);
  }

  /* Larger labels & title */
  .iso-stack__label {
    font-size: 10.5px;
    letter-spacing: 0.18em;
    margin-bottom: 12px;
  }
  .iso-stack__title {
    font-size: clamp(22px, 5.6vw, 26px);
    line-height: 1.1;
  }
  .iso-stack__sub {
    margin-top: 8px;
    font-size: 12.5px;
    line-height: 1.55;
  }

  /* Larger vertical connector lines between cards */
  .iso-stack__line {
    width: 2px;
    height: 36px;
    margin: 0 auto;
    background: linear-gradient(180deg,
      transparent,
      rgba(220, 0, 24, 0.5) 35%,
      rgba(220, 0, 24, 0.5) 65%,
      transparent);
  }
  .iso-stack__line::after {
    width: 8px;
    height: 8px;
    box-shadow: 0 0 0 4px rgba(220, 0, 24, 0.18), 0 0 14px rgba(220, 0, 24, 0.55);
  }

  .iso-stack__caption {
    margin-top: 22px;
    font-size: 11px;
    letter-spacing: 0.08em;
    padding: 0 12px;
    text-wrap: balance;
  }
}


/* ────────────────────────────────────────────────────────────────────────────
   8. FOOTER — GROUPED, PREMIUM, SAFE-AREA
   Rebuild the mobile footer: brand block at top → contact stack → 2-col
   grid (Leistungen+Branchen left, Tools+Rechtliches right) → bottom row.
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 760px) {
  .ftr {
    margin-top: clamp(40px, 10vw, 64px);
    /* Subtle dark grain texture */
    background:
      radial-gradient(circle at 0% 0%, rgba(220, 0, 24, 0.08), transparent 35%),
      radial-gradient(circle at 100% 100%, rgba(220, 0, 24, 0.05), transparent 40%),
      linear-gradient(180deg, #0a0a0a 0%, #050505 100%);
  }
  .ftr__inner {
    padding:
      clamp(36px, 9vw, 56px)
      max(20px, var(--sa-left))
      max(16px, calc(16px + var(--sa-bottom)))
      max(20px, var(--sa-right));
  }
  .ftr__top {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-bottom: 28px;
  }

  /* Brand block — always at the top, breathing room */
  .ftr__brand {
    display: flex;
    flex-direction: column;
    gap: 14px;
  }
  .ftr__brand .navbar__brand { font-size: 16px; gap: 10px; }
  .ftr__brand .navbar__mark  { width: 22px; height: 22px; }
  .ftr__tag {
    margin-top: 4px;
    max-width: 38ch;
    font-size: 13.5px;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.65);
  }

  /* Brand contact links — bigger 15px font + breathing */
  .ftr__brand a,
  .ftr__contact a {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 0;
    font-size: 15px;
    line-height: 1.45;
    color: rgba(255, 255, 255, 0.92);
    transition: color 0.2s var(--mp-ease), transform 0.2s var(--mp-ease);
  }
  .ftr__brand a:active,
  .ftr__contact a:active {
    color: var(--viz-red, #DC0018);
    transform: translateX(2px);
  }

  /* Two-column footer grid (tightened gap):
       Col 1: Leistungen + Branchen
       Col 2: Tools + Rechtliches */
  .ftr__cols {
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
  }
  .ftr__col h4 {
    position: relative;
    margin-bottom: 12px;
    padding-bottom: 8px;
    font-size: 10.5px;
    font-weight: 700;
    letter-spacing: 0.18em;
    color: rgba(255, 255, 255, 0.85);
  }
  /* Accent underline under each header */
  .ftr__col h4::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 22px;
    height: 2px;
    background: var(--viz-red, #DC0018);
    border-radius: 2px;
  }
  .ftr__col a {
    padding: 7px 0;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.78);
    line-height: 1.4;
    transition: color 0.2s, transform 0.2s;
  }
  .ftr__col a:active { color: var(--viz-red, #DC0018); transform: translateX(2px); }

  /* Bottom row: copyright + CTA, wrapping.
     Subtle red accent above the divider for a Swiss-flag nod. */
  .ftr__bot {
    position: relative;
    flex-wrap: wrap;
    gap: 12px;
    padding-top: 20px;
    margin-top: 8px;
    /* Safe-area-bottom respected here */
    padding-bottom: max(8px, var(--sa-bottom));
    border-top: 1px solid rgba(255, 255, 255, 0.10);
    font-size: 11.5px;
    line-height: 1.5;
    color: rgba(255, 255, 255, 0.58);
  }
  /* Red accent strip riding the top border */
  .ftr__bot::before {
    content: '';
    position: absolute;
    top: -1px;
    left: 0;
    width: 56px;
    height: 2px;
    background: linear-gradient(90deg,
      var(--viz-red, #DC0018) 0%,
      rgba(220, 0, 24, 0) 100%);
    border-radius: 0 2px 2px 0;
  }
  .ftr__bot-cta {
    margin-left: auto;
    padding: 11px 20px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.05);
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: background 0.25s var(--mp-ease), transform 0.2s var(--mp-ease), border-color 0.25s;
  }
  .ftr__bot-cta:active {
    background: var(--viz-red, #DC0018);
    border-color: var(--viz-red, #DC0018);
    transform: scale(0.98);
  }
}

/* Small phones: collapse to single column footer columns for max legibility */
@media (max-width: 420px) {
  .ftr__cols { grid-template-columns: 1fr; gap: 22px; }
  .ftr__col h4 { font-size: 10px; }
}


/* ────────────────────────────────────────────────────────────────────────────
   9. STICKY / Z-INDEX HIERARCHY
   Anchor scroll must never sit under the sticky header — give every [id]
   a scroll-margin-top equal to the navbar height plus a comfort gap.
   ──────────────────────────────────────────────────────────────────────────── */

[id] {
  scroll-margin-top: calc(var(--mp-nav-h) + 20px);
}

/* The navbar, mobile drawer, floating actions, and chat launcher get the
   canonical z-stack. */
.navbar          { z-index: var(--mp-z-nav); }
.mobile-menu     { z-index: var(--mp-z-drawer); }
.float-actions   { z-index: var(--mp-z-float); }
.sm-chat-launcher{ z-index: var(--mp-z-chat); }

/* Floating action buttons respect safe-area-bottom + safe-area-right */
@media (max-width: 768px) {
  .float-actions {
    right:  max(14px, calc(14px + var(--sa-right)));
    bottom: max(14px, calc(14px + var(--sa-bottom)));
    gap: 10px;
  }
  .float-btn {
    width: 48px;
    height: 48px;
    border-radius: 999px;
    box-shadow:
      0 8px 24px -6px rgba(0, 0, 0, 0.30),
      0 2px 6px rgba(0, 0, 0, 0.10);
  }
}


/* ────────────────────────────────────────────────────────────────────────────
   10. SCROLL POLISH, SELECTION, SCROLLBAR
   ──────────────────────────────────────────────────────────────────────────── */

html { scroll-behavior: smooth; overscroll-behavior-y: none; }

/* Premium selection — Swiss red with high contrast text */
::selection {
  background: rgba(220, 0, 24, 0.85);
  color: #fff;
  text-shadow: none;
}
::-moz-selection {
  background: rgba(220, 0, 24, 0.85);
  color: #fff;
  text-shadow: none;
}

/* Premium subtle scrollbar (desktop only — mobile uses native) */
@media (min-width: 769px) {
  /* Firefox */
  html {
    scrollbar-width: thin;
    scrollbar-color: rgba(220, 0, 24, 0.5) rgba(15, 23, 42, 0.04);
  }
  /* WebKit */
  ::-webkit-scrollbar {
    width: 10px;
    height: 10px;
  }
  ::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.04);
  }
  ::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, rgba(220, 0, 24, 0.45), rgba(179, 0, 20, 0.65));
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: padding-box;
  }
  ::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, rgba(220, 0, 24, 0.75), rgba(179, 0, 20, 0.95));
    background-clip: padding-box;
  }
}


/* ────────────────────────────────────────────────────────────────────────────
   PREMIUM CARD / PILL / BUTTON SYSTEM (cross-viewport polish)
   Tightens the global card system: consistent radius, shadow, hover.
   ──────────────────────────────────────────────────────────────────────────── */

/* Universal premium card hover behaviour on desktop only */
@media (min-width: 769px) and (hover: hover) {
  .pipe-card,
  .iso-stack__card,
  .hero-stat,
  .mini-stat,
  .flow-step,
  .tilt-card,
  .scene3d__float {
    transition:
      transform 0.32s var(--mp-ease),
      box-shadow 0.32s var(--mp-ease),
      border-color 0.32s var(--mp-ease);
  }
}

/* Touch devices: reduce hover-translate by tightening focus-visible only */
@media (hover: none) {
  .pipe-card:hover,
  .iso-stack__card:hover,
  .hero-stat:hover,
  .flow-step:hover {
    transform: none;
  }
}

/* Premium pill button — consistent across viewports.
   On mobile the HERO pill goes full-width (handled in section 5).
   The nav/footer pills stay compact. */
.btn-pill {
  border-radius: 999px;
  min-height: 48px;
  letter-spacing: -0.005em;
}
@media (max-width: 640px) {
  /* Only stretch pills that live in hero CTA, not nav or floating */
  .hero-stage__ctas .btn-pill { width: 100%; }
  .btn-pill:not(.hero-stage__ctas *) { width: auto; }
}

/* Subtle grain texture on dark sections (very low opacity, perf-friendly).
   Scoped to .ftr only to avoid layering issues over the WebGL pipe-stage. */
.ftr { position: relative; }
.ftr::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.04) 1px, transparent 0);
  background-size: 4px 4px;
  pointer-events: none;
  z-index: 0;
  opacity: 0.5;
}
.ftr__inner { position: relative; z-index: 1; }


/* ────────────────────────────────────────────────────────────────────────────
   11. REDUCED-MOTION RESPECT
   Disable all transforms / animations for users who prefer reduced motion.
   ──────────────────────────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    transition-delay: 0s !important;
    animation-delay: 0s !important;
    scroll-behavior: auto !important;
  }
  /* Hard-stop the orbiting floating cards & pulse rings */
  .scene3d__float,
  .pipe-stage__pulse,
  .hero-stage__pill .dot::before,
  .iso-stack__card[data-tier="2"]::before,
  .iso-stack__line::after,
  .ftr::after {
    animation: none !important;
  }
  /* Drawer: instant open/close, no slide */
  .mobile-menu {
    transition: none !important;
    transform: translateX(100%) !important;
  }
  .mobile-menu.open {
    transform: translateX(0) !important;
  }
  /* Forms: kill focus-ring animation, keep ring */
  .lead-form input,
  .lead-form textarea,
  .lead-form select,
  .lead-form button[type="submit"],
  .lead-form__submit {
    transition: none !important;
  }
  /* Avoid translate-based reveals jumping */
  .reveal-up,
  .reveal-scale,
  [data-reveal],
  [data-reveal-up] {
    transform: none !important;
    opacity: 1 !important;
  }
  /* Smooth-scroll disabled */
  html { scroll-behavior: auto !important; }
}


/* ────────────────────────────────────────────────────────────────────────────
   12. PRINT SAFETY
   ──────────────────────────────────────────────────────────────────────────── */

@media print {
  /* Hide chrome: nav, mobile menu, float actions, chat, cookie banner, blobs */
  .navbar,
  .mobile-menu,
  .float-actions,
  .float-btn,
  .sm-chat-launcher,
  .chat-launcher,
  .chatbot,
  .cookie-banner,
  #cookie-banner,
  .stage__blob,
  .scene3d__canvas,
  .net3d-wrap canvas,
  .ftr__bot-cta,
  [data-no-print] {
    display: none !important;
  }

  /* Hide WebGL / 3D viz that can't render in print */
  .pipe-stage,
  .scene3d,
  .monitor,
  .chart3d-stage {
    display: none !important;
  }

  /* Force light background everywhere */
  html, body {
    background: #fff !important;
    color: #000 !important;
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Open up stages so content reads top-down, padding reset to 24px */
  .stage,
  .hero-stage,
  .branch-hero-stage,
  .ftr {
    padding: 24px 0 !important;
    margin: 0 !important;
    background: #fff !important;
    box-shadow: none !important;
    border: 0 !important;
  }
  .stage__inner,
  .hero-stage__inner,
  .branch-hero-stage__inner,
  .ftr__inner {
    padding-left: 24px !important;
    padding-right: 24px !important;
  }

  /* Footer collapses to inline list */
  .ftr {
    color: #000 !important;
    background: #fff !important;
  }
  .ftr::after { display: none !important; }
  .ftr__top,
  .ftr__cols {
    display: block !important;
  }
  .ftr__col {
    display: inline-block;
    margin-right: 24px;
    margin-bottom: 16px;
    vertical-align: top;
  }
  .ftr__col a,
  .ftr__brand a {
    color: #000 !important;
  }
  .ftr__bot::before { display: none !important; }

  /* Iso-stack: print as flat list */
  .iso-stack__card[data-tier="2"] {
    background: #fff !important;
    color: #000 !important;
    border: 1px solid #000 !important;
  }
  .iso-stack__card[data-tier="2"] .iso-stack__title,
  .iso-stack__card[data-tier="2"] .iso-stack__sub {
    color: #000 !important;
  }
  .iso-stack__card[data-tier="2"]::before,
  .iso-stack__line::after { display: none !important; }

  /* Reveal everything (cancel JS animations) */
  .reveal-up,
  .reveal-scale,
  [data-reveal],
  [data-reveal-up] {
    opacity: 1 !important;
    transform: none !important;
  }

  /* Tables: render as block, no horizontal scroll */
  .scroll-shadow {
    overflow: visible !important;
    background: none !important;
  }
  .scroll-shadow th,
  .scroll-shadow td {
    white-space: normal !important;
  }

  /* Links: show URL after for context */
  a[href^="http"]::after {
    content: " (" attr(href) ")";
    font-size: 10px;
    color: #444;
  }

  /* Avoid orphan headings & page-break behaviour */
  h1, h2, h3, h4 { break-after: avoid-page; page-break-after: avoid; }
  img, table, figure { break-inside: avoid; page-break-inside: avoid; }
  p { orphans: 3; widows: 3; }
}


/* ────────────────────────────────────────────────────────────────────────────
   13. CONTAIN HEAVY SECTIONS (perf)
   Limit reflow scope for the most expensive blocks.
   ──────────────────────────────────────────────────────────────────────────── */

.pipe-stage,
.scene3d,
.monitor,
.chart3d-stage,
.ftr {
  contain: layout style;
}


/* ────────────────────────────────────────────────────────────────────────────
   14. FORMS — LEAD-FORM SHELL & INPUTS
   Premium form system: 48px+ inputs, soft red focus ring, error states,
   full-width submit on mobile / auto-sized desktop.
   ──────────────────────────────────────────────────────────────────────────── */

/* Shell base */
.lead-form-shell {
  background: linear-gradient(180deg, #fff 0%, #fafbfc 100%);
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: var(--mp-radius-lg);
  box-shadow: var(--mp-shadow-card);
  padding: clamp(20px, 5vw, 32px);
}

/* Form structure — vertical stack with consistent gap */
.lead-form,
.lead-form-shell .lead-form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Field group */
.lead-form__field,
.lead-form .field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  position: relative;
}

/* Labels */
.lead-form label,
.lead-form__label {
  font-size: 12px;
  line-height: 1.4;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--ink-2, #1a1a1a);
}

/* Inputs / textareas / selects — 48px min height for touch */
.lead-form input:not([type="checkbox"]):not([type="radio"]),
.lead-form textarea,
.lead-form select,
.lead-form-shell input:not([type="checkbox"]):not([type="radio"]),
.lead-form-shell textarea,
.lead-form-shell select {
  width: 100%;
  min-height: 48px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 15.5px;
  line-height: 1.5;
  color: var(--ink, #0a0a0a);
  background: #fff;
  border: 1.5px solid rgba(15, 23, 42, 0.12);
  border-radius: var(--mp-radius-sm);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.02);
  transition:
    border-color 0.22s var(--mp-ease),
    box-shadow 0.28s var(--mp-ease),
    background 0.22s var(--mp-ease);
}
.lead-form textarea,
.lead-form-shell textarea {
  min-height: 120px;
  padding: 14px;
  resize: vertical;
  line-height: 1.55;
}

/* Placeholder */
.lead-form ::placeholder,
.lead-form-shell ::placeholder {
  color: rgba(15, 23, 42, 0.42);
}

/* Hover (desktop) */
@media (hover: hover) {
  .lead-form input:not([type="checkbox"]):not([type="radio"]):hover,
  .lead-form textarea:hover,
  .lead-form select:hover,
  .lead-form-shell input:not([type="checkbox"]):not([type="radio"]):hover,
  .lead-form-shell textarea:hover,
  .lead-form-shell select:hover {
    border-color: rgba(15, 23, 42, 0.22);
  }
}

/* Focus — 2px red ring with smooth animation */
.lead-form input:focus-visible,
.lead-form textarea:focus-visible,
.lead-form select:focus-visible,
.lead-form-shell input:focus-visible,
.lead-form-shell textarea:focus-visible,
.lead-form-shell select:focus-visible {
  border-color: var(--viz-red, #DC0018);
  box-shadow:
    0 0 0 4px rgba(220, 0, 24, 0.14),
    0 1px 0 rgba(15, 23, 42, 0.02);
  background: #fff;
}

/* Error state — red border + softer red ring */
.lead-form input[aria-invalid="true"],
.lead-form input.is-error,
.lead-form textarea[aria-invalid="true"],
.lead-form textarea.is-error,
.lead-form select[aria-invalid="true"],
.lead-form select.is-error,
.lead-form-shell input[aria-invalid="true"],
.lead-form-shell input.is-error,
.lead-form-shell textarea[aria-invalid="true"],
.lead-form-shell textarea.is-error,
.lead-form-shell select[aria-invalid="true"],
.lead-form-shell select.is-error {
  border-color: var(--viz-red, #DC0018);
  background: #fff7f8;
  box-shadow: 0 0 0 3px rgba(220, 0, 24, 0.10);
}

/* Error helper text under the input */
.lead-form__error,
.lead-form .field__error,
.lead-form-shell .field__error {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.45;
  font-weight: 500;
  color: var(--viz-red, #DC0018);
}
.lead-form__error::before,
.lead-form .field__error::before {
  content: '!';
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 6px;
  border-radius: 50%;
  background: var(--viz-red, #DC0018);
  color: #fff;
  text-align: center;
  font-weight: 800;
  font-size: 10px;
  line-height: 14px;
  vertical-align: 1px;
}

/* Checkbox row — privacy / consent */
.lead-form .checkbox-row,
.lead-form__checkbox {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--ink-2, #1a1a1a);
}
.lead-form .checkbox-row input[type="checkbox"],
.lead-form__checkbox input[type="checkbox"] {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--viz-red, #DC0018);
  cursor: pointer;
}

/* Submit button — full-width mobile, auto desktop */
.lead-form button[type="submit"],
.lead-form__submit,
.lead-form-shell button[type="submit"] {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 24px;
  border: none;
  border-radius: 999px;
  font-family: var(--font-sans, inherit);
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: -0.005em;
  color: #fff;
  background: linear-gradient(135deg, #0a0a0a 0%, #1a1a1a 100%);
  box-shadow: 0 16px 40px -10px rgba(0, 0, 0, 0.30);
  cursor: pointer;
  transition:
    transform 0.22s var(--mp-ease),
    background 0.32s var(--mp-ease),
    box-shadow 0.32s var(--mp-ease);
}
.lead-form button[type="submit"]:hover,
.lead-form__submit:hover,
.lead-form-shell button[type="submit"]:hover {
  background: linear-gradient(135deg, var(--viz-red, #DC0018) 0%, #b30014 100%);
  box-shadow: var(--mp-shadow-glow-red);
}
.lead-form button[type="submit"]:active,
.lead-form__submit:active,
.lead-form-shell button[type="submit"]:active {
  transform: scale(0.985);
}
.lead-form button[type="submit"]:disabled,
.lead-form__submit:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* Full-width on mobile, intrinsic on desktop */
@media (max-width: 640px) {
  .lead-form button[type="submit"],
  .lead-form__submit,
  .lead-form-shell button[type="submit"] {
    width: 100%;
  }
}
@media (min-width: 641px) {
  .lead-form button[type="submit"],
  .lead-form__submit,
  .lead-form-shell button[type="submit"] {
    width: auto;
    align-self: flex-start;
  }
}

/* Success message slot */
.lead-form__success {
  margin-top: 8px;
  padding: 14px 16px;
  font-size: 14px;
  line-height: 1.5;
  color: #07683a;
  background: #f0fbf4;
  border: 1px solid #b6e8c8;
  border-radius: var(--mp-radius-sm);
}


/* ────────────────────────────────────────────────────────────────────────────
   15. SECTION TRANSITIONS & TABLES (mobile)
   Subtle visual cues at boundary between sections, plus a horizontally
   scrollable table pattern for legal pages.
   ──────────────────────────────────────────────────────────────────────────── */

/* ─── Section transitions ───
   Use data-theme="dark|light" on <section> / .stage for explicit hinting.
   Falls back to .stage--dark / .stage--light class names. */

/* Dark → Light: subtle 1px red separator */
.stage[data-theme="dark"] + .stage[data-theme="light"],
.stage--dark + .stage--light,
.stage[data-theme="dark"] + .stage:not([data-theme]),
section[data-theme="dark"] + section[data-theme="light"] {
  position: relative;
}
.stage[data-theme="dark"] + .stage[data-theme="light"]::before,
.stage--dark + .stage--light::before,
.stage[data-theme="dark"] + .stage:not([data-theme])::before,
section[data-theme="dark"] + section[data-theme="light"]::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: clamp(56px, 14vw, 88px);
  height: 1px;
  background: linear-gradient(90deg,
    transparent 0%,
    var(--viz-red, #DC0018) 50%,
    transparent 100%);
  z-index: 1;
  pointer-events: none;
}

/* Light → Light: gentle gradient hint at the seam */
.stage[data-theme="light"] + .stage[data-theme="light"],
.stage--light + .stage--light {
  background-image: linear-gradient(180deg,
    rgba(15, 23, 42, 0.025) 0%,
    transparent 12%);
}

/* Dark → Dark: blend seamlessly — kill any double background */
.stage[data-theme="dark"] + .stage[data-theme="dark"],
.stage--dark + .stage--dark {
  border-top: 0;
}

/* ─── Tables (legal pages) ───
   Wrap a table in .scroll-shadow to get horizontal scroll on mobile
   with a subtle right-edge fade indicating more content. */
.scroll-shadow {
  position: relative;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  background:
    /* Shadow indicator on the right edge */
    linear-gradient(90deg, transparent, rgba(15, 23, 42, 0.08)) right center / 24px 100% no-repeat,
    /* White cover so shadow only appears when scrollable */
    linear-gradient(90deg, transparent 80%, #fff) right center / 24px 100% no-repeat;
  background-attachment: local, scroll;
}
.scroll-shadow table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
  line-height: 1.55;
}
.scroll-shadow th,
.scroll-shadow td {
  padding: 12px 14px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
  white-space: nowrap;
}
.scroll-shadow th {
  font-size: 11.5px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 700;
  color: var(--ink-2, #1a1a1a);
  background: #f7f8fa;
  position: sticky;
  top: 0;
  z-index: 1;
}
.scroll-shadow tbody tr:nth-child(odd) td { background: #fafbfc; }

/* Generic tables on mobile — let them scroll if a parent forgot the wrapper */
@media (max-width: 640px) {
  main table,
  .stage table {
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    max-width: 100%;
    white-space: nowrap;
  }
}


/* ────────────────────────────────────────────────────────────────────────────
   16. FLOAT-ACTIONS vs CHAT-LAUNCHER STACKING (safety net)
   chatbot.css already owns the launcher position, but enforce vertical
   stacking here so the two never overlap if a page omits chatbot.css.
   ──────────────────────────────────────────────────────────────────────────── */

@media (max-width: 768px) {
  /* If both float-actions and the chat launcher are present on the same
     page, the chat-launcher sits at the bottom-right, and float-actions
     stack above it. We assume launcher ≈ 56px tall + 16px gap. */
  body:has(.sm-chat-launcher) .float-actions {
    bottom: max(82px, calc(82px + var(--sa-bottom)));
  }
  /* Fallback browsers without :has() — increase a touch via the parent
     selector won't apply, so do a no-op here. The :has() rule is enough
     for Safari 15.4+ / Chrome 105+ / Firefox 121+ (mobile coverage). */
}

/* Ensure the launcher itself respects safe-area */
.sm-chat-launcher {
  right:  max(14px, calc(14px + var(--sa-right)));
  bottom: max(14px, calc(14px + var(--sa-bottom)));
}

/* Cookie-banner safety — should always sit above floats but below drawer */
.cookie-banner,
#cookie-banner {
  z-index: calc(var(--mp-z-drawer) - 10);
}


/* End of file */
