/* Full-page takeover. Deliberately NOT :where()-scoped: these name the shared layout's parts,
   which live outside this screen's root. The asset is loaded app-wide and eagerly, so they are
   gated on a state class that pharmacyflow.mjs adds on show and removes on hide; nothing else
   removes them when the screen goes. */
html.pfp-takeover .px-nav-drawer { display: none !important; }
html.pfp-takeover .px-nav-topbar { display: none !important; }
html.pfp-takeover .px-nav-content {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    overflow: visible !important;
    height: auto !important;
}

/* pharmacyflow_pivot - the scoped block follows below */

/* `html { overflow-y: scroll }`, under the takeover gate. It sizes rather than
   scrolls: an explicit root overflow keeps the classic scrollbar inside the initial containing block,
   so the `100vw` above resolves to 1265px at a 1280px viewport - the width this deck was built at. */
html.pfp-takeover { overflow-y: scroll; color-scheme: dark; }

/* ===== pharmacyflow_pivot (HTML form, scoped) =====
   Loaded eagerly from anvil.yaml native_deps.head_html. The root rule is a bare class on purpose: it must
   outrank the zero-specificity :where() reset; every other rule stays :where()-scoped so it cannot leak off
   this screen. Rules gated on .pfp-live hold the deck in its pre-GSAP state - seven slides stacked in one
   viewport-tall clipped box, their contents at opacity 0 - so the designer canvas, which runs neither
   Python nor JavaScript, lays the slides out down the page instead of showing one blank screen. */

        :where(.pharmacyflow-pitch), :where(.pharmacyflow-pitch) *,
:where(.pharmacyflow-pitch) *::before, :where(.pharmacyflow-pitch)::before,
:where(.pharmacyflow-pitch) *::after, :where(.pharmacyflow-pitch)::after { margin: 0; padding: 0; box-sizing: border-box; }

        .pharmacyflow-pitch {
            --bg-deep: #0f1117;
            --bg-surface: #161822;
            --bg-card: rgba(255, 255, 255, 0.03);
            --text-primary: #e2e4ea;
            --text-secondary: #9ca0b0;
            --text-muted: #7f8498;
            --accent-purple: #6c63ff;
            --accent-purple-text: #8079ff;
            --accent-purple-dim: rgba(108, 99, 255, 0.06);
            --accent-amber: #fbbf24;
            --accent-amber-dim: rgba(251, 191, 36, 0.08);
            --accent-green: #34d399;
            --accent-green-dim: rgba(52, 211, 153, 0.08);
            --border-subtle: rgba(255, 255, 255, 0.05);
            --border-hover: rgba(108, 99, 255, 0.15);
            --font-display: "Space Grotesk", sans-serif;
            --font-body: "Inter", sans-serif;
            --font-mono: "Space Grotesk", sans-serif;
            font-family: var(--font-body);
            background: var(--bg-deep);
            color: var(--text-primary);
            -webkit-font-smoothing: antialiased;
            -moz-osx-font-smoothing: grayscale;
    position: relative;
    flex: 1 0 auto;
}

        /* ===== NOISE TEXTURE OVERLAY ===== */
        :where(.pharmacyflow-pitch) .pfp-noise {
            position: absolute; inset: 0;
            overflow: hidden; pointer-events: none;
        }
        :where(.pharmacyflow-pitch) .pfp-noise::before {
            content: "";
            position: absolute;
            inset: 0;
            z-index: 9999;
            pointer-events: none;
            opacity: 0.025;
            background-image: url("../noise.png");
            background-repeat: repeat;
        }

        /* ===== PROGRESS BAR ===== */
        :where(.pharmacyflow-pitch) .progress-track {
            position: fixed;
            right: 28px;
            top: 50%;
            transform: translateY(-50%);
            z-index: 1000;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 6px;
        }
        :where(.pharmacyflow-pitch) .progress-dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: var(--text-muted);
            transition: opacity 0.5s cubic-bezier(0.16, 1, 0.3, 1), transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.5s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.5s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.5s cubic-bezier(0.16, 1, 0.3, 1);
            cursor: pointer;
            position: relative;
        }
        :where(.pharmacyflow-pitch) .progress-dot::before {
            content: "";
            position: absolute;
            inset: -6px;
            border-radius: 50%;
            border: 1px solid transparent;
            transition: border-color 0.4s;
        }
        :where(.pharmacyflow-pitch) .progress-dot.active {
            background: var(--accent-purple);
            box-shadow: 0 0 12px rgba(108, 99, 255, 0.4);
            transform: scale(1.3);
        }
        :where(.pharmacyflow-pitch) .progress-dot.active::before {
            border-color: rgba(108, 99, 255, 0.2);
        }
        :where(.pharmacyflow-pitch) .progress-dot:hover:not(.active) {
            background: var(--text-secondary);
            transform: scale(1.15);
        }

        /* ===== SLIDE COUNTER ===== */
        :where(.pharmacyflow-pitch) .slide-counter {
            position: fixed;
            bottom: 32px;
            left: 40px;
            z-index: 1000;
            font-family: var(--font-mono);
            font-size: 0.72rem;
            color: var(--text-muted);
            letter-spacing: 0.08em;
        }
        :where(.pharmacyflow-pitch) .slide-counter .current {
            color: var(--accent-purple-text);
            font-weight: 500;
        }

        /* ===== NAV HINT ===== */
        :where(.pharmacyflow-pitch) .nav-hint {
            position: fixed;
            bottom: 32px;
            right: 60px;
            z-index: 1000;
            font-family: var(--font-mono);
            font-size: 0.65rem;
            color: var(--text-muted);
            letter-spacing: 0.06em;
            display: flex;
            align-items: center;
            gap: 8px;
        }
        :where(.pharmacyflow-pitch) .nav-hint kbd {
            display: inline-flex;
            align-items: center;
            justify-content: center;
            width: 22px;
            height: 22px;
            border: 1px solid var(--text-muted);
            border-radius: 4px;
            font-size: 0.6rem;
        }

        /* ===== SLIDES WRAPPER (pinned container) ===== */
        /* Override GSAP's inline left/width which captures the drawer offset */
        :where(.pharmacyflow-pitch.pfp-live) .slides-wrapper {
            left: 0 !important;
            width: 100vw !important;
            max-width: 100vw !important;
        }
        :where(.pharmacyflow-pitch) .pin-spacer {
            left: 0 !important;
            width: 100vw !important;
            max-width: 100vw !important;
        }
        :where(.pharmacyflow-pitch) .slides-wrapper {
            position: relative;
        }
        :where(.pharmacyflow-pitch.pfp-live) .slides-wrapper {
            height: 100vh;
            overflow: hidden;
        }

        /* ===== SLIDES (stacked absolutely) ===== */
        /* All slides except the first start invisible via CSS to prevent
           a flash of stacked content before JS runs. GSAP animates them in. */
        :where(.pharmacyflow-pitch) .slide {
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 80px 60px;
            overflow: hidden;
        }
        :where(.pharmacyflow-pitch.pfp-live) .slide {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }
        :where(.pharmacyflow-pitch.pfp-live) .slide .slide-inner,
