/*
  Analytics consent — floating StatusBanner r289 dual-action.
  Home: static skin (markup + CSS below) mirroring DS DualCard / SB_ACTIONS_CSS
  from Jdoe_DS StatusBanner.jsx (r289) — no local shape tuning.
  Auth: real DS StatusBanner via artwork (do not remount its buttons in mountControls).
  The fixed banner overlays the page without reserving layout space.
  On two-column auth screens, the compact card sits in the artwork column.
*/

.jdoe-analytics-banner {
  position: fixed;
  z-index: 120;
  left: 0;
  right: 0;
  bottom: 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 max(16px, env(safe-area-inset-right, 0px))
           calc(16px + env(safe-area-inset-bottom, 0px))
           max(16px, env(safe-area-inset-left, 0px));
  pointer-events: none;
  background: transparent;
  border: 0;
  box-shadow: none;
  /* DS liquid-glass menu-curve tokens (StatusBanner r289 card path). */
  --menu-curve-scale: .9554125;
  --menu-curve-points: [[76.43,0],[54.43,0],[43.42,0],[31.58,3.75],[18.65,8.45],[8.46,18.64],[3.75,31.57],[0,43.42],[0,54.42],[0,76.43]];
  --menu-rim-stroke: 1.1px;
  --menu-rim-light: var(--line-4, rgba(35, 33, 30, 0.12));
  --menu-rim-inset: 0px;
  /* Site glass.css only defines --lg-lift under dark; card box-shadow needs it. */
  --lg-lift: 0 1px 2px rgb(0 0 0 / .06), 0 3px 9px rgb(0 0 0 / .05);
}

.jdoe-analytics-banner__shell,
.jdoe-analytics-banner__sb-host {
  width: min(960px, 100%);
  margin-inline: auto;
  pointer-events: auto;
}

/* Match the two-column auth breakpoint and leave the form column clear. */
@media (min-width: 1080px), (min-width: 840px) and (min-height: 600px) and (orientation: landscape) {
  body.auth-page > .jdoe-analytics-banner {
    --analytics-auth-right-inset: max(var(--sp-2, 8px), env(safe-area-inset-right, 0px));
    left: auto;
    right: var(--analytics-auth-right-inset);
    width: 384px;
    max-width: calc(100% - var(--auth-left-width) - var(--sp-4, 16px) - var(--analytics-auth-right-inset));
    padding-inline: 0;
    padding-bottom: calc(var(--sp-2, 8px) + env(safe-area-inset-bottom, 0px));
  }
}

/* Leave the pending choice in place while the mobile keyboard is open. */
html[data-auth-w1][data-auth-banner-keyboard] #jdoe-analytics-banner {
  display: none;
}

/* Home static banner is in the HTML; hide until consent-pending class. */
html:not(.jdoe-analytics-banner-pending):not([data-auth-w1]) #jdoe-analytics-banner {
  display: none;
}

/*
  Material blur — one-line DualCard glass root
  (`[data-status-banner-actions].lg.lg-pill-lg`, whole surface).

  Diagnosis (home hero, Chromium):
  (a) White logo glyph is `.media-frame__mark` behind the banner (sticky
      media z=3 under fixed banner z=120) — not a sibling painted above,
      not a banner pseudo.
  (b) Hero `isolation` + `overflow:clip`, media `transform` +
      `overflow`+radius do not block backdrop (0↔48 through-glass MAD
      ≈21 / max≈107 with kids visible).
  (c) Headless Chromium does render backdrop-filter (control page
      16↔48 maxΔ≈70–220; site ladder matches when measuring the
      through-glass band — full-banner MAD≈1 was text/chrome washout).
  (d) `-webkit-backdrop-filter` is set on `.lg` (and re-asserted below).

  Glyph tips that stick out *below* the capsule sit outside the backdrop
  and stay sharp — do not read those as a failed blur.

  Recipe: DS menu material (POLISH-1020) — near-white fill for text over
  busy content. Exact tokens from Jdoe_DS `styles/liquid-glass.css` /
  GlassMenu (`--lg-opacity-menu:.92`, `--lg-blur-menu:24px`), applied the
  same way as GlassMenu.jsx / GlassMenuSurface.jsx:
  `--lg-opacity: var(--lg-opacity-menu, .92)` ·
  `--lg-blur: var(--lg-blur-menu, 24px)`.
  Keep pill geometry (not sheet radius 38). `overflow:hidden` +
  `corner-shape:round` restore the r287 Chromium clip so the frosted fill
  follows the 960 capsule (not a soft content-width rect). Card path
  (`[data-status-banner-card]`) keeps DualCard ::before.
*/
.jdoe-analytics-banner [data-status-banner-actions].lg-pill-lg:not([data-status-banner-card]) {
  /* Menu tier — do not retune; values live in DS liquid-glass tokens. */
  --lg-opacity: var(--lg-opacity-menu, .92);
  --lg-blur: var(--lg-blur-menu, 24px);
  --lg-radius: 999px;
  border-radius: 999px;
  corner-shape: round;
  /* Clip frosted fill / backdrop to the capsule. */
  overflow: hidden;
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate, 1.6));
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate, 1.6));
}
.jdoe-analytics-banner [data-status-banner-actions].lg-pill-lg:not([data-status-banner-card])::before,
.jdoe-analytics-banner [data-status-banner-actions].lg-pill-lg:not([data-status-banner-card])::after {
  border-radius: 999px;
  corner-shape: round;
}

