  *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

  html, body {
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    background: #0E1419;
    background-color: #0E1419;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
    color: #fff;
    -webkit-font-smoothing: antialiased;
    /* Prevent rubber-band pull from moving the video background */
    overscroll-behavior: none;
  }

  /* ── Full-screen background layer (behind everything) ───────────────────── */
  #bgFixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    background-color: #0E1419;
    background-size: cover;
    background-position: center top;
    overflow: hidden;
    pointer-events: none;
    /* GPU compositing: prevents video from being redrawn on overscroll */
    transform: translateZ(0);
    will-change: transform;
  }
  /* Video/image background — fills #bgFixed exactly, covers like a background image */
  #bgFixed video, #bgFixed img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: translateZ(0);
  }
  #bgOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    background: linear-gradient(
      to bottom,
      rgba(14,20,25,0.0)  0%,
      rgba(14,20,25,0.0)  60%,
      rgba(14,20,25,0.95) 100%
    );
    pointer-events: none;
  }

  /* ── App shell ──────────────────────────────────────────────────────────── */
  #app {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    /* 100svh = small viewport height: the visible area AFTER Safari toolbar.
       Clips #app to exactly what the user sees, preventing content from hiding
       behind the address bar. Falls back to 100% on browsers without svh. */
    height: 100svh;
    z-index: 10;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scroll-snap-type: none;
    display: flex;
    flex-direction: column;
    animation: fadeIn 0.4s ease both;
  }
  @keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

  /* ── Not-found / error state ────────────────────────────────────────────── */
  .state-cover {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    text-align: center;
  }
  .state-cover h2 {
    font-size: 20px;
    font-weight: 600;
    color: rgba(255,255,255,0.85);
    margin-bottom: 10px;
  }
  .state-cover p {
    font-size: 14px;
    color: rgba(255,255,255,0.5);
    line-height: 1.5;
  }

  /* ── Skeleton loading ───────────────────────────────────────────────────── */
  #skeleton {
    display: flex;
    flex-direction: column;
    flex: 1;
  }
  .skel-header {
    height: 80px;
    background: rgba(255,255,255,0.03);
    position: relative;
    overflow: hidden;
  }
  .skel-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.05) 50%, transparent 75%);
    animation: shimmer 1.4s infinite;
    background-size: 200% 100%;
  }
  @keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
  }
  .skel-spacer { flex: 1; }
  .skel-buttons {
    padding: 0 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  .skel-btn {
    height: 52px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    position: relative;
    overflow: hidden;
  }
  .skel-btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.05) 50%, transparent 75%);
    animation: shimmer 1.4s infinite;
    background-size: 200% 100%;
  }

  /* ── Main page ──────────────────────────────────────────────────────────── */
  #mainPage {
    display: none;
    flex-direction: column;
    justify-content: flex-start;
    flex: 1;
    min-height: 100%;
    touch-action: pan-y;
    padding: 20px 0;
  }
  #mainPage.visible {
    display: flex;
    animation: fadeIn 0.4s ease both;
  }

  /* ── Page header — business name / logo zone ───────────────────────────── */
  .page-header {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px 24px 12px;
    min-height: 100px;
    text-align: center;
  }
  .page-header.compact {
    min-height: 60px;
    padding-bottom: 8px;
  }
  .hero-business-name {
    width: 100%;
    text-align: center;
    font-size: clamp(18px, 5vw, 32px);
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.2;
    word-break: break-word;
    padding: 0 16px;
  }

  /* ── Flexible spacer — pushes buttons to lower half when bg image present ─ */
  #contentSpacer {
    flex: 0 0 0;
    min-height: 0;
    transition: flex-basis 0.3s ease;
  }
  #contentSpacer.expanded { flex: 1; min-height: 20px; }

  /* ── Content / buttons area ─────────────────────────────────────────────── */
  .content {
    flex-shrink: 0;
    padding: 0;
    margin-top: auto; /* anchors button stack to the bottom of available space */
  }

  /* No background — buttons sit directly below the business name, not at the bottom */
  #mainPage.no-bg .content {
    margin-top: 0;
  }
  #mainPage.no-bg .buttons {
    padding-top: 16px;
  }

  .section-label {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #FFFFFF;
    text-shadow: 0 0 12px rgba(6,214,160,0.4), 0 0 24px rgba(6,214,160,0.15);
    margin-bottom: 0;
    padding: 0;
  }

  /* ── Tap-outside catcher — transparent layer above video, below open form ── */
  #tapCatcher {
    position: fixed;
    inset: 0;
    z-index: 0;
    display: none;
    cursor: pointer;
    background: transparent;
  }

  /* ── Button units — wrapper for one tap-btn + its form-wrap ─────────────── */
  .btn-unit {
    position: relative;
    width: calc(100% - 48px);
    max-width: 440px;
    margin: 0 auto 14px;
    transition: transform 0.3s ease;
  }
  .btn-unit:last-child { margin-bottom: 2px; }

  /* Tapped unit: single compositor layer, neon border driven by --neon var */
  .btn-unit.form-open {
    position: relative;
    z-index: 2;
    background: rgba(0,0,0,0.55);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-radius: 12px;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    scrollbar-width: none;
    border: 2px solid var(--neon, #06D6A0);
    box-shadow: 0 0 6px var(--neon, #06D6A0), 0 0 10px color-mix(in srgb, var(--neon, #06D6A0) 40%, transparent);
  }
  .btn-unit.form-open::-webkit-scrollbar { display: none; }

  /* Sibling buttons slide away when a form is open */
  .slide-up {
    transform: translateY(-120vh);
    transition: transform 0.3s ease;
    pointer-events: none;
    position: absolute;
  }
  .slide-down {
    transform: translateY(120vh);
    transition: transform 0.3s ease;
    pointer-events: none;
    position: absolute;
  }

  /* When a form is open, centre the visible unit within the page */
  .has-open-form .buttons {
    justify-content: flex-start;
  }

  /* ── Buttons ─────────────────────────────────────────────────────────────── */
  .buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 0 16px;
    width: 100%;
  }

  .tap-btn {
    display: block;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 16px 24px;
    position: relative;  /* establishes positioning context for .btn-runner-overlay */
    background: rgba(0,0,0,0.35);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    border: 2px solid var(--neon, #06D6A0);
    border-radius: 12px;
    color: var(--neon, #06D6A0);
    box-shadow: 0 0 4px var(--neon, #06D6A0), 0 0 6px color-mix(in srgb, var(--neon, #06D6A0) 30%, transparent);
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    letter-spacing: 0.01em;
    line-height: 1.3;
    transition: opacity 0.12s, transform 0.08s, border-radius 0.15s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    text-decoration: none;
  }
  .tap-btn:active, .tap-btn.pressed {
    opacity: 0.72;
    transform: scale(0.97);
  }
  .tap-btn.glow-off {
    box-shadow: none;
  }

  /* ── "See what's on" section ─────────────────────────────────────────────── */
  .whats-on-divider {
    margin: 12px 24px 12px;
    border: none;
    border-top: 1px solid rgba(255,255,255,0.08);
  }
  .whats-on-btn {
    display: block;
    width: calc(100% - 48px);
    margin: 0 auto;
    padding: 12px 16px;
    background: transparent;
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 10px;
    color: rgba(255,255,255,0.55);
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-align: center;
    transition: background 0.12s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
  }
  .whats-on-btn:active { background: rgba(255,255,255,0.05); }
  .whats-on-content {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
  }
  .whats-on-content.open { max-height: 600px; }
  .whats-on-inner {
    padding: 14px 24px 0;
  }
  .whats-on-img {
    width: 100%;
    border-radius: 8px;
    display: block;
    margin-bottom: 10px;
  }
  .whats-on-text {
    font-size: 14px;
    color: rgba(255,255,255,0.75);
    line-height: 1.5;
  }

  /* ── Inline forms ────────────────────────────────────────────────────────── */
  .form-wrap {
    overflow: hidden;
    max-height: 0;
    transition: max-height 0.35s ease;
  }
  /* Form expands inline below the tapped button — page grows naturally */
  .form-wrap.open {
    max-height: 1200px;
  }

  .inline-form {
    position: relative;
    background: transparent;
    border-left: 1px solid rgba(255,255,255,0.15);
    border-right: 1px solid rgba(255,255,255,0.15);
    border-bottom: 1px solid rgba(255,255,255,0.15);
    border-top: none;
    border-radius: 0 0 12px 12px;
    padding: 12px 16px 24px;
    margin-top: -4px;
    display: flex;
    flex-direction: column;
    gap: 12px;
  }

  /* All children transparent — single blur on parent shows through uniformly */
  .btn-unit.form-open .tap-btn {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    border: none;
    box-shadow: none;
    border-radius: 12px 12px 0 0;
    color: var(--neon, #06D6A0);
    flex-shrink: 0;
  }
  .btn-unit.form-open .form-wrap {
    background: transparent;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
  .btn-unit.form-open .inline-form {
    background: transparent;
    backdrop-filter: none;
    border: none;
  }

  /* When a form is open, #app grows with content so the page can scroll */
  #app.form-active {
    height: auto;
    min-height: 100svh;
  }

  /* ── Form close button (X) ───────────────────────────────────────────────── */
  .form-close-btn {
    position: absolute;
    top: -2px;
    right: 2px;
    margin: 0;
    background: transparent;
    border: none;
    color: var(--neon, #06D6A0);
    width: 28px;
    height: 28px;
    font-size: 20px;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 20;
    -webkit-tap-highlight-color: transparent;
    font-family: inherit;
    line-height: 1;
    flex-shrink: 0;
    text-shadow: 0 0 6px var(--neon, #06D6A0);
  }
  .btn-unit.form-open .form-close-btn {
    display: flex;
  }
  .form-close-btn:hover { background: rgba(255,255,255,0.2); }

  .form-title {
    font-size: 14px;
    font-weight: 600;
    color: rgba(255,255,255,0.9);
    margin-bottom: 2px;
  }

  .field-wrap { display: flex; flex-direction: column; gap: 4px; }

  /* FIX 4: Field labels bright white */
  .field-label {
    font-size: 12px;
    font-weight: 500;
    color: #FFFFFF;
    letter-spacing: 0.02em;
  }
  .field-label .opt {
    color: rgba(255,255,255,0.35);
    font-weight: 400;
  }

  .field-input,
  .field-select,
  .field-textarea {
    width: 100%;
    padding: 11px 13px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    color: #fff;
    font-size: 16px;
    font-family: inherit;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
    transition: border-color 0.15s;
  }
  .field-input:focus,
  .field-select:focus,
  .field-textarea:focus {
    border-color: rgba(255,255,255,0.4);
  }
  .field-input::placeholder,
  .field-textarea::placeholder { color: rgba(255,255,255,0.28); }
  .field-input.error,
  .field-select.error,
  .field-textarea.error { border-color: #E84A5F; }

  .field-error {
    font-size: 12px;
    color: #E84A5F;
    display: none;
  }
  .field-error.visible { display: block; }

  .field-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='rgba(255,255,255,0.4)' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 13px center;
    padding-right: 36px;
  }
  .field-select option { background: #1C2730; color: #fff; }

  .field-textarea {
    resize: none;
    min-height: 80px;
    line-height: 1.4;
  }
  .field-counter {
    font-size: 11px;
    color: rgba(255,255,255,0.3);
    text-align: right;
  }

  .submit-btn {
    width: 100%;
    height: 50px;
    background: #06D6A0;
    border: none;
    border-radius: 10px;
    color: #0E1419;
    font-size: 15px;
    font-weight: 700;
    font-family: inherit;
    cursor: pointer;
    transition: opacity 0.12s, transform 0.08s;
    -webkit-tap-highlight-color: transparent;
  }
  .submit-btn:active { transform: scale(0.98); }
  .submit-btn:disabled { opacity: 0.5; cursor: default; }

  /* ── Success state ───────────────────────────────────────────────────────── */
  .success-state {
    display: none;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 24px 16px 20px;
  }
  .success-state.visible {
    display: flex;
    animation: fadeIn 0.3s ease both;
  }
  .success-icon {
    width: 52px;
    height: 52px;
    margin-bottom: 14px;
    color: #06D6A0;
  }
  .success-heading {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 8px;
  }
  .success-msg {
    font-size: 14px;
    color: rgba(255,255,255,0.65);
    line-height: 1.5;
  }

  /* ── Footer ─────────────────────────────────────────────────────────────── */
  .footer {
    text-align: center;
    /* max(20px, env(safe-area-inset-bottom)) keeps the "Stop these texts" link
       above the iPhone home indicator (34px on most models) while giving 20px
       minimum padding on devices with a physical home button. */
    padding: 14px 0 max(20px, env(safe-area-inset-bottom));
    flex-shrink: 0;
  }
  .footer-powered {
    font-size: 11px;
    color: rgba(255,255,255,0.28);
    letter-spacing: 0.04em;
  }
  .footer-powered .star { color: rgba(6,214,160,0.55); }
  .footer-stop {
    display: inline-block;
    margin-top: 5px;
    font-size: 10px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    letter-spacing: 0.02em;
  }
  .footer-stop:hover { color: #FFFFFF; }

  /* ── Sparkles effect ──────────────────────────────────────────────────────
     .btn-sparkle divs are created and removed by emitSparkle() in middleman.js.
     Each one gets inline: left, top, width, height, --sparkle-color,
     --sparkle-drift, animation-duration, animation-delay.
     Positioned relative to .btn-unit (the nearest positioned ancestor).      */
  .btn-sparkle {
    position: absolute;
    border-radius: 50%;
    background: var(--sparkle-color, #ffffff);
    box-shadow: 0 0 3px 1px var(--sparkle-color, #ffffff);
    pointer-events: none;
    z-index: 4;
    opacity: 0;
    animation: sparkle-float linear forwards;
  }
  @keyframes sparkle-float {
    0%   { opacity: 0;   transform: translate(0, 0) scale(1); }
    12%  { opacity: 0.9; }
    70%  { opacity: 0.45; }
    100% { opacity: 0;   transform: translate(var(--sparkle-drift, 0px), -56px) scale(0.15); }
  }