:where(.pharmacyflow-pitch.pfp-live) .slide .ambient-glow {
            opacity: 0;
        }

        /* Ambient glow */
        :where(.pharmacyflow-pitch) .ambient-glow {
            position: absolute;
            width: 600px;
            height: 600px;
            border-radius: 50%;
            filter: blur(160px);
            pointer-events: none;
        }

        :where(.pharmacyflow-pitch) .slide[data-slide="0"] .ambient-glow { background: rgba(108, 99, 255, 0.06); top: -200px; right: -100px; }
        :where(.pharmacyflow-pitch) .slide[data-slide="1"] .ambient-glow { background: rgba(108, 99, 255, 0.05); bottom: -200px; left: -100px; }
        :where(.pharmacyflow-pitch) .slide[data-slide="2"] .ambient-glow { background: rgba(52, 211, 153, 0.06); top: -150px; left: 50%; }
        :where(.pharmacyflow-pitch) .slide[data-slide="3"] .ambient-glow { background: rgba(108, 99, 255, 0.04); top: 50%; right: -200px; }
        :where(.pharmacyflow-pitch) .slide[data-slide="4"] .ambient-glow { background: rgba(52, 211, 153, 0.05); bottom: -100px; left: -150px; }
        :where(.pharmacyflow-pitch) .slide[data-slide="5"] .ambient-glow { background: rgba(251, 191, 36, 0.06); top: -100px; right: -100px; }
        :where(.pharmacyflow-pitch) .slide[data-slide="6"] .ambient-glow { background: rgba(52, 211, 153, 0.05); bottom: -200px; right: 20%; }

        :where(.pharmacyflow-pitch) .slide-inner {
            max-width: 880px;
            width: 100%;
            position: relative;
            z-index: 1;
        }

        /* ===== TYPOGRAPHY ===== */
        :where(.pharmacyflow-pitch) .label {
            font-family: var(--font-mono);
            font-size: 0.7rem;
            font-weight: 700;
            text-transform: uppercase;
            letter-spacing: 0.15em;
            color: var(--accent-purple-text);
            margin-bottom: 24px;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        :where(.pharmacyflow-pitch) .label::before {
            content: "";
            width: 32px;
            height: 1px;
            background: var(--accent-purple);
        }

        :where(.pharmacyflow-pitch) .heading-xl {
            font-family: var(--font-display);
            font-size: clamp(2.4rem, 5.5vw, 4rem);
            font-weight: 700;
            line-height: 1.08;
            color: var(--text-primary);
            margin-bottom: 28px;
            letter-spacing: -0.02em;
        }

        :where(.pharmacyflow-pitch) .heading-lg {
            font-family: var(--font-display);
            font-size: clamp(1.7rem, 3.5vw, 2.6rem);
            font-weight: 700;
            line-height: 1.15;
            color: var(--text-primary);
            margin-bottom: 22px;
            letter-spacing: -0.015em;
        }

        :where(.pharmacyflow-pitch) .highlight-purple { color: var(--accent-purple); }
        :where(.pharmacyflow-pitch) .highlight-green { color: var(--accent-green); }
        :where(.pharmacyflow-pitch) .highlight-amber { color: var(--accent-amber); }

        :where(.pharmacyflow-pitch) .body-text {
            font-size: 1.05rem;
            color: var(--text-secondary);
            line-height: 1.85;
            max-width: 640px;
            margin-bottom: 16px;
        }
        :where(.pharmacyflow-pitch) .body-text strong {
            color: var(--text-primary);
            font-weight: 600;
        }
        :where(.pharmacyflow-pitch) .body-text-sm { font-size: 0.95rem; }
        :where(.pharmacyflow-pitch) .body-text-gap-below { margin-bottom: 20px; }
        :where(.pharmacyflow-pitch) .body-text-gap-above { margin-top: 20px; }

        /* ===== DIVIDER ===== */
        :where(.pharmacyflow-pitch) .divider {
            width: 48px;
            height: 2px;
            background: linear-gradient(90deg, var(--accent-purple), var(--accent-green));
            margin: 28px 0;
            border-radius: 2px;
            transform-origin: left center;
        }

        /* ===== LIST ITEMS ===== */
        :where(.pharmacyflow-pitch) .item-list {
            list-style: none;
            display: flex;
            flex-direction: column;
            gap: 10px;
            margin: 24px 0;
        }
        :where(.pharmacyflow-pitch) .item-list li {
            display: flex;
            align-items: flex-start;
            gap: 16px;
            padding: 16px 20px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 10px;
            backdrop-filter: blur(8px);
            transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        }
        :where(.pharmacyflow-pitch) .item-list li:hover {
            border-color: var(--border-hover);
            background: rgba(108, 99, 255, 0.04);
            transform: translateX(4px);
        }
        :where(.pharmacyflow-pitch) .item-icon {
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            flex-shrink: 0;
            border-radius: 8px;
            font-size: 1rem;
        }
        :where(.pharmacyflow-pitch) .item-icon.purple { background: var(--accent-purple-dim); color: var(--accent-purple); }
        :where(.pharmacyflow-pitch) .item-icon.green { background: var(--accent-green-dim); color: var(--accent-green); }
        :where(.pharmacyflow-pitch) .item-icon.amber { background: var(--accent-amber-dim); color: var(--accent-amber); }
        :where(.pharmacyflow-pitch) .item-title {
            font-family: var(--font-display);
            font-weight: 600;
            font-size: 0.92rem;
            color: var(--text-primary);
            margin-bottom: 2px;
        }
        :where(.pharmacyflow-pitch) .item-sub {
            font-size: 0.82rem;
            color: var(--text-muted);
            line-height: 1.5;
        }

        /* ===== SCOPE GRID ===== */
        :where(.pharmacyflow-pitch) .scope-grid {
            list-style: none;
            display: grid;
            grid-template-columns: 1fr 1fr;
            gap: 8px;
            margin: 24px 0;
        }
        :where(.pharmacyflow-pitch) .scope-grid li {
            display: flex;
            align-items: center;
            gap: 12px;
            padding: 12px 16px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 8px;
            backdrop-filter: blur(8px);
            transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.35s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.35s cubic-bezier(0.16, 1, 0.3, 1);
        }
        :where(.pharmacyflow-pitch) .scope-grid li:hover {
            border-color: var(--border-hover);
            background: rgba(108, 99, 255, 0.04);
            transform: translateY(-1px);
        }
        :where(.pharmacyflow-pitch) .scope-marker {
            width: 6px;
            height: 6px;
            border-radius: 50%;
            background: var(--accent-purple);
            flex-shrink: 0;
            box-shadow: 0 0 8px rgba(108, 99, 255, 0.3);
        }
        :where(.pharmacyflow-pitch) .scope-text {
            font-family: var(--font-display);
            font-size: 0.82rem;
            font-weight: 500;
            color: var(--text-secondary);
        }

        /* ===== STAT CARDS ===== */
        :where(.pharmacyflow-pitch) .stat-row {
            display: flex;
            gap: 16px;
            margin: 28px 0;
            flex-wrap: wrap;
        }
        :where(.pharmacyflow-pitch) .stat-card {
            flex: 1;
            min-width: 180px;
            padding: 28px 24px;
            background: var(--bg-card);
            border: 1px solid var(--border-subtle);
            border-radius: 12px;
            backdrop-filter: blur(8px);
            position: relative;
            overflow: hidden;
        }
        :where(.pharmacyflow-pitch) .stat-card-border {
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            height: 2px;
            background: linear-gradient(90deg, var(--accent-amber), transparent);
            opacity: 0.6;
            transform-origin: left center;
        }
        :where(.pharmacyflow-pitch) .stat-value {
            font-family: var(--font-display);
            font-size: 2.2rem;
            font-weight: 700;
            color: var(--accent-amber);
            line-height: 1;
        }
        :where(.pharmacyflow-pitch) .stat-value span {
            font-size: 0.9rem;
            font-weight: 500;
            color: var(--text-muted);
        }
        :where(.pharmacyflow-pitch) .stat-label {
            font-size: 0.78rem;
            color: var(--text-muted);
            margin-top: 8px;
            letter-spacing: 0.01em;
        }

        /* ===== TARGET BADGES ===== */
        :where(.pharmacyflow-pitch) .target-badge {
            display: inline-flex;
            align-items: center;
            gap: 8px;
            padding: 8px 20px;
            border-radius: 40px;
            font-family: var(--font-mono);
            font-size: 0.75rem;
            font-weight: 500;
            letter-spacing: 0.04em;
            border: 1px solid;
        }
        :where(.pharmacyflow-pitch) .target-badge.green {
            color: var(--accent-green);
            border-color: rgba(52, 211, 153, 0.25);
            background: var(--accent-green-dim);
        }
        :where(.pharmacyflow-pitch) .target-badge.purple {
            color: var(--accent-purple-text);
            border-color: rgba(108, 99, 255, 0.25);
            background: var(--accent-purple-dim);
        }

        /* ===== RESPONSIVE ===== */
        @media (max-width: 768px) {
            :where(.pharmacyflow-pitch) .slide { padding: 60px 24px; }
            :where(.pharmacyflow-pitch) .scope-grid { grid-template-columns: 1fr; }
            :where(.pharmacyflow-pitch) .stat-row { flex-direction: column; }
            :where(.pharmacyflow-pitch) .progress-track { right: 14px; }
            :where(.pharmacyflow-pitch) .nav-hint { display: none; }
            :where(.pharmacyflow-pitch) .slide-counter { left: 24px; }
        }

        /* ===== SCROLL HINT BOUNCE ===== */
        /* Opacity stays animated at 1: the animation has always overridden GSAP's exit fade on the cue. */
        @keyframes pfp-float-down {
            0%, 100% { transform: translateY(0); opacity: 1; }
            50% { transform: translateY(6px); opacity: 1; }
        }
        :where(.pharmacyflow-pitch) .scroll-cue {
            position: absolute;
            bottom: 40px;
            left: 50%;
            transform: translateX(-50%);
            font-family: var(--font-mono);
            font-size: 0.65rem;
            color: var(--text-muted);
            letter-spacing: 0.1em;
            text-transform: uppercase;
            display: flex;
            flex-direction: column;
            align-items: center;
            gap: 8px;
            animation: pfp-float-down 2.5s ease-in-out infinite;
        }
        :where(.pharmacyflow-pitch) .scroll-cue svg {
            width: 16px;
            height: 16px;
            stroke: var(--text-muted);
        }
        /* ===== BACK BUTTON ===== */
        :where(.pharmacyflow-pitch) .back-btn {
            position: fixed;
            top: 28px;
            left: 28px;
            z-index: 10000;
            width: 36px;
            height: 36px;
            display: flex;
            align-items: center;
            justify-content: center;
            background: rgba(255, 255, 255, 0.05);
            border: 1px solid rgba(255, 255, 255, 0.1);
            border-radius: 8px;
            cursor: pointer;
            color: var(--text-muted);
            transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
            padding: 0;
        }
        :where(.pharmacyflow-pitch) .back-btn:hover {
            background: rgba(255, 255, 255, 0.1);
            color: var(--text-primary);
            border-color: rgba(255, 255, 255, 0.2);
        }
        :where(.pharmacyflow-pitch) .back-btn svg {
            width: 16px;
            height: 16px;
        }
