/* ============================================================
   demo-hud.css — guided tier-feature tour overlay for demo sites
   Self-contained: no dependency on the premium design system.
   Drop-in with demo-hud.js + a window.BALLY_TOUR config per page.
   ============================================================ */
:root{
  /* light, welcoming card — no more brown panels */
  --hud-ink:#141A24; --hud-ink-dim:#5A6270;
  --hud-panel:#FFFFFF; --hud-panel-2:#F6F6F2;
  --hud-line:rgba(20,26,36,.12);
  --hud-basic:#1C8B7C;     /* teal: the presence build, entry rung */
  --hud-pro:#7C2D48;       /* burgundy: the working build, most popular */
  --hud-premium:#16263F;   /* navy: the showcase build, the ceiling */
  /* legacy aliases, so any page not yet re-keyed still resolves */
  --hud-founder:var(--hud-basic);
  --hud-growth:var(--hud-pro);
  --hud-scale:var(--hud-premium);
  --hud-green:#5FD433; --hud-green-deep:#46B21F;
  --hud-shadow:0 24px 60px -18px rgba(16,24,40,.34);
}

/* ============================================================
   BOTTOM-EDGE SYSTEM  (added 2026-07-22 — foundation pass)
   ------------------------------------------------------------
   Every demo stacks three FIXED overlays along the bottom edge and they were
   fighting: the green tour pill (bottom-left), the navy attribution bar
   (bottom-CENTRE, floating over the page) and the green chat launcher
   (bottom-right). The centre pill was the real offender — it landed mid-content
   and cut TrueLine's trust strip in half and clipped Alder & Oak's copy, and at
   390px all three collided.

   One coherent system instead of three independent floats:

     ┌───────────────────────────────────────────────┐
     │  [tour pill]                    [chat launch] │  ← corner slots, floats
     ├───────────────────────────────────────────────┤
     │  ▉ DEMO STRIP — docked, full width, opaque    │  ← --bda-strip tall
     └───────────────────────────────────────────────┘

   The attribution bar becomes a DOCKED FULL-WIDTH STRIP, not a floating island,
   and body reserves exactly its height. At max scroll the reserved band sits
   under the strip, so the last line of real content is never covered. The two
   corner controls ride above the strip on a shared baseline.

   Ownership note: bally-chat.js is NOT ours to edit, so .bc is re-anchored here
   with scoped overrides. .bda-demobar carries inline styles injected per page,
   which is why these declarations need !important — that is deliberate, not lazy.
   ============================================================ */
:root{
  --bda-strip: 48px;          /* docked attribution strip height */
  --bda-gap: 14px;            /* breathing room above the strip */
  --bda-ctrl: 60px;           /* tallest corner control (the chat launcher) */
  --bda-edge: clamp(14px,3vw,26px);
  /* the whole rail — strip + gap + corner controls. Reserving only the strip
     left the tour pill sitting on top of the last lines of the page, which at
     390 covered TrueLine's "fictional business" disclaimer. That text is an
     honesty requirement, not decoration, so the reserve covers the full rail. */
  --bda-rail: calc(var(--bda-strip) + var(--bda-gap) + var(--bda-ctrl));
}
/* under 640 the strip wraps — was 76px measured before the tier badge went in.
   The badge adds a chip and a price to the same row, so the strip can now take
   a third line at 390. Reserve 84 so the last line of real content is still
   never occluded; the cost of over-reserving is whitespace, the cost of
   under-reserving is a covered disclaimer. */
@media (max-width:640px){ :root{ --bda-strip: 84px; --bda-gap: 12px; } }

/* Reserve the strip so nothing is ever occluded at the end of the page.
   Unconditional because this stylesheet only ships on demo pages, which all
   carry the bar — no :has() dependency, so it holds on older Android Chrome. */
body{ padding-bottom: var(--bda-rail); }

/* Base look for the docked strip. Lives here rather than in a per-page inline
   style attribute so the three demos share one source of truth. Deliberately
   NOT !important: halocline still carries the old inline styles and keeps its
   current look, because inline beats these. The !important block below then
   forces the docked geometry on every demo either way. */