/* —— StatusBanner r289 dual-action layout (verbatim from DS SB_ACTIONS_CSS) —— */
.jdoe-analytics-banner [data-status-banner-actions] {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--sp-4, 16px);
  padding: var(--sp-4, 16px) var(--sp-4, 16px) var(--sp-4, 16px) var(--sp-6, 24px);
  width: 100%;
  box-sizing: border-box;
  white-space: normal;
}
.jdoe-analytics-banner [data-status-banner-actions] [data-status-banner-copy] {
  flex: 1 1 auto;
  min-width: 0;
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: var(--fs-compact, 13px);
  line-height: var(--lh-compact, 20px);
  font-weight: 500;
  color: var(--text-secondary, rgba(35, 33, 30, 0.76));
  text-wrap: pretty;
}
.jdoe-analytics-banner [data-status-banner-actions] [data-status-banner-copy] [data-textlink] {
  vertical-align: baseline;
}
.jdoe-analytics-banner [data-status-banner-actions] [data-status-banner-pair] {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: var(--sp-2, 8px);
}
.jdoe-analytics-banner [data-status-banner-actions] [data-status-banner-pair] [data-jd-button] {
  min-height: var(--sp-10, 40px);
}
.jdoe-analytics-banner [data-status-banner-actions][data-status-banner-card] {
  /* Same DS menu tier as the wide .lg-pill-lg path above — narrow DualCard
     must not inherit site glass dark defaults (.55 / 28px) or light .3.
     Exact tokens: --lg-opacity-menu:.92 · --lg-blur-menu:24px (liquid-glass /
     GlassMenu). No invented values. */
  --lg-opacity: var(--lg-opacity-menu, .92);
  --lg-blur: var(--lg-blur-menu, 24px);
  --lg-radius: 36px;
  border-radius: 36px;
  corner-shape: var(--shape, superellipse(var(--superellipse, 2.2)));
  border-shape: var(--menu-clip);
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  box-shadow: var(--lg-lift);
}
.jdoe-analytics-banner [data-status-banner-actions][data-status-banner-card]::before {
  display: block;
  inset: 0;
  padding: 0;
  border-radius: inherit;
  corner-shape: inherit;
  mask: none;
  -webkit-mask: none;
  clip-path: var(--menu-clip);
  background: var(--lg-sheen), rgb(var(--lg-surface) / var(--lg-opacity));
  backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
  -webkit-backdrop-filter: blur(var(--lg-blur)) saturate(var(--lg-saturate));
  z-index: -1;
}
.jdoe-analytics-banner [data-status-banner-actions][data-status-banner-card]::after {
  display: block;
  inset: var(--menu-rim-inset, 0px);
  padding: 0;
  border-radius: 0;
  corner-shape: initial;
  background: var(--menu-rim-light);
  -webkit-mask-box-image: none;
  mask: var(--menu-rim-mask) center / 100% 100% no-repeat;
  -webkit-mask: var(--menu-rim-mask) center / 100% 100% no-repeat;
  z-index: 2;
}
[data-theme="dark"] .jdoe-analytics-banner [data-status-banner-actions][data-status-banner-card]::before,
[data-lg-theme="dark"] .jdoe-analytics-banner [data-status-banner-actions][data-status-banner-card]::before {
  background: var(--lg-sheen), rgb(var(--lg-surface) / var(--lg-opacity));
}
.jdoe-analytics-banner [data-status-banner-actions][data-status-banner-stack] {
  flex-direction: column;
  align-items: stretch;
  gap: var(--sp-3, 12px);
  padding: var(--sp-4, 16px);
}
.jdoe-analytics-banner [data-status-banner-actions][data-status-banner-stack] [data-status-banner-copy] {
  flex: none;
  width: 100%;
}
.jdoe-analytics-banner [data-status-banner-actions][data-status-banner-stack] [data-status-banner-pair] {
  display: flex;
  width: 100%;
  gap: var(--sp-3, 12px);
  justify-content: stretch;
  flex-wrap: nowrap;
}
.jdoe-analytics-banner [data-status-banner-actions][data-status-banner-stack] [data-status-banner-pair] > * {
  flex: 1 1 0;
  min-width: 0;
}
/* Home may lack .lg-card (site glass.css dropped it); r289 card radius 36. */
.jdoe-analytics-banner .lg-card {
  --lg-radius: 36px;
}

