html,
body {
    max-width: 100%;
    overflow-x: clip;
}

body {
    background-color: var(--background-color);
    font-family: 'DM Sans', sans-serif;
    color: var(--text-color);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin: 0;
    animation: fadeIn 0.8s var(--ease-standard);
    min-height: 100svh;
    height: 100svh;
    overflow: hidden;
    padding: var(--page-padding) !important;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: -1;
    background: var(--background-color);
}

body[data-page-shell='document'] {
    display: block;
    height: auto;
    overflow-y: visible;
    overflow-x: clip;
    padding: var(--page-padding) !important;
}

/* Explicit footer reservations opt into neutral shell spacing. */
body[data-footer-reservation] {
    padding-bottom: calc(var(--footer-height) + var(--safe-bottom) + var(--page-padding)) !important;
}

body[data-page-shell='document'][data-footer-reservation] {
    padding-bottom: calc(var(--footer-height) + var(--safe-bottom)) !important;
}

product-shell {
    display: block;
    width: 100%;
    max-width: min(100%, calc(var(--page-shell-card-max-width) + 240px));
    height: var(--page-shell-max-height);
    margin: 0 auto;
}

product-shell[data-shell-size='wide'] {
    max-width: 100%;
}

product-shell[data-shell-mode='document'] {
    height: auto;
    min-height: calc(100svh - var(--footer-height) - var(--safe-bottom) - (var(--page-padding) * 2));
}

.product-shell-frame {
    position: relative;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    padding: clamp(1rem, 2.2vw, 1.75rem);
}

product-shell[data-shell-mode='document'] .product-shell-frame {
    height: auto;
    min-height: inherit;
}

.product-shell-frame::before {
    display: none;
}

.product-shell-ribbon {
    position: relative;
    z-index: 1;
    display: none;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    font-size: 0.72rem;
    letter-spacing: 0.28em;
    text-transform: uppercase;
    color: var(--subtext-color);
}

.product-shell-eyebrow {
    color: color-mix(in srgb, var(--text-color) 78%, transparent);
}

.product-shell-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.8rem;
    border-radius: 999px;
    border: 1px solid rgba(var(--primary-neon-rgb), 0.22);
    background: rgba(var(--primary-neon-rgb), 0.08);
    color: var(--primary-neon);
    box-shadow: 0 0 18px rgba(var(--primary-neon-rgb), 0.1);
}

.product-shell-stage {
    position: relative;
    z-index: 1;
    margin-top: clamp(1rem, 2vw, 1.5rem);
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
}

.product-shell-stage:has(.looper-app) {
    margin-top: 0;
}

product-shell[data-shell-mode='document'] .product-shell-stage {
    align-items: stretch;
    justify-content: flex-start;
}

product-shell[data-shell-mode='document'] .product-shell-frame:has(.pricing-page),
product-shell[data-shell-mode='document'] .product-shell-frame:has(.legal-page) {
    padding-top: clamp(0.85rem, 1.8vw, 1.15rem);
}

product-shell[data-shell-mode='document'] .product-shell-stage:has(.pricing-page),
product-shell[data-shell-mode='document'] .product-shell-stage:has(.legal-page) {
    margin-top: 0;
}

.product-shell-stage > * {
    width: 100%;
    max-height: 100%;
}

product-shell[data-shell-mode='document'] .product-shell-stage > * {
    max-height: none;
}

@media (max-width: 640px) {
    .product-shell-frame {
        padding: 0.9rem;
    }

    .product-shell-ribbon {
        gap: 0.5rem;
        letter-spacing: 0.18em;
    }
}
