/*!
 * ohm-ui-optimizer.css — mobile-first UI normalization + seamless-PWA layer + donation invite UI
 * for all tongue-analysis.com landing pages and the VERA/OHM PWAs.
 *
 * Two parts:
 *   1) A conservative global normalization that makes every existing page render well on phones
 *      (fluid type, ≥44px touch targets, safe-area insets, no horizontal overflow, PWA polish).
 *      It deliberately avoids restyling page content so it can't regress heterogeneous pages
 *      (some use Tailwind, some hand-rolled CSS).
 *   2) A fully namespaced (.ohm-don*) donation-invite sheet + roadmap that never collides with
 *      page styles.
 *
 * Design tokens mirror the existing suite: gold #d4af37, cyan #00D8FF, ink #0a0a0a.
 */

:root {
  --ohm-gold: #d4af37;
  --ohm-gold-soft: #e8c75a;
  --ohm-cyan: #00d8ff;
  --ohm-teal: #2dd4bf;
  --ohm-ink: #0a0a0a;
  --ohm-ink-2: #0f0f19;
  --ohm-text: #eeeeee;
  --ohm-muted: #9aabbb;
  --ohm-safe-top: env(safe-area-inset-top, 0px);
  --ohm-safe-bottom: env(safe-area-inset-bottom, 0px);
  --ohm-safe-left: env(safe-area-inset-left, 0px);
  --ohm-safe-right: env(safe-area-inset-right, 0px);
}

/* ---------- 1. Conservative global mobile-first normalization ---------- */

html {
  -webkit-text-size-adjust: 100%;          /* stop iOS auto-zoom inflating text */
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  -webkit-tap-highlight-color: transparent; /* kill the grey tap flash */
}

/* Never let a stray wide element cause a horizontal scrollbar on phones. */
html, body { overflow-x: clip; }

/* Media should always fit its column on small screens. */
img, svg, video, canvas, iframe { max-width: 100%; height: auto; }

/* Comfortable, accessible focus ring (keyboard users) without hurting mouse users. */
:focus-visible {
  outline: 2px solid var(--ohm-gold);
  outline-offset: 2px;
  border-radius: 4px;
}

/* Minimum 44×44px touch targets for the common interactive elements only —
   scoped so we don't bloat inline text links. */
@media (pointer: coarse) {
  button,
  a.btn, .btn,
  a.nav-link, .nav-link,
  [role="button"],
  input[type="button"], input[type="submit"] {
    min-height: 44px;
  }
}

/* Honour the device notch / home indicator on the common sticky chrome. */
.nav-header, header.nav-header {
  padding-top: calc(14px + var(--ohm-safe-top));
  padding-left: calc(24px + var(--ohm-safe-left));
  padding-right: calc(24px + var(--ohm-safe-right));
}
footer {
  padding-bottom: calc(40px + var(--ohm-safe-bottom));
}

/* Seamless PWA: when launched standalone, give the body top breathing room for the
   status bar and a touch less hero padding so it feels app-native, not web-in-a-frame. */