/* Wide bar (>480, not stacked): Decline/Accept natural width with Button pad --sp-5.
   !important: beats CSP-safe base button skin and any leftover Button inline styles. */
.jdoe-analytics-banner [data-status-banner-actions]:not([data-status-banner-stack]) [data-status-banner-pair] .jdoe-analytics-banner__ds-btn,
.jdoe-analytics-banner [data-status-banner-actions]:not([data-status-banner-stack]) [data-status-banner-pair] [data-status-banner-primary],
.jdoe-analytics-banner [data-status-banner-actions]:not([data-status-banner-stack]) [data-status-banner-pair] [data-status-banner-secondary] {
  flex: 0 0 auto !important;
  width: auto !important;
  padding-inline: var(--sp-5, 20px) !important;
}

/* Narrow stack (≤480): equal-width Decline/Accept fill the card — DS
   `[data-status-banner-stack] [data-status-banner-pair] > * { flex:1 1 0 }`.
   Target the real buttons (auth wraps them in .auth-ds-control { display:contents }). */
.jdoe-analytics-banner [data-status-banner-actions][data-status-banner-stack] [data-status-banner-pair] .jdoe-analytics-banner__ds-btn,
.jdoe-analytics-banner [data-status-banner-actions][data-status-banner-stack] [data-status-banner-pair] [data-status-banner-primary],
.jdoe-analytics-banner [data-status-banner-actions][data-status-banner-stack] [data-status-banner-pair] [data-status-banner-secondary] {
  flex: 1 1 0 !important;
  min-width: 0 !important;
  width: auto !important;
  /* size 40 default pad — not wide-layout --sp-5 */
  padding-inline: 16px !important;
}

/*
  Dark menu tier — exact DS theme-dark token remaps (home lacks theme-dark.css).
  Text / TextLink / Decline: ink-a-* + btn-secondary-* (GlassMenu / StatusBanner).
  Primary Accept invert: Button.jsx primary = background var(--fill-ink) /
  color var(--text-on-ink); fill-ink → ink-800, text-on-ink → paper-50.
  theme-dark.css r130 flips those solids so primary is light fill + dark label.
  Values: styles/theme-dark.css; Button.jsx primary recipe.
*/
:is([data-theme="dark"], [data-lg-theme="dark"]) .jdoe-analytics-banner,
.jdoe-analytics-banner:is([data-theme="dark"], [data-lg-theme="dark"]) {
  --ink-a-04: rgba(247, 246, 244, 0.034);
  --ink-a-66: rgba(247, 246, 244, 0.504);
  --ink-a-76: rgba(247, 246, 244, 0.617);
  --ink-a-96: rgba(247, 246, 244, 0.885);
  --ink-800: #EBE9E6;
  --paper-50: #211F1D;
  --fill-ink: var(--ink-800);
  --text-on-ink: var(--paper-50);
  --soft-page: rgba(247, 246, 244, 0.10);
  --text-primary: var(--ink-a-96);
  --text-secondary: var(--ink-a-76);
  --text-tertiary: var(--ink-a-66);
  --text-3: var(--text-tertiary);
  --btn-secondary-edge: rgba(247, 246, 244, 0.38);
  --btn-secondary-label: var(--text-primary);
}

