/* Device gate — AAA-level splash shown when a phone tries to open a studio.
   Extreme editorial layout: massive display headline, premium typographic
   rhythm, hairline rules, monochrome device row. Zero gradients, zero
   illustrations, zero blue. Same brand primitives as the marketing pages
   (refund.html, privacy.html, terms.html): #fafafa bg, Inter, 28px black
   disc logo + wordmark lockup. */

#bds-device-gate {
  position: fixed;
  inset: 0;
  z-index: 2147483647;
  background: #fafafa;
  color: #111;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-feature-settings: 'cv11', 'ss01', 'ss03';
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.5;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 0;
}

/* Local reset so the gate renders identically regardless of the host page. */
#bds-device-gate,
#bds-device-gate *,
#bds-device-gate *::before,
#bds-device-gate *::after {
  box-sizing: border-box;
}

/* Surgical override of the studio's global `h1 { background: #1e3a8a;
   padding: .5rem .8rem; display: inline-block; border-radius: 10px; color:
   #fff; }` rule. That was bleeding the blue rectangle through whenever the
   gate showed. !important so nothing the host loads later can re-stomp it. */
#bds-device-gate h1 {
  background: transparent !important;
  background-color: transparent !important;
  background-image: none !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  text-shadow: none !important;
  display: block !important;
  color: #000 !important;
}

#bds-device-gate[hidden] { display: none !important; }

/* Nuke any studio-created floating UI while the gate is up. The studio
   app has two #1e3a8a blue FAB triggers (#bds-user-menu-trigger and
   #bds-help-trigger) plus a contact backdrop that get created by the
   studio script *after* the gate reveals. Those live at z-index 9999 so
   they shouldn't beat our z-index 2147483647 — but on iOS Safari the
   stacking can still be fragile when the studio JS mutates body late in
   the lifecycle. Hiding them outright is the only reliable fix. */
html.bds-gate-active #bds-user-menu-trigger,
html.bds-gate-active #bds-help-trigger,
html.bds-gate-active #bds-contact-backdrop,
html.bds-gate-active #bds-user-menu,
html.bds-gate-active #bds-user-menu-panel {
  display: none !important;
  visibility: hidden !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

/* === Header =============================================================
   Same lockup as every marketing page: 28px black disc + wordmark. Sits
   on a hairline rule so it visually anchors without feeling chunky. */
#bds-device-gate .bds-gate-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid #ececec;
  flex-shrink: 0;
}

#bds-device-gate .bds-gate-logo {
  font-size: 0.95rem;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.02em;
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

#bds-device-gate .bds-gate-logo-icon {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
#bds-device-gate .bds-gate-logo-icon::after {
  content: '';
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: #fff;
}

/* === Main hero ==========================================================
   Editorial: thin eyebrow above a display-weight headline that takes all
   the room it can. Max-width keeps measure legible on iPads if the gate
   ever shows there. */
#bds-device-gate .bds-gate-main {
  flex: 1 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
}

#bds-device-gate .bds-gate-content {
  width: 100%;
  max-width: 560px;
  margin: 0 auto;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
}

#bds-device-gate .bds-gate-eyebrow {
  font-size: 0.72rem;
  font-weight: 600;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  margin-bottom: 28px;
  text-align: center;
}

#bds-device-gate h1 {
  font-size: clamp(2.6rem, 12vw, 5rem);
  font-weight: 900;
  color: #000;
  line-height: 0.98;
  letter-spacing: -0.045em;
  margin: 0 0 28px;
  max-width: 14ch;
  text-align: center;
}

#bds-device-gate .bds-gate-lead {
  font-size: 1.0625rem;
  color: #555;
  line-height: 1.6;
  margin: 0 0 14px;
  max-width: 42ch;
  text-align: center;
}

#bds-device-gate .bds-gate-url {
  font-size: 0.95rem;
  color: #666;
  line-height: 1.6;
  margin: 0 0 44px;
  max-width: 42ch;
  text-align: center;
}
#bds-device-gate .bds-gate-url strong {
  color: #111;
  font-weight: 600;
}

/* === Device row =========================================================
   Three hairline cards above a shared rule. Phone greyed out with a slash
   badge, iPad + Desktop in full ink. No color accents — status is shown
   via weight and a tiny mono label. */
#bds-device-gate .bds-gate-devices {
  display: flex;
  justify-content: center;
  gap: 40px;
  padding-top: 32px;
  border-top: 1px solid #ececec;
  width: 100%;
  max-width: 420px;
}

#bds-device-gate .bds-gate-device {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  flex: 1 1 0;
  min-width: 0;
}

#bds-device-gate .bds-gate-device-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
}
#bds-device-gate .bds-gate-device-icon svg {
  width: 100%;
  height: 100%;
  stroke: currentColor;
  stroke-width: 1.6;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

#bds-device-gate .bds-gate-device.is-blocked .bds-gate-device-icon {
  color: #cfcfcf;
}

#bds-device-gate .bds-gate-device-name {
  font-size: 0.88rem;
  font-weight: 700;
  color: #111;
  letter-spacing: -0.01em;
  line-height: 1.2;
  text-align: center;
}
#bds-device-gate .bds-gate-device.is-blocked .bds-gate-device-name {
  color: #999;
}

#bds-device-gate .bds-gate-device-status {
  font-size: 0.66rem;
  font-weight: 600;
  color: #111;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  line-height: 1;
}
#bds-device-gate .bds-gate-device-status::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #111;
  flex-shrink: 0;
}
#bds-device-gate .bds-gate-device.is-blocked .bds-gate-device-status {
  color: #b5b5b5;
}
#bds-device-gate .bds-gate-device.is-blocked .bds-gate-device-status::before {
  background: transparent;
  border: 1px solid #cfcfcf;
}

/* === Footer =============================================================
   Thin, typographic, two-column line. Goes to the very bottom with safe
   area padding on iPhone. */
#bds-device-gate .bds-gate-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  max-width: 720px;
  width: 100%;
  margin: 0 auto;
  padding: 24px 24px calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid #ececec;
  font-size: 0.76rem;
  color: #999;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}
#bds-device-gate .bds-gate-footer a {
  color: #555;
  text-decoration: none;
  border-bottom: 1px solid #dcdcdc;
  padding-bottom: 1px;
  transition: color 0.15s, border-color 0.15s;
}
#bds-device-gate .bds-gate-footer a:hover {
  color: #111;
  border-bottom-color: #111;
}

/* === Tight phones =======================================================
   On sub-380px screens we clamp the headline and tighten the gutters so
   it never overflows. */
@media (max-width: 380px) {
  #bds-device-gate .bds-gate-main { padding: 44px 20px 28px; }
  #bds-device-gate .bds-gate-header { padding: 20px 20px; }
  #bds-device-gate .bds-gate-footer { padding: 20px 20px calc(24px + env(safe-area-inset-bottom)); }
  #bds-device-gate h1 { font-size: clamp(2.25rem, 12vw, 3rem); max-width: 10ch; }
  #bds-device-gate .bds-gate-device { padding-right: 10px; gap: 10px; }
  #bds-device-gate .bds-gate-device-icon { width: 34px; height: 34px; }
  #bds-device-gate .bds-gate-device-name { font-size: 0.82rem; }
  #bds-device-gate .bds-gate-device-status { font-size: 0.6rem; letter-spacing: 0.12em; }
}
