.compact-fit-hero-slot,
.compact-fit-viewport { display: none; }

/* Width chooses the presentation, including resized desktop browser windows. */
@media (max-width: 600px) {
  html[data-compact-fit-story="true"] .software-choice-hero .product-flow-grid > .software-stack-card,
  html[data-compact-fit-story="true"] .software-choice-hero .product-flow-grid > .custom-software-card > .software-comparison-heading,
  html[data-compact-fit-story="true"] .software-choice-hero .product-flow-grid > .software-choice-switch > * {
    opacity: calc(1 - var(--hero-comparison-fade, 0));
  }
  html[data-compact-fit-story="true"] .software-choice-hero .product-flow-grid > .custom-software-card {
    grid-row: 1;
    height: auto !important;
    min-height: 0 !important;
    padding-bottom: 0 !important;
    align-self: start;
    isolation: auto;
    z-index: 5;
    --fit-story-rail-extension: 0px;
  }
  html[data-compact-fit-story="true"] .compact-fit-hero-slot {
    display: block;
    position: relative;
    width: 100%;
    aspect-ratio: 490 / 370;
  }
  html[data-compact-fit-story="true"] .software-choice-hero .floral-device-showcase[data-compact-fit-attached] {
    position: absolute !important;
    display: block;
    left: 0 !important;
    top: 0 !important;
    width: var(--compact-fit-layout-width, 0px) !important;
    height: var(--compact-fit-layout-height, 0px) !important;
    max-width: none !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    transform: translate3d(var(--compact-fit-x, 0px), var(--compact-fit-y, 0px), 0)
      scale(var(--compact-fit-scale, 1)) !important;
    transform-origin: 0 0 !important;
    will-change: transform;
    filter: none !important;
    z-index: 5;
    pointer-events: none;
  }
  html[data-compact-fit-story="true"] .software-choice-hero .product-flow-grid > #how-it-works {
    grid-column: 1 / -1;
    grid-row: 2;
    margin: 20px 0 0 !important;
    padding: 0 !important;
    width: 100%;
    z-index: 2;
    scroll-margin-top: var(--fit-mobile-header-height, 64px);
  }
  html[data-compact-fit-story="true"] #how-it-works > .container {
    width: 100% !important;
    max-width: none;
    padding: 0 !important;
  }
  html[data-compact-fit-story="true"] #how-it-works .custom-fit-scroll-area {
    height: calc(var(--compact-fit-viewport-height, 100svh) - var(--compact-fit-header, 64px) + var(--compact-fit-scroll-range, 1040px)) !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    position: relative;
    overflow: visible;
    overflow-anchor: none;
  }
  html[data-compact-fit-story="true"] #how-it-works .custom-fit-deck { display: none !important; }
  html[data-compact-fit-story="true"] .compact-fit-viewport {
    position: sticky;
    top: var(--compact-fit-header, 64px);
    display: grid;
    grid-template-rows: auto minmax(0, auto) auto;
    align-content: center;
    gap: 10px;
    box-sizing: border-box;
    width: 100%;
    height: calc(var(--compact-fit-viewport-height, 100svh) - var(--compact-fit-header, 64px));
    padding: 18px 14px 24px;
  }
  html[data-compact-fit-story="true"] .compact-fit-viewport[data-intro-pinned="true"] {
    position: fixed;
    left: var(--compact-fit-viewport-left, 0px);
    width: var(--compact-fit-viewport-width, 100%);
    pointer-events: none;
  }
  .compact-fit-viewport::before,
  .compact-fit-viewport::after {
    content: "";
    position: absolute;
    top: 18px;
    bottom: 24px;
    left: 0;
    width: 2px;
    border-radius: 999px;
    pointer-events: none;
    opacity: var(--compact-fit-copy-opacity, 0);
  }
  .compact-fit-viewport::before {
    background: rgba(174, 198, 211, .14);
  }
  .compact-fit-viewport::after {
    background: linear-gradient(180deg, #79f2c0, #48e0ba);
    box-shadow: 0 0 8px rgba(121, 242, 192, .28);
    /* Arriving at the first slide already advances the story. */
    transform: scaleY(calc(.15 * var(--compact-fit-copy-opacity, 0) + .85 * var(--compact-fit-progress, 0)));
    transform-origin: top center;
  }
  .compact-fit-bubble {
    position: relative;
    width: min(100%, 660px);
    margin: 0 auto;
    opacity: var(--compact-fit-copy-opacity, 0);
    translate: 0 var(--compact-fit-copy-entrance, 0px);
  }
  .compact-fit-bubble-body {
    border: 0;
    background: none;
  }
  .compact-fit-heading-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) clamp(54px, 18vw, 84px);
    align-items: center;
    gap: clamp(12px, 3vw, 18px);
    width: 100%;
  }
  .compact-fit-phone-dock {
    width: 100%;
    aspect-ratio: 633 / 1381;
  }
  .compact-fit-bubble-title { min-width: 0; }
  .compact-fit-bubble-window { position: relative; overflow: hidden; }
  .compact-fit-bubble-panel {
    position: absolute;
    inset: 0;
    padding: 2px 0 8px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    will-change: transform;
  }
  .compact-fit-bubble-body .compact-fit-bubble-panel {
    padding: 14px 8px 4px;
    align-items: flex-start;
  }
  .compact-fit-bubble-title .compact-fit-bubble-panel { padding: 0; }
  .compact-fit-title {
    width: 100%;
    margin: 0;
    color: #e9f1f3;
    font-family: var(--font-heading, "Bebas Neue", sans-serif);
    font-size: clamp(26px, 7.6vw, 36px);
    line-height: 1.08;
    font-weight: 400;
    letter-spacing: 0;
    text-transform: uppercase;
    text-wrap: balance;
  }
  .compact-fit-title span { color: #79f2c0; }
  .compact-fit-title > span { display: block; }
  .compact-fit-title .custom-fit-title-line { color: inherit; }
  .compact-fit-title .custom-fit-title-gap { color: #ff6f7f; }
  .compact-fit-title .custom-fit-title-imagine {
    margin-top: .16em;
    color: #79f2c0;
    white-space: nowrap;
  }
  .compact-fit-body {
    width: 100%;
    margin: 0;
    font-family: var(--font-body, "Outfit", sans-serif);
    color: #edf4f5;
    font-size: clamp(16px, 3.6vw, 18px);
    font-weight: 500;
    line-height: 1.5;
  }
  .compact-fit-device-dock { position: relative; min-width: 0; min-height: 0; }
  html[data-compact-fit-story="true"] .has-product-state-beam :is(.product-app-change-sweep, .product-phone-change-sweep) {
    width: 7%;
    background: linear-gradient(90deg, transparent, rgba(72, 224, 186, .12) 32%, rgba(72, 224, 186, .32) 50%, rgba(72, 224, 186, .12) 68%, transparent);
  }

  html[data-compact-fit-story="true"][data-device-render="reference"][data-screen-render="live-perspective"] body
    .software-choice-hero .floral-device-showcase .product-device-stage {
    width: 100% !important;
    height: 100% !important;
    transform: none !important;
    translate: none !important;
    -webkit-mask-image: none !important;
    mask-image: none !important;
  }
  html[data-compact-fit-story="true"][data-device-render="reference"][data-screen-render="live-perspective"][data-device-rotation="true"] body
    .software-choice-hero .floral-device-showcase .floral-hero-product[data-device-rotation-ready="true"] > .product-device-stage > .product-monitor {
    /* The reading pose is the layout basis; the outer layer handles growth. */
    flex-basis: 82.368% !important;
    width: 82.368% !important;
    aspect-ratio: 1534.104 / 1173 !important;
    margin-left: 4% !important;
    scale: 1.18 !important;
  }
  html[data-compact-fit-story="true"][data-device-render="reference"][data-screen-render="live-perspective"][data-device-rotation="true"] body
    .software-choice-hero .floral-device-showcase[data-compact-fit-attached] .floral-hero-product[data-device-rotation-ready="true"] .product-phone {
    width: var(--compact-fit-phone-layout-width, 70px) !important;
    left: 0 !important;
    top: 0 !important;
    right: auto !important;
    bottom: auto !important;
    scale: 1 !important;
    translate: none !important;
    transform: translate3d(var(--compact-fit-phone-x, 0px), var(--compact-fit-phone-y, 0px), 0)
      scale(var(--compact-fit-phone-scale, 1)) !important;
    transform-origin: 0 0 !important;
    will-change: transform;
  }
}
@media (max-width: 600px) {
  html[data-compact-fit-story="true"] .software-choice-hero .product-flow-grid > .custom-software-card { grid-row: 2; }
  html[data-compact-fit-story="true"] .software-choice-hero .product-flow-grid > #how-it-works { grid-row: 3; margin-top: 38px !important; }
}
@media (max-width: 600px) {
  html[data-compact-fit-story="true"][data-compact-fit-short="true"] .compact-fit-viewport { gap: 9px; padding-block: 10px 14px; }
  html[data-compact-fit-short="true"] .compact-fit-viewport::before,
  html[data-compact-fit-short="true"] .compact-fit-viewport::after { top: 10px; bottom: 14px; }
  html[data-compact-fit-short="true"] .compact-fit-bubble-panel { padding: 0 0 5px; }
  html[data-compact-fit-short="true"] .compact-fit-bubble-body .compact-fit-bubble-panel { padding: 10px 6px 3px; }
  html[data-compact-fit-short="true"] .compact-fit-title { font-size: clamp(25px, 7vw, 32px); }
  html[data-compact-fit-short="true"] .compact-fit-body { font-size: 15px; line-height: 1.45; }
}