/* TextLink tertiary compact */
.jdoe-analytics-banner__ds-link {
  appearance: none;
  border: 0;
  margin: 0;
  padding: 0;
  background: none;
  font-weight: 500;
  font-size: var(--textlink-compact-fs, var(--fs-compact, 13px));
  line-height: var(--textlink-compact-lh, 18px);
  font-family: var(--font-ui, system-ui, sans-serif);
  color: var(--text-tertiary, rgba(35, 33, 30, 0.66));
  display: inline;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Button secondary/primary size 40 — home static classes + auth DS StatusBanner
   (React Button relies on inline styles that CSP style-src 'self' strips).
   flex/width for wide vs narrow are set in the stack/wide rules above. */
.jdoe-analytics-banner__ds-btn,
.jdoe-analytics-banner [data-status-banner-primary],
.jdoe-analytics-banner [data-status-banner-secondary] {
  height: 40px;
  min-height: 40px;
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 16px;
  border-radius: 99px;
  font: inherit;
  font-family: var(--font-ui, system-ui, sans-serif);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: -0.01em;
  position: relative;
  cursor: pointer;
  white-space: nowrap;
  appearance: none;
  margin: 0;
  border: 0;
}

.jdoe-analytics-banner__ds-btn--primary,
.jdoe-analytics-banner [data-status-banner-primary] {
  /* !important: auth React Button sets inline bg/color; CSP style-src 'self'
     strips some declarations and can leave background:transparent. */
  background: var(--fill-ink, #2b2b2b) !important;
  color: var(--text-on-ink, #fff) !important;
  font-weight: 650;
}

.jdoe-analytics-banner__ds-btn--primary:hover,
.jdoe-analytics-banner [data-status-banner-primary]:hover {
  filter: brightness(1.08);
}

.jdoe-analytics-banner__ds-btn--secondary,
.jdoe-analytics-banner [data-status-banner-secondary] {
  /* Match DS Button secondary (hairline ring) — visible on busy home hero glass. */
  background: transparent !important;
  color: var(--btn-secondary-label, var(--text-secondary, rgba(35, 33, 30, 0.76))) !important;
  font-weight: 600 !important;
  box-shadow: inset 0 0 0 var(--hairline-w, 0.5px) var(--btn-secondary-edge, var(--rule-strong, rgba(35, 33, 30, 0.28))) !important;
}

.jdoe-analytics-banner__ds-btn--secondary:hover,
.jdoe-analytics-banner [data-status-banner-secondary]:hover {
  background: var(--ink-a-04, rgba(35, 33, 30, 0.04)) !important;
}

.jdoe-analytics-banner .auth-ds-control {
  display: contents;
}

/* Auth: banner is fixed overlay — do not claim a grid row or shrink join height. */
body.auth-page.jdoe-analytics-banner-open > .jdoe-analytics-banner {
  grid-column: unset;
  grid-row: unset;
}

/* Beat auth.css inset:!important on .auth-ds-subview [data-bottom-bar]
   (body:not(:has(#auth-panel…)) carries :has() id+attr weight). */
html.jdoe-analytics-banner-open[data-auth-w1] body.auth-page:not(:has(#auth-panel[data-layout="login"][data-phase="email"])):not(:has(#auth-panel[data-layout="login"][data-phase="sending"])) .auth-ds-subview [data-bottom-bar],
html.jdoe-analytics-banner-open[data-auth-w1] body.auth-page:not(:has(#auth-panel[data-layout="login"][data-phase="email"])):not(:has(#auth-panel[data-layout="login"][data-phase="sending"])) #auth-panel [data-bottom-bar],
html.jdoe-analytics-banner-open[data-auth-w1] body.auth-page .auth-ds-subview [data-bottom-bar],
html.jdoe-analytics-banner-open[data-auth-w1] body.auth-page #auth-panel [data-bottom-bar] {
  inset: auto 0 calc(
    var(--jdoe-analytics-banner-clearance, 0px)
    + env(safe-area-inset-bottom, 0px)
  ) 0 !important;
  bottom: calc(
    var(--jdoe-analytics-banner-clearance, 0px)
    + env(safe-area-inset-bottom, 0px)
  ) !important;
}
html.jdoe-analytics-banner-open[data-auth-w1] body.auth-page:has(#auth-panel:not([data-layout="login"])) {
  padding-bottom: calc(
    var(--jdoe-analytics-banner-clearance, 0px) + env(safe-area-inset-bottom, 0px)
  );
}