@media (display-mode: standalone), (display-mode: fullscreen) {
  body { padding-top: var(--ohm-safe-top); }
  header.hero { padding-top: 28px; }
  /* External-site links are usually noise inside an installed app — soften them. */
  .ohm-hide-in-pwa { display: none !important; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

/* ---------- 2. Donation invite sheet (namespaced) ---------- */

/* Self-contained sizing: never inherit the host page's box-sizing. */
.ohm-don-overlay, .ohm-don-overlay *, .ohm-don-fab { box-sizing: border-box; }

.ohm-don-overlay {
  position: fixed;
  inset: 0;
  z-index: 2147483000;          /* above app modals, below nothing of ours */
  background: rgba(4, 4, 8, 0.72);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  display: flex;
  align-items: flex-end;        /* bottom-sheet on mobile */
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s ease;
  font-family: Inter, system-ui, -apple-system, sans-serif;
}
.ohm-don-overlay.ohm-don-in { opacity: 1; }

.ohm-don-sheet {
  width: 100%;
  max-width: 460px;
  max-height: 92vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: linear-gradient(180deg, #14141f 0%, var(--ohm-ink-2) 60%, #0b0b12 100%);
  border: 1px solid rgba(212, 175, 55, 0.28);
  border-bottom: none;
  border-radius: 22px 22px 0 0;
  padding: 22px 20px calc(20px + var(--ohm-safe-bottom));
  color: var(--ohm-text);
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.6);
  transform: translateY(18px);
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ohm-don-overlay.ohm-don-in .ohm-don-sheet { transform: translateY(0); }

/* Desktop: become a centred card with full rounding. */
@media (min-width: 640px) {
  .ohm-don-overlay { align-items: center; padding: 20px; }
  .ohm-don-sheet { border-radius: 22px; border-bottom: 1px solid rgba(212, 175, 55, 0.28); transform: scale(0.97); }
  .ohm-don-overlay.ohm-don-in .ohm-don-sheet { transform: scale(1); }
}

.ohm-don-grip {
  width: 40px; height: 4px; border-radius: 4px;
  background: rgba(255, 255, 255, 0.18);
  margin: -6px auto 14px;
}
@media (min-width: 640px) { .ohm-don-grip { display: none; } }

.ohm-don-heart { font-size: 2.4rem; text-align: center; line-height: 1; margin-bottom: 6px; }
.ohm-don-title {
  font-size: 1.32rem; font-weight: 800; text-align: center; margin: 0 0 6px;
  background: linear-gradient(135deg, var(--ohm-gold-soft), #fff);
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.ohm-don-sub { font-size: 0.92rem; color: var(--ohm-muted); text-align: center; line-height: 1.5; margin: 0 auto 16px; max-width: 360px; }

.ohm-don-cta {
  display: block; width: 100%; box-sizing: border-box;
  padding: 15px 20px; border: none; border-radius: 14px;
  background: linear-gradient(135deg, var(--ohm-gold), #b8860b);
  color: #000; font-weight: 800; font-size: 1.04rem; text-align: center;
  text-decoration: none; cursor: pointer;
  box-shadow: 0 6px 22px rgba(212, 175, 55, 0.38);
  transition: transform 0.12s ease, box-shadow 0.2s ease;
}
.ohm-don-cta:active { transform: scale(0.98); }
.ohm-don-cta small { display: block; font-weight: 600; font-size: 0.72rem; opacity: 0.72; margin-top: 2px; }

/* The "what you get" unlock block */
.ohm-don-unlock {
  margin: 18px 0 6px; padding: 16px;
  background: rgba(45, 212, 191, 0.06);
  border: 1px solid rgba(45, 212, 191, 0.22);
  border-radius: 14px;
}
.ohm-don-unlock h4 { margin: 0 0 8px; font-size: 0.98rem; color: var(--ohm-teal); display: flex; align-items: center; gap: 7px; }
.ohm-don-unlock ul { margin: 0; padding-left: 4px; list-style: none; }
.ohm-don-unlock li { font-size: 0.88rem; color: #d6e4e2; line-height: 1.5; padding: 3px 0 3px 24px; position: relative; }
.ohm-don-unlock li::before { content: "✓"; position: absolute; left: 2px; top: 3px; color: var(--ohm-teal); font-weight: 800; }

.ohm-don-price {
  text-align: center; margin: 14px 0 4px; font-size: 0.9rem; color: var(--ohm-muted);
}
.ohm-don-price strong { color: var(--ohm-gold); font-size: 1.05rem; }

/* Sovereign Tools chips */
.ohm-don-tools { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin: 12px 0 4px; }
.ohm-don-chip {
  font-size: 0.74rem; padding: 5px 11px; border-radius: 20px;
  background: rgba(255, 255, 255, 0.04); border: 1px solid rgba(212, 175, 55, 0.2);
  color: #d8cba0; white-space: nowrap;
}

/* Roadmap (collapsible) */
.ohm-don-roadmap { margin-top: 16px; border-top: 1px solid rgba(255, 255, 255, 0.08); padding-top: 12px; }
.ohm-don-roadmap > summary {
  cursor: pointer; list-style: none; font-size: 0.9rem; font-weight: 700; color: var(--ohm-gold);
  display: flex; align-items: center; gap: 7px; padding: 4px 0;
}
.ohm-don-roadmap > summary::-webkit-details-marker { display: none; }
.ohm-don-roadmap > summary::after { content: "▾"; margin-left: auto; transition: transform 0.2s ease; color: var(--ohm-muted); }
.ohm-don-roadmap[open] > summary::after { transform: rotate(180deg); }
.ohm-don-rmlist { margin: 10px 0 2px; padding: 0; list-style: none; }
.ohm-don-rmlist li {
  position: relative; padding: 6px 0 10px 22px; font-size: 0.85rem; color: #cdd6de; line-height: 1.45;
  border-left: 1.5px solid rgba(212, 175, 55, 0.25); margin-left: 6px;
}
.ohm-don-rmlist li::before {
  content: ""; position: absolute; left: -5.5px; top: 11px; width: 9px; height: 9px; border-radius: 50%;
  background: var(--ohm-ink-2); border: 2px solid var(--ohm-gold);
}
.ohm-don-rmlist li[data-done]::before { background: var(--ohm-teal); border-color: var(--ohm-teal); }
.ohm-don-rmlist li[data-now]::before { background: var(--ohm-gold); border-color: var(--ohm-gold); box-shadow: 0 0 0 3px rgba(212,175,55,0.25); }
.ohm-don-rmlist b { color: #fff; font-weight: 700; }
.ohm-don-rmtag { font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.04em; color: var(--ohm-muted); margin-left: 6px; }

/* Email-capture (after donating) + footer actions */
.ohm-don-after { margin-top: 16px; }
.ohm-don-after label { display: block; font-size: 0.78rem; color: var(--ohm-muted); margin-bottom: 5px; }
.ohm-don-input {
  width: 100%; box-sizing: border-box; padding: 12px; border-radius: 11px;
  border: 1px solid #333; background: #111; color: var(--ohm-text); font-size: 0.95rem;
}
.ohm-don-input:focus { border-color: var(--ohm-gold); outline: none; }
.ohm-don-confirm {
  width: 100%; margin-top: 9px; padding: 13px; border: 0; border-radius: 12px;
  background: var(--ohm-teal); color: #012; font-weight: 800; font-size: 0.95rem; cursor: pointer;
}
.ohm-don-msg { font-size: 0.8rem; min-height: 18px; margin-top: 8px; text-align: center; color: var(--ohm-teal); }
.ohm-don-dismiss {
  display: block; width: 100%; margin-top: 10px; padding: 9px; border: 0; background: transparent;
  color: #6b7785; font-size: 0.82rem; cursor: pointer;
}
.ohm-don-dismiss:hover { color: #98a4b2; }

/* Tiny persistent "Support" pill the optimizer can drop bottom-right for manual giving. */
/* Hidden by default — the JS reveals it AFTER analysis lands (post-result), so it never */
/* collides with the camera shutter or capture-coach overlay during scanning. */
.ohm-don-fab {
  display: none;
  position: fixed; right: 14px; bottom: calc(14px + var(--ohm-safe-bottom)); z-index: 2147482000;
  align-items: center; gap: 6px;
  padding: 10px 15px; border: none; border-radius: 30px; cursor: pointer;
  background: rgba(15, 15, 25, 0.82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(212, 175, 55, 0.35); color: var(--ohm-gold);
  font-family: Inter, system-ui, sans-serif; font-weight: 700; font-size: 0.82rem;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
}
/* Revealed via .ohm-don-fab-visible class added by the JS after results are shown. */
.ohm-don-fab.ohm-don-fab-visible { display: inline-flex; }
.ohm-don-fab:active { transform: scale(0.96); }
