/* ════════════════════════════════════════════════════════════════════
   TENANT FEATURE GATES
   ════════════════════════════════════════════════════════════════════
   The tenant-loader stamps each feature flag onto <body> as a
   `data-feature-{name}="{value}"` attribute. This stylesheet hides
   sections of the UI when the corresponding flag is "false" or "none".

   Naming convention from the loader:
     features.brandedReveal        → data-feature-brandedreveal
     features.whiteLabel           → data-feature-whitelabel
     features.coBranding           → data-feature-cobranding
     features.analytics            → data-feature-analytics ("none"|"basic"|"advanced")

   Defaults: when the loader hasn't run (no tenant config fetched) the
   attributes are absent, so every selector below is a no-op and the
   whole UI renders. That's the right fail-safe — a tenant config
   failure should NEVER hide functionality from a real customer.

   Servable from <link rel="stylesheet" href="styles/tenant-feature-gates.css">
   on every tenant-themable page (scan.html, create.html, order/*).
   ════════════════════════════════════════════════════════════════════ */

/* ─── Co-branding + white-label gates ───────────────────────────────
   "Powered by SweetNote" credit on the reveal-page brand footer
   shows by default.

   DECIDED, D108 (founder 2026-09-21; was the PS4 open decision of
   2026-09-18): "Powered by SweetNote" stays on every reveal through the first
   10 brands; white-label is revisited then, together with the headless path.
   So the white-label rule below stays DEAD by design: `features.whiteLabel` is
   false on every tenant config in this repo and nothing in the product sets
   it, so this selector has never fired. The reason is methodological as much
   as commercial: a constant instrument across tenants is what makes the
   cross-tenant benchmark defensible. Do NOT switch it on, and do NOT delete it
   as dead code: it is the hook the D108 revisit starts from. */
body[data-feature-whitelabel="true"]    .scan-brand-footer-line .sn-platform,
body[data-feature-whitelabel="true"]    .scan-brand-footer-line > span:last-child {
  display: none !important;
}

/* ─── Branded reveal — logo + colors ────────────────────────────────
   When brandedReveal is false (platform default — the platform IS
   the default brand), tenant logo upload is hidden in Step 3. When
   true (B2B tenants), the upload is exposed. Today this is gated
   per-order via a checkbox; when it becomes a tenant-level flag,
   the toggle disappears too. The `.advanced-disclosure-logo`
   container in create.html holds the logo upload UI. */
body[data-feature-brandedreveal="false"] .advanced-disclosure-logo {
  /* Platform default: keep visible — senders can still upload a
     one-off logo even though brandedReveal is conceptually "off" at
     the tenant level. The flag mostly matters for tenants who
     explicitly LOCK their brand (no per-order overrides allowed). */
}
body[data-feature-brandedreveal="locked"] .advanced-disclosure-logo {
  display: none !important;
}

/* ─── Analytics tier gates ──────────────────────────────────────────
   Senders on the "none" tier see no analytics surfaces (scan/watch
   counts, sentiment summaries). "basic" gets totals; "advanced"
   gets cohort + demographic breakdowns. The order/status.html page
   has analytics rows that should hide cleanly per tier. */
body[data-feature-analytics="none"] .order-analytics-row,
body[data-feature-analytics="none"] .scan-analytics-summary {
  display: none !important;
}

/* ─── Embed mode visual marker ──────────────────────────────────────
   When the page is loaded inside an iframe (Pattern A embed), the
   tenant-loader can stamp body data-embed-mode="true" so styles can
   tighten paddings, drop the site header, etc. Not wired yet (H2
   work) but the selector is reserved here so future styles plug in
   one place. */
body[data-embed-mode="true"] .site-header,
body[data-embed-mode="true"] .site-footer,
body[data-embed-mode="true"] .scan-header,
body[data-embed-mode="true"] .scan-footer {
  display: none !important;
}
body[data-embed-mode="true"] {
  /* No frame chrome inside the iframe — let the tenant's parent
     page provide the chrome. Padding tightens up. */
  padding: 0 !important;
  background: transparent !important;
}
