/* =====================================================================
   hepa "Clarity" layer (v29) — loaded LAST. Readability first:
   solid text colours (no see-through gradient text), stronger contrast,
   bigger type, calmer backgrounds, and phone-friendly tables and headers.
   No HTML, form or flow depends on it.
   ===================================================================== */
:root { --muted: #4F4766; --ink: #1A1230; --ink-2: #2E2545; }

/* 1. Never see-through text. Gradient-clipped text disappears on some phones and when a card is painted over it. */
h1, h2, h3, .hello h1, .hello h1 *, h1 *, .stat, .kpi-num, .tb-title, .bb-title, .hero h1, .hero h1 *, .money, .acct-num, .acct-number {
  background-image: none !important; -webkit-background-clip: border-box !important; background-clip: border-box !important;
  -webkit-text-fill-color: currentColor !important;
}
h1, h2, h3 { color: var(--ink); }
h1 em, h1 span, .hello h1 span, .hero h1 em, .hero h1 span { color: #4B2785; font-style: normal; }
.panel-royal h1, .panel-royal h2, .panel-royal h3, .panel-royal h1 *, .hero.royal h1, .mh-hero h1, .church-hero h1, .bb-daily *, .bb-present *,
.sidebar h1, .sidebar h2, .sidebar h3, .site-footer h1, .site-footer h2, .site-footer h3 { color: inherit; }
.panel-royal h1 span, .panel-royal h1 em, .mh-hero h1 span { color: #F2C14E; }

/* 2. Numbers on tiles: plain, big, dark. (A glass-card rule had painted a white box over them.) */
.stat, .kpi-num { background: none !important; border: 0 !important; box-shadow: none !important; padding: 0 !important; border-radius: 0 !important;
  color: var(--ink) !important; font-size: 1.9rem; font-weight: 800; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
.stat-strip .stat { font-size: 1.75rem; }
.stat::before, .kpi-num::before { display: none !important; }

/* 3. Text contrast */
body, .app-body { color: var(--ink); font-size: 16.5px; line-height: 1.6; }
.muted, .small.muted, .help, .divider, .hero .proof span, .sb-kicker:not(.bb-daily *) { color: #4F4766 !important; }
.help { font-size: .88rem; }
.small { font-size: .9rem; }
label, .form-field > label { color: var(--ink); }
.btn-ghost { color: #3A1680 !important; border-color: rgba(75,39,133,.38) !important; background: #fff !important; }
.chip { color: #2E2545; border-color: #CFC4E4; background: #fff; }
.chip.on, .chip[aria-pressed=true] { background: #3A1680 !important; color: #fff !important; border-color: #3A1680 !important; }
.bible-page .chip.on { color: #fff !important; }
.badge { color: #2E2545; }
.alert { color: var(--ink); background: #fff; }
.empty { color: #2E2545; }
a:not(.btn):not(.sb-link):not(.chip):not(.tile):not(.card):not(.card-link) { text-underline-offset: 3px; }
th { color: #3A1680 !important; letter-spacing: .02em !important; text-transform: none !important; font-size: .88rem !important; }
td { color: var(--ink); }

/* 4. Calmer surfaces: solid white cards on a soft page; the moving light is much fainter. */
.card, .kpi-tile, .tile, .org-tile, .church-card, .mk-card, .media-card, .plan, .plan-mini, .gs-item, .approve-card {
  background: #fff !important; -webkit-backdrop-filter: none !important; backdrop-filter: none !important; border-color: #E4DCF2 !important; }
.card::before, .kpi-tile::before, .org-tile::before, .church-card::before, .mk-card::before, .plan-mini::before { opacity: .35 !important; }
body::before { opacity: .45; }
body::after { display: none; }
.gs-item.done, .getting-started .done { background: #F1FBF5 !important; }

/* 5. Sidebar and top bars: crisp */
.sb-link { color: rgba(255,255,255,.92) !important; font-weight: 600; }
.sb-link.on { color: #fff !important; }
.sb-label, .sidebar .sb-kicker { color: rgba(255,255,255,.7) !important; }
.topbar, .site-header { background: #fff !important; }
.tb-title { color: var(--ink) !important; }

/* 6. Phones */
@media (max-width: 760px) {
  body, .app-body { font-size: 17px; }
  .page, .app-content > .page { padding-left: 14px !important; padding-right: 14px !important; }
  .list-head, .page-head, .row.between { flex-wrap: wrap; gap: 10px; }
  .list-head .btn, .page-head .btn { white-space: normal; text-align: center; line-height: 1.25; height: auto; min-height: 46px; }
  h1 { font-size: 1.65rem !important; line-height: 1.2; overflow-wrap: anywhere; }
  h2 { font-size: 1.3rem !important; }
  .card { padding: 16px !important; border-radius: 18px !important; }
  /* tables scroll sideways instead of squeezing words into single letters */
  .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .table-wrap table, .card > table, table.table { min-width: 620px; }
  th, td { white-space: nowrap; padding: 10px 12px !important; }
  td.wrap, td .wrap { white-space: normal; }
  .table-wrap::after { content: "← swipe to see more →"; display: block; text-align: center; font-size: .8rem; color: #6B6280; padding: 6px 0 2px; }
  /* filter rows stack */
  form.row, .filters, .filter-row { flex-direction: column; align-items: stretch !important; }
  form.row > *, .filters > *, .filter-row > * { width: 100%; max-width: none !important; flex: 0 0 auto !important; min-height: 0; }
  .stat-strip { grid-template-columns: 1fr 1fr; }
  .stat-strip .stat { font-size: 1.5rem; }
  .btabs a { font-size: .78rem; }
  .bb-bar { top: 58px; }
}
@media (max-width: 380px) { .stat-strip { grid-template-columns: 1fr; } }

/* 7. Voice features are switched off for now (kept in the code). */
.f-listen, .f-tip { display: none !important; }
/* light text inside dark areas stays light */
.sidebar .muted, .sidebar .small, .sidebar small, .sidebar .help, .panel-royal .muted, .panel-royal .small, .panel-royal .help, .hero.royal .muted,
.bb-daily .muted, .site-footer .muted, .site-footer .small, .mh-hero .muted, .tour .muted, [class*="night"] .muted { color: rgba(255,255,255,.82) !important; }
[data-speak] { display: none !important; }