.bda-demobar{
  position:fixed; z-index:2147483000;
  display:flex; align-items:center; gap:10px;
  color:#fff; text-decoration:none;
  background:rgba(12,16,26,0.94);
  -webkit-backdrop-filter:blur(8px); backdrop-filter:blur(8px);
  font:600 12.5px/1.25 system-ui,-apple-system,"Segoe UI",sans-serif;
}
.bda-demobar .bda-btn{
  flex:none; text-decoration:none; color:#fff;
  padding:7px 12px; border-radius:999px; font-weight:700;
  border:1px solid rgba(255,255,255,0.3);
  transition:background .2s,border-color .2s;
}
.bda-demobar .bda-btn:hover{ background:rgba(255,255,255,0.12); border-color:rgba(255,255,255,0.5); }
.bda-demobar .bda-btn--solid{ background:#F3F5F8; color:#0C101A; border-color:#F3F5F8; }
.bda-demobar .bda-btn--solid:hover{ background:#fff; color:#0C101A; }

/* NOTE ON SPECIFICITY: each demo page carries its own late
   <style id="bda-demobar-fix"> with `.bda-demobar{bottom:96px!important}` under
   760px. Same specificity + !important + later in the cascade = it would win.
   `html body .bda-demobar` (0,1,2) outranks it (0,1,0) so the docked strip
   holds without anyone editing page bodies. */
html body .bda-demobar{
  left:0 !important; right:0 !important; bottom:0 !important;
  transform:none !important;
  width:100% !important; max-width:none !important;
  border-radius:0 !important;
  border:0 !important;
  border-top:2px solid var(--bda-tier-c,rgba(243,245,248,0.14)) !important;
  min-height:var(--bda-strip);
  padding:8px clamp(12px,3vw,22px) !important;
  justify-content:center !important;
  flex-wrap:wrap !important;
  row-gap:4px !important;
  white-space:normal !important;
  box-shadow:0 -10px 30px -18px rgba(0,0,0,0.7) !important;
  z-index:2147483000;
}
/* retint the demo-chrome accent off the stray cyan and onto the locked teal —
   this bar is BALLY furniture, not the client demo's palette */
/* :not() guards keep these legacy dot/strong overrides off the tier badge
   below. Both rules are !important and `> span:first-of-type` (0,2,3) would
   otherwise outrank `.bda-tier` (0,2,2) and repaint the chip as a 8px dot. */
html body .bda-demobar > span:first-of-type:not(.bda-tier){ background:#7FD8CD !important; box-shadow:0 0 10px rgba(127,216,205,.7) !important; }
html body .bda-demobar > strong:not(.bda-price){ color:#7FD8CD !important; }
html body .bda-demobar > span{ min-width:0; overflow:hidden; text-overflow:ellipsis; }

/* ============================================================
   PERSISTENT TIER BADGE  (added 2026-08-09)
   ------------------------------------------------------------
   Hunter: "they need to show which tier they are clearly."
   A prospect who lands mid-page, or who is handed the phone halfway
   through a scroll, must be able to name the tier and the price
   without scrolling anywhere.

   Placement reasoning: the bottom edge is the ONLY edge already
   solved. Top-left and top-right are occupied on every demo by a
   sticky nav (brand on the left, phone + Call Now on the right), and
   a fixed corner chip there would sit on top of the demo's own call
   button — the single most important control on a trades site. So the
   badge is built INTO the docked strip that is already always visible,
   already full-width, already opaque, and already has its height
   reserved by --bda-rail at both 1440 and 390.

   The tier chip is the loudest thing in the strip: solid tier colour,
   uppercase, mono, dark text. The 2px top border on the whole strip
   carries the same colour so the tier reads peripherally.

   Colours are LIGHT tints of the HUD tier hues. The card hues
   (--hud-basic / --hud-pro / --hud-premium) are chosen for a white
   card and go invisible on this near-black strip.
   ============================================================ */
.bda-demobar[data-tier="basic"]  { --bda-tier-c:#6FD9C8; }  /* teal    */
.bda-demobar[data-tier="pro"]    { --bda-tier-c:#F5A3B8; }  /* rose    */
.bda-demobar[data-tier="premium"]{ --bda-tier-c:#9FBEEE; }  /* blue    */

html body .bda-demobar .bda-tier{
  flex:none;
  display:inline-flex; align-items:center;
  padding:.4em .68em; border-radius:6px;
  background:var(--bda-tier-c,#7FD8CD) !important;
  box-shadow:none !important;
  color:#0B1116;
  font:800 12px/1 ui-monospace,"SFMono-Regular",Menlo,Consolas,monospace;
  letter-spacing:.13em; text-transform:uppercase;
  width:auto !important; height:auto !important;
}
html body .bda-demobar .bda-price{
  flex:none; color:#FFFFFF !important; font-weight:800; letter-spacing:.005em;
}
html body .bda-demobar .bda-note{ opacity:.66; font-weight:600; }
html body .bda-demobar .bda-note--sm{ display:none; opacity:.66; font-weight:600; }
html body .bda-demobar .bda-sep{ opacity:.34; flex:none; }

@media (max-width:640px){
  /* the honesty line is a requirement, not decoration, so it is shortened
     rather than hidden — see the bottom-edge note above */
  html body .bda-demobar .bda-note{ display:none; }
  html body .bda-demobar .bda-note--sm{ display:inline; }
  html body .bda-demobar .bda-sep{ display:none; }
  html body .bda-demobar .bda-tier{ font-size:11px; letter-spacing:.1em; padding:.36em .55em; }
}

/* ---- the two corner controls ride ABOVE the strip on one baseline ---- */
html body .hud-launch{ bottom:calc(var(--bda-strip) + var(--bda-gap)) !important; }
html body .bc{ bottom:calc(var(--bda-strip) + var(--bda-gap)) !important; right:var(--bda-edge) !important; }
html body .bc__panel{ max-height:calc(100vh - var(--bda-strip) - 96px) !important; }

@media (max-width:640px){
  /* three controls will not fit on one row at 390 — the strip wraps to two
     lines and the corner buttons shrink rather than overlap */
  html body .bda-demobar{ font-size:11px !important; gap:6px !important; }
  html body .bda-demobar > span:nth-of-type(3){ display:none !important; }
  html body .bc__panel{ height:70vh !important; max-height:calc(100vh - var(--bda-strip) - 84px) !important; }
}

/* the tour card must never sit under the strip either */
html body .hud__card{ max-height:calc(100vh - var(--bda-strip) - 24px) !important; }

@media (prefers-reduced-motion:reduce){ .bda-demobar{ transition:none !important; } }

/* ---- launch pill ---- */
.hud-launch{
  position:fixed; left:clamp(14px,3vw,26px); bottom:clamp(14px,3vw,26px);
  z-index:2147483647; display:inline-flex; align-items:center; gap:.55rem;
  padding:.72rem 1.05rem .72rem .95rem; border:0; cursor:pointer;
  border-radius:999px; font:600 14px/1 system-ui,-apple-system,"Segoe UI",sans-serif;
  letter-spacing:.01em; color:#0B1A08; font-weight:700;
  background:linear-gradient(120deg,#5FD433,#46B21F);
  box-shadow:0 10px 30px -8px rgba(14,158,140,.45),0 2px 0 rgba(0,0,0,.12);
  transition:transform .25s cubic-bezier(.2,.8,.2,1),box-shadow .25s;
}
.hud-launch:hover{transform:translateY(-2px);box-shadow:0 16px 40px -10px rgba(63,191,173,.65)}
.hud-launch:active{transform:translateY(0)}
.hud-launch__dot{width:9px;height:9px;border-radius:50%;background:#0E1512;box-shadow:0 0 0 4px rgba(14,21,18,.18);animation:hudPulse 2.4s ease-in-out infinite}
.hud-launch__x{display:none}
.hud-launch.is-open{background:var(--hud-panel);color:var(--hud-ink);box-shadow:var(--hud-shadow)}
.hud-launch.is-open .hud-launch__label,.hud-launch.is-open .hud-launch__dot{display:none}
.hud-launch.is-open .hud-launch__x{display:inline}
.hud-launch[hidden]{display:none}
@keyframes hudPulse{0%,100%{opacity:1}50%{opacity:.35}}
@media (prefers-reduced-motion:reduce){.hud-launch__dot{animation:none}.hud-launch{transition:none}}

/* ---- root overlay ---- */
.hud{position:fixed;inset:0;z-index:2147483646;pointer-events:none;opacity:0;visibility:hidden;transition:opacity .3s ease}
.hud.is-active{opacity:1;visibility:visible}
.hud__scrim{position:fixed;inset:0;background:rgba(9,8,6,.001);pointer-events:auto}

/* spotlight ring — the huge spread shadow darkens everything except the hole */
.hud__ring{
  position:fixed; border-radius:16px; pointer-events:none;
  box-shadow:0 0 0 9999px rgba(9,8,6,.74), 0 0 0 2px var(--ring-c,#3FBFAD), 0 0 34px 2px var(--ring-glow,rgba(63,191,173,.5)) inset;
  transition:all .42s cubic-bezier(.4,0,.15,1);
}
.hud.is-summary .hud__ring{opacity:0}
.hud.is-summary .hud__scrim{background:rgba(9,8,6,.8);backdrop-filter:blur(3px)}
/* intro step: no dim — show the site in full, card docked in a corner */
.hud.is-full .hud__ring{box-shadow:0 0 0 2px var(--ring-c,#3FBFAD),0 0 34px 2px var(--ring-glow,rgba(63,191,173,.5)) inset;opacity:0}

/* ---- card ---- */
.hud__card{
  position:fixed; width:min(360px,calc(100vw - 28px)); pointer-events:auto;
  background:linear-gradient(180deg,var(--hud-panel-2),var(--hud-panel));
  border:1px solid var(--hud-line); border-radius:16px; padding:1.15rem 1.2rem 1rem;
  color:var(--hud-ink); box-shadow:var(--hud-shadow);
  max-height:calc(100vh - 24px); overflow-y:auto;
  font-family:system-ui,-apple-system,"Segoe UI",sans-serif;
  transition:top .42s cubic-bezier(.4,0,.15,1),left .42s cubic-bezier(.4,0,.15,1),transform .3s ease,opacity .3s ease;
}
.hud.is-summary .hud__card{width:min(440px,calc(100vw - 28px))}
.hud__close{position:absolute;top:.55rem;right:.6rem;width:30px;height:30px;display:grid;place-items:center;border:0;border-radius:8px;background:transparent;color:var(--hud-ink-dim);font-size:15px;cursor:pointer;transition:background .2s,color .2s}
.hud__close:hover{background:rgba(34,32,27,.06);color:var(--hud-ink)}
.hud__badge{display:inline-flex;align-items:center;gap:.45rem;font:700 11px/1 ui-monospace,"SFMono-Regular",Menlo,monospace;letter-spacing:.14em;text-transform:uppercase;color:var(--badge-c,#3FBFAD);padding-right:34px}
.hud__badge::before{content:"";width:8px;height:8px;border-radius:50%;background:var(--badge-c,#3FBFAD);box-shadow:0 0 10px var(--badge-c,#3FBFAD)}
.hud__plan{margin-left:.5rem;color:var(--hud-ink-dim);font-weight:600;letter-spacing:.02em;text-transform:none}
.hud__title{margin:.55rem 0 .4rem;font-size:1.28rem;line-height:1.16;font-weight:650;letter-spacing:-.01em}
.hud__body{margin:0;font-size:.95rem;line-height:1.5;color:var(--hud-ink-dim)}
.hud__body b{color:var(--hud-ink);font-weight:600}

.hud__foot{display:flex;align-items:center;gap:.6rem;margin-top:1.05rem}
.hud__dots{display:flex;gap:6px;margin-right:auto}
.hud__dots i{width:7px;height:7px;border-radius:50%;background:var(--hud-line);transition:background .25s,transform .25s}
.hud__dots i.on{background:var(--hud-ink);transform:scale(1.15)}
.hud__btn{font:600 13px/1 system-ui,sans-serif;border-radius:9px;padding:.6rem .9rem;cursor:pointer;border:1px solid var(--hud-line);background:transparent;color:var(--hud-ink);transition:background .2s,border-color .2s,transform .15s}
.hud__btn:hover{background:rgba(34,32,27,.06)}
.hud__btn:active{transform:scale(.97)}
.hud__btn--go{border:0;color:#0B1A08;background:linear-gradient(120deg,#5FD433,#46B21F);font-weight:700}
.hud__btn--go:hover{filter:brightness(1.05)}
.hud__btn[hidden]{display:none}

/* summary tier chips */
.hud__tiers{display:grid;gap:.55rem;margin:.9rem 0 .2rem}
.hud__tier{display:flex;gap:.7rem;align-items:flex-start;padding:.7rem .8rem;border:1px solid var(--hud-line);border-radius:11px;background:rgba(34,32,27,.025)}
.hud__tier b{display:block;font-size:.9rem;margin-bottom:.1rem}
.hud__tier span{font-size:.82rem;color:var(--hud-ink-dim);line-height:1.4}
.hud__tier i{width:10px;height:10px;border-radius:50%;margin-top:.28rem;flex:0 0 auto;box-shadow:0 0 8px currentColor}
/* the tier this demo actually is, called out in the closing summary */
.hud__tier.is-here{background:rgba(34,32,27,.06);border-color:rgba(20,26,36,.28);box-shadow:inset 0 0 0 1px rgba(20,26,36,.10)}
.hud__here{display:block;font:700 10px/1 ui-monospace,"SFMono-Regular",Menlo,monospace;letter-spacing:.11em;text-transform:uppercase;color:var(--hud-ink-dim);margin:.3rem 0 .18rem}
.hud__ctas{display:flex;gap:.6rem;margin-top:1rem;flex-wrap:wrap}
.hud__ctas a{flex:1 1 140px;text-align:center;text-decoration:none;font:700 13px/1 system-ui,sans-serif;padding:.75rem 1rem;border-radius:10px}
.hud__ctas a.primary{color:#0B1A08;background:linear-gradient(120deg,#5FD433,#46B21F)}
.hud__ctas a.ghost{color:var(--hud-ink);border:1px solid var(--hud-line)}

/* mobile: dock card to bottom */
@media (max-width:640px){
  .hud__card{left:14px!important;right:14px;width:auto;top:auto!important;transform:none!important;
             bottom:calc(var(--bda-strip) + var(--bda-gap) + 58px)!important}
  .hud.is-summary .hud__card{left:14px!important;top:auto!important}
  /* the global cap is measured from the strip only, but on mobile the card is
     ALSO pushed up by the gap and the 58px control row. Without this the taller
     summary card grows past the top of the viewport and loses its first line. */
  html body .hud__card{
    max-height:calc(100vh - var(--bda-strip) - var(--bda-gap) - 58px - 20px) !important;
  }
  /* the closing summary is the tallest card in the tour: three tier rows, two
     CTAs and the dots. Tighten it at 390 so it fits without an internal scroll,
     because a clipped price list on a sales demo reads as unfinished. */
  .hud.is-summary .hud__card{padding:1rem 1rem .85rem}
  .hud.is-summary .hud__body{font-size:.9rem;line-height:1.45}
  .hud.is-summary .hud__tiers{gap:.45rem;margin:.75rem 0 .1rem}
  .hud.is-summary .hud__tier{padding:.55rem .65rem}
  .hud.is-summary .hud__tier span{font-size:.78rem;line-height:1.35}
  .hud.is-summary .hud__ctas{margin-top:.8rem}
}
@media (prefers-reduced-motion:reduce){
  .hud__ring,.hud__card{transition:opacity .2s ease}
}
